/* Kairo Fasting — planner design system
   Matched to kairofasting.com: warm cream + gold (tan), rounded headings,
   ember / growth / recovery accents, dual light + dark. */

:root {
  color-scheme: dark;

  /* Neutrals — warm dusk (dark is the DEFAULT theme, shown to everyone) */
  --bg: #171310;
  --surface: #221c16;
  --surface-2: #1b1611;
  --border: #352d22;
  --text: rgba(255, 251, 245, .98);
  --text-muted: rgba(255, 244, 232, .62);
  --text-faint: rgba(255, 240, 226, .46);

  /* Brand accents */
  --tan: #d8b473;          /* primary gold */
  --tan-deep: #e6cd93;     /* legible gold text/links on dark */
  --tan-tint: rgba(216, 180, 115, .14);
  --ember: #e58a6b;
  --ember-deep: #f0a588;
  --ember-tint: rgba(229, 138, 107, .15);
  --growth: #8fb295;
  --growth-deep: #a9cbae;
  --growth-tint: rgba(127, 160, 132, .16);
  --recovery: #7fb2c6;
  --champagne: #ead7ae;

  /* Timeline neutrals */
  --fast-bar: #2c261c;
  --fast-bar-2: #38311f;

  --radius: 20px;
  --radius-sm: 13px;
  --radius-pill: 100px;
  --shadow: 0 1px 2px rgba(0,0,0,.34), 0 14px 34px rgba(0,0,0,.4);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 26px 64px rgba(0,0,0,.55);
  --font: -apple-system, "system-ui", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", var(--font);
}

/* Light is opt-in only (set data-theme="light" on <html>). Dark stays the default. */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f1e8;
    --surface: #ffffff;
    --surface-2: #f1e9da;
    --border: #e5dac5;
    --text: #221b13;
    --text-muted: #5f564a;
    --text-faint: #948a79;

    --tan-deep: #a9791e;     /* legible gold text/links on light */
    --tan-tint: #f3e8ce;     /* champagne fill */
    --ember-deep: #c25e3c;
    --ember-tint: #f7e2d8;
    --growth: #7fa084;
    --growth-deep: #4f7358;
    --growth-tint: #e6eee7;

    --fast-bar: #e7dcc8;
    --fast-bar-2: #dccfb6;
    --shadow: 0 1px 2px rgba(60, 46, 22, .05), 0 14px 34px rgba(60, 46, 22, .08);
    --shadow-lg: 0 2px 6px rgba(60, 46, 22, .07), 0 26px 64px rgba(60, 46, 22, .14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

h1, h2, h3, .brand, .section-title, .style-badge, .s-name,
.result-head h2, .pro-cta h3, .plan-card h3, .now-status {
  font-family: var(--font-rounded);
}

a { color: var(--tan-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 960px; }

/* --- Header (pill nav, like kairofasting.com) --- */
.site-header { padding: 18px 0 6px; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-pill); box-shadow: var(--shadow);
  padding: 10px 16px 10px 14px; max-width: 760px;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-weight: 700; font-size: 1.06rem; letter-spacing: -.01em; color: var(--text);
}
.brand:hover { text-decoration: none; }
.logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: center / cover no-repeat url("assets/kairo-icon.svg");
  box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.08);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--text-muted); font-weight: 560; font-size: .92rem;
  padding: 7px 13px; border-radius: var(--radius-pill);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.nav-cta { color: var(--tan-deep); background: var(--tan-tint); }
.nav-pro-badge {
  display: inline-flex; align-items: center; font-family: var(--font-rounded);
  font-size: .82rem; font-weight: 700; color: #2a1206;
  background: linear-gradient(135deg, var(--tan), var(--ember));
  border-radius: var(--radius-pill); padding: 5px 12px;
}
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-muted); cursor: pointer;
  transition: color .15s, background .15s, border-color .15s, transform .1s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--tan); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle:focus-visible { outline: 2px solid var(--tan); outline-offset: 2px; }

/* --- Hero --- */
.hero { padding: 40px 0 8px; text-align: center; }
.hero h1 {
  font-size: clamp(2rem, 6.4vw, 2.9rem);
  line-height: 1.05; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 700;
}
.hero h1 .accent { color: var(--tan-deep); }
.hero .lede { color: var(--text-muted); font-size: 1.1rem; margin: 0 auto; max-width: 30em; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--tan-deep);
  margin-bottom: 16px; padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--tan-tint);
}
/* FAST · MOVE · RECOVER style kicker */
.kicker {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin: 18px 0 0; font-size: .82rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase;
}
.kicker .k-fast { color: var(--ember-deep); }
.kicker .k-move { color: var(--growth-deep); }
.kicker .k-recover { color: var(--recovery); }
.kicker .dot-sep { color: var(--text-faint); }

/* --- Card --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px;
}
.card + .card { margin-top: 18px; }

/* --- Form --- */
.planner { margin-top: 28px; }
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field > label.field-label { display: block; font-weight: 650; font-size: .95rem; margin-bottom: 8px; }
.field .hint { color: var(--text-faint); font-size: .84rem; font-weight: 400; margin-left: 4px; }

.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.style-opt { position: relative; }
.style-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.style-opt label {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 8px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s, transform .1s; text-align: center;
}
.style-opt label .s-name { font-weight: 700; font-size: 1.04rem; }
.style-opt label .s-sub { font-size: .72rem; color: var(--text-faint); }
.style-opt input:checked + label {
  border-color: var(--tan); background: var(--tan-tint); color: var(--tan-deep);
}
.style-opt input:focus-visible + label { outline: 2px solid var(--tan); outline-offset: 2px; }
.style-opt label:active { transform: scale(.98); }

input[type="time"] {
  width: 100%; font-family: var(--font); font-size: 1.05rem;
  padding: 13px 15px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text);
}
input[type="time"]:focus-visible { outline: 2px solid var(--tan); outline-offset: 1px; border-color: var(--tan); }

.prefs { display: flex; flex-wrap: wrap; gap: 9px; }
.pref-chip { position: relative; }
.pref-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pref-chip label {
  display: inline-block; padding: 9px 15px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: var(--surface-2);
  font-size: .9rem; font-weight: 550; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.pref-chip input:checked + label { border-color: var(--tan); background: var(--tan-tint); color: var(--tan-deep); }
.pref-chip input:focus-visible + label { outline: 2px solid var(--tan); outline-offset: 2px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-rounded); font-size: 1.02rem; font-weight: 700;
  padding: 15px 26px; border-radius: 15px; border: none; cursor: pointer;
  transition: transform .1s, box-shadow .2s, filter .15s; text-decoration: none;
}
.btn-primary {
  width: 100%; color: #1c1305;
  background: linear-gradient(rgba(255,255,255,.30), rgba(255,255,255,0) 46%), var(--tan);
  border: 1px solid rgba(90, 62, 16, .3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 20px rgba(168, 128, 60, .3);
}
.btn-primary:hover { filter: brightness(1.03); text-decoration: none; }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { text-decoration: none; border-color: var(--tan); }
.btn-sun {
  color: #3a1a10;
  background: linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,0) 46%), var(--ember);
  border: 1px solid rgba(120, 48, 26, .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 20px rgba(197, 94, 60, .3);
}
.btn-sun:hover { filter: brightness(1.03); text-decoration: none; }
.btn[disabled], .btn.is-disabled {
  cursor: default; filter: none; opacity: .72;
  background: var(--surface-2); color: var(--text-faint);
  border: 1.5px dashed var(--border); box-shadow: none;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 140px; }

/* --- Notice / disclaimer strip --- */
.notice {
  display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 16px;
}
.notice .i {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ember-tint); color: var(--ember-deep);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .78rem;
}

/* --- Results --- */
#results { margin-top: 22px; }
[hidden] { display: none !important; }

.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.result-head h2 { font-size: 1.45rem; margin: 0; letter-spacing: -.02em; }
.result-head .style-badge {
  font-weight: 700; color: var(--tan-deep); background: var(--tan-tint);
  padding: 4px 13px; border-radius: var(--radius-pill); font-size: .9rem;
}

/* Timeline */
.timeline { margin: 20px 0 6px; }
.timeline-bar {
  position: relative; height: 46px; border-radius: 12px; overflow: hidden;
  display: flex; background: var(--fast-bar); border: 1px solid var(--border);
}
.seg { height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.seg-fast {
  background: repeating-linear-gradient(135deg, var(--fast-bar) 0 10px, var(--fast-bar-2) 10px 20px);
  color: var(--text-faint);
}
.seg-meal { background: linear-gradient(135deg, var(--growth), var(--growth-deep)); color: #fff; }
.seg .seg-label { font-size: .74rem; font-weight: 700; white-space: nowrap; padding: 0 6px; opacity: .95; }
.timeline-axis { display: flex; justify-content: space-between; margin-top: 7px; font-size: .72rem; color: var(--text-faint); }

.window-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.window-summary .ws { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface-2); }
.window-summary .ws .ws-k { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 650; }
.window-summary .ws .ws-v { font-size: 1.14rem; font-weight: 700; margin-top: 3px; font-family: var(--font-rounded); }
.window-summary .ws.meal .ws-v { color: var(--growth-deep); }

/* Meal + tips lists */
.section-title { font-size: 1.08rem; font-weight: 700; margin: 24px 0 12px; letter-spacing: -.01em; }
.section-title:first-child { margin-top: 6px; }
ul.plan-list { list-style: none; margin: 0; padding: 0; }
ul.plan-list li {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: .98rem;
}
ul.plan-list li:last-child { border-bottom: none; }
ul.plan-list li .dot {
  flex: none; width: 20px; height: 20px; border-radius: 6px; margin-top: 1px;
  background: var(--growth-tint); color: var(--growth-deep);
  display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800;
}
ul.tips-list li .dot { background: var(--ember-tint); color: var(--ember-deep); }
ul.plan-list li .li-text { flex: 1; min-width: 0; }
ul.plan-list li .kcal {
  flex: none; align-self: center; font-size: .78rem; font-weight: 700; color: var(--growth-deep);
  background: var(--growth-tint); border-radius: var(--radius-pill); padding: 3px 10px; white-space: nowrap;
}
ul.tips-list li .li-text { align-self: center; }
.est-note { font-size: .8rem; color: var(--text-faint); margin: 10px 0 0; font-style: italic; }

/* Pro CTA block */
.pro-cta {
  margin-top: 22px; text-align: center;
  background: radial-gradient(120% 140% at 50% -20%, var(--tan-tint), transparent 60%), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow);
}
.pro-cta h3 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: -.02em; }
.pro-cta p { margin: 0 auto 18px; color: var(--text-muted); max-width: 34em; }
.pro-cta .pro-feats { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin: 0 0 20px; padding: 0; list-style: none; font-size: .9rem; color: var(--text-muted); }
.pro-cta .pro-feats li::before { content: "✓ "; color: var(--growth-deep); font-weight: 800; }

/* App cross-promo */
.app-promo {
  margin-top: 18px; display: flex; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.app-promo .logo { width: 52px; height: 52px; border-radius: 13px; }
.app-promo .txt { flex: 1; min-width: 0; }
.app-promo .txt strong { display: block; font-size: 1rem; font-family: var(--font-rounded); }
.app-promo .txt span { font-size: .88rem; color: var(--text-muted); }

/* Shared-plan banner */
.shared-banner {
  display: none; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--tan-tint); border: 1px solid var(--tan);
  color: var(--tan-deep); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-top: 18px; font-size: .92rem; font-weight: 600;
}
.shared-banner.show { display: flex; }
.shared-banner .btn { padding: 8px 16px; font-size: .88rem; margin-left: auto; }

/* --- Footer --- */
.site-footer { margin-top: 48px; padding: 30px 0 40px; border-top: 1px solid var(--border); font-size: .84rem; color: var(--text-muted); }
.site-footer .foot-links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.site-footer .foot-links a { color: var(--text-muted); font-weight: 560; }
.site-footer .legal { font-size: .8rem; color: var(--text-faint); line-height: 1.6; }
.site-footer .affiliate { margin-top: 10px; font-style: italic; }

/* --- Legal page typography --- */
.legal-page { padding-top: 12px; }
.legal-page h1 { font-size: 1.9rem; letter-spacing: -.02em; }
.legal-page h2 { font-size: 1.2rem; margin-top: 30px; letter-spacing: -.01em; }
.legal-page p, .legal-page li { color: var(--text-muted); }
.legal-page .updated { color: var(--text-faint); font-size: .86rem; }
.back-link { display: inline-block; margin: 18px 0 4px; font-weight: 560; }

/* --- Toast --- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: var(--radius-pill);
  font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Immersive ambient background (warm dawn glow) --- */
body::before {
  content: ""; position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% -8%, rgba(216, 180, 115, .16), transparent 60%),
    radial-gradient(50% 40% at 88% 8%, rgba(229, 138, 107, .12), transparent 55%),
    radial-gradient(55% 45% at 8% 16%, rgba(127, 178, 198, .10), transparent 55%);
  animation: ambient 22s ease-in-out infinite alternate;
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(60% 45% at 50% -8%, rgba(216, 180, 115, .28), transparent 60%),
    radial-gradient(50% 40% at 88% 8%, rgba(229, 138, 107, .16), transparent 55%),
    radial-gradient(55% 45% at 8% 16%, rgba(127, 160, 132, .12), transparent 55%);
}
@keyframes ambient {
  from { transform: translate3d(0, -1.5%, 0) scale(1); }
  to   { transform: translate3d(0, 2%, 0) scale(1.06); }
}

/* Results reveal + timeline animation */
#results.revealed { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.timeline-bar .seg { transition: width .75s cubic-bezier(.2, .8, .2, 1); }

/* Live "now" marker */
.now-marker {
  position: absolute; top: -5px; bottom: -5px; width: 2px; z-index: 4;
  background: var(--text); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface);
  opacity: 0; animation: markerIn .3s ease .55s forwards;
}
.now-marker::after {
  content: ""; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface);
}
.now-marker.eating::after { background: var(--growth); }
.now-marker.fasting::after { background: var(--ember); }
@keyframes markerIn { to { opacity: 1; } }

/* "Right now" status line */
.now-status { display: flex; align-items: center; gap: 9px; margin: 14px 0 0; font-size: .96rem; font-weight: 650; }
.now-status:empty { display: none; }
.now-status.eating { color: var(--growth-deep); }
.now-status.fasting { color: var(--ember-deep); }
.now-status .pulse { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.now-status.eating .pulse { background: var(--growth); animation: pulse 2.2s infinite; }
.now-status.fasting .pulse { background: var(--ember); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }

/* Staggered list entrance */
#results.revealed ul.plan-list li { opacity: 0; animation: liIn .4s ease forwards; animation-delay: calc(.35s + var(--i, 0) * .06s); }
@keyframes liIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- Pro: 7-day plan --- */
#week-section { margin-top: 18px; }
#week-section.revealed { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
.pro-badge { background: linear-gradient(135deg, var(--tan), var(--ember)); color: #2a1206; }
body.is-pro .pro-cta { display: none; }         /* hide the upsell once unlocked */
.print-title { display: none; }

.export-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.export-bar .btn { flex: 0 1 auto; padding: 11px 18px; font-size: .94rem; }

.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; }
.day-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 14px 16px;
  opacity: 0; animation: liIn .4s ease forwards; animation-delay: calc(var(--i, 0) * .05s);
}
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.day-name { font-family: var(--font-rounded); font-weight: 700; font-size: 1.02rem; }
.day-date { color: var(--text-faint); font-size: .8rem; }
.day-list { list-style: none; margin: 0; padding: 0; }
.day-list li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.day-list li:last-child { border-bottom: none; }
.day-list li .li-text { flex: 1; min-width: 0; }
.day-list li.snack .li-text { color: var(--text-muted); font-size: .86rem; }
.day-list li .kcal {
  flex: none; align-self: flex-start; font-size: .74rem; font-weight: 700; color: var(--growth-deep);
  background: var(--growth-tint); border-radius: var(--radius-pill); padding: 2px 9px; white-space: nowrap;
}

/* --- Live fasting timer + progress ring --- */
.timer-card { text-align: center; }
.timer-ring-wrap { position: relative; width: 210px; height: 210px; margin: 2px auto 0; }
.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring .ring-track { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.timer-ring .ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .5s; }
.timer-card.eating .ring-fill { stroke: var(--growth); }
.timer-card.fasting .ring-fill { stroke: var(--ember); }
.timer-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-count { font-family: var(--font-rounded); font-size: 2.1rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.timer-phase { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-top: 3px; }
.timer-card.eating .timer-phase { color: var(--growth-deep); }
.timer-card.fasting .timer-phase { color: var(--ember-deep); }
.timer-sub { margin: 14px 0 0; color: var(--text-muted); font-size: .95rem; font-weight: 550; }

/* --- Flagship: adaptive recovery-aware card --- */
.flag-badge {
  font-family: var(--font); font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; vertical-align: middle; margin-left: 8px;
  color: var(--recovery); background: rgba(127,178,198,.14);
  border: 1px solid rgba(127,178,198,.4); border-radius: var(--radius-pill); padding: 3px 9px;
}
.recovery-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.rec-field { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; font-weight: 620; color: var(--text-muted); }
.rec-field select {
  font-family: var(--font); font-size: .98rem; font-weight: 500; color: var(--text);
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface-2); cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%), linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.rec-field select:focus-visible { outline: 2px solid var(--tan); border-color: var(--tan); }

.adapt-output { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); animation: rise .45s ease both; }
.adapt-head { margin-bottom: 12px; }
.adapt-level { font-family: var(--font); font-size: .72rem; font-weight: 800; letter-spacing: .08em; padding: 4px 12px; border-radius: var(--radius-pill); }
.adapt-low { color: var(--ember-deep); background: var(--ember-tint); }
.adapt-moderate { color: var(--tan-deep); background: var(--tan-tint); }
.adapt-high { color: var(--growth-deep); background: var(--growth-tint); }
.adapt-window { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 15px 18px; margin-bottom: 4px; }
.adapt-window-k { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 650; }
.adapt-window-val { font-family: var(--font-rounded); font-size: 1.5rem; font-weight: 700; color: var(--tan-deep); margin-top: 3px; }
.adapt-was { font-size: .84rem; color: var(--text-faint); margin-top: 4px; }
.adapt-notes li .dot { background: var(--recovery); color: #0e1a1f; }
.adapt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.adapt-chips-k { font-size: .84rem; font-weight: 620; color: var(--text-muted); }
.adapt-chip { font-size: .8rem; font-weight: 650; color: var(--growth-deep); background: var(--growth-tint); border-radius: var(--radius-pill); padding: 4px 12px; }

/* License activation */
.activate-row { display: flex; gap: 10px; flex-wrap: wrap; }
.activate-row input {
  flex: 1; min-width: 200px; font-family: var(--font); font-size: .96rem; color: var(--text);
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface-2);
}
.activate-row input:focus-visible { outline: 2px solid var(--tan); border-color: var(--tan); }
.activate-row .btn { padding: 12px 22px; }
.activate-status { font-size: .88rem; color: var(--text-muted); margin: 10px 0 0; min-height: 1em; }

@media (max-width: 520px) {
  .recovery-inputs { grid-template-columns: 1fr; }
}

/* --- Personalized calorie target --- */
.body-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.body-inputs input[type="number"], .body-inputs select {
  width: 100%; font-family: var(--font); font-size: .98rem; color: var(--text);
  padding: 11px 13px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface-2); -webkit-appearance: none; appearance: none;
}
.body-inputs input:focus-visible, .body-inputs select:focus-visible { outline: 2px solid var(--tan); border-color: var(--tan); }
.ht-row { display: flex; align-items: center; gap: 6px; }
.ht-row input { width: 56px; }
.ht-row span { color: var(--text-faint); font-size: .85rem; }

.cal-output { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); animation: rise .45s ease both; }
.cal-big { display: flex; align-items: baseline; gap: 3px; }
.cal-num { font-family: var(--font-rounded); font-size: 2.4rem; font-weight: 700; color: var(--tan-deep); letter-spacing: -.02em; }
.cal-unit { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.cal-sub { color: var(--text-faint); font-size: .86rem; margin-top: 2px; }
.macro-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.macro { flex: 1; min-width: 90px; text-align: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.macro-g { display: block; font-family: var(--font-rounded); font-weight: 700; font-size: 1.15rem; }
.macro-k { display: block; font-size: .78rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.cal-floor { color: var(--ember-deep); font-size: .85rem; margin: 12px 0 0; font-weight: 550; }

.day-total { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: .85rem; font-weight: 650; color: var(--text-muted); }
.day-total-tag { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill); }
.day-total-tag.on { color: var(--growth-deep); background: var(--growth-tint); }
.day-total-tag.off { color: var(--ember-deep); background: var(--ember-tint); }

@media (max-width: 520px) { .body-inputs { grid-template-columns: 1fr 1fr; } }

@media print {
  .site-header, .site-footer, .hero, .shared-banner, #planner-form,
  #results, .export-bar, .theme-toggle, .nav-links { display: none !important; }
  body { background: #fff; color: #000; }
  body::before { display: none; }
  .print-title { display: block; font-family: var(--font-rounded); font-weight: 700; font-size: 1.3rem; margin-bottom: 14px; color: #000; }
  #week-section { display: block !important; box-shadow: none; border: none; padding: 0; margin: 0; }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .day-card { break-inside: avoid; border: 1px solid #ccc; background: #fff; opacity: 1; animation: none; }
  .day-list li .kcal { color: #444; background: #eee; }
  .notice { color: #333; border-color: #ccc; }
}

@media (max-width: 520px) {
  .styles { grid-template-columns: repeat(2, 1fr); }
  .window-summary { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .nav-links a { padding: 7px 10px; font-size: .88rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, body::before { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .now-marker { opacity: 1; }
  #results.revealed ul.plan-list li { opacity: 1; }
}

/* ============================================================
   PLAN VISUAL REFRESH — modern, immersive, on-brand (dawn)
   ============================================================ */

/* Timer becomes an ambient, phase-coloured hero */
.timer-card {
  background: radial-gradient(75% 50% at 50% -6%, var(--ember-tint), transparent 55%), var(--surface);
}
.timer-card.eating {
  background: radial-gradient(75% 50% at 50% -6%, var(--growth-tint), transparent 55%), var(--surface);
}
/* Crisp ring — no glow */
.timer-ring .ring-fill { filter: none; }
.timer-ring .ring-track, .timer-ring .ring-fill { stroke-width: 7; }
.timer-count { font-size: 2rem; }

/* Section headings get a small dawn-gradient accent bar */
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title::before {
  content: ""; flex: none; width: 4px; height: 1.05em; border-radius: 3px;
  background: linear-gradient(var(--tan), var(--ember));
}

/* Meal / tip lists: soft floating cards instead of flat underlined rows */
ul.plan-list { display: grid; gap: 8px; }
ul.plan-list li {
  border-bottom: none; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 13px 15px;
  transition: transform .13s ease, border-color .15s ease, box-shadow .18s ease;
}
ul.plan-list li:hover { transform: translateY(-1px); border-color: var(--tan); box-shadow: var(--shadow); }
ul.plan-list li .kcal { font-size: .8rem; padding: 4px 11px; }
/* Drop the to-do checkmarks on meals/snacks; use a clean gold edge instead */
#meals-list li .dot, #snacks-list li .dot { display: none; }
#meals-list li, #snacks-list li { border-left: 3px solid var(--tan); padding-left: 16px; }
/* Tips keep a small sunrise marker, refined */
ul.tips-list li .dot { width: 26px; height: 26px; border-radius: 9px; margin-top: 0; }

/* Window summary → richer, tinted stat tiles */
.window-summary { gap: 14px; }
.window-summary .ws { border: 1px solid var(--border); }
.window-summary .ws.meal { background: linear-gradient(140deg, var(--growth-tint), var(--surface-2)); }
.window-summary .ws:not(.meal) { background: linear-gradient(140deg, var(--tan-tint), var(--surface-2)); }
.window-summary .ws .ws-v { font-size: 1.32rem; }

/* Timeline: taller, glowing eating band + a glowing "now" dot */
.timeline-bar { height: 54px; border-radius: 16px; }
.seg-meal { box-shadow: inset 0 0 10px rgba(127, 160, 132, .22); }
.now-marker::after { box-shadow: 0 0 4px 1px rgba(229, 138, 107, .45), 0 0 0 2px var(--surface); }
.now-marker.eating::after { box-shadow: 0 0 4px 1px rgba(127, 160, 132, .45), 0 0 0 2px var(--surface); }

/* 7-day cards: gentle lift + brand hairline on hover */
.day-card { transition: transform .13s ease, border-color .15s ease, box-shadow .18s ease; }
.day-card:hover { transform: translateY(-2px); border-color: var(--tan); box-shadow: var(--shadow); }

/* A touch more breathing room + a soft top sheen on result cards */
#results .card { position: relative; overflow: hidden; }
#results .card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 90px; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 0%, rgba(216, 180, 115, .07), transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  ul.plan-list li, .day-card { transition: none !important; }
}

/* ============================================================
   TABBED DASHBOARD + COOK
   ============================================================ */
.tabs {
  display: flex; gap: 5px; margin-bottom: 16px; padding: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill); position: sticky; top: 8px; z-index: 6;
}
.tab {
  flex: 1; border: none; background: transparent; color: var(--text-muted);
  font-family: var(--font-rounded); font-weight: 650; font-size: .95rem;
  padding: 10px 6px; border-radius: var(--radius-pill); cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--tan-deep); box-shadow: var(--shadow); }

/* Show only the active tab's cards (degrades to "show all" if JS is off) */
#results[data-active] > [data-tab] { display: none; }
#results[data-active="today"] > [data-tab~="today"],
#results[data-active="week"]  > [data-tab~="week"],
#results[data-active="cook"]  > [data-tab~="cook"],
#results[data-active="you"]   > [data-tab~="you"] { display: block; }

.cook-uses { color: var(--text-faint); font-size: .84rem; font-weight: 500; }
body:not(.is-pro) #week-section .export-bar { display: none; }

@media (max-width: 520px) {
  .tab { font-size: .86rem; padding: 9px 3px; }
}

/* ============================================================
   INTERACTIVE PROGRAM (Week tab)
   ============================================================ */
.week-streak { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.streak-flame { font-family: var(--font-rounded); font-weight: 700; color: var(--ember-deep); background: var(--ember-tint); border-radius: var(--radius-pill); padding: 5px 13px; }
.streak-count { color: var(--text-muted); font-size: .9rem; font-weight: 600; }

.day-card--live .day-list li { align-items: center; flex-wrap: wrap; }
.day-card--live .day-list li .li-text { flex: 1 1 60%; }
.item-ctrl {
  border: none; background: transparent; cursor: pointer; color: var(--text-faint);
  width: 26px; height: 26px; border-radius: 8px; font-size: .85rem; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.item-ctrl:hover { background: var(--surface); color: var(--text); }
.item-ctrl.check { border: 1.5px solid var(--border); }
.item-done .item-ctrl.check { background: var(--growth); border-color: var(--growth); color: #12200f; }
.item-ctrls { display: inline-flex; gap: 2px; margin-left: auto; }
.day-list li.item-locked { border-left: 3px solid var(--ember); padding-left: 11px; }
.item-done .li-text { text-decoration: line-through; color: var(--text-faint); }

.day-add { display: flex; gap: 6px; margin-top: 12px; }
.day-add input { font-family: var(--font); font-size: .86rem; color: var(--text); padding: 8px 10px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface-2); }
.day-add-name { flex: 1; min-width: 0; }
.day-add-kcal { width: 62px; }
.day-add-btn { padding: 8px 14px; font-size: .86rem; }

.day-foot { margin-top: 14px; }
.day-bar { height: 7px; border-radius: 5px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.day-bar-fill { height: 100%; background: linear-gradient(90deg, var(--growth), var(--growth-deep)); transition: width .35s ease; }
.day-foot-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 9px; font-size: .82rem; color: var(--text-muted); font-weight: 600; }
.shuffle-day { width: auto; padding: 6px 13px; border: 1px solid var(--border); border-radius: var(--radius-pill); font-weight: 650; color: var(--text-muted); }
.shuffle-day:hover { border-color: var(--tan); color: var(--tan-deep); background: transparent; }
.day-card.day-complete { border-color: var(--growth); }

/* --- Supabase sync bar --- */
.sync-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .9rem; }
.sync-off, .sync-on { font-weight: 650; color: var(--text-muted); }
.sync-on { color: var(--growth-deep); }
.sync-email { color: var(--text-muted); }
.sync-input { flex: 1; min-width: 160px; font-family: var(--font); font-size: .9rem; color: var(--text); padding: 8px 11px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); }
.sync-btn { padding: 8px 14px; font-size: .86rem; }
.sync-link { border: none; background: transparent; color: var(--tan-deep); font-weight: 650; cursor: pointer; margin-left: auto; }
.sync-link:hover { text-decoration: underline; }
.sync-status { flex-basis: 100%; color: var(--text-faint); font-size: .84rem; }

/* ===== Program controls — professional polish ===== */
.day-card--live .day-list li { flex-wrap: nowrap; align-items: center; gap: 10px; padding: 11px 0; }
.day-card--live .day-list li .li-text { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.item-meta { display: inline-flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.item-ctrls { display: inline-flex; gap: 1px; margin-left: 0; }
.item-ctrl { width: 28px; height: 28px; border-radius: 8px; color: var(--text-faint); }
.item-ctrl svg { display: block; }
.item-ctrl.check { border: 1.6px solid var(--border); border-radius: 7px; width: 22px; height: 22px; }
.item-done .item-ctrl.check { background: var(--growth); border-color: var(--growth); color: #12200f; }
.item-ctrl.lock.on { color: var(--ember-deep); }
.item-ctrl:hover { background: var(--surface); color: var(--text); }

.regen-week { width: auto; margin-left: auto; padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--text-muted); font-weight: 650; font-size: .82rem; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.regen-week:hover { border-color: var(--tan); color: var(--tan-deep); background: transparent; }
.regen-week svg { width: 13px; height: 13px; }
.shuffle-day { display: inline-flex; align-items: center; gap: 5px; }
.shuffle-day svg { width: 13px; height: 13px; }

/* ===== Program item: name on top, kcal + controls below (readable in narrow cards) ===== */
.day-card--live .day-list li { flex-wrap: nowrap; align-items: flex-start; gap: 10px; padding: 12px 0; }
.day-card--live .day-list li .item-content { flex: 1 1 auto; min-width: 0; }
.day-card--live .day-list li .li-text { display: block; line-height: 1.4; }
.day-card--live .day-list li .item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 9px 0 0; }
.day-card--live .day-list li .item-ctrl.check { margin-top: 1px; }

/* --- SEO learn / FAQ content --- */
.learn { margin-top: 46px; }
.learn h2 { font-size: 1.4rem; margin: 32px 0 10px; letter-spacing: -.02em; }
.learn > p { color: var(--text-muted); }
.learn a { color: var(--tan-deep); }
.schedule-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.schedule-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 15px; color: var(--text-muted); }
.schedule-list strong { color: var(--tan-deep); }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 13px 0; font-family: var(--font-rounded); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--text-faint); font-weight: 400; font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0 0 14px; color: var(--text-muted); }
