/* Design tokens — single source of truth for theming.
   Light is the default; [data-theme="dark"] overrides the same variables, so
   dark mode can never "miss" a component the way the old override list did. */
:root {
  color-scheme: light;

  /* surfaces & text */
  --bg: #ffffff;
  --bg-subtle: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e9edf2;
  --border: #e3e7ee;
  --border-strong: #cfd5df;

  --text: #14171c;
  --text-muted: #5b6573;
  --text-faint: #8a93a3;

  /* brand / accent (EVE cyan) */
  --accent: #0e93c4;
  --accent-strong: #0b7aa3;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(14, 147, 196, 0.12);

  /* security status */
  --sec-high: #1c8c3b;
  --sec-low: #b07d09;
  --sec-null: #c23b2b;

  /* incursion state */
  --state-established: #0e93c4;
  --state-mobilizing: #b07d09;
  --state-withdrawing: #a945c4;
  --state-ended: #c23b2b;

  /* effects */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 2px 6px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.08);
  --ring: 0 0 0 3px var(--accent-soft);

  /* radii */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* layout */
  --header-h: 58px;
  --maxw: 1200px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f1115;
  --bg-subtle: #13161b;
  --surface: #171a20;
  --surface-2: #1d212a;
  --surface-3: #242a34;
  --border: #272d38;
  --border-strong: #353c49;

  --text: #e6e9ef;
  --text-muted: #98a2b2;
  --text-faint: #6a7382;

  --accent: #2bb3df;
  --accent-strong: #54c6ec;
  --accent-contrast: #04222e;
  --accent-soft: rgba(43, 179, 223, 0.16);

  --sec-high: #44d365;
  --sec-low: #e3b341;
  --sec-null: #f0654a;

  --state-established: #36b6e0;
  --state-mobilizing: #e3b341;
  --state-withdrawing: #d07fe8;
  --state-ended: #f0654a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.5);
}

/* ----------------------------------------------------------------------------
   Modern reset (minimal, replaces Bootstrap's normalize)
---------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
picture,
svg,
canvas {
  display: block;
  max-width: 100%;
}
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: none;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4 {
  line-height: 1.18;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(1.65rem, 1.25rem + 1.6vw, 2.15rem);
}
h2 {
  font-size: 1.4rem;
}
h3 {
  font-size: 1.15rem;
}
p {
  text-wrap: pretty;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection {
  background: var(--accent-soft);
}

/* ----------------------------------------------------------------------------
   Layout primitives
---------------------------------------------------------------------------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}
.main {
  flex: 1;
  padding-block: var(--sp-6) var(--sp-7);
}

/* ----------------------------------------------------------------------------
   Cross-cutting, data-driven helper classes (applied from string values in JSX)
---------------------------------------------------------------------------- */
.sec {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.sec-high {
  color: var(--sec-high);
}
.sec-low {
  color: var(--sec-low);
}
.sec-null {
  color: var(--sec-null);
}

.state {
  font-weight: 600;
}
.state-established {
  color: var(--state-established);
}
.state-mobilizing {
  color: var(--state-mobilizing);
}
.state-withdrawing {
  color: var(--state-withdrawing);
}
.state-ended {
  color: var(--state-ended);
}

/* hide on phones */
@media (max-width: 767.98px) {
  .hidden-xs {
    display: none !important;
  }
}

/* Shared look for the plain data tables (history, communities, about). */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table thead th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: var(--surface-2);
}

/* group/section header rows inside the body (e.g. history dates) */
.data-table tbody .group-row th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  padding: var(--sp-3) var(--sp-4) var(--sp-2);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.data-table a {
  color: var(--text);
  font-weight: 550;
}
.data-table a:hover {
  color: var(--accent);
  text-decoration: none;
}

.data-table .center {
  text-align: center;
}
.data-table img {
  display: inline-block;
  vertical-align: middle;
}

.footer {
  margin-top: var(--sp-7);
  padding-block: var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.footer p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-faint);
}

.prose-prose {
  max-width: 70ch;
}
.prose-prose h1 {
  margin-bottom: var(--sp-4);
}
.prose-prose p {
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  line-height: 1.65;
}

.prose-contact {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: 0;
  margin-top: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.prose-contact dt {
  padding: var(--sp-3) var(--sp-4);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.prose-contact dd {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.prose-contact dt:last-of-type,
.prose-contact dd:last-of-type {
  border-bottom: none;
}
.prose-note {
  color: var(--text-faint);
  font-size: 0.9em;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: var(--sp-5);
  align-items: start;
}

@media (max-width: 360px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.nav-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: var(--header-h);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-right: auto;
}
.nav-brand:hover {
  text-decoration: none;
}
.nav-logo {
  width: 30px;
  height: 30px;
}

.nav-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.nav-link {
  position: relative;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-weight: 550;
  font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.nav-active {
  color: var(--accent);
}
.nav-active::after {
  content: "";
  position: absolute;
  left: var(--sp-3);
  right: var(--sp-3);
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-toggleWrap {
  margin-left: var(--sp-2);
  padding-left: var(--sp-3);
  border-left: 1px solid var(--border);
}

/* hamburger */
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  align-items: center;
  justify-content: center;
}
.nav-burger:hover {
  background: var(--surface-2);
}
.nav-burgerLines,
.nav-burgerLines::before,
.nav-burgerLines::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-burgerLines {
  position: relative;
}
.nav-burgerLines::before,
.nav-burgerLines::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-burgerLines::before {
  top: -6px;
}
.nav-burgerLines::after {
  top: 6px;
}
.nav-burgerOpen {
  background: transparent;
}
.nav-burgerOpen::before {
  transform: translateY(6px) rotate(45deg);
}
.nav-burgerOpen::after {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 767.98px) {
  .nav-burger {
    display: inline-flex;
  }
  .nav-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: var(--sp-3);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
  }
  .nav-navOpen {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-link {
    padding: var(--sp-3);
    font-size: 1rem;
  }
  .nav-active::after {
    display: none;
  }
  .nav-toggleWrap {
    margin: var(--sp-2) 0 0;
    padding: var(--sp-3) 0 0;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

.notice-notice {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--sec-low) 35%, var(--border));
  border-left: 3px solid var(--sec-low);
  border-radius: var(--r);
  background: color-mix(in srgb, var(--sec-low) 8%, var(--surface));
}

.notice-tag {
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sec-low);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--sec-low) 16%, transparent);
}

.notice-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
}

.notice-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notice-link:hover {
  color: var(--accent-strong);
}

.notice-salute {
  font-weight: 700;
  color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  padding: 0;
  border-radius: var(--r-pill);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 52px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background 0.2s;
}

.theme-sun,
.theme-moon {
  position: relative;
  z-index: 1;
  flex: none;
}
.theme-sun {
  color: #e8a93b;
  margin-right: auto;
}
.theme-moon {
  color: var(--text-muted);
  margin-left: auto;
}

.theme-knob {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transform: translateY(-50%);
  transition: left 0.2s ease;
}

:global([data-theme="dark"]) .theme-track {
  background: #1b2733;
  border-color: #2c3b49;
}
:global([data-theme="dark"]) .theme-knob {
  left: calc(100% - 25px);
  background: #f4d35e;
}
:global([data-theme="dark"]) .theme-moon {
  color: #f4d35e;
}
:global([data-theme="dark"]) .theme-sun {
  color: var(--text-faint);
}

.spawn-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.spawn-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
}
.spawn-sov {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  flex: none;
}
.spawn-title {
  font-size: 1.25rem;
  margin-right: auto;
  min-width: 0;
}
.spawn-title a {
  color: var(--text);
}
.spawn-title a:hover {
  color: var(--accent);
  text-decoration: none;
}
.spawn-statePill {
  flex: none;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.spawn-facts {
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) 1fr;
  gap: 2px var(--sp-4);
  padding: 0 var(--sp-4) var(--sp-3);
}
.spawn-fact {
  display: contents;
}
.spawn-fact dt {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 5px 0;
}
.spawn-fact dd {
  font-size: 0.92rem;
  padding: 5px 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.spawn-influenceFact dd {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.spawn-progress {
  flex: 1;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.spawn-bar {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.3s ease;
}
.spawn-influenceVal {
  font-size: 0.82rem;
  color: var(--text-muted);
  min-width: 2.6em;
}

.spawn-chart {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
}

.systems-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.systems-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.systems-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.systems-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.systems-hint {
  color: var(--text-faint);
  cursor: help;
  text-decoration: none;
  font-size: 0.85em;
}

.systems-toggleCol {
  width: 38px;
}
.systems-toggleCell {
  width: 38px;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center;
}

.systems-band td {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: var(--sp-1) var(--sp-3);
}

.systems-row:hover td {
  background: var(--surface-2);
}
.systems-row a {
  color: var(--text);
  font-weight: 550;
}
.systems-row a:hover {
  color: var(--accent);
  text-decoration: none;
}

.systems-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--text-faint);
  background: transparent;
  transition: background 0.15s, color 0.15s;
}
.systems-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.systems-chev {
  transition: transform 0.2s ease;
}
.systems-toggleOpen .systems-chev {
  transform: rotate(90deg);
}
.systems-toggleOpen {
  color: var(--accent);
}

/* expandable stations row: animate via grid-rows 0fr -> 1fr */
.systems-stationsRow td {
  padding: 0;
  border-bottom: none;
}
.systems-rowOpen td {
  border-bottom-color: transparent;
}
.systems-stationsWrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}
.systems-stationsOpen {
  grid-template-rows: 1fr;
  border-bottom: 1px solid var(--border);
}
.systems-stationsInner {
  overflow: hidden;
}
.systems-stations {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3) var(--sp-3) calc(38px + var(--sp-3));
  background: var(--surface-2);
}
.systems-station {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.systems-wrench {
  width: 12px;
  height: 12px;
  display: inline-block;
}

.hs-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.95rem;
  font-weight: 500;
}
.hs-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent);
}

.hs-calm {
  color: var(--state-established);
  border-color: color-mix(in srgb, var(--state-established) 35%, var(--border));
  background: color-mix(in srgb, var(--state-established) 8%, var(--surface));
}
.hs-soon {
  color: var(--sec-low);
  border-color: color-mix(in srgb, var(--sec-low) 35%, var(--border));
  background: color-mix(in srgb, var(--sec-low) 8%, var(--surface));
}
.hs-due {
  color: var(--sec-null);
  border-color: color-mix(in srgb, var(--sec-null) 40%, var(--border));
  background: color-mix(in srgb, var(--sec-null) 9%, var(--surface));
}

.rats-groupTitle {
  margin: var(--sp-6) 0 var(--sp-4);
}

.rats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}

.rats-name {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.rats-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
.rats-render {
  width: 100%;
  max-width: 256px;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.rats-stats {
  min-width: 0;
}

@media (min-width: 768px) {
  .rats-body {
    grid-template-columns: 256px 1fr;
  }
}

/* attack / defense stat rows */
.rats-statSection {
  margin-bottom: var(--sp-4);
}
.rats-statRow {
  display: grid;
  grid-template-columns: 4.5rem minmax(6rem, 9rem) 1fr;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-1) 0;
}
.rats-statLabel {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.rats-statValue {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 575.98px) {
  .rats-statRow {
    grid-template-columns: 4rem 1fr;
  }
  .rats-bars {
    grid-column: 1 / -1;
  }
}

.rats-sectionGap {
  height: var(--sp-4);
}

/* damage / resist bars */
.rats-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
}
.rats-barCol {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.rats-resiIcon {
  width: 18px;
  height: 18px;
  flex: none;
  display: none;
}
@media (min-width: 768px) {
  .rats-resiIcon {
    display: block;
  }
}

.rats-bar {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 26px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--slot, #2a2f36);
}
.rats-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  background: var(--grad, #888);
}
.rats-barText {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  color: #f1f1f1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

.rats-barCol[data-type="em"] {
  --slot: #21303a;
  --grad: linear-gradient(#258acd, #195e8c);
}
.rats-barCol[data-type="thermal"] {
  --slot: #382223;
  --grad: linear-gradient(#cd2525, #8c1919);
}
.rats-barCol[data-type="kinetic"] {
  --slot: #333535;
  --grad: linear-gradient(#a8a8a8, #727272);
}
.rats-barCol[data-type="explosive"] {
  --slot: #3a3224;
  --grad: linear-gradient(#cd8a25, #8c5e19);
}

/* hp / ehp badges */
.rats-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  font-size: 0.74rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.rats-hp {
  color: var(--accent-contrast);
  background: var(--accent);
}
.rats-ehp {
  color: #3a2c00;
  background: #e8b53b;
}

/* meta key/value lists */
.rats-metaGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}
@media (min-width: 768px) {
  .rats-metaGrid {
    grid-template-columns: 1fr 1fr;
  }
}
.rats-metaList {
  list-style: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.rats-metaList li {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}
.rats-metaList li:last-child {
  border-bottom: none;
}
.rats-metaList span {
  color: var(--text-muted);
}
.rats-metaList b {
  font-variant-numeric: tabular-nums;
}

/* ewar + attack-type icons */
.rats-ewar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rats-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

/* Only new language/data controls; all original component rules are preserved. */
.language-select { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); font-size: .85rem; padding: 5px 7px; max-width: 120px; }
.update-line { margin-top: var(--sp-3); color: var(--text-faint); font-size: .78rem; display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.stale { color: var(--state-mobilizing); }
.pagination { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; margin-top: var(--sp-5); color: var(--text-muted); font-size: .9rem; }
.pagination a { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.history-meta { display: flex; gap: var(--sp-4); margin-top: var(--sp-3); color: var(--text-muted); font-size: .85rem; }
.empty-state { color: var(--text-muted); padding: var(--sp-5) 0; }
.chart-wrap { position: relative; height: 170px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.theme-control { display: inline-flex; align-items: center; }
@media (max-width:767.98px) { .language-select { margin: var(--sp-2) var(--sp-3); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
