/* ============================================================
   Дневник тренировок — стили. Токены повторяют дизайн SVX Fitness.
   ============================================================ */
:root {
  --accent: #bce837;
  --accent-ink: #52700f;
  --accent-press: #a6d022;
  --accent-soft: rgba(140,190,20,.16);
  --lime-200: #dbff91; --lime-300: #c9f24d; --lime-400: #b6e81a; --lime-500: #a4d104; --lime-600: #8eb604; --lime-700: #52700f;
  --mint-500: #36dda0; --mint-600: #0cc288; --mint-ink: #028058;
  --sky-400: #58ccff; --sky-600: #0993c1; --sky-ink: #07769c;
  --copper: #b56a34; --copper-soft: rgba(181,106,52,.14);
  --danger: #dc4436; --danger-soft: rgba(220,68,54,.12);
  --ok: #12a06a; --ok-ink: #0b7a50; --ok-soft: rgba(18,160,106,.12);
  --warn: #b8860b; --warn-ink: #7a5a07; --warn-soft: rgba(184,134,11,.12);
  --info: #0f7fc4; --info-soft: rgba(15,127,196,.12);
  --macro-p: #8eb604; --macro-f: #0cc288; --macro-c: #0993c1;
  --ring-track: rgba(10,20,40,.06);

  --bg: #f2f2f6;
  --surface: #ffffff;
  --surface-2: #ececf1;
  --surface-solid: #fff;
  --border: #e4e4ea;
  --border-strong: #d1d1d6;
  --text: #1c1c1e;
  --text-2: #636369;
  --text-3: #75757d;
  --on-accent: #12170a;
  --overlay: rgba(20,20,24,.4);
  --hero-grain: rgba(10,20,40,.05);
  --knob: #fff;

  --glass-fill: rgba(255,255,255,.72);
  --glass-blur: blur(18px) saturate(180%);
  --glass-shadow: 0 8px 24px rgba(20,24,40,.14), 0 1px 2px rgba(20,24,40,.1);
  --shadow-2: 0 4px 12px rgba(30,30,40,.12), 0 12px 32px -12px rgba(30,30,40,.2);
  --shadow-lift: 0 10px 24px rgba(30,30,40,.14), 0 28px 56px -18px rgba(30,30,40,.24);
  --shadow-sheet: 0 -12px 36px rgba(30,30,40,.18);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 18px; --r-2xl: 24px; --r-full: 999px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tap-min: 44px;
  --dur: .2s; --dur-fast: .12s; --dur-slow: .34s;
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.22, 1.4, .36, 1);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Manrope", sans-serif;
  --content-w: 560px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f15; --surface: #1b1e24; --surface-2: #26292f; --surface-solid: #13161c;
    --border: #2b2f36; --border-strong: #3a3f48;
    --text: #f2f3f5; --text-2: #a4a9b2; --text-3: #82868e;
    --overlay: rgba(0,0,0,.55); --hero-grain: rgba(255,255,255,.045);
    --ring-track: rgba(255,255,255,.08);
    --glass-fill: rgba(27,30,36,.78);
    --glass-shadow: 0 8px 24px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 4px 12px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.5);
    --shadow-sheet: 0 -12px 36px rgba(0,0,0,.5);
    --accent-soft: rgba(188,232,55,.16);
    --knob: #2b2f36;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f15; --surface: #1b1e24; --surface-2: #26292f; --surface-solid: #13161c;
  --border: #2b2f36; --border-strong: #3a3f48;
  --text: #f2f3f5; --text-2: #a4a9b2; --text-3: #82868e;
  --overlay: rgba(0,0,0,.55); --hero-grain: rgba(255,255,255,.045);
  --ring-track: rgba(255,255,255,.08);
  --glass-fill: rgba(27,30,36,.78);
  --glass-shadow: 0 8px 24px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 4px 12px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.5);
  --shadow-sheet: 0 -12px 36px rgba(0,0,0,.5);
  --accent-soft: rgba(188,232,55,.16);
  --knob: #2b2f36;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: radial-gradient(var(--hero-grain) 1px, transparent 1.3px) 0 0 / 14px 14px, var(--bg);
  color: var(--text); font-family: var(--font-ui); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
a { color: var(--accent-ink); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; width: 100%; max-width: var(--content-w); margin: 0 auto; padding: calc(var(--safe-t) + 12px) 16px calc(var(--tabbar-h) + var(--safe-b) + 32px); }
.view.full { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 120px); }

/* ---------- typography ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.eyebrow.accent { color: var(--accent-ink); }
.eyebrow .ic { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.b { font-weight: 700; }
.sb { font-weight: 600; }
.section-title { margin: 24px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.section-title .eyebrow { color: var(--text-2); }
.section-title a, .section-title button.link { font-size: 14px; font-weight: 600; color: var(--accent-ink); }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; }
.page-head .titles { flex: 1; min-width: 0; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.page-head .sub { color: var(--text-2); font-size: 15px; margin-top: 2px; }
.page-head .date { color: var(--text-2); font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.brand { width: 50px; height: 33px; flex: none; }
.brand svg { width: 100%; height: 100%; display: block; }

.page-head.nav { margin: 4px 0 16px; align-items: flex-start; }
.page-head.nav h1 { font-size: 26px; }
.back { width: 40px; height: 40px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 2px; }
.back:active { transform: scale(.94); }

.session-head { position: sticky; top: 0; z-index: 10; margin: -12px -16px 12px; padding: calc(var(--safe-t) + 10px) 16px 10px; background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.session-head .titles { flex: 1; min-width: 0; }
.session-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-head .sub { color: var(--text-2); font-size: 14px; white-space: nowrap; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 16px; margin-bottom: 12px; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card.hero { background: linear-gradient(140deg, var(--surface) 0%, var(--surface) 55%, rgba(188,232,55,.14) 100%); box-shadow: var(--shadow-2); border-color: transparent; }
.card.glow { box-shadow: var(--shadow-2); }
.card.cta { background: rgba(188,232,55,.12); border-color: rgba(120,160,20,.3); }
.card.dashed { border-style: dashed; background: transparent; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .divider { height: 1px; background: var(--border); margin: 14px -16px; }
.card .divider.inner { margin: 14px 0; }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 16px; font-weight: 600; font-size: 16px; }
.row-link .ic { color: var(--text-3); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: var(--r-full); padding: 10px 18px; font-weight: 600; font-size: 15px; white-space: nowrap; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); transition: transform var(--dur-fast) var(--ease), background var(--dur) var(--ease); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:active { background: var(--accent-press); }
.btn.soft { background: var(--surface-2); border-color: transparent; }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; font-size: 17px; padding: 12px 22px; }
.btn.sm { min-height: 36px; font-size: 14px; padding: 6px 14px; }
.btn.xs { min-height: 30px; font-size: 13px; padding: 4px 12px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1 1 auto; min-width: 0; }
.btn-row .btn.auto { flex: 0 0 auto; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-full); display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text); flex: none; }
.icon-btn.outline { background: var(--surface); border: 1px solid var(--border); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.accent { background: var(--accent); color: var(--on-accent); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.dashed-btn { width: 100%; min-height: 56px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-xl); display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--text); background: transparent; margin: 14px 0; }
.dashed-btn .plus { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.link-btn { font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.center { text-align: center; }
.center-actions { display: flex; flex-direction: column; align-items: center; gap: 18px; margin: 22px 0; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px 0 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 8px 16px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 14px; color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-full); background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text); }
.tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.pill.copper { background: var(--copper-soft); color: var(--copper); }
.pill.gray { background: var(--surface-2); color: var(--text-2); }

/* segmented */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 14px; padding: 3px; gap: 2px; }
.seg button { padding: 7px 14px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg.block { display: flex; }
.seg.block button { flex: 1; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input { width: 100%; min-height: 48px; border-radius: var(--r-md); border: 1.5px solid var(--border); background: var(--surface); padding: 10px 14px; font-size: 16px; outline: none; transition: border-color var(--dur); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(190,232,40,.2); }
textarea.input { min-height: 80px; resize: vertical; }
.input-row { display: flex; gap: 10px; }
.input-row .field { flex: 1; }
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search .input { padding-left: 42px; }
.num-input { width: 100%; min-height: 44px; border-radius: var(--r-md); border: 0; background: var(--surface-2); text-align: center; font-size: 19px; font-weight: 700; color: var(--text); padding: 6px 4px; outline: none; font-variant-numeric: tabular-nums; }
.num-input:focus { box-shadow: 0 0 0 2px var(--accent); }
.num-input::placeholder { color: var(--text-3); font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .num-input { flex: 1; }
.toggle { position: relative; width: 50px; height: 30px; border-radius: 15px; background: var(--border-strong); transition: background var(--dur); flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .t { font-weight: 600; }
.setting-row .d { font-size: 13px; color: var(--text-2); }
.slider { width: 100%; accent-color: var(--accent-press); }

/* ---------- lists ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 8px; text-align: left; width: 100%; }
.list-row:active { background: var(--surface-2); }
.list-row.on { border-color: var(--accent); background: var(--accent-soft); }
.list-row .main { flex: 1; min-width: 0; }
.list-row .t { font-weight: 600; font-size: 16px; line-height: 1.3; }
.list-row .d { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.list-row .right { font-weight: 700; font-size: 16px; white-space: nowrap; }
.thumb { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: var(--text-2); flex: none; letter-spacing: -.02em; position: relative; }
.thumb.sm { width: 36px; height: 36px; border-radius: 10px; font-size: 12px; }
.thumb.lime { background: var(--accent); color: var(--on-accent); }
.thumb.circle { border-radius: 50%; }
.circle-check { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.circle-check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.circle-check .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.numbered { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: none; }
.rows { display: flex; flex-direction: column; }
.rows > .row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rows > .row:last-child { border-bottom: 0; }
.rows > .row .main { flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--text-2); padding: 20px 10px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* day badge (ПН 11) */
.daybadge { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; flex: none; }
.daybadge .wd { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-2); text-transform: uppercase; }
.daybadge .dn { font-size: 20px; font-weight: 800; }
.daybadge.on { background: var(--accent); }
.daybadge.on .wd { color: var(--accent-ink); }

/* ---------- rings & stats ---------- */
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .track { stroke: var(--ring-track); fill: none; }
.ring .bar { fill: none; stroke-linecap: round; transition: stroke-dashoffset .7s var(--ease); }
.ring .inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.05; }
.ring .inner .v { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.ring .inner .v small { font-size: 16px; color: var(--text-2); font-weight: 600; }
.ring .inner .l { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin-top: 4px; }
.ring.gauge svg { transform: rotate(135deg); }

.stats-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; }
.stats-3 > div { padding: 6px 4px; border-left: 1px solid var(--border); }
.stats-3 > div:first-child { border-left: 0; }
.stats-3 .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stats-3 .v small { font-size: 14px; font-weight: 700; }
.stats-3 .l { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.stats-3 .v.sky { color: var(--sky-ink); } .stats-3 .v.lime { color: var(--accent-ink); } .stats-3 .v.mint { color: var(--mint-ink); }

.kv-list { display: flex; flex-direction: column; gap: 12px; }
.kv-list .kv { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.kv-list .kv:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-list .k { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kv-list .k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.kv-list .kv.mint .k::before { background: var(--mint-500); }
.kv-list .kv.sky .k::before { background: var(--sky-400); }
.kv-list .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.kv-list .v small { font-size: 14px; font-weight: 700; color: var(--text-2); }
.kv-list .d { font-size: 13px; color: var(--text-2); }
.week-card { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; }
@media (max-width: 360px) { .week-card { grid-template-columns: 1fr; } }

.progress { height: 8px; border-radius: 4px; background: var(--ring-track); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--lime-300), var(--lime-600)); transition: width .6s var(--ease); }
.progress.p > i { background: linear-gradient(90deg, var(--lime-300), var(--lime-600)); }
.progress.f > i { background: linear-gradient(90deg, var(--mint-500), var(--mint-600)); }
.progress.c > i { background: linear-gradient(90deg, var(--sky-400), var(--sky-600)); }
.macro { margin-bottom: 10px; }
.macro .mt { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.macro .mt b { font-size: 15px; }
.macro .mt b small { font-weight: 500; color: var(--text-2); font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { border-radius: var(--r-lg); background: var(--surface-2); padding: 10px 8px; text-align: center; border: 1.5px solid transparent; }
.tile.on { border-color: var(--lime-500); background: var(--accent-soft); }
.tile .tl { font-size: 13px; color: var(--text-2); }
.tile .tv { font-size: 20px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 2px; }
.tile .tv .plus { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.tile .tv .plus .ic { width: 14px; height: 14px; stroke-width: 2.5; }

.home-rings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.home-rings .hr { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--r-lg); padding: 10px; }
.home-rings .hr .t { font-size: 13px; color: var(--text-2); }
.home-rings .hr .v { font-size: 20px; font-weight: 800; line-height: 1.1; }
.home-rings .hr .v small { font-size: 13px; color: var(--text-2); font-weight: 600; }
.home-rings .hr .d { font-size: 12px; color: var(--text-3); }

/* ---------- week strip / calendar ---------- */
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.weekstrip .wd { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-2); }
.weekstrip .wd.today { color: var(--text); }
.weekstrip .dn { width: 38px; height: 38px; margin: 6px auto 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; border: 1.5px solid transparent; }
.weekstrip .dn.today { background: var(--text); color: var(--bg); }
.weekstrip .dn.plan { border-color: var(--lime-600); border-style: dashed; }
.weekstrip .dn.sel { background: var(--accent); color: var(--on-accent); }
.weekstrip .dot { width: 6px; height: 6px; border-radius: 50%; margin: 4px auto 0; background: transparent; }
.weekstrip .dot.on { background: var(--lime-600); }
.weekstrip .dot.today { background: var(--text); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h3 { font-size: 18px; font-weight: 800; }
.cal-head .sub { font-size: 13px; color: var(--text-2); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal .wd { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-2); padding: 4px 0 6px; }
.cal .day { height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; font-weight: 600; font-size: 15px; color: var(--text); }
.cal .day.out { color: var(--text-3); opacity: .5; }
.cal .day.sel { background: var(--accent); color: var(--on-accent); }
.cal .day .dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; margin-top: 2px; }
.cal .day .dot.on { background: var(--lime-600); }
.cal .day.sel .dot.on { background: var(--on-accent); }
.cal .day.today { box-shadow: inset 0 0 0 1.5px var(--text); }
.cal .day.today.sel { box-shadow: none; }

/* ---------- workout session ---------- */
.ex-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 14px 14px 12px; margin-bottom: 12px; }
.ex-card.done { border-color: rgba(140,190,20,.4); }
.ex-head { display: flex; align-items: center; gap: 12px; }
.ex-head .name { flex: 1; min-width: 0; font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.ex-head .cnt { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.ex-head .fold { color: var(--text-2); }
.ex-goal { font-size: 13.5px; color: var(--text-2); margin: 8px 0 10px; }
.ex-goal b { color: var(--text); }
.ex-note { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.ex-note .av { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ex-note .txt { flex: 1; min-width: 0; }
.sets { display: grid; grid-template-columns: 26px 1fr 84px 70px 44px; gap: 8px; align-items: center; }
.sets .hd { font-size: 12.5px; color: var(--text-2); text-align: center; padding: 2px 0 4px; }
.sets .hd.l { text-align: left; }
.sets .hd .circle-check { width: 26px; height: 26px; margin: 0 auto; }
.sets .n { font-weight: 700; font-size: 15px; color: var(--text-2); text-align: center; }
.sets .prev { font-size: 14px; color: var(--text-2); }
.sets .val { font-size: 19px; font-weight: 800; text-align: center; }
.sets .set { display: contents; }
.sets .set > * { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.sets .set > .prev { justify-content: flex-start; }
.sets .set.active > * { background: var(--accent-soft); }
.sets .set.active > *:first-child { border-radius: 10px 0 0 10px; }
.sets .set.active > *:last-child { border-radius: 0 10px 10px 0; }
@supports (grid-template-columns: subgrid) {
  .sets .set { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; gap: 8px; border-radius: 12px; margin: 0 -6px; padding: 2px 6px; }
  .sets .set.active { background: var(--accent-soft); }
  .sets .set.active > * { background: none; }
}
.sets .set.active .n { color: var(--accent-ink); }
.sets .set.active .num-input { background: var(--surface); }
.check { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; color: transparent; background: var(--surface); transition: transform var(--dur-fast) var(--spring), background var(--dur); }
.check:active { transform: scale(.9); }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check.next { border-color: var(--lime-500); box-shadow: 0 0 0 3px var(--accent-soft); }
.check .ic { width: 18px; height: 18px; stroke-width: 2.6; }
.ex-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; }
.ex-foot .add { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.ex-foot .add .plus { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.ex-foot .right { display: flex; gap: 8px; }
.ex-card.folded .ex-body { display: none; }
.ex-card.folded .ex-head .fold { transform: rotate(180deg); }

/* floating banner (active workout) */
.banner { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px); z-index: 25; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.banner > button { pointer-events: auto; width: 100%; max-width: calc(var(--content-w) - 32px); display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: var(--r-full); background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-lift); text-align: left; }
.banner .play { width: 44px; height: 44px; border-radius: 50%; background: var(--on-accent); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.banner .t { font-weight: 800; font-size: 16px; line-height: 1.2; }
.banner .d { font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner .main { flex: 1; min-width: 0; }

/* rest timer pill */
.rest { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px); z-index: 26; display: flex; justify-content: center; padding: 0 16px; }
.rest > div { width: 100%; max-width: calc(var(--content-w) - 32px); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; border-radius: var(--r-full); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lift); }
.rest .time { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 70px; }
.rest .lbl { font-size: 12px; opacity: .7; flex: 1; }
.rest .btn { min-height: 36px; padding: 4px 12px; font-size: 14px; background: rgba(255,255,255,.14); border-color: transparent; color: inherit; }
.rest .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); border-radius: 2px; }
.rest.over > div { background: var(--accent); color: var(--on-accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.02); } }

/* ---------- tabbar ---------- */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 12px); width: calc(100% - 32px); max-width: calc(var(--content-w) - 32px); height: var(--tabbar-h); z-index: 30; display: flex; align-items: center; justify-content: space-around; padding: 6px; border-radius: var(--r-full); background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); border: 1px solid rgba(255,255,255,.6); }
:root[data-theme="dark"] .tabbar { border-color: rgba(255,255,255,.08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar { border-color: rgba(255,255,255,.08); } }
.tabbar a { flex: 1; height: 48px; border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; color: var(--text); transition: background var(--dur), color var(--dur); }
.tabbar a .ic { width: 26px; height: 26px; stroke-width: 1.7; }
.tabbar a.on { background: var(--surface-2); color: var(--accent-ink); }
.tabbar a.on .ic { stroke-width: 2.2; }
body.in-session .tabbar { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); transition: opacity var(--dur), transform var(--dur); }

/* ---------- sheet / overlay ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 40; opacity: 0; transition: opacity var(--dur-slow) var(--ease); }
.overlay.in { opacity: 1; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%); width: 100%; max-width: var(--content-w); max-height: 92vh; max-height: 92dvh; background: var(--surface); border-radius: 24px 24px 0 0; z-index: 41; box-shadow: var(--shadow-sheet); display: flex; flex-direction: column; transition: transform var(--dur-slow) var(--ease); }
.sheet.in { transform: translate(-50%, 0); }
.sheet .handle { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 10px auto 6px; flex: none; }
.sheet .sheet-head { padding: 6px 20px 10px; flex: none; display: flex; align-items: center; gap: 10px; }
.sheet .sheet-head h2 { font-size: 22px; font-weight: 800; flex: 1; letter-spacing: -.01em; }
.sheet .sheet-body { padding: 0 20px calc(var(--safe-b) + 20px); overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.sheet .sheet-foot { padding: 12px 20px calc(var(--safe-b) + 16px); flex: none; border-top: 1px solid var(--border); background: var(--surface); }
.sheet .sheet-foot .btn { width: 100%; }
.sheet.tall { height: 92vh; height: 92dvh; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 4px; font-size: 16px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--border); }
.menu-item:last-child { border-bottom: 0; }
.menu-item.danger { color: var(--danger); }
.menu-item .ic { color: var(--text-2); }
.menu-item.danger .ic { color: var(--danger); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 90px); transform: translateX(-50%) translateY(10px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: var(--r-full); font-weight: 600; font-size: 14px; z-index: 50; opacity: 0; transition: all var(--dur-slow) var(--ease); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; box-shadow: var(--shadow-lift); }
.toast.in { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- profile ---------- */
.avatar { width: 120px; height: 120px; border-radius: 50%; padding: 5px; background: conic-gradient(from 180deg, var(--sky-400), var(--mint-500), var(--lime-400), var(--sky-400)); margin: 0 auto 12px; }
.avatar > div { width: 100%; height: 100%; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 44px; font-weight: 800; color: var(--accent-ink); }
.avatar.sm { width: 44px; height: 44px; padding: 2px; margin: 0; }
.avatar.sm > div { font-size: 18px; }
.profile-name { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.badges { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 8px; }
.badges::-webkit-scrollbar { display: none; }
.badge { flex: none; width: 92px; text-align: center; }
.badge .circ { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 6px; padding: 4px; background: conic-gradient(var(--sky-400), var(--sky-600)); }
.badge.copper .circ { background: conic-gradient(var(--copper), #e3a06b); }
.badge .circ > div { width: 100%; height: 100%; border-radius: 50%; background: var(--text); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.badge .circ .v { font-size: 22px; font-weight: 800; color: var(--sky-400); }
.badge.copper .circ .v { color: #e3a06b; }
.badge .circ .l { font-size: 10px; opacity: .8; margin-top: 2px; }
.badge .n { font-size: 13px; font-weight: 600; }
.records .row .w { font-size: 20px; font-weight: 800; white-space: nowrap; min-width: 90px; }
.records .row .w small { font-size: 13px; color: var(--text-2); font-weight: 600; }
.ach { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ach .a { text-align: center; padding: 12px 6px; border-radius: var(--r-lg); background: var(--surface-2); font-size: 12.5px; font-weight: 600; line-height: 1.25; opacity: .55; }
.ach .a.on { opacity: 1; background: var(--accent-soft); color: var(--accent-ink); }
.ach .a .ico { font-size: 26px; margin-bottom: 6px; }
.ach .a .p { font-size: 11px; color: var(--text-2); font-weight: 600; margin-top: 4px; }

/* ---------- chart ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--lime-600); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: url(#chartFill); }
.chart .pt { fill: var(--surface); stroke: var(--lime-600); stroke-width: 2; }
.chart text { font-size: 11px; fill: var(--text-3); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.bars .bar { flex: 1; background: var(--accent); border-radius: 4px 4px 2px 2px; min-height: 3px; position: relative; }
.bars .bar.off { background: var(--ring-track); }
.bars-l { display: flex; gap: 6px; margin-top: 6px; }
.bars-l span { flex: 1; text-align: center; font-size: 10px; color: var(--text-3); }

/* ---------- carousel ---------- */
.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; }
.carousel::-webkit-scrollbar { display: none; }
.carousel > .card { flex: 0 0 84%; scroll-snap-align: start; margin-bottom: 0; }
.carousel > .card h3 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 4px 0 6px; }

/* meal card */
.meal { margin-bottom: 12px; }
.meal .meal-head { display: flex; align-items: baseline; gap: 10px; }
.meal .meal-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: center; }
.meal .meal-head .dot.off { background: var(--border-strong); }
.meal .meal-head h3 { font-size: 20px; font-weight: 800; flex: 1; }
.meal .meal-head .kcal { font-size: 20px; font-weight: 800; }
.meal .meal-head .kcal small { font-size: 13px; color: var(--text-2); font-weight: 600; }
.meal .macros { font-size: 13px; color: var(--text-2); margin: 0 0 6px 18px; }
.food-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.food-row .main { flex: 1; min-width: 0; }
.food-row .t { font-weight: 600; }
.food-row .d { font-size: 13px; color: var(--text-2); }
.food-row .k { font-weight: 700; font-size: 16px; white-space: nowrap; }
.food-row .del { color: var(--text-3); }
.meal-actions { display: flex; gap: 8px; margin-top: 10px; }
.meal-actions .btn { flex: 1; }

/* day nav */
.daynav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.daynav .lbl { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }

/* install hint */
.install-hint { background: var(--info-soft); border-radius: var(--r-lg); padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }
.install-hint b { display: block; margin-bottom: 4px; }

/* splash */
.splash { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); z-index: 100; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
