:root {
  /* Night-drive dashboard, after the mockup: near-black panels with hairline
     borders, and one lime green for "on", "live" and "talking". */
  --bg: #0b0d10;
  --panel: rgba(255, 255, 255, 0.045);
  --edge: rgba(255, 255, 255, 0.12);
  --ink: #f3f5f4;
  --text: #c6cbd1;
  --dim: #8d949d;
  --green: #c5f03a;
  --green-deep: #a3cf1f;
  --green-ink: #141b03;
  --red: #ff6156;
  --warn: #ffc857;
  --font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(130% 55% at 50% 0%, #1b2430 0%, rgba(11, 13, 16, 0) 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420' fill='none' stroke='%23ffffff' stroke-opacity='0.035'%3E%3Cpath d='M-20 80c60-40 110 20 170-10s90-70 150-40 80 60 140 30'/%3E%3Cpath d='M-20 130c70-30 100 30 170 0s100-60 150-30 90 50 140 20'/%3E%3Cpath d='M-20 260c50 30 90-40 150-20s80 70 150 40 100-50 160-10'/%3E%3Cpath d='M-20 310c60 20 100-30 150-10s90 60 150 30 90-40 160 0'/%3E%3Cpath d='M250 180c30-25 80-20 95 10s-10 60-45 62-70-25-70-45 5-15 20-27z'/%3E%3Cpath d='M270 195c18-14 46-10 55 6s-6 34-26 36-40-14-40-26 3-9 11-16z'/%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }

button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }

/* state changes ease in rather than snap */
@media (prefers-reduced-motion: no-preference) {
  button, .car-row, .knob, .thumb, .nearby { transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.22s ease, opacity 0.18s ease, transform 0.2s ease; }
  .screen:not([hidden]) { animation: screen-in 0.2s ease-out; }
  @keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.view { max-width: 520px; margin: 0 auto; padding: 0 18px; }

.ico { width: 24px; height: 24px; display: block; flex: none; }
.ico.car .lamp { fill: var(--lamp, #0b0d10); }

.card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
}

.eyebrow {
  margin: 0;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- top bar ---------- */

.appbar { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--edge); }

.logo {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
}

.brand { flex: 1 1 auto; min-width: 0; }

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
}

.brand-sub { margin: 2px 0 0; font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }

.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
}

/* ---------- a driver ---------- */

.car-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; }

/* the picture and name of a driver: one tap target that opens their profile */
.row-open {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 10px;
  color: inherit;
  text-align: left;
}

.thumb {
  width: 72px;
  height: 54px;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: #171c23;
}

.thumb svg, .thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* one slot on the right of a driver: a microphone, or a waveform while they talk */
.slot { width: 40px; height: 28px; display: flex; align-items: center; justify-content: center; color: #7d848d; }
.car-row[data-talking="true"] .slot .ico { display: none; }
.car-row:not([data-talking="true"]) .slot .mini-wave { display: none; }
.you .slot .ico { display: none; }      /* my own row already has the mic button */

.car-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.car-name { font-weight: 500; font-size: 18.5px; line-height: 1.2; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.car-sub { min-height: 18px; font-size: 13.5px; line-height: 1.3; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mini-wave { display: flex; align-items: center; gap: 3px; height: 26px; }
.mini-wave i { width: 3px; height: 6px; border-radius: 2px; background: var(--green); }
.mini-wave i:nth-child(2), .mini-wave i:nth-child(6) { height: 12px; }
.mini-wave i:nth-child(3), .mini-wave i:nth-child(5) { height: 18px; }
.mini-wave i:nth-child(4) { height: 26px; }

@media (prefers-reduced-motion: no-preference) {
  .car-row[data-talking="true"] .mini-wave i { animation: bounce 0.7s ease-in-out infinite alternate; transform-origin: center; }
  .mini-wave i:nth-child(2) { animation-delay: -0.5s; }
  .mini-wave i:nth-child(3) { animation-delay: -0.2s; }
  .mini-wave i:nth-child(4) { animation-delay: -0.6s; }
  .mini-wave i:nth-child(5) { animation-delay: -0.35s; }
  .mini-wave i:nth-child(6) { animation-delay: -0.1s; }
  @keyframes bounce { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }
}

/* ---------- setup: choosing your vehicle ---------- */

.setup { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; padding-bottom: 28px; }

.s-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 48px; }
.s-top > :first-child { justify-self: start; }
.s-top > :last-child { justify-self: end; }

.round-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; background: var(--panel); border: 1px solid var(--edge); border-radius: 50%; color: var(--ink); }

.s-brand { grid-column: 2; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.s-brand .ico { width: 30px; height: 30px; }
.s-brand .brand-name { font-size: 30px; }

/* the slanted Save tab */
.save-btn { grid-column: 3; height: 40px; padding: 0 16px; border: 0; background: var(--green); color: var(--green-ink); transform: skewX(-12deg); border-radius: 4px; box-shadow: 0 0 18px rgba(197, 240, 58, 0.3); }
.save-btn span { display: flex; align-items: center; gap: 6px; transform: skewX(12deg); font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 19px; }

.s-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--edge); }
.s-tabs button {
  min-height: 44px;
  padding: 6px 4px 8px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--dim);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.s-tabs button[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); }

.car-form, .s-panel { display: flex; flex-direction: column; gap: 14px; }

/* the picture of the vehicle, with its corner marks */
.hero-card { position: relative; height: 196px; margin: 0 -6px; overflow: hidden; }
.hero-img { position: absolute; inset: 0; background: url("img/road.jpg") center / cover no-repeat; }
.hero-img img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hero-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 10, 12, 0.88) 0%, rgba(8, 10, 12, 0.45) 55%, rgba(8, 10, 12, 0.1) 100%), linear-gradient(0deg, var(--bg) 0%, rgba(11, 13, 16, 0) 30%); }
.corner { position: absolute; z-index: 2; width: 18px; height: 18px; border: 0 solid var(--green); }
.corner.tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.corner.tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.hero-text { position: absolute; z-index: 2; left: 22px; right: 70px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; }
.hero-kicker { margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.hero-tag { margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 52px; line-height: 0.95; color: var(--ink); overflow-wrap: anywhere; }
.hero-car { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--text); }
.hero-car .ico { width: 22px; height: 22px; color: var(--ink); }
.hero-card .cam-badge { z-index: 3; }

.s-head { position: relative; margin: 4px 0 0; padding-left: 22px; font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 22px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink); }
.s-head::before { content: ""; position: absolute; left: 4px; top: 2px; bottom: 2px; width: 3px; background: var(--green); transform: skewX(-18deg); }

.s-field { border: 0; padding: 0; margin: 0; min-width: 0; }

.s-label { margin: 0; padding: 0; font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 15px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text); }
.s-label.plain span { font-weight: 600; color: var(--dim); }

.swatches { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.swatch { position: relative; display: flex; align-items: center; justify-content: center; height: 44px; }
.swatch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 100%; max-width: 30px; aspect-ratio: 1 / 1; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--green); }
.swatch input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 5px; }

/* a boxed field with its small label inside, as in the mockup */
.s-row3 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: 8px; }
.s-row3 .fbox { padding: 7px 8px 6px 10px; }
.s-row3 .fbox select, .s-row3 .fbox input { font-size: 16px; text-overflow: ellipsis; }
.s-row3 .fbox select { padding-right: 16px; background-size: 14px; }
.fbox { min-width: 0; padding: 7px 10px 6px 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--edge); border-radius: 10px; }
.fbox:focus-within { border-color: var(--green); }
.fbox > label { display: block; font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.fbox-line { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.fbox-line .ico { width: 22px; height: 22px; color: var(--ink); }
.fbox select, .fbox input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
}
.fbox select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f5f4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right center / 18px no-repeat;
}
.fbox select option { background: #14181d; color: #f3f5f4; }
.fbox input::placeholder { color: #6b727b; }

.s-bottom { display: grid; grid-template-columns: minmax(112px, auto) minmax(0, 1fr); gap: 16px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--edge); }
.s-bottom .s-label { font-size: 14px; white-space: nowrap; }
.s-preview { display: flex; flex-direction: column; gap: 8px; }
.s-photo { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.photo-tile { position: relative; width: 112px; height: 100px; padding: 0; background: #171c23; border: 2px solid var(--green); border-radius: 12px; overflow: visible; }
.photo-fill { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; }
.photo-fill svg, .photo-fill img { width: 100%; height: 100%; display: block; object-fit: cover; }
.s-right { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tag-input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--edge);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
}
.tag-input:focus { border-color: var(--green); outline: 0; }
.tag-input::placeholder { color: #6b727b; font-weight: 600; }

.preview { padding: 8px 10px 8px 8px; border: 1.5px solid var(--green); border-radius: 12px; background: rgba(197, 240, 58, 0.04); box-shadow: 0 0 18px rgba(197, 240, 58, 0.16); }
.preview .row-open { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
.preview .thumb { width: 56px; height: 44px; border-radius: 8px; }
.preview .car-name { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 22px; line-height: 1.05; }
.preview .car-sub { display: flex; align-items: center; gap: 6px; color: var(--text); }
.preview .live-dot { flex: none; width: 8px; height: 8px; }
.preview .car-sub span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

#go-demo { align-self: center; }

.btn {
  height: 56px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-go, .ptt {
  background: linear-gradient(180deg, #e0fb86 0%, var(--green) 45%, var(--green-deep) 100%);
  color: var(--green-ink);
  box-shadow: 0 0 22px rgba(197, 240, 58, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-quiet { background: var(--panel); border-color: var(--edge); color: var(--ink); font-size: 18px; font-weight: 600; }

.hint { margin: 0; font-size: 13px; color: var(--dim); }

.setup-error { margin: 0; color: var(--red); font-weight: 600; }

.fineprint { margin: 0; color: var(--dim); font-size: 14px; max-width: 60ch; }

/* ---------- home ---------- */

.drive:not([hidden]) { height: 100%; display: flex; flex-direction: column; }

.screen:not([hidden]) {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-top: 16px;
  padding-bottom: 14px;
}

/* The night-road picture behind the radar and the channel banner. */
.scene { pointer-events: none; background: url("img/road.jpg") center / auto 100% no-repeat; }

.home { position: relative; }
.home > *:not(.ptt) { position: relative; z-index: 1; }
.home > .scene {
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: 62px;
  height: 190px;
  opacity: 0.8;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 62%, transparent 100%);
}

/* ---------- home: who I am ---------- */

.me-head { display: flex; flex-direction: column; align-items: center; gap: 1px; margin-top: 8px; text-align: center; }

.avatar { display: block; overflow: hidden; border-radius: 50%; background: #171c23; }
.avatar svg, .avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar.big { width: 88px; height: 88px; box-shadow: 0 0 0 3px var(--green), 0 0 22px rgba(197, 240, 58, 0.35); }
.avatar.xl { width: 112px; height: 112px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--edge); }

.avatar-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; }

.badge, .cam-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: #1b2027;
  color: var(--ink);
}

.cam-badge { width: 44px; height: 44px; border-radius: 12px; right: 10px; bottom: 10px; }
.ico.sm { width: 18px; height: 18px; }

.me-name {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.05;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.me-line { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; color: var(--text); }
.me-line .ico { width: 20px; height: 20px; }

.me-status { margin: 2px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; color: var(--ink); }

.chat-card { display: flex; align-items: center; gap: 14px; margin-top: 10px; padding-top: 8px; padding-bottom: 8px; }
.chat-card .card-ico { border-right: 0; padding-right: 0; color: var(--ink); }
.chat-card .card-title { font-size: 23px; }

.switch {
  flex: none;
  width: 68px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 4px;
  background: var(--green);
  border: 0;
  border-radius: 999px;
}

.knob { width: 30px; height: 30px; border-radius: 50%; background: #f3f8ee; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); transform: translateX(30px); }

.switch[aria-checked="false"] { background: #3a4048; }
.switch[aria-checked="false"] .knob { background: #c6cbd1; transform: none; }

.radar-wrap { position: relative; flex: 1 1 0; min-height: 150px; margin-top: 6px; }

#radar { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* the line under the radar: status, or who is talking. Tapping it opens the channel. */
.nearby {
  align-self: center;
  max-width: 100%;
  min-height: 40px;
  margin: 4px 0 0;
  padding: 6px 8px 5px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 500;
  text-align: center;
  color: var(--ink);
}

.nearby .ico { width: 18px; height: 18px; color: var(--dim); }
.nearby[data-level="warn"] { color: var(--warn); }
.nearby[data-level="bad"] { color: var(--red); font-size: 14px; }
.drive[data-state="talker"] .nearby { border-color: var(--green); box-shadow: 0 0 16px rgba(197, 240, 58, 0.2); font-weight: 600; }

.settings-row { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; margin-top: 12px; color: var(--ink); }

.card-ico { display: flex; align-items: center; padding-right: 14px; border-right: 1px solid var(--edge); align-self: stretch; color: var(--text); }
.card-ico .ico { width: 30px; height: 30px; }

.card-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.card-label { font-size: 14px; color: var(--text); }

.card-title { flex: 1 1 auto; font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.1; color: var(--ink); }
.card-title.small { font-family: var(--font-body); font-weight: 500; font-size: 17px; }

.ptt {
  flex: none;
  height: 74px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* never scrolls out of reach, however small the screen */
  position: sticky;
  bottom: 0;
  z-index: 3;
}

.ptt .ico { width: 34px; height: 34px; }
.ptt[aria-pressed="true"] { background: #ffffff; box-shadow: 0 0 30px rgba(197, 240, 58, 0.75), inset 0 0 0 3px var(--green); }
.ptt:disabled { opacity: 0.4; box-shadow: none; cursor: not-allowed; }

.tabs { flex: none; width: 100%; max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 8px 10px; border-top: 1px solid var(--edge); background: var(--bg); }

.tab {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 12px;
  position: relative;
  padding: 0;
}

.tab .ico { width: 25px; height: 25px; }
.tab[aria-current="page"] { color: var(--green); font-weight: 600; }
.tab:disabled { color: #6b727b; cursor: not-allowed; }

/* ---------- channel ---------- */

.chan-head { flex: none; display: flex; align-items: center; gap: 8px; }

.chan-title { flex: 1 1 auto; min-width: 0; text-align: center; }
.chan-title h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.1; letter-spacing: 0.01em; color: var(--ink); }
.chan-title p { margin: 3px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14.5px; color: var(--text); }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(197, 240, 58, 0.8); }
.drive[data-power="off"] .live-dot { background: var(--dim); box-shadow: none; }

.banner {
  flex: none;
  position: relative;
  height: 164px;
  margin: 10px -18px 0;
  overflow: hidden;
}

.banner .scene { position: absolute; left: 0; right: 0; top: 0; height: 124px; background-size: cover; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, rgba(11, 13, 16, 0) 16%, rgba(11, 13, 16, 0.12) 46%, var(--bg) 80%); }

#wave { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; display: block; }

.cars { flex: none; list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.cars .car-row, .you { padding: 8px 4px 8px 8px; border: 1.5px solid transparent; border-radius: 16px; background: rgba(255, 255, 255, 0.028); }
.cars .car-row[data-talking="true"], .you[data-talking="true"] { border-color: var(--green); background: rgba(197, 240, 58, 0.05); box-shadow: 0 0 20px rgba(197, 240, 58, 0.16); }

.picture-card { display: flex; align-items: center; gap: 14px; }
.picture-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.picture-card .toggle { height: 44px; padding: 0 14px; background: #14181d; color: var(--ink); border: 1px solid var(--edge); border-radius: 10px; }

/* demo only: stands in for the open mic, which the demo page is not allowed to use */
.sim-talk {
  flex: none;
  min-height: 56px;
  margin-top: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: transparent;
  border: 1px solid rgba(197, 240, 58, 0.45);
  border-radius: 16px;
  color: var(--green);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sim-title { font-weight: 600; font-size: 16px; }
.sim-note { font-size: 12.5px; color: var(--dim); }
.sim-talk[aria-pressed="true"] { background: var(--green); color: var(--green-ink); }
.sim-talk[aria-pressed="true"] .sim-note { color: var(--green-ink); }

/* your own car, always first in the channel */
.you { flex: none; margin-top: 12px; }
.mic-mute { color: var(--green); }
.mic-mute[aria-pressed="true"] { color: var(--red); }
.mic-mute:disabled { color: var(--dim); cursor: not-allowed; }
.cars .car-row[data-muted="true"] .car-name { color: var(--dim); }

.mute { color: var(--ink); }
.mute[aria-pressed="true"] { color: var(--dim); }

.empty { margin: 14px 0 0; text-align: center; color: var(--dim); }

.range-card { flex: none; margin-top: 22px; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; padding-bottom: 12px; }

.range-top { margin: 0; display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; font-weight: 500; color: var(--ink); }
.range-top output { font-variant-numeric: tabular-nums; }

input[type="range"] {
  --fill: 100%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--green) var(--fill), #3a4048 var(--fill)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #3a4048; }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--green); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; border: 0; background: #ffffff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: 0; background: #ffffff; }

.settings-row { flex: none; }

.leave {
  flex: none;
  height: 58px;
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 97, 86, 0.05);
  border: 1px solid rgba(255, 97, 86, 0.8);
  border-radius: 16px;
  color: var(--red);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- party and recent ---------- */

.stack { flex: none; display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.stack .cars, .recent .cars { margin-top: 0; }
.recent .cars { margin-top: 16px; }
.lead { margin: 0; color: var(--text); }

.join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.join-row input {
  height: 48px;
  padding: 0 14px;
  background: #14181d;
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.join-row input::placeholder { color: #5d646d; }
.join-row .toggle, .code-card .toggle { height: 48px; padding: 0 18px; background: #14181d; color: var(--ink); border: 1px solid var(--edge); border-radius: 10px; font-weight: 600; }

.code-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; border-color: rgba(197, 240, 58, 0.45); }
.code { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; letter-spacing: 0.18em; color: var(--ink); padding-left: 0.18em; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: #14181d; border-radius: 12px; }
.seg button { min-height: 44px; padding: 0 8px; background: transparent; border: 0; border-radius: 9px; color: var(--text); font-weight: 500; }
.seg button[aria-checked="true"] { background: var(--green); color: var(--green-ink); font-weight: 600; }

#recent-clear { flex: none; margin-top: 18px; }
.recent .empty { margin-top: 24px; }

/* ---------- profile ---------- */

.cover { flex: none; position: relative; height: 150px; margin: 10px -18px 0; background: #171c23; overflow: hidden; }
.cover-img { position: absolute; inset: 0; background: url("img/road.jpg") center / cover no-repeat; }
.cover-img img { width: 100%; height: 100%; display: block; object-fit: cover; }

.p-id { flex: none; display: flex; align-items: flex-end; gap: 16px; margin-top: -42px; position: relative; z-index: 1; }
.p-avatar-wrap { position: relative; flex: none; }
.p-avatar-wrap .cam-badge { width: 36px; height: 36px; border-radius: 50%; right: -2px; bottom: -2px; }
.p-id-text { min-width: 0; padding-bottom: 2px; }
.p-id-text .me-status, .p-id-text .me-line { justify-content: flex-start; }
.p-name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.05; color: var(--ink); overflow-wrap: anywhere; }

.p-list { flex: none; margin-top: 16px; padding: 2px 14px; }

.p-row {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink);
  text-align: left;
}

.p-list .p-row + .p-row { border-top: 1px solid var(--edge); }
.p-row > .ico { color: var(--text); }
.p-label { flex: none; font-weight: 500; }
.p-value { flex: 1 1 auto; min-width: 0; text-align: right; color: var(--text); overflow-wrap: anywhere; }
.p-row .own { display: flex; }
.p-row .ico:last-child, .p-row .own .ico { width: 18px; height: 18px; color: var(--dim); }

.p-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-align: right;
}

.p-input::placeholder { color: var(--dim); }
.profile[data-mode="me"] .p-input { border-color: var(--edge); background: #14181d; color: var(--ink); }

.p-photos, .p-privacy { flex: none; margin-top: 14px; }
.p-photos h3, .p-privacy h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--ink); }
.p-head { display: flex; align-items: center; justify-content: space-between; }
.link { min-height: 36px; padding: 0 4px; background: none; border: 0; color: var(--green); font-weight: 600; }

.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.g-tile { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid var(--edge); background: #14181d; overflow: hidden; padding: 0; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.g-tile img { width: 100%; height: 100%; display: block; object-fit: cover; }
.g-remove { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(11, 13, 16, 0.6); border: 0; color: var(--red); font-weight: 600; }
.g-empty { grid-column: 1 / -1; margin: 0; color: var(--dim); font-size: 14px; }

#p-mute { flex: none; margin-top: 16px; }
#p-mute[aria-pressed="true"] { border-color: var(--red); color: var(--red); }

/* my own profile shows the editing controls; another driver's hides them */
.profile[data-mode="driver"] .own { display: none; }
.profile[data-mode="me"] .theirs { display: none; }

/* ---------- settings sheet ---------- */

.sheet { position: fixed; inset: 0; z-index: 5; background: var(--bg); overflow-y: auto; }

.sheet-inner { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; padding-bottom: 24px; }

.units { display: flex; flex-wrap: wrap; gap: 18px; border: 0; padding: 0; margin: 0; color: var(--ink); }
.units legend { padding: 0; margin-bottom: 6px; font-size: 14px; color: var(--text); }
.units label { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
.units input { accent-color: var(--green); width: 20px; height: 20px; }

.info { display: flex; flex-direction: column; gap: 8px; }
.info p { margin: 0; display: flex; justify-content: space-between; gap: 12px; }
.info p span:last-child { color: var(--ink); text-align: right; }

.demo-box { display: flex; flex-direction: column; gap: 10px; }

.demo-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.demo-bar select, .toggle { height: 44px; padding: 0 12px; background: #14181d; color: var(--ink); border: 1px solid var(--edge); border-radius: 10px; }

.toggle[aria-pressed="true"] { background: var(--green); color: var(--green-ink); border-color: var(--green); font-weight: 600; }

.demo-stats { margin: 0; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }

@media (max-height: 680px) {
  .avatar.big { width: 72px; height: 72px; }
  .me-name { font-size: 24px; margin-top: 4px; }
  .me-status { display: none; }
  .radar-wrap { min-height: 120px; }
  .ptt { height: 62px; }
}

/* ---------- counts ---------- */

.count, .tab-badge {
  min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--green); color: var(--green-ink); font-size: 12px; font-weight: 700; line-height: 1;
}
.tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); }
.seg .count { margin-left: 8px; }
.seg button[aria-checked="true"] .count { background: var(--green-ink); color: var(--green); }

/* ---------- setup: type and plate, account ---------- */

.s-row2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; }
.s-row2 + .hint { margin-top: -6px; }
.opt { font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; color: #6b727b; }
.tag-input[readonly], .fbox input[readonly] { color: var(--text); }
#account .fbox input { font-size: 18px; }
#account .btn { width: 100%; }
#account .link { align-self: center; }

/* ---------- people ---------- */

.recent > .seg { flex: none; margin-top: 16px; }
.recent .stack-sm { flex: none; margin-top: 14px; }
.recent .stack-sm .cars { margin-top: 0; }
.list-head { margin: 8px 0 0; font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.cars:empty { display: none; }
.row-actions { display: flex; align-items: center; gap: 6px; padding-right: 4px; }
.row-actions .toggle { height: 38px; padding: 0 12px; background: #14181d; color: var(--ink); border: 1px solid var(--edge); border-radius: 10px; font-weight: 600; font-size: 14px; }
.row-actions .toggle.go { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.row-actions .icon-btn { color: var(--green); }
.row-open:has(.row-side) { grid-template-columns: 72px minmax(0, 1fr) auto; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-right: 8px; font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.thumb[data-online="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--green); }

/* ---------- profile: message, add, block ---------- */

.p-actions { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.p-actions .btn { height: 50px; font-size: 18px; }
.p-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.profile > .hint { flex: none; margin-top: 14px; }
.link.danger { flex: none; align-self: center; margin-top: 6px; color: var(--red); }

/* ---------- one conversation ---------- */

.thread:not([hidden]) { overflow: hidden; padding-bottom: 10px; }
.thread-who { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; padding: 0; background: none; border: 0; color: inherit; text-align: left; }
.thread-who .thumb { width: 48px; height: 48px; border-radius: 50%; }
.lock-bar { flex: none; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(255, 200, 87, 0.5); border-radius: 12px; background: rgba(255, 200, 87, 0.08); }
.lock-bar p { flex: 1 1 auto; margin: 0; font-size: 14px; line-height: 1.35; color: var(--ink); }
.lock-bar .toggle { flex: none; height: 40px; padding: 0 12px; background: #14181d; color: var(--ink); border: 1px solid var(--edge); border-radius: 10px; font-weight: 600; font-size: 14px; white-space: nowrap; }

.msgs { flex: 1 1 0; min-height: 0; overflow-y: auto; list-style: none; margin: 12px 0 0; padding: 4px 0 8px; display: flex; flex-direction: column; gap: 4px; }
.msgs-empty, .msgs-day { align-self: center; margin: 10px 0 6px; font-size: 13px; color: var(--dim); text-align: center; }
.msg { max-width: 82%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; align-self: flex-start; }
.msg[data-mine="true"] { align-self: flex-end; align-items: flex-end; }
.bubble { margin: 0; padding: 9px 13px; border: 0; border-radius: 18px 18px 18px 6px; background: #1a1f26; color: var(--ink); font: inherit; font-size: 16.5px; line-height: 1.35; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg[data-mine="true"] .bubble { border-radius: 18px 18px 6px 18px; background: var(--green); color: var(--green-ink); }
.bubble.photo { padding: 0; overflow: hidden; background: #14181d; line-height: 0; }
.bubble.photo img { display: block; max-width: 100%; width: 230px; max-height: 300px; object-fit: cover; }
.bubble.shut { border: 1px dashed var(--edge); background: transparent; color: var(--text); font-size: 14.5px; }
.bubble.voice { display: flex; align-items: center; gap: 10px; min-width: 170px; min-height: 46px; }
.bubble.voice .ico { width: 22px; height: 22px; flex: none; }
.bubble.voice .mini-wave { flex: 1 1 auto; justify-content: center; height: 22px; }
.bubble.voice .mini-wave i:nth-child(n) { height: 8px; }
.bubble.voice .mini-wave i:nth-child(3n) { height: 20px; }
.bubble.voice .mini-wave i:nth-child(3n + 1) { height: 13px; }
.msg[data-mine="true"] .bubble.voice .mini-wave i { background: var(--green-ink); }
.voice-len { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.msg-time { padding: 0 6px; font-size: 11.5px; color: var(--dim); }
@media (prefers-reduced-motion: no-preference) {
  .bubble.voice[data-playing="true"] .mini-wave i { animation: bounce 0.7s ease-in-out infinite alternate; transform-origin: center; }
  .bubble.voice[data-playing="true"] .mini-wave i:nth-child(2n) { animation-delay: 0.2s; }
}

.thread-note { flex: none; margin: 6px 0 0; text-align: center; }
.thread-note[data-rec="true"] { color: var(--red); font-weight: 600; }
.composer { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; margin-top: 8px; padding: 5px; border: 1px solid var(--edge); border-radius: 26px; background: #14181d; }
.composer:focus-within { border-color: var(--green); }
.composer input { min-width: 0; height: 44px; padding: 0 4px; background: transparent; border: 0; outline: 0; color: var(--ink); font-size: 17px; }
.composer input::placeholder { color: #6b727b; }
.composer input:disabled { color: var(--dim); }
.composer .icon-btn { border-radius: 50%; color: var(--text); }
.composer .icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.composer .mic, .composer .send { background: var(--green); color: var(--green-ink); touch-action: none; user-select: none; -webkit-user-select: none; }
.composer .mic[aria-pressed="true"] { background: var(--red); color: #fff; transform: scale(1.15); }

/* ---------- banner and photo viewer ---------- */

.toast {
  position: fixed; z-index: 8; top: 10px; left: 50%; transform: translateX(-50%); width: min(480px, calc(100% - 20px));
  display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 12px 8px 8px;
  border: 1px solid rgba(197, 240, 58, 0.55); border-radius: 16px; background: #14181d; color: inherit; text-align: left; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.toast .thumb { width: 48px; height: 48px; border-radius: 50%; }
.lightbox { position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.92); }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .icon-btn { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.5); }
#msg-allow { height: 46px; padding: 0 12px; background: #14181d; color: var(--ink); border: 1px solid var(--edge); border-radius: 10px; font-size: 16px; }
.sheet .card > .toggle { align-self: flex-start; }
.p-actions .btn { padding: 0 8px; font-size: 17px; line-height: 1.1; }
#friend-name { letter-spacing: normal; text-transform: none; font-family: var(--font-body); font-weight: 500; font-size: 17px; text-align: left; }
#plate, #p-plate { text-transform: uppercase; }
#plate::placeholder, #p-plate::placeholder { text-transform: none; }

/* Newest messages sit just above the box you type in, as in any chat, not at the top of an empty screen. */
.msgs > :first-child { margin-top: auto; }
/* With the keyboard up, the conversation takes exactly the part of the screen still visible. */
.drive[data-screen="thread"][data-kb="true"] { height: var(--vvh, 100%); }
.drive[data-screen="thread"][data-kb="true"] .tabs { display: none; }

/* ---------- automatic car pictures ---------- */
.p-credit { flex: none; margin: 10px 0 0; font-size: 12.5px; }
.p-credit a { color: var(--text); text-decoration: underline; }
#photo-hint { margin: -4px 0 0; }
