/* ==========================================================================
   vBPS Fund — the fund floor
   Built on the BitcoinPoS Explorer's "node vault" system (bps-explorer-v2/public/style.css):
   same surfaces, ink, gem palette, panels, rack, rail and plate, so the two read as one family.

   Colour roles, as in the explorer (provenance of every hue: bps-explorer-v2/lib/gems.js):
     diamond      the neutral — the share class itself
     identity     one gem per balance, always beside its label:
                    spessartine  BTC leg      (garnet, dodecahedron)
                    sapphire     ETH leg      (corundum, barrel)
                    aquamarine   USDC reserve (beryl, prism)
                    amethyst     manager's segregated balance (quartz, point)
     status       emerald ok · citrine pending/warning · ruby fault — reserved, always labelled.
                  LONG / SHORT is a direction, not a health state, so it never borrows these.
   ========================================================================== */

:root {
	color-scheme: dark;

	--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, red → violet. Decoration only — never on a data mark. */
	--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: 52px; /* a holdings unit carries two lines, so it is a little taller than the explorer's 1U */
	--gutter: clamp(16px, 3vw, 32px);
	--maxw: 1380px;
}

.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); }

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

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; }

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: the explorer's diamond lattice seen down [110], under two soft pools of light. */
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("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='99' viewBox='0 0 70 99'%3E%3Cg stroke='%23cfd9e6' stroke-opacity='0.07' stroke-width='0.8' fill='none'%3E%3Cline x1='0' y1='0' x2='0' y2='24.75'/%3E%3Cline x1='70' y1='0' x2='70' y2='24.75'/%3E%3Cline x1='35' y1='49.5' x2='35' y2='74.25'/%3E%3Cline x1='0' y1='24.75' x2='35' y2='49.5'/%3E%3Cline x1='70' y1='24.75' x2='35' y2='49.5'/%3E%3Cline x1='35' y1='74.25' x2='0' y2='99'/%3E%3Cline x1='35' y1='74.25' x2='70' y2='99'/%3E%3C/g%3E%3Cg fill='%23dfe7f1' fill-opacity='0.11'%3E%3Ccircle cx='0' cy='0' r='1.7'/%3E%3Ccircle cx='0' cy='24.75' r='1.7'/%3E%3Ccircle cx='35' cy='49.5' r='1.7'/%3E%3Ccircle cx='35' cy='74.25' r='1.7'/%3E%3Ccircle cx='70' cy='0' r='1.7'/%3E%3Ccircle cx='70' cy='24.75' r='1.7'/%3E%3Ccircle cx='0' cy='99' r='1.7'/%3E%3Ccircle cx='70' cy='99' r='1.7'/%3E%3C/g%3E%3C/svg%3E") 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%);
}

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

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); }
.muted { color: var(--ink-3); }
.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-mark { width: 32px; height: 32px; filter: drop-shadow(0 2px 12px rgba(220, 227, 236, 0.25)); }
.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);
}

/* Where the explorer has its search loupe: what this page is (not) attached to. */
.contract-plate {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	height: 38px;
	padding: 0 14px 0 12px;
	background: var(--rack);
	border: 1px dashed var(--hair-3);
	border-radius: 11px;
	white-space: nowrap;
	cursor: help;
}
.contract-k { font-size: 0.6rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.contract-v { font: 500 0.8rem var(--mono); color: var(--ink-2); }

.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="usd"] [data-u="usd"],
.unit-switch[data-unit="bits"] [data-u="bits"],
.unit-switch:not([data-unit]) [data-u="usd"] { background: var(--bezel); color: var(--diamond); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }

/* The live status rail. */
.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-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; }
.led.is-busy[data-state="warn"] { animation: led-breathe 1.2s 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;
	color: var(--ink);
	border: 1px solid var(--hair-2);
	white-space: nowrap;
}
.state-tag[data-dir="SHORT"] { border-style: dashed; border-color: var(--hair-3); }
.state-tag[data-state="warn"] { border-style: solid; 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); }

/* ---------- 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);
}
.lede { max-width: 560px; margin: 0; color: var(--ink-2); font-size: 0.9rem; }

/* ---------- 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);
	scroll-margin-top: 110px;
}
.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-body { padding: 16px; }
.fine { margin: 0; padding: 12px 16px 14px; font-size: 0.74rem; color: var(--ink-3); border-top: 1px solid var(--hair); }

.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; }

/* ---------- 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; }

/* A1 — NAV, in the explorer's chain-tip style */
.nav-body { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.tip-height {
	font: 650 clamp(2.4rem, 1.6rem + 3vw, 3.7rem) / 1 var(--sans);
	letter-spacing: -0.025em;
	color: var(--diamond);
	text-shadow: 0 0 40px rgba(160, 190, 240, 0.18);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}
.tip-height .unit { color: var(--ink-3); font-weight: 300; margin-right: 4px; }
.tip-height .unit-after { color: var(--ink-3); font-weight: 300; font-size: 0.42em; margin-left: 8px; letter-spacing: 0; }
.tip-height.flash { animation: tip-flash 1.8s ease-out; }
.tip-sub { margin: 10px 0 0; color: var(--ink-2); font-size: 0.86rem; }

/* Composition: one bar, one gem per balance, labels beside — never colour alone. */
.mix-bar { display: flex; height: 10px; gap: 2px; border-radius: 6px; overflow: hidden; background: rgba(220, 227, 236, 0.06); }
.mix-bar i { display: block; height: 100%; background: var(--gem); min-width: 2px; transition: flex-grow 0.6s ease; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 9px; font-size: 0.74rem; color: var(--ink-2); }
.mix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mix-legend .habit { width: 13px; height: 13px; }
.mix-legend .habit .edge { stroke-width: 1.6; }
.mix-legend b { font: 600 0.74rem var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.mix-empty { padding: 10px 12px; border-radius: 8px; font-size: 0.78rem; font-style: italic; color: var(--ink-3); background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, 0.015) 10px 20px); border: 1px dashed var(--hair-2); }

.nav-spark-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.nav-spark-range { font: 0.62rem var(--mono); color: var(--ink-3); white-space: nowrap; }
.sparkline { width: 100%; height: 42px; display: block; overflow: visible; }
.sparkline .spark-ln { fill: none; 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; }
.spark-empty { height: 42px; line-height: 42px; font-size: 0.7rem; font-style: italic; color: var(--ink-3); }

.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; font-variant-numeric: tabular-nums; }
.readout-s { margin-top: 4px; font-size: 0.72rem; color: var(--ink-3); overflow-wrap: anywhere; }
.readout.flash .readout-v { animation: ink-flash 1.6s ease-out; }

.meter { position: relative; height: 5px; margin-top: 9px; border-radius: 5px; background: rgba(220, 227, 236, 0.1); }
.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); }

/* A2 — holdings rack, the explorer's 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);
}
.rack-units::before {
	content: "";
	position: absolute;
	left: 8px;
	top: 6px;
	bottom: 6px;
	width: 6px;
	background: repeating-linear-gradient(180deg, transparent 0 9px, rgba(196, 210, 232, 0.13) 9px 14px, transparent 14px 37px, rgba(196, 210, 232, 0.13) 37px 42px, transparent 42px var(--u));
	border-radius: 1px;
}
.unit { height: var(--u); padding: 2px 0; }
.unit-face {
	position: relative;
	height: 100%;
	display: grid;
	grid-template-columns: 24px 8px minmax(124px, 1.5fr) 96px minmax(96px, 1.1fr) minmax(92px, 1fr) 64px;
	align-items: center;
	gap: 10px;
	padding: 0 14px 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;
}
.unit-face:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.16); background: linear-gradient(180deg, #222836 0%, #1a1f2b 100%); }
.unit.is-segregated .unit-face { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0 6px, transparent 6px 12px), linear-gradient(180deg, #161a24, #10131b); border-style: dashed; border-color: rgba(176, 112, 220, 0.28); }
.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[data-state="ok"] { background: var(--emerald); box-shadow: 0 0 8px rgba(45, 180, 126, 0.85); animation: led-breathe 2.6s ease-in-out infinite; }
.unit-led[data-state="warn"] { background: var(--citrine); box-shadow: 0 0 8px rgba(216, 163, 40, 0.85); animation: led-breathe 1.2s ease-in-out infinite; }
.unit-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.unit-id .habit { width: 20px; height: 20px; }
.unit-name { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.unit-h { font: 620 0.82rem var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-sub { font: 0.62rem var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-dir { justify-self: start; }
.unit-col { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.unit-k { font-size: 0.54rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.unit-num { font: 0.72rem var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-val { text-align: right; }
.unit-val .unit-num { color: var(--ink); font-weight: 600; font-size: 0.78rem; }
.unit-w { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.unit-w .unit-num { text-align: right; }
.unit-w .bar { height: 4px; border-radius: 2px; background: rgba(220, 227, 236, 0.09); overflow: hidden; }
.unit-w .bar i { display: block; height: 100%; border-radius: 2px; background: var(--gem, var(--platinum)); opacity: 0.9; transition: width 0.6s ease; }
.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 .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 ease-out forwards;
}

@container (max-width: 620px) {
	.unit-face { grid-template-columns: 22px 8px minmax(110px, 1.4fr) 88px minmax(84px, 1fr) 58px; gap: 8px; }
	.unit-hedge { display: none; }
}
@container (max-width: 440px) {
	.rack-units { padding-left: 6px; background: #06080c; }
	.rack-units::before { display: none; }
	/* Tag and value size to their content; the name gives way first. */
	.unit-face { grid-template-columns: 8px minmax(0, 1fr) auto auto; gap: 8px; padding-left: 10px; }
	.unit-u, .unit-w { display: none; }
}

/* A4 — keeper */
.keeper { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.keeper-leg { padding: 14px 16px 16px; min-width: 0; box-shadow: 1px 0 0 var(--hair); }
.keeper-leg:last-child { box-shadow: none; }
.keeper-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.keeper-head .habit { width: 20px; height: 20px; }
.keeper-name { font-weight: 620; font-size: 0.88rem; color: var(--ink); }
.keeper-head .state-tag { margin-left: auto; }
.pair { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--hair); }
.pair-k { font: 600 0.74rem var(--mono); color: var(--ink-2); }
.keeper-proc { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-bottom: 1px solid var(--hair); }
.keeper-proc-note { flex-basis: 100%; font-size: 0.68rem; color: var(--ink-3); }
.verdict { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: #07090d; border: 1px solid var(--hair); font-size: 0.76rem; color: var(--ink-2); }
.verdict b { color: var(--ink); font-weight: 650; }

/* ---------- segmented controls (the explorer's .seg, as buttons) ---------- */

.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--hair-2); border-radius: 11px; background: var(--rack); max-width: 100%; }
.seg button {
	flex: none;
	padding: 6px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ink-3);
	font-size: 0.78rem;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}
.seg button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.seg button[aria-selected="true"], .seg button[aria-checked="true"], .seg button[aria-pressed="true"] { color: #0a0d13; background: linear-gradient(180deg, #ffffff, #cfd9e6); }
.seg button:disabled { cursor: not-allowed; opacity: 0.45; }
.seg-wide { display: flex; }
.seg-wide button { flex: 1; padding: 8px 12px; font-size: 0.84rem; }
.seg-sm button { padding: 4px 9px; font-size: 0.7rem; }

/* ---------- A3 — desk ---------- */

.desk-body { display: flex; flex-direction: column; gap: 14px; }
.desk-pane { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: 0.6rem; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.amount { position: relative; display: flex; }
.input {
	width: 100%;
	background: #07090d;
	border: 1px solid var(--hair-2);
	border-radius: 9px;
	padding: 11px 64px 11px 12px;
	color: var(--ink);
	font: 500 1.05rem var(--mono);
	font-variant-numeric: tabular-nums;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.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 { color: #5f6a7b; }
.input[aria-invalid="true"] { border-color: rgba(235, 74, 110, 0.55); }
.amount-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 0.72rem var(--mono); color: var(--ink-3); pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -6px; }
.chips button { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--rack-2); color: var(--ink-2); font: 600 0.7rem var(--mono); cursor: pointer; }
.chips button:hover { color: var(--diamond); border-color: var(--hair-3); }
.chips-note { margin-left: auto; font: 0.68rem var(--mono); color: var(--ink-3); }

/* Quote: the explorer's hash-list, as a receipt. */
.quote { margin: 0; padding: 4px 0; border: 1px solid var(--hair); border-radius: var(--r); background: #090b10; }
.quote > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: baseline; padding: 8px 14px; }
.quote > div + div { border-top: 1px solid var(--hair); }
.quote dt { font-size: 0.74rem; color: var(--ink-3); }
.quote dd { margin: 0; font: 0.8rem var(--mono); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.quote .q-sub { grid-column: 1 / -1; font-size: 0.66rem; color: var(--ink-3); margin-top: -2px; }
.quote .q-leg dt { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.quote .q-leg .habit { width: 14px; height: 14px; }
.quote .q-leg .habit .edge { stroke-width: 1.6; }
.quote .q-total { background: linear-gradient(90deg, rgba(220, 227, 236, 0.045), transparent 70%); }
.quote .q-total dt { color: var(--ink); font-weight: 600; }
.quote .q-total dd { font-size: 0.98rem; font-weight: 650; color: var(--diamond); }
.route { display: inline-block; font: 650 0.54rem var(--sans); letter-spacing: 0.1em; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--hair-2); color: var(--ink-3); margin-left: 4px; vertical-align: 1px; }
.route[data-state="warn"] { color: #f0cd78; border-color: rgba(216, 163, 40, 0.45); }

.basket { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.78rem; }
.basket th { text-align: right; font-size: 0.56rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding: 8px 14px 6px; border-bottom: 1px solid var(--hair-2); white-space: nowrap; }
.basket th:first-child { text-align: left; }
.basket td { padding: 8px 14px; border-bottom: 1px solid var(--hair); color: var(--ink-2); font-family: var(--mono); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.basket td:first-child { text-align: left; font-family: var(--sans); color: var(--ink); }
.basket td .cell { display: inline-flex; align-items: center; gap: 7px; }
.basket td .habit { width: 14px; height: 14px; }
.basket td .habit .edge { stroke-width: 1.6; }
.basket tr:last-child td { border-bottom: 0; }
.basket .sub { display: block; font: 0.62rem var(--sans); color: var(--ink-3); margin-top: 2px; white-space: normal; }
.basket-wrap { overflow-x: auto; border: 1px solid var(--hair); border-radius: var(--r); background: #090b10; }

.notice-inline { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; font-size: 0.76rem; line-height: 1.45; color: var(--ink-2); border: 1px solid var(--hair-2); background: var(--rack); }
.notice-inline .led { margin-top: 5px; }
.notice-inline[data-tone="warn"] { border-color: rgba(216, 163, 40, 0.4); background: linear-gradient(90deg, rgba(216, 163, 40, 0.08), transparent 70%), var(--rack); }
.notice-inline[data-tone="fault"] { border-color: rgba(235, 74, 110, 0.45); background: linear-gradient(90deg, rgba(235, 74, 110, 0.09), transparent 70%), var(--rack); }
.notice-inline p { margin: 0; }
.notice-inline p + p { margin-top: 4px; }

.btn {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 42px;
	padding: 0 18px;
	border: 0;
	border-radius: 9px;
	background: linear-gradient(180deg, #ffffff, #cfd9e6);
	color: #0a0d13;
	font: 650 0.86rem 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 { background: linear-gradient(180deg, #ffffff, #e4ebf3); }
.btn:disabled { cursor: not-allowed; background: var(--rack-2); color: var(--ink-3); box-shadow: none; border: 1px solid var(--hair-2); }
.btn-block { width: 100%; }
.btn-ghost { background: var(--rack); color: var(--ink); border: 1px solid var(--hair-2); box-shadow: none; height: 36px; font-size: 0.8rem; }
.btn-ghost:hover { color: var(--diamond); background: var(--rack-2); }

/* Two-phase work in flight: initiate → HyperCore → confirm. */
.pending-card { border: 1px solid rgba(216, 163, 40, 0.35); border-radius: var(--r); background: linear-gradient(90deg, rgba(216, 163, 40, 0.06), transparent 70%), #090b10; padding: 12px 14px; }
.pending-card + .pending-card { margin-top: 10px; }
.pending-title { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 620; color: var(--ink); margin-bottom: 10px; }
.pending-title .mono { margin-left: auto; font-size: 0.66rem; font-weight: 500; color: var(--ink-3); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.steps li { display: flex; align-items: center; gap: 9px; font-size: 0.74rem; color: var(--ink-3); }
.steps li[data-s="done"] { color: var(--ink-2); }
.steps li[data-s="active"] { color: var(--ink); }
.pending-card.is-stuck { border-color: rgba(235, 74, 110, 0.4); background: linear-gradient(90deg, rgba(235, 74, 110, 0.06), transparent 70%), #090b10; }
.pending-wait { margin: 10px 0 0; font: 0.68rem var(--mono); color: var(--ink-3); }
.pending-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pending-actions .btn { height: 32px; font-size: 0.74rem; padding: 0 12px; }

/* fee window: fund-wide flow the next action is priced against */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; padding: 9px 12px; border: 1px solid var(--hair); border-radius: var(--r); background: #090b10; }
.flow:empty { display: none; }
.flow-k { font-size: 0.6rem; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); cursor: help; }
.flow-v { font: 0.72rem var(--mono); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.flow .meter { grid-column: 1 / -1; margin-top: 6px; }

/* A5 — position (the explorer's spec grid) */
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spec { padding: 14px 16px; min-width: 0; box-shadow: 1px 0 0 var(--hair), 0 1px 0 var(--hair); }
.specs-flat { overflow: hidden; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.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; font-variant-numeric: tabular-nums; }
.spec-s { display: block; margin-top: 3px; font-size: 0.72rem; color: var(--ink-3); overflow-wrap: anywhere; }

/* Manager rows: the explorer's host rows */
.host-rows { list-style: none; margin: 0; padding: 4px 0; }
.host-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--hair); }
.host-row:last-child { border-bottom: 0; }
.host-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.host-label .habit { width: 14px; height: 14px; }
.host-label .habit .edge { stroke-width: 1.6; }
.host-value { font: 600 0.86rem var(--mono); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.host-value small { display: block; font-size: 0.66rem; font-weight: 400; color: var(--ink-3); }
.host-row.is-total .host-label { color: var(--ink); }
.mgr-foot { padding-top: 4px; }
.mgr-foot .btn { width: 100%; }

/* A7 — commissioning */
.checklist { list-style: none; margin: 0; padding: 6px 0; counter-reset: c; }
.checklist li { counter-increment: c; display: grid; grid-template-columns: 22px 10px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 16px; font-size: 0.78rem; color: var(--ink-2); }
.checklist li::before { content: counter(c, decimal-leading-zero); font: 500 0.62rem var(--mono); color: var(--ink-3); }
.checklist li + li { border-top: 1px solid var(--hair); }
.checklist .led { position: relative; top: -1px; }

/* A6 — fund log (the explorer's floor log) */
.log-lines { list-style: none; margin: 0; padding: 8px 0; max-height: 280px; overflow-y: auto; font: 0.74rem/1.5 var(--mono); }
.log-lines li { display: grid; grid-template-columns: 64px 70px minmax(0, 1fr); gap: 10px; padding: 5px 16px; color: var(--ink-2); }
.log-lines li.is-new { animation: log-in 0.8s 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="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-tag[data-tone="plain"] { color: var(--diamond); border-color: rgba(220, 227, 236, 0.35); }
.log-lines li.log-empty { display: block; padding: 14px 16px; color: var(--ink-3); font-style: italic; font-family: var(--sans); }

/* ---------- 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[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); }

/* ---------- 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-reset { border: 1px solid var(--hair-2); background: transparent; color: var(--ink-3); border-radius: 6px; padding: 2px 9px; font: 600 0.66rem var(--mono); cursor: pointer; }
.plate-reset:hover { color: #ff9ab2; border-color: rgba(235, 74, 110, 0.45); }
.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 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, .led.is-busy, .unit-led, .led[data-state="fault"] { animation: none !important; }
}

/* ---------- 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; }
	/* stretch, not 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; }
	/* The catch-all first: it has the same specificity as the named panels and must not override them. */
	.floor .panel { order: 5; }
	.floor .tip { order: 1; }
	.floor .desk { order: 2; }
	.floor .rack { order: 3; }
	.floor #keeper { order: 4; }
	.floor .log { order: 6; }
}

@media (max-width: 900px) {
	html { scroll-padding-top: 16px; }
	.panel { scroll-margin-top: 16px; }
	.facility { position: relative; }
	.facility-bar { flex-wrap: wrap; gap: 10px 14px; padding-top: 12px; padding-bottom: 10px; }
	.brand-sub { display: inline; }
	.contract-plate { order: 3; flex: 1 1 100%; justify-content: flex-start; margin-left: 0; }
	.unit-switch { margin-left: auto; }
	.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; }
	.plate-spec { margin-left: 0; }
}

@media (max-width: 680px) {
	body { font-size: 14px; }
	.rail { gap: 16px; }
	.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; }
	.keeper { grid-template-columns: minmax(0, 1fr); }
	.keeper-leg { box-shadow: 0 1px 0 var(--hair); }
	.log-lines li { grid-template-columns: 58px minmax(0, 1fr); }
	.log-lines .log-tag { display: none; }
	.nav-body { padding: 16px; }
}

@media (max-width: 420px) {
	.brand-sub { display: none; }
	.specs { grid-template-columns: minmax(0, 1fr); }
	.chips-note { flex-basis: 100%; margin-left: 0; }
}

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

.notice a, .notice-inline a { color: var(--diamond); text-decoration: underline; text-underline-offset: 2px; }
