:root {
  color-scheme: dark;
  --ground: #0b0d11; --surface: #12161c; --raised: #1a1f27; --border: #242a33;
  --text: #eef0f2; --muted: #8f98a5; --accent: #6fe0bd; --accent-2: #4ea8ff; --accent-ink: #04150e;
  --red: #ff6b6b; --yellow: #f5c451; --green: #52e08f;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 30px rgba(0,0,0,.28); --glow-a: rgba(111,224,189,.10); --glow-b: rgba(78,168,255,.09);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #f4f5f2; --surface: #ffffff; --raised: #eceee9; --border: #dcdfd8;
  --text: #14171a; --muted: #5d6670; --accent: #0a8a62; --accent-2: #2563eb; --accent-ink: #ffffff;
  --red: #d63b3b; --yellow: #b7791f; --green: #168a4a;
  --shadow: 0 1px 2px rgba(20,30,40,.05), 0 8px 24px rgba(20,30,40,.06); --glow-a: rgba(10,138,98,.09); --glow-b: rgba(37,99,235,.07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.mark { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), #3aa3ff); }
nav { display: flex; gap: 22px; } nav a { color: var(--muted); text-decoration: none; font-size: 14px; } nav a:hover { color: var(--text); }

.hero { padding: 72px 0 36px; max-width: 760px; }
.kicker { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 14px; }
h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 18px; font-weight: 700; }
.lead { color: var(--muted); font-size: 18px; margin: 0; max-width: 62ch; }

.lab { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; padding-bottom: 56px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.controls { display: grid; gap: 22px; position: sticky; top: 76px; }
.field { display: grid; gap: 8px; } .field small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.lab-t { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.seg { display: flex; padding: 3px; gap: 2px; background: var(--raised); border-radius: 12px; }
.seg.col { flex-direction: column; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 10px; border-radius: 9px; cursor: pointer; text-align: center; transition: background-color .15s, color .15s; }
.seg.col button { text-align: left; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.out { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.out > * { min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.kpi span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi b { display: block; font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi small { color: var(--muted); font-size: 12.5px; }

.chart-card { padding: 16px 18px 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chart-head h2 { font-size: 15px; margin: 0; font-weight: 600; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; } .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.var { background: var(--accent); } .dot.hit { background: var(--red); }
canvas { width: 100%; height: 280px; display: block; margin-top: 8px; }

#verdict { font-size: 16px; line-height: 1.6; }
#verdict b { font-weight: 650; }
.pass { color: var(--green); } .fail { color: var(--red); } .warn { color: var(--yellow); }

.table-card { padding: 6px 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; min-width: 640px; }
th, td { text-align: right; padding: 12px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; } tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; }
.chip.green { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.chip.yellow { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--yellow); }
.chip.red { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.notes { padding: 8px 0 72px; } .notes h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid3 article { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.grid3 h3 { margin: 0 0 8px; font-size: 16px; } .grid3 p { margin: 0; color: var(--muted); }
.grid3 b { color: var(--text); }
.fine { color: var(--muted); font-size: 13px; max-width: 80ch; margin: 22px 0 0; }
.foot { border-top: 1px solid var(--border); padding: 22px 0; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) { .lab { grid-template-columns: minmax(0, 1fr); } .controls { position: static; } .grid3 { grid-template-columns: minmax(0, 1fr); } .hero { padding-top: 44px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ---- screens: asset selection, data, results ---- */
nav a.on { color: var(--text); }
.hero.compact { padding: 44px 0 20px; max-width: 780px; } .hero.compact h1 { font-size: clamp(28px, 4vw, 42px); }
.grp { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 28px 0 12px; font-weight: 600; }
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.asset { display: grid; gap: 8px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, background-color .15s, transform .15s; }
.asset:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
.asset[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.a-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .a-top b { font-size: 15px; font-weight: 650; }
.tick { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); position: relative; }
.asset[aria-checked="true"] .tick { background: var(--accent); border-color: var(--accent); }
.asset[aria-checked="true"] .tick::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.spark { width: 100%; height: 40px; display: block; } .asset small { color: var(--muted); font-size: 12px; } .asset .src { opacity: .75; }
.weights { margin-top: 18px; display: grid; gap: 10px; } .weights h3 { margin: 0 0 4px; font-size: 15px; } .weights h3 small { color: var(--muted); font-weight: 400; }
.weights label { display: flex; justify-content: space-between; align-items: center; gap: 12px; } .weights input { width: 84px; }
input[type="number"], input[type="text"] { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
input[type="file"] { color: var(--muted); font: inherit; font-size: 13px; }
.step2 { margin-top: 40px; } .step2 h2 { margin: 0 0 16px; font-size: 24px; letter-spacing: -.02em; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.action { display: grid; gap: 8px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: 18px; padding: 20px; cursor: pointer; transition: border-color .15s, transform .15s; }
.action:not(:disabled):hover { border-color: var(--accent); transform: translateY(-2px); }
.action:disabled { opacity: .45; cursor: not-allowed; }
.action b { font-size: 18px; letter-spacing: -.01em; } .action span { color: var(--muted); font-size: 14px; } .action i { font-style: normal; color: var(--accent); font-weight: 650; margin-top: 4px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 14px 0 0; } .hint a { color: var(--accent); }
.runbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center; margin: 4px 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .chips small { color: var(--muted); font-size: 12.5px; }
.pill { background: var(--raised); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; } .tabs a { text-decoration: none; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); }
.tabs a:hover { color: var(--text); } .tabs a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.running { display: grid; place-items: center; gap: 14px; padding: 120px 0; color: var(--muted); text-align: center; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .grid2 > * { min-width: 0; }
.upload { display: grid; gap: 14px; grid-template-columns: 1fr 1fr auto; align-items: end; } .upload .hint { grid-column: 1 / -1; margin: 0; }
.primary { font: inherit; font-weight: 650; border: 0; border-radius: 12px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.link { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; } .link.danger { color: var(--red); }
.plain th, .plain td { text-align: left; } .plain { min-width: 0; } .cap { text-align: left; padding: 12px 12px 4px; font-weight: 650; font-size: 14px; caption-side: top; }
.empty { color: var(--muted); padding: 14px; margin: 0; } .mut { color: var(--muted); } .fine code { background: var(--raised); padding: 1px 6px; border-radius: 6px; }
.fine { color: var(--muted); font-size: 13px; max-width: 80ch; } .fail { color: var(--red); }
.field label.lab-t { display: block; }
.controls input[type="number"], .controls input[type="text"] { width: 100%; }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); } .upload { grid-template-columns: 1fr; } }

.dockbar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px); padding: 8px 10px 8px 16px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); box-shadow: 0 10px 40px rgba(0, 0, 0, .45); backdrop-filter: blur(10px); }
.dockbar span { color: var(--muted); font-size: 13px; font-weight: 600; margin-right: 4px; }
.dockbar button { font: inherit; font-size: 13.5px; font-weight: 650; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.dockbar button:hover { filter: brightness(1.08); }
.step2 { padding-bottom: 90px; }
textarea, select { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; width: 100%; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; resize: vertical; }
input[type="date"] { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; width: 100%; color-scheme: inherit; }
tfoot td { font-weight: 700; border-top: 1px solid var(--border); border-bottom: 0; }

.update { display: grid; gap: 12px; } .update .hint { margin: 0; }
.check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.update .primary { justify-self: start; } .update .primary:disabled { opacity: .45; cursor: not-allowed; }
pre#uplog { margin: 0; max-height: 260px; overflow: auto; background: var(--raised); border-radius: 12px; padding: 12px 14px; font: 12.5px/1.5 ui-monospace, Consolas, monospace; color: var(--muted); white-space: pre-wrap; }

/* "i" explanation buttons and their popover */
.info { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 6px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--muted); font: italic 700 10.5px/1 Georgia, serif; cursor: help; vertical-align: 1px; text-transform: none; letter-spacing: 0; }
.info:hover, .info:focus-visible { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.pop { position: fixed; z-index: 30; max-width: 340px; padding: 12px 14px; border-radius: 14px; background: var(--raised); border: 1px solid var(--border); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); display: grid; gap: 5px; pointer-events: none; }
.pop b { font-size: 13.5px; color: var(--text); } .pop span { font-size: 13px; line-height: 1.5; color: var(--muted); }
th .info { margin-left: 4px; }
.pricer { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 4px 0 18px; }
.pricer input[type="number"] { width: 100%; }

/* ---- start screen: one-viewport launcher ---- */
.launch { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 28px; align-items: start; padding: 44px 0 56px; max-width: 1080px; margin: 0 auto; }
.launch.solo { grid-template-columns: minmax(0, 600px); justify-content: center; padding-top: 11vh; text-align: center; }
.launch h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 0 0 10px; }
.launch .lead { font-size: 16px; margin: 0 0 26px; } .launch.solo .lead { margin-inline: auto; }
.combo { position: relative; text-align: left; }
.combo input { width: 100%; font: inherit; font-size: 16px; padding: 16px 46px 16px 18px; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; }
.combo input:focus { outline: none; border-color: var(--accent); }
.combo::after { content: ""; position: absolute; right: 20px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
#lb { position: absolute; z-index: 8; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; max-height: 340px; overflow: auto; background: var(--raised); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 48px rgba(0, 0, 0, .5); }
#lb[hidden] { display: none; }
#lb .gh { padding: 10px 10px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
#lb [role="option"] { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
#lb [role="option"].act { background: color-mix(in srgb, var(--accent) 14%, transparent); }
#lb [aria-selected="true"] span::before { content: "✓ "; color: var(--accent); }
#lb [aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
#lb small { color: var(--muted); font-size: 12px; white-space: nowrap; } #lb .none { padding: 12px; color: var(--muted); }
.hold { margin-top: 14px; padding: 8px 16px 12px; text-align: left; }
.hold-h { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; } .hold-h .link { color: var(--accent); font-size: 13px; }
.alloc { display: flex; height: 8px; gap: 2px; border-radius: 99px; overflow: hidden; margin: 2px 0 8px; } .alloc i { display: block; min-width: 2px; }
.hrow { display: grid; grid-template-columns: 10px minmax(0, 1fr) 72px auto 28px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.hrow .sw { width: 10px; height: 10px; border-radius: 3px; }
.hn b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hn small { color: var(--muted); font-size: 12px; }
.hrow canvas { width: 72px; height: 26px; margin: 0; }
.wi { display: flex; align-items: center; justify-content: flex-end; gap: 4px; color: var(--muted); min-width: 60px; } .wi input { width: 78px; text-align: right; }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; border-radius: 8px; width: 28px; height: 28px; } .x:hover { color: var(--red); }
.ex { margin-top: 18px; display: grid; gap: 10px; justify-items: center; } .launch:not(.solo) .ex { justify-items: start; }
.runs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.runs .action { padding: 14px 10px; border-radius: 14px; text-align: center; } .runs .action b { font-size: 14.5px; }
.launch .hint { margin-top: 14px; }
.prev { position: sticky; top: 76px; display: grid; gap: 12px; }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pstats span { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; } .pstats b { font-size: 20px; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .launch { grid-template-columns: minmax(0, 1fr); } .launch.solo { padding-top: 32px; } .runs { grid-template-columns: 1fr; } .hrow { grid-template-columns: 10px minmax(0, 1fr) auto 28px; } .hrow canvas { display: none; } .prev { position: static; } }

.sec-h { font-size: 15px; margin: 22px 0 -4px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
td.fail { color: var(--red); } td.pass { color: var(--green); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; } .presets .pill { cursor: pointer; text-align: left; padding: 8px 14px; border-radius: 12px; font-weight: 600; } .presets .pill small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; } .presets .pill.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.selres { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; } .selres > span { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; } .selres small { flex-basis: 100%; color: var(--muted); }
table.heat td { text-align: center; font-variant-numeric: tabular-nums; } table.heat td.fail, table.heat td.pass { color: var(--text); }

[hidden] { display: none !important; }
.tabs.sub { margin: 0 0 14px; }

.cb{height:4px;margin-top:3px}.cbar{display:block;height:100%;border-radius:2px}

/* ---- polish: depth, glow, day/night button, no horizontal overflow ---- */
html, body { overflow-x: hidden; }
body { background: radial-gradient(900px 420px at 12% -80px, var(--glow-a), transparent 70%), radial-gradient(800px 380px at 92% -60px, var(--glow-b), transparent 70%), var(--ground); background-attachment: fixed; min-height: 100vh; }
img, canvas, svg, video { max-width: 100%; }
.wrap, main, section, aside, .out, .card, .kpi { min-width: 0; }
p, li, h1, h2, h3, small { overflow-wrap: anywhere; }
.card, .kpi, .asset, .action, .grid3 article { box-shadow: var(--shadow); }
.mark { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 18px var(--glow-a); }
.top { background: color-mix(in srgb, var(--ground) 80%, transparent); backdrop-filter: blur(14px) saturate(1.3); }
.top-in { gap: 12px; }
nav { align-items: center; gap: 4px; }
nav a { padding: 7px 12px; border-radius: 999px; transition: background-color .15s, color .15s; }
nav a:hover { background: var(--raised); }
nav a.on { background: var(--raised); color: var(--text); }
.themebtn { flex: none; width: 36px; height: 36px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: transform .2s, background-color .15s; }
.themebtn:hover { background: var(--raised); transform: rotate(18deg); }
h1 { background: linear-gradient(120deg, var(--text) 45%, var(--accent) 130%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: .55; }
.chart-card { overflow: hidden; }
.seg button[aria-pressed="true"], .tabs a.on, .primary, .dockbar button { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2))); }
.asset:hover, .action:not(:disabled):hover { box-shadow: 0 10px 30px var(--glow-a); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.foot { margin-top: 24px; }
@media (max-width: 900px) {
  .wrap { padding: 0 16px; }
  .top-in { height: auto; min-height: 56px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
  nav { flex-wrap: wrap; justify-content: flex-end; }
  nav a { padding: 6px 9px; font-size: 13px; }
  .kpi b { font-size: 24px; }
  .hero { padding: 32px 0 20px; }
  table { min-width: 520px; }
  .plain { min-width: 0; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr 1fr; } .dockbar { border-radius: 22px; } }
@media (max-width: 520px) { #repo { display: none; } nav a { padding: 6px 8px; } .top-in { flex-wrap: nowrap; } }

/* ---- app shell: vertical sidebar ---- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); align-items: start; }
.shell > main { width: 100%; }
.side { position: sticky; top: 61px; height: calc(100vh - 61px); overflow-y: auto; border-right: 1px solid var(--border); padding: 14px 10px 54px; background: color-mix(in srgb, var(--surface) 55%, var(--ground)); scrollbar-width: thin; }
.sq input { width: 100%; font: inherit; font-size: 13.5px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--ground); color: var(--text); }
.sq input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sn { margin-top: 12px; display: grid; gap: 2px; }
.sh { width: 100%; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 650; font-size: 13.5px; text-align: left; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.sh:hover { background: var(--raised); }
.sh i { font-style: normal; color: var(--accent); text-align: center; }
.sh small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.sb { display: none; padding: 2px 0 8px 30px; }
.sc.open .sb { display: grid; gap: 1px; }
.sl { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; color: var(--muted); text-decoration: none; }
a.sl:hover { color: var(--text); background: var(--raised); }
a.sl.on { color: var(--accent-ink); background: var(--accent); font-weight: 650; }
.sl.soon { opacity: .55; cursor: default; } .sl.soon em { font-style: normal; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--border); border-radius: 99px; padding: 0 6px; }
.sempty { color: var(--muted); font-size: 13px; padding: 8px 10px; }
.smin { position: fixed; bottom: 12px; left: 12px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; }
.smin:hover { color: var(--text); }
.side-min .shell { grid-template-columns: 60px minmax(0, 1fr); }
.side-min .side { padding: 14px 6px; overflow-x: hidden; }
.side-min .sq, .side-min .sh span, .side-min .sh small, .side-min .sb { display: none; }
.side-min .sh { grid-template-columns: 1fr; justify-items: center; } .side-min .sh i { font-size: 18px; }
.side-min .smin { transform: rotate(180deg); }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding-bottom: 56px; }
.catcard { display: grid; gap: 6px; align-content: start; padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); text-decoration: none; transition: border-color .15s, transform .15s; }
a.catcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.catcard i { font-style: normal; font-size: 22px; color: var(--accent); } .catcard b { font-size: 17px; letter-spacing: -.01em; }
.catcard span { color: var(--muted); font-size: 14px; } .catcard small { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.catcard.dim { opacity: .55; }
@media (max-width: 900px) { .shell { grid-template-columns: minmax(0, 1fr); } .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); } .smin { display: none; } }

/* lab modules: sliders, notes, two-column result grids */
.controls input[type=range] { width: 100%; accent-color: var(--accent); margin-top: 6px; }
.controls output { float: right; color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; }
.card.note p { margin: 0; color: var(--muted); line-height: 1.6; max-width: 90ch; } .card.note b { color: var(--text); }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } @media (max-width: 900px) { .duo { grid-template-columns: minmax(0, 1fr); } }
.out > * + * { margin-top: 16px; }
.controls textarea, .controls select { width: 100%; }
.qopt { display: block; width: 100%; text-align: left; margin: 6px 0; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.qopt:hover { background: var(--raised); } .qopt.ok { border-color: var(--green); } .qopt.no { border-color: var(--red); }
.sheet h3 { margin: 18px 0 6px; font-size: 15px; } .sheet p, .sheet li { color: var(--muted); line-height: 1.6; } .sheet code { background: var(--raised); padding: 1px 6px; border-radius: 6px; color: var(--text); }
@media print { .side, .top, .foot, .controls, .smin { display: none !important; } .shell { display: block; } .lab { display: block; } body { background: #fff; color: #000; } }

/* Python code button and dialog */
#pybtn { position: fixed; right: 18px; bottom: 18px; z-index: 40; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
#pybtn:hover { border-color: var(--text); }
#pydlg { width: min(860px, 94vw); max-height: 88vh; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); }
#pydlg::backdrop { background: rgba(0, 0, 0, .5); }
#pydlg .pyhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
#pydlg .pyhead span { display: flex; gap: 8px; }
#pydlg button { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
#pydlg pre { margin: 0 0 10px; padding: 14px; max-height: 60vh; overflow: auto; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font: 13px/1.5 ui-monospace, Consolas, monospace; white-space: pre; }
#pydlg #pyout { margin: 0 0 10px; padding: 12px 14px; max-height: 30vh; overflow: auto; border-radius: 12px; border: 1px solid var(--border); font: 13px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
#pydlg #pyout.wait { color: var(--muted); }
#pydlg #pyout.bad { border-color: #c0392b; }
#pydlg small { color: var(--muted); }

#pybadge{font-size:12px;padding:2px 8px;border:1px solid currentColor;border-radius:999px;opacity:.75;margin-right:12px;white-space:nowrap}
