/* VOICE everyday: a gym logbook you actually use between sets
   IDEA the loaded barbell; colours are competition plates (red 25, blue 20, yellow 15, green 10)
   PICTURE a 16-week training grid where trained days fill and join into a ribbon, plus the live set table
   COLOUR white / gym-night graphite ground, chalk ink, plate red leads, plate blue supports, yellow marks records
   TYPE Barlow Condensed for numbers and titles, Barlow for text
   LAYOUT phone: title, grid, actions, bottom tab bar; laptop: side rail + two columns */
:root{color-scheme:light dark;
--bg:light-dark(#ffffff,#121314);
--surf:light-dark(#f4f4f1,#1c1e21);
--surf2:light-dark(#ebebe6,#26292d);
--ink:light-dark(#121314,#f2f1ec);
--mute:light-dark(#5d6066,#9c9fa5);
--line:light-dark(#dfdfda,#2e3136);
--red:light-dark(#d92b25,#ff4b43);
--red-ink:#fff;
--blue:light-dark(#1f52cc,#5b8cff);
--yellow:light-dark(#c99700,#ffcc2e);
--green:light-dark(#178a4a,#3ccf7c);
--cell:light-dark(#ebebe6,#23262a);
--display:"Barlow Condensed","Arial Narrow",system-ui,sans-serif;
--text:"Barlow",system-ui,-apple-system,"Segoe UI",sans-serif;
--navh:64px;
--mv-far:color-mix(in srgb,var(--ink) 38%,var(--surf));
--mv-eq:color-mix(in srgb,var(--mute) 45%,var(--surf));
--mv-hlfar:color-mix(in srgb,var(--red) 45%,var(--surf));
--mv-loadfar:color-mix(in srgb,var(--blue) 40%,var(--surf))}
:root[data-theme=light]{color-scheme:light}
:root[data-theme=dark]{color-scheme:dark}
*{box-sizing:border-box;min-width:0}
html,body{margin:0}
[hidden]{display:none!important}
body{background:var(--bg);color:var(--ink);font:16px/1.5 var(--text);overflow-x:clip;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit;color:inherit}
svg{display:block}
h1,h2,h3{font-family:var(--display);font-weight:700;letter-spacing:-.01em;line-height:1.05;margin:0}
h1{font-size:clamp(34px,7vw,46px)}
h2{font-size:24px;margin-bottom:10px}
h3{font-size:20px}
p{margin:0}
.loading{padding:40px 0;color:var(--mute)}

/* shell */
#view{padding:calc(env(safe-area-inset-top,0px) + 20px) max(5vw,16px,env(safe-area-inset-right,0px)) calc(var(--navh) + env(safe-area-inset-bottom,0px) + 32px) max(5vw,16px,env(safe-area-inset-left,0px));outline:none;max-width:1000px}
.nav{position:fixed;z-index:20;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(5,1fr);background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-top:1px solid var(--line);padding:0 env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
.nav .brand{display:none}
.nav a{height:var(--navh);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:var(--mute);text-decoration:none;font-size:12px;font-weight:600}
.nav a svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.nav a.on{color:var(--red)}
.nav a:active{transform:scale(.94)}
@media(min-width:900px){
 .nav{top:0;right:auto;width:220px;display:flex;flex-direction:column;gap:4px;padding:28px 14px;border-top:0;border-right:1px solid var(--line)}
 .nav .brand{display:flex;align-items:center;gap:10px;font:800 30px var(--display);padding:0 10px 22px}
 .nav .brand svg{width:34px;height:34px}
 .nav a{flex-direction:row;justify-content:flex-start;height:46px;padding:0 12px;border-radius:10px;font-size:16px;gap:12px}
 .nav a:hover{background:var(--surf)}
 .nav a.on{background:var(--surf)}
 #view{margin-left:220px;padding:40px 48px 60px}
 #restbar{left:calc(220px + 24px)!important;bottom:24px!important;max-width:520px}
 .two>div+div{margin-top:0}
 .two{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:28px;align-items:start}
}

.two>div+div{margin-top:16px}

/* page head */
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:18px;flex-wrap:wrap}
.head .sub{color:var(--mute);margin-top:4px}
.iconbtn{width:44px;height:44px;border-radius:12px;border:1px solid var(--line);background:var(--surf);display:grid;place-items:center;cursor:pointer}
.iconbtn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;border-radius:12px;border:1px solid var(--line);background:var(--surf);font-weight:700;cursor:pointer;text-decoration:none;white-space:nowrap}
.btn:hover{background:var(--surf2)}
.btn:active{transform:translateY(1px)}
.btn.primary{background:var(--red);border-color:var(--red);color:var(--red-ink)}
.btn.primary:hover{filter:brightness(1.06)}
.btn.ghost{background:transparent}
.btn.danger{color:var(--red)}
.btn.block{width:100%}
.btn.sm{min-height:38px;padding:0 14px;font-size:15px;border-radius:10px}
.btn:focus-visible,.iconbtn:focus-visible,.nav a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.row.end{justify-content:flex-end}
.grow{flex:1}

/* cards */
.card{background:var(--surf);border-radius:16px;padding:18px;margin-bottom:14px}
.card.line{background:transparent;border:1px solid var(--line)}
.sec{margin-top:28px}
.sec-h{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:10px}
.sec-h a,.link{color:var(--blue);font-weight:600;text-decoration:none;background:none;border:0;padding:0;cursor:pointer}
.mute{color:var(--mute)}
.small{font-size:14px}
.banner{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;background:color-mix(in srgb,var(--yellow) 18%,var(--bg));border:1px solid color-mix(in srgb,var(--yellow) 50%,var(--bg));border-radius:14px;padding:12px 14px;margin-bottom:18px;font-size:15px}

/* stats */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(9em,1fr));gap:10px;margin:16px 0}
.stat{background:var(--surf);border-radius:14px;padding:12px 14px}
.stat b{display:block;font:700 34px/1 var(--display);white-space:nowrap}
.stat b small{font-size:18px;font-weight:600;color:var(--mute);margin-left:3px}
.stat span{font-size:14px;color:var(--mute)}

/* training grid */
.grid-wrap{background:var(--surf);border-radius:18px;padding:16px}
.tgrid{display:grid;grid-template-columns:auto repeat(var(--weeks),minmax(0,1fr));gap:4px;align-items:center}
.tgrid .dl{font-size:12px;color:var(--mute);padding-right:4px;line-height:1}
.tgrid i{aspect-ratio:1;border-radius:5px;background:var(--cell);display:block;position:relative}
.tgrid i.on{background:var(--red)}
.tgrid i.on.j-t::before{content:"";position:absolute;left:0;right:0;top:-4px;height:6px;background:var(--red)}
.tgrid i.today{box-shadow:inset 0 0 0 2px var(--ink)}
.tgrid i.fut{background:transparent;box-shadow:inset 0 0 0 1px var(--line)}
.tgrid .ml{font-size:12px;color:var(--mute);grid-row:1;white-space:nowrap;overflow:visible}
.goal{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.goal b{font:700 44px/1 var(--display)}
.goal .of{font:600 22px var(--display);color:var(--mute)}
.plates{display:flex;gap:4px;align-items:center}
.plates span{width:12px;height:36px;border-radius:3px;background:var(--cell)}
.plates span.on{background:var(--red)}
.plates span:nth-child(even).on{background:var(--blue)}

/* list items */
.item{display:flex;gap:12px;align-items:center;width:100%;text-align:left;background:var(--surf);border:0;border-radius:14px;padding:14px;margin-bottom:8px;cursor:pointer;color:inherit;text-decoration:none}
.item:hover{background:var(--surf2)}
.item .t{font-weight:700}
.item .s{font-size:14px;color:var(--mute);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item .v{margin-left:auto;font:700 20px var(--display);white-space:nowrap;text-align:right}
.item .v small{display:block;font:500 13px var(--text);color:var(--mute)}
.date-badge{flex:none;width:48px;text-align:center;background:var(--bg);border-radius:10px;padding:5px 0;line-height:1}
.date-badge b{display:block;font:700 24px var(--display)}
.date-badge span{font-size:12px;color:var(--mute)}
.month{font:700 20px var(--display);color:var(--mute);margin:22px 0 8px}
.chips{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px;margin:12px 0;scrollbar-width:none}
.chip{flex:none;border:1px solid var(--line);background:var(--bg);border-radius:99px;padding:7px 14px;font-weight:600;font-size:15px;cursor:pointer}
.chip.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.cat-dot{width:10px;height:10px;border-radius:50%;flex:none}
input.search,.field input,.field select,.field textarea{width:100%;min-height:48px;border-radius:12px;border:1px solid var(--line);background:var(--bg);padding:10px 14px;font-size:16px}
.field{display:block;margin-bottom:14px}
.field>span{display:block;font-weight:600;margin-bottom:6px;font-size:15px}
.empty{text-align:center;padding:36px 16px;color:var(--mute)}
.empty svg{width:120px;margin:0 auto 14px}
.empty h3{color:var(--ink);margin-bottom:6px}

/* active workout */
.wk-top{position:sticky;top:0;z-index:5;background:var(--bg);margin:0 calc(-1*max(5vw,16px));padding:calc(env(safe-area-inset-top,0px) + 10px) max(5vw,16px) 12px;border-bottom:1px solid var(--line);margin-top:calc(-1*(env(safe-area-inset-top,0px) + 20px))}
@media(min-width:900px){.wk-top{margin:-40px -48px 0;padding:20px 48px 14px}}
.wk-top input{border:0;background:transparent;font:700 28px var(--display);padding:0;width:100%;outline:none}
.wk-meta{display:flex;gap:18px;font-size:15px;color:var(--mute);margin-top:2px;flex-wrap:wrap}
.wk-meta b{color:var(--ink);font:700 20px var(--display);margin-right:3px}
.ex{background:var(--surf);border-radius:16px;padding:14px;margin:14px 0}
.ex-h{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.ex-h h3{flex:1}
.ex-h .note{font-size:13px;color:var(--mute)}
.sets{width:100%;border-collapse:separate;border-spacing:0 6px}
.sets th{font-size:13px;color:var(--mute);font-weight:600;text-align:center;padding:0 4px}
.sets td{text-align:center;padding:0 3px}
.sets td.n{font:700 18px var(--display);width:32px;color:var(--mute)}
.sets td.prev{font-size:13px;color:var(--mute);white-space:nowrap;width:22%}
.sets input{width:100%;max-width:90px;height:44px;border-radius:10px;border:1px solid var(--line);background:var(--bg);text-align:center;font:600 18px var(--text);padding:0 4px}
.sets input::placeholder{color:color-mix(in srgb,var(--mute) 70%,transparent)}
.sets tr.done input{background:color-mix(in srgb,var(--green) 14%,var(--bg));border-color:color-mix(in srgb,var(--green) 45%,var(--bg))}
.chk{width:44px;height:44px;border-radius:10px;border:2px solid var(--line);background:var(--bg);display:grid;place-items:center;cursor:pointer}
.chk svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;opacity:.25}
tr.done .chk{background:var(--green);border-color:var(--green);color:#fff}
tr.done .chk svg{opacity:1}
.del{width:32px;height:44px;border:0;background:none;color:var(--mute);cursor:pointer;font-size:20px}

/* rest bar */
#restbar{position:fixed;z-index:30;left:12px;right:12px;bottom:calc(var(--navh) + env(safe-area-inset-bottom,0px) + 10px);background:var(--ink);color:var(--bg);border-radius:16px;padding:10px 10px 10px 16px;display:flex;align-items:center;gap:8px;box-shadow:0 6px 20px rgba(0,0,0,.25);overflow:hidden}
#restbar .rt{font:700 34px/1 var(--display);font-variant-numeric:tabular-nums;min-width:3.2ch}
#restbar .rl{font-size:13px;opacity:.7;flex:1;line-height:1.2}
#restbar button{height:40px;min-width:48px;border-radius:10px;border:0;background:color-mix(in srgb,var(--bg) 18%,transparent);color:inherit;font-weight:700;cursor:pointer}
#restbar .bar{position:absolute;left:0;bottom:0;height:4px;background:var(--red);transition:width 1s linear}

/* sheet */
.sheet{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-end;justify-content:center}
.sheet-bg{position:absolute;inset:0;background:rgba(0,0,0,.45)}
.sheet-card{position:relative;background:var(--bg);width:100%;max-width:620px;max-height:90vh;max-height:90dvh;overflow-y:auto;border-radius:20px 20px 0 0;padding:22px max(16px,env(safe-area-inset-right,0px)) calc(22px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));animation:up .22s ease-out}
@media(min-width:700px){.sheet{align-items:center}.sheet-card{border-radius:20px;padding:26px}}
@keyframes up{from{transform:translateY(30px);opacity:.4}}
@media(prefers-reduced-motion:reduce){.sheet-card{animation:none}#restbar .bar{transition:none}}
.sheet-h{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}
.x{width:40px;height:40px;border-radius:50%;border:0;background:var(--surf);font-size:22px;line-height:1;cursor:pointer;flex:none}
#toast{position:fixed;z-index:60;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top,0px) + 14px);background:var(--ink);color:var(--bg);padding:10px 18px;border-radius:12px;font-weight:600;max-width:calc(100% - 32px);box-shadow:0 6px 20px rgba(0,0,0,.2)}

/* charts */
.fig{position:relative;height:200px}
.fig>svg{position:absolute;inset:0;width:100%;height:100%}
.fig text{font:13px var(--text);fill:var(--mute);paint-order:stroke;stroke:var(--surf);stroke-width:4px}
.fig text.v{fill:var(--ink);font-weight:700}
.hbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;align-items:center;margin-bottom:10px}
.hbar .name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hbar .val{font:700 18px var(--display);white-space:nowrap;text-align:right}
.hbar .track{grid-column:1/-1;height:8px;border-radius:4px;background:var(--cell)}
.hbar .track i{display:block;height:100%;border-radius:4px;background:var(--blue)}
.pr{display:inline-block;background:var(--yellow);color:#1a1400;font:700 12px var(--text);border-radius:6px;padding:2px 6px;vertical-align:middle;margin-left:6px}
.detail-ex{border-top:1px solid var(--line);padding:12px 0}
.detail-ex .sl{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.detail-ex .sl span{background:var(--surf);border-radius:8px;padding:4px 10px;font-weight:600;font-size:15px;white-space:nowrap}
.summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0}
.summary div{background:var(--surf);border-radius:12px;padding:10px;text-align:center}
.summary b{display:block;font:700 26px var(--display);white-space:nowrap}
.summary span{font-size:13px;color:var(--mute)}
.seg{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.seg button{min-height:44px;border-radius:10px;border:1px solid var(--line);background:var(--bg);font-weight:600;cursor:pointer;font-size:15px}
.seg button.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}

/* animace cviků */
.move{position:relative;height:clamp(210px,60vw,300px);background:var(--surf);border-radius:16px;overflow:hidden;cursor:pointer;margin-bottom:12px}
.move svg{position:absolute;inset:8px;width:calc(100% - 16px);height:calc(100% - 16px)}
.move-state{position:absolute;right:12px;bottom:10px;font-size:14px;font-weight:700;color:var(--ink);background:var(--bg);border-radius:8px;padding:2px 8px}
.move-state:empty{display:none}
.how-mus{margin-bottom:12px}
.how-h{margin:14px 0 6px}
.how-steps,.how-tips{margin:0;padding-left:22px}
.how-steps li,.how-tips li{margin-bottom:6px}
.how-steps li::marker{font-weight:700;color:var(--red)}
.how-tips li::marker{color:var(--yellow)}
.iconbtn.help{width:38px;height:38px;font:700 20px var(--display);color:var(--blue)}

/* přihlášení */
body.auth .nav{display:none}
body.auth #view{margin-left:0;max-width:none}
.auth-box{max-width:400px;margin:0 auto;padding-top:min(8vh,64px)}
.auth-logo{display:flex;align-items:center;gap:10px;font:800 30px var(--display);margin-bottom:28px}
.auth-logo svg{width:40px;height:40px}
.auth-box h1{margin-bottom:6px}
.auth-box .sub{color:var(--mute);margin-bottom:22px}
.auth-msg{background:color-mix(in srgb,var(--yellow) 18%,var(--bg));border-radius:12px;padding:10px 14px;margin-bottom:16px}
.auth-err{color:var(--red);font-weight:600;margin:-4px 0 12px}
.auth-switch{margin-top:18px;text-align:center}
.check{display:flex;align-items:center;gap:10px;min-height:44px;margin:-4px 0 14px;font-weight:600}
.check input{width:22px;height:22px;accent-color:var(--red)}
