/* Ayush app screens — builds on styles.css tokens */
.app-body { min-height: 100vh; display: flex; flex-direction: column; }
.app-body main { flex: 1; }
.app-header .wrap { min-height: 60px; }
.app-header .help-btn { --b-bg: transparent; --b-fg: var(--danger); --b-line: var(--danger); }
.app-header .help-btn:hover { background: var(--danger-soft); }
.id-chip { font: 600 .82rem var(--font-mono); padding: .25rem .55rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 640px) { .id-chip { display: none; } .app-header .back-site { display: none; } }

.app-tabs { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.app-tabs .wrap { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.app-tabs .wrap::-webkit-scrollbar { display: none; }
.app-tabs a { flex: none; padding: .8rem .85rem .7rem; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; border-bottom: 3px solid transparent; }
.app-tabs a:hover { color: var(--ink); }
.app-tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

.view { padding-block: 1.75rem 3rem; display: flex; flex-direction: column; gap: 1.5rem; }
.view-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-end; }
.view-head h1 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.3rem); }
.view-head p { color: var(--ink-2); }
.sample-bar { background: var(--accent-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: .92rem; }
.sample-bar .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding-block: .5rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.25rem; }
.panel-head h3 { font-size: 1.1rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* Ring */
.ring-wrap { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.ring { width: 132px; height: 132px; flex: none; }
.ring .bg { fill: none; stroke: var(--surface-3); }
.ring .fg { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ring .val { fill: var(--ink); font: 700 30px var(--font-display); }
.ring .sub { fill: var(--ink-3); font: 600 11px var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.stat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: .75rem 1rem; }
.stat { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.stat dt, .stat .k { font-size: .8rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.stat dd, .stat .v { margin: 0; font: 700 1.3rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.stat .v small { font: 500 .85rem var(--font-body); color: var(--ink-3); }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.task { display: grid; grid-template-columns: 74px 30px minmax(0, 1fr) auto; gap: .5rem .7rem; align-items: start; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-time { font: 600 .85rem var(--font-body); color: var(--ink-3); padding-top: .2rem; font-variant-numeric: tabular-nums; }
.task-check { width: 26px; height: 26px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.task-body { min-width: 0; }
.task-title { font-weight: 600; line-height: 1.35; }
.task-detail { font-size: .9rem; color: var(--ink-2); }
.task.done .task-title { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.task .chip { margin-top: .1rem; }
@media (max-width: 520px) { .task { grid-template-columns: 30px minmax(0, 1fr); } .task-time { grid-column: 2; order: -1; padding: 0; } .task .chip { display: none; } .task-check { grid-row: span 2; } }
.g-Food { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.g-Movement { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.g-Yoga { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.g-Sleep { background: var(--sleep-soft); color: var(--sleep); border-color: transparent; }
.g-Mind { background: var(--surface-2); color: var(--ink-2); }
.g-Log { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* Sub tabs and day picker */
.subtabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.subtabs button, .day-picker button { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); padding: .45rem .9rem; border-radius: 999px; font: 600 .92rem var(--font-body); cursor: pointer; min-height: 40px; }
.subtabs button[aria-pressed="true"], .day-picker button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.day-picker { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: 2px; }
.day-picker button { padding: .4rem .7rem; flex: none; }
.day-picker button .today-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: .35rem; vertical-align: middle; }

/* Meals */
.meal { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: .5rem 1.1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.meal:last-child { border-bottom: 0; }
.meal-slot { font-weight: 600; color: var(--ink-3); font-size: .9rem; }
.meal-slot span { display: block; font-weight: 500; font-variant-numeric: tabular-nums; }
.meal h3 { font-size: 1.1rem; }
.meal .portion { color: var(--ink-2); font-size: .95rem; }
.nutri { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88rem; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: .25rem; }
.nutri b { color: var(--ink); font-weight: 600; }
.adapt { font-size: .9rem; color: var(--ink); background: var(--brand-soft); border-radius: var(--r-sm); padding: .4rem .6rem; margin-top: .4rem; }
.tip { font-size: .9rem; color: var(--ink-2); margin-top: .35rem; }
@media (max-width: 560px) { .meal { grid-template-columns: 1fr; } }
.bars { display: flex; flex-direction: column; gap: .6rem; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 110px; gap: .75rem; align-items: center; font-size: .9rem; }
.bar-row .track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 4px; background: var(--brand); }
.bar-row .fill.over { background: var(--warn); }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
@media (max-width: 480px) { .bar-row { grid-template-columns: 84px minmax(0, 1fr) 92px; } }
.grocery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem 1.5rem; }
.grocery h4 { font-size: .95rem; margin-bottom: .35rem; }
.grocery ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.grocery label { display: flex; gap: .5rem; align-items: center; font-size: .95rem; cursor: pointer; }
.grocery input { accent-color: var(--brand); width: 18px; height: 18px; }
.grocery input:checked + span { text-decoration: line-through; color: var(--ink-3); }

/* Exercise and yoga rows */
.ex-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.ex-list > li { border-bottom: 1px solid var(--line); }
.ex-list > li:last-child { border-bottom: 0; }
.ex-list details summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; padding: .7rem 0; align-items: baseline; }
.ex-list details summary::-webkit-details-marker { display: none; }
.ex-list details summary .name { font-weight: 600; }
.ex-list details summary .name small { font-weight: 400; color: var(--ink-3); }
.ex-list details summary .dose { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.ex-list details[open] summary .name { color: var(--brand); }
.ex-list .ex-body { padding: 0 0 .9rem; color: var(--ink-2); font-size: .95rem; display: flex; flex-direction: column; gap: .35rem; }
.group-label { font: 600 .78rem var(--font-body); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding-top: .8rem; }
.plain-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.plain-list li { display: flex; gap: .55rem; }
.plain-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); margin-top: .62em; flex: none; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: .75rem; padding: .55rem 0; border-left: 2px solid var(--sleep-soft); padding-left: 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .95rem; width: 10px; height: 10px; border-radius: 50%; background: var(--sleep); }
.timeline .at { font-weight: 600; color: var(--sleep); font-variant-numeric: tabular-nums; }
.big-time { font: 700 2.2rem/1 var(--font-display); color: var(--sleep); font-variant-numeric: tabular-nums; }

/* Breathing */
.breath { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.breath-circle { width: 96px; height: 96px; border-radius: 50%; background: var(--brand-soft); border: 2px solid var(--brand); display: grid; place-items: center; font-weight: 600; color: var(--brand); font-size: .9rem; transform: scale(.7); transition: transform 4s ease-in-out; flex: none; }
.breath-circle.in { transform: scale(1); transition-duration: 4s; }
.breath-circle.out { transform: scale(.7); transition-duration: 6s; }

/* Flags */
.flag { border-radius: var(--r-lg); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; border: 2px solid; }
.flag h3 { font-size: 1.15rem; }
.flag-emergency, .flag-crisis { background: var(--danger-soft); border-color: var(--danger); }
.flag-emergency h3, .flag-crisis h3 { color: var(--danger); }
.flag-urgent { background: var(--warn-soft); border-color: var(--warn); }
.flag-caution, .flag-care { background: var(--surface-2); border-color: var(--line-2); }

/* Charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1.25rem; }
.chart-card .latest { font: 700 1.6rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.chart-card .latest small { font: 500 .85rem var(--font-body); color: var(--ink-3); }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { fill: var(--ink-3); font: 500 11px var(--font-body); }
.chart-svg .band { fill: var(--ok-soft); }
.chart-svg .band-lbl { fill: var(--ok); font: 600 10.5px var(--font-body); }
.chart-svg .ref { stroke: var(--ink-3); stroke-dasharray: 4 4; stroke-width: 1; }
.chart-svg .ref-lbl { fill: var(--ink-3); font: 600 10.5px var(--font-body); }
.chart-svg .l1 { fill: none; stroke: var(--brand); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .l2 { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .a1 { fill: var(--brand); opacity: .1; }
.chart-svg .p1 { fill: var(--brand); }
.chart-svg .p2 { fill: var(--accent); }
.chart-svg .end1 { fill: var(--surface); stroke: var(--brand); stroke-width: 2.5; }
.chart-svg .end2 { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.chart-svg .bar { fill: var(--brand); opacity: .85; }
.chart-svg .bar-sleep { fill: var(--sleep); opacity: .8; }
.chart-svg .bar-low { fill: var(--line-2); }
.legend { display: flex; gap: 1rem; font-size: .85rem; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* Welcome and onboarding */
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.5rem; align-items: start; }
@media (max-width: 880px) { .welcome-grid { grid-template-columns: 1fr; } }
.persona-tile { display: flex; gap: .9rem; align-items: center; padding: .9rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; cursor: pointer; width: 100%; font: inherit; color: var(--ink); }
.persona-tile:hover { border-color: var(--brand); background: var(--brand-soft); }
.persona-tile p { font-size: .9rem; color: var(--ink-2); }
.otp { font: 600 1.6rem var(--font-mono); letter-spacing: .5em; text-align: center; max-width: 260px; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--ink-3); font-size: .88rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.healthid-big { font: 700 clamp(1.4rem, 1rem + 2vw, 2rem) var(--font-mono); letter-spacing: .04em; color: var(--brand); background: var(--brand-soft); border-radius: var(--r); padding: .7rem 1rem; display: inline-block; user-select: all; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); border-radius: 4px; transition: width .3s ease; }
.step-names { display: flex; gap: .3rem; flex-wrap: wrap; font-size: .82rem; }
.step-names span { padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); }
.step-names span.cur { background: var(--brand); color: var(--brand-ink); }
.step-names span.done { background: var(--brand-soft); color: var(--brand); }
@media (max-width: 700px) { .step-names { display: none; } }
.form-actions { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding-top: .5rem; border-top: 1px solid var(--line); }

/* Projections and milestones */
.proj { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.proj:last-child { border-bottom: 0; }
.proj .ft { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; font-variant-numeric: tabular-nums; }
.proj .arrow { color: var(--ink-3); }
.milestones { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.milestones li { padding: 1rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: .4rem; }
.milestones li.current { border: 2px solid var(--accent); }
.milestones .mnum { font: 600 .8rem var(--font-body); color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; }

/* Report */
.report-sheet { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 2.5rem); display: flex; flex-direction: column; gap: 1.4rem; }
.report-sheet h2 { font-size: 1.15rem; border-bottom: 2px solid var(--ink); padding-bottom: .3rem; }
.report-sheet table { font-size: .92rem; }
.report-sheet th, .report-sheet td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.report-sheet th { font-weight: 600; background: var(--surface-2); }
.report-sheet td.num, .report-sheet th.num { text-align: right; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .4rem 1.5rem; font-size: .95rem; }
.kv div { display: flex; gap: .5rem; justify-content: space-between; border-bottom: 1px dotted var(--line); padding: .2rem 0; }
.kv span:first-child { color: var(--ink-3); }

/* Help overlay */
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem; }

/* Data export */
.export-box { font: 400 .8rem/1.45 var(--font-mono); min-height: 200px; }
@media print {
  .app-header, .app-tabs, .sample-bar, .report-toolbar { display: none !important; }
  .view { padding: 0; }
}

@media (max-width: 900px) { .today-list { order: -1; } }
