:root {
  --bg: #f6f1e6;
  --surface: rgba(33, 28, 20, 0.035);
  --surface-strong: rgba(33, 28, 20, 0.06);
  --border: rgba(33, 28, 20, 0.14);
  --ink: #211c14;
  --sub: #6b5f4d;
  --accent: #9c7526;
  --accent-soft: rgba(156, 117, 38, 0.12);
  --accent-ink: #17140f;
  --danger: #a5432e;
  --success: #4f7a5c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17140f;
    --surface: rgba(236, 230, 218, 0.04);
    --surface-strong: rgba(236, 230, 218, 0.07);
    --border: rgba(236, 230, 218, 0.13);
    --ink: #ece6da;
    --sub: #b9ae9c;
    --accent: #c69632;
    --accent-soft: rgba(198, 150, 50, 0.16);
    --accent-ink: #17140f;
    --danger: #d9705a;
    --success: #7fae8c;
  }
}

html[data-theme="dark"] {
  --bg: #17140f;
  --surface: rgba(236, 230, 218, 0.04);
  --surface-strong: rgba(236, 230, 218, 0.07);
  --border: rgba(236, 230, 218, 0.13);
  --ink: #ece6da;
  --sub: #b9ae9c;
  --accent: #c69632;
  --accent-soft: rgba(198, 150, 50, 0.16);
  --accent-ink: #17140f;
  --danger: #d9705a;
  --success: #7fae8c;
}

html[data-theme="light"] {
  --bg: #f6f1e6;
  --surface: rgba(33, 28, 20, 0.035);
  --surface-strong: rgba(33, 28, 20, 0.06);
  --border: rgba(33, 28, 20, 0.14);
  --ink: #211c14;
  --sub: #6b5f4d;
  --accent: #9c7526;
  --accent-soft: rgba(156, 117, 38, 0.12);
  --accent-ink: #17140f;
  --danger: #a5432e;
  --success: #4f7a5c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* The [hidden] attribute's default UA display:none is easily beaten by any
   author rule setting display on the same element (e.g. .btn's display:
   inline-flex) - found live 2026-07-23 when the admin unfreeze button and
   the dashboard's admin nav link both stayed visible despite `hidden` being
   set, because both carry a .btn class. Force it to actually win. */
[hidden] {
  display: none !important;
}

html {
  color-scheme: light dark;
  /* Lives on html, not body (2026-07-27) - overflow-x:hidden on body computes
     body's overflow-y to 'auto' per the CSS overflow spec (one axis non-visible
     forces the other off 'visible' too), which makes body a scroll container
     and silently breaks position:sticky for every descendant on every page.
     Same horizontal-clipping effect here, without that side effect. */
  overflow-x: hidden;
}

body {
  font-family: "Inter", -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.text-accent {
  color: var(--accent);
}

/* Panels (replaces the old glassmorphism cards) */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 2px;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Navbar */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 22px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* The default a:visited color rule has higher specificity than a plain .brand
   class rule, so it was winning and showing the UA purple/underline (found
   live 2026-07-23 right after making the logo a link). Match its specificity
   explicitly instead of just setting color on .brand alone. */
.brand,
.brand:link,
.brand:visited,
.brand:hover,
.brand:active {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
}

.brand-word {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 640px) {
  nav {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 16px 5%;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 8px;
    width: 100%;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.25s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .icon-sun { display: none; }
  html:not([data-theme="light"]) .icon-moon { display: block; }
}

.icon-eye-off { display: none; }
html[data-recording="on"] .icon-eye { display: none; }
html[data-recording="on"] .icon-eye-off { display: block; }
html[data-recording="on"] #recordingModeToggle { border-color: var(--accent); color: var(--accent); }

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 5%;
}

.section {
  padding: 110px 0;
}

.section-header {
  max-width: 620px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-header h2 {
  font-size: 2.1rem;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--sub);
  font-size: 1.05rem;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-up {
  animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal {
  opacity: 0;
}

.reveal.animate-up {
  animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .animate-up, .reveal.animate-up {
    animation: none;
    opacity: 1;
  }
}

/* Hero */
.hero {
  padding: 140px 5% 80px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
}

.hero-photo {
  position: relative;
  margin-bottom: 56px;
}

.hero-photo-frame {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.hero-photo-frame img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  display: block;
}

.hero-msg {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 88%;
  background: rgba(23, 20, 15, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(198, 150, 50, 0.4);
  border-radius: 4px;
  padding: 16px 20px;
  color: #ece6da;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.hero-msg .who {
  display: block;
  color: var(--accent);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}

.hero-inner {
  max-width: 480px;
}

.hero h1 {
  font-size: 2.4rem;
  line-height: 1.25;
  margin-bottom: 20px;
}

.hero p.lede {
  font-size: 1.05rem;
  color: var(--sub);
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 120px;
  }
  .hero-photo-frame img { min-height: 320px; }
}

/* Showcase pairs (2026-07-29) - the two features with a real Chiron-mockup photo
   (meal analysis, biometrics) get the image merged directly into their own card,
   image and explanation side by side, alternating left/right. Replaces the earlier
   separate "Moments" photo strip entirely - the two generic stock-photo tiers that
   used to sit here (a 2-up "hero" row plus a 3-up supporting row of running/weights/
   bike) are gone, since those didn't have a specific feature to pair with. */
.showcase-list {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin-bottom: 56px;
}

.showcase-item {
  display: flex;
  align-items: center;
  gap: 48px;
}

.showcase-item-reverse {
  flex-direction: row-reverse;
}

.showcase-media,
.showcase-text {
  flex: 1 1 50%;
  min-width: 0;
}

.showcase-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.showcase-text h3 {
  font-size: 1.4rem;
  margin: 18px 0 10px;
}

.showcase-text p {
  color: var(--sub);
}

@media (max-width: 760px) {
  .showcase-item,
  .showcase-item-reverse {
    flex-direction: column;
  }
}

/* Lightbox - click-to-enlarge for the showcase images. Reuses the same
   .modal-overlay open/close mechanics as the auth modal (opacity/pointer-events
   toggled via .active, see app.js). Loads img[data-full] on click - the page
   itself only ever requests the small _thumb file, so this full-resolution image
   is only ever fetched on demand, not part of normal page-load weight. */
.lightbox-overlay {
  background: rgba(10, 8, 5, 0.92);
  padding: 5vh 5vw;
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 6px;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 5%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(236, 230, 218, 0.3);
  background: transparent;
  color: #ece6da;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  border-color: #ece6da;
}

/* Two Ways to Begin */
.start-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.start-card {
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.coming-soon-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:disabled:hover {
  transform: none;
  filter: none;
}

.start-card h3 {
  font-size: 1.3rem;
  margin: 14px 0 12px;
}

.start-card p {
  color: var(--sub);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.text-me-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.text-me-form input {
  flex: 1 1 180px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
}

.text-me-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.text-me-confirm {
  margin-top: 16px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

.start-note {
  text-align: center;
  color: var(--sub);
  font-size: 0.85rem;
  margin-top: 28px;
}

.referral-callout {
  max-width: 560px;
  margin: 64px auto 0;
  padding: 24px 28px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.referral-callout p {
  font-size: 0.9rem;
  color: var(--ink);
  margin: 0;
}

.referral-callout p + p {
  margin-top: 10px;
}

.referral-callout strong {
  color: var(--accent);
}

.referral-callout a {
  color: var(--accent);
  white-space: nowrap;
}

.referral-callout-lead {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
}

.referral-price-slash {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  font-family: "Fraunces", Georgia, serif;
}

.referral-price-struck {
  text-decoration: line-through;
  color: var(--sub);
  font-size: 1.3rem;
}

.referral-price-arrow {
  color: var(--sub);
  font-size: 1.1rem;
}

.referral-price-target {
  color: var(--accent);
  font-size: 1.9rem;
  font-weight: 600;
}

@media (max-width: 760px) {
  .start-grid {
    grid-template-columns: 1fr;
  }
}

.hero-note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--sub);
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.feature-card {
  background: var(--bg);
  padding: 40px 32px;
}

.feature-icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--sub);
  font-size: 0.95rem;
}

/* How It Works */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
}

.step-card {
  position: relative;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.step-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: block;
}

.step-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.step-card p {
  color: var(--sub);
  font-size: 0.95rem;
}

/* Disclaimer */
.disclaimer-section {
  padding: 0 0 110px;
}

.disclaimer-card {
  padding: 26px 36px;
  text-align: center;
  color: var(--sub);
  font-size: 0.95rem;
}

.disclaimer-card strong {
  color: var(--ink);
  font-weight: 600;
}

/* Final CTA */
.final-cta {
  text-align: center;
  padding: 40px 0 130px;
}

.final-cta h2 {
  font-size: 2.3rem;
  margin-bottom: 16px;
}

.final-cta p {
  color: var(--sub);
  font-size: 1.05rem;
  margin-bottom: 36px;
}

/* Nav anchor links (Pricing/FAQ) - plain text, not buttons, so they don't compete
   visually with the real CTAs (Log In / Get Started) */
.nav-link-text {
  color: var(--sub);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link-text:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .nav-link-text {
    display: none;
  }
}

/* Why Chiron (vs. generic AI) */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.why-card {
  background: var(--bg);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
}

.why-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 10px;
}

.why-label-accent {
  color: var(--accent);
  margin-top: 22px;
}

.why-problem {
  color: var(--sub);
  font-size: 0.92rem;
}

.why-card h3 {
  font-size: 1.15rem;
  margin: 8px 0 10px;
}

.why-card p {
  font-size: 0.95rem;
}

.why-card > p:last-child {
  color: var(--sub);
}

@media (max-width: 900px) {
  .why-grid {
    grid-template-columns: 1fr;
  }
}

/* Pricing */
.pricing-price {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pricing-amount {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.6rem;
  line-height: 1;
}

.pricing-period {
  color: var(--sub);
  font-size: 0.95rem;
}

.pricing-subnote {
  margin-top: 8px;
  color: var(--sub);
  font-size: 0.85rem;
}

.pricing-features {
  list-style: none;
  margin: 28px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-features li {
  position: relative;
  padding-left: 26px;
  font-size: 0.92rem;
}

.pricing-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: no-repeat center / 8px 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239c7526' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.pricing-cta {
  margin-top: auto;
  width: 100%;
}

.pricing-cta-note {
  text-align: center;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--sub);
}

/* Single toggle card (Monthly/Annual tabs) - replaces two side-by-side cards with
   identical feature lists, since the plans only differ on price/billing cadence,
   not on what you actually get. */
.pricing-single-wrap {
  max-width: 440px;
  margin: 0 auto;
}

.pricing-toggle-card {
  padding: 40px 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.pricing-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 28px;
}

.pricing-tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.pricing-tab:first-child {
  border-right: 1px solid var(--border);
}

.pricing-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Save 20% stays visible on the Annual tab regardless of which tab is currently
   selected - a nudge toward the better deal even while looking at Monthly, not
   just a reward for already having picked Annual. */
.pricing-tab-save {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.pricing-tab.active .pricing-tab-save {
  background: rgba(0, 0, 0, 0.18);
  color: var(--accent-ink);
}

/* Subscription page (portal/subscription.html) */
.sub-header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.tier-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--accent-soft);
  color: var(--accent);
}

.sub-trial-note,
.sub-status {
  font-size: 0.88rem;
  color: var(--sub);
}

.sub-status-active {
  color: var(--success);
}

.sub-status-ending {
  color: var(--danger);
}

.sub-included {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.sub-included h4 {
  font-size: 1rem;
}

.sub-included-note {
  color: var(--sub);
  font-size: 0.9rem;
  margin: 8px 0 18px;
}

.sub-cancel-note {
  margin-top: 10px;
  color: var(--sub);
  font-size: 0.85rem;
}

.sub-refund-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--sub);
  font-size: 0.85rem;
  line-height: 1.6;
}

.sub-refund-note p {
  margin: 0 0 10px;
}

.sub-refund-note p:last-child {
  margin-bottom: 0;
}

.sub-refund-note strong {
  color: var(--text);
}

/* Referrals page (referrals.html) - proper boxed card treatment, matching the
   reviewed mockup, not the plain-text inline style used elsewhere on the site. */
.ref-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}

.ref-stat {
  background: var(--bg);
  padding: 20px 14px;
  text-align: center;
}

.ref-stat-num {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1;
}

.ref-stat-label {
  margin-top: 8px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sub);
}

.ref-stat-def {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--sub);
  line-height: 1.4;
}

@media (max-width: 480px) {
  .ref-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.ref-stack > * + * {
  margin-top: 20px;
}

.ref-panel {
  padding: 26px 28px;
}

.ref-panel h4 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 4px;
}

.ref-sub {
  color: var(--sub);
  font-size: 0.85rem;
  margin-top: 4px;
}

.ref-panel p {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--sub);
  line-height: 1.6;
}

.ref-panel p:first-of-type {
  margin-top: 8px;
}

.ref-panel strong {
  color: var(--ink);
}

.ref-callout {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
  color: var(--ink);
}

.ref-paylog-banner {
  font-size: 0.82rem;
  color: var(--sub);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0 4px;
}

.ref-legal {
  font-size: 0.76rem;
  color: var(--sub);
  line-height: 1.6;
  max-width: 680px;
  margin: 20px auto 0;
}

.ref-legal:last-of-type {
  margin-bottom: 40px;
}

.ref-legal + .ref-legal {
  margin-top: 10px;
}

.ref-redeem-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.ref-redeem-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.ref-redeem-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ref-redeem-option input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ref-opt-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.ref-opt-sub {
  font-size: 0.78rem;
  color: var(--sub);
  margin-top: 2px;
}

.ref-threshold-input {
  width: 56px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sub-referral-link-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sub-referral-link-row input {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-alt, transparent);
  color: var(--sub);
  font-size: 0.82rem;
}

.sub-auto-redeem-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--sub);
  cursor: pointer;
}

.sub-paylog {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 12px;
}

.sub-paylog th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sub);
  font-weight: 500;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
}

.sub-paylog td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.sub-paylog tr:last-child td {
  border-bottom: none;
}

.sub-status-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.sub-status-charge { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.sub-status-refund { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.sub-status-credit_applied { background: var(--accent-soft); color: var(--accent); }

/* FAQ */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 8px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 22px 24px;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  color: var(--sub);
  font-size: 0.95rem;
  margin-top: 14px;
  max-width: 620px;
}

.faq-item p a {
  color: var(--accent);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 5%;
}

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

.footer-copy {
  color: var(--sub);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--sub);
  font-size: 0.85rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Auth Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 8, 5, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal {
  width: 100%;
  max-width: 400px;
  padding: 44px;
  background: var(--bg);
  transform: translateY(16px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .auth-modal {
  transform: translateY(0);
}

/* User Detail modal (2026-07-26) - much wider than .auth-modal since it holds a
   multi-group field layout plus a ledger table, and scrolls internally rather than
   growing the page, so it stays usable regardless of how much content a user has. */
.admin-detail-modal {
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  background: var(--bg);
  position: relative;
  transform: translateY(16px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .admin-detail-modal {
  transform: translateY(0);
}

.admin-modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: none;
  border: none;
  color: var(--sub);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.admin-modal-close:hover {
  color: var(--ink);
}

/* Supplement detail modal (2026-08-03) - narrower than .admin-detail-modal, this
   just holds a handful of label/value pairs, not a multi-group layout + table. */
.supp-detail-modal {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  background: var(--bg);
  position: relative;
  transform: translateY(16px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .supp-detail-modal {
  transform: translateY(0);
}

.supp-truncate {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.supp-truncate:hover {
  color: var(--accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.8rem;
  color: var(--sub);
}

.input-group input,
.input-group select,
.input-group textarea {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
}

.input-group textarea {
  resize: vertical;
}

.phone-input-row {
  display: flex;
  gap: 8px;
}

.phone-input-row .phone-country-select {
  flex: 0 0 auto;
  width: 140px;
}

.phone-input-row input {
  flex: 1;
  min-width: 0;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.input-group input:disabled {
  color: var(--sub);
  cursor: not-allowed;
}

/* Account dropdown (2026-07-27) - Dashboard/Profile/Settings/Subscription live
   here in the navbar, next to Admin/Log Out, instead of a tabbed row on the
   dashboard page itself (tried that first, reverted per Ernesto's own mental
   model - see functional_specs.md/memory). */
.account-dropdown {
  position: relative;
}

.account-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
  z-index: 50;
}

.account-dropdown-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 2px;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
}

.account-dropdown-menu a:hover {
  background: var(--surface-strong);
  color: var(--accent);
}

/* Quick-commands tip (2026-07-27) - dashed underline, no background/border, so
   these read as inline emphasis in a hint sentence rather than clickable pill
   buttons that visually competed with the real Meals/Workouts tab row right
   below them. */
.quick-cmd-code {
  font-family: monospace;
  font-style: normal;
  color: var(--accent);
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 1px;
}

/* Dashboard hero (2026-07-27) - scoped class, not a change to the shared
   .dashboard-header (that class is also used by admin.html/profile.html/
   settings.html/subscription.html - touching it directly would restyle all
   of them). Flat background box holding the page title/subtitle and a
   message-style card from Chiron, side by side. */
.chiron-hero {
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(120deg, color-mix(in srgb, var(--accent) 6%, transparent) 0 2px, transparent 2px 40px),
    linear-gradient(160deg, var(--surface-strong) 0%, transparent 75%);
  border-radius: 10px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  /* Stays side-by-side (2026-07-27) - flex-wrap:wrap was reflowing to a
     stacked layout on anything narrower than ~1280px, since .chiron-hero-text
     had no width cap and could shrink-fight the message box for space at any
     viewport. min-width:0 lets the text column actually shrink/truncate
     instead of forcing a wrap; only genuinely narrow (mobile) widths stack,
     via the media query below. */
  flex-wrap: nowrap;
}

.chiron-hero-text {
  min-width: 0;
  flex: 1 1 auto;
}

.chiron-hero-text h2 {
  margin: 0;
}

.chiron-hero-text p {
  color: var(--sub);
  margin-top: 8px;
  font-size: 0.95rem;
}

.chiron-msg {
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 10px;
  padding: 14px 18px;
  max-width: 320px;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .chiron-hero {
    flex-wrap: wrap;
  }
  .chiron-msg {
    max-width: 100%;
  }
}

.chiron-msg-who {
  display: block;
  color: var(--accent);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}

.chiron-msg-text {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0;
  color: var(--sub);
  font-size: 0.85rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.divider:not(:empty)::before { margin-right: .25em; }
.divider:not(:empty)::after { margin-left: .25em; }

.google-btn {
  background: #fff;
  color: #1f1f1f;
  width: 100%;
  border: 1px solid var(--border);
}

.google-btn:hover {
  background: #f5f5f5;
}

/* Dashboard */
.dashboard-header {
  padding: 130px 0 40px;
  border-bottom: 1px solid var(--border);
}

.quota-card {
  padding: 28px;
  margin: 32px 0;
}

.progress-bar {
  height: 4px;
  background: var(--surface-strong);
  border-radius: 2px;
  overflow: hidden;
  margin: 18px 0 10px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 1s ease;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
}

.file-table th, .file-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.file-table th {
  color: var(--sub);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn-delete {
  padding: 7px 14px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.82rem;
}

.btn-delete:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.data-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  /* Sticky under the fixed navbar (2026-07-27) - top comes from
     --sticky-tabs-top, computed in admin.js from the navbar's actual rendered
     height so this doesn't drift if the navbar's own height ever changes. */
  position: sticky;
  top: var(--sticky-tabs-top, 94px);
  z-index: 30;
  background: var(--bg);
}

.data-tab {
  padding: 8px 16px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--sub);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.data-tab:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.data-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.data-range {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.data-range button {
  padding: 5px 12px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--sub);
  font-size: 0.78rem;
  cursor: pointer;
}

.data-range button.active {
  color: var(--accent);
  border-color: var(--accent);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.data-table th, .data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.data-table th {
  color: var(--sub);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Supplements panel scroll/freeze (2026-08-01) - same solved pattern as the
   admin ledger table (.ledger-table-scroll below): bounded height so both
   scrollbars sit predictably, sticky thead (needs border-collapse:separate to
   render reliably, same gotcha noted below), and a mirrored top scrollbar
   since the real one sits at the bottom of a tall box. */
.supp-table-scroll {
  max-height: 65vh;
  overflow: auto;
}
.supp-table-scroll .data-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}
.supp-table-scroll .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--bg);
  background-image: linear-gradient(var(--surface), var(--surface));
  cursor: pointer;
  white-space: nowrap;
}
.supp-table-scroll .data-table thead th.sortable:hover {
  color: var(--accent);
}
.supp-scroll-mirror {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  margin-top: 12px;
}
.supp-scroll-mirror-inner {
  height: 1px;
}
.supp-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.supp-filters select, .supp-filters label {
  font-size: 0.85rem;
}

/* Ledger table (2026-07-27) - bounded height so both the horizontal scrollbar
   (long Details/User Message columns) and the vertical one (up to 50 rows/page)
   sit right below the filters instead of wherever the last row happens to land.
   Also what makes the sticky thead below work: position:sticky needs a real
   scrolling ancestor, and this box (not the page) is that ancestor now. */
.ledger-table-scroll {
  max-height: 60vh;
  overflow: auto;
}

.ledger-table-scroll .data-table {
  /* Overrides .data-table's border-collapse: collapse (2026-07-27) - collapsed
     borders and position:sticky on th don't render reliably together (the
     sticky header's background doesn't fully paint, letting the row scrolling
     underneath show through it). border-spacing:0 keeps the same tight look. */
  border-collapse: separate;
  border-spacing: 0;
  /* min-width, not width:100% + table-layout:fixed (2026-07-27, reverted) -
     forcing every column into a fixed % of the container is what made User's
     phone numbers and Event's event_type slugs (both single unbroken tokens,
     no spaces to wrap on) overflow past their own column into the next one.
     A real min-width per column below lets the table grow past the container
     instead of compressing text that can't wrap - that's what the horizontal
     scrollbar (native at the bottom of this box, mirrored at the top via
     #ledgerScrollTop) is actually for. */
  table-layout: auto;
  min-width: 100%;
}

.ledger-table-scroll .data-table th:nth-child(1), .ledger-table-scroll .data-table td:nth-child(1) { min-width: 130px; }
/* User/Event (2026-07-27) - sized to ~half the longest real value's single-line
   width (measured against actual rendered font: "+13054572009" = 135.8px, the
   longest of the 15 event_type values, account_abandoned_pending_deletion =
   293.7px) plus cell padding, so break-word wraps each into 2 fairly balanced
   lines instead of either overflowing or leaving one line nearly empty. */
.ledger-table-scroll .data-table th:nth-child(2), .ledger-table-scroll .data-table td:nth-child(2) { min-width: 105px; }
.ledger-table-scroll .data-table th:nth-child(3), .ledger-table-scroll .data-table td:nth-child(3) { min-width: 180px; }
.ledger-table-scroll .data-table th:nth-child(4), .ledger-table-scroll .data-table td:nth-child(4) { min-width: 220px; }
.ledger-table-scroll .data-table th:nth-child(5), .ledger-table-scroll .data-table td:nth-child(5) { min-width: 280px; }
.ledger-table-scroll .data-table th:nth-child(6), .ledger-table-scroll .data-table td:nth-child(6) { min-width: 260px; }

/* Belt-and-suspenders even with real column widths above (2026-07-27) - a
   phone number or a long event_type slug is a single unbroken token with no
   space/hyphen to wrap on, so without this it overflows its cell instead of
   wrapping, regardless of how wide the column is. */
.ledger-table-scroll .data-table td {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Mirrored top scrollbar (2026-07-27) - the box below already has a real
   horizontal scrollbar, but it's at the bottom of a 60vh box, easy to miss.
   This is a second, always-visible-up-top scrollbar synced to the same
   scrollLeft via admin.js, same idea as the frozen header row on spreadsheet
   tools like Google Sheets. */
.ledger-scroll-mirror {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  margin-top: 12px;
}

.ledger-scroll-mirror-inner {
  height: 1px;
}

.ledger-table-scroll .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  /* var(--surface) alone is a ~4%-alpha tint, not opaque (it's meant to sit
     once on top of the page background, e.g. .panel) - a sticky header needs
     something that actually blocks the row scrolling underneath it, so paint
     an opaque --bg base first and layer the same tint on top of that. */
  background-color: var(--bg);
  background-image: linear-gradient(var(--surface), var(--surface));
}

.data-table td.num {
  font-variant-numeric: tabular-nums;
  color: var(--sub);
}

/* Scoped utility, not a blanket rule on .data-table td (2026-07-26) - the Users
   table's Status (badge+dot) and Strikes ("0 (lifetime 0)") cells were wrapping to
   2 lines; a table-wide nowrap would risk overflowing wider content elsewhere
   (e.g. the Audit Ledger's Details column). */
.data-table td.nowrap {
  white-space: nowrap;
}

/* Meals day -> meal -> item collapsible tree (2026-08-07). All three tiers
   share this one grid template so Cal/Protein/Fat/etc. line up in the same
   vertical column at every level - see mealStatCellsHtml/MEAL_STAT_COLUMNS
   in app.js, which is the actual source of truth for the 6 stat columns
   (Carbs/Sugar dropped from display 2026-08-07, "visual is crowded" - still
   editable/in the CSV, just not their own columns here).
   Design validated with Ernesto as an interactive mockup before this port. */
.meal-grid-row {
  display: grid;
  grid-template-columns: minmax(180px, 2.3fr) minmax(48px, 60px) repeat(6, minmax(56px, 78px)) minmax(56px, 72px);
  column-gap: 6px;
  align-items: center;
  min-width: 760px;
}

/* Workouts (2026-08-07) - same tree-table mechanics as .meal-grid-row (reused
   via the shared .meal-day-row/.meal-row/.meal-item-row/.meal-collapse/etc.
   classes), just its own column template: no Qty, no net-carbs-style derived
   column, Duration/Cal Burned/Glycogen/Intensity/Notes instead. */
.workout-grid-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(64px, 90px) minmax(64px, 90px) minmax(64px, 90px) minmax(56px, 80px) minmax(140px, 1.3fr) minmax(56px, 72px);
  column-gap: 6px;
  align-items: center;
  min-width: 700px;
}

.meal-grid-row .num {
  text-align: right;
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meal-col-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: var(--bg);
  background-image: linear-gradient(var(--surface-strong), var(--surface-strong));
  border-bottom: 1px solid var(--border);
}

.meal-col-head span {
  padding: 10px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meal-col-head span.num {
  text-align: right;
}

.meal-day-block {
  border-bottom: 1px solid var(--border);
}

.meal-day-block:last-child {
  border-bottom: none;
}

.meal-day-row {
  cursor: pointer;
  background: var(--surface-strong);
}

.meal-day-row:hover {
  background: var(--accent-soft);
}

.meal-day-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.02rem;
  color: var(--accent);
}

.meal-day-row .num {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--ink);
}

.meal-row {
  cursor: pointer;
}

.meal-row:hover {
  background: var(--surface);
}

.meal-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 34px;
}

.meal-type-text {
  font-weight: 600;
  font-size: 0.86rem;
  text-transform: capitalize;
}

.meal-row .num {
  font-size: 0.82rem;
  color: var(--ink);
}

.meal-actions-cell {
  padding: 0 6px;
  display: flex;
  gap: 4px;
  justify-self: end;
}

/* Icon buttons (2026-08-07) - replaced the old text pills (Rename/Edit/
   Delete/+ Add Food), which were wide enough to overflow the actions
   column into Sodium's on real screen widths. */
.meal-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
}

.meal-icon-btn svg {
  width: 13px;
  height: 13px;
}

.meal-icon-btn-edit {
  color: var(--accent);
  border: 1px solid var(--accent);
}

.meal-icon-btn-edit:hover {
  background: var(--accent-soft);
}

.meal-icon-btn-delete {
  color: var(--danger);
  border: 1px solid var(--danger);
}

.meal-icon-btn-delete:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.meal-items-wrap {
  background: var(--surface);
}

.meal-item-head span {
  padding: 6px 10px;
  font-size: 0.64rem;
  color: var(--sub);
  opacity: 0.75;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meal-item-head span.num {
  text-align: right;
}

.meal-item-head span:first-child {
  padding-left: 62px;
}

.meal-item-row {
  border-top: 1px solid var(--border);
}

.meal-item-row:hover {
  background: var(--surface-strong);
}

.meal-item-label {
  padding: 8px 10px 8px 62px;
  font-size: 0.84rem;
}

.meal-item-row .num {
  font-size: 0.82rem;
  color: var(--sub);
}

/* Chevron - rotates open/closed, indicates the current state rather than
   just decorating the row (same "what's interactive should look
   interactive" principle as the rest of the portal). */
.meal-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--sub);
  transition: transform 0.18s ease;
}

.meal-chev svg {
  width: 10px;
  height: 10px;
}

.meal-day-row.is-open .meal-chev,
.meal-row.is-open .meal-chev {
  transform: rotate(90deg);
}

/* Collapse wrapper - animates height via grid-template-rows (0fr closed,
   1fr open) rather than display:none, so the expand/collapse itself reads
   as a real motion instead of a hard cut. */
.meal-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}

.meal-collapse.is-open {
  grid-template-rows: 1fr;
}

.meal-collapse > div {
  overflow: hidden;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .meal-chev, .meal-collapse {
    transition: none;
  }
}

.btn-edit {
  padding: 7px 14px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.82rem;
}

.btn-edit:hover {
  background: var(--accent-soft);
}

.data-table td .btn-edit,
.data-table td .btn-delete {
  padding: 5px 10px;
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2.1rem; }
  .section-header h2 { font-size: 1.6rem; }
  .hero-actions { flex-direction: column; width: 100%; }
}

/* Admin console (Epic 8) - reuses .panel/.btn/.data-tabs/.data-table/.input-group/
   .progress-bar from the user dashboard, adds only what's genuinely admin-specific. */
.admin-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 2px 6px;
  margin-left: 4px;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  /* Sticky right below .data-tabs (2026-07-27) - see --sticky-filters-top in
     admin.js. Padding + background so scrolled-past table rows don't show
     through underneath while this is pinned. */
  position: sticky;
  top: var(--sticky-filters-top, 144px);
  z-index: 25;
  background: var(--bg);
  padding: 10px 0;
}

.admin-filters input,
.admin-filters select {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
}

.admin-filters input:focus,
.admin-filters select:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-loading {
  padding: 24px;
  text-align: center;
  color: var(--sub);
}

.admin-row-clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-row-clickable:hover {
  background: var(--surface-strong);
}

.admin-badge-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  color: var(--sub);
}

.admin-badge-success {
  color: var(--success);
  border-color: var(--success);
}

.admin-badge-danger {
  color: var(--danger);
  border-color: var(--danger);
}

.admin-detail {
  margin-top: 20px;
  padding: 24px;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.admin-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-detail-label {
  font-size: 0.75rem;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-config-panel {
  padding: 28px;
  margin-top: 20px;
  max-width: 480px;
}

/* System Config redesign (2026-07-25) - one compact card per subscription tier
   instead of one long stacked form; see docs design pass before this shipped. */
.tier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 22px;
  margin-top: 16px;
  max-width: 640px;
}

.tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tier-head h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 1.05rem;
  margin: 0;
}

.tier-tag {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 20px;
  padding: 2px 9px;
}

.config-field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 20px;
}

.config-field-grid.trial-extra {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.config-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.config-field-row:last-child {
  border-bottom: none;
}

.config-field-row label {
  font-size: 0.8rem;
  color: var(--sub);
}

.config-field-row input,
.config-field-row select {
  width: 132px;
  padding: 5px 8px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  text-align: right;
}

.config-field-row select {
  text-align: left;
}

.config-field-row input:focus,
.config-field-row select:focus {
  outline: none;
  border-color: var(--accent);
}

.config-field-row.toggle-row {
  grid-column: 1 / -1;
  justify-content: flex-start;
  gap: 12px;
}

.config-field-row.toggle-row input {
  width: auto;
}

.config-badge-note {
  font-size: 0.72rem;
  color: var(--sub);
  font-style: italic;
  margin-top: 10px;
}

.admin-config-diff {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-strong);
  border-radius: 4px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.admin-stat-card {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-stat-value {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.6rem;
}

.admin-chart-panel {
  padding: 24px;
  margin-top: 20px;
}

.admin-chart-panel h4 {
  font-size: 0.95rem;
  margin-bottom: 16px;
  color: var(--sub);
  font-weight: 500;
}

/* Shared head row (title + toggle/filter) for admin panel sections. */
.admin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.admin-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  background: var(--surface-strong);
}
.admin-toggle button {
  border: none;
  background: none;
  color: var(--sub);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.admin-toggle button.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.admin-clickable-row {
  cursor: pointer;
}
.admin-clickable-row:hover {
  background: var(--surface-strong);
}
.admin-totals-row td {
  border-top: 1px solid var(--border);
  font-weight: 600;
}
.admin-log-tail {
  background: var(--surface-strong);
  padding: 14px;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}

/* Payment Transactions (2026-08-07) - expandable raw webhook payload row */
.txn-raw-payload {
  background: var(--surface-strong);
  padding: 14px;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow-y: auto;
  margin: 8px 0;
}

