/* ==========================================================================
   A.T.L.A.S. — holographic HUD theme
   ========================================================================== */
:root {
  --bg: #01060b;
  --bg2: #031019;
  --cyan: #00e5ff;
  --cyan-2: #39f3ff;
  --cyan-dim: rgba(0, 229, 255, 0.55);
  --cyan-faint: rgba(0, 229, 255, 0.14);
  --cyan-ghost: rgba(0, 229, 255, 0.06);
  --amber: #ffb300;
  --red: #ff4d5e;
  --green: #3dffa8;
  --text: #cfefff;
  --muted: #6c97ab;
  --panel: rgba(2, 16, 26, 0.72);
  --panel-border: rgba(0, 229, 255, 0.35);
  --glow: 0 0 6px rgba(0, 229, 255, 0.8), 0 0 18px rgba(0, 229, 255, 0.35);
  --font-hud: "Orbitron", "Segoe UI", sans-serif;
  --font-ui: "Rajdhani", "Segoe UI", sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, Consolas, monospace;
  --top: 64px;
  --foot: 34px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: radial-gradient(ellipse at 60% 50%, #04202e 0%, var(--bg) 62%);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--cyan-2); text-decoration: none; }
::selection { background: rgba(0, 229, 255, 0.3); }

/* ---------------------------------------------------------------- ambience */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
.bg-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.65) 100%);
}
.scanline {
  position: fixed; left: 0; right: 0; height: 140px; top: -140px; pointer-events: none; z-index: 6;
  background: linear-gradient(to bottom, transparent, rgba(0, 229, 255, 0.05) 70%, rgba(0, 229, 255, 0.14) 100%);
  animation: scan 7s linear infinite;
}
@keyframes scan { to { transform: translateY(calc(100vh + 140px)); } }

/* ---------------------------------------------------------------- globe */
#globeWrap {
  position: fixed; inset: 0; z-index: 1;
  transition: transform 1.3s cubic-bezier(.7, 0, .2, 1);
}
body.focused #globeWrap { transform: translateX(16vw); }
#globe { position: absolute; inset: 0; }
#globe canvas { outline: none; }

.globe-rings {
  position: absolute; left: 50%; top: 50%; pointer-events: none;
  width: 0; height: 0; transition: opacity .8s;
}
body.focused .globe-rings { opacity: 0; }
.ring {
  position: absolute; border-radius: 50%; border: 1px solid var(--cyan-faint);
  left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.ring.r1 { width: 74vmin; height: 74vmin; border-color: rgba(0, 229, 255, .22); border-style: dashed; animation: spin 80s linear infinite; }
.ring.r2 { width: 82vmin; height: 82vmin; border-width: 2px; border-color: transparent; border-top-color: var(--cyan-dim); border-bottom-color: rgba(0, 229, 255, .25); animation: spin 22s linear infinite reverse; }
.ring.r3 { width: 88vmin; height: 88vmin; border-color: rgba(0, 229, 255, .08); }
.ring-ticks {
  position: absolute; width: 92vmin; height: 92vmin; left: 50%; top: 50%;
  transform: translate(-50%, -50%); animation: spin 140s linear infinite;
}
.ring-ticks circle { fill: none; stroke: rgba(0, 229, 255, .35); stroke-width: 1.2; stroke-dasharray: .4 2.2; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ---------------------------------------------------------------- link + lock */
#link { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; overflow: visible; }
#linkPath {
  fill: none; stroke: var(--cyan); stroke-width: 2.5;
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, .9));
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  transition: stroke-dashoffset 0.9s cubic-bezier(.6, 0, .2, 1), opacity .3s;
}
#link.on #linkPath { stroke-dashoffset: 0; opacity: 1; }
#link.hidden #linkPath, #link.hidden #linkStart { opacity: 0 !important; }
#linkStart { fill: var(--bg); stroke: var(--cyan); stroke-width: 2; opacity: 0; transition: opacity .3s; }
#link.on #linkStart { opacity: 1; }

#lock {
  position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none;
  width: 0; height: 0; opacity: 0; transition: opacity .25s;
}
#lock.on { opacity: 1; }
#lock.hidden { opacity: 0 !important; }
.lock-box {
  position: absolute; width: 76px; height: 76px; left: -38px; top: -38px;
  border: 2px solid var(--amber);
  clip-path: polygon(0 0, 30% 0, 30% 4%, 4% 4%, 4% 30%, 0 30%, 0 70%, 4% 70%, 4% 96%, 30% 96%, 30% 100%, 70% 100%, 70% 96%, 96% 96%, 96% 70%, 100% 70%, 100% 30%, 96% 30%, 96% 4%, 70% 4%, 70% 0);
  filter: drop-shadow(0 0 5px rgba(255, 179, 0, .9));
}
#lock.on .lock-box { animation: lockin 1s cubic-bezier(.2, .9, .2, 1) both, lockspin 6s 1s linear infinite; }
@keyframes lockin {
  0% { transform: scale(4) rotate(-90deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1) rotate(45deg); opacity: 1; }
}
@keyframes lockspin { from { transform: rotate(45deg); } to { transform: rotate(405deg); } }
.lock-diamond {
  position: absolute; width: 14px; height: 14px; left: -7px; top: -7px;
  border: 2px solid #fff; background: rgba(1, 10, 16, .85); transform: rotate(45deg);
  box-shadow: 0 0 0 2px rgba(1, 10, 16, .7), var(--glow);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 2px var(--cyan), 0 0 26px var(--cyan); } }
.lock-label {
  position: absolute; top: 46px; left: 0; transform: translateX(-50%);
  font-family: var(--font-hud); font-size: 10px; letter-spacing: 2px; white-space: nowrap;
  color: #fff; background: rgba(1, 10, 16, .82); border: 1px solid var(--amber); padding: 2px 7px;
}

/* ---------------------------------------------------------------- top bar */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top); z-index: 20;
  display: flex; align-items: center; gap: 22px; padding: 0 20px;
  background: linear-gradient(to bottom, rgba(1, 8, 14, .92), rgba(1, 8, 14, .55));
  border-bottom: 1px solid var(--cyan-faint);
}
#topbar::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 30%;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: sweep 5s ease-in-out infinite;
}
@keyframes sweep { 0% { left: -30%; } 100% { left: 100%; } }
.brand { display: flex; align-items: center; gap: 12px; min-width: 250px; }
.reactor { position: relative; width: 38px; height: 38px; }
.reactor i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; }
.reactor i:nth-child(1) { border-top-color: var(--cyan); border-bottom-color: var(--cyan); animation: rspin 2.6s linear infinite; }
.reactor i:nth-child(2) { inset: 6px; border-left-color: var(--cyan-2); border-right-color: var(--cyan-2); animation: rspin 1.8s linear infinite reverse; }
.reactor i:nth-child(3) { inset: 13px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan), 0 0 26px var(--cyan); animation: pulse 2s infinite; }
@keyframes rspin { to { transform: rotate(360deg); } }
.brand-name { font-family: var(--font-hud); font-weight: 900; font-size: 19px; letter-spacing: 5px; color: var(--cyan-2); text-shadow: var(--glow); }
.brand-sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 2.2px; color: var(--muted); }

.search { position: relative; flex: 0 1 320px; }
.search input {
  width: 100%; height: 36px; padding: 0 12px 0 34px;
  background: rgba(0, 229, 255, .05); border: 1px solid var(--panel-border); color: var(--text);
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 1px; outline: none;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.search input:focus { background: rgba(0, 229, 255, .1); border-color: var(--cyan); }
.search input::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 11px; top: 7px; color: var(--cyan); font-size: 17px; }
#searchResults {
  position: absolute; top: 40px; left: 0; right: 0; margin: 0; padding: 0; list-style: none;
  background: rgba(2, 14, 22, .96); border: 1px solid var(--panel-border); max-height: 50vh; overflow: auto; display: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}
#searchResults.open { display: block; }
#searchResults li { padding: 8px 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; border-bottom: 1px solid var(--cyan-ghost); }
#searchResults li:hover, #searchResults li.active { background: var(--cyan-faint); }
#searchResults .flag { font-size: 18px; }
#searchResults .sr-cap { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.layers { display: flex; gap: 2px; margin-left: auto; }
.layers button {
  padding: 7px 12px; font-family: var(--font-hud); font-size: 10px; letter-spacing: 1.6px; color: var(--muted);
  border: 1px solid var(--cyan-faint); background: rgba(0, 229, 255, .03); transition: all .2s;
}
.layers button:hover { color: var(--text); border-color: var(--cyan-dim); }
.layers button.on { color: var(--bg); background: var(--cyan); border-color: var(--cyan); box-shadow: var(--glow); }
.clock { text-align: right; min-width: 120px; }
#clock { font-family: var(--font-hud); font-size: 18px; letter-spacing: 3px; color: var(--cyan-2); }
.clock-sub { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 1.5px; }
#sysStatus { color: var(--amber); }
#sysStatus.ok { color: var(--green); }

/* ---------------------------------------------------------------- panels */
.panel {
  position: fixed; z-index: 15;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 40px rgba(0, 229, 255, .05), 0 0 30px rgba(0, 0, 0, .5);
}
.panel-head {
  font-family: var(--font-hud); font-size: 12px; letter-spacing: 3px; color: var(--cyan-2);
  padding: 12px 14px; border-bottom: 1px solid var(--cyan-faint); display: flex; align-items: center; gap: 8px;
}
.tag { font-size: 9px; padding: 2px 5px; background: var(--cyan); color: var(--bg); letter-spacing: 1px; }
.count { margin-left: auto; font-family: var(--font-mono); color: var(--muted); }

/* index */
#index {
  left: 16px; top: calc(var(--top) + 14px); bottom: calc(var(--foot) + 14px); width: 290px;
  display: flex; flex-direction: column;
  transition: transform .7s cubic-bezier(.7, 0, .2, 1), opacity .5s;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}
body.focused #index { transform: translateX(-120%); opacity: 0; pointer-events: none; }
.index-tabs { display: flex; border-bottom: 1px solid var(--cyan-faint); }
.index-tabs button { flex: 1; padding: 8px; font-family: var(--font-hud); font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.index-tabs button.on { color: var(--cyan-2); box-shadow: inset 0 -2px 0 var(--cyan); }
.index-sort { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); padding: 7px 14px; letter-spacing: 1px; }
.index-sort b { color: var(--cyan); font-weight: normal; }
#indexList { list-style: none; margin: 0; padding: 0 6px 10px; overflow-y: auto; flex: 1; }
#indexList li {
  display: grid; grid-template-columns: 30px 22px 1fr auto; align-items: center; gap: 6px;
  padding: 6px 8px; cursor: pointer; border-left: 2px solid transparent; position: relative;
}
#indexList li:hover { background: var(--cyan-ghost); border-left-color: var(--cyan); }
#indexList .rk { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
#indexList .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#indexList .vl { font-family: var(--font-mono); font-size: 12px; color: var(--cyan-2); }
#indexList .bar { position: absolute; left: 38px; right: 8px; bottom: 1px; height: 2px; background: var(--cyan-ghost); }
#indexList .bar i { display: block; height: 100%; background: linear-gradient(90deg, rgba(0, 229, 255, .2), var(--cyan)); }
#indexList .empty { display: block; color: var(--muted); padding: 20px 10px; font-family: var(--font-mono); font-size: 12px; cursor: default; }
.obs { font-family: var(--font-mono); font-size: 9px; color: var(--amber); border: 1px solid var(--amber); padding: 0 3px; margin-left: 4px; vertical-align: 1px; }

/* scrollbars */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, .25); }
::-webkit-scrollbar-track { background: transparent; }

/* dossier */
#dossier {
  left: 24px; top: calc(var(--top) + 18px); bottom: calc(var(--foot) + 18px); width: min(440px, 38vw);
  display: flex; flex-direction: column;
  transform: translateX(-115%); opacity: 0; pointer-events: none;
  transition: transform .8s cubic-bezier(.7, 0, .2, 1), opacity .4s;
}
body.focused #dossier { transform: none; opacity: 1; pointer-events: auto; transition-delay: .35s; }
.corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--cyan); filter: drop-shadow(0 0 4px var(--cyan)); }
.corner.tl { left: -3px; top: -3px; border-right: 0; border-bottom: 0; }
.corner.tr { right: -3px; top: -3px; border-left: 0; border-bottom: 0; }
.corner.bl { left: -3px; bottom: -3px; border-right: 0; border-top: 0; }
.corner.br { right: -3px; bottom: -3px; border-left: 0; border-top: 0; }

.dossier-head { display: flex; gap: 14px; align-items: center; padding: 16px 16px 12px; border-bottom: 1px solid var(--cyan-faint); }
.d-flag { font-size: 42px; line-height: 1; filter: drop-shadow(0 0 8px rgba(0, 229, 255, .5)); }
.d-title { flex: 1; min-width: 0; }
.d-sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 2px; color: var(--amber); }
#dName {
  margin: 2px 0 4px; font-family: var(--font-hud); font-weight: 700; font-size: 24px; letter-spacing: 2.5px;
  text-transform: uppercase; color: #fff; text-shadow: var(--glow); line-height: 1.15;
  overflow-wrap: anywhere;
}
.d-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.d-meta b { color: var(--text); font-weight: normal; }
.d-actions { display: flex; flex-direction: column; gap: 6px; align-self: flex-start; }
.d-actions button {
  width: 30px; height: 30px; border: 1px solid var(--cyan-faint); color: var(--cyan-2); font-size: 15px;
}
.d-actions button:hover { border-color: var(--cyan); background: var(--cyan-faint); }
#watchBtn.on { color: var(--amber); border-color: var(--amber); }

.boot {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--cyan-dim); padding: 0 16px;
  max-height: 0; overflow: hidden; transition: max-height .4s, padding .4s;
}
.boot.on { max-height: 140px; padding: 10px 16px; }
.boot div { white-space: nowrap; overflow: hidden; animation: type .5s steps(30) both; }
.boot .ok { color: var(--green); }
@keyframes type { from { width: 0; } to { width: 100%; } }

.d-tabs { display: flex; border-bottom: 1px solid var(--cyan-faint); padding: 0 8px; }
.d-tabs button {
  flex: 1; padding: 11px 4px 9px; font-family: var(--font-hud); font-size: 10.5px; letter-spacing: 2px; color: var(--muted);
  position: relative;
}
.d-tabs button:hover { color: var(--text); }
.d-tabs button.on { color: var(--cyan-2); text-shadow: var(--glow); }
.d-tabs button.on::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 2px; background: var(--cyan); box-shadow: var(--glow); }

.d-body { flex: 1; overflow-y: auto; padding: 14px 16px 18px; }
.d-body > * { animation: rise .5s both; }
.d-body > *:nth-child(2) { animation-delay: .06s; }
.d-body > *:nth-child(3) { animation-delay: .12s; }
.d-body > *:nth-child(4) { animation-delay: .18s; }
.d-body > *:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.sec-title {
  font-family: var(--font-hud); font-size: 10px; letter-spacing: 2.5px; color: var(--cyan-dim);
  margin: 16px 0 8px; display: flex; align-items: center; gap: 8px;
}
.sec-title:first-child { margin-top: 2px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--cyan-faint), transparent); }
.sec-title .yr { font-family: var(--font-mono); color: var(--muted); letter-spacing: 1px; }

.hero { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-val { font-family: var(--font-hud); font-size: 34px; font-weight: 700; color: #fff; text-shadow: var(--glow); letter-spacing: 1px; }
.hero-sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile {
  padding: 9px 11px 8px; background: rgba(0, 229, 255, .035); border: 1px solid var(--cyan-ghost); position: relative;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; width: 6px; height: 6px; border-left: 1px solid var(--cyan); border-top: 1px solid var(--cyan); }
.tile .k { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.tile .v { font-family: var(--font-hud); font-size: 17px; color: var(--text); margin-top: 3px; letter-spacing: .5px; }
.tile .y { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.tile.na .v { color: var(--muted); }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: rgba(0, 229, 255, .08); }
.chart .axis { font-family: var(--font-mono); font-size: 9px; fill: var(--muted); }
.chart .line { fill: none; stroke-width: 1.8; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s .2s cubic-bezier(.6, 0, .2, 1) forwards; }
.chart .area { opacity: 0; animation: fade 1s .9s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: grow .7s cubic-bezier(.3, 1.4, .5, 1) both; }
.chart .bar.neg { transform-origin: top; }
@keyframes grow { from { transform: scaleY(0); } }
.chart .cursor { stroke: var(--cyan); stroke-dasharray: 2 3; opacity: 0; }
.chart .readout {
  position: absolute; top: 0; pointer-events: none; opacity: 0; transform: translateX(-50%);
  background: rgba(1, 10, 16, .92); border: 1px solid var(--panel-border); padding: 4px 7px;
  font-family: var(--font-mono); font-size: 10.5px; white-space: nowrap; z-index: 2;
}
.chart:hover .cursor, .chart:hover .readout { opacity: 1; }
.legend-inline { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin: 4px 0 2px; }
.legend-inline i { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 5px; }

.balance { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flow { padding: 10px 12px; border: 1px solid var(--cyan-ghost); background: rgba(0, 229, 255, .035); }
.flow .k { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.flow .v { font-family: var(--font-hud); font-size: 20px; margin: 3px 0 6px; }
.flow .meter { height: 6px; background: rgba(255, 255, 255, .05); }
.flow .meter i { display: block; height: 100%; animation: meter 1.1s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes meter { from { width: 0 !important; } }
.flow.exp .v { color: var(--cyan-2); } .flow.exp .meter i { background: var(--cyan); box-shadow: var(--glow); }
.flow.imp .v { color: var(--amber); } .flow.imp .meter i { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.net { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--cyan-faint); display: flex; justify-content: space-between; align-items: center; }
.net .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px; color: var(--muted); }
.net .v { font-family: var(--font-hud); font-size: 18px; }
.net.surplus .v { color: var(--green); } .net.deficit .v { color: var(--red); }

.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 10px 0 10px 14px; border-bottom: 1px solid var(--cyan-ghost); position: relative; animation: rise .45s both; }
.news li::before { content: ""; position: absolute; left: 0; top: 16px; width: 5px; height: 5px; background: var(--cyan); box-shadow: var(--glow); transform: rotate(45deg); }
.news a { color: var(--text); font-weight: 600; font-size: 15px; line-height: 1.25; display: block; }
.news a:hover { color: var(--cyan-2); }
.news .src { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: 3px; letter-spacing: .5px; }
.news .src b { color: var(--cyan-dim); font-weight: normal; }
.news .new { color: var(--amber); }
.news-bar { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-bottom: 6px; gap: 8px; }
.btn {
  font-family: var(--font-hud); font-size: 9.5px; letter-spacing: 1.6px; padding: 5px 10px;
  border: 1px solid var(--cyan-faint); color: var(--cyan-2);
}
.btn:hover { border-color: var(--cyan); background: var(--cyan-faint); }
.loading { font-family: var(--font-mono); font-size: 12px; color: var(--cyan-dim); padding: 18px 0; }
.loading::after { content: "▌"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.err { font-family: var(--font-mono); font-size: 12px; color: var(--red); padding: 12px; border: 1px solid rgba(255, 77, 94, .35); }
.note { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 14px; line-height: 1.5; }

/* ---------------------------------------------------------------- right HUD */
#hud {
  position: fixed; right: 18px; top: calc(var(--top) + 18px); z-index: 12; width: 230px;
  display: flex; flex-direction: column; gap: 14px; pointer-events: none;
  transition: opacity .6s;
}
body.focused #hud { opacity: .5; }
.hud-block { border-right: 2px solid var(--cyan-dim); padding: 2px 10px 2px 0; text-align: right; }
.hud-label { font-family: var(--font-hud); font-size: 9px; letter-spacing: 2.2px; color: var(--muted); margin-bottom: 3px; }
.hud-val { font-family: var(--font-mono); font-size: 11.5px; color: var(--cyan-2); letter-spacing: .5px; }
.hud-val.small { font-size: 10px; line-height: 1.6; color: var(--muted); }
.hud-val b { color: #fff; font-weight: normal; }
.hud-big { font-family: var(--font-hud); font-size: 22px; color: #fff; text-shadow: var(--glow); }
.legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.legend i { display: block; width: 110px; height: 7px; border: 1px solid var(--cyan-faint); }

/* ---------------------------------------------------------------- ticker */
#ticker {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--foot); z-index: 20;
  display: flex; align-items: center; background: rgba(1, 8, 14, .9); border-top: 1px solid var(--cyan-faint);
}
.ticker-label {
  font-family: var(--font-hud); font-size: 10px; letter-spacing: 2px; color: var(--bg); background: var(--cyan);
  height: 100%; display: flex; align-items: center; padding: 0 14px 0 12px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.ticker-track { flex: 1; overflow: hidden; height: 100%; display: flex; align-items: center;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-inner { white-space: nowrap; font-family: var(--font-mono); font-size: 12.5px; color: var(--text); padding-left: 20px; }
.ticker-inner.run { animation: tick var(--dur, 240s) linear infinite; }
.ticker-track:hover .ticker-inner { animation-play-state: paused; }
.ticker-inner a { color: var(--text); }
.ticker-inner a:hover { color: var(--cyan-2); }
.ticker-inner .sep { color: var(--cyan); margin: 0 18px; }
.ticker-inner .ts { color: var(--muted); margin-right: 6px; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- tooltip / toast */
#tooltip {
  position: fixed; z-index: 30; pointer-events: none; display: none;
  background: rgba(1, 12, 20, .92); border: 1px solid var(--cyan); padding: 7px 10px; min-width: 150px;
  box-shadow: var(--glow); font-family: var(--font-mono); font-size: 11px;
}
#tooltip .tt-name { font-family: var(--font-hud); font-size: 12px; letter-spacing: 1.5px; color: #fff; margin-bottom: 3px; }
#tooltip .tt-row { color: var(--muted); }
#tooltip .tt-row b { color: var(--cyan-2); font-weight: normal; }
#toast {
  position: fixed; left: 50%; bottom: calc(var(--foot) + 20px); transform: translate(-50%, 20px); z-index: 40;
  font-family: var(--font-mono); font-size: 12px; padding: 8px 16px; background: rgba(1, 12, 20, .95);
  border: 1px solid var(--amber); color: var(--amber); opacity: 0; transition: all .3s; pointer-events: none;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .layers button { padding: 7px 8px; letter-spacing: 1px; }
  #hud { display: none; }
  .brand { min-width: 0; }
  .brand-sub { display: none; }
}
@media (max-width: 860px) {
  :root { --top: 104px; }
  #topbar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px; height: var(--top); align-content: center; }
  .search { flex: 1 1 160px; }
  .clock { display: none; }
  .layers { margin-left: 0; width: 100%; overflow-x: auto; }
  .layers button { flex: 1 0 auto; }
  #index { left: 16px; right: 16px; width: auto; top: auto; height: 34vh; }
  body.focused #globeWrap { transform: translateY(-22vh); }
  #dossier { left: 0; right: 0; width: auto; top: 46vh; bottom: var(--foot); }
  #link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- flags */
.d-flag img { display: block; width: 68px; height: auto; border: 1px solid var(--cyan-faint); box-shadow: 0 0 14px rgba(0, 229, 255, .35); }
#searchResults .flag img, #indexList .fl img { display: block; width: 20px; height: auto; opacity: .9; }
