/* Apple-style theme: off-white canvas, white rounded cards, system (SF) type, blue accent, light only. */
:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .1);
  --accent: #0066cc;
  --accent-bg: #0066cc;
  --accent-ink: #ffffff;
  --tile: #f5f5f7;
  --note-bg: #eef5fd;
  --red: #ff3b30;
  --glass: rgba(245, 245, 247, .85);
  --nav-glass: rgba(255, 255, 255, .86);
  --chip: rgba(0, 0, 0, .05);
  --chip-hover: rgba(0, 0, 0, .09);
  --accent-soft: rgba(0, 102, 204, .1);
  --orange-bg: rgba(255, 149, 0, .16);
  --orange-fg: #8a4b00;
  --done-fg: #1a7f37;
  --pill-bg: rgba(29, 29, 31, .92);
  --orange: #ff9500;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r-lg: 22px;
  --r-md: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 17px; line-height: 1.47;
  -webkit-font-smoothing: antialiased; letter-spacing: -.011em;
  padding-block: 28px 72px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(2.3rem, 8vw, 3.6rem); line-height: 1.05; font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: 1.75rem; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; }
h3 { font-size: 1.3rem; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid rgba(0, 113, 227, .5); outline-offset: 2px; }
button { font-family: inherit; }

.hero { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.eyebrow { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }

/* tabs */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 20; background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.tabs { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px; margin-inline: -2px; scrollbar-width: none;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; font-size: .95rem; font-weight: 500; color: var(--fg); background: var(--chip); border: 0; padding: 8px 16px; border-radius: 980px; cursor: pointer; transition: background .2s, color .2s; }
.tabs button:hover { background: var(--chip-hover); }
.tabs button.on { background: var(--fg); color: var(--bg); }

.panel-tab { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.js .panel-tab { display: none; }
.js .panel-tab.active { display: flex; }

.panel { background: var(--surface); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .95rem; }
th { font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
tbody tr:last-child td { border-bottom: 0; }
td strong { font-weight: 600; }
.rest { color: var(--muted); }
ul.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.note { background: var(--note-bg); color: var(--fg); padding: 14px 16px; border-radius: var(--r-md); font-size: .95rem; }
.foot { color: var(--muted); font-size: .85rem; }
.sources ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; font-size: .93rem; }

.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.stat { background: var(--tile); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 1.7rem; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; }
.stat span { color: var(--muted); font-size: .85rem; }

/* day header */
.dayhead { display: flex; align-items: center; gap: 16px; background: var(--surface); border-radius: var(--r-lg); padding: 20px 24px; }
.dayhead > div { min-width: 0; }
.dayhead p { color: var(--muted); }
.dayhead .when { color: var(--accent); font-weight: 600; font-size: .9rem; margin-top: 2px; }
.dayhead .figs { margin-left: auto; }
.dk { font-size: 1.9rem; font-weight: 700; background: var(--accent-bg); color: var(--accent-ink); width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: none; }

.sumbox { background: var(--surface); border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sum { min-width: 330px; }
.sum a { color: var(--fg); font-weight: 600; }
.sum a:hover { color: var(--accent); }
.reset { align-self: flex-start; font-size: .9rem; color: var(--accent); background: var(--accent-soft); border: 0; padding: 8px 16px; border-radius: 980px; cursor: pointer; }

/* exercise card */
.ex { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); min-width: 0; scroll-margin-top: 70px; }
.pics { display: grid; grid-template-rows: 1fr 1fr; gap: 2px; background: var(--bg); }
.pics figure { margin: 0; position: relative; background: #fff; }
.pics img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.pics figcaption { position: absolute; left: 10px; top: 10px; font-size: .72rem; font-weight: 600; background: rgba(29, 29, 31, .72); color: #fff; padding: 3px 10px; border-radius: 980px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.body { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.n { color: var(--accent); margin-right: 8px; font-variant-numeric: tabular-nums; }
.tag { margin-left: 8px; font-size: .7rem; font-weight: 600; background: var(--tile); color: var(--muted); padding: 3px 10px; border-radius: 980px; vertical-align: middle; }
.ex h4, .grip h4 { font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.musblock { display: flex; gap: 16px; align-items: flex-start; }
.muscles { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.mrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ml { font-size: .72rem; font-weight: 600; color: var(--muted); min-width: 118px; }
.mchip { font-size: .85rem; padding: 3px 12px; border-radius: 980px; }
.mchip.p { background: var(--red); color: #fff; font-weight: 600; }
.mchip.s { background: var(--orange-bg); color: var(--orange-fg); }
.legend { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.r { background: #fc0000; } .dot.o { background: #f57900; margin-left: 6px; }
.figs { display: flex; gap: 6px; flex: none; }
.fig { margin: 0; position: relative; aspect-ratio: 200 / 362; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fig img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fig figcaption { position: absolute; left: 0; right: 0; bottom: 0; font-size: .6rem; font-weight: 600; text-align: center; background: rgba(29, 29, 31, .75); color: #fff; padding: 2px 0; z-index: 2; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.specs div { background: var(--tile); border-radius: 12px; padding: 10px 14px; }
.specs .wide { grid-column: 1 / -1; }
.specs dt { font-size: .72rem; font-weight: 600; color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.grip { display: flex; flex-direction: column; gap: 8px; background: var(--tile); border-radius: var(--r-md); padding: 14px 16px; min-width: 0; }
.grip .tablewrap { background: var(--surface); border-radius: 10px; padding: 0 4px; }
.gt { min-width: 0; width: 100%; }
.gt th, .gt td { font-size: .9rem; }
.gt td:first-child { width: 42%; font-weight: 600; }
.feel { font-size: .93rem; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-size: .97rem; }
.galti { font-size: .93rem; color: var(--muted); }
.galti strong { color: var(--fg); }
.log { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.chk { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.chk input { width: 22px; height: 22px; accent-color: var(--accent); }
.wl { display: flex; gap: 8px; align-items: center; font-size: .93rem; color: var(--muted); }
.wt { width: 88px; font: inherit; color: var(--fg); background: var(--tile); border: 1px solid transparent; border-radius: 10px; padding: 7px 10px; }

/* diet */
.menus { display: flex; flex-direction: column; gap: 8px; }
.dd { background: var(--tile); border-radius: var(--r-md); overflow: hidden; }
.dd summary { cursor: pointer; padding: 14px 18px; display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 1.05rem; }
.dd .tot { font-size: .85rem; color: var(--accent); font-weight: 600; align-self: center; }
.dd .tablewrap { background: var(--surface); margin: 0 6px 6px; border-radius: 10px; }
.mt { min-width: 340px; }
.mt .tm { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.mt .pr { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }

/* weekday view */
.phasebtns, .filters { display: flex; flex-wrap: wrap; gap: 6px; }
.phasebtns button, .filters button { font-size: .92rem; font-weight: 500; color: var(--fg); background: var(--tile); border: 0; padding: 8px 16px; border-radius: 980px; cursor: pointer; }
.phasebtns button.on, .filters button.on { background: var(--fg); color: var(--bg); }
.js .weekset { display: none; }
.js .weekset.on { display: block; }
.weekgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.wd { text-align: left; font: inherit; color: var(--fg); background: var(--tile); border: 0; border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wd.work { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.wd.work:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.wd.off { color: var(--muted); }
.wdn { font-size: .75rem; font-weight: 600; color: var(--accent); }
.wd strong { font-size: 1.1rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--fg); }
.wd.off strong { color: var(--muted); }
.wd .go { font-size: .85rem; color: var(--muted); }
.wd.work .go { color: var(--accent); font-weight: 600; }
.wd .figs { gap: 4px; }
.daycard { text-align: left; font: inherit; color: var(--fg); background: var(--tile); border: 0; border-radius: var(--r-md); padding: 14px; cursor: pointer; }

/* optional exercises */
.optsec { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.opth { font-size: 1.75rem; }
.opth span { color: var(--muted); font-weight: 500; font-size: 1.2rem; }
.optlist { display: flex; flex-direction: column; gap: 10px; }
.opt { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; min-width: 0; }
.opt[hidden] { display: none; }
.opt summary { display: flex; gap: 14px; align-items: center; padding: 10px 18px 10px 10px; cursor: pointer; list-style: none; }
.opt summary::-webkit-details-marker { display: none; }
.opt summary img { width: 76px; height: 57px; object-fit: contain; background: #fff; border-radius: 10px; flex: none; }
.on2 { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.on2 strong { font-size: 1.02rem; font-weight: 600; line-height: 1.2; }
.on2 small { color: var(--muted); font-size: .82rem; }
.eqp { flex: none; font-size: .72rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 3px 10px; border-radius: 980px; }
.opt summary::after { content: "+"; font-size: 1.5rem; font-weight: 300; color: var(--muted); flex: none; width: 20px; text-align: center; }
.opt[open] summary::after { content: "–"; }
.opt[open] > summary { border-bottom: 1px solid var(--line); }
.opt .ex { border-radius: 0; }

@media (max-width: 700px) {
  body { font-size: 16px; padding-block: 20px 56px; }
  .panel { padding: 20px; border-radius: 20px; }
  .ex { grid-template-columns: minmax(0, 1fr); }
  .pics { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .body { padding: 18px; }
  .musblock { flex-direction: column; }
  .ml { min-width: 100%; }
  .dayhead { flex-wrap: wrap; padding: 18px; }
  .dayhead .figs { margin-left: 0; }
  .eqp { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .wd.work { transition: none; } }

/* ================= v2: friendlier UX ================= */
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }

/* today card */
.today { background: linear-gradient(135deg, #0058b0, #0071e3); color: #fff; border-radius: var(--r-lg); padding: 26px 28px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.today[hidden] { display: none; }
.today .eyebrow { color: rgba(255, 255, 255, .8); }
.today h2 { font-size: 2rem; }
.today p { color: rgba(255, 255, 255, .92); max-width: 46ch; }
.cta { margin-top: 6px; font-size: 1rem; font-weight: 600; color: var(--accent); background: #fff; border: 0; padding: 12px 22px; border-radius: 980px; cursor: pointer; min-height: 44px; }

/* accordion panels */
.panel.acc { padding: 0; gap: 0; }
.panel.acc > summary { list-style: none; cursor: pointer; padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.panel.acc > summary::-webkit-details-marker { display: none; }
.panel.acc > summary h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.panel.acc > summary::after { content: ""; flex: none; 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; }
.panel.acc[open] > summary::after { transform: rotate(-135deg); }
.accbody { padding: 0 28px 26px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* day list + progress */
.proghead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ptxt { font-size: .9rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--tile); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent-bg); border-radius: 99px; transition: width .3s; }
.jump { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.jump li + li { border-top: 1px solid var(--line); }
.jump a { display: flex; align-items: center; gap: 14px; padding: 12px 2px; min-height: 56px; color: var(--fg); text-decoration: none; }
.jn { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--tile); display: grid; place-items: center; font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.jt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.jt strong { font-weight: 600; font-size: 1rem; line-height: 1.25; }
.jt small { color: var(--muted); font-size: .84rem; }
.jc { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.jump .done .jc { background: #34c759; border-color: #34c759; }
.jump .done .jc::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.jump .done .jn { background: rgba(52, 199, 89, .15); color: var(--done-fg); }

/* exercise card v2 */
.exh h3 { display: flex; align-items: baseline; flex-wrap: wrap; }
.exsub { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.ex.complete { box-shadow: inset 0 0 0 2px #34c759; }
.log { display: flex; flex-direction: column; gap: 10px; border-top: 0; padding-top: 0; align-items: stretch; }
.setrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ml2 { font-size: .8rem; font-weight: 600; color: var(--muted); margin-right: 2px; }
.setb { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: var(--fg); font-size: 1.05rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.setb:active { transform: scale(.94); }
.setb.on { background: #34c759; border-color: #34c759; color: #fff; }
.timerb { margin-left: auto; min-height: 44px; padding: 0 16px; font-size: .92rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 980px; cursor: pointer; }
.wl { font-size: .93rem; }
.wt { min-height: 40px; }
details.sec { border-top: 1px solid var(--line); padding-top: 4px; }
details.sec > summary { list-style: none; cursor: pointer; padding: 12px 0; min-height: 48px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 1rem; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
details.sec[open] > summary::after { transform: rotate(-135deg); }
details.sec[open] { padding-bottom: 6px; }
details.sec > p, details.sec > .tablewrap, details.sec > .steps, details.sec > .musblock { margin-bottom: 10px; }
.pics figure { cursor: zoom-in; }

/* meals */
.meals { list-style: none; margin: 0; padding: 4px 18px 12px; display: flex; flex-direction: column; }
.meals li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.meals li:first-child { border-top: 0; }
.meals .tm { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; padding-top: 2px; }
.meals p { color: var(--fg); font-size: .95rem; margin-top: 2px; }
.meals .pr { font-weight: 600; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--accent); white-space: nowrap; padding-top: 2px; }

/* weekday: today marker */
.wd.today { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); }
.wd.today .wdn::after { content: " · aaj"; }

/* bottom nav + timer + lightbox */
.bnav { display: none; }
.rt { position: fixed; z-index: 40; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 10px; background: var(--pill-bg); color: #fff; padding: 8px 8px 8px 18px; border-radius: 980px; box-shadow: 0 8px 28px rgba(0, 0, 0, .25); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.rt[hidden] { display: none; }
.rt.done { background: #34c759; }
.rtl { font-size: .8rem; opacity: .75; }
.rtt { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.2ch; }
.rt button { min-width: 44px; min-height: 44px; border-radius: 980px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: .9rem; font-weight: 600; cursor: pointer; }
.lb { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .88); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lb[hidden] { display: none; }
.lb img { max-width: 100%; max-height: 88vh; border-radius: 12px; background: #fff; }
.lb button { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .2); color: #fff; font-size: 1.1rem; cursor: pointer; }

@media (max-width: 700px) {
  .tabs { display: none; }
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  body::before { display: none; }
  h1 { font-size: 2.2rem; }
  .hero { padding-top: 0; }
  .today { padding: 22px 20px; }
  .today h2 { font-size: 1.7rem; }
  .panel.acc > summary { padding: 16px 20px; }
  .accbody { padding: 0 20px 22px; }
  .dayhead { gap: 14px; }
  .dayhead .figs { display: none; }
  .meals li { grid-template-columns: 44px 1fr auto; gap: 10px; }
  .timerb { margin-left: 0; }
  .bnav { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    background: var(--nav-glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); }
  .bnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: none; color: var(--muted); font-size: .66rem; font-weight: 500; cursor: pointer; border-radius: 12px; }
  .bnav button b { width: 24px; height: 24px; border-radius: 50%; border: 1.8px solid currentColor; display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
  .bnav button.on { color: var(--accent); }
  .rt { right: 12px; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; }
  .rtt { flex: 1; text-align: center; }
}

/* ================= v3: dark theme, theme switch, video link, back-to-top ================= */

/* theme switch */
.theme { align-self: flex-end; display: inline-flex; gap: 2px; padding: 3px; background: var(--chip); border-radius: 980px; }
.theme button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 980px; background: transparent; color: var(--muted); font-size: .85rem; font-weight: 600; cursor: pointer; }
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }

/* form video link */
.vid { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; min-height: 40px; padding: 0 16px; border-radius: 980px; background: var(--accent-soft); color: var(--accent); font-size: .92rem; font-weight: 600; text-decoration: none; }
.vid:hover { text-decoration: none; filter: brightness(.95); }
.exh { display: flex; flex-direction: column; }

/* back to top */
.totop { position: fixed; z-index: 35; right: 20px; bottom: 24px; width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--glass); color: var(--fg); box-shadow: 0 4px 16px rgba(0, 0, 0, .18), inset 0 0 0 1px var(--line); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); cursor: pointer; }
.totop[hidden] { display: none; }
.totop:active { transform: scale(.94); }
.rt:not([hidden]) ~ .totop { bottom: 92px; }
@media (max-width: 700px) {
  .theme { margin-bottom: -4px; }
  .totop { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .rt:not([hidden]) ~ .totop { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }
}

/* start date + phase */
.startrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--tile); border-radius: var(--r-md); padding: 12px 14px; }
.startrow label { font-weight: 600; font-size: .95rem; }
.startrow input { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 40px; }
.weekinfo { flex-basis: 100%; color: var(--muted); font-size: .9rem; }


/* ================= v4: Track tab, history, warm-up player ================= */
body.noscroll { overflow: hidden; }
.muted2 { color: var(--muted); font-size: .93rem; }

/* shared buttons */
.btnp, .btns, .btnd { min-height: 44px; padding: 0 20px; border: 0; border-radius: 980px; font-size: .95rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btnp { background: var(--accent-bg); color: #fff; }
.btns { background: var(--accent-soft); color: var(--accent); }
.btnd { background: rgba(255, 59, 48, .12); color: #d70015; }
.linkb { background: none; border: 0; color: var(--accent); font-size: .9rem; font-weight: 600; cursor: pointer; padding: 8px 4px; min-height: 40px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.bkrow { display: flex; flex-wrap: wrap; gap: 10px; }

/* habits */
.habhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.habdate { display: flex; align-items: center; gap: 8px; }
.streakrow { font-size: 1rem; }
.streakrow strong { font-size: 1.6rem; letter-spacing: -.02em; color: var(--accent); }
.streakrow span { color: var(--muted); font-size: .85rem; }
.habs { display: flex; flex-direction: column; gap: 8px; }
.hab { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--tile); border-radius: var(--r-md); padding: 12px 14px; }
.hab.col { flex-direction: column; align-items: stretch; }
.hab.hit { box-shadow: inset 0 0 0 2px #34c759; }
.hl { display: flex; flex-direction: column; min-width: 0; }
.hl small { color: var(--muted); font-size: .82rem; }
.hab input[type="number"] { width: 96px; min-height: 44px; font: inherit; text-align: center; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); color: var(--fg); font-size: 1.4rem; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.stepper span { min-width: 2.4ch; text-align: center; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchips button { min-height: 40px; padding: 0 12px; border-radius: 980px; border: 0; background: var(--surface); color: var(--fg); font-size: .85rem; font-weight: 600; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.padd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.padd input { width: 120px !important; }
.padd button:not(.linkb) { min-height: 44px; padding: 0 18px; border: 0; border-radius: 980px; background: var(--accent-bg); color: #fff; font-weight: 600; cursor: pointer; }
.pill { padding: 6px 14px; border-radius: 980px; background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.pill.ok { background: rgba(52, 199, 89, .16); color: var(--done-fg); box-shadow: none; }

/* calendar */
.calwrap { display: flex; flex-direction: column; gap: 8px; }
.calhead, .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calhead span { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); }
.cd { position: relative; aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 10px; background: var(--tile); color: var(--fg); font-size: .85rem; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.cd.l1 { background: rgba(52, 199, 89, .2); }
.cd.l2 { background: rgba(52, 199, 89, .4); }
.cd.l3 { background: rgba(52, 199, 89, .65); }
.cd.l4 { background: #34c759; color: #fff; }
.cd.tr::after { content: ""; position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-bg); }
.cd.sel { box-shadow: 0 0 0 2px var(--fg); }
.cd.fut { opacity: .35; cursor: default; }
.cd.key { display: inline-block; width: 16px; height: 16px; min-height: 0; aspect-ratio: auto; vertical-align: middle; border-radius: 4px; cursor: default; }
.legend2 { font-size: .8rem; color: var(--muted); }

/* weight log */
.lgform { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; align-items: end; }
.lgform label, .cgrid label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.lgform input, .cgrid input, .cgrid select { min-height: 44px; font: inherit; font-size: 1rem; color: var(--fg); background: var(--tile); border: 1px solid transparent; border-radius: 10px; padding: 0 12px; width: 100%; }
.cgrid select { padding-right: 8px; }
.strow { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.st { background: var(--tile); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.st span { font-size: .72rem; font-weight: 600; color: var(--muted); }
.st strong { font-size: 1.25rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.st.hl { background: var(--accent-soft); }
.st.hl strong { color: var(--accent); }
.smsg { background: var(--note-bg); border-radius: var(--r-md); padding: 12px 14px; font-size: .93rem; }
.smsg.warn { background: rgba(255, 149, 0, .16); }
.chartbox { background: var(--tile); border-radius: var(--r-md); padding: 10px; min-height: 80px; }
.chartbox svg { width: 100%; height: auto; display: block; }
.gl { stroke: var(--line); stroke-width: 1; }
.gt { fill: var(--muted); font-size: 11px; }
.ga { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.gd { fill: var(--muted); opacity: .55; }
.dot2 { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .55; }
.line2 { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--accent-bg); vertical-align: middle; }
.empty { color: var(--muted); font-size: .93rem; padding: 6px 2px; }
.lglist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lglist li { display: grid; grid-template-columns: 1fr 1fr 1fr 44px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; font-size: .95rem; }
.lglist li.empty { display: block; border-top: 0; }
.lglist .ld { color: var(--muted); }
.lglist .lv { font-weight: 600; }
.ldel { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1rem; cursor: pointer; }

/* calculator */
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cgrid .wide { grid-column: 1 / -1; }
.cout { display: flex; flex-direction: column; }

/* exercise: weight + reps + history */
.wrow { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.rp { width: 88px; font: inherit; color: var(--fg); background: var(--tile); border: 1px solid transparent; border-radius: 10px; padding: 7px 10px; min-height: 40px; }
.hist { font-size: .85rem; color: var(--muted); }
.hist:empty { display: none; }
.hist .pr { color: #1a7f37; background: rgba(52, 199, 89, .16); padding: 1px 8px; border-radius: 980px; font-weight: 700; }

/* warm-up */
.ctarow { display: flex; flex-wrap: wrap; gap: 8px; }
.cta.ghost { background: rgba(255, 255, 255, .22); color: #fff; }
.wuact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wulist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.wulist li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.wulist li:first-child { border-top: 0; }
.wulist img { width: 64px; height: 48px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.wulist span { display: flex; flex-direction: column; min-width: 0; }
.wulist small { color: var(--muted); font-size: .82rem; }
.wu { position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow-y: auto; display: flex; justify-content: center; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.wu[hidden] { display: none; }
.wuin { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 12px; }
.wuhead { display: flex; align-items: center; gap: 10px; }
.wuhead strong { font-size: 1.05rem; }
.wuhead span { color: var(--muted); font-variant-numeric: tabular-nums; flex: 1; }
.wuhead button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--chip); color: var(--fg); font-size: 1.1rem; cursor: pointer; }
.wuimg { background: #fff; border-radius: var(--r-lg); overflow: hidden; }
.wuimg img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.wuin h3 { font-size: 1.6rem; }
.wutime { font-size: 4rem; font-weight: 700; letter-spacing: -.03em; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; padding: 6px 0; }
.wubtns { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; }
.wubtns button { min-height: 52px; border: 0; border-radius: 980px; background: var(--chip); color: var(--fg); font-size: 1rem; font-weight: 600; cursor: pointer; }
.wubtns .btnp { background: var(--accent-bg); color: #fff; }
.wunext { color: var(--muted); text-align: center; font-size: .9rem; }

@media (max-width: 700px) {
  .bnav { grid-template-columns: repeat(7, 1fr); }
  .bnav button { font-size: .6rem; }
  .cgrid { grid-template-columns: 1fr 1fr; }
  .hab { padding: 12px; }
  .lgform { grid-template-columns: 1fr 1fr; }
  .lgform label:first-child, .lgform .btnp { grid-column: 1 / -1; }
}

/* ================= v5: workout mode, compact headers, schedule extras, account, volume ================= */
.hero h1 { text-wrap: balance; }
html[data-cap="2"] .setb[data-n="3"], html[data-cap="2"] .setb[data-n="4"], html[data-cap="2"] .wmset[data-wm-set="3"], html[data-cap="2"] .wmset[data-wm-set="4"] { display: none; }

/* header shrinks on every tab except Home */
body:not([data-tab="overview"]) .hero { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding-top: 0; }
body:not([data-tab="overview"]) .hero .eyebrow { display: none; }
body:not([data-tab="overview"]) .hero h1 { order: -1; font-size: 0; line-height: 1; }
body:not([data-tab="overview"]) .hero h1::before { content: "Gym Plan"; font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
body:not([data-tab="overview"]) .hero .theme { align-self: center; margin: 0; }

/* theme: three states */
.theme button { padding: 0 12px; }

/* today card extras */
.today .ctarow { margin-top: 4px; }
.deload { background: rgba(255, 255, 255, .18); border-radius: 12px; padding: 10px 12px; font-size: .93rem; max-width: 52ch; }
.missrow { display: flex; flex-wrap: wrap; gap: 0 16px; }
.linkb.light { color: #fff; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; }
.tip { font-size: .85rem; max-width: 52ch; }
.wmbtn { align-self: flex-start; min-height: 48px; }

/* diet menu: kcal under protein */
.meals .pr small { display: block; font-weight: 500; color: var(--muted); }
.meals li { grid-template-columns: 52px 1fr auto; }

/* weekly volume */
.vol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.vol li { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; }
.vol .vn { font-size: .93rem; font-weight: 600; }
.vol .vv { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.5ch; text-align: right; }
.vol li.empty { display: block; }

/* account */
.seg { display: inline-flex; align-self: flex-start; background: var(--chip); border-radius: 980px; padding: 3px; gap: 2px; }
.seg button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 980px; background: transparent; color: var(--muted); font-size: .93rem; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.lgform .wide, .aform .wide { grid-column: 1 / -1; }
.aform { grid-template-columns: 1fr; }
#a-in .bkrow + .bkrow { margin-top: -4px; }
#a-msg.bad { color: #d70015; }
#a-msg:empty { display: none; }
code { background: var(--tile); border-radius: 6px; padding: 1px 6px; font-size: .9em; }

/* toast */
.toast { position: fixed; z-index: 80; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 16px; background: var(--pill-bg); color: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.toast[hidden] { display: none; }
.toast span { flex: 1; font-size: .93rem; }
.toast button { min-height: 40px; min-width: 40px; border: 0; border-radius: 980px; background: rgba(255, 255, 255, .2); color: #fff; font-weight: 600; padding: 0 14px; cursor: pointer; }

/* rest timer sits above overlays */
.rt { z-index: 65; }
body.noscroll .rt { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.wu { z-index: 70; }

/* workout mode */
.wm { position: fixed; inset: 0; z-index: 55; background: var(--bg); overflow-y: auto; display: flex; justify-content: center; padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); }
.wm[hidden] { display: none; }
.wmin { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.wmhead { display: flex; align-items: center; gap: 10px; }
.wmx { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--chip); color: var(--fg); font-size: 1.1rem; cursor: pointer; flex: none; }
.wmt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wmt strong { font-size: 1rem; }
.wmt span { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.wmwake { font-size: .75rem; font-weight: 600; color: var(--done-fg); }
.wmbody { display: flex; flex-direction: column; gap: 12px; flex: 1; padding-bottom: 8px; }
.wmpics { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: #fff; border-radius: var(--r-lg); overflow: hidden; }
.wmpics img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.wmname { font-size: 1.6rem; }
.wmsub { color: var(--muted); margin-top: -6px; }
.wmspecs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wmspecs span { background: var(--tile); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.wmspecs small { font-size: .72rem; font-weight: 600; color: var(--muted); }
.wmspecs b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.wmstart { color: var(--muted); font-size: .93rem; margin-top: -4px; }
.wmsets { display: flex; flex-wrap: wrap; gap: 10px; }
.wmset { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: var(--fg); font-size: 1.4rem; font-weight: 700; cursor: pointer; transition: transform .1s; }
.wmset:active { transform: scale(.94); }
.wmset.on { background: #34c759; border-color: #34c759; color: #fff; }
.wmfields { display: grid; gap: 10px; }
.wmf { display: flex; align-items: center; gap: 8px; background: var(--tile); border-radius: 14px; padding: 8px 10px; }
.wmf span { flex: 1; font-weight: 600; font-size: .92rem; }
.wmf button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface); color: var(--fg); font-size: 1.5rem; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.wmf input { width: 88px; height: 48px; text-align: center; font: inherit; font-size: 1.25rem; font-weight: 700; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.wup { font-size: .85rem; color: var(--muted); }
.wup:empty { display: none; }
.wmguide { display: flex; flex-direction: column; }
.wmdone { padding: 24px 0; display: flex; flex-direction: column; gap: 12px; }
.wmnav { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to bottom, transparent, var(--bg) 28%); }
.wmnav button { min-height: 56px; border: 0; border-radius: 980px; font-size: 1.05rem; font-weight: 600; background: var(--chip); color: var(--fg); cursor: pointer; }
.wmnav .btnp { background: var(--accent-bg); color: #fff; }
.wmnav button:disabled { opacity: .4; cursor: default; }

@media (max-width: 700px) {
  .vol li { grid-template-columns: 104px 1fr auto; }
}

/* ================= v6: login page, PIN, account ================= */
.loginwrap { max-width: 440px; margin: 6vh auto 0; gap: 18px; }
.loginhead { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.loginhead h1 { font-size: 2rem; }
.loginhead .dk { width: 64px; height: 64px; font-size: 2.2rem; border-radius: 18px; }
.loginpage body, body.loginpage { padding-bottom: 40px; }
#l-msg.bad { color: #d70015; }
#l-msg:empty { display: none; }
.h3s { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.pinbox { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }

/* ================= v7: dashboard, login polish ================= */
.logintheme { align-self: center; }
.loginwrap { align-items: stretch; }
.loginpanel { gap: 16px; }
.loginpanel .seg { align-self: center; }
.loginhead h1 { font-size: 2.2rem; }

/* dashboard */
.dwelcome { gap: 4px; }
.dwelcome h2 { font-size: 1.9rem; }
.dstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dtile { text-align: left; font: inherit; color: var(--fg); background: var(--surface); border: 0; border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; }
.dtile:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.dtile .dk1 { font-size: .74rem; font-weight: 600; color: var(--muted); }
.dtile strong { font-size: 1.6rem; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dtile small { color: var(--muted); font-size: .8rem; }
.dweek { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dday { background: var(--tile); border-radius: 12px; padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.dday span { font-size: .7rem; font-weight: 600; color: var(--muted); }
.dday b { font-size: 1.15rem; line-height: 1.2; }
.dday small { font-size: .62rem; color: var(--muted); text-align: center; line-height: 1.1; }
.dday.now { box-shadow: inset 0 0 0 2px var(--accent); }
.dday.ok { background: rgba(52, 199, 89, .18); }
.dday.ok b { color: var(--done-fg); }
.dday.miss b { color: var(--muted); }
.spark { width: 100%; height: auto; display: block; margin: 8px 0; }
.gd2 { fill: var(--accent); }
.dprof { margin: 0; display: flex; flex-direction: column; }
.dprof div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.dprof div:first-child { border-top: 0; }
.dprof dt { color: var(--muted); font-size: .88rem; }
.dprof dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .dstats { grid-template-columns: 1fr 1fr; }
  .dprof div { grid-template-columns: 96px 1fr; }
  .dday b { font-size: 1rem; }
}

/* ================= v8: system check ================= */
.scsum { font-weight: 700; }
.scsum.ok { color: var(--done-fg); }
.scsum.bad { color: #d70015; }
:root[data-theme="dark"] .scsum.bad { color: #ff6961; }
.sclist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sclist li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.sclist li:first-child { border-top: 0; }
.sclist b { font-size: 1.05rem; }
.sclist li.ok b { color: var(--done-fg); }
.sclist li.bad b { color: #d70015; }
.sclist span { display: flex; flex-direction: column; min-width: 0; }
.sclist small { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --fg: #f5f5f7;
  --muted: #98989d;
  --line: rgba(255, 255, 255, .14);
  --accent: #64b5ff;
  --accent-bg: #0071e3;
  --tile: #2c2c2e;
  --note-bg: rgba(10, 132, 255, .2);
  --glass: rgba(0, 0, 0, .78);
  --nav-glass: rgba(28, 28, 30, .88);
  --chip: rgba(255, 255, 255, .1);
  --chip-hover: rgba(255, 255, 255, .16);
  --accent-soft: rgba(10, 132, 255, .22);
  --orange-bg: rgba(255, 159, 10, .2);
  --orange-fg: #ffb340;
  --done-fg: #30d158;
  --pill-bg: rgba(72, 72, 74, .96);
}
:root[data-theme="dark"] a:focus-visible, :root[data-theme="dark"] button:focus-visible { outline-color: rgba(100, 181, 255, .8); }
:root[data-theme="dark"] .wd.work:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .setb.on { color: #fff; }
:root[data-theme="dark"] .pics figure, :root[data-theme="dark"] .fig { border-color: rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .cta { background: #fff; color: #0058b0; }
:root[data-theme="dark"] .wt, :root[data-theme="dark"] .rp { color: var(--fg); }
:root[data-theme="dark"] .btnd { color: #ff6961; }
:root[data-theme="dark"] .hist .pr { color: #30d158; }
:root[data-theme="dark"] .smsg.warn { background: rgba(255, 159, 10, .2); }

@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --fg: #f5f5f7;
  --muted: #98989d;
  --line: rgba(255, 255, 255, .14);
  --accent: #64b5ff;
  --accent-bg: #0071e3;
  --tile: #2c2c2e;
  --note-bg: rgba(10, 132, 255, .2);
  --glass: rgba(0, 0, 0, .78);
  --nav-glass: rgba(28, 28, 30, .88);
  --chip: rgba(255, 255, 255, .1);
  --chip-hover: rgba(255, 255, 255, .16);
  --accent-soft: rgba(10, 132, 255, .22);
  --orange-bg: rgba(255, 159, 10, .2);
  --orange-fg: #ffb340;
  --done-fg: #30d158;
  --pill-bg: rgba(72, 72, 74, .96);
}
:root:not([data-theme="light"]) a:focus-visible, :root:not([data-theme="light"]) button:focus-visible { outline-color: rgba(100, 181, 255, .8); }
:root:not([data-theme="light"]) .wd.work:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
:root:not([data-theme="light"]) .setb.on { color: #fff; }
:root:not([data-theme="light"]) .pics figure, :root:not([data-theme="light"]) .fig { border-color: rgba(255, 255, 255, .08); }
:root:not([data-theme="light"]) .cta { background: #fff; color: #0058b0; }
:root:not([data-theme="light"]) .wt, :root:not([data-theme="light"]) .rp { color: var(--fg); }
:root:not([data-theme="light"]) .btnd { color: #ff6961; }
:root:not([data-theme="light"]) .hist .pr { color: #30d158; }
:root:not([data-theme="light"]) .smsg.warn { background: rgba(255, 159, 10, .2); }

}
