/* squeek-dash: amber phosphor on CRT glass. Gold dot-matrix + blue tile, from the Squeekchain mark. */
:root {
  --glass: #15110b;       /* page */
  --panel: #1b160e;       /* raised surfaces */
  --phosphor: #ffb547;    /* primary text */
  --ember: #b08a5a;       /* secondary text */
  --ash: #7d6646;         /* muted text, axis labels */
  --soot: #33291b;        /* rules, grid */
  --tile: #7fb0ff;        /* links, selection */
  --mark-amber: #b97a26;  /* chart marks (validated on --glass) */
  --mark-blue: #5a8ee6;
  --ready: #a8d672;
  --burn: #e8735a;
  --max: #ffe2a8;
  --mono: "Berkeley Mono", "JetBrains Mono", "IBM Plex Mono", "Cascadia Mono", "SF Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* every scrollbar on the page (window, tables, activity): no track, a thin amber thumb that lights up on hover */
* { scrollbar-width: thin; scrollbar-color: rgba(176, 138, 90, 0.45) transparent; }
*:hover { scrollbar-color: rgba(176, 138, 90, 0.75) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(176, 138, 90, 0.45); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(176, 138, 90, 0.8); }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
html, body { margin: 0; background: var(--glass); color: var(--phosphor); font: 14px/1.5 var(--mono); }
body { min-height: 100vh; text-shadow: 0 0 6px rgba(255, 181, 71, 0.16); }
a { color: var(--tile); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--tile); outline-offset: 2px; }
.muted { color: var(--ash); }
.dim { color: var(--ember); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar */
.bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; justify-content: space-between; padding: 14px 24px 10px; border-bottom: 1px solid var(--soot); }
.brand { font-weight: 700; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 9px; }
.brand img { display: block; border-radius: 4px; image-rendering: auto; }
.brand span { font-weight: 400; color: var(--ember); margin-left: 1px; }
#syncline { color: var(--ember); font-size: 12.5px; }
#syncline b { color: var(--phosphor); font-weight: 400; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ash); margin-right: 6px; vertical-align: 1px; }
.dot.live { background: var(--ready); box-shadow: 0 0 6px var(--ready); }
.dot.warn { background: var(--burn); }

nav.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 18px 0; border-bottom: 1px solid var(--soot); }
nav.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 10px 8px; cursor: pointer; color: var(--ember); }
nav.tabs button kbd { font: inherit; color: var(--ash); margin-right: 6px; }
nav.tabs button[aria-selected="true"] { color: var(--phosphor); border-bottom-color: var(--phosphor); }
nav.tabs button:hover { color: var(--phosphor); }

main { padding: 24px; max-width: 1360px; margin: 0 auto; }
section[hidden] { display: none; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.notice { border: 1px dashed var(--soot); padding: 10px 14px; color: var(--ember); margin-bottom: 20px; }

/* ---------- overview hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 28px; }
.matrix svg { display: block; width: 100%; max-width: 640px; height: auto; }
.matrix .on { fill: var(--phosphor); filter: drop-shadow(0 0 2px rgba(255, 181, 71, 0.55)); }
.matrix .off { fill: var(--soot); opacity: 0.55; }
.hero-cap { margin: 12px 0 2px; color: var(--ember); }
.hamster { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--soot); max-width: 640px; }
.wheel { width: 34px; height: 34px; flex: none; }
.wheel circle, .wheel line { stroke: var(--ember); fill: none; stroke-width: 1.5; }
.wheel.spin g { animation: spin 1.2s linear infinite; transform-origin: 17px 17px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wheel.spin g { animation: none; } }
pre.leaders { margin: 0; white-space: pre; overflow-x: auto; font: inherit; line-height: 1.75; }
pre.leaders .v { color: var(--phosphor); }
pre.leaders .l { color: var(--ember); }
pre.leaders .d { color: var(--soot); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-bottom: 32px; }
h3.sub { margin: 26px 0 12px; }

/* ---------- overview: headline figures */
.readout { border-left: 1px solid var(--soot); padding-left: 28px; }
/* chart and headline figures share a row; the figures sit four across so the row stays short */
.pulse { align-items: stretch; margin-bottom: 28px; }
.pulse .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 20px; margin-top: 0; margin-bottom: 18px; }
@container (max-width: 560px) { .pulse .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pulse .readout { container-type: inline-size; min-width: 0; }
.pulse .figures dd { font-size: 26px; }
.pulse figure { display: flex; flex-direction: column; }
.pulse figure .plot { flex: 1 1 auto; min-height: 0; }
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; margin: 4px 0 26px; }
.figures div { margin: 0; }
.figures dt { color: var(--ember); font-size: 12.5px; }
.figures dd { margin: 2px 0 0; font-size: 30px; line-height: 1.15; color: var(--phosphor); font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(255, 181, 71, 0.28); }
.figures dd.sub { font-size: 12.5px; line-height: 1.4; color: var(--ash); text-shadow: none; margin-top: 4px; }

/* SQK split: claimed vs waiting, one bar, 2px surface gap between the parts */
.supply { border-top: 1px solid var(--soot); padding-top: 16px; margin-bottom: 18px; }
.supply-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.supply-top b { font-weight: 400; font-size: 18px; }
.split { display: flex; gap: 2px; height: 12px; }
.split span { min-width: 2px; flex-basis: 0; }
.split .seg-a { background: var(--mark-amber); border-radius: 3px 0 0 3px; }
.split .seg-b { background: var(--mark-blue); border-radius: 0 3px 3px 0; }
.split-key { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 9px; font-size: 12.5px; color: var(--ember); }
.split-key b { color: var(--phosphor); font-weight: 400; }
.split-key i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; vertical-align: 0; }
.k-a { background: var(--mark-amber); } .k-b { background: var(--mark-blue); }

/* records: 4 x 2 small readings under the wheel, 2 x 4 when the column is narrow; 1px gaps draw the rules */
.records-col { container-type: inline-size; min-width: 0; }
.records-col h3 { margin: 0 0 12px; }
.records-col #stats { margin-top: 16px; max-width: 640px; }
.records { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; max-width: 640px; background: var(--soot); border: 1px solid var(--soot); }
@container (max-width: 600px) { .records { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.records div { padding: 10px 12px; background: var(--glass); }
.records div.wide { grid-column: 1 / -1; }
.records dt { color: var(--ash); font-size: 11.5px; line-height: 1.35; }
.records dd { margin: 4px 0 0; font-size: 16px; color: var(--phosphor); white-space: nowrap; }

/* level ladder */
.levels { margin-bottom: 0; }
.levels-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; margin-bottom: 6px; }
.levels-head h2, .levels-head p { margin: 0; }
.levels-head p { font-size: 12.5px; }
.ladder tr.empty td { color: var(--ash); }
.ladder tr.empty td.lvl { color: var(--ash); }
.barcell { display: inline-flex; align-items: center; gap: 8px; min-width: 210px; }
.lbar { display: inline-block; height: 10px; flex: none; }
.lbar.la { background: var(--mark-amber); border-radius: 0 3px 3px 0; }
.lbar.lb { background: var(--mark-blue); border-radius: 0 3px 3px 0; }
figure { margin: 0; border: 1px solid var(--soot); padding: 14px 16px 12px; background: var(--panel); }
figcaption { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
figcaption b { font-weight: 700; }
figcaption button { background: none; border: 0; color: var(--ash); cursor: pointer; padding: 0; }
figcaption button:hover { color: var(--phosphor); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--ash); font: 11px var(--mono); }
.chart .val { fill: var(--ember); }
.chart .grid { stroke: var(--soot); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .bar-a { fill: var(--mark-amber); }
.chart .bar-b { fill: var(--mark-blue); }
.chart .hit:hover + .bar-a, .chart .hit:hover + .bar-b, .chart .hl { filter: brightness(1.35); }
.chart table { width: 100%; }

#tooltip { position: fixed; pointer-events: none; z-index: 30; background: var(--glass); border: 1px solid var(--ember); padding: 6px 9px; font-size: 12.5px; white-space: nowrap; display: none; }

/* ---------- tables */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--soot); white-space: nowrap; }
th { color: var(--ash); font-weight: 400; }
td.r, th.r { text-align: right; }

/* tables that show 30 rows and scroll the rest inside the box, like wallet activity; the header row stays put */
.rows-box { overflow: auto; border: 1px solid var(--soot); }
.rows-box:focus-visible { outline: 1px solid var(--phosphor); }
.rows-box thead th { position: sticky; top: 0; z-index: 1; background: var(--glass); box-shadow: inset 0 -1px 0 var(--soot); border-bottom: 0; }
.rows-box tbody tr:last-child td { border-bottom: 0; }
.rows-box th, .rows-box td { padding: 6px 7px; } /* the border takes a few px; keep every column in view */
.box-note { margin: 8px 0 0; font-size: 12.5px; min-height: 1.4em; }
tbody tr:hover { background: rgba(255, 181, 71, 0.05); }
.sharebar { display: inline-block; height: 8px; background: var(--mark-blue); border-radius: 0 3px 3px 0; vertical-align: 0; margin-right: 8px; min-width: 1px; }
.lv-hi { color: var(--max); }

/* ---------- controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 16px; }
.controls label { color: var(--ember); display: inline-flex; gap: 8px; align-items: center; }
input[type="search"], input[type="text"], select {
  background: var(--panel); border: 1px solid var(--soot); padding: 6px 9px; min-width: 0;
}
input::placeholder { color: var(--ash); }
.btn { background: var(--panel); border: 1px solid var(--ember); padding: 6px 14px; cursor: pointer; }
.btn:hover { border-color: var(--phosphor); }
.btn[disabled] { opacity: 0.4; cursor: default; }
.count { color: var(--ember); margin-left: auto; }

/* ---------- squeek grid */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--soot); padding: 8px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.card:hover { border-color: var(--ember); }
.card .art { aspect-ratio: 1; width: 100%; background: radial-gradient(circle, var(--soot) 1px, transparent 1.5px) 0 0 / 8px 8px; display: grid; place-items: center; overflow: hidden; }
.card img, .drawer .art img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; display: block; }
.card img { height: auto; aspect-ratio: 1; image-rendering: auto; } /* a pre-rendered PNG, scaled down smoothly */
.card .row { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; white-space: nowrap; }
/* cards shrunk to fit the window: smaller text, and anything still too long ends in an ellipsis */
.card { container-type: inline-size; min-width: 0; }
.card .row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card .row > :first-child { flex: none; }
@container (max-width: 140px) { .card .row, .card .row .st { font-size: 11px; } .card .row { gap: 4px; } }
.st { font-size: 12px; }
.st-ready { color: var(--ready); }
.st-pending { color: var(--tile); }
.st-cooldown { color: var(--ember); }
.st-max { color: var(--max); }
.st-burned { color: var(--burn); }
.more { display: flex; justify-content: center; margin-top: 18px; }
#cards[aria-busy] { opacity: 0.55; }
/* a table squeezed to fit the window: fitTable() sets these, nothing changes until it does */
table.fit th, table.fit td { padding-top: var(--pad-y, 6px); padding-bottom: var(--pad-y, 6px); font-size: var(--fs, inherit); line-height: var(--lh, 1.5); }

/* ---------- pager */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 22px; }
.pg { min-width: 2.4em; padding: 5px 8px; background: none; border: 1px solid var(--soot); color: var(--ember); font: inherit; cursor: pointer; }
.pg:hover:not([disabled]):not(.cur) { border-color: var(--phosphor); color: var(--phosphor); }
.pg.cur { border-color: var(--phosphor); color: var(--glass); background: var(--phosphor); cursor: default; }
.pg[disabled] { opacity: 0.35; cursor: default; }
.pager .gap { color: var(--ash); padding: 0 2px; }
/* wallet: page numbers sit on the "Squeeks" heading row, so the cards stay the last thing in the column */
.cards-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.cards-head h3 { margin: 0; }
.cards-head h3 .muted { font-weight: 400; }
.cards-head .pager { margin: 0; justify-content: flex-end; gap: 4px; }
.cards-head .pg { min-width: 2.1em; padding: 3px 6px; }

/* ---------- wallet: details left; activity right, from the address heading down to the cards */
.wallet-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: stretch; }
.wallet-main > h2:first-child, .activity > h3 { margin-top: 0; }
/* as wide as its longest line, so every event reads on one line; capped so the details keep room */
.activity { display: flex; flex-direction: column; min-height: 0; width: max-content; max-width: min(680px, 58vw); }
.activity .history li { grid-template-columns: 8.2em max-content; }
.activity .history li > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.activity h3 .muted { font-weight: 400; }
/* flex-basis 0 keeps the list from setting the row height: the left column does, the list scrolls inside it */
.activity .scroll { flex: 1 1 0; min-height: 240px; overflow-y: auto; border: 1px solid var(--soot); padding: 0 12px; }
.activity .scroll:focus-visible { outline: 1px solid var(--phosphor); }
.activity .history li:last-child { border-bottom: 0; }

/* ---------- drawer */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(520px, 100vw); background: var(--glass); border-left: 1px solid var(--ember); z-index: 20; overflow-y: auto; padding: 18px 22px 28px; transform: translateX(100%); transition: transform 0.18s ease-out; }
.drawer.open { transform: none; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }
.scrim { position: fixed; inset: 0; background: rgba(8, 6, 3, 0.6); z-index: 19; display: none; }
.scrim.open { display: block; }
.drawer header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.drawer header h2 { font-size: 18px; margin: 0; }
.drawer .close { background: none; border: 1px solid var(--soot); cursor: pointer; padding: 2px 9px; }
.drawer .art { width: 100%; max-width: 280px; aspect-ratio: 1; border: 1px solid var(--soot); margin-bottom: 16px; background: radial-gradient(circle, var(--soot) 1px, transparent 1.5px) 0 0 / 10px 10px; }
.facts { margin: 0 0 18px; white-space: pre; font: inherit; overflow-x: auto; line-height: 1.75; }
.facts .l { color: var(--ember); } .facts .d { color: var(--soot); }
.attrs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.attrs span { border: 1px solid var(--soot); padding: 2px 8px; font-size: 12.5px; }
.attrs span i { font-style: normal; color: var(--ash); margin-right: 6px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 6px 0; border-bottom: 1px solid var(--soot); display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; }
.history .t { color: var(--ash); font-size: 12.5px; }

/* ---------- feed */
.kv { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-bottom: 18px; color: var(--ember); }
.kv b { color: var(--phosphor); font-weight: 400; }

@media (max-width: 980px) {
  .hero, .grid2, .wallet-split { grid-template-columns: minmax(0, 1fr); }
  .readout { border-left: 0; padding-left: 0; border-top: 1px solid var(--soot); padding-top: 20px; }
  .activity .scroll { flex: none; min-height: 0; max-height: 420px; }
  .activity { width: auto; max-width: none; }
  .activity .history li { grid-template-columns: 7.5em minmax(0, 1fr); }
  .activity .history li > span:last-child { white-space: normal; }
  .activity { margin-top: 28px; }
  main { padding: 16px; }
  .bar { padding: 12px 16px 8px; }
}
@media (max-width: 520px) {
  .figures dd { font-size: 24px; }
  .barcell { min-width: 150px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
  pre.leaders, .facts { font-size: 12px; }
}