/* Global buttons used by multiple screens */
.copy-id-button {
  border: 2px solid black;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--orange);
  color: black;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: none;
}

.copy-id-button:hover {
  background: #ffb674;
}

.copy-id-button:disabled {
  opacity: 0.6;
  cursor: default;
}
.overflow-menu {
  position: relative;
  display: inline-flex;
}

.overflow-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  color: black;
  font-size: 16px;
  cursor: pointer;
  border: none;
  box-shadow: none;
  padding: 0;
}

.overflow-menu-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.overflow-menu-button .fa-ellipsis,
.overflow-menu-button .fa-spinner {
  pointer-events: none;
}

.overflow-menu-list {
  position: absolute;
  right: 0;
  bottom: calc(100%);
  background: #fff;
  border: 1px solid var(--separator-gray);
  border-radius: 12px;
  display: none;
  min-width: 160px;
  padding: 6px 0;
  z-index: 20;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.overflow-menu-open .overflow-menu-list {
  display: flex;
  flex-direction: column;
}

.overflow-menu-item {
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

.overflow-menu-item:hover,
.overflow-menu-item:focus {
  background: #f5f5f5;
  outline: none;
}

.overflow-menu-item-danger {
  color: var(--red);
}

.overflow-menu-item-danger:hover,
.overflow-menu-item-danger:focus {
  background: #fde8e8;
}
.recipe-author-button {
  border: 0;
  background: #f1f5ff;
  color: #4164d9;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-right: 4px;
  cursor: pointer;
}

.recipe-author-button:hover {
  background: #e4ecff;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'SF Pro Rounded','Work Sans', Arial, Helvetica, sans-serif;
}

:root {
  --yellow: #FFBF26;
  --blue: #6392EE;
  --orange: #FF9D5E;
  --red: #FF6464;
  --green: #3AC884;
  --purple: #BF67FF;
  --teal: #3AACC8;
  --black: #1B1B1B;
  --dark-gray: #666666;
  --light-gray: #A8A8A8;
  --separator-gray: #EFEFEF;
}

/* Light grid background: black lines at 20% opacity, 16px tile size */
body {
	background-color: #fff;
	background-image:
		linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
	background-size: 16px 16px;
}
html, body {
	height: 100%;
}

h1 {
  margin-top: 8px;
  margin-bottom: 16px;
}

p {
  margin-top: 8px;
  margin-bottom: 8px;
}

body {
	min-height: 100vh;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

#content {
  width: min(1600px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  margin-top: 32px;
  padding-bottom: 48px; /* allow scroll past bottom content */
}

/* Home (main) screen tweaks */
#screen-main {
  align-items: center; /* center contents horizontally */
}
#screen-main h1 {
  text-align: center;
  margin-bottom: 0px;
  font-size: 2.5em;
}
#screen-main .main-logged-in-user {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--dark-gray);
}
#screen-main p {
  text-align: center;
  max-width: 430px;
  color: var(--light-gray);
}

button {
  padding: 8px;
  border: 2px solid black;
  border-radius: 8px;
  color: black;
  font-weight: bold;
  box-shadow: 3px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  user-select: none;
}
button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px rgba(0, 0, 0, 0.2);
}
button.primary {
  background: black;
  color: white;
}

div.screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

#screen-please-wait {
  align-items: center;
  justify-content: flex-start;
  /* This is a bit of a hack to make it vertically centered despite the
     container's top margin. */
  height: calc(100vh - 32px);
  padding-top: calc((100vh - 32px) / 3);
}

#please-wait-message {
  font-size: 24px;
  font-weight: bold;
  color: var(--dark-gray);
}

#screen-posts {
  padding-left: 0;
  padding-right: 0;
}

#screen-stats {
  padding-left: 0;
  padding-right: 0;
}

#screen-stats h2 {
  margin-bottom: 4px;
}

#screen-firstrun {
  padding-left: 0;
  padding-right: 0;
}

.screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.screen-topbar h1 {
  margin: 0;
  line-height: 1.1;
}

.screen-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: none;
}

.transactions-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.transactions-input-row input[type="text"] {
  flex: 1;
  min-width: 220px;
}

.transactions-results {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.transactions-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.transactions-summary-item {
  border: 1px solid var(--separator-gray);
  border-radius: 12px;
  background: #fff;
  padding: 12px 16px;
  min-width: 160px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.transactions-summary-label {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--dark-gray);
  margin-bottom: 4px;
}

.transactions-summary-value {
  font-size: 20px;
  font-weight: 700;
  font-family: 'Roboto Mono', monospace;
}

.transactions-status {
  color: var(--dark-gray);
}

.transactions-table-wrapper {
  overflow-x: auto;
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--separator-gray);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.transactions-table thead th {
  text-align: left;
  font-size: 13px;
  color: var(--dark-gray);
  background: #fafafa;
  padding: 10px 12px;
  border-bottom: 1px solid var(--separator-gray);
}

.transactions-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f4f4f4;
  font-size: 14px;
}

.transactions-table tbody tr:last-child td {
  border-bottom: none;
}

.transactions-table .tx-num {
  text-align: right;
  font-family: 'Roboto Mono', monospace;
}

.transactions-table .tx-media {
  width: 70px;
}

.transactions-table tbody tr.positive td.tx-num {
  color: #1e8f4b;
}

.transactions-table tbody tr.negative td.tx-num {
  color: #c7443a;
}

.transactions-media-thumb {
  width: 50px;
  max-width: 50px;
  height: auto;
  border-radius: 6px;
  display: block;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.notifications-body {
  gap: 16px;
}

.notifications-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.notifications-input-row input[type="text"] {
  flex: 1;
  min-width: 220px;
}

.notifications-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--dark-gray);
  user-select: none;
}

.notifications-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.notifications-status {
  color: var(--dark-gray);
}

.notifications-table-wrapper {
  overflow-x: auto;
}

.notifications-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--separator-gray);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.notifications-table tbody tr.notification-row td,
.notifications-table tbody tr.notification-details-row td {
  border-bottom: 1px solid #f4f4f4;
}

.notifications-table tbody tr:last-child td {
  border-bottom: none;
}

.notification-row td {
  padding: 12px;
  vertical-align: middle;
}

.notification-text-cell {
  width: 100%;
}

.notification-text {
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.notification-image-cell {
  width: 80px;
  text-align: center;
}

.notification-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  background: #f5f5f5;
  display: inline-block;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.16);
}

.notification-image-missing {
  color: var(--light-gray);
  font-style: italic;
}

.notification-details-row td {
  padding: 0 12px 12px;
}

.notification-details {
  font-size: 12px;
  color: var(--light-gray);
  line-height: 1.4;
}

.notifications-hide-details .notification-details-row {
  display: none;
}

.notification-hidden {
  opacity: 0.3;
}

.credits-body {
  gap: 20px;
  max-width: 720px;
}

.credits-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
}

.credits-field,
.credits-checkbox-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.credits-field label {
  font-weight: 600;
  color: #202124;
}

.credits-field input,
.credits-field select,
.credits-field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.credits-field textarea {
  resize: vertical;
  min-height: 140px;
}

.credits-field input:focus-visible,
.credits-field select:focus-visible,
.credits-field textarea:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
  outline: none;
}

.credits-checkbox-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #202124;
}

.credits-checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.credits-actions {
  display: flex;
  gap: 12px;
}

#credits-execute {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 146, 238, 0.2);
  transition: background 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

#credits-execute:hover:not(:disabled) {
  filter: brightness(0.9);
  box-shadow: 0 6px 16px rgba(99, 146, 238, 0.25);
}

#credits-execute:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.credits-progress,
.credits-status {
  font-size: 14px;
}

.credits-progress {
  color: #5f6368;
}

.credits-status {
  margin-top: 4px;
}

.credits-status-success {
  color: #0b7a07;
}

.credits-status-error {
  color: var(--red);
}

.revenuecat-body {
  flex-direction: column;
  gap: 24px;
}

.revenuecat-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.revenuecat-form input[type="text"] {
  min-width: 260px;
  padding: 8px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  font-size: 14px;
}

.revenuecat-form input[type="text"]:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
  outline: none;
}

#revenuecat-load {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

#revenuecat-load:hover:not(:disabled) {
  filter: brightness(0.9);
  box-shadow: 0 4px 12px rgba(99, 146, 238, 0.2);
}

#revenuecat-load:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.revenuecat-status {
  font-size: 14px;
  color: #5f6368;
}

.revenuecat-status-info {
  color: #5f6368;
}

.revenuecat-status-error {
  color: var(--red);
}

.revenuecat-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.revenuecat-section[hidden] {
  display: none;
}

.revenuecat-entitlement {
  font-size: 14px;
  color: #1a1f36;
}

.revenuecat-entitlement {
  margin-bottom: 0;
}

.revenuecat-entitlement-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.revenuecat-view-button {
  padding: 0.5rem 1rem;
  width: auto;
  flex-shrink: 0;
}

.revenuecat-pre {
  background: #f5f5f5;
  padding: 1rem;
  border: 1px solid var(--separator-gray);
  border-radius: 12px;
  padding: 16px;
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.revenuecat-events-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--separator-gray);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.revenuecat-events-table thead th {
  text-align: left;
  padding: 12px;
  background: #f7f8fa;
  font-size: 13px;
  color: #5f6368;
  border-bottom: 1px solid #e5e7eb;
}

.revenuecat-events-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 13px;
}

.revenuecat-events-table tbody tr:last-child td {
  border-bottom: none;
}

.revenuecat-empty {
  font-size: 14px;
  color: #5f6368;
}

.revenuecat-events-table a {
  color: var(--blue);
  text-decoration: none;
}

.revenuecat-events-table a:hover {
  text-decoration: underline;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-right label {
  font-size: 14px;
  color: var(--dark-gray);
}

/* Mobile tweaks for Stats toolbar */
@media (max-width: 600px) {
  /* Make top bar two rows on mobile for cleaner layout */
  .screen-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .topbar-left {
    justify-content: flex-start;
    width: 100%;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }
  /* Hide Max docs on small screens */
  .topbar-right label[for="stats-limit"],
  #stats-limit {
    display: none;
  }
  /* Compact Range control */
  .topbar-right label[for="stats-range"] {
    font-size: 12px;
  }
  #stats-range {
    font-size: 12px;
    padding: 3px 5px;
  }
  #stats-refresh {
    padding: 4px 6px;
    font-size: 12px;
  }
  .screen-topbar h1 { font-size: 20px; }
  /* Compact back button: show only arrow */
  .screen-topbar .back-to-main {
    font-size: 0; /* hide text */
    padding: 4px 6px;
    border-width: 0;
    box-shadow: none;
    background: transparent;
  }
  .screen-topbar .back-to-main::before {
    content: '←';
    font-size: 16px;
    line-height: 1;
    display: inline-block;
  }

  /* Posts toolbar: mobile-friendly grid layout */
  #screen-posts .topbar-right {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: row dense;
    gap: 6px;
    width: 100%;
  }
  /* Users toolbar: mobile-friendly grid layout */
  #screen-users .topbar-right {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: row dense;
    gap: 6px;
    width: 100%;
  }
  /* Hide posts labels on mobile to save space */
  #screen-posts .topbar-right label[for="posts-query"],
  #screen-posts .topbar-right label[for="posts-limit"],
  #screen-posts .topbar-right label[for="posts-status"],
  #screen-posts .topbar-right label[for="posts-user"],
  #screen-posts .topbar-right label[for="posts-query-arg"] {
    display: none;
  }
  /* Make controls compact and full-width where helpful */
  #posts-query,
  #posts-query-arg,
  #posts-limit,
  #posts-query-run,
  #posts-status {
    font-size: 12px;
    padding: 4px 6px;
    width: 100%;
  }
  #users-search,
  #users-sort,
  #users-limit,
  #users-refresh {
    font-size: 12px;
    padding: 4px 6px;
    width: 100%;
  }
  /* Place arg and Run on their own rows after first row */
  #posts-user-filter,
  #posts-query-arg,
  #posts-query-run {
    grid-column: 1 / -1;
    order: 1;
  }
  /* First row: Published, Most Recent, Limit side-by-side equal width */
  #posts-status { grid-column: 1; width: 100%; max-width: none; order: 0; }
  #posts-query { grid-column: 2; width: 100%; max-width: none; order: 0; }
  #posts-limit { grid-column: 3; width: 100%; max-width: none; order: 0; }
}

#posts-query {
  margin-right: 16px;
}

#posts-status {
  margin-right: 16px;
}

#posts-limit {
  margin-right: 16px;
}

/* Posts controls: unify heights and hide "User:" label */
label[for="posts-user"],
label[for="posts-user-filter"],
label[for="posts-query-arg"] {
  display: none;
}

/* Users table */
#users-container {
  margin-top: 12px;
}
#users-container table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--separator-gray);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}
#users-container thead th {
  text-align: left;
  font-size: 13px;
  color: var(--dark-gray);
  background: #fafafa;
  padding: 10px 12px;
  border-bottom: 1px solid var(--separator-gray);
  user-select: none;
  cursor: pointer;
}
#users-container tbody td {
  font-size: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid #f4f4f4;
}
#users-container tbody tr:hover {
  background: #fffdf3;
}
#users-container .cell-right { text-align: right; }
#users-container .cell-mono { font-family: 'Roboto Mono', monospace; }
#users-container .users-uname-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  display: inline;
  line-height: inherit;
  text-align: left;
  box-shadow: none;
}
#users-container .users-uname-button::-moz-focus-inner {
  border: 0;
  padding: 0;
}
#users-container .users-uname-button:hover,
#users-container .users-uname-button:focus,
#users-container .users-uname-button:active {
  text-decoration: underline;
}
#users-container .users-uname-button:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}
#users-container a.users-posts-link,
#users-container a.users-posts-link:visited {
  color: inherit;
  text-decoration: none;
}
#users-container a.users-posts-link:hover,
#users-container a.users-posts-link:focus,
#users-container a.users-posts-link:active {
  text-decoration: underline;
}

.users-account-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 900;
  overflow-y: auto;
}

.users-account-overlay.visible {
  display: flex;
}

body.users-account-overlay-open {
  overflow: hidden;
}

body.users-credit-ops-open {
  overflow: hidden;
}

.users-account-overlay-panel {
  background: #fff;
  width: min(820px, calc(100vw - 32px));
  max-height: min(90vh, calc(100vh - 64px));
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.users-account-overlay-panel:focus-visible {
  outline: 2px solid var(--dark-gray);
  outline-offset: 4px;
}

.users-account-overlay-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.users-account-overlay-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}

.users-account-overlay-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

.users-account-overlay-close:focus-visible {
  outline: 2px solid var(--dark-gray);
  outline-offset: 2px;
}

.users-account-overlay-header {
  padding: 26px 28px 14px 28px;
  border-bottom: 1px solid #ededed;
}

.users-account-overlay-header h2 {
  margin: 0 0 14px 0;
  font-size: 20px;
}

.users-account-overlay-summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  font-size: 14px;
}

.users-account-overlay-summary-label {
  color: var(--dark-gray);
  font-weight: 600;
}

.users-account-overlay-summary-value {
  color: #111;
  word-break: break-word;
}

.users-account-overlay-summary-value code {
  background: #f3f3f3;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
}

.users-account-overlay-body {
  padding: 18px 28px 48px 28px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
}

.users-account-overlay-section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.users-account-overlay-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.users-account-field-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 6px 16px;
  align-items: start;
}

.users-account-field-key {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  color: var(--dark-gray);
  word-break: break-all;
}

.users-account-field-value {
  font-size: 13px;
  color: #111;
  white-space: pre-wrap;
  word-break: break-word;
}

.users-account-field-value pre {
  margin: 0;
  background: #f7f7f7;
  padding: 8px;
  border-radius: 8px;
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.users-account-overlay-status {
  font-size: 13px;
  color: var(--dark-gray);
}

.users-account-overlay-error {
  color: #d93025;
}

.users-account-overlay-footer {
  padding: 16px 28px 24px 28px;
  border-top: 1px solid #ededed;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.users-account-credit-button {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.25);
  transition: background 0.15s ease, filter 0.15s ease;
}

.users-account-credit-button:hover:not(:disabled) {
  filter: brightness(0.9);
}

.users-account-credit-button:focus-visible {
  outline: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.4);
}

.users-account-credit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.users-account-delete-button {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(217, 48, 37, 0.25);
  transition: background 0.15s ease, filter 0.15s ease;
}

.users-account-delete-button:hover:not(:disabled) {
  filter: brightness(0.9);
}

.users-account-delete-button:focus-visible {
  outline: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.4);
}

.users-account-delete-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.users-credit-ops-panel {
  width: min(520px, 95vw);
}

.users-credit-ops-inner {
  min-height: 0;
}

.users-credit-ops-header {
  padding-bottom: 12px;
}

.users-credit-ops-target {
  margin-top: 6px;
  color: #5f6368;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.users-credit-ops-target code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
}

.users-credit-ops-body {
  padding: 0 28px 8px 28px;
}

.users-credit-ops-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.users-credit-ops-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.users-credit-ops-label {
  font-weight: 600;
  color: #202124;
}

.users-credit-ops-select,
.users-credit-ops-amount,
.users-credit-ops-desc {
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.users-credit-ops-select:focus-visible,
.users-credit-ops-amount:focus-visible,
.users-credit-ops-desc:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
  outline: none;
}

.users-credit-ops-checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.users-credit-ops-checkbox-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #202124;
}

.users-credit-ops-checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.users-credit-ops-amount:disabled {
  background: #f3f3f3;
  color: #80868b;
}

.users-credit-ops-warning {
  font-size: 12px;
  color: var(--orange);
}

.users-credit-ops-footer {
  justify-content: flex-end;
}

.users-credit-ops-cancel {
  background: transparent;
  border: 1px solid #d0d0d0;
  color: #202124;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.users-credit-ops-cancel:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
}

.users-credit-ops-cancel:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.users-credit-ops-cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.users-credit-ops-confirm {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.25);
  transition: background 0.15s ease;
}

.users-credit-ops-confirm:hover:not(:disabled) {
  background: var(--blue);
}

.users-credit-ops-confirm:focus-visible {
  outline: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.4);
}

.users-credit-ops-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}
#posts-query-arg,
#posts-user-filter,
#recipes-user-filter {
  font-size: 14px;
  padding: 6px 10px;
  line-height: 1.2;
  height: 34px;
  box-sizing: border-box;
}

#posts-user-filter,
#recipes-user-filter {
  padding-right: 30px; /* space for clear button */
}

#posts-query,
#posts-status,
#posts-limit,
#recipes-status,
#recipes-sort,
#recipes-limit,
#users-search,
#users-sort,
#users-limit,
#users-refresh {
  font-size: 14px;
  padding-top: 6px;
  padding-bottom: 6px;
  height: 34px;
  box-sizing: border-box;
}

.input-with-clear {
  position: relative;
  display: flex;
  align-items: center;
}

.clear-button {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--dark-gray);
  padding: 5px;
  box-shadow: none;
  z-index: 2;
}

.clear-button:hover {
  color: var(--black);
}

#sign-in, #sign-out-from-nope {
  margin-top: 32px;
  align-self: center;
}

#main-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-self: center;
  margin-top: 10px;
  width: calc(4 * (128px + 16px));
  max-width: 100%;
}

#secret-menu {
  margin-top: 20px;
}

/* Secret menu: make Tagged Posts button green */
#secret-grid .main-grid-button[data-screen-name="tagged-posts"] {
  background: var(--green);
}

.main-grid-button {
  width: 128px;
  height: 128px;
  margin: 8px;
  background: rgb(255, 218, 10);
}

@media (max-width: 600px) {
  #main-grid {
    width: 100%;
  }

  .main-grid-button {
    width: calc(33.333% - 12px);
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 6px;
    font-size: 14px;
  }

  .main-grid-button-icon {
    font-size: 36px;
  }

  .access-controls-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .access-controls-toolbar button {
    width: auto;
    min-width: 0;
    flex: none;
  }

  .access-controls-table th,
  .access-controls-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Active home boxes colors in order */
#screen-main #main-grid .main-grid-button:nth-child(7n + 1) { background: var(--yellow); }
#screen-main #main-grid .main-grid-button:nth-child(7n + 2) { background: var(--blue); }
#screen-main #main-grid .main-grid-button:nth-child(7n + 3) { background: var(--orange); }
#screen-main #main-grid .main-grid-button:nth-child(7n + 4) { background: var(--red); }
#screen-main #main-grid .main-grid-button:nth-child(7n + 5) { background: var(--green); }
#screen-main #main-grid .main-grid-button:nth-child(7n + 6) { background: var(--purple); }
#screen-main #main-grid .main-grid-button:nth-child(7n + 7) { background: var(--teal); }

.main-grid-button-icon {
  font-size: 48px;
  margin-bottom: 2px;
}

.back-to-main {
  align-self: flex-start;
  margin-bottom: 16px;
}

/* When back button is in a topbar, don't add extra bottom margin */
.screen-topbar .back-to-main {
  margin-bottom: 0;
}

.chart-section {
  margin-top: 16px;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 900px) {
  .chart-grid { grid-template-columns: repeat(3, 1fr); }
}

.chart-card {
  border: 1px solid var(--separator-gray);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.chart-card + .chart-card {
  margin-top: 0;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: 6px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 8px 0 16px 0;
}
@media (min-width: 700px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}
/* On very small screens, show KPIs as a single 4-item row */
@media (max-width: 699px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  /* Show number before/above label */
  .kpi-card { align-items: center; }
  .kpi-card .kpi-value { order: 0; }
  .kpi-card .kpi-label { order: 1; }
}

.kpi-card {
  border: 1px solid var(--separator-gray);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-label {
  color: var(--dark-gray);
  font-size: 14px;
  font-weight: 600;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
}

.chart {
  width: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
}

.chart-svg {
  width: 100%;
  height: auto;
}

/* Simple loading spinner for charts */
@keyframes chartspin {
  to { transform: rotate(360deg); }
}
.chart-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--black);
  border-top-color: transparent;
  border-radius: 50%;
  animation: chartspin 0.8s linear infinite;
  margin: 0 auto;
}

input[type="text"] {
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
  padding: 8px;
  border-radius: 4px;
  border: 2px solid black;
  box-shadow: 2px 2px rgba(0, 0, 0, 0.2);
}

#console-output {
  width: 100%;
  border: 1px solid black;
  padding: 8px;
  border-radius: 4px;
  box-shadow: 2px 2px rgba(0, 0, 0, 0.2);
  background: #f0f0f0;
  margin-top: 16px;
  height: 300px;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Roboto Mono', monospace;
}

/* Popup scrim and window */
#popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#popup-window {
  background: #fff;
  border: 2px solid black;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  padding: 32px 24px 24px 24px;
  min-width: 280px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#popup-buttons {
  display: flex;
  gap: 8px;
  justify-content: end;
}

#popup-buttons button {
  min-width: 80px;
}

select {
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 2px solid black;
  box-shadow: 2px 2px rgba(0, 0, 0, 0.2);
}

#posts-container {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 16px;
}

#tagged-posts-container {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 16px;
}

#firstrun-container {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 16px;
}

#recipes-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 600px) {
  #posts-container { grid-template-columns: repeat(2, 1fr); }
  #firstrun-container { grid-template-columns: repeat(2, 1fr); }
  #tagged-posts-container { grid-template-columns: repeat(2, 1fr); }
}
#recipes-container.recipes-cols-1,
#recipes-container.recipes-cols-2,
#recipes-container.recipes-cols-3 {
  grid-template-columns: 1fr;
}

#recipes-columns {
  min-width: 120px;
}

@media (min-width: 900px) {
  #recipes-container.recipes-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #recipes-container.recipes-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .recipes-columns-select {
    display: none;
  }
}

.recipes-columns-select {
  font-size: 14px;
}

@media (min-width: 900px) {
  #posts-container { grid-template-columns: repeat(3, 1fr); }
  #firstrun-container { grid-template-columns: repeat(3, 1fr); }
  #tagged-posts-container { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  #posts-container { grid-template-columns: repeat(4, 1fr); }
  #firstrun-container { grid-template-columns: repeat(4, 1fr); }
  #tagged-posts-container { grid-template-columns: repeat(4, 1fr); }
}
#recipes-container.recipes-cols-1 {
  grid-template-columns: 1fr;
}

#recipes-container.recipes-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#recipes-container.recipes-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 1500px) {
  #posts-container { grid-template-columns: repeat(5, 1fr); }
  #firstrun-container { grid-template-columns: repeat(5, 1fr); }
  #tagged-posts-container { grid-template-columns: repeat(5, 1fr); }
}

.post-item {
  border: 1px solid var(--separator-gray);
  border-radius: 20px;
  width: auto;
  margin: 8px;
  padding: 12px;
  padding-bottom: 56px; /* reserve space for bottom-right actions */
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  min-width: 0; /* prevent overflow in grid columns */
  position: relative; /* for bottom-left badge positioning */
}

.post-item-featured {
  outline: 1px solid #FFBF26;
  position: relative;
}

.post-featured-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fff8dc;
  color: #c48d00;
  font-weight: 600;
  font-size: 14px;
  cursor: default;
  user-select: none;
  box-shadow: 2px 2px rgba(0, 0, 0, 0.1);
  transition: background 0.2s ease, color 0.2s ease;
}

.post-featured-pill:focus {
  outline: 2px solid #ffbf26;
  outline-offset: 2px;
}

.post-featured-pill.post-featured-pill--expanded {
  background: #fff1a8;
}

.post-featured-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--orange);
  color: black;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 2px 2px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform-origin: bottom center;
}

.post-featured-pill.post-featured-pill--expanded .post-featured-tooltip,
.post-featured-pill:focus .post-featured-tooltip {
  opacity: 1;
  transform: translate(-50%, -4px);
}

.post-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: absolute;
  right: 12px;
  bottom: 12px;
  align-items: center;
}

.post-feature-toggle {
  background: var(--yellow);
}

.post-feature-toggle:disabled {
  opacity: 0.6;
  cursor: default;
}

#recipes-container .empty-state {
  grid-column: 1 / -1;
  color: var(--dark-gray);
  font-size: 16px;
}

.recipe-card {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 20px;
  padding: 10px;
  gap: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
}

.recipe-image-container {
  width: 96px;
  height: 144px;
  border-radius: 25px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease-in-out;
  background: linear-gradient(135deg, #f0f0f0, #e2e2e2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-gray);
  font-weight: 600;
  text-align: center;
}

.recipe-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-image-container:hover {
  transform: scale(1.1);
}

.recipe-content-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  align-self: stretch;
  justify-content: space-between;
  gap: 8px;
}

.recipe-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipe-meta-line {
  font-size: 13px;
  color: var(--dark-gray);
}

.recipe-meta-line strong {
  font-weight: 600;
}

.recipe-title {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 6px;
}

.recipe-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 12px;
  background: #ffe4e4;
  color: #b12c2c;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recipe-text {
  font-size: 16px;
  color: var(--dark-gray);
  white-space: pre-wrap;
}

.recipe-text .highlight {
  display: inline-flex;
  padding: 0px 8px;
  justify-content: center;
  align-items: center;
  gap: 4px;
  border-radius: 15px;
  font-weight: 500;
  font-size: 15px;
  border: 1px solid #fff;
  margin: 0 4px 4px 0;
}

.recipe-text .highlight strong {
  font-weight: 700;
}

.recipe-text .chip-photo {
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.70) 0%, rgba(255, 255, 255, 0.70) 100%), var(--blue, #6392EE);
  color: var(--blue);
}

.recipe-text .chip-text {
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.70) 0%, rgba(255, 255, 255, 0.70) 100%), var(--green, #3AC884);
  color: var(--green);
}

.recipe-text .chip-list {
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.70) 0%, rgba(255, 255, 255, 0.70) 100%), var(--red, #FF6464);
  color: var(--red);
}

.recipe-text .chip-sketch {
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.70) 0%, rgba(255, 255, 255, 0.70) 100%), var(--yellow, #FFBF26);
  color: var(--yellow);
}

.recipe-text .chip-number {
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.70) 0%, rgba(255, 255, 255, 0.70) 100%), var(--teal, #3AACC8);
  color: var(--teal);
}

.recipe-text .chip-unknown {
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.70) 0%, rgba(255, 255, 255, 0.70) 100%), #bbbbbb;
  color: var(--dark-gray);
}

.recipe-text .chip-image {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
}

.recipe-stats {
  display: flex;
  gap: 15px;
  font-size: 14px;
  color: var(--dark-gray);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.recipe-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recipe-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.recipe-actions .primary {
  border: 2px solid black;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--yellow);
  color: black;
}

.recipe-actions .primary:hover {
  background: var(--yellow);
}

.recipe-featured-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fff8dc;
  color: #c48d00;
  font-weight: 600;
  font-size: 14px;
  cursor: default;
  user-select: none;
  box-shadow: 2px 2px rgba(0, 0, 0, 0.1);
  transition: background 0.2s ease, color 0.2s ease;
}

.recipe-featured-pill.recipe-featured-pill--expanded {
  background: #fff1a8;
}

.recipe-featured-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 8px 14px;
  background: var(--orange);
  color: black;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 2px 2px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform-origin: bottom center;
}

.recipe-featured-pill.recipe-featured-pill--expanded .recipe-featured-tooltip,
.recipe-featured-pill:focus .recipe-featured-tooltip {
  opacity: 1;
  transform: translate(-50%, -4px);
}

/* First Run order input size */
input.firstrun-order-input {
  width: 40px;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-name-block {
  display: flex;
  flex-direction: column;
}

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #f5f5f5;
  display: block;
}

.post-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  background: #f5e27f;
}

.post-username {
  font-size: 18px;
  font-weight: 600;
}

.post-display-name {
  color: var(--light-gray);
  font-size: 14px;
  line-height: 1.3;
}

.post-publish-time {
  color: var(--light-gray);
  font-size: 14px;
  line-height: 1.3;
}

.post-meta {
  color: var(--dark-gray);
  font-size: 14px;
}

.post-meta-strong {
  font-weight: 500;
}

.post-image {
  width: 100%;
  border-radius: 12px;
  box-shadow: inset 2px 0 8px 2px rgba(0, 0, 0, 0.15);
}

.post-recipe-text {
  white-space: pre-wrap;
  line-height: 1.5;
  margin-bottom: 2px;
}

.post-recipe-image {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  vertical-align: middle;
}

.inline-chip-image {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 4px;
  vertical-align: middle;
}

.post-chips {
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  color: var(--black);
}

.post-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  margin-bottom: 8px;
}

.post-stat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--black);
}

.post-stat-value {
  font-variant-numeric: tabular-nums;
}

body.fa-ready .post-stat-icon {
  display: inline-block;
}

body.fa-ready .post-stat-fallback {
  display: none;
}

.post-stat-fallback {
  font-size: 16px;
  line-height: 1;
}

.post-stat-icon {
  display: none;
}

.post-user-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
  grid-column: 1 / -1;
}

.post-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-left: 8px;
}

.post-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.post-carousel {
  display: flex;
  overflow-x: auto;
  padding-bottom: 16px; /* For scrollbar */
  gap: 12px;
}

.post-card {
  flex: 0 0 200px; /* fixed width, don't grow or shrink */
  border: 1px solid #EFEFEF;
  border-radius: 12px;
  padding: 8px;
  padding-bottom: 44px; /* reserve space for bottom-right actions */
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative; /* for bottom-left badge positioning */
}

.post-card-image {
  width: 100%;
  border-radius: 8px;
}

.post-card-recipe-text {
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}

/* Private badge shown for unpublished posts */
.post-private-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: #ffe8e8;
  color: var(--red);
  border: 1px solid #ffb8b8;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.post-private-badge--small {
  left: 8px;
  bottom: 8px;
  font-size: 10px;
  padding: 2px 5px;
}

.page-definition {
  padding: 12px 16px;
  background-color: #f0f0f0;
  border-bottom: 1px solid var(--dark-gray);
  font-style: italic;
  color: var(--dark-gray);
  margin-bottom: 16px;
  border-radius: 8px;
}

.recent-posts-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  width: 596px;
  flex-shrink: 0;
}

.recent-post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

#top-recipes-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

#top-recipes-columns {
  display: none;
}

.recipe-rank {
  font-size: 2.5em;
  font-weight: 800;
  color: var(--separator-gray);
  width: 60px;
  text-align: center;
  flex-shrink: 0;
  align-self: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

#revenuecat-user-list-container {
  margin-top: 1rem;
}

.revenuecat-user-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.revenuecat-user-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--separator-gray);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.revenuecat-user-table thead th {
  text-align: left;
  font-size: 13px;
  color: var(--dark-gray);
  background: #fafafa;
  padding: 10px 12px;
  border-bottom: 1px solid var(--separator-gray);
}

.revenuecat-user-table tbody td {
  font-size: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid #f4f4f4;
}

.revenuecat-user-table tbody tr:hover {
  background: #fffdf3;
  cursor: pointer;
}

.revenuecat-user-table .revenuecat-user-list-uname {
  font-weight: 600;
}

.revenuecat-user-list-button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  background: #f0f0f0;
  border: none;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
}

.revenuecat-user-list li:first-child .revenuecat-user-list-button {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.revenuecat-user-list li:last-child .revenuecat-user-list-button {
  border-bottom: none;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.revenuecat-user-list-button:hover {
  background: #e0e0e0;
}

.revenuecat-user-list-displayname {
  color: #555;
  font-size: 0.9em;
}
