/* =========================================================
   IRON//HORIZON — Endfield-inspired defense archive
   Palette & geometry reference: zmd-charge-plus
   ========================================================= */

:root {
  --bg: #0f1010;
  --bg-deep: #0b0c0c;
  --panel: #161817;
  --panel-2: #1b1d1b;
  --panel-3: #222421;
  --line: #2d302c;
  --line-soft: #232622;
  --line-bright: #494d45;
  --text: #f0f1e9;
  --muted: #9a9e92;
  --dim: #666b60;
  --accent: #f2ff00;
  --accent-soft: rgba(242, 255, 0, .12);
  --green: #01ffa2;
  --pink: #ff1aac;
  --danger: #ff5b45;
  --sans: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --rail: 248px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --edge: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 30px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: #10110b; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
h1, h2, h3, h4, p { margin: 0; }
code, kbd { font-family: var(--mono); }

.skip-link {
  position: fixed;
  top: -80px; left: 16px;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--accent);
  color: #111;
  font: 700 12px var(--mono);
}
.skip-link:focus { top: 12px; }

/* ============ LEFT RAIL ============ */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--rail);
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  background: #171817;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  min-width: 0;
  padding: 0 4px;
}
.brand img { width: 38px; height: 38px; flex: 0 0 38px; filter: drop-shadow(0 0 12px rgba(242,255,0,.12)); }
.brand-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-copy strong {
  font: 800 13px/1.4 var(--mono);
  letter-spacing: .4px;
  white-space: nowrap;
}
.brand-copy strong span { color: var(--accent); }
.brand-copy small {
  font: 9px/1.4 var(--mono);
  letter-spacing: .35px;
  color: var(--muted);
  white-space: nowrap;
}

.rail-signal { display: flex; gap: 4px; margin: 26px 8px 14px; }
.rail-signal i { width: 20px; height: 2px; background: var(--accent); }
.rail-signal i:nth-child(2) { background: var(--green); }
.rail-signal i:nth-child(3) { background: var(--pink); }

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  flex: 1;
}
.rail-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 3px;
  color: var(--text);
  font-size: 13.5px;
  transition: background .18s, color .18s;
}
.rail-nav a svg {
  width: 18px; height: 18px; flex: 0 0 18px;
  fill: none; stroke: currentColor; stroke-width: 1.45;
  stroke-linecap: round; stroke-linejoin: round;
}
.rail-nav a span { flex: 1; }
.rail-nav a b {
  font: 400 9px var(--mono);
  color: var(--dim);
  letter-spacing: .8px;
}
.rail-nav a:hover { background: #ffffff09; color: var(--accent); }
.rail-nav a:hover b { color: var(--accent); }
.rail-nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.rail-nav a.is-active b { color: var(--accent); }

.rail-footer { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.rail-readout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px 10px;
  font: 9px/1.7 var(--mono);
  letter-spacing: .7px;
  color: var(--dim);
  padding: 0 5px 14px;
}
.rail-readout b { color: var(--muted); font-weight: 400; }
.rail-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-bright);
  background: #202220;
  border-radius: 3px;
  font: 11px var(--mono);
  color: var(--text);
  transition: .18s;
}
.rail-button span:last-child { color: var(--accent); font-size: 15px; }
.rail-button:hover { border-color: var(--accent); background: #2b2d17; color: var(--accent); }
.rail-note {
  margin: 14px 5px 0;
  color: #4f534b;
  font: 8px/1.6 var(--mono);
  letter-spacing: .8px;
}

/* ============ MAIN / STATUS ============ */

main {
  margin-left: var(--rail);
  width: calc(100% - var(--rail));
  min-height: 100vh;
  overflow: hidden;
}

.status-band {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: #111212;
  font: 9px/1 var(--mono);
  letter-spacing: .9px;
  color: var(--dim);
  text-transform: uppercase;
}
.status-live { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.status-live i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(1,255,162,.6);
  animation: livePulse 2.4s infinite;
}
.status-coord { margin-left: auto; }
.status-signal { display: flex; gap: 4px; }
.status-signal i { width: 3px; height: 12px; background: var(--accent); }
.status-signal i:nth-child(2) { background: var(--green); height: 8px; align-self: center; }
.status-signal i:nth-child(3) { background: var(--pink); height: 5px; align-self: center; }
.status-edition { color: var(--muted); }

/* ============ HERO ============ */

.hero {
  position: relative;
  padding: 24px clamp(24px, 4vw, 64px) 0;
  min-height: 940px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 74% 58%, rgba(100,105,65,.10), transparent 68%),
    linear-gradient(180deg, #141515 0%, #0f1010 72%);
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, transparent calc(25% - 1px), rgba(255,255,255,.035) 25%, transparent calc(25% + 1px)),
    linear-gradient(90deg, transparent calc(75% - 1px), rgba(255,255,255,.035) 75%, transparent calc(75% + 1px)),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 88px;
  mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 96%);
}
.hero-grid-bg::after {
  content: "+";
  position: absolute;
  top: 34%; left: 25%;
  color: rgba(242,255,0,.35);
  font: 16px var(--mono);
  transform: translate(-50%,-50%);
}
.hero-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font: 9px/1.4 var(--mono);
  letter-spacing: 1.4px;
  color: var(--dim);
  text-transform: uppercase;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.eyebrow { color: var(--muted); }
.eyebrow::before { content: "+"; color: var(--accent); margin-right: 12px; }
.version { text-align: right; }

.hero-heading {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr);
  align-items: end;
  gap: clamp(28px, 5vw, 80px);
  margin-top: clamp(30px, 4.5vh, 56px);
}
h1 {
  position: relative;
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(76px, 9.6vw, 158px);
  line-height: .81;
  letter-spacing: -.072em;
  margin-left: -.05em;
  color: var(--text);
}
h1 .h1-small {
  display: block;
  font: 9px/1 var(--mono);
  letter-spacing: 5px;
  color: var(--accent);
  margin: 0 0 16px .55em;
  font-weight: 400;
}
h1 .h1-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px #686d60;
  letter-spacing: -.055em;
}
h1 sup {
  position: absolute;
  right: -.08em;
  bottom: .04em;
  font: 400 .16em/1 var(--mono);
  color: var(--accent);
  letter-spacing: 0;
}
.hero-intro {
  padding-left: 24px;
  border-left: 1px solid var(--line);
  align-self: end;
  padding-bottom: 8px;
}
.hero-cn {
  font-size: clamp(25px, 2.2vw, 34px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .02em;
  margin-bottom: 16px;
}
.hero-cn span { color: var(--accent); }
.hero-desc { color: var(--muted); font-size: 13px; line-height: 1.85; max-width: 430px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 44px;
  padding: 11px 17px;
  font: 600 12px var(--sans);
  letter-spacing: .02em;
  border-radius: 2px;
  transition: background .2s, color .2s, transform .2s, border-color .2s;
}
.btn span { font: 400 18px/1 var(--mono); }
.btn-primary {
  background: var(--accent);
  color: #111208;
  clip-path: var(--edge);
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: #fbff65; transform: translateY(-2px); }
.btn-ghost {
  border: 1px solid var(--line-bright);
  color: var(--text);
  background: #1a1c1a;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.hero-stage {
  position: relative;
  z-index: 2;
  margin-top: clamp(34px, 4.4vh, 58px);
}
.stage-head, .stage-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font: 9px/1.4 var(--mono);
  letter-spacing: .9px;
  color: var(--dim);
  text-transform: uppercase;
}
.stage-head { margin-bottom: 10px; }
.stage-head span:first-child { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.stage-head i { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }
.stage-head span:last-child { color: var(--accent); }

.hud-frame {
  position: relative;
  background: #0c0e0d;
  border: 1px solid #393d37;
  padding: 10px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
  box-shadow: 0 28px 70px rgba(0,0,0,.5);
}
.hud-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 49.9%, rgba(255,255,255,.035) 50%, transparent 50.1%);
  z-index: 3;
}
.corner { position: absolute; width: 18px; height: 18px; z-index: 5; pointer-events: none; }
.c-tl { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.c-tr { top: -1px; right: -1px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.c-bl { bottom: -1px; left: -1px; border-bottom: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.c-br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

.hud-topline, .hud-btmline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font: 8.5px/1.4 var(--mono);
  letter-spacing: 1px;
  color: #7d8276;
  text-transform: uppercase;
}
.hud-topline { padding: 2px 4px 9px; }
.hud-rec { display: flex; align-items: center; gap: 6px; color: #b5b9aa; }
.hud-rec i { width: 5px; height: 5px; border-radius: 50%; background: var(--danger); animation: blink 1.6s infinite; }
.hud-btmline { padding: 9px 4px 2px; }
.hud-status { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.hud-status i { width: 5px; height: 5px; background: var(--accent); }

.hud-image-wrap {
  position: relative;
  aspect-ratio: 2.5 / 1;
  min-height: 260px;
  max-height: 480px;
  overflow: hidden;
  background: #0a0b0a;
}
.hud-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 56%;
  filter: saturate(.72) contrast(1.08) brightness(.82);
  transform: scale(1.02);
  transition: opacity .6s ease, transform 6s ease;
}
.hud-image-wrap.is-switching img { opacity: .15; transform: scale(1.07); }
.hud-scan {
  position: absolute;
  inset: -20% 0 auto;
  height: 22%;
  z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(242,255,0,.06), transparent);
  border-bottom: 1px solid rgba(242,255,0,.25);
  animation: scan 7s linear infinite;
  pointer-events: none;
}
.hud-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6,7,6,.9) 0%, transparent 27%, transparent 72%, rgba(6,7,6,.72) 100%),
    linear-gradient(0deg, rgba(6,7,6,.86) 0%, transparent 38%, transparent 78%, rgba(6,7,6,.35) 100%);
  pointer-events: none;
}
.reticle {
  position: absolute;
  top: 44%; left: 64%;
  width: 80px; height: 80px;
  transform: translate(-50%,-50%);
  z-index: 3;
  opacity: .7;
  pointer-events: none;
}
.ret-x { position: absolute; top: 50%; left: -18px; right: -18px; height: 1px; background: rgba(242,255,0,.55); }
.ret-y { position: absolute; left: 50%; top: -18px; bottom: -18px; width: 1px; background: rgba(242,255,0,.55); }
.ret-ring { position: absolute; inset: 18px; border: 1px solid rgba(242,255,0,.7); border-radius: 50%; }
.ret-ring::before, .ret-ring::after {
  content: ""; position: absolute; width: 5px; height: 5px; background: var(--accent);
}
.ret-ring::before { top: -3px; left: 50%; transform: translateX(-50%); }
.ret-ring::after { bottom: -3px; left: 50%; transform: translateX(-50%); }

.hud-readout {
  position: absolute;
  z-index: 4;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hud-readout-left { left: 26px; }
.hud-readout-right { right: 26px; text-align: right; }
.hud-label { font: 8px/1.3 var(--mono); letter-spacing: 1.4px; color: #9da38f; text-transform: uppercase; }
.hud-readout strong { font-size: clamp(22px, 2.4vw, 36px); line-height: 1.15; letter-spacing: -.02em; }
.hud-readout strong + span { font: 10px/1.5 var(--mono); color: #b6bbad; letter-spacing: .4px; }
.hud-readout-right b { font: 500 15px/1.4 var(--mono); color: var(--accent); margin-bottom: 4px; }

.hud-tabs { display: flex; gap: 3px; }
.hud-tabs button {
  width: 24px; height: 19px;
  font: 9px/1 var(--mono);
  color: #8c9184;
  border: 1px solid #3e423a;
  background: #151714;
}
.hud-tabs button.is-active { background: var(--accent); color: #111; border-color: var(--accent); }
.stage-foot { margin-top: 9px; color: #4f534a; font-size: 8px; }
.stage-foot b { color: var(--accent); font-weight: 400; }

.hero-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 26px;
  margin-top: clamp(34px, 5vh, 58px);
  padding: 24px 0 26px;
  border-top: 1px solid var(--line);
}
.hero-stats > div { display: flex; align-items: flex-end; gap: 12px; }
.hero-stats strong {
  font: 400 clamp(34px, 3.5vw, 52px)/.85 var(--sans);
  letter-spacing: -.06em;
}
.hero-stats strong span { font-size: .4em; color: var(--accent); vertical-align: top; letter-spacing: 0; }
.hero-stats > div > span { color: var(--dim); font: 9px/1.45 var(--mono); letter-spacing: .3px; padding-bottom: 2px; }
.hero-scroll {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
  font: 10px var(--mono);
  color: var(--muted);
  letter-spacing: .8px;
  padding-bottom: 3px;
}
.hero-scroll span { color: var(--accent); animation: nudge 2s infinite; }
.hero-scroll:hover { color: var(--accent); }

/* ============ TICKER ============ */

.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: #151615;
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 22px;
  width: max-content;
  padding: 10px 0;
  animation: ticker 55s linear infinite;
}
.ticker-track span {
  font: 9px/1 var(--mono);
  letter-spacing: 1.3px;
  color: #777c6f;
  white-space: nowrap;
}
.ticker-track i { color: var(--accent); font-style: normal; font-size: 11px; }
.ticker:hover .ticker-track { animation-play-state: paused; }

/* ============ SECTIONS ============ */

.archive, .protocol { padding: clamp(70px, 8vw, 112px) clamp(24px, 4vw, 64px); }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .66fr);
  align-items: end;
  gap: clamp(24px, 5vw, 80px);
  margin-bottom: clamp(34px, 4vw, 54px);
}
.section-tag {
  font: 9px/1.4 var(--mono);
  letter-spacing: 1.6px;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.section-head h2, .compare-head h2, .sources-body h2 {
  font-size: clamp(42px, 5.3vw, 78px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 650;
}
.section-head h2 span, .compare-head h2 span, .sources-shell h2 span { color: #6f7468; }
.section-head > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
  max-width: 430px;
  padding-bottom: 6px;
}

/* ============ TOOLBAR ============ */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.filter-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--muted);
  font: 11px var(--mono);
  letter-spacing: .3px;
  transition: .16s;
}
.filter-tabs button span { color: #555a50; font-size: 8px; }
.filter-tabs button:hover { color: var(--text); background: #ffffff07; }
.filter-tabs button.is-active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
  font-weight: 700;
}
.filter-tabs button.is-active span { color: #5c6100; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 35px;
  padding: 0 10px;
  border: 1px solid var(--line-bright);
  background: #141514;
  border-radius: 2px;
  min-width: 238px;
  transition: border-color .18s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { width: 14px; height: 14px; fill: none; stroke: var(--dim); stroke-width: 1.5; flex: 0 0 14px; }
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 11px var(--sans);
  min-width: 0;
}
.search-box input::placeholder { color: #62665b; }
.search-box kbd {
  font-size: 9px;
  color: #656a5e;
  border: 1px solid #3a3e36;
  padding: 1px 4px;
  border-radius: 2px;
}
.compare-mode {
  height: 35px;
  padding: 0 12px;
  border: 1px solid var(--line-bright);
  background: #1b1d1b;
  font: 11px var(--mono);
  color: var(--muted);
  white-space: nowrap;
  border-radius: 2px;
  transition: .18s;
}
.compare-mode:hover { border-color: var(--accent); color: var(--accent); }
.compare-mode[aria-pressed="true"] { background: var(--accent); color: #111; border-color: var(--accent); }
.cmp-glyph { margin-right: 5px; font-size: 14px; }

.archive-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0 22px;
  font: 8.5px/1.4 var(--mono);
  letter-spacing: .9px;
  color: #64695e;
  text-transform: uppercase;
}
.archive-meta #resultCount { color: var(--accent); }
.archive-meta .meta-hint { margin-left: auto; color: #4f544a; }

/* ============ CARD GRID ============ */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.archive-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--edge);
  transition: border-color .22s, background .22s, transform .3s var(--ease);
  animation: cardIn .55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.archive-card:hover { border-color: #777d6b; background: #191b19; transform: translateY(-4px); }
.archive-card.is-selected { border-color: var(--accent); background: #1b1d14; box-shadow: inset 0 0 0 1px rgba(242,255,0,.35); }

.card-media {
  position: relative;
  aspect-ratio: 1.42 / 1;
  overflow: hidden;
  background: #0b0c0b;
  cursor: pointer;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.78) contrast(1.07) brightness(.88);
  transition: transform .85s var(--ease), filter .4s;
}
.archive-card:hover .card-media img { transform: scale(1.045); filter: saturate(.95) contrast(1.05) brightness(.95); }
.card-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9,10,9,.3) 0%, transparent 28%, transparent 62%, rgba(9,10,9,.8) 100%);
  pointer-events: none;
}
.card-top {
  position: absolute;
  top: 11px; left: 12px; right: 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.card-index {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 8.5px/1 var(--mono);
  letter-spacing: .9px;
  color: #d8dbcf;
  background: rgba(12,13,12,.65);
  border: 1px solid rgba(255,255,255,.17);
  backdrop-filter: blur(5px);
  padding: 5px 7px;
}
.card-index i { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }
.card-country {
  font: 8.5px/1 var(--mono);
  letter-spacing: .8px;
  color: #e2e5d8;
  padding: 5px 7px;
  background: rgba(12,13,12,.66);
  border: 1px solid rgba(255,255,255,.17);
  backdrop-filter: blur(5px);
  text-transform: uppercase;
}
.card-select {
  position: absolute;
  right: 12px; bottom: 12px;
  z-index: 3;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(12,13,12,.74);
  color: #dfe2d5;
  font: 17px/1 var(--mono);
  backdrop-filter: blur(5px);
  transition: .16s;
  opacity: .55;
}
.archive-card:hover .card-select, .archive-card.is-selected .card-select, body.compare-mode .card-select { opacity: 1; }
.card-select:hover { background: var(--accent); color: #111; border-color: var(--accent); }
.archive-card.is-selected .card-select { background: var(--accent); color: #111; border-color: var(--accent); }

.card-body { padding: 17px 18px 15px; cursor: pointer; }
.card-en {
  font: 8.5px/1.4 var(--mono);
  letter-spacing: 1.2px;
  color: #757a6d;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.card-title h3 {
  font-size: clamp(21px, 1.65vw, 26px);
  line-height: 1.25;
  letter-spacing: -.025em;
  font-weight: 600;
  transition: color .18s;
}
.archive-card:hover .card-title h3 { color: var(--accent); }
.card-title > span {
  font: 8px/1 var(--mono);
  color: #5f6459;
  white-space: nowrap;
  letter-spacing: .4px;
}
.card-role {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.card-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.card-specs div { min-width: 0; }
.card-specs span {
  display: block;
  color: #61665b;
  font: 7.5px/1.3 var(--mono);
  letter-spacing: .55px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-specs b {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  min-height: 30px;
  color: #d7dacd;
  font: 400 11px/1.35 var(--mono);
  overflow-wrap: anywhere;
}
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font: 8px/1 var(--mono);
  color: #555a50;
  letter-spacing: .55px;
  text-transform: uppercase;
}
.card-foot .open-arrow { color: var(--accent); font-size: 13px; transition: transform .2s; }
.archive-card:hover .open-arrow { transform: translate(2px,-2px); }

.empty-state {
  padding: 90px 20px;
  text-align: center;
  border: 1px dashed #3a3e35;
  background: #141514;
}
.empty-state > span { font: 9px var(--mono); color: var(--accent); letter-spacing: 1px; }
.empty-state h3 { font-size: 28px; margin: 12px 0 8px; letter-spacing: -.03em; }
.empty-state p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.empty-state .btn { display: inline-flex; }

/* =========================================================
   DEEP//HORIZON — Modern Warships additions
   Reuses the Endfield-style base system above.
   ========================================================= */

.mw-hero-wrap {
  background:
    radial-gradient(ellipse at 50% 62%, rgba(75,145,160,.25), transparent 58%),
    linear-gradient(180deg, #0b1112, #0a0f10);
}
.mw-hero-wrap img {
  object-fit: contain;
  object-position: center 54%;
  padding: 18px 7%;
  filter: drop-shadow(0 24px 26px rgba(0,0,0,.55));
}
.mw-hero-wrap .hud-vignette {
  background:
    linear-gradient(90deg, rgba(5,9,10,.9) 0%, transparent 26%, transparent 74%, rgba(5,9,10,.72) 100%),
    linear-gradient(0deg, rgba(5,9,10,.9) 0%, transparent 42%, transparent 80%, rgba(5,9,10,.3) 100%);
}

.mw-catalog { background: #111413; }
.mw-console { border-color: #39433f; }

.mw-cats {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}
.mw-cats::-webkit-scrollbar { display: none; }
.mw-cat {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid transparent;
  color: #a0a79b;
  font: 10px var(--mono);
  letter-spacing: .2px;
  transition: .16s;
}
.mw-cat b { color: #5d655c; font-weight: 400; font-size: 8px; }
.mw-cat:hover { background: #ffffff07; color: var(--text); }
.mw-cat.is-active { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 700; }
.mw-cat.is-active b { color: #5e6400; }

.mw-countries {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}
.mw-countries::-webkit-scrollbar { display: none; }
.mw-country {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid transparent;
  color: #90998d;
  font: 8px var(--mono);
  transition: .15s;
}
.mw-country img { width: 18px; height: 12px; object-fit: cover; border: 1px solid #454e49; filter: saturate(.85); }
.mw-country b { color: #596157; font-weight: 400; }
.mw-country:hover { background: #ffffff07; color: var(--text); }
.mw-country.is-active { border-color: var(--accent); color: var(--accent); background: #fffa000d; }
.mw-country.is-active b { color: #a5ab00; }

.mw-controls { align-items: flex-start; flex-wrap: wrap; }
.mw-filter-group { display: flex; align-items: center; gap: 8px; }
.mw-filter-label { font: 8px var(--mono); letter-spacing: .9px; color: #5c645a; }
.mw-filter-group .tt-ranks { gap: 2px; }
.mw-filter-group .tt-rank { height: 25px; min-width: 31px; }
.mw-controls .tt-tools { margin-left: auto; }

.mw-results { display: flex; flex-direction: column; gap: 24px; }
.mw-group { border-top: 1px solid #343b34; }
.mw-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 0 10px;
}
.mw-group-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: #e1e6d9; }
.mw-group-sub { font: 8px var(--mono); color: #687064; letter-spacing: .6px; text-transform: uppercase; }
.mw-group-count { margin-left: auto; font: 8px var(--mono); color: #596157; }
.mw-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.mw-card {
  --rarity: #87928a;
  min-width: 0;
  border: 1px solid #2e3733;
  border-top: 2px solid var(--rarity);
  background: linear-gradient(165deg, #1a211f, #131817);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  transition: border-color .18s, transform .22s var(--ease), background .18s;
  animation: cardIn .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 12ms);
  text-align: left;
  padding: 0;
}
.mw-card:hover { transform: translateY(-3px); border-color: #7d8878; border-top-color: var(--rarity); background: #202824; }
.mw-card-media {
  position: relative;
  aspect-ratio: 1.38 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 62%, rgba(95,150,150,.16), transparent 65%),
    linear-gradient(180deg, #111817, #0d1211);
}
.mw-card-media > img {
  width: 94%;
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(0,0,0,.45));
  transition: transform .28s var(--ease);
}
.mw-card:hover .mw-card-media > img { transform: scale(1.05); }
.mw-card-top {
  position: absolute;
  inset: 7px 7px auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 5px;
  z-index: 2;
}
.mw-card-flag { width: 18px; height: 12px; object-fit: cover; border: 1px solid #4a554d; }
.mw-tier {
  padding: 2px 5px;
  border: 1px solid #49534a;
  background: rgba(8,11,10,.75);
  color: #c6cec2;
  font: 7px var(--mono);
  letter-spacing: .3px;
}
.mw-card-body { padding: 9px 10px 10px; }
.mw-card-name {
  display: block;
  color: #e7ece1;
  font: 600 11.5px/1.3 var(--sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-card-type {
  display: block;
  margin-top: 3px;
  color: #748075;
  font: 7.5px/1.4 var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #2b342f;
}
.mw-card-stats span {
  display: block;
  font: 6.5px/1.3 var(--mono);
  color: #5d685e;
  letter-spacing: .25px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-card-stats b {
  display: block;
  margin-top: 2px;
  font: 400 9px/1.3 var(--mono);
  color: #c8d2c5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-top: 7px;
  color: #5b665b;
  font: 6.5px var(--mono);
  letter-spacing: .25px;
}
.mw-card-foot .mw-rarity-label { color: var(--rarity); }
.mw-empty { border: 1px dashed #39433b; background: #141a17; padding: 60px 20px; text-align: center; color: #8c978b; font: 10px var(--mono); }
.mw-empty b { display: block; color: var(--accent); font-size: 22px; margin-bottom: 8px; }

/* MW detail dialog */
.mw-shell { width: min(1180px, 100%); }
.mw-shell::before {
  content: "MODERN WARSHIPS / UNIT FILE";
  position: absolute;
  top: 17px; left: 26px;
  z-index: 7;
  font: 8px var(--mono);
  letter-spacing: 1px;
  color: #5f675d;
}
.mw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(390px, .96fr);
  padding-top: 44px;
}
.mw-visual {
  position: relative;
  padding: 0 24px 22px;
  border-right: 1px solid var(--line);
  background-color: #0c1110;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 38px 38px;
}
.mw-visual-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  font: 8px var(--mono);
  letter-spacing: .7px;
  color: #707b70;
  text-transform: uppercase;
}
.mw-visual-top b { color: var(--accent); font-weight: 400; }
.mw-render {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.2 / 1;
  min-height: 330px;
  border: 1px solid #303b35;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 62%, rgba(90,155,160,.22), transparent 60%),
    linear-gradient(180deg, #0a0f0e, #111816);
}
.mw-render::before {
  content: "";
  position: absolute; left: 8%; right: 8%; bottom: 14%; height: 1px;
  background: linear-gradient(90deg, transparent, #6d887c66, transparent);
}
.mw-render img {
  max-width: 92%;
  max-height: 86%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 22px 22px rgba(0,0,0,.55));
}
.mw-render-tag {
  position: absolute;
  left: 12px; bottom: 10px;
  font: 7.5px var(--mono);
  color: #718074;
  letter-spacing: .7px;
}
.mw-credit { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; font: 8px/1.5 var(--mono); color: #5c685f; }
.mw-credit a { color: #9aa89b; text-decoration: underline; text-underline-offset: 3px; }
.mw-credit a:hover { color: var(--accent); }
.mw-info-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 13px;
  border: 1px solid #303b34;
  background: #303b34;
}
.mw-info-cell { background: #151b18; padding: 9px 10px; }
.mw-info-cell span { display: block; font: 7px var(--mono); color: #5f6b60; letter-spacing: .55px; }
.mw-info-cell b { display: block; margin-top: 3px; color: var(--accent); font: 400 12px/1.3 var(--mono); }
.mw-visual-note { margin-top: 12px; padding: 10px 11px; border: 1px solid #29342e; background: #121815; color: #748176; font: 8.5px/1.7 var(--mono); }

.mw-content { padding: 12px 30px 38px; min-width: 0; }
.mw-kicker { display: flex; align-items: center; gap: 8px; font: 8px var(--mono); letter-spacing: .8px; color: #6c786e; text-transform: uppercase; }
.mw-kicker .mw-live { margin-left: auto; color: var(--green); border: 1px solid #1f5e49; padding: 2px 5px; }
.mw-title h2 { margin-top: 11px; font-size: clamp(32px, 3vw, 46px); line-height: 1.06; letter-spacing: -.045em; font-weight: 650; text-wrap: balance; }
.mw-title .mw-sub { margin-top: 6px; font: 8px var(--mono); color: #768277; letter-spacing: 1px; }
.mw-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.mw-tags span { padding: 4px 7px; border: 1px solid #3a453d; background: #191f1b; color: #b2beb1; font: 8px var(--mono); }
.mw-tags span:first-child { color: var(--accent); border-color: #5d6330; }
.mw-desc-label { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); color: #657166; font: 7.5px var(--mono); letter-spacing: .8px; }
.mw-desc { margin-top: 5px; color: #b5c0b5; font-size: 12px; line-height: 1.9; }
.mw-spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 16px; border: 1px solid #2b3630; background: #2b3630; }
.mw-spec { background: #171e1a; padding: 8px 9px; min-width: 0; }
.mw-spec span { display: block; font: 7px var(--mono); color: #657166; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-spec b { display: block; margin-top: 3px; color: #d9e2d8; font: 400 10px/1.4 var(--mono); overflow-wrap: anywhere; }
.mw-block-head { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.mw-block-head h3 { font: 9px var(--mono); letter-spacing: .9px; color: #c2cec2; text-transform: uppercase; }
.mw-block-head span { font: 7px var(--mono); color: #5c685d; }
.mw-loadout { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 9px; }
.mw-module {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid #303b34;
  background: #171e1a;
  text-align: left;
  transition: .15s;
}
.mw-module:hover { border-color: var(--accent); background: #202820; }
.mw-module img { width: 40px; height: 29px; object-fit: contain; flex: 0 0 40px; }
.mw-module span { min-width: 0; display: block; }
.mw-module b { display: block; color: #d3ddd2; font: 500 9px/1.3 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-module em { display: block; color: #6d796e; font: 7px/1.3 var(--mono); font-style: normal; margin-top: 2px; }
.mw-consum { display: grid; gap: 5px; margin-top: 9px; }
.mw-consum-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px 7px; border: 1px solid #303a34; background: #171e1a; }
.mw-consum-item img { width: 28px; height: 28px; object-fit: contain; flex: 0 0 28px; }
.mw-consum-item b { display: block; color: #d0dad0; font: 500 9px/1.4 var(--sans); }
.mw-consum-item em { display: block; margin-top: 2px; color: #6f7c70; font: 7.5px/1.55 var(--mono); font-style: normal; }
.mw-mounted { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.mw-mounted button { padding: 4px 6px; border: 1px solid #354138; background: #171e1a; color: #9eab9e; font: 7.5px var(--mono); }
.mw-mounted button:hover { color: var(--accent); border-color: var(--accent); }
.mw-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.mw-actions .btn { min-height: 38px; padding: 8px 12px; font-size: 10px; gap: 15px; }
.mw-note { margin-top: 14px; color: #5d695f; font: 8px/1.7 var(--mono); }
.mw-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.mw-nav button { font: 8px var(--mono); color: #7b887c; max-width: 47%; text-align: left; }
.mw-nav button:last-child { text-align: right; }
.mw-nav button:hover { color: var(--accent); }

@media (max-width: 1500px) { .mw-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1180px) {
  .mw-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mw-controls .tt-tools { width: 100%; margin-left: 0; }
  .mw-controls .tt-search { flex: 1; }
  .mw-layout { grid-template-columns: 1fr; }
  .mw-visual { border-right: 0; border-bottom: 1px solid var(--line); }
  .mw-render { aspect-ratio: 1.65 / 1; min-height: 260px; }
}
@media (max-width: 900px) {
  .mw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mw-content { padding: 20px 18px 34px; }
  .mw-visual { padding: 20px 16px 18px; }
  .mw-shell::before { left: 18px; }
  .mw-controls { gap: 10px; }
  .mw-filter-group { flex-wrap: wrap; }
  .mw-cats, .mw-countries { padding-inline: 9px; }
}
@media (max-width: 620px) {
  .mw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mw-card-media { aspect-ratio: 1.3 / 1; }
  .mw-card-name { font-size: 10.5px; }
  .mw-card-stats b { font-size: 8px; }
  .mw-card-foot { display: none; }
  .mw-render { min-height: 220px; aspect-ratio: 1.25 / 1; }
  .mw-info-board { grid-template-columns: repeat(3, 1fr); }
  .mw-spec-grid { grid-template-columns: 1fr; }
  .mw-loadout { grid-template-columns: 1fr; }
  .mw-filter-group .tt-rank { min-width: 27px; padding-inline: 4px; }
  .mw-controls .tt-tools { width: 100%; }
  .mw-controls .tt-search { width: 100%; }
}


.hero-tech-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 5px 0;
  border-bottom: 1px solid #424737;
  color: #9da391;
  font: 9px var(--mono);
  letter-spacing: .45px;
  text-transform: uppercase;
  transition: color .18s, border-color .18s;
}
.hero-tech-link b { color: var(--accent); font-weight: 500; }
.hero-tech-link span:last-child { color: var(--accent); margin-left: 4px; }
.hero-tech-link:hover { color: var(--text); border-color: var(--accent); }
.ht-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--green); }

.tech-tree {
  position: relative;
  padding: clamp(70px, 8vw, 112px) clamp(24px, 4vw, 64px);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse 65% 40% at 80% 8%, rgba(80,86,48,.12), transparent 70%),
    #111312;
}
.tech-tree::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, transparent calc(25% - 1px), rgba(255,255,255,.025) 25%, transparent calc(25% + 1px), transparent calc(75% - 1px), rgba(255,255,255,.025) 75%, transparent calc(75% + 1px));
}
.tech-tree > * { position: relative; z-index: 1; }

.tt-console {
  border: 1px solid #3b4037;
  background: #151815;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
.tt-console-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #1b1e1a;
  font: 8px var(--mono);
  letter-spacing: .9px;
  color: #7b8173;
  text-transform: uppercase;
}
.tt-console-head span:first-child { display: flex; align-items: center; gap: 7px; }
.tt-console-head i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 2.2s infinite; }
.tt-console-head span:last-child { color: #5e6458; }

.tt-nations {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 11px 12px 9px;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}
.tt-nations::-webkit-scrollbar { display: none; }
.tt-nation {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  color: #9da393;
  font: 9px var(--mono);
  letter-spacing: .35px;
  transition: .16s;
}
.tt-nation img { width: 19px; height: 13px; object-fit: cover; border: 1px solid #4b5144; filter: saturate(.8); }
.tt-nation b { color: #5f6559; font-weight: 400; font-size: 7.5px; }
.tt-all-dot { width: 7px; height: 7px; border: 1px solid #747a68; border-radius: 50%; }
.tt-flag-code { display: inline-grid; place-items: center; min-width: 19px; height: 11px; border: 1px solid #4b5144; color: #858b7a; font: 6px var(--mono); }
.tt-nation:hover { background: #ffffff07; color: var(--text); }
.tt-nation.is-active { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 700; }
.tt-nation.is-active b { color: #5d6300; }
.tt-nation.is-active img { border-color: #8b9100; filter: none; }

.tt-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.tt-domains { display: flex; flex-wrap: wrap; gap: 4px; }
.tt-domain {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid #343930;
  color: #a8ad9d;
  font: 10px var(--mono);
  letter-spacing: .3px;
  transition: .16s;
}
.tt-domain b { color: #62685b; font-weight: 400; font-size: 8px; }
.tt-domain:hover { border-color: #6b725e; color: var(--text); }
.tt-domain.is-active { border-color: var(--accent); color: var(--accent); background: #fffa000d; }
.tt-domain.is-active b { color: #a4aa00; }
.tt-tools { display: flex; align-items: center; gap: 7px; }
.tt-search { min-width: 240px; }
.tt-tools .compare-mode { height: 35px; }

.tt-ranks-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 14px 10px;
}
.tt-ranks-label { font: 8px var(--mono); letter-spacing: 1px; color: #5f6558; }
.tt-ranks { display: flex; flex-wrap: wrap; gap: 3px; }
.tt-rank {
  min-width: 34px;
  height: 25px;
  padding: 0 7px;
  border: 1px solid transparent;
  font: 9px var(--mono);
  color: #747a6c;
  transition: .15s;
}
.tt-rank:hover { color: var(--text); background: #ffffff07; }
.tt-rank:disabled { opacity: .26; cursor: not-allowed; background: none; }
.tt-rank.is-active { background: #2d3128; color: var(--accent); border-color: #5b624b; }
.tt-rank-all { padding-inline: 10px; }

.tt-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 2px 18px;
  font: 8px var(--mono);
  letter-spacing: .8px;
  color: #5e6457;
  text-transform: uppercase;
}
.tt-meta #ttResultCount { color: var(--accent); }
.tt-meta #ttFilterLabel { color: #868c7c; }
.tt-meta #ttTotalNote { margin-left: auto; color: #50564b; }

.tt-results { display: flex; flex-direction: column; gap: 22px; }
.tt-group { border-top: 1px solid #34392f; }
.tt-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 9px;
}
.tt-group-roman {
  min-width: 44px;
  font: 400 25px/1 var(--sans);
  letter-spacing: -.04em;
  color: var(--accent);
}
.tt-group-label { font: 8px var(--mono); letter-spacing: 1px; color: #8b917f; }
.tt-group-count { margin-left: auto; font: 8px var(--mono); color: #5b6154; letter-spacing: .5px; }
.tt-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.tt-card {
  position: relative;
  min-width: 0;
  padding: 8px 8px 10px;
  border: 1px solid #2e332b;
  background: linear-gradient(165deg, #1b1e1a, #151815);
  text-align: left;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  transition: border-color .18s, background .18s, transform .22s var(--ease);
  animation: cardIn .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 12ms);
}
.tt-card:hover { border-color: #7b8268; background: #20241d; transform: translateY(-2px); }
.tt-card.is-premium { border-color: #4f4a2c; }
.tt-card-top { display: flex; justify-content: space-between; align-items: flex-start; min-height: 14px; gap: 4px; }
.tt-flag { width: 15px; height: 10px; object-fit: cover; border: 1px solid #464c3e; opacity: .75; }
.tt-badge { font: 7px var(--mono); letter-spacing: .35px; padding: 2px 4px; border: 1px solid #4d5244; color: #8e947f; white-space: nowrap; }
.tt-badge.premium { color: #e3cc62; border-color: #655b30; background: #2a2614; }
.tt-badge.squadron { color: var(--green); border-color: #24664c; background: #10291f; }
.tt-icon {
  display: grid;
  place-items: center;
  height: 84px;
  margin: 4px 0 7px;
  background:
    radial-gradient(ellipse at 50% 58%, rgba(146,156,112,.13), transparent 65%),
    linear-gradient(180deg, transparent 55%, rgba(255,255,255,.025) 56%, transparent 57%);
}
.tt-icon img { max-width: 94%; max-height: 78px; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(0,0,0,.35)); transition: transform .25s var(--ease); }
.tt-card:hover .tt-icon img { transform: scale(1.06); }
.tt-name {
  display: block;
  color: #e6e9db;
  font: 600 11px/1.35 var(--sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-sub {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-top: 3px;
  color: #6f7567;
  font: 7.5px/1.35 var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-sub b { color: #c8cdbb; font-weight: 500; }
.tt-br {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid #2b2f28;
  font: 8px var(--mono);
  color: #5e6457;
}
.tt-br b { color: var(--accent); font-size: 11px; font-weight: 500; }
.tt-br em { font-style: normal; margin-left: auto; color: #4f5549; font-size: 7px; }

.tt-more-wrap { display: flex; justify-content: center; padding: 26px 0 4px; }
.tt-more {
  min-width: 190px;
  padding: 11px 18px;
  border: 1px solid #555c49;
  background: #1b1e19;
  color: #b7bdab;
  font: 10px var(--mono);
  letter-spacing: .4px;
  transition: .18s;
}
.tt-more span { color: var(--accent); margin-left: 8px; }
.tt-more:hover { border-color: var(--accent); color: var(--accent); }
.tt-more[hidden] { display: none; }
.tt-disclaimer {
  max-width: 800px;
  margin: 18px auto 0;
  color: #53594d;
  font: 8px/1.8 var(--mono);
  letter-spacing: .3px;
  text-align: center;
}
.tt-empty {
  padding: 70px 20px;
  border: 1px dashed #3a4035;
  background: #141714;
  text-align: center;
  color: #838a78;
  font: 11px var(--mono);
}
.tt-empty b { display: block; color: var(--accent); font-size: 20px; margin-bottom: 8px; }

/* War Thunder unit dialog */
.wt-shell { width: min(1150px, 100%); }
.wt-shell::before {
  content: "WAR THUNDER / UNIT FILE";
  position: absolute;
  top: 17px; left: 26px;
  z-index: 7;
  font: 8px var(--mono);
  letter-spacing: 1px;
  color: #5f6459;
}
.wt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(380px, .96fr);
  padding-top: 44px;
}
.wt-visual {
  position: relative;
  padding: 0 26px 24px;
  border-right: 1px solid var(--line);
  background-color: #0d0e0d;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 38px 38px;
}
.wt-visual-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 13px;
  font: 8px/1.4 var(--mono);
  letter-spacing: .8px;
  color: #717768;
  text-transform: uppercase;
}
.wt-visual-top b { color: var(--accent); font-weight: 400; }
.wt-render {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.2 / 1;
  min-height: 340px;
  border: 1px solid #30352d;
  background:
    radial-gradient(ellipse at 50% 62%, rgba(156,166,116,.14), transparent 58%),
    linear-gradient(180deg, #0b0d0b, #121511);
  overflow: hidden;
}
.wt-render::before {
  content: "";
  position: absolute;
  left: 8%; right: 8%; bottom: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #707a5a55, transparent);
}
.wt-render img {
  max-width: 88%;
  max-height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 22px 22px rgba(0,0,0,.55));
  position: relative;
  z-index: 1;
}
.wt-render .wt-render-tag {
  position: absolute;
  left: 12px; bottom: 10px;
  font: 7.5px var(--mono);
  color: #777e6b;
  letter-spacing: .7px;
  text-transform: uppercase;
}
.wt-credit {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  font: 8px/1.5 var(--mono);
  color: #5d6356;
}
.wt-credit a { color: #99a08c; text-decoration: underline; text-underline-offset: 3px; }
.wt-credit a:hover { color: var(--accent); }
.wt-br-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 14px;
  border: 1px solid #30352c;
  background: #30352c;
}
.wt-br-cell { background: #171a16; padding: 9px 10px; }
.wt-br-cell span { display: block; font: 7px var(--mono); color: #5e6457; letter-spacing: .6px; }
.wt-br-cell b { display: block; margin-top: 2px; color: var(--accent); font: 500 17px/1.1 var(--mono); }
.wt-visual-note {
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid #292e27;
  background: #131613;
  color: #747b6c;
  font: 8.5px/1.7 var(--mono);
}
.wt-content { padding: 12px 32px 38px; min-width: 0; }
.wt-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 8px var(--mono);
  letter-spacing: .8px;
  color: #6a7062;
  text-transform: uppercase;
}
.wt-kicker .wt-live { margin-left: auto; color: var(--green); border: 1px solid #1e5f45; padding: 2px 5px; }
.wt-title h2 { margin-top: 12px; font-size: clamp(32px, 3vw, 46px); line-height: 1.06; letter-spacing: -.045em; font-weight: 650; text-wrap: balance; }
.wt-title .en { margin-top: 7px; font: 8px var(--mono); color: #737a6a; letter-spacing: 1.1px; }
.wt-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.wt-tags span { padding: 4px 7px; border: 1px solid #3b4136; background: #1a1d18; color: #b4baa9; font: 8px var(--mono); }
.wt-tags span:first-child { color: var(--accent); border-color: #5d6231; }
.wt-desc { margin-top: 6px; color: #b4baab; font-size: 12px; line-height: 1.9; }
.wt-desc-label {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #656b5d;
  font: 7.5px var(--mono);
  letter-spacing: .8px;
  text-transform: uppercase;
}
.wt-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 20px; border: 1px solid #2b3028; background: #2b3028; }
.wt-spec { background: #181b17; padding: 9px 10px; min-width: 0; }
.wt-spec span { display: block; font: 7px var(--mono); color: #666d5f; letter-spacing: .55px; text-transform: uppercase; }
.wt-spec b { display: block; margin-top: 3px; color: #dde0d2; font: 400 10.5px/1.4 var(--mono); overflow-wrap: anywhere; }
.wt-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.wt-actions .btn { min-height: 38px; padding: 8px 13px; font-size: 10px; gap: 16px; }
.wt-note { margin-top: 16px; color: #5e6457; font: 8px/1.7 var(--mono); }
.wt-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.wt-nav button { font: 8px var(--mono); color: #78806e; max-width: 47%; text-align: left; }
.wt-nav button:last-child { text-align: right; }
.wt-nav button:hover { color: var(--accent); }

@media (max-width: 1500px) {
  .tt-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .tt-controls { flex-direction: column; align-items: stretch; }
  .tt-tools { width: 100%; }
  .tt-search { flex: 1; }
  .tt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wt-layout { grid-template-columns: 1fr; }
  .wt-visual { border-right: 0; border-bottom: 1px solid var(--line); }
  .wt-render { aspect-ratio: 1.7 / 1; min-height: 260px; }
}
@media (max-width: 900px) {
  .tt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tech-tree { padding: 64px 16px; }
  .tt-console-head span:last-child { display: none; }
  .tt-controls { padding: 10px; }
  .tt-nations { padding: 9px 8px 7px; }
  .tt-nation { padding: 5px 8px; }
  .tt-ranks-row { padding-inline: 10px; }
  .tt-meta #ttFilterLabel { display: none; }
  .tt-meta #ttTotalNote { margin-left: 0; }
  .wt-content { padding: 20px 18px 34px; }
  .wt-visual { padding: 20px 16px; }
  .wt-shell::before { left: 18px; }
}
@media (max-width: 620px) {
  .tt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tt-icon { height: 72px; }
  .tt-icon img { max-height: 66px; }
  .tt-badge { font-size: 6px; }
  .tt-more-wrap { padding-top: 18px; }
  .wt-render { min-height: 210px; aspect-ratio: 1.25 / 1; }
  .wt-br-board { margin-top: 10px; }
  .wt-specs { grid-template-columns: 1fr; }
}

/* ============ PROTOCOL ============ */

.protocol {
  background: #121312;
  border-top: 1px solid var(--line);
}
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.protocol-card {
  position: relative;
  min-height: 250px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #1a1c1a, #151615 60%);
  overflow: hidden;
  border-radius: 2px;
}
.protocol-no { font: 8px var(--mono); letter-spacing: 1px; color: #74796c; }
.protocol-card h3 { font-size: 24px; line-height: 1.25; letter-spacing: -.025em; margin: 30px 0 13px; font-weight: 600; }
.protocol-card p { color: var(--muted); font-size: 12px; line-height: 1.9; max-width: 340px; }
.protocol-mark {
  position: absolute;
  right: 18px; top: 4px;
  color: rgba(242,255,0,.12);
  font: 96px/1 var(--mono);
  pointer-events: none;
}
.protocol-card:hover { border-color: #555a4c; }
.protocol-card::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .4s var(--ease);
}
.protocol-card:hover::after { width: 100%; }

.protocol-terminal {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: #0d0f0d;
  border-radius: 2px;
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: #1a1c1a;
  border-bottom: 1px solid var(--line);
  font: 8px var(--mono);
  letter-spacing: .9px;
  color: #7a7f72;
  text-transform: uppercase;
}
.terminal-bar span:first-child { display: flex; align-items: center; gap: 7px; }
.terminal-bar i { width: 4px; height: 4px; background: var(--green); border-radius: 50%; }
.terminal-body { padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 30px; }
.terminal-body p { display: flex; align-items: baseline; gap: 12px; font: 10px/2.1 var(--mono); color: #9fa493; }
.terminal-body p > span { color: #4c5148; width: 18px; flex: 0 0 18px; }
.terminal-body p b { color: var(--text); font-weight: 500; min-width: 94px; }
.terminal-body p em { color: #646a5e; font-style: normal; }
.terminal-body p i { color: #595f53; font-style: normal; }
.terminal-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: calc(100% - 40px);
  margin: 0 20px 18px;
  padding: 11px 0 0;
  border-top: 1px dashed #34382f;
  color: var(--accent);
  font: 10px var(--mono);
  letter-spacing: .4px;
  text-align: left;
}
.terminal-link:hover { color: #fff; }

/* ============ FOOTER ============ */

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 34px;
  align-items: start;
  padding: 32px clamp(24px, 4vw, 64px) 38px;
  border-top: 1px solid var(--line);
  background: #101110;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { filter: grayscale(1) brightness(1.7); }
.footer-brand span { display: flex; flex-direction: column; }
.footer-brand strong { font: 700 11px var(--mono); letter-spacing: .4px; }
.footer-brand small { color: var(--dim); font: 8px var(--mono); margin-top: 2px; }
.site-footer p { color: #656a5f; font-size: 10px; line-height: 1.8; max-width: 690px; }
.footer-links { display: flex; gap: 20px; align-items: center; justify-content: flex-end; }
.footer-links button, .footer-links a {
  font: 9px var(--mono);
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: .3px;
}
.footer-links button:hover, .footer-links a:hover { color: var(--accent); }

/* ============ COMPARE TRAY ============ */

.compare-tray {
  position: fixed;
  z-index: 60;
  left: calc(var(--rail) + 50%);
  transform: translateX(-50%);
  bottom: 18px;
  width: min(700px, calc(100vw - var(--rail) - 40px));
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: rgba(20,22,20,.96);
  border: 1px solid #555b47;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(14px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.compare-tray[hidden] { display: none; }
.tray-head { display: flex; flex-direction: column; gap: 3px; font: 8px var(--mono); letter-spacing: .8px; color: var(--dim); }
.tray-head span:last-child { color: var(--accent); font-size: 9px; }
.tray-items { display: flex; gap: 5px; flex-wrap: wrap; }
.tray-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 150px;
  padding: 6px 7px;
  background: #262922;
  border: 1px solid #41463a;
  font: 9px var(--mono);
  color: #d9dccd;
}
.tray-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-chip button { color: #8b907f; font-size: 13px; line-height: 1; }
.tray-chip button:hover { color: var(--accent); }
.tray-actions { display: flex; align-items: center; gap: 7px; }
.tray-clear { font: 9px var(--mono); color: var(--dim); padding: 7px; }
.tray-clear:hover { color: var(--text); }
.tray-run {
  padding: 9px 12px;
  background: var(--accent);
  color: #111;
  font: 700 10px var(--mono);
  letter-spacing: .2px;
  white-space: nowrap;
}
.tray-run:hover { background: #fbff67; }
.tray-run:disabled { opacity: .4; cursor: not-allowed; }

/* ============ MODALS ============ */

.modal {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 3vh 3vw;
  border: 0;
  background: rgba(5,6,5,.78);
  color: var(--text);
  backdrop-filter: blur(9px);
}
.modal[open] { display: flex; align-items: center; justify-content: center; }
.modal::backdrop { background: rgba(4,5,4,.7); }
.modal-shell {
  position: relative;
  width: min(1240px, 100%);
  max-height: 94dvh;
  overflow: auto;
  background: #151716;
  border: 1px solid #4a4f43;
  box-shadow: 0 40px 120px rgba(0,0,0,.8);
  scrollbar-width: thin;
  scrollbar-color: #4b5045 #141514;
}
.modal-shell::-webkit-scrollbar { width: 8px; }
.modal-shell::-webkit-scrollbar-thumb { background: #444a3e; }
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(10,11,10,.82);
  border: 1px solid #555b4c;
  color: #cfd3c4;
  font: 8px var(--mono);
  letter-spacing: .7px;
  backdrop-filter: blur(6px);
}
.modal-close span { font-size: 16px; line-height: .7; color: var(--accent); }
.modal-close:hover { border-color: var(--accent); color: var(--accent); }

/* Detail */

.detail-shell { width: min(1280px, 100%); }
.detail-shell::before {
  content: "DOSSIER / VISUAL ARCHIVE";
  position: absolute;
  top: 17px; left: 26px;
  z-index: 7;
  font: 8px var(--mono);
  letter-spacing: 1px;
  color: #5f6459;
  pointer-events: none;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  min-height: 600px;
  padding-top: 44px;
}
.detail-visual {
  position: relative;
  border-right: 1px solid var(--line);
  background-color: #0d0e0d;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 38px 38px;
  padding: 0 26px 22px;
  display: flex;
  flex-direction: column;
}
.detail-visual-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font: 8px/1.5 var(--mono);
  letter-spacing: .9px;
  color: #73786c;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.detail-visual-top b { color: var(--accent); font-weight: 400; }
.detail-image {
  position: relative;
  border: 1px solid #343832;
  overflow: hidden;
  background: #0a0b0a;
}
.detail-image img {
  width: 100%;
  aspect-ratio: 1.35 / 1;
  object-fit: cover;
  filter: saturate(.86) contrast(1.06) brightness(.92);
}
.detail-image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8,9,8,.62), transparent 36%);
  pointer-events: none;
}
.detail-image .img-tag {
  position: absolute;
  left: 12px; bottom: 10px;
  z-index: 2;
  font: 8px var(--mono);
  letter-spacing: .8px;
  color: #d4d8ca;
  background: rgba(10,11,10,.75);
  border: 1px solid #4a5043;
  padding: 4px 6px;
}
.detail-credit {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font: 8px/1.6 var(--mono);
  color: #676c60;
  letter-spacing: .3px;
}
.detail-credit a { color: #9da391; text-decoration: underline; text-underline-offset: 3px; }
.detail-credit a:hover { color: var(--accent); }
.detail-image-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  border: 1px solid #2b2f28;
  background: #2b2f28;
}
.detail-image-meta div { background: #161815; padding: 9px 10px; min-width: 0; }
.detail-image-meta span {
  display: block;
  color: #5d6357;
  font: 7px/1.4 var(--mono);
  letter-spacing: .55px;
}
.detail-image-meta b {
  display: block;
  margin-top: 3px;
  color: #b7bcad;
  font: 400 8.5px/1.4 var(--mono);
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-visual-foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font: 8px/1.5 var(--mono);
  color: #4d5248;
  letter-spacing: .7px;
  text-transform: uppercase;
}
.detail-visual-note {
  margin-top: 18px;
  padding: 13px 14px 12px;
  border: 1px solid #292d27;
  background: rgba(18,20,18,.72);
}
.note-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: 7.5px/1.3 var(--mono);
  letter-spacing: .65px;
  color: #6b7163;
  text-transform: uppercase;
}
.note-head span:last-child { color: #4e5449; }
.detail-visual-note p {
  margin-top: 8px;
  color: #7f8578;
  font-size: 10px;
  line-height: 1.8;
  max-width: 520px;
}
.note-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  margin-top: 10px;
  opacity: .45;
}
.note-bars i { display: block; width: 2px; height: 5px; background: #606753; }
.note-bars i:nth-child(3n) { height: 11px; background: #8b9275; }
.note-bars i:nth-child(4n) { height: 7px; }
.note-bars i:nth-child(5n) { height: 15px; background: var(--accent); opacity: .55; }

.detail-content {
  padding: 12px 32px 38px;
  min-width: 0;
}
.detail-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 8.5px var(--mono);
  letter-spacing: 1px;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.detail-kicker i { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }
.detail-kicker .status {
  margin-left: auto;
  color: var(--green);
  border: 1px solid rgba(1,255,162,.28);
  padding: 3px 6px;
}
.detail-title h2 {
  font-size: clamp(31px, 2.9vw, 44px);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 650;
  text-wrap: balance;
}
.detail-title .en {
  margin-top: 7px;
  color: #777d6e;
  font: 9px/1.4 var(--mono);
  letter-spacing: 1.4px;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.detail-meta span {
  padding: 4px 7px;
  border: 1px solid #3d4237;
  background: #1b1e1a;
  color: #b4b9a9;
  font: 8.5px var(--mono);
  letter-spacing: .3px;
}
.detail-meta span:first-child { color: var(--accent); border-color: #5a5f31; }
.detail-summary {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #b7bbad;
  font-size: 13px;
  line-height: 1.95;
}
.detail-tagline {
  margin-top: 15px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  color: #daddcf;
  font-size: 12px;
  line-height: 1.8;
}
.detail-block { margin-top: 26px; }
.detail-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.detail-block-head h3 { font: 10px var(--mono); letter-spacing: 1.1px; color: #c1c5b6; text-transform: uppercase; }
.detail-block-head span { font: 8px var(--mono); color: #5c6156; letter-spacing: .5px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #2a2d28; border: 1px solid #2a2d28; }
.spec-cell { background: #191b18; padding: 10px 11px; min-width: 0; }
.spec-cell span {
  display: block;
  font: 7.5px var(--mono);
  letter-spacing: .55px;
  color: #666c5f;
  text-transform: uppercase;
}
.spec-cell b {
  display: block;
  margin-top: 3px;
  font: 400 12px/1.45 var(--mono);
  color: #e5e8d9;
  overflow-wrap: anywhere;
}
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.feature-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  color: #aeb3a4;
  font-size: 11.5px;
  line-height: 1.75;
}
.feature-list li::before {
  content: "▸";
  color: var(--accent);
  font-size: 10px;
  line-height: 1.9;
}
.detail-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-sources a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #3c4136;
  background: #1a1c19;
  font: 8.5px var(--mono);
  color: #aeb3a3;
  letter-spacing: .2px;
}
.detail-sources a span { color: var(--accent); }
.detail-sources a:hover { border-color: var(--accent); color: var(--accent); }
.detail-actions { display: flex; gap: 8px; margin-top: 24px; }
.detail-actions .btn { min-height: 38px; padding: 8px 13px; font-size: 10px; gap: 14px; }
.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.detail-nav button { font: 8.5px var(--mono); color: #777d6e; letter-spacing: .3px; }
.detail-nav button:hover { color: var(--accent); }

/* Compare */

.compare-shell { width: min(1150px, 100%); }
.compare-head { padding: 32px 32px 20px; border-bottom: 1px solid var(--line); }
.compare-head .section-tag { margin-bottom: 12px; }
.compare-head h2 { font-size: clamp(36px, 4vw, 54px); }
.compare-head p { color: var(--muted); font-size: 11px; margin-top: 10px; max-width: 680px; line-height: 1.8; }
.compare-table-wrap { padding: 20px 24px 28px; overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.compare-table th, .compare-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font: 10px/1.55 var(--mono);
}
.compare-table thead th { border-bottom-color: #555b4b; padding-bottom: 14px; }
.compare-table thead .cmp-card { width: 190px; }
.cmp-photo { width: 100%; aspect-ratio: 1.6/1; object-fit: cover; border: 1px solid #3a3f34; filter: saturate(.8) contrast(1.05); }
.cmp-name { margin-top: 8px; font: 600 14px/1.3 var(--sans); letter-spacing: -.01em; }
.cmp-en { color: #73796b; font: 7.5px var(--mono); margin-top: 3px; }
.cmp-remove { margin-top: 8px; font: 8px var(--mono); color: #8a907f; border-bottom: 1px solid #4b5044; }
.cmp-remove:hover { color: var(--accent); border-color: var(--accent); }
.compare-table tbody th {
  width: 130px;
  color: #73796b;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: 8px;
  background: #171917;
  position: sticky;
  left: 0;
}
.compare-table td { color: #d7dbcd; }
.compare-table tbody tr:hover td { background: #1b1e19; }
.cmp-empty { color: #777d6f; padding: 50px 10px; text-align: center; font: 10px var(--mono); }

/* Sources */

.sources-shell { width: min(780px, 100%); padding: 38px 40px 34px; }
.sources-shell .section-tag { margin-bottom: 14px; }
.sources-shell h2 { font-size: clamp(36px, 4vw, 52px); }
.sources-body { margin-top: 24px; }
.sources-body h3 {
  margin: 22px 0 7px;
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
}
.sources-body p { color: #a7ac9d; font-size: 12px; line-height: 1.9; }
.sources-body code { color: #d7dbcb; background: #22251f; padding: 1px 4px; font-size: .92em; }
.sources-body .btn { margin-top: 26px; }
.source-credits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 12px;
  border: 1px solid #2b2f28;
  background: #2b2f28;
}
.source-credits a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 6px;
  padding: 8px 10px;
  background: #171916;
  min-width: 0;
  font-size: 10px;
  color: #c1c6b7;
  transition: background .16s;
}
.source-credits a:hover { background: #20231d; color: var(--accent); }
.source-credits a span { color: #656b5e; font: 8px var(--mono); grid-row: 1 / 3; padding-top: 2px; }
.source-credits a em {
  grid-column: 2;
  color: #62685b;
  font: 7.5px var(--mono);
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toast */

.toast {
  position: fixed;
  z-index: 200;
  left: calc(var(--rail) + 50%);
  transform: translate(-50%, 16px);
  bottom: 84px;
  padding: 9px 14px;
  background: var(--accent);
  color: #111;
  font: 700 10px var(--mono);
  letter-spacing: .3px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============ ANIMATIONS ============ */

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(1,255,162,.55); }
  70% { box-shadow: 0 0 0 7px rgba(1,255,162,0); }
  100% { box-shadow: 0 0 0 0 rgba(1,255,162,0); }
}
@keyframes blink { 0%, 45% { opacity: 1; } 50%, 100% { opacity: .15; } }
@keyframes scan { 0% { top: -20%; } 100% { top: 105%; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ============ RESPONSIVE ============ */

@media (max-width: 1440px) {
  :root { --rail: 232px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-heading { grid-template-columns: 1.45fr minmax(300px, .75fr); }
}

@media (max-width: 1180px) {
  .hero-heading { grid-template-columns: 1fr; gap: 28px; }
  .hero-intro { max-width: 620px; padding-left: 18px; }
  .hero { min-height: 0; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .hero-scroll { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-right { width: 100%; }
  .search-box { flex: 1; }
  .detail-layout { grid-template-columns: 1fr .95fr; }
  .detail-content { padding: 30px 24px; }
  .compare-tray { grid-template-columns: 1fr auto; }
  .tray-head { flex-direction: row; justify-content: space-between; grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  :root { --rail: 0px; }
  html { scroll-padding-top: 118px; }
  body { padding-top: 0; }
  .rail {
    position: sticky;
    top: 0; left: 0;
    width: 100%;
    height: auto;
    padding: 11px 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(23,24,23,.97);
    backdrop-filter: blur(12px);
  }
  .brand { padding: 0; }
  .brand img { width: 30px; height: 30px; flex-basis: 30px; }
  .brand-copy strong { font-size: 11px; }
  .brand-copy small { font-size: 8px; }
  .rail-signal { display: none; }
  .rail-nav {
    flex-direction: row;
    gap: 2px;
    margin: 8px -4px 0;
    padding-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-nav a { flex: none; min-height: 34px; padding: 7px 9px; font-size: 11px; gap: 6px; white-space: nowrap; }
  .rail-nav a svg { width: 14px; height: 14px; flex-basis: 14px; }
  .rail-nav a b { display: none; }
  .rail-nav a.is-active { box-shadow: inset 0 -2px 0 var(--accent); }
  .rail-footer { display: none; }
  main { margin-left: 0; width: 100%; }
  .status-band { height: 32px; padding: 0 16px; font-size: 7.5px; gap: 12px; }
  .status-coord { display: none; }
  .status-edition { margin-left: auto; }
  .hero { padding: 22px 16px 0; }
  .hero-heading { margin-top: 28px; }
  h1 { font-size: clamp(60px, 15vw, 110px); }
  .hero-intro { padding-left: 14px; }
  .hud-image-wrap { aspect-ratio: 1.75 / 1; min-height: 220px; }
  .hud-readout-right { display: none; }
  .hud-readout-left { left: 16px; bottom: 16px; }
  .stage-foot span:nth-child(2) { display: none; }
  .hero-stats { gap: 16px; grid-template-columns: repeat(2, 1fr); margin-top: 34px; padding-top: 20px; }
  .hero-stats > div { justify-content: space-between; border-bottom: 1px solid var(--line-soft); padding-bottom: 8px; }
  .hero-stats strong { font-size: 38px; }
  .hero-scroll { grid-column: 1 / -1; }
  .archive, .protocol { padding: 64px 16px; }
  .section-head { grid-template-columns: 1fr; gap: 18px; margin-bottom: 30px; }
  .section-head h2 { font-size: clamp(42px, 10vw, 60px); }
  .section-head > p { max-width: 560px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 14px 13px; }
  .card-title { display: block; }
  .card-title h3 { font-size: 20px; }
  .card-title > span { display: none; }
  .card-specs b { font-size: 10px; }
  .card-specs span { font-size: 7px; }
  .card-foot { margin-top: 9px; }
  .archive-meta .meta-hint { display: none; }
  .protocol-grid { grid-template-columns: 1fr; }
  .protocol-card { min-height: 0; }
  .protocol-card h3 { margin-top: 22px; }
  .terminal-body { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; gap: 18px; padding: 24px 16px 30px; }
  .footer-links { justify-content: flex-start; }
  .compare-tray { left: 12px; right: 12px; bottom: 12px; width: auto; transform: none; grid-template-columns: 1fr; gap: 8px; }
  .tray-actions { justify-content: flex-end; }
  .toast { left: 50%; }
  .modal { padding: 0; }
  .modal-shell { max-height: 100dvh; height: 100dvh; border: 0; width: 100%; }
  .detail-layout { grid-template-columns: 1fr; min-height: 0; }
  .detail-visual { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 16px 16px; }
  .detail-visual-note { display: none; }
  .detail-image img { aspect-ratio: 1.5 / 1; }
  .detail-visual-foot { display: none; }
  .detail-content { padding: 24px 18px 36px; }
  .detail-title h2 { font-size: 34px; }
  .modal-close { top: 8px; right: 8px; }
  .compare-head { padding: 28px 18px 18px; }
  .compare-table-wrap { padding: 14px 12px 24px; }
  .sources-shell { padding: 48px 20px 30px; }
}

@media (max-width: 620px) {
  .source-credits { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .card-media { aspect-ratio: 1.55 / 1; }
  .card-title h3 { font-size: 23px; }
  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tabs button { flex: none; }
  .toolbar-right { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; flex: none; }
  .compare-mode { align-self: flex-start; }
  .hero-top .version { display: none; }
  .hero-cn { font-size: 27px; }
  .hero-actions .btn { flex: 1; min-width: 140px; }
  .hero-stage { margin-top: 28px; }
  .hud-frame { padding: 7px; }
  .hud-image-wrap { aspect-ratio: 1.35 / 1; min-height: 190px; }
  .hud-topline { font-size: 7px; }
  .hud-btmline { font-size: 7px; }
  .hud-readout strong { font-size: 22px; }
  .stage-head { font-size: 7.5px; }
  .stage-foot { display: none; }
  .hud-readout-left { left: 12px; bottom: 12px; }
  .hud-readout-left .hud-label { font-size: 6.5px; }
  .hud-readout-left strong + span { font-size: 8px; }
  .section-head h2 { font-size: 42px; }
  .archive-meta { font-size: 7.5px; }
  .archive-meta #activeFilterLabel { display: none; }
  .spec-grid { grid-template-columns: 1fr; }
  .detail-actions { flex-direction: column; }
  .detail-credit { flex-direction: column; gap: 3px; }
  .compare-head h2 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ticker-track { animation: none; }
}
