/* Progressino (formerly Momentum) — white-label fitness coaching app. Brand colour comes from --brand (set at runtime). */
:root {
  --brand: #4f46e5; --brand-ink: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --brand-line: color-mix(in srgb, var(--brand) 35%, transparent);
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f1f3f6; --surface-3: #e9ecf1;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8; --line: #e4e7ec;
  --ok: #16a34a; --warn: #d97706; --err: #dc2626; --info: #0284c7;
  --ok-soft: #dcfce7; --warn-soft: #fef3c7; --err-soft: #fee2e2; --info-soft: #e0f2fe;
  --p: #e11d48; --c: #f59e0b; --f: #0ea5e9;
  --r: 16px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 10px rgba(15, 23, 42, .05);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .18);
  --tab-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12; --surface: #141821; --surface-2: #1b202b; --surface-3: #242a37;
    --ink: #eef1f6; --ink-2: #cbd2dd; --muted: #8f99a9; --faint: #5f6878; --line: #262c38;
    --ok: #34d399; --warn: #fbbf24; --err: #f87171; --info: #38bdf8;
    --ok-soft: #10291f; --warn-soft: #2b2310; --err-soft: #2e1515; --info-soft: #0f2533;
    --brand-soft: color-mix(in srgb, var(--brand) 22%, transparent);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d12; --surface: #141821; --surface-2: #1b202b; --surface-3: #242a37;
  --ink: #eef1f6; --ink-2: #cbd2dd; --muted: #8f99a9; --faint: #5f6878; --line: #262c38;
  --ok: #34d399; --warn: #fbbf24; --err: #f87171; --info: #38bdf8;
  --ok-soft: #10291f; --warn-soft: #2b2310; --err-soft: #2e1515; --info-soft: #0f2533;
  --brand-soft: color-mix(in srgb, var(--brand) 22%, transparent);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv11", "ss01"; font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.i { width: 20px; height: 20px; flex: none; }
.i.sm { width: 16px; height: 16px; } .i.lg { width: 24px; height: 24px; } .i.xl { width: 32px; height: 32px; }

/* ---------- Shell ---------- */
.app { min-height: 100dvh; }
.side { display: none; }
.main { min-width: 0; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); }
.app.focus .main { padding-bottom: 120px; }
.app.focus .tabbar, .app.focus .side { display: none !important; }
@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 252px 1fr; }
  .app.focus { grid-template-columns: 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); background: var(--surface); padding: 18px 12px; gap: 2px; overflow-y: auto; }
  .main { padding-bottom: 40px; }
  .tabbar { display: none !important; }
  .topbar .tb-brand { display: none; }
}
.brandmark { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 16px; overflow: hidden; flex: none; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.brandmark small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.navlink { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 550; font-size: 14.5px; position: relative; }
.navlink:hover { background: var(--surface-2); }
.navlink.on { background: var(--brand-soft); color: var(--brand); }
.navlink .badge { margin-left: auto; }
.side .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side .grow { flex: 1; }
.side .me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.side .me b { display: block; font-size: 13.5px; } .side .me span { font-size: 12px; color: var(--muted); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
.tabbar a.on { color: var(--brand); }
.tabbar a .dot { position: absolute; top: 9px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: var(--err); border: 2px solid var(--surface); }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; min-height: 56px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .tb-title { font-weight: 700; font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .tb-brand { display: flex; align-items: center; gap: 8px; }
@media (min-width: 960px) { .topbar .tb-brand { display: none; } }
.topbar .tb-brand .logo { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.asbar + .topbar { top: 36px; }
.asbar { height: 36px; background: var(--ink); color: var(--bg); font-size: 13px; padding: 8px 16px; display: flex; align-items: center; gap: 10px; justify-content: center; position: sticky; top: 0; z-index: 25; }
.asbar button { text-decoration: underline; font-weight: 600; }

.page { max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; }
.page.wide { max-width: 1180px; }
@media (min-width: 960px) { .page { padding: 16px 32px 32px; } }
.ph { display: flex; align-items: flex-end; gap: 12px; margin: 8px 0 18px; flex-wrap: wrap; }
.ph h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.ph .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.ph .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; min-width: 0; }
.card.flat { box-shadow: none; }
.card.pad0 { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h3 { font-size: 15px; font-weight: 700; flex: 1; }
.card-h a, .card-h .lnk { font-size: 13px; font-weight: 600; color: var(--brand); }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .xs { font-size: 12px; }
.b { font-weight: 700; } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; } .row.top { align-items: flex-start; } .row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; } .gap-s { gap: 6px; } .mt { margin-top: 12px; } .mt-s { margin-top: 6px; } .mb { margin-bottom: 12px; } .mb0 { margin-bottom: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; } .cols.even { grid-template-columns: 1fr 1fr; } }
.divider { height: 1px; background: var(--line); margin: 12px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; font-weight: 650; font-size: 14.5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); white-space: nowrap; transition: transform .05s, background .15s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--err); }
.btn.danger.solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.lg { height: 52px; font-size: 16px; border-radius: 14px; padding: 0 22px; }
.btn.block { width: 100%; }
.btn.icon { width: 42px; padding: 0; } .btn.icon.sm { width: 34px; }
.btn:disabled { opacity: .45; pointer-events: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.muted { background: var(--surface-2); color: var(--muted); } .pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.nodot::before { display: none; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.tag { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; }

.seg { display: flex; background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 2px; margin-bottom: 16px; }
.seg a, .seg button { flex: 1; text-align: center; height: 36px; display: grid; place-items: center; border-radius: 9px; font-weight: 650; font-size: 13.5px; color: var(--muted); }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 12px; font-weight: 650; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--brand); }

.av { border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; flex: none; overflow: hidden; letter-spacing: .02em; }
.av img { width: 100%; height: 100%; object-fit: cover; }

.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; }
a.li:hover, button.li:hover { background: var(--surface-2); }
button.li { width: 100%; text-align: left; }
.li .t { font-weight: 650; font-size: 14.5px; } .li .s { font-size: 12.5px; color: var(--muted); }
.li .chev { color: var(--faint); }
.ico-tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.ico-tile.ok { background: var(--ok-soft); color: var(--ok); } .ico-tile.warn { background: var(--warn-soft); color: var(--warn); } .ico-tile.err { background: var(--err-soft); color: var(--err); } .ico-tile.info { background: var(--info-soft); color: var(--info); } .ico-tile.gray { background: var(--surface-2); color: var(--muted); }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; line-height: 1.1; }
.kpi .v small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi .d { font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.up { color: var(--ok); } .down { color: var(--err); } .neutral { color: var(--muted); }

.bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.bar.thin { height: 6px; }
.macro { margin-bottom: 12px; }
.macro .row { font-size: 13px; margin-bottom: 5px; }
.macro b { font-weight: 700; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; height: 44px; width: 100%; min-width: 0; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { padding: 10px 12px; height: auto; min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="color"] { padding: 4px; width: 56px; }
input[type="range"] { padding: 0; border: 0; height: 28px; accent-color: var(--brand); box-shadow: none; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); padding: 0; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.search input { padding-left: 40px; background: var(--surface); }
.scale { display: flex; gap: 6px; }
.scale button { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--muted); }
.scale button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--surface-3); border-radius: 999px; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .ico-tile { margin: 0 auto 12px; width: 52px; height: 52px; border-radius: 16px; }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty p { margin: 0 auto 14px; max-width: 360px; font-size: 14px; }

/* Charts */
.lc { display: flex; flex-direction: column; gap: 6px; }
.lc-plot { position: relative; flex: 1; min-height: 0; }
.lc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lc .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lc .goal { stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.lc .ln { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lc .ln.raw { stroke: var(--faint); stroke-width: 1.25; opacity: .7; }
.lc .area { fill: url(#lcg); }
.lc .g0 { stop-color: var(--brand); stop-opacity: .22; } .lc .g1 { stop-color: var(--brand); stop-opacity: 0; }
.lc-dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--brand); border: 2.5px solid var(--surface); box-shadow: 0 0 0 1px var(--brand); }
.lc-yl { position: absolute; right: 0; transform: translateY(-120%); font-size: 11px; font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 0 3px; border-radius: 4px; }
.lc-yl.goal { left: 0; right: auto; color: var(--ok); }
.lc-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.chart-empty { display: grid; place-items: center; height: 140px; color: var(--muted); font-size: 13.5px; background: var(--surface-2); border-radius: 12px; text-align: center; padding: 16px; }
.bc { display: flex; gap: 6px; align-items: stretch; }
.bc-col { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bc-track { flex: 1; position: relative; display: flex; align-items: flex-end; }
.bc-bar { width: 100%; background: color-mix(in srgb, var(--brand) 40%, var(--surface-3)); border-radius: 6px 6px 3px 3px; min-height: 3px; position: relative; }
.bc-col.hi .bc-bar { background: var(--brand); }
.bc-bar span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 600; color: var(--muted); padding-bottom: 3px; white-space: nowrap; }
.bc-goal { position: absolute; left: -3px; right: -3px; border-top: 1.5px dashed var(--ok); z-index: 1; }
.bc-l { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }
.hb-row { display: grid; grid-template-columns: 92px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.hb-l { color: var(--ink-2); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.hb-t div { height: 100%; background: var(--brand); border-radius: 999px; }
.hb-v { text-align: right; color: var(--muted); font-weight: 600; }
.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring .rt { fill: none; stroke: var(--surface-3); }
.ring .rv { fill: none; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
svg.spark { width: 100%; height: 30px; }
svg.spark path { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
svg.spark.ok path { stroke: var(--ok); } svg.spark.err path { stroke: var(--err); }
.hm { display: flex; gap: 6px; }
.hm-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; font-size: 9.5px; color: var(--muted); }
.hm-g { display: flex; gap: 3px; flex: 1; }
.hm-c { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; flex: 1; }
.hm-c i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); max-width: 18px; }
.hm-c i.hm-1 { background: color-mix(in srgb, var(--brand) 62%, var(--surface-3)); } .hm-c i.hm-2 { background: color-mix(in srgb, var(--brand) 80%, var(--surface-3)); } .hm-c i.hm-3 { background: var(--brand); }
.hm-c i.hm-f { background: transparent; } .hm-c i.hm-t { outline: 1.5px solid var(--ink); outline-offset: -1.5px; }

/* ---------- Today ---------- */
.hello { margin: 6px 0 18px; display: flex; align-items: center; gap: 12px; }
.hello h1 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.hello .sub { color: var(--muted); font-size: 14px; }
.hero { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 62%, #000)); color: var(--brand-ink); border: 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero .eyebrow { color: inherit; opacity: .8; }
.hero h2 { font-size: 22px; font-weight: 750; margin: 4px 0 2px; }
.hero .meta { opacity: .85; font-size: 13.5px; }
.hero .exs { margin: 14px 0 16px; display: flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 1; }
.hero .exs span { background: rgba(255, 255, 255, .16); border-radius: 8px; padding: 4px 9px; font-size: 12.5px; font-weight: 600; }
.hero .btn { background: #fff; color: #0f172a; border: 0; position: relative; z-index: 1; }
.hero .btn.ghost { background: rgba(255, 255, 255, .14); color: inherit; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week .wd { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.week .wd i { display: grid; place-items: center; margin: 6px auto 0; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-style: normal; font-size: 13px; font-weight: 700; }
.week .wd.done i { background: var(--brand); color: var(--brand-ink); }
.week .wd.today i { box-shadow: 0 0 0 2px var(--brand) inset; color: var(--brand); }
.week .wd.done.today i { color: var(--brand-ink); }
.habit { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.habit:first-child { border-top: 0; }
.habit .hc { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; transition: all .15s; }
.habit.on .hc { background: var(--ok); border-color: var(--ok); color: #fff; }
.habit .t { flex: 1; font-weight: 550; } .habit.on .t { color: var(--muted); }
.habit .streak { font-size: 12px; color: var(--warn); font-weight: 700; display: flex; align-items: center; gap: 3px; }
.stat-tile { display: flex; align-items: center; gap: 12px; }
.stat-tile .v { font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.stat-tile .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- Workout logger ---------- */
.wk-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.wk-head .in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.wk-head input.title { border: 0; background: transparent; font-size: 17px; font-weight: 750; padding: 0; height: 28px; box-shadow: none; }
.wk-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wk-stats b { color: var(--ink); }
.exc { padding: 0; overflow: hidden; }
.exc-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.exc-h .name { font-weight: 700; font-size: 15.5px; color: var(--brand); }
.exc-meta { padding: 0 16px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.exc-note { margin: 0 16px 8px; font-size: 13px; color: var(--muted); }
.sugg { margin: 0 16px 10px; font-size: 12.5px; background: var(--ok-soft); color: var(--ok); padding: 7px 10px; border-radius: 9px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.sets { width: 100%; border-collapse: collapse; }
.sets th { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 4px 4px; text-align: center; }
.sets td { padding: 4px; text-align: center; }
.sets tr td:first-child, .sets tr th:first-child { padding-left: 12px; width: 44px; }
.sets tr td:last-child, .sets tr th:last-child { padding-right: 12px; width: 56px; }
.sets .prev { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.sets input { height: 38px; text-align: center; font-weight: 700; padding: 0 4px; background: var(--surface-2); border-color: transparent; border-radius: 9px; }
.sets input::placeholder { color: var(--faint); font-weight: 600; }
.sets tr.done td { background: var(--ok-soft); }
.sets tr.done input { background: transparent; }
.sets tr.done td:first-child { border-radius: 0; }
.stype { width: 30px; height: 30px; border-radius: 8px; font-weight: 800; font-size: 13px; color: var(--muted); background: var(--surface-2); }
.stype.W { color: var(--warn); } .stype.D { color: var(--info); } .stype.F { color: var(--err); }
.tick { width: 40px; height: 38px; border-radius: 10px; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; margin: 0 auto; }
tr.done .tick { background: var(--ok); color: #fff; }
.prb { display: inline-flex; align-items: center; gap: 2px; font-size: 10px; font-weight: 800; color: #b45309; background: #fef3c7; border-radius: 5px; padding: 1px 4px; margin-left: 4px; vertical-align: middle; }
.exc-f { display: flex; gap: 8px; padding: 8px 12px 12px; }
.rest {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  width: min(520px, calc(100% - 24px)); background: var(--ink); color: var(--bg); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px;
}
.rest .t { font-size: 24px; font-weight: 800; min-width: 72px; letter-spacing: -.01em; }
.rest { flex-wrap: wrap; }
.rest .bar { order: 9; flex: 1 0 100%; background: rgba(255, 255, 255, .15); }
.rest .sp { flex: 1; }
.rest .bar > i { background: var(--brand); transition: width 1s linear; }
.rest button { height: 34px; padding: 0 10px; border-radius: 9px; background: rgba(255, 255, 255, .12); font-weight: 700; font-size: 13px; }

/* ---------- Coach ---------- */
.client-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 110px 120px 90px 24px; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.client-row:hover { background: var(--surface-2); }
.client-row.head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-top: 0; padding-top: 10px; padding-bottom: 10px; }
.client-row.head:hover { background: var(--surface-2); }
@media (max-width: 860px) {
  .client-row { grid-template-columns: minmax(0, 1fr) auto; }
  .client-row > :nth-child(2), .client-row > :nth-child(4), .client-row > :nth-child(5), .client-row > :nth-child(6) { display: none; }
  .client-row.head { display: none; }
  .client-row { border-top: 1px solid var(--line); }
  .client-row:first-of-type { border-top: 0; }
}
.attn { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.attn:first-child { border-top: 0; }
.attn:hover { background: var(--surface-2); }
.feed-i { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.feed-i:first-child { border-top: 0; }
.ch-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; flex-wrap: wrap; }
.ch-head h1 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.qa { padding: 10px 0; border-top: 1px solid var(--line); }
.qa:first-child { border-top: 0; }
.qa .q { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.scores { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scores div { background: var(--surface-2); border-radius: 10px; padding: 8px; text-align: center; }
.scores b { display: block; font-size: 18px; }
.scores span { font-size: 11px; color: var(--muted); font-weight: 600; }
@media (max-width: 520px) { .scores { grid-template-columns: repeat(3, 1fr); } }

/* Program builder */
.pday { padding: 0; overflow: hidden; }
.pday-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.pday-h input { height: 36px; font-weight: 700; background: var(--surface); }
.pex { display: grid; grid-template-columns: minmax(0, 1fr) 64px 92px 76px auto; gap: 8px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.pex:first-of-type { border-top: 0; }
.pex input { height: 36px; padding: 0 8px; text-align: center; }
.pex .nm b { display: block; font-size: 14px; } .pex .nm span { font-size: 12px; color: var(--muted); }
.pex .tools { display: flex; gap: 2px; }
.pex-h { display: grid; grid-template-columns: minmax(0, 1fr) 64px 92px 76px auto; gap: 8px; padding: 8px 16px 0; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pex-h span:not(:first-child) { text-align: center; }
@media (max-width: 600px) {
  .pex { grid-template-columns: 1fr 52px 70px 60px; } .pex .tools { grid-column: 1 / -1; justify-content: flex-end; margin-top: -4px; }
  .pex-h { grid-template-columns: 1fr 52px 70px 60px; } .pex-h span:last-child { display: none; }
}

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100dvh - 190px); min-height: 380px; }
.chat .msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 18px; font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble-t { font-size: 11px; color: var(--faint); margin: 2px 6px 8px; }
.bubble-t.me { align-self: flex-end; } .bubble-t.them { align-self: flex-start; }
.chat form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.inbox { display: grid; grid-template-columns: 300px 1fr; }
.inbox .threads { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100dvh - 190px); }
.inbox .threads a.on { background: var(--brand-soft); }
@media (max-width: 860px) { .inbox { grid-template-columns: 1fr; } .inbox.open .threads { display: none; } .inbox:not(.open) .chat { display: none; } }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 3/4; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); padding: 2px 6px; border-radius: 6px; }
.photo.sel { outline: 3px solid var(--brand); outline-offset: -3px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Brand studio */
.phone { width: 300px; height: 600px; border-radius: 42px; border: 10px solid #0f172a; background: var(--bg); overflow: hidden; position: relative; margin: 0 auto; box-shadow: var(--shadow-lg); }
.phone .scr { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; }
.phone .ptop { padding: 30px 16px 10px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.phone .pbody { flex: 1; padding: 0 12px; }
.phone .ptab { display: flex; border-top: 1px solid var(--line); background: var(--surface); height: 56px; }
.phone .ptab span { flex: 1; display: grid; place-items: center; color: var(--muted); }
.phone .ptab span.on { color: var(--brand); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.swatch.on { border-color: var(--ink); }

/* Cloud status */
.cloud-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; margin: 0 6px; }
.cloud-dot.ok { background: var(--ok); } .cloud-dot.sync { background: var(--info); animation: pulse 1s infinite alternate; } .cloud-dot.err { background: var(--err); } .cloud-dot.offline { background: var(--warn); }
@keyframes pulse { to { opacity: .35; } }
.lnk { font-size: inherit; }
/* Overlays */
.backdrop { position: fixed; inset: 0; background: rgba(8, 10, 15, .5); z-index: 50; opacity: 0; transition: opacity .2s; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom);
}
.sheet.show { transform: none; }
@media (min-width: 720px) {
  .sheet { left: 50%; top: 50%; bottom: auto; width: min(560px, calc(100% - 32px)); max-height: 86dvh; border-radius: 20px; transform: translate(-50%, -46%); opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
}
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.sheet-h h3 { flex: 1; font-size: 17px; font-weight: 750; }
.sheet-b { overflow-y: auto; padding: 4px 16px 16px; flex: 1; }
.sheet-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 999px; background: var(--surface-3); margin: 8px auto 0; }
@media (min-width: 720px) { .sheet .grab { display: none; } }
#toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -150%); z-index: 60; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); transition: transform .25s cubic-bezier(.2, .8, .2, 1); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); }
#toast.show { transform: translate(-50%, 0); visibility: visible; }
#toast:not(.show) { visibility: hidden; transition: transform .25s, visibility 0s .25s; }
#toast.pr { background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; }
#toast.err { background: var(--err); color: #fff; }

/* Welcome */
.welcome { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, var(--brand-soft), transparent), var(--bg); }
.welcome .box { width: min(880px, 100%); }
.welcome h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; letter-spacing: -.03em; text-align: center; line-height: 1.1; }
.welcome .lead { text-align: center; color: var(--muted); font-size: 16px; margin: 12px auto 28px; max-width: 560px; }
.choice { text-align: left; padding: 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .1s; }
.choice:hover { border-color: var(--brand); transform: translateY(-2px); }
.choice h3 { font-size: 17px; } .choice p { margin: 0; color: var(--muted); font-size: 14px; }
.choice ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.steps i { width: 28px; height: 4px; border-radius: 999px; background: var(--surface-3); }
.steps i.on { background: var(--brand); }

.fab { position: fixed; right: 18px; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); z-index: 25; width: 56px; height: 56px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
@media (min-width: 960px) { .fab { bottom: 28px; right: 28px; } }
.kbd { font: 600 11px ui-monospace, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.food-r { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.food-r:first-child { border-top: 0; }
.food-r .t { font-weight: 600; font-size: 14px; } .food-r .s { font-size: 12px; color: var(--muted); }
.water { display: flex; gap: 6px; flex-wrap: wrap; }
.water button { width: 34px; height: 40px; border-radius: 8px 8px 12px 12px; border: 2px solid var(--line); color: var(--faint); display: grid; place-items: center; }
.water button.on { background: var(--info-soft); border-color: var(--info); color: var(--info); }
@media print { .side, .tabbar, .topbar { display: none !important; } }

/* Exercise catalog (v1.5) */
.sheet.tall { height: 92dvh; }
@media (min-width: 720px) { .sheet.tall { height: 86dvh; } }
.exfilters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 720px) { .exfilters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.exfilters select { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; }
.exthumb { width: 48px; height: 48px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: inline-grid; place-items: center; color: var(--faint); }
.exthumb:not([src]):not(.none) { animation: exPulse 1.2s ease-in-out infinite; }
@keyframes exPulse { 50% { opacity: .55; } }
.li.exrow { padding: 8px 12px 8px 16px; gap: 6px; }
.exmain { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; padding: 4px 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.howto .photos { display: grid; gap: 8px; margin-bottom: 12px; }
.howto .photos.g2 { grid-template-columns: 1fr 1fr; }
.photo { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: #fff; aspect-ratio: 3 / 2; }
.photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.photo img:not([src]) { visibility: hidden; }
.photo.loading { background: var(--surface-2); animation: exPulse 1.2s ease-in-out infinite; }
.photo.failed::after { content: 'Photo unavailable offline'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.photo figcaption { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, .55); padding: 3px 8px; border-radius: 999px; }
.howto .muscles { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; }
.howto-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.chip.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.chip.static { pointer-events: none; }
.howto .card-h { flex-wrap: wrap; gap: 8px; }

/* Training calendar (v1.6) */
.cal-h, .cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal-d { position: relative; min-height: 64px; padding: 5px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font: inherit; min-width: 0; }
.cal-d:hover { background: var(--surface-2); }
.cal-d.out { opacity: .4; }
.cal-d .n { font-size: 12px; font-weight: 700; }
.cal-d.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.cal-d.sel { background: var(--brand-soft); }
.cal-d .pl { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-d .pl i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.cal-d .pl em { font-style: normal; font-size: 10.5px; line-height: 1.2; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.cal-d .ok { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; }
.cal-d .ok svg { width: 12px; height: 12px; }
.cal-d .miss { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--err); }
.cal-d.done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.cal-key { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cal-key.done { background: var(--ok); } .cal-key.missed { background: var(--err); } .cal-key.today { border: 2px solid var(--brand); }
.pl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
@media (max-width: 520px) { .cal-d { min-height: 52px; padding: 4px 3px; } .cal-d .pl em { display: none; } .cal-d .pl i { width: 9px; height: 9px; } }

/* ---------- Food tables (js/foods.js) ---------- */
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.food-r.tap { cursor: pointer; border-radius: 10px; }
.food-r.tap:hover { background: var(--surface-2); }
.fthumb { width: 44px; height: 44px; flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); display: inline-grid; place-items: center; font-size: 22px; }
.fthumb.sm { width: 36px; height: 36px; font-size: 18px; }
.fthumb.emo { background: var(--surface-2); }
.fhead { display: flex; gap: 14px; align-items: flex-start; }
.fphoto { width: 112px; height: 112px; flex: none; border-radius: 14px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.fphoto.emo { display: grid; place-items: center; font-size: 52px; background: var(--surface-2); }
.fcalc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 4px; text-align: center; }
.fcalc div { background: var(--surface-2); border-radius: 12px; padding: 8px 4px; }
.fcalc b { display: block; font-size: 19px; font-weight: 800; }
.fcalc span { font-size: 11.5px; color: var(--muted); }
.fcalc div:nth-child(2) b { color: var(--p); } .fcalc div:nth-child(3) b { color: var(--c); } .fcalc div:nth-child(4) b { color: var(--f); }
.ntab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ntab th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 0 6px; }
.ntab td { padding: 6px 0; border-top: 1px solid var(--line); text-align: right; }
.ntab td:first-child { text-align: left; font-weight: 600; }
.ntab td.sub { font-weight: 400; color: var(--muted); padding-left: 14px; }
.nscore { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 800; font-size: 13px; color: #fff; }
.ns-a { background: #038141; } .ns-b { background: #85bb2f; } .ns-c { background: #fecb02; color: #222; } .ns-d { background: #ee8100; } .ns-e { background: #e63e11; }
.scanbox { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanframe { position: absolute; left: 10%; right: 10%; top: 30%; bottom: 30%; border: 3px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scanmsg { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px #000; }
.mb-s { margin-bottom: 8px; }
/* v1.8 nutrients */
.ntab tr.grp td { text-align: left; font-weight: 750; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 14px; border-top: 0; }
.mrow { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; row-gap: 3px; padding: 4px 0; font-size: 13px; }
.mrow .mbar { grid-column: 1 / -1; }
.mrow .ml { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.mbar i { display: block; height: 100%; border-radius: 999px; }
.mrow .mv { font-size: 12px; text-align: right; white-space: nowrap; }
.micro-h { width: 100%; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.micro-h h3::after { content: ' ▾'; color: var(--muted); font-size: 12px; } .micro.open .micro-h h3::after { content: ' ▴'; }
.card.micro:not(.open) .micro-h { margin-bottom: 0; }

/* v1.9 social */
.post .pbody { margin: 10px 0 0; white-space: pre-wrap; font-size: 14.5px; }
.wbox { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.wbox .wkpi { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 4px; font-size: 13px; font-weight: 650; }
.wbox .wex { margin-top: 6px; display: grid; gap: 4px; }
.wbox .wex .row { gap: 8px; }
.ico-tile.sm { width: 32px; height: 32px; border-radius: 9px; }
.pact { display: flex; gap: 6px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.pact > * { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--muted); }
.pact > *:hover { background: var(--surface-2); }
.pact button.on { color: #ea580c; }
.cmt { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.cmt:first-of-type { border-top: 0; }
.socstats { display: flex; gap: 8px; margin: 14px 0; }
.socstats > div { flex: 1; text-align: center; background: var(--surface-2); border-radius: 12px; padding: 8px 4px; }
.socstats b { display: block; font-size: 18px; font-weight: 800; } .socstats span { font-size: 12px; color: var(--muted); }
.tabs .badge { height: 18px; min-width: 18px; font-size: 10.5px; margin-left: 4px; }

/* v1.9.1 nutrition bars */
.bar { position: relative; }
.bar > i.part { position: absolute; left: 0; top: 0; z-index: 1; border-radius: 999px 0 0 999px; opacity: .9; }
.macro .over b { color: var(--err); }
.macro .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.nutbars .macro { margin-bottom: 10px; }

/* v1.10 home overview — categorical slots 1–3 of the validated palette; dark mode uses its own steps */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; } }
:root[data-theme="dark"] { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; }
h2.sect { font-size: 19px; font-weight: 800; margin: 22px 0 12px; }
.ar { display: flex; align-items: center; gap: 14px; }
@media (max-width: 360px) { .ar { flex-direction: column; align-items: stretch; } .ar-svg { align-self: center; } }
.ar-svg { flex: none; }
.ar-track { fill: none; stroke: var(--surface-3); }
.ar-val { fill: none; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ar-val.v1 { stroke: var(--viz-1); } .ar-val.v2 { stroke: var(--viz-2); } .ar-val.v3 { stroke: var(--viz-3); }
.ar-legend { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ar-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 10px; color: inherit; }
.ar-row:hover { background: var(--surface-2); }
.ar-sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ar-sw.v1 { background: var(--viz-1); } .ar-sw.v2 { background: var(--viz-2); } .ar-sw.v3 { background: var(--viz-3); }
.ar-v { text-align: right; font-size: 13px; white-space: nowrap; }
.sw.goal { display: inline-block; width: 14px; height: 0; border-top: 2px dashed var(--ok); vertical-align: middle; margin-right: 6px; }
.hm-key { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 8px; }
.hm-key i { width: 11px; height: 11px; border-radius: 3px; background: var(--surface-3); }
.hm-key i.hm-1 { background: color-mix(in srgb, var(--brand) 62%, var(--surface-3)); } .hm-key i.hm-3 { background: var(--brand); }
.lc-plot { position: relative; }
.lc-hit { position: absolute; top: 0; bottom: 0; transform: translateX(-50%); min-width: 8px; cursor: crosshair; }
.lc-hit b { position: absolute; left: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--surface); opacity: 0; }
.lc-hit:hover { background: linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat; }
.lc-hit:hover b { opacity: 1; }
.sw.line, .sw.raw { display: inline-block; width: 14px; height: 0; vertical-align: middle; margin: 0 6px 0 2px; border-top: 2.5px solid var(--brand); }
.sw.raw { border-top: 1.5px solid var(--faint); margin-left: 12px; }

/* v1.11 own planned workouts */
.cal-d .pl.own i { background: #0f766e; border-radius: 2px; }
.plan-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px; margin-bottom: 10px; border-left: 4px solid #0f766e; }
.plan-ex input:not([type]) { height: 38px; }

/* v1.12 sign-in screen with app preview */
.login-v2 { place-items: start center; padding: clamp(20px, 4vw, 48px) 16px; }
.lg-wrap { width: min(1080px, 100%); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); grid-template-areas: "intro form" "show form"; gap: 18px 40px; align-items: start; }
.lg-intro { grid-area: intro; } .lg-form { grid-area: form; position: sticky; top: 24px; } .lg-show { grid-area: show; }
.lg-form > .card { max-width: none !important; box-shadow: 0 12px 40px rgba(15, 23, 42, .10); }
.lg-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 18px; }
.welcome .lg-h { font-size: clamp(28px, 4.2vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; margin: 0; text-align: left; }
.lg-h span { color: var(--brand); }
.lg-lead { color: var(--muted); font-size: 16px; margin: 12px 0 0; max-width: 560px; }
.showcase { position: relative; }
.sc-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; margin-bottom: 10px; }
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sc-card { margin: 0; padding: 14px; }
.sc-card .card-h { margin-bottom: 8px; } .sc-card h3 { font-size: 14px; }
.sc-rings .ar { gap: 10px; } .sc-rings .ar-row { padding: 3px 4px; } .sc-rings .ar-v { font-size: 12px; }
.sc-pr { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; }
.sc-rings { grid-column: 1 / -1; } .sc-rings .ar-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sc-rings .ar-row { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 8px; align-items: start; }
.sc-rings .ar-row .ar-sw { margin-top: 4px; } .sc-rings .ar-v { grid-column: 2; text-align: left; white-space: normal; }
@media (max-width: 620px) { .sc-rings .ar-legend { grid-template-columns: 1fr; } }
.showcase .ar-val { animation: arIn 1.4s cubic-bezier(.2, .8, .2, 1) .2s both; }
.sc-feats { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.sc-feats li { display: flex; gap: 10px; align-items: flex-start; }
.sc-feats b { display: block; font-size: 14px; } .sc-feats span { font-size: 12.5px; color: var(--muted); }
.sc-feats .ico-tile { width: 34px; height: 34px; border-radius: 10px; flex: none; }
@keyframes arIn { from { stroke-dashoffset: var(--c); } }
@media (prefers-reduced-motion: reduce) { .showcase .ar-val { animation: none; } }
@media (max-width: 860px) {
  .lg-wrap { grid-template-columns: 1fr; grid-template-areas: "intro" "form" "show"; gap: 18px; }
  .lg-intro, .welcome .lg-h { text-align: center; } .lg-brand { justify-content: center; } .lg-lead { margin-left: auto; margin-right: auto; }
  .lg-form { position: static; }
}
@media (max-width: 520px) { .sc-grid, .sc-feats { grid-template-columns: 1fr; } }
.login-v2 { overflow-x: hidden; } .lg-wrap > *, .sc-grid > *, .showcase { min-width: 0; }
.login-v2 .lg-wrap { justify-self: stretch; margin: 0 auto; }
.lg-form .card .row { flex-wrap: wrap; gap: 4px; } .lg-form .card .row .btn.ghost.sm { white-space: normal; text-align: left; }

/* v1.13 recipes */
.rcp-ing { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; }
.rcp-ing input, .rcp-ing select { height: 38px; }

/* v1.14 meal sharing */
.share-in { border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); }
.share-box { padding: 10px 0; border-top: 1px solid var(--line); } .share-box:first-of-type { border-top: 0; padding-top: 0; }
.share-box select { height: 36px; }
.shared-by { color: var(--brand); font-weight: 600; } .shared-by svg { width: 11px; height: 11px; vertical-align: -1px; }

/* v1.16 energy (BMR) card */
.en-f { gap: 0 10px; } .en-f .field { margin-bottom: 10px; } .en-f .seg button { flex: 1; }
.en-body { padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.en-r { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.en-r .t { font-size: 14px; } .en-r b { font-size: 17px; }
.en-r.strong b { font-size: 22px; color: var(--brand); } .en-r.strong { border-bottom: 0; }
.ok-t { color: var(--ok); } .ok-t svg { width: 12px; height: 12px; vertical-align: -1px; }

/* v1.16.1 delete own food / recipe */
.del-mine { color: var(--err); } .del-mine.armed { background: var(--err); color: #fff; }

/* v1.16.4 vitamins card placement: under the summary on phones, right column on wide screens */
.micro-d { display: none; }
@media (min-width: 960px) { .micro-m { display: none; } .micro-d { display: block; } }

/* v1.18 sign-in: Individual / Trainer slider, trainer preview, benefits, legal pages */
.lg-mode { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--surface-3); border-radius: 999px; padding: 4px; margin: 0 0 18px; min-width: 280px; }
.lg-mode::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); transition: transform .32s cubic-bezier(.3, .9, .3, 1); }
.lg-mode[data-m="coach"]::before { transform: translateX(100%); }
.lg-mode button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); transition: color .2s; }
.lg-mode button.on { color: var(--brand); }
.lg-mode button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lg-copy, .lg-show { animation: lgFade .35s ease both; }
@keyframes lgFade { from { opacity: .35; } }
.lg-hint:empty { display: none; } .lg-hint { display: flex; gap: 6px; align-items: flex-start; margin: 10px 2px 0; } .lg-hint svg { flex: none; margin-top: 1px; }
.lg-legal { text-align: center; margin: 14px 0 0; } .lg-legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.sc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.sc-kpis .kpi { padding: 12px; } .sc-kpis .kpi .v { font-size: 22px; } .sc-kpis .kpi .k { font-size: 11.5px; } .sc-kpis .kpi .d { font-size: 11.5px; }
.sc-attn { grid-column: 1 / -1; } .sc-attn .attn { padding: 9px 14px; } .sc-attn .attn:last-child { padding-bottom: 14px; }
.sc-phone { border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: var(--surface-2); }
.sc-ph-top { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 10px; }
.sc-logo { width: 26px; height: 26px; border-radius: 8px; background: var(--bc); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.sc-ph-line { height: 8px; border-radius: 4px; background: var(--line); margin-bottom: 6px; } .sc-ph-line.s { width: 60%; }
.sc-ph-btn { margin-top: 10px; background: var(--bc); color: #fff; border-radius: 10px; text-align: center; font-size: 12px; font-weight: 700; padding: 7px; }
.sc-sw { display: flex; gap: 6px; margin-top: 10px; } .sc-sw i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
.sc-sec { margin-top: 18px; } .sc-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.sc-sec .sc-feats { margin-top: 0; }
.sc-bens { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.sc-bens li { display: flex; gap: 10px; align-items: flex-start; } .sc-bens b { display: block; font-size: 14px; } .sc-bens span { font-size: 12.5px; color: var(--muted); }
.sc-chk { width: 22px; height: 22px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; flex: none; margin-top: 1px; }
.sc-bens .sc-chk { color: var(--ok); font-size: inherit; }
@media (max-width: 860px) { .lg-mode { margin-left: auto; margin-right: auto; display: grid; width: min(340px, 100%); min-width: 0; } }
@media (max-width: 620px) { .sc-kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .sc-bens { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .lg-mode::before, .lg-copy, .lg-show { transition: none; animation: none; } }
.legal-v { place-items: start center; } .legal-box { width: min(760px, 100%); }
.legal { padding: clamp(18px, 4vw, 36px); line-height: 1.6; }
.legal h1 { font-size: clamp(24px, 4vw, 32px); text-align: left; margin: 0 0 6px; } .legal h2 { font-size: 16px; margin: 22px 0 6px; }
.legal p, .legal li { font-size: 14px; } .legal ul { padding-left: 20px; margin: 6px 0; } .legal li { margin-bottom: 4px; }
.legal a { color: var(--brand); } .legal-box .center a { color: var(--muted); text-decoration: underline; }

/* v1.20 platform admin + support mode */
.support-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #c2410c; color: #fff; font-size: 13px; }
.support-bar > span { flex: 1; min-width: 0; } .support-bar .btn { background: #fff; color: #9a3412; border-color: transparent; }
.support-bar .sb-note { opacity: .85; }
@media (max-width: 620px) { .support-bar .sb-note { display: none; } }
.adm-t { margin-bottom: 10px; } .adm-cl { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.adm-c { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--line); } .adm-c:last-child { border-bottom: 0; }
.card > .adm-c.adm-t { margin-bottom: 0; }
.adm-log { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); } .adm-log:last-child { border-bottom: 0; }
.adm-log .xs { width: 74px; flex: none; }
