:root {
  color-scheme: dark;
  --bg: #121212; --surface: #191919; --surface2: #222; --line: #2e2e2e;
  --text: #efefef; --text2: #9c9c9c;
  --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef; --s8: #eb6263;
  --good: #0aac23; --bad: #eb6263;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
html { touch-action: manipulation; }
body { font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: calc(64px + env(safe-area-inset-bottom)); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); -webkit-text-size-adjust: 100%; }
a { color: var(--s1); }
main { max-width: 980px; margin: 0 auto; padding: 8px 10px; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
h2 small, .sub, .note, .kpi i, .mini i { color: var(--text2); font-weight: 400; font-size: 12px; font-style: normal; }
h3 { font-size: 13px; color: var(--text2); margin: 10px 0 4px; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(18,18,18,.96); border-bottom: 1px solid var(--line); padding: 8px 10px 6px; padding-top: calc(8px + env(safe-area-inset-top)); }
.top > * { max-width: 960px; margin-left: auto; margin-right: auto; }
select, input, button { font: inherit; color: var(--text); background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; }
select { display: block; width: 100%; min-height: 44px; padding: 8px 12px; font-weight: 600; }
.pills { display: flex; gap: 6px; margin-top: 6px; }
.pills a { flex: 1; text-align: center; min-height: 40px; line-height: 40px; border-radius: 10px; background: var(--surface2); color: var(--text); text-decoration: none; font-weight: 600; }
.pills a.on { background: var(--s1); color: #fff; }
.sub { margin: 4px 0 0; text-align: center; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kpi.wide { grid-column: 1 / -1; }
.kpi span, .mini span { display: block; color: var(--text2); font-size: 12px; }
.kpi b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.wide b { font-size: 28px; }
.kpi i, .mini i { display: block; }
.card { background: var(--surface); border-radius: 12px; padding: 12px; margin: 8px 0; }
.card.two { display: grid; gap: 14px; }
@media (min-width: 640px) { .card.two { grid-template-columns: 1fr 1fr; } }
.mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; }
@media (min-width: 640px) { .mini { grid-template-columns: repeat(4, 1fr); } }
.mini b { font-size: 18px; font-variant-numeric: tabular-nums; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--text2); font-size: 9px; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--s1); opacity: .12; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .hit.on { fill: rgba(255,255,255,.07); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.legend b { color: var(--text); margin-right: 10px; font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -12px; padding: 0 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--text2); font-weight: 500; font-size: 12px; }
td:first-child, th:first-child { padding-left: 0; }
.r { text-align: right; }
.empty { color: var(--text2); margin: 4px 0; }
.barrow { display: grid; grid-template-columns: 70px 1fr 42px; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.barrow span { overflow: hidden; text-overflow: ellipsis; }
.barrow b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.bar { background: var(--surface2); border-radius: 4px; height: 10px; overflow: hidden; }
.bar div { background: var(--s1); height: 100%; border-radius: 4px; }
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #161616; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
nav.bottom a { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 12px; color: var(--text2); color: var(--text); text-decoration: none; font-size: 14px; background: none; border: 0; border-radius: 0; width: 100%; }
nav.bottom a.on { color: var(--s1); }
nav.bottom .ic { font-size: 18px; line-height: 20px; }
nav.bottom a:active { background: var(--surface2); }
button.wide { width: 100%; min-height: 46px; }
.form label, .login label { display: block; margin: 10px 0; color: var(--text2); font-size: 13px; }
.form input:not([type=checkbox]), .login input { display: block; width: 100%; min-height: 46px; padding: 10px 12px; margin-top: 4px; font-size: 16px; }
.form label.check { display: flex; align-items: center; gap: 10px; color: var(--text); min-height: 44px; }
.form label.check input { width: 22px; height: 22px; }
button { min-height: 40px; padding: 6px 14px; cursor: pointer; }
button.primary { width: 100%; min-height: 48px; background: var(--s1); border-color: var(--s1); color: #fff; font-weight: 600; margin-top: 6px; }
.login { max-width: 380px; margin: 18vh auto 0; padding: 20px; }
.err { color: var(--bad); }
.good { color: var(--good); } .bad { color: var(--bad); }
.tag { font-size: 11px; background: var(--s2); color: #fff; border-radius: 6px; padding: 1px 6px; }
.keybox code { display: block; word-break: break-all; background: var(--surface2); padding: 10px; border-radius: 8px; user-select: all; font-size: 14px; }
code { font-size: 12px; }
pre { font-size: 11px; overflow-x: auto; background: var(--surface2); padding: 8px; border-radius: 8px; }
.camp { border-top: 1px solid var(--line); padding: 10px 0; }
.camphead { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.camphead span { color: var(--text2); font-size: 12px; }
.del { margin-top: 6px; }
#tip { position: fixed; z-index: 10; background: #000; color: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; pointer-events: none; max-width: 80vw; }

/* multi-column content + desktop sidebar */
.only-wide { display: none; }
.side { display: none; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.cols > .card { min-width: 0; }
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  nav.bottom { display: none; }
  .side { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: 210px; padding: 18px 12px; background: #161616; border-right: 1px solid var(--line); gap: 4px; }
  .side .brand { font-weight: 700; font-size: 16px; padding: 4px 10px 14px; }
  .side a { color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 10px; }
  .side a:hover { background: var(--surface2); }
  .side a.on { background: var(--s1); color: #fff; }
  .side form { margin-top: auto; }
  .side form button { width: 100%; }
  .side + .page { margin-left: 210px; }
  main, .top > * { max-width: 1400px; }
  main { padding: 10px 24px 24px; }
  .top { padding-left: 24px; padding-right: 24px; display: grid; grid-template-columns: minmax(240px, 380px) minmax(240px, 420px) 1fr; gap: 12px; align-items: center; }
  .top > * { margin: 0; }
  .top .pills { margin: 0; }
  .top .sub { text-align: left; }
  .kpis { grid-template-columns: repeat(7, 1fr); }
  .kpi.wide { grid-column: span 2; }
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols > .span2 { grid-column: 1 / -1; }
  .only-wide { display: block; } .only-narrow { display: none; }
  .mini { grid-template-columns: repeat(4, 1fr); }
}
details summary { cursor: pointer; color: var(--s1); padding: 10px 0 4px; min-height: 40px; }
.shareform { border-top: 1px solid var(--line); padding: 10px 0; }
.shareform .note { display: block; margin: 2px 0 6px; }
.inl { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 8px; align-items: end; }
.inl label { color: var(--text2); font-size: 12px; }
.inl input { display: block; width: 100%; min-height: 44px; padding: 8px 10px; margin-top: 4px; font-size: 16px; }
.inl button { min-height: 44px; }
.toggle { display: flex; gap: 6px; margin: 8px 0 0; }
.toggle a { flex: 1; text-align: center; min-height: 40px; line-height: 40px; border-radius: 10px; background: var(--surface2); color: var(--text); text-decoration: none; font-weight: 600; }
.toggle a.on { background: var(--s2); color: #fff; }
/* Ask page */
.askhead { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.askhead form { margin: 0; }
.seg { display: flex; flex: 1; background: var(--surface2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; min-height: 38px; border-radius: 8px; color: var(--text2); font-weight: 600; }
.seg button.on { background: var(--s1); color: #fff; }
.askpage main { padding-bottom: 90px; }
#chat { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.hint p { color: var(--text2); margin: 4px 0 8px; }
.hint .ex { display: block; width: 100%; text-align: left; margin: 6px 0; padding: 12px; min-height: 48px; background: var(--surface); }
.turn .me { align-self: flex-end; margin-left: 15%; background: var(--s1); color: #fff; padding: 10px 12px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; word-break: break-word; }
.turn { display: flex; flex-direction: column; gap: 8px; }
.turn .bot { background: var(--surface); border-radius: 14px 14px 14px 4px; padding: 10px 12px; min-width: 0; }
.turn .bot .md p { margin: 6px 0; }
.turn .bot .md ul, .turn .bot .md ol { margin: 6px 0; padding-left: 20px; }
.turn .bot .md h3 { color: var(--text); font-size: 14px; margin: 10px 0 4px; }
.turn .bot .tw { margin: 6px 0; padding: 0; }
.card.inner { background: var(--surface2); margin: 8px 0; padding: 10px; }
.card.inner h3 { margin: 0 0 6px; color: var(--text); }
.status { color: var(--text2); font-size: 13px; min-height: 0; }
.status:not(:empty)::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--s1); margin-right: 6px; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }
.cost { color: var(--text2); font-size: 11px; margin-top: 4px; }
.askbar { position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 8px 10px; background: rgba(18,18,18,.97); border-top: 1px solid var(--line); z-index: 5; }
.askbar textarea { flex: 1; resize: none; min-height: 46px; max-height: 160px; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--text); background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; }
.askbar button.primary { width: auto; margin: 0; min-width: 72px; }
@media (min-width: 1024px) {
  .askbar { left: 210px; bottom: 0; padding: 12px 24px; }
  #chat, .askhead, .askpage .sub { max-width: 900px; }
}
/* Roblox-style benchmark cards */
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; vertical-align: middle; margin-left: 6px; white-space: nowrap; }
.chip.up { color: #3ddc6a; background: rgba(10,172,35,.16); }
.chip.down { color: #ff7b7c; background: rgba(235,98,99,.16); }
.kpi b .chip { font-size: 11px; }
.chipnote { margin: 4px 2px 0; }
.bcards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 8px 0; }
@media (min-width: 640px) { .bcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .bcards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bcard { background: var(--surface); border-radius: 12px; padding: 12px 14px 10px; min-width: 0; }
.bhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 600; }
.bhead small { color: var(--text2); font-weight: 400; }
.verdict { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.verdict.great { background: #0aac23; color: #fff; }
.verdict.good { background: rgba(10,172,35,.25); color: #6be38a; }
.verdict.avg { background: rgba(210,142,5,.22); color: #f2b84a; }
.verdict.weak { background: rgba(235,98,99,.22); color: #ff8a8b; }
.bval { margin: 2px 0 6px; }
.bval b { font-size: 24px; font-variant-numeric: tabular-nums; }
.pbar { position: relative; display: flex; gap: 4px; height: 12px; margin: 26px 0 4px; }
.pbar .seg { height: 8px; margin-top: 2px; border-radius: 4px; background: #3a3a3a; overflow: hidden; }
.pbar .s50 { flex: 50; } .pbar .s90 { flex: 40; } .pbar .s100 { flex: 10; }
.pbar .seg i { display: block; height: 100%; background: #3ddc6a; border-radius: 4px; }
.pbar .knob { position: absolute; top: -1px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #ddd; border: 2px solid var(--surface); }
.pbar .knob em { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); font-style: normal; font-weight: 700; font-size: 12px; white-space: nowrap; }
.pmarks { position: relative; height: 34px; font-size: 11px; color: var(--text2); }
.pmarks span { position: absolute; top: 2px; transform: translateX(-50%); text-align: center; background: var(--surface2); border-radius: 6px; padding: 2px 6px; line-height: 1.25; white-space: nowrap; }
.pmarks span:last-child { transform: translateX(-70%); }
.bhelp { color: var(--text2); font-size: 12px; margin: 6px 0 0; }
.bhelp .ref { opacity: .8; }
/* settings */
.keyrow { border-top: 1px solid var(--line); padding: 12px 0 6px; }
.keyhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-bottom: 6px; }
.keyhead span { font-size: 13px; }
.keyform { display: grid; gap: 8px; }
.keyform input { width: 100%; min-height: 46px; padding: 10px 12px; font-size: 16px; }
.keyform .btns { display: flex; gap: 8px; }
.keyform .btns button { flex: 1; min-height: 44px; margin: 0; }
.keyform .btns .primary { width: auto; }
.addgroup { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.testout { margin: 6px 0 0; font-size: 13px; min-height: 1em; }
.okmsg { color: #3ddc6a; }
.linkrow { display: block; padding: 14px 0; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.benchgrid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 6px 8px; align-items: center; font-size: 13px; }
.benchgrid input { min-height: 40px; padding: 6px 8px; font-size: 16px; width: 100%; }
@media (min-width: 1024px) { .keyform { grid-template-columns: 1fr 1fr auto; align-items: center; } .keyform .btns { min-width: 260px; } .addgroup { grid-template-columns: 1fr 1fr 1fr auto; } .addgroup h3 { grid-column: 1 / -1; } }
.kpi span.chip, .mini span.chip { display: inline-block; font-size: 11px; color: inherit; }
.kpi span.chip.up { color: #3ddc6a; } .kpi span.chip.down { color: #ff7b7c; }
.kpi i span.chip { margin-left: 2px; }
.pbar .knob.edge-r em { left: auto; right: -4px; transform: none; }
.pbar .knob.edge-l em { left: -4px; transform: none; }
/* sticky header: fully opaque so scrolled content never shows through */
.top { background: var(--bg); box-shadow: 0 6px 12px -6px rgba(0,0,0,.7); isolation: isolate; }
.askbar { background: var(--bg); }
.qr { display: block; background: #fff; border-radius: 8px; margin: 8px 0; }
pre.codes { background: var(--bg2, #1e1e1e); padding: 10px; border-radius: 8px; font-size: 15px; user-select: all; }
