:root {
  --bg: #0b1219;
  --ink: #071017;
  --panel: #152231;
  --panel-2: #1b2c3c;
  --line: #2d4a5c;
  --line-soft: #243848;
  --text: #e8eef4;
  --muted: #8aa0b3;
  --accent: #4ec8dc;
  --accent-2: #6dce7a;
  --warn: #e0b33a;
  --danger: #e05a5a;
  --on-accent: #071820;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 12px 28px rgba(0, 8, 16, 0.45);
  --radius-card: 4px;
  --radius-chip: 4px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0.01em;
}
button, input, select { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

#app { height: 100%; display: grid; grid-template-rows: 64px 1fr; }
html.boot #app { visibility: hidden; pointer-events: none; }
html.boot .start-screen { display: grid !important; }

.topbar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(210px, 1fr);
  align-items: stretch;
  gap: 18px;
  padding: 0 18px;
  background: linear-gradient(180deg, #1a2a38 0%, #101920 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(78, 200, 220, 0.25);
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand-name {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-mark {
  width: 5px;
  height: 28px;
  border-radius: 1px;
  flex-shrink: 0;
  background: var(--accent);
}

.kpi-strip {
  display: flex;
  gap: 4px 0;
  justify-content: center;
  flex-wrap: wrap;
  align-items: stretch;
  padding: 8px 0;
}
.kpi {
  padding: 4px 14px;
  border-right: 1px solid var(--line-soft);
}
.kpi:last-of-type { border-right: 0; }
.kpi.main { padding-right: 18px; }
.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}
.kpi strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.kpi.main strong { font-size: 18px; color: var(--warn); }
.kpi strong.up { color: var(--accent-2); }
.kpi strong.down { color: var(--danger); }

.top-tools { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
#clock-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.speed-controls {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--ink);
  border-radius: var(--radius-chip);
  overflow: hidden;
}
.speed-controls button {
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 600;
}
.speed-controls button:last-child { border-right: 0; }
.ghost, .primary, .side-tabs button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: var(--radius-chip);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
}
.icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  width: 34px; height: 34px;
  padding: 0;
  font-size: 15px;
  display: grid;
  place-items: center;
}
.icon-btn .st-ico { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--accent); background: var(--panel-2); }
.speed-controls button.active {
  background: var(--accent);
  color: var(--on-accent);
}
.side-tabs button.active, .primary {
  background: var(--accent);
  border-color: #3aa9bb;
  color: var(--on-accent);
  box-shadow: none;
}
.primary {
  width: 100%;
  margin-top: 10px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  padding: 9px 12px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary .st-ico { color: var(--on-accent); width: 18px; height: 18px; }
.primary:hover { filter: brightness(1.06); }
.ghost {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  color: var(--text);
  font-weight: 600;
  padding: 7px 12px;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.ghost.danger { color: var(--danger); border-color: #5a3038; }
.row-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 12px; }

.layout { display: grid; grid-template-columns: 1fr 318px; min-height: 0; }
.map-wrap { position: relative; min-height: 0; }
#map { width: 100%; height: 100%; }
.map-hud {
  position: absolute; left: 14px; top: 14px; z-index: 19;
  display: flex; flex-direction: column; gap: 16px; width: min(368px, calc(100% - 28px));
}
.hud-panel {
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  padding: 6px;
}
.hud-dock { margin-top: 2px; }
.hud-kicker {
  margin: 2px 4px 4px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.build-stack { display: flex; flex-direction: column; gap: 6px; }
.build-band { display: flex; flex-direction: column; gap: 2px; }
.band-lab {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 4px;
}
.build-row, .build-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 4px;
  background: none;
  padding: 0;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.build-card {
  width: auto; min-width: 0; text-align: left; padding: 6px 7px;
  border-radius: 4px;
  border: 1px solid transparent;
  border-left: 3px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.build-card strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.build-card small { display: block; color: var(--muted); font-size: 9px; font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.build-card.active {
  background: #16323c;
  border-color: var(--accent);
  border-left-color: var(--accent);
}
.build-card.ultra { border-left-color: var(--warn); }
.build-card.energy { border-left-color: #f0d24a; }
.build-card.energy.active { border-color: #f0d24a; background: #2a2814; }
.build-card.energy.park { border-left-color: #c9a227; }
.energy-bar { margin-top: 4px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.power-mix { margin-top: 6px; }
.power-mix-track {
  display: flex;
  height: 10px;
  background: #0d1a22;
  border-radius: 4px;
  overflow: hidden;
}
.power-mix-track span { display: block; min-width: 0; height: 100%; }
#pm-buy { background: #4ec8dc; }
#pm-solar { background: #f0d24a; }
#pm-batt { background: #ffb020; }
.power-mix p { margin: 4px 0 0; font-size: 10px; color: var(--muted); }
#staff-wage, #staff-n { width: 72px; }
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.price-rivals, .price-rank { margin: 8px 0; padding: 0; list-style: none; font-size: 12px; color: var(--text); }
.price-rivals div, .price-rank li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
}
.price-rank li.is-you { color: var(--accent); font-weight: 600; }
.tax-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 10px 0; }
.tax-table th, .tax-table td { padding: 6px 4px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.tax-table th { color: var(--muted); font-weight: 600; }
.tax-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tax-table tfoot td { font-weight: 700; }
.ledger-list { max-height: min(62vh, 540px); overflow: auto; }
.ledger-table td.up { color: var(--accent-2); }
.ledger-table td.down { color: var(--danger); }
#tax-status.warn { color: var(--warn); }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.shop-item {
  background: var(--ink);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 12px 14px 12px;
}
.shop-item.is-owned { border-left-color: var(--accent-2); }
.shop-item.is-on { border-color: var(--accent); background: #16323c; }
.shop-item h3 { margin: 2px 0 6px; font-size: 16px; font-weight: 600; }
.shop-item .st-kicker { margin: 0 0 4px; }
.shop-bens { margin: 8px 0 10px; padding-left: 16px; color: var(--text); font-size: 12px; }
.shop-bens li { margin: 3px 0; }
.shop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.shop-foot strong { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.charger-tools {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 10px 0 12px;
}
#btn-service-bulk { width: 100%; margin: 4px 0 6px; }
.charger-list { display: flex; flex-direction: column; gap: 4px; }
.charger-head, .charger-row {
  display: grid;
  grid-template-columns: 6.2rem 0.9fr 0.9fr 1.3fr auto;
  gap: 8px;
  align-items: center;
  text-align: left;
}
.charger-head {
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.charger-row {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
.charger-row:hover { border-color: var(--accent); cursor: pointer; }
.charger-act { justify-self: end; }
.charger-act .quiet-btn { padding: 4px 8px; font-size: 11px; }
.charger-id {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}
.charger-meta { font-size: 12px; }
.hint {
  margin: 0; padding: 0 4px;
  border-radius: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  max-width: none;
}
.legend {
  display: flex; flex-wrap: wrap; gap: 10px 12px;
  padding: 2px 4px 0;
  background: none;
  border: 0;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i, .legend .you, .legend .diesel, .legend .petrol, .legend .ev {
  width: 9px; height: 3px; border-radius: 0; display: inline-block;
}
.legend .you, .legend .ev { background: var(--accent-2); }
.legend .diesel { background: #8a8074; }
.legend .petrol { background: var(--warn); }
.legend .solar { width: 9px; height: 9px; background: #f0d24a; }
.legend .park { width: 14px; height: 10px; background: #e8c547; }
.legend .battery { width: 9px; height: 9px; background: #ffb020; }
.map-attribution-note {
  position: absolute; left: 12px; bottom: 26px; z-index: 2;
  font-size: 10px; color: var(--muted);
}

.sidebar {
  overflow: auto;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, #152231 0%, #101920 100%);
  display: flex;
  flex-direction: column;
}
.live-side {
  padding: 22px 18px 28px;
  gap: 26px;
}
.live-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.live-group:last-of-type { border-bottom: 0; padding-bottom: 0; }
.live-group h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sat-block { gap: 10px; }
.sat-block.alert {
  background: #243018;
  border-left: 3px solid var(--warn);
  border-radius: 0 4px 4px 0;
  padding: 12px 12px 14px;
}
.sat-why {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sat-why li { font-size: 13px; line-height: 1.5; color: var(--muted); }
.sat-why li.bad { color: var(--warn); }
.sat-why li.good { color: var(--accent-2); }
.live-more {
  width: auto;
  align-self: flex-start;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.live-more .st-ico, .live-group h2 .st-ico { color: var(--accent); }
.live-brief h2 {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.side-fin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.fin-cell {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 8px 9px 9px;
  min-width: 0;
}
.fin-cell span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-cell strong {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.side-log { max-height: 148px; font-size: 11px; }
.live-side .customer-list li { padding: 5px 0; font-size: 12px; }
.live-side .customer-list li span { color: var(--muted); font-size: 11px; text-align: right; }
#btn-sat-power.hidden { display: none !important; }
#btn-sat-power { margin-top: 6px; }
.console-dock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  background: none;
  padding: 0;
  border: 0;
  box-shadow: none;
}
.console-dock button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.console-dock button .i18n-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.console-dock button .st-ico { width: 16px; height: 16px; }
.console-dock button.active, .console-dock button:hover {
  color: var(--on-accent);
  border-color: var(--accent);
  background: var(--accent);
}
.console-dock button.active .st-ico, .console-dock button:hover .st-ico { color: var(--on-accent); }
@keyframes tax-due-blink {
  0%, 100% {
    background: #7a1c18;
    border-color: #ff8a6a;
    color: #fff;
    box-shadow: 0 0 0 1px #ff6b4a, 0 0 10px rgba(224, 90, 90, 0.55);
  }
  50% {
    background: #e05a5a;
    border-color: #ffd4c8;
    color: #fff;
    box-shadow: 0 0 0 2px #fff, 0 0 16px rgba(255, 140, 90, 0.9);
  }
}
.console-dock button.tax-due,
.console-dock button.tax-due.active,
.console-dock button.tax-due:hover {
  animation: tax-due-blink 0.8s ease-in-out infinite;
  color: #fff;
  font-weight: 800;
}
.console-dock button.tax-due .st-ico,
.console-dock button.tax-due.active .st-ico,
.console-dock button.tax-due:hover .st-ico { color: #fff; }
#btn-tax-pay.tax-due {
  animation: tax-due-blink 0.8s ease-in-out infinite;
}

.console-layer {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.console-layer.hidden { display: none !important; }
.console-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 16, 0.62);
}
.mgmt-card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: 86vh;
  overflow: auto;
  background:
    linear-gradient(180deg, #1b2c3c 0%, #152231 100%);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}
.card-hero {
  height: 118px;
  overflow: hidden;
  background: var(--ink);
  flex-shrink: 0;
}
.card-hero img {
  display: block;
  width: 100%;
  height: 118px;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.06);
}
.card-hero.no-img { display: none; }
.mgmt-card.hidden { display: none !important; }
.mgmt-head, .mgmt-card > .panel { padding-left: 22px; padding-right: 22px; }
.mgmt-head {
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mgmt-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}
.mgmt-card .panel { margin: 0; }
.tab-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.tab-body.hidden { display: none; }
.panel {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 14px 0 4px;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.stats { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; font-size: 13px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-family: var(--mono); text-align: right; }

.mix-overview { margin-bottom: 10px; }
.zone-list { display: flex; flex-direction: column; gap: 8px; }
.zone-card { padding: 8px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.zone-card header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.zone-card header strong { font-family: var(--display); font-weight: 600; }
.bars { display: flex; height: 4px; border-radius: 0; overflow: hidden; background: var(--ink); }
.bars span { display: block; height: 100%; }
.ev { background: var(--accent-2); }
.diesel { background: #8a8074; }
.petrol { background: var(--warn); }
.zone-meta { color: var(--muted); font-size: 11px; margin-top: 4px; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
input[type="number"], input[type="range"], select { width: 100%; }
input[type="number"], input[type="text"], .start-card select, #tender-concept, select {
  background: var(--ink);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
input[type="number"]:focus, input[type="text"]:focus, select:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.campaigns { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.campaign {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 12px; padding: 6px 0; border-top: 1px solid var(--line-soft);
}
.campaign button { padding: 4px 8px; }

.expand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.expand-row:last-child { border-bottom: 0; }
.expand-row .row-btns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
  min-width: 160px;
}
.expand-status {
  color: var(--accent-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.quiet-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}
.quiet-btn:hover { border-style: solid; border-color: var(--accent); color: var(--accent); }
.quiet-btn:disabled { opacity: 0.4; cursor: default; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0; color: var(--muted); }
.check input { width: auto; }

.alert-pop {
  position: fixed;
  right: 16px;
  top: 76px;
  z-index: 45;
  width: min(340px, calc(100% - 24px));
  background: var(--panel-2);
  border: 1px solid var(--warn);
  border-left: 4px solid var(--warn);
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.alert-pop.hidden { display: none !important; }
.alert-pop h3 { margin: 0 0 6px; font-family: var(--display); font-size: 18px; color: var(--warn); }
.alert-pop p { margin: 0 0 10px; font-size: 13px; color: var(--text); }

.tweet-stack {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 35;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(280px, 46vw);
  pointer-events: none;
}
.tweet {
  pointer-events: auto;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}
.tweet strong {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}
html.calm .tweet { opacity: 0.85; }
html.calm .legend { opacity: 0.55; }
html.compact-hud .topbar { min-height: 44px; }
html.compact-hud .top-kpis { gap: 8px; }
html.compact-hud .map-hud { gap: 6px; }
html.compact-hud .tweet { font-size: 11px; padding: 6px 8px; }
.muted { color: var(--muted); font-size: 12px; font-weight: 500; }
.loan-list, .event-log { margin-top: 8px; font-size: 12px; }
.loan-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
#btn-loan-merge { margin-top: 10px; width: 100%; }
#bank-score { font-size: 13px; margin: 0 0 10px; }
#bank-offers { margin: 12px 0; }
.event-log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.event-log li { padding: 7px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.event-log time { color: var(--muted); font-family: var(--mono); margin-right: 8px; }

.modal {
  position: fixed; inset: 0; background: rgba(12, 9, 6, 0.62);
  display: grid; place-items: center; z-index: 20;
}
.modal.hidden, .toast.hidden, .modal[hidden], .start-screen.hidden { display: none !important; }
#settings { z-index: 50; }
#credits { z-index: 55; }
#legal { z-index: 56; }
#settings .modal-card, .settings-sheet, .credits-sheet { max-height: 90vh; overflow: auto; }
.settings-sheet, .credits-sheet { width: min(460px, calc(100% - 24px)); padding: 0 0 18px; }
.settings-sheet .st-body, .credits-sheet { padding: 8px 20px 18px; }
.settings-sheet .card-hero { margin-bottom: 4px; }
.credits-sheet { padding: 22px 22px 20px; }
.legal-sheet { width: min(520px, calc(100% - 24px)); }
.legal-dl { margin: 0; display: grid; gap: 8px; }
.legal-dl div { display: grid; grid-template-columns: minmax(7.5rem, 38%) 1fr; gap: 8px 12px; font-size: 13px; }
.legal-dl dt { color: var(--muted); }
.legal-dl dd { margin: 0; }
.legal-copy p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.legal-btns { grid-template-columns: 1fr 1fr; margin: 12px 0; }
.start-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 12px; }
.start-links .linkish { margin: 8px 0 0; }
.credit-list { list-style: none; margin: 0; padding: 0; }
.credit-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.credit-list a { color: var(--accent); }
.credit-list span { color: var(--muted); font-size: 11px; white-space: nowrap; }
html.boot .start-screen { display: grid !important; }
.modal-card {
  width: min(420px, calc(100% - 24px));
  background: linear-gradient(180deg, #1b2c3c, #152231);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.modal-card h3, .modal-card h2 {
  margin-top: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13px; }
.detail-grid span { color: var(--muted); }
.util-bar { height: 5px; background: var(--ink); border-radius: 0; overflow: hidden; margin: 12px 0; }
.util-bar i { display: block; height: 100%; background: var(--accent-2); }

#station-modal-card.station-sheet {
  width: min(488px, calc(100% - 24px));
  max-height: 90vh;
  overflow: auto;
  padding: 0;
  border-top: 0;
}
.st-hero {
  position: relative;
  min-height: 148px;
  background: var(--ink);
  overflow: hidden;
  border-radius: 4px 4px 0 0;
}
.st-hero img {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
}
.st-hero-copy {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 20px 14px;
  background: linear-gradient(transparent, var(--ink) 72%);
}
.st-kicker {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}
.st-hero-copy h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}
.st-hero-copy h3.st-code,
dd.st-code {
  font-family: var(--mono);
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: none;
}
.st-hero-copy p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.st-body { padding: 16px 20px 18px; }
.st-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.st-kpi {
  background: var(--ink);
  border-left: 3px solid var(--accent);
  padding: 10px 12px 11px;
  min-height: 78px;
}
.st-kpi span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.st-kpi strong {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
}
.st-kpi .util-bar { margin: 8px 0 0; height: 4px; }
.st-kpi.up strong { color: var(--accent-2); }
.st-kpi.down strong { color: var(--danger); }
.st-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 16px 0 6px;
  font-size: 12px;
}
.st-meta div { display: flex; justify-content: space-between; gap: 8px; }
.st-meta dt { color: var(--muted); }
.st-meta dd { margin: 0; font-family: var(--mono); }
.st-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.st-block h4 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.st-note { margin: 0 0 10px; }
.st-actions { display: flex; flex-direction: column; gap: 8px; }
.st-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
}
.st-action span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-action strong { font-size: 13px; font-weight: 600; }
.st-action small { color: var(--muted); font-size: 11px; }
.st-action:hover { border-color: var(--accent); }
.st-action.is-on {
  border-color: #2f5a4a;
  background: #1a2420;
}
.st-action.is-on small { color: var(--accent-2); }
.st-action.st-upgrade {
  border-color: var(--accent);
  background: #16323c;
}
.st-action.is-danger {
  margin-top: 16px;
  border-style: solid;
  border-color: #5a3038;
  color: var(--danger);
  background: transparent;
}
.st-ico { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); }
.st-action.is-on .st-ico { color: var(--accent-2); }
.st-action.is-danger .st-ico { color: var(--danger); }
#station-modal-card #st-close {
  width: auto;
  margin-top: 14px;
}
#station-modal-card #st-price-btn { margin-top: 8px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 4px;
  z-index: 30;
  font-size: 13px;
}

.start-screen {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 22px 20px 24px;
  overflow: auto;
}
.start-bg {
  position: absolute;
  inset: 0;
}
.start-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 16, 23, 0.42) 0%, rgba(7, 16, 23, 0.78) 100%);
}
.start-bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7) contrast(1.05);
}
.start-hero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.start-title {
  grid-column: 2;
  margin: 0;
  font-family: "Orbitron", var(--display), sans-serif;
  font-size: clamp(28px, 5.4vw, 56px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text);
  text-shadow: 0 0 18px rgba(78, 200, 220, 0.28), 0 8px 28px rgba(0, 8, 16, 0.55);
}
.start-lang {
  justify-self: end;
  display: flex;
  gap: 6px;
  align-items: center;
}
.start-lang-flag {
  width: 42px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  border-radius: 4px;
  line-height: 0;
}
.start-lang-flag svg { width: 100%; height: 100%; display: block; border-radius: 2px; }
.start-lang-flag:hover { border-color: var(--accent); }
.start-lang-flag.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.start-body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(240px, 360px);
  gap: 18px;
  align-items: start;
  justify-content: center;
}
.start-card { width: auto; max-width: none; }
.start-faq {
  background: linear-gradient(180deg, #1b2c3c 0%, #152231 100%);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  max-height: min(72vh, 640px);
  overflow: auto;
}
.start-faq h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.start-faq details { border-top: 1px solid var(--line-soft); padding: 8px 0; }
.start-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.start-faq p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 860px) {
  .start-body { grid-template-columns: 1fr; }
  .start-hero { grid-template-columns: 1fr auto; }
  .start-title { grid-column: 1; text-align: left; }
}
.linkish {
  display: block; margin: 16px auto 0; background: none; border: 0;
  color: var(--muted); font-size: 12px; text-decoration: underline;
  text-underline-offset: 3px;
}
.brand-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.start-card h2, #start-heading {
  font-family: var(--display);
  font-weight: 600;
}
.start-dots { display: flex; gap: 8px; margin: 12px 0 18px; }
.start-dots i { width: 18px; height: 3px; border-radius: 0; background: var(--line); display: block; }
.start-dots i.on { background: var(--accent); }
.start-pane.hidden { display: none !important; }
.start-nav { margin-top: 16px; grid-template-columns: 1fr 1fr; }
.start-nav .primary { margin-top: 0; }
.start-nav .ghost { border: 1px solid var(--line); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 12px; }
.check input { width: auto; }
.customer-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.customer-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.pay-box { margin-top: 14px; font-size: 12px; }
.pay-box .ghost { width: 100%; margin: 6px 0; }
.tutorial {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 10, 16, 0.48);
  display: grid; place-items: end start;
  padding: 28px;
  pointer-events: none;
}
.tutorial.tut-with-card { background: transparent; pointer-events: auto; }
.tutorial.hidden { display: none !important; }
.console-layer.tut-front { z-index: 46; }
.tut-arrow {
  position: fixed;
  z-index: 55;
  width: 64px;
  height: 96px;
  color: #7ee7f2;
  filter: drop-shadow(0 0 10px rgba(78, 200, 220, 0.95));
  pointer-events: none;
  animation: tutArrowPulse 1s ease-in-out infinite;
}
.tut-arrow svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 88%;
  animation: tutArrowNudge 0.85s ease-in-out infinite;
}
.tut-arrow.hidden { display: none !important; }
@keyframes tutArrowNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(12px); }
}
@keyframes tutArrowPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}
.tutorial-card {
  pointer-events: auto;
  z-index: 56;
  width: min(420px, calc(100% - 24px));
  background: linear-gradient(180deg, #1b2c3c, #152231);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.tutorial-card.tut-in { animation: tutCard 0.45s ease; }
@keyframes tutCard {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.tut-anim {
  height: 4px;
  margin: -18px -20px 12px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: tutBar 1.6s linear infinite;
}
@keyframes tutBar {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
.tutorial-card h3 {
  margin: 4px 0 10px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}
.tutorial-card .row-btns { grid-template-columns: 1fr 1fr; }
.tutorial-card .primary { margin-top: 0; }
.tutorial-copy { font-size: 14px; line-height: 1.55; max-height: min(42vh, 280px); overflow: auto; }
.tutorial-copy p { margin: 0 0 10px; }
.tutorial-copy p:last-child { margin-bottom: 0; }
#tutorial-end { display: block; margin-top: 10px; pointer-events: auto; }
.tut-spot {
  position: relative;
  z-index: 46;
  outline: 2px solid var(--accent);
  animation: tutPulse 1.4s ease-in-out infinite;
}
@keyframes tutPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(78, 200, 220, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(78, 200, 220, 0); }
}
.help-sheet { width: min(860px, calc(100vw - 32px)); max-height: min(86vh, 720px); display: flex; flex-direction: column; }
.help-layout { display: grid; grid-template-columns: 200px 1fr; gap: 12px; min-height: 0; flex: 1; margin: 10px 0 12px; }
.help-nav { display: flex; flex-direction: column; gap: 4px; overflow: auto; padding-right: 4px; }
.help-link {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
}
.help-link.on, .help-link:hover { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.help-body { overflow: auto; font-size: 13px; line-height: 1.55; padding: 4px 8px 8px 12px; border-left: 1px solid var(--line-soft); }
.help-body h3 { margin: 0 0 10px; font-family: var(--display); font-size: 20px; }
.help-body p { margin: 0 0 10px; color: var(--text); }
.start-brief { list-style: none; margin: 8px 0 0; padding: 0; }
.start-brief li {
  position: relative;
  padding: 8px 0 8px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--text);
  animation: tutCard 0.45s ease both;
}
.start-brief li:nth-child(2) { animation-delay: 0.08s; }
.start-brief li:nth-child(3) { animation-delay: 0.16s; }
.start-brief li:nth-child(4) { animation-delay: 0.24s; }
.start-brief li:nth-child(5) { animation-delay: 0.32s; }
.start-brief li:nth-child(6) { animation-delay: 0.4s; }
.start-brief li::before {
  content: "";
  position: absolute;
  left: 0; top: 14px;
  width: 6px; height: 6px;
  border-radius: 1px;
  background: var(--accent);
}
button:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 55vh 1fr; }
  .topbar { grid-template-columns: 1fr auto; }
  .kpi-strip { display: none; }
  .charger-tools { grid-template-columns: 1fr; }
  .help-layout { grid-template-columns: 1fr; }
  .help-body { border-left: 0; padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tutorial-card.tut-in, .tut-anim, .tut-spot, .start-brief li, .tut-arrow, .tut-arrow svg { animation: none; }
}
