:root {
  --paper: #f4eee6;
  --paper-strong: #fbf7f1;
  --stone: #ebe2d6;
  --stone-dark: #d9cebe;
  --ink: #1a211d;
  --ink-soft: rgba(26, 33, 29, 0.66);
  --ink-faint: rgba(26, 33, 29, 0.4);
  --line: rgba(26, 33, 29, 0.12);
  --shadow: 0 26px 72px rgba(38, 34, 29, 0.12);
  --shadow-soft: 0 16px 34px rgba(38, 34, 29, 0.08);
  --sage-400: #9ac8ad;
  --sage-500: #6fa685;
  --sage-700: #3f7355;
  --bronze-400: #caa16f;
  --bronze-600: #94663e;
  --amber-400: #d7ab6d;
  --amber-600: #9f6a38;
  --terra-400: #bb7a67;
  --terra-600: #8d4f42;
  --road: #6b7a8a;
  --road-edge: #5a6878;
  --ground: #4e5e3a;
  --ground-mid: #445234;
  --ground-dark: #39452c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 250, 244, 0.95), rgba(244, 238, 230, 0.72) 42%, transparent 68%),
    radial-gradient(circle at top right, rgba(235, 226, 214, 0.76), transparent 48%),
    linear-gradient(180deg, #f7f2eb 0%, #f0e8dc 45%, #e9dfd3 100%);
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
}

.welcome-scrim {
  position: absolute;
  inset: 0;
  background: rgba(24, 22, 19, 0.42);
  backdrop-filter: blur(10px);
}

.welcome-sheet {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 36px));
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(26, 33, 29, 0.12);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(245, 238, 228, 0.94)),
    rgba(251, 247, 241, 0.96);
  box-shadow: 0 28px 80px rgba(24, 22, 19, 0.24);
}

.welcome-sheet h2 {
  margin: 0;
  max-width: 18ch;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

@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;
  }
}

.welcome-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 18px;
  margin-top: 20px;
}

.setup-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-soft);
}

.setup-card-hero {
  display: grid;
  gap: 16px;
}

.car-cabin-diagram {
  position: relative;
  min-height: 280px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(117, 128, 139, 0.28), rgba(81, 90, 101, 0.38)),
    linear-gradient(180deg, #cfc6ba 0%, #b9ac9a 100%);
  overflow: hidden;
}

.windshield-zone {
  position: absolute;
  top: 10px;
  left: 12%;
  right: 12%;
  height: 96px;
  border-radius: 24px 24px 42px 42px;
  background: linear-gradient(180deg, rgba(226, 240, 246, 0.9), rgba(191, 214, 221, 0.45));
}

.dash-zone {
  position: absolute;
  top: 92px;
  left: 15%;
  right: 15%;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(180deg, #6d716f 0%, #4f5553 100%);
}

.phone-mount {
  position: absolute;
  display: grid;
  place-items: center;
  width: 108px;
  height: 58px;
  border-radius: 18px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.phone-mount span {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
}

.phone-mount.recommended {
  top: 26px;
  left: calc(50% - 54px);
  border: 2px solid rgba(63, 115, 85, 0.32);
  background: rgba(111, 166, 133, 0.18);
}

.phone-mount.recommended span {
  background: rgba(63, 115, 85, 0.92);
  color: #f7f4ef;
}

.phone-mount.alternate {
  top: 106px;
  left: calc(50% - 54px);
  border: 2px solid rgba(148, 102, 62, 0.26);
  background: rgba(202, 161, 111, 0.16);
}

.phone-mount.alternate span {
  background: rgba(148, 102, 62, 0.9);
  color: #fbf7f1;
}

.steering-wheel {
  position: absolute;
  left: 14%;
  bottom: 54px;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  border: 18px solid rgba(45, 49, 47, 0.82);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.console-block {
  position: absolute;
  right: 14%;
  bottom: 42px;
  width: 126px;
  height: 138px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(80, 83, 81, 0.92), rgba(45, 49, 47, 0.92));
}

.setup-points {
  display: grid;
  gap: 10px;
}

.welcome-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.topbar,
.demo-ribbon,
.status-tile,
.support-card,
.panel-surface,
.recent-item,
.recent-detail,
.settings-card,
.info-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(251, 247, 241, 0.78);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 20px;
  padding: 28px;
}

.brand-block h1,
.panel-head h2,
.support-card h2,
.info-card h3,
.settings-card strong {
  margin: 0;
}

.brand-block h1 {
  max-width: 10ch;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.8rem, 5vw, 4.9rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.subhead {
  max-width: 52ch;
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.eyebrow,
.tiny {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.status-cluster {
  display: grid;
  gap: 16px;
}

.status-tile {
  min-height: 118px;
  padding: 20px 22px;
}

.status-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 1.45rem;
  line-height: 1.05;
}

.demo-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1.2fr);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 18px 20px;
}

.demo-copy {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.demo-buttons,
.tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hidden {
  display: none !important;
}

.demo-button,
.tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 250, 244, 0.76);
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.demo-button:hover,
.tab:hover,
.dock-tab:hover {
  transform: translateY(-1px);
}

.demo-button.active,
.tab.active {
  background: #264f3d;
  border-color: #264f3d;
  color: #f4f1ea;
}

.replay-button {
  min-width: 78px;
}

.tab-row {
  margin: 18px 0;
}

.main-stack {
  display: grid;
  gap: 20px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.drive-workbench {
  display: grid;
  grid-template-columns: minmax(340px, 470px) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}

.device-frame {
  display: flex;
  justify-content: center;
  padding: 18px;
  border-radius: 38px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, #d7cbbc 0%, #c5b8a8 100%);
  box-shadow: var(--shadow);
}

.drive-screen {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 430 / 932;
  overflow: hidden;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.62), transparent 24%),
    linear-gradient(180deg, #f7f2eb 0%, #f1e9df 52%, #e8ddd0 100%);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 28px 70px rgba(40, 36, 30, 0.24);
}

.screen-glow {
  position: absolute;
  inset: auto 18% 56% 18%;
  height: 170px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.36), transparent 70%);
  pointer-events: none;
}

.whisper,
.hero,
.confidence-strip,
.dock {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
}

.whisper {
  top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  height: 58px;
  padding: 18px 24px 0;
}

.whisper span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(26, 33, 29, 0.42);
}

.whisper span:nth-child(2) {
  text-align: center;
}

.whisper span:last-child {
  text-align: right;
}

.hero {
  top: 58px;
  padding: 0 24px;
  text-align: center;
}

.hero-phrase {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(3.2rem, 8vw, 4rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero-support {
  max-width: 78%;
  margin: 10px auto 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(26, 33, 29, 0.52);
}

.stage-wrap {
  position: absolute;
  top: 186px;
  left: 20px;
  right: 20px;
  height: 503px;
  z-index: 2;
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 44%, rgba(80, 100, 55, 0.4) 0%, transparent 70%),
    linear-gradient(160deg, var(--ground) 0%, var(--ground-mid) 52%, var(--ground-dark) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.18),
    0 20px 56px rgba(0, 0, 0, 0.32),
    0 4px 12px rgba(0, 0, 0, 0.18);
}

.stage-vehicles {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.traffic-controls {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.stop-sign,
.signal-cluster {
  position: absolute;
}

.stop-sign {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 247, 238, 0.92);
  border-radius: 10px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.3), transparent 30%),
    linear-gradient(145deg, #de433d 0%, #9f211f 100%);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  box-shadow:
    0 7px 16px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(71, 18, 17, 0.32);
}

.stop-sign::before {
  content: "";
  position: absolute;
  left: calc(50% - 2px);
  top: 26px;
  width: 4px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(232, 231, 221, 0.94), rgba(128, 132, 124, 0.96));
  z-index: -1;
}

.stop-sign::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 52px;
  width: 30px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.28), transparent 72%);
  z-index: -2;
}

.stop-sign span {
  color: rgba(255, 249, 242, 0.96);
  font-size: 0.47rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(72, 16, 15, 0.34);
}

.stop-sign-north {
  top: calc(44% - 116px);
  left: calc(50% - 116px);
  transform: rotate(180deg);
}

.stop-sign-south {
  top: calc(44% + 82px);
  left: calc(50% + 82px);
}

.stop-sign-west {
  top: calc(44% + 72px);
  left: calc(50% - 130px);
  transform: rotate(90deg);
}

.stop-sign-east {
  top: calc(44% - 110px);
  left: calc(50% + 84px);
  transform: rotate(-90deg);
}

.controls-signal .stop-sign,
.controls-stop .signal-cluster {
  opacity: 0;
}

.controls-stop .stop-sign,
.controls-signal .signal-cluster {
  opacity: 1;
}

.signal-cluster {
  display: grid;
  justify-items: center;
  gap: 0;
  filter: drop-shadow(0 7px 14px rgba(0, 0, 0, 0.28));
  transition: opacity 180ms ease;
}

.signal-cluster-north {
  top: calc(44% - 138px);
  left: calc(50% - 118px);
  transform: rotate(180deg);
}

.signal-cluster-south {
  top: calc(44% + 82px);
  left: calc(50% + 82px);
}

.signal-cluster-west {
  top: calc(44% + 78px);
  left: calc(50% - 134px);
  transform: rotate(90deg);
}

.signal-cluster-east {
  top: calc(44% - 132px);
  left: calc(50% + 82px);
  transform: rotate(-90deg);
}

.signal-post {
  width: 6px;
  height: 58px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(42, 45, 44, 0.94), rgba(23, 25, 24, 0.92));
}

.signal-head {
  display: grid;
  gap: 5px;
  margin-bottom: -4px;
  padding: 8px 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(31, 34, 33, 0.96), rgba(18, 19, 19, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 7px 18px rgba(0, 0, 0, 0.34);
}

.signal-lamp {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  opacity: 0.18;
  filter: saturate(0.5);
}

.lamp-red {
  background: #d14c45;
}

.lamp-yellow {
  background: #d5aa4d;
}

.lamp-green {
  background: #58b36f;
}

.signal-head.signal-red .lamp-red,
.signal-head.signal-yellow .lamp-yellow,
.signal-head.signal-green .lamp-green {
  opacity: 1;
  filter: saturate(1);
}

.signal-head.signal-red .lamp-red {
  box-shadow: 0 0 15px rgba(209, 76, 69, 0.9);
}

.signal-head.signal-yellow .lamp-yellow {
  box-shadow: 0 0 15px rgba(213, 170, 77, 0.9);
}

.signal-head.signal-green .lamp-green {
  box-shadow: 0 0 15px rgba(88, 179, 111, 0.9);
}

.road {
  position: absolute;
  background: linear-gradient(180deg, var(--road) 0%, var(--road-edge) 100%);
}

.road-v {
  top: -4px;
  bottom: -4px;
  left: calc(50% - 64px);
  width: 128px;
  box-shadow:
    -3px 0 12px rgba(0, 0, 0, 0.28),
     3px 0 12px rgba(0, 0, 0, 0.28);
}

.road-h {
  top: calc(44% - 64px);
  left: -4px;
  right: -4px;
  height: 128px;
  box-shadow:
    0 -3px 12px rgba(0, 0, 0, 0.28),
    0 3px 12px rgba(0, 0, 0, 0.28);
}

.dash-v,
.dash-h,
.stopbar {
  position: absolute;
}

.dash-v {
  left: calc(50% - 1.5px);
  width: 3px;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.72) 0,
    rgba(255, 255, 255, 0.72) 18px,
    transparent 18px,
    transparent 36px
  );
}

.dash-v.north {
  top: 0;
  bottom: calc(56% + 2px);
}

.dash-v.south {
  top: calc(56% - 2px);
  bottom: 0;
}

.dash-h {
  top: calc(44% - 1.5px);
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.72) 0,
    rgba(255, 255, 255, 0.72) 18px,
    transparent 18px,
    transparent 36px
  );
}

.dash-h.west {
  left: 0;
  right: calc(50% + 64px);
}

.dash-h.east {
  left: calc(50% + 64px);
  right: 0;
}

.stopbar {
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.65);
}

.stopbar-n,
.stopbar-s {
  left: calc(50% - 54px);
  width: 108px;
  height: 4px;
}

.stopbar-n {
  top: calc(44% - 68px);
}

.stopbar-s {
  top: calc(44% + 64px);
}

.stopbar-w,
.stopbar-e {
  top: calc(44% - 54px);
  width: 4px;
  height: 108px;
}

.stopbar-w {
  left: calc(50% - 68px);
}

.stopbar-e {
  left: calc(50% + 64px);
}

.lane-edge {
  position: absolute;
  opacity: 0.3;
  pointer-events: none;
}

.lane-edge-v {
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.28) 10%, rgba(255, 255, 255, 0.28) 90%, transparent 100%);
}

.lane-edge-v.left {
  left: calc(50% - 28px);
}

.lane-edge-v.right {
  left: calc(50% + 26px);
}

.lane-edge-h {
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.28) 10%, rgba(255, 255, 255, 0.28) 90%, transparent 100%);
}

.lane-edge-h.top {
  top: calc(44% - 28px);
}

.lane-edge-h.bottom {
  top: calc(44% + 26px);
}

.stage-vehicle {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 4;
  transition:
    left 260ms ease,
    top 260ms ease,
    opacity 220ms ease,
    filter 220ms ease,
    transform 220ms ease;
}

.stage-vehicle.is-entering {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
}

.stage-vehicle.is-exiting {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  pointer-events: none;
}

.stage-vehicle .vehicle-body {
  position: relative;
  border-radius: 9px;
}

.stage-vehicle .vehicle-intent {
  position: absolute;
  z-index: 6;
  opacity: 0.78;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    filter 220ms ease;
}

.stage-vehicle .vehicle-body::before,
.stage-vehicle .vehicle-body::after {
  content: "";
  position: absolute;
  border-radius: 5px;
}

.stage-vehicle.approach-south .vehicle-body,
.stage-vehicle.approach-north .vehicle-body {
  width: 52px;
  height: 116px;
}

.stage-vehicle.approach-south .vehicle-body {
  border-radius: 10px 10px 8px 8px;
}

.stage-vehicle.approach-south .vehicle-body,
.stage-vehicle.approach-north .vehicle-body,
.stage-vehicle.approach-west .vehicle-body,
.stage-vehicle.approach-east .vehicle-body {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.24),
    0 10px 28px rgba(0, 0, 0, 0.45);
}

.stage-vehicle.approach-south .vehicle-body::before {
  top: 6px;
  left: 7px;
  right: 7px;
  height: 26%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.06) 100%);
}

.stage-vehicle.approach-south .vehicle-body::after {
  top: 33%;
  left: 10px;
  right: 10px;
  height: 30%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.stage-vehicle.approach-south::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 72px;
  height: 22px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(90, 158, 122, 0.3) 0%, transparent 72%);
}

.stage-vehicle.approach-north .vehicle-body {
  border-radius: 8px 8px 10px 10px;
}

.stage-vehicle.approach-north .vehicle-body::before {
  right: 6px;
  left: 6px;
  bottom: 6px;
  height: 26%;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.stage-vehicle.approach-north .vehicle-body::after {
  right: 8px;
  left: 8px;
  bottom: 33%;
  height: 28%;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.stage-vehicle.approach-west .vehicle-body,
.stage-vehicle.approach-east .vehicle-body {
  width: 106px;
  height: 46px;
}

.stage-vehicle.approach-west .vehicle-body {
  border-radius: 8px 10px 10px 8px;
}

.stage-vehicle.approach-west .vehicle-body::before {
  top: 6px;
  right: 6px;
  bottom: 6px;
  width: 26%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.42) 100%);
}

.stage-vehicle.approach-west .vehicle-body::after {
  top: 8px;
  right: 33%;
  bottom: 8px;
  width: 28%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.stage-vehicle.approach-east .vehicle-body {
  border-radius: 10px 8px 8px 10px;
}

.stage-vehicle.approach-east .vehicle-body::before {
  top: 6px;
  left: 6px;
  bottom: 6px;
  width: 26%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.stage-vehicle.approach-east .vehicle-body::after {
  top: 8px;
  left: 33%;
  bottom: 8px;
  width: 28%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.stage-vehicle.probability-strong.approach-south .vehicle-body,
.stage-vehicle.probability-strong.approach-north .vehicle-body {
  background: linear-gradient(180deg, #9fd5b5 0%, #6fad88 50%, #3f7355 100%);
}

.stage-vehicle.probability-strong.approach-west .vehicle-body {
  background: linear-gradient(90deg, #3f7355 0%, #6fad88 50%, #9fd5b5 100%);
}

.stage-vehicle.probability-strong.approach-east .vehicle-body {
  background: linear-gradient(90deg, #9fd5b5 0%, #6fad88 50%, #3f7355 100%);
}

.stage-vehicle.probability-probable.approach-south .vehicle-body,
.stage-vehicle.probability-probable.approach-north .vehicle-body {
  background: linear-gradient(180deg, #dfc29a 0%, #caa16f 52%, #94663e 100%);
}

.stage-vehicle.probability-probable.approach-west .vehicle-body {
  background: linear-gradient(90deg, #94663e 0%, #caa16f 52%, #dfc29a 100%);
}

.stage-vehicle.probability-probable.approach-east .vehicle-body {
  background: linear-gradient(90deg, #dfc29a 0%, #caa16f 52%, #94663e 100%);
}

.stage-vehicle.probability-soft.approach-south .vehicle-body,
.stage-vehicle.probability-soft.approach-north .vehicle-body {
  background: linear-gradient(180deg, #edd0a1 0%, #d7ab6d 52%, #9f6a38 100%);
}

.stage-vehicle.probability-soft.approach-west .vehicle-body {
  background: linear-gradient(90deg, #9f6a38 0%, #d7ab6d 52%, #edd0a1 100%);
}

.stage-vehicle.probability-soft.approach-east .vehicle-body {
  background: linear-gradient(90deg, #edd0a1 0%, #d7ab6d 52%, #9f6a38 100%);
}

.stage-vehicle.probability-remote.approach-south .vehicle-body,
.stage-vehicle.probability-remote.approach-north .vehicle-body {
  background: linear-gradient(180deg, #d8a191 0%, #bb7a67 52%, #8d4f42 100%);
}

.stage-vehicle.probability-remote.approach-west .vehicle-body {
  background: linear-gradient(90deg, #8d4f42 0%, #bb7a67 52%, #d8a191 100%);
}

.stage-vehicle.probability-remote.approach-east .vehicle-body {
  background: linear-gradient(90deg, #d8a191 0%, #bb7a67 52%, #8d4f42 100%);
}

.stage-vehicle.probability-unresolved.approach-south .vehicle-body,
.stage-vehicle.probability-unresolved.approach-north .vehicle-body {
  background: linear-gradient(180deg, #f0f2f0 0%, #d8dcd8 50%, #c4c8c4 100%);
}

.stage-vehicle.probability-unresolved.approach-west .vehicle-body {
  background: linear-gradient(90deg, #c4c8c4 0%, #d8dcd8 50%, #f0f2f0 100%);
}

.stage-vehicle.probability-unresolved.approach-east .vehicle-body {
  background: linear-gradient(90deg, #f0f2f0 0%, #d8dcd8 50%, #c4c8c4 100%);
}

.stage-vehicle.maneuver-straight .vehicle-intent {
  width: 10px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 245, 232, 0.92), rgba(255, 245, 232, 0.12));
  box-shadow: 0 0 10px rgba(255, 245, 232, 0.18);
}

.stage-vehicle.approach-south.maneuver-straight .vehicle-intent {
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
}

.stage-vehicle.approach-north.maneuver-straight .vehicle-intent {
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
}

.stage-vehicle.approach-west.maneuver-straight .vehicle-intent {
  top: 50%;
  right: -18px;
  transform: translateY(-50%) rotate(90deg);
}

.stage-vehicle.approach-east.maneuver-straight .vehicle-intent {
  top: 50%;
  left: -18px;
  transform: translateY(-50%) rotate(90deg);
}

.stage-vehicle.maneuver-left .vehicle-intent,
.stage-vehicle.maneuver-right .vehicle-intent {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 241, 220, 0.92);
  border-color: rgba(255, 241, 220, 0.92) transparent transparent transparent;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 241, 220, 0.16);
}

.stage-vehicle.approach-south.maneuver-left .vehicle-intent {
  top: -8px;
  left: -2px;
  transform: rotate(-45deg);
}

.stage-vehicle.approach-south.maneuver-right .vehicle-intent {
  top: -8px;
  right: -2px;
  transform: scaleX(-1) rotate(-45deg);
}

.stage-vehicle.approach-north.maneuver-left .vehicle-intent {
  bottom: -8px;
  right: -2px;
  transform: rotate(135deg);
}

.stage-vehicle.approach-north.maneuver-right .vehicle-intent {
  bottom: -8px;
  left: -2px;
  transform: scaleX(-1) rotate(135deg);
}

.stage-vehicle.approach-west.maneuver-left .vehicle-intent {
  top: -2px;
  right: -8px;
  transform: rotate(45deg);
}

.stage-vehicle.approach-west.maneuver-right .vehicle-intent {
  bottom: -2px;
  right: -8px;
  transform: scaleY(-1) rotate(45deg);
}

.stage-vehicle.approach-east.maneuver-left .vehicle-intent {
  bottom: -2px;
  left: -8px;
  transform: rotate(225deg);
}

.stage-vehicle.approach-east.maneuver-right .vehicle-intent {
  top: -2px;
  left: -8px;
  transform: scaleY(-1) rotate(225deg);
}

.marker {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  z-index: 5;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    background 220ms ease,
    color 220ms ease,
    border-color 220ms ease;
}

.stage-vehicle.approach-south .marker {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.stage-vehicle.approach-north .marker {
  top: -11px;
  right: -11px;
}

.stage-vehicle.approach-west .marker,
.stage-vehicle.approach-east .marker {
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
}

.stage-vehicle .marker {
  background: rgba(20, 28, 20, 0.8);
  border: 1.5px solid rgba(220, 225, 218, 0.35);
  color: rgba(239, 243, 237, 0.85);
}

.stage-vehicle .marker.probability-strong {
  background: rgba(63, 115, 85, 0.92);
  border-color: rgba(196, 233, 212, 0.42);
}

.stage-vehicle .marker.probability-probable {
  background: rgba(148, 102, 62, 0.9);
  border-color: rgba(235, 208, 161, 0.36);
}

.stage-vehicle .marker.probability-soft {
  background: rgba(159, 106, 56, 0.9);
  border-color: rgba(237, 208, 161, 0.34);
}

.stage-vehicle .marker.probability-remote {
  background: rgba(141, 79, 66, 0.88);
  border-color: rgba(216, 161, 145, 0.34);
}

.stage-vehicle .marker.probability-unresolved {
  background: rgba(86, 92, 88, 0.82);
  border-color: rgba(220, 225, 218, 0.24);
}

.vector {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  transition:
    opacity 240ms ease,
    filter 240ms ease;
}

.vector svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.vector-path-core,
.vector-path-glow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    d 260ms ease,
    stroke 220ms ease,
    opacity 220ms ease;
}

.vector-path-core {
  stroke: rgba(98, 190, 140, 0.94);
  stroke-width: 1.05;
}

.vector-path-glow {
  stroke: rgba(98, 190, 140, 0.26);
  stroke-width: 2.4;
  filter: blur(1.8px);
}

.confidence-strip {
  top: 689px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 30px;
  text-align: center;
}

.confidence-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(26, 33, 29, 0.36);
}

.confidence-bar-wrap {
  width: 100%;
  max-width: 240px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.1);
}

.confidence-bar-fill {
  width: 36%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #587f67, #8dc4a6);
  transition: width 220ms ease, background 220ms ease, opacity 220ms ease;
}

.confidence-note {
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(26, 33, 29, 0.46);
}

.dock {
  bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  height: 130px;
  padding: 16px 32px 0;
  background: linear-gradient(180deg, transparent 0%, rgba(242, 237, 230, 0.97) 38%);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.dock-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: rgba(26, 33, 29, 0.34);
  cursor: pointer;
}

.dock-tab span:last-child {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.dock-icon svg path,
.dock-icon svg circle,
.dock-icon svg rect {
  stroke: currentColor;
}

.dock-tab.active {
  color: #3d7a58;
}

.dock-tab.active::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.support-rail {
  display: grid;
  gap: 18px;
}

.support-card {
  padding: 22px;
}

.support-card h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.replay-card {
  display: grid;
  gap: 14px;
}

#replay-frame-label {
  margin: -2px 0 0;
}

#replay-frame-detail {
  margin: -8px 0 0;
}

.replay-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.replay-readout {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0.92), rgba(246, 240, 231, 0.82)),
    rgba(251, 247, 241, 0.78);
}

.replay-readout h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.sequence-scale-card {
  display: grid;
  gap: 14px;
}

.signal-metrics-card {
  display: grid;
  gap: 14px;
}

.sequence-scale {
  display: grid;
  gap: 10px;
}

.sequence-scale-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(26, 33, 29, 0.08);
}

.sequence-scale-item.is-primary {
  background: linear-gradient(180deg, rgba(117, 187, 146, 0.22), rgba(255, 255, 255, 0.58));
  border-color: rgba(63, 115, 85, 0.2);
  box-shadow: 0 12px 22px rgba(63, 115, 85, 0.08);
}

.sequence-scale-item.probability-strong {
  background: linear-gradient(180deg, rgba(117, 187, 146, 0.22), rgba(255, 255, 255, 0.58));
}

.sequence-scale-item.probability-probable {
  background: linear-gradient(180deg, rgba(202, 161, 111, 0.18), rgba(255, 255, 255, 0.56));
}

.sequence-scale-item.probability-soft {
  background: linear-gradient(180deg, rgba(215, 171, 109, 0.15), rgba(255, 255, 255, 0.56));
}

.sequence-scale-item.probability-remote {
  background: linear-gradient(180deg, rgba(187, 122, 103, 0.14), rgba(255, 255, 255, 0.54));
}

.sequence-scale-item.probability-unresolved {
  background: rgba(255, 255, 255, 0.36);
}

.sequence-scale-item.is-ego {
  outline: 1px solid rgba(63, 115, 85, 0.18);
}

.sequence-scale-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(20, 28, 20, 0.82);
  color: rgba(250, 247, 241, 0.95);
  font-size: 0.82rem;
  font-weight: 700;
}

.sequence-scale-item.is-primary .sequence-scale-rank {
  background: linear-gradient(180deg, #3f7355 0%, #5a9e7a 100%);
}

.sequence-scale-item.probability-probable .sequence-scale-rank {
  background: linear-gradient(180deg, #94663e 0%, #caa16f 100%);
}

.sequence-scale-item.probability-soft .sequence-scale-rank {
  background: linear-gradient(180deg, #9f6a38 0%, #d7ab6d 100%);
}

.sequence-scale-item.probability-remote .sequence-scale-rank {
  background: linear-gradient(180deg, #8d4f42 0%, #bb7a67 100%);
}

.sequence-scale-item.probability-unresolved .sequence-scale-rank {
  background: linear-gradient(180deg, #6e746f 0%, #aab0ab 100%);
}

.sequence-scale-label strong,
.sequence-scale-empty strong {
  display: block;
  margin: 0;
}

.sequence-scale-label span,
.sequence-scale-empty span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.sequence-scale-empty {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(26, 33, 29, 0.08);
}

.support-points {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.support-item {
  padding: 12px 14px;
  border-left: 3px solid rgba(26, 33, 29, 0.16);
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink-soft);
  line-height: 1.45;
}

.metrics-card {
  display: grid;
  gap: 16px;
}

.metric-row strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.15rem;
  line-height: 1.2;
}

.panel-surface {
  padding: 22px;
}

.panel-head {
  margin-bottom: 18px;
}

.recent-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.25fr);
  gap: 16px;
}

.recent-list {
  display: grid;
  gap: 12px;
}

.refresh-warning {
  grid-column: 1 / -1;
  margin: 0 0 14px;
  color: #8b4a24;
}

.recent-item,
.recent-detail,
.settings-card,
.info-card {
  padding: 18px;
}

.recent-item {
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.recent-item:hover {
  transform: translateY(-1px);
}

.recent-item.active {
  border-color: rgba(63, 115, 85, 0.35);
  background: rgba(231, 244, 235, 0.88);
}

.recent-meta,
.detail-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.card-grid,
.summary-row {
  display: grid;
  gap: 12px;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.summary-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.summary-key {
  display: block;
  margin-bottom: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(38, 79, 61, 0.08);
  color: #285640;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.muted,
.empty-state {
  color: var(--ink-soft);
}

.drive-screen.state-guidance_available .stage-vehicle.is-primary .vehicle-body {
  box-shadow:
    0 0 0 1.5px rgba(143, 207, 180, 0.56),
    0 0 24px rgba(143, 207, 180, 0.36),
    0 0 52px rgba(143, 207, 180, 0.14),
    0 10px 28px rgba(0, 0, 0, 0.46);
}

.drive-screen.state-guidance_available .stage-vehicle.is-secondary {
  opacity: 0.96;
}

.drive-screen.state-guidance_available .stage-vehicle.is-secondary .vehicle-body {
  filter: saturate(0.9);
}

.drive-screen.state-guidance_available .stage-vehicle.is-primary.tone-ego .vehicle-body {
  animation: pulse-primary 2.8s ease-in-out infinite;
}

.drive-screen.state-degraded_guidance .stage {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.16),
    0 18px 46px rgba(0, 0, 0, 0.3),
    0 4px 10px rgba(0, 0, 0, 0.18);
}

.drive-screen.state-degraded_guidance .stage-vehicle {
  opacity: 0.88;
}

.drive-screen.state-degraded_guidance .stage-vehicle.is-primary .vehicle-body {
  box-shadow:
    0 0 0 1px rgba(215, 171, 109, 0.52),
    0 0 18px rgba(215, 171, 109, 0.26),
    0 8px 24px rgba(0, 0, 0, 0.46);
  filter: saturate(0.86);
}

.drive-screen.state-degraded_guidance .marker.is-primary {
  background: rgba(159, 106, 56, 0.92);
  color: #fff3e4;
}

.drive-screen.state-degraded_guidance .vector {
  opacity: 0.52;
  filter: saturate(0.7);
}

.drive-screen.state-guidance_hidden .stage-vehicle {
  opacity: 0.72;
  filter: saturate(0.7);
}

.drive-screen.state-guidance_hidden .stage-vehicle.is-secondary {
  opacity: 0.64;
}

.drive-screen.state-guidance_hidden .marker {
  opacity: 0.24;
}

.drive-screen.state-guidance_hidden .vector {
  opacity: 0;
}

.drive-screen.state-guidance_hidden .hero-support,
.drive-screen.state-guidance_hidden .confidence-note {
  color: rgba(26, 33, 29, 0.42);
}

.drive-screen.state-monitoring .stage-vehicle {
  opacity: 0.76;
  filter: saturate(0.84);
}

.drive-screen.state-monitoring .marker {
  opacity: 0.42;
}

.drive-screen.state-monitoring .vector {
  opacity: 0;
}

.drive-screen.state-signal_monitor .stage,
.drive-screen.state-signal_caution .stage,
.drive-screen.state-signal_warning .stage,
.drive-screen.state-signal_hidden .stage {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.18),
    0 18px 50px rgba(0, 0, 0, 0.34),
    0 4px 10px rgba(0, 0, 0, 0.2);
}

.drive-screen.state-signal_monitor .stage-vehicle.is-primary .vehicle-body {
  box-shadow:
    0 0 0 1.5px rgba(143, 207, 180, 0.5),
    0 0 20px rgba(143, 207, 180, 0.24),
    0 10px 28px rgba(0, 0, 0, 0.46);
}

.drive-screen.state-signal_caution .stage-vehicle.is-primary .vehicle-body {
  box-shadow:
    0 0 0 1.5px rgba(215, 171, 109, 0.54),
    0 0 22px rgba(215, 171, 109, 0.24),
    0 10px 28px rgba(0, 0, 0, 0.46);
}

.drive-screen.state-signal_warning .stage-vehicle.is-primary .vehicle-body {
  box-shadow:
    0 0 0 1.5px rgba(209, 76, 69, 0.58),
    0 0 26px rgba(209, 76, 69, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.46);
}

.drive-screen.state-signal_hidden .stage-vehicle {
  opacity: 0.78;
  filter: saturate(0.72);
}

.drive-screen.state-signal_hidden .hero-support,
.drive-screen.state-signal_hidden .confidence-note {
  color: rgba(26, 33, 29, 0.46);
}

.stage-vehicle.is-secondary {
  opacity: 0.92;
}

.stage-vehicle.is-muted {
  opacity: 0.76;
  filter: saturate(0.78) blur(0.2px);
}

.marker.is-primary {
  background: #3d7a58;
  border-color: rgba(143, 207, 180, 0.4);
  color: #edf7f1;
}

.marker.is-secondary {
  background: rgba(39, 48, 40, 0.82);
}

.marker.is-muted {
  opacity: 0.48;
}

@keyframes pulse-primary {
  0%,
  100% {
    box-shadow:
      0 0 0 1.5px rgba(143, 207, 180, 0.56),
      0 0 24px rgba(143, 207, 180, 0.36),
      0 0 52px rgba(143, 207, 180, 0.14),
      0 10px 28px rgba(0, 0, 0, 0.46);
  }

  50% {
    box-shadow:
      0 0 0 1.5px rgba(170, 224, 196, 0.72),
      0 0 30px rgba(143, 207, 180, 0.48),
      0 0 62px rgba(143, 207, 180, 0.2),
      0 10px 28px rgba(0, 0, 0, 0.46);
  }
}

@media (max-width: 1120px) {
  .topbar,
  .demo-ribbon,
  .drive-workbench,
  .recent-layout {
    grid-template-columns: 1fr;
  }

  .welcome-layout {
    grid-template-columns: 1fr;
  }

  .device-frame {
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px;
  }

  .topbar,
  .demo-ribbon,
  .panel-surface,
  .support-card,
  .status-tile {
    border-radius: 22px;
  }

  .brand-block h1 {
    max-width: none;
    font-size: clamp(2.3rem, 10vw, 3.7rem);
  }

  .demo-buttons,
  .tab-row {
    gap: 8px;
  }

  .demo-button,
  .tab {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .device-frame {
    padding: 12px;
    border-radius: 30px;
  }

  .drive-screen {
    width: 100%;
  }

  .support-card h2 {
    font-size: 2rem;
  }
}
