:root {
  --bg: #EEF2EF; --card: #ffffff; --card-2: #E3E9E4; --ink: #152420; --muted: #54655D; --faint: #8B978F;
  --line: #D4DCD6; --accent: #1E7A5C; --accent-ink: #F4FBF7; --soft: #DCEEE4; --flame: #DB9A2E; --flame-soft: #F6E7C9;
  --shadow: 0 1px 2px rgba(21,36,32,.06), 0 6px 16px rgba(21,36,32,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1512; --card: #161F1B; --card-2: #1D2822; --ink: #EAF2EC; --muted: #9FB2A9; --faint: #6C7C74;
    --line: #2A3630; --accent: #3DB489; --accent-ink: #08130F; --soft: #1C3A2E; --flame: #EAB253; --flame-soft: #3A2E17;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1512; --card: #161F1B; --card-2: #1D2822; --ink: #EAF2EC; --muted: #9FB2A9; --faint: #6C7C74;
  --line: #2A3630; --accent: #3DB489; --accent-ink: #08130F; --soft: #1C3A2E; --flame: #EAB253; --flame-soft: #3A2E17;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 460px; margin: 0 auto; padding: 64px 16px 64px; display: flex; flex-direction: column; gap: 22px; }

.theme {
  position: fixed; top: 12px; right: 12px; z-index: 5; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 16px; cursor: pointer;
  box-shadow: var(--shadow);
}

a { color: var(--accent); }
.mono { font-variant-numeric: tabular-nums; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; color: var(--faint); }
.impact { font-weight: 800; letter-spacing: -.01em; }

.brand { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
h1 { font-size: clamp(26px, 8vw, 32px); line-height: 1.05; margin: 6px 0 4px; font-weight: 800; letter-spacing: -.01em; }
p.lede { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 38ch; }
p.lede b { color: var(--ink); font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }

/* Streak */
.streak-card { padding: 18px 20px; display: flex; align-items: center; gap: 18px; }
.streak-num { font-size: 52px; font-weight: 800; line-height: 1; color: var(--accent); flex-shrink: 0; }
.streak-body { flex: 1; min-width: 0; }
.streak-label { font-weight: 700; font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.history { display: flex; gap: 6px; }
.history-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.history-dot { width: 100%; aspect-ratio: 1; max-width: 26px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card-2); }
.history-dot.half { background: linear-gradient(135deg, var(--accent) 50%, var(--card-2) 50%); border-color: var(--accent); }
.history-dot.full { background: var(--accent); border-color: var(--accent); }
.history-dot.today { box-shadow: 0 0 0 2px var(--flame-soft), 0 0 0 3.5px var(--flame); }
.history-day span { font-size: 10px; color: var(--faint); font-weight: 700; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h2 { font-weight: 800; font-size: 17px; letter-spacing: .01em; margin: 0; text-transform: uppercase; }
.section-head .hint { font-size: 12px; color: var(--faint); }


.goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.goals li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.goals .num { font-weight: 800; font-size: 18px; color: var(--flame); flex-shrink: 0; width: 20px; }
.goals .txt { font-size: 14px; line-height: 1.45; }
.goals .txt small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); }
.chip.on { background: var(--soft); border-color: var(--accent); color: var(--accent); }

.plan-start { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 12px; }
.plan-start input[type="date"] { font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); padding: 3px 6px; }
.roadmap { display: flex; flex-direction: column; gap: 8px; }
.phase { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); }
.phase.current { border-color: var(--flame); background: var(--flame-soft); }
.phase .p-num { font-weight: 800; font-size: 20px; grid-row: 1 / 3; color: var(--faint); }
.phase.current .p-num { color: var(--flame); }
.phase .p-name { font-weight: 700; font-size: 14px; }
.phase .p-focus { font-size: 12px; color: var(--muted); grid-column: 2/3; }
.phase .p-meta { font-size: 11px; color: var(--faint); text-align: right; grid-row: 1/3; line-height: 1.5; white-space: nowrap; }

.next-session { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.next-session svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); margin-top: 1px; }
.next-session .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.next-session .val { font-weight: 700; font-size: 14.5px; margin-top: 1px; }

.in-clinic { padding: 14px 16px; }

footer { padding-top: 4px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); line-height: 1.6; }
footer .clinic-name { font-weight: 700; color: var(--muted); }
footer .locations { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 8px; }
footer .privacy { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }

button.link { background: none; border: none; color: var(--accent); font-weight: 700; font-size: 12.5px; cursor: pointer; padding: 0; text-decoration: underline; font-family: inherit; }

/* Home Exercise Program */
.hep-intro { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.hep-list { display: flex; flex-direction: column; gap: 14px; }
.hep { padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 1.5px solid var(--line); }
.hep.done { border-color: var(--accent); }
.hep-top { display: flex; gap: 12px; align-items: flex-start; }
.hep-check {
  font: inherit; font-weight: 800; font-size: 20px; color: var(--accent-ink); background: var(--accent);
  width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: none; cursor: pointer; padding: 0;
}
.hep-check svg { width: 18px; height: 18px; }
.hep-check:disabled { cursor: default; }
.hep-check.done { background: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.hep-title h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; line-height: 1.2; }
.hep-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: 3px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.tag.when { background: var(--flame-soft); color: var(--flame); border-color: var(--flame); }
.hep-img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.hep-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.hep-steps li::marker { color: var(--accent); font-weight: 700; }
.hep-purpose { margin: 0; font-size: 13px; color: var(--muted); }
.hep-purpose b { color: var(--ink); }
.hep-dose { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; font-weight: 700; }
.hep-dose label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); }
.freq { font: inherit; font-size: 13px; width: 130px; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); padding: 4px 8px; }

/* Cloud sync */
.sync-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11.5px; font-weight: 700; color: var(--accent); }
.sync-badge svg, .sync-badge .flame { width: 13px; height: 13px; }
.sync-badge.owner { color: var(--flame); }
.sync-badge.pending { color: var(--faint); }

.exercise:disabled, .freq:disabled { cursor: default; opacity: .75; }
.exercise:disabled .box { border-color: var(--line); }

.ownerbox { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.owner-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--flame); }
.owner-pill svg { width: 12px; height: 12px; }
#signin-form { display: flex; flex-wrap: wrap; gap: 6px; }
#signin-form input { font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); padding: 5px 8px; }
#signin-form button { font: inherit; font-size: 12.5px; font-weight: 700; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: var(--accent-ink); padding: 5px 10px; cursor: pointer; }
.auth-error { font-size: 11.5px; color: var(--flame); }

.google-btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
  padding: 7px 12px; cursor: pointer; box-shadow: var(--shadow);
}
.google-btn:hover { border-color: var(--faint); }
