:root {
    color-scheme: dark;
    --bg: #020705;
    --panel: rgba(4, 17, 12, 0.84);
    --line: rgba(99, 255, 177, 0.18);
    --line-hot: rgba(107, 255, 184, 0.58);
    --green: #78ffb2;
    --green-hot: #b9ffd5;
    --cyan: #68e8ff;
    --amber: #ffcc6b;
    --muted: #789287;
    --text: #d8eee4;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
    --sans: "Inter", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body {
    color: var(--text);
    font-family: var(--mono);
    overflow-x: hidden;
    background:
        radial-gradient(circle at 48% 32%, rgba(38, 145, 91, .12), transparent 38rem),
        linear-gradient(180deg, #020806 0%, #010403 100%);
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: 2px solid var(--green-hot); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 9px 14px; color: #001a0e; background: var(--green); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.rain { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .24; overflow: hidden; }
.rain span { position: absolute; top: -24vh; color: rgba(114,255,175,.5); font-size: 10px; line-height: 1; writing-mode: vertical-rl; text-shadow: 0 0 8px currentColor; animation: rain-fall linear infinite; }
@keyframes rain-fall { to { transform: translateY(135vh); } }

.be-header {
    position: fixed; inset: 0 0 auto; z-index: 50; height: 62px; padding: 0 22px;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    border-bottom: 1px solid var(--line); background: rgba(1, 7, 4, .86); backdrop-filter: blur(18px);
}
.be-brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; letter-spacing: .12em; font-size: 13px; }
.be-brand img { width: 31px; filter: drop-shadow(0 0 8px rgba(105,255,175,.32)); }
.be-brand b { color: var(--green); }
.network-health { display: flex; align-items: center; gap: 9px; font-size: 10px; letter-spacing: .11em; color: #a3c0b2; }
.network-health i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 1.8s ease-in-out infinite; }
.network-health em { padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-style: normal; }
@keyframes pulse { 50% { opacity: .35; } }
.be-actions { justify-self: end; display: flex; gap: 20px; color: #91aa9d; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.be-actions a:hover, .be-actions a:focus-visible { color: var(--green-hot); }

.be-main { position: relative; z-index: 1; min-height: 100vh; padding: 62px 0 0; }
.viewport { position: relative; isolation: isolate; height: calc(100vh - 242px); min-height: 480px; overflow: hidden; border-bottom: 1px solid var(--line); background: #010805; }
.viewport::before { content: ""; position: absolute; z-index: 0; inset: 0; pointer-events: none; opacity: .18; background-image: linear-gradient(rgba(88,255,160,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(88,255,160,.045) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 72%, transparent); }
.viewport::after { content: ""; position: absolute; z-index: 3; inset: 10px; pointer-events: none; opacity: .42; background: linear-gradient(var(--green),var(--green)) left top/22px 1px no-repeat, linear-gradient(var(--green),var(--green)) left top/1px 22px no-repeat, linear-gradient(var(--green),var(--green)) right top/22px 1px no-repeat, linear-gradient(var(--green),var(--green)) right top/1px 22px no-repeat, linear-gradient(var(--green),var(--green)) left bottom/22px 1px no-repeat, linear-gradient(var(--green),var(--green)) left bottom/1px 22px no-repeat, linear-gradient(var(--green),var(--green)) right bottom/22px 1px no-repeat, linear-gradient(var(--green),var(--green)) right bottom/1px 22px no-repeat; }
.matrix-boot { position: absolute; z-index: 12; inset: 0; display: flex; flex-direction: column; justify-content: center; padding-left: max(8vw, 32px); color: rgba(120,255,178,.7); background: #010805; font-size: 9px; line-height: 2; letter-spacing: .15em; pointer-events: none; animation: boot-exit 2.1s both; }
.matrix-boot span { opacity: 0; animation: boot-line .18s steps(2,end) forwards; }
.matrix-boot span:nth-child(2) { animation-delay: .18s; }.matrix-boot span:nth-child(3) { animation-delay: .36s; }.matrix-boot span:nth-child(4) { animation-delay: .54s; }
.matrix-boot strong { margin-top: 14px; color: var(--green-hot); font-size: clamp(18px,3vw,38px); font-weight: 500; letter-spacing: .06em; opacity: 0; text-shadow: 0 0 24px rgba(120,255,178,.55); animation: boot-line .25s .78s forwards; }
@keyframes boot-line { to { opacity: 1; } }
@keyframes boot-exit { 0%,65% { opacity: 1; } 88% { opacity: .15; filter: brightness(2); } 100% { opacity: 0; visibility: hidden; } }
#matrixGpu, #matrixCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#matrixGpu { z-index: 0; opacity: .88; }
#matrixCanvas { z-index: 1; cursor: crosshair; touch-action: manipulation; }
#matrixCanvas.dragging { cursor: grabbing; }
.low-gpu #matrixGpu { display: none; }
.mode-sigil { position: absolute; z-index: 2; right: clamp(18px,4vw,64px); top: 50%; display: grid; justify-items: end; pointer-events: none; transform: translateY(-50%); opacity: .075; color: var(--green); text-align: right; transition: color .5s, opacity .5s; }
.mode-sigil span { font: 600 clamp(34px,7.5vw,108px)/.8 var(--sans); letter-spacing: -.07em; writing-mode: vertical-rl; text-orientation: mixed; }
.mode-sigil i { margin-top: 15px; font: normal 8px var(--mono); letter-spacing: .22em; writing-mode: vertical-rl; }
.scene-alert { position: absolute; z-index: 9; top: 92px; left: 50%; width: min(430px,calc(100vw - 36px)); padding: 11px 14px 11px 30px; border: 1px solid rgba(255,99,120,.55); color: #ff93a3; background: linear-gradient(90deg,rgba(44,4,12,.94),rgba(5,12,9,.88)); box-shadow: 0 0 45px rgba(255,30,75,.16); transform: translateX(-50%); animation: alert-arrive .34s steps(3,end); }
.scene-alert i { position: absolute; left: 12px; top: 13px; width: 7px; height: 7px; background: currentColor; box-shadow: 0 0 13px currentColor; animation: alert-blink .65s steps(1,end) infinite; }
.scene-alert span { display: block; font-size: 7px; letter-spacing: .2em; }
.scene-alert strong { display: block; margin-top: 4px; color: #ffdce2; font-size: 10px; letter-spacing: .08em; }
.scene-alert em { display: block; margin-top: 3px; color: #b77b84; font: normal 9px var(--sans); }
.scene-alert[data-kind="recover"], .scene-alert[data-kind="proof"] { border-color: rgba(104,232,255,.5); color: var(--cyan); background: linear-gradient(90deg,rgba(3,29,34,.94),rgba(5,12,9,.88)); box-shadow: 0 0 45px rgba(35,214,255,.13); }
.scene-alert[data-kind="proof"] { border-color: rgba(185,255,213,.7); color: var(--green-hot); }
.scene-alert[data-kind="recover"] strong, .scene-alert[data-kind="proof"] strong { color: #e0fff7; }
.scene-alert[data-kind="recover"] em, .scene-alert[data-kind="proof"] em { color: #79a99c; }
@keyframes alert-arrive { from { opacity: 0; transform: translate(-50%,-10px) scaleX(.84); filter: blur(4px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes alert-blink { 50% { opacity: .18; } }
body[data-matrix-mode="chain"] .mode-sigil { color: #caff36; opacity: .028; }
body[data-matrix-mode="ai"] .mode-sigil { color: var(--cyan); opacity: .035; }
body[data-matrix-mode="chain"] .spectral-slices i { background: linear-gradient(90deg,transparent 5%,rgba(202,255,54,.16),rgba(255,204,107,.5),transparent 88%); }
body[data-matrix-mode="ai"] .spectral-slices i { background: linear-gradient(90deg,transparent 5%,rgba(104,232,255,.18),rgba(181,158,255,.5),transparent 88%); }
.spectral-slices { position: absolute; z-index: 2; inset: 0; overflow: hidden; pointer-events: none; mix-blend-mode: screen; }
.spectral-slices i { position: absolute; left: -8%; width: 116%; height: 1px; opacity: 0; background: linear-gradient(90deg, transparent 4%, rgba(104,232,255,.2) 28%, rgba(185,255,213,.55) 52%, transparent 86%); box-shadow: 0 0 12px rgba(104,232,255,.16); animation: spectral-cut 9s steps(1,end) infinite; }
.spectral-slices i:nth-child(1) { top: 31%; }
.spectral-slices i:nth-child(2) { top: 57%; animation-delay: -3.1s; }
.spectral-slices i:nth-child(3) { top: 78%; animation-delay: -6.2s; }
@keyframes spectral-cut { 0%,92%,100% { opacity: 0; transform: translateX(0); } 93% { opacity: .75; transform: translateX(-9px); } 94% { opacity: .2; transform: translateX(13px); } 95% { opacity: .55; transform: translateX(-3px); } 96% { opacity: 0; } }
.scanline { position: absolute; z-index: 4; inset: -100% 0 auto; height: 22%; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(102,255,175,.035), transparent); animation: scan 8s linear infinite; }
@keyframes scan { to { transform: translateY(900%); } }
.scene-vignette { position: absolute; z-index: 2; inset: 0; pointer-events: none; box-shadow: inset 0 0 150px 48px rgba(0,0,0,.72); background: repeating-linear-gradient(0deg, rgba(255,255,255,.008) 0, rgba(255,255,255,.008) 1px, transparent 1px, transparent 3px), linear-gradient(180deg, rgba(0,0,0,.3), transparent 25%, transparent 72%, rgba(0,0,0,.45)); }
.matrix-hud { position: absolute; z-index: 4; top: 18px; left: 50%; display: grid; grid-template-columns: repeat(2, auto); gap: 4px 18px; color: rgba(104,232,255,.38); font-size: 7px; letter-spacing: .13em; pointer-events: none; transform: translateX(-50%); }
.reorg-glitch .viewport { animation: reorg-shift .72s steps(3, end); }
.reorg-glitch .viewport::after { opacity: .9; filter: hue-rotate(130deg); }
.reorg-glitch .spectral-slices i { opacity: .9; background: #ff6378; box-shadow: 0 0 24px #ff3152; animation: none; }
.stream-lost #matrixCanvas { opacity: .35; filter: grayscale(.7) contrast(1.35); }
.stream-lost .viewport { box-shadow: inset 0 0 120px rgba(255,30,65,.13); }
.stream-lost .spectral-slices i { opacity: .38; background: rgba(255,49,82,.65); animation-duration: 1.2s; }
.stream-recovering #matrixCanvas { opacity: .68; filter: hue-rotate(70deg); }
.stream-lost #matrixCanvas, .stream-recovering #matrixCanvas { transition: opacity .28s, filter .28s; }
.proof-pass .viewport { animation: proof-lock .75s ease-out; }
@keyframes proof-lock { 0% { box-shadow: inset 0 0 0 rgba(185,255,213,0); } 20% { box-shadow: inset 0 0 90px rgba(185,255,213,.19); } 100% { box-shadow: inset 0 0 0 rgba(185,255,213,0); } }
@keyframes reorg-shift { 20% { transform: translateX(3px); filter: contrast(1.4) hue-rotate(55deg); } 40% { transform: translateX(-5px); clip-path: inset(16% 0 58%); } 60% { transform: translateX(2px); clip-path: inset(58% 0 12%); } 100% { transform: none; clip-path: none; } }

.scene-title { position: absolute; top: 28px; left: 28px; max-width: 470px; pointer-events: none; }
.scene-title, .truth-legend, .tour-card, .trace-status, .soundless-note, .notice-popover, .layer-controls { z-index: 5; }
.scene-title span { color: var(--green); font-size: 10px; letter-spacing: .15em; }
.scene-title h1 { margin: 9px 0 5px; color: #ebfff3; font-family: var(--sans); font-size: clamp(25px, 3vw, 42px); font-weight: 500; letter-spacing: -.04em; }
.scene-title p { margin: 0; color: #6e9380; font-size: 10px; letter-spacing: .04em; }
.truth-legend { position: absolute; left: 28px; bottom: 24px; display: flex; flex-wrap: wrap; gap: 14px; color: #719081; font-size: 9px; letter-spacing: .05em; }
.truth-legend span { display: inline-flex; align-items: center; gap: 6px; }
.truth-legend i { width: 5px; height: 5px; border-radius: 50%; }
.truth-legend .verified { background: var(--green); box-shadow: 0 0 8px var(--green); }
.truth-legend .chain { width: 7px; height: 7px; border: 1px solid #d7ff57; background: transparent; box-shadow: 0 0 8px #d7ff57; }
.truth-legend .signed { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.truth-legend .observed { background: var(--amber); }
.truth-legend .declared { border: 1px solid #708078; }
.truth-legend .stale { background: #ff6378; transform: rotate(45deg); border-radius: 0; }

.tour-card { position: absolute; right: 28px; top: 30px; width: min(340px, calc(100vw - 56px)); padding: 14px 16px; border: 1px solid var(--line); border-left-color: var(--green); background: rgba(2,13,8,.74); backdrop-filter: blur(12px); transition: opacity .25s, transform .25s; }
.tour-card::before { content: ""; position: absolute; left: -1px; top: 0; width: 1px; height: 100%; box-shadow: 0 0 14px 2px rgba(112,255,176,.34); }
.tour-card span { color: #608371; font-size: 8px; letter-spacing: .18em; }
.tour-card strong { display: block; margin: 7px 0 5px; color: var(--green-hot); font-size: 12px; letter-spacing: .07em; }
.tour-card p { margin: 0; color: #8ca99a; font-family: var(--sans); font-size: 11px; line-height: 1.5; }
.trace-status { position: absolute; top: 156px; left: 28px; width: 220px; padding: 10px 12px; border-left: 1px solid var(--cyan); color: #779b8a; background: linear-gradient(90deg, rgba(7,35,27,.9), rgba(3,14,9,.34)); box-shadow: -8px 0 22px rgba(35,214,255,.08); font-size: 8px; letter-spacing: .08em; }
.trace-status span { display: block; color: var(--cyan); letter-spacing: .17em; }
.trace-status strong { display: block; margin-top: 6px; overflow: hidden; color: #d9fff0; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.trace-status em { display: block; margin-top: 4px; color: #6f9181; font-style: normal; }
.trace-status button { margin-top: 8px; padding: 4px 7px; border: 1px solid rgba(104,232,255,.25); color: var(--cyan); background: transparent; font-size: 7px; cursor: pointer; }
.trace-status button:hover, .trace-status button:focus-visible { border-color: var(--cyan); background: rgba(104,232,255,.08); }
.soundless-note { position: absolute; right: 28px; bottom: 24px; border: 0; color: #668676; background: none; font-size: 9px; letter-spacing: .1em; cursor: pointer; }
.soundless-note span { color: var(--amber); }
.notice-popover { position: absolute; right: 28px; bottom: 49px; width: min(380px, calc(100vw - 56px)); padding: 12px 14px; border: 1px solid var(--line); color: #91aa9d; background: #05130d; font: 11px/1.55 var(--sans); }
.notice-popover code { color: var(--green); }
.layer-controls { position: absolute; left: 28px; bottom: 48px; display: flex; gap: 9px; align-items: center; color: #5d7a6b; font-size: 8px; letter-spacing: .06em; }
.layer-controls > span { color: #3f5c4e; letter-spacing: .14em; }
.layer-controls label { display: flex; align-items: center; gap: 3px; cursor: pointer; }
.layer-controls input { width: 10px; height: 10px; accent-color: var(--green); }
.layer-controls button { padding: 4px 7px; border: 1px solid var(--line); color: #719181; background: rgba(2,12,8,.8); font-size: 8px; cursor: pointer; }
.layer-controls select { padding: 3px 5px; border: 1px solid var(--line); color: #719181; background: #031009; font: 8px var(--mono); }
.low-gpu .rain, .low-gpu .scanline, .low-gpu .spectral-slices, .low-gpu .mode-sigil { display: none; }
.paused-motion .rain span, .paused-motion .scanline, .paused-motion .spectral-slices i, .paused-motion .network-health i { animation-play-state: paused; }
.low-gpu .matrix-boot { display: none; }

.inspector { position: fixed; z-index: 40; top: 82px; right: 18px; width: 310px; max-height: calc(100vh - 260px); padding: 17px; overflow: auto; border: 1px solid rgba(105,255,176,.22); background: rgba(3,14,9,.94); box-shadow: 0 28px 80px rgba(0,0,0,.48); backdrop-filter: blur(20px); transform: translateX(calc(100% + 32px)); transition: transform .3s ease; }
.inspector.open { transform: none; }
.inspector-head { display: flex; align-items: center; justify-content: space-between; color: #668475; font-size: 9px; letter-spacing: .15em; }
.inspector-head button { border: 0; color: #799587; background: none; font-size: 18px; cursor: pointer; }
.entity-mark { display: grid; place-items: center; width: 50px; height: 50px; margin: 23px 0 17px; border: 1px solid var(--line-hot); color: var(--green-hot); background: rgba(105,255,176,.06); box-shadow: inset 0 0 20px rgba(105,255,176,.06), 0 0 20px rgba(105,255,176,.08); font-size: 13px; }
.entity-kind { margin: 0 0 5px; color: #638273; font-size: 9px; letter-spacing: .14em; }
.inspector h2 { margin: 0; color: #edfff4; font: 500 21px var(--sans); }
.entity-id { margin: 8px 0 13px; overflow: hidden; color: #587266; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.truth-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--line); color: #9bd8b7; font-size: 8px; letter-spacing: .1em; }
.truth-badge i { width: 7px; height: 7px; border: 1px solid currentColor; background: transparent; box-shadow: 0 0 7px currentColor; }
.truth-badge[data-truth="fixture_verified"] { color: #d7ff57; border-style: double; }
.truth-badge[data-truth="fixture_verified"] i { transform: rotate(45deg); }
.truth-badge[data-truth="node_validated"] i { border-radius: 50%; background: currentColor; }
.truth-badge[data-truth="chain_reported"] { color: #8aab9b; }
.truth-badge[data-truth="chain_reported"] i { border-radius: 50%; }
.truth-badge[data-truth="signed_offchain"], .truth-badge[data-truth="attested"] { color: var(--cyan); border-style: dashed; }
.truth-badge[data-truth="signed_offchain"] i { clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); background: currentColor; }
.truth-badge[data-truth="observed"] { color: var(--amber); }
.truth-badge[data-truth="declared"], .truth-badge[data-truth="inferred"] { color: #b59eff; }
.truth-badge[data-truth="stale"] { color: #ff6378; border-style: dashed; }
.truth-badge[data-truth="stale"] i { transform: rotate(45deg); border-width: 0 1px 1px 0; }
.inspector-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin: 15px 0 0; border: 1px solid var(--line); }
.inspector-tabs button { padding: 7px 2px; border: 0; border-right: 1px solid var(--line); color: #587366; background: transparent; font-size: 8px; cursor: pointer; }
.inspector-tabs button:last-child { border: 0; }
.inspector-tabs button.active { color: var(--green-hot); background: rgba(105,255,176,.07); }
.inspector dl { margin: 20px 0; border-top: 1px solid var(--line); }
.inspector dl div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.inspector dt { color: #648173; }
.inspector dd { margin: 0; color: #c4ded0; text-align: right; }
.evidence-box { padding: 11px; border: 1px dashed rgba(105,255,176,.2); background: rgba(105,255,176,.025); }
.evidence-box span { color: #668475; font-size: 8px; letter-spacing: .12em; }
.evidence-box p { margin: 7px 0 0; color: #8aa496; font: 10px/1.55 var(--sans); }
.inspector-panel { margin-top: 14px; color: #8aa496; font: 10px/1.6 var(--sans); }
.relation-row, .proof-row { padding: 8px; margin-bottom: 6px; border: 1px solid var(--line); background: rgba(105,255,176,.025); }
.relation-row b, .proof-row b { display: block; color: #c4ded0; font: 9px var(--mono); }
.proof-row span { color: var(--green); }
.raw-panel { max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: #78a68d; font: 8px/1.55 var(--mono); }

.command-deck { min-height: 72px; padding: 11px 22px; display: grid; grid-template-columns: 1fr minmax(260px, 450px) 1fr; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); background: rgba(2,9,6,.92); }
.mode-switch { display: flex; align-items: stretch; }
.mode-switch button { padding: 9px 12px; border: 0; border-left: 1px solid var(--line); color: #627d70; background: transparent; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; cursor: pointer; }
.mode-switch button:last-child { border-right: 1px solid var(--line); }
.mode-switch button b { color: #435c50; font-weight: 400; }
.mode-switch button.active { color: var(--green-hot); background: rgba(105,255,176,.055); box-shadow: inset 0 -1px var(--green); }
.mode-switch button.active b { color: var(--green); }
.search-box { height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.search-box i { color: var(--green); font-style: normal; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: #c9e7d7; background: none; font-size: 10px; }
.search-box input::placeholder { color: #4e685b; }
.search-results { position: absolute; z-index: 70; left: 50%; top: calc(100% - 176px); width: min(450px, calc(100vw - 24px)); max-height: 260px; overflow: auto; transform: translateX(-50%); border: 1px solid var(--line-hot); background: #031009; box-shadow: 0 20px 60px #000; }
.search-results button, .search-results p { display: block; width: 100%; margin: 0; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); color: #9bc2ae; background: transparent; text-align: left; font-size: 9px; }
.search-results button:hover, .search-results button:focus-visible { color: var(--green-hot); background: rgba(105,255,176,.07); }
kbd { padding: 2px 5px; border: 1px solid var(--line); color: #557064; font: 8px var(--mono); }
.playback { justify-self: end; display: flex; gap: 7px; }
.playback button { width: 34px; height: 34px; border: 1px solid var(--line); color: #8bab9b; background: rgba(105,255,176,.025); cursor: pointer; }
.playback button:hover, .playback button:focus-visible { border-color: var(--line-hot); color: var(--green-hot); }

.timeline-panel { height: 52px; padding: 5px 22px 0; border-bottom: 1px solid var(--line); background: rgba(1,7,4,.95); }
.timeline-meta { display: flex; justify-content: space-between; color: #506a5d; font-size: 8px; }
.timeline-meta strong { color: #739382; font-weight: 500; letter-spacing: .12em; }
.timeline-panel input { display: block; width: 100%; height: 12px; margin: 3px 0 0; accent-color: var(--green); cursor: pointer; }
.timeline-labels { display: flex; justify-content: space-between; color: #3f584b; font-size: 7px; letter-spacing: .07em; }

.event-console { position: relative; min-height: 82px; padding: 6px 22px; overflow: hidden; border-bottom: 1px solid var(--line); background: #010604; }
.console-head { display: flex; gap: 14px; color: #4d6a5b; font-size: 7px; letter-spacing: .1em; }
.console-head strong { color: var(--green); font-weight: 400; }
.console-head em { margin-left: auto; color: #5f5442; font-style: normal; }
.event-rail { display: flex; gap: 7px; margin-top: 6px; overflow: hidden; }
.event-pill { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--line); color: #78988a; background: rgba(105,255,176,.025); font-size: 8px; }
.event-pill b { color: #b9e7cf; font-weight: 500; }
.event-pill.retract { border-color: rgba(255,99,120,.3); color: #ce7c89; }
.system-actions { position: absolute; right: 22px; bottom: 6px; display: flex; gap: 5px; }
.system-actions button { padding: 4px 7px; border: 1px solid var(--line); color: #658375; background: #031009; font-size: 7px; cursor: pointer; }
.system-actions button:hover, .system-actions button:focus-visible { color: var(--green-hot); border-color: var(--line-hot); }
.system-panel, .entity-navigator { position: fixed; z-index: 80; top: 76px; left: 50%; width: min(720px, calc(100vw - 30px)); max-height: calc(100vh - 100px); padding: 18px; overflow: auto; border: 1px solid var(--line-hot); background: rgba(2,13,8,.98); box-shadow: 0 30px 100px #000; transform: translateX(-50%); }
.system-panel header, .entity-navigator header { display: flex; justify-content: space-between; color: var(--green); font-size: 10px; letter-spacing: .12em; }
.system-panel header button, .entity-navigator header button { border: 0; color: #799587; background: none; font-size: 18px; cursor: pointer; }
.system-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
.system-card { padding: 12px; border: 1px solid var(--line); color: #799989; font: 10px/1.6 var(--sans); }
.system-card b { display: block; color: #d0ecdd; font: 10px var(--mono); }
.system-card strong { color: var(--green); }
.explorer-intro { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; margin-top: 15px; padding: 10px 12px; border-left: 2px solid var(--amber); color: #8aa496; background: rgba(255,204,107,.035); font: 9px/1.5 var(--sans); }
.explorer-intro b { color: var(--amber); font: 8px var(--mono); letter-spacing: .08em; white-space: nowrap; }
.explorer-tabs { display: flex; margin-top: 12px; border: 1px solid var(--line); overflow-x: auto; }
.explorer-tabs button { flex: 1 0 auto; padding: 9px 12px; border: 0; border-right: 1px solid var(--line); color: #607e6e; background: transparent; font: 8px var(--mono); cursor: pointer; }
.explorer-tabs button[aria-selected="true"] { color: var(--green-hot); background: rgba(105,255,176,.08); box-shadow: inset 0 -1px var(--green-hot); }
.explorer-scroll { overflow-x: auto; border: 1px solid var(--line); border-top: 0; }
.explorer-table { width: 100%; min-width: 630px; border-collapse: collapse; color: #87a797; font: 9px/1.4 var(--mono); }
.explorer-table th { padding: 8px 10px; color: #4f6e5d; background: rgba(105,255,176,.025); font-size: 7px; letter-spacing: .08em; text-align: left; }
.explorer-table td { max-width: 220px; padding: 10px; overflow: hidden; border-top: 1px solid var(--line); text-overflow: ellipsis; white-space: nowrap; }
.explorer-table tbody tr:hover { background: rgba(105,255,176,.025); }
.explorer-table button { padding: 0; border: 0; color: #bdebd3; background: none; font: inherit; text-align: left; cursor: pointer; }
.explorer-table button:hover, .explorer-table button:focus-visible { color: var(--green-hot); text-decoration: underline; }
.explorer-pages { display: flex; justify-content: flex-end; gap: 6px; align-items: center; margin-top: 10px; color: #557264; font: 7px var(--mono); }
.explorer-pages span { margin-right: auto; }
.explorer-pages button { padding: 6px 9px; border: 1px solid var(--line); color: #78988a; background: rgba(105,255,176,.025); font: 7px var(--mono); cursor: pointer; }
.explorer-pages button:disabled { opacity: .32; cursor: default; }
.grammar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.grammar-group { padding: 12px; border: 1px solid var(--line); background: rgba(105,255,176,.02); }
.grammar-group h3 { margin: 0 0 11px; color: var(--green-hot); font: 9px var(--mono); letter-spacing: .13em; }
.grammar-row { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: center; min-height: 30px; color: #86a797; font: 9px/1.4 var(--sans); }
.grammar-row b { display: block; color: #cce8da; font: 8px var(--mono); }
.grammar-glyph { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--green); color: var(--green); font: 7px var(--mono); box-shadow: 0 0 9px rgba(120,255,178,.18); }
.grammar-glyph.circle { border-radius: 50%; }
.grammar-glyph.diamond { transform: rotate(45deg); }
.grammar-glyph.diamond span { transform: rotate(-45deg); }
.grammar-glyph.hex { clip-path: polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%); border: 0; background: rgba(104,232,255,.16); outline: 1px solid var(--cyan); color: var(--cyan); }
.grammar-edge { width: 22px; height: 0; border-top: 2px solid var(--green); }
.grammar-edge.signed { border-color: var(--cyan); border-top-style: dashed; }
.grammar-edge.observed { border-color: var(--amber); border-top-style: dotted; }
.grammar-edge.failure { border-color: #ff6378; border-top-style: dashed; }
.grammar-warning { grid-column: 1 / -1; padding: 10px 12px; border-left: 2px solid var(--amber); color: #a58e65; background: rgba(255,204,107,.04); font: 9px/1.5 var(--sans); }
.entity-navigator p { color: #6e8b7c; font: 11px var(--sans); }
#entityNavList { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
#entityNavList button { padding: 8px; border: 1px solid var(--line); color: #8da99b; background: rgba(105,255,176,.025); text-align: left; font-size: 8px; cursor: pointer; }
.sr-status { position: fixed; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.field-source { display: block; margin-top: 3px; color: #557264; font-size: 7px; }
.field-source b { color: #75a38b; font-weight: 400; }

.telemetry { min-height: 56px; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(2,9,6,.96); }
.telemetry article { padding: 9px 16px; border-right: 1px solid var(--line); }
.telemetry article:last-child { border: 0; }
.telemetry span { display: block; color: #506d5e; font-size: 7px; letter-spacing: .13em; }
.telemetry strong { display: inline-block; margin-top: 3px; color: #c7ebd7; font-size: 14px; font-weight: 500; }
.telemetry small { margin-left: 8px; color: #4b6758; font-size: 7px; }
.noscript { position: fixed; z-index: 200; inset: auto 20px 20px; padding: 14px; color: #1a0b00; background: var(--amber); }

@media (max-width: 1000px) {
    .viewport { height: calc(100vh - 274px); }
    .be-header { grid-template-columns: 1fr auto; }
    .network-health { display: none; }
    .command-deck { grid-template-columns: 1fr auto; }
    .search-box { grid-column: 1 / -1; grid-row: 2; }
    .telemetry { grid-template-columns: repeat(3, 1fr); }
    .telemetry article:nth-child(n+4) { display: none; }
}

@media (max-width: 700px) {
    .be-header { height: 56px; padding: 0 14px; }
    .be-main { padding-top: 56px; }
    .be-actions a:first-child { display: none; }
    .viewport { height: calc(100vh - 282px); min-height: 390px; }
    .scene-title { top: 30px; left: 16px; max-width: calc(100vw - 32px); }
    .scene-title h1 { font-size: 26px; }
    .matrix-hud { top: 8px; right: 14px; left: auto; display: block; transform: none; }
    .matrix-hud span { display: none; }
    .matrix-hud span:first-child { display: block; }
    .scene-title p { max-width: 270px; }
    .tour-card { top: auto; right: 16px; bottom: 78px; width: min(190px, calc(100vw - 32px)); max-height: 62px; padding: 9px 11px; overflow: hidden; opacity: .88; }
    .tour-card strong { margin-bottom: 0; font-size: 10px; }
    .tour-card p { display: none; }
    body[data-matrix-mode="ai"] .tour-card { display: none; }
    .mode-sigil { display: none; }
    .trace-status { top: 124px; left: 16px; width: min(200px, calc(100vw - 32px)); padding: 8px 10px; }
    .truth-legend { left: 14px; right: 132px; bottom: 8px; max-width: none; flex-wrap: nowrap; gap: 5px 9px; overflow-x: auto; scrollbar-width: none; }
    .truth-legend::-webkit-scrollbar { display: none; }
    .truth-legend span { flex: 0 0 auto; }
    .layer-controls { left: 14px; bottom: 43px; max-width: calc(100vw - 28px); overflow-x: auto; }
    .layer-controls > span { display: none; }
    .layer-controls label { flex: 0 0 auto; }
    .soundless-note { right: 14px; bottom: 15px; }
    .command-deck { min-height: 92px; padding: 8px 10px; gap: 8px; }
    .mode-switch button { padding: 8px 7px; font-size: 7px; }
    .mode-switch button b { display: none; }
    .playback button { width: 30px; height: 30px; }
    .timeline-panel { padding-inline: 12px; }
    .timeline-labels span:nth-child(even) { display: none; }
    .telemetry { grid-template-columns: repeat(2, 1fr); }
    .telemetry article:nth-child(3) { display: none; }
    .event-console { padding-inline: 10px; }
    .system-actions { position: static; margin-top: 6px; overflow-x: auto; }
    .system-actions button { flex: 0 0 auto; }
    .event-rail { display: none; }
    #entityNavList, .system-grid, .grammar-grid { grid-template-columns: 1fr; }
    .explorer-intro { grid-template-columns: 1fr; gap: 4px; }
    .inspector { top: auto; right: 10px; bottom: 10px; left: 10px; width: auto; max-height: 64vh; transform: translateY(calc(100% + 24px)); }
    .search-results { position: fixed; top: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
    .rain, .scanline, .matrix-boot, .spectral-slices, .mode-sigil { display: none; }
    .scene-alert i { animation: none; }
}
