:root {
  color-scheme: dark;
  --bg: #06070d;
  --bg-2: #0b1020;
  --panel: rgba(15, 20, 34, 0.96);
  --panel-strong: rgba(17, 24, 42, 0.98);
  --line: rgba(255,255,255,0.12);
  --line-strong: rgba(255,255,255,0.20);
  --text: #e6ebf2;
  --muted: #aab6c6;
  --soft: #d7e0ec;
  --eyebrow: #8b98ac;
  --red: #e0575f;
  --red-deep: #991b1b;
  --blue: #4d7fd6;
  --cyan: #5cb3c6;
  --amber: #d9a441;
  --green: #3fae72;
  --pink: #ec4899;
  --purple: #8b5cf6;
  --shadow: 0 10px 30px rgba(0, 0, 0, .38);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

.pilot-card h1,
.hero-copy h2,
.section-head h3,
.fit-ship-summary h3,
.kill-modal h3 { font-family: var(--display); }

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  background:
    radial-gradient(circle at 22% -2%, rgba(59,130,246,.07), transparent 45%),
    linear-gradient(160deg, #070911 0%, #080b14 55%, #0a0c15 100%);
}
.space-noise,
.blood-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.space-noise {
  z-index: -3;
  opacity: .05;
  background-image:
    linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}
.blood-glow {
  display: none;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--cyan);
  background: #020617;
  color: var(--cyan);
  border-radius: 12px;
  transform: translateY(-150%);
  z-index: 100;
}
.skip-link:focus { transform: translateY(0); }

.app-shell {
  width: min(1500px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 34px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
}

.panel,
.dossier-rail {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dossier-rail {
  position: sticky;
  top: 18px;
  height: calc(100dvh - 36px);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 16px;
  padding: 16px;
  border-radius: 28px;
}
.rail-topline,
.rail-footer,
.section-code,
.eyebrow,
.metric span,
.feed-meta,
.modal-grid dt,
.combat-tags span {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.rail-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.rail-topline b { color: var(--green); }
.pilot-card { margin: 0; }
.portrait-frame {
  position: relative;
  border-radius: 28px;
  padding: 6px;
  background: linear-gradient(135deg, rgba(59,130,246,.45), rgba(148,163,184,.20));
}
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 21px;
  border: 1px solid rgba(255,255,255,.18);
  pointer-events: none;
}
.portrait-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22px;
  background: #111827;
}
.pilot-card h1 {
  margin: 6px 0 4px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: .98;
  letter-spacing: -.03em;
}
.pilot-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.eyebrow {
  margin: 0;
  color: var(--eyebrow);
  font-size: 11px;
  font-weight: 700;
}

.pilot-search {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, .46);
  border-radius: 20px;
}
.pilot-search label { color: var(--soft); font-weight: 700; }
.pilot-search div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.pilot-search input,
.pilot-search button {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
}
.pilot-search input {
  width: 100%;
  padding: 0 12px;
  background: #050812;
  color: var(--text);
}
.pilot-search button,
.feed-filters button,
.modal-actions a,
.modal-actions button {
  cursor: pointer;
  border: 1px solid rgba(239,68,68,.36);
  background: linear-gradient(135deg, rgba(239,68,68,.2), rgba(59,130,246,.12));
  color: var(--text);
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.pilot-search button:hover,
.feed-filters button:hover,
.modal-actions a:hover,
.modal-actions button:hover { transform: translateY(-1px); border-color: rgba(239,68,68,.72); }
.pilot-search small { color: var(--muted); line-height: 1.4; }

.view-tabs {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 0;
  overflow-y: auto;
}
.view-tabs button {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.075);
  background: rgba(255,255,255,.032);
  color: var(--text);
  text-align: left;
  border-radius: 18px;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.view-tabs button span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(239,68,68,.12);
  color: var(--red);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}
.view-tabs button:hover,
.view-tabs button.active {
  transform: translateX(2px);
  border-color: rgba(239,68,68,.44);
  background: linear-gradient(135deg, rgba(239,68,68,.16), rgba(59,130,246,.08));
}
.rail-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}
.rail-footer a { color: var(--cyan); text-decoration: none; }

.combat-main { min-width: 0; display: grid; gap: 16px; }
.combat-main:focus { outline: none; }
.combat-main:focus-visible {
  outline: 1px solid rgba(34, 211, 238, .22);
  outline-offset: 4px;
}
.hero-dossier {
  min-height: 180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: center;
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: 32px;
  overflow: hidden;
  position: relative;
}
.hero-dossier::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 88% 32%, rgba(34,197,94,.18), transparent 26%),
    linear-gradient(110deg, transparent 0 58%, rgba(59,130,246,.08));
  pointer-events: none;
}
.hero-copy,
.efficiency-ring { position: relative; }
.hero-copy h2 {
  max-width: 860px;
  margin: 8px 0 10px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -.02em;
}
.hero-copy p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.62;
}
.combat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.combat-tags span {
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.045);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}
.efficiency-ring {
  justify-self: center;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
}
.efficiency-ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.ring-bg,
.ring-value {
  fill: none;
  stroke-width: 12;
}
.ring-bg { stroke: rgba(255,255,255,.08); }
.ring-value {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: 389;
  stroke-dashoffset: 389;
  transition: stroke-dashoffset 550ms ease;
}
.efficiency-ring div {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  background: rgba(2, 6, 23, .62);
}
.efficiency-ring strong { font-family: var(--mono); font-size: 30px; color: var(--green); }
.efficiency-ring span { color: var(--soft); font-size: 12px; text-align: center; max-width: 92px; }

.metrics-grid,
.two-col {
  display: grid;
  gap: 16px;
}
.metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric {
  min-height: 140px;
  padding: 18px;
  border-radius: 26px;
}
.metric span { display: block; color: var(--muted); font-size: 11px; }
.metric strong {
  display: block;
  margin: 14px 0 8px;
  font-family: var(--mono);
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -.05em;
}
.metric small { color: var(--muted); }
.metric.danger strong { color: var(--green); }
.metric.loss strong { color: var(--red); }
.metric.isk strong { color: var(--green); }
.metric.blue strong { color: var(--cyan); }

.two-col { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); }
.highlight-panel,
.systems-panel,
.feed-panel,
.loss-review-panel,
.ships-panel,
.advice-panel {
  padding: 20px;
  border-radius: 28px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 15px;
}
.section-head h3 {
  margin: 5px 0 0;
  font-size: clamp(22px, 2.1vw, 32px);
  letter-spacing: -.05em;
}
.section-code {
  color: var(--muted);
  font-size: 10px;
}
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.highlight-card {
  min-height: 128px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
  border-radius: 20px;
}
.highlight-card.loss { border-color: rgba(239,68,68,.34); background: rgba(239,68,68,.055); }
.highlight-card.kill { border-color: rgba(34,197,94,.26); background: rgba(34,197,94,.055); }
.highlight-card span { color: var(--muted); font-size: 12px; }
.highlight-card strong { display: block; margin: 8px 0 5px; font-size: 20px; }
.highlight-card b { font-family: var(--mono); color: var(--green); }
.highlight-card.loss b { color: var(--red); }

.system-bars,
.advice-list { display: grid; gap: 10px; }
.system-row,
.advice-item {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.034);
  border-radius: 18px;
}
.system-row header,
.feed-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.system-row strong { font-size: 16px; }
.system-row span { color: var(--muted); font-size: 12px; }
.bar {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--blue)); border-radius: inherit; }

.feed-panel { min-height: 420px; }
.feed-head { align-items: center; }
.feed-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.feed-filters button {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
}
.feed-filters button.active { background: var(--blue); border-color: rgba(34,211,238,.72); color: white; box-shadow: 0 0 0 1px rgba(34,211,238,.16); }
.feed-list { display: grid; gap: 10px; }
.feed-row {
  width: 100%;
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(2,6,23,.34);
  border-radius: 19px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}
.feed-row.kill { border-left: 3px solid var(--green); }
.feed-row.loss { border-left: 3px solid var(--red); }
.feed-row.kill:hover { transform: translateY(-1px); border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.06); box-shadow: 0 0 0 1px rgba(34,197,94,.12); }
.feed-row.loss:hover { transform: translateY(-1px); border-color: rgba(239,68,68,.55); background: rgba(239,68,68,.065); box-shadow: 0 0 0 1px rgba(239,68,68,.12); }
.feed-ship-thumb {
  position: relative;
  width: 64px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: radial-gradient(circle at 50% 24%, rgba(148,163,184,.18), rgba(15,23,42,.84));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
}
.feed-ship-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.16), transparent 36%, rgba(0,0,0,.22));
}
.feed-ship-thumb.kill { border-color: rgba(34,197,94,.5); }
.feed-ship-thumb.loss { border-color: rgba(239,68,68,.5); }
.feed-ship-thumb img {
  position: relative;
  z-index: 2;
  width: 86%;
  height: 86%;
  object-fit: contain;
  filter: saturate(1.08) contrast(1.06) drop-shadow(0 8px 16px rgba(0,0,0,.38));
}
.feed-ship-thumb i {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  font-style: normal;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .06em;
  font-weight: 900;
  color: rgba(226,232,240,.46);
}
.feed-row h4 { margin: 0; font-size: 17px; }
.feed-row p { margin: 5px 0 0; color: var(--muted); line-height: 1.42; }
.feed-debrief-note {
  display: block;
  margin-top: 6px;
  color: var(--cyan);
  line-height: 1.35;
}
.feed-meta { color: var(--muted); font-size: 11px; }
.feed-isk { font-family: var(--mono); color: var(--green); white-space: nowrap; }
.feed-row.loss .feed-isk { color: var(--red); }

.chip-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.ship-chip {
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--soft);
  font-weight: 700;
}
.advice-item strong { display: block; margin-bottom: 5px; }
.advice-item small { color: var(--muted); line-height: 1.45; }

.refresh-button {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, .28);
  background: rgba(34, 211, 238, .06);
  color: var(--cyan);
  cursor: pointer;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11px;
  font-weight: 800;
}
.refresh-button:hover { border-color: rgba(34, 211, 238, .62); background: rgba(34, 211, 238, .11); }

.analysis-stack {
  display: grid;
  gap: 16px;
}
.analysis-hero,
.analysis-grid .panel { padding: 20px; border-radius: 28px; }
.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.scorecard {
  min-height: 126px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.035);
  border-radius: 20px;
}
.scorecard span,
.ship-row span,
.loss-mini b,
.hotspot-row span {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-size: 10px;
}
.scorecard strong {
  display: block;
  margin: 12px 0 8px;
  font-family: var(--mono);
  font-size: clamp(24px, 2.5vw, 36px);
  letter-spacing: -.05em;
}
.scorecard small,
.analysis-source,
.hotspot-row p,
.loss-mini span,
.ship-row small { color: var(--muted); line-height: 1.42; }
.scorecard.green strong { color: var(--green); }
.scorecard.amber strong { color: var(--amber); }
.scorecard.red strong { color: var(--red); }
.scorecard.blue strong { color: var(--cyan); }
.analysis-source {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}
.loss-review-summary {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.loss-review-stat,
.loss-review-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.034);
  border-radius: 18px;
}
.loss-review-stat {
  display: grid;
  align-content: center;
  min-height: 132px;
}
.loss-review-stat span,
.loss-review-block h4,
.loss-observation strong {
  margin: 0;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-size: 10px;
}
.loss-review-stat strong {
  display: block;
  margin: 12px 0 8px;
  font-family: var(--mono);
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -.05em;
  color: var(--red);
}
.loss-review-stat small,
.loss-ship-row small,
.loss-observation span { color: var(--muted); line-height: 1.42; }
.loss-pressure-profile,
.loss-ship-list,
.loss-observation-list { display: grid; gap: 8px; }
.loss-pressure-row,
.loss-ship-row {
  min-height: 44px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(2,6,23,.28);
  border-radius: 14px;
}
.loss-pressure-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.loss-pressure-row .bar {
  grid-column: 1 / -1;
  margin-top: 0;
}
.loss-pressure-row .bar i { background: linear-gradient(90deg, var(--red), var(--amber), var(--cyan)); }
.loss-pressure-row span,
.loss-ship-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}
.loss-pressure-row b,
.loss-ship-row b {
  font-family: var(--mono);
  color: var(--amber);
  white-space: nowrap;
}
.loss-ship-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.loss-ship-row small {
  grid-column: 1 / -1;
}
.loss-observation-list {
  margin-top: 10px;
}
.loss-observation {
  min-height: 44px;
  padding: 12px;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(92,179,198,.22);
  background: rgba(92,179,198,.06);
  border-radius: 16px;
}
.loss-observation.amber {
  border-color: rgba(217,164,65,.28);
  background: rgba(217,164,65,.065);
}
.loss-observation.red {
  border-color: rgba(224,87,95,.30);
  background: rgba(224,87,95,.065);
}
.ship-table,
.loss-review,
.hotspot-list { display: grid; gap: 10px; }
.ship-row,
.hotspot-row,
.loss-card,
.loss-mini {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.034);
  border-radius: 18px;
}
.ship-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}
.ship-row strong,
.hotspot-row strong { display: block; font-size: 16px; }
.ship-row b { font-family: var(--mono); white-space: nowrap; }
.ship-row b.pos { color: var(--green); }
.ship-row b.neg { color: var(--amber); }
.loss-card {
  display: grid;
  gap: 5px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.loss-card:hover { border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.06); }
.loss-card strong { color: var(--amber); font-family: var(--mono); }
.loss-card span { font-weight: 800; }
.loss-card small { color: var(--muted); }
.loss-mini { display: grid; gap: 5px; }
.hotspot-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.hotspot-row p { margin: 6px 0 0; }

.kill-modal {
  width: min(760px, calc(100% - 28px));
  border: 1px solid rgba(255,255,255,.16);
  padding: 0;
  border-radius: 28px;
  color: var(--text);
  background: rgba(6, 8, 16, .96);
  box-shadow: 0 34px 160px rgba(0,0,0,.72);
  backdrop-filter: blur(22px);
}
.kill-modal::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(5px); }
.kill-modal article { position: relative; padding: 24px; }
.modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
}
.kill-modal h3 { margin: 8px 48px 8px 0; font-size: clamp(26px, 4vw, 44px); line-height: .98; letter-spacing: -.055em; }
.kill-modal p { color: var(--muted); line-height: 1.5; }
.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.modal-grid div {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  border-radius: 16px;
}
.modal-grid dt { color: var(--muted); font-size: 10px; }
.modal-grid dd { margin: 6px 0 0; font-weight: 800; }
.modal-loss-debrief {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(92,179,198,.22);
  background: rgba(92,179,198,.055);
  border-radius: 16px;
}
.modal-loss-debrief h4 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 18px;
}
.modal-debrief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.modal-debrief-card,
.modal-debrief-composition article,
.modal-debrief-observations {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(2,6,23,.30);
  border-radius: 14px;
}
.modal-debrief-card {
  display: grid;
  gap: 6px;
  align-content: start;
}
.modal-debrief-card span,
.modal-debrief-composition h5,
.modal-debrief-observations h5 {
  margin: 0;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-size: 10px;
}
.modal-debrief-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}
.modal-debrief-card small,
.modal-debrief-card em {
  color: var(--muted);
  line-height: 1.4;
  font-style: normal;
}
.modal-debrief-pressure strong { color: var(--cyan); }
.modal-debrief-top-damage strong { color: var(--amber); }
.modal-debrief-value strong {
  color: var(--red);
  font-family: var(--mono);
}
.modal-debrief-composition {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.modal-debrief-composition article {
  display: grid;
  gap: 8px;
}
.modal-debrief-bar {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.modal-debrief-bar span,
.modal-debrief-bar b,
.modal-debrief-bar small {
  position: relative;
  z-index: 1;
}
.modal-debrief-bar span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}
.modal-debrief-bar b {
  font-family: var(--mono);
  color: var(--amber);
  white-space: nowrap;
}
.modal-debrief-bar small {
  grid-column: 1 / -1;
  color: var(--muted);
}
.modal-debrief-bar i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  min-width: 4%;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--cyan));
}
.modal-debrief-observations {
  margin-top: 10px;
}
.modal-debrief-observations ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--soft);
}
.modal-debrief-observations li {
  margin: 5px 0;
  line-height: 1.45;
}
.modal-debrief-caveat {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(217,164,65,.24);
  background: rgba(217,164,65,.06);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.modal-actions a,
.modal-actions button {
  min-height: 46px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  text-decoration: none;
}

.hidden { display: none !important; }
.loading {
  padding: 18px;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 18px;
  color: var(--muted);
}
.error-text { color: var(--red); }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 1fr; }
  .dossier-rail {
    position: relative;
    top: 0;
    height: auto;
    grid-template-rows: auto;
  }
  .pilot-card { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
  .view-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-dossier { grid-template-columns: 1fr; }
  .efficiency-ring { justify-self: start; width: 190px; height: 190px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scorecard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loss-review-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 12px, 1500px); padding-top: 8px; }
  .dossier-rail,
  .panel { border-radius: 22px; }
  .pilot-card { grid-template-columns: 112px 1fr; }
  .pilot-card h1 { font-size: 32px; }
  .pilot-search div,
  .view-tabs,
  .metrics-grid,
  .highlight-grid,
  .scorecard-grid,
  .loss-review-summary,
  .modal-grid,
  .modal-debrief-grid,
  .modal-debrief-composition { grid-template-columns: 1fr; }
  .hero-dossier { padding: 20px; }
  .hero-copy h2 { font-size: clamp(24px, 7vw, 34px); }
  .hero-copy p:not(.eyebrow) { font-size: 15px; }
  .feed-head { display: grid; }
  .feed-filters { justify-content: flex-start; }
  .feed-row { grid-template-columns: 1fr; }
  .ship-row { grid-template-columns: 1fr; }
  .hotspot-row header { display: grid; }
  .feed-ship-thumb { width: 76px; }
  .feed-isk { white-space: normal; }
}

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


/* Workbench × zKill fit matcher */
.fits-workbench {
  display: grid;
  gap: 16px;
}
.fit-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.fit-rules span,
.fit-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--soft);
  background: rgba(255,255,255,.045);
  font-size: 12px;
}
.fit-ship-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.fit-ship-tabs button {
  min-height: 72px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(2,6,23,.55);
  cursor: pointer;
  padding: 12px;
}
.fit-ship-tabs button.active {
  border-color: rgba(34,211,238,.65);
  background: linear-gradient(135deg, rgba(34,211,238,.16), rgba(59,130,246,.1));
  box-shadow: 0 0 0 1px rgba(34,211,238,.12), 0 18px 50px rgba(34,211,238,.08);
}
.fit-ship-tabs strong,
.fit-ship-tabs small { display: block; }
.fit-ship-tabs small { color: var(--muted); margin-top: 4px; line-height: 1.35; }
.fit-board { display: grid; gap: 16px; }
.fit-ship-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 18px;
}
.fit-ship-summary h3 { margin: 0; font-size: clamp(30px, 4vw, 56px); letter-spacing: -.06em; }
.fit-ship-summary p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.fit-ship-summary img { width: 150px; max-width: 100%; justify-self: end; filter: drop-shadow(0 24px 45px rgba(0,0,0,.45)); }
.fit-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.fit-card {
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.fit-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--amber);
}
.fit-card.good::before { background: var(--green); }
.fit-card.warn::before { background: var(--amber); }
.fit-card.risk::before { background: var(--red); }
.fit-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.fit-card h4 { margin: 0; font-size: 23px; line-height: 1.05; letter-spacing: -.035em; }
.fit-card header span { display: block; margin-top: 6px; color: var(--muted); }
.fit-card header b {
  min-width: 92px;
  min-height: 72px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(0,0,0,.24);
  font: 900 24px/1 var(--mono);
}
.fit-card header b small {
  display: block;
  color: var(--muted);
  font: 700 8px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fit-card header b em {
  display: block;
  max-width: 82px;
  color: var(--soft);
  font: 700 10px/1.15 var(--sans);
  text-align: center;
}
.fit-score-bars { display: grid; gap: 8px; }
.fit-score-bars div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 700 11px/1.2 var(--mono);
  text-transform: uppercase;
}
.fit-score-bars i {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green));
  box-shadow: 0 0 22px rgba(34,197,94,.14);
}
.fit-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.fit-facts div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 10px;
  background: rgba(255,255,255,.035);
}
.fit-facts dt { color: var(--muted); font: 700 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.fit-facts dd { margin: 5px 0 0; color: var(--soft); }
.fit-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fit-reasons { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.45; }
.fit-eft summary { cursor: pointer; color: var(--cyan); font-weight: 800; }
.fit-eft pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #020617;
  color: #dce9f8;
  font: 12px/1.45 var(--mono);
}
.fit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fit-actions a,
.fit-actions button {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(59,130,246,.12);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
}
.fit-actions button.primary {
  border-color: rgba(34,197,94,.48);
  background: linear-gradient(135deg, rgba(34,197,94,.24), rgba(34,211,238,.10));
  color: #f8fff9;
}
@media (max-width: 760px) {
  .fit-ship-summary { grid-template-columns: 1fr; }
  .fit-ship-summary img { justify-self: start; width: 120px; }
  .fit-facts { grid-template-columns: 1fr; }
}

/* No pilot chosen yet: only the prompt is shown, the dossier panels wait. */
.empty-state {
  padding: 28px;
  display: grid;
  gap: 10px;
  max-width: 640px;
}
.empty-state h2 { margin: 0; }
.empty-state p { margin: 0; color: var(--muted); line-height: 1.5; }
.no-pilot [data-view-panel] { display: none; }

/* Doctrine cards reuse the fit-card frame; only the hull render and status tint are new. */
.doctrine-card header { align-items: flex-start; }
.doctrine-hull { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; background: var(--bg-2); }
.doctrine-notes { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }
.doctrine-evidence { margin: 8px 0 0; font-size: 0.92rem; color: var(--muted); }
.doctrine-card.example { opacity: 0.8; border-style: dashed; }
.doctrine-card.draft { border-style: dotted; }

/* Subject switcher and the corporation view. */
.mode-toggle { display: flex; gap: 12px; margin-bottom: 8px; font-size: 0.9rem; color: var(--muted); }
.mode-toggle label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.link-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline dotted; cursor: pointer; }
.pilot-list { display: grid; gap: 6px; }
.pilot-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); text-align: left; border-radius: 10px; cursor: pointer; }
.pilot-row img { width: 32px; height: 32px; border-radius: 8px; }
.pilot-row span { display: grid; }
.pilot-row small { color: var(--muted); }
.pilot-row b { font-variant-numeric: tabular-nums; }
.pilot-row:hover { border-color: var(--accent, #6cf); }

/* ==========================================================================
   Redesign 2026-09-06: compact rail, content-first main, phone layout.
   Overrides live at the end of the file and use the original selectors so
   the cascade, not specificity tricks, decides.
   ========================================================================== */

/* The empty-state prompt honours the hidden attribute again. */
.empty-state[hidden] { display: none; }

/* --- Rail: fits a 577 px tall window with every tab visible ------------- */
.dossier-rail {
  top: 12px;
  height: auto;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
}
.pilot-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.portrait-frame { padding: 3px; border-radius: 16px; }
.portrait-frame::after { inset: 4px; border-radius: 13px; }
.portrait-frame img { border-radius: 12px; }
.pilot-card figcaption { min-width: 0; }
.pilot-card .eyebrow { font-size: 10px; }
.pilot-card h1 {
  margin: 2px 0;
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.pilot-card p:not(.eyebrow) { font-size: 13px; line-height: 1.35; }

.pilot-search { gap: 6px; padding: 10px; border-radius: 14px; }
.pilot-search label { font-size: 12px; }
.pilot-search input,
.pilot-search button { min-height: 38px; border-radius: 10px; }
.pilot-search small { font-size: 11px; line-height: 1.35; }
.refresh-button { min-height: 32px; padding: 0 10px; font-size: 11px; }

/* Mode switch as a segmented control; the native radios stay for a11y. */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(2, 6, 23, .5);
}
.mode-toggle label {
  position: relative;
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.mode-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.mode-toggle label:has(input:checked) {
  color: var(--text);
  background: linear-gradient(135deg, rgba(239,68,68,.22), rgba(59,130,246,.14));
}
.mode-toggle label:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 1px; }

.view-tabs { gap: 6px; }
.view-tabs button {
  min-height: 40px;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 14px;
}
.view-tabs button span { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.rail-footer { font-size: 10px; }

/* --- Main: smaller hero, one summary, tighter metrics ------------------- */
.hero-dossier {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 24px;
}
.hero-copy h2 { margin: 4px 0 6px; font-size: clamp(22px, 2.2vw, 30px); }
.hero-copy p:not(.eyebrow) { font-size: 15px; line-height: 1.5; }
.combat-tags { margin-top: 12px; gap: 6px; }
.combat-tags span { padding: 6px 9px; }
.efficiency-ring { width: 150px; height: 150px; }
.efficiency-ring div { width: 100px; height: 100px; }
.efficiency-ring strong { font-size: 24px; }
.efficiency-ring span { font-size: 11px; max-width: 84px; }
.metric { min-height: 0; padding: 14px 16px; border-radius: 20px; }
.metric strong { margin: 8px 0 4px; font-size: clamp(24px, 2.4vw, 36px); }
.combat-main { gap: 14px; }
#main { scroll-margin-top: 56px; }

/* --- Tablet: rail on top, tabs in two rows ------------------------------ */
@media (max-width: 1120px) {
  .dossier-rail { max-height: none; overflow: visible; }
  .pilot-card { grid-template-columns: 64px minmax(0, 1fr); }
  .view-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Phone: short header, sticky one-row tabs, content right after ------ */
@media (max-width: 720px) {
  .app-shell { padding-top: 6px; }
  .dossier-rail { padding: 10px; gap: 8px; border-radius: 16px; }
  .rail-topline { font-size: 10px; }
  .pilot-card { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; }
  .pilot-card .eyebrow { display: none; }
  .pilot-card h1 { font-size: 19px; }
  .pilot-card p:not(.eyebrow) { font-size: 12px; }
  .pilot-search { padding: 8px; }
  .pilot-search label { display: none; }
  .pilot-search div { grid-template-columns: 1fr auto; }
  .pilot-search small { display: none; }
  .refresh-button { min-height: 30px; }
  .view-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    margin: 0 -10px;
    padding: 6px 10px;
    background: var(--panel);
    scrollbar-width: none;
  }
  .view-tabs::-webkit-scrollbar { display: none; }
  .view-tabs button { flex: 0 0 auto; min-height: 34px; padding: 5px 11px; white-space: nowrap; font-size: 13px; }
  .view-tabs button span { display: none; }
  .view-tabs button:hover,
  .view-tabs button.active { transform: none; }
  .rail-footer { display: none; }
  .hero-dossier { padding: 16px; gap: 12px; }
  .hero-copy h2 { font-size: 22px; }
  .hero-copy p:not(.eyebrow) { font-size: 14px; }
  .efficiency-ring { width: 120px; height: 120px; }
  .efficiency-ring div { width: 80px; height: 80px; }
  .efficiency-ring strong { font-size: 20px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 12px; }
  .metric strong { font-size: 24px; }
  .combat-main { gap: 10px; }
}

/* --- Short desktop windows: trim what the rail does not need ------------ */
@media (max-height: 640px) and (min-width: 721px) {
  .dossier-rail { gap: 8px; padding: 12px; }
  .pilot-search small { display: none; }
  .view-tabs button { min-height: 34px; }
}

/* Tabs that belong to the other mode stay hidden despite the flex display. */
.view-tabs button[hidden] { display: none; }

/* Phone hero: one column, the ring sits under the text instead of squeezing it. */
@media (max-width: 720px) {
  .hero-dossier { grid-template-columns: 1fr; }
  .efficiency-ring { justify-self: start; width: 96px; height: 96px; }
  .efficiency-ring div { width: 64px; height: 64px; }
  .efficiency-ring strong { font-size: 16px; }
  .efficiency-ring span { display: none; }
  .combat-tags { margin-top: 8px; }
  .combat-tags span { padding: 4px 7px; font-size: 9px; }
}

/* ===== Corporation analytics: battles, threat board, activity heatmap ===== */

.battle-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.battle-row {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}

.battle-row[data-outcome="win"] { border-left-color: var(--green); }
.battle-row[data-outcome="loss"] { border-left-color: var(--red); }
.battle-row[data-outcome="trade"] { border-left-color: var(--amber); }

.battle-row header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.battle-row header strong {
  font-family: var(--display);
  font-size: 15px;
}

.battle-row header small {
  color: var(--eyebrow);
  font-family: var(--mono);
  font-size: 11px;
  margin-left: auto;
}

.battle-verdict {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.battle-row[data-outcome="win"] .battle-verdict { color: var(--green); border-color: rgba(63, 174, 114, .5); }
.battle-row[data-outcome="loss"] .battle-verdict { color: var(--red); border-color: rgba(224, 87, 95, .5); }
.battle-row[data-outcome="trade"] .battle-verdict { color: var(--amber); border-color: rgba(217, 164, 65, .5); }

.battle-score {
  margin: 8px 0 6px;
  font-size: 13px;
  color: var(--soft);
}

.battle-score b { color: var(--text); }

.battle-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.battle-meta + .battle-meta { margin-top: 5px; }

.battle-meta span {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.battle-foes span { background: rgba(224, 87, 95, 0.12); }

.threat-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.threat-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.02);
}

.threat-row:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }

.threat-row img { width: 34px; height: 34px; border-radius: 6px; }

.threat-main { display: grid; gap: 2px; min-width: 0; }
.threat-main strong { font-size: 13.5px; }
.threat-main small { color: var(--eyebrow); font-size: 11px; }

.threat-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }

.threat-chips span {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(77, 127, 214, 0.15);
  color: var(--soft);
}

.threat-row > b {
  display: grid;
  justify-items: end;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
  color: var(--red);
}

.threat-row > b small {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--eyebrow);
  margin-top: 3px;
}

.heatmap {
  display: grid;
  grid-template-columns: 22px repeat(24, 1fr);
  gap: 2px;
  margin-top: 12px;
  align-items: center;
}

.heat-corner { height: 10px; }

.heat-hour {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--eyebrow);
  text-align: center;
  height: 10px;
  line-height: 10px;
}

.heat-day {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--eyebrow);
  text-align: right;
  padding-right: 4px;
}

.heat-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.heat-cell[data-level="1"] { background: rgba(77, 127, 214, 0.35); }
.heat-cell[data-level="2"] { background: rgba(92, 179, 198, 0.55); }
.heat-cell[data-level="3"] { background: rgba(217, 164, 65, 0.75); }
.heat-cell[data-level="4"] { background: rgba(224, 87, 95, 0.9); }

@media (max-width: 700px) {
  .heatmap { grid-template-columns: 18px repeat(24, 1fr); gap: 1px; }
  .battle-row header small { margin-left: 0; width: 100%; }
}

/* ===== Layout fixes 2026-09-07: no stretched panels, phone toggle, portraits ===== */

/* A 40-row list must not stretch its neighbour into an empty column. */
.two-col { align-items: start; }

/* The rule above hides the "Имя" caption on phones; it must not take the
   segmented mode switch with it, which is built from labels too. */
@media (max-width: 720px) {
  .pilot-search .mode-toggle label { display: block; }
  .pilot-search .mode-toggle { margin-bottom: 8px; }
}

/* Phone hero: ring beside the text, not floating under it. */
@media (max-width: 720px) {
  .hero-dossier { grid-template-columns: minmax(0, 1fr) 96px; align-items: center; }
  .efficiency-ring { justify-self: end; }
  .corp-hero .combat-tags { grid-column: 1 / -1; }
}

/* Collapsed rows and the "show more" control. */
.pilot-row[hidden],
.battle-row[hidden] { display: none; }

.show-more {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--soft);
  font: 600 12px var(--sans);
  cursor: pointer;
}
.show-more:hover { border-style: solid; background: rgba(255, 255, 255, 0.04); }
.show-more[hidden] { display: none; }

/* A portrait that failed to load shows a neutral tile, not a hole. */
.pilot-row img { background: linear-gradient(135deg, rgba(77,127,214,.25), rgba(92,179,198,.15)); object-fit: cover; }
.pilot-row img.is-missing { visibility: visible; }
