@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --hue { syntax: '<number>'; inherits: true; initial-value: 205; }

:root {
  --hue: 205;
  --bg: #05060a;
  --ink: #e9ecf5;
  --mute: #a3aabd;
  --dim: #6b728a;
  --line: rgba(255,255,255,.07);
  --glass: rgba(18,21,32,.55);
  --acc: oklch(78% .17 var(--hue));
  --acc2: oklch(70% .2 calc(var(--hue) + 40));
  --f-ui: "Inter Tight", system-ui, sans-serif;
  --f-disp: "Instrument Serif", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  transition: --hue .9s cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html { color-scheme: dark; scrollbar-color: #2a2f40 transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-ui); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
button { font: inherit; color: inherit; }

/* ---------- ambient background ---------- */
.aurora { position: fixed; inset: -20vmax; z-index: 0; pointer-events: none; filter: blur(80px) saturate(140%); opacity: .55; }
.aurora i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; mix-blend-mode: screen; animation: drift 28s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { left: 5%; top: 0; background: radial-gradient(closest-side, oklch(55% .2 var(--hue) / .55), transparent); }
.aurora i:nth-child(2) { right: 0; top: 25%; background: radial-gradient(closest-side, oklch(50% .22 calc(var(--hue) + 60) / .45), transparent); animation-duration: 36s; animation-delay: -9s; }
.aurora i:nth-child(3) { left: 30%; bottom: -10%; background: radial-gradient(closest-side, oklch(45% .18 calc(var(--hue) - 50) / .4), transparent); animation-duration: 44s; animation-delay: -20s; }
@keyframes drift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(8vmax,-6vmax) scale(1.15); } 100% { transform: translate(-6vmax,5vmax) scale(.95); } }
.gridfx { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%); opacity: .5; }
#beams { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ---------- header ---------- */
header.top, main { position: relative; z-index: 2; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px clamp(16px,3vw,44px) 4px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.mark { width: 34px; height: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.mark span { border-radius: 4px; background: var(--acc); animation: pulse 2.4s ease-in-out infinite; }
.mark span:nth-child(2) { animation-delay: .3s; opacity: .7; } .mark span:nth-child(3) { animation-delay: .6s; opacity: .5; } .mark span:nth-child(4) { animation-delay: .9s; opacity: .85; }
@keyframes pulse { 50% { filter: brightness(1.6); transform: scale(.88); } }
.kicker { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--mute); }
h1 { margin: 2px 0 0; font-family: var(--f-disp); font-weight: 400; font-size: clamp(30px,3.2vw,44px); line-height: 1; letter-spacing: -.01em; }
h1 em { font-style: italic; background: linear-gradient(90deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hud { display: flex; gap: 6px; flex-wrap: wrap; }
.hud-cell { background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 12px; padding: 7px 12px 6px; min-width: 70px; }
.hud-cell .k { display: block; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.hud-cell .v { display: block; font-family: var(--f-mono); font-size: 17px; font-weight: 500; margin-top: 1px; font-variant-numeric: tabular-nums; }
.hud-cell.spark { min-width: 140px; } .hud-cell svg { width: 120px; height: 24px; display: block; margin-top: 2px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); margin-right: 7px; vertical-align: 2px; }
.dot.ok { background: #5df2a5; box-shadow: 0 0 10px #5df2a5; } .dot.bad { background: #ff5d7a; box-shadow: 0 0 10px #ff5d7a; }
.dot.busy { background: var(--acc); box-shadow: 0 0 10px var(--acc); animation: pulse .6s infinite; }

/* ---------- composer ---------- */
main { padding: 10px clamp(16px,3vw,44px) 40px; max-width: 1800px; margin: 0 auto; }
.composer { max-width: 1100px; margin: 18px auto 0; }
.field { position: relative; border-radius: 22px; padding: 2px; background: linear-gradient(120deg, oklch(70% .18 var(--hue) / .7), oklch(60% .2 calc(var(--hue) + 70) / .5), oklch(70% .18 var(--hue) / .15), oklch(70% .18 var(--hue) / .7)); background-size: 300% 300%; animation: sheen 9s linear infinite; box-shadow: 0 30px 80px -30px oklch(55% .2 var(--hue) / .55); }
@keyframes sheen { to { background-position: 300% 0; } }
.field::before { content: ""; position: absolute; inset: 2px; border-radius: 20px; background: rgba(9,11,18,.88); backdrop-filter: blur(20px); }
.field > * { position: relative; }
textarea#input { display: block; width: 100%; resize: none; border: 0; outline: none; background: transparent; color: var(--ink); font-family: var(--f-ui); font-weight: 300; font-size: clamp(19px,1.7vw,25px); line-height: 1.45; padding: 22px 26px 8px; min-height: 76px; max-height: 40vh; caret-color: var(--acc); field-sizing: content; }
textarea#input::placeholder { color: var(--dim); }
.field-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 18px 14px 22px; flex-wrap: wrap; }
.samples { display: flex; gap: 6px; flex-wrap: wrap; }
.samples button { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #c3c8d6; border-radius: 99px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; transition: all .2s; }
.samples button:hover { color: var(--ink); border-color: oklch(75% .15 var(--hue) / .6); background: oklch(60% .15 var(--hue) / .15); }
.field-meta { font-family: var(--f-mono); font-size: 11px; color: var(--mute); display: flex; gap: 6px; }
.field-meta #state.busy { color: var(--acc); }
.scan { position: absolute !important; left: 2px; right: 2px; bottom: 2px; height: 2px; border-radius: 0 0 20px 20px; overflow: hidden; }
.scan::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; left: -30%; background: linear-gradient(90deg, transparent, var(--acc), transparent); opacity: 0; }
.scan.on::after { opacity: 1; animation: scan .7s linear infinite; }
@keyframes scan { to { left: 100%; } }

.tabs { display: flex; gap: 6px; justify-content: center; margin: 20px -120px 6px; flex-wrap: wrap; }
@media (max-width: 1340px) { .tabs { margin-left: 0; margin-right: 0; } }
.tab { position: relative; border: 1px solid rgba(255,255,255,.1); background: var(--glass); backdrop-filter: blur(12px); border-radius: 14px; padding: 7px 11px 7px 8px; cursor: pointer; display: flex; align-items: center; gap: 9px; color: var(--mute); transition: color .2s, border-color .2s, transform .2s; }
.tab:hover { color: var(--ink); transform: translateY(-1px); }
.tab .g { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; background: oklch(55% .16 var(--th) / .22); color: oklch(85% .14 var(--th)); }
.tab .n { font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.tab .mini { display: grid; grid-template-columns: repeat(10, 3px); gap: 1px; margin-left: 4px; }
.tab .mini i { width: 3px; height: 3px; border-radius: 1px; background: oklch(80% .16 var(--th) / calc(.08 + var(--p) * .92)); }
.tab.on { color: var(--ink); border-color: oklch(75% .15 var(--th) / .7); box-shadow: 0 0 0 1px oklch(75% .15 var(--th) / .25), 0 10px 30px -12px oklch(60% .2 var(--th) / .7); }
.blurb { text-align: center; color: var(--mute); font-size: 14px; margin: 8px auto 0; max-width: 760px; min-height: 1.4em; }

/* ---------- readout ---------- */
.readout { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 22px auto 0; max-width: 1300px; min-height: 36px; }
.readout .ghost { color: var(--dim); font-size: 13px; font-style: italic; align-self: center; }
.pill { --c: oklch(80% .16 var(--hue)); display: inline-flex; align-items: center; gap: 8px; border-radius: 99px; padding: 6px 12px 6px 7px; background: oklch(55% .16 var(--hue) / .16); border: 1px solid oklch(75% .15 var(--hue) / .35); font-size: 13.5px; cursor: pointer; animation: pop .45s cubic-bezier(.2,1.4,.4,1) both; }
.pill b { font-family: var(--f-mono); font-size: 11px; font-weight: 700; color: #05060a; background: var(--c); border-radius: 99px; padding: 2px 6px; }
.pill:hover { background: oklch(55% .16 var(--hue) / .3); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.9); } }

/* ---------- controls ---------- */
.controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0 14px; flex-wrap: wrap; font-size: 13px; color: var(--mute); }
.thresh { display: flex; align-items: center; gap: 9px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.thresh input { accent-color: var(--acc); width: 140px; }
.thresh b { color: var(--ink); font-weight: 500; width: 34px; }
.litcount b { color: var(--ink); font-family: var(--f-mono); font-size: 15px; }
.seg { display: inline-flex; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; cursor: pointer; color: var(--mute); font-size: 12.5px; }
.seg button.on { background: rgba(255,255,255,.08); color: var(--ink); }
.burst { border: 1px solid oklch(75% .15 var(--hue) / .5); background: linear-gradient(90deg, oklch(55% .18 var(--hue) / .35), oklch(55% .2 calc(var(--hue) + 60) / .35)); border-radius: 10px; padding: 7px 14px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink); transition: filter .2s; }
.burst:hover { filter: brightness(1.3); }
.burst:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- the wall ---------- */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(370px, 100%), 1fr)); gap: 14px; transition: opacity .25s, filter .25s; }
.wall.stale { opacity: .55; filter: saturate(.6); }
.wall.flat { display: block; }
.cat { position: relative; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 12px; overflow: hidden; container-type: inline-size; }
.cat::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 0% 0%, oklch(60% .18 var(--hue) / calc(var(--heat, 0) * .28)), transparent 60%); pointer-events: none; transition: --heat .6s; }
.cat-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; position: relative; }
.cat-h h3 { margin: 0; font-weight: 600; font-size: 14px; letter-spacing: .01em; }
.cat-h .meta { font-family: var(--f-mono); font-size: 10.5px; color: var(--mute); }
.cat-h .meta b { color: var(--ink); font-weight: 500; }
.heatbar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.05); margin: -4px 0 10px; overflow: hidden; position: relative; }
.heatbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--acc), var(--acc2)); width: calc(var(--heat, 0) * 100%); transition: width .5s cubic-bezier(.2,.8,.2,1); border-radius: 2px; }
.cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
@container (max-width: 300px) { .cells { grid-template-columns: repeat(4, 1fr); } }
.cell { --p: 0; position: relative; height: 54px; border-radius: 9px; border: 1px solid rgba(255,255,255,.05); cursor: pointer; overflow: hidden; text-align: left; padding: 5px 6px; display: flex; flex-direction: column; justify-content: space-between;
  /* v1.1 ramp: --q = p^2.2 keeps low values dark and spreads .5-1 apart, so .55 and .95 read as different tiers */
  --q: calc(var(--p) * var(--p) * (0.35 + 0.65 * var(--p)));
  background: oklch(calc(18% + var(--q) * 62%) calc(.02 + var(--q) * .19) calc(var(--hue) + var(--q) * 40) / calc(.4 + var(--p) * .6));
  box-shadow: 0 0 calc(var(--q) * 26px) oklch(72% .2 calc(var(--hue) + 40) / calc(var(--q) * .6)), inset 0 1px 0 rgba(255,255,255,calc(.03 + var(--q) * .22));
  transition: --p .55s cubic-bezier(.2,.8,.2,1), transform .15s, opacity .3s; }
.cell:hover { transform: translateY(-2px) scale(1.04); z-index: 3; border-color: rgba(255,255,255,.3); }
.cell .l { font-size: 11px; line-height: 1.12; font-weight: 500; hyphens: manual; overflow-wrap: break-word; word-break: normal; letter-spacing: -.02em; color: rgba(255,255,255,calc(.6 + var(--p) * .4)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell .n { font-family: var(--f-mono); font-size: 11px; color: rgba(255,255,255,calc(.42 + var(--p) * .4)); align-self: flex-end; font-variant-numeric: tabular-nums; }
.cell.lit { border-color: oklch(85% .12 calc(var(--hue) + 35) / .55); }
.cell.lit .n { color: #fff; font-weight: 700; font-size: 12px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.cell.dimmed { opacity: .14; }
.cell.flash::after { content: ""; position: absolute; inset: 0; border-radius: 9px; border: 1.5px solid #fff; animation: flash .9s ease-out forwards; }
@keyframes flash { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.15); } }
.cell.wait { animation: shimmer 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * 6ms); }
@keyframes shimmer { 50% { filter: brightness(1.7); } }
.wall.flat .cells { grid-template-columns: repeat(auto-fill, minmax(118px,1fr)); }
.wall.flat .cell .c { font-size: 9px; color: rgba(255,255,255,.35); font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .06em; }

.foot { margin-top: 28px; display: flex; justify-content: space-between; gap: 20px; color: var(--mute); font-size: 12.5px; flex-wrap: wrap; }
.foot em { font-family: var(--f-mono); font-style: normal; color: var(--ink); }
#usage { font-family: var(--f-mono); font-size: 11px; }

/* ---------- drawer ---------- */
.drawer { position: fixed; z-index: 20; top: 12px; right: 12px; bottom: 12px; width: min(400px, calc(100vw - 24px)); background: rgba(11,13,21,.92); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.1); border-radius: 22px; padding: 26px 24px; transform: translateX(110%); transition: transform .45s cubic-bezier(.2,.9,.2,1); overflow-y: auto; box-shadow: -30px 0 80px rgba(0,0,0,.5); }
.drawer.open { transform: none; }
.x { position: absolute; top: 14px; right: 16px; border: 0; background: rgba(255,255,255,.06); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--mute); }
.x:hover { color: var(--ink); }
.d-cat { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--acc); }
.drawer h2 { font-family: var(--f-disp); font-weight: 400; font-size: 34px; margin: 4px 0 6px; line-height: 1.05; }
.d-q { color: #c4c9d8; font-size: 15px; line-height: 1.45; margin: 0 0 18px; }
.d-ring { position: relative; width: 150px; height: 150px; margin: 6px auto 16px; }
.d-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.d-ring circle { fill: none; stroke-width: 9; }
.d-ring .trk { stroke: rgba(255,255,255,.06); }
.d-ring .arc { stroke: var(--acc); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .7s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 8px var(--acc)); }
.d-p { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-mono); font-size: 34px; font-weight: 500; }
.d-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--mute); }
.d-row b { color: var(--ink); font-weight: 500; font-family: var(--f-mono); font-size: 13px; }
.d-h { margin: 18px 0 8px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.d-hist { display: grid; gap: 5px; }
.d-hist .hrow { display: grid; grid-template-columns: 1fr 70px 34px; gap: 8px; align-items: center; font-size: 12px; color: #aab0c2; }
.d-hist .hrow span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-hist .hb { height: 5px; border-radius: 3px; background: rgba(255,255,255,.06); position: relative; overflow: hidden; }
.d-hist .hb i { position: absolute; inset: 0 auto 0 0; background: var(--acc); }
.d-hist .hrow b { font-family: var(--f-mono); font-size: 11px; text-align: right; color: var(--ink); font-weight: 500; }
.d-json { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-family: var(--f-mono); font-size: 11px; color: #b8c0d6; white-space: pre-wrap; word-break: break-word; margin: 0; }

/* ---------- burst modal ---------- */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(3,4,8,.86); backdrop-filter: blur(8px); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .3s; padding: 20px; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-in { position: relative; width: min(1200px, 100%); max-height: 92vh; overflow: auto; background: #0b0d15; border: 1px solid rgba(255,255,255,.1); border-radius: 24px; isolation: isolate; padding: 26px 28px; }
.b-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.b-head h2 { font-family: var(--f-disp); font-weight: 400; font-size: 32px; margin: 4px 0 0; }
.b-stat { font-family: var(--f-mono); font-size: 13px; color: var(--mute); text-align: right; line-height: 1.6; margin-right: 40px; }
.b-stat b { color: var(--ink); font-size: 22px; font-weight: 500; }
.b-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 14px; }
.b-set .t { min-height: 2.6em; align-items: flex-start; gap: 6px; }
.b-set { border: 1px solid var(--line); border-radius: 16px; padding: 12px; cursor: pointer; background: rgba(255,255,255,.02); transition: transform .2s, border-color .2s; }
.b-set:hover { transform: translateY(-3px); border-color: oklch(75% .15 var(--th) / .6); }
.b-set .t { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.b-set .t span { font-family: var(--f-mono); font-size: 11px; color: var(--mute); font-weight: 400; }
.b-mini { display: grid; grid-template-columns: repeat(20, 1fr); gap: 1.5px; }
.b-mini i { aspect-ratio: 1; border-radius: 1.5px; background: oklch(calc(20% + var(--p) * 60%) calc(.02 + var(--p) * .18) var(--th) / calc(.25 + var(--p) * .75)); transition: background .4s; }
.b-set .top3 { margin-top: 8px; font-size: 11.5px; color: var(--mute); line-height: 1.4; min-height: 3em; }
.b-set .top3 b { color: var(--ink); font-weight: 500; }
.b-note { color: var(--mute); font-size: 12.5px; margin: 16px 0 0; }

@media (max-width: 720px) { .hud-cell.spark { display: none; } .cells { grid-template-columns: repeat(4,1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.foot .notice { flex-basis: 100%; color: #ffcf8a; background: rgba(255,170,60,.08); border: 1px solid rgba(255,170,60,.25); border-radius: 10px; padding: 8px 12px; }
.setup { max-width: 900px; margin: 16px auto 0; padding: 14px 18px; border-radius: 14px; background: rgba(255,93,122,.1); border: 1px solid rgba(255,93,122,.35); color: #ffd3dc; font-size: 14px; line-height: 1.6; }
.setup code { font-family: var(--f-mono); background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 5px; color: #fff; }
.setup a { color: #fff; }

/* v1.1: keyboard focus, phone fit, contrast */
.field:focus-within { box-shadow: 0 0 0 2px oklch(80% .15 var(--hue) / .7), 0 30px 80px -30px oklch(55% .2 var(--hue) / .55); }
:focus-visible { outline: 2px solid oklch(85% .15 var(--hue)); outline-offset: 2px; }
.cell:focus-visible { z-index: 4; }
@property --heat { syntax: '<number>'; inherits: true; initial-value: 0; }
.cell.dimmed { opacity: .22; }
@media (max-width: 480px) {
  .cat { padding: 10px; }
  .cells { grid-template-columns: repeat(3, 1fr); }
  .cell { height: 58px; }
  .controls { gap: 10px; }
}

/* ---------- v1.2: banners, flips, tools, explain, burst race, toast ---------- */
.banner { max-width: 1100px; margin: 16px auto 0; padding: 11px 44px 11px 16px; border-radius: 14px; position: relative; font-size: 13.5px; line-height: 1.55; color: #e9ecf5;
  background: oklch(45% .12 var(--hue) / .22); border: 1px solid oklch(75% .14 var(--hue) / .35); }
.banner a { color: var(--acc); } .banner b { color: #fff; }
.banner button { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: var(--mute); font-size: 18px; cursor: pointer; }
.dot.rec { background: #ffb547; box-shadow: 0 0 10px #ffb547; }
.flips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 12px auto 0; max-width: 1300px; min-height: 26px; font-size: 12px; }
.f-k, .ex-k { font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-right: 4px; }
.f-n { font-family: var(--f-mono); font-size: 11px; margin: 0 2px 0 8px; } .f-n.up { color: #7cf0b4; } .f-n.down { color: #ff8fa3; }
.f-none { color: var(--dim); font-style: italic; }
.fchip { border-radius: 99px; padding: 3px 9px; font-size: 12px; cursor: pointer; border: 1px solid; background: transparent; animation: pop .4s cubic-bezier(.2,1.4,.4,1) both; }
.fchip.up { color: #b9f7d6; border-color: rgba(124,240,180,.4); background: rgba(124,240,180,.08); }
.fchip.down { color: #ffc2cd; border-color: rgba(255,143,163,.35); background: rgba(255,143,163,.07); }
.tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -4px 0 16px; }
.tools button { border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); color: var(--mute); border-radius: 10px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; transition: color .2s, border-color .2s; }
.tools button:hover { color: var(--ink); border-color: oklch(75% .15 var(--hue) / .5); }
.tools button:disabled { opacity: .45; cursor: progress; }
#explainBtn { color: var(--ink); border-color: oklch(75% .15 var(--hue) / .45); background: oklch(50% .15 var(--hue) / .18); }
body.replay #explainBtn { opacity: .5; }
.explain { max-width: 1100px; margin: 0 auto 18px; padding: 16px 20px 12px; border-radius: 18px; background: rgba(11,13,21,.78); backdrop-filter: blur(16px); border: 1px solid oklch(75% .14 var(--hue) / .3); }
.ex-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ex-head > div { flex: 1; font-size: 15px; } #exFocus b { font-weight: 600; } #exFocus span { font-family: var(--f-mono); color: var(--acc); margin-left: 4px; }
.ex-meta { font-family: var(--f-mono); font-size: 11px; color: var(--dim); }
.x.small { position: static; width: 26px; height: 26px; font-size: 16px; }
.ex-text { font-size: 17px; line-height: 1.85; margin: 10px 0 8px; }
.ex-p { border-radius: 6px; padding: 2px 3px; cursor: pointer; transition: outline-color .2s; outline: 1px solid transparent; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ex-p.pos { background: rgba(80, 230, 160, calc(var(--w) * .5)); }
.ex-p.neg { background: rgba(255, 95, 125, calc(var(--w) * .5)); }
.ex-p.sel, .ex-p:hover { outline-color: rgba(255,255,255,.55); }
.ex-p sup { font-family: var(--f-mono); font-size: 9.5px; color: var(--mute); margin-left: 2px; }
.ex-gates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 28px; }
.ex-hint { color: var(--dim); font-size: 12.5px; font-style: italic; }
.ex-note { font-size: 11.5px; color: var(--dim); margin: 10px 0 0; }
.hb.neg i { background: #ff8fa3; }
.lane { height: 3px; border-radius: 2px; background: rgba(255,255,255,.06); margin: -2px 0 8px; overflow: hidden; }
.lane i { display: block; height: 100%; width: 0; background: oklch(78% .17 var(--th)); box-shadow: 0 0 8px oklch(78% .17 var(--th)); }
.b-set.done .lane i { background: oklch(85% .12 var(--th)); }
.b-compare { margin-top: 16px; display: grid; gap: 8px; }
.cmp { display: grid; grid-template-columns: minmax(150px, 280px) 1fr 90px; align-items: center; gap: 12px; font-size: 12.5px; color: var(--mute); }
.cmp b { font-family: var(--f-mono); color: var(--ink); text-align: right; font-weight: 500; }
.cbar { height: 16px; border-radius: 8px; background: rgba(255,255,255,.07); overflow: hidden; }
.cbar i { display: block; height: 100%; width: var(--w); border-radius: 8px; background: linear-gradient(90deg, var(--acc), var(--acc2)); box-shadow: 0 0 18px oklch(75% .18 var(--hue) / .7); animation: grow .7s cubic-bezier(.2,.8,.2,1) both; }
.cmp.ghost .cbar i { background: repeating-linear-gradient(90deg, #ff8fa3 0 8px, rgba(255,143,163,.45) 8px 16px); box-shadow: none; animation-duration: 2.4s; }
.cmp { font-size: 13.5px; color: var(--ink); } .cmp b { font-size: 16px; }
.b-compare { padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
@keyframes grow { from { width: 0; } }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; z-index: 40; background: #141826; border: 1px solid rgba(255,255,255,.14); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; transition: opacity .25s, transform .25s; pointer-events: none; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 600px) { .cmp { grid-template-columns: 1fr 70px; } .cmp .cbar { grid-column: 1 / -1; grid-row: 2; } .ex-text { font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .cbar i, .fchip, .pill { animation: none; } }

@media (min-width: 1100px) {
  main, header.top { transition: padding-right .45s cubic-bezier(.2,.9,.2,1); }
  body.drawer-open main, body.drawer-open header.top { padding-right: 430px; }
}
.d-hist .hrow.why { grid-template-columns: 1fr 60px 44px; align-items: start; } .d-hist .hrow.why span:first-child { white-space: normal; overflow: visible; text-overflow: clip; font-size: 12px; line-height: 1.35; }
