/* =========================
   VARIABLES
========================= */
:root {
  --bg: #0b0f14;
  --panel: #121822;
  --panel-soft: #16202c;
  --text: #eaf0f6;
  --muted: #9eacbb;
  --line: #2a3443;

  --green: #97c98b;
  --yellow: #ffd166;
  --red: #e36d6d;
  --blue: #5b8def;

  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

/* =========================
   BASE
========================= */
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  background:
    radial-gradient(circle at 50% 0%, rgba(151,201,139,0.10), transparent 34rem),
    linear-gradient(180deg, #0b0f14 0%, #0d1218 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

/* =========================
   HEADER
========================= */
.site-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-logo {
  width: min(220px, 52vw);
  max-height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,0.35));
}

/* =========================
   THEME TOGGLE
========================= */
.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  min-height: 38px;
  padding: 8px 14px;

  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--text);

  font: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;

  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16);

  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.theme-toggle:hover {
  background: rgba(151,201,139,0.14);
  border-color: rgba(151,201,139,0.35);
}

/* =========================
   NAVIGATION
========================= */
.site-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px 14px;

  display: flex;
  justify-content: center;
  gap: 10px;
}

.site-nav a {
  padding: 8px 12px;

  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);

  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.035);
}

.site-nav a.active {
  color: var(--text);
  background: rgba(151,201,139,0.18);
  border-color: rgba(151,201,139,0.4);
  box-shadow: 0 0 10px rgba(151,201,139,0.2);
}

/* =========================
   LAYOUT
========================= */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 18px 34px;

  display: flex;
  justify-content: center;
  gap: 18px;

  color: var(--muted);
  font-size: 13px;
}

.site-footer a:hover {
  color: var(--text);
}

/* =========================
   HERO
========================= */
.hero {
  min-height: calc(100vh - 190px);
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-card {
  width: 100%;
  max-width: 760px;
  padding: clamp(28px, 6vw, 56px);

  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(18,24,34,0.94), rgba(16,23,32,0.94));
  box-shadow: var(--shadow);
}

.hero-logo {
  width: min(220px, 60vw);
  margin-bottom: 24px;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.4));
}

/* =========================
   TYPOGRAPHY
========================= */
h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 78px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.lead {
  /* max-width: 620px; */
  margin: 22px auto 0;

  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 12px;

  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* =========================
   PAGE TITLES
========================= */
.page-title {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.object-title {
  margin: 0;
  font-size: clamp(22px, 3.2vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 800;
}

.tx-title {
  margin: 0;
  font-size: clamp(22px, 3.2vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 800;
}

.muted-note {
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
  font-size: 0.9em;
}

/* =========================
   PANELS
========================= */
.panel {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(18,24,34,0.96), rgba(12,18,26,0.96));
  box-shadow: var(--shadow);
}

.panel h1,
.panel .lead,
.panel .eyebrow {
  text-align: left;
}

.panel h2 {
  margin-top: 0px;
}

.panel .lead {
  margin-left: 0;
  margin-right: 0;
}

.panel-title {
  margin: 0 0 14px;

  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.panel-meta {
  margin-top: 14px;

  text-align: right;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.6;
  letter-spacing: 0.03em;
}

/* =========================
   GRID
========================= */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* =========================
   KEY VALUE ROWS
========================= */
.kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;

  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.kv:last-child {
  border-bottom: 0;
}

.k {
  color: var(--muted);
  font-size: 14px;
}

.v {
  font-weight: 600;
  text-align: right;
}

.v.strong {
  font-weight: 800;
}

/* =========================
   BADGES
========================= */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;

  padding: 6px 9px;

  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.035);
  color: var(--muted);

  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.badge.small {
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge.ok {
  color: #b7e3af;
  background: rgba(151,201,139,0.13);
}

.badge.warning {
  color: #ffe3a1;
  background: rgba(255,209,102,0.13);
}

.badge.critical {
  color: #f0a3a3;
  background: rgba(227,109,109,0.13);
}

.badge.period {
  cursor: pointer;
}

.badge.period.active {
  color: #b7e3af;
  background: rgba(151,201,139,0.16);
  border-color: rgba(151,201,139,0.35);
}

td .badge {
  white-space: nowrap;
}

/* =========================
   STATUS
========================= */
.status-pill {
  margin-top: 30px;

  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 14px;

  border-radius: 999px;
  border: 1px solid var(--line);
  /* background: rgba(255,255,255,0.03); */
  background: rgba(151,201,139,0.08);
  color: #b7e3af;

  font-size: 14px;
  font-weight: 800;
}

.status-dot {
  width: 9px;
  height: 9px;

  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px rgba(151,201,139,0.8);
}

#status {
  color: var(--muted);
  font-size: 13px;
}

/* =========================
   HEALTH
========================= */

.public-health {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 2px;
  margin-left: 2px;
  min-height: 8px;
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.4;
}

.health-dot.ok {
  background: var(--green);
  opacity: 1;
}

.health-dot.warning {
  background: var(--yellow);
  opacity: 1;
}

.health-dot.critical {
  background: var(--red);
  opacity: 1;
}

.health-dot.pending {
  background: transparent;
  border: 1px solid var(--line);
  opacity: 0.6;
  border-style: dashed;
}


/* =========================
   TABLES
========================= */
.table-wrap {
  overflow-x: auto;

  border-radius: 16px;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 680px;

  border-collapse: collapse;
  background: rgba(18,24,34,0.86);
}

.table-action {
  white-space: nowrap;
}

.table-station {
  white-space: nowrap;
}

.table-object-name {
  font-weight: 900;
}

.table-object-norad {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.table-time-main {
  white-space: nowrap;
}

.table-time-age {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.table-tx-mode {
  display: block;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.table-tx-freq {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

th,
td {
  padding: 12px 14px;

  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td.num,
th.num {
  text-align: right;
}

tr:last-child td {
  border-bottom: 0;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: rgba(151,201,139,0.045);
}

/* =========================
   CHARTS
========================= */
.mini-chart {
  height: 170px;

  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 4px;

  padding: 18px 0 4px;

  background: linear-gradient(
    to top,
    rgba(255,255,255,0.04) 1px,
    transparent 1px
  );
  background-size: 100% 25%;
}

.chart-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  flex: 1 1 0;
  min-width: 6px;

  border-radius: 6px 6px 0 0;
  background: rgba(151,201,139,0.65);
}

.bar.empty {
  opacity: 0.22;
}

/* =========================
   STATIONS (internal / legacy)
========================= */
.station-card {
  margin-top: 18px;
  margin-bottom: 18px;
  padding: 20px;
}

.station-card:last-child {
  margin-bottom: 0;
}

.station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.station-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.station-block {
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 12px;
}

.block-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 10px;
}

/* =========================
   OBJECT TRANSMITTER CARDS
========================= */
.object-tx-list {
  display: grid;
  gap: 12px;
}

.object-tx-card {
  display: block;
  padding: 16px;

  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  box-shadow: 0 8px 22px rgba(0,0,0,0.14);

  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.object-tx-card:hover {
  border-color: rgba(151,201,139,0.42);
  background: rgba(151,201,139,0.07);
  box-shadow: 0 14px 32px rgba(0,0,0,0.22);
}

.object-tx-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.object-tx-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.015em;
}

.object-tx-frequency {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.object-tx-action {
  flex-shrink: 0;
}

.object-tx-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.object-tx-stat {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}

.object-tx-stat .k {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.object-tx-stat .v {
  display: block;
  text-align: left;
  font-weight: 800;
}

/* =========================
   PAGE HEADER / BREADCRUMB
========================= */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 14px;

  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb-sep {
  opacity: 0.55;
}

.page-header {
  margin-bottom: 18px;
}

.page-actions {
  margin-top: 14px;
}

.text-link {
  color: var(--green);
  font-weight: 850;
}

.text-link:hover {
  color: var(--text);
}

/* =========================
   PUBLIC STATIONS (mission control)
========================= */
.public-stations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
}

.public-station {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

/* --- header --- */
.public-station-head {
  margin-bottom: 14px;
}

.public-station-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.public-station-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.public-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

/* --- layout --- */
.public-station-body {
  display: grid;
  gap: 12px;
}

/* --- NOW / NEXT cards --- */
.public-pass-card {
  min-height: 160px;
  padding: 14px;

  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);

  cursor: default;
}

/* NOW = highlight */
.public-pass-card.is-now {
  border-color: rgba(151,201,139,0.22);
  background: rgba(151,201,139,0.055);
}

/* NEXT = neutral */
.public-pass-card.is-next {
  background: rgba(255,255,255,0.032);
}

/* empty state */
.public-pass-card.is-empty {
  border-color: rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}

.public-pass-card.is-now.is-running {
  position: relative;
  box-shadow: 0 0 0 1px rgba(151,201,139,0.2),
              0 0 18px rgba(151,201,139,0.12);
}

.public-pass-card.is-now.is-running::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(151,201,139,0.9);
  animation: pulseDot 1.8s ease-in-out infinite;
}

.public-pass-card.is-upcoming {
  border-color: rgba(255, 209, 102, 0.28);
}

.public-pass-card.is-soon {
  border-color: rgba(255, 209, 102, 0.55);
  background: rgba(255, 209, 102, 0.075);
}

.public-pass-card.is-critical {
  border-color: rgba(227, 109, 109, 0.75);
  background: rgba(227, 109, 109, 0.11);
}

.public-pass-card.is-critical .public-countdown {
  color: var(--red);
}

.public-pass-card.is-soon .public-countdown,
.public-pass-card.is-upcoming .public-countdown {
  color: var(--yellow);
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- content --- */
.public-pass-label {
  margin-bottom: 8px;

  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.public-pass-card.is-now .public-pass-label {
  color: var(--green);
}

.public-pass-object {
  color: var(--green);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.public-pass-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.public-pass-empty {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

/* --- countdown --- */
.public-countdown {
  margin-top: 10px;

  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.03em;

  color: var(--text);

}

/* --- metrics (inline) --- */
.public-metrics-inline {
  padding: 10px 12px;

  border-radius: 12px;
  background: rgba(255,255,255,0.025);

  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.public-metrics-inline strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}

.public-metrics-inline span {
  margin: 0 6px;
  opacity: 0.55;
}

/* --- station summary --- */
.station-summary {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.055);
  background:
    linear-gradient(135deg, rgba(151,201,139,0.035), rgba(255,255,255,0.018));
  display: grid;
  gap: 8px;
}

.station-summary-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 0;
  border-bottom: 0;
}

.station-summary-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0.72;
}

.station-summary-value {
  min-width: 0;
  text-align: left;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.station-summary-row.is-primary {
  margin-bottom: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.station-summary-row.is-primary .station-summary-label {
  color: var(--green);
  opacity: 1;
}

.station-summary-row.is-primary .station-summary-value {
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: -0.02em;
}

.backend-station-card:has(.badge.critical) {
  border-color: rgba(227,109,109,0.22);
}

.backend-station-card:has(.badge.warning) {
  border-color: rgba(255,209,102,0.20);
}

.metric-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.045);
  background: rgba(255,255,255,0.016);
}

.metric-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-title {
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -0.01em;
}

.metric-value-main {
  margin-top: 18px;
  font-size: 26px;
  font-weight: 1000;
  letter-spacing: -0.04em;
}

.metric-caption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.station-updated {
  margin-top: 12px;
  text-align: right;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  opacity: 0.55;
}

.station-updated-dot {
  margin: 0 6px;
  opacity: 0.45;
}

/* =========================
   LEADERBOARD
========================= */

.leaderboard-table {
  border-collapse: separate;
  border-spacing: 0 6px;
  background: transparent;
}

.leaderboard-table th {
  padding-bottom: 10px;
}

.leaderboard-table td {
  padding: 14px;
  border-bottom: 0;
  background: rgba(255,255,255,0.018);
}

.leaderboard-table tbody tr:nth-child(even):not(.rank-1):not(.rank-2):not(.rank-3) td {
  background: rgba(255,255,255,0.032);
}

.leaderboard-table td:first-child {
  border-radius: 12px 0 0 12px;
}

.leaderboard-table td:last-child {
  border-radius: 0 12px 12px 0;
}

.leaderboard-rank {
  width: 58px;
  text-align: center;
  font-weight: 950;
}

.leaderboard-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.leaderboard-station {
  font-weight: 850;
}

.score-line {
  display: grid;
  grid-template-columns: 42px minmax(120px, 1fr);
  align-items: center;
  gap: 12px;
}

.score-value {
  text-align: right;
  font-weight: 950;
}

.score-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}

.score-bar-fill {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(151,201,139,0.55), rgba(151,201,139,0.95));
}

/* Top 3 */
.leaderboard-row.rank-1 td {
  background: linear-gradient(90deg, rgba(255,209,102,0.13), rgba(255,255,255,0.026));
}

.leaderboard-row.rank-1 .score-bar-fill {
  background: linear-gradient(
    90deg,
    rgba(255,209,102,0.7),
    rgba(255,230,150,1)
  );
}

.leaderboard-row.rank-2 td {
  background: linear-gradient(90deg, rgba(210,220,230,0.14), rgba(255,255,255,0.026));
}

.leaderboard-row.rank-3 td {
  background: linear-gradient(90deg, rgba(205,127,50,0.13), rgba(255,255,255,0.026));
}

.leaderboard-row.rank-1 .leaderboard-rank-badge {
  background: rgba(255,209,102,0.18);
}

.leaderboard-row.rank-2 .leaderboard-rank-badge {
  background: rgba(210,220,230,0.20);
}

.leaderboard-row.rank-3 .leaderboard-rank-badge {
  background: rgba(205,127,50,0.18);
}

.leaderboard-row.rank-1 .leaderboard-station,
.leaderboard-row.rank-1 .score-value {
  color: var(--yellow);
}

.leaderboard-row.rank-2 .leaderboard-station,
.leaderboard-row.rank-2 .score-value {
  color: #d8e2ec;
}

.leaderboard-row.rank-2 .score-bar-fill {
  background: linear-gradient(90deg, rgba(190,205,220,0.70), rgba(235,242,248,0.98));
}

.leaderboard-row.rank-3 .score-bar-fill {
  background: linear-gradient(90deg, rgba(205,127,50,0.50), rgba(205,127,50,0.90));
}

/* Light mode */
body.light .leaderboard-table tbody tr:nth-child(even):not(.rank-1):not(.rank-2):not(.rank-3) td {
  background: rgba(23,32,22,0.055);
}

body.light .leaderboard-table td {
  background: rgba(23,32,22,0.035);
}

body.light .score-bar {
  background: rgba(23,32,22,0.10);
}

.station-header-hero {
  align-items: flex-start;
}

.station-hero-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.station-hero-kpi {
  min-width: 130px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(151,201,139,0.08);
  border: 1px solid rgba(151,201,139,0.18);
  text-align: right;
}

.station-hero-value {
  color: var(--green);
  font-size: 34px;
  font-weight: 1000;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.station-hero-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-kv {
  grid-template-columns: 1fr auto;
  row-gap: 7px;
}

.stat-kv .stat-mini-bar {
  grid-column: 1 / -1;
}

.stat-mini-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.065);
  overflow: hidden;
}

.stat-mini-bar-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: rgba(151,201,139,0.75);
}

.stat-mini-bar.is-primary .stat-mini-bar-fill {
  background: linear-gradient(90deg, rgba(151,201,139,0.55), rgba(151,201,139,0.95));
}

.stat-mini-bar.is-success .stat-mini-bar-fill {
  background: linear-gradient(90deg, rgba(151,201,139,0.55), rgba(151,201,139,1));
}

.stat-mini-bar.is-soft .stat-mini-bar-fill {
  opacity: 0.55;
}

.station-card.is-empty {
  opacity: 0.62;
}

.station-card.is-empty .station-hero-kpi {
  background: rgba(255,255,255,0.025);
  border-color: rgba(255,255,255,0.06);
}

body.light .stat-mini-bar {
  background: rgba(23,32,22,0.10);
}

/* =========================
   LIGHT MODE
========================= */
body.light {
  --bg: #f6f8f5;
  --panel: #ffffff;
  --panel-soft: #eef3ed;
  --text: #172016;
  --muted: #526151;
  --line: #cfdccd;

  --green: #4f8f49;
  --yellow: #9a6500;
  --red: #b94343;
  --blue: #315fc7;

  --shadow: 0 18px 45px rgba(20, 40, 20, 0.10);

  background:
    radial-gradient(circle at 50% 0%, rgba(95,159,88,0.15), transparent 34rem),
    linear-gradient(180deg, #f6f8f5 0%, #edf3ec 100%);
}

/* Light Header / Toggle */
body.light .theme-toggle {
  background: rgba(23,32,22,0.055);
  border-color: rgba(23,32,22,0.14);
  box-shadow: 0 8px 24px rgba(20,40,20,0.10);
}

body.light .theme-toggle:hover {
  background: rgba(95,159,88,0.18);
  border-color: rgba(95,159,88,0.38);
}

/* Light Navigation */
body.light .site-nav a {
  color: #465645;
  background: rgba(23,32,22,0.035);
  border-color: rgba(23,32,22,0.12);
}

body.light .site-nav a:hover {
  color: var(--text);
  background: rgba(95,159,88,0.13);
}

body.light .site-nav a.active {
  color: #1f5f1c;
  background: rgba(95,159,88,0.22);
  border-color: rgba(95,159,88,0.42);
  box-shadow: 0 0 10px rgba(95,159,88,0.18);
}

/* Light Panels / Cards */
body.light .hero-card,
body.light .panel {
  background: linear-gradient(135deg, #ffffff 0%, #f4faf3 100%);
  border-color: rgba(23,32,22,0.13);
  box-shadow: 0 18px 45px rgba(20,40,20,0.10);
}

/* Light Tables */
body.light table {
  background: #ffffff;
}

body.light .table-wrap {
  border-color: rgba(23,32,22,0.13);
}

/* Light Text */
body.light .lead,
body.light .k,
body.light #status,
body.light th,
body.light .panel-meta,
body.light .site-footer {
  color: var(--muted);
}

/* Light Lines */
body.light .kv,
body.light th,
body.light td {
  border-bottom-color: rgba(23,32,22,0.09);
}

/* Light Status */
body.light .status-pill {
  color: #245c21;
  background: rgba(95,159,88,0.16);
  border-color: rgba(95,159,88,0.32);
}

/* Light Badges */
body.light .badge {
  color: #263225;
  background: rgba(23,32,22,0.075);
  border-color: rgba(23,32,22,0.14);
}

body.light .badge.ok {
  color: #245c21;
  background: rgba(95,159,88,0.22);
  border-color: rgba(95,159,88,0.36);
}

body.light .badge.warning {
  color: #744a00;
  background: rgba(255,193,61,0.30);
  border-color: rgba(185,133,0,0.35);
}

body.light .badge.critical {
  color: #8f2f2f;
  background: rgba(227,109,109,0.22);
  border-color: rgba(201,79,79,0.35);
}

body.light .badge.period.active {
  color: #1f5f1c;
  background: rgba(95,159,88,0.28);
  border-color: rgba(95,159,88,0.48);
  box-shadow: 0 0 0 1px rgba(95,159,88,0.10);
}

/* Light Charts */
body.light .mini-chart {
  background: linear-gradient(
    to top,
    rgba(23,32,22,0.075) 1px,
    transparent 1px
  );
  background-size: 100% 25%;
}

body.light .bar {
  background: rgba(95,159,88,0.72);
}

body.light .bar.empty {
  opacity: 0.28;
}

body.light .station-block {
  background: rgba(23,32,22,0.04);
}

/* Light Public Stations */
body.light .public-station,
body.light .public-pass-card,
body.light .public-metrics-inline {
  background: rgba(23,32,22,0.035);
}

body.light .public-pass-card.is-now {
  border-color: rgba(95,159,88,0.32);
  background: rgba(95,159,88,0.12);
}

body.light .public-pass-card.is-next {
  background: rgba(23,32,22,0.045);
}

body.light .public-pass-card.is-empty {
  border-color: rgba(23,32,22,0.10);
  background: rgba(23,32,22,0.025);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 760px) {
  .site-header {
    padding: 14px 18px 10px;
  }

  .brand-logo {
    width: min(180px, 50vw);
    max-height: 62px;
  }

  .theme-toggle {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 12px;
  }

  .site-nav {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 12px;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: calc(100vh - 160px);
  }

  table {
    min-width: 100%;
  }

  .station-grid {
    grid-template-columns: 1fr;
  }

  .object-tx-head {
    display: block;
  }

  .object-tx-action {
    margin-top: 10px;
  }

  .object-tx-meta {
    grid-template-columns: 1fr;
  }

  .public-stations {
    grid-template-columns: 1fr;
  }
}
