:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1220;
  color: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0b1220;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #172033;
  color: #f8fafc;
  padding: 0 14px;
}

button:disabled {
  opacity: 0.45;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px 0;
  background: #0b1220;
}

.tabs .active {
  background: #f8fafc;
  color: #111827;
}

.panel,
.controls,
.stats,
.gate-editor {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.panel {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.hero h1,
.panel h1,
.empty h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: #93c5fd;
  font-size: 0.83rem;
  text-transform: uppercase;
}

.status {
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 8px 12px;
  color: #cbd5e1;
}

.status.live {
  border-color: #22c55e;
  color: #bbf7d0;
}

.map-wrap {
  height: min(62vh, 620px);
  min-height: 360px;
  border: 1px solid #243044;
  overflow: hidden;
}

#map {
  height: 100%;
  width: 100%;
  background: #111827;
}

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

.primary {
  background: #f97316;
  border-color: #fb923c;
  color: #111827;
  font-weight: 800;
}

.notice {
  border-left: 4px solid #f97316;
  background: #172033;
  padding: 12px;
  color: #fde68a;
}

.stats {
  grid-template-columns: repeat(4, 1fr);
}

.stats article,
.session-card,
.gate-card,
.empty {
  border: 1px solid #243044;
  background: #111827;
  border-radius: 8px;
  padding: 14px;
}

.stats span {
  display: block;
  color: #94a3b8;
  font-size: 0.82rem;
}

.stats strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(1rem, 3vw, 1.55rem);
}

.table {
  border: 1px solid #243044;
  overflow-x: auto;
}

.row {
  display: grid;
  grid-template-columns: 62px repeat(5, minmax(90px, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 620px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #243044;
  border-radius: 0;
  background: #111827;
  text-align: left;
}

.row.header {
  min-height: 42px;
  padding: 0 14px;
  color: #94a3b8;
  background: #172033;
}

.row.muted {
  grid-template-columns: 1fr;
  padding: 14px;
  color: #94a3b8;
}

.session-list,
.gate-editor {
  display: grid;
  gap: 12px;
}

.session-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.session-card h2,
.gate-card h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.session-card p {
  margin: 0;
  color: #94a3b8;
}

.gate-editor {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.gate-card label {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  color: #cbd5e1;
}

.gate-card input {
  min-height: 40px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0b1220;
  color: #f8fafc;
  padding: 0 10px;
}

.leaflet-container {
  font: inherit;
}

@media (max-width: 720px) {
  .shell {
    padding: 10px;
  }

  .panel,
  .controls,
  .stats {
    grid-template-columns: 1fr;
  }

  .map-wrap {
    min-height: 330px;
    height: 48vh;
  }
}
