/* ==========================================================================
   Kommandozentrale – HUD styles (local fonts, no frameworks)
   ========================================================================== */

@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("../fonts/rajdhani-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("../fonts/rajdhani-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("../fonts/rajdhani-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("../fonts/rajdhani-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Share Tech Mono"; src: url("../fonts/share-tech-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
    --bg: #02060d;
    --bg-2: #050d18;
    --panel: rgba(8, 22, 38, .55);
    --panel-strong: rgba(8, 24, 42, .82);
    --line: rgba(94, 231, 255, .18);
    --line-strong: rgba(94, 231, 255, .45);
    --cyan: #5ee7ff;
    --cyan-2: #22d3ee;
    --cyan-dim: #3aa7bd;
    --gold: #ffb547;
    --red: #ff4d5e;
    --green: #3df5a7;
    --text: #d8f6ff;
    --text-dim: #7fa3b3;
    --glow: 0 0 12px rgba(94, 231, 255, .55), 0 0 32px rgba(34, 211, 238, .25);
    --font: "Rajdhani", "Segoe UI", system-ui, sans-serif;
    --display: "Orbitron", "Rajdhani", system-ui, sans-serif;
    --mono: "Share Tech Mono", ui-monospace, Menlo, monospace;
    --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
    margin: 0; min-height: 100vh; overflow-x: hidden;
    font-family: var(--font); font-size: 17px; line-height: 1.45; color: var(--text);
    background: radial-gradient(ellipse at 50% -10%, #0b2238 0%, var(--bg-2) 45%, var(--bg) 100%) fixed;
}
a { color: var(--cyan); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
code { font-family: var(--mono); color: var(--cyan); }
.display { font-family: var(--display); letter-spacing: .06em; }
.mono { font-family: var(--mono); letter-spacing: .08em; }
.dim { color: var(--text-dim); }
.small { font-size: .85rem; }
.tiny { font-size: .72rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; box-shadow: var(--glow); }

/* Background layers ----------------------------------------------------- */
.bg-particles, .bg-grid, .bg-glow, .bg-scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg-particles { width: 100%; height: 100%; opacity: .7; }
.bg-grid {
    background-image:
        linear-gradient(rgba(94, 231, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(94, 231, 255, .06) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
    animation: grid-drift 40s linear infinite;
}
.bg-glow {
    background:
        radial-gradient(circle at 15% 85%, rgba(255, 181, 71, .07), transparent 35%),
        radial-gradient(circle at 85% 20%, rgba(34, 211, 238, .1), transparent 40%);
}
.bg-scanlines {
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px);
    mix-blend-mode: overlay;
}
@keyframes grid-drift { to { background-position: 46px 46px, 46px 46px; } }

/* Panels with corner brackets ------------------------------------------- */
.panel {
    position: relative; z-index: 1; padding: 1.4rem 1.5rem;
    background: linear-gradient(160deg, rgba(14, 40, 64, .55), rgba(4, 14, 26, .7));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 0 40px rgba(34, 211, 238, .05), 0 20px 60px rgba(0, 0, 0, .4);
}
.corner { position: absolute; width: 14px; height: 14px; border-color: var(--cyan); border-style: solid; filter: drop-shadow(0 0 4px var(--cyan)); }
.corner.tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.corner.tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.corner.bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.corner.br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.panel-title { font-size: .8rem; color: var(--cyan); letter-spacing: .3em; margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; }
.panel-title::before { content: ""; width: 6px; height: 6px; background: var(--cyan); box-shadow: var(--glow); transform: rotate(45deg); }
.panel-meta { margin-left: auto; color: var(--text-dim); letter-spacing: .1em; font-size: .7rem; }
.eyebrow { color: var(--gold); font-size: .75rem; letter-spacing: .25em; margin-bottom: .5rem; }

/* Buttons, forms -------------------------------------------------------- */
.btn-hud {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    min-height: 46px; padding: .6rem 1.4rem; border: 1px solid var(--line-strong); background: rgba(94, 231, 255, .06);
    color: var(--text); font-family: var(--display); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
    cursor: pointer; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: background .2s, box-shadow .2s, color .2s;
}
.btn-hud:hover { background: rgba(94, 231, 255, .14); box-shadow: var(--glow); }
.btn-hud:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: linear-gradient(90deg, rgba(34, 211, 238, .35), rgba(94, 231, 255, .18)); border-color: var(--cyan); color: #fff; text-shadow: 0 0 8px var(--cyan); }
.btn-arrow { font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.btn-hud:hover .btn-arrow { transform: translateX(4px); }

.hud-form { display: grid; gap: 1rem; margin-top: 1.4rem; }
.hud-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hud-field { display: grid; gap: .35rem; }
.hud-field > span { font-size: .7rem; color: var(--cyan-dim); letter-spacing: .22em; }
.hud-field input, .hud-field select {
    width: 100%; min-height: 46px; padding: .55rem .8rem; font: inherit; font-size: 1.05rem; color: var(--text);
    background: rgba(2, 10, 20, .7); border: 1px solid var(--line); border-radius: 2px; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.hud-field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%), linear-gradient(135deg, var(--cyan) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.hud-field input:focus, .hud-field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), var(--glow); }
.alert { margin-top: 1rem; padding: .7rem 1rem; border-left: 3px solid; font-weight: 500; background: rgba(255, 255, 255, .03); }
.alert-error { border-color: var(--red); color: #ffb3bb; background: rgba(255, 77, 94, .08); }
.alert-success { border-color: var(--green); color: #b6ffe0; background: rgba(61, 245, 167, .07); }
.alert-info { border-color: var(--cyan); color: var(--text); background: rgba(94, 231, 255, .07); }

.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line);
    background: rgba(94, 231, 255, .04); color: var(--cyan); cursor: pointer; border-radius: 2px; transition: all .2s;
}
.icon-btn:hover { border-color: var(--cyan); box-shadow: var(--glow); }
.icon-btn-danger { color: var(--red); border-color: rgba(255, 77, 94, .3); }
.icon-btn-danger:hover { border-color: var(--red); box-shadow: 0 0 14px rgba(255, 77, 94, .5); }
.ico { width: 22px; height: 22px; }
.ico-sm { width: 18px; height: 18px; }
.ico-xs { width: 12px; height: 12px; vertical-align: -1px; }

/* Reactor --------------------------------------------------------------- */
.reactor { width: 100%; height: auto; overflow: visible; }
.reactor .r-faint { fill: none; stroke: rgba(94, 231, 255, .12); stroke-width: 1; }
.reactor .r-dash-fine { fill: none; stroke: rgba(94, 231, 255, .5); stroke-width: 1; stroke-dasharray: 2 6; }
.reactor .r-arc { fill: none; stroke: var(--cyan); stroke-width: 3; filter: drop-shadow(0 0 6px var(--cyan)); }
.reactor .r-gold { stroke: var(--gold); stroke-width: 2.5; filter: drop-shadow(0 0 6px var(--gold)); }
.reactor .tick { stroke: rgba(94, 231, 255, .45); stroke-width: 1; }
.reactor .tick-l { stroke: var(--cyan); stroke-width: 2; }
.reactor .seg { fill: rgba(94, 231, 255, .25); stroke: var(--cyan); stroke-width: 1; }
.reactor .r-solid { fill: rgba(2, 10, 20, .9); stroke: rgba(94, 231, 255, .6); stroke-width: 1.5; }
.reactor .r-inner { fill: none; stroke: rgba(232, 253, 255, .35); stroke-width: 1; stroke-dasharray: 3 3; }
.reactor .core { animation: core-pulse 3.2s ease-in-out infinite; transform-origin: 200px 200px; }
.reactor .ring { transform-origin: 200px 200px; }
.reactor .ring-a { animation: spin 60s linear infinite; }
.reactor .ring-b { animation: spin 24s linear infinite reverse; }
.reactor .ring-c { animation: spin 90s linear infinite; }
.reactor .ring-d { animation: spin 14s linear infinite; }
.reactor .ring-e { animation: spin 30s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes core-pulse { 0%, 100% { opacity: .75; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }

/* Auth pages ------------------------------------------------------------ */
.page-auth .auth-wrap {
    position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
    align-items: center; gap: 4rem; max-width: 1100px; margin: 0 auto; padding: 2rem;
}
.auth-reactor { position: relative; max-width: 440px; justify-self: center; width: 100%; }
.auth-reactor-label { text-align: center; margin-top: .6rem; letter-spacing: .4em; }
.auth-panel h1 { font-size: 2rem; text-shadow: 0 0 18px rgba(94, 231, 255, .5); margin-bottom: .3rem; }
.auth-foot { margin-top: 1.4rem; }

/* Topbar ---------------------------------------------------------------- */
.hud { position: relative; z-index: 1; max-width: 1480px; margin: 0 auto; padding: 1.2rem 1.6rem 2rem; }
.hud-narrow { max-width: 1100px; }
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .4rem 0 1.2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.brand { display: flex; align-items: center; gap: .9rem; color: var(--text); }
.brand-hex {
    display: grid; place-items: center; width: 44px; height: 50px; color: var(--cyan);
    background: rgba(94, 231, 255, .1); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    box-shadow: inset 0 0 12px rgba(94, 231, 255, .4);
}
.brand-name { display: block; font-weight: 700; font-size: 1.05rem; letter-spacing: .18em; text-shadow: 0 0 14px rgba(94, 231, 255, .45); }
.brand-sub { display: block; font-size: .66rem; color: var(--text-dim); letter-spacing: .3em; }
.topbar-status { display: flex; align-items: center; gap: .6rem; margin-left: auto; font-size: .78rem; color: var(--green); letter-spacing: .2em; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.topbar-right form { margin: 0; }
.topbar-clock { font-size: 1.05rem; color: var(--cyan); text-shadow: var(--glow); min-width: 6.5ch; text-align: right; margin-right: .4rem; }
.hud-alert { margin: -.5rem 0 1.2rem; }

/* Main grid ------------------------------------------------------------- */
.hud-main { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr) minmax(0, 320px); gap: 1.6rem; align-items: stretch; }
.side-panel { display: flex; flex-direction: column; }
.telemetry { display: grid; gap: .65rem; margin: 0 0 1.2rem; }
.telemetry div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .55rem; border-bottom: 1px dashed rgba(94, 231, 255, .12); }
.telemetry dt { color: var(--text-dim); font-size: .92rem; }
.telemetry dd { margin: 0; text-align: right; font-weight: 600; }
.telemetry .ok { color: var(--green); }
.telemetry .warn { color: var(--gold); }

.gauge { position: relative; width: 150px; margin: auto auto 0; }
.gauge svg { width: 100%; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: rgba(94, 231, 255, .1); stroke-width: 8; }
.gauge-value { fill: none; stroke: var(--cyan); stroke-width: 8; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--cyan)); transition: stroke-dasharray 1.2s cubic-bezier(.2, .8, .2, 1); }
.gauge-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge-num { font-size: 1.6rem; font-weight: 700; color: #fff; text-shadow: var(--glow); }

/* Core (center) --------------------------------------------------------- */
.core-panel { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: .5rem; }
.core-reactor { position: relative; width: min(100%, 380px); }
.core-readout { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }
.core-time { font-size: 2.35rem; font-weight: 900; color: #fff; text-shadow: 0 0 18px var(--cyan), 0 0 40px rgba(34, 211, 238, .6); line-height: 1; }
.core-sec { color: var(--gold); font-size: .95rem; margin-top: .2rem; text-shadow: 0 0 8px rgba(255, 181, 71, .7); }
.core-date { position: absolute; bottom: -1.2rem; left: 0; right: 0; font-size: .72rem; color: var(--text-dim); letter-spacing: .25em; }
.greeting { margin-top: 1.9rem; font-size: clamp(1.4rem, 2.6vw, 2.1rem); font-weight: 700; text-shadow: 0 0 22px rgba(94, 231, 255, .45); min-height: 1.3em; }
.greeting [data-type]::after { content: "▍"; color: var(--cyan); animation: blink 1s step-end infinite; margin-left: .1em; }
.greeting-sub { margin-top: .3rem; }

.command {
    position: relative; display: flex; align-items: center; gap: .7rem; width: min(100%, 620px); margin-top: 1.6rem;
    padding: 0 .9rem; background: rgba(2, 10, 20, .75); border: 1px solid var(--line-strong);
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    box-shadow: inset 0 0 22px rgba(34, 211, 238, .08);
}
.command:focus-within { border-color: var(--cyan); box-shadow: inset 0 0 22px rgba(34, 211, 238, .16), var(--glow); }
.command-prompt { color: var(--gold); text-shadow: 0 0 8px rgba(255, 181, 71, .6); }
.command input { flex: 1; min-height: 54px; border: 0; outline: none; background: transparent; color: #fff; font-family: var(--mono); font-size: 1rem; letter-spacing: .05em; }
.command input::placeholder { color: rgba(127, 163, 179, .7); }
.command kbd { font-size: .7rem; color: var(--text-dim); border: 1px solid var(--line); padding: .15rem .4rem; border-radius: 2px; }
.command-results {
    position: fixed; z-index: 30; list-style: none; margin: 0; padding: .35rem; text-align: left;
    background: var(--panel-strong); border: 1px solid var(--line-strong); backdrop-filter: blur(14px); box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}
.command-results li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .8rem; cursor: pointer; border-left: 2px solid transparent; }
.command-results li.is-active { background: rgba(94, 231, 255, .1); border-left-color: var(--cyan); }
.command-results small { color: var(--text-dim); font-family: var(--mono); }
.command-feedback { min-height: 1.4em; margin-top: .7rem; color: var(--cyan); }

/* Live link status ------------------------------------------------------ */
.links-status { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .7rem; }
.links-status li { display: grid; grid-template-columns: 12px 1fr auto; grid-template-rows: auto 3px; column-gap: .6rem; row-gap: .3rem; align-items: center; }
.links-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.links-status li.is-online .dot { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2.4s ease-in-out infinite; }
.links-status li.is-offline .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.ls-name { font-weight: 600; }
.ls-ms { font-size: .78rem; color: var(--text-dim); }
.links-status li.is-online .ls-ms { color: var(--green); }
.links-status li.is-offline .ls-ms { color: var(--red); }
.ls-bar { grid-column: 2 / 4; height: 3px; background: rgba(94, 231, 255, .08); overflow: hidden; }
.ls-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-2), var(--cyan)); box-shadow: 0 0 6px var(--cyan); transition: width 1s ease; }
.links-status li.is-offline .ls-bar span { background: var(--red); }

/* Modules --------------------------------------------------------------- */
.modules { margin-top: 2.2rem; }
.section-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-head .panel-title { margin: 0; }
.section-head .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.link { color: var(--cyan); }
.link:hover { text-shadow: var(--glow); }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.module {
    position: relative; z-index: 1; display: grid; gap: .35rem; align-content: start; min-height: 178px; padding: 1.2rem 1.25rem 1rem;
    color: var(--text); background: linear-gradient(160deg, rgba(14, 40, 64, .5), rgba(4, 14, 26, .75));
    border: 1px solid var(--line); overflow: hidden; isolation: isolate;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .25s, box-shadow .25s;
}
.module::before {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(94, 231, 255, .22), transparent 55%);
}
.module::after {
    content: ""; position: absolute; left: -60%; top: 0; width: 40%; height: 100%; z-index: -1;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .08), transparent); transform: skewX(-20deg);
}
.module:hover, .module:focus-visible { transform: translateY(-4px); border-color: var(--cyan); box-shadow: var(--glow), 0 18px 40px rgba(0, 0, 0, .5); }
.module:hover::before, .module:focus-visible::before { opacity: 1; }
.module:hover::after { animation: sweep .9s ease; }
@keyframes sweep { to { left: 130%; } }
.module .corner { width: 10px; height: 10px; opacity: .6; }
.module:hover .corner { opacity: 1; }
.module-key { position: absolute; top: .8rem; right: .9rem; font-size: .7rem; color: var(--text-dim); border: 1px solid var(--line); padding: .05rem .35rem; }
.module-icon {
    display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: .45rem; color: var(--cyan);
    border: 1px solid var(--line-strong); background: rgba(94, 231, 255, .07); box-shadow: inset 0 0 14px rgba(94, 231, 255, .2);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.module-icon .ico { width: 26px; height: 26px; filter: drop-shadow(0 0 4px var(--cyan)); }
.module-title { font-weight: 700; font-size: .98rem; letter-spacing: .1em; }
.module-desc { color: var(--text-dim); font-size: .95rem; }
.module-url { font-size: .7rem; color: var(--cyan-dim); margin-top: auto; padding-top: .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-state { position: absolute; bottom: .9rem; right: .9rem; font-size: .66rem; color: var(--text-dim); }
.module-state.is-online { color: var(--green); }
.module-state.is-offline { color: var(--red); }
.module-add { border-style: dashed; place-content: center; justify-items: center; text-align: center; color: var(--text-dim); }
.module-add .module-icon { color: var(--gold); border-color: rgba(255, 181, 71, .4); background: rgba(255, 181, 71, .06); }
.module-add .module-icon .ico { filter: drop-shadow(0 0 4px var(--gold)); }

.hud-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* Compact layout: hero on top, modules directly below (no scrolling) ---- */
.topbar { padding-bottom: .9rem; margin-bottom: 1.1rem; }
.hero {
    position: relative; z-index: 1; display: grid; grid-template-columns: 190px minmax(0, 1fr) 250px; gap: 2rem; align-items: center;
    padding: .2rem 0 1.4rem;
}
.hero-reactor { position: relative; width: 190px; }
.hero-reactor .core-time { font-size: 1.55rem; }
.hero-reactor .core-sec { font-size: .78rem; }
.hero-main { min-width: 0; }
.hero-date { font-size: .74rem; color: var(--gold); letter-spacing: .3em; margin-bottom: .2rem; }
.hero .greeting { margin: 0; text-align: left; font-size: clamp(1.4rem, 2.4vw, 2rem); }
.hero .command { width: 100%; max-width: 640px; margin-top: .9rem; }
.hero .command-feedback { margin-top: .4rem; min-height: 1.2em; }
.hero-stats { display: flex; align-items: center; gap: 1.2rem; justify-content: flex-end; }
.hero-stats .gauge { width: 112px; margin: 0; }
.hero-stats .gauge-num { font-size: 1.3rem; }
.hero-facts { margin: 0; display: grid; gap: .6rem; }
.hero-facts div { display: grid; gap: .1rem; }
.hero-facts dt { font-size: .64rem; color: var(--text-dim); letter-spacing: .25em; }
.hero-facts dd { margin: 0; font-weight: 600; font-size: 1.05rem; }
.hero-facts .ok { color: var(--green); }
.hero-facts .warn { color: var(--gold); }

.modules { margin-top: 0; }
.module-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.module { min-height: 132px; padding: 1rem 1.05rem .9rem; gap: .2rem; }
.module-icon { width: 42px; height: 42px; margin-bottom: .35rem; }
.module-icon .ico { width: 22px; height: 22px; }
.module-desc { font-size: .9rem; line-height: 1.3; }
.module-state { position: static; margin-top: auto; padding-top: .45rem; }

.hud-panels { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.4rem; margin-top: 2rem; align-items: start; }
.hud-panels > .panel + .panel { margin-top: 0; }
.hide-sm { white-space: nowrap; }

/* Reveal animation (set by JS) ----------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }

/* Boot sequence --------------------------------------------------------- */
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(circle, #04121f, #000 70%); transition: opacity .8s ease, visibility .8s; }
.boot.is-done { opacity: 0; visibility: hidden; }
.boot-inner { width: min(560px, 90vw); display: grid; justify-items: center; gap: 1.2rem; }
.boot-reactor { width: 170px; }
.boot-log { width: 100%; min-height: 11.5em; margin: 0; color: var(--cyan); font-size: .85rem; line-height: 1.6; white-space: pre-wrap; text-shadow: 0 0 6px rgba(94, 231, 255, .6); }
.boot-log .ok { color: var(--green); }
.boot-bar { width: 100%; height: 3px; background: rgba(94, 231, 255, .12); }
.boot-bar span { display: block; height: 100%; width: 0; background: var(--cyan); box-shadow: var(--glow); transition: width .25s ease; }
.boot-skip { background: none; border: 0; color: var(--text-dim); cursor: pointer; letter-spacing: .2em; }
.boot-skip:hover { color: var(--cyan); }
.is-booting .hud { visibility: hidden; }

/* Module editor --------------------------------------------------------- */
.module-editor { margin-top: 1.4rem; }
.me-rows { display: grid; gap: .9rem; }
.me-row { display: grid; grid-template-columns: 30px 1fr 1.6fr 1.4fr 150px auto; gap: .8rem; align-items: end; margin: 0; padding: .9rem; border: 1px solid var(--line); background: rgba(2, 10, 20, .45); }
.me-index { align-self: center; color: var(--gold); font-size: 1.1rem; text-align: center; }
.me-actions { display: flex; gap: .35rem; }
.me-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.4rem; }
.spacer { flex: 1; }
.panel > h1 { font-size: 1.6rem; margin-bottom: .3rem; }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 1180px) {
    .hud-main { grid-template-columns: 1fr 1fr; }
    .core-panel { grid-column: 1 / -1; order: -1; }
    .me-row { grid-template-columns: 30px 1fr 1fr; }
    .me-row .me-url { grid-column: 2 / -1; }
}
@media (max-width: 1100px) {
    .hero { grid-template-columns: 150px minmax(0, 1fr); }
    .hero-reactor { width: 150px; }
    .hero-stats { grid-column: 1 / -1; justify-content: flex-start; }
    .hud-panels { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .hero { grid-template-columns: 96px minmax(0, 1fr); gap: 1rem; padding-bottom: 1rem; }
    .hero-reactor { width: 96px; }
    .hero-reactor .core-sec { display: none; }
    .hero-reactor .core-time { font-size: 1rem; }
    .hero-stats { display: none; }
    .hide-sm { display: none; }
    body { font-size: 16px; }
    .hud { padding: 1rem 1rem 2rem; }
    .hud-main { grid-template-columns: 1fr; }
    .topbar { gap: .8rem; flex-wrap: wrap; }
    .topbar-status { display: none; }
    .topbar-right { margin-left: auto; }
    .topbar-clock { display: none; }
    .page-auth .auth-wrap { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem 1rem; }
    .auth-reactor { max-width: 200px; }
    .hud-row { grid-template-columns: 1fr; }
    .core-time { font-size: 1.9rem; }
    .command kbd { display: none; }
    .module-grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
    .module { min-height: 150px; padding: 1rem; }
    .module-desc, .module-url { display: none; }
    .me-row { grid-template-columns: 1fr; }
    .me-row .me-url { grid-column: auto; }
    .me-index { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* Long module titles (wide display font) must fit the tile */
.module .module-title { font-size: .86rem; letter-spacing: .05em; overflow-wrap: anywhere; hyphens: auto; }
