:root {
  --void: #04070c;
  --panel: #0a1118;
  --panel-2: #101923;
  --line: #263445;
  --line-hot: #3b4e64;
  --text: #eef5f8;
  --muted: #8a98a8;
  --dim: #536171;
  --cyan: #00d4ff;
  --green: #34d399;
  --red: #ff3b30;
  --amber: #ffb800;
  --mono: "JetBrains Mono", "Courier New", monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.counter-shell {
  width: min(1540px, calc(100vw - 24px));
  height: 100svh;
  margin: 0 auto;
  padding: 10px 0;
  display: grid;
  grid-template-rows: 185px 210px 92px minmax(190px, 1fr);
  gap: 10px;
  overflow: hidden;
}

.hero-band,
.total-stage,
.metric-card,
.dispatch-panel,
.ledger-panel {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.hero-band {
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.hero-band::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.status-bar {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}

.brand-lockup {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--red);
  color: var(--cyan);
  font-weight: 800;
}

.brand-lockup strong,
.live-state strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.brand-lockup small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.live-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--amber);
}

.status-actions,
.social-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.social-actions a {
  min-width: 38px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-hot);
  color: var(--text);
  background: rgba(16, 25, 35, 0.72);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.social-actions a:hover,
.social-actions a:focus {
  color: var(--cyan);
  border-color: var(--cyan);
  outline: none;
}

.live-state.ready {
  color: var(--green);
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 16px currentColor;
  animation: pulse 1.1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(130px, 15vw, 220px);
  gap: 18px;
  align-items: stretch;
  height: calc(100% - 48px);
  padding: 12px 16px;
  min-height: 0;
}

.hero-copy {
  align-self: center;
}

.eyebrow,
.total-label,
.metric-card span,
.panel-head,
.total-foot,
.subject-caption,
.flow-line span,
dt {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.eyebrow {
  color: var(--cyan);
  font-size: 10px;
  margin: 0 0 8px;
}

h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(28px, 3vw, 56px);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(12px, 1.08vw, 16px);
  line-height: 1.35;
}

.subject-panel {
  position: relative;
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--panel-2);
  overflow: hidden;
}

.subject-panel picture,
.subject-panel img {
  display: block;
  width: 100%;
  height: 100%;
}

.subject-panel img {
  object-fit: contain;
  padding: 8px;
  filter: saturate(0.9) contrast(1.06);
}

.scan {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 48%, rgba(0, 212, 255, 0.24) 50%, transparent 52%),
    linear-gradient(to bottom, transparent, rgba(4, 7, 12, 0.55));
  background-size: 100% 180px, 100% 100%;
  animation: scan 4.8s linear infinite;
}

@keyframes scan {
  from { background-position: 0 -180px, 0 0; }
  to { background-position: 0 360px, 0 0; }
}

.subject-caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(4, 7, 12, 0.82);
  border: 1px solid var(--line-hot);
  font-size: 8px;
}

.subject-caption strong {
  color: var(--red);
}

.total-stage {
  margin-top: 0;
  padding: clamp(14px, 2vw, 24px);
  min-height: 0;
  overflow: hidden;
}

.total-label {
  color: var(--muted);
  font-size: 10px;
}

.total-values {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 18px;
  margin-top: 10px;
}

.total-values div {
  min-width: 0;
}

.total-values span {
  display: block;
  font-family: var(--mono);
  font-size: clamp(42px, 7vw, 96px);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--green);
}

.total-values div + div span {
  color: var(--cyan);
  font-size: clamp(34px, 5vw, 72px);
}

.total-values small {
  display: block;
  margin-top: 6px;
  color: var(--dim);
  font-family: var(--mono);
  letter-spacing: 0.18em;
  font-size: 10px;
}

.total-foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 9px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
  min-height: 0;
}

.metric-card {
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card span {
  color: var(--dim);
  font-size: 8px;
}

.metric-card strong {
  display: block;
  font-family: var(--mono);
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.narrative-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(270px, 0.8fr);
  gap: 10px;
  margin-top: 0;
  min-height: 0;
  overflow: hidden;
}

.dispatch-panel,
.ledger-panel {
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 8px;
  color: var(--dim);
}

.panel-head strong {
  color: var(--cyan);
  text-align: right;
}

.dispatch-panel p {
  color: var(--muted);
  font-size: clamp(11px, 1.05vw, 15px);
  line-height: 1.35;
  margin: 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flow-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.flow-line div {
  border: 1px solid var(--line);
  padding: 9px;
  min-height: 52px;
  background: var(--panel-2);
}

.flow-line span {
  display: block;
  color: var(--red);
  font-size: 8px;
  margin-bottom: 6px;
}

.flow-line strong {
  display: block;
  font-size: 11px;
}

dl {
  margin: 10px 0 0;
  display: grid;
  gap: 6px;
}

dt {
  color: var(--dim);
  font-size: 8px;
}

dd {
  margin: 2px 0 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .counter-shell {
    width: min(100vw - 18px, 1540px);
    grid-template-rows: 180px 212px 92px minmax(190px, 1fr);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 150px;
  }

  .narrative-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.95fr);
  }

  h1 {
    font-size: clamp(28px, 3.2vw, 42px);
  }

  .lede {
    font-size: 12px;
  }
}

@media (max-width: 680px) {
  .counter-shell {
    width: min(100vw - 24px, 1640px);
    padding-top: 12px;
    grid-template-rows: 188px 190px 140px minmax(210px, 1fr);
  }

  .status-bar,
  .total-foot,
  .panel-head,
  .subject-caption {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-bar {
    height: auto;
    gap: 14px;
    padding: 16px;
  }

  .status-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero-grid,
  .total-stage,
  .dispatch-panel,
  .ledger-panel {
    padding: 18px;
  }

  .hero-grid,
  .narrative-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .subject-panel {
    min-height: 180px;
  }

  .total-values,
  .metric-grid,
  .flow-line {
    grid-template-columns: 1fr;
  }
}
