:root {
  --ink: #141414;
  --muted: #5e5e5e;
  --faint: #8a8a8a;
  --line: #141414;
  --hair: #d8d8d6;
  --paper: #f3f3f1;
  --card: #ffffff;
  --wash: #ececea;
  --stage: #0e0e0e;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--stage);
  color: var(--ink);
  font-family: var(--sans);
}

button, input {
  font-family: inherit;
  color: inherit;
}

button { cursor: pointer; }

a { color: inherit; }

.proto-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  color: #f3f3f1;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.proto-bar strong { font-weight: 600; }

.proto-bar span { color: #bdbdbd; }

.proto-bar .spacer { flex: 1; }

.proto-bar a,
.proto-bar button {
  border: 1px solid #3a3a3a;
  background: transparent;
  color: #f3f3f1;
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 12px;
}

.proto-bar a:hover,
.proto-bar button:hover { background: #1c1c1c; }

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 28px;
  background: var(--paper);
  color: var(--ink);
  min-height: calc(100vh - 88px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: var(--card);
  border-bottom: 1px solid var(--hair);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 18px;
}

.badge {
  width: 28px;
  height: 28px;
  background: var(--ink);
  color: white;
  display: grid;
  place-items: center;
  border-radius: 7px;
}

.badge svg { display: block; }

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

.meta b { color: var(--ink); font-weight: 600; }

.top .spacer { flex: 1; }

.modes {
  display: flex;
  border: 1px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.modes button {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
}

.modes button.on {
  background: var(--ink);
  color: white;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: white;
  font-weight: 600;
}

.body { padding: 22px; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

h1 {
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 600;
  margin: 0 0 8px;
}

.lede {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.route {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 28px 0;
}

.stop {
  background: white;
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 12px;
  min-height: 92px;
}

.stop small {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  margin-bottom: 8px;
}

.stop b { display: block; font-size: 14px; letter-spacing: -0.02em; }

.stop span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.stop.done { background: var(--wash); }
.stop.next { border: 1.5px solid var(--ink); background: white; }

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 550;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.btn.small { padding: 8px 12px; font-size: 13px; }

.btn:disabled { opacity: 0.35; cursor: default; }

.home-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
  align-items: start;
}

.card {
  background: white;
  border: 1px solid var(--hair);
  border-radius: 16px;
  padding: 18px;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.card p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 14px; }

.lobby {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: center;
}

.landmark-block h1 { font-size: 64px; }

.code {
  font-family: var(--mono);
  font-size: 64px;
  letter-spacing: 0.12em;
  margin: 8px 0;
}

.join-box {
  border: 1px solid var(--ink);
  border-radius: 18px;
  padding: 22px;
  background: white;
}

.board-gauge {
  position: relative;
  width: 168px;
  height: 168px;
  margin-top: 22px;
}

.board-gauge svg { width: 100%; height: 100%; display: block; }

.board-figure {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.board-figure strong {
  font-size: 52px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.board-figure span {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.join-box .btn { margin-top: 4px; }

.fake-qr {
  width: 148px;
  height: 148px;
  margin-top: 12px;
  background:
    linear-gradient(var(--ink) 0 0) 0 0 / 18px 18px,
    linear-gradient(var(--ink) 0 0) 100% 0 / 18px 18px,
    linear-gradient(var(--ink) 0 0) 0 100% / 18px 18px,
    repeating-linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 8px),
    repeating-linear-gradient(0deg, var(--ink) 0 4px, transparent 4px 8px);
  background-repeat: no-repeat;
  border: 8px solid white;
  outline: 1px solid var(--ink);
}

.count {
  margin: 8px 0 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.convoy {
  background: white;
  border: 1px solid var(--ink);
  border-radius: 18px;
  padding: 18px 18px 12px;
}

.road-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.road { width: 100%; height: 280px; display: block; }

.fuel-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.track {
  height: 14px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: white;
}

.track > i {
  display: block;
  height: 100%;
  background: var(--ink);
}

.dispatch {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
}

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.front {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

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

.seat {
  border: 1px solid var(--hair);
  background: white;
  border-radius: 10px;
  min-height: 64px;
  padding: 8px;
  text-align: left;
}

.seat b { display: block; font-size: 13px; font-weight: 600; }
.seat small { color: var(--muted); font-size: 11px; }

.seat.stall { background: var(--ink); color: white; border-color: var(--ink); }
.seat.stall small { color: #cfcfcf; }
.seat.slow { border: 1.5px dashed var(--ink); }
.seat.ahead { border: 3px double var(--ink); }
.seat.quiet { opacity: 0.55; }

.legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1.5px solid var(--ink);
}
.swatch.stall { background: var(--ink); }
.swatch.slow { border-style: dashed; }
.swatch.ahead { border-width: 3px; }

.flag {
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 8px;
}

.flag.on { border-color: var(--ink); }

.flag .who {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.flag .why {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.trend {
  margin-top: 14px;
  background: white;
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 14px;
}

.trend svg { width: 100%; height: 54px; display: block; }

.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 14, 0.46);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 5;
}

.sheet {
  width: min(520px, 100%);
  background: white;
  color: var(--ink);
  border-radius: 18px;
  padding: 22px;
  border: 1px solid var(--ink);
}

.sheet h2 { margin: 0 0 4px; letter-spacing: -0.03em; font-size: 28px; }
.sheet .sub { color: var(--muted); margin: 0 0 16px; }

.check {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--hair);
  font-size: 15px;
}

.check input { width: 16px; height: 16px; accent-color: black; }

.tabs { display: flex; gap: 8px; margin-bottom: 12px; }

.draft {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  background: var(--paper);
}

.source {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 16px;
}

.quote {
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 8px 0 12px;
}

.record-list { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

.record {
  display: grid;
  grid-template-columns: 140px 88px 1fr;
  gap: 12px;
  align-items: start;
  background: white;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--hair);
}

.record-head {
  background: transparent;
  border: 0;
  padding: 0 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.record b { letter-spacing: -0.02em; }

.note { color: var(--muted); font-size: 13px; margin-top: 14px; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.columns h3 { margin: 0 0 8px; font-size: 14px; }
.columns li { margin: 0 0 6px; color: var(--muted); font-size: 14px; }

.phone-stage {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 8px 16px 32px;
}

.phone {
  width: 390px;
  height: 780px;
  background: var(--paper);
  border-radius: 36px;
  border: 10px solid #1a1a1a;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.phone header.app {
  padding: 18px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phone .screen {
  padding: 8px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow: auto;
}

.phone h1 { font-size: 32px; }

.field {
  width: 100%;
  border: 1.5px solid var(--ink);
  background: white;
  border-radius: 12px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.field::placeholder { color: #b5b5b5; }

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

.names button, .option {
  border: 1px solid var(--hair);
  background: white;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  font-size: 15px;
}

.names button.on, .option.on { border-color: var(--ink); background: var(--ink); color: white; }

.option { width: 100%; font-weight: 550; }

.q-card {
  background: white;
  border: 1px solid var(--ink);
  border-radius: 16px;
  padding: 16px;
}

.q-card p { margin: 8px 0 0; font-size: 20px; letter-spacing: -0.03em; line-height: 1.25; }

.fuel-mini .track { margin-top: 6px; }

.result {
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--hair);
  font-size: 14px;
  line-height: 1.4;
}

.private {
  background: var(--ink);
  color: white;
  border-radius: 16px;
  padding: 16px;
}

.private p { margin: 8px 0 0; line-height: 1.4; }
.private .btn { background: white; color: var(--ink); border-color: white; margin-top: 12px; }

.foot-note { color: var(--muted); font-size: 12px; line-height: 1.4; }

.waiting-msg {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.4;
}

.hub {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.hub-card {
  width: min(880px, 100%);
  color: #f4f4f2;
}

.hub-card h1 {
  font-size: 48px;
  margin: 8px 0;
}

.hub-card .lede { color: #c8c8c8; }
.hub .badge { background: #f4f4f2; }
.hub .badge path { stroke: #141414; }

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.choice {
  display: block;
  text-decoration: none;
  border: 1px solid #3a3a3a;
  border-radius: 18px;
  padding: 20px;
  min-height: 180px;
  background: #161616;
}

.choice:hover { background: #1d1d1d; }

.choice b { display: block; font-size: 22px; letter-spacing: -0.03em; margin-bottom: 8px; }
.choice span { color: #bdbdbd; line-height: 1.45; display: block; }

@media (max-width: 900px) {
  .home-grid, .lobby, .dispatch, .choices, .columns { grid-template-columns: 1fr; }
  .route { grid-template-columns: repeat(3, 1fr); }
  h1, .landmark-block h1 { font-size: 36px; }
  .code { font-size: 40px; }
}
