/* ============================================================================
   VALHALLA NEXUS R2 — THE COMMAND DECK, REBUILT
   Ground-up layout for the new member surfaces. Not a reskin: this sheet owns
   every component on the rebuilt pages (deck, hourly, gate).
   Sci-fi command bridge × Norse runeforge × ninja-blade precision.
   LAW: green = bullish/UP, red = bearish/DOWN, gold = wait-for-value.
        Brand cyan never colors a candle or a direction.
   ========================================================================== */

/* --------------------------------------------------------------- tokens -- */
:root {
    --dk-void: #01050b;
    --dk-abyss: #041020;
    --dk-steel: #0a1e36;
    --dk-plate: #0f2846;
    --dk-ice: #c4efff;
    --dk-cyan: #41d6ff;
    --dk-cyan-dim: #1d7fa8;
    --dk-frost: #8fd2ef;
    --dk-titanium: #9db4cc;
    --dk-silver: #d7e5f2;
    --dk-up: #3ce6a4;
    --dk-up-deep: #0d3f31;
    --dk-down: #ff5d78;
    --dk-down-deep: #47121e;
    --dk-gold: #f2c76b;
    --dk-ember: #ffb85c;
    --dk-storm: #8f7bff;
    --dk-line: rgba(96, 178, 226, 0.24);
    --dk-line-strong: rgba(105, 220, 255, 0.6);
    --dk-line-dim: rgba(70, 130, 180, 0.13);
    --dk-text: #eef7ff;
    --dk-text-soft: #b6cadd;
    --dk-muted: #7e97ae;
    --dk-glass: linear-gradient(164deg, rgba(13, 33, 58, 0.84), rgba(4, 13, 26, 0.93));
    --dk-glass-hot: linear-gradient(158deg, rgba(19, 44, 76, 0.9), rgba(6, 17, 33, 0.95));
    --dk-inset: rgba(2, 8, 17, 0.75);
    --dk-font-display: "VALHALLA Marcellus", "Palatino Linotype", Georgia, serif;
    --dk-font-ui: "VALHALLA Sora", "Segoe UI", system-ui, sans-serif;
    --dk-font-mono: "VALHALLA Plex Mono", "Cascadia Mono", Consolas, monospace;
    --dk-snap: cubic-bezier(0.22, 1, 0.36, 1);
    --dk-blade: cubic-bezier(0.7, 0, 0.16, 1);
    --dk-rail-w: 4.4rem;
    --dk-intel-w: 21.5rem;
    --dk-notch: 1.05rem;
    --dk-glow-cyan: 0 0 20px rgba(65, 214, 255, 0.30), 0 0 52px rgba(65, 214, 255, 0.10);
}

/* ---------------------------------------------------------- foundation -- */
.nexus-deck,
.nexus-deck * ,
.nexus-deck *::before,
.nexus-deck *::after { box-sizing: border-box; }

html { font-size: clamp(13.5px, 0.45vw + 11px, 22px); }

body.nexus-deck {
    margin: 0;
    min-height: 100vh;
    background: var(--dk-void);
    color: var(--dk-text);
    font-family: var(--dk-font-ui);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.nexus-deck ::selection { background: rgba(65, 214, 255, 0.32); color: #fff; }

.nexus-deck :focus-visible {
    outline: 2px solid var(--dk-cyan);
    outline-offset: 2px;
    border-radius: 4px;
}

.nexus-deck * { scrollbar-width: thin; scrollbar-color: rgba(65,214,255,0.35) rgba(4,12,24,0.6); }
.nexus-deck *::-webkit-scrollbar { width: 9px; height: 9px; }
.nexus-deck *::-webkit-scrollbar-track { background: rgba(3, 10, 20, 0.6); }
.nexus-deck *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(65, 214, 255, 0.45), rgba(29, 127, 168, 0.45));
    border-radius: 8px;
    border: 2px solid rgba(3, 10, 20, 0.8);
}

.nx-mono { font-family: var(--dk-font-mono); font-variant-numeric: tabular-nums; }
.nx-up   { color: var(--dk-up) !important; }
.nx-down { color: var(--dk-down) !important; }
.nx-gold { color: var(--dk-gold) !important; }

/* ------------------------------------------------------------ atmosphere - */
/* (canvas + aurora painted by valhalla-nexus.js atmosphere engine) */
.nexus-deck .nexus-atmosphere { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.nexus-deck .nexus-atmosphere::before {
    content: "";
    position: absolute;
    inset: -12%;
    background:
        radial-gradient(56% 40% at 14% -8%, rgba(64, 132, 244, 0.18), transparent 60%),
        radial-gradient(44% 36% at 86% -6%, rgba(143, 123, 255, 0.15), transparent 58%),
        radial-gradient(70% 58% at 50% 116%, rgba(9, 48, 78, 0.55), transparent 70%),
        linear-gradient(180deg, #020610 0%, #030b18 46%, #04101f 100%);
}
.nexus-deck #nexus-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.nexus-deck .nexus-horizon {
    position: absolute; left: -20%; right: -20%; bottom: -6%; height: 44%;
    background:
        linear-gradient(to top, rgba(65, 214, 255, 0.10), transparent 70%),
        repeating-linear-gradient(90deg, rgba(65, 214, 255, 0.12) 0 1px, transparent 1px 90px),
        repeating-linear-gradient(0deg, rgba(65, 214, 255, 0.10) 0 1px, transparent 1px 54px);
    transform: perspective(50rem) rotateX(64deg);
    transform-origin: 50% 100%;
    mask-image: linear-gradient(to top, rgba(0,0,0,0.8), transparent 86%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.8), transparent 86%);
    animation: dk-horizon 24s steps(24, end) infinite;   /* R9G: one repaint a second, not sixty */
}
@keyframes dk-horizon { to { background-position: 0 0, 0 0, 0 3.4rem; } }
.nexus-deck .nexus-vignette {
    position: absolute; inset: 0;
    background: radial-gradient(125% 92% at 50% 10%, transparent 56%, rgba(0, 2, 6, 0.6) 100%);
}

/* ============================================================= TOP BAR === */
.deck-top {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.1rem;
    padding: 0.55rem clamp(0.8rem, 2vw, 1.6rem);
    background: linear-gradient(180deg, rgba(7, 19, 36, 0.94), rgba(3, 9, 18, 0.9));
    border-bottom: 1px solid var(--dk-line);
    backdrop-filter: blur(14px) saturate(1.25);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
}

.deck-top::after {
    content: "";
    position: absolute;
    inset: auto 0 -2px 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(65, 214, 255, 0.9) 30%, rgba(255, 184, 92, 0.85) 50%, rgba(65, 214, 255, 0.9) 70%, transparent);
    background-size: 240% 100%;
    animation: dk-crown 9s linear infinite;
    pointer-events: none;
}
@keyframes dk-crown { from { background-position: 130% 0; } to { background-position: -130% 0; } }

.deck-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.deck-sigil {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 30%;
    overflow: visible;
}
.deck-sigil img { width: 100%; height: 100%; border-radius: 30%; display: block; }
.deck-sigil::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 34%;
    border: 1px solid rgba(65, 214, 255, 0.5);
    border-top-color: rgba(255, 184, 92, 0.85);
    animation: dk-spin 12s linear infinite;
}
@keyframes dk-spin { to { transform: rotate(360deg); } }

.deck-brand-name { line-height: 1.05; min-width: 0; }
.deck-brand-name strong {
    display: block;
    font-family: var(--dk-font-display);
    font-size: 1.02rem;
    letter-spacing: 0.14em;
    background: linear-gradient(100deg, #f4faff 10%, var(--dk-ice) 35%, var(--dk-cyan) 55%, #dce9f5 80%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: dk-shimmer 11s ease-in-out infinite;
    white-space: nowrap;
}
@keyframes dk-shimmer { 0%,100%{background-position:0 0} 50%{background-position:100% 0} }
.deck-brand-name small {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.3em;
    color: var(--dk-gold);
    white-space: nowrap;
}

/* center: the heartbeat */
.deck-pulse {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.8rem, 2.5vw, 2.2rem);
    min-width: 0;
}

.deck-price-block { text-align: center; }
.deck-price-label {
    font-size: 0.56rem;
    letter-spacing: 0.3em;
    color: var(--dk-muted);
    text-transform: uppercase;
}
.deck-price-row { display: flex; align-items: baseline; gap: 0.55rem; justify-content: center; }
#nx-price {
    font-family: var(--dk-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: clamp(1.25rem, 2.1vw, 1.7rem);
    font-weight: 600;
    color: var(--dk-ice);
    text-shadow: 0 0 18px rgba(65, 214, 255, 0.45);
    transition: color 300ms;
}
#nx-price.is-up-tick { color: var(--dk-up); text-shadow: 0 0 18px rgba(60, 230, 164, 0.5); }
#nx-price.is-down-tick { color: var(--dk-down); text-shadow: 0 0 18px rgba(255, 93, 120, 0.5); }
#nx-price-delta { font-family: var(--dk-font-mono); font-size: 0.78rem; }
#nx-spark { width: clamp(90px, 11vw, 170px); height: 42px; opacity: 0.95; }
.deck-price-meta {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    font-size: 0.62rem;
    color: var(--dk-muted);
    font-family: var(--dk-font-mono);
}
.deck-price-meta strong { color: var(--dk-text-soft); font-weight: 500; }

/* right cluster: contract + clock + live */
.deck-contract {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.deck-contract-chip {
    text-align: right;
    line-height: 1.25;
}
.deck-contract-chip small { display:block; font-size: 0.55rem; letter-spacing: 0.26em; color: var(--dk-muted); }
#nx-ticker { font-family: var(--dk-font-mono); font-size: 0.74rem; color: var(--dk-frost); }
#nx-strike-top { font-family: var(--dk-font-mono); font-size: 0.7rem; color: var(--dk-gold); }
.deck-live {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: var(--dk-inset);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
}
.deck-live i {
    width: 0.55rem; height: 0.55rem;
    border-radius: 50%;
    background: var(--dk-up);
    animation: dk-heart 2.2s ease-out infinite;
}
.deck-live.is-degraded i { background: var(--dk-gold); }
.deck-live.is-offline i { background: var(--dk-down); animation: none; }
@keyframes dk-heart {
    0% { box-shadow: 0 0 0 0 rgba(60, 230, 164, 0.65); }
    70% { box-shadow: 0 0 0 8px rgba(60, 230, 164, 0); }
    100% { box-shadow: 0 0 0 0 rgba(60, 230, 164, 0); }
}

/* ============================================================ SKELETON === */
.deck-body {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: var(--dk-rail-w) minmax(0, 1fr) var(--dk-intel-w);
    gap: 1rem;
    width: min(2260px, 100% - 2rem);
    margin: 1rem auto 2.5rem;
    align-items: start;
}

@media (min-width: 1800px) {
    :root { --dk-intel-w: 24rem; --dk-rail-w: 5rem; }
    .deck-body { gap: 1.3rem; width: min(2420px, 100% - 3.5rem); }
}

/* ================================================================ RAIL === */
.deck-rail {
    position: sticky;
    top: 4.4rem;
    z-index: 55;   /* above stage cards (their filters make stacking contexts), below header/dock — tooltips must never hide behind a plate */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.4rem;
    background: var(--dk-glass);
    border: 1px solid var(--dk-line);
    border-radius: 1.1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.rail-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    border: 1px solid transparent;
    border-radius: 0.9rem;
    background: transparent;
    color: var(--dk-titanium);
    cursor: pointer;
    transition: color 180ms, background 180ms, border-color 180ms, box-shadow 240ms;
}
.rail-btn svg { width: 1.35rem; height: 1.35rem; display: block; }
.rail-btn:hover { color: var(--dk-ice); background: rgba(65, 214, 255, 0.08); }
.rail-btn.is-active {
    color: #06121d;
    background: linear-gradient(140deg, var(--dk-ice), var(--dk-cyan) 65%);
    border-color: rgba(190, 238, 255, 0.5);
    box-shadow: var(--dk-glow-cyan);
}
.rail-btn .rail-tip {
    position: absolute;
    left: calc(100% + 0.55rem);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--dk-line);
    border-radius: 0.4rem;
    background: rgba(4, 12, 24, 0.97);
    color: var(--dk-ice);
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6), 0 0 16px rgba(92, 220, 255, 0.15);
    transition: opacity 160ms, transform 160ms;
    z-index: 30;
}
.rail-btn:hover .rail-tip { opacity: 1; transform: translateY(-50%) translateX(0); }
.rail-sep { width: 60%; height: 1px; margin: 0.3rem 0; background: var(--dk-line); }
.rail-vitals {
    margin-top: auto;
    text-align: center;
    font-size: 0.55rem;
    color: var(--dk-muted);
    letter-spacing: 0.12em;
    line-height: 1.7;
}
.rail-vitals strong { display: block; font-family: var(--dk-font-mono); font-size: 0.8rem; color: var(--dk-up); }

/* =============================================================== CARDS === */
/* Chamfered HUD plate: clip-path shape, glow follows the cut via drop-shadow */
.nx-card { filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.5)); }
.nx-card > .nx-card-body {
    position: relative;
    background: var(--dk-glass);
    border: 1px solid var(--dk-line);
    clip-path: polygon(
        var(--dk-notch) 0, 100% 0,
        100% calc(100% - var(--dk-notch)),
        calc(100% - var(--dk-notch)) 100%,
        0 100%, 0 var(--dk-notch));
    padding: 1rem 1.1rem 1.1rem;
    isolation: isolate;
}
.nx-card > .nx-card-body::before {
    /* notch seams */
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(65, 214, 255, 0.8) 0 2px, transparent 2px) 0 0 / calc(var(--dk-notch) + 2px) calc(var(--dk-notch) + 2px) no-repeat,
        linear-gradient(-45deg, rgba(65, 214, 255, 0.55) 0 2px, transparent 2px) 100% 100% / calc(var(--dk-notch) + 2px) calc(var(--dk-notch) + 2px) no-repeat;
    pointer-events: none;
    opacity: 0.8;
}
.nx-card > .nx-card-body::after {
    /* crown edge light */
    content: "";
    position: absolute;
    top: 0; left: 8%; right: 4%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(65, 214, 255, 0.75) 30%, rgba(196, 239, 255, 0.9) 50%, rgba(65, 214, 255, 0.75) 70%, transparent);
    animation: dk-edge 7s ease-in-out infinite;
    pointer-events: none;
}
@keyframes dk-edge { 0%,100%{opacity:0.3} 50%{opacity:0.85} }
.nx-card.is-hot { filter: drop-shadow(0 18px 34px rgba(0,0,0,0.5)) drop-shadow(0 0 22px rgba(65, 214, 255, 0.22)); }
.nx-card.is-up-glow { filter: drop-shadow(0 18px 34px rgba(0,0,0,0.5)) drop-shadow(0 0 24px rgba(60, 230, 164, 0.28)); }
.nx-card.is-down-glow { filter: drop-shadow(0 18px 34px rgba(0,0,0,0.5)) drop-shadow(0 0 24px rgba(255, 93, 120, 0.28)); }
.nx-card.is-gold-glow { filter: drop-shadow(0 18px 34px rgba(0,0,0,0.5)) drop-shadow(0 0 24px rgba(242, 199, 107, 0.26)); }

.nx-card-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.6rem;
    margin: 0 0 0.75rem;
    min-width: 0;
}
.nx-card-title h2, .nx-card-title h3 { overflow-wrap: anywhere; }
.nx-card-title h2, .nx-card-title h3 {
    margin: 0;
    font-family: var(--dk-font-ui);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--dk-frost);
    text-transform: uppercase;
}
.nx-card-title .nx-chip { flex: 0 0 auto; }

.nx-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.6rem;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: var(--dk-inset);
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    color: var(--dk-text-soft);
    text-transform: uppercase;
    white-space: nowrap;
}
.nx-chip.is-up { color: var(--dk-up); border-color: rgba(60, 230, 164, 0.45); }
.nx-chip.is-down { color: var(--dk-down); border-color: rgba(255, 93, 120, 0.45); }
.nx-chip.is-gold { color: var(--dk-gold); border-color: rgba(242, 199, 107, 0.5); }
.nx-chip.is-cyan { color: var(--dk-cyan); border-color: rgba(65, 214, 255, 0.5); }
.nx-chip.is-dim { opacity: 0.75; }

/* stat cell */
.nx-fact { line-height: 1.3; min-width: 0; }
.nx-fact small {
    display: block;
    font-size: 0.53rem;
    letter-spacing: 0.22em;
    color: var(--dk-muted);
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}
.nx-fact strong {
    font-family: var(--dk-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--dk-text);
    overflow-wrap: anywhere;
}

/* ============================================================ WATCHTOWER = */
.nx-watch { margin-bottom: 1rem; }
.nx-watch .nx-card-body {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 1.1rem;
}
.nx-watch-glyph {
    flex: 0 0 auto;
    width: 2rem; height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--dk-line-strong);
    font-family: var(--dk-font-display);
    color: var(--dk-cyan);
}
.nx-watch-copy { min-width: 0; flex: 1; }
#nx-watch-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; }
#nx-watch-detail { font-size: 0.68rem; color: var(--dk-text-soft); margin-top: 0.15rem; }
.nx-watch.is-alert .nx-card-body { animation: dk-alert 1.8s ease-in-out infinite; }
.nx-watch.is-alert .nx-watch-glyph { color: var(--dk-down); border-color: rgba(255, 93, 120, 0.6); }
@keyframes dk-alert {
    0%,100% { box-shadow: inset 0 0 0 1px rgba(255,93,120,0); }
    50% { box-shadow: inset 0 0 26px rgba(255, 93, 120, 0.18); }
}

/* ============================================================ OATH HERO == */
#nx-oath {
    display: grid;
    grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr);
    gap: clamp(1rem, 2.4vw, 2.2rem);
    align-items: center;
    background:
        radial-gradient(120% 160% at 18% -30%, rgba(65, 214, 255, 0.10), transparent 55%),
        var(--dk-glass-hot);
    padding: 1.3rem 1.4rem;
}

/* the dial */
.nx-dial-wrap { position: relative; display: grid; place-items: center; }
#nx-dial { width: 100%; max-width: 19rem; height: auto; display: block; }
#nx-dial .dial-track { stroke: rgba(80, 140, 190, 0.22); }
#nx-dial .dial-progress {
    stroke: var(--dk-cyan);
    filter: drop-shadow(0 0 6px rgba(65, 214, 255, 0.8));
    transition: stroke-dashoffset 900ms var(--dk-snap), stroke 400ms;
}
#nx-dial .dial-runes text {
    font-family: var(--dk-font-ui);
    font-size: 7.2px;
    letter-spacing: 0.32em;
    fill: var(--dk-muted);
}
#nx-dial .dial-state-ring {
    stroke: rgba(65, 214, 255, 0.35);
    stroke-dasharray: 3 6;
    /* dash march instead of a transform spin — a rotating transform on the
       ring inflated the mobile layout viewport and overflowed 320px views */
    animation: dk-dial-march 34s linear infinite;
}
@keyframes dk-dial-march { to { stroke-dashoffset: -720; } }

.nx-dial-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    gap: 0.15rem;
    pointer-events: none;
}
#nx-dial-state {
    font-size: 0.58rem;
    letter-spacing: 0.34em;
    color: var(--dk-frost);
    text-transform: uppercase;
}
#nx-dial-dir {
    font-family: var(--dk-font-display);
    font-size: clamp(1.7rem, 2.6vw, 2.5rem);
    line-height: 1;
    letter-spacing: 0.06em;
    color: var(--dk-silver);
    text-shadow: 0 0 26px rgba(65, 214, 255, 0.35);
    transition: color 400ms;
}
#nx-dial-sub { font-size: 0.6rem; letter-spacing: 0.2em; color: var(--dk-muted); }
#nx-dial-clock {
    margin-top: 0.35rem;
    font-family: var(--dk-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.02rem;
    color: var(--dk-ice);
}
#nx-dial-clock small { font-size: 0.55rem; letter-spacing: 0.26em; color: var(--dk-muted); display:block; }

#nx-oath.state-locked-up #nx-dial-dir { color: var(--dk-up); text-shadow: 0 0 30px rgba(60,230,164,0.5); }
#nx-oath.state-locked-down #nx-dial-dir { color: var(--dk-down); text-shadow: 0 0 30px rgba(255,93,120,0.5); }
#nx-oath.state-locked-up #nx-dial .dial-progress { stroke: var(--dk-up); filter: drop-shadow(0 0 7px rgba(60,230,164,0.8)); }
#nx-oath.state-locked-down #nx-dial .dial-progress { stroke: var(--dk-down); filter: drop-shadow(0 0 7px rgba(255,93,120,0.8)); }
#nx-oath.state-forming #nx-dial .dial-state-ring { stroke: rgba(242, 199, 107, 0.5); }
#nx-oath.state-conflicted #nx-dial .dial-state-ring { stroke: rgba(255, 93, 120, 0.4); }

/* status column */
.nx-oath-status { display: grid; gap: 0.8rem; min-width: 0; }
.nx-oath-headline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
#nx-call {
    margin: 0;
    font-family: var(--dk-font-display);
    font-size: clamp(1.3rem, 2.4vw, 2.1rem);
    letter-spacing: 0.05em;
    line-height: 1.08;
    color: var(--dk-silver);
}
#nx-call.is-up { color: var(--dk-up); }
#nx-call.is-down { color: var(--dk-down); }
#nx-call-note { font-size: 0.62rem; letter-spacing: 0.2em; color: var(--dk-muted); text-transform: uppercase; }

/* entry lane — separate from settlement call, gold when waiting */
.nx-entry {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(242, 199, 107, 0.4);
    border-left: 3px solid var(--dk-gold);
    background: linear-gradient(90deg, rgba(242, 199, 107, 0.08), transparent 60%);
    border-radius: 0.45rem;
}
.nx-entry.is-live {
    border-color: rgba(60, 230, 164, 0.45);
    border-left-color: var(--dk-up);
    background: linear-gradient(90deg, rgba(60, 230, 164, 0.08), transparent 60%);
}
.nx-entry small { font-size: 0.53rem; letter-spacing: 0.24em; color: var(--dk-muted); display: block; }
#nx-entry-status { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; color: var(--dk-gold); }
.nx-entry.is-live #nx-entry-status { color: var(--dk-up); }
#nx-entry-detail { font-size: 0.62rem; color: var(--dk-text-soft); }

/* probability blades */
.nx-blades { display: grid; gap: 0.3rem; }
.nx-blades-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    font-family: var(--dk-font-mono);
}
.nx-blades-track {
    position: relative;
    height: 0.85rem;
    border-radius: 0.3rem;
    background: var(--dk-inset);
    border: 1px solid var(--dk-line-dim);
    overflow: hidden;
    display: flex;
}
#nx-blade-up, #nx-blade-down { height: 100%; transition: width 800ms var(--dk-snap); }
#nx-blade-up {
    background: linear-gradient(90deg, rgba(60, 230, 164, 0.25), var(--dk-up));
    clip-path: polygon(0 0, 100% 0, calc(100% - 0.5rem) 100%, 0 100%);
}
#nx-blade-down {
    margin-left: auto;
    background: linear-gradient(90deg, var(--dk-down), rgba(255, 93, 120, 0.25));
    clip-path: polygon(0.5rem 0, 100% 0, 100% 100%, 0 100%);
}
.nx-blades-mid {
    position: absolute;
    top: -20%;
    bottom: -20%;
    width: 2px;
    left: 50%;
    background: rgba(196, 239, 255, 0.8);
    box-shadow: 0 0 8px rgba(65, 214, 255, 0.8);
}

/* lock facts + proofs */
.nx-oath-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr));
    gap: 0.7rem 1rem;
}
.nx-proofs { display: flex; align-items: center; gap: 0.4rem; }
.nx-proofs i {
    width: 1.5rem; height: 0.45rem;
    border-radius: 2px;
    background: var(--dk-inset);
    border: 1px solid var(--dk-line-dim);
}
.nx-proofs i.on {
    background: linear-gradient(90deg, var(--dk-cyan), var(--dk-ice));
    box-shadow: 0 0 8px rgba(65, 214, 255, 0.6);
    border-color: transparent;
}
.nx-reasons { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.3rem; }
.nx-reasons li {
    position: relative;
    padding-left: 1rem;
    font-size: 0.68rem;
    color: var(--dk-text-soft);
}
.nx-reasons li::before {
    content: "ᚲ";
    position: absolute;
    left: 0;
    color: var(--dk-cyan);
    font-size: 0.6rem;
}
#nx-warnings li::before { content: "ᛉ"; color: var(--dk-gold); }

/* ============================================================== FORGE ==== */
.nx-forge { margin-top: 1rem; }
.nx-forge .nx-card-body { padding: 0.9rem; }
.nx-forge-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.nx-forge-head h2 {
    margin: 0;
    font-family: var(--dk-font-display);
    font-size: 1rem;
    letter-spacing: 0.12em;
    color: var(--dk-silver);
}
.nx-forge-head h2 span { color: var(--dk-cyan); }
#flow-forge-panel { min-height: clamp(340px, 46vh, 620px); position: relative; }
#flow-forge-panel .flow-forge-v2-waiting { color: var(--dk-muted); font-size: 0.7rem; letter-spacing: 0.2em; display:grid; place-items:center; min-height: 300px; }
#nx-candles { width: 100%; height: clamp(320px, 44vh, 600px); display: none; }
.nx-forge.is-fallback #nx-candles { display: block; }

/* ============================================================== INTEL ==== */
.deck-intel {
    position: sticky;
    top: 4.4rem;
    display: grid;
    gap: 1rem;
    align-items: start;
}
.deck-intel .nx-card-body { padding: 0.85rem 0.95rem; }
.nx-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 0.8rem; }
.nx-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem 0.8rem; }

/* whale sonar */
.nx-sonar { display: grid; grid-template-columns: 4.6rem minmax(0,1fr); gap: 0.8rem; align-items: center; }
#nx-sonar-scope {
    width: 4.6rem; height: 4.6rem;
    border-radius: 50%;
    border: 1px solid var(--dk-line);
    background:
        radial-gradient(circle, rgba(65,214,255,0.08) 0 30%, transparent 31%),
        radial-gradient(circle, transparent 0 59%, rgba(65,214,255,0.12) 60% 61%, transparent 62%),
        var(--dk-inset);
    position: relative;
    overflow: hidden;
}
#nx-sonar-scope::before {
    content: "";
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, rgba(65, 214, 255, 0.4), transparent 60deg, transparent 360deg);
    animation: dk-spin 4s linear infinite;
}
#nx-sonar-scope.is-up::before { background: conic-gradient(from 0deg, rgba(60, 230, 164, 0.45), transparent 60deg, transparent 360deg); }
#nx-sonar-scope.is-down::before { background: conic-gradient(from 0deg, rgba(255, 93, 120, 0.45), transparent 60deg, transparent 360deg); }
#nx-sonar-dot {
    position: absolute;
    width: 0.5rem; height: 0.5rem;
    border-radius: 50%;
    background: var(--dk-cyan);
    box-shadow: 0 0 8px currentColor;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    transition: left 900ms var(--dk-snap), top 900ms var(--dk-snap), background 400ms;
}

/* structure mini-map */
.nx-structmap { position: relative; height: 5.4rem; margin-top: 0.3rem; }
.nx-struct-line {
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: var(--dk-line-strong);
}
.nx-struct-line small {
    position: absolute;
    right: 0;
    top: -1.05em;
    font-size: 0.55rem;
    letter-spacing: 0.16em;
    color: var(--dk-muted);
    font-family: var(--dk-font-mono);
}
#nx-struct-ceiling { top: 12%; background: linear-gradient(90deg, transparent, rgba(255,93,120,0.7)); }
#nx-struct-floor { bottom: 12%; background: linear-gradient(90deg, transparent, rgba(60,230,164,0.7)); }
#nx-struct-price {
    position: absolute;
    left: 8%;
    width: 84%;
    top: 50%;
    height: 2px;
    border-radius: 2px;
    background: var(--dk-ice);
    box-shadow: 0 0 10px rgba(65, 214, 255, 0.8);
    transition: top 900ms var(--dk-snap);
}
#nx-struct-strike {
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    border-top: 1px dashed rgba(242, 199, 107, 0.65);
    transition: top 900ms var(--dk-snap);
}
#nx-struct-strike small {
    position: absolute; left: 0; top: 0.1em;
    font-size: 0.55rem; color: var(--dk-gold); letter-spacing: 0.16em;
    font-family: var(--dk-font-mono);
}

/* evidence family bars */
.nx-evidence { display: grid; gap: 0.45rem; }
.nx-evrow { display: grid; grid-template-columns: 6.2rem minmax(0,1fr) 2.6rem; gap: 0.5rem; align-items: center; }
.nx-evrow small { font-size: 0.56rem; letter-spacing: 0.14em; color: var(--dk-muted); }
.nx-evrow .bar { height: 0.4rem; border-radius: 2px; background: var(--dk-inset); overflow: hidden; }
.nx-evrow .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--dk-cyan-dim), var(--dk-cyan)); transition: width 800ms var(--dk-snap); }
.nx-evrow.lean-up .bar i { background: linear-gradient(90deg, rgba(60,230,164,0.5), var(--dk-up)); }
.nx-evrow.lean-down .bar i { background: linear-gradient(90deg, rgba(255,93,120,0.5), var(--dk-down)); }
.nx-evrow strong { font-size: 0.6rem; text-align: right; font-family: var(--dk-font-mono); color: var(--dk-text-soft); }

/* ============================================================= LEDGER ==== */
.nx-ledger { margin-top: 1rem; }
.nx-ledger-tabs { display: flex; gap: 0.4rem; }
.nx-ledger-tabs button {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: transparent;
    color: var(--dk-titanium);
    font-family: var(--dk-font-ui);
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    cursor: pointer;
    transition: all 200ms;
}
.nx-ledger-tabs button.is-active {
    color: #06121d;
    background: linear-gradient(135deg, var(--dk-ice), var(--dk-cyan) 65%);
    border-color: transparent;
    box-shadow: 0 0 16px rgba(65, 214, 255, 0.35);
}
.nx-ledger-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
    gap: 0.7rem 1rem;
    padding: 0.8rem 0 0.9rem;
    border-bottom: 1px solid var(--dk-line-dim);
    margin-bottom: 0.9rem;
}
.nx-ledger-feed { display: grid; gap: 0.55rem; }
@media (min-width: 901px) {
    .nx-ledger-feed { max-height: 30rem; overflow-y: auto; padding-right: 0.3rem; }
}

.nx-oathcard {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(160deg, rgba(12, 30, 52, 0.72), rgba(5, 14, 27, 0.85));
    border: 1px solid var(--dk-line-dim);
    border-left: 3px solid var(--dk-line);
    border-radius: 0.5rem;
    transition: transform 200ms var(--dk-snap), border-color 200ms, box-shadow 240ms;
}
.nx-oathcard:hover { transform: translateX(4px); }
.nx-oathcard.is-win { border-left-color: var(--dk-up); }
.nx-oathcard.is-loss { border-left-color: var(--dk-down); }
.nx-oathcard.is-pass { border-left-color: var(--dk-gold); opacity: 0.85; }
.nx-oathcard.is-win:hover { box-shadow: -6px 0 22px -8px rgba(60, 230, 164, 0.5); }
.nx-oathcard.is-loss:hover { box-shadow: -6px 0 22px -8px rgba(255, 93, 120, 0.5); }
.nx-oathcard .dirmark {
    width: 2.1rem; height: 2.1rem;
    display: grid;
    place-items: center;
    border-radius: 0.5rem;
    font-family: var(--dk-font-display);
    font-size: 0.95rem;
    background: var(--dk-inset);
    border: 1px solid var(--dk-line-dim);
}
.nx-oathcard .dirmark.up { color: var(--dk-up); }   /* direction color follows the CALL, never the result */
.nx-oathcard .dirmark.down { color: var(--dk-down); }
.nx-oathcard .dirmark.pass { color: var(--dk-gold); }
.nx-oathcard .body { min-width: 0; }
.nx-oathcard .body .l1 { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; }
.nx-oathcard .body .l2 { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.58rem; color: var(--dk-muted); font-family: var(--dk-font-mono); margin-top: 0.2rem; }
.nx-oathcard .stamp {
    font-family: var(--dk-font-display);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    padding: 0.3rem 0.55rem;
    border: 1px solid currentColor;
    border-radius: 4px;
    transform: rotate(-1.6deg);
    white-space: nowrap;
}
.nx-oathcard.is-win .stamp { color: var(--dk-up); }
.nx-oathcard.is-loss .stamp { color: var(--dk-down); }
.nx-oathcard.is-pass .stamp { color: var(--dk-gold); }
.nx-oathcard.is-open .stamp { color: var(--dk-cyan); }

/* ============================================================= FOOTER ==== */
.deck-foot {
    position: relative;
    z-index: 2;
    width: min(2260px, 100% - 2rem);
    margin: 0 auto 2rem;
    padding: 1rem 0 0;
    border-top: 1px solid var(--dk-line-dim);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.6rem;
    justify-content: space-between;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--dk-muted);
}
.deck-foot a { color: var(--dk-frost); text-decoration: none; display: inline-block; padding: 1.3rem 0.55rem; margin: -0.55rem -0.1rem; }
.deck-foot a:hover { color: var(--dk-ice); text-shadow: 0 0 10px rgba(65,214,255,0.6); }

/* ============================================================ REVEAL ===== */
.dk-reveal { opacity: 1; }
.dk-reveal.dk-pre { opacity: 0; transform: translateY(16px); }
.dk-reveal.dk-in { opacity: 1; transform: none; transition: opacity 600ms var(--dk-snap), transform 600ms var(--dk-snap); }

/* ========================================================== RESPONSIVE === */
@media (max-width: 1280px) {
    .deck-body { grid-template-columns: var(--dk-rail-w) minmax(0, 1fr); }
    .deck-intel { position: static; grid-column: 2; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
}

@media (max-width: 900px) {
    .deck-body { grid-template-columns: minmax(0, 1fr); width: calc(100% - 1.2rem); }
    .deck-rail { display: none; }
    .deck-intel { grid-column: 1; }
    #nx-oath { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .nx-oath-status { justify-items: center; }
    .nx-oath-facts { width: 100%; }
    .nx-reasons li { text-align: left; }
    .deck-pulse { justify-content: flex-start; }
    #nx-spark { display: none; }
    .deck-contract-chip { display: none; }
    .deck-top { grid-template-columns: auto minmax(0,1fr) auto; gap: 0.6rem; }
    body.nexus-deck { padding-bottom: calc(4.6rem + env(safe-area-inset-bottom)); }

    /* bottom dock */
    .deck-dock {
        display: flex !important;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 70;
        justify-content: space-around;
        gap: 0.2rem;
        padding: 0.4rem max(0.5rem, env(safe-area-inset-right)) calc(0.4rem + env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
        background: linear-gradient(180deg, rgba(8, 22, 40, 0.97), rgba(3, 9, 18, 0.99));
        border-top: 1px solid var(--dk-line);
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .deck-dock .rail-btn { width: auto; min-width: 0; flex: 1 1 0; height: 3rem; border-radius: 0.7rem; flex-direction: column; gap: 0.12rem; display: flex; align-items: center; justify-content: center; padding: 0.2rem 0.1rem; }
    .deck-dock .rail-btn svg { width: 1.15rem; height: 1.15rem; }
    .deck-dock .rail-btn em { font-style: normal; font-size: 0.5rem; letter-spacing: 0.16em; }
    .deck-dock .rail-tip { display: none; }
    .nexus-horizon { display: none; }
}
.deck-dock { display: none; }

@media (max-width: 520px) {
    .deck-price-meta { display: none; }
    #nx-price { font-size: 1.2rem; }
    .deck-live { padding: 0.35rem 0.5rem; }
    .deck-live strong { font-size: 0.52rem; letter-spacing: 0.12em; }
}

/* touch */
@media (pointer: coarse) {
    .rail-btn, .nx-ledger-tabs button { min-height: 44px; min-width: 44px; }
}

/* =================================================== REDUCED MOTION ====== */
@media (prefers-reduced-motion: reduce) {
    .nexus-deck *, .nexus-deck *::before, .nexus-deck *::after { animation: none !important; }
    .dk-reveal { opacity: 1; transform: none; }
    #nx-dial .dial-progress { transition: none; }
}

/* ============================================================ GATE (login) */
body.nexus-gate { margin: 0; background: var(--dk-void); color: var(--dk-text); font-family: var(--dk-font-ui); }
.gate-split {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 3rem);
    width: min(1700px, 100% - 2.4rem);
    margin: 1.2rem auto 2.5rem;
    align-items: start;
}
.gate-hero {
    position: sticky;
    top: 1.2rem;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0.9rem;
    padding: clamp(1.2rem, 3vw, 3rem) 1rem;
}
.gate-hero .hero-brand-logo { position: relative; }
.gate-tag {
    font-family: var(--dk-font-display);
    font-size: clamp(1.15rem, 2vw, 1.7rem);
    letter-spacing: 0.22em;
    color: var(--dk-silver);
}
.gate-sub { font-size: 0.7rem; letter-spacing: 0.24em; color: var(--dk-muted); }
.gate-ticks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.gate-panel-col { min-width: 0; }
@media (max-width: 980px) {
    .gate-split { grid-template-columns: 1fr; }
    .gate-hero { position: static; padding-bottom: 0; }
}

/* gate-split must win over access.css shell layout */
body.valhalla-access-page main.access-shell.gate-split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 3rem);
    width: min(1700px, 100% - 2.4rem);
    align-items: start;
    padding: clamp(1rem, 2.5vw, 2.2rem);
}
body.valhalla-access-page main.access-shell.gate-split .gate-hero {
    position: sticky;
    top: 1.2rem;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0.9rem;
}
@media (max-width: 980px) {
    body.valhalla-access-page main.access-shell.gate-split { grid-template-columns: 1fr; }
    body.valhalla-access-page main.access-shell.gate-split .gate-hero { position: static; }
}

/* ---- R2 polish round 1 ---- */
/* mobile oath stacks and centers */
@media (max-width: 900px) {
    #nx-oath { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .nx-blades { width: 100%; max-width: 30rem; margin-inline: auto; }
    .nx-oath-facts { text-align: left; }
    .nx-reasons { text-align: left; }
}

/* compact phone top bar — two clean rows, nothing overlaps */
@media (max-width: 640px) {
    .deck-brand-name { display: none; }
    .deck-price-label { display: none; }
    .deck-top {
        grid-template-columns: auto minmax(0, 1fr);
        row-gap: 0.45rem;
        column-gap: 0.5rem;
        padding-inline: max(0.6rem, env(safe-area-inset-left)) max(0.6rem, env(safe-area-inset-right));
    }
    .deck-brand { grid-row: 1; grid-column: 1; }
    .deck-pulse { grid-row: 1; grid-column: 2; justify-self: start; min-width: 0; }
    .deck-price-row { flex-wrap: wrap; row-gap: 0; }
    #nx-price { font-size: clamp(0.95rem, 5.2vw, 1.15rem); overflow-wrap: anywhere; }
    .deck-contract {
        grid-row: 2;
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem;
        min-width: 0;
    }
    .deck-contract-chip {
        display: block;              /* the ≤900px rule hides it; phones keep a truncating chip */
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.25rem 0.5rem;
    }
    .deck-contract-chip small { display: none; }
    .deck-contract-chip > div {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.56rem;
    }
    .nx-product select { max-width: 30vw; }
}

/* structure map labels stay inside the card */
.nx-structmap { overflow: hidden; }
.nx-struct-line small { right: 0.15rem; font-size: 0.52rem; }
#nx-struct-strike small { left: 0.15rem; }

/* rail vitals: no per-letter wrap */
.rail-vitals { width: 100%; padding: 0 0.2rem; font-size: 0.5rem; letter-spacing: 0.08em; }
.rail-vitals strong { font-size: 0.85rem; }

/* live chat launcher joins the deck language */
.nexus-deck .live-chat-launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--dk-line) !important;
    border-radius: 999px !important;
    background: var(--dk-inset) !important;
    color: var(--dk-frost) !important;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    box-shadow: none !important;
    transition: box-shadow 220ms, color 220ms, border-color 220ms;
}
.nexus-deck .live-chat-launcher:hover {
    color: var(--dk-ice) !important;
    border-color: var(--dk-line-strong) !important;
    box-shadow: var(--dk-glow-cyan) !important;
}
.nexus-deck .live-chat-launcher svg { width: 1rem; height: 1rem; fill: currentColor; }
@media (max-width: 640px) {
    .nexus-deck .live-chat-launcher-label { display: none; }
    .nexus-deck .live-chat-launcher { padding: 0.45rem 0.55rem; }
}

/* proofs row alignment */
.nx-proofs-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* forced fallback chart: hide the v2 host, show the built-in candle canvas */
.nx-forge.is-fallback #flow-forge-panel { display: none; }

/* ============================================================== RAID ===== */
.nx-raid { margin-top: 1rem; }
.nx-raid-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1rem 1.4rem;
    align-items: start;
}
.nx-raid-grid * { min-width: 0; }
.nx-raid-action, .nx-raid-targets .nx-fact strong, #nx-raid-note { overflow-wrap: anywhere; }
.nx-raid-action { display: grid; gap: 0.4rem; align-content: start; }
.nx-raid-action small { font-size: 0.53rem; letter-spacing: 0.24em; color: var(--dk-muted); }
#nx-raid-action {
    font-family: var(--dk-font-display);
    font-size: clamp(1rem, 1.4vw, 1.45rem);
    letter-spacing: 0.06em;
    color: var(--dk-gold);
    line-height: 1.05;
}
.nx-raid.is-armed #nx-raid-action { color: var(--dk-cyan); }
.nx-raid.is-live-up #nx-raid-action { color: var(--dk-up); }
.nx-raid.is-live-down #nx-raid-action { color: var(--dk-down); }
#nx-raid-note { font-size: 0.62rem; color: var(--dk-text-soft); }
.nx-raid-dirline { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.3rem; }
.nx-raid-targets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.7rem 1rem;
}
.nx-raid-side { display: grid; gap: 0.6rem; }
.nx-raid-mini {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--dk-line-dim);
    border-left: 3px solid var(--dk-line);
    border-radius: 0.45rem;
    background: var(--dk-inset);
    display: grid;
    gap: 0.25rem;
}
.nx-raid-mini small { font-size: 0.52rem; letter-spacing: 0.22em; color: var(--dk-muted); }
.nx-raid-mini .l { display: flex; align-items: center; gap: 0.5rem; }
.nx-raid-mini em { font-style: normal; font-size: 0.6rem; color: var(--dk-text-soft); }
.nx-raid-mini.is-alert { border-left-color: var(--dk-gold); }
.nx-raid-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.4rem;
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--dk-line-dim);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    color: var(--dk-muted);
}
.nx-raid-foot strong { color: var(--dk-text-soft); margin-left: 0.25rem; }
#nx-raid-disclosure { margin-left: auto; color: var(--dk-gold); }
@media (max-width: 1180px) {
    .nx-raid-grid { grid-template-columns: 1fr; }
}

/* ======================================================= KEEPER GATE ===== */
body.keeper-gate { background: #050302; }
body.keeper-gate .nexus-atmosphere::before {
    background:
        radial-gradient(56% 42% at 16% -8%, rgba(242, 199, 107, 0.12), transparent 60%),
        radial-gradient(44% 36% at 84% -6%, rgba(255, 140, 60, 0.08), transparent 58%),
        radial-gradient(70% 58% at 50% 116%, rgba(60, 34, 6, 0.5), transparent 70%),
        linear-gradient(180deg, #070402 0%, #0b0603 46%, #0d0804 100%);
}
body.keeper-gate .nexus-horizon {
    background:
        linear-gradient(to top, rgba(242, 199, 107, 0.10), transparent 70%),
        repeating-linear-gradient(90deg, rgba(242, 199, 107, 0.12) 0 1px, transparent 1px 90px),
        repeating-linear-gradient(0deg, rgba(242, 199, 107, 0.10) 0 1px, transparent 1px 54px);
}
.keeper-split {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(1.2rem, 4vw, 4rem);
    width: min(1500px, 100% - 2.4rem);
    margin: clamp(1rem, 4vh, 3.5rem) auto 2rem;
    align-items: center;
}
.keeper-hero { text-align: center; display: grid; justify-items: center; gap: 1rem; }
.keeper-sigil {
    position: relative;
    width: clamp(9rem, 16vw, 13rem);
    height: clamp(9rem, 16vw, 13rem);
    display: grid;
    place-items: center;
}
.keeper-sigil > b {
    font-family: var(--dk-font-display);
    font-size: clamp(4rem, 7vw, 6rem);
    color: #140b02;
    background: linear-gradient(140deg, #ffe9b8, var(--dk-gold) 45%, #a87a2e);
    width: 62%;
    height: 62%;
    display: grid;
    place-items: center;
    border-radius: 26%;
    box-shadow: 0 0 40px rgba(242, 199, 107, 0.35), inset 0 2px 0 rgba(255,255,255,0.5);
    transform: rotate(-3deg);
}
.keeper-sigil::before, .keeper-sigil::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(242, 199, 107, 0.5);
    animation: dk-spin 50s linear infinite;
}
.keeper-sigil::after {
    inset: -8%;
    border-style: solid;
    border-color: rgba(242, 199, 107, 0.18);
    border-top-color: rgba(242, 199, 107, 0.7);
    animation-duration: 16s;
}
.keeper-hero h1 {
    margin: 0;
    font-family: var(--dk-font-display);
    font-size: clamp(1.8rem, 3.4vw, 3rem);
    letter-spacing: 0.12em;
    line-height: 1.1;
    color: #f6e7c6;
}
.keeper-hero h1 span { color: var(--dk-gold); }
.keeper-kicker { font-size: 0.62rem; letter-spacing: 0.34em; color: var(--dk-gold); }
.keeper-copy { max-width: 34rem; font-size: 0.72rem; line-height: 1.7; color: #cdbb96; }
.keeper-risk { font-size: 0.6rem; letter-spacing: 0.14em; color: #8d7c58; }

.keeper-card { filter: drop-shadow(0 24px 48px rgba(0,0,0,0.6)) drop-shadow(0 0 28px rgba(242,199,107,0.12)); }
.keeper-card > .nx-card-body {
    background: linear-gradient(164deg, rgba(46, 32, 12, 0.82), rgba(16, 10, 3, 0.94));
    border-color: rgba(242, 199, 107, 0.35);
    padding: 1.4rem 1.5rem 1.5rem;
}
.keeper-card > .nx-card-body::before {
    background:
        linear-gradient(135deg, rgba(242, 199, 107, 0.9) 0 2px, transparent 2px) 0 0 / calc(var(--dk-notch) + 2px) calc(var(--dk-notch) + 2px) no-repeat,
        linear-gradient(-45deg, rgba(242, 199, 107, 0.6) 0 2px, transparent 2px) 100% 100% / calc(var(--dk-notch) + 2px) calc(var(--dk-notch) + 2px) no-repeat;
}
.keeper-card > .nx-card-body::after {
    background: linear-gradient(90deg, transparent, rgba(242, 199, 107, 0.85) 50%, transparent);
}
.keeper-card h2 {
    margin: 0 0 0.2rem;
    font-family: var(--dk-font-display);
    font-size: 1.25rem;
    letter-spacing: 0.06em;
    color: #f6e7c6;
}
.keeper-card .panel-label { font-size: 0.56rem; letter-spacing: 0.3em; color: var(--dk-gold); margin: 0 0 0.7rem; }
.keeper-card label { display: block; margin: 1rem 0 0.35rem; font-size: 0.56rem; letter-spacing: 0.24em; color: #b09a6a; }
.keeper-card input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    font-family: var(--dk-font-mono);
    font-size: 0.9rem;
    color: #f6e7c6;
    background: rgba(8, 5, 1, 0.8);
    border: 1px solid rgba(242, 199, 107, 0.3);
    border-radius: 0.45rem;
    transition: border-color 200ms, box-shadow 200ms;
}
.keeper-card input:focus {
    outline: none;
    border-color: rgba(242, 199, 107, 0.7);
    box-shadow: 0 0 0 3px rgba(242, 199, 107, 0.14), 0 0 22px rgba(242, 199, 107, 0.2);
}
.keeper-card .security-challenge { margin-top: 0.9rem; min-height: 20px; }
.keeper-card button[type="submit"] {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-top: 1.1rem;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--dk-font-ui);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    color: #140b02;
    background: linear-gradient(135deg, #ffe9b8, var(--dk-gold) 55%, #c9973f);
    border: 1px solid rgba(255, 233, 184, 0.6);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 160ms var(--dk-blade), box-shadow 240ms;
}
.keeper-card button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(242, 199, 107, 0.35);
}
.keeper-card .access-message {
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 93, 120, 0.5);
    border-radius: 0.45rem;
    background: rgba(70, 15, 25, 0.4);
    color: #ffb9c6;
    font-size: 0.68rem;
    margin-bottom: 0.6rem;
}
.keeper-foot {
    position: relative;
    z-index: 2;
    width: min(1500px, 100% - 2.4rem);
    margin: 0 auto 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.6rem;
    justify-content: space-between;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(242, 199, 107, 0.16);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    color: #8d7c58;
}
#gate-clock { font-family: var(--dk-font-mono); color: var(--dk-gold); }
@media (max-width: 900px) {
    .keeper-split { grid-template-columns: 1fr; text-align: center; }
}

/* ====================================================== KEEPER'S KEEP ==== */
/* /admin — deck shell + gold command trim around the working panels */
body.keeper-keep {
    background: #060401;
    color: #efe3c8;
    font-family: var(--dk-font-ui);
}
body.keeper-keep .aurora { display: none; }
body.keeper-keep .nexus-atmosphere::before {
    background:
        radial-gradient(56% 42% at 16% -8%, rgba(242, 199, 107, 0.10), transparent 60%),
        radial-gradient(44% 36% at 84% -6%, rgba(143, 123, 255, 0.06), transparent 58%),
        linear-gradient(180deg, #070402 0%, #0a0603 46%, #0c0704 100%);
}
body.keeper-keep .nexus-horizon { display: none; }

.keeper-top {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem clamp(0.8rem, 2vw, 1.6rem);
    background: linear-gradient(180deg, rgba(26, 18, 6, 0.95), rgba(10, 6, 2, 0.92));
    border-bottom: 1px solid rgba(242, 199, 107, 0.28);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.keeper-top::after {
    content: "";
    position: absolute;
    inset: auto 0 -2px 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(242, 199, 107, 0.9) 40%, rgba(255, 233, 184, 0.9) 50%, rgba(242, 199, 107, 0.9) 60%, transparent);
    background-size: 240% 100%;
    animation: dk-crown 10s linear infinite;
}
.keeper-top .k-mark {
    width: 2.4rem; height: 2.4rem;
    display: grid; place-items: center;
    font-family: var(--dk-font-display);
    font-size: 1.3rem;
    color: #140b02;
    background: linear-gradient(140deg, #ffe9b8, var(--dk-gold) 55%, #a87a2e);
    border-radius: 26%;
    text-decoration: none;
    box-shadow: 0 0 22px rgba(242, 199, 107, 0.3);
}
.keeper-top .k-name strong {
    display: block;
    font-family: var(--dk-font-display);
    font-size: 1rem;
    letter-spacing: 0.14em;
    color: #f6e7c6;
    white-space: nowrap;
}
.keeper-top .k-name small { display:block; font-size: 0.56rem; letter-spacing: 0.3em; color: var(--dk-gold); }
.keeper-top .k-actions { display: flex; align-items: center; gap: 0.6rem; }
.keeper-top .k-actions a,
.keeper-top .k-actions button {
    padding: 0.45rem 0.85rem;
    font-family: var(--dk-font-ui);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--dk-gold);
    background: rgba(12, 8, 2, 0.8);
    border: 1px solid rgba(242, 199, 107, 0.35);
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: all 200ms;
}
.keeper-top .k-actions a:hover,
.keeper-top .k-actions button:hover {
    color: #140b02;
    background: linear-gradient(135deg, #ffe9b8, var(--dk-gold));
    box-shadow: 0 0 18px rgba(242, 199, 107, 0.35);
}

.keeper-body {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: var(--dk-rail-w) minmax(0, 1fr);
    gap: 1rem;
    width: min(2000px, 100% - 2rem);
    margin: 1rem auto 2.5rem;
    align-items: start;
}
.keeper-body .deck-rail {
    background: linear-gradient(164deg, rgba(30, 21, 8, 0.9), rgba(10, 6, 2, 0.94));
    border-color: rgba(242, 199, 107, 0.25);
    top: 4.2rem;
}
.keeper-body .rail-btn { color: #b09a6a; }
.keeper-body .rail-btn:hover { color: #ffe9b8; background: rgba(242, 199, 107, 0.1); }
.keeper-body .rail-btn.is-active {
    color: #140b02;
    background: linear-gradient(140deg, #ffe9b8, var(--dk-gold) 65%);
    border-color: rgba(255, 233, 184, 0.5);
    box-shadow: 0 0 20px rgba(242, 199, 107, 0.35);
}
.keeper-body .rail-tip { border-color: rgba(242,199,107,0.35); color: #ffe9b8; background: rgba(12,8,2,0.95); }

/* restyle the working panels in the deck language */
body.keeper-keep .admin-shell { display: grid; gap: 1rem; min-width: 0; }
body.keeper-keep .admin-panel,
body.keeper-keep .admin-main-grid .admin-panel,
body.keeper-keep .admin-status-grid {
    position: relative;
    background: linear-gradient(164deg, rgba(36, 25, 9, 0.72), rgba(12, 8, 3, 0.92)) !important;
    border: 1px solid rgba(242, 199, 107, 0.24) !important;
    border-radius: 0 !important;
    clip-path: polygon(var(--dk-notch) 0, 100% 0, 100% calc(100% - var(--dk-notch)), calc(100% - var(--dk-notch)) 100%, 0 100%, 0 var(--dk-notch));
    box-shadow: none !important;
    padding: 1.1rem 1.2rem !important;
}
body.keeper-keep .admin-main-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); }
body.keeper-keep .admin-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.8rem 1.2rem;
}
body.keeper-keep .admin-status-grid article { background: none; border: 0; padding: 0.2rem 0; }
body.keeper-keep .admin-status-grid small {
    display: block;
    font-size: 0.53rem;
    letter-spacing: 0.22em;
    color: #8d7c58;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}
body.keeper-keep .admin-status-grid strong {
    font-family: var(--dk-font-mono);
    font-size: 0.85rem;
    color: #ffe9b8;
}
body.keeper-keep .admin-panel h2,
body.keeper-keep .admin-panel h3 {
    font-family: var(--dk-font-display);
    letter-spacing: 0.05em;
    color: #f6e7c6;
}
body.keeper-keep .panel-label,
body.keeper-keep .card-crown span { color: var(--dk-gold) !important; letter-spacing: 0.26em; }
body.keeper-keep .admin-panel-copy { color: #cdbb96; }
body.keeper-keep .admin-panel label { color: #b09a6a; letter-spacing: 0.18em; }
body.keeper-keep .admin-panel input,
body.keeper-keep .admin-panel select,
body.keeper-keep .admin-panel textarea {
    background: rgba(8, 5, 1, 0.8) !important;
    border: 1px solid rgba(242, 199, 107, 0.3) !important;
    color: #f6e7c6 !important;
    border-radius: 0.4rem;
    font-family: var(--dk-font-mono);
}
body.keeper-keep .admin-panel input:focus,
body.keeper-keep .admin-panel select:focus,
body.keeper-keep .admin-panel textarea:focus {
    outline: none;
    border-color: rgba(242, 199, 107, 0.7) !important;
    box-shadow: 0 0 0 3px rgba(242, 199, 107, 0.14);
}
body.keeper-keep .admin-panel button,
body.keeper-keep .admin-panel .primary-action {
    font-family: var(--dk-font-ui);
    letter-spacing: 0.16em;
    color: #ffe9b8;
    background: rgba(242, 199, 107, 0.1);
    border: 1px solid rgba(242, 199, 107, 0.4);
    border-radius: 0.45rem;
    cursor: pointer;
    transition: all 200ms;
}
body.keeper-keep .admin-panel button:hover { background: rgba(242, 199, 107, 0.2); box-shadow: 0 0 16px rgba(242,199,107,0.2); }
body.keeper-keep .admin-panel button[type="submit"],
body.keeper-keep .admin-panel .admin-action {
    color: #140b02;
    background: linear-gradient(135deg, #ffe9b8, var(--dk-gold) 60%, #c9973f);
    border-color: rgba(255, 233, 184, 0.6);
    font-weight: 700;
}
body.keeper-keep .admin-panel table { border-color: rgba(242, 199, 107, 0.2) !important; }
body.keeper-keep .admin-panel th { color: #b09a6a !important; letter-spacing: 0.16em; }
body.keeper-keep .admin-panel td { color: #efe3c8 !important; border-color: rgba(242, 199, 107, 0.12) !important; font-family: var(--dk-font-mono); }
body.keeper-keep .admin-panel tr:hover td { background: rgba(242, 199, 107, 0.05); }
body.keeper-keep ::selection { background: rgba(242, 199, 107, 0.35); color: #fff; }
body.keeper-keep * { scrollbar-color: rgba(242,199,107,0.4) rgba(12,8,2,0.6); }
body.keeper-keep *::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(242,199,107,0.5), rgba(150,110,40,0.5)); }
@media (max-width: 900px) {
    .keeper-body { grid-template-columns: 1fr; }
    /* the rail becomes a sticky horizontal wing bar — the console keeps its
       navigation on phones instead of losing it */
    .keeper-body .deck-rail {
        display: flex;               /* the global mobile rule hides .deck-rail — keeper keeps its wing bar */
        position: sticky;
        top: max(0.4rem, env(safe-area-inset-top));
        z-index: 40;
        flex-direction: row;
        justify-content: flex-start;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        width: 100%;
        padding: 0.4rem;
        gap: 0.35rem;
        scrollbar-width: none;
    }
    .keeper-body .deck-rail::-webkit-scrollbar { display: none; }
    .keeper-body .deck-rail .rail-btn { flex: 0 0 auto; }
    .keeper-body .deck-rail .rail-tip {
        position: static;
        opacity: 1;
        transform: none;
        border: 0;
        background: transparent;
        padding: 0 0.15rem 0 0.3rem;
        font-size: 0.52rem;
        color: inherit;
    }
    .keeper-body .deck-rail .rail-btn { display: inline-flex; align-items: center; width: auto; padding: 0 0.55rem; }
}

/* ---- R3 polish ---- */
/* anchored sections clear the sticky top bar */
#nx-oath-card, #nx-forge, #nx-raid, #nx-ledger, #nx-intel-anchor, #nx-ladder-card,
#keeper-status, #maintenance-control-panel, #keeper-forge, #next-beta-access-panel,
#trial-admin-user-roster, #commerce-code-manager, #admin-abuse-control, #v171-owner-assistant {
    scroll-margin-top: 4.8rem;
}

/* keeper keep: silence legacy status-card chrome and the light-mode toggle */
body.keeper-keep .admin-status-grid article,
body.keeper-keep .admin-status-grid article::before,
body.keeper-keep .admin-status-grid article::after {
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}
body.keeper-keep [data-theme-toggle],
body.keeper-keep .theme-toggle { display: none !important; }

/* keeper gate: center the split in the viewport */
.keeper-split { min-height: calc(100vh - 10rem); align-content: center; }
body.keeper-keep .admin-status-grid article {
    display: grid !important;
    gap: 0.25rem !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    align-content: start;
}

/* ╔══════════════════════════════════════════════════════════════════════╗
   ║  NEXUS R4 LAYER — audit fixes, new stations, cinematics, wow motion  ║
   ╚══════════════════════════════════════════════════════════════════════╝ */

/* ------------------------------------------------ global wrap-safety ---- */
.nx-card-body, .nx-fact, .nx-chip, .nx-fact strong { min-width: 0; }
.nx-fact strong { overflow-wrap: anywhere; }
.nx-chip { white-space: normal; text-align: center; }

/* interactive minimums (44px law) */
.nx-ledger-tabs button, .nx-ws-tabs button, .dock-sheet a, .dock-sheet button,
.nx-more-btn, .deck-live, .rail-btn, .keeper-top .k-actions a, .keeper-top .k-actions button {
    min-height: 44px;
}
.nx-ledger-tabs button, .nx-ws-tabs button { display: inline-flex; align-items: center; }

/* ------------------------------------------------ atmosphere v2 --------- */
.nx-aurora-curtain {
    position: absolute;
    inset: -20% -10%;
    /* R9G QUIET DECK: the 30px blur used to be re-rendered over a layer larger than the screen on
       every frame of a 38 s animation. The softness now lives in the gradients themselves and the
       only thing that animates is the drift - a compositor-only move that costs nothing. */
    background:
        radial-gradient(46% 34% at 22% 8%, rgba(64, 150, 255, 0.18), rgba(64, 150, 255, 0.06) 45%, transparent 72%),
        radial-gradient(42% 30% at 74% 4%, rgba(143, 123, 255, 0.15), rgba(143, 123, 255, 0.05) 45%, transparent 70%),
        radial-gradient(34% 26% at 50% 14%, rgba(45, 220, 200, 0.09), rgba(45, 220, 200, 0.03) 45%, transparent 72%);
    animation: r4-curtain 38s ease-in-out infinite alternate;
    pointer-events: none;
    will-change: transform, opacity;
}
@keyframes r4-curtain {
    0%   { transform: translate3d(-2%, 0, 0) scale(1); opacity: 1; }
    50%  { transform: translate3d(2%, 1.5%, 0) scale(1.06); opacity: 0.86; }
    100% { transform: translate3d(-1%, -1%, 0) scale(1.02); opacity: 0.95; }
}
.nexus-deck .nexus-atmosphere > * { will-change: transform; }

/* page veil — section-jump + entry transition */
.nx-veil {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(80% 60% at 50% 50%, rgba(65, 214, 255, 0.10), transparent 70%),
        linear-gradient(180deg, rgba(1, 5, 11, 0.94), rgba(1, 5, 11, 0.94));
}
.nx-veil.is-flash { animation: r4-veil 620ms var(--dk-snap); }
@keyframes r4-veil { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ------------------------------------------------ intro overlay --------- */
.nx-intro {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 1.1rem;
    background: #01050b;
    transition: opacity 700ms var(--dk-snap), visibility 700ms;
}
.nx-intro.is-done { opacity: 0; visibility: hidden; }
.nx-intro-mark { width: clamp(9rem, 30vw, 15rem); height: auto; filter: drop-shadow(0 0 44px rgba(65, 214, 255, 0.35)); }
.nx-intro-mark path { stroke-dasharray: 900; stroke-dashoffset: 900; fill-opacity: 0; }
.nx-intro.is-run .nx-intro-mark path {
    animation: r4-draw 1.5s var(--dk-snap) forwards, r4-fill 0.8s 1.2s forwards;
}
@keyframes r4-draw { to { stroke-dashoffset: 0; } }
@keyframes r4-fill { to { fill-opacity: 1; } }
.nx-intro-title {
    font-family: var(--dk-font-display);
    font-size: clamp(1.2rem, 4vw, 2rem);
    letter-spacing: 0.34em;
    color: var(--dk-silver);
    opacity: 0;
    text-align: center;
}
.nx-intro-sub { font-size: 0.62rem; letter-spacing: 0.4em; color: var(--dk-gold); opacity: 0; }
.nx-intro.is-run .nx-intro-title { animation: r4-rise 900ms 1.1s var(--dk-snap) forwards; }
.nx-intro.is-run .nx-intro-sub { animation: r4-rise 900ms 1.35s var(--dk-snap) forwards; }
@keyframes r4-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.nx-intro-flash { position: absolute; inset: 0; background: #cfeaff; opacity: 0; pointer-events: none; }
.nx-intro.is-run .nx-intro-flash { animation: r4-flash 2.2s linear forwards; }
@keyframes r4-flash {
    0%, 8% { opacity: 0; } 9% { opacity: 0.5; } 11% { opacity: 0; }
    13% { opacity: 0.28; } 15% { opacity: 0; } 100% { opacity: 0; }
}
.nx-intro-skip {
    position: absolute;
    bottom: max(1.2rem, env(safe-area-inset-bottom));
    right: 1.4rem;
    padding: 0.55rem 1rem;
    font-size: 0.6rem;
    letter-spacing: 0.24em;
    color: var(--dk-titanium);
    background: transparent;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    cursor: pointer;
    min-height: 44px;
}
.nx-intro-skip:hover { color: var(--dk-ice); border-color: var(--dk-line-strong); }
@media (prefers-reduced-motion: reduce) { .nx-intro { display: none !important; } }

/* sound toggle */
.nx-sound {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    min-height: 44px;
    min-width: 44px;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: var(--dk-inset);
    color: var(--dk-frost);
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    cursor: pointer;
    transition: color 200ms, border-color 200ms, box-shadow 200ms;
}
.nx-sound:hover { color: var(--dk-ice); border-color: var(--dk-line-strong); box-shadow: var(--dk-glow-cyan); }
.nx-sound svg { width: 1rem; height: 1rem; }
.nx-sound[aria-pressed="false"] { opacity: 0.65; }
.nx-sound[aria-pressed="false"] .nx-sound-on { display: none; }
.nx-sound[aria-pressed="true"] .nx-sound-off { display: none; }

/* product switcher */
.nx-product {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
.nx-product select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.5rem 1.7rem 0.5rem 0.8rem;
    font-family: var(--dk-font-ui);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    color: var(--dk-ice);
    background: var(--dk-inset);
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    cursor: pointer;
    min-height: 44px;
}
.nx-product::after {
    content: "▾";
    position: absolute;
    right: 0.7rem;
    color: var(--dk-cyan);
    pointer-events: none;
    font-size: 0.6rem;
}
.nx-product select:hover { border-color: var(--dk-line-strong); }

/* ------------------------------------------------ market row: quotes+SR - */
.nx-market-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 1rem;
    margin-top: 1rem;
    align-items: stretch;
}
@media (max-width: 1180px) { .nx-market-row { grid-template-columns: 1fr; } }

/* live session quotes */
.nx-quotes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.nx-qside {
    position: relative;
    padding: 0.85rem 0.9rem;
    border-radius: 0.6rem;
    border: 1px solid var(--dk-line-dim);
    background: var(--dk-inset);
    display: grid;
    gap: 0.2rem;
    overflow: hidden;
}
.nx-qside::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
}
.nx-qside.up::before { background: linear-gradient(180deg, var(--dk-up), transparent); }
.nx-qside.down::before { background: linear-gradient(180deg, var(--dk-down), transparent); }
.nx-qside small { font-size: 0.55rem; letter-spacing: 0.26em; color: var(--dk-muted); }
.nx-qside .ask {
    font-family: var(--dk-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 600;
    line-height: 1;
}
.nx-qside.up .ask { color: var(--dk-up); text-shadow: 0 0 22px rgba(60, 230, 164, 0.35); }
.nx-qside.down .ask { color: var(--dk-down); text-shadow: 0 0 22px rgba(255, 93, 120, 0.35); }
.nx-qside .bid { font-family: var(--dk-font-mono); font-size: 0.68rem; color: var(--dk-text-soft); }
.nx-qside .tag { font-size: 0.54rem; letter-spacing: 0.18em; color: var(--dk-muted); }
.nx-quotes-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    margin-top: 0.75rem;
    font-size: 0.6rem;
    color: var(--dk-muted);
    letter-spacing: 0.12em;
}
.nx-quotes-foot strong { color: var(--dk-text-soft); font-family: var(--dk-font-mono); }

/* support & resistance panel */
.nx-sr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 560px) { .nx-sr-grid, .nx-quotes-grid { grid-template-columns: 1fr; } }
.nx-sr-side {
    border: 1px solid var(--dk-line-dim);
    border-radius: 0.6rem;
    background: var(--dk-inset);
    padding: 0.8rem 0.9rem;
    display: grid;
    gap: 0.5rem;
}
.nx-sr-side header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.3rem; }
.nx-sr-side header small { font-size: 0.55rem; letter-spacing: 0.24em; }
.nx-sr-side.ceiling header small { color: var(--dk-down); }
.nx-sr-side.floor header small { color: var(--dk-up); }
.nx-sr-price { font-family: var(--dk-font-mono); font-size: 1.05rem; color: var(--dk-ice); }
.nx-sr-meter { position: relative; height: 0.5rem; border-radius: 3px; background: rgba(2, 8, 17, 0.9); overflow: hidden; }
.nx-sr-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; transition: width 800ms var(--dk-snap); }
.nx-sr-side.ceiling .nx-sr-meter i { background: linear-gradient(90deg, rgba(255,93,120,0.4), var(--dk-down)); }
.nx-sr-side.floor .nx-sr-meter i { background: linear-gradient(90deg, rgba(60,230,164,0.4), var(--dk-up)); }
.nx-sr-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; }
.nx-sr-counts .nx-fact small { font-size: 0.48rem; letter-spacing: 0.14em; }
.nx-sr-counts .nx-fact strong { font-size: 0.78rem; }
.nx-sr-prev { font-size: 0.56rem; color: var(--dk-muted); font-family: var(--dk-font-mono); overflow-wrap: anywhere; }

/* ------------------------------------------------ workspaces ------------ */
.nx-ws { margin-top: 1rem; }
.nx-ws-tabs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.2rem;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 1.2rem), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 1.2rem), transparent);
}
.nx-ws-tabs::-webkit-scrollbar { display: none; }
.nx-ws-tabs button {
    flex: 0 0 auto;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: transparent;
    color: var(--dk-titanium);
    font-family: var(--dk-font-ui);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 200ms;
    white-space: nowrap;
}
.nx-ws-tabs button:hover { color: var(--dk-ice); background: rgba(65, 214, 255, 0.08); }
.nx-ws-tabs button.is-active {
    color: #06121d;
    background: linear-gradient(135deg, var(--dk-ice), var(--dk-cyan) 65%);
    border-color: transparent;
    box-shadow: 0 0 16px rgba(65, 214, 255, 0.35);
}
.nx-ws-pane { display: none; margin-top: 0.9rem; animation: r4-pane 420ms var(--dk-snap); }
.nx-ws-pane.is-active { display: block; }
@keyframes r4-pane { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.nx-wall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(8.4rem, 100%), 1fr));
    gap: 0.7rem 1rem;
}
.nx-subhead {
    margin: 0.9rem 0 0.5rem;
    font-size: 0.56rem;
    letter-spacing: 0.28em;
    color: var(--dk-frost);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.nx-subhead::after { content: ""; flex: 1; height: 1px; background: var(--dk-line-dim); }
.nx-meter { position: relative; height: 0.5rem; border-radius: 3px; background: rgba(2,8,17,0.9); overflow: hidden; }
.nx-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: linear-gradient(90deg, var(--dk-cyan-dim), var(--dk-cyan)); transition: width 700ms var(--dk-snap); }
.nx-meter.gold i { background: linear-gradient(90deg, rgba(242,199,107,0.4), var(--dk-gold)); }
.nx-updates { display: grid; gap: 0.6rem; }
.nx-update {
    display: grid;
    gap: 0.25rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--dk-line-dim);
    border-left: 3px solid var(--dk-cyan);
    border-radius: 0.5rem;
    background: var(--dk-inset);
}
.nx-update .l1 { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: baseline; }
.nx-update .l1 strong { font-size: 0.74rem; letter-spacing: 0.06em; }
.nx-update .l1 time { font-size: 0.56rem; color: var(--dk-muted); font-family: var(--dk-font-mono); }
.nx-update p { margin: 0; font-size: 0.66rem; color: var(--dk-text-soft); line-height: 1.55; }
.nx-seq-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.nx-seq-chips i {
    font-style: normal;
    font-family: var(--dk-font-mono);
    font-size: 0.56rem;
    padding: 0.18rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--dk-line-dim);
}
.nx-seq-chips i.u { color: var(--dk-up); border-color: rgba(60,230,164,0.4); }
.nx-seq-chips i.d { color: var(--dk-down); border-color: rgba(255,93,120,0.4); }

/* ------------------------------------------------ dock v2 (5 slots) ----- */
@media (max-width: 900px) {
    .deck-dock { gap: 0.15rem; padding: 0.35rem max(0.4rem, env(safe-area-inset-right)) calc(0.35rem + env(safe-area-inset-bottom)) max(0.4rem, env(safe-area-inset-left)); }
    .deck-dock .rail-btn em { font-size: 0.46rem; letter-spacing: 0.1em; }
    body.nexus-deck { padding-bottom: calc(5.4rem + env(safe-area-inset-bottom)); }
    .deck-foot { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
}
.dock-sheet {
    position: fixed;
    left: 0.6rem;
    right: 0.6rem;
    bottom: calc(4.4rem + env(safe-area-inset-bottom));
    z-index: 72;
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
    gap: 0.4rem;
    padding: 0.7rem;
    background: linear-gradient(180deg, rgba(10, 26, 46, 0.98), rgba(4, 11, 22, 0.99));
    border: 1px solid var(--dk-line);
    border-radius: 0.9rem;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.6);
}
.dock-sheet.is-open { display: grid; animation: r4-pane 260ms var(--dk-snap); }
.dock-sheet a, .dock-sheet button {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--dk-line-dim);
    border-radius: 0.6rem;
    background: var(--dk-inset);
    color: var(--dk-text-soft);
    font-family: var(--dk-font-ui);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-decoration: none;
    cursor: pointer;
}
.dock-sheet a:hover, .dock-sheet button:hover { color: var(--dk-ice); border-color: var(--dk-line-strong); }
.dock-sheet svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.dock-backdrop { position: fixed; inset: 0; z-index: 71; display: none; background: rgba(1, 4, 9, 0.5); }
.dock-backdrop.is-open { display: block; }

/* ledger show-more */
.nx-more-btn {
    margin-top: 0.6rem;
    width: 100%;
    padding: 0.6rem;
    border: 1px dashed var(--dk-line);
    border-radius: 0.6rem;
    background: transparent;
    color: var(--dk-frost);
    font-family: var(--dk-font-ui);
    font-size: 0.6rem;
    letter-spacing: 0.24em;
    cursor: pointer;
}
.nx-more-btn:hover { color: var(--dk-ice); border-color: var(--dk-line-strong); }

/* ------------------------------------------------ tiny screens ---------- */
@media (max-width: 360px) {
    .deck-body { width: calc(100% - 0.8rem); }
    .nx-card > .nx-card-body { padding: 0.8rem 0.7rem 0.9rem; --dk-notch: 0.8rem; }
    .nx-oath-facts { grid-template-columns: 1fr 1fr; }
    .nx-sr-counts { grid-template-columns: repeat(2, 1fr); }
    #nx-call { font-size: 1.15rem; }
    .deck-top { gap: 0.4rem; }
    #nx-price { font-size: 1.05rem; }
    .nx-qside .ask { font-size: 1.4rem; }
}

/* keeper mobile header: two rows */
@media (max-width: 640px) {
    .keeper-top { grid-template-columns: auto minmax(0, 1fr); grid-auto-rows: auto; row-gap: 0.4rem; }
    .keeper-top .k-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
    .keeper-top .k-name strong { white-space: normal; font-size: 0.85rem; overflow-wrap: anywhere; }
}

/* safe-area for sticky tops on notched devices */
.deck-top, .keeper-top { padding-top: max(0.55rem, env(safe-area-inset-top)); }

/* monitors (HEIMDALL / Option E) phone stacking helper */
@media (max-width: 700px) {
    body.nx-monitor main, body.nx-monitor .monitor-grid, body.nx-monitor [class*="grid"] {
        display: block !important;
    }
    body.nx-monitor main > *, body.nx-monitor [class*="grid"] > * { margin-bottom: 0.8rem; }
    body.nx-monitor { padding: 10px !important; }
    body.nx-monitor * { overflow-wrap: anywhere; min-width: 0; }
}

/* ================================================== R4 · BTC HOURLY ====== */
/* Record states beyond win/loss — pending is an OPEN cyan state, never a win;
   void is a gold no-contest; unknown stays neutral (fail-closed styling). */
.nx-oathcard.is-pending { border-left-color: var(--dk-cyan); }
.nx-oathcard.is-pending .stamp { color: var(--dk-cyan); }
.nx-oathcard.is-void { border-left-color: var(--dk-gold); opacity: 0.82; }
.nx-oathcard.is-void .stamp { color: var(--dk-gold); }
.nx-oathcard.is-unknown { border-left-color: var(--dk-line); }
.nx-oathcard.is-unknown .stamp { color: var(--dk-muted); }

/* Entry lane variants — BUY takes the direction's color; NO NEW ENTRY goes
   quiet instead of borrowing loss-red; WAIT keeps the default gold lane. */
.nx-entry.is-live { border-color: rgba(60, 230, 164, 0.5); border-left-color: var(--dk-up);
    background: linear-gradient(90deg, rgba(60, 230, 164, 0.1), transparent 60%); }
.nx-entry.is-live-down { border-color: rgba(255, 93, 120, 0.5); border-left-color: var(--dk-down);
    background: linear-gradient(90deg, rgba(255, 93, 120, 0.1), transparent 60%); }
.nx-entry.is-live-down #nx-entry-status { color: var(--dk-down); }
.nx-entry.is-blocked { border-color: var(--dk-line-dim); border-left-color: var(--dk-line); opacity: 0.85; }
.nx-entry.is-blocked #nx-entry-status { color: var(--dk-text-soft); }

/* Executable ladder rows — both sides quoted on every rung. */
.nx-ladrow {
    display: grid;
    grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.45rem 0.9rem;
    align-items: center;
    padding: 0.55rem 0.8rem;
    min-height: 44px;
    background: linear-gradient(160deg, rgba(12, 30, 52, 0.72), rgba(5, 14, 27, 0.85));
    border: 1px solid var(--dk-line-dim);
    border-left: 3px solid var(--dk-line);
    border-radius: 0.5rem;
    transition: transform 200ms var(--dk-snap), border-color 200ms;
}
.nx-ladrow:hover { transform: translateX(4px); }
.nx-ladrow.is-above { border-left-color: var(--dk-up); }
.nx-ladrow.is-below { border-left-color: var(--dk-down); }
.nx-ladrow.is-primary { border-color: rgba(242, 199, 107, 0.55); box-shadow: 0 0 18px -6px rgba(242, 199, 107, 0.45); }
.nx-ladrow .lmark { font-family: var(--dk-font-display); font-size: 0.92rem; width: 1.4rem; text-align: center; }
.nx-ladrow.is-above .lmark { color: var(--dk-up); }
.nx-ladrow.is-below .lmark { color: var(--dk-down); }
.nx-ladrow .lmain { min-width: 0; }
.nx-ladrow .lmain strong { display: block; font-size: 0.74rem; letter-spacing: 0.06em; font-family: var(--dk-font-mono); overflow-wrap: anywhere; }
.nx-ladrow .lmain small, .nx-ladrow .lcell small {
    display: block; font-size: 0.5rem; letter-spacing: 0.2em; color: var(--dk-muted); margin-bottom: 0.1rem;
}
.nx-ladrow .lcell { min-width: 0; font-family: var(--dk-font-mono); font-size: 0.64rem; color: var(--dk-text-soft); overflow-wrap: anywhere; }
.nx-ladrow .lcell b.up { color: var(--dk-up); font-weight: 600; }
.nx-ladrow .lcell b.down { color: var(--dk-down); font-weight: 600; }
.nx-ladrow .lchip {
    justify-self: end; font-size: 0.52rem; letter-spacing: 0.16em; font-family: var(--dk-font-display);
    padding: 0.25rem 0.5rem; border: 1px solid var(--dk-line); border-radius: 999px; color: var(--dk-muted); white-space: nowrap;
}
.nx-ladrow.is-primary .lchip { color: var(--dk-gold); border-color: rgba(242, 199, 107, 0.55); }
@media (max-width: 700px) {
    .nx-ladrow { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
    .nx-ladrow .lchip { grid-column: 3; grid-row: 1; }
    .nx-ladrow .lmain { grid-column: 2; }
}

/* Ranked outlook rows — a reading, never an official lock. */
.nx-rankrow {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.5rem 0.8rem;
    min-height: 44px;
    background: var(--dk-inset);
    border: 1px solid var(--dk-line-dim);
    border-radius: 0.5rem;
}
.nx-rankrow .rk {
    font-family: var(--dk-font-display); font-size: 0.8rem; color: var(--dk-gold);
    width: 1.8rem; height: 1.8rem; display: grid; place-items: center;
    border: 1px solid rgba(242, 199, 107, 0.4); border-radius: 50%;
}
.nx-rankrow .rdir { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; white-space: nowrap; }
.nx-rankrow .rdir.up { color: var(--dk-up); }
.nx-rankrow .rdir.down { color: var(--dk-down); }
.nx-rankrow .rmeta { font-family: var(--dk-font-mono); font-size: 0.6rem; color: var(--dk-muted); overflow-wrap: anywhere; min-width: 0; }
.nx-rankrow .rstr { font-size: 0.52rem; letter-spacing: 0.16em; color: var(--dk-frost); white-space: nowrap; }

/* Path canvas frame */
#nx-path { display: block; border: 1px solid var(--dk-line-dim); border-radius: 0.5rem; background: var(--dk-inset); }

/* ghost pill button — 44px touch-safe */
.nx-ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: transparent;
    color: var(--dk-frost);
    font-family: var(--dk-font-display);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: color 200ms, border-color 200ms, box-shadow 200ms;
}
.nx-ghost-btn:hover { color: var(--dk-ice); border-color: var(--dk-line-strong); box-shadow: var(--dk-glow-cyan); }

/* ============================================= R4 · KEEPER WINGS ========= */
.keep-wingbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(242, 199, 107, 0.28);
    border-left: 3px solid var(--dk-gold);
    border-radius: 0.5rem;
    background: linear-gradient(90deg, rgba(242, 199, 107, 0.08), transparent 65%);
}
#keep-wing-label {
    font-family: var(--dk-font-display);
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    color: #ffe9b8;
    text-shadow: 0 0 18px rgba(242, 199, 107, 0.4);
}
.keep-wing-hint { font-size: 0.52rem; letter-spacing: 0.22em; color: var(--dk-muted); }

.keep-group { display: none; }
.keep-group.is-live { display: grid; gap: 1rem; min-width: 0; animation: r4-pane 260ms var(--dk-snap); }
@media (prefers-reduced-motion: reduce) { .keep-group.is-live { animation: none; } }

.keep-empty {
    display: none;
    margin: 0;
    padding: 1.1rem 1.2rem;
    border: 1px dashed rgba(242, 199, 107, 0.3);
    border-radius: 0.5rem;
    color: var(--dk-muted);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-align: center;
}
/* shown only when every panel in the wing is role-hidden (modern engines) */
.keep-group.is-live:not(:has(> section:not([hidden]), > article:not([hidden]))) .keep-empty { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   R4 · BIFROST RESKIN — the new NEXUS visual language
   Obsidian-violet space, animated rainbow-seam holo-plates, corner reticles,
   scanline sweeps, reactor dial, glass rails. Applied to every page that
   loads this sheet. Candle law untouched: green=UP, red=DOWN, gold=WAIT.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
    --dk-void: #030210;
    --dk-abyss: #05041a;
    --dk-steel: #0a0f2e;
    --dk-plate: #101637;
    --dk-storm: #b27cff;
    --dk-line: rgba(120, 168, 240, 0.26);
    --dk-line-strong: rgba(140, 216, 255, 0.65);
    --dk-line-dim: rgba(96, 120, 200, 0.14);
    --dk-glass: linear-gradient(164deg, rgba(16, 22, 55, 0.85), rgba(5, 6, 24, 0.94));
    --dk-glass-hot: linear-gradient(158deg, rgba(24, 32, 74, 0.92), rgba(7, 9, 30, 0.96));
    --dk-inset: rgba(3, 4, 18, 0.78);
    /* the bifrost seam triad — keeper pages override to ember-gold */
    --nxa: rgba(92, 220, 255, 0.85);
    --nxb: rgba(178, 124, 255, 0.85);
    --nxc: rgba(242, 199, 107, 0.85);
    --nx-halo: rgba(92, 220, 255, 0.16);
}
body.keeper-keep, body.keeper-gate, body.ragnarok-keeper-page {
    --nxa: rgba(255, 226, 158, 0.9);
    --nxb: rgba(255, 165, 74, 0.85);
    --nxc: rgba(255, 244, 214, 0.9);
    --nx-halo: rgba(255, 196, 92, 0.14);
}

/* deep space floor: violet nebula pools + engraved grid + film grain */
body.nexus-deck {
    background:
        radial-gradient(58rem 34rem at 82% -6%, rgba(64, 34, 120, 0.34), transparent 60%),
        radial-gradient(50rem 30rem at 6% 12%, rgba(20, 70, 130, 0.30), transparent 62%),
        radial-gradient(70rem 44rem at 50% 118%, rgba(34, 20, 84, 0.42), transparent 64%),
        linear-gradient(180deg, #04031a 0%, var(--dk-void) 45%, #020109 100%);
    background-color: var(--dk-void);
    overflow-x: visible;                 /* nothing to hide — zero real overflow is the law */
}
body.nexus-deck::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(110, 150, 255, 0.033) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 150, 255, 0.033) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(120% 90% at 50% 10%, #000 30%, transparent 78%);
    mask-image: radial-gradient(120% 90% at 50% 10%, #000 30%, transparent 78%);
}
body.nexus-deck::after {
    content: "";
    position: fixed;
    inset: -60%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
    animation: nx-grain 1.4s steps(3) infinite;
}
@keyframes nx-grain {
    0% { transform: translate(0, 0); }
    34% { transform: translate(-1.2%, 0.9%); }
    67% { transform: translate(0.8%, -1.1%); }
    100% { transform: translate(0, 0); }
}

/* ------------------------------------------------ holo-plate silhouette -- */
.nx-card { position: relative; }
.nx-card > .nx-card-body {
    background: var(--dk-glass);
    clip-path: polygon(
        var(--dk-notch) 0,
        calc(70% - 1rem) 0,
        calc(70% - 0.5rem) 0.44rem,
        calc(70% + 1.7rem) 0.44rem,
        calc(70% + 2.2rem) 0,
        100% 0,
        100% calc(100% - var(--dk-notch)),
        calc(100% - var(--dk-notch)) 100%,
        1.9rem 100%,
        1.45rem calc(100% - 0.36rem),
        0 calc(100% - 0.36rem),
        0 var(--dk-notch));
    transition: transform 260ms var(--dk-snap);
    contain: paint;
}
/* the living seam: a bifrost light forever tracing the plate's rim */
.nx-card > .nx-card-body::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1.6px;
    background: linear-gradient(115deg,
        transparent 12%, var(--nxa) 32%, var(--nxc) 46%,
        var(--nxb) 58%, transparent 82%);
    background-size: 320% 320%;
    animation: nx-seam 8s linear infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.9;
}
@keyframes nx-seam {
    0% { background-position: 0% 0%; }
    100% { background-position: 320% 320%; }
}
/* scanline sweep — a faint holo refresh passing every few seconds */
.nx-card > .nx-card-body::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: -30%;
    height: 26%;
    background: linear-gradient(180deg, transparent,
        rgba(150, 220, 255, 0.045) 45%, rgba(150, 220, 255, 0.10) 50%,
        rgba(150, 220, 255, 0.045) 55%, transparent);
    animation: nx-scan 9s var(--dk-snap) infinite;
    animation-delay: calc(var(--nx-i, 0) * -1.3s);
    pointer-events: none;
}
@keyframes nx-scan {
    0%, 62% { transform: translateY(0); opacity: 0; }
    66% { opacity: 1; }
    88%, 100% { transform: translateY(520%); opacity: 0; }
}
/* halo bloom behind every plate */
.nx-card { filter: drop-shadow(0 22px 44px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 26px var(--nx-halo)); }
.nx-card:hover > .nx-card-body { transform: translateY(-2px); }

/* corner reticles drawn by the atmosphere engine (.nx-plate > b × 4) */
.nx-plate { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.nx-plate b {
    position: absolute;
    width: 0.85rem; height: 0.85rem;
    border: 1.6px solid var(--dk-line-strong);
    opacity: 0.75;
    transition: opacity 300ms, filter 300ms;
}
.nx-plate b:nth-child(1) { top: 0.3rem; left: 0.3rem; border-right: 0; border-bottom: 0; }
.nx-plate b:nth-child(2) { top: 0.3rem; right: 0.3rem; border-left: 0; border-bottom: 0; }
.nx-plate b:nth-child(3) { bottom: 0.3rem; left: 0.3rem; border-right: 0; border-top: 0; }
.nx-plate b:nth-child(4) { bottom: 0.3rem; right: 0.3rem; border-left: 0; border-top: 0; }
.nx-holo:hover > .nx-plate b { opacity: 1; filter: drop-shadow(0 0 6px var(--nxa)); }

/* materialization — panels wipe into existence instead of fading */
.dk-reveal { opacity: 1; }
.dk-reveal.dk-pre {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    clip-path: inset(0 100% 0 0);
}
.dk-reveal.dk-in {
    animation: nx-materialize 640ms var(--dk-snap) both;
}
@keyframes nx-materialize {
    0% { opacity: 0; transform: translateY(18px) scale(0.985); clip-path: inset(0 100% 0 0); filter: brightness(2.2) saturate(1.6); }
    55% { clip-path: inset(0 -4% 0 0); }
    100% { opacity: 1; transform: none; clip-path: inset(0 -4% 0 0); filter: none; }
}

/* ------------------------------------------------------- bridge canopy -- */
.deck-top {
    background: linear-gradient(180deg, rgba(10, 14, 40, 0.88), rgba(4, 5, 20, 0.82));
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
    border-bottom: 1px solid transparent;
}
.deck-top::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--nxa) 18%, var(--nxc) 50%, var(--nxb) 82%, transparent);
    background-size: 220% 100%;
    animation: nx-seam-slide 7s linear infinite;
    pointer-events: none;
}
@keyframes nx-seam-slide { 0% { background-position: 0% 0; } 100% { background-position: 220% 0; } }
.deck-sigil {
    background: transparent;
    filter: drop-shadow(0 0 12px rgba(92, 220, 255, 0.5));
}
#nx-price { text-shadow: 0 0 26px rgba(92, 220, 255, 0.35); }

/* -------------------------------------------------------- glass pods ----- */
.deck-rail, .deck-dock {
    background: linear-gradient(164deg, rgba(14, 20, 52, 0.82), rgba(5, 6, 24, 0.9));
    -webkit-backdrop-filter: blur(12px) saturate(1.25);
    backdrop-filter: blur(12px) saturate(1.25);
    border: 1px solid var(--dk-line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 0 24px rgba(92, 220, 255, 0.05);
}
.rail-btn { transition: color 200ms, background 220ms, box-shadow 260ms, transform 200ms var(--dk-snap); }
.rail-btn:hover { transform: translateY(-1px); }
.rail-btn.is-active {
    box-shadow: 0 0 18px rgba(92, 220, 255, 0.4), inset 0 0 12px rgba(255, 255, 255, 0.14);
}

/* -------------------------------------------------------- reactor dial --- */
.nx-dial-wrap { position: relative; }
.nx-dial-wrap::before {
    content: "";
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--nx-halo) 0%, transparent 62%);
    animation: nx-core 3.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes nx-core { 0%, 100% { opacity: 0.5; transform: scale(0.97); } 50% { opacity: 1; transform: scale(1.03); } }
.nx-dial-wrap::after {
    content: "";
    position: absolute;
    inset: -3.5%;
    border-radius: 50%;
    border: 1px dashed rgba(140, 216, 255, 0.28);
    animation: nx-orbit 6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes nx-orbit {
    0%, 100% { border-color: rgba(140, 216, 255, 0.16); box-shadow: 0 0 10px rgba(92, 220, 255, 0.06); }
    50% { border-color: rgba(140, 216, 255, 0.45); box-shadow: 0 0 18px rgba(92, 220, 255, 0.18); }
}
#nx-dial .dial-track { stroke: rgba(120, 168, 240, 0.2); }
#nx-oath.state-locked-up .nx-dial-wrap::before { background: radial-gradient(circle, rgba(60, 230, 164, 0.2) 0%, transparent 62%); }
#nx-oath.state-locked-down .nx-dial-wrap::before { background: radial-gradient(circle, rgba(255, 93, 120, 0.2) 0%, transparent 62%); }
#nx-oath.state-forming .nx-dial-wrap::before { background: radial-gradient(circle, rgba(242, 199, 107, 0.16) 0%, transparent 62%); }

/* ------------------------------------------------------ gradient ink ----- */
.nx-oath-headline h1:not(.is-up):not(.is-down),
.keeper-hero h1,
.portal-hero h1,
#keep-wing-label {
    background: linear-gradient(96deg, #e8f6ff 8%, #8fd2ef 38%, var(--dk-storm) 72%, #ffe9b8 98%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}
body.keeper-keep .keeper-hero h1, body.keeper-gate .keeper-hero h1, #keep-wing-label {
    background: linear-gradient(96deg, #fff6df 10%, #ffd685 45%, #ff9d4a 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --------------------------------------------------------- chips glow ---- */
.nx-chip {
    background: rgba(8, 12, 34, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.03);
}

/* -------------------------------------------------- controls, reskinned -- */
.nexus-deck input[type="text"],
.nexus-deck input[type="password"],
.nexus-deck input[type="number"],
.nexus-deck input[type="email"],
.nexus-deck select,
.nexus-deck textarea {
    background: var(--dk-inset);
    border: 1px solid var(--dk-line);
    border-radius: 0.45rem;
    color: var(--dk-text);
    font-family: var(--dk-font-mono);
    transition: border-color 200ms, box-shadow 220ms;
}
.nexus-deck input:focus-visible,
.nexus-deck select:focus-visible,
.nexus-deck textarea:focus-visible {
    border-color: var(--dk-line-strong);
    box-shadow: 0 0 0 2px rgba(92, 220, 255, 0.22), var(--dk-glow-cyan);
    outline: none;
}
.nexus-deck .primary-action,
.nexus-deck button[type="submit"].primary-action {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.nexus-deck .primary-action::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
    background-size: 260% 100%;
    background-position: 130% 0;
    transition: background-position 600ms var(--dk-snap);
    pointer-events: none;
    z-index: 1;
}
.nexus-deck .primary-action:hover::after { background-position: -130% 0; }

/* scrollbars in the new hue */
.nexus-deck *::-webkit-scrollbar { width: 9px; height: 9px; }
.nexus-deck *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(92, 220, 255, 0.4), rgba(178, 124, 255, 0.4));
    border-radius: 8px;
}
.nexus-deck ::selection { background: rgba(178, 124, 255, 0.4); color: #fff; }

/* -------------------------------------------------- reduced-motion law --- */
@media (prefers-reduced-motion: reduce) {
    body.nexus-deck::after,
    .nx-card > .nx-card-body::before,
    .nx-card > .nx-card-body::after,
    .deck-top::after,
    .nx-dial-wrap::before,
    .nx-dial-wrap::after,
    .nexus-deck .primary-action::after { animation: none !important; transition: none !important; }
    .dk-reveal.dk-in { animation: none; }
    .dk-reveal.dk-pre { opacity: 1; transform: none; clip-path: none; }
}

/* lean word carries its direction color before the seal (id-specificity) */
#nx-dial-dir.nx-up { color: var(--dk-up); text-shadow: 0 0 24px rgba(60, 230, 164, 0.4); }
#nx-dial-dir.nx-down { color: var(--dk-down); text-shadow: 0 0 24px rgba(255, 93, 120, 0.4); }

/* ═══════════════════════════════════════════════════════════════════════════
   R4 · MEMBER PORTAL — the account surface in full deck language
   ═══════════════════════════════════════════════════════════════════════ */
.portal-body {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: var(--dk-rail-w) minmax(0, 1fr);
    gap: 1rem;
    width: min(1720px, 100% - 2rem);
    margin: 1rem auto 2.5rem;
    align-items: start;
}
.portal-body .deck-rail { top: 4.4rem; }
.member-portal-shell { display: grid; gap: 1.1rem; min-width: 0; }

.portal-id-chip {
    justify-self: center;
    text-align: center;
    padding: 0.3rem 1rem;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: var(--dk-inset);
    min-width: 0;
    max-width: 100%;
}
.portal-id-chip small { display: block; font-size: 0.46rem; letter-spacing: 0.3em; color: var(--dk-muted); }
.portal-id-chip span { font-family: var(--dk-font-display); font-size: 0.78rem; letter-spacing: 0.14em; color: var(--dk-ice); overflow-wrap: anywhere; }
.portal-header-actions { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }
.portal-header-actions .nx-ghost-btn { text-decoration: none; }

/* hero: greeting + the access seal */
.portal-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(15rem, 1fr); gap: 1.4rem; align-items: center; }
.portal-hero-copy .hero-kicker { margin: 0 0 0.5rem; font-size: 0.55rem; letter-spacing: 0.34em; color: var(--dk-gold); }
.portal-hero h1 { margin: 0; font-family: var(--dk-font-display); font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: 0.06em; line-height: 1.08; }
.portal-hero-line { margin: 0.6rem 0 0; color: var(--dk-text-soft); font-size: 0.72rem; line-height: 1.65; max-width: 34rem; }
.portal-hero-actions { margin-top: 1rem; display: grid; gap: 0.45rem; justify-items: start; }
.portal-hero-note { margin: 0; font-size: 0.58rem; color: var(--dk-muted); letter-spacing: 0.06em; }

.portal-seal { position: relative; display: grid; place-items: center; justify-self: center; }
.portal-seal-ring { width: min(15rem, 62vw); height: auto; display: block; }
.portal-seal-ring .seal-outer { stroke: rgba(140, 216, 255, 0.25); stroke-dasharray: 2 5; }
.portal-seal-ring .seal-track { stroke: rgba(120, 168, 240, 0.16); }
.portal-seal-ring .seal-arc { stroke: var(--dk-cyan); filter: drop-shadow(0 0 8px rgba(92, 220, 255, 0.7)); transition: stroke 400ms, stroke-dashoffset 900ms var(--dk-snap); }
.portal-seal-ring .seal-runes text { font-family: var(--dk-font-ui); font-size: 11px; fill: var(--dk-muted); letter-spacing: 0.3em; }
.portal-access-badge {
    position: absolute;
    display: grid;
    gap: 0.15rem;
    place-items: center;
    text-align: center;
    max-width: 72%;
}
.portal-access-badge small { font-size: 0.5rem; letter-spacing: 0.3em; color: var(--dk-muted); }
.portal-access-badge strong { font-family: var(--dk-font-display); font-size: 1.02rem; letter-spacing: 0.1em; color: var(--dk-up); overflow-wrap: anywhere; }
.portal-access-badge span { font-size: 0.56rem; color: var(--dk-text-soft); overflow-wrap: anywhere; }
.portal-access-badge.is-inactive strong { color: var(--dk-gold); }
.portal-hero-card .nx-card-body:has(.portal-access-badge.is-inactive) .seal-arc { stroke: var(--dk-gold); filter: drop-shadow(0 0 8px rgba(242, 199, 107, 0.55)); }

/* tabs: crystal segmented switch */
body.portal-deck .portal-tabs {
    display: flex;
    gap: 0.4rem;
    padding: 0.3rem;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: var(--dk-inset);
    width: fit-content;
    max-width: 100%;
    margin: 0;
}
body.portal-deck .portal-tab {
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1.3rem;
    min-height: 44px;
    background: transparent;
    color: var(--dk-frost);
    font-family: var(--dk-font-display);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    cursor: pointer;
    transition: background 240ms, color 240ms, box-shadow 240ms;
}
body.portal-deck .portal-tab.is-active {
    background: linear-gradient(140deg, #d9f6ff, var(--dk-cyan) 70%);
    color: #041018;
    box-shadow: 0 0 20px rgba(92, 220, 255, 0.4);
}

/* zones */
.portal-zones { display: grid; gap: 1.4rem; }
.pz { display: grid; gap: 0.8rem; scroll-margin-top: 5.2rem; }
.pz-head { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; padding-left: 0.15rem; }
.pz-head h2 {
    margin: 0;
    font-family: var(--dk-font-display);
    font-size: 1rem;
    letter-spacing: 0.24em;
    color: var(--dk-ice);
    text-shadow: 0 0 20px rgba(92, 220, 255, 0.35);
}
.pz-head span { font-size: 0.52rem; letter-spacing: 0.26em; color: var(--dk-muted); }
.pz-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr)); }
.pz-grid .pz-span { grid-column: 1 / -1; }

.portal-identity { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.8rem; }
body.portal-deck .profile-monogram {
    width: 3.4rem; height: 3.4rem;
    display: grid; place-items: center;
    font-family: var(--dk-font-display);
    font-size: 1.5rem;
    color: #041018;
    background: linear-gradient(140deg, #d9f6ff, var(--dk-cyan) 60%, var(--dk-storm));
    clip-path: polygon(28% 0, 100% 0, 100% 72%, 72% 100%, 0 100%, 0 28%);
    box-shadow: 0 0 24px rgba(92, 220, 255, 0.4);
}
.portal-identity-name h2 { margin: 0; font-family: var(--dk-font-display); font-size: 1.05rem; letter-spacing: 0.08em; overflow-wrap: anywhere; }
.portal-identity-sub { font-size: 0.5rem; letter-spacing: 0.28em; color: var(--dk-muted); }
body.portal-deck .profile-details { margin: 0; }
body.portal-deck .profile-details dt { font-size: 0.5rem; letter-spacing: 0.24em; color: var(--dk-muted); margin: 0; }
body.portal-deck .profile-details dd { margin: 0; font-family: var(--dk-font-mono); font-size: 0.72rem; color: var(--dk-text); overflow-wrap: anywhere; }
.portal-copy { margin: 0 0 0.75rem; color: var(--dk-text-soft); font-size: 0.68rem; line-height: 1.6; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.75rem; }
body.portal-deck .portal-policy {
    margin-top: 0.85rem;
    padding: 0.6rem 0.75rem;
    border-left: 3px solid var(--dk-gold);
    background: linear-gradient(90deg, rgba(242, 199, 107, 0.07), transparent 70%);
    font-size: 0.56rem;
    letter-spacing: 0.05em;
    color: var(--dk-muted);
    line-height: 1.6;
}

/* access.css controls, retuned to the deck language */
body.portal-deck .access-form label { color: var(--dk-frost); font-size: 0.55rem; letter-spacing: 0.24em; }
body.portal-deck .access-form input[type="text"],
body.portal-deck .access-form input[type="password"] { min-height: 44px; }
body.portal-deck .primary-action {
    border: 1px solid rgba(140, 216, 255, 0.5);
    border-radius: 0.5rem;
    background: linear-gradient(140deg, rgba(92, 220, 255, 0.2), rgba(26, 111, 212, 0.3));
    color: var(--dk-ice);
    font-family: var(--dk-font-display);
    letter-spacing: 0.2em;
    min-height: 44px;
    box-shadow: 0 0 18px rgba(92, 220, 255, 0.15);
}
body.portal-deck .primary-action:hover { box-shadow: 0 0 26px rgba(92, 220, 255, 0.35); }
body.portal-deck .primary-action.disabled { opacity: 0.55; box-shadow: none; }
body.portal-deck .secondary-action {
    border: 1px solid var(--dk-line);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--dk-frost);
    letter-spacing: 0.18em;
    min-height: 44px;
}
body.portal-deck .danger-action { border-color: rgba(255, 93, 120, 0.5); color: #ffb3c0; }
body.portal-deck .terms-consent span,
body.portal-deck .notification-preferences label span,
body.portal-deck .renewal-consent span { color: var(--dk-text-soft); font-size: 0.62rem; }
body.portal-deck .notification-preferences { display: grid; gap: 0.5rem; margin-top: 0.8rem; }
body.portal-deck .notification-preferences label {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    min-height: 44px;
    border: 1px solid var(--dk-line-dim);
    border-radius: 0.45rem;
    background: var(--dk-inset);
}
body.portal-deck .access-message {
    border: 1px solid var(--dk-line);
    border-left: 3px solid var(--dk-cyan);
    border-radius: 0.45rem;
    background: var(--dk-inset);
    color: var(--dk-text);
}
body.portal-deck .access-message.is-error { border-left-color: var(--dk-down); }
body.portal-deck .access-message.is-success { border-left-color: var(--dk-up); }
body.portal-deck .device-list .device-row {
    border: 1px solid var(--dk-line-dim);
    border-left: 3px solid var(--dk-line);
    border-radius: 0.45rem;
    background: var(--dk-inset);
    color: var(--dk-text-soft);
}
body.portal-deck .device-list .device-row.is-current { border-left-color: var(--dk-up); }
body.portal-deck .security-confirm-dialog {
    background: var(--dk-glass-hot);
    border: 1px solid var(--dk-line-strong);
    border-radius: 0.6rem;
    color: var(--dk-text);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(92, 220, 255, 0.12);
}
body.portal-deck .security-confirm-dialog::backdrop { background: rgba(2, 3, 12, 0.72); backdrop-filter: blur(6px); }
body.portal-deck .membership-plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
body.portal-deck .membership-plan {
    border: 1px solid var(--dk-line);
    border-radius: 0.6rem;
    background: var(--dk-glass);
    color: var(--dk-text);
    padding: 1rem;
    transition: transform 240ms var(--dk-snap), box-shadow 260ms, border-color 240ms;
}
body.portal-deck .membership-plan:hover {
    transform: translateY(-3px);
    border-color: var(--dk-line-strong);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 26px rgba(92, 220, 255, 0.2);
}
body.portal-deck .membership-plan.is-promotional { border-color: rgba(242, 199, 107, 0.6); box-shadow: 0 0 26px rgba(242, 199, 107, 0.18); }
body.portal-deck .membership-price { color: var(--dk-ice); font-family: var(--dk-font-display); }
body.portal-deck .launch-offer-banner {
    border: 1px solid rgba(242, 199, 107, 0.5);
    border-radius: 0.5rem;
    background: linear-gradient(90deg, rgba(242, 199, 107, 0.12), transparent 70%);
    color: var(--dk-text);
}
body.portal-deck .checkout-confirmation-dialog {
    background: var(--dk-glass-hot);
    border: 1px solid var(--dk-line-strong);
    border-radius: 0.7rem;
    color: var(--dk-text);
}
body.portal-deck .checkout-confirmation-backdrop { background: rgba(2, 3, 12, 0.74); backdrop-filter: blur(6px); }
body.portal-deck .recovery-security-note { background: var(--dk-inset); border: 1px dashed var(--dk-line); color: var(--dk-frost); overflow-wrap: anywhere; }
body.portal-deck .nx-subhead { margin-top: 0.8rem; }

/* portal responsive */
@media (max-width: 1080px) {
    .portal-hero { grid-template-columns: 1fr; }
    .portal-seal { justify-self: start; }
}
@media (max-width: 900px) {
    .portal-body { grid-template-columns: 1fr; width: calc(100% - 1.2rem); }
    .portal-id-chip { display: none; }
    .pz { scroll-margin-top: max(5.6rem, calc(4.6rem + env(safe-area-inset-top))); }
}
@media (max-width: 640px) {
    .portal-header-actions { gap: 0.3rem; }
    .portal-header-actions .cinematic-sound-toggle span { display: none; }
    .portal-header-actions .cinematic-sound-toggle::after { content: "♪"; font-size: 0.9rem; }
    .portal-hero h1 { font-size: 1.45rem; }
    body.portal-deck .portal-tabs { width: 100%; }
    body.portal-deck .portal-tab { flex: 1 1 0; text-align: center; padding: 0.65rem 0.4rem; }
}

/* portal polish: stacked identity facts, chromeless seal badge, no theme pill */
body.portal-deck .profile-details .nx-fact { display: block; }
body.portal-deck .profile-details .nx-fact dt { margin-bottom: 0.2rem; }
body.portal-deck .profile-details .nx-fact dd { font-size: 0.68rem; }
body.portal-deck .portal-access-badge,
body.portal-deck .portal-access-badge.is-inactive {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}
body.portal-deck [data-theme-toggle],
body.portal-deck .theme-toggle { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   R4 · MEMBER GATE — the login, reforged
   ═══════════════════════════════════════════════════════════════════════ */
.gate-top-status { justify-self: center; }
.gate-stage {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(21rem, 0.95fr);
    gap: 2.2rem;
    align-items: center;
    width: min(1480px, 100% - 2.4rem);
    margin: 2.2rem auto 3rem;
}
.gate-idol { display: grid; justify-items: start; gap: 0.7rem; min-width: 0; }
.gate-mark-orbit {
    position: relative;
    display: grid;
    place-items: center;
    margin-bottom: 0.4rem;
}
.gate-mark { width: min(30vw, 15rem); height: auto; filter: drop-shadow(0 0 34px rgba(92, 220, 255, 0.5)); animation: gate-breathe 5s ease-in-out infinite; }
@keyframes gate-breathe {
    0%, 100% { filter: drop-shadow(0 0 22px rgba(92, 220, 255, 0.35)); }
    50% { filter: drop-shadow(0 0 44px rgba(92, 220, 255, 0.6)) drop-shadow(0 0 80px rgba(178, 124, 255, 0.25)); }
}
.gate-mark-orbit::before, .gate-mark-orbit::after {
    content: "";
    position: absolute;
    inset: -8%;
    border-radius: 50%;
    border: 1px dashed rgba(140, 216, 255, 0.22);
    animation: nx-orbit 7s ease-in-out infinite;
    pointer-events: none;
}
.gate-mark-orbit::after { inset: -16%; border-color: rgba(178, 124, 255, 0.14); animation-delay: -3s; }
.gate-deck .hero-kicker { margin: 0; font-size: 0.6rem; letter-spacing: 0.4em; color: var(--dk-gold); }
.gate-headline {
    margin: 0;
    font-family: var(--dk-font-display);
    font-size: clamp(1.9rem, 4vw, 3.2rem);
    line-height: 1.06;
    letter-spacing: 0.05em;
    background: linear-gradient(96deg, #e8f6ff 8%, #8fd2ef 40%, var(--dk-storm) 75%, #ffe9b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.gate-promise { margin: 0.2rem 0 0; max-width: 30rem; color: var(--dk-text-soft); font-size: 0.76rem; line-height: 1.65; }
.gate-facts { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.7rem; }
.gate-facts .nx-fact {
    border: 1px solid var(--dk-line);
    border-radius: 0.5rem;
    background: var(--dk-inset);
    padding: 0.55rem 0.9rem;
}
.gate-risk { margin: 0.8rem 0 0; font-size: 0.52rem; letter-spacing: 0.18em; color: var(--dk-muted); max-width: 34rem; line-height: 1.7; }
.gate-card { min-width: 0; }
.gate-card .nx-card-body { padding: 1.2rem 1.25rem 1.35rem; }

/* the stamped access card sheds its old chrome inside the holo plate */
.gate-deck .access-card { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; }
.gate-deck .access-card .card-crown span { color: var(--dk-gold); letter-spacing: 0.3em; }
.gate-deck .access-tabs { display: flex; gap: 0.35rem; padding: 0.28rem; border: 1px solid var(--dk-line); border-radius: 999px; background: var(--dk-inset); }
.gate-deck .access-tab {
    flex: 1 1 0;
    border: 0;
    border-radius: 999px;
    min-height: 44px;
    background: transparent;
    color: var(--dk-frost);
    font-family: var(--dk-font-display);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: background 240ms, color 240ms, box-shadow 240ms;
}
.gate-deck .access-tab.is-active {
    background: linear-gradient(140deg, #d9f6ff, var(--dk-cyan) 70%);
    color: #041018;
    box-shadow: 0 0 18px rgba(92, 220, 255, 0.4);
}
.gate-deck .tab-panel h2 { font-family: var(--dk-font-display); letter-spacing: 0.06em; color: var(--dk-ice); }
.gate-deck .panel-label { color: var(--dk-gold); letter-spacing: 0.3em; }
.gate-deck .account-recovery-link { color: var(--dk-frost); min-height: 44px; }
.gate-deck .recovery-methods button {
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: transparent;
    color: var(--dk-frost);
    min-height: 44px;
}
.gate-deck .recovery-methods button.is-active {
    background: linear-gradient(140deg, #d9f6ff, var(--dk-cyan) 70%);
    color: #041018;
    border-color: transparent;
}
.gate-deck .maintenance-notice { background: var(--dk-glass); border: 1px solid rgba(242, 199, 107, 0.4); border-radius: 0.6rem; color: var(--dk-text); }

@media (max-width: 1080px) {
    .gate-stage { grid-template-columns: 1fr; gap: 1.4rem; }
    .gate-idol { justify-items: center; text-align: center; }
    .gate-promise, .gate-risk { max-width: 40rem; }
    .gate-facts { justify-content: center; }
}
@media (max-width: 640px) {
    .gate-top-status { display: none; }
    .gate-stage { width: calc(100% - 1.2rem); margin-top: 1.2rem; }
    .gate-card .nx-card-body { padding: 1rem 0.85rem 1.1rem; }
    .gate-deck .access-tab { font-size: 0.5rem; letter-spacing: 0.12em; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   R4 · OWNER COMMAND CENTER + MONITOR FIXES (audit items)
   ═══════════════════════════════════════════════════════════════════════ */
/* six labeled lanes get six real columns — never six cells in four tracks */
body.nexus-deck .timeline-head,
body.nexus-deck .timeline-table > div,
body.nexus-deck .records-head,
body.nexus-deck .records-table > div:not(.empty-state) {
    grid-template-columns: 0.6fr 1.5fr 1fr 0.9fr 0.7fr 1.1fr;
}
@media (max-width: 760px) {
    body.nexus-deck .timeline-head, body.nexus-deck .records-head { display: none; }
    body.nexus-deck .timeline-table > div,
    body.nexus-deck .records-table > div:not(.empty-state) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 12px;
        padding: 12px;
    }
    body.nexus-deck .timeline-table > div > *,
    body.nexus-deck .records-table > div:not(.empty-state) > * { overflow-wrap: anywhere; }
}
/* the owner ribbon grows with its content instead of spilling out of 30px */
body.nexus-deck .canary-ribbon {
    position: sticky;
    top: 0;
    height: auto;
    min-height: 30px;
    flex-wrap: wrap;
    padding: 4px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
    row-gap: 2px;
}
body.nexus-deck .app-shell { padding-top: 0; }

/* monitors: permanent two-column tiles stack to one on phones */
@media (max-width: 760px) {
    body.nx-monitor .row { grid-template-columns: 1fr !important; }
    body.nx-monitor { padding: 12px !important; }
    body.nx-monitor .meta { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   R4 · BIFROST CINEMATICS — upgraded intro choreography
   ═══════════════════════════════════════════════════════════════════════ */
.nx-intro { background: radial-gradient(90rem 60rem at 50% 40%, #080620 0%, #030210 55%, #010108 100%); }
.nx-intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nx-intro-mark { position: relative; z-index: 2; }
.nx-intro-mark .mk-ring {
    transform-origin: 50% 50%;
    opacity: 0;
}
.nx-intro.is-run .nx-intro-mark .mk-ring { animation: nxi-ring 1.4s 0.3s var(--dk-snap) forwards; }
@keyframes nxi-ring {
    0% { opacity: 0; stroke-dashoffset: 60; }
    100% { opacity: 1; stroke-dashoffset: 0; }
}
/* the mark forges itself — one stroke at a time, then the metal fills */
.nx-intro.is-run .nx-intro-mark .mk-1 { animation: r4-draw 900ms 0.35s var(--dk-blade) forwards, r4-fill 500ms 1.5s forwards; }
.nx-intro.is-run .nx-intro-mark .mk-2 { animation: r4-draw 900ms 0.6s var(--dk-blade) forwards, r4-fill 500ms 1.62s forwards; }
.nx-intro.is-run .nx-intro-mark .mk-3 { animation: r4-draw 900ms 0.85s var(--dk-blade) forwards, r4-fill 500ms 1.74s forwards; }
.nx-intro.is-run .nx-intro-mark .mk-4 { animation: r4-draw 700ms 1.15s var(--dk-blade) forwards, r4-fill 480ms 1.88s forwards; }
.nx-intro.is-run .nx-intro-mark { animation: nxi-arrive 1s var(--dk-snap) both, nxi-glow 2.6s 1.7s ease-in-out infinite; }
@keyframes nxi-arrive {
    0% { transform: scale(0.82); opacity: 0.4; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes nxi-glow {
    0%, 100% { filter: drop-shadow(0 0 30px rgba(92, 220, 255, 0.35)); }
    50% { filter: drop-shadow(0 0 60px rgba(92, 220, 255, 0.65)) drop-shadow(0 0 100px rgba(178, 124, 255, 0.3)); }
}
/* deck variant: the mark bursts out of the tunnel */
.nx-intro.is-deck.is-run .nx-intro-mark { animation: nxi-burst 1.05s var(--dk-blade) both, nxi-glow 2.6s 1.5s ease-in-out infinite; }
@keyframes nxi-burst {
    0% { transform: scale(0.1) rotate(-14deg); opacity: 0; }
    62% { transform: scale(1.1) rotate(2deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}
.nx-intro-title {
    background: linear-gradient(96deg, #e8f6ff 10%, #8fd2ef 45%, var(--dk-storm) 80%, #ffe9b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    z-index: 2;
}
.nx-intro-sub { z-index: 2; }
.nx-intro-skip { z-index: 3; }
/* thunder: a double strike, timed with the cue's opening hit */
.nx-intro.is-gate.is-run .nx-intro-flash { animation: nxi-thunder 2.6s linear forwards; }
@keyframes nxi-thunder {
    0%, 8% { opacity: 0; }
    9% { opacity: 0.85; }
    11% { opacity: 0.05; }
    13% { opacity: 0.55; }
    16%, 40% { opacity: 0; }
    41% { opacity: 0.4; }
    44%, 100% { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   R4 · TOUCH-TARGET & COLLISION SWEEP FIXES (QA matrix)
   ═══════════════════════════════════════════════════════════════════════ */
/* live chat launcher + any chat toggles reach 44px */
.nexus-deck .live-chat-launcher,
.nexus-deck #live-chat-toggle,
.nexus-deck .live-chat-toggle,
body.nexus-deck [id*="live-chat"] button,
body.nexus-deck button[class*="live-chat"] {
    min-height: 44px !important;
    min-width: 44px !important;
}
/* ledger mode tabs */
.nx-ledger-tabs button { min-height: 44px; }
/* ghost buttons never collapse narrower than a fingertip */
.nx-ghost-btn { min-width: 44px; justify-content: center; }
/* consent checkbox rows give the checkbox a 44px hit area via the label */
.nexus-deck .terms-consent,
.nexus-deck .renewal-consent {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.35rem 0.2rem;
    cursor: pointer;
}
/* keeper gate + keep console controls */
body.keeper-gate .primary-action, body.ragnarok-keeper-page .primary-action { min-height: 44px; }
.keeper-top .k-mark { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.keeper-top .k-actions a, .keeper-top .k-actions button { min-height: 44px; }
/* owner console controls (override layer over captured CSS) */
body.nexus-deck .menu-button, body.nexus-deck .profile-button { min-width: 44px; min-height: 44px; }
body.nexus-deck .list-buttons button { min-height: 44px; }
/* terms page (now portal-deck): header mark, back link, big links */
body.portal-deck .valhalla-mark { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
body.portal-deck #terms-back, body.portal-deck .terms-back { display: inline-flex; align-items: center; min-height: 44px; padding: 0.4rem 0.8rem; }
body.portal-deck a.secondary-action, body.portal-deck a.primary-action { display: inline-flex; align-items: center; justify-content: center; }
/* option-e monitor: cohort label/status stack instead of colliding */
@media (max-width: 760px) {
    body.nx-monitor #cohortLabel, body.nx-monitor #cohortStatus {
        display: block !important;
        position: static !important;
        width: 100% !important;
        text-align: left !important;
    }
}

/* tablet band: the header trio never fights for width */
@media (max-width: 1240px) {
    #nx-spark { display: none; }
    .deck-brand-name small { display: none; }
    #nx-price { font-size: clamp(1.02rem, 1.7vw, 1.4rem); }
    .deck-price-meta { column-gap: 0.5rem; }
    .deck-brand-name strong { font-size: 0.72rem; }
}
@media (max-width: 980px) and (min-width: 641px) {
    .deck-brand-name { display: none; }
    .deck-contract-chip small { display: none; }
}

/* owner pantheon tiles: long health strings wrap inside their own tile */
body.nexus-deck .pantheon-grid > article { min-width: 0; }
body.nexus-deck .pantheon-grid b,
body.nexus-deck .pantheon-grid span,
body.nexus-deck .pantheon-grid strong { display: block; overflow-wrap: anywhere; }
@media (max-width: 470px) {
    body.nexus-deck .pantheon-grid { grid-template-columns: 1fr 1fr !important; }
}

/* workspace tabs + every remaining pill control reach 44px */
.nx-ws-tabs button { min-height: 44px; }
body.nexus-deck .admin-tool-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}
body.nexus-deck .admin-panel button,
body.nexus-deck .ledger-actions button,
body.nexus-deck .admin-actions button,
body.nexus-deck .admin-actions a { min-height: 44px; }
body.portal-deck .discord-logo-link.icon-only { min-width: 44px !important; }

/* footer rows breathe so padded links never cross wrapped lines */
.deck-foot { row-gap: 0.55rem; }
/* owner console: every control is touch-sized */
body.nexus-deck .app-shell button,
body.nexus-deck .sidebar button,
body.nexus-deck .topbar button { min-height: 44px; }

/* Flow Forge mode switch pills (presentation sizing only; outranks the
   #flow-forge-panel id rule in flow-forge-v2.css) */
body.nexus-deck #flow-forge-panel .flow-forge-mode-switch button { min-height: 44px; }

/* ═══════════════════════════════════════════════════════════════════════════
   R4 · MULTI-ASSET IDENTITY (BTC / ETH / SOL / DOGE)
   The asset accent is IDENTITY ONLY — candles and directions keep the law.
   ═══════════════════════════════════════════════════════════════════════ */
body[data-asset] .deck-sigil { filter: drop-shadow(0 0 12px var(--nx-asset, rgba(92, 220, 255, 0.5))); }
body[data-asset] .deck-brand-name small,
body[data-asset] .deck-brand-name small .nx-sym { color: var(--nx-asset, var(--dk-cyan)); }
body[data-asset] .nx-product select { border-color: color-mix(in srgb, var(--nx-asset, #5cdcff) 45%, transparent); }
body[data-asset="eth"] .deck-top::after,
body[data-asset="sol"] .deck-top::after,
body[data-asset="doge"] .deck-top::after {
    background: linear-gradient(90deg, transparent, var(--nx-asset) 30%, var(--nxc) 60%, var(--nx-asset) 85%, transparent);
    background-size: 220% 100%;
}
.nx-product optgroup { background: #060a1e; color: var(--dk-muted); font-family: var(--dk-font-ui); }
.nx-product option:disabled { color: rgba(126, 151, 174, 0.5); }

/* honest not-provisioned states for BTC-only modules on other assets */
.nx-raid.is-asset-pending .nx-card-body { opacity: 0.92; }
.nx-raid.is-asset-pending #nx-raid-action { color: var(--dk-frost); }

/* ═══════════════════════════════════════════════════════════════════════════
   R4 · BATTLEFIELD MODE — full-viewport 3D war-table chrome
   ═══════════════════════════════════════════════════════════════════════ */
body.battlefield-page { overflow: hidden; height: 100vh; height: 100dvh; }
#bf-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    z-index: 1;
}
#bf-canvas:active { cursor: grabbing; }
.bf-hud-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: max(0.6rem, env(safe-area-inset-top)) max(0.8rem, env(safe-area-inset-right)) 0.6rem max(0.8rem, env(safe-area-inset-left));
    background: linear-gradient(180deg, rgba(4, 5, 18, 0.85), rgba(4, 5, 18, 0));
    pointer-events: none;
}
.bf-hud-top > * { pointer-events: auto; }
.bf-back { text-decoration: none; flex: 0 0 auto; }
.bf-readouts, .bf-side { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.bf-chip {
    display: grid;
    gap: 0.1rem;
    padding: 0.4rem 0.85rem;
    min-height: 44px;
    border: 1px solid var(--dk-line);
    border-radius: 0.55rem;
    background: rgba(6, 9, 26, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.bf-chip small { font-size: 0.48rem; letter-spacing: 0.26em; color: var(--dk-muted); }
.bf-chip strong { font-family: var(--dk-font-mono); font-size: 0.85rem; color: var(--dk-text); }
.bf-chip.is-up { border-color: rgba(60, 230, 164, 0.5); }
.bf-chip.is-up strong { color: var(--dk-up); }
.bf-chip.is-down { border-color: rgba(255, 93, 120, 0.5); }
.bf-chip.is-down strong { color: var(--dk-down); }
.bf-chip.is-gold { border-color: rgba(242, 199, 107, 0.5); }
.bf-chip.is-gold strong { color: var(--dk-gold); }
.bf-chip .bf-count {
    font-style: normal;
    font-family: var(--dk-font-body);
    font-weight: 700;
    font-size: 0.5rem;
    letter-spacing: 0.2em;
    opacity: 0.78;
}
.bf-chip.is-up .bf-count { color: var(--dk-up); }
.bf-chip.is-down .bf-count { color: var(--dk-down); }
.bf-hint {
    position: fixed;
    left: 50%;
    bottom: max(0.9rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 10;
    padding: 0.5rem 1rem;
    border: 1px solid var(--dk-line-dim);
    border-radius: 999px;
    background: rgba(6, 9, 26, 0.66);
    color: var(--dk-muted);
    font-size: 0.52rem;
    letter-spacing: 0.22em;
    white-space: nowrap;
    max-width: calc(100% - 1.6rem);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.bf-nogl[hidden] { display: none; }
.bf-nogl {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(3, 2, 16, 0.9);
}
@media (max-width: 900px) {
    .bf-hud-top { flex-wrap: wrap; }
    .bf-side { order: 3; width: 100%; justify-content: space-between; }
    .bf-chip strong { font-size: 0.72rem; }
}
@media (max-width: 520px) {
    .bf-chip { padding: 0.35rem 0.55rem; }
    .bf-chip small { font-size: 0.42rem; letter-spacing: 0.18em; }
    .bf-hint { display: none; }
}

/* ═══════════════════════════════════════════════ LIVE CHAT — BIFROST ═══ */
/* Presentation-only reskin: js/live-chat.js + its template ids untouched.
   These rules out-rank the captured live-chat.css via the body scope.     */

/* — launcher chip in the deck header — */
body.nexus-deck .live-chat-launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    min-width: 44px;
    padding: 0 0.95rem;
    border: 1px solid var(--dk-line);
    border-radius: 0.6rem;
    background: var(--dk-glass);
    color: var(--dk-frost);
    font-family: var(--dk-font-ui);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    cursor: pointer;
    transition: border-color 0.25s var(--dk-snap), color 0.25s, box-shadow 0.25s, transform 0.25s var(--dk-snap);
}
body.nexus-deck .live-chat-launcher:hover {
    border-color: var(--dk-line-strong);
    color: var(--dk-ice);
    box-shadow: var(--dk-glow-cyan);
    transform: translateY(-1px);
}
body.nexus-deck .live-chat-launcher[aria-expanded="true"] {
    border-color: var(--dk-cyan);
    color: var(--dk-ice);
    box-shadow: inset 0 0 18px rgba(65, 214, 255, 0.16), var(--dk-glow-cyan);
}
body.nexus-deck .live-chat-launcher svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    flex: 0 0 auto;
}
body.nexus-deck .live-chat-unread {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(242, 199, 107, 0.8);
    border-radius: 999px;
    background: linear-gradient(160deg, #3a2c10, #1c1204);
    color: var(--dk-gold);
    font-family: var(--dk-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    animation: nx-chat-unread-pulse 1.8s ease-in-out infinite;
}
@keyframes nx-chat-unread-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(242, 199, 107, 0.35); }
    55%      { box-shadow: 0 0 0 7px rgba(242, 199, 107, 0); }
}

/* — backdrop veil — */
body.nexus-deck .live-chat-backdrop {
    position: fixed;
    inset: 0;
    z-index: 84;
    background: rgba(2, 3, 14, 0.62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
body.nexus-deck .live-chat-backdrop[hidden] { display: none; }

/* — the war-room panel — */
body.nexus-deck .valhalla-live-chat {
    position: fixed;
    inset: auto clamp(0.6rem, 1.6vw, 1.4rem) clamp(0.6rem, 1.6vw, 1.4rem) auto;
    z-index: 85;
    width: min(430px, calc(100vw - 1.2rem));
    height: min(74vh, 700px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--dk-line);
    border-radius: 1rem;
    background:
        radial-gradient(120% 60% at 100% 0%, rgba(65, 214, 255, 0.07), transparent 55%),
        linear-gradient(168deg, rgba(10, 24, 44, 0.94), rgba(3, 8, 20, 0.97));
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(3, 8, 18, 0.6);
    clip-path: polygon(1.15rem 0, 100% 0, 100% 100%, 0 100%, 0 1.15rem);
    contain: paint;
    animation: nx-chat-materialize 0.5s var(--dk-snap) both;
}
body.nexus-deck .valhalla-live-chat[hidden] { display: none; }
@keyframes nx-chat-materialize {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}
/* bifrost seam across the top edge */
body.nexus-deck .valhalla-live-chat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    z-index: 3;
    background: linear-gradient(90deg, #41d6ff, #8f7bff, #ff5d78, #f2c76b, #3ce6a4, #41d6ff);
    background-size: 320% 100%;
    animation: nx-chat-seam 9s linear infinite;
    opacity: 0.85;
    pointer-events: none;
}
@keyframes nx-chat-seam {
    from { background-position: 0% 0; }
    to   { background-position: 320% 0; }
}
/* faint scanline drift over the glass */
body.nexus-deck .valhalla-live-chat::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: repeating-linear-gradient(180deg, rgba(148, 214, 255, 0.022) 0 1px, transparent 1px 4px);
    mix-blend-mode: screen;
    pointer-events: none;
}

/* — header — */
body.nexus-deck .live-chat-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem 0.7rem 1.05rem;
    border-bottom: 1px solid var(--dk-line-dim);
    background: linear-gradient(180deg, rgba(14, 32, 56, 0.55), transparent);
}
body.nexus-deck .live-chat-header-mark {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(65, 214, 255, 0.45);
    border-radius: 0.55rem;
    background: linear-gradient(160deg, rgba(15, 40, 70, 0.9), rgba(5, 13, 26, 0.95));
    color: transparent;
    background-clip: padding-box;
    font-family: var(--dk-font-display);
    font-size: 1.25rem;
    clip-path: polygon(28% 0, 100% 0, 100% 72%, 72% 100%, 0 100%, 0 28%);
    position: relative;
}
body.nexus-deck .live-chat-header-mark::after {
    content: "V";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, #c4efff, #41d6ff 55%, #8f7bff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
body.nexus-deck .live-chat-heading { flex: 1 1 auto; min-width: 0; }
body.nexus-deck .live-chat-title-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}
body.nexus-deck .live-chat-title-row h2 {
    margin: 0;
    font-family: var(--dk-font-ui);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    background: linear-gradient(120deg, var(--dk-ice), var(--dk-cyan) 60%, var(--dk-storm));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
body.nexus-deck .live-chat-heading p {
    margin: 0.2rem 0 0;
    color: var(--dk-muted);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
body.nexus-deck .live-chat-connection {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.18rem 0.6rem;
    border: 1px solid rgba(242, 199, 107, 0.5);
    border-radius: 999px;
    background: rgba(38, 28, 8, 0.5);
    color: var(--dk-gold);
    font-family: var(--dk-font-mono);
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}
body.nexus-deck .live-chat-connection::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: nx-chat-conn-pulse 1.4s ease-in-out infinite;
}
@keyframes nx-chat-conn-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}
body.nexus-deck .live-chat-connection[data-state="live"] {
    border-color: rgba(60, 230, 164, 0.55);
    background: rgba(9, 38, 28, 0.55);
    color: var(--dk-up);
}
body.nexus-deck .live-chat-connection[data-state="live"]::before { animation: none; }
body.nexus-deck .live-chat-connection[data-state="error"] {
    border-color: rgba(255, 93, 120, 0.55);
    background: rgba(48, 10, 18, 0.55);
    color: var(--dk-down);
}
body.nexus-deck .live-chat-minimize {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--dk-line);
    border-radius: 0.55rem;
    background: transparent;
    color: var(--dk-frost);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
body.nexus-deck .live-chat-minimize:hover {
    border-color: var(--dk-line-strong);
    color: var(--dk-ice);
    box-shadow: var(--dk-glow-cyan);
}

/* — presence strip — */
body.nexus-deck .live-chat-presence-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 1.05rem;
    border-bottom: 1px solid var(--dk-line-dim);
    background: rgba(5, 14, 27, 0.6);
    color: var(--dk-muted);
    font-size: 0.54rem;
    letter-spacing: 0.2em;
}
body.nexus-deck .live-chat-presence-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dk-up);
    box-shadow: 0 0 10px rgba(60, 230, 164, 0.8);
    animation: nx-chat-conn-pulse 2.2s ease-in-out infinite;
}
body.nexus-deck .live-chat-presence-bar strong {
    color: var(--dk-up);
    font-family: var(--dk-font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
}

/* — history + messages — */
body.nexus-deck .live-chat-history {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(65, 214, 255, 0.35) transparent;
    padding: 0.7rem 0.85rem 0.9rem;
}
body.nexus-deck .live-chat-history::-webkit-scrollbar { width: 8px; }
body.nexus-deck .live-chat-history::-webkit-scrollbar-thumb {
    background: rgba(65, 214, 255, 0.28);
    border-radius: 999px;
}
body.nexus-deck .live-chat-load-earlier {
    display: block;
    margin: 0 auto 0.75rem;
    min-height: 44px;
    padding: 0 1.1rem;
    border: 1px solid var(--dk-line);
    border-radius: 999px;
    background: rgba(8, 20, 38, 0.7);
    color: var(--dk-frost);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
body.nexus-deck .live-chat-load-earlier:hover { border-color: var(--dk-line-strong); color: var(--dk-ice); }
body.nexus-deck .live-chat-load-earlier[hidden] { display: none; }
body.nexus-deck .live-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
body.nexus-deck .live-chat-empty {
    margin: 1.6rem 0.4rem;
    text-align: center;
    color: var(--dk-muted);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
}

/* message card */
body.nexus-deck .live-chat-message {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    animation: nx-chat-msg-in 0.32s var(--dk-snap) both;
}
@keyframes nx-chat-msg-in {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: none; }
}
body.nexus-deck .live-chat-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(65, 214, 255, 0.4);
    border-radius: 0.5rem;
    background: linear-gradient(160deg, rgba(14, 34, 60, 0.9), rgba(4, 11, 22, 0.95));
    color: var(--dk-ice);
    font-family: var(--dk-font-display);
    font-size: 0.85rem;
    clip-path: polygon(26% 0, 100% 0, 100% 74%, 74% 100%, 0 100%, 0 26%);
}
body.nexus-deck .live-chat-message-content { min-width: 0; }
body.nexus-deck .live-chat-message-meta {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.22rem;
}
body.nexus-deck .live-chat-message-meta strong {
    color: var(--dk-silver);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}
body.nexus-deck .live-chat-message-meta time {
    color: var(--dk-muted);
    font-family: var(--dk-font-mono);
    font-size: 0.52rem;
    letter-spacing: 0.08em;
}
body.nexus-deck .live-chat-message-role {
    padding: 0.1rem 0.45rem;
    border: 1px solid rgba(143, 123, 255, 0.5);
    border-radius: 999px;
    background: rgba(28, 20, 60, 0.5);
    color: #c9bcff;
    font-size: 0.47rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
body.nexus-deck .live-chat-message-bubble {
    position: relative;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--dk-line-dim);
    border-left: 2px solid rgba(65, 214, 255, 0.45);
    border-radius: 0.15rem 0.7rem 0.7rem 0.7rem;
    background: linear-gradient(165deg, rgba(13, 30, 53, 0.72), rgba(6, 14, 28, 0.82));
    color: var(--dk-text-soft);
    font-size: 0.74rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

/* my own transmissions dock right, cyan-lit */
body.nexus-deck .live-chat-message.is-self {
    grid-template-columns: minmax(0, 1fr) 34px;
}
body.nexus-deck .live-chat-message.is-self .live-chat-avatar { order: 2; }
body.nexus-deck .live-chat-message.is-self .live-chat-message-content { order: 1; text-align: right; }
body.nexus-deck .live-chat-message.is-self .live-chat-message-meta { justify-content: flex-end; }
body.nexus-deck .live-chat-message.is-self .live-chat-message-bubble {
    text-align: left;
    border-left: 1px solid var(--dk-line-dim);
    border-right: 2px solid rgba(65, 214, 255, 0.75);
    border-radius: 0.7rem 0.15rem 0.7rem 0.7rem;
    background: linear-gradient(200deg, rgba(17, 44, 66, 0.8), rgba(7, 18, 33, 0.85));
    box-shadow: inset 0 0 22px rgba(65, 214, 255, 0.05);
}

/* the Allfather speaks in gold */
body.nexus-deck .live-chat-message.is-owner .live-chat-avatar {
    border-color: rgba(242, 199, 107, 0.75);
    color: var(--dk-gold);
    box-shadow: 0 0 14px rgba(242, 199, 107, 0.25);
}
body.nexus-deck .live-chat-message.is-owner .live-chat-message-role {
    border-color: rgba(242, 199, 107, 0.6);
    background: rgba(46, 34, 10, 0.55);
    color: var(--dk-gold);
}
body.nexus-deck .live-chat-message.is-owner .live-chat-message-bubble {
    border-left-color: rgba(242, 199, 107, 0.65);
    background: linear-gradient(165deg, rgba(38, 30, 12, 0.5), rgba(10, 12, 22, 0.85));
}

/* moderation */
body.nexus-deck .live-chat-message-actions { margin-top: 0.25rem; }
body.nexus-deck .live-chat-delete {
    min-height: 30px;
    padding: 0.15rem 0.6rem;
    border: 1px solid rgba(255, 93, 120, 0.4);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 143, 162, 0.85);
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
body.nexus-deck .live-chat-delete:hover {
    background: rgba(255, 93, 120, 0.14);
    color: #ffd2da;
}

/* — notice strip — */
body.nexus-deck .live-chat-notice {
    position: relative;
    z-index: 2;
    margin: 0 0.85rem 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(242, 199, 107, 0.4);
    border-left-width: 3px;
    border-radius: 0.5rem;
    background: rgba(40, 30, 9, 0.5);
    color: #ffe9b8;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
}
body.nexus-deck .live-chat-notice[data-level="error"] {
    border-color: rgba(255, 93, 120, 0.5);
    background: rgba(48, 10, 18, 0.55);
    color: #ffd2da;
}
body.nexus-deck .live-chat-notice[hidden] { display: none; }

/* — composer — */
body.nexus-deck .live-chat-composer {
    position: relative;
    z-index: 2;
    padding: 0.65rem 0.85rem max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--dk-line-dim);
    background: linear-gradient(0deg, rgba(11, 26, 46, 0.7), rgba(5, 12, 24, 0.4));
}
body.nexus-deck .live-chat-composer textarea {
    width: 100%;
    min-height: 46px;
    max-height: 130px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--dk-line);
    border-radius: 0.6rem;
    background: var(--dk-inset);
    color: var(--dk-text);
    font-family: var(--dk-font-ui);
    font-size: 0.74rem;
    line-height: 1.45;
    resize: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
body.nexus-deck .live-chat-composer textarea::placeholder { color: var(--dk-muted); }
body.nexus-deck .live-chat-composer textarea:focus {
    outline: none;
    border-color: var(--dk-cyan);
    box-shadow: 0 0 0 1px rgba(65, 214, 255, 0.35), var(--dk-glow-cyan);
}
body.nexus-deck .live-chat-composer textarea:disabled { opacity: 0.45; }
body.nexus-deck .live-chat-composer-footer {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.5rem;
}
body.nexus-deck .live-chat-composer-footer #live-chat-count {
    color: var(--dk-muted);
    font-family: var(--dk-font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
}
body.nexus-deck .live-chat-conduct {
    flex: 1 1 auto;
    text-align: center;
    color: var(--dk-muted);
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.26em;
}
body.nexus-deck .live-chat-composer-footer button {
    position: relative;
    min-height: 44px;
    min-width: 92px;
    padding: 0 1.2rem;
    border: 1px solid rgba(65, 214, 255, 0.55);
    border-radius: 0.6rem;
    background: linear-gradient(160deg, rgba(23, 56, 92, 0.9), rgba(9, 24, 44, 0.95));
    color: var(--dk-ice);
    font-family: var(--dk-font-ui);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    cursor: pointer;
    transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s var(--dk-snap);
}
body.nexus-deck .live-chat-composer-footer button:hover:not(:disabled) {
    border-color: var(--dk-cyan);
    box-shadow: var(--dk-glow-cyan);
    transform: translateY(-1px);
}
body.nexus-deck .live-chat-composer-footer button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* — phone: the chat becomes a full war-room sheet — */
@media (max-width: 640px) {
    body.nexus-deck .valhalla-live-chat {
        inset: auto 0 0 auto;
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
        border-left: none;
        border-right: none;
        clip-path: none;
    }
    body.nexus-deck .live-chat-launcher .live-chat-launcher-label { display: none; }
    body.nexus-deck .live-chat-launcher { padding: 0; width: 44px; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    body.nexus-deck .valhalla-live-chat,
    body.nexus-deck .live-chat-message { animation: none; }
    body.nexus-deck .valhalla-live-chat::before { animation: none; }
}

/* ═══════════════════════════════ KEEPER CONSOLE — ALIGNMENT + USABILITY ═ */
/* Every working panel snaps to one grid rhythm: crown → title → copy →
   controls. admin.js DOM untouched; this layer only lines it up.          */

/* typographic rhythm inside panels */
body.keeper-keep .admin-panel h2 {
    font-size: 1.42rem;
    line-height: 1.15;
    margin: 0.2rem 0 0.55rem;
}
body.keeper-keep .admin-panel h3 { font-size: 0.98rem; margin: 1rem 0 0.45rem; }
body.keeper-keep .admin-panel-copy,
body.keeper-keep .admin-panel > p {
    font-size: 0.8rem;
    line-height: 1.55;
    max-width: 68ch;
}
body.keeper-keep .panel-label { margin: 0 0 0.35rem; font-size: 0.56rem; }
body.keeper-keep .card-crown {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.55rem;
}
body.keeper-keep .card-crown i {
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(242, 199, 107, 0.45), transparent);
}

/* status strip: equal-height framed cells instead of floating text */
body.keeper-keep .admin-status-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
    gap: 0.6rem;
}
body.keeper-keep .admin-status-grid article {
    display: grid !important;
    align-content: center;
    gap: 0.28rem !important;
    min-height: 4.1rem !important;
    padding: 0.55rem 0.8rem !important;
    border: 1px solid rgba(242, 199, 107, 0.16) !important;
    border-left: 2px solid rgba(242, 199, 107, 0.45) !important;
    background: rgba(20, 13, 4, 0.5) !important;
    border-radius: 0.45rem;
}
body.keeper-keep .admin-status-grid small { margin: 0; }
body.keeper-keep .admin-status-grid strong { font-size: 0.82rem; overflow-wrap: anywhere; }

/* readiness checklist: scannable two-column cells with status chips */
body.keeper-keep .admin-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr));
    gap: 0.5rem;
    margin: 0.9rem 0 1rem;
}
body.keeper-keep .admin-checklist > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin: 0 !important;
    padding: 0.6rem 0.8rem !important;
    min-height: 44px;
    border: 1px solid rgba(242, 199, 107, 0.14) !important;
    border-bottom: 1px solid rgba(242, 199, 107, 0.14) !important;
    border-radius: 0.45rem;
    background: rgba(16, 11, 3, 0.55);
}
body.keeper-keep .admin-checklist span { font-size: 0.72rem; color: #cdbb96; }
body.keeper-keep .admin-checklist strong {
    flex: 0 0 auto;
    padding: 0.22rem 0.6rem;
    border: 1px solid rgba(242, 199, 107, 0.4);
    border-radius: 999px;
    background: rgba(46, 34, 10, 0.5);
    color: var(--dk-gold);
    font-family: var(--dk-font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.14em;
    white-space: nowrap;
}
body.keeper-keep .admin-checklist strong.status-good {
    border-color: rgba(60, 230, 164, 0.45);
    background: rgba(9, 38, 28, 0.5);
    color: var(--dk-up);
}

/* tool links: compact pill row, not stretched slabs */
body.keeper-keep .admin-tool-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.4rem;
}
body.keeper-keep .admin-tool-links a {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1.15rem;
    border: 1px solid rgba(242, 199, 107, 0.4);
    border-radius: 0.5rem;
    background: rgba(242, 199, 107, 0.08);
    color: #ffe9b8;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
}
body.keeper-keep .admin-tool-links a:hover {
    background: rgba(242, 199, 107, 0.18);
    box-shadow: 0 0 16px rgba(242, 199, 107, 0.18);
}

/* every control lands on the same 44px line */
body.keeper-keep .admin-panel input:not([type="checkbox"]):not([type="radio"]),
body.keeper-keep .admin-panel select {
    width: 100%;
    min-height: 44px;
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
}
body.keeper-keep .admin-panel textarea { width: 100%; padding: 0.55rem 0.7rem; font-size: 0.8rem; }
body.keeper-keep .admin-panel label {
    display: block;
    margin: 0 0 0.3rem;
    font-size: 0.56rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
body.keeper-keep .admin-panel button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0 1.1rem;
    font-size: 0.64rem;
    font-weight: 700;
}
body.keeper-keep .access-form { display: grid; gap: 0.85rem; margin-top: 0.9rem; }
body.keeper-keep .duration-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr));
    gap: 0.7rem;
    align-items: end;
}
body.keeper-keep .duration-row > div { display: grid; gap: 0; }
body.keeper-keep .lifetime-toggle {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(242, 199, 107, 0.2);
    border-radius: 0.5rem;
    background: rgba(16, 11, 3, 0.5);
    cursor: pointer;
}
body.keeper-keep .lifetime-toggle input { width: 19px; height: 19px; accent-color: var(--dk-gold); }
body.keeper-keep .lifetime-toggle strong { display: block; color: #ffe9b8; font-size: 0.66rem; letter-spacing: 0.16em; }
body.keeper-keep .lifetime-toggle small { display: block; color: #8d7c58; font-size: 0.58rem; margin-top: 0.15rem; }
body.keeper-keep .duration-preview {
    margin: 0;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid rgba(242, 199, 107, 0.5);
    background: rgba(26, 18, 5, 0.5);
    color: #e8d9b4;
    font-family: var(--dk-font-mono);
    font-size: 0.68rem;
}
body.keeper-keep .access-form .primary-action,
body.keeper-keep .access-form button[type="submit"] { width: 100%; min-height: 48px; }

/* generated code: one aligned strip */
body.keeper-keep .generated-code {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.8rem;
    padding: 0.75rem 0.9rem;
    border: 1px dashed rgba(242, 199, 107, 0.5);
    border-radius: 0.55rem;
    background: rgba(26, 18, 5, 0.55);
}
body.keeper-keep .generated-code strong {
    font-family: var(--dk-font-mono);
    font-size: 1rem;
    letter-spacing: 0.14em;
    color: #ffe9b8;
    overflow-wrap: anywhere;
}
body.keeper-keep .generated-code span { color: #b09a6a; font-size: 0.62rem; }
body.keeper-keep .generated-code button { margin-left: auto; }

/* maintenance master control: copy | state | switch on one aligned grid */
body.keeper-keep .maintenance-control-panel {
    display: grid !important;
    grid-template-columns: minmax(0, 1.5fr) minmax(15rem, 1fr) auto;
    grid-template-areas:
        "copy state switch"
        "help state switch"
        "msg  msg   msg";
    gap: 0.6rem 1.2rem;
    align-items: center;
}
body.keeper-keep .maintenance-control-copy { grid-area: copy; }
body.keeper-keep .maintenance-control-copy p { margin-bottom: 0; }
body.keeper-keep .maintenance-control-state {
    grid-area: state;
    display: grid;
    gap: 0.3rem;
    align-content: center;
    min-height: 5.4rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(242, 199, 107, 0.2);
    border-left: 2px solid rgba(60, 230, 164, 0.55);
    border-radius: 0.5rem;
    background: rgba(16, 11, 3, 0.55);
}
body.keeper-keep .maintenance-control-state small { color: #8d7c58; font-size: 0.52rem; letter-spacing: 0.22em; }
body.keeper-keep .maintenance-control-state strong { color: var(--dk-up); font-family: var(--dk-font-mono); font-size: 0.95rem; }
body.keeper-keep .maintenance-control-state span { color: #b09a6a; font-size: 0.62rem; line-height: 1.45; }
body.keeper-keep .maintenance-mode-switch {
    grid-area: switch;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 10.5rem;
    padding: 0.8rem 1rem !important;
}
body.keeper-keep .maintenance-switch-help { grid-area: help; margin: 0; color: #8d7c58; font-size: 0.62rem; line-height: 1.5; max-width: 60ch; }
body.keeper-keep .maintenance-admin-message { grid-area: msg; }

/* tables: framed, scrollable, breathable */
body.keeper-keep .admin-table-wrap {
    margin-top: 0.8rem;
    border: 1px solid rgba(242, 199, 107, 0.18);
    border-radius: 0.55rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    background: rgba(12, 8, 2, 0.45);
}
body.keeper-keep .admin-table { width: 100%; min-width: 560px; border-collapse: collapse; }
body.keeper-keep .admin-table th {
    position: sticky;
    top: 0;
    padding: 0.6rem 0.75rem !important;
    background: rgba(30, 21, 7, 0.96) !important;
    font-size: 0.54rem !important;
    text-align: left;
    white-space: nowrap;
}
body.keeper-keep .admin-table td {
    padding: 0.55rem 0.75rem !important;
    font-size: 0.7rem !important;
    vertical-align: middle;
}
body.keeper-keep .admin-table tbody tr:nth-child(even) td { background: rgba(242, 199, 107, 0.03); }
body.keeper-keep .admin-table td button { min-height: 36px; padding: 0 0.7rem; font-size: 0.56rem; }

/* ledger headings: title left, actions right, one line */
body.keeper-keep .ledger-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0.9rem 0 0.4rem;
}
body.keeper-keep .ledger-heading h3 { margin: 0; }
body.keeper-keep .ledger-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
body.keeper-keep .online-users-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid rgba(60, 230, 164, 0.4);
    border-radius: 999px;
    background: rgba(9, 38, 28, 0.5);
    color: var(--dk-up);
    font-family: var(--dk-font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
}

/* empty states: quiet, centered, framed */
body.keeper-keep .keep-empty {
    display: grid;
    place-items: center;
    min-height: 4.6rem;
    margin: 0.6rem 0;
    padding: 1rem;
    border: 1px dashed rgba(242, 199, 107, 0.25);
    border-radius: 0.55rem;
    color: #8d7c58;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-align: center;
}

/* stat grids reused by labs (precision, discord) inherit the strip look */
body.keeper-keep .precision-summary-grid,
body.keeper-keep .discord-readiness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(10.5rem, 100%), 1fr));
    gap: 0.6rem;
    margin: 0.8rem 0;
}
body.keeper-keep .precision-summary-grid article,
body.keeper-keep .discord-readiness-grid article,
body.keeper-keep .precision-summary-grid > div,
body.keeper-keep .discord-readiness-grid > div {
    display: grid;
    align-content: center;
    gap: 0.28rem;
    min-height: 4.1rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(242, 199, 107, 0.16);
    border-left: 2px solid rgba(242, 199, 107, 0.45);
    border-radius: 0.45rem;
    background: rgba(20, 13, 4, 0.5);
}
body.keeper-keep .precision-summary-grid small,
body.keeper-keep .discord-readiness-grid small {
    color: #8d7c58;
    font-size: 0.53rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
body.keeper-keep .precision-summary-grid strong,
body.keeper-keep .discord-readiness-grid strong {
    color: #ffe9b8;
    font-family: var(--dk-font-mono);
    font-size: 0.82rem;
}

/* code ledgers list */
body.keeper-keep .commerce-code-list { display: grid; gap: 0.55rem; }

/* phone: single column, tighter frames, same rhythm */
@media (max-width: 720px) {
    body.keeper-keep .admin-panel { padding: 0.95rem 0.9rem !important; }
    body.keeper-keep .admin-panel h2 { font-size: 1.2rem; }
    body.keeper-keep .maintenance-control-panel {
        grid-template-columns: 1fr;
        grid-template-areas: "copy" "state" "switch" "help" "msg";
        align-items: stretch;
    }
    body.keeper-keep .maintenance-mode-switch { width: 100%; }
    body.keeper-keep .admin-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.keeper-keep .admin-tool-links a { flex: 1 1 auto; }
}

/* action hierarchy: classic mint/red actions re-forged in keep gold */
body.keeper-keep .admin-panel .primary-action,
body.keeper-keep .admin-panel button[type="submit"],
body.keeper-keep .admin-panel .admin-action {
    color: #140b02 !important;
    background: linear-gradient(135deg, #ffe9b8, #f2c76b 58%, #c9973f) !important;
    border-color: rgba(255, 233, 184, 0.65) !important;
    box-shadow: 0 10px 26px rgba(242, 199, 107, 0.16) !important;
    font-weight: 800;
}
body.keeper-keep .admin-panel .primary-action:hover:not(:disabled),
body.keeper-keep .admin-panel .admin-action:hover:not(:disabled) {
    filter: brightness(1.07);
    box-shadow: 0 14px 30px rgba(242, 199, 107, 0.28) !important;
}
body.keeper-keep .admin-panel .secondary-action {
    color: #ffe9b8 !important;
    background: rgba(242, 199, 107, 0.08) !important;
    border: 1px solid rgba(242, 199, 107, 0.4) !important;
    box-shadow: none !important;
}
body.keeper-keep .admin-panel .danger-action,
body.keeper-keep .admin-panel button[data-danger],
body.keeper-keep .admin-panel .revoke-action {
    color: #ffd2da !important;
    background: rgba(72, 15, 26, 0.55) !important;
    border: 1px solid rgba(255, 93, 120, 0.5) !important;
    box-shadow: none !important;
}
body.keeper-keep .admin-panel .danger-action:hover:not(:disabled) {
    background: rgba(255, 93, 120, 0.2) !important;
    box-shadow: 0 0 18px rgba(255, 93, 120, 0.2) !important;
}


/* ═══════════════════════════════ RETIRED INTERFACES (R5) ═══════════════ */
/* RAGNAROK beta surfaces are retired: elements stay in the DOM so captured
   scripts keep their hooks, but nothing can ever display them again.      */
.is-retired-interface,
#next-beta-access-card,
#next-beta-access-panel { display: none !important; }

/* ═══════════════════════════════ ALLFATHER — RECORDER COMMAND (R5) ═════ */
/* Restrained intelligence-console layer: dark navy foundation, semantic
   color only (cyan live · green qualified · amber warn · red failed ·
   violet governance), no heavy glow, no decorative seams.               */
body.allfather-page {
    min-height: 100vh;
    background:
        radial-gradient(1100px 520px at 78% -12%, rgba(23, 48, 88, 0.5), transparent 60%),
        linear-gradient(180deg, #05070f, #03040a);
    color: var(--dk-text-soft);
}
.af-top {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.7rem clamp(0.8rem, 2vw, 1.6rem);
    border-bottom: 1px solid rgba(143, 123, 255, 0.22);
    background: rgba(4, 6, 15, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
.af-brand { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.af-sigil {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(143, 123, 255, 0.5);
    border-radius: 0.55rem;
    color: #c9bcff;
    font-size: 1.15rem;
    background: linear-gradient(160deg, rgba(34, 26, 66, 0.7), rgba(8, 7, 20, 0.9));
}
.af-brand strong {
    display: block;
    font-family: var(--dk-font-ui);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    color: #e6defc;
}
.af-brand small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.53rem;
    letter-spacing: 0.22em;
    color: var(--dk-muted);
}
.af-links { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-left: auto; }
.af-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.85rem;
    border: 1px solid var(--dk-line-dim);
    border-radius: 0.5rem;
    color: var(--dk-frost);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.af-links a:hover { border-color: rgba(143, 123, 255, 0.55); color: #e6defc; }
.af-linkstate { display: flex; align-items: center; gap: 0.7rem; }
.af-asof { font-family: var(--dk-font-mono); font-size: 0.56rem; letter-spacing: 0.1em; color: var(--dk-muted); }

.af-body {
    display: grid;
    grid-template-columns: var(--dk-rail-w) minmax(0, 1fr);
    gap: 1rem;
    width: min(1560px, calc(100% - 1.6rem));
    margin: 1rem auto 3rem;
    align-items: start;
}
.af-rail { top: 4.6rem; }
.af-rail .rail-btn.is-active {
    color: #0d0a1e;
    background: linear-gradient(140deg, #d9cfff, #9d7bff 65%);
    border-color: rgba(217, 207, 255, 0.5);
    box-shadow: none;
}
.af-main { display: grid; gap: 1rem; min-width: 0; }
.af-section {
    border: 1px solid rgba(96, 130, 180, 0.18);
    border-radius: 0.7rem;
    background: linear-gradient(172deg, rgba(10, 18, 34, 0.72), rgba(4, 7, 15, 0.9));
    padding: 1.1rem 1.2rem 1.3rem;
    min-width: 0;
}
.af-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(96, 130, 180, 0.14);
}
.af-sec-head h1 {
    margin: 0;
    font-family: var(--dk-font-ui);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.26em;
    color: #dfe9f6;
}
.af-subhead {
    margin: 1.2rem 0 0.55rem;
    font-family: var(--dk-font-ui);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    color: var(--dk-muted);
}
.af-state, .af-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border: 1px solid var(--dk-line-dim);
    border-radius: 999px;
    font-family: var(--dk-font-mono);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--dk-text-soft);
    white-space: nowrap;
    max-width: 100%;
}
.af-chip { white-space: normal; text-align: center; }
.af-state.is-live, .af-chip.is-live { color: var(--dk-cyan); border-color: rgba(65, 214, 255, 0.45); }
.af-state.is-good, .af-chip.is-good { color: #0d2b1e; background: linear-gradient(140deg, #7df0c4, #3ce6a4); border-color: rgba(60, 230, 164, 0.7); }
.af-state.is-good-line, .af-chip.is-good-line { color: var(--dk-up); border-color: rgba(60, 230, 164, 0.5); }
.af-state.is-warn, .af-chip.is-warn { color: var(--dk-ember); border-color: rgba(255, 184, 92, 0.5); }
.af-state.is-bad, .af-chip.is-bad { color: var(--dk-down); border-color: rgba(255, 93, 120, 0.5); }
.af-state.is-violet, .af-chip.is-violet { color: #c9bcff; border-color: rgba(143, 123, 255, 0.5); }
.af-state.is-dim, .af-chip.is-dim { color: var(--dk-muted); }

.af-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
    gap: 0.6rem;
}
.af-card {
    display: grid;
    align-content: center;
    gap: 0.3rem;
    min-height: 4.6rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(96, 130, 180, 0.16);
    border-left: 2px solid rgba(65, 214, 255, 0.4);
    border-radius: 0.5rem;
    background: rgba(7, 12, 24, 0.6);
}
.af-card small { font-size: 0.52rem; letter-spacing: 0.2em; color: var(--dk-muted); }
.af-card strong {
    font-family: var(--dk-font-mono);
    font-size: 0.92rem;
    color: #e6eefb;
    overflow-wrap: anywhere;
}
.af-sub { font-size: 0.55rem; letter-spacing: 0.12em; color: var(--dk-muted); }
.af-note {
    margin: 1rem 0 0;
    padding: 0.6rem 0.8rem;
    border-left: 2px solid rgba(143, 123, 255, 0.5);
    background: rgba(20, 16, 42, 0.4);
    color: #b9aee6;
    font-size: 0.64rem;
    line-height: 1.55;
    max-width: 74ch;
}
.af-blocker {
    margin-top: 0.8rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(255, 93, 120, 0.45);
    border-left-width: 3px;
    border-radius: 0.45rem;
    background: rgba(48, 10, 18, 0.5);
    color: #ffd2da;
    font-family: var(--dk-font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
}
.af-empty {
    margin: 0.4rem 0;
    padding: 1.1rem 1rem;
    border: 1px dashed rgba(96, 130, 180, 0.3);
    border-radius: 0.5rem;
    color: var(--dk-muted);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-align: center;
    line-height: 1.5;
}

/* matrix */
.af-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
    gap: 0.7rem;
}
.af-mcell {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(96, 130, 180, 0.18);
    border-radius: 0.55rem;
    background: rgba(7, 12, 24, 0.6);
    min-width: 0;
}
.af-mcell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.af-mcell-head strong {
    font-family: var(--dk-font-ui);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: #e6eefb;
}
.af-mcell-auth { margin-top: 0.55rem; }
.af-kv {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.26rem 0;
    border-bottom: 1px dashed rgba(96, 130, 180, 0.14);
}
.af-kv:last-of-type { border-bottom: 0; }
.af-kv small { font-size: 0.53rem; letter-spacing: 0.16em; color: var(--dk-muted); white-space: nowrap; }
.af-kv b {
    font-family: var(--dk-font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    color: #dce7f5;
    text-align: right;
    overflow-wrap: anywhere;
    min-width: 0;
}

/* recorder filters */
.af-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(10.5rem, 100%), 1fr));
    gap: 0.55rem;
    margin-bottom: 0.9rem;
}
.af-filters label {
    display: grid;
    gap: 0.25rem;
    font-size: 0.52rem;
    letter-spacing: 0.2em;
    color: var(--dk-muted);
}
.af-filters select {
    min-height: 44px;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(96, 130, 180, 0.28);
    border-radius: 0.45rem;
    background: rgba(6, 10, 22, 0.85);
    color: #dce7f5;
    font-family: var(--dk-font-mono);
    font-size: 0.66rem;
}
.af-filters select:focus { outline: none; border-color: rgba(143, 123, 255, 0.6); }

/* recorder cards */
.af-recorders { display: grid; gap: 0.7rem; }
.af-rec {
    border: 1px solid rgba(96, 130, 180, 0.18);
    border-radius: 0.55rem;
    background: rgba(7, 12, 24, 0.6);
    padding: 0.75rem 0.85rem;
    min-width: 0;
}
.af-rec-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
    flex-wrap: wrap;
}
.af-rec-id strong {
    display: block;
    font-family: var(--dk-font-ui);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #e6eefb;
}
.af-rec-id small {
    display: block;
    margin-top: 0.2rem;
    font-family: var(--dk-font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: var(--dk-muted);
    overflow-wrap: anywhere;
}
.af-gen {
    flex: 0 0 auto;
    padding: 0.24rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}
.af-gen.is-base   { color: var(--dk-frost); border: 1px solid rgba(96, 130, 180, 0.4); }
.af-gen.is-uw     { color: #0a2531; background: linear-gradient(140deg, #9be7ff, #41d6ff); border: 1px solid rgba(65, 214, 255, 0.7); }
.af-gen.is-shadow { color: #c9bcff; border: 1px solid rgba(143, 123, 255, 0.55); }
.af-gen.is-canary { color: var(--dk-up); border: 1px solid rgba(60, 230, 164, 0.55); }
.af-rec-em {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
    gap: 0.5rem;
    margin-top: 0.7rem;
}
.af-rec-emcell {
    display: grid;
    gap: 0.3rem;
    align-content: start;
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(96, 130, 180, 0.12);
    border-radius: 0.45rem;
    background: rgba(5, 9, 18, 0.55);
    min-width: 0;
}
.af-rec-emcell small { font-size: 0.5rem; letter-spacing: 0.2em; color: var(--dk-muted); }
.af-rec-emcell b {
    font-family: var(--dk-font-mono);
    font-size: 0.68rem;
    color: #dce7f5;
    overflow-wrap: anywhere;
}
.af-rec-emcell b.af-bad { color: var(--dk-down); }
.af-drawer { margin-top: 0.65rem; border-top: 1px dashed rgba(96, 130, 180, 0.16); }
.af-drawer summary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.4rem;
    cursor: pointer;
    color: var(--dk-frost);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    list-style: none;
}
.af-drawer summary::-webkit-details-marker { display: none; }
.af-drawer summary::before { content: "▸ "; }
.af-drawer[open] summary::before { content: "▾ "; }
.af-drawer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
    gap: 0 1.4rem;
    padding: 0.3rem 0.2rem 0.6rem;
}

/* hashes */
.af-hashes { display: grid; gap: 0.6rem; margin-bottom: 0.9rem; }
.af-hash {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(143, 123, 255, 0.28);
    border-radius: 0.5rem;
    background: rgba(16, 13, 34, 0.5);
}
.af-hash small { flex: 0 0 auto; font-size: 0.52rem; letter-spacing: 0.2em; color: #b9aee6; }
.af-hash code {
    flex: 1 1 12rem;
    min-width: 0;
    font-family: var(--dk-font-mono);
    font-size: 0.62rem;
    color: #e6defc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.af-hash-inline { margin-top: 0.5rem; border-color: rgba(96, 130, 180, 0.2); background: rgba(5, 9, 18, 0.55); }
.af-copy {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 0.75rem;
    border: 1px solid rgba(143, 123, 255, 0.45);
    border-radius: 0.4rem;
    background: transparent;
    color: #c9bcff;
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    cursor: pointer;
    transition: background 0.2s;
}
.af-copy:hover { background: rgba(143, 123, 255, 0.14); }

/* sources + incidents + ledger lists */
.af-sources, .af-list { display: grid; gap: 0.6rem; }
.af-src, .af-incident {
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(96, 130, 180, 0.16);
    border-radius: 0.55rem;
    background: rgba(7, 12, 24, 0.6);
    min-width: 0;
}
.af-src-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.af-src-head strong {
    font-family: var(--dk-font-ui);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: #e6eefb;
}
.af-src-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
    gap: 0 1.4rem;
    margin-top: 0.4rem;
}
.af-incident p { margin: 0.45rem 0 0.3rem; font-size: 0.7rem; line-height: 1.5; color: var(--dk-text-soft); }
.af-lrow {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(96, 130, 180, 0.14);
    border-radius: 0.45rem;
    background: rgba(5, 9, 18, 0.55);
}
.af-lrow b { font-family: var(--dk-font-mono); font-size: 0.62rem; color: #dce7f5; overflow-wrap: anywhere; }
.af-lrow span { font-size: 0.58rem; color: var(--dk-muted); }

/* cohort */
.af-notstarted {
    display: grid;
    gap: 0.5rem;
    justify-items: center;
    text-align: center;
    padding: 2.2rem 1rem;
    border: 1px dashed rgba(143, 123, 255, 0.35);
    border-radius: 0.6rem;
    background: rgba(16, 13, 34, 0.35);
}
.af-notstarted strong {
    font-family: var(--dk-font-ui);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #c9bcff;
}
.af-notstarted span { max-width: 56ch; font-size: 0.66rem; line-height: 1.55; color: var(--dk-muted); }
.af-checkpoints {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
    gap: 0.6rem;
    margin-top: 0.9rem;
}
.af-checkpoint {
    display: grid;
    gap: 0.35rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(96, 130, 180, 0.16);
    border-radius: 0.5rem;
    background: rgba(7, 12, 24, 0.6);
}
.af-checkpoint strong { font-family: var(--dk-font-ui); font-size: 0.7rem; letter-spacing: 0.2em; color: #e6eefb; }
.af-checkpoint span { font-family: var(--dk-font-mono); font-size: 0.58rem; color: var(--dk-muted); }
.af-coverage, .af-bars { display: grid; gap: 0.55rem; }
.af-cov {
    display: grid;
    grid-template-columns: minmax(8rem, 16rem) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
}
.af-cov small { font-size: 0.55rem; letter-spacing: 0.14em; color: var(--dk-muted); overflow-wrap: anywhere; }
.af-cov b { font-family: var(--dk-font-mono); font-size: 0.62rem; color: #dce7f5; white-space: nowrap; }
.af-bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: rgba(96, 130, 180, 0.14);
    overflow: hidden;
    min-width: 0;
}
.af-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2b9fca, #41d6ff);
    transition: width 0.4s var(--dk-snap);
}
.af-bar i.is-warn { background: linear-gradient(90deg, #b8813a, #ffb85c); }
.af-bar i.is-cap { background: linear-gradient(90deg, #b0384d, #ff5d78); }
.af-bar s {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: rgba(255, 184, 92, 0.8);
}

/* phone */
@media (max-width: 900px) {
    .af-body { grid-template-columns: 1fr; }
    .af-body .af-rail {
        display: flex;
        position: sticky;
        top: max(0.4rem, env(safe-area-inset-top));
        z-index: 40;
        flex-direction: row;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        width: 100%;
        padding: 0.4rem;
        gap: 0.35rem;
        scrollbar-width: none;
    }
    .af-body .af-rail::-webkit-scrollbar { display: none; }
    .af-body .af-rail .rail-btn { flex: 0 0 auto; display: inline-flex; align-items: center; width: auto; padding: 0 0.55rem; }
    .af-body .af-rail .rail-tip {
        position: static;
        opacity: 1;
        transform: none;
        border: 0;
        background: transparent;
        padding: 0 0.15rem 0 0.3rem;
        font-size: 0.52rem;
        color: inherit;
    }
    .af-top { position: static; }
    .af-links { margin-left: 0; width: 100%; }
    .af-cov { grid-template-columns: 1fr; gap: 0.3rem; }
}
@media (max-width: 520px) {
    .af-section { padding: 0.85rem 0.8rem 1rem; }
    .af-links a { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .af-bar i { transition: none; }
}

/* hidden always wins inside ALLFATHER (explicit display rules otherwise override it) */
body.allfather-page [hidden] { display: none !important; }
.af-checkpoint .af-chip { justify-self: start; }


/* pre-lock dual proof lane (fed only by per-direction backend fields) */
.nx-checking {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.55rem;
}
.nx-checking[hidden] { display: none; }
.nx-checking-lane {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.65rem;
    border: 1px solid var(--dk-line-dim);
    border-radius: 999px;
    font-size: 0.55rem;
}
.nx-checking-lane b { font-weight: 800; letter-spacing: 0.18em; }
.nx-checking-lane strong { font-family: var(--dk-font-mono); font-size: 0.62rem; }
.nx-checking-lane.is-up-lane { border-color: rgba(60, 230, 164, 0.4); }
.nx-checking-lane.is-up-lane b, .nx-checking-lane.is-up-lane strong { color: var(--dk-up); }
.nx-checking-lane.is-down-lane { border-color: rgba(255, 93, 120, 0.4); }
.nx-checking-lane.is-down-lane b, .nx-checking-lane.is-down-lane strong { color: var(--dk-down); }
.nx-checking small { color: var(--dk-muted); font-size: 0.5rem; letter-spacing: 0.18em; }

/* ═══════════════════════════════ R6 — MEMBER-REQUESTED DECK REVISION ═══ */

/* the dial word never clips (JS fit assists; CSS guards the frame) */
#nx-dial-dir { max-width: 208px; white-space: nowrap; overflow: visible; }

/* — STREAKS & RUNS band (brought back) — */
.nx-streak-band {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(10.5rem, 100%), 1fr));
    gap: 0.55rem;
    margin: 0.2rem 0 0.9rem;
    padding: 0.75rem;
    border: 1px solid var(--dk-line-dim);
    border-radius: 0.6rem;
    background: linear-gradient(168deg, rgba(13, 30, 53, 0.6), rgba(5, 12, 24, 0.75));
}
.nx-streak-cell {
    display: grid;
    gap: 0.28rem;
    align-content: center;
    min-height: 3.9rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--dk-line-dim);
    border-left: 2px solid rgba(65, 214, 255, 0.45);
    border-radius: 0.45rem;
    background: rgba(4, 9, 19, 0.55);
}
.nx-streak-cell small { font-size: 0.5rem; letter-spacing: 0.2em; color: var(--dk-muted); }
.nx-streak-cell strong {
    font-family: var(--dk-font-mono);
    font-size: 1.05rem;
    color: var(--dk-silver);
}
.nx-streak-cell.is-current { border-left-color: rgba(60, 230, 164, 0.6); }
.nx-streak-cell.is-current strong.nx-up { color: var(--dk-up); text-shadow: 0 0 16px rgba(60, 230, 164, 0.35); }
.nx-streak-cell.is-best { border-left-color: rgba(242, 199, 107, 0.6); }
.nx-streak-cell.is-best strong { color: var(--dk-gold); }
.nx-streak-cell.is-worst { border-left-color: rgba(255, 93, 120, 0.55); }
.nx-streak-cell.is-worst strong { color: var(--dk-down); }
.nx-streak-cell.is-defense { border-left-color: rgba(143, 123, 255, 0.55); }
.nx-streak-cell.is-defense strong { font-size: 0.78rem; color: #c9bcff; }
.nx-streak-recent {
    grid-column: 1 / -1;
    display: grid;
    gap: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--dk-line-dim);
}
.nx-streak-recent small { font-size: 0.48rem; letter-spacing: 0.22em; color: var(--dk-muted); }
#nx-sb-recent { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.nx-sb-dot {
    width: 14px;
    height: 14px;
    border-radius: 0.25rem;
    border: 1px solid transparent;
}
.nx-sb-dot.is-w { background: rgba(60, 230, 164, 0.85); box-shadow: 0 0 8px rgba(60, 230, 164, 0.4); }
.nx-sb-dot.is-l { background: rgba(255, 93, 120, 0.85); box-shadow: 0 0 8px rgba(255, 93, 120, 0.35); }
.nx-sb-dot.is-p { background: transparent; border-color: rgba(242, 199, 107, 0.6); }
.nx-sb-empty { font-size: 0.56rem; letter-spacing: 0.14em; color: var(--dk-muted); }

/* — modular deck layout ("layouts on TV") — */
.u-layout-hidden { display: none !important; }
.nx-layout-btn svg { width: 17px; height: 17px; }
.nx-layout-backdrop {
    position: fixed;
    inset: 0;
    z-index: 88;
    background: rgba(2, 3, 14, 0.55);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}
.nx-layout-backdrop[hidden] { display: none; }
.nx-layout-sheet {
    position: fixed;
    inset: auto clamp(0.6rem, 1.6vw, 1.4rem) clamp(0.6rem, 1.6vw, 1.4rem) auto;
    z-index: 89;
    width: min(360px, calc(100vw - 1.2rem));
    max-height: min(78vh, 640px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--dk-line);
    border-radius: 1rem;
    background: linear-gradient(168deg, rgba(10, 24, 44, 0.96), rgba(3, 8, 20, 0.98));
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
    clip-path: polygon(1.05rem 0, 100% 0, 100% 100%, 0 100%, 0 1.05rem);
    animation: nx-chat-materialize 0.4s var(--dk-snap) both;
}
.nx-layout-sheet[hidden] { display: none; }
.nx-layout-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.9rem 1rem 0.7rem;
    border-bottom: 1px solid var(--dk-line-dim);
}
.nx-layout-head h2 {
    margin: 0;
    font-family: var(--dk-font-ui);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.26em;
    background: linear-gradient(120deg, var(--dk-ice), var(--dk-cyan) 60%, var(--dk-storm));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.nx-layout-head p { margin: 0.25rem 0 0; font-size: 0.58rem; letter-spacing: 0.08em; color: var(--dk-muted); }
.nx-layout-close {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border: 1px solid var(--dk-line);
    border-radius: 0.55rem;
    background: transparent;
    color: var(--dk-frost);
    font-size: 1.15rem;
    cursor: pointer;
}
.nx-layout-close:hover { border-color: var(--dk-line-strong); color: var(--dk-ice); }
.nx-layout-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.6rem 0.8rem;
    display: grid;
    gap: 0.45rem;
}
.nx-layout-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 44px;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--dk-line-dim);
    border-radius: 0.5rem;
    background: rgba(6, 12, 24, 0.55);
    cursor: pointer;
    transition: border-color 0.2s;
}
.nx-layout-row:hover { border-color: var(--dk-line-strong); }
.nx-layout-row input { width: 19px; height: 19px; accent-color: var(--dk-cyan); flex: 0 0 auto; }
.nx-layout-row span { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; color: var(--dk-text-soft); }
.nx-layout-foot {
    padding: 0.7rem 0.9rem max(0.8rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--dk-line-dim);
    display: grid;
    gap: 0.5rem;
}
.nx-layout-reset {
    min-height: 44px;
    border: 1px solid rgba(242, 199, 107, 0.45);
    border-radius: 0.55rem;
    background: rgba(242, 199, 107, 0.08);
    color: #ffe9b8;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    cursor: pointer;
}
.nx-layout-reset:hover { background: rgba(242, 199, 107, 0.16); }
.nx-layout-foot p { margin: 0; font-size: 0.54rem; line-height: 1.5; color: var(--dk-muted); }
@media (max-width: 640px) {
    .nx-layout-sheet { inset: auto 0 0 auto; width: 100vw; max-height: 82vh; border-radius: 1rem 1rem 0 0; clip-path: none; }
}

/* — faster first paint on phones: materialize snappier, never a long blank — */
@media (max-width: 760px) {
    .dk-reveal.dk-in { animation-duration: 360ms; }
}

/* tightest phones: the header row absorbs the layout button with room to spare */
@media (max-width: 380px) {
    .deck-contract { gap: 0.3rem; }
    .deck-live { padding: 0.3rem 0.45rem; gap: 0.3rem; }
    .deck-live strong { letter-spacing: 0.08em; font-size: 0.52rem; }
    .nx-product select { max-width: 26vw; }
}

/* ===================================================== FORGE CHART v2 ==== */
/* THE LIVING FORGE — interactive chart with flow currents */
.nx-fg2 {
    position: relative;
    border: 1px solid var(--dk-line);
    border-radius: 12px;
    background:
        radial-gradient(90% 60% at 80% 0%, rgba(65,214,255,0.06), transparent 60%),
        linear-gradient(170deg, rgba(8, 22, 40, 0.72), rgba(3, 10, 20, 0.9));
    padding: 0.5rem;
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}
.nx-fg2::before {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(65,214,255,0.85) 25%, rgba(255,184,92,0.8) 50%, rgba(143,123,255,0.8) 75%, transparent);
    background-size: 220% 100%;
    animation: fg2-seam 8s linear infinite;
}
@keyframes fg2-seam { from { background-position: 140% 0; } to { background-position: -140% 0; } }
.nx-fg2:fullscreen { border-radius: 0; clip-path: none; background: #030b18; padding: 0.8rem; }
.nx-fg2:fullscreen .fg2-layout { height: calc(100vh - 110px); }
.nx-fg2:fullscreen .fg2-stage { height: 100%; }

.fg2-toolbar {
    display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap;
    padding: 0.1rem 0.1rem 0.45rem;
}
.fg2-togs, .fg2-right, .fg2-tfs { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
.fg2-pill {
    font: 600 0.56rem var(--dk-font-ui);
    letter-spacing: 0.12em;
    color: var(--dk-titanium);
    background: rgba(10, 30, 54, 0.55);
    border: 1px solid rgba(126, 151, 174, 0.35);
    border-radius: 6px;
    padding: 0.28rem 0.5rem;
    cursor: pointer;
    transition: color 160ms, border-color 160ms, box-shadow 160ms, background 160ms;
}
.fg2-pill:hover { color: var(--dk-ice); border-color: rgba(65,214,255,0.6); }
.fg2-pill.is-on {
    color: var(--dk-cyan);
    border-color: rgba(65, 214, 255, 0.65);
    background: rgba(15, 45, 74, 0.7);
    box-shadow: 0 0 10px rgba(65, 214, 255, 0.22), inset 0 0 8px rgba(65, 214, 255, 0.08);
}
.fg2-pill-flow.is-on {
    color: var(--dk-gold);
    border-color: rgba(242, 199, 107, 0.7);
    box-shadow: 0 0 12px rgba(242, 199, 107, 0.3);
    animation: fg2-flowpulse 2.6s ease-in-out infinite;
}
@keyframes fg2-flowpulse { 50% { box-shadow: 0 0 18px rgba(242, 199, 107, 0.5); } }
.fg2-density { display: flex; align-items: center; gap: 0.3rem; font: 600 0.52rem var(--dk-font-ui); letter-spacing: 0.16em; color: var(--dk-muted); }
.fg2-density input { width: 5.2rem; accent-color: var(--dk-cyan); }

.fg2-tfbar { display: flex; gap: 0.28rem; flex-wrap: wrap; padding: 0 0.1rem 0.4rem; font-family: var(--dk-font-mono); }
.fg2-tf {
    --c: 0.4;
    font-size: 0.55rem;
    padding: 0.13rem 0.35rem;
    border-radius: 4px;
    border: 1px solid rgba(126, 151, 174, 0.35);
    color: var(--dk-titanium);
    background: rgba(10, 30, 54, 0.5);
}
.fg2-tf.is-up   { color: var(--dk-up);   border-color: rgba(60,230,164,calc(0.25 + var(--c)*0.6));  background: rgba(13,63,49,calc(var(--c)*0.8)); }
.fg2-tf.is-down { color: var(--dk-down); border-color: rgba(255,93,120,calc(0.25 + var(--c)*0.6));  background: rgba(71,18,30,calc(var(--c)*0.8)); }
.fg2-tf.is-wait { color: var(--dk-gold); }

.fg2-layout { display: grid; grid-template-columns: minmax(0, 1fr) 15.5rem; gap: 0.55rem; }
.fg2-stage { position: relative; min-width: 0; }
.fg2-stage canvas { display: block; width: 100%; border-radius: 8px; background: rgba(2, 7, 15, 0.55); cursor: crosshair; }
.fg2-tip {
    position: absolute;
    min-width: 7rem;
    padding: 0.35rem 0.5rem;
    font: 0.58rem var(--dk-font-mono);
    line-height: 1.5;
    color: var(--dk-ice);
    background: rgba(3, 10, 20, 0.95);
    border: 1px solid rgba(65, 214, 255, 0.4);
    border-radius: 6px;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}
.fg2-live {
    position: absolute; right: 0.6rem; bottom: 3rem;
    font: 700 0.6rem var(--dk-font-ui); letter-spacing: 0.14em;
    color: #04101f; background: var(--dk-cyan);
    border: 0; border-radius: 6px; padding: 0.32rem 0.6rem; cursor: pointer;
    box-shadow: var(--dk-glow-cyan);
}
.fg2-sidebar { min-width: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.fg2-tabs { display: flex; gap: 0.25rem; }
.fg2-tab {
    flex: 1;
    font: 600 0.53rem var(--dk-font-ui); letter-spacing: 0.12em;
    color: var(--dk-muted);
    background: rgba(10, 30, 54, 0.45);
    border: 1px solid rgba(126, 151, 174, 0.3);
    border-radius: 6px;
    padding: 0.32rem 0.2rem;
    cursor: pointer;
}
.fg2-tab.is-on { color: var(--dk-cyan); border-color: rgba(65, 214, 255, 0.6); background: rgba(15, 45, 74, 0.6); }
.fg2-side { display: flex; flex-direction: column; gap: 0.45rem; overflow: auto; max-height: 26rem; }
.fg2-card {
    border: 1px solid var(--dk-line);
    border-left: 2px solid rgba(65, 214, 255, 0.55);
    border-radius: 8px;
    background: rgba(6, 16, 30, 0.72);
    padding: 0.5rem 0.55rem;
}
.fg2-card h3 { margin: 0 0 0.35rem; font: 600 0.55rem var(--dk-font-ui); letter-spacing: 0.22em; color: var(--dk-frost); }
.fg2-verdict { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.25rem; }
.fg2-verdict b { font: 700 1.25rem var(--dk-font-display); letter-spacing: 0.1em; }
.fg2-verdict i { font: 0.7rem var(--dk-font-mono); color: var(--dk-soft); }
.fg2-verdict.is-up b { color: var(--dk-up); text-shadow: 0 0 14px rgba(60,230,164,0.5); }
.fg2-verdict.is-down b { color: var(--dk-down); text-shadow: 0 0 14px rgba(255,93,120,0.5); }
.fg2-verdict.is-wait b { color: var(--dk-gold); }
.fg2-line { margin: 0.15rem 0; font-size: 0.62rem; color: var(--dk-ice); line-height: 1.45; }
.fg2-inv { margin: 0.3rem 0 0; font-size: 0.55rem; color: var(--dk-down); line-height: 1.4; }
.fg2-kv { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.12rem 0; font-size: 0.56rem; }
.fg2-kv span { color: var(--dk-muted); letter-spacing: 0.12em; }
.fg2-kv b { color: var(--dk-silver); font-family: var(--dk-font-mono); font-weight: 500; text-align: right; }
.fg2-list { margin: 0; padding-left: 0.9rem; font-size: 0.58rem; color: var(--dk-soft); line-height: 1.6; }
.fg2-log { margin: 0; padding: 0; list-style: none; font-size: 0.55rem; line-height: 1.6; color: var(--dk-soft); }
.fg2-log span { color: var(--dk-cyan-dim); font-family: var(--dk-font-mono); margin-right: 0.4rem; }
.fg2-leg { display: flex; align-items: center; gap: 0.45rem; font-size: 0.57rem; color: var(--dk-soft); padding: 0.14rem 0; }
.fg2-leg i { width: 0.85rem; height: 0.5rem; border-radius: 3px; border: 1px solid var(--k); box-shadow: 0 0 8px var(--k); background: color-mix(in srgb, var(--k) 25%, transparent); }
.fg2-note { margin: 0.4rem 0 0; font-size: 0.52rem; color: var(--dk-muted); line-height: 1.5; }
.fg2-una { font-size: 0.56rem; letter-spacing: 0.14em; color: var(--dk-muted); }

/* pop-out solo mode: the forge becomes the whole page */
body.fg2-solo .deck-rail,
body.fg2-solo .deck-top,
body.fg2-solo .deck-intel,
body.fg2-solo section.nx-card:not(#nx-forge),
body.fg2-solo #nx-watch { display: none !important; }
body.fg2-solo #nx-forge { margin: 0.5rem; }

@media (max-width: 900px) {
    .fg2-layout { grid-template-columns: 1fr; }
    .fg2-side { max-height: 16rem; }
}
@media (max-width: 560px) {
    .fg2-right { width: 100%; justify-content: flex-start; }
}

/* ================================================================= */
/* R6C — LAYOUT BUTTON: BIFROST PLATE                                */
/* Runic control plate: notched corners, seam-light sweep, gold      */
/* keel line, pulsing modular tile, gradient sigil text.             */
/* ================================================================= */
.nx-layout-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem 1rem 0.5rem 0.78rem;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    border: 1px solid rgba(65, 214, 255, 0.42);
    clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
    background:
        radial-gradient(120% 160% at 8% 0%, rgba(65, 214, 255, 0.14), transparent 46%),
        radial-gradient(130% 170% at 96% 110%, rgba(143, 123, 255, 0.16), transparent 52%),
        linear-gradient(115deg, rgba(9, 21, 37, 0.97) 0%, rgba(14, 32, 54, 0.97) 52%, rgba(22, 22, 52, 0.97) 100%);
    color: #c9ecff;
    box-shadow:
        inset 0 0 16px rgba(65, 214, 255, 0.10),
        inset 0 1px 0 rgba(196, 239, 255, 0.16),
        0 0 14px rgba(65, 214, 255, 0.16);
    transition: border-color 200ms, box-shadow 220ms, transform 150ms, color 200ms;
}
.nx-layout-btn::before {
    /* bifrost seam: a shard of light sweeping the plate */
    content: "";
    position: absolute;
    inset: -45% -65%;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(105deg,
        transparent 40%,
        rgba(65, 214, 255, 0.20) 48%,
        rgba(196, 239, 255, 0.28) 51%,
        rgba(143, 123, 255, 0.18) 55%,
        transparent 64%);
    transform: translateX(-78%);
    animation: nxLayoutSweep 5.4s ease-in-out infinite;
}
@keyframes nxLayoutSweep {
    0%, 55% { transform: translateX(-78%); }
    85%, 100% { transform: translateX(78%); }
}
.nx-layout-btn::after {
    /* gold keel line under the sigil */
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: 3px;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(242, 199, 107, 0.9), transparent);
    opacity: 0.65;
    transition: left 220ms, right 220ms, opacity 220ms;
}
.nx-layout-btn:hover::after,
.nx-layout-btn:focus-visible::after { left: 5%; right: 5%; opacity: 1; }
.nx-layout-btn svg {
    width: 17px;
    height: 17px;
    flex: none;
    color: #41d6ff;
    filter: drop-shadow(0 0 5px rgba(65, 214, 255, 0.7));
    transition: color 200ms, filter 200ms;
}
.nx-layout-btn svg rect { transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.nx-layout-btn svg rect:nth-child(4) {
    animation: nxTileForge 2.8s ease-in-out infinite;
}
@keyframes nxTileForge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.22; }
}
.nx-layout-btn:hover svg rect:nth-child(1) { transform: translate(0.8px, 0.8px); }
.nx-layout-btn:hover svg rect:nth-child(2) { transform: translate(-0.8px, 0.8px); }
.nx-layout-btn:hover svg rect:nth-child(3) { transform: translate(0.8px, -0.8px); }
.nx-layout-btn:hover svg rect:nth-child(4) { transform: translate(-0.8px, -0.8px); }
.nx-layout-btn span {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    line-height: 1;
    background: linear-gradient(92deg, #c4efff 0%, #41d6ff 52%, #a08bff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #9fd9f2; /* fallback if clip unsupported */
    transform: translateY(0.5px);
}
.nx-layout-btn:hover,
.nx-layout-btn:focus-visible {
    border-color: rgba(242, 199, 107, 0.75);
    color: #eaf7ff;
    transform: translateY(-1px);
    box-shadow:
        inset 0 0 20px rgba(65, 214, 255, 0.18),
        inset 0 1px 0 rgba(196, 239, 255, 0.22),
        0 0 22px rgba(65, 214, 255, 0.38),
        0 0 10px rgba(242, 199, 107, 0.28);
}
.nx-layout-btn:hover svg,
.nx-layout-btn:focus-visible svg {
    color: #f2c76b;
    filter: drop-shadow(0 0 7px rgba(242, 199, 107, 0.75));
}
.nx-layout-btn:focus-visible { outline: 2px solid rgba(65, 214, 255, 0.6); outline-offset: 2px; }
.nx-layout-btn:active { transform: translateY(0) scale(0.98); }
.nx-layout-btn[aria-expanded="true"] {
    border-color: rgba(242, 199, 107, 0.85);
    box-shadow:
        inset 0 0 22px rgba(242, 199, 107, 0.16),
        0 0 20px rgba(242, 199, 107, 0.3);
}
.nx-layout-btn[aria-expanded="true"] svg { color: #f2c76b; }
@media (prefers-reduced-motion: reduce) {
    .nx-layout-btn::before,
    .nx-layout-btn svg rect:nth-child(4) { animation: none; }
    .nx-layout-btn:hover { transform: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   R7X · THE QUIET DECK — the final layer (2026-09-02)
   One design, two plate tiers, one type scale. Nothing below invents a new
   color: every value is a deck token. Hero plates (.is-hero) keep the full
   bifrost frame; every other plate goes quiet — static hairline seam, no
   scanline, no halo bloom, no corner reticles, no hover lift — so the eye
   lands on the session first. Labels never drop below 0.68rem again.
   Members can fold any card; the fold is remembered on the device.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
    --dk-t-label: 0.68rem;   /* small caps labels */
    --dk-t-chip: 0.64rem;    /* status chips */
    --dk-t-title: 0.7rem;    /* card titles */
    --dk-t-value: 0.94rem;   /* mono values */
    --dk-t-body: 0.8rem;     /* running copy */
    --dk-r-tag: 6px;
    --dk-r-input: 8px;
    --dk-line-quiet: rgba(120, 168, 240, 0.18);
    --dk-seam-quiet: rgba(140, 216, 255, 0.42);
    --dk-tint-up: rgba(60, 230, 164, 0.10);
    --dk-tint-down: rgba(255, 93, 120, 0.10);
    --dk-tint-gold: rgba(242, 199, 107, 0.10);
    --dk-tint-cyan: rgba(65, 214, 255, 0.10);
}

/* ---------------------------------------------------------- type scale --- */
body.nexus-deck .nx-fact small,
body.nexus-deck .nx-entry small,
body.nexus-deck .nx-dial-center small,
body.nexus-deck .nx-heat-sub,
body.nexus-deck .nx-subhead { font-size: var(--dk-t-label); letter-spacing: 0.16em; }
body.nexus-deck .nx-fact strong { font-size: var(--dk-t-value); line-height: 1.25; }
body.nexus-deck .nx-card-title h2,
body.nexus-deck .nx-card-title h3 { font-size: var(--dk-t-title); letter-spacing: 0.22em; color: var(--dk-frost); }
body.nexus-deck .nx-chip { font-size: var(--dk-t-chip); letter-spacing: 0.12em; padding: 0.26rem 0.62rem; line-height: 1.1; }
body.nexus-deck .nx-heat-title { font-size: var(--dk-t-title); letter-spacing: 0.22em; }
body.nexus-deck .nx-raven-words,
body.nexus-deck .nx-quotes-foot,
body.nexus-deck .nx-sizing-note,
body.nexus-deck .nx-heim-note { font-size: var(--dk-t-body); line-height: 1.55; }
body.nexus-deck .nx-heat-cell small { font-size: 0.52rem; }
body.nexus-deck .nx-heat-cell { font-size: 0.7rem; }

/* grids never grow past their column — long values wrap, they do not push */
body.nexus-deck .nx-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
body.nexus-deck .nx-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.nexus-deck .deck-intel, body.nexus-deck .deck-stage { min-width: 0; }
@media (min-width: 1281px) { body.nexus-deck .deck-intel { grid-template-columns: minmax(0, 1fr); } }
body.nexus-deck .nx-fact { min-width: 0; }
body.nexus-deck .nx-fact small { overflow-wrap: normal; hyphens: none; }
body.nexus-deck .nx-sr-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 0.6rem; }
body.nexus-deck .nx-sr-counts .nx-fact small { font-size: var(--dk-t-label); }
body.nexus-deck .nx-sr-counts .nx-fact strong { font-size: var(--dk-t-value); }
body.nexus-deck .nx-sr-side header small { font-size: var(--dk-t-label); letter-spacing: 0.18em; }
body.nexus-deck .nx-sr-prev { font-size: 0.66rem; }
body.nexus-deck .nx-fact .nx-chip { max-width: 100%; }

/* ---------------------------------------------------- chip discipline ---- */
body.nexus-deck .nx-chip {
    border-color: var(--dk-line-quiet);
    background: rgba(3, 4, 18, 0.55);
    box-shadow: none;
    text-shadow: none;
}
body.nexus-deck .nx-chip.is-up { color: var(--dk-up); border-color: rgba(60, 230, 164, 0.34); background: var(--dk-tint-up); }
body.nexus-deck .nx-chip.is-down { color: var(--dk-down); border-color: rgba(255, 93, 120, 0.34); background: var(--dk-tint-down); }
body.nexus-deck .nx-chip.is-gold { color: var(--dk-gold); border-color: rgba(242, 199, 107, 0.36); background: var(--dk-tint-gold); }
body.nexus-deck .nx-chip.is-cyan { color: var(--dk-cyan); border-color: rgba(65, 214, 255, 0.36); background: var(--dk-tint-cyan); }
body.nexus-deck .nx-chip.is-dim { opacity: 0.8; }

/* --------------------------------------------------- two plate tiers ----- */
/* tier 2 — the quiet plate: same silhouette, still seam, no theatre */
body.nexus-deck .nx-card:not(.is-hero):not(.is-hot):not(.is-up-glow):not(.is-down-glow):not(.is-gold-glow) { filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.42)); }
body.nexus-deck .nx-card:not(.is-hero):not(.is-hot):not(.is-up-glow):not(.is-down-glow):not(.is-gold-glow) > .nx-card-body { border-color: var(--dk-line-quiet); }
body.nexus-deck .nx-card:not(.is-hero):not(.is-hot):not(.is-up-glow):not(.is-down-glow):not(.is-gold-glow) > .nx-card-body::before {
    animation: none;
    background: linear-gradient(100deg, transparent 0%, var(--dk-seam-quiet) 22%, rgba(178, 124, 255, 0.28) 55%, transparent 100%);
    background-size: 100% 100%;
    opacity: 0.7;
}
body.nexus-deck .nx-card:not(.is-hero):not(.is-hot):not(.is-up-glow):not(.is-down-glow):not(.is-gold-glow) > .nx-card-body::after { display: none; }
body.nexus-deck .nx-card:not(.is-hero):not(.is-hot):not(.is-up-glow):not(.is-down-glow):not(.is-gold-glow) .nx-plate { display: none; }
body.nexus-deck .nx-card:not(.is-hero):not(.is-hot):not(.is-up-glow):not(.is-down-glow):not(.is-gold-glow):hover > .nx-card-body { transform: none; }
/* tier 1 — the hero keeps the living seam, but one scanline is enough */
body.nexus-deck .nx-card.is-hero > .nx-card-body::before, body.nexus-deck .nx-card.is-hot > .nx-card-body::before { opacity: 0.85; }
body.nexus-deck .nx-card.is-hero { filter: drop-shadow(0 22px 44px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 26px var(--nx-halo)); }
body.nexus-deck .nx-card.is-hero.is-up-glow { filter: drop-shadow(0 22px 44px rgba(0,0,0,0.6)) drop-shadow(0 0 26px rgba(60, 230, 164, 0.26)); }
body.nexus-deck .nx-card.is-hero.is-down-glow { filter: drop-shadow(0 22px 44px rgba(0,0,0,0.6)) drop-shadow(0 0 26px rgba(255, 93, 120, 0.26)); }
body.nexus-deck .nx-card.is-hero.is-gold-glow { filter: drop-shadow(0 22px 44px rgba(0,0,0,0.6)) drop-shadow(0 0 26px rgba(242, 199, 107, 0.24)); }

/* ---------------------------------------------------- folding cards ------ */
body.nexus-deck .nx-card.can-fold > .nx-card-body { padding-top: 1rem; }
body.nexus-deck .nx-card.can-fold > .nx-card-body > .nx-card-title { padding-right: 1.9rem; }
body.nexus-deck .nx-fold {
    position: absolute;
    top: 0.78rem; right: 0.95rem;
    z-index: 4;
    width: 1.35rem; height: 1.35rem;
    display: inline-grid; place-items: center;
    padding: 0;
    border: 1px solid var(--dk-line-quiet);
    border-radius: 999px;
    background: rgba(3, 4, 18, 0.5);
    color: var(--dk-frost);
    cursor: pointer;
    transition: border-color 200ms, color 200ms;
}
body.nexus-deck .nx-fold svg { width: 0.75rem; height: 0.75rem; transition: transform 240ms var(--dk-snap); }
body.nexus-deck .nx-fold:hover { border-color: var(--dk-line-strong); color: var(--dk-ice); }
body.nexus-deck .nx-fold:focus-visible { outline: 2px solid var(--dk-cyan); outline-offset: 2px; }
body.nexus-deck .nx-card.is-folded .nx-fold svg { transform: rotate(-90deg); }
body.nexus-deck .nx-card.is-folded > .nx-card-body > *:not(.nx-card-title):not(.nx-plate) { display: none !important; }
body.nexus-deck .nx-card.is-folded > .nx-card-body { padding-bottom: 0.7rem; }
body.nexus-deck .nx-card.is-folded .nx-card-title { margin-bottom: 0; }
body.nexus-deck .nx-card-title .nx-fold-sum {
    flex: 1 1 auto; min-width: 0;
    font-size: var(--dk-t-chip); letter-spacing: 0.08em; color: var(--dk-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: none;
}
body.nexus-deck .nx-card.is-folded .nx-card-title .nx-fold-sum { display: block; }
/* the title row is the handle */
body.nexus-deck .nx-card.can-fold .nx-card-title { cursor: pointer; user-select: none; }

/* ------------------------------------------------- the session strip ----- */
/* HEAT becomes a slim band riding under the hero — no plate of its own */
body.nexus-deck .nx-heat { margin: -0.15rem 0 1rem; filter: none; }
body.nexus-deck .nx-heat > .nx-card-body {
    clip-path: none;
    background: transparent;
    border: 0;
    padding: 0 0.2rem;
}
body.nexus-deck .nx-heat > .nx-card-body::before,
body.nexus-deck .nx-heat > .nx-card-body::after { display: none; }
body.nexus-deck .nx-heat-head { margin-bottom: 0.35rem; }
body.nexus-deck .nx-heat-sub { display: none; }
@media (min-width: 1500px) { body.nexus-deck .nx-heat-sub { display: inline; font-size: 0.62rem; letter-spacing: 0.08em; } }
body.nexus-deck .nx-heat-row { gap: 0.3rem; }
body.nexus-deck .nx-heat-cell {
    height: 1.95rem;
    border-radius: var(--dk-r-tag);
    border: 1px solid var(--dk-line-quiet);
    background: rgba(3, 4, 18, 0.5);
    color: var(--dk-muted);
    box-shadow: none;
    transition: border-color 200ms;
}
body.nexus-deck .nx-heat-cell:hover { transform: none; border-color: var(--dk-line-strong); }
body.nexus-deck .nx-heat-cell i { display: none; }
body.nexus-deck .nx-heat-cell.W { color: var(--dk-up); background: rgba(60, 230, 164, 0.14); border-color: rgba(60, 230, 164, 0.42); box-shadow: none; }
body.nexus-deck .nx-heat-cell.L { color: var(--dk-down); background: rgba(255, 93, 120, 0.14); border-color: rgba(255, 93, 120, 0.42); box-shadow: none; }
body.nexus-deck .nx-heat-cell.W.LEAN { background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(60, 230, 164, 0.16) 4px 6px), rgba(60, 230, 164, 0.05); }
body.nexus-deck .nx-heat-cell.L.LEAN { background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255, 93, 120, 0.16) 4px 6px), rgba(255, 93, 120, 0.05); }
body.nexus-deck .nx-heat-cell.LIVE { color: var(--dk-ice); background: var(--dk-tint-cyan); border-color: rgba(65, 214, 255, 0.6); }
body.nexus-deck .nx-heat-cell.SETTLING { color: var(--dk-gold); background: var(--dk-tint-gold); border-color: rgba(242, 199, 107, 0.4); }
body.nexus-deck .nx-heat-cell small { top: 0.14rem; left: 0.32rem; opacity: 0.7; }
body.nexus-deck .nx-heat-cell { height: 2.25rem; place-items: end center; padding-bottom: 0.28rem; }

/* RAVEN — one quiet line while roosting; opens itself when inbound */
body.nexus-deck .nx-raven-line {
    flex: 1 1 auto; min-width: 0;
    font-family: var(--dk-font-mono);
    font-size: 0.72rem; letter-spacing: 0.04em;
    color: var(--dk-text-soft);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.nexus-deck .nx-raven:not(.is-open):not(.is-inbound):not(.is-said) .nx-raven-wrap { display: none; }
body.nexus-deck .nx-raven:not(.is-open):not(.is-inbound):not(.is-said) .nx-card-title { margin-bottom: 0; }
body.nexus-deck .nx-raven:not(.is-open):not(.is-inbound):not(.is-said) > .nx-card-body { padding-top: 0.7rem; padding-bottom: 0.7rem; }
body.nexus-deck .nx-raven.is-open .nx-raven-line,
body.nexus-deck .nx-raven.is-inbound .nx-raven-line,
body.nexus-deck .nx-raven.is-said .nx-raven-line { display: none; }
body.nexus-deck .nx-raven .nx-card-title { cursor: pointer; user-select: none; flex-wrap: nowrap; }
body.nexus-deck .nx-raven .nx-card-title h3 { flex: 0 0 auto; }
body.nexus-deck .nx-raven .nx-card-title .nx-chip { flex: 0 0 auto; }
body.nexus-deck .nx-raven-lead strong { font-size: 1rem; }
body.nexus-deck .nx-raven.is-inbound { filter: drop-shadow(0 18px 34px rgba(0,0,0,.5)) drop-shadow(0 0 22px rgba(242, 199, 107, 0.26)); }

/* --------------------------------------------------- top bar + rail ------ */
body.nexus-deck .nx-layout-btn::before,
body.nexus-deck .nx-layout-btn::after { animation: none; }
body.nexus-deck .deck-rail .rail-btn { box-shadow: none; }
body.nexus-deck .deck-rail .rail-btn:hover,
body.nexus-deck .deck-rail .rail-btn.is-active { box-shadow: 0 0 0 1px rgba(65, 214, 255, 0.35) inset; }
body.nexus-deck .rail-wing { border-top: 1px solid var(--dk-line-quiet); padding-top: 0.45rem; margin-top: 0.25rem; }

/* the crown bar never collides on laptops: things shrink before they overlap */
body.nexus-deck .deck-pulse > * { min-width: 0; }
@media (max-width: 1440px) and (min-width: 901px) {
    body.nexus-deck .deck-top { gap: 0.7rem; }
    body.nexus-deck .deck-pulse { gap: 0.8rem; }
    body.nexus-deck #nx-spark { display: none; }
    body.nexus-deck .deck-brand-name strong { font-size: 0.9rem; letter-spacing: 0.1em; }
}
@media (max-width: 1300px) and (min-width: 901px) {
    body.nexus-deck .deck-brand-name small { display: none; }
    body.nexus-deck .deck-price-meta { gap: 0.5rem; font-size: 0.58rem; }
    body.nexus-deck .deck-contract-chip { max-width: 11rem; }
    body.nexus-deck #nx-price { font-size: 1.25rem; }
}
@media (max-width: 1130px) and (min-width: 901px) {
    body.nexus-deck .deck-price-label,
    body.nexus-deck .deck-price-meta,
    body.nexus-deck .deck-contract-chip small,
    body.nexus-deck .nx-layout-btn span,
    body.nexus-deck .live-chat-launcher-label { display: none; }
    body.nexus-deck .deck-contract { gap: 0.55rem; }
    body.nexus-deck .deck-contract-chip { max-width: 9.5rem; }
    body.nexus-deck #nx-ticker { font-size: 0.66rem; }
    body.nexus-deck .deck-live strong { font-size: 0.58rem; }
}

/* ------------------------------------------------------- radii law ------- */
body.nexus-deck .nx-entry,
body.nexus-deck .nx-oathcard,
body.nexus-deck .nx-rung,
body.nexus-deck .nx-heim-pill,
body.nexus-deck .nx-ws-tabs button,
body.nexus-deck .nx-quote-box,
body.nexus-deck .nx-sr-box { border-radius: var(--dk-r-input); }
body.nexus-deck input[type="number"],
body.nexus-deck input[type="text"],
body.nexus-deck select { border-radius: var(--dk-r-input); }

/* ---------------------------------------------- the hall pages inherit --- */
body.nexus-deck .reel .nx-chip, body.nexus-deck .film-timeline .nx-chip { font-size: 0.54rem; padding: 0.16rem 0.42rem; letter-spacing: 0.1em; }
@media (max-width: 640px) { body.nexus-deck .nx-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.nexus-deck .hall-nav { scrollbar-width: none; }
body.nexus-deck .hall-nav::-webkit-scrollbar { display: none; }

/* -------------------------------------------------- reduced motion law --- */
@media (prefers-reduced-motion: reduce) {
    body.nexus-deck .nx-fold, body.nexus-deck .nx-fold svg { transition: none; }
}


/* MOBILEFIX-DECK-2026-09-06 */
/* Same cause as the gate: iOS and the app's WKWebView zoom into any focused field under 16px, and a
   zoomed page is wider than the screen, so it pans sideways. Measured on the live deck before this
   fix: #nx-product-switch 13.2px, #nx-size-bank 14.08px, #nx-size-unit 14.08px, #nx-heim-entry
   13.64px. Pinch-zoom is left working on purpose. */
@media (max-width: 900px) {
  input, select, textarea,
  .nexus-deck input, .nexus-deck select, .nexus-deck textarea,
  #nx-product-switch, #nx-size-bank, #nx-size-unit, #nx-heim-entry {
    font-size: 16px;
  }
  /* a range slider has no text, and 16px would change its track metrics */
  input[type="range"] { font-size: inherit; }
}

/* -- R18 WHO'S ONLINE (owner 2026-09-15): the presence pill opens the roster -- */
body.nexus-deck .live-chat-presence-bar .live-chat-presence-btn {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0.2rem 0.55rem 0.2rem 0.35rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--dk-up);
    font-family: var(--dk-font-mono);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
body.nexus-deck .live-chat-presence-btn:hover,
body.nexus-deck .live-chat-presence-btn[aria-expanded="true"] {
    border-color: rgba(60, 230, 164, 0.45);
    background: rgba(60, 230, 164, 0.08);
    color: var(--dk-ice);
}
body.nexus-deck .live-chat-presence-btn:focus-visible {
    outline: 2px solid var(--dk-gold);
    outline-offset: 2px;
}
body.nexus-deck .live-chat-presence-btn::after {
    content: "";
    display: inline-block;
    width: 0.32rem;
    height: 0.32rem;
    margin-left: 0.45rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-0.12rem) rotate(45deg);
    transition: transform 0.2s;
}
body.nexus-deck .live-chat-presence-btn[aria-expanded="true"]::after {
    transform: translateY(0.08rem) rotate(-135deg);
}
body.nexus-deck .live-chat-online {
    position: relative;
    z-index: 2;
    max-height: 38%;
    overflow-y: auto;
    border-bottom: 1px solid var(--dk-line-dim);
    background: rgba(5, 14, 27, 0.82);
    backdrop-filter: blur(6px);
}
body.nexus-deck .live-chat-online[hidden] { display: none; }
body.nexus-deck .live-chat-online-head {
    padding: 0.5rem 1.05rem 0.3rem;
    color: var(--dk-gold);
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.24em;
}
body.nexus-deck .live-chat-online-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin: 0;
    padding: 0 1.05rem 0.65rem;
    list-style: none;
}
body.nexus-deck .live-chat-online-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 28px;
    padding: 0 0.6rem 0 0.5rem;
    border: 1px solid var(--dk-line-dim);
    border-radius: 999px;
    background: rgba(15, 40, 70, 0.55);
    color: var(--dk-ice);
    font-family: var(--dk-font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
}
body.nexus-deck .live-chat-online-item[data-self="true"] {
    border-color: rgba(242, 199, 107, 0.5);
}
body.nexus-deck .live-chat-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dk-up);
    box-shadow: 0 0 8px rgba(60, 230, 164, 0.8);
}
body.nexus-deck .live-chat-online-you {
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: rgba(242, 199, 107, 0.16);
    color: var(--dk-gold);
    font-size: 0.48rem;
    font-weight: 800;
    letter-spacing: 0.2em;
}
body.nexus-deck .live-chat-online-empty {
    color: var(--dk-muted);
    font-size: 0.55rem;
    letter-spacing: 0.18em;
}
@media (prefers-reduced-motion: reduce) {
    body.nexus-deck .live-chat-presence-btn,
    body.nexus-deck .live-chat-presence-btn::after { transition: none; }
}
