:root{color-scheme:light dark;--bg:#fff8f7;--paper:#fffdfc;--ink:#49364f;--muted:#76627c;--line:#eadde2;--green:#b95d75;--accent:#eee7fa;--sage:#dcedE3;--coral:#fdece6;font:16px/1.55 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:var(--bg);color:var(--ink);background-image:radial-gradient(circle at 0 0,#f8dfe4aa,transparent 30rem)}button,input,select,textarea{font:inherit}a{color:inherit}button,a,input,select,textarea,summary{touch-action:manipulation}:focus-visible{outline:3px solid #b95d75;outline-offset:3px}.top{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding:16px max(5vw,calc((100vw - 1050px)/2));gap:16px;background:#fff8f7eF;backdrop-filter:blur(12px);position:sticky;top:0;z-index:3}.brand{text-decoration:none;font-family:Georgia,serif;font-weight:650;font-size:1.45rem;letter-spacing:-.03em}.brand span{color:#b95d75;font-family:system-ui}.top nav{display:flex;gap:clamp(10px,3vw,30px)}.top nav a{text-decoration:none;font-weight:650;padding:8px 0;color:var(--muted)}.top nav a:hover{color:var(--ink);text-decoration:underline;text-decoration-color:#db8197;text-underline-offset:6px}main{max-width:1098px;margin:auto;padding:42px 24px 72px}section{margin-bottom:54px;scroll-margin:90px}.heading,.calendar-head,.actions{display:flex;align-items:center;justify-content:space-between;gap:12px}.heading{margin-bottom:24px}.heading>div:first-child{max-width:58rem}.intro{max-width:52ch;font-size:1.05rem}.eyebrow{text-transform:uppercase;letter-spacing:.13em;font-size:.75rem;font-weight:750;margin:0 0 8px}h1,h2{font-family:Georgia,"Iowan Old Style",serif;line-height:1.06;letter-spacing:-.035em;margin:0}h1{font-size:clamp(2.4rem,6vw,4.7rem)}h2{font-size:clamp(1.6rem,3vw,2.6rem)}h3{font-family:Georgia,serif}p{margin:12px 0;color:var(--muted)}.dashboard{display:grid;grid-template-columns:1fr 1.12fr;gap:18px}.panel,.forecast{border:1px solid var(--line);border-radius:26px;padding:clamp(18px,3vw,32px);background:var(--paper);box-shadow:0 8px 24px #49364f0b}.forecast{background:#f8dfe4;color:var(--ink);border-color:#f0cbd4;display:flex;flex-direction:column;justify-content:center}.forecast p{color:var(--muted)}.forecast .eyebrow{color:#a24360}.forecast details{margin-top:18px;border-top:1px solid #e9b9c7;padding-top:13px}summary{cursor:pointer;font-weight:700}.calendar-head h2{font-size:1.6rem}.calendar-head button{padding:4px 12px}.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;text-align:center;margin:20px 0}.grid button{padding:0;min-height:40px;border:1px solid transparent;background:transparent;border-radius:11px}.grid button.current{border-color:var(--green)}.grid button.logged,.dot.logged{background:#f8dfe4;color:#713d50}.grid button.estimated,.dot.estimated{background:var(--accent);color:#503e77}.weekday,.legend{font-size:.8rem;color:var(--muted)}.legend{display:flex;align-items:center;gap:8px}.dot{width:12px;height:12px;border-radius:4px}.dot.estimated{margin-left:8px}button{cursor:pointer;border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:12px;padding:10px 15px;font-weight:700}button:disabled{cursor:default;opacity:.6}button:hover:not(:disabled){filter:brightness(.97)}.primary{background:var(--green);color:white;border-color:transparent;white-space:nowrap}.danger{color:#9d3628}.actions{justify-content:flex-start;flex-wrap:wrap}.row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid var(--line)}.row:last-child{border-bottom:0}.row p{margin:4px 0;overflow-wrap:anywhere}.row>div{min-width:0}.privacy{margin-top:16px}.privacy-strip{margin:18px 0 0;padding:14px 18px;background:var(--sage);border-radius:16px;font-size:.92rem;color:var(--ink)}.gate{max-width:550px;margin:40px auto}.gate h1{font-size:3rem}.gate form{display:grid;gap:12px}.gate button{justify-self:start}label{display:grid;gap:4px;font-weight:650}.toggle{display:flex;align-items:center;gap:8px;margin:14px 0}input,select,textarea{min-width:0;width:100%;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink)}input[type=checkbox]{width:auto}dialog{max-width:min(570px,calc(100% - 24px));width:100%;max-height:90dvh;border:1px solid var(--line);border-radius:24px;background:var(--paper);color:var(--ink);padding:24px;box-shadow:0 20px 60px #49364f33}dialog::backdrop{background:#3a263099}.fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}#entry-error:not(:empty){color:var(--ink);font-weight:650}@media(max-width:720px){.dashboard{grid-template-columns:1fr}.heading{align-items:flex-start;flex-direction:column}.heading .actions{width:100%}.heading .actions button{flex:1}main{padding:28px 16px 110px}.top{padding-inline:16px}.top #install-app{display:none}}@media(max-width:390px){.heading{flex-wrap:wrap}.top{padding-inline:12px}.fields{grid-template-columns:1fr}}@media(prefers-color-scheme:dark){:root{--bg:#1d1621;--paper:#281f2e;--ink:#f7eff5;--muted:#c7b7cd;--line:#493b50;--green:#e592a7;--accent:#322842;--sage:#20362c;--coral:#432b26}.top{background:#1d1621ef}.forecast{background:#462735;border-color:#6f4253}.forecast .eyebrow{color:#f0a9bc}.grid button.current{border-color:var(--ink)}}@media print{:root{color-scheme:light;--ink:#111;--muted:#444;--paper:white;--bg:white}.top,#today,#privacy,button,#message{display:none!important}main{padding:0}.row{break-inside:avoid}#history h2{font-size:26pt}}

.markers,.daily-heading{margin-top:22px}.markers details{margin-top:12px}.markers strong:empty{display:none}
#gap-review section{margin:12px 0 0;padding-top:10px;border-top:1px solid #91a699}
#gap-review .actions button{font-size:.85rem}
#daily-records{margin-top:12px}
fieldset{min-width:0;border:1px solid var(--line);border-radius:12px;margin:12px 0;padding:12px}
.symptoms{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.symptoms label{display:flex;align-items:center;gap:5px;border:1px solid var(--line);border-radius:8px;padding:6px 8px;font-size:.88rem}
#add-symptom{margin-top:8px}
.grid button.daily{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}

.daily-key{text-decoration:underline;text-underline-offset:3px;margin-left:8px}.legend{flex-wrap:wrap}
.top #install-app{margin-left:auto}
#install-guide h2{margin:0}
@media(max-width:580px){.top{flex-wrap:wrap}.top nav{order:3;width:100%;border-top:1px solid var(--line);padding-top:4px}}

.symptom-rating{max-width:100%}.symptom-rating select{margin-top:4px}.symptom-rating label{overflow-wrap:anywhere}

.top nav{flex-wrap:wrap}
.insight-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:1rem;margin-top:1rem}
.insight-grid h3{margin:0}.insight-grid li{overflow-wrap:anywhere}

/* Unlock and first-run setup share the Orbit layout. */
body:has(#gate:not([hidden])) .top nav { display: none; }
#gate {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  max-width: 920px;
  min-height: 460px;
  margin: clamp(12px, 4vw, 52px) auto 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: var(--paper);
}
.gate-art { position: relative; min-width: 0; background: #172e28; }
.gate-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gate-content { align-self: center; padding: clamp(24px, 5vw, 62px); }
.gate-brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: .035em; }
#gate h1 { margin: 23px 0 10px; font-size: clamp(2.15rem, 5.1vw, 3.7rem); }
#gate-copy { margin: 0 0 24px; max-width: 36ch; }
#unlock { display: grid; gap: 8px; }
#unlock label { font-size: .9rem; font-weight: 650; }
#unlock input { min-height: 46px; font-size: 1rem; }
#unlock-button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 46px; }
.gate-note { margin: 14px 0 0; font-size: .875rem; }
body:has(#gate:not([hidden])) #message { max-width: 920px; margin-inline: auto; }
@media (max-width: 580px) {
  #gate { grid-template-columns: minmax(0, 1fr); min-height: 0; margin-top: 12px; border-radius: 18px; }
  .gate-art { min-height: 112px; }
  .gate-art img { object-position: 50% 30%; }
  .gate-content { padding: 22px; }
  #gate-copy { margin-bottom: 18px; }
}

#gate-restore { margin-top: 12px; }
.diary-access { margin-top: 20px; }
#restore-controls { border: 0; padding: 0; margin: 0; }
#restore-controls label + label { margin-top: 12px; }

/* Keep primary destinations reachable with one hand on installed mobile web apps. */
@media (max-width: 580px) {
  .top { position: static; padding-bottom: 0; }
  .top nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 -8px 24px #49364f12;
  }
  .top nav a { padding: 6px 2px; text-align: center; font-size: .72rem; white-space: nowrap; }
}
