:root {
  color-scheme: light;
  --ink: #142d29;
  --paper: #fffdf8;
  --orange: #bb450c;
  --line: #d8ddd5;
  font:
    16px/1.5 system-ui,
    -apple-system,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: #f5f4ed;
}
button,
a {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #fd5a01;
  outline-offset: 4px;
}
button {
  color: var(--ink);
}
header {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
  background: var(--paper);
}
.brand {
  display: flex;
  gap: 9px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 23px;
  letter-spacing: -0.6px;
}
.brand-caption {
  font-size: 14px;
  color: #50645b;
}
header > button {
  margin-left: auto;
  padding: 9px 19px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: transparent;
  font-size: 14px;
}
.scene {
  height: calc(100svh - 122px);
  min-height: 540px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(#83b7d0, #edf0dd 55%, #577c3f);
  isolation: isolate;
}
.scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-x;
}
.loading {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper);
  padding: 18px 25px;
  border-radius: 14px;
}
.horizon {
  display: none;
}
.journey-intro {
  position: absolute;
  top: 28px;
  left: 36px;
  z-index: 2;
  pointer-events: none;
  color: #17372f;
  text-shadow: 0 1px 15px #f7f8eda0;
}
.journey-intro > span {
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 600;
}
.journey-intro h1 {
  font-size: clamp(24px, 3.2vw, 44px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -1px;
  margin: 10px 0;
}
.drive-controls {
  position: absolute;
  z-index: 10;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  align-items: center;
  white-space: nowrap;
}
.drive-controls button {
  background: var(--paper);
  border: 1px solid #fff;
  border-radius: 28px;
  box-shadow: 0 4px 18px #16352c20;
  min-height: 50px;
  padding: 10px 22px;
}
.drive-controls .back,
.drive-controls .forward {
  width: 50px;
  padding: 0;
  font-size: 28px;
}
.journey-status {
  position: absolute;
  z-index: 2;
  bottom: 18px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #fff;
  text-shadow: 0 1px 4px #142d29;
  font-size: 13px;
}
.readable-sign {
  position: absolute;
  z-index: 5;
  top: 30px;
  right: 32px;
  width: min(370px, 38%);
  min-height: 128px;
  border: 0;
  border-left: 4px solid #fd5a01;
  background: var(--paper);
  color: var(--ink);
  border-radius: 4px 16px 16px 4px;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  text-align: left;
  box-shadow: 0 8px 35px #193b2826;
}
.readable-sign small {
  font-size: 13px;
  color: var(--orange);
}
.readable-sign strong {
  font-size: 23px;
  line-height: 1.25;
  font-weight: 600;
}
.route-stops {
  position: absolute;
  top: 87px;
  right: 25px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(460px, calc(100% - 32px));
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 30px #193b2820;
}
.route-stops[hidden] {
  display: none;
}
.stop {
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 14px;
  min-height: 44px;
}
.stop[aria-pressed='true'] {
  background: #fff0e4;
  border-color: #fd5a01;
  color: var(--orange);
}
.destination {
  position: absolute;
  z-index: 30;
  right: 22px;
  top: 94px;
  width: 370px;
  max-height: calc(100svh - 150px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 45px #17352c30;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.6px;
  color: var(--orange);
  font-weight: 600;
}
.close-panel,
.close-dialog {
  border: 0;
  background: transparent;
  width: 40px;
  height: 40px;
  font-size: 29px;
  line-height: 1;
}
.destination h2 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 500;
  margin: 10px 0;
}
.panel-description {
  font-size: 14px;
  color: #53675d;
  margin: 0 0 16px;
}
.question-list {
  display: grid;
  gap: 6px;
}
.question {
  border: 0;
  border-radius: 9px;
  background: #f0f3ec;
  padding: 13px 14px;
  min-height: 46px;
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
}
.question:hover,
.question[aria-pressed='true'] {
  background: #fff0e4;
  color: var(--orange);
}
.chosen {
  font-size: 13px;
  line-height: 1.5;
  color: #53675d;
  min-height: 52px;
  padding-top: 13px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.resume,
.dialog-actions button,
.dialog-actions a {
  border: 0;
  border-radius: 23px;
  padding: 11px 18px;
  background: #173b30;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  min-height: 44px;
}
.resume {
  width: 100%;
  margin-top: 13px;
}
dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px;
  max-width: 540px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 80px #102b2940;
}
dialog::backdrop {
  background: #142d2980;
  backdrop-filter: blur(5px);
}
dialog form {
  display: flex;
  justify-content: flex-end;
  margin: -12px -10px 0;
}
dialog h2 {
  font-weight: 500;
  font-size: 30px;
  line-height: 1.25;
  margin: 15px 0;
}
dialog p {
  font-size: 16px;
}
.connection-note {
  background: #f0f3ec;
  border-radius: 12px;
  padding: 15px;
  color: #52675b;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dialog-actions a {
  background: #fff0e4;
  color: var(--orange);
}
.copy-status {
  min-height: 24px;
  font-size: 14px;
}
footer {
  height: 44px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #52675b;
}
footer button {
  font-size: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 5px;
}
.credits-dialog a {
  color: var(--orange);
}
@media (max-width: 700px) {
  header {
    height: 66px;
    padding: 0 16px;
    gap: 9px;
  }
  .brand {
    font-size: 20px;
  }
  .brand-caption {
    display: none;
  }
  header > button {
    font-size: 13px;
    padding: 8px 13px;
  }
  .scene {
    height: calc(100svh - 116px);
    min-height: 550px;
  }
  .journey-intro {
    top: 18px;
    left: 18px;
  }
  .journey-intro h1 {
    font-size: 24px;
  }
  .journey-intro > span {
    font-size: 11px;
  }
  .readable-sign {
    top: 126px;
    left: 16px;
    right: 16px;
    width: auto;
    height: 124px;
    padding: 14px 17px;
  }
  .readable-sign strong {
    font-size: 20px;
  }
  .readable-sign small {
    font-size: 12px;
  }
  .drive-controls {
    bottom: 78px;
  }
  .drive-controls button {
    font-size: 14px;
    padding: 10px 18px;
  }
  .journey-status {
    bottom: 15px;
    left: 18px;
    right: 18px;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
  }
  .destination {
    top: 80px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100svh - 108px);
    padding: 20px;
  }
  .route-stops {
    top: 75px;
    right: 12px;
  }
  footer {
    height: 50px;
    padding: 0 14px;
    font-size: 11px;
  }
  footer > span {
    max-width: 58%;
  }
  footer button {
    font-size: 11px;
  }
  dialog {
    padding: 22px;
  }
  dialog h2 {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

.readable-sign small,
.panel-description,
.chosen,
.journey-status {
  font-size: 14px;
}
@media (max-width: 700px) {
  header > button,
  .readable-sign small,
  .journey-status {
    font-size: 14px;
  }
}

.topic-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: var(--orange);
  vertical-align: middle;
}
.stop,
.question,
.bot-link {
  display: flex;
  align-items: center;
  gap: 10px;
}
.destination h2,
#question-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.destination h2 .topic-icon,
#question-title .topic-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}
.bot-link .topic-icon {
  color: inherit;
}
.panel-bot {
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #173b30;
  color: white;
  text-decoration: none;
  font-size: 15px;
}
.readable-sign strong {
  display: flex;
  align-items: center;
  gap: 12px;
}
.readable-sign strong .topic-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}
.question-dialog #question-title {
  align-items: flex-start;
}

.stop .topic-icon,
.question .topic-icon,
.bot-link .topic-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}
.readable-sign strong .topic-icon,
.destination h2 .topic-icon,
#question-title .topic-icon {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}
.navigator {
  position: absolute;
  z-index: 8;
  right: 28px;
  bottom: 32px;
  width: 340px;
  background: #fffdf9;
  border: 1px solid #ffffffb3;
  border-radius: 25px;
  box-shadow: 0 20px 60px #10292340;
  overflow: hidden;
  color: var(--ink);
}
.navigator-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: #173b30;
  color: white;
}
.navigator-top span {
  margin-left: auto;
  font-size: 12px;
  color: #cfe4d8;
}
.navigator-map {
  height: 176px;
  position: relative;
  overflow: hidden;
}
.navigator-map svg {
  width: 100%;
  height: 100%;
}
.map-direction {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 12px;
  background: #fffdfad9;
  padding: 5px 9px;
  border-radius: 10px;
}
.navigator-card {
  height: 155px;
  padding: 17px 18px 8px;
}
.navigator .readable-sign {
  position: static;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  gap: 10px;
}
.navigator .readable-sign small {
  font-size: 13px;
  color: #5a7266;
}
.navigator .readable-sign strong {
  font-size: 21px;
  line-height: 1.25;
  align-items: flex-start;
}
.navigator-next {
  padding: 8px 18px 14px;
  height: 87px;
  border-top: 1px solid #e5ebe4;
}
.navigator-next > span {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #52675b;
}
.navigator-next strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  margin-top: 5px;
}
.navigator-progress {
  height: 3px;
  background: #e4eee8;
}
.navigator-progress > div {
  height: 100%;
  background: #f07941;
}
.navigator .drive-controls {
  position: static;
  transform: none;
  justify-content: center;
  padding: 12px 12px 6px;
  gap: 6px;
}
.navigator .drive-controls button {
  min-height: 42px;
  padding: 8px 13px;
  font-size: 13px;
  box-shadow: none;
  background: #edf3ed;
  border: 0;
}
.navigator .drive-controls .back,
.navigator .drive-controls .forward {
  width: 38px;
  font-size: 23px;
}
.navigator-open {
  margin: 5px 16px 15px;
  width: calc(100% - 32px);
  border: 0;
  border-radius: 12px;
  padding: 11px;
  color: white;
  background: #173b30;
  font-size: 14px;
}
.journey-intro h1 {
  font-size: clamp(24px, 2.5vw, 36px);
}
.journey-status {
  right: 400px;
  flex-direction: column;
  gap: 3px;
}
.destination {
  right: 24px;
  top: 88px;
}
.scene {
  background: #bad5d6;
}
@media (max-width: 700px) {
  .navigator {
    right: 12px;
    left: 12px;
    bottom: 40px;
    width: auto;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 110px 1fr;
  }
  .navigator-top {
    grid-column: 1/-1;
    padding: 9px 12px;
  }
  .navigator-map {
    height: 175px;
    grid-column: 1;
    grid-row: 2/4;
  }
  .navigator-map svg {
    width: 260px;
    max-width: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  .map-direction {
    display: none;
  }
  .navigator-card {
    height: 128px;
    padding: 12px 12px 5px;
    grid-column: 2;
  }
  .navigator .readable-sign strong {
    font-size: 16px;
    gap: 7px;
  }
  .navigator .readable-sign strong .topic-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
  .navigator .readable-sign small {
    font-size: 12px;
  }
  .navigator-next {
    height: 47px;
    padding: 4px 12px;
    border: 0;
    grid-column: 2;
  }
  .navigator-next > span {
    font-size: 9px;
  }
  .navigator-next strong {
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .navigator-progress {
    grid-column: 1/-1;
  }
  .navigator .drive-controls {
    grid-column: 1;
    grid-row: 5;
    padding: 8px 4px;
    gap: 3px;
  }
  .navigator .drive-controls .back,
  .navigator .drive-controls .forward {
    display: none;
  }
  .navigator .drive-controls button {
    font-size: 12px;
    padding: 6px;
    min-height: 42px;
    width: 100%;
  }
  .navigator-open {
    grid-column: 2;
    grid-row: 5;
    margin: 8px 10px;
    width: calc(100% - 20px);
    font-size: 13px;
    padding: 8px;
  }
  .journey-status {
    right: 12px;
    bottom: 8px;
    font-size: 12px;
  }
  .journey-status .hint {
    display: none;
  }
  .journey-intro {
    top: 18px;
  }
  .journey-intro h1 {
    font-size: 23px;
  }
  .navigator .readable-sign {
    left: auto;
    right: auto;
    top: auto;
  }
  .destination {
    z-index: 35;
  }
}

/* A movable card stays inside the scene; the compact view leaves room for the road. */
.scene {
  min-height: 0;
}
.navigator {
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.navigator-top {
  padding: 0 5px 0 8px;
  min-height: 46px;
  gap: 0;
  position: relative;
}
.navigator-handle {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: white;
  text-align: left;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.navigator-handle strong {
  font-size: 15px;
}
.navigator-handle > span:last-child {
  font-size: 11px;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 5px;
}
.navigator-top .drag-grip {
  margin: 0;
  font-size: 21px;
  line-height: 1;
  color: #91b2a3;
}
.navigator-collapse {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  background: #ffffff12;
  border: 0;
  border-radius: 12px;
  color: white;
}
.navigator.is-compact .navigator-collapse svg {
  transform: rotate(180deg);
}
.navigator.is-dragging .navigator-handle {
  cursor: grabbing;
}
.navigator.is-dragging {
  box-shadow: 0 20px 70px #10292360;
}
.navigator-map {
  height: 130px;
}
.navigator-card {
  height: 124px;
}
.navigator-next {
  height: 70px;
}
.navigator-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}
.navigator .drive-controls {
  padding: 0;
  gap: 4px;
  flex-shrink: 0;
}
.navigator .drive-controls button {
  min-height: 44px;
  padding: 8px 10px;
}
.navigator .drive-controls .back,
.navigator .drive-controls .forward {
  width: 30px;
}
.navigator-open {
  margin: 0;
  width: auto;
  min-width: 0;
  min-height: 44px;
  flex: 1;
  padding: 8px;
  font-size: 13px;
}
.navigator {
  display: grid;
  grid-template-columns: 1fr;
}
.navigator-top,
.navigator-map,
.navigator-card,
.navigator-next,
.navigator-progress,
.navigator-actions {
  grid-column: 1/-1;
  grid-row: auto;
}
.navigator.is-compact {
  width: 320px;
  grid-template-columns: 84px minmax(0, 1fr);
}
.navigator.is-compact .navigator-map {
  grid-column: 1;
  grid-row: 2;
  height: 100px;
}
.navigator.is-compact .navigator-map svg {
  width: 210px;
  max-width: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.navigator.is-compact .map-direction,
.navigator.is-compact .navigator-next {
  display: none;
}
.navigator.is-compact .navigator-card {
  grid-column: 2;
  grid-row: 2;
  height: 100px;
  padding: 10px 12px;
}
.navigator.is-compact .readable-sign {
  gap: 6px;
}
.navigator.is-compact .readable-sign small {
  font-size: 11px;
}
.navigator.is-compact .readable-sign strong {
  font-size: 16px;
  gap: 7px;
}
.navigator.is-compact .readable-sign .topic-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}
.navigator.is-compact .drive-controls .back,
.navigator.is-compact .drive-controls .forward {
  display: none;
}
.navigator.is-compact .play {
  font-size: 0;
  width: 44px;
  padding: 0;
}
.navigator.is-compact .play::before {
  content: '▶';
  font-size: 17px;
}
.navigator.is-compact .play[aria-pressed='true']::before {
  content: 'Ⅱ';
}
.navigator.is-compact .navigator-handle > span:last-child {
  display: none;
}
@media (max-width: 700px) {
  header {
    height: 56px;
    padding: 0 14px;
  }
  .brand {
    font-size: 19px;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  .scene {
    height: calc(100svh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0;
  }
  .journey-intro {
    top: 16px;
    left: 16px;
  }
  .journey-intro h1 {
    font-size: 21px;
    line-height: 1.2;
    margin-top: 7px;
    letter-spacing: -0.6px;
  }
  .journey-intro > span {
    font-size: 10px;
    letter-spacing: 1.5px;
  }
  .navigator,
  .navigator.is-compact {
    left: auto;
    right: 12px;
    bottom: 34px;
    width: min(360px, calc(100% - 24px));
    border-radius: 18px;
  }
  .navigator {
    grid-template-columns: 1fr;
  }
  .navigator-top {
    padding: 0 4px 0 6px;
  }
  .navigator-map {
    height: 100px;
    grid-column: 1/-1;
    grid-row: auto;
  }
  .navigator-map svg {
    width: 100%;
    position: static;
    transform: none;
    max-width: 100%;
  }
  .navigator-card {
    height: 102px;
    padding: 12px 16px;
    grid-column: 1/-1;
  }
  .navigator .readable-sign strong {
    font-size: 18px;
  }
  .navigator .readable-sign small {
    font-size: 11px;
  }
  .navigator-next {
    grid-column: 1/-1;
    height: 54px;
    padding: 7px 16px;
    border-top: 1px solid #e5ebe4;
  }
  .navigator-next strong {
    font-size: 13px;
  }
  .navigator-actions {
    padding: 8px 10px;
  }
  .navigator .drive-controls .back,
  .navigator .drive-controls .forward {
    display: none;
  }
  .navigator .drive-controls button {
    width: auto;
    font-size: 12px;
    padding: 8px 10px;
    min-height: 44px;
  }
  .navigator-open {
    width: auto;
    margin: 0;
    font-size: 13px;
    padding: 8px;
    min-height: 44px;
    grid-column: auto;
    grid-row: auto;
  }
  .navigator.is-compact {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .navigator.is-compact .navigator-map,
  .navigator.is-compact .navigator-card {
    height: 94px;
  }
  .navigator.is-compact .navigator-card {
    padding: 9px 11px;
  }
  .navigator.is-compact .readable-sign strong {
    font-size: 16px;
  }
  .navigator.is-compact .navigator-actions {
    padding: 7px 9px;
  }
  .navigator.is-compact .play {
    font-size: 0;
  }
  .journey-status {
    left: 14px;
    right: 14px;
    bottom: 8px;
    font-size: 11px;
  }
  footer {
    height: 40px;
    padding: 0 14px;
    font-size: 10px;
  }
  footer button {
    font-size: 10px;
  }
  .destination {
    top: 64px;
    max-height: calc(100svh - 80px);
    max-height: calc(100dvh - 80px);
    padding: 18px;
  }
  .route-stops {
    top: 64px;
    max-height: calc(100svh - 80px);
    overflow: auto;
  }
  dialog {
    max-height: calc(100svh - 32px);
    max-height: calc(100dvh - 32px);
    overflow: auto;
  }
}
@media (max-height: 520px) {
  header {
    height: 48px;
  }
  .scene {
    height: calc(100svh - 78px);
  }
  footer {
    height: 30px;
  }
  .journey-intro h1 {
    font-size: 19px;
  }
  .navigator {
    bottom: 28px;
  }
  .journey-intro {
    top: 10px;
  }
}

.navigator-topic-label {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.navigator.is-compact .drive-controls .play {
  width: 44px;
  padding: 0;
}
.navigator.is-compact .navigator-card,
.navigator.is-compact .navigator-map {
  height: 108px;
}

@media (max-width: 700px) {
  body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  }
  footer {
    height: calc(40px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
}
@media (max-height: 520px) and (max-width: 700px) {
  .scene {
    height: calc(100svh - 78px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  footer {
    height: calc(30px + env(safe-area-inset-bottom));
  }
}
.navigator-top {
  position: sticky;
  top: 0;
  z-index: 1;
}

@media (max-width: 700px) {
  .navigator.is-compact {
    width: min(330px, calc(100% - 24px));
    grid-template-columns: minmax(0, 1fr) 48px;
    border-radius: 16px;
  }
  .navigator.is-compact .navigator-map {
    display: none;
  }
  .navigator.is-compact .navigator-top {
    grid-column: 1/-1;
    grid-row: 1;
  }
  .navigator.is-compact .navigator-card {
    grid-column: 1;
    grid-row: 2;
    height: 90px;
    padding: 10px 12px;
  }
  .navigator.is-compact .readable-sign small {
    display: none;
  }
  .navigator.is-compact .readable-sign strong {
    font-size: 18px;
    line-height: 1.25;
    gap: 9px;
    align-items: center;
  }
  .navigator.is-compact .navigator-actions {
    grid-column: 2;
    grid-row: 2;
    padding: 1px 3px 1px 0;
    gap: 0;
    flex-direction: column;
  }
  .navigator.is-compact .navigator-open {
    font-size: 0;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #edf3ed;
    color: #173b30;
  }
  .navigator.is-compact .navigator-open::before {
    content: '↗';
    font-size: 26px;
  }
  .navigator.is-compact .navigator-progress {
    grid-column: 1/-1;
    grid-row: 3;
  }
  .navigator.is-compact .navigator-handle strong {
    font-size: 14px;
  }
  .navigator.is-compact .navigator-handle img {
    width: 21px;
    height: 21px;
  }
  .journey-status {
    font-size: 12px;
  }
}

.speed-button {
  border: 0;
  background: #ffffff12;
  color: white;
  border-radius: 10px;
  min-height: 44px;
  min-width: 66px;
  padding: 4px 8px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}
.speed-value {
  font-size: 19px;
  font-weight: 650;
  min-width: 22px;
}
.speed-button span {
  font-size: 10px;
}
.navigator-speed {
  position: absolute;
  z-index: 3;
  left: 7px;
  right: 7px;
  top: 48px;
  background: #fffdf8;
  border: 1px solid #d8e3da;
  border-radius: 12px;
  box-shadow: 0 8px 25px #10292330;
  padding: 8px 12px;
}
.navigator-speed[hidden] {
  display: none;
}
.navigator-speed label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}
.navigator-speed input {
  width: 100%;
  height: 36px;
  margin: 0;
  accent-color: #173b30;
  touch-action: pan-y;
  cursor: pointer;
}
.navigator-speed > div {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #52675b;
}
.navigator-handle {
  flex: 1;
}
.navigator-top .speed-button {
  margin-right: 4px;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .speed-button {
    min-width: 62px;
    padding: 4px 6px;
  }
  .speed-value {
    font-size: 18px;
  }
  .navigator-handle {
    gap: 5px;
  }
  .navigator.is-compact .navigator-handle strong {
    font-size: 13px;
  }
  .navigator-top .speed-button span {
    font-size: 9px;
  }
}

.navigator-speed {
  z-index: 15;
}

.night-toggle {
  flex: 0 0 40px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #ffffff12;
  color: #f7d78a;
  font-size: 22px;
  margin-right: 3px;
}
.night {
  --ink: #e4f4ed;
  --paper: #10212a;
  --line: #2c4650;
  background: #08131e;
}
.night header,
.night footer {
  background: #091822;
  color: #a7c4cb;
}
.night .brand {
  color: #e4f4ed;
}
.night .brand-caption {
  color: #9fc3cc;
}
.night .journey-intro {
  color: #e4f4ed;
  text-shadow: 0 0 18px #6ac8da55;
}
.night .navigator {
  background: #10232d;
  border-color: #356270;
  color: #e4f4ed;
  box-shadow: 0 12px 45px #0008;
}
.night .navigator-top {
  background: #0b2935;
}
.night .navigator .readable-sign {
  color: #e4f4ed;
}
.night .navigator .readable-sign small,
.night .navigator-next > span {
  color: #9dbfc7;
}
.night .navigator-next {
  border-color: #2b4650;
}
.night .navigator-progress {
  background: #1e3b47;
}
.night .navigator-progress > div {
  background: #6ed8e2;
}
.night .navigator .drive-controls button,
.night .navigator.is-compact .navigator-open {
  background: #1c3c49;
  color: #e4f4ed;
}
.night .navigator-open,
.night .resume {
  background: #226679;
  color: #fff;
}
.night .navigator-speed {
  background: #10232d;
  border-color: #356270;
  color: #e4f4ed;
}
.night .navigator-speed > div {
  color: #a7c4cb;
}
.night .navigator-speed input {
  accent-color: #72d8e2;
}
.night .navigator-map svg > rect:first-of-type {
  fill: #0c202e;
}
.night .map-road-base {
  stroke: #153b4a;
}
.night .map-road {
  stroke: #6dd3e2;
}
.night .navigator-map pattern path {
  stroke: #244651;
}
.night .map-direction {
  background: #10232ddd;
  color: #e4f4ed;
}
.night .destination,
.night dialog,
.night .route-stops {
  background: #10232d;
  color: #e4f4ed;
}
.night .question,
.night .connection-note {
  background: #18323e;
  color: #d8eeed;
}
.night .question:hover,
.night .question[aria-pressed='true'] {
  background: #22566a;
  color: #fff;
}
.night .panel-description,
.night .chosen {
  color: #a7c4cb;
}
@media (max-width: 700px) {
  .night-toggle {
    flex-basis: 36px;
    margin-right: 1px;
  }
  .navigator-handle {
    gap: 4px;
  }
  .navigator.is-compact .navigator-handle strong {
    font-size: 12px;
  }
}

body.night-theme {
  background: #08131e;
  color-scheme: dark;
}

.navigator-handle img,
.navigator.is-compact .navigator-handle img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .brand img {
    width: 36px;
    height: 36px;
  }
}

.radio {
  grid-column: 1/-1;
  min-width: 0;
  border-top: 1px solid #d8e3da;
  background: #edf3ed;
}
.radio-bar {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 5px 0 10px;
  gap: 4px;
}
.radio button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  min-height: 44px;
}
.radio-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  flex: 1;
  min-width: 0;
  padding: 0;
}
.radio-toggle > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.radio-toggle small {
  display: block;
  font-size: 9px;
  letter-spacing: 1px;
  color: #52675b;
}
.radio-title {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.radio-symbol {
  font-size: 24px;
  color: #bb450c;
}
.radio-toggle > span:last-child {
  font-size: 18px;
  transform: rotate(180deg);
}
.radio-toggle[aria-expanded='true'] > span:last-child {
  transform: none;
}
.radio .radio-play {
  flex: 0 0 44px;
  background: #173b30;
  color: white;
  font-size: 17px;
}
.radio-panel {
  padding: 4px 12px 8px;
}
.radio-panel[hidden] {
  display: none;
}
.radio-stations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 9px;
}
.radio-stations button {
  flex: 1;
  min-width: 0;
  padding: 6px;
  font-size: 13px;
  background: #fffdf8;
  border: 1px solid #d8e3da;
}
.radio-stations button span {
  display: block;
  font-size: 11px;
  line-height: 1.3;
}
.radio-stations button[aria-pressed='true'] {
  border-color: #bb450c;
  background: #fff0e4;
}
.radio-seek-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.radio-time {
  font-variant-numeric: tabular-nums;
}
.radio input {
  height: 32px;
  accent-color: #bb450c;
  margin: 0;
  cursor: pointer;
  touch-action: pan-y;
  min-width: 0;
}
#radio-seek {
  width: 100%;
}
.radio-volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.radio-volume-row input {
  flex: 1;
  width: 0;
}
.radio-off {
  flex: 0 0 44px;
  font-size: 21px;
}
.radio-message {
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
}
.radio-message:empty {
  display: none;
}
.night .radio {
  background: #0c202b;
  border-color: #2b4650;
}
.night .radio-toggle small {
  color: #a7c4cb;
}
.night .radio-symbol {
  color: #ffd08a;
}
.night .radio .radio-play {
  background: #226679;
}
.night .radio-stations button {
  background: #18323e;
  border-color: #356270;
}
.night .radio-stations button[aria-pressed='true'] {
  background: #22566a;
  border-color: #72d8e2;
}
.night .radio input {
  accent-color: #72d8e2;
}
@media (max-width: 700px) {
  .navigator.is-compact .radio {
    grid-row: 4;
  }
  .radio-bar {
    height: 44px;
  }
  .radio-title {
    font-size: 12px;
  }
}

.landscape-menu {
  position: absolute;
  z-index: 6;
  right: 80px; /* the HD button sits at its right */
  top: 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #ffffff80;
  border-radius: 22px;
  background: #fffdf9df;
  color: #173b30;
  box-shadow: 0 4px 20px #142d2920;
  font-size: 12px;
  backdrop-filter: blur(12px);
}
.landscape-menu > span:first-child {
  font-size: 20px;
}
.landscape-options {
  position: absolute;
  z-index: 22;
  top: 72px;
  right: 80px;
  width: 250px;
  background: #fffdf9f2;
  border: 1px solid #d8e3da;
  border-radius: 16px;
  padding: 7px;
  box-shadow: 0 12px 35px #10292340;
  backdrop-filter: blur(12px);
}
.landscape-options[hidden] {
  display: none;
}
.landscape-options button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
}
.landscape-options button:hover,
.landscape-options button[aria-pressed='true'] {
  background: #edf3ed;
}
.night .landscape-menu,
.night .landscape-options {
  background: #10232de8;
  color: #e4f4ed;
  border-color: #356270;
}
.night .landscape-options button {
  color: #e4f4ed;
}
.night .landscape-options button:hover,
.night .landscape-options button[aria-pressed='true'] {
  background: #22566a;
}
.hd-toggle {
  position: absolute;
  z-index: 6;
  right: 24px;
  top: 24px;
  min-width: 48px;
  min-height: 40px;
  border: 1px solid #ffffff80;
  border-radius: 22px;
  background: #fffdf9df;
  color: #173b30;
  box-shadow: 0 4px 20px #142d2920;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  backdrop-filter: blur(12px);
}
.hd-toggle[hidden] {
  display: none;
}
.hd-toggle[aria-pressed='true'] {
  background: #173b30;
  color: #fffdf9;
}
.night .hd-toggle {
  background: #10232de8;
  color: #e4f4ed;
  border-color: #356270;
}
.night .hd-toggle[aria-pressed='true'] {
  background: #e4f4ed;
  color: #10232d;
}
.debug-fps {
  position: absolute;
  z-index: 30;
  left: 8px;
  top: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #000a;
  color: #fff;
  font: 11px/1.3 ui-monospace, monospace;
  pointer-events: none;
}
@media (max-width: 700px) {
  .landscape-menu {
  .hd-toggle {
    right: 16px;
    top: 109px;
    min-height: 36px;
    min-width: 44px;
  }
    left: 16px;
    right: auto;
    top: 109px;
    font-size: 11px;
    padding: 5px 11px;
    min-height: 36px;
  }
  .landscape-options {
    left: 16px;
    right: auto;
    top: 153px;
    max-height: calc(100% - 164px);
    overflow: auto;
  }
}
@media (max-height: 520px) {
  .landscape-menu {
    left: auto;
    right: 66px;
    top: 12px;
  }
  .hd-toggle {
    right: 14px;
    top: 12px;
    min-height: 40px;
  }
  .landscape-options {
    left: auto;
    right: 66px;
    top: 58px;
    max-height: calc(100% - 70px);
  }
}

.language-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
}
.language-code::after {
  content: ' ▾';
  font-weight: 400;
}
/* The native select sits invisibly over the pill: the platform picker, keyboard and screen readers stay. */
.language-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}
.language-select:focus-within {
  outline: 2px solid #5bd8de;
  outline-offset: 2px;
}
@media (max-width: 700px) {
  header {
    gap: 6px;
    padding: 0 12px;
  }
  .brand {
    gap: 6px;
    font-size: 18px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  header > button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .language-select {
    min-height: 34px;
    padding: 0 9px;
  }
  .radio-stations {
    grid-template-columns: 1fr 1fr;
  }
  .radio-stations button {
    min-width: 0;
  }
  .radio-stations span {
    white-space: normal;
    line-height: 1.25;
  }
}

/* Until the reader starts there is no canvas (the scene loads on Start): the light text of the
   intro and the distance readout needs a dark backdrop, not the pale fallback. */
#jyoti-road:not([data-world]) .scene {
  background: linear-gradient(#0f2a31, #1f4a50 60%, #2c5f5d);
}

/* The start button (main.js): big, centred on the scene once the world is loaded, in the page language
   (uppercase follows <html lang>); the pulse is switched off by the reduced-motion rule above. */
.start-journey {
  position: absolute;
  z-index: 7; /* under the navigator (8), so its open radio panel is never covered */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 32px);
  min-height: 68px;
  padding: 14px 36px 14px 18px;
  border: 2px solid var(--paper);
  border-radius: 40px;
  background: #173b30;
  color: #fff;
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 10px 40px #0b1f1a66;
  animation: start-pulse 2.2s ease-out infinite;
}
.start-journey[hidden] {
  display: none;
}
.start-journey:hover {
  background: #1f4d3f;
}
.start-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding-left: 3px;
  border-radius: 50%;
  background: #fd5a01;
  font-size: 16px;
  letter-spacing: 0;
}
@keyframes start-pulse {
  0% {
    box-shadow:
      0 10px 40px #0b1f1a66,
      0 0 0 0 #fc713cb3;
  }
  70%,
  100% {
    box-shadow:
      0 10px 40px #0b1f1a66,
      0 0 0 28px #fc713c00;
  }
}
/* A narrow desktop or a phone on its side: the navigator takes the right 354 px, so the button centres
   on the rest of the scene instead of sitting under the navigator. */
@media (min-width: 701px) and (max-width: 1010px), (max-width: 700px) and (orientation: landscape) {
  .start-journey {
    left: calc((100% - 354px) / 2);
    max-width: calc(100% - 370px);
  }
}

/* Loading screen: the 3D logo (CSS turn about Y, glowing J, pulsing rays) and a bar that fills as the start-up
   textures and models are decoded. The road stays frozen behind it (main.js). */
.scene .loading {
  inset: 0;
  z-index: 40;
  transform: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--paper);
  color: #17372f;
  font-weight: 600;
  text-align: center;
}
.scene .loading[hidden] {
  display: none;
}
.scene .loading.failed {
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  border-radius: 14px;
}
/* v2.3 logo: a 3 s seamless animated WebP (alpha, ~170 KB); reduced-motion gets the still frame (<picture>). */
.loading-logo img {
  display: block;
  width: 128px;
  height: 128px;
}
.loading-bar {
  width: min(260px, 70vw);
  height: 6px;
  border-radius: 3px;
  background: #17372f22;
  overflow: hidden;
}
.loading-bar i {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: #fd5a01;
  transition: width 0.25s;
}
