/* Layout: chalk-grey gym board — dense, tabular, plate-coloured workouts on neutral ground */
:root {
  --bg: #F1F2EF; --surface: #FFFFFF; --sunk: #E8EAE6; --ink: #15181B; --ink2: #3F464C; --muted: #697279; --line: #D7DAD5;
  --accent: #C93A28; --on-accent: #FFFFFF;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  --st0: #CDD1CC; --st1: #A3ABB0; --st2: #5C666D; --st3: #1C2226; --st-ink0: #15181B; --st-ink3: #FFFFFF;
  --good: #1D7C43; --warn: #A86300; --bad: #BF3328;
  --f-display: "Fira Sans Extra Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #111315; --surface: #1A1D20; --sunk: #22262A; --ink: #E9EBE8; --ink2: #C3C8CB; --muted: #8F979D; --line: #2F3438;
  --accent: #F0644F; --on-accent: #15181B;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0f9a0f;
  --st0: #343A3F; --st1: #56606A; --st2: #8C979F; --st3: #E4E8EA; --st-ink0: #E9EBE8; --st-ink3: #15181B;
  --good: #52C47F; --warn: #E3A43A; --bad: #F2695C; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #111315; --surface: #1A1D20; --sunk: #22262A; --ink: #E9EBE8; --ink2: #C3C8CB; --muted: #8F979D; --line: #2F3438;
  --accent: #F0644F; --on-accent: #15181B;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0f9a0f;
  --st0: #343A3F; --st1: #56606A; --st2: #8C979F; --st3: #E4E8EA; --st-ink0: #E9EBE8; --st-ink3: #15181B;
  --good: #52C47F; --warn: #E3A43A; --bad: #F2695C; color-scheme: dark; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding-block: 24px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: .01em; margin: 0; text-wrap: balance; line-height: 1.05; }
h1 { font-size: clamp(34px, 6vw, 54px); text-transform: uppercase; }
h2 { font-size: 26px; text-transform: uppercase; }
h3 { font-size: 19px; }
.eyebrow { font: 600 12px/1.2 var(--f-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
input[type=date], input[type=number], input[type=text], select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; min-height: 40px; }
textarea { width: 100%; resize: vertical; line-height: 1.5; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 8px 14px; min-height: 40px; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 14px; min-height: 40px; font-weight: 500; }
.btn:hover { border-color: var(--ink2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { background: none; }
.btn:disabled { opacity: .5; cursor: default; }
.wk { --c: var(--muted); }
.wk[data-wk=PC] { --c: var(--s1); } .wk[data-wk=PA] { --c: var(--s2); } .wk[data-wk=L1] { --c: var(--s3); }
.wk[data-wk=PS] { --c: var(--s4); } .wk[data-wk=PB] { --c: var(--s5); } .wk[data-wk=L2] { --c: var(--s6); }
.tagchip { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--f-body); }
.tagchip::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; font: 600 11px/1 var(--f-body); letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.pill.good { color: var(--good); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); } .pill.mute { color: var(--muted); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.rx { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rx th { text-align: left; font: 600 11px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.rx td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rx tr:last-child td { border-bottom: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===== app ===== */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 14px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.top h1 { font-size: clamp(30px, 5vw, 44px); }
nav.tabs { display: flex; gap: 2px; background: var(--sunk); padding: 3px; border-radius: 8px; max-width: 100%; overflow-x: auto; }
nav.tabs a { text-decoration: none; color: var(--ink2); padding: 8px 12px; border-radius: 6px; font-weight: 500; min-height: 40px; display: inline-flex; align-items: center; white-space: nowrap; }
nav.tabs a[aria-current=page] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.banner { margin-top: 14px; padding: 10px 14px; border-radius: var(--r); background: var(--sunk); font-size: 14px; }
.banner.warn { color: var(--warn); }
.view { margin-top: 22px; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.status { font-size: 13px; color: var(--muted); min-height: 1.4em; }
.status.err { color: var(--bad); } .status.ok { color: var(--good); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.sticky-foot { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  position: sticky; bottom: max(8px, env(safe-area-inset-bottom, 0px)); box-shadow: 0 6px 24px rgb(0 0 0 / .08); z-index: 5; }

@media (max-width: 560px) { .sticky-foot { padding: 10px; gap: 8px; } .sticky-foot > .btn { flex: 1 1 auto; } }
body.ro .ownonly { display: none !important; }
/* ---------- log */
.ctx { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.ctx .info { flex: 1 1 260px; min-width: 0; padding: 8px 0; font-size: 14px; color: var(--ink2); }
.ctx .info b { font-family: var(--f-display); font-size: 21px; text-transform: uppercase; color: var(--ink); display: block; line-height: 1.1; }
.voice { margin-top: 18px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 10px; }
.voice .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.voice .hint { font-size: 13px; color: var(--muted); margin: 0; }
.exlist { margin-top: 18px; display: grid; gap: 12px; }
.ex { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 8px; }
.ex .h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.ex .h b { font-size: 15.5px; }
.ex .ord { font: 600 12px/1 var(--f-mono); color: var(--muted); margin-right: 8px; }
.ex .rxl { font: 500 13px/1.3 var(--f-mono); color: var(--ink2); }
.ex .drop { color: var(--accent); font-size: 12px; font-weight: 600; }
.ex .hist { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.ex .hist .goal { color: var(--ink); }
.ex .hist .goal b { font-family: var(--f-mono); font-weight: 600; }
.sets { display: grid; gap: 6px; }
.set { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) auto 36px; gap: 6px; align-items: center; }
.set .i { font: 500 12px/1 var(--f-mono); color: var(--muted); }
.set input[type=number] { width: 100%; min-width: 0; text-align: center; font-family: var(--f-mono); padding: 8px 4px; }
.set label.dp { font-size: 11.5px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.set .x { border: 0; background: none; color: var(--muted); font-size: 18px; min-height: 36px; }
.set.head { font: 600 10.5px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.set.head span { text-align: center; }
.addset { justify-self: start; border: 1px dashed var(--line); background: none; border-radius: var(--r); padding: 6px 10px; font-size: 13px; color: var(--ink2); }
.ex .why { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.set.pre input[data-f=w] { color: var(--muted); font-style: italic; }
.set input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.ex-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.addset.asplan { border-style: solid; color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, var(--line)); }
.ex.done { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.ex.extra .h b::after { content: " · вне плана"; color: var(--muted); font-weight: 400; font-size: 13px; }
.sticky-foot .field.note { flex: 1 1 220px; }
.sticky-foot .field.note input { width: 100%; }
.sticky-foot .field.bw input { width: 100px; }

/* ---------- program editor */
.pwks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 6px; }
.pwk { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 10px; text-align: left; display: flex; justify-content: space-between; gap: 8px; align-items: center; border-top: 3px solid var(--c); min-width: 0; }
.pwk .tagchip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pwk .tagchip::before { display: none; }
.pwk .cnt { font: 500 12px/1 var(--f-mono); color: var(--muted); }
.pwk[aria-pressed=true] { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-color: var(--c); }
.pmeta { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 16px; }
.pmeta .field { flex: 1 1 260px; }
.pmeta .field input { width: 100%; }
.psum { font-size: 13px; color: var(--muted); flex: 2 1 300px; }
.psum b { color: var(--ink); font-family: var(--f-mono); font-weight: 600; }
.slots { margin-top: 14px; display: grid; gap: 8px; }
.slot { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
.slot.focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.slot .st { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.slot .ord { font: 600 14px/1.1 var(--f-mono); }
.slot .ord small { display: block; font: 500 10.5px/1.2 var(--f-body); color: var(--muted); }
.slot select { width: 100%; min-width: 0; }
.slot .acts { display: flex; gap: 4px; }
.slot .acts button { border: 1px solid var(--line); background: none; border-radius: var(--r); width: 36px; height: 36px; font-size: 15px; color: var(--ink2); }
.slot .acts button:disabled { opacity: .35; }
.slot .acts button.del:hover { color: var(--bad); border-color: var(--bad); }
.slot .sf { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding-left: 64px; font-size: 13px; }
.slot .sf label { display: inline-flex; gap: 6px; align-items: center; color: var(--ink2); }
.slot .sf input[type=number] { width: 58px; min-height: 34px; padding: 4px 6px; text-align: center; font-family: var(--f-mono); }
.slot .meta { font-size: 12px; color: var(--muted); padding-left: 64px; margin-top: -4px; }
@media (max-width: 560px) { .slot .sf, .slot .meta { padding-left: 0; } .slot .st { grid-template-columns: 44px minmax(0, 1fr); } .slot .acts { grid-column: 1 / -1; justify-content: flex-end; } }
.addslot { margin-top: 8px; }
.lib { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 860px) { .lib { grid-template-columns: 1fr; } }
.lib .panel form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.lib .panel form .field:first-child { flex: 1 1 100%; }
.lib .panel form .field:first-child input { width: 100%; }
.clist { display: grid; gap: 4px; }
.citem { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.citem:last-child { border-bottom: 0; }

/* ---------- plan / calendar */
.today { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; margin-bottom: 8px; }
.today b { font-family: var(--f-display); font-size: 20px; text-transform: uppercase; letter-spacing: .02em; }
.pctl { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 18px; }
.block { margin-top: 30px; }
.phases { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .phases { grid-template-columns: 1fr; } }
.phase .ph-h { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; gap: 8px; }
.phase .ph-h b { color: var(--ink); font-family: var(--f-display); font-size: 17px; text-transform: uppercase; }
.strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.wcell { border: 0; border-radius: 4px; padding: 8px 4px 7px; text-align: left; display: grid; gap: 3px; min-width: 0; background: var(--st1); color: var(--st-ink0); position: relative; }
.wcell[data-st=accum] { background: var(--st2); color: var(--bg); }
.wcell[data-st=intens] { background: var(--st3); color: var(--st-ink3); }
.wcell[data-st=deload] { background: repeating-linear-gradient(135deg, var(--st0) 0 4px, transparent 4px 8px), var(--sunk); color: var(--ink2); }
.wcell .n { font: 600 15px/1 var(--f-mono); }
.wcell .r { font: 500 10.5px/1.1 var(--f-mono); opacity: .9; white-space: nowrap; overflow: hidden; }
.wcell[aria-pressed=true] { outline: 2px solid var(--accent); outline-offset: 2px; }
.wcell .now { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.stlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.stlegend span { display: inline-flex; gap: 6px; align-items: center; }
.stlegend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
table.cal { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 720px; }
table.cal th { font: 600 11px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 2px 4px; }
table.cal td { padding: 0; }
.wkno { font: 600 13px/1 var(--f-mono); padding: 0 6px !important; white-space: nowrap; }
.wkno small { display: block; font: 500 10.5px/1.3 var(--f-body); color: var(--muted); }
.day { display: grid; gap: 2px; padding: 6px 7px 7px; border-radius: 4px; min-height: 50px; border-top: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.day.rest { border-top-color: transparent; background: transparent; outline: 1px dashed var(--line); outline-offset: -1px; }
.day .d { font: 500 11px/1 var(--f-mono); color: var(--muted); }
.day .t { font: 600 13px/1.15 var(--f-body); }
.day.rest .t { color: var(--muted); font-weight: 400; }
button.day { border-width: 3px 0 0; border-style: solid; border-color: var(--c); width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; align-content: start; }
button.day:hover { filter: brightness(.97); }
.day .f { font: 500 11px/1.2 var(--f-body); color: var(--good); }
.day .f.muted { color: var(--muted); }
.day.moved .d::after { content: " •"; color: var(--accent); font-weight: 700; }
.day.csel { box-shadow: inset 0 0 0 2px var(--ink); }
.day.dropt { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.day.dragging { opacity: .4; }
body.picking button.day:not(.csel) { cursor: copy; }
.editbar { display: grid; gap: 10px; }
.editbar .eb-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.editbar .eb-h b { font-family: var(--f-display); font-size: 20px; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-top: 3px solid var(--c); background: var(--surface); border-radius: var(--r); padding: 7px 10px; min-height: 38px; font: 500 13px/1.1 var(--f-body); }
.chip[aria-pressed=true] { background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-color: var(--c); font-weight: 600; }
.chip.restchip { --c: var(--muted); }
.eb-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.undo { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0 4px; font: inherit; }
.day.logged .t::after { content: " ✓"; color: var(--good); }
.day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
tr.week-row { cursor: pointer; }
tr.week-row.sel .wkno { color: var(--accent); }
tr.week-row.deload .day:not(.rest) { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, transparent) 0 5px, transparent 5px 10px), var(--surface); }
.vol { font: 500 12px/1.2 var(--f-mono); color: var(--muted); padding: 0 6px !important; white-space: nowrap; }
.wkleg { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; padding: 16px; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 14px 0 0; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.checks { margin: 14px 0 0; padding: 12px 14px; background: var(--sunk); border-radius: var(--r); font-size: 14px; display: grid; gap: 6px; }
.checks b { font: 600 11px/1.2 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.workouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-top: 16px; }
.wo { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.wo header { padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; border-top: 4px solid var(--c); }
.wo header h3 { font-size: 18px; }
.wo table.rx td:first-child { font: 500 12px/1.4 var(--f-mono); color: var(--muted); width: 28px; }
.wo .drop { color: var(--accent); font-weight: 600; font-size: 12px; }
.wo .p { font: 500 13px/1.4 var(--f-mono); white-space: nowrap; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.rule { padding: 16px; border-top: 2px solid var(--ink); background: var(--surface); }
.rule h3 { margin-bottom: 6px; }
.rule p { margin: 0; color: var(--ink2); font-size: 14px; }

/* ---------- shared bars */
.vbars { display: grid; gap: 7px; }
.vbar { display: grid; grid-template-columns: 118px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; }
.vbar .track { position: relative; height: 12px; background: var(--sunk); border-radius: 2px; }
.vbar .fill { position: absolute; inset: 0 auto 0 0; background: var(--ink2); border-radius: 0 4px 4px 0; }
.vbar.prio .fill { background: var(--accent); }
.vbar .plan { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px solid var(--ink); }
.vbar .ref { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1px dashed var(--muted); }
.vbar .num { text-align: right; font: 500 12px/1 var(--f-mono); color: var(--ink2); }
.vbar .num.under { color: var(--bad); }

/* ---------- history */
.hweek { margin-top: 18px; }
.hweek h3 { font-size: 17px; text-transform: uppercase; margin-bottom: 8px; display: flex; gap: 10px; align-items: baseline; }
.hrow { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; }
.hrow .d { font: 500 13px/1.2 var(--f-mono); color: var(--ink2); }
.hrow .m { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .hrow { grid-template-columns: 1fr auto; } .hrow .d { grid-column: 1 / -1; } }

/* ---------- dashboard */
.weeknav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.weeknav .lbl { font-family: var(--f-display); font-size: 26px; text-transform: uppercase; min-width: 7ch; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; margin-top: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 4px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font: 600 26px/1.1 var(--f-mono); font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi .s { font-size: 12.5px; color: var(--muted); }
.kpi .s.up { color: var(--good); } .kpi .s.down { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; min-width: 0; }
.panel h3 { font-size: 18px; text-transform: uppercase; margin-bottom: 4px; }
.panel .sub { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { fill: var(--muted); font: 11px var(--f-mono); }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .b { fill: var(--st1); }
svg.chart .b.sel { fill: var(--accent); }
svg.chart .ln { fill: none; stroke: var(--ink); stroke-width: 2; }
svg.chart .pt { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
svg.chart .pt.dl { fill: var(--surface); stroke: var(--ink); }
svg.chart .hit { fill: transparent; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); font: 500 12px/1.4 var(--f-mono); padding: 6px 8px; border-radius: 4px; z-index: 20; white-space: nowrap; }
.cull td.n { font: 500 13px/1.3 var(--f-mono); white-space: nowrap; }
.cull td.d.up { color: var(--good); } .cull td.d.down { color: var(--bad); }
.cull .swap { border: 0; background: none; color: var(--accent); font-size: 13px; text-decoration: underline; padding: 0; min-height: 0; }
.analysis { white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; max-width: 75ch; }
