/* Self-Care OS — calm, clinical-meets-athletic. Dark first. One accent per domain. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", -apple-system, "Space Grotesk", system-ui, sans-serif;
  --r-card: 24px; --r-btn: 16px; --r-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: calc(68px + var(--safe-b));
}
:root, [data-theme="dark"] {
  --bg: #0B0D10; --card: #15181D; --card2: #1E232B; --card3: #2A303A;
  --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.16); --track: rgba(255,255,255,.09);
  --tx: #F2F4F7; --tx2: #A6ADB8; --tx3: #7E8693; --on-accent: #0B0D10;
  --skin: #FF9E80; --hair: #B3A4FF; --gym: #B8F15A; --diet: #5CD6C0; --water: #7CC4FF; --warn: #FFC861;
  --gym-2: #E3FAB8; --gym-3: #8DBF3F; --neutral-bar: #9FB0C4;
  --tab-bg: rgba(15,17,21,.92); --shadow: 0 12px 32px rgba(0,0,0,.45);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F3F4F6; --card: #FFFFFF; --card2: #EEF0F3; --card3: #E2E5EA;
  --line: rgba(14,17,22,.08); --line2: rgba(14,17,22,.18); --track: rgba(14,17,22,.08);
  --tx: #0E1116; --tx2: #4A5260; --tx3: #6B7280; --on-accent: #FFFFFF;
  --skin: #B8492A; --hair: #5B46D6; --gym: #3D6A00; --diet: #0A7A69; --water: #1F6FC4; --warn: #8A5A00;
  --gym-2: #6E9E1F; --gym-3: #24400A; --neutral-bar: #7A8799;
  --tab-bg: rgba(255,255,255,.94); --shadow: 0 12px 32px rgba(14,17,22,.12);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    --bg: #F3F4F6; --card: #FFFFFF; --card2: #EEF0F3; --card3: #E2E5EA;
    --line: rgba(14,17,22,.08); --line2: rgba(14,17,22,.18); --track: rgba(14,17,22,.08);
    --tx: #0E1116; --tx2: #4A5260; --tx3: #6B7280; --on-accent: #FFFFFF;
    --skin: #B8492A; --hair: #5B46D6; --gym: #3D6A00; --diet: #0A7A69; --water: #1F6FC4; --warn: #8A5A00;
    --gym-2: #6E9E1F; --gym-3: #24400A; --neutral-bar: #7A8799;
    --tab-bg: rgba(255,255,255,.94); --shadow: 0 12px 32px rgba(14,17,22,.12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; padding-bottom: var(--nav-h); }
body.no-nav { padding-bottom: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; border-radius: 8px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#view { outline: none; }

/* layout utilities */
.pad { padding: calc(20px + var(--safe-t)) 16px 32px; max-width: 560px; margin: 0 auto; }
.row { display: flex; align-items: center; }
.row.baseline { align-items: baseline; } .row.end { align-items: flex-end; }
.between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; } .stack-10 { display: flex; flex-direction: column; gap: 10px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; } .stack-14 { display: flex; flex-direction: column; gap: 14px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.w-full { width: 100%; } .right { text-align: right; } .center { text-align: center; } .block { display: block; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.center-stack { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px; }
.desk-only { display: none !important; }

/* type */
.muted { color: var(--tx2); } .small { font-size: 13px; } .strong { font-weight: 600; }
.micro { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.big { font-size: 22px; } .tx { color: var(--tx); }
.title { font-family: var(--font-num); font-size: 32px; line-height: 1.12; font-weight: 650; letter-spacing: -.02em; margin: 6px 0 12px; }
.title.xl { font-size: 36px; }
.h2 { font-family: var(--font-num); font-size: 26px; font-weight: 650; margin: 4px 0; } .h3 { font-size: 17px; font-weight: 650; margin: 0; }
.kicker { display: block; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--tx2); }
.section-label { font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--tx2); margin: 20px 4px 8px; }
.lead { font-size: 16px; font-weight: 500; line-height: 1.45; margin: 8px 0; }
.score-xl { font-size: 44px; font-weight: 650; line-height: 1; }
p { margin: 6px 0; }

/* surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; }
.card.outline { background: transparent; }
.card.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.notice { margin-bottom: 12px; }
.warn { display: flex; gap: 12px; align-items: flex-start; border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--card)); }
.warn > .ic { color: var(--warn); flex-shrink: 0; margin-top: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-right: 8px; flex-shrink: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--r-btn); border: 1px solid transparent; background: var(--card2); color: var(--tx); font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .08s, opacity .15s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[data-busy] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--tx); color: var(--bg); }
.btn-ghost { background: transparent; border-color: var(--line2); }
.btn-ghost.muted { color: var(--tx2); }
.btn-soft { background: var(--card2); border-color: var(--line); }
.btn-skin { background: var(--skin); color: var(--on-accent); }
.btn-gym { background: var(--gym); color: var(--on-accent); }
.btn-water { background: color-mix(in srgb, var(--water) 16%, transparent); color: var(--water); }
.btn-lg { min-height: 56px; font-size: 17px; border-radius: 18px; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 22px; cursor: pointer; color: var(--tx2); }
.icon-btn:disabled { opacity: .3; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px 0 14px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 13px; font-weight: 650; cursor: pointer; }
.pill-accent { padding: 0 14px; margin-bottom: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--card2); display: flex; align-items: center; justify-content: center; }

/* chips + tags */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px; font-weight: 600; background: var(--card); border: 1px solid var(--line); }
.chip-skin { background: color-mix(in srgb, var(--skin) 15%, transparent); color: var(--skin); border-color: transparent; }
.chip-gym { background: color-mix(in srgb, var(--gym) 15%, transparent); color: var(--gym); border-color: transparent; }
.chip-diet { background: color-mix(in srgb, var(--diet) 15%, transparent); color: var(--diet); border-color: transparent; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 650; background: var(--card2); color: var(--tx2); white-space: nowrap; }
.tag-skin { background: color-mix(in srgb, var(--skin) 15%, transparent); color: var(--skin); }
.tag-hair { background: color-mix(in srgb, var(--hair) 15%, transparent); color: var(--hair); }
.tag-gym { background: color-mix(in srgb, var(--gym) 15%, transparent); color: var(--gym); }
.tag-diet { background: color-mix(in srgb, var(--diet) 15%, transparent); color: var(--diet); }

/* today */
.today-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.day-nav .icon-btn { width: 36px; height: 44px; }
.today-grid { display: flex; flex-direction: column; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.rings-card { display: flex; flex-direction: column; gap: 14px; }
.rings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring-svg { position: relative; }
.ring-arc { transition: stroke-dasharray .5s cubic-bezier(.2,.8,.2,1); }
.ring-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 650; }
.ring-label { text-align: center; line-height: 1.25; } .ring-label b { display: block; font-size: 12px; } .ring-label span { font-size: 11px; color: var(--tx2); }
.levelup { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; }
.levelup b { display: block; font-size: 14px; } .levelup span { font-size: 13px; }
.lv-ic { width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--diet) 16%, transparent); color: var(--diet); flex-shrink: 0; }
.sugg h3 { font-family: var(--font-num); font-size: 20px; margin: 10px 0 4px; }
.kicker-row { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--tx2); }
.evidence { margin: 8px 0 12px; } .evidence summary { font-weight: 650; min-height: 44px; display: flex; align-items: center; cursor: pointer; list-style: none; }
.evidence summary::-webkit-details-marker { display: none; }
.spark { display: flex; gap: 8px; align-items: flex-end; padding: 8px 0; overflow-x: auto; }
.spark-col { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--tx2); min-width: 28px; }
.spark-bar { width: 14px; border-radius: 4px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.time { font-family: var(--font-num); font-size: 13px; font-weight: 650; color: var(--tx2); }
.count { font-size: 14px; font-weight: 650; color: var(--tx2); }
.card-title { display: flex; align-items: center; gap: 4px; font-family: var(--font-num); font-size: 20px; font-weight: 650; text-decoration: none; margin-bottom: 6px; }
.card-title .ic { color: var(--tx3); }
.steps, .steps-card { display: flex; flex-direction: column; }
.steps-card { padding: 4px 16px; }
.step { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 6px 0; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.steps-card .step:first-child { border-top: 0; }
.box { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--tx3); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--on-accent); transition: transform .12s; }
.box-done { border: 0; animation: pop .22s ease-out; }
.box-skip { border-style: dashed; color: var(--tx2); font-weight: 700; }
@keyframes pop { 0% { transform: scale(.7); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.step-text { flex: 1; min-width: 0; line-height: 1.3; } .step-text b { display: block; font-weight: 550; font-size: 15px; } .step-text span { display: block; font-size: 13px; color: var(--tx2); }
.step.is-skipped .step-text b { color: var(--tx2); }
.step-tag { font-size: 13px; font-weight: 650; color: var(--tx2); }
.done-banner { min-height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 12px; font-size: 14px; font-weight: 650; background: color-mix(in srgb, var(--b, var(--skin)) 14%, transparent); color: var(--b, var(--skin)); }
.photo-tile { min-height: 68px; border-radius: 14px; border: 1.5px dashed var(--line2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-size: 13px; color: var(--tx2); }
.photo-tile.is-done { border-style: solid; border-color: transparent; background: color-mix(in srgb, var(--gym) 12%, transparent); color: var(--tx); }
.photo-tile.is-done .ic { color: var(--gym); }
.photo-tile small { font-size: 11px; color: var(--tx2); }
.mini { padding: 10px; border-radius: 14px; background: var(--card2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini span { font-size: 12px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mini b { font-size: 17px; font-weight: 650; } .mini b.big { font-size: 28px; }
.field-inline { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: 14px; background: var(--card2); font-size: 14px; color: var(--tx2); }
.field-inline input { width: 72px; border: 0; background: transparent; font-family: var(--font-num); font-size: 17px; font-weight: 650; color: var(--tx); text-align: right; }
.checkin-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.checkin-row > span { font-size: 14px; color: var(--tx2); width: 70px; flex-shrink: 0; }
.review-link { text-decoration: none; display: block; }
.kv { display: flex; justify-content: space-between; align-items: center; min-height: 40px; border-top: 1px solid var(--line); font-size: 14px; }
.kv:first-of-type { border-top: 0; } .kv span { color: var(--tx2); }

/* segmented */
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg-btn { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line2); background: transparent; font-weight: 650; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.seg-btn.wide { min-width: 58px; }
.seg-btn.on { background: var(--tx); color: var(--bg); border-color: var(--tx); }
.seg-full { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.seg-full .seg-btn { border: 0; border-radius: 10px; color: var(--tx2); }
.seg-full .seg-btn.on { background: var(--card3); color: var(--tx); }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; margin: -8px -8px 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px; border: 0; background: none; text-decoration: none; font-size: 16px; font-weight: 500; cursor: pointer; }
.page-head { margin-bottom: 12px; }

/* routine */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; margin: 12px 0; }
.week-strip > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day-dot { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--card2); color: var(--tx2); font-weight: 650; font-size: 13px; }
.day-dot.is-active { background: color-mix(in srgb, var(--skin) 18%, transparent); color: var(--skin); }
.day-dot.is-today { outline: 2px solid var(--tx); outline-offset: 2px; }
.routine-list { list-style: none; margin: 0; padding: 0; }
.routine-step { display: flex; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.routine-step b { font-size: 16px; }
.num-badge { width: 36px; height: 36px; border-radius: 18px; background: var(--card2); border: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-num); font-weight: 650; font-size: 15px; flex-shrink: 0; cursor: pointer; color: var(--tx); }
.num-badge.is-active { background: var(--skin); color: var(--on-accent); }
.num-badge.is-hair { background: color-mix(in srgb, var(--hair) 18%, transparent); color: var(--hair); }
.num-badge.is-done { background: var(--diet); color: var(--on-accent); }
.sticky-cta { position: sticky; bottom: calc(var(--nav-h) + 8px); padding-top: 16px; margin-top: 16px; }
.no-nav .sticky-cta { bottom: calc(12px + var(--safe-b)); }
.guided-body { padding: 32px 0; display: flex; flex-direction: column; gap: 8px; }
.big-amount { font-family: var(--font-num); font-size: 22px; font-weight: 650; }
.timer-big { font-size: 72px; font-weight: 650; letter-spacing: -.02em; margin-top: 24px; }
.progress-seg { display: flex; gap: 6px; }
.progress-seg > * { flex: 1; height: 6px; border-radius: 3px; background: var(--track); border: 0; padding: 0; cursor: pointer; }
.progress-seg button { height: 10px; background-clip: content-box; padding: 2px 0; }
.progress-seg .on { background-color: var(--gym); } .progress-seg .cur { background-color: var(--tx); }
.onboarding .progress-seg .on { background-color: var(--tx); }

/* camera */
.camera { position: fixed; inset: 0; background: #050608; color: #F2F4F7; overflow: hidden; }
.camera video, .camera .ghost { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera.mirror video { transform: scaleX(-1); }
.camera .ghost { pointer-events: none; mix-blend-mode: screen; }
.guide-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.guide-svg .g { fill: rgba(242,244,247,.05); stroke: rgba(242,244,247,.55); stroke-width: 2; stroke-dasharray: 7 7; }
.guide-svg .g2 { fill: none; stroke: #B8F15A; stroke-opacity: .6; stroke-width: 1.5; stroke-dasharray: 4 6; }
.cam-top { position: absolute; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cam-btn { width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; cursor: pointer; color: #F2F4F7; }
.cam-kinds { display: flex; gap: 4px; padding: 4px; border-radius: 22px; background: rgba(0,0,0,.45); }
.cam-kind { height: 36px; padding: 0 12px; border-radius: 18px; display: flex; align-items: center; font-size: 13px; font-weight: 600; text-decoration: none; color: #C9CED6; }
.cam-kind.on { background: #F2F4F7; color: #0B0D10; font-weight: 700; }
.cam-light { position: absolute; top: calc(68px + var(--safe-t)); left: 50%; transform: translateX(-50%); height: 40px; padding: 0 16px; border-radius: 20px; display: flex; align-items: center; font-size: 14px; font-weight: 650; white-space: nowrap; }
.cam-light.warn { background: #FFC861; color: #1A1407; } .cam-light.ok { background: rgba(184,241,90,.92); color: #0B0D10; }
.cam-hint { position: absolute; top: calc(118px + var(--safe-t)); left: 24px; right: 24px; text-align: center; font-size: 13px; color: #D5D9DF; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.cam-ghost { position: absolute; left: 16px; right: 16px; bottom: calc(210px + var(--safe-b)); display: flex; align-items: center; gap: 10px; font-size: 12px; color: #C9CED6; }
.cam-ghost input { flex: 1; height: 44px; accent-color: #F2F4F7; }
.cam-countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 140px; font-weight: 700; color: #F2F4F7; text-shadow: 0 4px 24px rgba(0,0,0,.6); pointer-events: none; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(20px + var(--safe-b)); background: linear-gradient(rgba(5,6,8,0), rgba(5,6,8,.92) 30%); display: flex; flex-direction: column; gap: 16px; }
.cam-angles { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.cam-angle { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #C9CED6; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cam-angle.done { background: rgba(184,241,90,.16); color: #B8F15A; border-color: transparent; }
.cam-angle.on { background: #F2F4F7; color: #0B0D10; border-color: #F2F4F7; font-weight: 700; }
.cam-row { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.cam-count { width: 64px; font-size: 15px; font-weight: 650; text-align: center; } .cam-count small { display: block; font-family: var(--font); font-size: 11px; color: #A6ADB8; }
.shutter { width: 80px; height: 80px; border-radius: 40px; border: 4px solid #F2F4F7; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.shutter span { width: 64px; height: 64px; border-radius: 32px; background: #F2F4F7; transition: transform .1s; }
.shutter:active span { transform: scale(.88); }
.cam-file { width: 64px; height: 52px; border-radius: 14px; border: 1px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cam-status { text-align: center; font-weight: 600; margin: 0; }

/* analysis */
.cmp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cmp-fig { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.cmp-fig img, .ph-empty { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 20px; background: var(--card2); }
.ph-empty { display: flex; align-items: center; justify-content: center; color: var(--tx3); font-size: 13px; }
.cmp-fig figcaption { font-size: 13px; color: var(--tx2); }
.score-bar { display: flex; flex-direction: column; gap: 7px; }
.score-bar .row { gap: 8px; font-size: 14px; } .score-bar .row b { font-size: 15px; }
.score-bar .trend { min-width: 96px; text-align: right; font-size: 12px; font-weight: 650; }
.bar { position: relative; height: 8px; border-radius: 4px; background: var(--track); }
.bar.thick { height: 10px; border-radius: 5px; }
.bar .fill { height: 100%; border-radius: inherit; transition: width .4s; }
.bar .tick { position: absolute; top: -3px; width: 2px; height: 14px; border-radius: 1px; background: var(--tx3); }
.slider-row { display: grid; grid-template-columns: 1fr 1.2fr 36px; align-items: center; gap: 10px; font-size: 14px; }
.slider-row input { width: 100%; height: 44px; accent-color: var(--tx); }

/* workout */
.ex-card { border-color: color-mix(in srgb, var(--gym) 35%, transparent); }
.set-head, .set-row { display: grid; grid-template-columns: 32px minmax(0, 1.4fr) minmax(0, 1fr) 52px; gap: 8px; align-items: center; }
.set-head { padding: 12px 2px 6px; font-size: 12px; font-weight: 650; color: var(--tx3); text-transform: uppercase; letter-spacing: .05em; }
.set-row { min-height: 64px; border-top: 1px solid var(--line); }
.set-n { font-weight: 650; color: var(--tx2); font-size: 17px; }
.set-target { border: 0; background: none; text-align: left; font-size: 20px; font-weight: 650; padding: 8px 0; cursor: pointer; }
.set-target small { font-size: 14px; color: var(--tx2); }
.set-edit { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--tx2); }
.set-edit input { width: 58px; height: 44px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2); text-align: center; font-family: var(--font-num); font-weight: 650; font-size: 16px; }
.set-last { font-size: 13px; color: var(--tx2); }
.set-check { justify-self: end; width: 50px; height: 50px; border-radius: 14px; border: 2px solid var(--line2); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--on-accent); }
.set-check.on { background: var(--gym); border-color: var(--gym); animation: pop .22s; }
.set-row.is-done .set-target { color: var(--tx); }
.pr-badge { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--gym); color: var(--on-accent); font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.hint { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--gym) 10%, transparent); font-size: 14px; }
.hint .ic { color: var(--gym); flex-shrink: 0; }
.list { list-style: none; margin: 0; padding: 0 16px; }
.list > li { border-top: 1px solid var(--line); } .list > li:first-child { border-top: 0; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 58px; width: 100%; background: none; border: 0; text-align: left; padding: 6px 0; cursor: pointer; }
.list > .list-row, .card.list > .list-row { border-top: 1px solid var(--line); } .card.list > .list-row:first-child { border-top: 0; }
.list-row b { display: block; font-size: 15px; } .list-row .small { display: block; }
.list-row.is-current b { color: var(--gym); }
.rest-dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(14px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; z-index: 20; box-shadow: 0 -12px 30px rgba(0,0,0,.25); }
.rest-dock .btn { min-height: 52px; }
.rest-time { font-size: 34px; font-weight: 650; line-height: 1.1; }
.workout { padding-bottom: 140px; }

/* diet */
.diet-grid { display: flex; flex-direction: column; gap: 12px; }
.macro { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.glasses { display: grid; gap: 4px; margin: 12px 0; } .glasses span { height: 24px; border-radius: 6px; background: var(--track); } .glasses span.on { background: var(--water); }
.dish { min-height: 68px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); text-align: left; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.dish b { display: block; font-size: 15px; } .dish .small { display: block; }
.dish .plus { width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--diet) 16%, transparent); color: var(--diet); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.custom-add summary { font-weight: 650; min-height: 32px; cursor: pointer; }
.nutrients { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.nutrients > div { padding: 10px 4px; border-radius: 16px; background: var(--card); text-align: center; }
.nutrients b { display: block; font-size: 18px; } .nutrients small { font-size: 12px; color: var(--tx2); } .nutrients span { font-size: 11px; color: var(--tx2); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--tx2); }
.field input, .field select, .select select, .lift-in input, .product-row input { min-height: 48px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card2); padding: 0 14px; font-size: 16px; color: var(--tx); width: 100%; }
.select select { min-height: 44px; }
.form-error { color: var(--warn); font-weight: 600; }
.product-row { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }

/* plan */
.plan-grid { padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; overflow-x: auto; }
.plan-row, .plan-weeks { display: grid; grid-template-columns: 44px repeat(3, minmax(0, 1fr)); gap: 4px; align-items: stretch; min-width: 340px; }
.plan-weeks { grid-template-columns: 44px repeat(12, minmax(0, 1fr)); font-size: 11px; color: var(--tx3); text-align: center; align-items: center; }
.plan-weeks .cur { height: 22px; border-radius: 11px; background: var(--gym); color: var(--on-accent); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.plan-weeks .past { color: var(--tx2); }
.block { padding: 6px 8px; border-radius: 10px; background: var(--card2); font-size: 12px; } .block b { display: block; } .block span { font-size: 11px; color: var(--tx2); }
.block-now { background: var(--tx); color: var(--bg); } .block-now span { color: var(--bg); opacity: .75; }
.lane-name { font-size: 12px; font-weight: 700; display: flex; align-items: center; }
.lane-cell { min-height: 54px; padding: 7px 8px; border-radius: 10px; font-size: 11px; line-height: 1.3; color: var(--tx2); background: color-mix(in srgb, var(--c) 8%, transparent); }
.lane-now { background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid var(--c); color: var(--tx); font-weight: 600; }
.lane-next { background: transparent; border: 1px dashed var(--line2); }
.cal-row.is-today { background: color-mix(in srgb, var(--tx) 4%, transparent); margin: 0 -16px; padding: 6px 16px; }
.cal-date { width: 40px; display: flex; flex-direction: column; align-items: center; } .cal-date small { font-size: 11px; color: var(--tx2); font-weight: 650; } .cal-date b { font-size: 18px; }
.dots { display: flex; gap: 4px; } .dots i { width: 8px; height: 8px; border-radius: 4px; }

/* progress */
.progress-grid { display: flex; flex-direction: column; gap: 12px; }
.cmp-slider { position: relative; aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden; background: var(--card2); --split: 50%; }
.cmp-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.cmp-slider input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.cmp-slider::after { content: ''; position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; background: #F2F4F7; transform: translateX(-1px); pointer-events: none; }
.cmp-handle { position: absolute; top: 50%; left: var(--split); width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 22px; background: #F2F4F7; color: #0B0D10; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
.cmp-label { position: absolute; bottom: 10px; height: 26px; padding: 0 10px; border-radius: 13px; background: rgba(0,0,0,.5); color: #F2F4F7; font-size: 12px; font-weight: 650; display: flex; align-items: center; z-index: 1; }
.cmp-label.l { left: 10px; } .cmp-label.r { right: 10px; }
.reel { width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--card2); text-align: left; cursor: pointer; }
.reel b { display: block; } .reel .small { display: block; }
.reel-thumb { width: 56px; height: 56px; border-radius: 14px; background: var(--card3); display: flex; align-items: center; justify-content: center; }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; } .axis { font-size: 12px; fill: var(--tx3); font-family: var(--font); }
.empty-chart { padding: 24px 0; color: var(--tx3); font-size: 13px; text-align: center; }
.lift-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 72px; gap: 10px; align-items: center; font-size: 14px; }
.lift-row small { display: block; font-size: 11px; font-weight: 650; }
.adh-table { display: grid; gap: 6px; align-items: center; }
.adh-cell { height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 650; }
.lvl-0 { background: var(--track); color: var(--tx3); } .lvl-1 { background: color-mix(in srgb, var(--tx) 10%, transparent); }
.lvl-2 { background: color-mix(in srgb, var(--tx) 25%, transparent); } .lvl-3 { background: color-mix(in srgb, var(--tx) 55%, transparent); color: var(--bg); }
.lvl-4 { background: color-mix(in srgb, var(--tx) 88%, transparent); color: var(--bg); }

/* review */
.review-grid { display: flex; flex-direction: column; }
.goal-row { min-height: 64px; }
.dec { min-width: 86px; height: 30px; padding: 0 10px; border-radius: 15px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dec-up { background: var(--tx); color: var(--bg); } .dec-hold { background: var(--card3); } .dec-down { border: 1px solid var(--line2); color: var(--tx2); }
.ins-bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 32px; gap: 8px; align-items: center; }

/* onboarding */
.onboarding { display: flex; flex-direction: column; gap: 14px; min-height: 100vh; padding-bottom: calc(110px + var(--safe-b)); }
.option { padding: 18px; border-radius: 20px; border: 1px solid var(--line2); background: var(--card); text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.option b { font-size: 17px; } .option span { font-size: 14px; color: var(--tx2); }
.option.on { border: 2px solid var(--gym); background: color-mix(in srgb, var(--gym) 8%, var(--card)); }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line2); background: transparent; font-size: 14px; font-weight: 500; cursor: pointer; }
.pick.on { background: var(--tx); color: var(--bg); border-color: var(--tx); font-weight: 650; }
.lift-in { padding: 12px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--tx2); }
.lift-in input { min-height: 44px; font-family: var(--font-num); font-weight: 650; }
.ob-cta { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(16px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%); max-width: 560px; margin: 0 auto; }

/* auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.brand-mark { display: flex; gap: 6px; } .brand-mark span { width: 14px; height: 14px; border-radius: 7px; }

/* loading, toasts, sheets */
.loading { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--track); border-top-color: var(--tx); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; left: 16px; right: 16px; top: calc(12px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; }
.toast { max-width: 420px; padding: 12px 16px; border-radius: 16px; background: var(--tx); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; transform: translateY(-12px); opacity: 0; transition: .25s; }
.toast.show { transform: none; opacity: 1; } .toast-error { background: var(--warn); color: #1A1407; }
.toast-level { background: var(--gym); color: #0B0D10; }
#sheet-host { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--card2); border-radius: 26px 26px 0 0; padding: 12px 20px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.grabber { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line2); }
.sheet h3 { font-family: var(--font-num); font-size: 20px; margin: 4px 0 0; }
.sheet-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.sheet-opt { min-height: 68px; border-radius: 16px; border: 1px solid var(--line2); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 650; cursor: pointer; padding: 8px; }
.sheet-opt span { font-size: 11px; font-weight: 500; color: var(--tx2); text-align: center; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 8px 12px calc(10px + var(--safe-b)); background: var(--tab-bg); border-top: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; }
.tabbar[hidden] { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 52px; justify-content: center; color: var(--tx2); text-decoration: none; font-size: 11px; font-weight: 500; }
.tab[aria-current="page"] { color: var(--tx); font-weight: 650; }
.tab-center { color: var(--tx); font-weight: 650; justify-content: flex-end; }
.tab-fab { width: 60px; height: 60px; margin-top: -26px; border-radius: 30px; background: var(--tx); color: var(--bg); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }

/* ---------- desktop / iPad landscape ---------- */
@media (min-width: 1024px) {
  body { padding-bottom: 0; padding-left: 240px; }
  body.no-nav { padding-left: 0; }
  .desk-only { display: revert !important; }
  .tabbar .tab.desk-only, .tabbar .nav-brand { display: flex !important; }
  .tabbar { top: 0; right: auto; width: 240px; bottom: 0; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 28px 16px; border-top: 0; border-right: 1px solid var(--line); background: var(--bg); }
  .nav-brand { padding: 0 12px 24px; font-family: var(--font-num); font-size: 20px; font-weight: 700; }
  .tab, .tab-center { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 500; }
  .tab[aria-current="page"] { background: var(--card2); }
  .tab-fab { width: auto; height: auto; margin: 0; background: none; color: inherit; box-shadow: none; }
  .tab-fab .ic { width: 24px; height: 24px; }
  .pad { max-width: 1200px; padding: 32px 40px 48px; }
  .today .title { font-size: 40px; }
  .today-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.25fr) minmax(280px, .9fr); gap: 20px; align-items: start; }
  .today-grid .section-label { margin-top: 0; }
  .diet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .review-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
  .sticky-cta { bottom: 16px; }
  .ob-cta { left: 0; }
  .rest-dock { left: 240px; }
  .pad.onboarding, .pad.settings { max-width: 640px; }
  .routine-list, .guided { max-width: 720px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
