:root {
  --bg: #050c17;
  --bg-elevated: #091425;
  --panel: rgba(13, 30, 52, 0.94);
  --panel-strong: #10243d;
  --panel-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(161, 203, 238, 0.16);
  --line-strong: rgba(161, 203, 238, 0.3);
  --text: #eff8ff;
  --muted: #93abc2;
  --blue: #35b8ff;
  --blue-strong: #1687e4;
  --cyan: #66e3ff;
  --green: #27d17f;
  --orange: #f9a826;
  --red: #ff5c68;
  --violet: #8c7cff;
  --shadow: 0 24px 65px rgba(0, 0, 0, 0.3);
  --radius: 24px;
  --radius-small: 15px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eaf2f8;
  --bg-elevated: #f7fbff;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --panel-soft: rgba(14, 67, 107, 0.055);
  --line: rgba(13, 67, 107, 0.14);
  --line-strong: rgba(13, 67, 107, 0.25);
  --text: #0b2237;
  --muted: #5f7588;
  --shadow: 0 22px 55px rgba(40, 76, 108, 0.13);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -8%, rgba(37, 143, 239, 0.22), transparent 35%),
    radial-gradient(circle at 92% 20%, rgba(41, 209, 184, 0.1), transparent 27%),
    linear-gradient(180deg, var(--bg-elevated), var(--bg));
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(53, 184, 255, 0.45);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  z-index: 500;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px clamp(14px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px);
}

.brand,
.header-status,
.card-heading,
.section-intro,
.slot-heading,
.action-row,
.motion-heading {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  background:
    radial-gradient(circle at 25% 22%, #75ecff, transparent 35%),
    linear-gradient(145deg, #1689e8, #12355f 70%);
  box-shadow: 0 10px 25px rgba(17, 135, 227, 0.32);
  color: white;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.brand-mark::after {
  position: absolute;
  right: -11px;
  bottom: -18px;
  width: 42px;
  height: 42px;
  border: 7px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  content: "";
}

.brand h1,
.brand p,
.card h2,
.card h3,
.section-intro h2 {
  margin: 0;
}

.brand h1 {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand h1 em {
  color: var(--cyan);
  font-style: normal;
}

.brand p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.header-status {
  gap: 10px;
}

.status-chip,
.secure-chip,
.trip-badge,
.camera-state,
.voice-state,
.report-date {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-chip {
  gap: 7px;
  padding: 6px 11px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(249, 168, 38, 0.12);
}

.status-chip.online .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(39, 209, 127, 0.12);
}

.clock {
  min-width: 52px;
  color: var(--text);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.icon-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 20px;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 2.6vw, 34px) clamp(12px, 3vw, 42px) 112px;
}

.tab-panel {
  display: none;
  animation: panel-in 0.24s ease both;
}

.tab-panel.active {
  display: block;
}

@keyframes panel-in {
  from {
    transform: translateY(5px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(380px, 0.96fr);
  gap: 18px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
}

.card::before {
  position: absolute;
  top: 0;
  right: 7%;
  left: 7%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 216, 255, 0.55), transparent);
  content: "";
}

.card-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card h2 {
  color: var(--text);
  font-size: clamp(17px, 2vw, 22px);
  letter-spacing: -0.025em;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.trip-badge,
.camera-state,
.voice-state,
.report-date,
.secure-chip {
  padding: 6px 11px;
  white-space: nowrap;
}

.trip-badge.running,
.camera-state.active,
.voice-state.listening {
  border-color: rgba(39, 209, 127, 0.35);
  background: rgba(39, 209, 127, 0.1);
  color: #8ff0be;
}

.speed-zone {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 170px;
  padding: 22px clamp(18px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 14% 35%, rgba(53, 184, 255, 0.16), transparent 40%),
    rgba(3, 12, 24, 0.38);
}

.speed-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.speed-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.speed-value strong {
  font-size: clamp(68px, 10vw, 112px);
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.speed-value span {
  color: var(--muted);
  font-weight: 850;
}

.limit-sign {
  display: grid;
  width: clamp(88px, 10vw, 118px);
  aspect-ratio: 1;
  place-items: center;
  border: clamp(8px, 1vw, 12px) solid #ff3f4d;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.15),
    0 16px 32px rgba(255, 63, 77, 0.18);
  color: #10151a;
}

.limit-sign span {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 950;
  letter-spacing: -0.08em;
}

.driving-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(39, 209, 127, 0.3);
  border-radius: 17px;
  background: rgba(39, 209, 127, 0.1);
  color: #a1f3c8;
}

.driving-status.caution {
  border-color: rgba(249, 168, 38, 0.34);
  background: rgba(249, 168, 38, 0.11);
  color: #ffda8d;
}

.driving-status.danger {
  border-color: rgba(255, 92, 104, 0.4);
  background: rgba(255, 92, 104, 0.12);
  color: #ffb4ba;
}

.status-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.driving-status strong,
.driving-status small {
  display: block;
}

.driving-status small {
  margin-top: 2px;
  color: currentColor;
  opacity: 0.75;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.metric,
.summary-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--panel-soft);
}

.metric span,
.summary-grid span,
.heard-box span,
.motion-heading span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.metric strong,
.summary-grid strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.action-row {
  flex-wrap: wrap;
  gap: 9px;
}

.action-row.compact {
  gap: 7px;
}

.button {
  min-height: 43px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    border-color 0.15s ease;
}

.button:hover {
  filter: brightness(1.08);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: linear-gradient(135deg, #1597ee, #1662d9);
  box-shadow: 0 9px 20px rgba(16, 111, 218, 0.2);
  color: white;
}

.button.secondary {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--text);
}

.button.warning {
  background: rgba(249, 168, 38, 0.15);
  border-color: rgba(249, 168, 38, 0.25);
  color: #ffd88a;
}

.button.danger {
  background: rgba(255, 92, 104, 0.16);
  border-color: rgba(255, 92, 104, 0.28);
  color: #ffbec3;
}

.button.ai {
  background: linear-gradient(135deg, #755cec, #3186e9);
  color: white;
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.58;
}

.legal-note,
.settings-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.video-frame {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 50%, rgba(53, 184, 255, 0.08), transparent 40%),
    #020711;
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.video-empty {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.video-empty.hidden {
  display: none;
}

.video-empty strong,
.video-empty small {
  display: block;
}

.camera-symbol {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 8px;
  place-items: center;
  border: 1px solid rgba(53, 184, 255, 0.24);
  border-radius: 50%;
  background: rgba(53, 184, 255, 0.08);
  color: var(--blue);
  font-size: 24px;
}

.video-overlay {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  justify-content: space-between;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(1, 7, 14, 0.62);
  color: #d9efff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

label {
  display: block;
  margin: 13px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(2, 10, 20, 0.38);
  color: var(--text);
}

input,
select {
  min-height: 46px;
  padding: 10px 13px;
}

textarea {
  min-height: 390px;
  padding: 16px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

.camera-card select {
  margin-bottom: 9px;
}

.scan-result {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.gps-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.65fr);
  gap: 18px;
}

.destination-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  margin-bottom: 13px;
}

.map {
  height: min(60vh, 590px);
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #07111f;
  z-index: 1;
}

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

.gps-sidebar,
.report-sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
}

.route-summary h2 {
  margin-bottom: 14px;
  line-height: 1.2;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.position {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.instructions {
  max-height: 260px;
  margin: 0;
  padding: 0 0 0 24px;
  overflow: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.instructions li {
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
}

.recent-list,
.history-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.recent-item,
.history-item {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
}

button.recent-item {
  cursor: pointer;
}

.recent-item strong,
.recent-item small,
.history-item strong,
.history-item small {
  display: block;
}

.recent-item small,
.history-item small {
  margin-top: 4px;
  color: var(--muted);
}

.empty-copy {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.section-intro {
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.section-intro h2 {
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -0.04em;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.camera-slot {
  padding: 16px;
}

.slot-heading {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.slot-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.slot-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.slot-number {
  color: var(--blue);
  font-size: 10px;
  font-weight: 950;
}

.camera-slot h3 {
  font-size: 15px;
}

.camera-slot .video-frame,
.camera-slot .video-frame video {
  min-height: 220px;
}

.info-banner {
  margin: 16px 0 0;
  padding: 12px 15px;
  border: 1px solid rgba(53, 184, 255, 0.2);
  border-radius: 15px;
  background: rgba(53, 184, 255, 0.07);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.seat-card {
  display: grid;
  min-height: 135px;
  align-content: center;
  justify-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}

.seat-card.detected {
  border-color: rgba(39, 209, 127, 0.34);
  background: rgba(39, 209, 127, 0.09);
  color: #a0efc5;
}

.seat-card.uncertain {
  border-color: rgba(249, 168, 38, 0.3);
  background: rgba(249, 168, 38, 0.08);
  color: #ffd486;
}

.seat-icon {
  margin-bottom: 7px;
  font-size: 30px;
}

.seat-card strong,
.seat-card small {
  display: block;
}

.seat-card small {
  margin-top: 4px;
  color: currentColor;
  font-size: 10px;
}

.motion-heading {
  justify-content: space-between;
  margin: 15px 0 7px;
}

.motion-heading span {
  margin: 0;
}

.motion-heading strong {
  font-size: 12px;
}

.level-bar {
  height: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 10, 20, 0.48);
}

.level-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--orange), var(--red));
  transition: width 0.18s linear;
}

.event-log {
  height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(2, 10, 20, 0.32);
}

.event-entry {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.event-entry time {
  color: var(--blue);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.text-button {
  padding: 5px;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.voice-orb {
  position: relative;
  display: grid;
  width: min(250px, 72vw);
  aspect-ratio: 1;
  margin: 16px auto 24px;
  place-content: center;
  border: 1px solid rgba(102, 227, 255, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(102, 227, 255, 0.2), transparent 28%),
    radial-gradient(circle, rgba(53, 184, 255, 0.08) 0 56%, transparent 57%),
    var(--panel-soft);
  box-shadow:
    0 0 0 18px rgba(53, 184, 255, 0.025),
    0 0 55px rgba(53, 184, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.voice-orb::before,
.voice-orb::after {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(102, 227, 255, 0.16);
  border-radius: 50%;
  content: "";
}

.voice-orb.listening::before {
  animation: pulse-ring 1.1s ease-out infinite;
}

@keyframes pulse-ring {
  from {
    transform: scale(0.85);
    opacity: 1;
  }
  to {
    transform: scale(1.2);
    opacity: 0;
  }
}

.orb-core {
  position: relative;
  z-index: 1;
  color: var(--cyan);
  font-size: 48px;
  line-height: 1;
  text-shadow: 0 0 24px rgba(102, 227, 255, 0.7);
}

.voice-orb strong,
.voice-orb small {
  position: relative;
  z-index: 1;
  display: block;
}

.voice-orb strong {
  margin-top: 7px;
}

.voice-orb small {
  max-width: 150px;
  margin: 5px auto 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.heard-box {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-soft);
}

.heard-box span {
  margin: 0 0 4px;
}

.command-form {
  margin: 16px 0 0;
}

.command-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.command-list button {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
}

.voice-info {
  margin-top: 14px;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.history-item {
  border-left: 3px solid var(--blue);
}

.full-button {
  width: 100%;
  margin-top: 16px;
}

.settings-note {
  border: 0;
}

.bottom-nav {
  position: fixed;
  z-index: 800;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  width: min(760px, calc(100% - 24px));
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  padding: 7px;
  transform: translateX(50%);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(22px);
}

.bottom-nav button {
  display: grid;
  min-height: 58px;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.bottom-nav button span {
  font-size: 17px;
}

.bottom-nav button strong {
  font-size: 10px;
}

.bottom-nav button.active {
  background: linear-gradient(180deg, rgba(53, 184, 255, 0.18), rgba(53, 184, 255, 0.07));
  color: var(--cyan);
}

.toast {
  position: fixed;
  z-index: 1200;
  top: 84px;
  right: 18px;
  max-width: min(390px, calc(100% - 36px));
  padding: 12px 15px;
  transform: translateY(-10px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.visible {
  transform: none;
  opacity: 1;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.leaflet-control-attribution {
  font-size: 9px;
}

@media (max-width: 1060px) {
  .dashboard-grid,
  .gps-layout,
  .report-layout {
    grid-template-columns: 1fr;
  }

  .camera-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .camera-slot:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .topbar {
    min-height: 62px;
    padding: 8px 11px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .brand p,
  .status-chip,
  .clock {
    display: none;
  }

  main {
    padding: 12px 10px 102px;
  }

  .card {
    padding: 15px;
    border-radius: 20px;
  }

  .speed-zone {
    min-height: 145px;
    padding: 18px;
  }

  .speed-value strong {
    font-size: 66px;
  }

  .limit-sign {
    width: 82px;
  }

  .metrics-row,
  .seat-grid,
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric {
    padding: 9px;
  }

  .metric strong {
    font-size: 13px;
  }

  .action-row .button {
    flex: 1 1 calc(50% - 6px);
  }

  .video-frame,
  .video-frame video {
    min-height: 220px;
  }

  .destination-form {
    grid-template-columns: 1fr;
  }

  .destination-form .button {
    width: 100%;
  }

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

  .section-intro {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .camera-slot:last-child {
    grid-column: auto;
  }

  .command-list {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    bottom: max(7px, env(safe-area-inset-bottom));
    width: calc(100% - 12px);
    gap: 2px;
    padding: 5px;
    border-radius: 18px;
  }

  .bottom-nav button {
    min-height: 55px;
    border-radius: 13px;
  }

  .bottom-nav button strong {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .speed-zone {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 15px 13px;
  }

  .speed-value {
    gap: 5px;
  }

  .speed-value strong {
    font-size: 58px;
  }

  .speed-value span {
    font-size: 11px;
  }

  .limit-sign {
    width: 74px;
    border-width: 7px;
  }

  .limit-sign span {
    font-size: 33px;
  }

  .metrics-row {
    gap: 6px;
  }

  .metric span {
    font-size: 9px;
  }

  .seat-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .seat-card {
    min-height: 90px;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    justify-items: start;
    gap: 0 12px;
    text-align: left;
  }

  .seat-icon {
    grid-row: 1 / 3;
    margin: 0;
  }

  .card-heading {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
