/* ================= Теми ================= */
:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #eeebe5;
  --text: #1a1c1f;
  --muted: #5f646b;
  --line: #e2ddd5;
  --accent: #e4572e;
  --accent-ink: #b9401c;
  --accent-soft: #fde6dd;
  --on-accent: #ffffff;
  --ok: #1f9d55;
  --danger: #c62828;
  --ph-warm: #f2a516;
  --ph-steady: #0fa595;
  --ph-fast: #e5383b;
  --ph-easy: #3fae4f;
  --ph-cool: #3a7bd5;
  --shadow: 0 1px 2px rgba(30, 25, 20, .05), 0 4px 16px rgba(30, 25, 20, .05);
  --radius: 20px;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --surface: #1b1e21;
    --surface-2: #25292d;
    --text: #eef0f2;
    --muted: #a2a8af;
    --line: #2d3236;
    --accent: #ff6f45;
    --accent-ink: #ff9372;
    --accent-soft: #3a231b;
    --ok: #4ade80;
    --danger: #f87171;
    --shadow: none;
    color-scheme: dark;
  }
}

/* ================= Основа ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 .6em; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent-ink); }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.tiny { font-size: .8rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ok-text { color: var(--ok); font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ================= Горна лента ================= */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(8px)) {
  .topbar { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
.top-titles { min-width: 0; }
.top-titles h1 { font-size: 1.15rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-titles p { margin: 0; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark, .icon-btn {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
}
.brand-mark { background: var(--accent); color: var(--on-accent); }
.brand-mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { background: var(--surface); border: 1px solid var(--line); color: var(--text); cursor: pointer; padding: 0; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.small { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn.small svg { width: 18px; height: 18px; }

/* ================= Главен дел ================= */
main {
  max-width: 600px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}
body.no-tabs main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 4px 10px; font-weight: 700; }
.eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); font-weight: 700; margin-bottom: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:active { transform: scale(.99); }

/* ================= Копчиња ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
}
.btn svg { width: 20px; height: 20px; }
.btn svg .fill, .btn-round svg .fill { fill: currentColor; stroke: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small-btn { min-height: 40px; padding: 6px 14px; font-size: .9rem; margin-top: 8px; }
.btn-row { display: flex; gap: 8px; }
.btn-row.wrap { flex-wrap: wrap; }
.btn-col { display: grid; gap: 8px; margin-top: 4px; }

/* ================= Почетна ================= */
.hero { display: flex; align-items: center; gap: 18px; }
.hero h2 { font-size: 1.4rem; margin-bottom: 4px; }
.ring-wrap { position: relative; width: 112px; height: 112px; flex: none; }
.ring-wrap.small { width: 92px; height: 92px; }
.ring-wrap svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-center b { font-size: 1.6rem; line-height: 1; }
.ring-wrap.small .ring-center b { font-size: 1.25rem; }
.ring-center span { font-size: .72rem; color: var(--muted); margin-top: 3px; }

.link-card { display: flex !important; align-items: center; gap: 14px; }
.link-card > div:nth-child(2) { flex: 1; min-width: 0; }
.link-card h3 { margin-bottom: 2px; }
.link-card.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.link-card.soft { background: var(--accent-soft); border-color: transparent; }
.lc-icon { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.lc-icon svg { width: 22px; height: 22px; }
.lc-icon svg .fill { fill: currentColor; }
svg.st { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lc-icon.ok { background: var(--ok); }
.chev { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.eq-card { display: flex !important; align-items: center; gap: 14px; }
.eq-card > div:nth-child(2) { flex: 1; }
.eq-icon { flex: none; width: 60px; height: 60px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.eq-icon svg { width: 40px; height: 40px; }

.install h3 { margin-bottom: 8px; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 4px; }

/* ================= Справа / програма ================= */
.anim-box { width: 100%; aspect-ratio: 4 / 3; max-height: 260px; margin: 0 auto; }
.eq-hero .anim-box { margin-bottom: 8px; }
.anim-svg { width: 100%; height: 100%; }
.a-shadow { fill: var(--surface-2); }
.a-frame { fill: none; stroke: var(--muted); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.a-seat { fill: none; stroke: var(--text); stroke-width: 8; stroke-linecap: round; }
.a-console { fill: var(--surface-2); stroke: var(--muted); stroke-width: 3; }
.a-wheel { fill: var(--surface-2); stroke: var(--muted); stroke-width: 6; }
.a-spokes line { stroke: var(--muted); stroke-width: 3; stroke-linecap: round; opacity: .6; }
.a-hub { fill: var(--text); }
.a-crank { stroke: var(--text); stroke-width: 5; stroke-linecap: round; }
.a-limb { fill: none; stroke: var(--c, var(--accent)); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.a-far .a-limb, .a-far .a-crank { opacity: .4; }
.a-arm { stroke-width: 9; }
.a-torso { stroke: var(--c, var(--accent)); stroke-width: 18; stroke-linecap: round; }
.a-head { fill: var(--c, var(--accent)); }

.chips { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--surface-2); border-radius: 999px; padding: 5px 11px; font-size: .82rem; }

.prog-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.prog-top .push { margin-left: auto; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.badge.lvl-beginner { background: color-mix(in srgb, var(--ph-easy) 18%, transparent); color: var(--ph-easy); }
.badge.lvl-intermediate { background: color-mix(in srgb, var(--ph-warm) 20%, transparent); color: #b06f00; }
.badge.lvl-advanced { background: color-mix(in srgb, var(--ph-fast) 16%, transparent); color: var(--ph-fast); }
.badge.rec { background: var(--accent); color: var(--on-accent); }
.badge.soft { background: var(--surface-2); color: var(--muted); }
@media (prefers-color-scheme: dark) { .badge.lvl-intermediate { color: var(--ph-warm); } }

.bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 10px 0 4px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill { min-height: 44px; min-width: 70px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 14px; background: var(--surface-2); color: var(--text); font-weight: 650; text-decoration: none; }

.fold { padding: 0; }
.fold summary { padding: 15px 16px; font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.fold[open] summary::after { transform: rotate(-135deg); }
.fold-body { padding: 0 16px 16px; }
.bullets { margin: 0; padding-left: 20px; }
.bullets li { margin-bottom: 6px; }
.guide { margin: 0 0 10px; }
.guide > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.guide dt { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.guide dd { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }

.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--c, var(--accent)); }

.week header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.week h3 { margin: 0; }
.sess-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.sess {
  width: 60px; height: 60px; border-radius: 16px; border: 2px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text); text-decoration: none; font-weight: 700; background: var(--surface);
}
.sess small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.sess.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.sess.done small { color: #fff; }
.sess small svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.plan-lines p { margin-bottom: 3px; }

/* ================= Тренинг ================= */
.wk { --c: var(--accent); display: flex; flex-direction: column; gap: 10px; }
.wk-stage { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.wk-anim { max-height: 210px; }
.wk-badge {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--c); color: #fff; font-weight: 750;
  padding: 7px 13px; border-radius: 999px; font-size: 1rem;
  transition: background .3s;
}
.wk[data-state="ready"] .wk-badge { background: var(--surface-2); color: var(--text); }
.wk-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.wk[data-state="running"] .wk-badge .dot { animation: pulse 1.2s infinite; }
.wk-rep { font-weight: 600; opacity: .9; }
.wk-rep:empty { display: none; }
@keyframes pulse { 50% { opacity: .3; } }

.wk-clock { position: relative; width: min(64vw, 230px); aspect-ratio: 1; margin: 2px auto 0; }
.wk-clock .ring { width: 100%; height: 100%; }
.wk-clock .ring-bg { stroke-width: 8; }
.wk-clock .ring-fg { stroke: var(--c); stroke-width: 8; transition: stroke-dashoffset .25s linear, stroke .3s; }
.wk-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wk-time .num { font-size: clamp(3rem, 15vw, 4.2rem); font-weight: 750; line-height: 1; letter-spacing: -0.02em; }
.wk[data-state="paused"] .wk-time .num { opacity: .5; }
.wk-cue { text-align: center; font-size: 1rem; min-height: 2.9em; margin: 0 4px; }
.wk-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted); }
.wk-meta > span:last-child { text-align: right; }
.timeline { position: relative; display: flex; gap: 2px; height: 12px; border-radius: 99px; overflow: hidden; }
.timeline i { display: block; height: 100%; opacity: .75; }
.timeline b { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--text); border-radius: 2px; box-shadow: 0 0 0 2px var(--bg); }
.wk-total { display: flex; justify-content: space-between; margin-top: -4px; }
.wk-controls { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 6px 0; }
.btn-round {
  width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.btn-round svg { width: 26px; height: 26px; }
.btn-round.big { width: 84px; height: 84px; border: none; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-round.big svg { width: 38px; height: 38px; }
.btn-round:disabled { opacity: .35; }
.btn-round:active { transform: scale(.95); }

@media (min-width: 600px) and (min-height: 700px) {
  .wk-anim { max-height: 240px; }
}

/* ================= Крај ================= */
.finish { text-align: center; padding: 24px 16px; }
.finish-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.finish-icon.partial { background: var(--ph-warm); }
.finish-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.finish-big { font-size: 2.4rem; font-weight: 800; margin: 6px 0; }

/* ================= Форми ================= */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 10px 0; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; color: var(--muted); font-weight: 600; }
input[type="number"], input[type="text"] {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 1.05rem;
}
.input-unit { position: relative; display: block; }
.input-unit input { padding-right: 46px; }
.input-unit em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: .85rem; pointer-events: none; }
.inline-form { display: flex; gap: 8px; margin: 10px 0 6px; }
.inline-form .input-unit { flex: 1; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.opt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt-col { display: grid; gap: 8px; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; }
.opt > span { display: flex; flex-direction: column; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); min-height: 48px; justify-content: center; }
.opt small { color: var(--muted); font-size: .8rem; }
.opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.errors { color: var(--danger); font-size: .9rem; margin: 10px 0 0; }
.errors:empty { display: none; }
.switch { display: flex; justify-content: space-between; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch input { order: 2; appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); }
.switch input:disabled { opacity: .4; }
.switch + .tiny, .switch + .btn { margin-top: 10px; }
.card > .btn { margin-top: 12px; }

/* ================= Напредок ================= */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.45rem; line-height: 1.1; }
.stat span { font-size: .74rem; color: var(--muted); }
.chart { width: 100%; height: auto; margin: 6px 0 8px; overflow: visible; }
.chart .b { fill: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.chart .b-ok { fill: var(--accent); }
.chart .c-base { stroke: var(--line); stroke-width: 1; }
.chart .c-goal { stroke: var(--text); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .55; }
.chart .c-ax { fill: var(--muted); font-size: 10px; }
.chart .c-val { fill: var(--text); font-size: 10px; font-weight: 700; }
.chart .c-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.chart .c-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.prog-line { display: grid; grid-template-columns: 1fr 90px auto; align-items: center; gap: 10px; padding: 8px 0; color: inherit; text-decoration: none; font-size: .92rem; }
.prog-line .bar { margin: 0; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.hist b { font-size: .95rem; font-weight: 650; }
.hist p { margin: 2px 0 0; }
.tag { background: color-mix(in srgb, var(--ph-warm) 25%, transparent); border-radius: 6px; padding: 1px 6px; color: var(--text); }

/* ================= План ================= */
.ps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.ps-grid > div { display: flex; flex-direction: column; }
.ps-grid b { font-size: 1rem; }
.kcal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.meal-split { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.meal-split > div { background: var(--surface-2); border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.meal-split b { font-size: 1rem; }
.note { background: color-mix(in srgb, var(--ph-warm) 16%, var(--surface)); border-left: 4px solid var(--ph-warm); padding: 10px 12px; border-radius: 10px; }
.plate { display: flex; gap: 16px; align-items: center; }
.plate svg { width: 120px; height: 120px; flex: none; }
.plate-rim { fill: var(--surface-2); }
.plate path { stroke: var(--surface); stroke-width: 2; }
.plate ul { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.plate li { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.plate li i { width: 12px; height: 12px; border-radius: 4px; flex: none; margin-top: 4px; }
.ai-text h4 { font-size: 1rem; margin: 14px 0 6px; }
.ai-text h4:first-child { margin-top: 0; }
.ai-text { margin-bottom: 10px; }
.ai-ctl { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.ai-card > .ai-ctl:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* ================= Долна лента ================= */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; max-width: 150px; height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 650;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--accent-ink); }
.tabbar a.active svg { stroke-width: 2.6; }

/* ================= Модал, тост ================= */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.modal { background: var(--surface); color: var(--text); border-radius: 24px; padding: 22px 20px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; }
.modal h2 { margin-bottom: 12px; font-size: 1.3rem; }
.modal p { font-size: .93rem; }
.modal-logo { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; margin-bottom: 12px; }
.modal-logo svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 600px) { .modal-backdrop { align-items: center; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px;
  display: flex; gap: 14px; align-items: center; max-width: calc(100vw - 32px); width: max-content;
  font-size: .92rem; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 800; cursor: pointer; padding: 4px; }

@media (max-width: 360px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ps-grid, .meal-split { grid-template-columns: repeat(2, 1fr); }
  .hero { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

details.mini { margin-top: 10px; font-size: .9rem; }
details.mini summary { cursor: pointer; color: var(--accent-ink); font-weight: 650; padding: 6px 0; }
details.mini p { margin: 10px 0 4px; }
.install .btn.block { margin: 10px 0 4px; }

.install-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.install-head h3 { margin: 0; }
.install-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.install-icon svg { width: 24px; height: 24px; }
.install.highlight { background: var(--accent-soft); border: 2px solid var(--accent); }
.install.highlight .install-head h3 { font-size: 1.15rem; }
