/* ==========================================================================
   BitcoinPoS Explorer — the node vault
   A datacenter floor built from real mineralogy.

   Colour system (provenance in lib/gems.js — every hue is a real gem, every caption is
   that gem's actual chemistry):
     diamond      the neutral, and the chain itself
     zones        sapphire · aquamarine · amethyst · spessartine — identity, one per telemetry
                  section; validated as a set on --rack (lightness band, chroma, CVD, 3:1)
     status       emerald ok · citrine warning · ruby fault — reserved, always with a label
   ========================================================================== */

:root {
	color-scheme: dark;

	/* Surfaces: vault floor → rack metal → a unit's raised bezel. */
	--void: #05060a;
	--floor: #080a0f;
	--rack: #0e1117;
	--rack-2: #131722;
	--bezel: #1a1f2b;
	--hair: rgba(196, 210, 232, 0.08);
	--hair-2: rgba(196, 210, 232, 0.14);
	--hair-3: rgba(196, 210, 232, 0.24);

	/* Ink — contrast on --rack: 16.5 / 9.9 / 6.4 : 1 */
	--ink: #ecf0f6;
	--ink-2: #b3bccb;
	--ink-3: #8c97a8;
	--platinum: #dce3ec;
	--diamond: #f3f7fc;

	/* Dispersion, in the order a prism separates white light (red → violet). Decoration only —
	   never on a data mark, where a rainbow would imply an ordered scale. */
	--fire: linear-gradient(90deg, #ff4d4d, #ff9b2f, #ffe24a, #4fdc8a, #3fa2ff, #8a63ff);

	--sapphire: #5087ee;
	--aquamarine: #2aa79c;
	--amethyst: #b070dc;
	--spessartine: #c9773a;

	--emerald: #2db47e;
	--citrine: #d8a328;
	--ruby: #eb4a6e;

	--link: #93b6f4;

	--display: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, "Book Antiqua", Georgia, serif;
	--sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

	--r-lg: 14px;
	--r: 10px;
	--r-sm: 6px;
	--u: 44px; /* one rack unit: 1.75 in = 44.45 mm */
	--gutter: clamp(16px, 3vw, 32px);
	--maxw: 1380px;
	--head-h: 92px;
}

.gem-diamond { --gem: var(--platinum); }
.gem-sapphire { --gem: var(--sapphire); }
.gem-aquamarine { --gem: var(--aquamarine); }
.gem-amethyst { --gem: var(--amethyst); }
.gem-spessartine { --gem: var(--spessartine); }
.gem-emerald { --gem: var(--emerald); }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	background: var(--void);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* The floor: a faint diamond lattice seen down [110] (public/lattice.svg, drawn from the real
   projected coordinates), under two soft pools of light, fading out toward the bottom. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(1100px 560px at 78% -8%, rgba(80, 135, 238, 0.11), transparent 62%),
		radial-gradient(800px 480px at -6% 4%, rgba(176, 112, 220, 0.06), transparent 60%),
		url("/lattice.svg") center top / 70px 99px repeat,
		var(--void);
	-webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, rgba(0, 0, 0, 0.55) 100%);
	mask-image: linear-gradient(180deg, #000 0%, #000 45%, rgba(0, 0, 0, 0.55) 100%);
}

/* With JavaScript, the lattice is drawn in 3D on a canvas (public/lattice3d.js) and the flat tile
   steps aside; the two pools of light stay behind it. */
html.has-lattice3d body::before {
	background:
		radial-gradient(1100px 560px at 78% -8%, rgba(80, 135, 238, 0.11), transparent 62%),
		radial-gradient(800px 480px at -6% 4%, rgba(176, 112, 220, 0.06), transparent 60%),
		var(--void);
}
/* The vignette is drawn in the lattice's shader; a CSS mask here was composited on every frame. */
.lattice3d {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	z-index: -1;
	pointer-events: none;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--diamond); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
	outline: 2px solid var(--sapphire);
	outline-offset: 2px;
	border-radius: 4px;
}

h1, h2, h3 { font-weight: 600; margin: 0; }
p { margin: 0 0 10px; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--platinum); background: rgba(255, 255, 255, 0.05); padding: 1px 5px; border-radius: 4px; }
strong { color: var(--ink); font-weight: 600; }

.mono { font-family: var(--mono); }
.right { text-align: right; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--diamond); color: #0a0d13; padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- facility header ---------- */

.facility {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(5, 6, 10, 0.84);
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	backdrop-filter: blur(16px) saturate(140%);
	border-bottom: 1px solid var(--hair);
}
.facility::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 1px;
	background: var(--fire);
	opacity: 0.28;
}

.facility-bar {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 10px var(--gutter);
	display: flex;
	align-items: center;
	gap: 20px;
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand img { width: 34px; height: 34px; display: block; filter: drop-shadow(0 2px 10px rgba(241, 140, 33, 0.3)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--display); font-size: 1.22rem; font-weight: 600; letter-spacing: 0.005em; }
.brand-sub { font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

.halls { display: flex; gap: 2px; }
.hall {
	position: relative;
	display: inline-flex;
	align-items: baseline;
	gap: 7px;
	padding: 8px 11px;
	color: var(--ink-2);
	font-size: 0.86rem;
	font-weight: 550;
	border-radius: 8px;
	white-space: nowrap;
}
.hall-code { font-family: var(--mono); font-size: 0.64rem; color: var(--ink-3); letter-spacing: 0.02em; }
.hall:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.hall[aria-current="page"] { color: var(--diamond); }
.hall[aria-current="page"] .hall-code { color: var(--ink-2); }
.hall[aria-current="page"]::after {
	content: "";
	position: absolute;
	left: 11px;
	right: 11px;
	bottom: 1px;
	height: 2px;
	border-radius: 2px;
	background: var(--fire);
}

.loupe {
	flex: 1;
	max-width: 500px;
	min-width: 220px;
	margin-left: auto;
	display: flex;
	align-items: center;
	background: var(--rack);
	border: 1px solid var(--hair-2);
	border-radius: 11px;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.loupe:focus-within { border-color: rgba(80, 135, 238, 0.65); box-shadow: 0 0 0 3px rgba(80, 135, 238, 0.16); }
.loupe-icon { width: 17px; height: 17px; margin-left: 12px; color: var(--ink-3); flex: none; }
.loupe input {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: 0;
	outline: 0;
	color: var(--ink);
	font: 500 0.88rem var(--sans);
	padding: 9px 10px;
}
.loupe input::placeholder { color: var(--ink-3); }
.loupe input::-webkit-search-cancel-button { filter: invert(0.7); }
.loupe-kbd {
	font: 600 0.7rem var(--mono);
	color: var(--ink-3);
	border: 1px solid var(--hair-2);
	border-bottom-width: 2px;
	border-radius: 5px;
	padding: 0 6px;
	margin-right: 4px;
}
.loupe:focus-within .loupe-kbd { display: none; }
.loupe button {
	margin: 4px;
	border: 0;
	border-radius: 8px;
	padding: 6px 13px;
	background: linear-gradient(180deg, #ffffff, #cfd9e6);
	color: #0a0d13;
	font: 650 0.8rem var(--sans);
	cursor: pointer;
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.loupe button:hover { background: linear-gradient(180deg, #ffffff, #e4ebf3); }

.unit-switch {
	flex: none;
	display: inline-flex;
	padding: 3px;
	gap: 2px;
	border: 1px solid var(--hair-2);
	background: var(--rack);
	border-radius: 999px;
	cursor: pointer;
	font: 600 0.7rem var(--mono);
	letter-spacing: 0.03em;
}
.unit-switch span { padding: 4px 9px; border-radius: 999px; color: var(--ink-3); transition: background 0.15s, color 0.15s; }
.unit-switch[data-unit="bps"] [data-u="bps"],
.unit-switch[data-unit="bits"] [data-u="bits"],
.unit-switch:not([data-unit]) [data-u="bps"] { background: var(--bezel); color: var(--diamond); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }

/* The radio: a pill beside the unit switch. Its equaliser moves only while music plays, in the
   playing track's gem colour. */
.radio { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.radio-btn, .radio-next {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 30px;
	padding: 0 11px 0 9px;
	border: 1px solid var(--hair-2);
	background: var(--rack);
	border-radius: 999px;
	color: var(--ink-3);
	font: 600 0.7rem var(--mono);
	letter-spacing: 0.03em;
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.radio-btn:hover, .radio-next:hover { color: var(--ink); border-color: var(--hair-3); }
.radio-next { width: 30px; padding: 0; justify-content: center; }

/* Download (public/download.js): the radio's pill, at the far right, its arrow in the logo's orange. */
.dl-btn {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 12px 0 9px;
	border: 1px solid var(--hair-2);
	background: var(--rack);
	border-radius: 999px;
	color: var(--ink-2);
	font: 600 0.7rem var(--mono);
	letter-spacing: 0.03em;
	white-space: nowrap;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.dl-btn svg { width: 15px; height: 15px; color: #f18c21; }
.dl-btn:hover { color: var(--ink); border-color: rgba(241, 140, 33, 0.55); background: color-mix(in srgb, #f18c21 9%, var(--rack)); }
.dl-btn:focus-visible { outline: 2px solid #f18c21; outline-offset: 2px; }
.radio-next:disabled { opacity: 0.4; cursor: default; }
.radio-next[hidden], .radio-mc[hidden] { display: none; }
.radio-mc {
	height: 30px;
	padding: 0 10px;
	border: 1px solid var(--hair-2);
	background: var(--rack);
	border-radius: 999px;
	color: var(--ink-3);
	font: 650 0.64rem var(--mono);
	letter-spacing: 0.08em;
	cursor: pointer;
}
.radio-mc[aria-pressed="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--gem, var(--platinum)) 55%, transparent); }
.radio-mc[aria-pressed="false"] { text-decoration: line-through; }
.radio-mc:hover { color: var(--ink); }
.rail-set[hidden] { display: none; }
.radio-next svg { width: 12px; height: 12px; }
/* Decks and volume: a speaker button that opens the deck panel. */
.radio { position: relative; }
.radio-mix {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 1px solid var(--hair-2);
	background: var(--rack);
	border-radius: 999px;
	color: var(--ink-3);
	cursor: pointer;
}
.radio-mix:hover, .radio-mix[aria-expanded="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--gem, var(--platinum)) 55%, transparent); }
.radio-mix[hidden], .radio-panel[hidden] { display: none; }
.radio-mix svg { width: 14px; height: 14px; }
.radio-mix[data-vol="low"] .rv-2, .radio-mix[data-vol="0"] .rv-1, .radio-mix[data-vol="0"] .rv-2 { opacity: 0.2; }
.radio-panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: 60;
	width: min(340px, calc(100vw - 32px));
	padding: 14px 16px 12px;
	border: 1px solid var(--hair-2);
	border-top: 2px solid color-mix(in srgb, var(--gem, var(--platinum)) 70%, transparent);
	border-radius: var(--r);
	background: rgba(14, 17, 23, 0.97);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
	font: 500 0.74rem/1.45 var(--mono);
	color: var(--ink-2);
}
.radio-panel p { margin: 0 0 6px; }
.rp-title { font: 600 1rem/1.25 var(--display); color: var(--ink); }
.rp-meta { color: var(--ink); }
.rp-deck, .rp-kit { font-size: 0.68rem; color: var(--ink-3); }
.rp-k { display: block; font-size: 0.6rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.rp-lyric { margin: 10px 0 12px; padding: 9px 10px; border: 1px solid var(--hair); border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.02); }
.rp-ml { display: block; margin-top: 3px; font-size: 0.86rem; color: color-mix(in srgb, var(--gem, var(--platinum)) 75%, var(--ink)); letter-spacing: 0.02em; overflow-wrap: anywhere; }
.rp-gloss { display: block; margin-top: 2px; color: var(--ink-3); font-style: italic; }
.rp-vol { display: grid; grid-template-columns: auto minmax(0, 1fr) 4ch; align-items: center; gap: 10px; }
.rp-vol .rp-k { display: inline; }
.rp-vol input { width: 100%; accent-color: var(--gem, var(--platinum)); }
.rp-vol output { text-align: right; color: var(--ink); }
/* Who is on the desk, and the switch that mutes them. In the panel rather than the header, because
   the header's buttons have no room on a phone and a voice you cannot switch off is a trap. */
.rp-host { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 8px; }
.rp-host .rp-k { display: inline; }
.rp-who { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-mc {
	min-height: 32px; min-width: 56px; padding: 4px 12px; border-radius: 999px; cursor: pointer;
	font: 0.72rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--ink-2); background: var(--rack); border: 1px solid var(--line);
}
.rp-mc[aria-pressed="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--gem, var(--platinum)) 55%, transparent); }
.rp-mc[aria-pressed="false"] { color: var(--ink-3); text-decoration: line-through; }
.radio-label { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio[data-state="on"] .radio-btn { color: var(--ink); border-color: color-mix(in srgb, var(--gem, var(--platinum)) 55%, transparent); background: color-mix(in srgb, var(--gem, var(--platinum)) 10%, var(--rack)); }
.radio[data-state="waiting"] .radio-btn { color: var(--ink); border-style: dashed; }
.radio[data-gem="sapphire"] { --gem: var(--sapphire); }
.radio[data-gem="aquamarine"] { --gem: var(--aquamarine); }
.radio[data-gem="amethyst"] { --gem: var(--amethyst); }
.radio[data-gem="spessartine"] { --gem: var(--spessartine); }
.radio[data-gem="diamond"] { --gem: var(--platinum); }
.radio-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.radio-eq i { width: 2px; height: 3px; border-radius: 1px; background: currentColor; opacity: 0.8; }
.radio[data-state="on"] .radio-eq i { background: var(--gem, var(--platinum)); animation: eq 1.1s ease-in-out infinite alternate; }
.radio[data-state="on"] .radio-eq i:nth-child(2) { animation-duration: 0.8s; animation-delay: -0.3s; }
.radio[data-state="on"] .radio-eq i:nth-child(3) { animation-duration: 1.3s; animation-delay: -0.6s; }
.radio[data-state="on"] .radio-eq i:nth-child(4) { animation-duration: 0.95s; animation-delay: -0.2s; }
@keyframes eq { from { height: 2px; } to { height: 11px; } }

/* In-page navigation (public/nav.js): a thin line of diamond fire while a page is on its way. */
.nav-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	z-index: 200;
	pointer-events: none;
	background: var(--fire);
	transform-origin: 0 50%;
	transform: scaleX(0);
	opacity: 0;
	transition: opacity 0.25s;
}
.nav-progress.is-on { opacity: 1; animation: nav-load 2.4s cubic-bezier(0.1, 0.7, 0.3, 1) forwards; }
@keyframes nav-load { from { transform: scaleX(0.05); } to { transform: scaleX(0.9); } }
main:focus { outline: none; }

/* The live status rail — the facility's building-management strip. */
.rail-wrap { border-top: 1px solid var(--hair); }
.rail {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 var(--gutter);
	height: 32px;
	display: flex;
	align-items: center;
	gap: 22px;
	font-size: 0.74rem;
	white-space: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-item { display: inline-flex; align-items: center; gap: 7px; }
.rail-item[hidden] { display: none; }
.rail-k { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.6rem; font-weight: 600; color: var(--ink-3); }
.rail-v { color: var(--ink-2); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rail-clock { margin-left: auto; }
.rail-v.flash { animation: ink-flash 1.6s ease-out; }

/* ---------- LEDs & status ---------- */

.led {
	--led: #566174;
	display: inline-block;
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75), transparent 45%), var(--led);
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}
.led[data-state="ok"] { --led: var(--emerald); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 9px rgba(45, 180, 126, 0.7); }
.led[data-state="warn"] { --led: var(--citrine); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 9px rgba(216, 163, 40, 0.7); }
.led[data-state="fault"] { --led: var(--ruby); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 9px rgba(235, 74, 110, 0.75); animation: led-blink 1.1s steps(2, jump-none) infinite; }
.led.is-live[data-state="ok"] { animation: led-breathe 2.6s ease-in-out infinite; }

.state-tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font: 650 0.58rem var(--sans);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	padding: 2px 6px;
	border-radius: 4px;
	margin-right: 6px;
	vertical-align: 1px;
	color: var(--ink);
	border: 1px solid var(--hair-2);
}
.state-tag[data-state="warn"] { border-color: rgba(216, 163, 40, 0.5); background: rgba(216, 163, 40, 0.12); }
.state-tag[data-state="fault"] { border-color: rgba(235, 74, 110, 0.55); background: rgba(235, 74, 110, 0.14); }

.badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 3px 10px 3px 8px;
	border-radius: 999px;
	font-size: 0.74rem;
	font-weight: 600;
	color: var(--ink);
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--hair-2);
}
.badge.muted { color: var(--ink-2); }

/* ---------- layout ---------- */

main {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 26px var(--gutter) 72px;
}

.page-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 40px;
	margin: 8px 0 24px;
	flex-wrap: wrap;
}
.eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px;
	font-size: 0.66rem;
	font-weight: 650;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--ink-3);
}
.eyebrow .code {
	font-family: var(--mono);
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--ink-2);
	padding: 2px 6px;
	border: 1px solid var(--hair-2);
	border-radius: 4px;
}
.display {
	font-family: var(--display);
	font-weight: 500;
	font-size: clamp(2rem, 1.3rem + 2vw, 2.9rem);
	line-height: 1.04;
	letter-spacing: -0.012em;
	color: var(--diamond);
}
.display-num {
	font-family: var(--sans);
	font-weight: 650;
	letter-spacing: -0.02em;
}
.lede { max-width: 560px; margin: 0; color: var(--ink-2); font-size: 0.9rem; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; font-size: 0.76rem; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--diamond); }
.crumbs .sep { opacity: 0.5; }

/* ---------- panels ---------- */

.panel {
	position: relative;
	min-width: 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0) 140px), var(--rack);
	border: 1px solid var(--hair);
	border-radius: var(--r-lg);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 48px -30px rgba(0, 0, 0, 0.9);
}
/* Stacked panels in page flow get breathing room; panels placed by a grid or flex parent get it from the gap. */
main > .panel + .panel { margin-top: 16px; }

.panel-head {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--hair);
}
.panel-code {
	font: 600 0.62rem var(--mono);
	color: var(--ink-3);
	border: 1px solid var(--hair-2);
	border-radius: 4px;
	padding: 1px 5px;
}
.panel-title {
	font-size: 0.72rem;
	font-weight: 650;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-2);
}
.panel-meta {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font: 500 0.72rem var(--mono);
	color: var(--ink-3);
	text-align: right;
}
.panel-link { color: var(--link); font-family: var(--sans); font-weight: 550; }
.panel-body { padding: 16px; }
.fine { margin: 0; padding: 12px 16px 14px; font-size: 0.74rem; color: var(--ink-3); border-top: 1px solid var(--hair); max-width: none; }
.fine + .fine { border-top: 0; padding-top: 0; }

.habit { width: 22px; height: 22px; flex: none; color: var(--gem, var(--platinum)); overflow: visible; }
.habit .f1 { fill: currentColor; fill-opacity: 0.5; }
.habit .f2 { fill: currentColor; fill-opacity: 0.28; }
.habit .f3 { fill: currentColor; fill-opacity: 0.12; }
.habit .edge { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linejoin: round; stroke-linecap: round; }

.ztag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.6rem;
	font-weight: 650;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-3);
	white-space: nowrap;
}
.ztag .habit { width: 13px; height: 13px; }
.ztag .habit .edge { stroke-width: 1.6; }

/* ---------- the floor ---------- */

.floor {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: 16px;
	align-items: start;
}
.floor-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Tip */
.tip-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px 20px;
	align-items: center;
	padding: 18px 20px 14px;
}
.tip-height {
	font: 650 clamp(2.7rem, 1.8rem + 3vw, 4.1rem) / 1 var(--sans);
	letter-spacing: -0.025em;
	color: var(--diamond);
	text-shadow: 0 0 40px rgba(160, 190, 240, 0.18);
}
.tip-height.flash { animation: tip-flash 1.8s ease-out; }
.tip-hash { color: var(--ink-3); font-weight: 300; margin-right: 3px; }
.tip-sub { margin: 10px 0 0; color: var(--ink-2); font-size: 0.88rem; }

.clock { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.clock svg { width: 74px; height: 74px; flex: none; overflow: visible; }
.clock-track { fill: none; stroke: var(--hair-2); stroke-width: 5; }
.clock-arc { fill: none; stroke: var(--platinum); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; filter: drop-shadow(0 0 5px rgba(220, 227, 236, 0.35)); }
.clock.is-over .clock-arc { stroke: var(--diamond); }
.clock-avg { stroke: var(--ink-3); stroke-width: 1.5; }
.clock-text { display: flex; flex-direction: column; line-height: 1.25; }
.clock-k { font-size: 0.6rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.clock-v { font: 600 1.35rem var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; margin: 2px 0; }
.clock-s { font-size: 0.72rem; color: var(--ink-3); }

/* The holographic coin. Faint scanlines over the canvas sell the projection; they are CSS, so the
   canvas itself stays a clean drawing. */
.coin-fig { position: relative; margin: -14px 0 -4px; text-align: center; }
canvas.coin { width: 220px; height: 270px; display: block; margin: 0 auto; }
.coin-fig::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	width: 220px;
	height: 190px;
	transform: translateX(-50%);
	pointer-events: none;
	background: repeating-linear-gradient(180deg, rgba(5, 6, 10, 0.22) 0 1px, transparent 1px 3px);
	-webkit-mask-image: radial-gradient(circle at 50% 53%, #000 0 42%, transparent 66%);
	mask-image: radial-gradient(circle at 50% 53%, #000 0 42%, transparent 66%);
}
.coin-fig figcaption { margin-top: -6px; font: 0.62rem/1.5 var(--mono); color: var(--ink-3); }
.coin-fig [data-coin-peers] { color: var(--ink-2); }

.tip-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--hair); }
.readout { padding: 14px 18px 16px; border-left: 1px solid var(--hair); min-width: 0; }
.readout:first-child { border-left: 0; }
.readout-k { font-size: 0.6rem; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.readout-v { margin-top: 5px; font-size: 1.02rem; font-weight: 620; color: var(--ink); overflow-wrap: anywhere; }
.readout-s { margin-top: 4px; font-size: 0.72rem; color: var(--ink-3); overflow-wrap: anywhere; }

.meter { position: relative; height: 5px; margin-top: 9px; border-radius: 5px; background: rgba(220, 227, 236, 0.1); overflow: visible; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--gem, var(--platinum)); transition: width 0.6s ease; }
.meter[data-state="warn"] i { background: var(--citrine); }
.meter[data-state="fault"] i { background: var(--ruby); }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink-2); }

/* Rack elevation */
.rack-frame { padding: 12px; container-type: inline-size; }
.rack-units {
	list-style: none;
	margin: 0;
	padding: 6px 6px 6px 26px;
	position: relative;
	border-radius: 9px;
	background: linear-gradient(90deg, #0b0d12 0 22px, transparent 22px), #06080c;
	border: 1px solid var(--hair);
	box-shadow: inset 0 12px 30px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
/* Mounting rails with square cage-nut holes, one pair per U. */
.rack-units::before {
	content: "";
	position: absolute;
	left: 8px;
	top: 6px;
	bottom: 6px;
	width: 6px;
	background: repeating-linear-gradient(180deg, transparent 0 8px, rgba(196, 210, 232, 0.13) 8px 13px, transparent 13px 30px, rgba(196, 210, 232, 0.13) 30px 35px, transparent 35px var(--u));
	border-radius: 1px;
}
.unit { height: var(--u); padding: 2px 0; }
.unit-face {
	position: relative;
	height: 100%;
	display: grid;
	grid-template-columns: 28px 10px minmax(98px, 1.25fr) minmax(76px, 1fr) minmax(92px, 1.1fr) 62px 66px;
	align-items: center;
	gap: 10px;
	padding: 0 12px 0 8px;
	overflow: hidden;
	border-radius: 5px;
	color: var(--ink-2);
	background: linear-gradient(180deg, #1b202c 0%, #151923 55%, #12151e 100%);
	border: 1px solid rgba(255, 255, 255, 0.06);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.55);
	font-size: 0.74rem;
	transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.unit-face:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.16); background: linear-gradient(180deg, #222836 0%, #1a1f2b 100%); transform: translateX(-2px); }
.unit-face:focus-visible { outline-offset: -2px; }
.unit-u { font: 500 0.58rem var(--mono); color: var(--ink-3); letter-spacing: 0.02em; }
.unit-led { width: 6px; height: 6px; border-radius: 50%; background: #3a4353; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5); }
.unit-led.is-live { background: var(--emerald); box-shadow: 0 0 8px rgba(45, 180, 126, 0.85); animation: led-breathe 2.6s ease-in-out infinite; }
.unit-face:hover .unit-led:not(.is-live) { background: var(--platinum); box-shadow: 0 0 6px rgba(220, 227, 236, 0.6); }
.unit-id { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.unit-h { font: 620 0.82rem var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.unit-hash { font: 0.6rem var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-tx, .unit-size { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pips { display: flex; gap: 2px; height: 9px; }
.pips i { width: 3px; height: 9px; border-radius: 1px; background: var(--platinum); opacity: 0.72; }
.unit-face:hover .pips i { opacity: 1; }
.unit-num { font: 0.64rem var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.unit-size .bar { height: 4px; border-radius: 2px; background: rgba(220, 227, 236, 0.09); overflow: hidden; margin: 2px 0 1px; }
.unit-size .bar i { display: block; height: 100%; border-radius: 2px; background: var(--platinum); opacity: 0.8; }
.unit-gap, .unit-age { font: 0.66rem var(--mono); color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.unit-age { color: var(--ink-2); }
.unit-grille {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: 5px;
	background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0 2px, rgba(255, 255, 255, 0.05) 2px 4px);
	opacity: 0.8;
}
.unit.is-new { animation: unit-slot 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.unit.is-new .unit-face::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.16) 45%, rgba(160, 200, 255, 0.12) 52%, transparent 70%);
	transform: translateX(-100%);
	animation: specular 1.3s 0.25s ease-out forwards;
}
.unit.is-leaving { animation: unit-unslot 0.5s ease-in both; }

@container (max-width: 560px) {
	.unit-face { grid-template-columns: 26px 8px minmax(96px, 1.2fr) minmax(58px, 0.8fr) minmax(70px, 1fr) 60px; gap: 9px; }
	.unit-gap { display: none; }
}
@container (max-width: 430px) {
	.rack-units { padding-left: 6px; background: #06080c; }
	.rack-units::before { display: none; }
	.unit-face { grid-template-columns: 8px minmax(88px, 1fr) minmax(50px, 0.7fr) 80px; gap: 8px; padding-left: 10px; }
	.unit-u, .unit-size, .unit-hash { display: none; }
}

/* Instrument modules */
.modules-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	overflow: hidden;
}
.module { padding: 14px 16px 14px; min-width: 0; display: flex; flex-direction: column; box-shadow: 1px 0 0 var(--hair), 0 1px 0 var(--hair); }
.module-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.module-label { font-size: 0.72rem; font-weight: 600; color: var(--ink-2); }
.module-value { margin-top: 6px; font-size: 1.14rem; font-weight: 640; color: var(--ink); overflow-wrap: anywhere; line-height: 1.25; }
.module-spark { margin-top: 8px; height: 30px; line-height: 0; }
.module-spark.is-empty { line-height: 30px; font-size: 0.66rem; font-style: italic; color: var(--ink-3); }
.module-sub { margin-top: 7px; font-size: 0.68rem; color: var(--ink-3); }
.module.flash .module-value, .readout.flash .readout-v { animation: ink-flash 1.6s ease-out; }

.sparkline { width: 100%; height: 30px; display: block; overflow: visible; }
.sparkline .spark-ln { stroke: var(--gem, var(--platinum)); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.sparkline .spark-ar { fill: var(--gem, var(--platinum)); opacity: 0.1; }
.sparkline .spark-zero { stroke: var(--hair-3); stroke-width: 1px; vector-effect: non-scaling-stroke; }

/* Cadence (block intervals) */
svg.vchart { width: 100%; height: auto; aspect-ratio: 640 / 220; display: block; overflow: visible; }
.vchart .g, .lchart .g { stroke: rgba(196, 210, 232, 0.07); }
.vchart .ax, .lchart .ax { fill: var(--ink-3); font-family: var(--mono); }
.vchart .bar { fill: var(--gem, var(--platinum)); opacity: 0.9; transition: opacity 0.12s; }
.vchart .col:hover .bar { opacity: 1; filter: brightness(1.25); }
.vchart .col:last-child .bar { opacity: 1; }
.vchart .val { fill: var(--ink); font-family: var(--mono); font-weight: 600; }
.vchart .ref, .lchart .ref { stroke: var(--ink-3); opacity: 0.75; }
.vchart .ref-label, .lchart .ref-label { fill: var(--ink-3); font-family: var(--mono); }

/* Host */
.host-rows { list-style: none; margin: 0; padding: 4px 0; }
.host-row { padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.host-row:last-child { border-bottom: 0; }
.host-main { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.host-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.host-value { font: 600 0.9rem var(--mono); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.host-row[data-missing] .host-value { font: italic 0.72rem var(--sans); color: var(--ink-3); }
.host-row .meter { margin-top: 8px; }
.host-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.host-note { font-size: 0.66rem; color: var(--ink-3); }
.host-spark { width: 120px; flex: none; }
.host-spark .sparkline { height: 18px; }

/* Floor log */
.log-lines { list-style: none; margin: 0; padding: 8px 0; max-height: 236px; overflow-y: auto; font: 0.74rem/1.5 var(--mono); }
.log-lines li { display: grid; grid-template-columns: 64px 64px minmax(0, 1fr); gap: 10px; padding: 5px 16px; color: var(--ink-2); }
.log-lines li.is-new { animation: log-in 0.6s ease-out; }
.log-lines time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.log-tag { justify-self: start; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--hair-2); border-radius: 4px; padding: 0 5px; height: 17px; line-height: 15px; }
.log-tag[data-tone="block"] { color: var(--diamond); border-color: rgba(220, 227, 236, 0.35); }
.log-tag[data-tone="ok"] { color: #7fe0b4; border-color: rgba(45, 180, 126, 0.45); }
.log-tag[data-tone="warn"] { color: #f0cd78; border-color: rgba(216, 163, 40, 0.45); }
.log-tag[data-tone="fault"] { color: #ff9ab2; border-color: rgba(235, 74, 110, 0.5); }
.log-lines a { color: var(--link); }

/* ---------- notices ---------- */

.notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 13px 16px;
	margin: 0 0 16px;
	border-radius: var(--r);
	border: 1px solid var(--hair-2);
	background: var(--rack);
	font-size: 0.84rem;
	color: var(--ink-2);
}
.notice .led { margin-top: 6px; }
.notice p:last-child { margin-bottom: 0; }
.notice-title { color: var(--ink); font-weight: 650; margin: 0 0 4px; }
.notice-list { margin: 6px 0 0; padding-left: 18px; }
.notice[data-tone="ok"] { border-color: rgba(45, 180, 126, 0.35); background: linear-gradient(90deg, rgba(45, 180, 126, 0.08), transparent 60%), var(--rack); }
.notice[data-tone="warn"] { border-color: rgba(216, 163, 40, 0.4); background: linear-gradient(90deg, rgba(216, 163, 40, 0.08), transparent 60%), var(--rack); }
.notice[data-tone="fault"] { border-color: rgba(235, 74, 110, 0.45); background: linear-gradient(90deg, rgba(235, 74, 110, 0.09), transparent 60%), var(--rack); }

/* ---------- specimen pages (block / tx / address) ---------- */

.specimen-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin: 4px 0 20px; }
.specimen-head .display { overflow-wrap: anywhere; }

.chain-strip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chain-strip a, .chain-strip span.here, .chain-strip span.void {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 11px;
	border-radius: 8px;
	font: 550 0.76rem var(--mono);
	color: var(--ink-2);
	background: var(--rack);
	border: 1px solid var(--hair-2);
	font-variant-numeric: tabular-nums;
}
.chain-strip a:hover { color: var(--diamond); border-color: var(--hair-3); background: var(--rack-2); }
.chain-strip span.here { color: #0a0d13; background: linear-gradient(180deg, #ffffff, #cfd9e6); border-color: transparent; font-weight: 700; }
.chain-strip span.void { color: var(--ink-3); border-style: dashed; opacity: 0.6; }
.chain-strip .kbd-hint { margin-left: 6px; font-size: 0.68rem; color: var(--ink-3); }
.chain-strip kbd { font: 600 0.66rem var(--mono); border: 1px solid var(--hair-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink-2); }

.inscription {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px 12px 16px;
	margin: 0 0 16px;
	border-radius: var(--r);
	border: 1px solid var(--hair);
	background: linear-gradient(90deg, rgba(220, 227, 236, 0.045), rgba(220, 227, 236, 0) 70%), var(--rack);
	overflow: hidden;
}
.inscription::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--fire); opacity: 0.7; }
.inscription-k { font-size: 0.6rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.inscription-v { flex: 1; min-width: 0; font: 500 0.86rem var(--mono); letter-spacing: 0.03em; color: var(--platinum); word-break: break-all; }

.copy {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 28px;
	padding: 0 10px;
	border-radius: 7px;
	border: 1px solid var(--hair-2);
	background: var(--rack-2);
	color: var(--ink-2);
	font: 600 0.7rem var(--sans);
	cursor: pointer;
}
.copy:hover { color: var(--diamond); border-color: var(--hair-3); }
.copy svg { width: 13px; height: 13px; }
.copy.is-done { color: #7fe0b4; border-color: rgba(45, 180, 126, 0.45); }

.specs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	margin: 0 0 16px;
	background: var(--rack);
	border: 1px solid var(--hair);
	border-radius: var(--r-lg);
	overflow: hidden;
}
/* Hairlines drawn per cell (not as grid-gap background) so a part-filled last row has no tinted hole. */
.spec { padding: 14px 16px; min-width: 0; box-shadow: 1px 0 0 var(--hair), 0 1px 0 var(--hair); }

.hash-list { margin: -4px 0 16px; padding: 4px 0; border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--rack); }
.hash-list > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 9px 16px; }
.hash-list > div + div { border-top: 1px solid var(--hair); }
.hash-list dt { font-size: 0.6rem; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.hash-list dd { margin: 0; font: 0.8rem var(--mono); color: var(--platinum); word-break: break-all; }
.spec-k { display: block; font-size: 0.6rem; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.spec-v { display: block; margin-top: 5px; font-size: 1rem; font-weight: 620; color: var(--ink); overflow-wrap: anywhere; }
.spec-v.mono { font-size: 0.84rem; font-weight: 500; word-break: break-all; }
.spec-s { display: block; margin-top: 3px; font-size: 0.72rem; color: var(--ink-3); overflow-wrap: anywhere; }

/* Confirmation depth on a log scale — how deep the block now sits under the tip. */
.depth { margin-top: 10px; }
.depth-track { position: relative; height: 6px; border-radius: 6px; background: linear-gradient(90deg, rgba(220, 227, 236, 0.06), rgba(220, 227, 236, 0.16)); }
.depth-track i { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--diamond); box-shadow: 0 0 8px rgba(243, 247, 252, 0.8); }
.depth-scale { display: flex; justify-content: space-between; margin-top: 5px; font: 0.56rem var(--mono); color: var(--ink-3); }

.section-title { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; }
.section-title h2 { font-family: var(--display); font-weight: 500; font-size: 1.45rem; color: var(--diamond); }
.section-title .count { font: 0.78rem var(--mono); color: var(--ink-3); }

/* ---------- ledger tables ---------- */

.table-wrap { overflow-x: auto; }
.ledger { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.84rem; }
.ledger th {
	text-align: left;
	font-size: 0.6rem;
	font-weight: 650;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-3);
	padding: 11px 16px;
	border-bottom: 1px solid var(--hair-2);
	white-space: nowrap;
}
.ledger td { padding: 11px 16px; border-bottom: 1px solid var(--hair); color: var(--ink-2); vertical-align: middle; }
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr { transition: background 0.12s; }
.ledger tbody tr:hover { background: rgba(80, 135, 238, 0.05); }
.ledger tbody tr:hover td { color: var(--ink); }
.ledger .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger th.num { font-family: var(--sans); }
.ledger .idx { width: 1%; font-family: var(--mono); color: var(--ink-3); }
.ledger .hash-link { font-family: var(--mono); font-size: 0.8rem; }
.ledger .sub { display: block; font-size: 0.68rem; color: var(--ink-3); margin-top: 2px; font-family: var(--sans); }
.kind { display: inline-block; font-size: 0.6rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--hair-2); color: var(--ink-3); margin-left: 8px; vertical-align: 1px; }
.kind[data-kind="coinstake"], .kind[data-kind="coinbase"] { color: var(--platinum); border-color: rgba(220, 227, 236, 0.3); }

.share { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.share-bar { width: 88px; height: 5px; border-radius: 5px; background: rgba(220, 227, 236, 0.08); overflow: hidden; flex: none; }
.share-bar i { display: block; height: 100%; border-radius: 5px; background: var(--gem, var(--platinum)); }

.hash-link { font-family: var(--mono); }

/* ---------- transaction cabling ---------- */

.patch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 0.6fr) minmax(0, 1fr); align-items: start; padding: 10px 0; }
.ports { list-style: none; margin: 0; padding: 0; min-width: 0; }
.ports-head { height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-size: 0.6rem; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.port { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; min-width: 0; }
.ports.in .port { padding-right: 6px; }
.ports.out .port { padding-left: 6px; }
.port-jack { flex: none; width: 12px; height: 12px; border-radius: 3px; background: #07090d; border: 1px solid var(--hair-3); box-shadow: inset 0 0 0 2px #0e1117; }
.ports.in .port { flex-direction: row-reverse; text-align: right; }
.port-body { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.port-addr { font: 0.78rem var(--mono); color: var(--link); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port-addr.plain { color: var(--ink-3); font-family: var(--sans); font-style: italic; }
.port-meta { font: 0.68rem var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port-amt { font: 600 0.8rem var(--mono); color: var(--ink); white-space: nowrap; }
.port.is-hot .port-jack { border-color: var(--diamond); box-shadow: inset 0 0 0 2px #0e1117, 0 0 8px rgba(243, 247, 252, 0.6); }
.bus { position: relative; }
.cables { width: 100%; display: block; overflow: visible; }
.cable { fill: none; stroke: var(--platinum); stroke-opacity: 0.38; vector-effect: non-scaling-stroke; stroke-linecap: butt; transition: stroke-opacity 0.15s; }
.cable.unknown { stroke-width: 1px; stroke-dasharray: 3 3; stroke-opacity: 0.5; }
.cable.empty { stroke-opacity: 0.2; }
.cable.fee { stroke: var(--spessartine); stroke-opacity: 0.7; }
.cable.minted { stroke: var(--diamond); stroke-opacity: 0.75; }
.cable.is-hot { stroke-opacity: 0.95; }
.junction {
	position: absolute;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 7px 10px;
	border-radius: 10px;
	background: linear-gradient(180deg, #1d2330, #12161f);
	border: 1px solid var(--hair-3);
	box-shadow: 0 0 0 4px var(--rack), 0 8px 24px rgba(0, 0, 0, 0.5);
	text-align: center;
	white-space: nowrap;
}
.junction .led { margin-bottom: 2px; }
.junction-k { font-size: 0.56rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.junction-v { font: 600 0.74rem var(--mono); color: var(--ink); }
.bus-note { position: absolute; left: 50%; transform: translateX(-50%); font: 0.62rem var(--mono); color: var(--ink-3); white-space: nowrap; background: var(--rack); padding: 0 6px; }
.patch-single .ports { grid-column: 1 / -1; }

/* ---------- address vault ---------- */

.tray {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 12px;
	padding: 18px;
	border-radius: 10px;
	background: radial-gradient(ellipse at 50% 0%, rgba(40, 48, 66, 0.5), transparent 70%), #07090d;
	box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.6);
	margin: 0 16px 16px;
}
.stone {
	--d: 16px;
	width: var(--d);
	height: var(--d);
	border-radius: 50%;
	display: block;
	background:
		conic-gradient(from 22.5deg, rgba(255, 255, 255, 0.55), rgba(120, 140, 170, 0.2), rgba(255, 255, 255, 0.45), rgba(90, 110, 140, 0.25), rgba(255, 255, 255, 0.6), rgba(120, 140, 170, 0.2), rgba(255, 255, 255, 0.4), rgba(90, 110, 140, 0.3), rgba(255, 255, 255, 0.55)),
		radial-gradient(circle at 38% 32%, #ffffff, #b9c6d6 45%, #5e6f86 100%);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
	transition: transform 0.15s;
}
.stone:hover { transform: scale(1.18); box-shadow: 0 0 14px rgba(243, 247, 252, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.5); }

.hero-amount { font: 650 clamp(1.8rem, 1.2rem + 2vw, 2.6rem) / 1.1 var(--sans); letter-spacing: -0.02em; color: var(--diamond); overflow-wrap: anywhere; }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; min-width: 0; }
.field span { font-size: 0.6rem; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.input, .track-form input, .pg-form input {
	width: 100%;
	background: #07090d;
	border: 1px solid var(--hair-2);
	border-radius: 9px;
	padding: 10px 12px;
	color: var(--ink);
	font: 0.86rem var(--mono);
	transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .track-form input:focus, .pg-form input:focus { outline: none; border-color: rgba(80, 135, 238, 0.65); box-shadow: 0 0 0 3px rgba(80, 135, 238, 0.15); }
.input::placeholder, .track-form input::placeholder, .pg-form input::placeholder { color: #5f6a7b; }

.btn, .track-form button, .pg-form button {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 18px;
	border: 0;
	border-radius: 9px;
	background: linear-gradient(180deg, #ffffff, #cfd9e6);
	color: #0a0d13;
	font: 650 0.84rem var(--sans);
	cursor: pointer;
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 6px 18px -8px rgba(160, 190, 240, 0.5);
}
.btn:hover, .track-form button:hover, .pg-form button:hover { color: #0a0d13; background: linear-gradient(180deg, #ffffff, #e4ebf3); }
.btn-ghost { background: var(--rack); color: var(--ink); border: 1px solid var(--hair-2); box-shadow: none; }
.btn-ghost:hover { color: var(--diamond); background: var(--rack-2); }

.track-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

/* ---------- telemetry ---------- */

.controls {
	position: sticky;
	top: var(--head-h);
	z-index: 20;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin: 0 calc(var(--gutter) * -1) 8px;
	padding: 10px var(--gutter);
	background: linear-gradient(180deg, rgba(5, 6, 10, 0.92), rgba(5, 6, 10, 0.78));
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--hair);
}
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--hair-2); border-radius: 11px; background: var(--rack); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg a { flex: none; padding: 6px 12px; border-radius: 8px; color: var(--ink-3); font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.seg a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.seg a[aria-current="true"] { color: #0a0d13; background: linear-gradient(180deg, #ffffff, #cfd9e6); }
.coverage { font: 0.72rem var(--mono); color: var(--ink-3); }
.zone-chips { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.zone-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 8px; border-radius: 999px; border: 1px solid var(--hair); background: var(--rack); color: var(--ink-2); font-size: 0.76rem; font-weight: 550; }
.zone-chip:hover { color: var(--diamond); border-color: var(--hair-3); }
.zone-chip .habit { width: 15px; height: 15px; }

.zone { margin: 30px 0 38px; scroll-margin-top: calc(var(--head-h) + 120px); }
.zone-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 16px; align-items: center; padding: 0 0 14px; margin-bottom: 16px; border-bottom: 1px solid var(--hair); }
.zone-head > .habit { grid-row: span 2; width: 44px; height: 44px; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--gem) 35%, transparent)); }
.zone-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.zone-title h2 { font-family: var(--display); font-weight: 500; font-size: 1.6rem; color: var(--diamond); }
.zone-code { font: 600 0.64rem var(--mono); letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase; }
.zone-desc { margin: 2px 0 0; max-width: 780px; font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(480px, 100%), 1fr)); gap: 14px; }
.chart-card {
	position: relative;
	margin: 0;
	padding: 14px 16px 10px;
	min-width: 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 90px), var(--rack);
	border: 1px solid var(--hair);
	border-radius: var(--r-lg);
}
.chart-card::before { content: ""; position: absolute; left: 16px; top: -1px; width: 34px; height: 2px; border-radius: 0 0 2px 2px; background: var(--gem, var(--platinum)); }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.chart-title { font-size: 0.72rem; font-weight: 620; color: var(--ink-2); letter-spacing: 0.01em; padding-top: 3px; }
.chart-readout { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; }
.chart-now { font-size: 1.18rem; font-weight: 650; color: var(--ink); line-height: 1.15; }
.chart-range { font: 0.62rem var(--mono); color: var(--ink-3); margin-top: 2px; white-space: nowrap; }
.chart-card.is-empty .chart-now { color: var(--ink-3); }

/* The charts are drawn in a 520x210 viewBox with preserveAspectRatio="none", so the rendered
   box must keep that same aspect or the drawing is stretched — which distorts the axis labels
   horizontally and, at narrow widths, makes them unreadable. Fixing the aspect ratio makes the
   "stretch" an identity transform at every width. */
svg.lchart { width: 100%; height: auto; aspect-ratio: 520 / 210; display: block; overflow: visible; }
.lchart .ln { stroke: var(--gem, var(--platinum)); }
.lchart .ar { fill: var(--gem, var(--platinum)); opacity: 0.1; }
.lchart .end { fill: var(--gem, var(--platinum)); stroke: var(--rack); }
.lchart .xh-line { stroke: rgba(236, 240, 246, 0.3); }
.lchart .xh-dot { fill: var(--gem, var(--platinum)); stroke: var(--rack); }
.chart-empty-lg {
	aspect-ratio: 520 / 210;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 20px;
	text-align: center;
	color: var(--ink-3);
	font-size: 0.8rem;
	font-style: italic;
	border-radius: 8px;
	background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, 0.012) 10px 20px);
}
.chart-tip, .tip-float {
	position: absolute;
	z-index: 30;
	transform: translateX(-50%);
	background: rgba(8, 10, 15, 0.96);
	border: 1px solid var(--hair-3);
	border-radius: 7px;
	padding: 6px 10px;
	pointer-events: none;
	white-space: nowrap;
	font-family: var(--mono);
	line-height: 1.35;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}
.tip-float { position: fixed; transform: translate(-50%, calc(-100% - 12px)); font-size: 0.72rem; color: var(--ink); }
.chart-tip .tv { display: block; font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.chart-tip .tt { display: block; font-size: 0.66rem; color: var(--ink-3); }

.notes { margin-top: 28px; border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--rack); }
.notes summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 16px; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.notes summary::-webkit-details-marker { display: none; }
.notes summary::after { content: "+"; margin-left: auto; font: 400 1rem var(--mono); color: var(--ink-3); }
.notes[open] summary::after { content: "−"; }
.notes-body { padding: 0 16px 14px; font-size: 0.82rem; color: var(--ink-2); max-width: 860px; }
.notes-body p { margin: 0 0 10px; }

/* ---------- lab ---------- */

.lab { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(520px, 100%), 1fr)); gap: 16px; }

/* The lab's almost-hidden switch to the background alone (public/playground.js). */
.bg-only-row { margin: 36px 0 0; text-align: center; }
.bg-only-btn { padding: 6px 12px; border: 0; background: none; color: var(--ink-3); font-size: 0.8rem; line-height: 1; opacity: 0.22; cursor: pointer; transition: opacity 0.2s; }
.bg-only-btn:hover, .bg-only-btn:focus-visible { opacity: 1; }
html.bg-only, html.bg-only body { overflow: hidden; }
html.bg-only body > *:not(.lattice3d):not(.bg-exit) { visibility: hidden !important; }
html.bg-only.bg-idle, html.bg-only.bg-idle * { cursor: none; }
.bg-exit {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 300;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px;
	border: 1px solid var(--hair-2);
	border-radius: 999px;
	background: rgba(5, 6, 10, 0.72);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	font: 600 0.68rem var(--mono);
	color: var(--ink-3);
	transition: opacity 0.4s;
}
.bg-exit button { height: 28px; padding: 0 12px; border: 1px solid var(--hair-2); border-radius: 999px; background: var(--rack); color: var(--ink); font: inherit; cursor: pointer; }
.bg-exit button:hover { border-color: var(--hair-3); }
.bg-exit span { padding: 0 8px 0 2px; letter-spacing: 0.08em; }
html.bg-idle .bg-exit { opacity: 0; pointer-events: none; }
html.bg-idle .bg-exit:focus-within { opacity: 1; pointer-events: auto; } /* keyboard users keep their buttons */
.instrument { display: flex; flex-direction: column; }
.instrument .panel-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.instrument-blurb { margin: 0; font-size: 0.82rem; color: var(--ink-2); }
.pg-form { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-form input { flex: 1 1 220px; min-width: 0; }
.pg-out {
	position: relative;
	flex: 1;
	margin: 0;
	min-height: 92px;
	padding: 14px 16px;
	border-radius: 10px;
	background: #05070a;
	border: 1px solid var(--hair);
	box-shadow: inset 0 8px 24px rgba(0, 0, 0, 0.5);
	font: 0.78rem/1.65 var(--mono);
	color: var(--ink-2);
	white-space: pre-wrap;
	word-break: break-all;
	overflow-x: auto;
}
.pg-out::before { content: "readout"; position: absolute; right: 10px; top: 8px; font: 600 0.54rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: #4f5a6a; }
.pg-out.error { color: #ff9ab2; border-color: rgba(235, 74, 110, 0.4); }

/* ---------- fault ---------- */

.fault { max-width: 720px; margin: 40px auto; padding: 28px; }
.fault-code { display: inline-flex; align-items: center; gap: 10px; font: 650 0.66rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: #ff9ab2; margin-bottom: 12px; }
.fault-msg { margin: 14px 0 22px; padding: 12px 14px; border-radius: 9px; background: #05070a; border: 1px solid rgba(235, 74, 110, 0.3); font: 0.84rem/1.6 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.fault-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fault-actions form { display: flex; gap: 8px; flex: 1 1 280px; }

/* ---------- footer ---------- */

.plate { border-top: 1px solid var(--hair); background: rgba(5, 6, 10, 0.7); }
.plate-inner { max-width: var(--maxw); margin: 0 auto; padding: 18px var(--gutter) 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; font-size: 0.74rem; color: var(--ink-3); }
.plate-mark { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-family: var(--display); font-size: 0.9rem; }
.plate-spec { margin-left: auto; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.02em; }

/* ---------- motion ---------- */

@keyframes led-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes led-blink { 0% { opacity: 1; } 100% { opacity: 0.25; } }
@keyframes ink-flash { 0% { color: #ffffff; text-shadow: 0 0 18px rgba(200, 220, 255, 0.9); } 100% { text-shadow: 0 0 0 transparent; } }
@keyframes tip-flash { 0% { text-shadow: 0 0 44px rgba(220, 235, 255, 0.95), 0 0 12px rgba(255, 255, 255, 0.7); } 100% { text-shadow: 0 0 40px rgba(160, 190, 240, 0.18); } }
@keyframes unit-slot { 0% { opacity: 0; transform: translateY(-14px); max-height: 0; } 60% { max-height: var(--u); } 100% { opacity: 1; transform: none; max-height: var(--u); } }
@keyframes unit-unslot { to { opacity: 0; transform: translateY(10px); max-height: 0; padding: 0; } }
@keyframes specular { to { transform: translateX(100%); } }
@keyframes log-in { from { background: rgba(220, 227, 236, 0.08); } to { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
	.led.is-live, .unit-led.is-live, .led[data-state="fault"] { animation: none !important; }
	/* The equaliser stands still at a fixed shape; the progress line simply appears. */
	.radio[data-state="on"] .radio-eq i { animation: none !important; height: 7px; }
	.radio[data-state="on"] .radio-eq i:nth-child(odd) { height: 10px; }
	.nav-progress.is-on { animation: none !important; transform: scaleX(0.6); }
}

/* ---------- responsive ---------- */

@media (max-width: 1240px) {
	.halls .hall { padding: 8px 8px; }
	.hall-code { display: none; }
	.brand-sub { display: none; }
}

@media (max-width: 1120px) {
	.rail { gap: 18px; }
	.rail-host { display: none !important; }
	/* stretch, not the grid's start: the rack frame is a size container and has no content width of its own */
	.floor { display: flex; flex-direction: column; align-items: stretch; }
	.floor-col { display: contents; }
	/* Stacked in the order of the panel codes: block intervals directly above the rack. */
	.floor .tip { order: 1; }
	.floor .cadence { order: 2; }
	.floor .rack { order: 3; }
	.floor .modules { order: 4; }
	.floor .host { order: 5; }
	.floor .log { order: 6; }
}

@media (max-width: 900px) {
	:root { --head-h: 0px; }
	.facility { position: relative; }
	.facility-bar { flex-wrap: wrap; gap: 10px 14px; padding-top: 12px; padding-bottom: 10px; }
	.brand-sub { display: inline; }
	.unit-switch { margin-left: auto; }
	.loupe { order: 3; flex: 1 1 100%; max-width: none; margin-left: 0; }
	.halls { order: 4; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 calc(var(--gutter) - 8px); }
	.halls::-webkit-scrollbar { display: none; }
	.hall-code { display: inline; }
	.hall[aria-current="page"]::after { bottom: 0; }
	.loupe-kbd { display: none; }
	.controls { position: static; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
	.zone-chips { margin-left: 0; }
	.patch { grid-template-columns: minmax(0, 1fr); }
	.patch .bus { display: none; }
	.ports.in .port { flex-direction: row; text-align: left; padding-right: 16px; }
	.ports.out .port { padding-left: 16px; }
	/* Stacked, the lists no longer centre against each other, so drop the alignment offset. */
	.patch .ports { padding-top: 0 !important; }
	.ports.out { border-top: 1px solid var(--hair); margin-top: 6px; }
	.port { height: auto; min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
	.plate-spec { margin-left: 0; }
}

@media (max-width: 680px) {
	body { font-size: 14px; }
	/* The radio shrinks to its equaliser, which moves while music plays; the title names the track. */
	.radio-label { display: none; }
	.radio-btn { padding: 0 9px; }
	/* Download likewise, to its arrow; its title still says what it fetches. A little less space between
	   the pills keeps it on the brand's row on a phone instead of alone on a row of its own. */
	.dl-label { display: none; }
	.dl-btn { width: 30px; padding: 0; justify-content: center; }
	.facility-bar { column-gap: 8px; }
	/* The deck panel spans the width under the header bar. (Not position: fixed — the header's
	   backdrop-filter makes it the containing block for fixed descendants.) */
	.facility-bar { position: relative; }
	.radio { position: static; }
	.radio-panel { top: calc(100% + 4px); left: var(--gutter); right: var(--gutter); width: auto; }
	.rail { gap: 16px; }
	.rail-host { display: none !important; }
	.tip-body { grid-template-columns: minmax(0, 1fr); }
	.coin-fig { margin-top: 4px; }
	.tip-foot { grid-template-columns: minmax(0, 1fr); }
	.readout { border-left: 0; border-top: 1px solid var(--hair); }
	.readout:first-child { border-top: 0; }
	.rack-frame { padding: 8px; }
	.panel-meta .opt { display: none; }
	.modules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	/* Nine modules in two columns: the last one spans the row instead of leaving a hole beside it. */
	.module:last-child:nth-child(odd) { grid-column: 1 / -1; }
	.module { padding: 12px; }
	.module-sub { display: none; }
	.host-spark { width: 90px; }
	.log-lines li { grid-template-columns: 58px minmax(0, 1fr); }
	.log-lines .log-tag { display: none; }
	.hash-list > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
	.specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.spec-v { font-size: 0.92rem; }
	.inscription { flex-wrap: wrap; gap: 8px 12px; }
	.inscription-v { flex-basis: 100%; order: 3; font-size: 0.78rem; }
	.copy { margin-left: auto; }
	.chart-head { flex-direction: column; gap: 4px; }
	.chart-readout { align-items: flex-start; text-align: left; }
	.zone-head > .habit { width: 34px; height: 34px; }
	.zone-title h2 { font-size: 1.35rem; }

	/* Tables become stacked cards; each cell names its column. */
	.ledger thead { display: none; }
	.ledger, .ledger tbody, .ledger tr, .ledger td { display: block; width: 100%; }
	.ledger tr { padding: 10px 14px; border-bottom: 1px solid var(--hair); }
	.ledger tbody tr:last-child { border-bottom: 0; }
	.ledger td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
	.ledger td::before { content: attr(data-label); font-size: 0.6rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); text-align: left; flex: none; padding-top: 2px; }
	.ledger td.idx { width: auto; }
	.ledger td.primary { display: block; text-align: left; padding-bottom: 6px; }
	.ledger td.primary::before { display: none; }
	.share-bar { width: 60px; }
	.lab { grid-template-columns: minmax(0, 1fr); }
	.pg-form { flex-direction: column; }
	.pg-form button { width: 100%; }
	.fault { padding: 20px; margin: 16px 0; }
}

@media (max-width: 420px) {
	/* No room for these beside the unit switch. The MC still has to be switchable, so the panel carries
	   its own control (.rp-mc) on every screen — hiding the only way to mute a voice is not a layout
	   decision, it is a trap. */
	.radio-next, .radio-mc { display: none !important; }
	.modules-grid { grid-template-columns: minmax(0, 1fr); }
	.module:last-child:nth-child(odd) { grid-column: auto; }
	.brand-sub { display: none; }
}

@media (forced-colors: active) {
	.led, .unit-led { forced-color-adjust: none; }
	.meter i, .share-bar i { background: CanvasText; }
}

/* ---------- the vault chat (public/chat.js) ----------
   A pill at the bottom right; the panel opens above it. Residents carry their gem as a dot; visitors
   are ink, so no hue is used without a gem behind it. */
.vchat { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.vchat[hidden] { display: none; }
.vchat > * { pointer-events: auto; }
.vchat-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 16px 0 13px;
	border: 1px solid var(--hair-2);
	border-radius: 999px;
	background: rgba(14, 17, 23, 0.92);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: var(--ink);
	font: 600 0.78rem var(--mono);
	letter-spacing: 0.04em;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	cursor: pointer;
	transition: border-color 0.15s, transform 0.15s;
}
.vchat-btn:hover { border-color: var(--hair-3); transform: translateY(-1px); }
.vchat-btn svg { width: 18px; height: 18px; color: var(--sapphire); }
.vchat.is-open .vchat-btn { border-color: color-mix(in srgb, var(--sapphire) 55%, transparent); }
.vchat-badge { position: absolute; top: 6px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--sapphire); box-shadow: 0 0 0 2px var(--rack), 0 0 10px var(--sapphire); }
.vchat-badge[hidden] { display: none; }
.vchat-panel {
	display: flex;
	flex-direction: column;
	width: min(380px, calc(100vw - 32px));
	height: min(560px, calc(100vh - 110px));
	border: 1px solid var(--hair-2);
	border-top: 2px solid color-mix(in srgb, var(--sapphire) 70%, transparent);
	border-radius: var(--r);
	background: rgb(12, 15, 21);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
	overflow: hidden;
}
.vchat-panel[hidden] { display: none; }
.vchat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 8px; }
.vchat-title { margin: 0; font: 600 1.05rem/1.2 var(--display); color: var(--ink); }
.vchat-sub { margin: 3px 0 0; font-size: 0.74rem; color: var(--ink-3); }
.vchat-close { flex: none; width: 30px; height: 30px; border: 1px solid var(--hair-2); border-radius: 50%; background: none; color: var(--ink-3); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.vchat-close:hover { color: var(--ink); border-color: var(--hair-3); }
.vchat-roster { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; border-bottom: 1px solid var(--hair); }
.vchat-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border: 1px solid var(--hair-2); border-radius: 999px; background: var(--rack); color: var(--ink-2); font: 600 0.66rem var(--mono); cursor: pointer; }
.vchat-chip:hover { color: var(--ink); border-color: var(--hair-3); }
.vchat-log { flex: 1; min-height: 0; margin: 0; padding: 10px 12px; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.vchat-msg { display: flex; gap: 9px; padding: 7px 4px; border-radius: var(--r-sm); }
.vchat-msg.is-mine { background: rgba(80, 135, 238, 0.07); }
.vchat-dot { flex: none; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--ink-3); }
.vchat-dot[data-gem="sapphire"] { background: var(--sapphire); }
.vchat-dot[data-gem="aquamarine"] { background: var(--aquamarine); }
.vchat-dot[data-gem="amethyst"] { background: var(--amethyst); }
.vchat-dot[data-gem="spessartine"] { background: var(--spessartine); }
.vchat-dot[data-gem="diamond"] { background: var(--platinum); }
.vchat-dot[data-gem="emerald"] { background: var(--emerald); }
/* The fly's words (public/chat.js spellMl): its machine language, and the English under it. */
.vchat-ml { margin: 0; font: 500 0.84rem var(--mono); color: var(--emerald); overflow-wrap: anywhere; }
.vchat-gloss { font-size: 0.76rem; color: var(--ink-3) !important; font-style: italic; }
.vchat-msg[data-kind="bot"] .vchat-dot { background: none; border: 1.5px solid var(--ink-3); }
.vchat-body { min-width: 0; }
.vchat-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 0 0 2px; font: 500 0.66rem var(--mono); color: var(--ink-3); }
.vchat-name { padding: 0; border: 0; background: none; color: var(--ink); font: 650 0.74rem var(--mono); cursor: pointer; }
.vchat-name:hover { text-decoration: underline; }
.vchat-tag { padding: 1px 6px; border: 1px solid var(--hair-2); border-radius: 999px; font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; }
.vchat-text { margin: 0; font-size: 0.84rem; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.vchat-msg[data-kind="resident"] .vchat-text { color: var(--ink); }
.vchat-form { padding: 10px 12px 12px; border-top: 1px solid var(--hair); }
.vchat-who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; font: 600 0.62rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.vchat-me { font: 650 0.78rem var(--mono); letter-spacing: 0; text-transform: none; color: var(--ink); }
.vchat-given { margin-left: auto; font-weight: 500; letter-spacing: 0.04em; text-transform: none; }
.vchat-say { display: flex; gap: 8px; }
.vchat-say input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--hair-2); border-radius: var(--r-sm); background: var(--rack); color: var(--ink); font-size: 0.86rem; }
.vchat-say input:focus { outline: 2px solid var(--sapphire); outline-offset: 1px; }
.vchat-send { height: 38px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--sapphire) 60%, transparent); border-radius: var(--r-sm); background: color-mix(in srgb, var(--sapphire) 18%, var(--rack)); color: var(--ink); font: 650 0.74rem var(--mono); cursor: pointer; }
.vchat-send:disabled { opacity: 0.5; cursor: default; }
.vchat-note { min-height: 1em; margin: 6px 0 0; font-size: 0.72rem; color: var(--citrine); }
.vchat-note:empty { display: none; }
@media (max-width: 680px) {
	.vchat { right: 12px; bottom: 12px; left: 12px; }
	.vchat-btn { padding: 0 13px; }
	.vchat-label { display: none; }
	.vchat-panel { width: 100%; height: min(72vh, calc(100vh - 90px)); }
}
@media (prefers-reduced-motion: reduce) { .vchat-btn { transition: none; } }
