:root {
  color-scheme: dark;
  --black: #0A0A0A;
  --dark: #101210;
  --card: #161a14;
  --sand: #8d9885;
  --lime: #C2FF00;
  --green: #67D10A;
  --warm: #F5F0EB;
  --muted: #8A9384;
  --line: #263022;
  --danger: #FF4040;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(194, 255, 0, .11), transparent 30%),
    linear-gradient(180deg, #050605 0%, #0A0A0A 48%, #070907 100%);
  color: var(--warm);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.station-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 21px 44px;
}

.base-header {
  padding: 2.5rem 0 0;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
  padding-bottom: 2rem;
}

.wordmark-e {
  font-size: 34px;
  font-weight: 900;
  color: var(--lime);
  font-style: italic;
  letter-spacing: -.06em;
}

.wordmark-brand {
  font-size: 24px;
  font-weight: 800;
  color: var(--warm);
  letter-spacing: .04em;
}

.wordmark-dot {
  display: inline-block;
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  margin: 0 10px 3px;
}

.wordmark-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.base-nav {
  display: flex;
  border-top: .5px solid var(--line);
  border-bottom: .5px solid var(--line);
  margin-bottom: 2.5rem;
  overflow-x: auto;
}

.base-nav a {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 16px;
  white-space: nowrap;
  border-right: .5px solid var(--line);
}

.base-nav a:hover,
.base-nav a:nth-child(2) {
  color: var(--lime);
}

.charger-stage {
  position: relative;
}

.charger-stage { display: grid; gap: 16px; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, p { margin: 0; }

h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 92px);
  line-height: .9;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  letter-spacing: -.01em;
}

.connection-pill {
  min-width: 118px;
  padding: 10px 14px;
  border: .5px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

.connection-pill.online {
  color: var(--black);
  background: var(--lime);
  border-color: var(--lime);
}

.base-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.base-stats div,
.metric-grid div,
.panel,
.charger-visual {
  background: rgba(13, 16, 12, .94);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(194, 255, 0, .04);
}

.base-stats div {
  padding: 14px 16px;
}

.base-stats strong {
  display: block;
  color: var(--lime);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -.03em;
}

.base-stats span,
.metric-grid span,
label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.charger-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 10px;
  align-items: start;
}

.charger-visual {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(260px, 1fr);
  gap: 10px;
  padding: 10px;
  min-height: 690px;
}

.machine-panel {
  position: relative;
  overflow: hidden;
  min-height: 670px;
  border: .5px solid var(--line);
  border-radius: 8px;
  background: #060806;
}

.machine-photo {
  width: 100%;
  height: 100%;
  min-height: 670px;
  object-fit: cover;
  display: block;
  filter: saturate(.98) contrast(1.04) brightness(.96);
}

.machine-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 38% 25%, rgba(194, 255, 0, .08), transparent 22%),
    linear-gradient(180deg, transparent 44%, rgba(0, 0, 0, .36));
}

.station-paint,
.station-green-stripe {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.station-paint {
  inset: 0 8% 1% 10%;
  clip-path: polygon(21% 2%, 82% 0, 97% 16%, 99% 100%, 18% 100%, 0 39%, 5% 12%);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, .12), transparent 18%, rgba(0, 0, 0, .18) 74%),
    linear-gradient(180deg, rgba(8, 13, 7, .52), rgba(2, 4, 2, .68));
  -webkit-backdrop-filter: brightness(.52) contrast(1.28) saturate(.72);
  backdrop-filter: brightness(.52) contrast(1.28) saturate(.72);
}

.station-green-stripe {
  left: 48%;
  top: 49%;
  width: 6%;
  height: 42%;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .2), transparent 34%),
    var(--lime);
  box-shadow:
    0 0 12px rgba(194, 255, 0, .18),
    inset -8px 0 18px rgba(70, 110, 0, .22);
}

.station-skin {
  position: absolute;
  top: 13%;
  left: 15%;
  z-index: 2;
  display: grid;
  gap: 2px;
  width: min(245px, 48%);
  padding: 13px 15px;
  border: 1px solid rgba(194, 255, 0, .42);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(4, 7, 4, .86), rgba(2, 4, 2, .74));
  box-shadow: 0 18px 34px rgba(0, 0, 0, .25);
  -webkit-backdrop-filter: blur(2px) brightness(.9);
  backdrop-filter: blur(2px) brightness(.9);
}

.station-skin span {
  color: var(--lime);
  font-size: clamp(34px, 7vw, 48px);
  font-style: italic;
  font-weight: 950;
  line-height: .72;
  letter-spacing: -.08em;
}

.station-skin strong {
  color: var(--warm);
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 950;
  letter-spacing: .04em;
}

.station-skin small {
  color: var(--lime);
  font-size: clamp(9px, 2.4vw, 12px);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.machine-overlay {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 12px;
  border: .5px solid rgba(245, 240, 235, .22);
  border-radius: 8px;
  z-index: 2;
  border-color: rgba(194, 255, 0, .36);
  background: rgba(5, 7, 5, .82);
  backdrop-filter: blur(10px);
}

.machine-overlay span,
.terminal-detail {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.machine-overlay strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.charger-tower {
  display: grid;
  align-content: start;
  gap: 10px;
}

.screen,
.payter,
.connector,
.vehicle-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070907;
}

.screen {
  display: grid;
  gap: 8px;
  padding: 22px;
  min-height: 190px;
}

.screen span {
  color: var(--lime);
  font-size: 12px;
}

.screen strong {
  color: var(--lime);
  font-size: clamp(58px, 8vw, 96px);
  line-height: .9;
  letter-spacing: -.04em;
}

.screen small {
  color: var(--sand);
  font-size: 13px;
  font-weight: 700;
}

.payter {
  padding: 18px;
  border-color: rgba(194, 255, 0, .42);
  background: linear-gradient(180deg, #0d120b, #050705);
  color: var(--warm);
}

.payter span {
  color: var(--lime);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.payter strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  letter-spacing: -.03em;
}

.connector {
  padding: 18px;
}

.cable {
  height: 82px;
  max-width: 220px;
  border-right: 12px solid var(--lime);
  border-bottom: 12px solid var(--lime);
  border-radius: 0 0 38px 0;
  opacity: .16;
  margin-bottom: 12px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--black);
  background: var(--lime);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -.01em;
}

button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #2A2A28;
}

.vehicle-card {
  padding: 18px;
}

.vehicle-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.vehicle-meta span {
  color: var(--warm);
  font-weight: 800;
}

.vehicle-meta strong {
  color: var(--lime);
  font-size: 34px;
  line-height: 1;
}

.battery-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #20281d;
}

#battery-fill {
  width: 22%;
  height: 100%;
  background: var(--lime);
}

.control-panel {
  display: grid;
  gap: 10px;
}

.panel {
  display: grid;
  gap: 10px;
  padding: 18px;
}

select, input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #354230;
  border-radius: 8px;
  padding: 12px;
  color: var(--warm);
  background: #070907;
}

.range-panel {
  border-color: rgba(194, 255, 0, .26);
}

.range-control {
  display: grid;
  gap: 10px;
}

.range-control strong {
  color: var(--lime);
  font-size: 26px;
  line-height: 1;
}

input[type="range"] {
  appearance: none;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--green));
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border: 2px solid #050705;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(194, 255, 0, .18);
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--green));
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 2px solid #050705;
  border-radius: 50%;
  background: var(--lime);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric-grid div {
  min-height: 88px;
  padding: 14px;
}

.metric-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--warm);
  font-size: 22px;
  line-height: 1.1;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.telemetry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 10px;
  margin-top: 10px;
}

canvas {
  width: 100%;
  height: auto;
}

.log-panel {
  max-height: 360px;
  overflow: auto;
}

#log {
  display: grid;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.log-entry {
  padding: 9px;
  border-radius: 7px;
  background: #070907;
  color: var(--muted);
  word-break: break-word;
}

.log-entry.out { color: var(--sand); }
.log-entry.in { color: var(--lime); }
.log-entry.warn { color: var(--warm); }

@media (max-width: 980px) {
  .charger-layout,
  .charger-visual,
  .telemetry {
    grid-template-columns: 1fr;
  }

  .machine-panel,
  .machine-photo {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .station-shell {
    padding: 0 14px 36px;
  }

  .topbar,
  .base-stats,
  .metric-grid,
  .action-row {
    grid-template-columns: 1fr;
  }

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

  .base-nav a {
    text-align: center;
    padding: 10px 8px;
  }

  h1 {
    font-size: 42px;
    line-height: 1;
  }

  .connection-pill {
    width: 100%;
  }

  .charger-visual {
    min-height: 0;
  }

  .machine-panel,
  .machine-photo {
    min-height: 520px;
  }
}
