/* ==========================================================================
   KYBERTURVAKESKUS — Pip-Boy phosphor terminal
   Palette lives in --pip-rgb; everything else derives from it.
   ========================================================================== */

:root {
  --pip-rgb: 26, 255, 140;
  --alert-rgb: 255, 86, 48;
  --pip: rgb(var(--pip-rgb));
  --alert: rgb(var(--alert-rgb));
  --bg: #030806;
  --bg-rgb: 3, 8, 6;
  --font: 'VT323', 'Courier New', monospace;
  /* tighter halo than before: VT323 reads crisper with less bloom */
  --glow: 0 0 1px rgba(var(--pip-rgb), .5), 0 0 6px rgba(var(--pip-rgb), .16);
  --line: 2px solid rgba(var(--pip-rgb), .9);
  --fs: 24px;
}
html[data-palette="amber"] { --pip-rgb: 255, 176, 0;   --bg: #0a0602; --bg-rgb: 10, 6, 2; --alert-rgb: 255, 52, 40; }
html[data-palette="blue"]  { --pip-rgb: 110, 205, 255; --bg: #02060a; --bg-rgb: 2, 6, 10; }
html[data-palette="white"] { --pip-rgb: 226, 232, 228; --bg: #050606; --bg-rgb: 5, 6, 6; }
html[data-palette="teal"]  { --pip-rgb: 20, 253, 206;  --bg: #02100c; --bg-rgb: 2, 16, 12; }
html[data-palette="red"]   { --pip-rgb: 255, 72, 48;   --bg: #0a0302; --bg-rgb: 10, 3, 2; --alert-rgb: 255, 220, 90; }

@font-face {
  font-family: 'VT323';
  src: url('../fonts/VT323-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background: #000;
  color: var(--pip);
  font: var(--fs)/1.32 var(--font);
  letter-spacing: .03em;
  text-shadow: var(--glow);
  overflow: hidden;
  -webkit-font-smoothing: none;
}
button, a { font: inherit; color: inherit; letter-spacing: inherit; text-shadow: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { text-decoration: none; }
b, strong { font-weight: 400; }
::selection { background: var(--pip); color: var(--bg); text-shadow: none; }
.dim { opacity: .7; }
.pad { padding: 10px; }

/* ---- CRT overlays ----------------------------------------------------- */

.crt-scan, .crt-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
}
.crt-scan {
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.crt-vignette {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(115deg, rgba(255, 255, 255, .035) 0%, transparent 28%, transparent 70%, rgba(255, 255, 255, .02) 100%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .75);
  animation: flicker 4s infinite;
}
@keyframes flicker {
  0%, 100% { opacity: .92; } 37% { opacity: .98; } 41% { opacity: .9; } 63% { opacity: .96; } 67% { opacity: .88; } 70% { opacity: .95; }
}

/* ---- boot ------------------------------------------------------------- */

.boot {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg);
  padding: 5vh 6vw;
  display: flex; flex-direction: column;
  font-size: clamp(16px, 2.4vmin, 26px);
  transform-origin: 50% 50%;
}
.boot-log { flex: 1; overflow: hidden; white-space: pre-wrap; }
.boot .bl { min-height: 1.25em; }
.boot .bl.hdr { opacity: .9; }
.boot .bl.err { color: var(--alert); }
.boot .bl.wait { opacity: .7; }
.boot .bl.typing::after, .hk-prompt::after, .boot-log:empty::after {
  /* CSS block cursor — VT323 has no block-element glyphs */
  content: ''; display: inline-block; width: .55em; height: .9em; background: currentColor;
  vertical-align: -.1em; margin-left: 2px; animation: blink 1s steps(1, end) infinite;
}
.boot-hint { opacity: .5; font-size: .8em; letter-spacing: .15em; }
.boot.off { animation: crt-off .48s cubic-bezier(.2, .9, .3, 1) forwards; }
@keyframes crt-off {
  0% { transform: scaleY(1); filter: brightness(1); }
  55% { transform: scaleY(.012); filter: brightness(3.5); opacity: 1; }
  100% { transform: scaleY(.002) scaleX(.2); filter: brightness(6); opacity: 0; }
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- frame ------------------------------------------------------------ */

.pipboy {
  position: fixed; inset: 0;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 10px 22px 8px;
  background: radial-gradient(ellipse at 50% 42%, rgba(var(--pip-rgb), .11) 0%, rgba(var(--pip-rgb), .035) 48%, transparent 78%), var(--bg);
  transform-origin: 50% 50%;
}
.pipboy.power-on { animation: crt-on .8s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes crt-on {
  0% { transform: scaleY(.004) scaleX(.6); filter: brightness(5); opacity: 0; }
  35% { transform: scaleY(.004) scaleX(1); filter: brightness(5); opacity: 1; }
  70% { transform: scaleY(1); filter: brightness(2.2); }
  100% { transform: none; filter: none; }
}
.pipboy.glitch { animation: glitch .22s steps(2, end) 1; }
@keyframes glitch {
  0% { clip-path: inset(12% 0 60% 0); transform: translateX(-6px); }
  25% { clip-path: inset(55% 0 20% 0); transform: translateX(5px); }
  50% { clip-path: inset(30% 0 45% 0); transform: translateX(-3px); filter: hue-rotate(20deg); }
  75% { clip-path: inset(70% 0 5% 0); transform: translateX(4px); }
  100% { clip-path: none; transform: none; }
}

/* ---- top bar ---------------------------------------------------------- */

.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px;
  border-bottom: var(--line); padding-bottom: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 24px; line-height: 1; }
.brand svg { width: 26px; height: 26px; flex: none; animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand small { font-size: 13px; letter-spacing: .18em; opacity: .55; display: block; margin-top: 3px; }
.tabs { display: flex; gap: clamp(8px, 2.2vw, 34px); align-items: end; }
.tabs button {
  font-size: clamp(20px, 2.4vw, 30px); letter-spacing: .1em; padding: 2px 10px 4px; position: relative;
  opacity: .62; transition: opacity .15s;
}
.tabs button:hover { opacity: .9; }
.tabs button[aria-selected="true"] { opacity: 1; }
.tabs button[aria-selected="true"]::before, .tabs button[aria-selected="true"]::after {
  position: absolute; top: 0; opacity: .85;
}
.tabs button[aria-selected="true"]::before { content: '['; left: -4px; }
.tabs button[aria-selected="true"]::after { content: ']'; right: -4px; }
.tabs button[aria-selected="true"] { border-bottom: 4px solid var(--pip); margin-bottom: -8px; padding-bottom: 8px; }
.clock { text-align: right; font-size: 22px; }
.clock span + span { margin-left: 12px; }

/* ---- screen ----------------------------------------------------------- */

.screen { overflow: auto; position: relative; padding: 14px 2px 10px; scrollbar-width: thin; scrollbar-color: rgba(var(--pip-rgb), .5) transparent; }
/* STAT fills the screen's full height (the screen is a definite-height grid cell) so
   the radar and the right-hand panels can distribute the space on big displays; the
   other tabs keep their natural height and scroll normally */
#tab-stat { height: 100%; display: flex; flex-direction: column; }
.screen.wipe > .tab { animation: tab-in .36s steps(14, end) both; }
.screen.wipe::after {
  content: ''; position: absolute; left: 0; right: 0; height: 6px; z-index: 5; pointer-events: none;
  background: rgba(var(--pip-rgb), .55); box-shadow: 0 0 18px rgba(var(--pip-rgb), .8);
  animation: wipe-bar .36s linear both;
}
@keyframes tab-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes wipe-bar { from { top: 0; } to { top: 100%; opacity: 0; } }

.subtabs { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 20px; letter-spacing: .12em; margin: -4px 0 12px; }
.subtabs button { opacity: .55; padding: 0 2px; }
.subtabs button:hover { opacity: .85; }
.subtabs button[aria-selected="true"] { opacity: 1; background: var(--pip); color: var(--bg); text-shadow: none; padding: 0 6px; }
.subtabs .sep { opacity: .35; }

.panel {
  border: var(--line);
  /* near-opaque dark backing so readouts sit on black — the page glow and the
     radar must not bleed through the panels (that was the "messy" low-contrast look) */
  background: rgba(var(--bg-rgb), .94);
  box-shadow: inset 0 0 22px rgba(var(--pip-rgb), .07), 0 0 0 1px rgba(0, 0, 0, .5);
}
.panel-h {
  background: var(--pip); color: var(--bg); text-shadow: none; padding: 3px 9px; font-size: 22px; letter-spacing: .16em;
  display: flex; justify-content: space-between; align-items: center;
}
.panel-h [data-mode="locked"], .panel-h [data-mode="hover"] { color: var(--bg); }
.panel-b { padding: 8px 10px; }
.lnk { opacity: .85; letter-spacing: .06em; }
.lnk:hover { opacity: 1; background: var(--pip); color: var(--bg); text-shadow: none; }

/* ---- STAT ------------------------------------------------------------- */

/* radar on the LEFT, panel stack on the RIGHT. The radar column scales with the
   viewport (clamped) instead of a fixed cap, so big displays get a big radar; the
   grid is full-height so the right-hand panels can stretch to fill the screen. */
.stat-grid { display: grid; grid-template-columns: minmax(300px, clamp(360px, 40vw, 820px)) minmax(340px, 1fr); grid-template-rows: minmax(0, 1fr); gap: 28px; align-items: stretch; flex: 1; min-height: 0; }
/* centre the radar + disclaimer vertically in whatever height the row has */
.radar-box { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
/* max-width scales with viewport height too so the square radar never overflows a
   short-but-wide screen; margin-inline:auto centres it when the column is wider */
.radar-wrap { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: min(820px, 74vh); margin-inline: auto; overflow: hidden; }
/* canvas is a replaced element: with inset:0 but no explicit size it renders at its
   intrinsic bitmap size (cssSize × devicePixelRatio), overflowing the wrap on HiDPI
   screens so only a corner shows. Pin it to the wrap so the full radar always fits. */
.radar-wrap canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.radar-hud { position: absolute; left: 6px; top: 6px; font-size: 17px; line-height: 1.15; letter-spacing: .08em; opacity: .85; pointer-events: none; }
.radar-hud b { font-size: 21px; }
/* src line sits just above the legend, both anchored bottom-left, so they never
   collide horizontally the way right- vs left-anchored text did on a narrower radar */
.radar-src { position: absolute; left: 6px; bottom: 60px; font-size: 16px; letter-spacing: .08em; opacity: .65; pointer-events: none; text-align: left; }
.radar-key { position: absolute; left: 6px; bottom: 4px; font-size: 16px; opacity: .7; pointer-events: none; display: grid; gap: 1px; }
.radar-key i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pip); box-shadow: 0 0 6px var(--pip); margin-right: 6px; vertical-align: middle; }
.radar-key i.crit { width: 11px; height: 11px; outline: 1px solid var(--pip); outline-offset: 2px; }
.radar-key i.kev { background: var(--alert); box-shadow: 0 0 6px var(--alert); border-radius: 0; transform: rotate(45deg); }
.sim-watermark {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: clamp(22px, 5vw, 44px); letter-spacing: .3em; color: var(--alert); opacity: .55; transform: rotate(-18deg);
}
.disclaimer { font-size: 17px; letter-spacing: .1em; opacity: .72; margin-top: 10px; line-height: 1.3; }

/* readout + target keep their size; the lists row takes the remaining height so the
   right column fills the screen instead of leaving a gap below on tall displays */
.stat-side { display: grid; gap: 16px; grid-template-rows: auto auto minmax(160px, 1fr); min-height: 0; }
.readout .r { display: flex; align-items: baseline; gap: 8px; line-height: 1.18; }
.readout .r .k { letter-spacing: .1em; font-size: 20px; white-space: nowrap; }
.readout .r .dots { flex: 1; border-bottom: 2px dotted rgba(var(--pip-rgb), .4); transform: translateY(-5px); }
.readout .r .v { font-size: 32px; white-space: nowrap; }
.readout .r .v.alert { color: var(--alert); }
.readout .r .v small { font-size: 17px; opacity: .6; margin-left: 4px; }
.readout.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 24px; }

.target { min-height: 190px; }
.tg-id { display: flex; justify-content: space-between; align-items: baseline; font-size: 28px; line-height: 1; margin-bottom: 4px; }
.tg-sev { font-size: 17px; letter-spacing: .12em; padding: 0 6px; border: 1px solid currentColor; }
.sev-critical { color: var(--alert); }
.sev-high { color: var(--pip); }
.sev-medium { opacity: .8; }
.sev-low, .sev-none { opacity: .55; }
.sev-kev { color: var(--alert); }
.tg-row { display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 19px; letter-spacing: .06em; opacity: .9; }
.tg-kev { color: var(--alert); font-size: 19px; margin-top: 4px; }
.tg-desc { margin-top: 6px; min-height: 3.6em; font-size: 20px; line-height: 1.2; opacity: .92; }
.tg-foot { display: flex; gap: 16px; align-items: baseline; margin-top: 6px; font-size: 18px; flex-wrap: wrap; }
.tg-status { opacity: .5; letter-spacing: .1em; margin-left: auto; }

.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 0; }
/* each list panel fills the lists row; its body scrolls if the rows overflow */
.lists .panel { display: flex; flex-direction: column; min-height: 0; }
.lists .panel-b { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(var(--pip-rgb), .5) transparent; }
.li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; width: 100%; text-align: left; font-size: 20px; padding: 3px 5px; align-items: baseline; transition: background .06s steps(2, end); }
.li:active { transform: translateX(2px); }
.li:hover { background: var(--pip); color: var(--bg); text-shadow: none; }
.li:hover .tg-sev, .li:hover .dim { color: inherit; opacity: 1; }
.li .tg-sev { font-size: 16px; }
.li.kev { grid-template-columns: auto auto 1fr; }
.li .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- INTEL ------------------------------------------------------------ */

.intel-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; margin-bottom: 8px; }
.intel-count { font-size: 20px; letter-spacing: .1em; opacity: .85; }
.cols-h, .row {
  display: grid; grid-template-columns: 112px 190px 70px 92px 120px 1fr; gap: 10px; align-items: baseline;
  padding: 4px 7px; font-size: 21px;
}
.cols-h { font-size: 17px; letter-spacing: .14em; opacity: .68; border-bottom: 1px solid rgba(var(--pip-rgb), .4); }
.row { position: relative; border-bottom: 1px solid rgba(var(--pip-rgb), .12); cursor: pointer; animation: row-in .28s both; animation-delay: calc(var(--i) * 14ms); transition: background .05s steps(2, end); }
@keyframes row-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* ---- Fallout selection "tick": a reserved caret slides in, the open row keeps a
   lit edge, and hovering inverts the line like a Pip-Boy menu selection.
   Click gives a tactile press nudge. All visual — no audio (silent by design). --- */
.row .c-tag::before { content: '>'; display: inline-block; width: .8em; opacity: 0; }
.row.open { background: rgba(var(--pip-rgb), .14); box-shadow: inset 3px 0 0 var(--pip); }
.row.open .c-tag::before { opacity: .85; }
.row:hover { background: var(--pip); color: var(--bg); text-shadow: none; }
.row:hover .c-tag::before { opacity: 1; }
.row:hover .c-time, .row:hover .c-cwe, .row:hover .c-desc { opacity: 1; }
.row:hover.sev-critical .c-tag, .row:hover .c-more .kevline { color: inherit; }
.row:hover .c-epss { border-color: rgba(var(--bg-rgb), .55); }
.row:hover .c-epss i { background: var(--bg); box-shadow: none; }
.row:hover .c-epss b { opacity: 1; }
.row:hover.has-kev .c-id::before { background: var(--bg); box-shadow: none; }
.row:active { transform: translateX(2px); }
.row:focus-visible { outline: 1px solid var(--pip); outline-offset: -1px; }
.row .c-tag { letter-spacing: .06em; white-space: nowrap; }
.row.sev-critical .c-tag { color: var(--alert); }
.row.sev-none .c-tag, .row.sev-low .c-tag { opacity: .5; }
.row .c-id { white-space: nowrap; }
.row.has-kev .c-id::before {
  content: ''; display: inline-block; width: .45em; height: .45em; background: var(--alert);
  transform: rotate(45deg); margin-right: .5em; vertical-align: .1em; box-shadow: 0 0 6px var(--alert);
}
.row .c-time, .row .c-cwe { opacity: .72; white-space: nowrap; font-size: 19px; }
.row .c-epss { position: relative; height: 10px; border: 1px solid rgba(var(--pip-rgb), .4); align-self: center; }
.row .c-epss i { position: absolute; inset: 1px auto 1px 1px; background: var(--pip); box-shadow: 0 0 6px rgba(var(--pip-rgb), .6); }
.row .c-epss b { position: absolute; left: 100%; top: -5px; margin-left: 6px; font-size: 16px; opacity: .7; }
.row .c-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.row.open .c-desc { white-space: normal; opacity: 1; }
/* the detail block stays in the DOM once built, so its visibility is driven by
   .open — a second click removes .open and this collapses it again */
.row .c-more { display: none; }
.row.open .c-more { grid-column: 1 / -1; font-size: 18px; opacity: .85; padding: 4px 0 4px 2px; display: grid; gap: 2px; }
.row .c-more .kevline { color: var(--alert); }
.row .c-actions { display: flex; gap: 14px; margin-top: 4px; }
/* keep the expanded-row action buttons usable when the row is hover-inverted */
.row:hover .lnk { opacity: 1; }
.row:hover .lnk:hover { background: var(--bg); color: var(--pip); text-shadow: var(--glow); }
.intel-more { padding: 10px 6px; opacity: .6; letter-spacing: .1em; }

/* ---- ARCHIVE ---------------------------------------------------------- */

.archive-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 20px; align-items: start; }
.archive-grid > * { min-width: 0; }
.chart-wrap { position: relative; }
.chart-wrap canvas { display: block; width: 100%; }
.archive-progress { font-size: 18px; letter-spacing: .08em; color: var(--alert); margin-bottom: 6px; }
.archive-note { font-size: 17px; opacity: .6; margin-top: 8px; line-height: 1.2; }

/* ---- RADIO ------------------------------------------------------------ */

.radio-grid { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.radio-grid > * { min-width: 0; }
.station { display: grid; grid-template-columns: 58px 1fr; gap: 10px; width: 100%; text-align: left; padding: 3px 8px; font-size: 20px; letter-spacing: .06em; opacity: .7; }
.station:hover { opacity: 1; }
.station[aria-selected="true"] { opacity: 1; background: var(--pip); color: var(--bg); text-shadow: none; }
.station .freq { opacity: .8; }
.radio-freq { font-size: 44px; line-height: 1; letter-spacing: .06em; padding: 4px 8px 8px; }
.speaker-status {
  display: flex; align-items: center; gap: 8px; margin: 10px 8px 2px; padding: 5px 8px;
  border: 1px solid var(--alert); color: var(--alert); font-size: 17px; letter-spacing: .08em;
  background: rgba(var(--alert-rgb), .08);
}
.speaker-status .led {
  width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--alert);
  box-shadow: 0 0 8px var(--alert); animation: blink 1.4s steps(1, end) infinite;
}
.scope-wrap { border: var(--line); position: relative; }
.scope-wrap canvas { display: block; width: 100%; }
.scope-badge {
  position: absolute; right: 8px; bottom: 8px; font-size: 15px; letter-spacing: .1em;
  color: var(--alert); border: 1px solid var(--alert); padding: 1px 6px; background: rgba(0, 0, 0, .5);
  pointer-events: none;
}
.radio-now { min-height: 2.6em; font-size: 20px; margin-top: 10px; line-height: 1.2; }
.ticker { overflow: hidden; white-space: nowrap; border-top: var(--line); border-bottom: var(--line); margin-top: 12px; padding: 3px 0; font-size: 21px; }
.ticker-track { display: inline-block; padding-left: 100%; animation: ticker var(--dur, 40s) linear infinite; will-change: transform; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---- status bar ------------------------------------------------------- */

.statusbar {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 24px; align-items: center;
  border-top: var(--line); padding-top: 6px; font-size: 19px; letter-spacing: .08em;
}
.meters { display: flex; gap: 22px; }
.meter { display: grid; grid-template-columns: auto 110px auto; gap: 8px; align-items: center; }
.bar { height: 11px; border: 2px solid var(--pip); position: relative; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, rgba(var(--pip-rgb), .9), rgba(var(--pip-rgb), .35)); box-shadow: 0 0 10px rgba(var(--pip-rgb), .5); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
#val-threat[data-level="SEVERE"], #val-threat[data-level="HIGH"] { color: var(--alert); }
.link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#link-state[data-state="live"]::before, #link-state[data-state="uplink"]::before {
  content: ''; display: inline-block; width: .45em; height: .45em; border-radius: 50%; background: currentColor;
  margin-right: .4em; vertical-align: .05em; box-shadow: 0 0 6px currentColor;
}
#link-state[data-state="uplink"] { animation: blink 1s steps(1, end) infinite; }
#link-state[data-state="down"], #link-state[data-state="sim"], #link-state[data-state="degraded"] { color: var(--alert); }
#link-detail { opacity: .6; margin-left: 8px; }
.palette { display: flex; gap: 6px; }
.pal { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; opacity: .55; padding: 0 3px; }
.pal:hover { opacity: .9; }
.pal[aria-pressed="true"] { opacity: 1; outline: 1px solid var(--pip); }
.pal i { width: 10px; height: 10px; display: inline-block; }
.pal-green i { background: rgb(26, 255, 140); } .pal-amber i { background: rgb(255, 176, 0); } .pal-blue i { background: rgb(110, 205, 255); }
.pal-white i { background: rgb(226, 232, 228); } .pal-teal i { background: rgb(20, 253, 206); } .pal-red i { background: rgb(255, 72, 48); }
.sysbtns { display: flex; gap: 16px; align-items: center; }
.term-btn { letter-spacing: .12em; opacity: .7; }
.term-btn:hover, .term-btn[aria-pressed="true"] { opacity: 1; background: var(--pip); color: var(--bg); text-shadow: none; }

/* ---- hack terminal ---------------------------------------------------- */

.hack {
  position: fixed; inset: 0; z-index: 45; background: var(--bg); padding: 3vh 4vw; overflow: auto;
  font-size: clamp(15px, 2.1vmin, 22px); line-height: 1.25; display: flex; flex-direction: column; gap: 1em;
}
.hack.glitch { animation: glitch .22s steps(2, end) 1; }
.hk-head { display: grid; gap: .1em; }
.hk-attempts { margin-top: .6em; letter-spacing: .1em; }
.hk-attempts .blk { display: inline-block; width: .55em; height: .8em; background: currentColor; margin-right: .35em; vertical-align: -.05em; box-shadow: 0 0 6px rgba(var(--pip-rgb), .6); }
.hk-attempts.danger { color: var(--alert); }
.hk-grid { display: grid; grid-template-columns: auto auto 1fr; gap: 0 2.5em; align-items: start; }
.hk-row { display: flex; gap: 1em; white-space: pre; }
.hk-addr { opacity: .6; }
.hk-c { display: inline-block; width: 1ch; cursor: pointer; }
.hk-c.hl { background: var(--pip); color: var(--bg); text-shadow: none; }
.hk-c.used { opacity: .35; cursor: default; }
.hk-side { display: flex; flex-direction: column; justify-content: flex-end; min-height: calc(16 * 1.25em); border-left: 1px solid rgba(var(--pip-rgb), .3); padding-left: 1em; }
.hk-log { opacity: .9; white-space: pre; }
.hk-prompt { white-space: pre; }
.hk-foot { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; font-size: .8em; opacity: .8; letter-spacing: .08em; }
.hk-locked, .hk-win { display: grid; gap: .4em; align-content: start; min-height: 60vh; }
.hk-locked { place-content: center; text-align: center; }
.hk-locked .big, .hk-win .big { font-size: 2.4em; letter-spacing: .2em; }
.hk-locked .big { color: var(--alert); }
.hk-win .ln { white-space: pre; }
.hk-win .hk-foot { justify-content: flex-start; margin-top: 1em; }

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

@media (max-width: 1100px) {
  .cols-h, .row { grid-template-columns: 104px 180px 66px 84px 100px 1fr; }
  .lists { grid-template-columns: 1fr; }
}
/* right column is getting narrow — stack the stat readout so labels/values never collide */
@media (max-width: 1000px) {
  .readout.two { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --fs: 18px; }
  .pipboy { padding: 8px 12px 6px; }
  .topbar { grid-template-columns: 1fr; gap: 6px; }
  .tabs { justify-content: space-between; gap: 4px; }
  .brand small { display: none; }
  .clock { display: none; }
  .subtabs .hint, .subtabs .sep { display: none; }
  .archive-grid, .radio-grid { grid-template-columns: 1fr; }
  /* INTEL table → compact single-description rows (avoids horizontal scroll) */
  .cols-h { display: none; }
  .row { grid-template-columns: 90px 1fr 62px; }
  .row .c-cwe, .row .c-epss { display: none; }
  .row .c-desc { grid-column: 1 / -1; }
  .statusbar { grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 16px; }
  .meter { grid-template-columns: auto 80px auto; }
  .link { grid-column: 1 / -1; }
  .palette { grid-column: 1 / -1; }
  .sysbtns { justify-self: end; }
  .hk-grid { grid-template-columns: 1fr; gap: 1em; }
  .hk-side { border-left: 0; padding-left: 0; min-height: 0; }
}
/* only now give up the side-by-side radar/panels — radar stays capped + centred */
@media (max-width: 780px) {
  /* stacked layout flows naturally and the page scrolls — drop the fill-height grid */
  #tab-stat { display: block; height: auto; }
  .stat-grid { grid-template-columns: 1fr; grid-template-rows: none; flex: none; min-height: 0; height: auto; }
  .stat-side { grid-template-rows: none; }
  .lists .panel-b { overflow: visible; }
  .radar-wrap { max-width: 440px; }
  .radar-key { display: none; }
  .radar-src { left: 0; right: 0; bottom: -1.3em; text-align: center; font-size: 13px; }
  .radar-hud { font-size: 14px; }
  .disclaimer { margin-top: 20px; }
}
@media (max-width: 560px) {
  .tabs button { font-size: 19px; padding: 2px 4px; letter-spacing: .06em; }
  .brand { font-size: 20px; }
  .readout .r .v { font-size: 26px; }
  .pal span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .crt-vignette, .brand svg, .ticker-track, .row { animation: none !important; }
  .pipboy.power-on, .pipboy.glitch, .boot.off, .screen.wipe > .tab, .screen.wipe::after { animation: none !important; }
  .bar > i { transition: none; }
}
