/* Layout: sticky header with three views; calendar view = month grid + today strip on the left, the selected day's log on the right (stacks on phones). */
/* Palette "Sheer": sand and shell, espresso ink, rust accent from lily stamens, clay, sea-glass green, stone and silver. */
:root{
  --bg:#EAE3D6; --surface:#FBF8F2; --surface-2:#F0EAE0; --ink:#2A211C; --muted:#776D63; --line:#DDD3C5;
  --accent:#A8502A; --accent-ink:#FFFFFF; --accent-soft:#F2E1D4; --on-strong:#FFFFFF;
  --period:#A9473E; --period-soft:#F0D4CD; --fertile:#5C8274; --fertile-soft:#DCE7E0; --foll-soft:#DAD9D3;
  --pms:#A35E2E; --pms-soft:#F0DFCC; --luteal-soft:#EBE0CB; --pms-week:#E0D0AE; --pms-hatch:#C8B386;
  --h-e:#B0522A; --h-p:#B98A3A; --h-lh:#4F7D70; --h-t:#9C3F3A; --h-fsh:#6A879E; --lining:#D6A194;
  --good:#4F7A5C; --warn:#A27428; --bad:#A9473E; --food-mid:#D1A23A;
  --moon-lit:#F5EEDC; --moon-dark:#D6CDBF; --moon-edge:#A3988A; --moon-glow:#D6B468;
  --sl-deep:#3E5F78; --sl-light:#94B7BF; --sl-rem:#8C6589; --sl-awake:#D0A247;
  --font-display:ui-rounded, "SF Pro Rounded", "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r:12px;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#191715; --surface:#221F1C; --surface-2:#2B2723; --ink:#EFE8DC; --muted:#A89E91; --line:#3A342E;
  --accent:#D9875A; --accent-ink:#191715; --accent-soft:#3A2A20; --on-strong:#191715;
  --period:#D97A6B; --period-soft:#43271F; --fertile:#8FB39A; --fertile-soft:#24302A; --foll-soft:#2A3032;
  --pms:#D9945F; --pms-soft:#3C2B1E; --luteal-soft:#2F2A21; --pms-week:#3C3424; --pms-hatch:#54492F;
  --h-e:#E08A5E; --h-p:#D9B064; --h-lh:#8FB39A; --h-t:#D97A6B; --h-fsh:#9DB4C8; --lining:#8A4D45;
  --good:#8FC29D; --warn:#D9B064; --bad:#E08070; --food-mid:#E3C060;
  --moon-lit:#F1E8D3; --moon-dark:#3A342E; --moon-edge:#7A6F64; --sl-deep:#7FA3C0; --sl-light:#557C85; --sl-rem:#C49AC0; --sl-awake:#E3C060;
  --moon-glow:#E3C47A; color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#191715; --surface:#221F1C; --surface-2:#2B2723; --ink:#EFE8DC; --muted:#A89E91; --line:#3A342E;
  --accent:#D9875A; --accent-ink:#191715; --accent-soft:#3A2A20; --on-strong:#191715;
  --period:#D97A6B; --period-soft:#43271F; --fertile:#8FB39A; --fertile-soft:#24302A; --foll-soft:#2A3032;
  --pms:#D9945F; --pms-soft:#3C2B1E; --luteal-soft:#2F2A21; --pms-week:#3C3424; --pms-hatch:#54492F;
  --h-e:#E08A5E; --h-p:#D9B064; --h-lh:#8FB39A; --h-t:#D97A6B; --h-fsh:#9DB4C8; --lining:#8A4D45;
  --good:#8FC29D; --warn:#D9B064; --bad:#E08070; --food-mid:#E3C060;
  --moon-lit:#F1E8D3; --moon-dark:#3A342E; --moon-edge:#7A6F64; --sl-deep:#7FA3C0; --sl-light:#557C85; --sl-rem:#C49AC0; --sl-awake:#E3C060;
  --moon-glow:#E3C47A; color-scheme:dark}

*{box-sizing:border-box}
body{background:var(--bg);color:var(--ink);font-family:var(--font-body);font-size:15px;line-height:1.5}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:10;background:var(--surface)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
h1,h2,h3{font-family:var(--font-display);font-weight:700;margin:0;text-wrap:balance;letter-spacing:-.01em}
.num,.mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums}

.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;background:var(--surface);border-bottom:1px solid var(--line);
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.top-in{max-width:1180px;margin:0 auto;display:flex;align-items:center;gap:16px;padding-block:10px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:10px;margin-right:auto}
.brand-mark{width:28px;height:28px;border-radius:50%;background:conic-gradient(var(--period) 0 18%,var(--h-e) 18% 50%,var(--fertile) 50% 62%,var(--h-p) 62% 100%);position:relative;flex:none}
.brand-mark::after{content:"";position:absolute;inset:7px;border-radius:50%;background:var(--surface)}
.brand h1{font-size:19px}
.tabs{display:flex;gap:4px;background:var(--surface-2);padding:3px;border-radius:999px}
.tab{border:0;background:transparent;padding:6px 14px;border-radius:999px;color:var(--muted);font-weight:700;font-size:14px}
.tab[aria-selected="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.status{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;white-space:nowrap}
.status i{width:8px;height:8px;border-radius:50%;background:var(--muted);display:inline-block}
.status[data-s="saved"] i{background:var(--good)} .status[data-s="saving"] i{background:var(--warn)} .status[data-s="error"] i,.status[data-s="local"] i{background:var(--bad)}

main{max-width:1180px;margin:0 auto;padding-block:20px 48px;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r)}
.eyebrow{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:700}
.muted{color:var(--muted)}
.small{font-size:13px}

.cal-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:20px;align-items:start}
@media (max-width:900px){.cal-layout{grid-template-columns:minmax(0,1fr)}}
.left-col{display:flex;flex-direction:column;gap:16px;min-width:0}

/* Today strip */
.today{padding:16px 18px;display:grid;grid-template-columns:auto 1fr;gap:6px 18px;align-items:center}
.ring{width:84px;height:84px;grid-row:span 3}
.today h2{font-size:22px}
.today-facts{display:flex;flex-wrap:wrap;gap:6px}
.fact{font-size:13px;background:var(--surface-2);border-radius:999px;padding:3px 10px}
.fact b{font-family:var(--font-mono);font-weight:500}

/* Calendar */
.cal{padding:14px}
.cal-head{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.cal-head h2{font-size:20px;margin-right:auto}
.icon-btn{border:1px solid var(--line);background:var(--surface);border-radius:8px;min-width:34px;height:34px;padding:0 10px;font-weight:700}
.icon-btn:hover{background:var(--surface-2)}
.wk,.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.wk div{font-size:11px;text-align:center;color:var(--muted);letter-spacing:.06em;text-transform:uppercase;padding-bottom:4px}
.cell{position:relative;aspect-ratio:1/1.02;border:1px solid transparent;border-radius:9px;background:var(--surface-2);padding:4px 5px;text-align:left;display:flex;flex-direction:column;justify-content:space-between;min-width:0;overflow:hidden}
.cell:hover{border-color:var(--muted)}
.cell .n{font-family:var(--font-mono);font-size:13px;line-height:1}
.cell.out{opacity:.42}
.cell.foll{background:var(--foll-soft)}
.cell.fert{background:var(--fertile-soft)}
.cell.ovu{background:var(--fertile);color:var(--on-strong)}
.cell.lut{background:var(--luteal-soft)}
/* premenstrual week = late luteal: same colour family, deeper shade plus fine hatching */
.cell.lut.pmw,.sw.pmw{background:repeating-linear-gradient(135deg,var(--pms-week) 0 5px,var(--pms-hatch) 5px 6.5px)}
.cell.per{background:var(--period);color:var(--on-strong)}
.cell.ppred{border:1.5px dashed var(--period);background:var(--period-soft)}
.moon{position:absolute;top:4px;right:4px;width:12px;height:12px;opacity:.7;pointer-events:none}
.moon .moon-dark{fill:var(--moon-dark);stroke:var(--moon-edge);stroke-width:.7}
.moon .moon-lit{fill:var(--moon-lit)}
.moon.full,.moon.new{width:17px;height:17px;top:3px;right:3px;opacity:1;border-radius:50%}
.moon.full{box-shadow:0 0 0 2px var(--moon-glow),0 0 8px 1px var(--moon-glow)}
.moon.full .moon-dark{stroke:var(--moon-glow)}
.moon.new{box-shadow:0 0 0 2px var(--ink)}
.moon.new .moon-dark{fill:var(--ink);stroke:var(--ink)}
.cell.today .n{background:var(--ink);color:var(--surface);border-radius:5px;padding:2px 4px;margin:-2px -2px}
.cell.sel{outline:2px solid var(--accent);outline-offset:1px}
.marks{display:flex;gap:3px;align-items:center;flex-wrap:wrap;min-height:8px}
.mk{width:7px;height:7px;border-radius:50%;flex:none}
.mk.food{width:9px;height:9px;box-shadow:0 0 0 1.5px var(--surface)}
.mk.f-good{background:var(--good)}
.mk.f-mid{background:var(--food-mid)}
.mk.f-bad{background:var(--bad)}
.food-score{display:inline-flex;align-items:center;gap:6px;font-size:14px}
.wlist{display:flex;flex-direction:column}
.wrow{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;gap:8px;align-items:center;padding:6px 0;border-bottom:1px solid var(--line)}
.wrow .nm{font-weight:700;overflow-wrap:anywhere}
.mk.ph{border-radius:2px;background:var(--accent);box-shadow:0 0 0 1.5px var(--surface)}
.mk.tr{transform:rotate(45deg);border-radius:1px;background:var(--h-p);width:6px;height:6px;box-shadow:0 0 0 1.5px var(--surface)}
.legend{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:12px;font-size:12px;color:var(--muted)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.sw{width:14px;height:14px;border-radius:4px;display:inline-block}

/* Day panel */
.day{padding:0;position:sticky;top:calc(env(safe-area-inset-top,0px) + 70px);max-height:calc(100vh - 90px);overflow:auto}
@media (max-width:900px){.day{position:static;max-height:none}}
.day-head{display:flex;align-items:center;gap:8px;padding:14px 16px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--surface);z-index:1}
.day-head h2{font-size:19px;margin-right:auto}
.sec{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;flex-direction:column;gap:10px}
.sec:last-child{border-bottom:0}
.sec h3{font-size:15px;display:flex;align-items:center;gap:8px}
.sec h3 .hint{font-family:var(--font-body);font-weight:400;font-size:13px;color:var(--muted);margin-left:auto}
.phase-pill{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:3px 10px;font-weight:700;font-size:13px}
.ph-menstrual{background:var(--period-soft);color:var(--period)}
.ph-follicular{background:var(--foll-soft);color:var(--ink)}
.ph-fertile{background:var(--fertile-soft);color:var(--fertile)}
.ph-luteal{background:var(--luteal-soft);color:var(--h-p)}
.ph-premenstrual{background:var(--pms-soft);color:var(--pms)}
.hchart{width:100%;height:auto;display:block}
.hlist{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:6px}
.hrow{display:flex;align-items:center;gap:8px;font-size:13px;background:var(--surface-2);border-radius:8px;padding:5px 8px}
.hrow .key{width:10px;height:3px;border-radius:2px;flex:none}
.hrow b{margin-left:auto;font-weight:700}
.recs{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:4px}
.callout{background:var(--surface-2);border-radius:10px;padding:10px 12px;font-size:14px}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:5px 12px;font-size:14px;display:inline-flex;align-items:center;gap:6px}
.chip:hover{border-color:var(--muted)}
.chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.chip.bad[aria-pressed="true"]{background:var(--bad);border-color:var(--bad);color:var(--on-strong)}
.chip.goodc[aria-pressed="true"]{background:var(--good);border-color:var(--good);color:var(--on-strong)}
.chip.per[aria-pressed="true"]{background:var(--period);border-color:var(--period);color:var(--on-strong)}
.chip.ghost{border-style:dashed;color:var(--muted)}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.field{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:7px 10px;min-width:0}
textarea.field{width:100%;min-height:72px;resize:vertical}
.btn{border:1px solid var(--accent);background:var(--accent);color:var(--accent-ink);border-radius:8px;padding:7px 14px;font-weight:700}
.btn.sec-btn{background:transparent;color:var(--accent)}
.btn:disabled{opacity:.5;cursor:default}
.slot-label{font-size:13px;font-weight:700;color:var(--muted)}
.scale{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
.scale button{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:6px 2px;font-size:12px;line-height:1.2}
.scale button b{display:block;font-family:var(--font-mono);font-size:15px}
.scale button[aria-pressed="true"]{color:var(--on-strong);border-color:transparent}
.photo-wrap{display:grid;grid-template-columns:140px minmax(0,1fr);gap:12px;align-items:start}
@media (max-width:460px){.photo-wrap{grid-template-columns:minmax(0,1fr)}}
.photo-wrap img{width:100%;max-width:100%;border-radius:10px;display:block;aspect-ratio:3/4;object-fit:cover;background:var(--surface-2)}
.ai{display:flex;flex-direction:column;gap:6px;font-size:14px;min-width:0}
.ai .score{font-family:var(--font-mono);font-size:26px;line-height:1}
.ai .tags{display:flex;flex-wrap:wrap;gap:4px}
.tag{font-size:12px;background:var(--surface-2);border-radius:6px;padding:2px 7px}
.ai ul{margin:0;padding-left:18px}
.trt{display:flex;align-items:center;gap:8px;background:var(--surface-2);border-radius:8px;padding:6px 10px;font-size:14px}
.trt .x{margin-left:auto;border:0;background:transparent;color:var(--muted);font-size:18px;line-height:1}
.file-btn{position:relative;overflow:hidden}
.file-btn input{position:absolute;inset:0;opacity:0;cursor:pointer}

/* Insights */
.ins-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
@media (max-width:820px){.ins-grid{grid-template-columns:minmax(0,1fr)}}
.ins-card{padding:16px 18px;display:flex;flex-direction:column;gap:10px;min-width:0}
.ins-card.wide{grid-column:1/-1}
.ins-card h2{font-size:18px}
.ai-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.trend{font-weight:700;border-radius:999px;padding:3px 10px;font-size:13px;background:var(--surface-2)}
.trend.improving{background:var(--fertile-soft);color:var(--good)}
.trend.worsening{background:var(--period-soft);color:var(--bad)}
.cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.cols h3{font-size:14px;margin-bottom:4px}
.cols ul{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:4px;font-size:14px}
.bars{display:flex;flex-direction:column;gap:8px}
.bar{display:grid;grid-template-columns:120px minmax(0,1fr) 44px;gap:8px;align-items:center;font-size:13px}
.bar .track{height:12px;background:var(--surface-2);border-radius:6px;overflow:hidden}
.bar .fill{height:100%;border-radius:6px}
.bar .v{font-family:var(--font-mono);text-align:right}
.compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.stat{background:var(--surface-2);border-radius:10px;padding:10px 12px}
.stat .big{font-family:var(--font-mono);font-size:24px}
.chart-box{overflow-x:auto}
.empty{border:1px dashed var(--line);border-radius:10px;padding:14px;color:var(--muted);font-size:14px}

/* Setup */
.setup-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
@media (max-width:820px){.setup-grid{grid-template-columns:minmax(0,1fr)}}
.prod{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
.prod:last-child{border-bottom:0}
.prod .nm{font-weight:700;overflow-wrap:anywhere}
.prod .kd{font-size:12px;color:var(--muted)}
.disclaimer{font-size:12px;color:var(--muted);max-width:70ch}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media (max-width:520px){.tab{padding:6px 10px}.brand h1{font-size:17px}.cell{padding:3px}.cell .n{font-size:12px}}

/* Standalone page base (the Claude version got these from its host) */
:root{color-scheme:light;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
body{margin:0;-webkit-text-size-adjust:100%}
img{max-width:100%}
[hidden]{display:none!important}
code{font-family:var(--font-mono);font-size:.92em;background:var(--surface-2);padding:1px 5px;border-radius:5px}

/* Sign-in */
.auth{min-height:100vh;display:flex;flex-direction:column;align-items:center;padding-block:24px;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.auth-card{width:100%;max-width:400px;padding:24px;display:flex;flex-direction:column;gap:14px}
.auth > .auth-card{margin-block:auto}
/* night sea behind the homepage and the log in page (drawn by app.js) */
.night{position:fixed;inset:0;z-index:0;pointer-events:none;background:#0E1620}
.night svg{display:block;width:100%;height:100%}
#auth{padding-top:0}
#auth .auth-card{position:relative;z-index:1;box-shadow:0 12px 44px rgba(4,8,12,.45)}
.auth-alt-line{margin:0;color:var(--muted)}
/* top bar: the name (back to the homepage) and the Log in button */
.pub-top{position:relative;z-index:2;width:100%;max-width:1120px;height:64px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px}
.pub-top:empty{display:none}
.pub-brand{display:flex;align-items:center;gap:10px;color:#F4EEE3;text-decoration:none;font-family:var(--font-display);font-weight:700;font-size:18px;letter-spacing:-.01em}
.pub-brand .brand-mark{width:26px;height:26px}
.pub-brand .brand-mark::after{background:#0E1620}
.pub-btn{color:#F4EEE3;text-decoration:none;font-weight:700;font-size:15px;padding:8px 20px;border-radius:999px;border:1px solid rgba(244,238,227,.4);background:rgba(244,238,227,.08)}
.pub-btn:hover{background:rgba(244,238,227,.18)}
.pub-link{color:#F4EEE3;font-size:14px;text-underline-offset:3px}
.pub-brand:focus-visible,.pub-btn:focus-visible,.pub-link:focus-visible,.home a:focus-visible{outline:2px solid #E3C47A;outline-offset:3px}
@media (max-width:699px){
  .pub-top{height:56px}.pub-brand{font-size:16px}.pub-btn{padding:7px 16px;font-size:14px}
  #auth > .auth-card{margin-top:var(--moon-gap,24px)}
  .home{padding-top:var(--moon-gap,24px)}}
/* homepage: what the app does, and the waitlist */
.home{position:relative;z-index:1;width:100%;max-width:1120px;color:#F4EEE3}
.home-hero{display:grid;gap:28px;padding-block:4px 36px}
.home-eyebrow{margin:0 0 12px;font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#E3C47A}
.home h1{font-size:clamp(34px,5vw,56px);line-height:1.06;color:#F7F1E6;max-width:14ch}
.home-lead{margin:18px 0 0;font-size:clamp(16px,1.5vw,19px);line-height:1.55;color:rgba(244,238,227,.88);max-width:34em}
.home-note{margin:14px 0 0;font-size:14px;line-height:1.5;color:rgba(244,238,227,.68);max-width:34em}
.home-wl{position:relative;width:100%;max-width:440px;padding:24px;display:flex;flex-direction:column;gap:12px;color:var(--ink);box-shadow:0 12px 44px rgba(4,8,12,.45);scroll-margin-top:16px}
.home-wl h2{font-size:21px}
.home-sec{padding-block:24px}
.home-sec h2{margin-bottom:16px;font-size:24px;color:#F7F1E6}
.home-feats{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
@media (min-width:560px){.home-feats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:900px){.home-feats{grid-template-columns:repeat(3,minmax(0,1fr))}}
.home-feat,.home-steps li{background:rgba(12,20,30,.72);border:1px solid rgba(244,238,227,.1);border-radius:var(--r);padding:18px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.home-feat i{display:block;width:24px;height:4px;border-radius:2px;margin-bottom:12px}
.home-feat h3,.home-steps h3{margin-bottom:6px;font-size:16px;color:#F7F1E6}
.home-feat p,.home-steps p{margin:0;font-size:14px;line-height:1.5;color:rgba(244,238,227,.76)}
.home-private{margin:16px 0 0;font-size:14px;line-height:1.5;color:rgba(244,238,227,.8);max-width:46em}
.home-private b{color:#F7F1E6}
.home-steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;counter-reset:st}
.home-steps li{counter-increment:st}
.home-steps li::before{content:counter(st);display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:rgba(227,196,122,.16);color:#E3C47A;font-weight:700;font-size:14px;margin-bottom:12px}
.home-foot{padding-block:16px 0;font-size:14px;color:rgba(244,238,227,.66)}
.home-foot a{color:#F4EEE3;text-underline-offset:3px}
.home-foot p{margin:0 0 6px}
/* text straight on the sky stays readable where it passes over the moon while scrolling */
.home-intro,.home-sec>h2,.home-private,.home-foot{text-shadow:0 1px 10px rgba(5,9,14,.9),0 0 2px rgba(5,9,14,.6)}
@media (min-width:700px){.home-hero{padding-top:28px}}
@media (min-width:960px){
  .home-hero{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:56px;align-items:start}
  .home-wl{justify-self:end;margin-top:max(0px,calc(var(--moon-low,0px) - 64px))}}
body:has(#auth:not([hidden]))::before{background:transparent}
.ng-tw{animation:ngTw 5s ease-in-out infinite}
.ng-gl{animation:ngGl 3.2s ease-in-out infinite}
.ng-wave{animation:ngDrift 18s linear infinite}
.ng-wash{animation:ngWash 7s ease-in-out infinite alternate}
@keyframes ngTw{50%{opacity:.12}}
@keyframes ngGl{50%{opacity:.08}}
@keyframes ngDrift{to{transform:translateX(var(--p))}}
@keyframes ngWash{to{transform:translateY(5px)}}
.auth-card h1{font-size:22px}
.auth-form{display:flex;flex-direction:column;gap:6px}
.auth-form label{font-size:13px;font-weight:700;color:var(--muted)}
.auth-form .field{width:100%;padding:10px 12px}
.auth-form .btn{margin-top:10px;padding:10px 14px}
.auth-alt{justify-content:space-between}
.linkish{border:0;background:none;color:var(--accent);padding:0;font-size:14px;text-decoration:underline;text-underline-offset:3px}
.auth-msg{font-size:14px;min-height:1.2em}
.auth-msg.err{color:var(--bad)}
.keyfield{width:100%;font-family:var(--font-mono)}
.chip .pts{font-family:var(--font-mono);font-size:11px;opacity:.75}
.pct-in{display:inline-flex;align-items:center;gap:3px;font-family:var(--font-mono);font-size:13px}

/* Daily analysis */
.shots{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.shot{position:relative;aspect-ratio:3/4;border-radius:10px;overflow:hidden;background:var(--surface-2);min-width:0}
.shot img{width:100%;height:100%;object-fit:cover;display:block}
.shot-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:1.5px dashed var(--line);color:var(--muted);cursor:pointer;text-align:center;padding:8px}
.shot-empty:hover{border-color:var(--accent);color:var(--accent)}
.shot-empty .plus{font-size:28px;line-height:1}
.shot-bar{position:absolute;left:0;right:0;bottom:0;display:flex;justify-content:space-between;gap:8px;padding:6px 8px;background:color-mix(in srgb,var(--surface) 88%,transparent)}
.shot-bar .linkish{font-size:13px}
/* selfies hidden by default: small blurred tiles; "Show photos" reveals them */
.shots.compact .shot{aspect-ratio:auto;height:72px}
.shots.compact .shot-empty{flex-direction:row;gap:8px}
.shots.compact .shot-empty .plus{font-size:22px}
.shot-hidden img{filter:blur(14px) saturate(.6);transform:scale(1.3)}
.shot-lock{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;color:var(--ink);background:color-mix(in srgb,var(--surface) 55%,transparent)}
.shots-toggle{display:block;margin:6px 0 2px;font-size:13px}
.an{display:flex;flex-direction:column;gap:10px}
.an-head{display:flex;align-items:center;gap:12px}
.an-head .score{font-family:var(--font-mono);font-size:34px;line-height:1}
.an-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.an-grid .stat{padding:8px 10px}
.an-grid .big{font-size:18px}
@media (max-width:460px){.an-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.callout.flare{background:var(--period-soft)}
.tags{display:flex;flex-wrap:wrap;gap:4px}
table.log{width:100%;border-collapse:collapse;font-size:13px;min-width:520px}
table.log th{text-align:left;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:700;padding:6px 8px;border-bottom:1px solid var(--line)}
table.log td{padding:6px 8px;border-bottom:1px solid var(--line)}
table.log td.num{font-family:var(--font-mono);text-align:right}

/* Hormone graph */
.hchips .hchip{font-size:13px;padding:4px 10px}
.hchip i{width:14px;height:3px;border-radius:2px;display:inline-block}
.hchip[aria-pressed="true"]{background:var(--surface);color:var(--ink);border-color:var(--ink)}
.hchip[aria-pressed="false"]{opacity:.55}
.hgraph{border-radius:10px;outline-offset:3px}
.hgraph svg{touch-action:pan-y;cursor:ew-resize;user-select:none;-webkit-user-select:none}
.hchart .gl{font-size:9px;fill:var(--muted);font-family:var(--font-body)}
.hread{display:flex;flex-direction:column;gap:4px;background:var(--surface-2);border-radius:10px;padding:8px 10px}
.hr-day{display:flex;gap:8px;align-items:baseline;font-size:14px}
.hr-vals{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:13px}
.hv{display:inline-flex;align-items:center;gap:5px}
.hv i{width:9px;height:9px;border-radius:50%;display:inline-block}
.hv b{font-weight:600}
.fol{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:12px;align-items:center}
.fol-svg{width:100%;height:auto;display:block}
.fol-svg .gl{font-size:8px;fill:var(--muted);font-family:var(--font-body)}
.fol-text{display:flex;flex-direction:column;gap:4px}
@media (max-width:460px){.fol{grid-template-columns:minmax(0,1fr)}}
.mk.wo{width:0;height:0;border-radius:0;border-left:4.5px solid transparent;border-right:4.5px solid transparent;border-bottom:8px solid var(--h-fsh)}
.mk.sx{width:auto;height:auto;border-radius:0;font-style:normal;font-size:11px;line-height:8px;color:var(--h-e)}
.cell.per .mk.wo,.cell.ovu .mk.wo{border-bottom-color:var(--on-strong)}
.cell.per .mk.sx,.cell.ovu .mk.sx{color:var(--on-strong)}
.sec h3 .moon{position:static;flex:none;opacity:1}
.callout.sens{background:var(--pms-soft)}
.examples{font-size:13px}
.examples summary{cursor:pointer;color:var(--accent);font-weight:700}
.examples dl{margin:8px 0 0;display:grid;grid-template-columns:minmax(0,1fr);gap:2px 0}
.examples dt{font-weight:700;margin-top:6px}
.examples dd{margin:0;color:var(--muted)}
.wrow .ex{grid-column:1/-1}

/* Product cards */
.pcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px;align-items:start}
.pcard{border:1px solid var(--line);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:8px;min-width:0}
.pcard.lvl-avoid{border-color:var(--bad)}
.pc-top{display:grid;grid-template-columns:52px minmax(0,1fr) auto auto;gap:8px;align-items:center}
.pc-img{width:52px;height:52px;border-radius:10px;overflow:hidden;background:var(--surface-2);display:flex;align-items:center;justify-content:center;font-size:20px;cursor:pointer}
.pc-img img{width:100%;height:100%;object-fit:cover}
.pc-add{border:1.5px dashed var(--line)}
.pc-main{min-width:0;display:flex;flex-direction:column;gap:2px}
.pc-name{font-weight:700;padding:4px 8px;width:100%}
.pc-top select{max-width:130px}
.act{font-size:12px;border-radius:999px;padding:2px 9px;border:1px solid transparent}
.act-good{background:var(--fertile-soft);color:var(--good)}
.act-info{background:var(--surface-2);color:var(--muted)}
.act-caution{background:var(--pms-soft);color:var(--pms)}
.act-avoid{background:var(--period-soft);color:var(--bad);border-color:var(--bad)}
.pc-warn{margin:0;padding-left:18px;font-size:13px;display:flex;flex-direction:column;gap:2px}
.pc-warn li.avoid{color:var(--bad)}
.pc-ing summary{cursor:pointer;color:var(--accent);font-weight:700;font-size:13px}
.pc-ing[open]{display:flex;flex-direction:column;gap:6px}
.pc-ing textarea{min-height:80px;font-size:13px}
.warn-ic{color:var(--bad);font-size:12px}
@media (max-width:460px){.pc-top{grid-template-columns:44px minmax(0,1fr) auto}.pc-top select{grid-column:2/-1;max-width:none}.pc-img{width:44px;height:44px}}
.pc-main .kd{font-size:12px;color:var(--muted)}
@media (max-width:460px){.pc-top .icon-btn{grid-column:3;grid-row:1}.pc-top select{grid-row:2}}


/* Header: a generated beach for the selected day (see Beach in app.js). No text on it, only the day arrows. */
.hero{position:relative;height:clamp(200px,28vw,320px);overflow:hidden;background:linear-gradient(180deg,#D7CBBA 0 38%,#A9BDBA 38% 62%,#E2D5C0 62%);
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.hero canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.hero-in{position:relative;z-index:1;max-width:1180px;height:100%;margin:0 auto;display:flex;padding-block:14px}
.hero-nav{margin-left:auto;display:flex;gap:6px;align-self:flex-start}
.hero-btn{border:1px solid rgba(251,248,242,.6);background:rgba(42,33,28,.2);color:#FBF8F2;border-radius:999px;width:36px;height:36px;padding:0;font-size:18px;font-weight:700;line-height:1;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.hero-btn:hover{background:rgba(42,33,28,.36)}

/* Caption strip under the beach: the day's tide, then date, phase and moon */
.hero-cap{background:var(--surface);border-bottom:1px solid var(--line);padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.hc-in{max-width:1180px;margin:0 auto;padding-block:18px 16px;display:flex;align-items:flex-end;gap:12px 32px;flex-wrap:wrap}
.hc-main{flex:1 1 360px;min-width:0}
.hc-app{font-size:11px;letter-spacing:.14em;text-transform:uppercase;font-weight:700;color:var(--accent)}
.hero-cap h1{font-size:clamp(26px,3.6vw,36px);font-weight:600;letter-spacing:-.015em;margin-top:4px;line-height:1.1}
#heroLine{margin:6px 0 0;color:var(--muted);font-style:italic;max-width:60ch}
.hc-meta{display:flex;flex-direction:column;align-items:flex-end;gap:6px;text-align:right}
.hc-date{font-size:14px;font-weight:700}
.hc-chips{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.moon-pill{background:var(--surface-2);color:var(--ink);font-weight:600}
.moon-pill .moon{position:static;width:13px;height:13px;opacity:1}
.moon-pill .moon.full,.moon-pill .moon.new{width:13px;height:13px;box-shadow:none}
#heroToday{font-size:13px;padding:3px 12px}
.top-in .tabs{margin-right:auto}
.top{border-top:0}
@media (max-width:600px){
  .hero{height:240px}
  .hc-in{padding-block:14px 12px}
  .hc-meta{align-items:flex-start;text-align:left}
  .hc-chips{justify-content:flex-start}
}
/* Full and new moon on their calendar day */
.cell .mn{position:absolute;top:3px;right:4px;font-size:13px;line-height:1;filter:saturate(.85)}
.mn-l{font-size:14px;line-height:1}
@media (max-width:520px){.cell .mn{font-size:11px;top:2px;right:2px}}

/* Daily advice blocks */
.advice{display:flex;flex-direction:column;gap:10px}
.adv{border-radius:10px;padding:10px 12px;background:var(--surface-2)}
.adv p{margin:0 0 4px}
.adv-skin{background:var(--accent-soft)}
.adv-avoid{background:var(--period-soft)}
.adv-sub{font-size:12px;font-weight:700;color:var(--muted);margin-top:6px}
.adv .recs{margin-top:2px}
.moon-sec h3 .moon{width:16px;height:16px}
.moon-line{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;font-size:15px}
.moon-line.grow b{color:var(--fertile)}
.moon-line.go b{color:var(--accent)}

/* 3D skin map */
.skinmap{display:flex;flex-direction:column;gap:8px;margin-top:4px}
.sm-stage{position:relative;aspect-ratio:4/3;max-height:340px;border-radius:12px;overflow:hidden;background:radial-gradient(ellipse at 50% 40%,#3B3A3C 0%,#262527 70%)}
.sm-stage canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:pan-y;cursor:grab}
.sm-hint{position:absolute;right:10px;bottom:8px;font-size:11px;color:rgba(255,255,255,.55);pointer-events:none}
.sm-ctrl{display:flex;align-items:center;gap:10px}
.sm-range{flex:1;min-width:0;accent-color:var(--accent)}
.sm-day{font-family:var(--font-mono);font-size:12px;white-space:nowrap}
.sm-legend{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted)}
.sm-legend i{flex:1;height:6px;border-radius:3px;background:linear-gradient(90deg,#BFBAB5,#E3A495,#B8584E)}
.sm-spots{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:11px;color:var(--muted)}
.sm-spots span{display:inline-flex;align-items:center;gap:5px}
.dot{width:9px;height:9px;border-radius:50%;display:inline-block}
.d-new{background:#E64F42}.d-old{background:#A23A31}.d-heal{background:#F58FA3}
.sm-stats{color:var(--ink);font-weight:600}

/* Pregnancy mode: switch, dates form, trimester colours, morning sickness, food search, baby card */
.today-top{display:flex;align-items:center;justify-content:space-between;gap:6px 10px;flex-wrap:wrap}
.mode-sw{display:inline-flex;border:1px solid var(--line);border-radius:999px;padding:2px;background:var(--surface-2)}
.mode-sw button{border:0;background:transparent;border-radius:999px;padding:3px 12px;font-size:13px;font-weight:600;color:var(--muted)}
.mode-sw button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(42,33,28,.12)}
.preg-form{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:flex-end}
.preg-form label{display:flex;flex-direction:column;gap:3px;font-size:13px;color:var(--muted)}
.ins-card .mode-sw{align-self:flex-start}
.cell.tri1,.sw.tri1{background:var(--fertile-soft)}
.cell.tri2,.sw.tri2{background:var(--luteal-soft)}
.cell.tri3,.sw.tri3{background:var(--pms-soft)}
.cell.due,.sw.due{background:var(--accent);color:var(--on-strong)}
.tri-1{background:var(--fertile-soft);color:var(--fertile)}
.tri-2{background:var(--luteal-soft);color:var(--h-p)}
.tri-3{background:var(--pms-soft);color:var(--pms)}
.mk.sick{width:10px;height:4px;border-radius:2px;background:var(--h-lh);box-shadow:0 0 0 1.5px var(--surface)}
.mk.sick.s-1{opacity:.55}
.mk.sick.s-3{height:6px}
.cell.due .mk.sick,.cell.due .mk.wo{filter:brightness(1.6)}
.chip.lim[aria-pressed="true"]{background:var(--food-mid);border-color:var(--food-mid);color:#2A211C}
.chip.sickc[aria-pressed="true"]{background:var(--h-lh);border-color:var(--h-lh);color:var(--on-strong)}
.preg-head{font-size:14px}
.fsearch{display:flex;gap:8px}
.fsearch .field{flex:1;min-width:0}
.fres{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;align-items:start;padding:8px 10px;border-radius:10px;background:var(--surface-2);margin-top:6px}
.vd{font-size:12px;font-weight:700;border-radius:999px;padding:2px 9px;white-space:nowrap;line-height:1.5}
.vd-ok .vd,.vd.vd-ok{background:var(--fertile-soft);color:var(--good)}
.vd-careful .vd,.vd.vd-careful{background:color-mix(in srgb,var(--h-fsh) 22%,var(--surface));color:var(--h-fsh)}
.vd-cooked .vd,.vd.vd-cooked{background:var(--pms-soft);color:var(--pms)}
.vd-limit .vd,.vd.vd-limit{background:color-mix(in srgb,var(--food-mid) 28%,var(--surface));color:var(--warn)}
.vd-avoid .vd,.vd.vd-avoid{background:var(--period-soft);color:var(--bad)}
#foodRes .linkish{margin-top:6px;display:inline-block}
.baby{display:grid;grid-template-columns:150px minmax(0,1fr);gap:12px;align-items:center}
.womb-svg{width:150px;height:auto;display:block}
.today-wide{grid-column:1/-1;display:flex;flex-direction:column;gap:8px}
@media (max-width:460px){.baby{grid-template-columns:minmax(0,1fr)}.womb-svg{width:210px;margin:0 auto}}
.body-row .field{width:92px}
.sec h3 .moon-way{font-weight:400;font-size:13px;color:var(--muted)}
.moon-sec h3{flex-wrap:wrap}

/* Accounts: log in / create account, recovery code, onboarding steps, account settings */
.auth-tabs{align-self:flex-start}
.auth-msg{font-size:14px;min-height:1.2em}
.auth-msg.err{color:var(--bad)}
.consent,.check{display:flex;gap:8px;align-items:flex-start;font-size:13px;color:var(--ink);font-weight:400;line-height:1.4}
.consent input,.check input{margin-top:3px;flex:none}
.rcode{font-size:20px;letter-spacing:.06em;background:var(--surface-2);border-radius:10px;padding:12px;text-align:center;overflow-wrap:anywhere}
.onb-card{max-width:560px}
.onb-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.onb-dots{display:inline-flex;gap:5px}
.onb-dots i{width:8px;height:8px;border-radius:50%;background:var(--line)}
.onb-dots i.on{background:var(--accent)}
.onb-q{display:flex;flex-direction:column;gap:6px}
.onb-label{font-weight:700;font-size:15px}
.onb-q .row .field{width:96px}
.field.wide{width:100%}
.onb-nav{display:flex;align-items:center;gap:12px;margin-top:6px}
.onb-nav .spacer{flex:1}
.acc-more summary{cursor:pointer;color:var(--accent);font-weight:700;font-size:14px}
.acc-more .row{margin-top:8px}
.acc-more.danger summary,.danger-link{color:var(--bad)}
.btn.danger-btn{background:var(--bad);border-color:var(--bad);color:var(--on-strong)}
.auth-form .consent{font-weight:400;color:var(--ink);font-size:13px}
:root{--h-prl:#7E6A9E}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--h-prl:#B3A0D0}}
:root[data-theme="dark"]{--h-prl:#B3A0D0}
/* "What do these hormones do?" pop-up */
.hinfo-btn{align-self:flex-start;font-size:13px}
/* sleep through the cycle */
.sleep-sec .sl-svg .sl-row{font-size:9.5px;font-weight:700}
.sl-now{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:1px 5px;border-radius:999px;background:var(--surface-2);color:var(--muted)}
.chip[aria-pressed="true"] .sl-now{background:rgba(255,255,255,.22);color:inherit}
.sl-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.sl-stat{display:flex;flex-direction:column;gap:1px;background:var(--surface-2);border-radius:9px;padding:7px 9px;font-size:12px;color:var(--muted)}
.sl-stat i{width:10px;height:10px;border-radius:3px;display:inline-block}
.sl-stat b{font-size:14px;color:var(--ink)}
.sl-delta{font-size:11.5px;font-weight:700;color:var(--ink)}
.sl-text{margin:0;font-size:14px}
.sl-tip{font-size:14px;background:var(--surface-2);border-radius:9px;padding:8px 11px}
.sl-bed{font-size:14px;background:var(--accent-soft);border-radius:9px;padding:8px 11px}
#bSleepGoal,#bWake{width:auto}
.sl-src-h{font-size:14px;margin:6px 0 0}
.sl-src{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px;font-size:13px}
.sl-src a{color:var(--accent)}
@media (max-width:420px){.sl-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
dialog.hinfo{border:1px solid var(--line);border-radius:var(--r);background:var(--surface);color:var(--ink);padding:18px 20px;width:min(520px, calc(100vw - 32px));max-height:85vh;overflow:auto}
dialog.hinfo::backdrop{background:rgba(25,20,17,.45)}
.hinfo-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.hinfo-head h2{font-size:19px}
.hinfo-list{margin:6px 0 12px}
.hinfo-list dt{font-weight:700;display:flex;align-items:center;gap:8px;margin-top:12px}
.hinfo-list dt i{width:16px;height:3px;border-radius:2px;flex:none}
.hinfo-list dd{margin:3px 0 0 24px;font-size:14px;line-height:1.45}
.moon-acts{margin-top:8px}
.moon-acts .recs{margin-top:4px}
.ma-form{display:flex;flex-direction:column;gap:8px;margin-top:8px}
:root{--h-rlx:#C27BA0}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--h-rlx:#E0A3C2}}
:root[data-theme="dark"]{--h-rlx:#E0A3C2}
/* Face map and possible root causes */
.sm-ctrl .sm-mapbtn{font-size:13px;padding:4px 10px;flex:none}
.sm-zones{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:12px;color:var(--muted)}
.sm-zones span{display:inline-flex;align-items:center;gap:6px}
.sm-zones b{color:var(--ink);font-weight:600}
.sm-zones i{width:10px;height:10px;border-radius:3px;flex:none}
.rootcause{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.rc-zone{background:var(--surface-2);border-radius:10px;padding:8px 12px}
.rc-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rc-head i{width:12px;height:12px;border-radius:3px;flex:none}
.rc-zone .recs{margin:6px 0 0}
/* Waitlist: the hidden field only bots fill in, and the remove confirmation */
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.icon-btn.confirm{width:auto;padding:0 8px;color:var(--bad);border-color:var(--bad);font-size:12px}
.auth-form textarea.field{width:100%;padding:10px 12px;min-height:60px}
