/* ============================================================
   EMPIRE SCREEN
   ============================================================ */

.empire-overview {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
}

/* ─── Stats Grid (resource-card style) ────────────────── */
.empire-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
  padding: 0 12px;
}

/* F2a: compact stat chip row (Flota · Líderes · Reputación) */
.empire-stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 12px;
}
.empire-access-chips-wrap {
  position: relative;
}
.empire-access-chips-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, rgba(13, 13, 31, 0.9));
  pointer-events: none;
  z-index: 1;
}
.empire-access-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.empire-access-chips::-webkit-scrollbar {
  display: none;
}
.empire-access-chips .estat-chip {
  flex: 0 0 auto;
}
.estat-chip {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 4px 7px;
  background: linear-gradient(180deg, rgba(20, 20, 40, 0.9), rgba(10, 10, 24, 0.9));
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 6px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 0;
}
.estat-chip:hover { border-color: rgba(var(--accent-rgb), 0.45); }
.estat-chip .icon { width: 14px !important; height: 14px !important; }
.estat-chip .ec-l {
  font-size: 11.5px;
  white-space: nowrap;
}
.estat-chip .ec-v {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.estat-chip .ec-s {
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
@media (max-width: 359px) {
  .estat-chip .ec-s { display: none; }
}
.empire-res-card[data-empire-stat="credits"] {
  --res-glow-rgb: 16, 185, 129;
  background-image: url('../../assets/resources/credits.webp?v=5');
}
.empire-res-card[data-empire-stat="military"] {
  --res-glow-rgb: 239, 68, 68;
  background-image: url('../../assets/resources/plasma.webp?v=5');
}
.empire-res-card[data-empire-stat="leaders"] {
  --res-glow-rgb: 245, 158, 11;
  background-image: url('../../assets/resources/energy.webp');
}
.empire-res-card[data-empire-stat="reputation"] {
  --res-glow-rgb: 0, 210, 211;
  background-image: url('../../assets/resources/qbits.webp?v=5');
}

/* Leader face thumbnails in stats card */
.empire-leader-faces {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}
.empire-leader-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(245, 158, 11, 0.4);
  object-fit: cover;
}

@keyframes empire-pulse {
  0%, 100% { background: rgba(239, 68, 68, 0.05); }
  50% { background: rgba(239, 68, 68, 0.12); }
}

/* ─── Inline ops rows ─────────────────────────────────── */
.empire-ops-row td {
  padding: 0 !important;
  border-bottom: 1px solid rgba(42, 42, 74, 0.3);
}
.empire-inline-ops {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 8px 48px;
  background: rgba(6, 6, 15, 0.6);
}
.empire-inline-ops .task-card {
  padding: 5px 8px;
}
.empire-inline-ops .task-card-icon {
  width: 32px;
  min-height: 32px;
  margin: -5px 0;
}
.empire-inline-ops .task-card-actions {
  display: none;
}
.empire-inline-ops .task-card-name {
  font-size: 0.68rem;
}

/* ─── Inline per-colony planet alerts (merged Imperio view) ─────── */
.empire-planet-alert-row td {
  padding: 0 !important;
  border-bottom: 1px solid rgba(42, 42, 74, 0.3);
}
.empire-inline-alerts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 8px 48px;
  background: rgba(30, 8, 8, 0.45);
}
.empire-inline-alerts .empire-alert-card {
  min-height: 0;
  padding: 8px 12px;
  gap: 10px;
}
.empire-inline-alerts .empire-alert-icon-wrap {
  width: 26px;
  height: 26px;
}
.empire-inline-alerts .task-card-name {
  font-size: 0.74rem;
}
.empire-inline-alerts .task-card-subtitle {
  font-size: 0.66rem;
}

/* ─── Merged Imperio header (totals + empire alerts + quick panels) ── */
.empire-header-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* ─── Planets Table ───────────────────────────────────── */
.empire-table-wrap {
  padding: 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.empire-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.empire-table th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 6px;
  border-bottom: 1px solid var(--bg-divider);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.empire-table th:hover { color: var(--cyan); }
.empire-th-planet { text-align: left !important; }
.empire-th-fields { text-align: center !important; }

/* Row with planet surface background */
.empire-row {
  cursor: pointer;
  position: relative;
  background-size: cover;
  background-position: center;
}
.empire-row > td {
  position: relative;
  z-index: 1;
}
/* Overlay: image visible at ~30% opacity on left, fully hidden from 40% onward */
.empire-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6,6,15,0.7) 0%, rgba(6,6,15,0.85) 20%, rgba(6,6,15,1) 40%);
  z-index: 0;
  transition: background 0.2s;
}
.empire-row:hover::before {
  background: linear-gradient(90deg, rgba(6,6,15,0.55) 0%, rgba(6,6,15,0.75) 25%, rgba(6,6,15,0.95) 45%);
}
.empire-row.empire-current-planet {
  outline: 2px solid rgba(0, 210, 211, 0.7);
  outline-offset: -2px;
  border-radius: 3px;
  box-shadow: inset 0 0 12px rgba(0, 210, 211, 0.1), 0 0 8px rgba(0, 210, 211, 0.15);
}

/* Separator between planet groups */
.empire-separator td {
  height: 1px;
  padding: 0 !important;
  border-bottom: none;
  background: linear-gradient(90deg, transparent 0%, rgba(var(--accent-rgb), 0.15) 10%, rgba(var(--accent-rgb), 0.15) 90%, transparent 100%);
}

/* Moon rows */
.empire-moon-row {
  background-image: none !important;
}
.empire-moon-row::before {
  background: rgba(6,6,15,0.92) !important;
}
.empire-moon-row:hover::before {
  background: rgba(var(--accent-rgb), 0.06) !important;
}
.empire-moon-indent { display: none; }
.empire-moon-row .empire-tbl-img {
  width: 28px;
  height: 28px;
}
.empire-moon-badge {
  font-family: var(--font-mono);
  font-size: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text-dim);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
}

.empire-td-planet {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(42, 42, 74, 0.3);
  white-space: nowrap;
}
.empire-tbl-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}
.empire-tbl-img.empire-pcard-moon {
  border-radius: 4px;
  width: 32px;
  height: 32px;
}
.empire-tbl-info { min-width: 0; }
.empire-tbl-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 3px;
}
.empire-rename {
  cursor: pointer;
  transition: color 0.15s;
}
.empire-rename:hover {
  color: var(--cyan);
}
.empire-tbl-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.empire-export-chip {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 3px;
  color: var(--cyan);
  font: inherit;
  font-size: 0.6rem;
  padding: 0 5px;
  line-height: 1.5;
  cursor: pointer;
}
.empire-export-chip:hover {
  background: rgba(6, 182, 212, 0.18);
}

.empire-td-fields {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(42, 42, 74, 0.3);
  text-align: center;
  white-space: nowrap;
  font-size: 0.75rem;
  width: 10%;
  min-width: 88px;
}
.empire-td-res {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(42, 42, 74, 0.3);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.empire-td-storage {
  width: 10%;
  min-width: 88px;
}
.empire-storage-pct {
  font-size: 0.88rem;
  color: var(--text-primary);
}
.empire-storage-bar {
  width: 100%;
  max-width: 76px;
  height: 5px;
  margin: 6px auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.empire-storage-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.95), rgba(34, 211, 238, 0.95));
}
.empire-storage-fill.is-high {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.96), rgba(249, 115, 22, 0.96));
}
.empire-res-rate {
  font-size: 0.55rem;
  color: var(--text-dim);
  margin-top: 1px;
}
.empire-energy-ok { color: var(--green); }
.empire-energy-warn { color: var(--red); }

/* Mobile-only resource icon (hidden on desktop) */
.empire-mob-icon { display: none; }

/* Units cell (ships, defenses) */
.empire-td-units {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(42, 42, 74, 0.3);
  text-align: center;
  min-width: 60px;
}
.empire-unit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  align-items: center;
}
.empire-unit {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}
.empire-unit img {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
}
.empire-leader {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #f59e0b;
}
.empire-leader img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #f59e0b;
  object-fit: cover;
}

/* Mobile-only consolidated assets cell - hidden on desktop (table-layout) */
.empire-td-assets { display: none; }

/* Mobile-only net-balance cells (credits/energy/qbits/happiness). On desktop
   the table keeps its 6 columns; these surface only in the mobile colony grid. */
.empire-td-balance { display: none; }

/* Metric cells open the per-resource balance window for their colony. */
.empire-cell-metric { cursor: pointer; transition: background 0.15s; }
.empire-cell-metric:hover { background: rgba(255, 255, 255, 0.06); }


/* Status badges */
.empire-planet-status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.empire-status-idle     { background: rgba(var(--accent-rgb), 0.06); color: var(--text-dim); }
.empire-status-building { background: rgba(245, 158, 11, 0.12); color: var(--amber); }
.empire-status-attack   { background: rgba(239, 68, 68, 0.15); color: var(--red); animation: empire-pulse 1.5s ease-in-out infinite; }
.empire-status-training { background: rgba(var(--accent-rgb), 0.1); color: var(--cyan); }

/* ─── Empire Navigation + Panes ───────────────────────── */

#empire-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 0;
}

.empire-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}

.empire-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Divider between merged sections in Ciencia/Flotas panes */
.empire-ciencia-divider {
  height: 1px;
  margin: 20px 0;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.2), transparent);
}

/* Consolidated sub-tab toggle (Comercio: trade/routes, Militar: ships/defense) */
.consolidated-toggle {
  display: flex;
  gap: 4px;
  padding: 8px var(--panel-padding) 4px;
  justify-content: center;
  margin-right: calc(var(--panel-padding) * -1);
  position: sticky;
  top: calc(var(--sticky-tabs-h, var(--sticky-header-h, 0px)) + var(--sticky-resources-h, 0px));
  z-index: 19;
  background: var(--bg-void);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.08);
}
.consolidated-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 4px;
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.consolidated-toggle-btn:hover {
  color: var(--text-secondary);
  background: rgba(var(--accent-rgb), 0.06);
}
.consolidated-toggle-btn.active {
  color: var(--cyan);
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.empire-section .section-header,
.empire-pane-copy,
.empire-alert-grid,
.empire-network-grid,
.empire-research-grid,
.empire-embedded-panel {
  padding: 0 12px;
}

.empire-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* F2a: section headings drop the giant h2 scale on mobile - same voice as
   the AMENAZAS/ALERTAS titles, room goes to the content */
.empire-section .section-header h2 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0;
}
.empire-section .section-header.section-header-end {
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.empire-pane-copy {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.empire-command-hero {
  position: relative;
  min-height: 188px;
  margin: 0 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.12), transparent 42%),
    linear-gradient(135deg, rgba(7, 12, 24, 0.25), rgba(3, 7, 18, 0.35));
  background-size: 120% auto;
  background-position: center;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 22px 50px rgba(0, 0, 0, 0.25);
}

.empire-command-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(5, 8, 20, 0.15);
}

/* Star type color tint for hero banner (matches planet-surface LUT) */
.empire-command-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: color;
  opacity: 0;
}
.empire-command-hero.star-red_dwarf::after    { background: #cc4422; opacity: 0.45; }
.empire-command-hero.star-red_dwarf           { filter: brightness(0.72) saturate(0.8); }
.empire-command-hero.star-orange_giant::after  { background: #ff8833; opacity: 0.35; }
.empire-command-hero.star-orange_giant         { filter: brightness(1.05) saturate(0.9); }
.empire-command-hero.star-blue_giant::after    { background: #4488ff; opacity: 0.4; }
.empire-command-hero.star-blue_giant           { filter: brightness(1.15) saturate(0.8); }
.empire-command-hero.star-red_giant::after     { background: #cc2200; opacity: 0.5; }
.empire-command-hero.star-red_giant            { filter: brightness(0.78) saturate(0.7); }
.empire-command-hero.star-white_dwarf::after   { background: #aabbff; opacity: 0.4; }
.empire-command-hero.star-white_dwarf          { filter: brightness(0.62) saturate(0.65) contrast(1.1); }
.empire-command-hero.star-brown_dwarf::after   { background: #664422; opacity: 0.55; }
.empire-command-hero.star-brown_dwarf          { filter: brightness(0.42) saturate(0.55); }
.empire-command-hero.star-neutron_star::after  { background: #6688ff; opacity: 0.45; }
.empire-command-hero.star-neutron_star         { filter: brightness(0.68) saturate(0.7) contrast(1.15); }
.empire-command-hero.star-black_hole::after    { background: #8844ff; opacity: 0.55; }
.empire-command-hero.star-black_hole           { filter: brightness(0.32) saturate(0.45) contrast(1.2); }

.empire-command-hero-research::before {
  background:
    linear-gradient(120deg, rgba(3, 10, 18, 0.14), rgba(5, 10, 24, 0.88) 52%, rgba(1, 6, 18, 0.98)),
    radial-gradient(circle at 18% 18%, rgba(34, 211, 238, 0.16), transparent 34%);
}

.empire-command-hero-research {
  min-height: 154px;
}

.empire-command-hero-overview {
  min-height: 164px;
}

/* GPU-accelerated pan/zoom background layer - avoids layout/paint thrashing on Safari/iOS */
.empire-hero-bg {
  position: absolute;
  inset: -15%;
  background-size: cover;
  background-position: center;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.empire-command-hero-overview .empire-command-overlay {
  justify-content: flex-start;
  min-height: 164px;
  padding-top: 18px;
  padding-bottom: 16px;
}

.empire-command-hero-overview .empire-command-kicker,
.empire-command-hero-overview .empire-command-title,
.empire-command-hero-overview .empire-command-meta {
  background: rgba(3, 8, 20, 0.65);
  padding: 2px 10px;
  border-radius: 4px;
  width: fit-content;
}

.empire-command-hero-research .empire-command-overlay {
  justify-content: flex-start;
  min-height: 154px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.empire-command-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-height: 188px;
  padding: 18px;
  max-width: 640px;
}

.empire-command-kicker,
.empire-summary-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.empire-command-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  line-height: 1.08;
  color: var(--text-primary);
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.28);
}

.empire-command-meta {
  font-size: 0.82rem;
  color: rgba(230, 244, 255, 0.8);
}

.empire-command-tags,
.empire-summary-tags,
.empire-network-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.empire-inline-tag,
.empire-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(6, 17, 30, 0.72);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.empire-inline-tag.muted {
  opacity: 0.8;
}

.empire-inline-tag.is-capital {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.25);
  color: #ffd07f;
}

.empire-inline-tag.is-research {
  border-color: rgba(34, 211, 238, 0.34);
  background: rgba(34, 211, 238, 0.12);
  color: #b8fbff;
}

.empire-role-badge {
  margin-left: 4px;
}

.empire-role-research {
  border-color: rgba(34, 211, 238, 0.34);
  background: rgba(34, 211, 238, 0.12);
  color: #b8fbff;
}

.empire-role-military {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.12);
  color: #ffb8b8;
}

.empire-role-trade {
  border-color: rgba(16, 185, 129, 0.34);
  background: rgba(16, 185, 129, 0.12);
  color: #baf6dc;
}

.empire-role-energy {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.12);
  color: #ffdca6;
}

.empire-role-economy {
  border-color: rgba(99, 102, 241, 0.34);
  background: rgba(99, 102, 241, 0.12);
  color: #cbcfff;
}

.empire-role-frontier {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.1);
  color: #d7dee8;
}

/* Real colony designations (F1): brighter than the heuristic roles */
.empire-role-desig-mining {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.16);
  color: #ffdca6;
}

.empire-role-desig-refinery {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.16);
  color: #bfdcff;
}

.empire-role-desig-commerce {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.16);
  color: #baf6dc;
}

.empire-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 12px;
}

.empire-summary-grid-research {
  grid-template-columns: 1fr 1fr;
}
.empire-summary-grid-research > .empire-summary-panel-lab,
.empire-summary-grid-research > .empire-ip-card {
  min-height: 0;
}

.empire-summary-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    linear-gradient(135deg, rgba(6, 10, 22, 0.92), rgba(4, 8, 18, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.empire-summary-panel > * {
  position: relative;
  z-index: 1;
}

.empire-capital-planet {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0.85;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.2));
}

@media (max-width: 600px) {
  .empire-capital-planet {
    width: 56px;
    height: 56px;
    top: -6px;
    right: -6px;
  }
}

.empire-summary-panel-hero {
  min-height: 176px;
  background-size: cover;
  background-position: center;
  border-color: rgba(34, 211, 238, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 36px rgba(0, 0, 0, 0.18);
}
.empire-summary-panel-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(1, 6, 18, 0.98), rgba(5, 10, 24, 0.84) 52%, rgba(3, 10, 18, 0.18)),
    radial-gradient(circle at 80% 18%, rgba(34, 211, 238, 0.18), transparent 34%);
}

.empire-summary-panel-lab {
  min-height: 0;
  text-align: left;
  position: relative;
}

.empire-lab-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.empire-lab-globe {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.35));
}

.empire-lab-text {
  text-align: left;
}

.empire-lab-level {
  font-size: 1rem;
  color: rgba(230, 244, 255, 0.65);
  margin-top: 0.1rem;
}

.empire-summary-panel-lab .empire-summary-value {
  font-size: 1.4rem;
}

.empire-summary-panel-lab .empire-summary-label {
  font-size: 0.75rem;
}

.empire-summary-panel-lab .empire-summary-note {
  font-size: 0.85rem;
  color: rgba(230, 244, 255, 0.55);
}

/* IP card (separate panel in research pane) */
.empire-ip-card {
  --res-glow-rgb: 245, 158, 11;
  background-image: url('../../assets/resources/qbits.webp?v=5');
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 280px;
  flex-shrink: 0;
}
.empire-ip-card .res-label {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  color: var(--text-primary);
}
.empire-ip-card .res-label .icon {
  color: rgba(139, 92, 246, 0.9);
}
.empire-ip-card .res-amount {
  font-size: 1.5rem;
  color: var(--text-primary);
}
.empire-ip-card .empire-ip-of {
  font-size: 0.85rem;
  opacity: 0.5;
}
.empire-ip-card .res-rate {
  color: var(--text-dim);
}
.empire-ip-card .empire-ip-bar {
  width: 100%;
  max-width: 100%;
}
button.empire-ip-card {
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.2s, box-shadow 0.2s;
}
button.empire-ip-card:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.15);
}
button.empire-ip-card:active {
  transform: scale(0.98);
}
.empire-ip-card .empire-ip-live-data {
  display: none;
}
.empire-lab-idle-status {
  text-align: center;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(180, 220, 255, 0.9);
  text-shadow: 0 0 10px rgba(140, 200, 255, 0.5), 0 0 20px rgba(100, 180, 255, 0.25);
  padding: 0.6rem 0.5rem;
  animation: idle-glow 2.5s ease-in-out infinite;
}
.empire-lab-need-lab,
.innov-need-lab {
  color: rgba(239, 68, 68, 0.9);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.4), 0 0 20px rgba(239, 68, 68, 0.2);
}
.innov-need-lab {
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 8px 0;
}
.empire-lab-idle-hint {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(140, 180, 220, 0.6);
  text-shadow: none;
  margin-top: 0.25rem;
}
@keyframes idle-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(140, 200, 255, 0.4), 0 0 16px rgba(100, 180, 255, 0.15); }
  50% { text-shadow: 0 0 14px rgba(180, 220, 255, 0.7), 0 0 28px rgba(100, 180, 255, 0.35); }
}

.empire-summary-panel button,
.empire-summary-panel[data-empire-tab] {
  cursor: pointer;
}

.empire-summary-value {
  font-size: 1.02rem;
  line-height: 1.2;
  color: var(--text-primary);
}

.empire-summary-progress {
  margin-top: 6px;
}

.empire-summary-progress .progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.empire-research-idle {
  color: rgba(139, 92, 246, 0.55) !important;
  font-style: italic;
}

.empire-summary-science.is-active {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.1);
  animation: empire-research-pulse 3s ease-in-out infinite;
}
@keyframes empire-research-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(139, 92, 246, 0.08); }
  50% { box-shadow: 0 0 22px rgba(139, 92, 246, 0.18); }
}
.empire-summary-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.empire-summary-capital .empire-summary-meta {
  min-height: 1.15em;
}

.empire-summary-note {
  margin-top: auto;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-dim);
}

/* Science Nexus labs tab: how labs + nexus accelerate research */
.empire-research-speed-panel {
  min-height: 0;
  gap: 6px;
}
.empire-research-speed-headline {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(196, 181, 253, 1);
}
.empire-research-speed-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.empire-research-speed-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}
.empire-research-speed-row strong {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  font-weight: 600;
}
.empire-research-speed-row.is-total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}
.empire-research-speed-row.is-total span,
.empire-research-speed-row.is-total strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Megaproject requirements summary cell: tappable, reflects the same
   requirements array the build button reads. Green when satisfied,
   amber/red when missing. */
.empire-megaproject-reqs-summary.is-met {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.06);
}
.empire-megaproject-reqs-summary.is-met .empire-summary-value {
  color: #22c55e;
}
.empire-megaproject-reqs-summary.is-blocked {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.06);
}
.empire-megaproject-reqs-summary.is-blocked .empire-summary-value {
  color: #ef4444;
}
.empire-megaproject-reqs-summary[data-megaproject-reqs-detail] {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.empire-megaproject-reqs-summary[data-megaproject-reqs-detail]:hover,
.empire-megaproject-reqs-summary[data-megaproject-reqs-detail]:focus-visible {
  transform: translateY(-1px);
}
.empire-megaproject-reqs-summary[data-megaproject-reqs-detail]:focus-visible {
  outline: 2px solid var(--accent, #00f0ff);
  outline-offset: 2px;
}

/* Requirements detail modal list */
.empire-req-list .empire-req-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}
.empire-req-list .empire-req-row.is-met {
  background: rgba(34, 197, 94, 0.08);
  color: var(--text-secondary);
}
.empire-req-list .empire-req-row.is-missing {
  background: rgba(239, 68, 68, 0.1);
  color: var(--text);
}
.empire-req-list .empire-req-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}
.empire-req-list .empire-req-row.is-met .empire-req-icon {
  background: rgba(34, 197, 94, 0.25);
  color: #22c55e;
}
.empire-req-list .empire-req-row.is-missing .empire-req-icon {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.empire-alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.empire-alert-card {
  display: flex;
  align-items: center;
  min-height: 86px;
  padding: 18px 20px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.05), rgba(8, 12, 24, 0.92)),
    rgba(8, 12, 24, 0.9);
  border-left-width: 3px;
  gap: 14px;
}

.empire-alert-icon-wrap {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.empire-alert-icon {
  width: 20px;
  height: 20px;
  color: var(--text-dim);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empire-alert-icon--fill {
  fill: currentColor;
  stroke: none;
}

.empire-alert-capital .empire-alert-icon { color: #f59e0b; }
.empire-alert-capital .empire-alert-icon-wrap { background: rgba(245, 158, 11, 0.14); }
.empire-alert-research .empire-alert-icon { color: #c084fc; }
.empire-alert-research .empire-alert-icon-wrap { background: rgba(168, 85, 247, 0.16); }
.empire-alert-network .empire-alert-icon { color: #22d3ee; }
.empire-alert-network .empire-alert-icon-wrap { background: rgba(6, 182, 212, 0.14); }
.empire-alert-energy .empire-alert-icon { color: #facc15; }
.empire-alert-energy .empire-alert-icon-wrap { background: rgba(250, 204, 21, 0.14); }
.empire-alert-happiness_critical .empire-alert-icon { color: #ef4444; }
.empire-alert-happiness_critical .empire-alert-icon-wrap { background: rgba(239, 68, 68, 0.16); }
.empire-alert-happiness_warning .empire-alert-icon { color: #f59e0b; }
.empire-alert-happiness_warning .empire-alert-icon-wrap { background: rgba(245, 158, 11, 0.14); }
.empire-alert-happiness_critical {
  border-color: rgba(239, 68, 68, 0.55) !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04)) !important;
  animation: empire-alert-critical-pulse 2.4s ease-in-out infinite;
}
@keyframes empire-alert-critical-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.empire-alert-happiness_warning {
  border-color: rgba(245, 158, 11, 0.45) !important;
}
.empire-alert-queue .empire-alert-icon { color: #fb923c; }
.empire-alert-queue .empire-alert-icon-wrap { background: rgba(249, 115, 22, 0.14); }
.empire-alert-storage .empire-alert-icon { color: var(--ore-color); }
.empire-alert-storage .empire-alert-icon-wrap { background: rgba(245, 158, 11, 0.14); }
.empire-alert-happiness .empire-alert-icon { color: #ef4444; }
.empire-alert-overpopulation .empire-alert-icon { color: #f472b6; }
.empire-alert-overpopulation .empire-alert-icon-wrap { background: rgba(244, 114, 182, 0.14); }

/* F2a: one-line advisory rows (replace the big alert cards) */
.empire-alert-grid { display: flex; flex-direction: column; gap: 6px; }
.empire-alert-line {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 4px 10px;
  text-align: left;
  background: rgba(8, 12, 24, 0.85);
  border: 1px solid var(--bg-divider);
  border-left: 3px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 6px;
  cursor: pointer;
  min-width: 0;
}
.empire-alert-line .empire-alert-icon-wrap {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}
.empire-alert-line .empire-alert-icon { width: 15px; height: 15px; }
.empire-alert-line .eal-title {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62%;
}
.empire-alert-line .eal-hint {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empire-alert-line .eal-go {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
}
.empire-inline-alerts .empire-alert-line { min-height: 38px; background: rgba(20, 10, 12, 0.55); }
.empire-alert-trade_route_stalled .empire-alert-icon { color: #38bdf8; }
.empire-alert-trade_route_stalled .empire-alert-icon-wrap { background: rgba(56, 189, 248, 0.14); }

.empire-alert-event-positive {
  border-color: rgba(236, 72, 153, 0.45) !important;
  background:
    linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(168, 85, 247, 0.06)),
    rgba(8, 12, 24, 0.9) !important;
}
.empire-alert-event-positive .empire-alert-icon-wrap {
  background: rgba(236, 72, 153, 0.14);
}
.empire-alert-event-positive .empire-alert-icon { color: #f472b6; }

.empire-alert-event-negative {
  border-color: rgba(239, 68, 68, 0.45) !important;
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.10), rgba(249, 115, 22, 0.05)),
    rgba(8, 12, 24, 0.9) !important;
}
.empire-alert-event-negative .empire-alert-icon-wrap {
  background: rgba(239, 68, 68, 0.12);
}
.empire-alert-event-negative .empire-alert-icon { color: #f87171; }

.empire-alert-event-neutral .empire-alert-icon { color: #06b6d4; }

.empire-alert-card .task-card-info {
  gap: 8px;
}

.empire-alert-card .task-card-name,
.empire-alert-card .task-card-subtitle {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.empire-alert-card .task-card-name {
  line-height: 1.2;
  font-size: 0.95rem;
}

.empire-alert-card .task-card-subtitle {
  line-height: 1.35;
  font-size: 0.8rem;
}

.empire-campaign-teaser {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 12px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  background:
    radial-gradient(circle at right top, rgba(245, 158, 11, 0.12), transparent 38%),
    linear-gradient(135deg, rgba(10, 12, 28, 0.92), rgba(4, 7, 19, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.empire-campaign-mission-hero {
  min-height: 188px;
  margin-bottom: 12px;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
  border-color: rgba(34, 211, 238, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 34px rgba(0, 0, 0, 0.2);
}

.empire-campaign-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.empire-campaign-hero-badge {
  position: absolute;
  top: 8px;
  right: 8px;
}

.empire-campaign-mission-hero .empire-summary-value {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  max-width: 16ch;
}

.empire-campaign-mission-hero .empire-summary-meta,
.empire-campaign-mission-hero .empire-summary-note {
  color: rgba(230, 244, 255, 0.9);
  max-width: 40ch;
}

#empire-mega-in-facilities {
  margin-top: 24px;
}

.empire-megaproject-banner,
.empire-megaproject-lock {
  padding: 18px 20px;
  margin-bottom: 0;
  background:
    linear-gradient(180deg, rgba(19, 30, 64, 0.94), rgba(8, 13, 28, 0.96)),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 42%);
  border: 1px solid rgba(34, 211, 238, 0.16);
}

.empire-megaproject-banner .empire-summary-value,
.empire-megaproject-lock .empire-summary-value {
  font-size: 1.18rem;
}

/* Locked megaproject preview grid */
.empire-megaproject-locked-grid {
  margin-top: 4px;
}
.empire-megaproject-locked-grid .building-card {
  pointer-events: none;
  opacity: 0.7;
}
.empire-megaproject-locked-reqs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--text-dim, rgba(255,255,255,0.45));
}
.empire-megaproject-locked-reqs .empire-megaproject-req {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.empire-research-grid {
  /* grid-template-columns inherited from .building-grid */
}

/* F6: fixed active-research banner + scrollable branch grid */
.empire-pane-research.empire-research-ciencia-layout {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - var(--sticky-header-h, 0px) - var(--sticky-resources-h, 0px) - 140px);
  overflow: hidden;
  gap: 0;
  padding-bottom: 0;
}
.empire-pane-research .cifixed {
  flex: none;
  padding: 0 0 6px;
}
.empire-pane-research .ciscroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(24px + env(safe-area-inset-bottom, 0px));
}
.empire-pane-research .ribanner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  background: var(--bg-panel);
  border: 1px solid color-mix(in srgb, var(--bc, #8b5cf6) 30%, var(--bg-divider));
  border-radius: 6px;
  padding: 8px 10px;
}
.empire-pane-research .ribanner.empty {
  justify-content: center;
}
.empire-pane-research .ribanner .rthumb.r48 {
  width: 48px;
  height: 48px;
  flex: none;
  object-fit: contain;
  border-radius: 6px;
  padding: 4px;
  background: rgba(var(--accent-rgb), 0.08);
}
.empire-pane-research .ribanner .binfo {
  flex: 1;
  min-width: 0;
}
.empire-pane-research .ribanner .binfo .n {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}
.empire-pane-research .ribanner .bact {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: 52%;
}
/* Research points (PI) focus chip + per-card cost row. Points flow into the
   one research in flight, so the chip names it and carries its progress. */
.pi-bank-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border: 1px solid color-mix(in srgb, #a855f7 40%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, #a855f7 10%, transparent);
  font-size: 0.92rem;
}
.pi-bank-chip .pi-bank-icon { display: inline-flex; }
.pi-bank-chip .pi-bank-amount { color: #e9d5ff; font-weight: 700; font-size: 1.05rem; }
.pi-bank-chip .pi-bank-cap-txt { font-size: 0.8rem; }
.pi-bank-chip .pi-bank-rate {
  margin-left: auto;
  color: #c084fc;
  font-size: 0.82rem;
}
.pi-bank-chip.pi-bank-cap .pi-bank-rate { color: var(--amber, #f59e0b); }
.pi-bank-chip .pi-bank-reserve { font-size: 0.78rem; }
.pi-bank-chip .pi-bank-idle { color: var(--amber, #f59e0b); font-weight: 600; font-size: 0.95rem; }
.pi-bank-chip.pi-bank-idle-state { border-style: dashed; }
.pi-bank-bar {
  display: block; width: 100%; height: 4px; margin: -2px 0 6px;
  border-radius: 2px; overflow: hidden;
  background: color-mix(in srgb, #a855f7 22%, transparent);
}
.pi-bank-bar .pi-progress-fill { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #7c3aed, #d8b4fe); }
.pi-bank-wrap .pi-bank-bar { margin-bottom: 0; }
.pi-cost-row.pi-cost-active .cost-num-cell { font-weight: 700; }
/* Queue strip: where the empire's output goes after the current research */
.research-queue-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 8px; font-size: 0.8rem;
}
.research-queue-strip .rq-label { color: #c084fc; text-transform: uppercase; letter-spacing: 0.04em; }
.research-queue-strip .rq-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, #a855f7 35%, transparent);
  background: color-mix(in srgb, #a855f7 8%, transparent);
}
.research-queue-strip .rq-empty { border-style: dashed; opacity: 0.75; }
.research-queue-strip .rq-eta { font-size: 0.74rem; }
.research-queue-strip .rq-drop {
  border: 0; background: none; cursor: pointer; padding: 0 2px;
  color: inherit; font-size: 1rem; line-height: 1;
}
/* Expandable rate: tap the chip to reveal the PI/h breakdown */
.pi-bank-wrap { margin-bottom: 6px; }
.pi-bank-wrap .pi-bank-chip { margin-bottom: 0; }
.pi-bank-chip.pi-bank-expandable { cursor: pointer; }
.pi-bank-chip.pi-bank-expandable:hover { background: color-mix(in srgb, #a855f7 16%, transparent); }
.pi-bank-caret {
  width: 0; height: 0; margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid color-mix(in srgb, #c084fc 80%, transparent);
  transition: transform 0.15s ease;
}
.pi-bank-chip[aria-expanded="true"] .pi-bank-caret { transform: rotate(180deg); }
.pi-rate-breakdown {
  margin-top: 4px;
  padding: 8px 10px 6px;
  border: 1px solid color-mix(in srgb, #a855f7 32%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, #a855f7 8%, transparent);
}
.pi-rate-breakdown[hidden] { display: none; }
.pi-bd-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: #d8b4fe; font-weight: 700; margin-bottom: 6px;
}
.pi-bd-list { list-style: none; margin: 0; padding: 0; }
.pi-bd-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; padding: 3px 0;
  border-top: 1px solid color-mix(in srgb, #a855f7 14%, transparent);
}
.pi-bd-row:first-child { border-top: 0; }
.pi-bd-label { display: flex; flex-direction: column; min-width: 0; }
.pi-bd-detail { font-size: 0.68rem; color: var(--text-secondary); }
.pi-bd-nums { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.pi-bd-effect { font-size: 0.72rem; color: var(--text-secondary); }
.pi-bd-val { font-size: 0.82rem; font-weight: 700; color: #e9d5ff; }
.pi-bd-total { border-top: 1px solid color-mix(in srgb, #a855f7 40%, transparent); margin-top: 2px; padding-top: 5px; }
.pi-bd-total .pi-bd-label { font-weight: 700; text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.03em; }
.pi-bd-total .pi-bd-val { font-size: 0.92rem; color: #f5edff; }
.pi-bd-damage .pi-bd-detail { color: var(--amber, #f59e0b); }
.pi-bd-neg { color: #f87171; }
/* Single-line footer: cost chip left, availability right. Must out-rank the
   .research-card .bld-cost grid or the cells stack one per implicit row. */
.pi-cost-row,
.building-card .bld-cost.pi-cost-row,
.research-card .bld-cost.pi-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 4px 10px;
  white-space: nowrap;
}
.pi-cost-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.pi-cost-chip.is-short { opacity: 0.8; }
.pi-cost-row .cost-icon-cell { display: inline-flex; }
.pi-cost-row .cost-num-cell { padding-right: 0; }
.pi-cost-eta {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-repair-btn { margin-top: 6px; }

.empire-research-shell {
  min-height: 100%;
}

.empire-research-shell[data-empire-focus-branch-card] {
  cursor: pointer;
}

.building-card.research-card.empire-research-shell.is-target {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.56),
    0 0 20px color-mix(in srgb, var(--card-color) 26%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--card-color) 24%, transparent);
}

.empire-research-progress-panel {
  padding-bottom: 8px;
}

.empire-research-progress-panel .bld-progress {
  margin-top: 6px;
}

/* Research-in-progress status boxes (replaces the per-branch chip ribbon) */
.empire-research-progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empire-research-progress-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.04);
}

.empire-research-progress-empty .icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--text-dim);
  fill: currentColor;
}

.empire-research-progress-empty-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.empire-research-progress-empty-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}

.empire-research-progress-empty-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.empire-research-progress-panel .bld-timer {
  padding-top: 6px;
}

.empire-research-stack {
  position: relative;
  z-index: 2;
  margin-top: auto;
}

.empire-research-card-footer {
  display: grid;
  gap: 8px;
  margin: 0 4px 4px;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(5, 10, 18, 0.78), rgba(5, 10, 18, 0.92));
}

.empire-research-card-meta {
  display: grid;
  gap: 5px;
}

.empire-research-card-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.16);
  background: rgba(34, 211, 238, 0.08);
  color: #b8fbff;
  font-family: var(--font-mono);
  font-size: max(11.5px, 0.56rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  justify-self: start;
}

.empire-research-card-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.64rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.empire-research-card-line strong {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

.empire-research-card-key {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}

.empire-research-card-line.is-alert {
  display: block;
  color: #ffb0b0;
}

.empire-research-card-footer .empire-research-actions {
  margin-top: 0;
}

.empire-research-card-footer .empire-action-btn,
.empire-research-card-footer .empire-link-btn {
  flex: 1 1 100%;
  justify-content: center;
  text-align: center;
}

.empire-research-card-footer .empire-link-btn {
  margin-left: 0;
}

.empire-research-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 244px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    linear-gradient(135deg, rgba(4, 10, 22, 0.95), rgba(5, 8, 19, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.empire-research-card.is-active {
  border-color: rgba(34, 211, 238, 0.34);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 14px 34px rgba(3, 12, 24, 0.4);
}

.empire-research-card.is-queued {
  border-color: rgba(168, 85, 247, 0.28);
}

.empire-research-card.is-target {
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.06), 0 16px 32px rgba(5, 16, 30, 0.32);
}

.empire-research-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.empire-research-title {
  font-size: 1rem;
  color: var(--text-primary);
}

.empire-research-level {
  font-size: 0.8rem;
  color: var(--cyan);
}

.empire-research-focus {
  margin-bottom: 4px;
  color: #8ee8ff;
}

.empire-research-effect {
  min-height: 38px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.empire-research-cost {
  font-size: 0.72rem;
}

.empire-research-meta,
.empire-branch-missing {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.empire-branch-missing {
  color: #ffb0b0;
}

.empire-research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.empire-action-btn,
.empire-link-btn {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.empire-action-btn:hover,
.empire-link-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.32);
  color: var(--text-primary);
}

.empire-action-btn.is-primary {
  border-color: rgba(34, 211, 238, 0.24);
  background: rgba(34, 211, 238, 0.11);
  color: #b8fbff;
}

.empire-action-btn.is-secondary {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.08);
}

.empire-action-btn.is-danger {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.1);
  color: #ffb4b4;
}

.empire-link-btn {
  margin-left: auto;
}

.empire-network-grid {
  display: grid;
  gap: 10px;
}

.empire-network-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    linear-gradient(135deg, rgba(10, 11, 24, 0.95), rgba(5, 8, 18, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.empire-network-planet {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.empire-network-thumb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  object-fit: cover;
  flex-shrink: 0;
}

.empire-network-name {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.empire-network-coords {
  font-size: 0.64rem;
  color: var(--text-dim);
}

.empire-network-status {
  justify-self: end;
  min-width: 110px;
  text-align: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.empire-network-status.is-ready {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.26);
  color: #baf6dc;
}

.empire-network-status.is-blocked {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #ffdca6;
}

.empire-embedded-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empire-embedded-panel .leaders-tab-view,
.empire-embedded-panel .missions-layout {
  padding: 0;
}

.empire-inline-link {
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.empire-inline-link:hover {
  color: #f8fafc;
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-1px);
}

.empire-mission-grid,
.empire-megaproject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 12px;
}

.empire-objectives-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 12px 12px;
}
.empire-objective-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}
.empire-objective-card.is-completed {
  opacity: 0.55;
}
.empire-objective-card.is-completed .empire-objective-title {
  text-decoration: line-through;
}
.empire-objective-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.empire-objective-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.empire-objective-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-dim);
}
.empire-objective-context {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
  font-style: italic;
}
.empire-objective-map {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--cyan);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.empire-objective-map:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--text-primary);
}
.empire-objective-map .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.empire-objective-map-label {
  font-weight: 600;
  letter-spacing: 0.04em;
}
.empire-objective-map-coords {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  padding-left: 6px;
  border-left: 1px solid rgba(var(--accent-rgb), 0.25);
}
.objective-counter,
.objective-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
}
.empire-objective-card.is-completed .objective-status { color: var(--success, #4ade80); }
.objective-parts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.objective-part-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.objective-part-counter {
  font-family: var(--font-mono);
  color: var(--text);
}
@media (max-width: 720px) {
  .empire-objectives-grid { grid-template-columns: 1fr; }
}

/* Tutorial objectives - flat 12-step list rendered on Empire overview */
.tutorial-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 14px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.tutorial-header-title { color: var(--accent); font-weight: 600; }
.tutorial-header-progress { font-family: var(--font-mono); color: var(--text); }
.tutorial-objective-card {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tutorial-objective-card:hover { border-color: var(--accent); }
.tutorial-objective-card.is-complete {
  opacity: 0.5;
}
.tutorial-objective-card.is-complete .empire-objective-title {
  text-decoration: line-through;
  color: var(--text-dim);
}
.tutorial-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 3px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}
.tutorial-check-pending { color: transparent; }
.tutorial-objective-card.is-complete .tutorial-check {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: var(--accent);
}
.tutorial-objectives-hint {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}
.tutorial-objective-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.empire-mission-card {
  position: relative;
  min-height: 124px;
}
.empire-mission-card > .card-mission-badge {
  top: 8px;
  right: 8px;
}

.empire-mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.empire-mission-leader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font: inherit;
}

.empire-mission-leader-thumb {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
}

.empire-network-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.empire-network-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(10, 16, 30, 0.88);
  border: 1px solid rgba(var(--accent-rgb), 0.1);
}

.empire-network-check.is-met {
  border-color: rgba(34, 197, 94, 0.22);
  color: #bbf7d0;
}

.empire-network-check.is-missing {
  border-color: rgba(245, 158, 11, 0.22);
  color: #ffdca6;
}

.empire-megaproject-bag {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.empire-megaproject-bag-part {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.empire-megaproject-bag-part .icon {
  color: currentColor;
  fill: currentColor;
}

.empire-megaproject-intro {
  padding-top: 0;
  padding-bottom: 8px;
}

.empire-megaproject-workbench {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  gap: var(--grid-gap);
  padding: 0 12px;
  align-items: start;
}

.empire-megaproject-grid {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: var(--grid-gap);
  align-content: start;
}

.empire-leaders-academy-meta {
  padding: 0 12px 10px;
}

.empire-leaders-academy-grid {
  align-items: start;
}

.empire-megaproject-shell {
  min-height: 100%;
  cursor: pointer;
}

.building-card.research-card.empire-megaproject-shell.is-selected {
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.58),
    0 0 24px color-mix(in srgb, var(--card-color) 24%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--card-color) 24%, transparent);
}

.empire-megaproject-system-section {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  align-items: start;
  padding: 10px;
  border-radius: 12px;
  background: rgba(10, 14, 28, 0.38);
  border: 1px solid rgba(var(--accent-rgb, 56, 189, 248), 0.14);
}

@media (max-width: 900px) {
  .empire-megaproject-system-section {
    grid-template-columns: minmax(0, 1fr);
  }
}

.empire-megaproject-system-section > .building-grid {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  gap: 0;
}

.empire-megaproject-system-section > .empire-megaproject-grid {
  grid-template-columns: minmax(0, 220px);
}

.empire-megaproject-dashboard {
  display: grid;
  gap: 12px;
}

/* Tighter summary panels inside the system section since they now share
   horizontal space with the card on the left. */
.empire-megaproject-system-section .empire-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
}

.empire-megaproject-card-footer {
  display: grid;
  gap: 8px;
}

.empire-megaproject-card-status,
.empire-megaproject-detail-status {
  justify-self: start;
}

.empire-megaproject-card-status.is-ready,
.empire-megaproject-detail-status.is-ready {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
  color: #b9fbcf;
}

.empire-megaproject-card-status.is-blocked,
.empire-megaproject-detail-status.is-blocked {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

.empire-megaproject-card-status.is-queued,
.empire-megaproject-detail-status.is-queued {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.25);
  color: #e9d5ff;
}

.empire-megaproject-card-status.is-active,
.empire-megaproject-detail-status.is-active {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.24);
  color: #b8fbff;
}

.empire-megaproject-card-status.is-blueprint,
.empire-megaproject-detail-status.is-blueprint {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.26);
  color: #fde68a;
}

.empire-megaproject-card-status.is-max,
.empire-megaproject-detail-status.is-max {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
}

.empire-megaproject-reqs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.empire-megaproject-req {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(8, 13, 26, 0.72);
  border: 1px solid rgba(var(--accent-rgb), 0.08);
  font-size: 0.72rem;
}

.empire-megaproject-req.is-met {
  border-color: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

.empire-megaproject-req.is-missing {
  border-color: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.empire-megaproject-card-actions .btn {
  width: 100%;
  justify-content: center;
}

.empire-megaproject-detail {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    linear-gradient(135deg, rgba(4, 10, 22, 0.96), rgba(5, 8, 19, 0.99));
  background-size: cover;
  background-position: center;
  border-color: color-mix(in srgb, var(--megaproject-accent, var(--cyan)) 22%, rgba(255, 255, 255, 0.05));
}

.empire-megaproject-detail::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--megaproject-accent, var(--cyan)) 22%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(6, 6, 15, 0.16) 0%, rgba(6, 6, 15, 0.78) 44%, rgba(6, 6, 15, 0.96) 100%);
  pointer-events: none;
}

.empire-megaproject-detail-overlay {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.empire-megaproject-detail-hero {
  display: grid;
  gap: 8px;
}

.empire-megaproject-detail-kicker {
  font: 600 0.72rem var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--megaproject-accent, var(--cyan)) 82%, white);
}

.empire-megaproject-detail-title {
  font-size: 1.42rem;
  line-height: 1.08;
  font-weight: 700;
  color: var(--text-primary);
}

.empire-megaproject-detail-copy {
  max-width: 64ch;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.empire-megaproject-detail-actions {
  display: flex;
  justify-content: flex-start;
}

.empire-megaproject-primary-action {
  min-width: 180px;
}

.empire-megaproject-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.empire-megaproject-detail-panel {
  padding: 12px;
  border-radius: 10px;
  background: rgba(8, 13, 26, 0.78);
  border: 1px solid color-mix(in srgb, var(--megaproject-accent, var(--cyan)) 12%, rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.empire-megaproject-detail-panel-requirements,
.empire-megaproject-detail-panel-table {
  grid-column: 1 / -1;
}

.empire-megaproject-detail-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.empire-megaproject-detail-line {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.empire-megaproject-detail-line.muted {
  color: var(--text-dim);
}

.empire-megaproject-detail-meta {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--megaproject-accent, var(--cyan)) 76%, #fff);
}

.empire-megaproject-detail-cost {
  margin-top: 8px;
  font-size: 0.72rem;
}

.empire-megaproject-table-wrap {
  overflow-x: auto;
}

.empire-megaproject-progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.empire-megaproject-progress-table th {
  padding: 8px 10px;
  text-align: left;
  font: 600 0.64rem var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.empire-megaproject-progress-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  vertical-align: top;
}

.empire-megaproject-progress-row.is-current td {
  color: var(--text-primary);
  background: rgba(34, 211, 238, 0.06);
}

.empire-megaproject-progress-row.is-next td {
  background: rgba(245, 158, 11, 0.06);
}

.empire-megaproject-progress-row.is-complete td {
  color: #b4c4d8;
}

/* ─── Mobile: transform table into cards ──────────────── */
@media (max-width: 700px) {
  .empire-stats-grid { grid-template-columns: repeat(2, 1fr); padding: 0 8px; gap: 6px; }
  .empire-pane { gap: 10px; }
  .empire-command-hero,
  .empire-command-overlay { min-height: 164px; }
  .empire-command-hero { margin: 0 8px; }
  .empire-command-overlay { padding: 14px; }
  .empire-summary-grid,
  .empire-summary-grid-research { grid-template-columns: 1fr; padding: 0 8px; gap: 8px; }
  .empire-ip-card { width: auto; }
  .empire-section .section-header,
  .empire-pane-copy,
  .empire-alert-grid,
  .empire-network-grid,
  .empire-research-grid,
  .empire-mission-grid,
  .empire-megaproject-grid,
  .empire-embedded-panel { padding: 0 8px; }
  .empire-alert-grid,
  .empire-mission-grid { grid-template-columns: 1fr; }
  .empire-megaproject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .empire-leaders-academy-meta { padding: 0 8px 10px; }
  .empire-megaproject-workbench { grid-template-columns: 1fr; padding: 0 8px; }
  .empire-megaproject-detail-overlay { padding: 14px; }
  .empire-megaproject-detail-grid { grid-template-columns: 1fr; }
  .empire-megaproject-detail-panel-requirements,
  .empire-megaproject-detail-panel-table { grid-column: auto; }
  .empire-network-row { grid-template-columns: 1fr; justify-items: start; }
  .empire-network-status { justify-self: start; }
  .empire-campaign-teaser { margin: 0 8px; }
  .empire-res-card { padding: 8px 10px 6px !important; gap: 1px !important; touch-action: manipulation; }
  .empire-res-card .res-label { padding: 1px 6px !important; }
  .empire-res-card .res-amount { font-size: 1.1rem !important; padding: 1px 6px !important; }
  .empire-res-card .res-rate { font-size: 0.65rem !important; padding: 1px 6px !important; }
  .empire-leader-thumb { width: 26px; height: 26px; touch-action: manipulation; }
  .empire-table-wrap { padding: 0 8px; overflow-x: visible; }

  /* Hide table header */
  .empire-table thead { display: none; }
  .empire-table, .empire-table tbody { display: block; width: 100%; }

  /* Keep fleet inventory table headers visible on mobile.
     IMPORTANT: tbody must remain table-row-group (not display:table) so thead
     and tbody share the same column widths. Otherwise tbody becomes its own
     table and numbers misalign under their headers. */
  .fleet-cmd-inv-table { display: table; width: 100%; font-size: 0.75rem; }
  .fleet-cmd-inv-table thead { display: table-header-group; }
  .fleet-cmd-inv-table tbody { display: table-row-group; width: auto; }
  .fleet-cmd-inv-table tr { display: table-row; }
  .fleet-cmd-inv-table th,
  .fleet-cmd-inv-table td { display: table-cell; }
  .fleet-inv-th { padding: 4px 6px; font-size: 0.65rem; position: sticky; top: 0; z-index: 1; background: var(--bg-panel, #0d0d1f); }
  .fleet-inv-ship-cell { padding: 4px 6px; }
  .fleet-inv-qty,
  .fleet-inv-total { padding: 4px 6px; }

  /* Each row becomes a card */
  .empire-row {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
    margin-bottom: 2px;
    border-radius: 2px;
    border-bottom: none;
    gap: 0;
  }
  .empire-row::before { border-radius: 2px; }

  /* Planet cell: full width at top */
  .empire-row .empire-td-planet {
    width: 100%;
    border-bottom: none;
    padding: 0 0 6px 0;
  }

  /* Colony metric grid: 4 columns x 2 rows = 8 cells.
     Row 1 = population + ore/helium/plasma storage.
     Row 2 = net credits/energy/qbits + happiness.
     Each cell takes 25% so the 8 cells wrap into exactly 4 columns / 2 rows. */
  .empire-row .empire-td-fields,
  .empire-row .empire-td-balance,
  .empire-row .empire-td-res {
    display: block;
    width: 25%;
    flex: 0 0 25%;
    box-sizing: border-box;
    border-bottom: none;
    padding: 5px 2px;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-primary);
    min-width: 0;
  }
  .empire-row .empire-td-balance { display: block; }
  .empire-td-fields .empire-storage-bar {
    max-width: none;
    margin: 6px auto 0;
  }
  .empire-storage-bar { max-width: none; }

  /* Net-balance value: sign-aware colour cue */
  .empire-balance-val {
    font-size: 0.88rem;
    font-family: var(--font-mono);
    line-height: 1.1;
    margin-top: 2px;
  }
  .empire-balance-positive { color: #22c55e; }
  .empire-balance-warn { color: #eab308; }
  .empire-balance-negative { color: #ef4444; }
  .empire-td-balance .happiness-icon { vertical-align: -2px; }

  /* Show resource icons on mobile - block above value */
  .empire-mob-icon {
    display: block;
    margin: 0 auto 1px;
    text-align: center;
  }

  /* On mobile the old cramped ships/defenses cells are hidden; the consolidated
     .empire-td-assets row below takes over (ships + defenses + leader fleets). */
  .empire-row .empire-td-units { display: none; }

  /* Consolidated assets row (ships + defenses + leader fleets) */
  .empire-row .empire-td-assets {
    display: block;
    width: 100%;
    flex-basis: 100%;
    border-bottom: none;
    padding: 6px 2px 2px;
    text-align: left;
  }
  .empire-assets-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 6px 6px;
    background: rgba(10, 12, 24, 0.45);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 6px;
  }
  .empire-assets-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .empire-assets-icon {
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    flex-shrink: 0;
  }
  .empire-assets-ships .empire-assets-icon { color: var(--cyan); }
  .empire-assets-defenses .empire-assets-icon { color: #94a3b8; }
  .empire-assets-leader-fleet {
    padding: 3px 6px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 999px;
  }
  .empire-leader-fleet-portrait {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #f59e0b;
    object-fit: cover;
    flex-shrink: 0;
  }
  .empire-leader-fleet-empty {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #f59e0b;
  }
  /* Bigger thumbnails on mobile for readability */
  .empire-unit-mob {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
    gap: 3px;
  }
  .empire-unit-mob img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
  }
  /* Desktop-only leader chip inside ships cell is irrelevant on mobile since
     .empire-td-units is hidden, but keep it safe if it leaks. */
  .empire-leader-desktop { display: none; }

  /* Larger planet name on mobile */
  .empire-tbl-name { font-size: 0.95rem; }
  .empire-tbl-meta { font-size: 11.5px; }
  .empire-td-fields .empire-storage-pct { font-size: 0.88rem; }

  /* Separator */
  .empire-separator { display: block; height: 6px; }
  .empire-separator td { display: block; height: 1px; }


  /* Ops row */
  .empire-ops-row { display: block; }
  .empire-ops-row td { display: block; }
  .empire-inline-ops { padding: 6px 8px 8px 32px; }

  /* Inline per-colony alerts */
  .empire-planet-alert-row { display: block; }
  .empire-planet-alert-row td { display: block; }
  .empire-inline-alerts { padding: 6px 8px 8px; }

  /* Research ops row */
  .empire-ops-row .empire-inline-ops { padding-left: 8px; }
  .empire-research-card-line {
    flex-direction: column;
    align-items: flex-start;
  }
  .empire-research-card-line strong {
    text-align: left;
  }
}


/* ─── Planet Overlay ──────────────────────────────────── */
.po-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, var(--scrim-60) 0%, rgba(0,0,0,0.85) 100%);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  animation: poFadeIn 0.2s ease-out;
  padding: 16px;
}
.po-overlay[hidden] { display: none !important; }

@keyframes poFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes poSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.po-box {
  width: 360px;
  max-width: 92vw;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--bg-panel, #0d0d1f);
  animation: poSlideUp 0.25s ease-out;
  box-shadow: 0 8px 40px var(--scrim-60), 0 0 60px rgba(0,0,0,0.3);
}

.po-hero {
  position: relative;
  padding: 20px 20px 16px;
  background-color: rgba(13,13,31,0.95);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: top center;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.po-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,6,15,0.3) 0%, rgba(6,6,15,0.85) 100%);
  pointer-events: none;
}


.po-img {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid rgba(0,240,255,0.25);
  box-shadow: 0 0 24px rgba(0,240,255,0.2), 0 0 48px rgba(0,240,255,0.08);
  object-fit: cover;
  margin-bottom: 10px;
}

.po-header {
  position: relative;
  z-index: 1;
}

.po-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-shadow: 0 0 16px rgba(0,240,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.po-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.po-coords {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: 0.03em;
}

.po-body {
  padding: 14px 20px;
}

.po-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 0.78rem;
}

.po-detail-label {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  padding-top: 2px;
}

.po-detail-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.po-rarity-common { color: #64748b; }
.po-rarity-uncommon { color: #22c55e; }
.po-rarity-rare { color: #3b82f6; }
.po-rarity-epic { color: #a855f7; }
.po-rarity-legendary { color: #f59e0b; }

.po-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.po-action-btn {
  flex: 1 1 calc(50% - 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.po-action-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0,240,255,0.05);
}

.po-goto-btn {
  flex: 1 1 100%;
  background: rgba(0,240,255,0.06);
  border-color: rgba(0,240,255,0.25);
  color: var(--cyan);
}
.po-goto-btn:hover {
  background: rgba(0,240,255,0.12);
}

/* ── Innovation Card System ──────────────────────────────────── */

/* IP section inside lab panel */
.empire-ip-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0 0;
}
.empire-ip-bar {
  width: 100%;
  max-width: 200px;
}
.empire-ip-stats {
  font-size: 0.65rem;
  color: #f59e0b;
  opacity: 0.8;
}
.empire-ip-tap-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(217,119,6,0.1));
  border: 1px solid rgba(245,158,11,0.4);
  color: #f59e0b;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.empire-ip-tap-box:hover {
  background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(217,119,6,0.2));
  border-color: rgba(245,158,11,0.6);
  transform: scale(1.05);
}
.empire-ip-tap-box:active {
  transform: scale(0.95);
}

/* Innovation card active state */
.innovation-card.innovation-active {
  border-color: rgba(245,158,11,0.4);
  box-shadow: 0 0 12px rgba(245,158,11,0.15);
}

/* Innovation card ready state - fire aura wrapper */
.innovation-aura-wrapper {
  position: relative;
  isolation: isolate;
}
.innovation-aura-wrapper::before,
.innovation-aura-wrapper::after,
.innovation-aura-wrapper > .innovation-aura-c {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius, 12px) + 4px);
  background: linear-gradient(60deg,
    color-mix(in srgb, var(--aura-color) 70%, transparent),
    color-mix(in srgb, var(--aura-color) 50%, transparent),
    color-mix(in srgb, var(--aura-color) 30%, transparent),
    color-mix(in srgb, var(--aura-color) 50%, transparent),
    color-mix(in srgb, var(--aura-color) 70%, transparent)
  );
  z-index: 0;
  pointer-events: none;
  will-change: opacity;
}
.innovation-aura-wrapper::before {
  filter: url(#fire-aura-a) blur(3px);
  animation: fire-xfade 0.75s ease-in-out infinite alternate;
}
.innovation-aura-wrapper::after {
  filter: url(#fire-aura-b) blur(3px);
  animation: fire-xfade 0.75s ease-in-out infinite alternate;
  animation-delay: -0.5s;
}
.innovation-aura-wrapper > .innovation-aura-c {
  filter: url(#fire-aura-c) blur(3px);
  animation: fire-xfade 0.75s ease-in-out infinite alternate;
  animation-delay: -1s;
}
.innovation-aura-wrapper > .building-card {
  position: relative;
  z-index: 1;
  border: 2px solid transparent !important;
  background-image:
    linear-gradient(var(--card-bg, #12121e), var(--card-bg, #12121e)),
    linear-gradient(135deg, var(--aura-color), color-mix(in srgb, var(--aura-color) 60%, #000), var(--aura-color));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
@keyframes fire-xfade {
  0%   { opacity: .9; }
  100% { opacity: 0; }
}
@keyframes fire-xfade-intense {
  0%   { opacity: 1; }
  100% { opacity: 0.15; }
}

/* Bonus text in innovation card */
.innovation-bonus {
  font-weight: 600;
  color: var(--text-primary);
}

/* Innovation progression table rows */
.innov-prog-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.innov-prog-thumb {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.innov-prog-thumb-click {
  cursor: pointer;
  transition: transform 0.15s;
}
.innov-prog-thumb-click:hover {
  transform: scale(1.1);
}
.innov-prog-info {
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.3;
}
.innov-prog-bonuses {
  font-size: 0.72rem;
  margin-top: 2px;
  opacity: 0.9;
}

/* Innovation image lightbox */
.innov-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}
.innov-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  max-height: 85dvh;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

/* Innovation card cost/time info */
.innovation-cost-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border-radius: 0 0 4px 4px;
  padding: 5px 10px;
  margin: 0 -6px -6px;
}
.innov-cost-ip {
  color: #34d399;
}
.innov-cost-time {
  color: #f59e0b;
}
.innovation-cost-sep {
  opacity: 0.35;
}

.innovation-cost-row {
  margin-top: 0;
  align-self: center;
}

.innovation-start-btn {
  height: 38px;
  min-height: 38px;
  padding: 6px 8px;
  flex: 0 0 auto !important;
  width: 60%;
  margin: 0 auto;
  border-radius: 3px;
  color: #bf63ff;
  border: 1px solid rgba(141, 76, 207, 0.82);
  background: linear-gradient(135deg, rgba(55, 25, 88, 0.84) 0%, rgba(6, 10, 18, 0.68) 100%);
  box-shadow: inset 0 0 0 1px rgba(141, 76, 207, 0.12);
  text-shadow: 0 0 8px rgba(141, 76, 207, 0.30);
}

.innovation-start-btn::before {
  display: none;
}

.innovation-start-btn:hover {
  transform: none;
  color: #d07aff;
  background: rgba(67, 31, 104, 0.72);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.16);
}

.innovation-start-btn.affordable {
  animation: none;
}

.research-card .innovation-start-btn .btn-label {
  font-size: 0.72rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.innov-thinking {
  animation: innov-pulse 1.5s ease-in-out infinite;
}
@keyframes innov-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Accumulated bonus display on innovation card */
.innovation-accumulated-bonus {
  padding: 6px 8px;
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: center;
  background: var(--scrim-70);
  border-radius: 6px;
  margin: 0 4px;
}
.innovation-accumulated-bonus .variant-bonus-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
}
.innovation-accumulated-bonus .variant-bonus-res {
  font-weight: 600;
  font-size: 0.72rem;
}
.innovation-accumulated-bonus .variant-bonus-other {
  font-size: 0.65rem;
  opacity: 0.85;
}
.innovation-accumulated-bonus .variant-bonus-special {
  font-size: 0.62rem;
  font-style: italic;
  opacity: 0.75;
}

/* IP tap particle animation */
.ip-particle {
  position: fixed;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--particle-color, #8b5cf6);
  pointer-events: none;
  z-index: 10000;
  opacity: 1;
  box-shadow: 0 0 4px 1px var(--particle-glow, rgba(139, 92, 246, 0.6));
  animation: ip-particle-fly var(--fly-duration, 0.6s) cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
@keyframes ip-particle-fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  70% {
    opacity: 0.9;
    transform: translate(var(--dx), var(--dy)) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.3);
  }
}

/* ── Variant Selection Modal ──────────────────────────────────── */
.variant-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.variant-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(var(--blur-lg));
  display: flex;
  align-items: center;
  justify-content: center;
}
.variant-modal-content {
  max-width: 700px;
  width: 95%;
  padding: 24px 12px;
  text-align: center;
}
.variant-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 4px;
}
.variant-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.variant-modal-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary, var(--text-secondary));
  opacity: 0.75;
  margin-bottom: 20px;
}
.variant-modal-cards {
  display: flex;
  gap: clamp(12px, 2vw, 18px);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  align-items: flex-start;
}
.variant-modal-close {
  margin-top: 0;
  position: relative;
  z-index: 5;
  padding: 8px 24px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
}
.variant-modal-close:hover {
  background: rgba(255,255,255,0.1);
}
.variant-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}
.variant-modal-discard {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}
.variant-modal-discard:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #fff;
}

/* --- 3D Flip Card System --- */
.variant-card-flipper {
  perspective: 1000px;
  width: min(30vw, 240px);
  aspect-ratio: 5/7;
  cursor: default;
  flex-shrink: 0;
  animation: variant-card-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Revealed cards open the technique detail: same affordance as collection cards. */
.variant-card-flipper.is-revealed {
  cursor: pointer;
  transition: transform 0.15s ease;
}
.variant-card-flipper.is-revealed:hover {
  transform: translateY(-3px);
}
.variant-card-flipper:nth-child(1) { animation-delay: 0.1s; }
.variant-card-flipper:nth-child(2) { animation-delay: 0.25s; }
.variant-card-flipper:nth-child(3) { animation-delay: 0.4s; }
.variant-card-flipper:nth-child(4) { animation-delay: 0.55s; }

/* Reveal flipper: plain frame (rarity in card title). */
@keyframes variant-card-enter {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.variant-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  border-radius: 8px;
}
.variant-card-inner.is-flipped {
  transform: rotateY(180deg);
}
.variant-card-face-back,
.variant-card-face-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
}

/* Card back design */
.variant-card-face-back {
  background: url('../../assets/card-back.webp') center/cover no-repeat, #0a0e1a;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.variant-card-back-logo {
  width: 60px;
  height: 60px;
  background: url('../../assets/logo.webp') center/contain no-repeat;
  opacity: 0.8;
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.8));
}
/* Variant card front layout: title top-left, level circle top-right */
.variant-revealed-card .card-title-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
}
.variant-revealed-card .card-name {
  line-height: 1.15;
}
.variant-revealed-card .card-type-badge {
  color: var(--rarity-color);
}

/* Card front: pre-rotated 180deg, backface-visibility handles show/hide during flip */
.variant-card-face-front {
  transform: rotateY(180deg);
  background: var(--bg-void, #080c18);
}
.variant-card-face-front .building-card {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  background: var(--bg-void, #080c18);
  text-align: left;
}
/* Bonus and lore text styling inside variant cards */
.variant-card-face-front .card-info-text {
  padding: 4px 8px;
}
.variant-card-face-front .card-info-benefit {
  font-size: 0.6rem;
  line-height: 1.8;
}
.variant-card-face-front .card-info-lore {
  font-size: 0.55rem;
  line-height: 1.4;
  opacity: 0.7;
  margin-top: 4px;
}
.variant-bonus-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1px 8px;
  align-items: center;
}
.variant-bonus-res {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-weight: 700;
  white-space: nowrap;
}
.variant-bonus-res .cost-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.variant-bonus-other {
  white-space: nowrap;
}
.variant-bonus-special {
  color: #f59e0b;
  font-style: italic;
}
/* Bonus help icon: small "?" button next to each bonus row. */
.bonus-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.bonus-help-icon:hover,
.bonus-help-icon:focus {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
  outline: none;
}
.bonus-help-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: 240px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.97);
  color: #e2e8f0;
  font-size: 0.72rem;
  line-height: 1.35;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  animation: bonus-help-tip-in 0.12s ease;
}
@keyframes bonus-help-tip-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Effect description on cards */
.variant-effect-list {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.variant-effect-item {
  font-size: 0.55rem;
  color: #c4b5fd;
  line-height: 1.4;
  padding: 1px 0;
}
.variant-effect-item strong {
  color: #e9d5ff;
}
.variant-effect-item .effect-cond,
.variant-effect-item .effect-event,
.variant-effect-item .effect-combo {
  color: #a78bfa;
  font-weight: 600;
}
.variant-effect-item .effect-combat {
  margin-right: 2px;
}
.variant-effect-item .effect-cap {
  color: #64748b;
  font-size: 0.5rem;
}

/* Reveal and collection previews keep their compact mobile typography, but
   desktop has enough card area to make the technique's actual payoff legible
   without opening the detail view. */
@media (min-width: 1024px) {
  .variant-revealed-card .card-name {
    font-size: 0.82rem;
  }
  .variant-card-face-front .card-info-text {
    padding: 6px 9px;
  }
  .variant-card-face-front .card-info-benefit {
    font-size: 0.76rem;
    line-height: 1.45;
  }
  .variant-card-face-front .card-info-lore {
    font-size: 0.66rem;
    line-height: 1.45;
  }
  .variant-card-face-front .variant-effect-item {
    font-size: 0.68rem;
    line-height: 1.35;
    padding: 2px 0;
  }
  .variant-card-face-front .variant-effect-item .effect-cap {
    font-size: 0.6rem;
  }
}

.variant-card-flipper {
  position: relative;
}

/* Fire aura layers inside card-inner - DISABLED (fire only on booster shelf) */
.variant-aura-a,
.variant-aura-b,
.variant-aura-c {
  opacity: 0;
  background: transparent;
  pointer-events: none;
}

/* Reveal cards are static display only: all 4 go straight to the collection,
   so no hover-zoom or select-zoom (legacy "pick 1 of 4" mechanic removed). */

/* Responsive: wrap on narrow screens */
@media (max-width: 480px) {
  .variant-modal-cards {
    flex-wrap: wrap;
  }
  .variant-card-flipper {
    width: min(42vw, 200px);
  }
}

/* ── Technique Slots ────────────────────────────────────── */
.technique-slots-section {}
.technique-slots-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(192, 132, 252, 0.18);
}
.technique-slots-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(192, 132, 252, 0.85);
  position: relative;
  padding-left: 14px;
}
.technique-slots-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) rotate(45deg);
  background: rgba(192, 132, 252, 0.85);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.7);
}
.technique-slots-count {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.85);
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.55);
}
.technique-slots-count.is-full {
  color: rgba(252, 211, 77, 0.95);
  border-color: rgba(252, 211, 77, 0.5);
  background: rgba(252, 211, 77, 0.1);
}
.technique-slots {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.technique-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 320px;
}
.technique-slot-filled {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
    rgba(15, 23, 42, 0.6);
  border: 1px solid var(--slot-color, rgba(255,255,255,0.1));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.technique-slot-filled:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 18px var(--slot-color, transparent);
}
.technique-slot-empty {
  position: relative;
  background:
    radial-gradient(70% 70% at 50% 50%, rgba(192, 132, 252, 0.06), transparent 70%),
    rgba(8, 13, 28, 0.45);
  border: 1px dashed rgba(192, 132, 252, 0.28);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 6px;
  cursor: default;
  min-height: 88px;
  overflow: hidden;
}
.technique-slot-empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(192, 132, 252, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 132, 252, 0.05) 1px, transparent 1px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000 30%, transparent 100%);
          mask-image: radial-gradient(60% 60% at 50% 50%, #000 30%, transparent 100%);
  pointer-events: none;
}
.technique-slot-empty-hex {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: rgba(192, 132, 252, 0.75);
  background: rgba(192, 132, 252, 0.06);
  border: 1px solid rgba(192, 132, 252, 0.4);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.45));
}
.technique-slot-empty-label {
  position: relative;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(192, 132, 252, 0.65);
}
.technique-slot-img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.technique-slot-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.technique-slot-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.technique-slot-branch {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}
.technique-slot-bonus {
  font-size: 0.7rem;
  margin-top: 2px;
}
.technique-slot-bonus .variant-bonus-row {
  gap: 4px;
}
.technique-slot-action {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.technique-slot-action:hover {
  opacity: 1;
  color: #ef4444;
}


/* ── Catalog Pane ───────────────────────────────────────── */
.empire-catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  padding: 4px 8px 8px;
}
.empire-catalog-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Filter strip */
.empire-catalog-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0 12px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.empire-catalog-filters::-webkit-scrollbar { display: none; }

/* Branch filters are icon toggles now: a fixed, small set that fits one row
   even at 390px (the 'all' chip keeps text + total, branches are icon-only
   with the name in tooltip/aria-label). */
.empire-catalog-filters[data-filter-row="branch"] {
  flex-wrap: nowrap;
  overflow-x: visible;
  align-items: center;
}
.empire-catalog-filter-btn.catalog-filter-iconbtn {
  padding: 2px;
  border-radius: 9px;
  line-height: 0;
}
.empire-catalog-filters[data-filter-row="branch"] { gap: 4px; }
.catalog-filter-iconbtn .catalog-filter-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  opacity: 0.62;
  filter: saturate(0.55);
  transition: opacity 0.15s, filter 0.15s;
}
.empire-catalog-filter-btn.catalog-filter-iconbtn.active {
  border-color: var(--filter-color, rgba(255, 255, 255, 0.35));
  background: color-mix(in srgb, var(--filter-color, #64748b) 22%, transparent);
}
.catalog-filter-iconbtn.active .catalog-filter-icon {
  opacity: 1;
  filter: none;
}

.empire-catalog-filter-btn {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-size: 0.72rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.empire-catalog-filter-btn:hover {
  background: rgba(255,255,255,0.08);
}
.empire-catalog-filter-btn.active {
  background: rgba(255,255,255,0.1);
  border-color: var(--filter-color, rgba(255,255,255,0.25));
  color: var(--text);
}
.catalog-filter-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
}

/* Branch separator headers */
.catalog-branch-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 4px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.catalog-branch-header:first-child { padding-top: 0; }
.catalog-branch-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
}

/* Card wrapper */
.catalog-card-wrap { display: contents; }
.catalog-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.catalog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--scrim-40);
}

@media (max-width: 600px) {
  /* The collection scrolls with the page (the mini loadout keeps it one short
     scroll away); a nested 50vh scroller also broke grid row sizing with
     aspect-ratio cards on Chrome. */
  .empire-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .empire-catalog-filters { padding: 0 8px 8px; }

  /* Keep the empty slot placeholder small so it does not push the collection
     list off-screen when the player has not equipped anything yet. */
  .technique-slots-header { padding-bottom: 4px; margin-bottom: 6px; }
  .technique-slot-empty { min-height: 54px; padding: 6px 10px; }
  .technique-slot-empty-hex { width: 28px; height: 28px; }
  .technique-slot-empty-label { font-size: 9px; letter-spacing: 0.12em; }
  .technique-slot { min-width: 0; flex: 1 1 100%; }
}

/* ─── Techniques: loadout panel (active slots) ───────────── */
.tech-loadout-section { margin-bottom: var(--gap); }
/* Sticky slots counter: pins below the research subtab bar for the whole pane.
   Each rule mirrors the anchor the subtab bar itself uses in that layout
   (empire.css base calc, layout.css kc-shell, e2.css kc-lw scroller). */
.tech-slots-sticky {
  position: sticky;
  top: calc(var(--sticky-tabs-h, var(--sticky-header-h, 0px)) + var(--sticky-resources-h, 0px) + var(--research-subtabs-h, 48px));
  z-index: 25;
  background: var(--bg-void, #06060f);
  padding-top: 4px;
}
body.kc-shell:not(.kc-layout-desktop3) .screen.active .tech-slots-sticky {
  top: calc(var(--sticky-resources-h, 0px) + var(--research-subtabs-h, 48px));
}
body.kc-lw #empire-content .tech-slots-sticky {
  top: var(--research-subtabs-h, 48px);
}
.tech-loadout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-items: stretch;
}
.tech-loadout-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-radius: 10px;
  text-align: center;
  font-family: inherit;
}
.tech-loadout-slot.is-empty {
  justify-content: center;
  gap: 10px;
  /* Match the equipped card footprint (building-card is 5/7) so empty slots
     and filled cards line up exactly in the grid. width:100% pins the slot to
     its grid track so a lone empty slot on its own row does not collapse to
     its content size. */
  width: 100%;
  aspect-ratio: 5 / 7;
  padding: 10px;
  border-radius: 6px;
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(192, 132, 252, 0.08), transparent 72%),
    rgba(8, 13, 28, 0.4);
  border: 1px dashed rgba(192, 132, 252, 0.3);
}
.tech-loadout-slot.is-empty .tech-loadout-slot-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px dashed rgba(192, 132, 252, 0.4);
  font-size: 26px;
  font-weight: 300;
  color: rgba(192, 132, 252, 0.7);
  line-height: 1;
}
.tech-loadout-slot.is-empty .tech-loadout-slot-name {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.7);
}
/* Filled slots host a full standard card; the wrapper is just a positioning
   context + click target, so it must NOT inherit catalog-card-wrap's
   display:contents. */
.tech-loadout-slot.is-filled {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.tech-loadout-slot.is-filled .catalog-card { cursor: pointer; }
.tech-loadout-slot.is-busy { opacity: 0.5; pointer-events: none; }
.tech-loadout-slot-remove {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 5;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  color: rgba(248, 113, 113, 0.95);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}
.tech-loadout-slot.is-filled:hover .tech-loadout-slot-remove { opacity: 1; }
.tech-loadout-locked {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.85);
  padding: 12px;
  border: 1px dashed rgba(192, 132, 252, 0.22);
  border-radius: 8px;
  text-align: center;
}
.tech-loadout-cost {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: rgba(148, 163, 184, 0.85);
}

/* ─── Techniques: collection browser ─────────────────────── */
.tech-collection-section { margin-top: var(--gap); }
.tech-collection-header { margin-bottom: 10px; }
.tech-collection-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.tech-collection-search-icon {
  position: absolute;
  left: 10px;
  color: rgba(148, 163, 184, 0.7);
  pointer-events: none;
}
.tech-collection-search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: 8px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(8, 13, 28, 0.6);
  color: rgba(226, 232, 240, 0.95);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.tech-collection-search-input:focus {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.15);
}
.tech-collection-search-input::placeholder { color: rgba(148, 163, 184, 0.6); }
.tech-collection-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 12px;
}
.tech-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tech-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.5);
  color: rgba(203, 213, 225, 0.85);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.tech-chip:hover { border-color: rgba(34, 211, 238, 0.4); color: #e2e8f0; }
.tech-chip.active {
  border-color: rgba(34, 211, 238, 0.65);
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.12);
}
.tech-chip-rarity.rarity-uncommon.active { border-color: rgba(34,197,94,0.7); color: #4ade80; background: rgba(34,197,94,0.12); }
.tech-chip-rarity.rarity-rare.active { border-color: rgba(59,130,246,0.7); color: #60a5fa; background: rgba(59,130,246,0.12); }
.tech-chip-rarity.rarity-legendary.active { border-color: rgba(245,158,11,0.7); color: #fbbf24; background: rgba(245,158,11,0.12); }
.tech-sort-group { margin-left: auto; }
.tech-sort-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.75);
}
.tech-sort-select {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(8, 13, 28, 0.6);
  color: rgba(226, 232, 240, 0.92);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  outline: none;
}
.tech-collection-card-wrap {
  display: contents;
}
.tech-collection-card-wrap.is-equipped .catalog-card {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.55), 0 6px 20px var(--scrim-40);
}
.tech-collection-card-wrap .catalog-card.is-busy { opacity: 0.5; pointer-events: none; }

/* Technique card title tinted by rarity (no pip symbols). */
.catalog-card .tech-rarity-title,
.variant-revealed-card .tech-rarity-title {
  display: block;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}
.catalog-card .tech-rarity-title .card-name-inner,
.variant-revealed-card .tech-rarity-title .card-name-inner {
  min-width: 0;
}
.catalog-card .tech-rarity-common .card-name-inner,
.variant-revealed-card .tech-rarity-common .card-name-inner { color: #e2e8f0; font-weight: 600; }
.catalog-card .tech-rarity-uncommon .card-name-inner,
.variant-revealed-card .tech-rarity-uncommon .card-name-inner {
  color: #6969ff;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(105, 105, 255, 0.35), 0 1px 3px rgba(0,0,0,0.85);
}
.catalog-card .tech-rarity-rare .card-name-inner,
.variant-revealed-card .tech-rarity-rare .card-name-inner {
  color: #ffff77;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 255, 119, 0.28), 0 1px 3px rgba(0,0,0,0.85);
}
.catalog-card .tech-rarity-epic .card-name-inner,
.variant-revealed-card .tech-rarity-epic .card-name-inner { color: #cf9a63; font-weight: 700; }
.catalog-card .tech-rarity-legendary .card-name-inner,
.variant-revealed-card .tech-rarity-legendary .card-name-inner {
  color: #ff8000;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px rgba(255, 128, 0, 0.42), 0 1px 3px rgba(0,0,0,0.85);
}

/* Technique card grids must stay below the sticky resource bar + lab subtabs. */
.tech-collection-grid.building-grid,
.tech-loadout-grid {
  z-index: auto;
}

/* Offscreen collection cards (~90 heavy art cards) neither layout nor
   rasterize: without this a native pinch zoom re-rasters the whole list at
   zoom scale and can OOM the tab on iOS. Box height still comes from the
   card's own aspect-ratio, so scroll geometry is unaffected. */
.tech-collection-grid .catalog-card {
  content-visibility: auto;
}

.tech-collection-noresults {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.8);
}
.variant-modal-confirm {
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: #67e8f9;
}

@media (max-width: 600px) {
  .tech-loadout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tech-collection-controls { gap: 8px 10px; }
  .tech-sort-group { margin-left: 0; }
}

/* ─── Catalog Detail Modal ──────────────────────────────── */
.catalog-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.catalog-detail-backdrop.visible {
  opacity: 1;
}

.catalog-detail-modal {
  background: rgba(15, 20, 35, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 14px;
  max-width: min(90vw, 400px);
  width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px var(--scrim-60), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: scale(0.9) translateY(10px);
  transition: transform 0.25s ease;
}
.catalog-detail-backdrop.visible .catalog-detail-modal {
  transform: scale(1) translateY(0);
}

.catalog-detail-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}
.catalog-detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.catalog-detail-image-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(15, 20, 35, 0.95));
  pointer-events: none;
}

.catalog-detail-body {
  padding: 16px 18px 20px;
}

.catalog-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.catalog-detail-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
  line-height: 1.25;
}
.catalog-detail-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.catalog-detail-rarity {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.catalog-detail-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.catalog-detail-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cyan, #00f0ff);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.catalog-detail-bonus-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
}
.catalog-detail-bonus-row + .catalog-detail-bonus-row {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}
.catalog-detail-bonus-icon {
  flex-shrink: 0;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1px;
}
.catalog-detail-bonus-icon .cost-icon {
  width: 16px;
  height: 16px;
}
.catalog-detail-bonus-info {
  flex: 1;
  min-width: 0;
}
.catalog-detail-bonus-label {
  font-size: 0.82rem;
  color: #e0e0e0;
  font-weight: 500;
}
.catalog-detail-bonus-value {
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 4px;
}
.catalog-detail-bonus-explain {
  font-size: 0.72rem;
  color: #7a8599;
  line-height: 1.35;
  margin-top: 1px;
}

.catalog-detail-effects {
  margin-top: 8px;
}
.catalog-detail-effects .variant-effect-list {
  margin: 0;
}
.catalog-detail-effects .variant-effect-item {
  font-size: 0.8rem;
  padding: 5px 0;
  color: #c0c8d8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.catalog-detail-effects .variant-effect-item:last-child {
  border-bottom: none;
}

.catalog-detail-lore {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.catalog-detail-lore-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cyan, #00f0ff);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.catalog-detail-lore-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.5;
  font-style: italic;
}
.catalog-detail-lore-quote {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  font-style: italic;
}

/* Variant preview backdrop (sits above variant selection overlay z-index:9999) */
.variant-preview-backdrop {
  z-index: 10000;
}
.variant-preview-choose-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 12px 0;
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
  text-transform: uppercase;
}
.variant-preview-choose-btn:hover {
  filter: brightness(1.15);
}
.variant-preview-choose-btn:active {
  transform: scale(0.97);
}
.variant-preview-close-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 11px 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  text-transform: uppercase;
}
.variant-preview-close-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.variant-preview-close-btn:active {
  transform: scale(0.97);
}
.catalog-detail-action-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.catalog-detail-action-btn:active { transform: scale(0.97); }
.catalog-detail-action-btn.is-equip {
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: #67e8f9;
}
.catalog-detail-action-btn.is-equip:hover {
  background: rgba(34, 211, 238, 0.26);
  border-color: rgba(34, 211, 238, 0.7);
  color: #a5f3fc;
}
.catalog-detail-action-btn.is-unequip {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}
.catalog-detail-action-btn.is-unequip:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

@media (max-width: 600px) {
  .catalog-detail-modal {
    max-width: 95vw;
    max-height: 90vh;
    max-height: 90dvh;
  }
  .catalog-detail-body {
    padding: 12px 14px 16px;
  }
  .catalog-detail-name {
    font-size: 1.05rem;
  }
}

/* ─── Fleet Command Pane ──────────────────────────────── */
.fleet-cmd-section-title {
  color: var(--cyan);
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fleet-cmd-panel {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.fleet-cmd-panel--hibernated .fleet-cmd-section-title {
  color: #94a3b8;
}
.fleet-cmd-pools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.fleet-cmd-pools-header .fleet-cmd-section-title {
  margin: 0 0 10px 0;
}
.fleet-cmd-leader-slots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  color: #f59e0b;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.fleet-cmd-leader-slots .icon {
  width: 14px;
  height: 14px;
}
.fcm-card-leader {
  margin-top: 4px;
}
.fcm-card-leader-chip {
  cursor: pointer;
}

/* Per-colony ship pools (Flotas tab) */
.fleet-pool-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fleet-pool-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  cursor: pointer;
}
.fleet-pool-card.is-viewing {
  border-color: rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.3) inset, 0 4px 16px rgba(0, 240, 255, 0.12);
}
/* Soft hero art of the colony's dominant hull, same recipe as the fleet
   dispatch form: low opacity + blur + fade mask, text sits above via
   z-index. Very slow drift, paused when hidden / reduced-motion / mobile. */
.fleet-pool-card-hero {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-size: cover;
  background-position: 50% 40%;
  background-repeat: no-repeat;
  opacity: 0.14;
  filter: blur(1.5px) saturate(1.1);
  -webkit-mask-image: radial-gradient(140% 90% at 50% 15%, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.45) 55%, transparent 90%);
  mask-image: radial-gradient(140% 90% at 50% 15%, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.45) 55%, transparent 90%);
  pointer-events: none;
  z-index: 0;
  animation: kc-hero-drift-b 45s ease-in-out infinite alternate;
  animation-play-state: var(--anim-state, running);
}
.fleet-pool-list .fleet-pool-card:nth-child(3n+2) .fleet-pool-card-hero { animation-delay: -15s; }
.fleet-pool-list .fleet-pool-card:nth-child(3n) .fleet-pool-card-hero { animation-delay: -30s; }
@media (prefers-reduced-motion: reduce) {
  .fleet-pool-card-hero { animation: none; }
}
@media (pointer: coarse) {
  .fleet-pool-card-hero { animation: none; filter: blur(0.75px) saturate(1.05); opacity: 0.12; }
}
.fleet-pool-card-head,
.fleet-pool-card-ships,
.fleet-pool-card-action {
  position: relative;
  z-index: 1;
}
.fleet-pool-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fleet-pool-card-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
}
.fleet-pool-card-head-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.fleet-pool-card-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #e7eefc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-pool-card-meta {
  font-size: 0.72rem;
  color: #8aa0bf;
}
.fleet-pool-card-head .fleet-tpl-card-mode {
  flex: 0 0 auto;
}
.fleet-pool-card-ships {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.fleet-pool-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.18);
  font-size: 0.78rem;
  color: #cfe6f0;
}
.fleet-pool-chip-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.fleet-pool-chip-qty {
  color: var(--cyan);
  font-weight: 600;
}
.fleet-pool-chip--leader {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.32);
  color: #f8e3b8;
  cursor: pointer;
}
.fleet-pool-chip-icon--leader {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(245, 158, 11, 0.5);
}
.fleet-pool-card-action {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fleet-pool-send-btn,
.fleet-pool-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.fleet-pool-send-btn {
  border: 1px solid rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.1);
  color: #d7f6ff;
}
.fleet-pool-send-btn:hover {
  background: rgba(0, 240, 255, 0.18);
}
.fleet-pool-view-btn {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}
.fleet-pool-view-btn:hover {
  background: rgba(148, 163, 184, 0.18);
}
.fleet-pool-send-btn .icon,
.fleet-pool-view-btn .icon {
  width: 16px;
  height: 16px;
}

/* Detected contacts (mobile/empire view of visible_fleets) */
.fleet-cmd-detected-panel .fleet-cmd-detected-count {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: #a8eeff;
}
.fleet-cmd-detected-panel .fleet-cmd-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.fcm-detected-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: rgba(20, 26, 48, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.18);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.fcm-detected-card:hover {
  background: rgba(28, 40, 72, 0.65);
  border-color: rgba(148, 163, 184, 0.45);
}
.fcm-detected-card:active { transform: scale(0.99); }
.fcm-detected-icon {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fcm-detected-icon svg { width: 18px; height: 18px; }
.fcm-detected-body { min-width: 0; }
.fcm-detected-title {
  font-size: 13px;
  font-weight: 600;
  color: #e7ecf7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fcm-detected-meta {
  font-size: 11px;
  color: rgba(230, 240, 255, 0.55);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fcm-detected-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #cbd5e1;
  vertical-align: middle;
}
.fcm-detected-intel {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: var(--cyan, #22d3ee);
  cursor: pointer;
  vertical-align: middle;
}
.fcm-detected-intel:hover {
  background: rgba(34, 211, 238, 0.22);
}
/* Tier modifiers — same palette as desktop3 detected cards */
.fcm-detected-card.tier-2 .fcm-detected-icon {
  background: rgba(245, 158, 11, 0.14); color: #fbbf24;
}
.fcm-detected-card.tier-3,
.fcm-detected-card.tier-4 {
  border-color: rgba(245, 158, 11, 0.4);
}
.fcm-detected-card.tier-3 .fcm-detected-icon,
.fcm-detected-card.tier-4 .fcm-detected-icon {
  background: rgba(245, 158, 11, 0.18); color: #fbbf24;
}
.fcm-detected-card.tier-3 .fcm-detected-chip,
.fcm-detected-card.tier-4 .fcm-detected-chip {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}
.fleet-cmd-panel:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.fleet-cmd-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.fleet-cmd-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.fleet-cmd-filter-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fleet-cmd-empty-notice {
  text-align: center;
  padding: 18px 12px;
  color: #475569;
  font-style: italic;
  font-size: 0.84rem;
  border: 1px dashed rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-top: 4px;
}

/* ── Active mission cards ──────────────────────────────── */
.fleet-cmd-missions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.fcm-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(8, 12, 22, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fcm-card:hover {
  border-color: var(--fcm-color, rgba(0, 240, 255, 0.25));
  box-shadow: 0 4px 16px var(--scrim-40), 0 0 12px color-mix(in srgb, var(--fcm-color, #00f0ff) 15%, transparent);
}
.fcm-card-thumb {
  position: relative;
  width: 64px;
  flex-shrink: 0;
  overflow: hidden;
}
.fcm-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fcm-card-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 40%, rgba(8, 12, 22, 0.85) 100%);
}
.fcm-card-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fcm-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fcm-card-mission {
  color: var(--fcm-color, #00f0ff);
  font-weight: 600;
  font-size: 0.88rem;
}
.fcm-card-status {
  color: #64748b;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fcm-card-on-map {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: rgba(42, 209, 168, 0.95);
  border: 1px solid rgba(42, 209, 168, 0.35);
  background: rgba(42, 209, 168, 0.1);
}
.fcm-card-route {
  font-size: 0.78rem;
  color: #94a3b8;
}
.fcm-card-ships {
  font-size: 0.72rem;
  color: #64748b;
}
.fcm-card-progress {
  margin-top: 4px;
}
.fcm-card-progress .progress-bar { height: 4px; }
.fcm-card-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 10px 12px;
  flex-shrink: 0;
  gap: 6px;
}
.fcm-card-eta {
  font-size: 0.85rem;
  color: #e0e0e0;
}

/* ── Mercenary fleet card (idle/stationed) ─────────────── */
.fcm-card-merc {
  border-color: rgba(239, 68, 68, 0.35);
  cursor: pointer;
}
.fcm-card-merc.fcm-card-merc-warning {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.18);
}
.fcm-card-merc-thumb {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(8, 22, 32, 0.6));
}
.fcm-card-merc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.fcm-card-merc-cta {
  align-items: center;
}
.fcm-merc-dispatch-btn {
  appearance: none;
  border: 1px solid rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.12);
  color: #f8fafc;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fcm-merc-dispatch-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.85);
}

/* ── Ship inventory table ──────────────────────────────── */
.fleet-cmd-inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: auto;
}
.fleet-inv-th {
  padding: 6px 10px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  white-space: nowrap;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  vertical-align: middle;
}
.fleet-inv-th-ship {
  text-align: left;
  width: auto;
}
.fleet-inv-th-planet,
.fleet-inv-th-total {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}
.fleet-inv-th-total {
  color: var(--cyan);
  font-weight: 700;
}
.fleet-inv-ship-cell {
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  white-space: nowrap;
}
.fleet-inv-ship-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fleet-inv-ship-icon {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  flex-shrink: 0;
}
.fleet-inv-ship-name {
  line-height: 1.1;
}
.fleet-inv-qty {
  text-align: center;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e0e0e0;
  white-space: nowrap;
  width: 1%;
  vertical-align: middle;
}
.fleet-inv-total {
  text-align: center;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--cyan);
  font-weight: 700;
  white-space: nowrap;
  width: 1%;
  vertical-align: middle;
}
.fleet-cmd-inv-table tbody tr.fleet-inv-row {
  cursor: pointer;
  transition: background 0.12s;
}
.fleet-cmd-inv-table tbody tr.fleet-inv-row:hover td {
  background: rgba(0, 240, 255, 0.06);
}

/* Template action buttons */
.fleet-cmd-tpl-btn:hover {
  filter: brightness(1.3);
}
@media (max-width: 600px) {
  .fcm-card-thumb {
    width: 52px;
  }
}

/* ── Variant card cost line ───────────────────────────────── */
.variant-cost-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.68rem;
  padding: 4px 6px;
  margin-top: 4px;
  background: var(--scrim-35);
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* ── IP bar full state ────────────────────────────────────── */
.progress-fill.innovation.ip-full {
  background: linear-gradient(90deg, #a855f7 0%, #f59e0b 100%);
  animation: ip-full-pulse 2s ease-in-out infinite;
}
@keyframes ip-full-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

/* ─── First-time tap hint banner ─────────────────────────────────── */
.tap-hint-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 12px 4px;
  padding: 10px 18px;
  border: 2px solid rgba(103, 232, 249, 0.85);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.45), rgba(14, 116, 144, 0.30));
  color: #eafdff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.45), 0 6px 18px rgba(6, 182, 212, 0.2);
  animation: tap-hint-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
.tap-hint-banner.hidden { display: none; }
.tap-hint-arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #67e8f9;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.7));
  animation: tap-hint-arrow-bob 1s ease-in-out infinite;
}
.tap-hint-text {
  white-space: normal;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.35);
}

@keyframes tap-hint-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.45), 0 6px 18px rgba(6, 182, 212, 0.2);
    border-color: rgba(34, 211, 238, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 211, 238, 0), 0 6px 22px rgba(6, 182, 212, 0.35);
    border-color: rgba(34, 211, 238, 0.95);
  }
}
@keyframes tap-hint-arrow-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (max-width: 720px) {
  .tap-hint-banner { margin: 6px 8px 2px; padding: 9px 14px; font-size: 13px; }
  .tap-hint-arrow { width: 18px; height: 18px; }
}

/* ─── Fleet Command: empty state wall ────────────────────────────── */
.fleet-cmd-empty-wall {
  padding: 12px 0 4px;
  grid-column: 1 / -1;
}
.fleet-cmd-empty-hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.28);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(129, 140, 248, 0.14), transparent 62%),
    rgba(15, 18, 32, 0.72);
}
.fleet-cmd-empty-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 28px 24px;
  max-width: 520px;
  margin: 0 auto;
}
.fleet-cmd-empty-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: rgba(129, 140, 248, 0.88);
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid rgba(129, 140, 248, 0.42);
  border-radius: 2px;
  background: rgba(99, 102, 241, 0.1);
}
.fleet-cmd-empty-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-shadow: 0 2px 12px var(--scrim-60);
}
.fleet-cmd-empty-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.85);
  max-width: 480px;
  text-shadow: 0 1px 6px var(--scrim-50);
}
.fleet-cmd-empty-cta {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #0b1420;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(129, 140, 248, 0.65) inset;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.fleet-cmd-empty-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.55), 0 0 0 1px rgba(129, 140, 248, 0.9) inset;
}
.fleet-cmd-empty-cta:active { transform: translateY(0); }
.fleet-cmd-empty-cta-arrow { transition: transform 160ms ease; }
.fleet-cmd-empty-cta:hover .fleet-cmd-empty-cta-arrow {
  transform: translateX(3px);
}

@media (max-width: 720px) {
  .fleet-cmd-empty-hero-content { padding: 24px 20px; }
}

/* ─── Techniques: Lab sub-tabs (Investigaciones / Técnicas) ───────── */
.empire-research-subtabs {
  display: flex;
  gap: 6px;
  margin: 4px 0 12px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 10px;
  position: sticky;
  top: calc(var(--sticky-tabs-h, var(--sticky-header-h, 0px)) + var(--sticky-resources-h, 0px));
  z-index: 29;
  isolation: isolate;
  backdrop-filter: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.empire-research-subtab {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(226, 232, 240, 0.78);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.empire-research-subtab > span:not(.empire-research-subtab-badge) {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .empire-research-subtab { font-size: 12px; gap: 6px; padding: 10px 6px; }
}
.empire-research-subtab .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.empire-research-subtab:hover { color: #fff; background: rgba(99, 102, 241, 0.12); }
.empire-research-subtab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.24), rgba(99, 102, 241, 0.18));
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35) inset, 0 4px 16px rgba(99, 102, 241, 0.2);
}
.empire-research-subtab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 2px;
  border-radius: 9px;
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #422006;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.55);
  animation: empire-research-subtab-badge-pulse 2.4s ease-in-out infinite;
}
@keyframes empire-research-subtab-badge-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(250, 204, 21, 0.45); }
  50%      { box-shadow: 0 0 16px rgba(250, 204, 21, 0.85); }
}

/* ─── Techniques locked hero (Lab < 3) ───────────────────────────── */
.techniques-locked-wall { padding: 12px 0 4px; }
.techniques-locked-hero {
  position: relative;
  min-height: 300px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  isolation: isolate;
}
.techniques-locked-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.05);
  transform: scale(1.02);
  z-index: 0;
}
.techniques-locked-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 12, 22, 0.28) 0%, rgba(8, 12, 22, 0.55) 45%, rgba(8, 12, 22, 0.92) 100%),
    radial-gradient(120% 80% at 50% 100%, rgba(168, 85, 247, 0.22), transparent 60%);
  z-index: 1;
}
.techniques-locked-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 32px 28px 28px;
  max-width: 560px;
  min-height: 300px;
  justify-content: flex-end;
}
.techniques-locked-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(216, 180, 254, 0.92);
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 2px;
  background: rgba(168, 85, 247, 0.12);
}
.techniques-locked-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-shadow: 0 2px 12px var(--scrim-60);
}
.techniques-locked-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.88);
  max-width: 480px;
  text-shadow: 0 1px 6px var(--scrim-50);
}
.techniques-locked-status {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(216, 180, 254, 0.9);
  padding: 4px 10px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.1);
}
.techniques-locked-cta {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #0b1420;
  background: linear-gradient(135deg, #c084fc, #a855f7);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(168, 85, 247, 0.4), 0 0 0 1px rgba(192, 132, 252, 0.65) inset;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.techniques-locked-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 14px 32px rgba(168, 85, 247, 0.55), 0 0 0 1px rgba(192, 132, 252, 0.9) inset;
}
.techniques-locked-cta-arrow { transition: transform 160ms ease; }
.techniques-locked-cta:hover .techniques-locked-cta-arrow { transform: translateX(3px); }

@media (max-width: 720px) {
  .techniques-locked-hero { min-height: 260px; }
  .techniques-locked-hero-content { padding: 24px 20px 22px; min-height: 260px; }
}

/* ─── Techniques: pending booster shelf (permanent-decision model) ── */
.tech-packs-section {}
.tech-packs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(192, 132, 252, 0.18);
}
.tech-packs-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(192, 132, 252, 0.85);
  position: relative;
  padding-left: 14px;
}
.tech-packs-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) rotate(45deg);
  background: rgba(192, 132, 252, 0.85);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.7);
}
.tech-packs-count {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.85);
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.55);
}
.tech-packs-shelf {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  justify-content: center;
}

/* Single booster tile (card-back thumbnail + status label under it) */
.tech-pack-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 96px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  appearance: none;
  transition: transform 180ms ease;
}
.tech-pack-slot:hover { transform: translateY(-2px); }
.tech-pack-slot:active { transform: translateY(0); }
.tech-pack-slot-img {
  width: 96px;
  height: 134px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(192, 132, 252, 0.45);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--scrim-40) inset;
  transition: box-shadow 220ms ease, border-color 220ms ease, filter 220ms ease;
  will-change: transform;
  animation: tech-pack-drift-a 7.4s ease-in-out infinite;
}
/* Stagger drift motion so each card floats on its own path */
.tech-pack-slot:nth-child(4n+2) .tech-pack-slot-img { animation-name: tech-pack-drift-b; animation-duration: 8.3s; }
.tech-pack-slot:nth-child(4n+3) .tech-pack-slot-img { animation-name: tech-pack-drift-c; animation-duration: 6.9s; }
.tech-pack-slot:nth-child(4n+4) .tech-pack-slot-img { animation-name: tech-pack-drift-d; animation-duration: 9.1s; }
.tech-pack-slot:hover .tech-pack-slot-img { animation-play-state: paused; }
/* When inside fire wrapper, drift the whole wrapper instead of just the img */
.tech-pack-fire-wrap { animation: tech-pack-drift-a 7.4s ease-in-out infinite; will-change: transform; }
.tech-pack-fire-wrap:nth-child(4n+2) { animation-name: tech-pack-drift-b; animation-duration: 8.3s; }
.tech-pack-fire-wrap:nth-child(4n+3) { animation-name: tech-pack-drift-c; animation-duration: 6.9s; }
.tech-pack-fire-wrap:nth-child(4n+4) { animation-name: tech-pack-drift-d; animation-duration: 9.1s; }
.tech-pack-fire-wrap:hover { animation-play-state: paused; }
.tech-pack-fire-wrap .tech-pack-slot-img { animation: none; }

@keyframes tech-pack-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25%      { transform: translate3d(2px, -3px, 0) rotate(0.4deg); }
  50%      { transform: translate3d(-1px, -4px, 0) rotate(-0.3deg); }
  75%      { transform: translate3d(-3px, -1px, 0) rotate(0.2deg); }
}
@keyframes tech-pack-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25%      { transform: translate3d(-2px, 2px, 0) rotate(-0.4deg); }
  50%      { transform: translate3d(3px, 1px, 0) rotate(0.3deg); }
  75%      { transform: translate3d(1px, -3px, 0) rotate(-0.2deg); }
}
@keyframes tech-pack-drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  33%      { transform: translate3d(3px, 0, 0) rotate(0.3deg); }
  66%      { transform: translate3d(-2px, -3px, 0) rotate(-0.5deg); }
}
@keyframes tech-pack-drift-d {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  33%      { transform: translate3d(-3px, 2px, 0) rotate(-0.3deg); }
  66%      { transform: translate3d(2px, -2px, 0) rotate(0.4deg); }
}
.tech-pack-slot-glow {
  display: none;
}

/* ── Fire aura wrapper (all boosters, opened or closed) ── */
.tech-pack-fire-wrap {
  position: relative;
  isolation: isolate;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.tech-pack-fire-wrap::before,
.tech-pack-fire-wrap::after,
.tech-pack-fire-wrap > .tech-pack-fire-c {
  position: absolute;
  inset: -6px;
  bottom: 14px;
  border-radius: calc(8px + 6px);
  background: linear-gradient(
    60deg,
    rgba(50, 120, 255, 0.85),
    rgba(70, 150, 255, 0.7),
    rgba(100, 180, 255, 0.55),
    rgba(70, 150, 255, 0.7),
    rgba(50, 120, 255, 0.85)
  );
  z-index: 0;
  pointer-events: none;
  will-change: opacity;
  transition: filter 0.3s ease;
}
.tech-pack-fire-wrap::before,
.tech-pack-fire-wrap::after { content: ''; }
.tech-pack-fire-wrap::before {
  filter: url(#fire-aura-a) blur(3px);
  animation: fire-xfade 1.5s ease-in-out infinite alternate;
}
.tech-pack-fire-wrap::after {
  filter: url(#fire-aura-b) blur(3px);
  animation: fire-xfade 1.5s ease-in-out infinite alternate;
  animation-delay: -1s;
}
.tech-pack-fire-wrap > .tech-pack-fire-c {
  filter: url(#fire-aura-c) blur(3px);
  animation: fire-xfade 1.5s ease-in-out infinite alternate;
  animation-delay: -2s;
}
/* Card sits above the fire */
.tech-pack-fire-wrap > .tech-pack-slot {
  position: relative;
  z-index: 1;
  overflow: hidden;
}
/* Hide default glow, unify border */
.tech-pack-fire-wrap .tech-pack-slot-glow { display: none !important; }
.tech-pack-fire-wrap .tech-pack-slot-img {
  border-color: var(--scrim-60) !important;
  box-shadow: 0 10px 24px var(--scrim-50), 0 0 0 1px var(--scrim-40) inset !important;
}
/* Kill button-level hover/active (wrapper handles it) */
.tech-pack-fire-wrap .tech-pack-slot:hover,
.tech-pack-fire-wrap .tech-pack-slot:active { transform: none !important; }
.tech-pack-fire-wrap .tech-pack-slot:hover .tech-pack-slot-img { filter: none !important; }

/* ── Hover: shine only (no scale, no fire intensification) ── */
.tech-pack-fire-wrap:hover .tech-pack-slot-img {
  border-color: rgba(100, 180, 255, 0.5) !important;
  box-shadow: 0 10px 30px var(--scrim-50), 0 0 0 1px rgba(100, 180, 255, 0.4) inset !important;
}
/* Diagonal shine sweep on hover */
.tech-pack-fire-wrap .tech-pack-slot::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 96px; height: 134px;
  border-radius: 8px;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.25) 45%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 70%
  );
  z-index: 2;
  pointer-events: none;
  transform: translateX(-120%);
  transition: transform 0.5s ease;
  overflow: hidden;
}
.tech-pack-fire-wrap:hover .tech-pack-slot::before {
  transform: translateX(120%);
}
.tech-pack-slot-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #422006;
  font-size: 12px;
  font-weight: 800;
  border-radius: 13px;
  border: 2px solid rgba(8, 13, 28, 0.95);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.7);
}
.tech-pack-slot-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(192, 132, 252, 0.85);
  text-align: center;
  max-width: 100%;
  line-height: 1.2;
}
.tech-pack-fire-wrap .tech-pack-slot-label {
  position: relative;
  z-index: 1;
  color: rgba(245, 158, 11, 0.95);
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

}

/* Empty state under the active techniques header (no cards claimed yet) */
.tech-active-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.75);
  font-style: italic;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.4);
}

/* Tech cards hide rarity badges in the permanent-decision model: all cards
   use neutral (common-ish) framing regardless of server rarity. The
   individual cards still show branch color via --card-color. */
.tech-active-card-wrap .catalog-card[data-rarity] { /* no-op, rarity is forced */ }

@media (max-width: 519px) {
  .tech-packs-shelf { gap: 10px; }
  .tech-pack-slot { width: 82px; }
  .tech-pack-slot-img { width: 82px; height: 114px; }
}

/* ─── Techniques: branch picker modal ─────────────────────────────── */
.techniques-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.techniques-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(var(--blur-sm));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.techniques-picker-content {
  position: relative;
  width: min(560px, 94vw);
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 26px 22px 22px;
  background: linear-gradient(180deg, rgba(30, 27, 75, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 14px;
  box-shadow: 0 24px 70px var(--scrim-70);
}
.techniques-picker-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  text-align: center;
}
.techniques-picker-subtitle {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.75);
  text-align: center;
  margin-bottom: 18px;
}
.techniques-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.techniques-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--filter-color, rgba(99, 102, 241, 0.35));
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.techniques-picker-btn:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 6px 20px var(--scrim-40), 0 0 0 1px var(--filter-color, rgba(99, 102, 241, 0.65)) inset;
}
.techniques-picker-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.techniques-picker-label {
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}
.techniques-picker-close {
  display: block;
  margin: 18px auto 0;
  padding: 10px 24px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.techniques-picker-close:hover { background: rgba(51, 65, 85, 0.9); }

/* ─── Planet development milestone overlay ───────────────────────── */
.planet-milestone-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at center, rgba(0, 20, 40, 0.75) 0%, rgba(0, 5, 15, 0.95) 100%);
  opacity: 0;
  transition: opacity 420ms ease;
  backdrop-filter: blur(var(--blur-md));
}
.planet-milestone-overlay.planet-milestone-in { opacity: 1; }
.planet-milestone-overlay.planet-milestone-out {
  opacity: 0;
  transition: opacity 260ms ease;
}
.planet-milestone-box {
  position: relative;
  width: min(640px, 95vw);
  padding: 28px 32px 24px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 18, 32, 0.96) 0%, rgba(5, 10, 22, 0.98) 100%);
  border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow:
    0 40px 80px var(--scrim-60),
    0 0 0 1px rgba(34, 211, 238, 0.15) inset,
    0 0 90px rgba(34, 211, 238, 0.22);
  transform: translateY(18px) scale(0.97);
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.planet-milestone-in .planet-milestone-box {
  transform: translateY(0) scale(1);
}
.planet-milestone-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: rgba(34, 211, 238, 0.9);
  text-transform: uppercase;
  text-align: center;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
  margin-bottom: 12px;
}
.planet-milestone-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: 0.01em;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}
.planet-milestone-coords {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(148, 163, 184, 0.85);
  text-align: center;
  letter-spacing: 0.18em;
  margin-top: 4px;
  margin-bottom: 16px;
}
.planet-milestone-feed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: #000;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.18) inset;
}
.planet-milestone-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.planet-milestone-img-new {
  z-index: 1;
  filter: brightness(1.02) saturate(1.05);
  opacity: 0;
  transform: scale(1.12);
  transition: opacity 1800ms cubic-bezier(0.5, 0, 0.25, 1), transform 2000ms cubic-bezier(0.22, 1, 0.36, 1);
}
.planet-milestone-img-old {
  z-index: 2;
  opacity: 1;
  transform: scale(1);
  transition: opacity 1800ms cubic-bezier(0.5, 0, 0.25, 1),
              filter 1800ms ease,
              transform 2000ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* BEFORE state: old image fully visible, new image hidden. */
.planet-milestone-state-before .planet-milestone-img-old { opacity: 1; }
.planet-milestone-state-before .planet-milestone-img-new { opacity: 0; }
/* TRANSITIONING state: old fades out + scales down, new fades in + scales to 1. */
.planet-milestone-state-transitioning .planet-milestone-img-old {
  opacity: 0;
  filter: blur(4px) brightness(1.35);
  transform: scale(0.94);
}
.planet-milestone-state-transitioning .planet-milestone-img-new {
  opacity: 1;
  transform: scale(1);
}
/* AFTER state: keep new image locked in place. */
.planet-milestone-state-after .planet-milestone-img-old { opacity: 0; }
.planet-milestone-state-after .planet-milestone-img-new { opacity: 1; transform: scale(1); }

/* Radial flash pulse at the midpoint of the transition. */
.planet-milestone-flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(140, 220, 255, 0.55) 25%,
    rgba(34, 211, 238, 0.0) 65%);
  mix-blend-mode: screen;
}
.planet-milestone-state-transitioning .planet-milestone-flash {
  animation: milestoneFlash 2000ms ease-out forwards;
}
@keyframes milestoneFlash {
  0%   { opacity: 0; transform: scale(0.2); }
  35%  { opacity: 1; transform: scale(1.15); }
  55%  { opacity: 0.75; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(1.45); }
}

/* Drifting sparkle particles overlay during the transition. */
.planet-milestone-sparkles {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}
.planet-milestone-state-transitioning .planet-milestone-sparkles { opacity: 1; }
.planet-milestone-sparkle {
  position: absolute;
  bottom: -10%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #e0f7ff;
  box-shadow: 0 0 8px rgba(180, 230, 255, 0.95),
              0 0 16px rgba(34, 211, 238, 0.55);
  opacity: 0;
}
.planet-milestone-state-transitioning .planet-milestone-sparkle {
  animation: milestoneSparkle linear forwards;
}
@keyframes milestoneSparkle {
  0%   { transform: translate3d(0, 0, 0) scale(0.4); opacity: 0; }
  15%  { opacity: 1; }
  80%  { opacity: 0.9; }
  100% { transform: translate3d(var(--pm-drift, 0px), -140%, 0) scale(1.2); opacity: 0; }
}
/* Scan lines on the feed for the "orbital telemetry" feel */
.planet-milestone-feed::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(34, 211, 238, 0.03) 2px,
    rgba(34, 211, 238, 0.03) 4px
  );
}
/* Corner brackets on the feed */
.planet-milestone-feed::after {
  content: '';
  position: absolute;
  inset: 6px;
  z-index: 4;
  pointer-events: none;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 6px;
  clip-path: polygon(
    0 0, 18px 0, 18px 1.5px, 1.5px 1.5px, 1.5px 18px, 0 18px,
    0 calc(100% - 18px), 1.5px calc(100% - 18px), 1.5px calc(100% - 1.5px), 18px calc(100% - 1.5px), 18px 100%, 0 100%,
    calc(100% - 18px) 100%, calc(100% - 18px) calc(100% - 1.5px), calc(100% - 1.5px) calc(100% - 1.5px), calc(100% - 1.5px) calc(100% - 18px), 100% calc(100% - 18px), 100% 100%,
    100% 18px, calc(100% - 1.5px) 18px, calc(100% - 1.5px) 1.5px, calc(100% - 18px) 1.5px, calc(100% - 18px) 0, 100% 0
  );
}
.planet-milestone-feed-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
  color: rgba(226, 232, 240, 0.9);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.planet-milestone-rec {
  color: #ef4444;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
  animation: milestonePulse 1.4s ease-in-out infinite;
}
.planet-milestone-rec::before {
  content: '● ';
}
.planet-milestone-tier-old {
  color: rgba(148, 163, 184, 0.75);
  text-decoration: line-through;
  margin-left: auto;
}
.planet-milestone-arrow {
  color: rgba(34, 211, 238, 0.85);
}
.planet-milestone-tier-new {
  color: #22d3ee;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.55);
}
@keyframes milestonePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.planet-milestone-caption {
  font-size: 13px;
  color: rgba(203, 213, 225, 0.85);
  text-align: center;
  line-height: 1.45;
  margin-top: 16px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.probe-feed-bonuses {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.survey-reward-rows {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 10px;
  background: rgba(8, 24, 34, 0.55);
}
.survey-reward-title {
  flex-basis: 100%;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(165, 243, 252, 0.85);
}
.survey-reward-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: #e2e8f0;
}
.survey-reward-item .icon {
  width: 18px;
  height: 18px;
  color: #22d3ee;
}
.survey-reward-num {
  font-family: 'Share Tech Mono', monospace;
  color: #7dd3fc;
}
.probe-feed-bonuses .planet-bonuses {
  justify-content: center;
  gap: 4px 8px;
}
.kc-narrative-boon {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(34, 211, 238, 0.22);
  color: rgba(165, 243, 252, 0.9);
  font-style: italic;
}
.kc-narrative-unlocks {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(34, 211, 238, 0.22);
  text-align: left;
}
.kc-narrative-unlocks-head {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(34, 211, 238, 0.85);
  margin-bottom: 8px;
}
.kc-narrative-unlocks-empty {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(34, 211, 238, 0.22);
  color: rgba(165, 243, 252, 0.85);
  font-style: italic;
  font-size: 13px;
  text-align: center;
}
.kc-narrative-unlocks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}
.kc-narrative-unlock {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 3px;
}
.kc-narrative-unlock-kind {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(125, 211, 252, 0.7);
}
.kc-narrative-unlock-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.95);
}
.kc-narrative-unlock-megaproject {
  border-color: rgba(250, 204, 21, 0.35);
}
.kc-narrative-unlock-megaproject .kc-narrative-unlock-kind {
  color: rgba(250, 204, 21, 0.85);
}
.kc-narrative-variant-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fde68a;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.55);
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.25);
  pointer-events: none;
}
.planet-milestone-stats {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  color: rgba(148, 163, 184, 0.85);
  letter-spacing: 0.05em;
}
.planet-milestone-btn {
  display: none;
  margin: 20px auto 0;
  padding: 12px 36px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #0b1420;
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(6, 182, 212, 0.35), 0 0 0 1px rgba(34, 211, 238, 0.6) inset;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease, opacity 260ms ease;
}
.planet-milestone-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 14px 32px rgba(6, 182, 212, 0.5);
}
.planet-milestone-btn:active { transform: translateY(0); }

/* State-driven button visibility. */
.planet-milestone-state-before .planet-milestone-btn-reveal { display: block; }
.planet-milestone-state-transitioning .planet-milestone-btn-reveal {
  display: block;
  opacity: 0.35;
  pointer-events: none;
}
.planet-milestone-btn-row {
  display: none;
  margin: 20px auto 0;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.planet-milestone-state-after .planet-milestone-btn-row {
  display: flex;
  animation: milestoneBtnIn 360ms ease-out both;
}
.planet-milestone-btn-row .planet-milestone-btn {
  display: block;
  margin: 0;
}
.planet-milestone-btn-close {
  background: linear-gradient(135deg, #64748b, #475569);
  color: #f1f5f9;
  box-shadow: 0 10px 24px rgba(71, 85, 105, 0.35), 0 0 0 1px rgba(148, 163, 184, 0.5) inset;
}
.planet-milestone-btn-close:hover {
  box-shadow: 0 14px 32px rgba(71, 85, 105, 0.5);
}
@keyframes milestoneBtnIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Covert outcome modal: emblem heroes are square, so contain instead of crop. */
.covert-outcome-frame {
  background: radial-gradient(circle at 50% 40%, #0d1828, #050a12 70%);
}
.covert-outcome-frame .planet-milestone-img-new {
  object-fit: contain;
  padding: 6%;
  transform: scale(1);
}

@media (max-width: 720px) {
  .planet-milestone-box { padding: 22px 20px 18px; }
  .planet-milestone-title { font-size: 18px; }
  .planet-milestone-feed-hud { font-size: 10px; padding: 6px 10px; gap: 8px; }
  .planet-milestone-caption { font-size: 12px; }
}

/* Alert-warning narrative template (marauder/revuelta/traicion/pact_broken) */
.kc-alert-overlay {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 220ms ease;
}
.kc-alert-overlay.kc-alert-in { opacity: 1; }
.kc-alert-overlay.kc-alert-out { opacity: 0; }
.kc-alert-box {
  width: min(560px, 92vw);
  background: linear-gradient(160deg, #1a1014 0%, #221218 100%);
  border: 2px solid #ff3a3a;
  border-radius: 6px;
  padding: 22px 24px 20px;
  color: #f1f5f9;
  font-family: inherit;
  animation: kc-alert-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 58, 58, 0.22) inset;
}
@keyframes kc-alert-pulse {
  0%, 100% { box-shadow: 0 30px 80px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,58,58,0.22) inset, 0 0 0  rgba(255,58,58,0.0); }
  50%      { box-shadow: 0 30px 80px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,58,58,0.45) inset, 0 0 32px rgba(255,58,58,0.55); }
}
.kc-alert-strip {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  color: #ff6b6b; text-transform: uppercase;
  padding-bottom: 8px; border-bottom: 1px solid rgba(255, 58, 58, 0.32);
}
.kc-alert-siren {
  font-size: 16px; color: #ff3a3a;
  animation: kc-alert-blink 0.9s steps(2, end) infinite;
}
@keyframes kc-alert-blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0.25; } }
.kc-alert-title { font-size: 22px; font-weight: 700; margin-top: 12px; color: #fff5f5; line-height: 1.2; }
.kc-alert-subtitle { font-size: 12px; color: rgba(226, 232, 240, 0.75); margin-top: 4px; font-family: var(--font-mono); letter-spacing: 0.06em; }
.kc-alert-coords { color: rgba(255, 200, 200, 0.75); }
.kc-alert-orbital-feed {
  position: relative;
  margin: 12px 0 6px;
  height: 180px;
  background: rgba(8, 10, 18, 0.6);
  border: 1px solid rgba(255, 58, 58, 0.32);
  border-radius: 4px;
  overflow: hidden;
}
.kc-alert-orbital-feed img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05) saturate(0.85);
}
.kc-alert-orbital-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 35%, rgba(255,58,58,0.18) 70%, rgba(120,12,12,0.55) 100%),
    linear-gradient(180deg, rgba(255,58,58,0.05) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.kc-alert-orbital-rec {
  position: absolute; top: 8px; right: 10px;
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  color: #ff6b6b; text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.kc-alert-orbital-recdot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff3a3a;
  box-shadow: 0 0 8px rgba(255,58,58,0.85);
  animation: kc-alert-blink 1.1s steps(2,end) infinite;
}
.kc-alert-orbital-tag {
  position: absolute; bottom: 8px; left: 10px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.kc-alert-countdown {
  margin: 4px 0 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 700; letter-spacing: 0.18em;
  color: #ff6b6b;
  text-shadow: 0 0 12px rgba(255, 58, 58, 0.55);
}
.kc-alert-countdown-impact {
  color: #fff5f5;
  animation: kc-alert-blink 0.6s steps(2,end) infinite;
}
.kc-alert-defbar {
  grid-column: 1 / -1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.kc-alert-defbar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 240ms ease;
}
.kc-alert-btn-secondary {
  background: linear-gradient(135deg, #334155, #1f2937); color: #f1f5f9;
}
@media (max-width: 720px) {
  .kc-alert-orbital-feed { height: 140px; }
  .kc-alert-countdown { font-size: 22px; }
}
.kc-alert-hero {
  position: relative;
  margin: 12px 0 4px;
  height: 200px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 58, 58, 0.3);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5) inset;
}
.kc-alert-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.kc-alert-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(8, 10, 18, 0) 55%,
    rgba(8, 10, 18, 0.65) 100%);
  pointer-events: none;
}
@media (max-width: 720px) {
  .kc-alert-hero { height: 150px; }
}
.kc-narrative-hero {
  position: relative;
  margin: 12px 0 8px;
  height: 220px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.18);
}
.kc-narrative-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.kc-narrative-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}
@media (max-width: 720px) {
  .kc-narrative-hero { height: 160px; }
}
.kc-alert-body { font-size: 13px; color: rgba(226, 232, 240, 0.9); line-height: 1.5; margin: 6px 0 12px; }
.kc-alert-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 12px;
  padding: 10px 12px; margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.kc-alert-stat { display: flex; justify-content: space-between; gap: 10px; }
.kc-alert-stat-k { color: rgba(148, 163, 184, 0.85); text-transform: uppercase; letter-spacing: 0.05em; }
.kc-alert-stat-v { color: #fff5f5; font-weight: 600; }

.kc-marauder-info {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.28);
  border-left: 2px solid rgba(255, 58, 58, 0.45);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.kc-marauder-info-row {
  display: flex; justify-content: space-between; gap: 10px;
}
.kc-marauder-info-k {
  color: rgba(148, 163, 184, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}
.kc-marauder-info-v {
  color: #fff5f5;
  font-weight: 600;
}
.kc-marauder-hp-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin: -2px 0 4px;
}
.kc-marauder-hp-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 240ms ease;
}

.kc-alert-defense-row {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 2px;
}
.kc-alert-defense-row .kc-alert-stat-k { display: block; }
.kc-alert-defense-list {
  display: flex; flex-wrap: wrap; gap: 4px 6px;
}
.kc-alert-defense-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.30);
  color: #e0f2fe;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
.kc-alert-defense-chip-struct {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fef3c7;
}
.kc-alert-defense-chip-qty { font-weight: 700; opacity: 0.85; }
.kc-alert-defense-chip-name { font-weight: 500; }
.kc-alert-defense-chip-more {
  background: rgba(148, 163, 184, 0.10);
  border-color: rgba(148, 163, 184, 0.30);
  color: rgba(226, 232, 240, 0.85);
}
.kc-alert-defense-sub {
  font-size: 10px;
  color: rgba(148, 163, 184, 0.7);
  letter-spacing: 0.04em;
}
.kc-alert-defense-none {
  color: #ff6b6b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kc-alert-attacker-chip {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.40);
  color: #fecaca;
}

.kc-alert-loot-block .kc-alert-loot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.kc-alert-loot-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.kc-alert-loot-icon {
  display: inline-flex;
  align-items: center;
}
.kc-alert-loot-value {
  letter-spacing: 0.02em;
}
.kc-alert-loot-none {
  color: rgba(134, 239, 172, 0.95);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kc-alert-cta-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.kc-alert-btn {
  padding: 10px 22px; border: none; border-radius: 4px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: transform 120ms ease, filter 120ms ease;
}
.kc-alert-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.kc-alert-btn-primary { background: linear-gradient(135deg, #ff3a3a, #c1272d); color: #fff5f5; box-shadow: 0 6px 16px rgba(255, 58, 58, 0.45); }
.kc-alert-btn-close { background: linear-gradient(135deg, #475569, #334155); color: #f1f5f9; }
.kc-alert-btn-report {
  background: linear-gradient(180deg, #d63a3a 0%, #a92e2e 100%);
  color: #fff5f5;
  box-shadow: 0 6px 16px rgba(214, 58, 58, 0.4);
}
.kc-alert-btn-intercept {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ff8a3d, #e2551f);
  color: #fff7f0;
  box-shadow: 0 6px 16px rgba(226, 85, 31, 0.42);
}
.kc-alert-btn-intercept svg { flex: 0 0 auto; }
.fleet-intercept-lock .fleet-marauder-lock-icon { color: #ff8a3d; }

/* Defensive fleets already dispatched against this threat */
.kc-alert-sent {
  margin: 4px 0 12px;
  padding: 10px 12px;
  background: rgba(30, 16, 12, 0.5);
  border: 1px solid rgba(226, 85, 31, 0.32);
  border-radius: 6px;
}
.kc-alert-sent-title {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #ffb98a;
  margin-bottom: 8px;
}
.kc-alert-sent-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.kc-alert-sent-row:first-of-type { border-top: none; }
.kc-alert-sent-name { font-size: 12px; font-weight: 600; color: #f1f5f9; }
.kc-alert-sent-etas { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.kc-alert-sent-eta {
  font-family: var(--font-mono); font-size: 11px;
  padding: 2px 7px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.07); color: #cbd5e1;
  white-space: nowrap;
}
.kc-alert-sent-eta-cut { background: rgba(226, 85, 31, 0.2); color: #ffcaa6; }

/* Aftermath variant (post-impact marauder_raid) */
.kc-alert-orbital-feed-aftermath img {
  filter: contrast(1.08) saturate(0.6) brightness(0.78);
}
.kc-alert-orbital-vignette-aftermath {
  background: radial-gradient(ellipse at center, transparent 30%, rgba(60, 20, 10, 0.55) 80%, rgba(0, 0, 0, 0.85) 100%);
}
.kc-alert-aftermath-badge {
  display: block;
  width: max-content;
  margin: 10px auto 12px;
  padding: 4px 12px;
  background: rgba(120, 50, 50, 0.18);
  border: 1px solid rgba(214, 58, 58, 0.4);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8c0c0;
}
@media (max-width: 720px) {
  .kc-alert-box { padding: 18px 18px 16px; }
  .kc-alert-title { font-size: 18px; }
  .kc-alert-cta-row { justify-content: stretch; }
  .kc-alert-btn { flex: 1; }
}

/* Threats panel (Amenazas) inside the Fleets pane */
.fleet-cmd-threats-panel {}
.fleet-threat-list { gap: 8px; display: flex; flex-direction: column; }
.fleet-threat-card {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(160deg, rgba(40, 14, 18, 0.55), rgba(28, 12, 16, 0.7));
  border: 1px solid rgba(255, 58, 58, 0.28);
  border-radius: 6px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}
.fleet-threat-card:hover { transform: translateY(-1px); border-color: rgba(255, 58, 58, 0.55); }
.fleet-threat-card.fleet-threat-imminent { border-color: rgba(255, 58, 58, 0.85); animation: kc-alert-pulse 1.6s ease-in-out infinite; }
.fleet-threat-card.fleet-threat-pulse { box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.9), 0 0 14px 4px rgba(255, 184, 64, 0.45); animation: fleet-threat-pulse 1.4s ease-in-out 3; }
@keyframes fleet-threat-pulse {
  0%   { box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.95), 0 0 14px 4px rgba(255, 184, 64, 0.55); }
  50%  { box-shadow: 0 0 0 3px rgba(255, 232, 156, 0.85), 0 0 20px 8px rgba(255, 184, 64, 0.35); }
  100% { box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.95), 0 0 14px 4px rgba(255, 184, 64, 0.55); }
}
.fleet-threat-thumb {
  width: 50px; height: 50px; border-radius: 50%;
  overflow: hidden; flex: none;
  border: 1px solid rgba(255, 58, 58, 0.4);
}
.fleet-threat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fleet-threat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fleet-threat-faction { font-weight: 700; color: #fff5f5; font-size: 13px; line-height: 1.2; }
.fleet-threat-target { font-size: 11px; color: rgba(226, 232, 240, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet-threat-eta { font-size: 14px; color: #ff9b9b; }
.fleet-threat-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.fleet-threat-chip {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase;
}
.fleet-threat-chip-imminent    { background: rgba(255, 58, 58, 0.25); color: #ff6b6b; border: 1px solid rgba(255, 58, 58, 0.55); }
.fleet-threat-chip-approaching { background: rgba(251, 191, 36, 0.18); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.45); }
.fleet-threat-chip-detected    { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.35); }
.fleet-threat-defend-btn {
  border: 1px solid rgba(255, 58, 58, 0.55);
  background: linear-gradient(135deg, #ff3a3a, #c1272d);
  color: #fff5f5;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: filter 120ms ease;
}
.fleet-threat-defend-btn:hover { filter: brightness(1.1); }
.fleet-threat-map-btn {
  border: 1px solid rgba(0, 240, 255, 0.45);
  background: rgba(0, 240, 255, 0.08);
  color: #d8f7ff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.fleet-threat-map-btn:hover {
  background: rgba(0, 240, 255, 0.16);
  border-color: rgba(0, 240, 255, 0.75);
}

/* F2a: pinned one-line threat rows (icon + name + countdown, tap = detail) */
.fleet-threat-line {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 4px 10px;
  text-align: left;
  background: linear-gradient(160deg, rgba(40, 14, 18, 0.55), rgba(28, 12, 16, 0.7));
  border: 1px solid rgba(255, 58, 58, 0.28);
  border-radius: 6px;
  cursor: pointer;
  min-width: 0;
}
.fleet-threat-line:hover { border-color: rgba(255, 58, 58, 0.55); }
.fleet-threat-line.fleet-threat-imminent { border-color: rgba(255, 58, 58, 0.85); animation: kc-alert-pulse 1.6s ease-in-out infinite; }
.fleet-threat-line.fleet-threat-pulse { box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.9), 0 0 14px 4px rgba(255, 184, 64, 0.45); animation: fleet-threat-pulse 1.4s ease-in-out 3; }
.fleet-threat-line .ftl-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; flex: none;
  border: 1px solid rgba(255, 58, 58, 0.4);
}
.fleet-threat-line .ftl-name {
  flex-shrink: 1;
  min-width: 0;
  font-weight: 700;
  color: #fff5f5;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fleet-threat-line .ftl-target {
  flex-shrink: 2;
  min-width: 0;
  font-size: 11.5px;
  color: rgba(226, 232, 240, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fleet-threat-line .ftl-eta {
  flex: none;
  margin-left: auto;
  font-size: 13px;
  color: #ff9b9b;
}
.fleet-threat-more {
  align-self: flex-start;
  min-height: 32px;
  padding: 4px 12px;
  background: none;
  border: 1px dashed rgba(255, 58, 58, 0.35);
  border-radius: 6px;
  color: #ff9b9b;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.fleet-threat-more:hover { border-color: rgba(255, 58, 58, 0.6); }

/* Bottom-nav threat badge */
#nav-flotas .nav-badge-threat {
  background: linear-gradient(135deg, #ff3a3a, #c1272d);
  color: #fff5f5;
  box-shadow: 0 0 8px rgba(255, 58, 58, 0.55);
}

/* Galaxy map ETA chip overlay */
.kc-map-eta-chips {
  position: absolute; inset: 0; pointer-events: none;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  z-index: 4;
}
.kc-map-eta-chip {
  position: absolute;
  background: rgba(8, 10, 18, 0.85);
  border: 1px solid rgba(255, 58, 58, 0.55);
  color: #ff9b9b;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transform: translate(8px, -16px);
  pointer-events: none;
}
.kc-map-eta-chip.kc-map-eta-imminent { border-color: rgba(255, 58, 58, 0.95); color: #ff6b6b; background: rgba(40, 8, 12, 0.92); }
.kc-map-eta-chip.kc-map-eta-approaching { border-color: rgba(251, 191, 36, 0.55); color: #fbbf24; }

/* Briefing threats section */
.kc-narrative-briefing .briefing-threats-title {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  color: #ff6b6b; text-transform: uppercase;
  margin: 14px 0 6px;
}
.kc-narrative-briefing .briefing-threat-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid rgba(255, 58, 58, 0.3);
  border-radius: 4px;
  background: rgba(40, 14, 18, 0.4);
}
.kc-narrative-briefing .briefing-threat-row .briefing-threat-text {
  display: flex; flex-direction: column; gap: 2px; font-size: 12px;
}
.kc-narrative-briefing .briefing-threat-row .briefing-threat-eta { color: #ff9b9b; font-family: var(--font-mono); }
.kc-narrative-briefing .briefing-threat-row button {
  background: linear-gradient(135deg, #ff3a3a, #c1272d);
  color: #fff5f5; border: none;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px; border-radius: 4px; cursor: pointer;
}

/* Killmail reveal: reuses the milestone scaffold for the cinematic teaser
   that surfaces a brand-new combat report. The verdict label sits where
   the tier title is on the milestone, color-coded relative to the viewer. */
.km-reveal .planet-milestone-tier-old {
  color: rgba(226, 232, 240, 0.85);
  text-decoration: none;
  margin-left: auto;
}
.km-reveal .planet-milestone-tier-new {
  color: rgba(226, 232, 240, 0.95);
  font-weight: 700;
  text-shadow: none;
}
.km-reveal-verdict {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.km-reveal-victory .km-reveal-verdict {
  color: #44ff88;
  text-shadow: 0 0 22px rgba(68, 255, 136, 0.45);
}
.km-reveal-defeat .km-reveal-verdict {
  color: #ff5d5d;
  text-shadow: 0 0 22px rgba(255, 93, 93, 0.45);
}
.km-reveal-draw .km-reveal-verdict {
  color: #ffc844;
  text-shadow: 0 0 22px rgba(255, 200, 68, 0.4);
}
.km-reveal .planet-milestone-box { border-color: rgba(34, 211, 238, 0.32); }
.km-reveal-victory .planet-milestone-box { border-color: rgba(68, 255, 136, 0.4); box-shadow: 0 40px 80px var(--scrim-60), 0 0 0 1px rgba(68, 255, 136, 0.18) inset, 0 0 90px rgba(68, 255, 136, 0.22); }
.km-reveal-defeat .planet-milestone-box  { border-color: rgba(255, 93, 93, 0.45);  box-shadow: 0 40px 80px var(--scrim-60), 0 0 0 1px rgba(255, 93, 93, 0.22) inset,  0 0 90px rgba(255, 93, 93, 0.22); }
.km-reveal-draw .planet-milestone-box    { border-color: rgba(255, 200, 68, 0.4);  box-shadow: 0 40px 80px var(--scrim-60), 0 0 0 1px rgba(255, 200, 68, 0.2) inset,  0 0 90px rgba(255, 200, 68, 0.2); }

/* ─── Probe feed: capa glitch + línea de escaneo sobre la animación del
   milestone. Solo visibles durante .probe-feed-glitching. ───────────── */
.probe-feed-glitch {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    linear-gradient(90deg, rgba(239, 68, 68, 0.0) 0%, rgba(239, 68, 68, 0.55) 48%, rgba(239, 68, 68, 0) 50%),
    linear-gradient(90deg, rgba(34, 211, 238, 0.0) 50%, rgba(34, 211, 238, 0.55) 52%, rgba(34, 211, 238, 0) 55%);
  opacity: 0;
}
.probe-feed-scanline {
  position: absolute;
  left: 0; right: 0;
  top: -8%;
  height: 22%;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(34, 211, 238, 0) 0%,
    rgba(34, 211, 238, 0.22) 45%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(34, 211, 238, 0.22) 55%,
    rgba(34, 211, 238, 0) 100%);
  opacity: 0;
}
.probe-feed-glitching .probe-feed-glitch {
  animation: probeFeedGlitch 2000ms steps(1, end) both;
}
.probe-feed-glitching .probe-feed-scanline {
  animation: probeFeedScan 2000ms cubic-bezier(0.33, 0, 0.67, 1) both;
}
.probe-feed-glitching .planet-milestone-img-new {
  animation: probeFeedImgGlitch 2000ms steps(8, end) both;
}
@keyframes probeFeedGlitch {
  0%   { opacity: 0; transform: translateX(0); }
  15%  { opacity: 0.85; transform: translateX(-5px); }
  20%  { opacity: 0.1; transform: translateX(4px); }
  35%  { opacity: 0.75; transform: translateX(6px); }
  40%  { opacity: 0.2; transform: translateX(-3px); }
  55%  { opacity: 0.55; transform: translateX(2px); }
  70%  { opacity: 0.25; }
  85%  { opacity: 0; }
  100% { opacity: 0; transform: translateX(0); }
}
@keyframes probeFeedScan {
  0%   { top: -30%; opacity: 0; }
  8%   { opacity: 0.95; }
  90%  { opacity: 0.9; }
  100% { top: 110%; opacity: 0; }
}
@keyframes probeFeedImgGlitch {
  0%   { filter: contrast(2.5) saturate(0.1) brightness(1.3); clip-path: inset(20% 0 60% 0); }
  20%  { filter: contrast(1.8) saturate(0.4) brightness(1.1); clip-path: inset(0 40% 30% 0); }
  35%  { filter: contrast(1.6) saturate(0.7) brightness(1.05); clip-path: inset(45% 0 10% 20%); }
  50%  { filter: contrast(1.4) saturate(0.85) brightness(1.02); clip-path: inset(0 10% 0 0); }
  70%  { filter: contrast(1.2) saturate(0.95) brightness(1.01); clip-path: inset(0); }
  100% { filter: none; clip-path: inset(0); }
}

/* ─── Overview alerts + Victory Progress page ───────────────────── */
.empire-overview-alerts { padding: 0; }
.empire-overview-alerts .empire-alerts-section-title {
  margin: 0 0 8px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}
.empire-overview-alerts .empire-alerts-section-title--threats {
  color: #ff6b6b;
}
.empire-overview-alerts .fleet-cmd-threats-panel {
  margin: 0 0 4px;
  padding-bottom: 0;
  border-bottom: none;
}
.empire-overview-alerts .fleet-cmd-threats-panel .fleet-threat-list {
  padding: 0 12px;
}
.empire-overview-alerts .empire-planet-alerts-block {
  margin-top: 4px;
}
.empire-overview-alerts .empire-planet-alerts-block .empire-alerts-section-title {
  margin-top: 14px;
}
.empire-pane-victorias .empire-victorias-cards {
  padding: 0 0 8px;
}
.empire-vc-chart {
  margin-top: 12px;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.empire-vc-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.empire-vc-chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.empire-vc-chart-tab {
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: rgba(15, 23, 42, 0.55);
  color: rgba(226, 232, 240, 0.85);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.empire-vc-chart-tab.active {
  border-color: rgba(125, 211, 252, 0.55);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}
.empire-vc-chart-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.empire-vc-chart-range {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.45);
  color: rgba(148, 163, 184, 0.85);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}
.empire-vc-chart-range.active {
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
}
.empire-vc-chart-body {
  position: relative;
}
.empire-vc-chart-axis-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  padding: 0 2px;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.75);
}
.empire-vc-chart-canvas {
  display: block;
  width: 100%;
  border-radius: 8px;
}
.empire-vc-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}
.empire-vc-chart-legend-item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 0.74rem;
  color: rgba(226, 232, 240, 0.88);
}
.empire-vc-chart-legend-item.is-you {
  color: #7dd3fc;
}
.empire-vc-chart-legend-swatch {
  width: 30px;
  height: 12px;
  flex-shrink: 0;
}
.empire-vc-chart-legend-pct {
  color: rgba(148, 163, 184, 0.9);
}
.empire-vc-chart-status {
  display: none;
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.9);
  text-align: center;
}
.empire-vc-chart-status.is-visible {
  display: block;
}
.empire-overview-empty {
  padding: 18px 16px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px dashed rgba(99, 102, 241, 0.22);
  color: rgba(226, 232, 240, 0.7);
  font-size: 13px;
  text-align: center;
}
.empire-vc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.empire-vc-card {
  position: relative;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(99, 102, 241, 0.22);
}
.empire-vc-card-met {
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.25) inset;
}
.empire-vc-card-dim { opacity: 0.55; }
.empire-vc-axes { display: flex; flex-direction: column; gap: 9px; }
.empire-vc-axis { display: flex; flex-direction: column; gap: 4px; }
.empire-vc-axis-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.empire-vc-axis-label { font-size: 11.5px; color: rgba(203, 213, 225, 0.85); }
.empire-vc-axis-val { font-size: 11.5px; color: rgba(148, 163, 184, 0.95); }
.empire-vc-axes .progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  overflow: hidden;
}
.empire-vc-axes .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.9), rgba(129, 140, 248, 1));
  transition: width 220ms ease;
}
.empire-vc-card-met .empire-vc-axes .progress-fill {
  background: linear-gradient(90deg, #facc15, #f59e0b);
}
.empire-vc-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.empire-vc-headmain {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.empire-vc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}
.empire-vc-pct {
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(129, 140, 248, 1);
}
.empire-vc-card-met .empire-vc-pct { color: #facc15; }

/* ─── Victory-path emblem: seal frame + scanline accent ─── */
.empire-vc-emblem {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  clip-path: polygon(24% 0, 76% 0, 100% 24%, 100% 76%, 76% 100%, 24% 100%, 0 76%, 0 24%);
  border: 1px solid color-mix(in srgb, var(--vc-accent, #818cf8) 45%, transparent);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--vc-accent, #818cf8) 22%, transparent), rgba(10, 16, 32, 0.9) 78%);
  color: var(--vc-accent, #818cf8);
  box-shadow: 0 0 14px color-mix(in srgb, var(--vc-accent, #818cf8) 18%, transparent) inset;
}
.empire-vc-emblem svg { width: 30px; height: 30px; }
.empire-vc-emblem--domination { --vc-accent: #ff8a66; }
.empire-vc-emblem--economic   { --vc-accent: #4ade9d; }
.empire-vc-emblem--scientist  { --vc-accent: #5bc8f8; }

/* ─── Completion gauge: arc ring around the % readout ─── */
.empire-vc-gauge {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.empire-vc-gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.empire-vc-gauge-track {
  fill: none;
  stroke: rgba(30, 41, 59, 0.95);
  stroke-width: 2.6;
}
.empire-vc-gauge-fill {
  fill: none;
  stroke: rgba(129, 140, 248, 0.95);
  stroke-width: 2.6;
  stroke-linecap: round;
}
.empire-vc-card-met .empire-vc-gauge-fill { stroke: #facc15; }

/* ─── Chips row (rank / leading path) ─── */
.empire-vc-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.empire-vc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: rgba(226, 232, 240, 0.92);
  white-space: nowrap;
}
.empire-vc-chip svg { width: 11px; height: 11px; }
.empire-vc-chip-lead {
  border-color: rgba(250, 204, 21, 0.5);
  background: rgba(250, 204, 21, 0.1);
  color: #fde68a;
}
.empire-vc-chip-rank {
  font-family: var(--font-mono, monospace);
  border-color: rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
}

/* ─── Milestone ticks on the axis bars ─── */
.empire-vc-bar { position: relative; }
.empire-vc-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(148, 163, 184, 0.55);
}
.empire-vc-tick.is-hit { background: rgba(226, 232, 240, 0.95); }
.empire-vc-axes .progress-bar.empire-vc-bar { height: 8px; }

/* ─── Race strip: you vs closest rival ─── */
.empire-vc-race {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 7px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(10, 16, 32, 0.6);
}
.empire-vc-race-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.1) 0 1px, transparent 1px 10%),
    rgba(30, 41, 59, 0.6);
}
.empire-vc-race-track::after {
  content: '';
  position: absolute;
  right: 3px;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 2px;
  background: repeating-linear-gradient(0deg, rgba(226, 232, 240, 0.85) 0 2px, rgba(15, 23, 42, 0.9) 2px 4px);
}
.empire-vc-race-marker {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.empire-vc-race-marker i {
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.03em;
}
/* You: solid rounded flag riding above the lane */
.empire-vc-race-marker--you {
  transform: translate(-50%, -50%);
  z-index: 2;
  min-width: 22px;
  height: 15px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.92);
  border: 1px solid #bae6fd;
  color: #04222e;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}
/* Rival: outlined diamond under the lane */
.empire-vc-race-marker--rival {
  transform: translate(-50%, -50%) rotate(45deg);
  z-index: 1;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(250, 204, 21, 0.85);
  color: #fde68a;
}
.empire-vc-race-marker--rival i { transform: rotate(-45deg); }
.empire-vc-race-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: rgba(203, 213, 225, 0.9);
}
.empire-vc-race-label b { color: #fde68a; font-weight: 700; }
.empire-vc-race-alert .empire-vc-race-label { color: rgba(248, 200, 120, 1); font-weight: 600; }

/* ─── Leading path: subtle glow lift ─── */
.empire-vc-card-lead {
  border-color: rgba(250, 204, 21, 0.4);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.14), 0 0 0 1px rgba(250, 204, 21, 0.18) inset;
}
.empire-vc-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(203, 213, 225, 0.85);
}
.empire-vc-progress .progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  overflow: hidden;
}
.empire-vc-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.9), rgba(129, 140, 248, 1));
  transition: width 220ms ease;
}
.empire-vc-card-met .empire-vc-progress .progress-fill {
  background: linear-gradient(90deg, #facc15, #f59e0b);
}
.empire-vc-leader-empty {
  color: rgba(148, 163, 184, 0.7);
  font-style: italic;
  font-size: 11.5px;
}

/* --- Colonies pane subtabs (Status / Build queue) --- */
.empire-section.empire-section-tight {
  gap: 0;
}
.empire-section.empire-section-tight > .section-header:empty {
  display: none;
}
.colonies-subtabs {
  margin-top: 0;
  margin-bottom: 4px;
}
.colonies-subtabs .kc-subtab {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}
@media (max-width: 600px) {
  .colonies-subtabs .kc-subtab {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    padding: 9px 8px;
  }
}

/* --- Build queue rows (active + queued construction tasks per colony) --- */
.bq-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bq-rows .task-card {
  margin: 0;
}
.empire-autofarm-toggle {
  appearance: none;
  display: inline-block;
  width: 12px;
  height: 12px;
  padding: 0;
  margin-left: 6px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.18);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.empire-autofarm-toggle:hover { border-color: rgba(52, 211, 153, 0.55); }
.empire-autofarm-toggle.is-active {
  background: #34d399;
  border-color: rgba(52, 211, 153, 0.8);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}
.empire-autofarm-toggle:disabled { opacity: 0.5; cursor: wait; }

/* Per-colony autofarm toggle in the colonies list (icon + ON/OFF state). */
.empire-af-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 7px 1px 5px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 20px;
  background: rgba(8, 12, 22, 0.6);
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: 0.04em;
  cursor: pointer;
  vertical-align: middle;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.empire-af-toggle:hover { border-color: rgba(52, 211, 153, 0.5); }
.empire-af-toggle.is-active {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.18);
}
.empire-af-toggle:disabled { opacity: 0.45; cursor: not-allowed; }
.empire-af-toggle-icon {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  flex: none;
}
.empire-af-toggle-state { font-weight: 600; }

/* --- Build queue subtab --- */
.colonies-buildqueue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}
.bq-colony-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: rgba(8, 12, 22, 0.55);
  padding: 10px 12px;
}
.bq-colony-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.bq-colony-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.bq-colony-coords {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.bq-recs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bq-rec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px;
  border-radius: 4px;
}
.bq-rec-row:hover { background: rgba(148, 163, 184, 0.05); }
.bq-rec-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.bq-rec-name {
  font-size: 0.85rem;
  color: var(--text);
}
.bq-rec-cost {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.bq-rec-build {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 0.78rem;
}
.bq-rows .task-card.recommended {
  background: rgba(16, 185, 129, 0.05);
  border: 1px dashed rgba(16, 185, 129, 0.25);
  opacity: 0.95;
}
.bq-rows .task-card.recommended .task-card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bq-rec-cost-row {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 4px 0;
}
.bq-rec-locked {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 6px 4px;
}

/* ─── VC quests ─── */
.empire-vc-quest-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 68px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.empire-vc-quest-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.empire-vc-quest-btn--domination { box-shadow: 0 0 0 1px rgba(255, 107, 74, 0.35); }
.empire-vc-quest-btn--economic   { box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35); }
.empire-vc-quest-btn--scientist  { box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35); }
.empire-vc-quest-btn:hover { transform: scale(1.08); }
.empire-vc-quest-btn:active { transform: scale(0.94); }
.empire-vc-quest-btn[data-badge] {
  box-shadow: 0 0 0 2px rgba(255, 196, 92, 0.75), 0 0 12px rgba(255, 196, 92, 0.35);
}

.empire-quest-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 10, 22, 0.92);
}
.empire-quest-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow: hidden;
  padding: 18px 20px 22px;
  border-radius: 16px;
  background: rgba(12, 18, 36, 0.98);
  border: 1px solid rgba(120, 160, 255, 0.25);
}
.empire-quest-panel-head,
.empire-quest-panel-tabs {
  flex-shrink: 0;
}
.empire-quest-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.empire-quest-panel--domination { border-color: rgba(255, 107, 74, 0.35); }
.empire-quest-panel--economic   { border-color: rgba(52, 211, 153, 0.35); }
.empire-quest-panel--scientist  { border-color: rgba(56, 189, 248, 0.35); }
.empire-quest-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding-right: 28px;
}
.empire-quest-panel-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(8, 12, 28, 0.65);
}
.empire-quest-panel-icon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.empire-quest-panel-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #eef2ff;
}
.empire-quest-panel-subtitle {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #94a3c8;
}
.empire-quest-tabs {
  display: flex;
  gap: 8px;
  margin: 0;
  border-bottom: 1px solid rgba(120, 160, 255, 0.15);
  padding-bottom: 10px;
}
.empire-quest-panel-tabs {
  margin-bottom: 16px;
}
.empire-quest-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #8fa0c8;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.empire-quest-tab.active {
  background: rgba(99, 102, 241, 0.22);
  color: #eef2ff;
}
.empire-quest-tab-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(120, 160, 255, 0.25);
  font-size: 0.75rem;
  font-weight: 700;
}
/* VC filter chips inside the Available tab */
.empire-quest-vc-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.empire-quest-vc-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(120, 160, 255, 0.22);
  background: rgba(20, 28, 50, 0.6);
  color: #9fb0d8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.empire-quest-vc-chip:hover { border-color: rgba(150, 185, 255, 0.45); }
.empire-quest-vc-chip.is-active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(150, 185, 255, 0.6);
  color: #eef2ff;
}
.empire-quest-vc-chip-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
}
.empire-quest-vc-chip-icon img { width: 100%; height: 100%; object-fit: contain; }
.empire-quest-vc-chip-count {
  min-width: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(120, 160, 255, 0.28);
  font-size: 0.72rem;
  font-weight: 700;
}
.empire-quest-offer-lore,
.empire-quest-offer-intro {
  font-size: 0.86rem;
  line-height: 1.55;
  color: #b6c2e0;
  margin: 0 0 8px;
}
.empire-quest-offer-step {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #9fb0d8;
  margin: 0 0 10px;
}
.empire-quest-offer-step-label {
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #7dd3fc;
}
.empire-quest-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 28px 16px;
  text-align: center;
  color: #8fa0c8;
  font-size: 0.9rem;
  line-height: 1.5;
}
.empire-quest-offer-list {
  display: flex;
  flex-direction: column;
}
.empire-quest-offer {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 16px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid rgba(120, 160, 255, 0.14);
}
.empire-quest-offer:first-child { padding-top: 4px; }
.empire-quest-offer:last-child { border-bottom: none; padding-bottom: 4px; }
@media (max-width: 520px) {
  .empire-quest-offer {
    grid-template-columns: 96px 1fr;
    gap: 12px;
  }
}
.empire-quest-art-frame {
  border-radius: 4px;
  border-style: solid;
  border-width: 5px;
  border-image-source: url('../../assets/ui/hud-frame.webp');
  border-image-slice: 94;
  border-image-width: 5px;
  border-image-repeat: stretch;
  overflow: hidden;
  background: rgba(8, 12, 24, 0.95);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 0 10px rgba(0, 0, 0, 0.45);
}
.empire-quest-offer-art {
  margin: 0;
  flex-shrink: 0;
}
.empire-quest-offer-art .empire-quest-art-frame img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.empire-quest-active-thumb {
  flex-shrink: 0;
  width: 52px;
}
.empire-quest-active-thumb .empire-quest-art-frame {
  border-width: 4px;
  border-image-width: 4px;
}
.empire-quest-active-thumb .empire-quest-art-frame img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
}
.empire-quest-offer-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.empire-quest-offer-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #eef2ff;
}
.empire-quest-offer-intro {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #b8c5e0;
}
.empire-quest-offer-meta {
  font-size: 0.75rem;
  color: #7d8eb5;
}
.empire-quest-capstone-line {
  font-size: 0.78rem;
  color: #c8d4f0;
}
.empire-quest-accept-btn {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 0.85rem;
}
.empire-quest-active-list {
  display: flex;
  flex-direction: column;
}
.empire-quest-active {
  border-bottom: 1px solid rgba(120, 160, 255, 0.14);
  overflow: hidden;
}
.empire-quest-active:last-child { border-bottom: none; }
.empire-quest-active.is-expanded {
  background: rgba(15, 23, 42, 0.28);
}
.empire-quest-active-done { opacity: 0.75; }
.empire-quest-active-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.empire-quest-active-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.empire-quest-active-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #eef2ff;
}
.empire-quest-active-progress {
  font-size: 0.78rem;
  color: #9fb0d8;
  line-height: 1.35;
}
.empire-quest-active-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #8fa0c8;
}
.empire-quest-active-detail {
  padding: 0 0 16px 64px;
  border-top: 1px solid rgba(120, 160, 255, 0.1);
}
@media (max-width: 520px) {
  .empire-quest-active-detail { padding-left: 0; }
}
.empire-quest-ring-note {
  font-size: 0.75rem;
  color: #7d8eb5;
  margin-bottom: 10px;
}
.empire-quest-hero {
  margin: -18px -20px 14px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}
.empire-quest-hero img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}
.empire-quest-title {
  margin: 0 0 3px;
  font-size: 1.15rem;
  color: #e6ecff;
}
.empire-quest-intro {
  font-size: 0.85rem;
  color: #b6c2e0;
  margin: 0 0 14px;
  line-height: 1.45;
}
.empire-quest-milestones {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.empire-quest-milestone {
  padding: 10px 0 10px 12px;
  border-left: 2px solid rgba(120, 160, 255, 0.28);
  background: transparent;
}
.empire-quest-ms-locked { opacity: 0.5; }
.empire-quest-ms-done { border-left-color: rgba(110, 220, 150, 0.65); }
.empire-quest-ms-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.empire-quest-ms-title { font-size: 0.9rem; color: #dde5ff; }
.empire-quest-ms-state { font-size: 0.7rem; color: #8fa0c8; white-space: nowrap; }
.empire-quest-ms-beat {
  font-size: 0.78rem;
  color: #9fadcf;
  margin: 4px 0 6px;
  line-height: 1.4;
}
.empire-quest-ms-progress {
  height: 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.empire-quest-ms-bar {
  height: 100%;
  background: linear-gradient(90deg, #2ad1a8, #6ee0c0);
}
.empire-quest-ms-foot {
  margin-top: 6px;
  font-size: 0.72rem;
  color: #9fb0d8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.empire-quest-ms-map-btn {
  flex-shrink: 0;
  font-size: 0.72rem;
  padding: 4px 10px;
}
.empire-quest-ms-locked-hint {
  font-size: 0.72rem;
  color: #6b7799;
  font-style: italic;
  margin-top: 4px;
}
.empire-quest-capstone {
  margin-top: 14px;
  padding: 10px 0 0 12px;
  border-left: 2px solid rgba(150, 185, 255, 0.45);
  background: transparent;
}
.empire-quest-capstone-label {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9fb0d8;
  margin-bottom: 4px;
}
.empire-quest-capstone-body {
  font-size: 0.85rem;
  color: #dde5ff;
}
/* Multi-quest panel: stacked quest cards, one per saga */
.empire-quest-card + .empire-quest-card {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(120, 160, 255, 0.18);
}
.empire-quest-card-done { opacity: 0.7; }
.empire-quest-card-done .empire-quest-title::after {
  content: ' \2713';
  color: #6ee0c0;
}
/* Side-entry button (e.g. Pirate Hunt) under the victory grid */
.empire-side-entry-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 255, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #dde5ff;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.empire-side-entry-btn:hover { border-color: rgba(120, 160, 255, 0.55); }
.empire-side-entry-btn:active { transform: scale(0.99); }
.empire-side-entry-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empire-side-entry-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.empire-side-entry-label { flex: 1; text-align: left; font-weight: 600; font-size: 0.9rem; }

/* Pirate Hunt entry button */
.empire-pirate-btn {
  margin-top: 10px;
  border-color: rgba(225, 80, 80, 0.30);
}
.empire-pirate-btn:hover { border-color: rgba(225, 80, 80, 0.60); }
.empire-pirate-btn .empire-side-entry-icon svg { width: 24px; height: 24px; color: #ff8a7a; }

/* ── Pirate Hunt overlay (reuses .empire-quest-overlay / .empire-quest-panel) ── */
.pq-panel { max-width: 760px; padding: 0; }
.pq-panel .pq-close { z-index: 3; color: #e7ecff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.pq-panel-body { overflow-y: auto; max-height: 88vh; }
.pq-loading { padding: 48px 20px; text-align: center; color: #9fb0d8; }

.pq-phase { display: flex; flex-direction: column; }

.pq-splash {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 1408 / 768;
  overflow: hidden;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: #0a1022;
}
.pq-splash img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pq-splash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 28, 0) 55%, rgba(10, 14, 30, 0.92) 100%);
  pointer-events: none;
}
.pq-splash-cap {
  position: absolute;
  left: 18px;
  bottom: 14px;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffd7c7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}
.pq-splash-cap--victory { color: #ffe39c; }

.pq-lore, .pq-stage-body { padding: 16px 22px 6px; }
.pq-title { margin: 0 0 8px; font-size: 1.4rem; font-weight: 800; color: #f1f5ff; }
.pq-lore-text, .pq-stage-text {
  margin: 0 0 4px;
  font-size: 0.96rem;
  line-height: 1.55;
  color: #c6d2f0;
}
.pq-coords { margin: 0 0 8px; font-size: 0.82rem; color: #8fa0c8; }

/* Objective tracker */
.pq-tracker { list-style: none; margin: 14px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pq-step { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #8593b8; }
.pq-step-mark {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 0.72rem;
  background: rgba(40, 52, 84, 0.6);
  color: #6f7ea6;
}
.pq-step--done { color: #cfe6d4; }
.pq-step--done .pq-step-mark { background: rgba(52, 211, 153, 0.22); color: #6ee7b7; }
.pq-step--current { color: #ffe3d2; font-weight: 700; }
.pq-step--current .pq-step-mark { background: rgba(255, 138, 122, 0.24); color: #ff8a7a; }

/* Reward teaser (offer) */
.pq-reward-teaser {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 22px 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 196, 92, 0.30);
  background: rgba(20, 18, 10, 0.55);
  color: #ffe7b8;
  cursor: pointer;
  font-size: 0.88rem;
}
.pq-reward-teaser:hover { border-color: rgba(255, 196, 92, 0.6); }
.pq-reward-teaser svg { width: 20px; height: 20px; color: #ffd166; }
.pq-reward-teaser-name { margin-left: auto; font-weight: 700; color: #fff0cf; }

/* Actions */
.pq-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 22px 22px; }
.pq-actions .btn, .pq-actions .btn-primary, .pq-actions .btn-secondary, .pq-actions .btn-danger { flex: 1 1 auto; }
.pq-accept-btn { font-size: 1rem; }

/* Reward card (completion + modal) */
.pq-reward {
  display: flex;
  gap: 16px;
  margin: 8px 22px 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 196, 92, 0.30);
  background: linear-gradient(135deg, rgba(34, 26, 12, 0.7), rgba(16, 20, 38, 0.7));
}
.pq-reward-art { position: relative; flex-shrink: 0; width: 120px; }
.pq-reward-art img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; }
.pq-reward-rarity {
  position: absolute;
  left: 6px; bottom: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(8, 12, 28, 0.85);
  color: #cdd8f5;
}
.pq-reward-rarity--legendary { color: #ffcf66; box-shadow: 0 0 0 1px rgba(255, 207, 102, 0.5); }
.pq-reward-body { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.pq-reward-kicker { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #b9a06a; }
.pq-reward-name { font-size: 1.15rem; font-weight: 800; color: #ffe7b0; }
.pq-reward-effect { margin: 2px 0 0; font-size: 0.9rem; line-height: 1.5; color: #d7dcef; }
.pq-reward-credits { margin-top: 4px; font-size: 0.82rem; color: #6ee7b7; }

.pq-reward--big { margin: 0; flex-direction: column; align-items: center; text-align: center; }
.pq-reward--big .pq-reward-art { width: 200px; }
.pq-reward--big .pq-reward-art img { width: 200px; height: 200px; }
.pq-reward--big .pq-reward-body { align-items: center; }

.pq-reward-modal { padding: 4px 2px; }
.pq-reward-modal-title { margin: 0 0 14px; font-size: 1.25rem; font-weight: 800; color: #ffe7b0; text-align: center; }

@media (max-width: 560px) {
  .pq-reward { flex-direction: column; align-items: center; text-align: center; }
  .pq-reward-body { align-items: center; }
  .pq-title { font-size: 1.2rem; }
}

/* Activos: artifact cards */
.empire-artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.empire-artifact-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
}
.empire-artifact-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 5px;
}
.fleet-cmd-section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #cdd8f5;
  margin: 6px 0 10px;
}
.fleet-cmd-section-head .icon { width: 16px; height: 16px; }

/* ── Domination missions panel ── */
.dom-mission-overlay { z-index: 960; }
.dom-mission-panel {
  position: relative;
  width: 100%;
  max-width: 760px;
  height: min(90vh, 720px);
  max-height: min(90vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dom-mission-panel-head { padding: 20px 20px 8px; flex-shrink: 0; }
.dom-mission-panel-head h2 { margin: 0 0 6px; font-size: 1.25rem; }
.dom-mission-panel-head p { margin: 0; color: #9fb0d8; font-size: 0.88rem; }
.dom-mission-reseed-next--waiting {
  color: #fde68a;
}
.dom-mission-reseed-next {
  margin: 0;
  color: #9fb0d8;
  font-size: 0.85rem;
}
.dom-mission-reseed-next .dom-mission-countdown { font-size: 0.85rem; }
.dom-mission-tabs {
  display: flex;
  gap: 6px;
  padding: 0 16px 10px;
  border-bottom: 1px solid rgba(120, 160, 255, 0.14);
  flex-shrink: 0;
}
.dom-mission-tab {
  display: flex;
  flex: 1 1 0;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  position: relative;
  padding: 10px 8px;
  border: 1px solid rgba(120, 160, 255, 0.16);
  border-radius: 10px;
  background: rgba(8, 16, 32, 0.45);
  color: #9fb0d8;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.dom-mission-tab-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.12s, filter 0.12s;
}
.dom-mission-tab-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 4px rgba(120, 160, 255, 0.35));
}
.dom-mission-tab-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dom-mission-tab.is-active .dom-mission-tab-icon { opacity: 1; }
.dom-mission-tab--explore.is-active .dom-mission-tab-icon img {
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.55));
}
.dom-mission-tab--colonize.is-active .dom-mission-tab-icon img {
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.55));
}
.dom-mission-tab--attack.is-active .dom-mission-tab-icon img,
.dom-mission-tab--operations.is-active .dom-mission-tab-icon img {
  filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.55));
}
.dom-mission-tab.is-active {
  color: #eef2ff;
  border-color: rgba(120, 160, 255, 0.38);
  background: rgba(99, 102, 241, 0.18);
}
.dom-mission-tab--explore.is-active {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.12);
  color: #fef08a;
}
.dom-mission-tab--colonize.is-active {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}
.dom-mission-tab--attack.is-active,
.dom-mission-tab--operations.is-active {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}
.dom-mission-tab-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 0 2px rgba(8, 16, 32, 0.8);
}
.dom-mission-tab-badge--done {
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(8, 16, 32, 0.8), 0 0 8px rgba(74, 222, 128, 0.45);
}
.dom-mission-card--tabbed .dom-mission-head {
  justify-content: flex-end;
  min-height: 0;
}
.dom-mission-card--tabbed .dom-mission-head:empty {
  display: none;
}
.dom-mission-card--tabbed {
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-bottom: none;
}
.dom-mission-tabbed-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}
.dom-mission-hero {
  position: relative;
  width: 100%;
  min-height: 108px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.dom-mission-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.dom-mission-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(6, 12, 28, 0.94) 0%,
    rgba(6, 12, 28, 0.78) 42%,
    rgba(6, 12, 28, 0.28) 100%
  );
}
.dom-mission-hero--explore .dom-mission-hero-scrim {
  background: linear-gradient(
    105deg,
    rgba(20, 16, 4, 0.94) 0%,
    rgba(12, 14, 28, 0.76) 45%,
    rgba(6, 12, 28, 0.22) 100%
  );
}
.dom-mission-hero--colonize .dom-mission-hero-scrim {
  background: linear-gradient(
    105deg,
    rgba(4, 20, 12, 0.94) 0%,
    rgba(8, 16, 28, 0.76) 45%,
    rgba(6, 12, 28, 0.22) 100%
  );
}
.dom-mission-hero--attack .dom-mission-hero-scrim {
  background: linear-gradient(
    105deg,
    rgba(24, 6, 8, 0.94) 0%,
    rgba(14, 10, 28, 0.76) 45%,
    rgba(6, 12, 28, 0.22) 100%
  );
}
.dom-mission-hero--explore { box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.28); }
.dom-mission-hero--colonize { box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.28); }
.dom-mission-hero--attack { box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.28); }
.dom-mission-hero-copy {
  position: relative;
  z-index: 1;
  padding: 14px 16px;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.dom-mission-hero-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  color: #f4f7ff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.dom-mission-hero-desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(220, 230, 250, 0.9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  max-width: 92%;
}
.dom-mission-hero-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}
.dom-mission-card--tabbed .dom-explore-targets {
  align-self: stretch;
  width: 100%;
  margin-top: 0;
}
.dom-mission-card--tabbed .dom-mission-fail {
  margin-top: 0;
  margin-bottom: 10px;
}
.dom-mission-card--tabbed .dom-mission-actions {
  margin-top: auto;
  padding-top: 12px;
}
.dom-mission-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 16px 20px;
  display: flex;
  flex-direction: column;
}
.dom-mission-list > .dom-mission-card {
  flex: 1 1 auto;
  min-height: 0;
}
.dom-mission-list > .dom-mission-empty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.dom-mission-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid rgba(120, 160, 255, 0.14);
}
.dom-mission-card:first-child { padding-top: 4px; }
.dom-mission-card:last-child { border-bottom: none; padding-bottom: 4px; }
.dom-mission-art {
  flex-shrink: 0;
  width: 96px;
}
.dom-mission-art .empire-quest-art-frame img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
}
.dom-mission-body { flex: 1; min-width: 0; }
.dom-mission-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.dom-mission-head-badge {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}
.dom-mission-title { margin: 0; font-size: 1rem; }
.dom-mission-countdown {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fbbf24;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.dom-mission-countdown--paused {
  color: rgba(251, 191, 36, 0.72);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: none;
}
.dom-mission-countdown--active {
  color: #5eead4;
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: none;
}
.dom-mission-status-failed {
  font-size: 0.72rem;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 6px;
}
.dom-mission-status-completed {
  font-size: 0.72rem;
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 6px;
}
.dom-mission-card.dom-mission-completed .dom-mission-hero-scrim {
  background: linear-gradient(180deg, rgba(8, 16, 32, 0.15) 0%, rgba(8, 16, 32, 0.72) 55%, rgba(8, 24, 16, 0.92) 100%);
}
.dom-mission-done {
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.28);
}
.dom-mission-done-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #86efac;
  margin-bottom: 6px;
}
.dom-mission-done-target {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: #e2e8f0;
  font-weight: 600;
}
.dom-mission-done-result {
  margin: 0;
  font-size: 0.82rem;
  color: #bbf7d0;
}
.dom-mission-done-result-label {
  color: #86efac;
  font-weight: 600;
}
.dom-mission-desc { margin: 6px 0; font-size: 0.86rem; color: #c8d6f0; }
.dom-mission-fail {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(225, 80, 80, 0.12);
  border: 1px solid rgba(225, 80, 80, 0.25);
  font-size: 0.82rem;
  color: #ffb4a8;
}
.dom-mission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.dom-mission-actions > .btn,
.dom-mission-actions > .dom-mission-map-icon-btn {
  flex: 0 1 auto;
  min-height: 34px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.dom-mission-map-icon-btn {
  flex: 0 0 auto;
  padding: 5px 10px;
  min-height: 0;
  font: 600 0.68rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #67e8f9;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.38);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.08);
}
.dom-mission-map-icon-btn:hover,
.dom-mission-map-icon-btn:focus-visible {
  color: #ecfeff;
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.62);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.18);
}
.dom-explore-target-actions .dom-mission-map-icon-btn {
  padding: 4px 9px;
}
.dom-mission-report-btn {
  color: #c4b5fd;
  background: rgba(170, 102, 255, 0.08);
  border-color: rgba(170, 102, 255, 0.4);
  box-shadow: 0 0 10px rgba(170, 102, 255, 0.08);
}
.dom-mission-report-btn:hover,
.dom-mission-report-btn:focus-visible {
  color: #f5f3ff;
  background: rgba(170, 102, 255, 0.18);
  border-color: rgba(196, 132, 255, 0.7);
  box-shadow: 0 0 14px rgba(170, 102, 255, 0.2);
}
.dom-report-box {
  max-width: 360px;
}
.dom-report-hero {
  display: flex;
  justify-content: center;
  margin: 10px 0 4px;
}
.dom-report-hero-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.18));
}
.dom-report-specs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 10px 0 0;
  padding: 0;
}
.dom-report-spec {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 10px;
  border: 1px solid rgba(120, 160, 255, 0.16);
  border-radius: 6px;
  background: rgba(20, 30, 56, 0.4);
}
.dom-report-spec dt {
  font-size: 0.74rem;
  color: #9fb0d8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dom-report-spec dd {
  margin: 0;
  font-size: 0.82rem;
  color: #e6edff;
}
.dom-report-mods {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.04);
}
.dom-report-mods-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.7rem;
  color: #67e8f9;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dom-report-mods--none {
  font-size: 0.8rem;
  color: #9fb0d8;
  text-align: center;
  font-style: italic;
  border-style: dashed;
  background: none;
}
.dom-explore-target-actions .dom-mission-probe-btn,
.dom-explore-target-actions .dom-mission-attack-btn,
.dom-explore-target-actions .dom-mission-spy-btn {
  padding: 4px 11px;
}
.dom-mission-spy-btn {
  flex: 0 0 auto;
  padding: 4px 11px;
  min-height: 0;
  font: 600 0.68rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f5f3ff;
  background: rgba(170, 102, 255, 0.88);
  border: 1px solid rgba(196, 132, 255, 0.95);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(170, 102, 255, 0.24);
}
.dom-mission-spy-btn:hover,
.dom-mission-spy-btn:focus-visible {
  background: #c084fc;
  border-color: #d8b4fe;
  box-shadow: 0 0 16px rgba(170, 102, 255, 0.34);
}
.dom-mission-spy-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  color: #d8b4fe;
  background: rgba(170, 102, 255, 0.08);
  border-color: rgba(170, 102, 255, 0.28);
  box-shadow: none;
}
.dom-mission-probe-btn {
  flex: 0 0 auto;
  padding: 4px 11px;
  min-height: 0;
  font: 600 0.68rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b1220;
  background: rgba(0, 240, 255, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.9);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.22);
}
.dom-mission-probe-btn:hover,
.dom-mission-probe-btn:focus-visible {
  background: #67e8f9;
  border-color: #a5f3fc;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.32);
}
.dom-mission-probe-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  color: #67e8f9;
  background: rgba(0, 240, 255, 0.06);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: none;
}
.dom-mission-colonize-btn,
.dom-mission-attack-btn {
  flex: 0 0 auto;
  padding: 5px 12px;
  min-height: 0;
  font: 600 0.68rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b1220;
  border-radius: 4px;
}
.dom-mission-colonize-btn {
  background: rgba(0, 240, 255, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.9);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.22);
}
.dom-mission-colonize-btn:hover,
.dom-mission-colonize-btn:focus-visible {
  background: #67e8f9;
  border-color: #a5f3fc;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.32);
}
.dom-mission-attack-btn {
  color: #fee2e2;
  background: rgba(255, 68, 68, 0.16);
  border: 1px solid rgba(255, 68, 68, 0.6);
  box-shadow: 0 0 12px rgba(255, 68, 68, 0.14);
}
.dom-mission-attack-btn:hover,
.dom-mission-attack-btn:focus-visible {
  color: #fff;
  background: rgba(255, 68, 68, 0.28);
  border-color: rgba(255, 68, 68, 0.85);
  box-shadow: 0 0 16px rgba(255, 68, 68, 0.26);
}
.dom-mission-killmail-btn,
.dom-mission-combat-btn {
  flex: 0 0 auto;
  padding: 5px 12px;
  min-height: 0;
  font: 600 0.68rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe6c2;
  background: rgba(255, 150, 64, 0.16);
  border: 1px solid rgba(255, 150, 64, 0.6);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(255, 150, 64, 0.14);
}
.dom-mission-killmail-btn:hover,
.dom-mission-killmail-btn:focus-visible,
.dom-mission-combat-btn:hover,
.dom-mission-combat-btn:focus-visible {
  color: #fff;
  background: rgba(255, 150, 64, 0.28);
  border-color: rgba(255, 150, 64, 0.85);
  box-shadow: 0 0 16px rgba(255, 150, 64, 0.26);
}
.dom-target-action-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 88px;
}
.dom-explore-target-actions--resolved {
  flex-direction: column;
  align-items: stretch;
}
.dom-target-action-stack .dom-mission-map-icon-btn,
.dom-target-action-stack .dom-mission-combat-btn {
  width: 100%;
  flex: 0 0 auto;
}
.dom-mission-outcome {
  margin: 8px 0 0;
  font: 600 0.74rem/1.3 var(--font-mono);
  letter-spacing: 0.04em;
}
.dom-mission-outcome-label {
  color: #9fb0d8;
  margin-right: 6px;
}
.dom-mission-outcome--attacker_wins { color: #86efac; }
.dom-mission-outcome--defender_wins { color: #fca5a5; }
.dom-mission-outcome--draw { color: #fcd34d; }
.dom-mission-empty { padding: 32px 16px; text-align: center; color: #8fa0c8; }

.dom-mission-proposals { flex: 0 0 auto; width: 100%; }
.dom-mission-tracking {
  flex: 0 0 auto;
  margin-top: 16px;
  padding: 10px 0 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.dom-mission-tracking-title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(159, 176, 216, 0.9);
}
.dom-mission-tracking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dom-tracking-row {
  display: block;
  padding: 0;
  border: none;
}
.dom-tracking-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 12px;
  background: rgba(8, 12, 24, 0.72);
  border: 1px solid rgba(120, 160, 255, 0.16);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}
.dom-tracking-row--explore .dom-tracking-card {
  border-color: rgba(94, 234, 212, 0.22);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(8, 12, 24, 0.78));
}
.dom-tracking-row--colonize .dom-tracking-card {
  border-color: rgba(74, 222, 128, 0.22);
  background: linear-gradient(135deg, rgba(22, 101, 52, 0.12), rgba(8, 12, 24, 0.78));
}
.dom-tracking-row--attack .dom-tracking-card {
  border-color: rgba(248, 113, 113, 0.22);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.12), rgba(8, 12, 24, 0.78));
}
.dom-tracking-row--colonize.dom-tracking-row--arrived .dom-tracking-card {
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.08);
}
.dom-tracking-row--attack.dom-tracking-row--arrived .dom-tracking-card {
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.08);
}
.dom-tracking-row--arrived .dom-tracking-card {
  box-shadow: 0 0 20px rgba(94, 234, 212, 0.08);
}
.dom-tracking-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.dom-tracking-hero {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(120, 160, 255, 0.2);
  overflow: hidden;
}
.dom-tracking-hero--star {
  border-radius: 50%;
  border-color: rgba(255, 220, 140, 0.35);
  box-shadow: 0 0 16px rgba(255, 200, 100, 0.2);
}
.dom-tracking-hero--planet,
.dom-tracking-hero--moon {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  overflow: visible;
  border-radius: 50%;
}
.dom-tracking-hero--processing::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 30%, rgba(94, 234, 212, 0.35) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: dom-tracking-scan 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes dom-tracking-scan {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
.dom-tracking-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.dom-tracking-hero-img--round {
  object-fit: cover;
  border-radius: 50%;
}
.dom-tracking-planet-strip {
  width: 100%;
  text-align: center;
}
.dom-tracking-planet-strip-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}
.dom-tracking-planet-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(170, 102, 255, 0.35);
  background: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.dom-tracking-planet-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dom-tracking-planet-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(88, 28, 135, 0.45);
  border: 1px solid rgba(167, 139, 250, 0.35);
}
.dom-tracking-planet-strip-label {
  display: block;
  margin-top: 4px;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(159, 176, 216, 0.85);
  line-height: 1.2;
}
.dom-tracking-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.dom-tracking-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.dom-tracking-type {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.9);
  font-weight: 600;
  flex-shrink: 0;
}
.dom-tracking-row--colonize .dom-tracking-type { color: rgba(74, 222, 128, 0.95); }
.dom-tracking-row--attack .dom-tracking-type { color: rgba(248, 113, 113, 0.95); }
.dom-tracking-target {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e8eefc;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dom-tracking-progress {
  position: relative;
  height: 46px;
  margin: 0;
  width: 100%;
  overflow: hidden;
  --dom-probe-size: 30px;
  --dom-plume-size: 34px;
  --dom-endpoint-size: 42px;
  --dom-origin-size: 42px;
  --dom-track-lane-left: calc(var(--dom-origin-size) + 14px);
  --dom-track-lane-right: calc(var(--dom-endpoint-size) / 2);
}
.dom-tracking-lane {
  position: absolute;
  left: var(--dom-track-lane-left);
  right: var(--dom-track-lane-right);
  top: 50%;
  height: var(--dom-probe-size);
  transform: translateY(-50%);
  overflow: visible;
}
.dom-tracking-rail.progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07), transparent 45%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 12px),
    var(--dom-track-remain, rgba(22, 30, 50, 0.98));
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(68, 84, 118, 0.65),
    0 0 10px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.dom-tracking-fill.progress-fill {
  width: var(--dom-track-progress, 0%);
  min-width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  transition: none;
  animation: none;
  position: relative;
  z-index: 1;
}
.dom-tracking-fill.progress-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.14) 0 2px, transparent 2px 8px),
    radial-gradient(circle at 85% 50%, rgba(255, 255, 255, 0.18), transparent 30%);
  background-size: 18px 100%, 100% 100%;
  mix-blend-mode: screen;
  opacity: 0.48;
  pointer-events: none;
  animation: dom-tracking-fill-flow 0.9s linear infinite;
}
.dom-tracking-fill.progress-fill::after {
  content: '';
  position: absolute;
  left: auto;
  right: 0;
  top: -2px;
  bottom: -2px;
  height: auto;
  width: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14));
  box-shadow: 0 0 6px var(--dom-track-glow, rgba(94, 234, 212, 0.28));
  pointer-events: none;
  animation: none;
  transform: none;
  opacity: 0.55;
}
.dom-tracking-row--explore {
  --dom-track-remain: rgba(13, 22, 38, 0.98);
  --dom-track-done-a: #075985;
  --dom-track-done-b: #0e7490;
  --dom-track-glow: rgba(34, 211, 238, 0.36);
  --dom-plume-core: rgba(103, 232, 249, 0.98);
  --dom-plume-particle: rgba(224, 254, 255, 0.95);
  --dom-plume-glow: rgba(34, 211, 238, 0.75);
  --dom-plume-spark: #ffffff;
  --dom-plume-spark-core: #f0f9ff;
  --dom-plume-spark-blue: #7dd3fc;
}
.dom-tracking-row--explore .dom-tracking-fill.progress-fill {
  background: linear-gradient(90deg, var(--dom-track-done-a), var(--dom-track-done-b));
  box-shadow: 0 0 10px var(--dom-track-glow);
}
.dom-tracking-row--colonize {
  --dom-track-remain: rgba(12, 27, 18, 0.98);
  --dom-track-done-a: #16a34a;
  --dom-track-done-b: #bbf7d0;
  --dom-track-glow: rgba(134, 239, 172, 0.62);
  --dom-plume-core: rgba(74, 222, 128, 0.95);
  --dom-plume-particle: rgba(220, 252, 231, 0.92);
  --dom-plume-glow: rgba(134, 239, 172, 0.7);
  --dom-plume-spark: #ffffff;
  --dom-plume-spark-core: #f0f9ff;
  --dom-plume-spark-blue: #7dd3fc;
}
.dom-tracking-row--colonize .dom-tracking-fill.progress-fill {
  background: linear-gradient(90deg, var(--dom-track-done-a), var(--dom-track-done-b));
  box-shadow: 0 0 10px var(--dom-track-glow);
}
.dom-tracking-row--attack {
  --dom-track-remain: rgba(34, 16, 20, 0.98);
  --dom-track-done-a: #dc2626;
  --dom-track-done-b: #f87171;
  --dom-track-glow: rgba(251, 113, 133, 0.62);
  --dom-plume-core: rgba(251, 113, 133, 0.98);
  --dom-plume-particle: rgba(255, 228, 230, 0.95);
  --dom-plume-glow: rgba(248, 113, 113, 0.78);
  --dom-plume-spark: #ffffff;
  --dom-plume-spark-core: #f0f9ff;
  --dom-plume-spark-blue: #7dd3fc;
}
.dom-tracking-row--attack .dom-tracking-fill.progress-fill {
  background: linear-gradient(90deg, var(--dom-track-done-a), var(--dom-track-done-b));
  box-shadow: 0 0 10px var(--dom-track-glow);
}
.dom-tracking-row--explore .dom-tracking-probe {
  --dom-probe-border: rgba(94, 234, 212, 0.38);
  --dom-probe-glow: rgba(94, 234, 212, 0.36);
}
.dom-tracking-row--colonize .dom-tracking-probe {
  --dom-probe-border: rgba(74, 222, 128, 0.4);
  --dom-probe-glow: rgba(74, 222, 128, 0.26);
}
.dom-tracking-row--attack .dom-tracking-probe {
  --dom-probe-border: rgba(248, 113, 113, 0.4);
  --dom-probe-glow: rgba(248, 113, 113, 0.26);
}
.dom-tracking-probe {
  position: absolute;
  left: calc(var(--dom-track-lane-left) + (100% - var(--dom-track-lane-left) - var(--dom-track-lane-right)) * var(--dom-track-progress-n, 0));
  top: 50%;
  width: var(--dom-probe-size);
  height: var(--dom-probe-size);
  transform: translate(-50%, -50%);
  border-radius: 8px;
  overflow: visible;
  isolation: isolate;
  z-index: 6;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: dom-tracking-probe-bob 2.6s ease-in-out infinite;
  will-change: transform;
}
.dom-tracking-probe-btn:hover::before,
.dom-tracking-probe-btn:focus-visible::before {
  border-color: var(--dom-probe-border, rgba(94, 234, 212, 0.55));
  box-shadow: 0 0 18px var(--dom-probe-glow, rgba(94, 234, 212, 0.4));
}
.dom-tracking-probe-btn:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.55);
  outline-offset: 2px;
}
.dom-tracking-probe::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(6, 10, 22, 0.96);
  border: 1px solid var(--dom-probe-border, rgba(94, 234, 212, 0.3));
  box-shadow: 0 0 14px var(--dom-probe-glow, rgba(94, 234, 212, 0.24));
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
}
.dom-tracking-plume {
  position: absolute;
  right: calc(100% - 2px);
  top: 50%;
  width: calc(var(--dom-plume-size) + 10px);
  height: calc(var(--dom-plume-size) * 0.68);
  transform: translateY(-50%);
  transform-origin: right center;
  pointer-events: none;
  z-index: 2;
  opacity: 0.96;
  background:
    radial-gradient(ellipse at 92% 50%, rgba(255, 255, 255, 0.95) 0%, rgba(186, 230, 253, 0.72) 18%, rgba(56, 189, 248, 0.26) 44%, transparent 70%),
    linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.05) 22%, rgba(125, 211, 252, 0.3) 62%, rgba(255, 255, 255, 0.88) 100%) center / 100% 5px no-repeat;
  filter:
    drop-shadow(-4px 0 8px rgba(125, 211, 252, 0.62))
    drop-shadow(-10px 0 7px rgba(56, 189, 248, 0.32));
  animation: dom-tracking-plume-core 0.42s ease-in-out infinite alternate;
  will-change: opacity, transform;
}
.dom-tracking-plume::before,
.dom-tracking-plume::after {
  content: '';
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--dom-plume-spark, #fff) 0 34%, var(--dom-plume-spark-core, #f0f9ff) 52%, var(--dom-plume-spark-blue, #7dd3fc) 100%);
  box-shadow:
    0 0 4px 1px rgba(255, 255, 255, 0.88),
    0 0 9px 2px rgba(56, 189, 248, 0.52);
  filter: none;
  transform-origin: center;
  animation: dom-tracking-plume-spark 0.58s ease-out infinite;
}
.dom-tracking-plume::before {
  width: 4px;
  right: 10px;
  top: 6px;
  animation-delay: 0s;
}
.dom-tracking-plume::after {
  width: 3px;
  right: 19px;
  bottom: 6px;
  animation-delay: 0.2s;
}
@keyframes dom-tracking-probe-bob {
  0%, 100% { transform: translate(-50%, calc(-50% - 3px)); }
  50% { transform: translate(-50%, calc(-50% + 3px)); }
}
@keyframes dom-tracking-plume-core {
  0% { opacity: 0.74; transform: translateY(-50%) scaleX(0.82); }
  100% { opacity: 1; transform: translateY(-50%) scaleX(1); }
}
@keyframes dom-tracking-plume-spark {
  0% { opacity: 0; transform: translate(5px, 0) scale(0.65); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(-21px, 0) scale(0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .dom-tracking-probe,
  .dom-tracking-plume { animation: none; }
  .dom-tracking-plume::before,
  .dom-tracking-plume::after { animation: none; opacity: 0.75; }
}
@keyframes dom-tracking-fill-flow {
  from { background-position: 0 0, 0 0; }
  to { background-position: 18px 0, 0 0; }
}
.dom-tracking-probe-img {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 2px;
  box-sizing: border-box;
  transform: scaleX(-1);
}
.dom-tracking-endpoint {
  position: absolute;
  right: 0;
  top: 50%;
  width: var(--dom-endpoint-size);
  height: var(--dom-endpoint-size);
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border-radius: 0;
  pointer-events: none;
}
.dom-tracking-origin {
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--dom-origin-size);
  height: var(--dom-origin-size);
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dom-tracking-origin-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.2));
}
.dom-tracking-origin-img--round {
  object-fit: cover;
  border-radius: 50%;
  box-shadow: none;
}
.dom-tracking-endpoint-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.dom-tracking-endpoint--star .dom-tracking-endpoint-img {
  filter: drop-shadow(0 0 10px rgba(255, 220, 140, 0.55));
}
.dom-tracking-endpoint-img--round {
  object-fit: cover;
  border-radius: 50%;
  box-shadow: none;
}
.dom-tracking-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.78rem;
  color: #b8c8e8;
}
.dom-tracking-recall-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 0;
  font: 600 0.68rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  color: #fee2e2;
  background: rgba(255, 68, 68, 0.16);
  border: 1px solid rgba(255, 68, 68, 0.6);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(255, 68, 68, 0.14);
  cursor: pointer;
}
.dom-tracking-recall-btn:hover,
.dom-tracking-recall-btn:focus-visible {
  color: #fff;
  background: rgba(255, 68, 68, 0.28);
  border-color: rgba(255, 68, 68, 0.85);
  box-shadow: 0 0 16px rgba(255, 68, 68, 0.26);
}
.dom-tracking-recall-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dom-tracking-stat-label {
  color: rgba(159, 176, 216, 0.82);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  font-weight: 600;
}
.dom-tracking-arrived {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  width: 100%;
}
.dom-tracking-arrived .dom-tracking-report-btn {
  margin-left: auto;
  flex-shrink: 0;
}
.dom-tracking-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dom-tracking-pill--ok {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.dom-tracking-pill--wait {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.dom-tracking-returning {
  color: #a5b4fc;
  font-weight: 600;
}
.probe-feed-frame--system {
  min-height: 200px;
}
.probe-feed-system-view {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(18, 28, 55, 0.45), transparent 70%),
    radial-gradient(circle at 50% 50%, rgba(2, 6, 16, 0.2), rgba(2, 5, 14, 0.96) 78%);
}
.probe-feed-system-star-stage,
.probe-feed-system-orbit-stage {
  position: absolute;
  inset: 0;
  transition: opacity 900ms ease, visibility 900ms ease;
}
.probe-feed-system-star-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
}
.probe-feed-system-orbit-stage {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.planet-milestone-state-after.probe-feed-overlay--system .probe-feed-system-star-stage,
.probe-feed-system-star-stage[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
}
.planet-milestone-state-after.probe-feed-overlay--system .probe-feed-system-orbit-stage,
.probe-feed-system-orbit-stage[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.probe-feed-system-star {
  width: min(58%, 210px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(255, 220, 140, 0.5));
}
.probe-feed-system-orbit-scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92%;
  height: 92%;
  transform: translate(-50%, -50%);
}
.probe-feed-system-orbit-star {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(16%, calc(26% * var(--star-scale, 1)), 46%);
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 0 18px rgba(255, 220, 140, 0.45));
  pointer-events: none;
}
.probe-feed-system-orbit-track {
  position: absolute;
  inset: 0;
  transform: rotate(var(--orbit-a, 0deg));
  animation: probeFeedSystemOrbit var(--orbit-dur, 18s) linear infinite;
  animation-delay: var(--orbit-delay, 0s);
  will-change: transform;
}
.probe-feed-system-orbit-body {
  position: absolute;
  top: 50%;
  left: calc(50% + var(--orbit-r, 30%));
  width: var(--body-sz, 16px);
  height: var(--body-sz, 16px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(120, 180, 255, 0.35);
  border: 1px solid rgba(180, 210, 255, 0.25);
  background: rgba(8, 12, 24, 0.85);
}
.probe-feed-system-orbit-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@keyframes probeFeedSystemOrbit {
  from { transform: rotate(var(--orbit-a, 0deg)); }
  to { transform: rotate(calc(var(--orbit-a, 0deg) + 360deg)); }
}
.planet-milestone-state-transitioning.probe-feed-overlay--system .probe-feed-system-orbit-stage {
  opacity: 0.35;
  visibility: visible;
}
.planet-milestone-state-transitioning.probe-feed-overlay--system .probe-feed-system-star-stage {
  opacity: 0.65;
}
@media (prefers-reduced-motion: reduce) {
  .probe-feed-system-orbit-track { animation: none; }
}

.empire-dom-missions {
  margin-top: 16px;
  padding: 14px 16px 16px;
  border-color: rgba(255, 107, 74, 0.28);
}
.empire-dom-missions-head { margin-bottom: 12px; }
.empire-dom-missions-title { margin: 0 0 4px; font-size: 1.05rem; }
.empire-dom-missions-sub { margin: 0; font-size: 0.84rem; color: #9fb0d8; }
.empire-dom-missions-list { padding: 0; }
.empire-dom-missions { position: relative; }

.dom-mission-card--explore-grid .dom-mission-desc { margin-bottom: 4px; }
.dom-explore-targets {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin-top: 8px;
}
.dom-explore-target-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 12px 0;
  border-top: 1px solid rgba(120, 160, 255, 0.14);
}
.dom-explore-target-row:first-child { border-top: none; padding-top: 4px; }

/* Operations: target-centric master/detail */
.dom-ops-wrap { position: relative; overflow: hidden; }
.dom-ops-pane { animation: dom-ops-slide-in 0.22s ease; }
.dom-ops-wrap.is-detail .dom-ops-pane--detail { animation: dom-ops-slide-in-right 0.22s ease; }
@keyframes dom-ops-slide-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes dom-ops-slide-in-right { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.dom-ops-row {
  appearance: none;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(120, 160, 255, 0.14);
  text-align: left;
  cursor: pointer;
  color: inherit;
  align-items: center;
}
.dom-ops-targets > .dom-ops-row:first-child { border-top: none; }
.dom-ops-row:hover { background: rgba(120, 160, 255, 0.06); }
.dom-ops-chev { width: 20px; height: 20px; color: rgba(150, 180, 255, 0.7); align-self: center; }
.dom-ops-back {
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(170, 195, 255, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  font: inherit;
  margin-bottom: 8px;
}
.dom-ops-back svg { width: 20px; height: 20px; }
.dom-ops-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 10px;
}
.dom-ops-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.dom-ops-actions .btn { width: 100%; }
.dom-ops-diplomacy {
  appearance: none;
  width: 100%;
  margin-top: 10px;
  background: rgba(120, 160, 255, 0.08);
  border: 1px solid rgba(120, 160, 255, 0.2);
  border-radius: 10px;
  color: rgba(190, 210, 255, 0.95);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  font: inherit;
}
.dom-ops-diplomacy:hover { background: rgba(120, 160, 255, 0.14); }
.dom-ops-diplomacy .kc-board-row-chev { width: 18px; height: 18px; flex: 0 0 auto; }
.dom-explore-star {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 44px;
  flex: 0 0 auto;
  padding-top: 2px;
}
.dom-explore-star-img-wrap {
  position: relative;
  width: 44px;
  height: 44px;
}
.dom-explore-star-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 220, 140, 0.4));
}
.dom-explore-star-count {
  position: absolute;
  right: -5px;
  bottom: -3px;
  font: 700 0.68rem/1 var(--font-mono);
  color: #ffe9b0;
  background: rgba(10, 14, 26, 0.92);
  border: 1px solid rgba(255, 220, 140, 0.55);
  border-radius: 6px;
  padding: 2px 4px;
}
.dom-explore-target-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.dom-explore-target-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e8eefc;
  line-height: 1.25;
}
.dom-explore-target-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.8rem;
  color: #b8c8e8;
  line-height: 1.35;
}
.dom-explore-target-meta--star {
  color: #d4deef;
}
.dom-explore-target-bonuses {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  width: 100%;
  margin-top: 2px;
  font-size: 0.78rem;
  line-height: 1.35;
}
.dom-explore-target-bonuses .planet-bonuses {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0;
}
.dom-explore-target-bonuses .planet-bonuses > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}
.dom-explore-target-bonuses .bonus-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.dom-explore-target-stat-label {
  color: rgba(159, 176, 216, 0.82);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  font-weight: 600;
}
.dom-explore-target-stat--planets {
  color: #e2e8f0;
  font-weight: 600;
}
.dom-explore-target-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: flex-start;
  justify-self: end;
  padding-top: 0;
}
.dom-explore-pending-note {
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #9fb0d8;
  text-align: center;
  border: 1px dashed rgba(120, 160, 255, 0.22);
  border-radius: 8px;
}
.dom-explore-shipyard-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.dom-explore-shipyard-bar--prompt {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.dom-shipyard-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #9fb0d8;
  text-align: center;
  line-height: 1.35;
}
.dom-explore-shipyard-bar--prompt .dom-mission-shipyard-btn {
  align-self: flex-end;
}
.dom-mission-shipyard-btn {
  flex: 0 0 auto;
  padding: 4px 11px;
  min-height: 0;
  font: 600 0.68rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b1220;
  background: rgba(255, 178, 74, 0.9);
  border: 1px solid rgba(255, 178, 74, 0.95);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(255, 178, 74, 0.22);
}
.dom-mission-shipyard-btn:hover,
.dom-mission-shipyard-btn:focus-visible {
  background: #ffc97a;
  border-color: #ffe0b0;
  box-shadow: 0 0 16px rgba(255, 178, 74, 0.32);
}
.dom-planet-thumb-wrap .dom-explore-star-img-wrap {
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(120, 170, 255, 0.28);
}
.dom-planet-thumb-img {
  object-fit: cover;
  border-radius: 50%;
}
.dom-planet-target-row {
  align-items: start;
}
/* Outcome slot is a single full-width card; do not leave it in the 3-col target grid. */
.dom-planet-target-row--outcome {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border-top: none;
  box-sizing: border-box;
}
.dom-planet-target-row--outcome > .dom-planet-target-slot {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.dom-planet-target-row--outcome + .dom-planet-target-row,
.dom-planet-target-row + .dom-planet-target-row--outcome {
  margin-top: 10px;
  padding-top: 0;
  border-top: none;
}
.dom-explore-targets > .dom-planet-target-row--outcome:first-child {
  margin-top: 4px;
}
.dom-planet-target-slot {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 255, 0.16);
  background: rgba(6, 10, 22, 0.55);
}
.dom-target-outcome-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.dom-target-outcome-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.dom-target-outcome-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(6, 12, 28, 0.92) 0%,
    rgba(6, 12, 28, 0.72) 45%,
    rgba(6, 12, 28, 0.35) 100%
  );
}
.dom-target-outcome-scrim--attacker_wins {
  background: linear-gradient(
    105deg,
    rgba(4, 28, 14, 0.9) 0%,
    rgba(6, 12, 28, 0.74) 48%,
    rgba(6, 12, 28, 0.32) 100%
  );
}
.dom-target-outcome-scrim--defender_wins {
  background: linear-gradient(
    105deg,
    rgba(32, 6, 10, 0.92) 0%,
    rgba(6, 12, 28, 0.76) 48%,
    rgba(6, 12, 28, 0.32) 100%
  );
}
.dom-target-outcome-scrim--draw {
  background: linear-gradient(
    105deg,
    rgba(28, 22, 4, 0.9) 0%,
    rgba(6, 12, 28, 0.76) 48%,
    rgba(6, 12, 28, 0.32) 100%
  );
}
.dom-target-outcome-head {
  position: relative;
  z-index: 1;
  padding: 12px 14px 6px;
  font: 600 0.72rem/1.35 var(--font-mono);
  letter-spacing: 0.04em;
}
.dom-target-outcome-label {
  color: rgba(159, 176, 216, 0.92);
  margin-right: 6px;
}
.dom-target-outcome-text {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}
.dom-target-outcome-head--attacker_wins .dom-target-outcome-text { color: #86efac; }
.dom-target-outcome-head--defender_wins .dom-target-outcome-text { color: #fca5a5; }
.dom-target-outcome-head--draw .dom-target-outcome-text { color: #fcd34d; }
.dom-planet-target-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 8px 12px 12px;
}
.dom-planet-target-row--outcome .dom-planet-target-grid {
  padding-top: 0;
}
.dom-planet-intel {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dom-planet-intel-row {
  font-size: 0.76rem;
  color: #9fb0d8;
  line-height: 1.3;
}
.dom-planet-intel-row > span {
  color: rgba(159, 176, 216, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.66rem;
  margin-right: 4px;
}
.dom-planet-intel-unknown {
  color: rgba(159, 176, 216, 0.6);
  font-style: italic;
}
.dom-planet-intel-report {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.dom-planet-intel-age {
  font-size: 0.74rem;
  color: #9fb0d8;
}
.dom-planet-intel-link {
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: 600 0.72rem/1.35 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan, #5eead4);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dom-planet-intel-link:hover,
.dom-planet-intel-link:focus-visible {
  color: #a5f3fc;
}
.dom-planet-empty {
  margin-top: 10px;
  padding: 12px;
  font-size: 0.82rem;
  color: #9fb0d8;
  text-align: center;
  border: 1px dashed rgba(120, 160, 255, 0.2);
  border-radius: 6px;
}
@media (max-width: 560px) {
  .dom-mission-panel {
    height: 88dvh;
    max-height: 88dvh;
    min-height: 88dvh;
    border-radius: 16px 16px 0 0;
    align-self: flex-end;
  }
  .dom-mission-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .dom-mission-panel-head {
    padding: 16px 16px 6px;
  }
  .dom-mission-panel-head h2 {
    font-size: 1.05rem;
    padding-right: 28px;
  }
  .dom-mission-tabs {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0 12px 8px;
    background: linear-gradient(180deg, rgba(12, 20, 38, 0.98) 85%, rgba(12, 20, 38, 0));
  }
  .dom-mission-tab {
    gap: 5px;
    padding: 9px 6px;
    font-size: 0.78rem;
  }
  .dom-mission-tab-icon {
    width: 22px;
    height: 22px;
  }
  .dom-mission-list {
    padding: 4px 12px 16px;
    -webkit-overflow-scrolling: touch;
  }
  .dom-mission-hero {
    min-height: 116px;
    margin-bottom: 10px;
  }
  .dom-mission-hero-copy {
    min-height: 116px;
    padding: 12px 14px;
  }
  .dom-mission-hero-title { font-size: 1rem; }
  .dom-mission-hero-desc { font-size: 0.76rem; max-width: 100%; }
  .dom-mission-card--tabbed { padding: 0; }
  .dom-explore-target-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
  }
  .dom-explore-target-row .dom-explore-target-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    padding-top: 0;
  }
  .dom-explore-target-row .dom-explore-target-actions .btn { flex: 0 0 auto; }
  .dom-planet-target-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "thumb main"
      "actions actions";
    gap: 10px 12px;
    align-items: start;
  }
  .dom-planet-target-row--outcome {
    grid-template-columns: none;
    grid-template-areas: none;
  }
  .dom-planet-target-grid {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "thumb main"
      "actions actions";
    gap: 10px 12px;
    padding: 8px 10px 10px;
  }
  .dom-planet-target-grid > .dom-explore-star { grid-area: thumb; }
  .dom-planet-target-grid > .dom-explore-target-main { grid-area: main; }
  .dom-planet-target-row > .dom-explore-star,
  .dom-planet-target-grid > .dom-explore-star { grid-area: thumb; }
  .dom-planet-target-row > .dom-explore-target-main,
  .dom-planet-target-grid > .dom-explore-target-main { grid-area: main; }
  .dom-planet-target-row > .dom-explore-target-actions,
  .dom-planet-target-grid > .dom-explore-target-actions {
    grid-area: actions;
    justify-self: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(120, 160, 255, 0.1);
  }
  .dom-planet-target-row > .dom-explore-target-actions > .btn {
    flex: 1 1 auto;
    min-height: 36px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .dom-planet-target-row > .dom-explore-target-actions > .dom-mission-map-icon-btn {
    flex: 1 1 auto;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .dom-planet-target-row > .dom-explore-target-actions--resolved {
    flex-direction: column;
    align-items: stretch;
  }
  .dom-planet-target-row > .dom-explore-target-actions--resolved .dom-target-action-stack {
    width: 100%;
  }
  .dom-planet-target-row > .dom-explore-target-actions--resolved .dom-target-action-stack > .btn {
    flex: 1 1 auto;
    min-height: 36px;
    width: 100%;
  }
  .dom-planet-intel-row { font-size: 0.8rem; line-height: 1.4; }
  .dom-planet-intel { gap: 4px; }
  .dom-explore-shipyard-bar { justify-content: stretch; }
  .dom-explore-shipyard-bar--prompt .dom-mission-shipyard-btn { align-self: stretch; }
  .dom-explore-shipyard-bar .dom-mission-shipyard-btn { flex: 1 1 auto; }
}


/* P5b nav migration: Resumen + I+D + Colonias live in the Domestic
   board; the header is bound to ONE colony (always-visible planet
   dropdown + its tabs). */
#empire-header-tabs .cmd-tab[data-empire-tab="overview"],
#empire-header-tabs .cmd-tab[data-empire-tab="ciencia"],
#empire-header-tabs .cmd-tab[data-empire-tab="colonies-list"] {
  display: none;
}

/* Compact view-on-map reticle inside colony table rows */
.empire-tbl-viewmap { width: 22px; height: 22px; margin-left: 2px; }
.empire-tbl-viewmap svg { width: 13px; height: 13px; }

/* PI cost chip on the Recomendado banner: KC-cost-chip weight, phone-readable */
.empire-research-ribanner .lw-cost.pi-row-cost { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.empire-research-ribanner .pi-row-cost .pi-cost-num { display: inline-flex; align-items: center; gap: 4px; color: #d8b4fe; font-weight: 700; }
.empire-research-ribanner .pi-row-cost .pi-cost-eta { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; }
/* Bank fill toward a not-yet-affordable tech: the accrual is the timer */
.empire-research-ribanner .pi-progress { display: block; width: 100%; max-width: min(52vw, 210px); height: 3px; border-radius: 2px; background: color-mix(in srgb, #a855f7 22%, transparent); overflow: hidden; }
.empire-research-ribanner .pi-progress-fill { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #7c3aed, #d8b4fe); }
/* Recomendado banner: a highlight, not another row - eyebrow, branch tint */
.e2scope.ribanner.empire-research-next { background: linear-gradient(90deg, color-mix(in srgb, var(--bc, #8b5cf6) 13%, var(--bg-panel)), var(--bg-panel) 60%); border-color: color-mix(in srgb, var(--bc, #8b5cf6) 45%, var(--bg-divider)); }
.empire-research-ribanner .rec-eyebrow { display: block; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--bc, #8b5cf6) 60%, #fff); }
.e2scope.ribanner.empire-research-next .binfo .n { display: flex; align-items: center; gap: 7px; min-width: 0; }

/* Bigger colony planet thumb in the Colonias rows; negative margins pin its footprint to 30px so the row height holds */
.brow[data-colidx] .bwrap { width: 44px; height: 44px; margin-top: -7px; margin-bottom: -7px; }

/* ─── Imperio subtab strip (Colonias / Objetivos / Propuestas) ─── */
/* Fixed chrome above the Living World band (tabs, then viewport, then
   content): nothing scrolls beneath it, so it stays transparent and
   integrates with the page background like the Ahora category strip
   (same .surface-switch anatomy: centered, max 640px). */
#imperio-subtabs { flex: none; }
#imperio-subtabs[hidden] { display: none; }
/* Only the command (empire) screen carries the strip */
body:not(:has(#screen-empire.active)) #imperio-subtabs { display: none; }
.empire-pane-propuestas { max-width: 640px; margin: 0 auto; padding: 4px 12px 14px; }
