/* Одна колонка под телефон и большой палец: шапка с выбором человека, карточки упражнений, снизу кнопка сохранения и вкладки */
@font-face{font-family:"Golos Text";font-weight:500;font-display:swap;src:url(/fonts/golos-500-cyr.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Golos Text";font-weight:500;font-display:swap;src:url(/fonts/golos-500-lat.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Golos Text";font-weight:600;font-display:swap;src:url(/fonts/golos-600-cyr.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Golos Text";font-weight:600;font-display:swap;src:url(/fonts/golos-600-lat.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Roboto Condensed";font-weight:700;font-display:swap;src:url(/fonts/robcond-700-cyr.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Roboto Condensed";font-weight:700;font-display:swap;src:url(/fonts/robcond-700-lat.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root{
  --bg:#EEF0F3; --surface:#FFFFFF; --sunk:#F4F5F7; --ink:#12151A; --muted:#5B6470; --line:#DDE1E6;
  --accent:#F97316; --on-accent:#12151A; --accent-soft:#FFEDD5; --accent-ink:#C2410C;
  --ok:#15803D; --ok-soft:#DCFCE7; --warn:#B91C1C; --warn-soft:#FEE2E2;
  --t-blue:#DBEAFE; --t-blue-ink:#1D4ED8; --t-violet:#EDE9FE; --t-violet-ink:#6D28D9;
  --shadow:0 1px 2px rgba(18,21,26,.06),0 4px 16px rgba(18,21,26,.05);
  --f-display:"Roboto Condensed","Arial Narrow",system-ui,sans-serif;
  --f-body:"Golos Text",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --r-lg:20px; --r-md:14px; --r-sm:10px;
  --dock-h:72px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root{
  --bg:#0F1216; --surface:#171B21; --sunk:#1F242B; --ink:#F1F3F5; --muted:#9AA3AE; --line:#2A3038;
  --accent:#F97316; --on-accent:#12151A; --accent-soft:#3A2414; --accent-ink:#FDBA74;
  --ok:#4ADE80; --ok-soft:#14301F; --warn:#FCA5A5; --warn-soft:#3B1A1A;
  --t-blue:#172554; --t-blue-ink:#93C5FD; --t-violet:#2E1065; --t-violet-ink:#C4B5FD;
  --shadow:none; color-scheme:dark}}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--f-body);font-weight:500;font-size:16px;line-height:1.45;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));
  padding-block:env(safe-area-inset-top,0px) calc(var(--dock-h) + 88px + env(safe-area-inset-bottom,0px))}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:10;background:var(--bg)}
[hidden]{display:none!important}
button{font-family:inherit;cursor:pointer;-webkit-user-select:none;user-select:none}
.ic{width:20px;height:20px;flex:none;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.wrap{max-width:560px;margin:0 auto}

/* шапка */
header{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;background:var(--bg);padding-block:14px 12px;display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.hdr-text{min-width:0}
.eyebrow{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
h1{font:700 30px/1.05 var(--f-display);margin:2px 0 0;letter-spacing:-.005em;text-wrap:balance}
.pips{display:inline-flex;gap:4px}
.pip{width:8px;height:8px;border-radius:50%;background:var(--line)}
.pip.on{background:var(--accent)}
.people{display:flex;gap:6px;flex:none}
.people button{width:44px;height:44px;border-radius:50%;border:2px solid var(--line);background:var(--surface);color:var(--muted);font:700 18px var(--f-display);display:grid;place-items:center}
.people button[aria-pressed="true"]{border-color:var(--accent);background:var(--accent);color:var(--on-accent)}

main{display:grid;gap:12px}
.status{padding:14px 16px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--line);color:var(--muted)}

/* карточки */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:16px;display:grid;gap:12px;min-width:0;box-shadow:var(--shadow);transition:border-color .2s}
.card.done{border-color:var(--ok)}
.sec{font:700 13px var(--f-display);text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:10px 4px -2px}
.pill{display:inline-flex;align-items:center;gap:5px;font-size:13px;color:var(--muted);background:var(--sunk);border-radius:999px;padding:4px 10px;white-space:nowrap}
.pill .ic{width:15px;height:15px}
.pill.ok{background:var(--ok-soft);color:var(--ok)}

/* сводка тренировки */
.today{gap:14px}
.today-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.today-top h2{font:700 24px/1.1 var(--f-display);margin:2px 0 0}
.datechip{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.datechip input{font:500 14px var(--f-body);color:var(--muted);background:var(--sunk);border:0;border-radius:999px;padding:5px 10px;min-height:32px;min-width:0}
.bar{height:10px;border-radius:999px;background:var(--sunk);overflow:hidden}
.bar i{display:block;height:100%;width:0;background:var(--accent);border-radius:inherit;transition:width .25s ease-out}
.bar.full i{background:var(--ok)}
.barlabel{display:flex;justify-content:space-between;font-size:13px;color:var(--muted)}
.barlabel b{font:700 15px var(--f-display);color:var(--ink);font-variant-numeric:tabular-nums}
.meta{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.checks{display:flex;gap:6px;flex-wrap:wrap}
.chip{display:inline-flex;align-items:center;gap:6px;min-height:40px;font:500 14px var(--f-body);padding:8px 14px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--muted)}
.chip .ic{width:16px;height:16px;display:none}
.chip[aria-pressed="true"]{background:var(--ok-soft);border-color:var(--ok);color:var(--ok)}
.chip[aria-pressed="true"] .ic{display:block}

/* упражнение */
.exh{display:flex;gap:12px;align-items:center}
.exh-text{min-width:0;flex:1}
.plate{flex:none;width:46px;height:46px;border-radius:50%;background:var(--ink);color:var(--bg);display:grid;place-items:center;font:700 18px var(--f-display);box-shadow:inset 0 0 0 4px var(--ink),inset 0 0 0 6px var(--muted)}
.plate.blank{background:var(--sunk);color:var(--muted);box-shadow:inset 0 0 0 2px var(--line)}
.card.done .plate{background:var(--ok);color:var(--surface);box-shadow:none}
.exname{font-weight:600;font-size:17px;line-height:1.25}
.exnote{font-size:13px;color:var(--muted)}
.work{display:grid;gap:10px;background:var(--sunk);border-radius:var(--r-md);padding:10px}
.stepper{display:grid;grid-template-columns:48px 1fr 48px;align-items:center;gap:6px}
.stepper button{height:48px;border-radius:var(--r-sm);border:1px solid var(--line);background:var(--surface);color:var(--ink);display:grid;place-items:center}
.stepper .val{display:flex;align-items:baseline;justify-content:center;gap:4px}
.stepper input{width:104px;text-align:right;border:0;background:none;color:var(--ink);font:700 34px/1 var(--f-display);font-variant-numeric:tabular-nums;padding:0}
.unit{font:700 15px var(--f-display);color:var(--muted)}
.sets{display:flex;gap:6px;align-items:flex-end}
.set{flex:1;min-width:0;display:grid;gap:3px;justify-items:center;font-size:11px;color:var(--muted)}
.set input{width:100%;height:48px;text-align:center;border-radius:var(--r-sm);border:1px solid var(--line);background:var(--surface);color:var(--ink);font:700 22px var(--f-display);font-variant-numeric:tabular-nums}
.set input::placeholder{color:var(--muted);opacity:.35}
.set input.done{background:var(--ok-soft);border-color:var(--ok);color:var(--ok)}
.set input.short{border-color:var(--accent);background:var(--accent-soft)}
.fill{height:48px;padding:0 12px;border-radius:var(--r-sm);border:1px solid var(--line);background:var(--surface);color:var(--ink);font:600 13px var(--f-body);display:inline-flex;align-items:center;gap:6px}
.fill .ic{width:16px;height:16px;color:var(--ok)}
.advice{display:flex;gap:10px;align-items:center;font-size:14px;line-height:1.35;color:var(--muted)}
.advice .badge{flex:none;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--sunk)}
.advice .badge .ic{width:17px;height:17px}
.advice.up{color:var(--ink)}
.advice.up .badge{background:var(--accent-soft);color:var(--accent-ink)}
.advice.down .badge{background:var(--warn-soft);color:var(--warn)}
.advice > span{flex:1;min-width:0}
.advice .btn{flex:none}

/* поля и кнопки */
label.f{display:grid;gap:4px;font-size:13px;color:var(--muted)}
.f input,.f textarea{font:500 16px var(--f-body);color:var(--ink);background:var(--sunk);border:1px solid var(--line);border-radius:var(--r-sm);padding:10px 12px;width:100%;min-width:0;min-height:46px}
.f input:disabled{opacity:.85;background:transparent}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;font:600 14px var(--f-body);border-radius:var(--r-sm);border:1px solid var(--line);background:var(--surface);color:var(--ink);padding:10px 14px}
.btn .ic{width:18px;height:18px}
.btn.primary{width:100%;min-height:54px;background:var(--accent);color:var(--on-accent);border-color:var(--accent);font-size:17px;font-weight:600;border-radius:var(--r-md);box-shadow:0 6px 20px rgba(249,115,22,.28)}
.btn.accent{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.btn.danger{color:var(--warn)}
.btn.small{min-height:40px;padding:8px 12px;font-size:13px}
.btn.icon{width:44px;padding:0}
.btn:disabled{opacity:.4;cursor:default}
@media (hover:hover){.btn:not(:disabled):hover,.chip:hover,.fill:hover,.stepper button:hover{border-color:var(--muted)}}
@media (prefers-reduced-motion: no-preference){
  .btn,.chip,.fill,.stepper button,.people button,.tabbar button{transition:transform .12s ease-out,background-color .15s,border-color .15s,color .15s}
  .btn:active:not(:disabled),.chip:active,.fill:active,.stepper button:active,.people button:active{transform:scale(.96)}
}

/* низ: сохранить + вкладки */
.dock{position:fixed;left:0;right:0;bottom:0;z-index:6;
  padding:0 max(16px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(16px,env(safe-area-inset-left,0px));
  background:linear-gradient(to bottom,transparent,var(--bg) 28px)}
.dock .wrap{display:grid;gap:10px;padding-top:24px}
.tabbar{display:grid;grid-template-columns:repeat(3,1fr);height:var(--dock-h);background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg) var(--r-lg) 0 0;border-bottom:0;box-shadow:var(--shadow)}
.tabbar button{border:0;background:none;color:var(--muted);display:grid;justify-items:center;align-content:center;gap:4px;font:600 12px var(--f-body);position:relative}
.tabbar button .ic{width:22px;height:22px}
.tabbar button[aria-current="page"]{color:var(--ink)}
.tabbar button[aria-current="page"]::before{content:"";position:absolute;top:0;left:30%;right:30%;height:3px;border-radius:0 0 3px 3px;background:var(--accent)}

/* прогресс и история */
.stats{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.stat{display:flex;gap:10px;align-items:center;background:var(--sunk);border-radius:var(--r-md);padding:10px 12px;min-width:0}
.stat .badge{flex:none;width:34px;height:34px;border-radius:50%;display:grid;place-items:center}
.stat .badge .ic{width:17px;height:17px}
.stat b{display:block;font:700 20px/1.1 var(--f-display);font-variant-numeric:tabular-nums}
.stat small{display:block;font-size:12px;color:var(--muted)}
.b-orange{background:var(--accent-soft);color:var(--accent-ink)}
.b-green{background:var(--ok-soft);color:var(--ok)}
.b-blue{background:var(--t-blue);color:var(--t-blue-ink)}
.b-violet{background:var(--t-violet);color:var(--t-violet-ink)}
.logh{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.logh h3{font:700 22px/1.1 var(--f-display);margin:2px 0 0}
.rows{display:grid;gap:6px}
.lr{display:flex;justify-content:space-between;align-items:center;gap:10px;background:var(--sunk);border-radius:var(--r-sm);padding:9px 12px;font-size:15px}
.lr > span:first-child{min-width:0}
.lr .res{font:700 17px var(--f-display);font-variant-numeric:tabular-nums;white-space:nowrap;display:inline-flex;align-items:center;gap:6px}
.lr .res.full{color:var(--ok)}
.lr .res .ic{width:16px;height:16px}
.tags{display:flex;gap:6px;flex-wrap:wrap}
.prog{display:grid;grid-template-columns:minmax(0,1fr) 84px auto;gap:12px;align-items:center;background:var(--sunk);border-radius:var(--r-md);padding:10px 12px}
.prog svg{width:84px;height:30px;display:block;overflow:visible}
.delta{font:700 20px var(--f-display);white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.delta.pos{color:var(--ok)}
.delta small{display:block;font:500 11px var(--f-body);color:var(--muted)}

/* программа */
.pe{display:grid;grid-template-columns:72px minmax(0,1fr);gap:8px}
.pe .nums{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.pe .note,.pe .acts{grid-column:1/-1}
.pe .acts{display:flex;gap:6px;justify-content:flex-end}
.add{border-style:dashed;background:transparent;min-height:52px;color:var(--muted)}

.empty{text-align:center;padding:32px 20px;color:var(--muted);display:grid;gap:10px;justify-items:center}
.empty .badge{width:56px;height:56px;border-radius:50%;display:grid;place-items:center}
.empty .badge .ic{width:26px;height:26px}
.empty b{color:var(--ink);font:700 22px var(--f-display)}

/* вход */
.login{max-width:380px;margin:9vh auto 0;display:grid;gap:14px}
.login .logo{width:72px;height:72px;border-radius:20px}
.login h1{font-size:44px;line-height:1}
.login p{margin:0;color:var(--muted)}
.err{color:var(--warn);font-size:14px;min-height:1.2em;margin:0}
.acct{display:grid;gap:10px}
.acct .row{display:flex;gap:8px;flex-wrap:wrap}

.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--dock-h) + 84px + env(safe-area-inset-bottom,0px));background:var(--ink);color:var(--bg);padding:12px 18px;border-radius:var(--r-md);font-weight:600;z-index:20;max-width:calc(100% - 32px);text-align:center;box-shadow:0 8px 24px rgba(0,0,0,.2)}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
@media (max-width:360px){h1{font-size:26px}.meta{grid-template-columns:1fr}}
.acts-inline{display:inline-flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
