:root {
  --navy: #0e1530; --navy-deep: #0a0f24; --card: #141c3d; --card-line: #262e58; --line: #2a3160;
  --ink: #f4f1e8; --ink-soft: #c6c2ae; --pearl-dim: #9b9482;
  --sash: #e0576b; --sash-soft: #3a1620; --royal: #6f89ff; --royal-soft: #1a2354;
  --gold: #d7b65c; --good: #5bc28f; --warn: #e3a04a;
  --display: Didot, "Bodoni Moda", "Bodoni 72", Georgia, serif;
  --body: -apple-system, "Segoe UI", system-ui, sans-serif;
  --menstrual: #e0576b; --follicular: #5bc28f; --ovulatory: #d7b65c; --luteal: #6f89ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--navy); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--gold); }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--navy-deep); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: .5px; }
.muted { color: var(--ink-soft); }
.dim { color: var(--pearl-dim); font-size: 13px; }

/* ---------- App ---------- */
.app { max-width: 720px; margin: 0 auto; padding: 20px 18px 110px; }
.app header.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.brand { font-family: var(--display); font-size: 22px; letter-spacing: 1px; }
.brand b { color: var(--sash); font-weight: 400; }
.sync { font-size: 12px; color: var(--pearl-dim); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; background: none; }
.sync.on { color: var(--good); border-color: #2c5e47; }
h1.title { font-family: var(--display); font-size: 34px; font-weight: 400; margin: 4px 0 18px; line-height: 1.1; }
h2 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 26px 0 10px; }
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 6px 0; line-height: 1.5; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.btn { display: inline-block; text-decoration: none; background: var(--sash); color: #fff; border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 600; }
.btn.ghost { background: none; border: 1px solid var(--line); color: var(--ink); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.gold { background: var(--gold); color: var(--navy-deep); }
.chip { border: 1px solid var(--line); background: none; color: var(--ink-soft); border-radius: 999px; padding: 7px 12px; font-size: 13px; }
.chip.on { background: var(--royal-soft); border-color: var(--royal); color: var(--ink); }
.scale { display: flex; gap: 6px; }
.scale button { flex: 1; border: 1px solid var(--line); background: none; color: var(--ink-soft); border-radius: 10px; padding: 9px 0; }
.scale button.on { background: var(--gold); color: var(--navy-deep); border-color: var(--gold); font-weight: 700; }
label.field { display: block; margin: 12px 0 6px; font-size: 13px; color: var(--ink-soft); }
.tag { display: inline-block; font-size: 11px; border-radius: 999px; padding: 3px 8px; margin: 2px 4px 2px 0; background: var(--navy-deep); color: var(--ink-soft); border: 1px solid var(--line); }
.list-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.x { background: none; border: 0; color: var(--pearl-dim); font-size: 18px; }
.note { font-size: 12px; color: var(--pearl-dim); line-height: 1.5; }

/* phase ring */
.hero { display: flex; gap: 18px; align-items: center; }
.ring { width: 132px; height: 132px; flex: none; }
.phase-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 130px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { height: 10px; background: var(--navy-deep); border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 6px; }
.timeline { display: flex; gap: 2px; margin: 10px 0 4px; }
.timeline div { flex: 1; height: 14px; border-radius: 3px; opacity: .45; }
.timeline div.today { opacity: 1; outline: 2px solid var(--ink); outline-offset: 1px; }

/* tabs */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--navy-deep); border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
nav.tabs .in { display: flex; width: 100%; max-width: 720px; justify-content: space-around; }
nav.tabs a { text-decoration: none; color: var(--ink-soft); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; padding: 8px 6px; }
nav.tabs a.on { color: var(--gold); }
details.recipe summary { list-style: none; cursor: pointer; }
details.recipe summary::-webkit-details-marker { display: none; }
details.recipe ol, details.recipe ul { padding-left: 20px; line-height: 1.6; }
.modal { position: fixed; inset: 0; background: rgba(5,8,20,.75); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.modal .sheet { background: var(--card); border: 1px solid var(--card-line); border-radius: 20px 20px 0 0; width: 100%; max-width: 720px; max-height: 88vh; overflow: auto; padding: 20px 18px 30px; }
@media (min-width: 720px) { .modal { align-items: center; } .modal .sheet { border-radius: 20px; } }
