:root {
  --bg: #0F1217; --surface: #171C24; --surface-2: #242B36; --line: #1E242E;
  --text: #EDF1F5; --muted: #94A0B2; --accent: #2FC4A9; --accent-ink: #0F1217;
  --teal: #1F9E88; --blue: #5B8BE0; --amber: #B9841F; --coral: #D9704F; --on: #152B28;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: Manrope, system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1 1 auto; padding: calc(env(safe-area-inset-top) + 20px) 16px 110px; display: flex; flex-direction: column; gap: 14px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
h1 { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.card { background: var(--surface); border-radius: 18px; padding: 14px 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 6px; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.span2 { grid-column: 1 / -1; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .mt8 { margin-top: 8px; }
.small { font-size: 13px; } .tiny { font-size: 11px; } .muted { color: var(--muted); }
.big { font-size: 22px; font-weight: 800; line-height: 1.1; }
.big span, .big small { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat { display: flex; flex-direction: column; }
.stat .big { font-size: 20px; }
.up { color: var(--teal); } .down { color: var(--coral); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 0; color: var(--muted); font-size: 12px; font-weight: 700; min-height: 36px; }
.chip.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ring text { font-family: Manrope, system-ui, sans-serif; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.bar > div { height: 6px; background: var(--blue); border-radius: 3px; }
.dots { display: flex; gap: 4px; margin-top: 8px; }
.dots span { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); }
.dots span.dry { background: var(--teal); } .dots span.wet { background: var(--amber); }

.workout { display: flex; align-items: center; gap: 12px; }
.workout .icon { width: 40px; height: 40px; border-radius: 12px; background: #1F2A2A; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--teal); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.workout .title { font-size: 15px; font-weight: 700; }
.workout .sub { font-size: 12px; color: var(--muted); }

.cta { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 10px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 800; border: 0; width: 100%; }
.cta[disabled] { opacity: 0.6; }
.btn { height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--surface-2); background: transparent; color: var(--text); font-weight: 700; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; }
.notice { background: #2A2416; border: 1px solid #5A4A1F; border-radius: 14px; padding: 12px 14px; font-size: 13px; }
.notice a { color: var(--accent); font-weight: 700; }

.toggle { height: 46px; border-radius: 14px; border: 1px solid var(--surface-2); background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 700; }
.toggle[aria-pressed="true"] { border-color: var(--teal); background: var(--on); color: var(--text); }
.toggle[aria-pressed="true"]::before { content: "✓ "; color: var(--accent); }

.seg { display: flex; gap: 8px; }
.seg button { flex: 1; height: 40px; border-radius: 12px; border: 1px solid var(--surface-2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.seg button.on { border-color: var(--teal); background: var(--on); color: var(--text); }
.small-seg { background: var(--surface); border-radius: 12px; padding: 3px; gap: 0; }
.small-seg button { height: 30px; padding: 0 10px; border: 0; border-radius: 9px; font-size: 12px; flex: 0 0 auto; }
.small-seg button.on { background: var(--surface-2); color: var(--text); }

.round { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--text); font-size: 20px; }
.input { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--surface-2); background: var(--surface-2); color: var(--text); padding: 10px 12px; outline: none; }
.input:focus { border-color: var(--teal); }
.textarea { resize: none; min-height: 60px; background: transparent; border-color: transparent; padding: 4px 0; }
input[type="time"].input { font-size: 18px; font-weight: 800; }

.scale { display: flex; gap: 6px; }
.scale button { flex: 1; height: 40px; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.scale button.on { background: var(--accent); color: var(--accent-ink); font-weight: 800; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--surface-2); background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; min-height: 36px; }
.chips button[data-level="1"] { border-color: var(--amber); color: var(--text); background: #2A2416; }
.chips button[data-level="2"] { border-color: var(--coral); color: var(--text); background: #2E1F1A; }
.chips button[data-level="3"] { border-color: var(--coral); color: var(--text); background: var(--coral); color: var(--accent-ink); }

details.card summary { list-style: none; cursor: pointer; }
details.card summary::-webkit-details-marker { display: none; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(76px + env(safe-area-inset-bottom)); padding: 10px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 480px; margin: 0 auto; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); min-height: 44px; justify-content: center; }
.nav a.on { color: var(--accent); font-weight: 700; }

.icon-sq { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dot { width: 12px; height: 12px; border-radius: 6px; display: inline-block; flex: 0 0 auto; }
a.card { color: inherit; }
