/* 316 Wellness Hub styles. Colors, fonts and radius come from theme.js as
   CSS variables; this file only lays things out. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; margin: 0 0 8px; letter-spacing: -0.02em; }
h1 { font-size: 30px; line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 10px; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* ---------- login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: var(--bg) url('/img/backdrop.svg') center / cover no-repeat;
}
.login .logo { width: 210px; height: auto; margin: 0 auto 18px; display: block; }
.login form { max-width: 380px; width: 100%; margin: 0 auto; }
.login .subtitle { text-align: center; margin: 0 0 6px; font-size: 15px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.login .tagline { text-align: center; margin-bottom: 32px; font-size: 15px; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; color: var(--text-muted); margin: 12px 0 4px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 13px 14px; color: var(--text);
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.btn {
  font: inherit; font-weight: 600; width: 100%; padding: 14px; margin-top: 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 980px;
}
.btn.secondary { background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); }
.btn.small { width: auto; padding: 8px 14px; margin: 0; font-size: 14px; }
.error { color: var(--danger); margin-top: 12px; font-size: 14px; }

/* ---------- shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .logo { height: 26px; width: auto; }
.topbar .who { font-size: 13px; color: var(--text-muted); text-align: right; }
.topbar .who strong { display: block; color: var(--text); font-weight: 600; }
.contextbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 14px;
}
.tier { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--border); }
main.screen { flex: 1; padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--text-muted); font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em; border-radius: 10px; }
.tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--accent); }
@media (min-width: 640px) { .tabbar { max-width: 640px; margin: 0 auto; left: 0; right: 0; border-radius: 16px 16px 0 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); } }

/* ---------- cards and lists ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li:last-child { padding-bottom: 0; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stat { display: flex; flex-direction: column; }
.stat .value { font-family: var(--font-heading); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .label { font-size: 12px; color: var(--text-muted); letter-spacing: 0.02em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.placeholder { text-align: center; padding: 48px 16px; color: var(--text-muted); }
.chev { color: var(--text-muted); }

/* ---------- step 4 additions ---------- */
.progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.1); margin-top: 14px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.numbered { margin: 0; padding: 0 0 0 22px; }
.numbered li { padding: 6px 0; }
.numbered li::marker { color: var(--accent); font-weight: 600; }
.list li .bullet { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; align-self: flex-start; }
.list li:has(.bullet) { justify-content: flex-start; align-items: flex-start; }

/* ---------- step 5 additions ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font: inherit; font-weight: 600; cursor: pointer; }
.chip.current { border-color: var(--accent); color: var(--text); }
.chip.selected { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.exrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; color: inherit; }
.rx { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.video-card video { width: 100%; border-radius: 12px; background: #000; display: block; aspect-ratio: 16 / 9; }
.video-card iframe { width: 100%; border: 0; border-radius: 12px; display: block; aspect-ratio: 16 / 9; }
.ex-image { width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; display: block; margin-bottom: 10px; }
.media-placeholder { text-align: center; padding: 28px 16px; }
.media-placeholder img { width: 72px; opacity: 0.6; }

/* ---------- step 6: charts, photos, history ---------- */
.chart-card .stat .value { font-size: 26px; }
svg.chart { width: 100%; height: auto; display: block; margin-top: 6px; touch-action: pan-y; }
svg.chart .grid { stroke: rgba(255,255,255,0.08); stroke-width: 1; }
svg.chart .area { fill: var(--chart-fill); }
svg.chart .line { fill: none; stroke: var(--chart-line); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .dot { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2; }
svg.chart .val { fill: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
svg.chart .axis { fill: var(--text-muted); font-size: 13px; }
svg.chart .hit { fill: transparent; cursor: crosshair; }
svg.chart .cursor line { stroke: rgba(255,255,255,0.35); stroke-width: 1; stroke-dasharray: 3 3; }
svg.chart .cursor circle { fill: var(--surface); stroke: var(--chart-line); stroke-width: 2; }
.tip { margin-top: 6px; font-size: 13px; color: var(--text); min-height: 18px; font-variant-numeric: tabular-nums; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); display: block; }
.photos figcaption { font-size: 12px; margin-top: 6px; line-height: 1.3; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 500; color: var(--text-muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 0 0 8px; }
.table td { padding: 8px 0; border-top: 1px solid var(--border); }
.table th:not(:first-child), .table td:not(:first-child) { text-align: right; }

/* ---------- step 7: documents ---------- */
.upload-btn { display: block; text-align: center; margin: 0; cursor: pointer; }
.doc-icon { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; }
.doc-icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-title { font-size: 22px; word-break: break-word; }
.doc-card { padding: 8px; }
.doc-frame { width: 100%; height: 70vh; border: 0; border-radius: 12px; background: #fff; display: block; }
.doc-image { width: 100%; height: auto; border-radius: 12px; display: block; }

/* ---------- step 8: coach measurement form ---------- */
.measure-form .grid3 { gap: 10px; }
.measure-form .grid3 label { margin-top: 10px; }
.measure-form input[type=number] { padding-left: 10px; padding-right: 6px; }
@media (max-width: 360px) { .measure-form .grid3 { grid-template-columns: 1fr; } }

/* ---------- workout log: sets ---------- */
.list li.exitem { display: block; }
.exhead { display: flex; align-items: center; gap: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.exhead .status { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; }
.exhead .status svg { width: 16px; height: 16px; stroke: transparent; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.exitem.done .status { background: var(--accent); border-color: var(--accent); }
.exitem.done .status svg { stroke: var(--accent-text); }
.exitem.done .exname strong { color: var(--text-muted); }
.exhead .exname { flex: 1; min-width: 0; }
.exhead .exmeta { flex: 0 0 auto; text-align: right; }
.exhead .rx { font-weight: 600; font-variant-numeric: tabular-nums; }
.exitem.open .exhead .exname strong { color: var(--text); }
.setbox { margin: 12px 0 4px 42px; }
.sets { display: flex; flex-direction: column; gap: 8px; }
.sethead, .setrow { display: grid; grid-template-columns: 22px 1fr 14px 1fr 34px; align-items: center; gap: 6px; }
.sethead { font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.setrow .setno { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: center; }
.setrow label { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 11px; color: var(--text-muted); }
.setrow input { padding: 8px 6px; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; min-width: 0; }
.setrow input::-webkit-outer-spin-button, .setrow input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.setrow input::placeholder { color: rgba(255,255,255,0.28); }
.setrow .x { color: var(--text-muted); text-align: center; }
.tick { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.35); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.tick svg { width: 18px; height: 18px; stroke: transparent; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.setrow.done .tick { background: var(--accent); border-color: var(--accent); }
.setrow.done .tick svg { stroke: var(--accent-text); }
.setrow.done input { color: var(--text-muted); }
.setbox > a { display: inline-block; margin-top: 10px; }
.sessions td:last-child { text-align: left; font-variant-numeric: tabular-nums; }
.table tr.current-row td { color: var(--accent); }

/* ---------- phases, weekdays, editor, library ---------- */
.daycard .dayhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.daycard.rest { padding: 10px 16px; opacity: 0.6; }
.daycard.today { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.workout + .workout { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.workout .wtitle { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.movesel { font: inherit; font-size: 12px; padding: 4px 8px; width: auto; border-radius: 8px; background: var(--surface-raised); color: var(--text-muted); border: 1px solid var(--border); }
.alts { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }
.tempo { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.setrow .settarget { grid-column: 1 / -1; font-size: 11px; color: var(--text-muted); margin: -2px 0 0 28px; }
.sethead { grid-template-columns: 22px 1fr 14px 1fr 34px; }
.setrow.single { grid-template-columns: 22px 1fr 34px; }
.setrow.single label { grid-column: 2; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; background: rgba(255,255,255,0.08); color: var(--text-muted); border: 1px solid var(--border); }
.badge.current { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.badge.upcoming { color: var(--text); }
.phase-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; color: inherit; }
.locked { opacity: 0.55; pointer-events: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.btn.tiny { width: auto; padding: 6px 10px; margin: 0; font-size: 13px; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--border); }
.editrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.editrow label { margin-top: 6px; }
.edit-ex { padding: 12px 0; border-top: 1px solid var(--border); }
.edit-ex:first-child { border-top: 0; }
.edit-ex .exhead { display: flex; justify-content: space-between; gap: 10px; align-items: center; cursor: default; }
.edit-ex .actions { display: flex; gap: 6px; }
.edit-ex .actions button { font: inherit; font-size: 13px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); cursor: pointer; }
.edit-ex details { margin-top: 8px; }
.edit-ex summary { cursor: pointer; font-size: 13px; color: var(--accent); }
textarea { min-height: 110px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.search-results { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; margin-top: 6px; }
.search-results button { display: block; width: 100%; text-align: left; font: inherit; padding: 10px 12px; background: transparent; border: 0; border-top: 1px solid var(--border); color: var(--text); cursor: pointer; }
.search-results button:first-child { border-top: 0; }
.search-results button span { color: var(--text-muted); font-size: 12px; }
.status { font-size: 13px; color: var(--text-muted); min-height: 18px; }
.daygrid { display: flex; gap: 6px; flex-wrap: wrap; }
.daygrid label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text); margin: 0; }
.daygrid input { width: auto; }
.coach-tabs a { font-size: 10.5px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* ---------- calendar ---------- */
.tabbar.many a { font-size: 9.5px; padding: 6px 0; }
.tabbar.many a svg { width: 20px; height: 20px; }
.chip.small { width: auto; height: 32px; border-radius: 999px; padding: 0 12px; font-size: 13px; }
.cal-workout { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; padding: 8px 0; cursor: pointer; border-top: 1px solid var(--border); }
.cal-workout:first-of-type { border-top: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.3); flex: 0 0 9px; }
.dot.done { background: var(--accent); }
.dot.partial { background: transparent; border: 2px solid var(--accent); box-sizing: border-box; }
.cal-card { padding: 10px 6px 12px; margin-left: -8px; margin-right: -8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-head { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; margin-bottom: 4px; }
.cal-cell { position: relative; min-height: 92px; border-radius: 8px; padding: 5px 4px 4px; background: rgba(255,255,255,0.03); display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-cell.past { opacity: 0.6; }
.cal-cell .num { white-space: nowrap; }
.cal-cell .num.month { font-size: 11px; letter-spacing: -0.01em; }
.cal-cell.ph0 { background: rgba(255,255,255,0.06); }
.cal-cell.ph1 { background: rgba(255,69,58,0.10); }
.cal-cell.today { outline: 1.5px solid var(--accent); outline-offset: -1.5px; }
.cal-cell.has { cursor: pointer; }
.cal-cell .num { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1; }
.cal-cell.today .num { color: var(--accent); }
.cal-cell .phlabel { font-size: 9px; color: var(--accent); letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-cell .wt { font-size: 10.5px; color: var(--text); line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cal-cell .dot { width: 8px; height: 8px; flex: 0 0 8px; }
@media (min-width: 640px) { .cal-card { margin-left: 0; margin-right: 0; padding: 14px; } .cal-grid { gap: 6px; } .cal-cell { min-height: 110px; padding: 8px; } .cal-cell .wt { font-size: 12px; } .cal-cell .num { font-size: 15px; } }
.mk { position: absolute; right: 3px; top: 3px; width: 10px; height: 10px; border-radius: 2px; background: var(--text-muted); box-shadow: 0 0 0 4px transparent; }
a.mk { cursor: pointer; }
a.mk:hover, a.mk:focus { background: var(--text); }
.cal-cell a.phlabel { color: var(--accent); }

/* ---------- home: encouragement and next steps ---------- */
.encourage { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.encourage .verse { font-family: var(--font-heading); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin: 0 0 8px; }
.steps .step { justify-content: flex-start; align-items: flex-start; gap: 10px; }
.steps .step .tick { flex: 0 0 30px; width: 30px; height: 30px; margin-top: 1px; }
.steps .step .tick svg { width: 16px; height: 16px; }
.steps .step.done .tick { background: var(--accent); border-color: var(--accent); }
.steps .step.done .tick svg { stroke: var(--accent-text); }
.steps .step.done > span, .steps .step.done .steplink { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.3); }
.steps .step.done .steplink span span { display: none; }
.steplink { flex: 1; min-width: 0; color: inherit; display: flex; }
.step-edit { display: block; }
.step-edit .btn.tiny { padding: 6px 8px; }

/* ---------- blueprint pillars ---------- */
.pillar .pillar-tag { font-family: var(--font-heading); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.pillar.finish { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.pillar.finish .pillar-tag { color: var(--accent); }

/* ---------- progress photo sets ---------- */
.photoset { padding: 12px 0 4px; border-top: 1px solid var(--border); }
.photoset:first-of-type { border-top: 0; padding-top: 4px; }
.photos4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.tile { position: relative; margin: 0; }
.tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); display: block; background: var(--surface-raised); }
.tile.empty { cursor: pointer; }
.tile.empty img { opacity: 0.6; border-style: dashed; }
.tile.has img { cursor: zoom-in; }
.tile figcaption { font-size: 13px; margin-top: 6px; text-align: center; line-height: 1.3; }
.tile figcaption .small { color: var(--text-muted); }
.tile-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.65); color: #fff; font-size: 13px; cursor: pointer; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 85vh; border-radius: 12px; }
.lightbox p { color: var(--text-muted); margin: 0; }

.photonav { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; }
.photonav select { flex: 1; }
.photos4.row4 { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 0; }
.row4 .tile figcaption { font-size: 11px; margin-top: 4px; }
.row4 .tile-x { width: 22px; height: 22px; font-size: 11px; top: 4px; right: 4px; }
.row4 .tile img { border-radius: 8px; }

/* ---------- progress sections ---------- */
.subtabs { margin: 4px 0 14px; }
.subtabs .chip { text-decoration: none; display: inline-flex; align-items: center; }
.latest { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.latest-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.latest-tile.selected { border-color: var(--accent); }
.latest-tile .label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.latest-tile .value { font-family: var(--font-heading); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.latest-tile .unit { font-size: 12px; font-weight: 400; color: var(--text-muted); letter-spacing: 0; }
.latest-tile .delta { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.latest-tile .delta.good { color: var(--success); }
.latest-tile .delta.bad { color: var(--danger); }
.marker-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 34px; gap: 6px; margin-bottom: 8px; align-items: center; }
.marker-row input { padding: 8px 8px; font-size: 14px; }
.marker-row .row-x { padding: 6px 0; }
.table.blood td, .table.blood th { text-align: left; }
.table.blood tr.flag-high td:nth-child(2) strong, .table.blood tr.flag-low td:nth-child(2) strong { color: var(--accent); }
.badge.flag { margin-left: 6px; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }

/* ---------- history by month ---------- */
details.month { border-top: 1px solid var(--border); padding: 8px 0; }
details.month:first-of-type { border-top: 0; }
details.month summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
details.month summary::-webkit-details-marker { display: none; }
details.month summary::before { content: '›'; color: var(--text-muted); margin-right: 8px; display: inline-block; transition: transform 0.15s; }
details.month[open] summary::before { transform: rotate(90deg); }
details.month .table { margin-top: 8px; }

/* ---------- agreements ---------- */
.steps .step.auto .status-dot { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--accent); background: transparent; position: relative; margin-top: 1px; }
.steps .step.auto .status-dot::after { content: '!'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 700; font-size: 14px; }
.agreement .btn.tiny { flex: 0 0 auto; }

/* ---------- PAR-Q ---------- */
.parq-q { padding: 10px 0; border-top: 1px solid var(--border); }
.parq-q:first-of-type { border-top: 0; }
.parq-q p { margin: 0 0 6px; }
.parq-q .daygrid label { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; }
.parq-q .daygrid label:has(input:checked) { border-color: var(--accent); color: var(--text); }

/* ---------- nutrition library ---------- */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.grid5 input { padding: 8px 6px; }
.recipe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.recipe-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; color: inherit; }
.recipe-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-raised); }
.recipe-card .rc-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.recipe-card strong { font-size: 14px; line-height: 1.25; }
.recipe-hero { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.recipe-hero > img { width: 120px; height: 90px; object-fit: cover; border-radius: 12px; flex: 0 0 120px; background: var(--surface-raised); }
.macro-strip .stat .value { font-size: 22px; }
.macro-strip .unit { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.donut-wrap { display: flex; gap: 14px; align-items: center; }
.donut { width: 120px; height: 120px; flex: 0 0 120px; }
.donut-num { fill: var(--text); font-size: 18px; font-weight: 700; font-family: var(--font-heading); }
.donut-lbl { fill: var(--text-muted); font-size: 9px; }
.donut-legend { flex: 1; }
.donut-legend .dot { display: inline-block; vertical-align: middle; margin-right: 6px; }
@media (min-width: 640px) { .recipe-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- meal plans ---------- */
.macro-strip .label .target { font-size: 10px; color: var(--text-muted); letter-spacing: 0; text-transform: none; }
.meal { padding: 10px 0; border-top: 1px solid var(--border); }
.meal:first-of-type { border-top: 0; padding-top: 4px; }
.mealhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mealhead .actions { display: flex; gap: 4px; flex: 0 0 auto; }
.mealhead .actions button, .mi-edit button { font: inherit; font-size: 13px; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-raised); color: var(--text-muted); border: 1px solid var(--border); cursor: pointer; padding: 0; }
.mealhead .actions button:disabled { opacity: 0.35; cursor: default; }
.list.mealitems { margin-top: 6px; }
.list li.mealitem { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.mi-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; }
.mi-link img, .pickrow img { width: 44px; height: 44px; flex: 0 0 44px; object-fit: cover; border-radius: 10px; background: var(--surface-raised); }
.mi-body { display: flex; flex-direction: column; min-width: 0; }
.mi-body strong { font-size: 14px; line-height: 1.25; }
.mi-edit { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.mi-edit input { width: 58px; padding: 6px 4px; text-align: right; font-variant-numeric: tabular-nums; }
.meal.done .mealhead > span > strong { color: var(--text-muted); }
.addfood { margin-top: 8px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.picklist { margin-top: 6px; max-height: 300px; overflow: auto; }
.pickrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; padding: 6px 0; cursor: pointer; }
.pickrow .chev { color: var(--accent); font-size: 20px; }
.inline-details summary { list-style: none; display: inline-block; }
.inline-details summary::-webkit-details-marker { display: none; }
.cal-meal { text-decoration: none; }
.cal-meal .mealicon { width: 22px; height: 22px; flex: 0 0 22px; display: flex; align-items: center; justify-content: center; }
.cal-meal .mealicon svg { width: 18px; height: 18px; fill: none; stroke: var(--text-muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cal-meal.done .mealicon svg { stroke: var(--accent); }
.cal-cell .ml { font-size: 9.5px; color: var(--text-muted); line-height: 1.1; white-space: nowrap; text-decoration: none; border-top: 1px dotted var(--border); padding-top: 2px; margin-top: auto; }
.cal-cell .ml:hover { color: var(--text); }
.mealhead .tick { flex: 0 0 34px; margin-right: 2px; }
.meal.done .tick { background: var(--accent); border-color: var(--accent); }
.meal.done .tick svg { stroke: var(--accent-text); }
.meal.done .mealitems { opacity: 0.6; }
.list li.shoprow { display: block; padding: 0; }
.shoprow label { display: flex; align-items: center; gap: 12px; padding: 10px 0; margin: 0; cursor: pointer; font-size: 15px; color: var(--text); text-transform: none; letter-spacing: 0; }
.shoprow input { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--accent); margin: 0; }
.shoprow .shopbody { flex: 1; min-width: 0; }
.shoprow .qty { font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.shoprow.done strong { color: var(--text-muted); text-decoration: line-through; }
.cal-meal.partial .mealicon svg { stroke: var(--text); }

.list li.replacebox { display:block; padding:8px 0 4px }
.replacebox .picklist { margin-top:6px }
.inline-ask { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 0 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); vertical-align: middle; }
.chip.danger { border-color: var(--danger); color: var(--danger); }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); max-width: 90vw; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.inline-ask.block { display: flex; margin: 8px 0 0; }

/* taking on clients */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.field-error { margin: 4px 0 0; font-size: 13px; }
.checkline { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 4px; color: var(--text); font-size: 15px; }
.checkline input { width: auto; margin: 3px 0 0; flex: 0 0 auto; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-raised); padding: 1px 6px; border-radius: 6px; }
input:disabled { opacity: 0.6; }

details.small summary { cursor: pointer; color: var(--accent); margin: 8px 0 4px; }

/* coach strip on Home; workout cards on Program */
.card.coach { display: flex; align-items: center; gap: 14px; }
.card.coach img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 2px solid color-mix(in srgb, var(--accent) 60%, var(--border)); }
.daycard .workout-card { padding: 10px 0 2px; }
.daycard .workout-card + .workout-card { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }
.workout-card.done strong { color: var(--text-muted); }
