:root {
  --green: #2f5d4a;
  --green-dark: #24493a;
  --paper: #f4eddc;
  --ink: #33291d;
  --muted: #7a6b54;
  --line: #e2d5bb;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
}

body {
  position: fixed;
  inset: 0;
  margin: 0;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  color: #fff;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  box-shadow: 0 2px 10px rgba(36, 73, 58, 0.25);
  z-index: 20;
}

.title-main {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.title-sub {
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.85;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 20px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-btn.active {
  color: var(--green);
  background: #fff;
}

#map-wrap {
  overscroll-behavior: none;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  background: #efe6cf;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1200px;
  height: 800px;
  transform-origin: 0 0;
}

#map-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

#route-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

#route-layer[hidden] {
  display: none;
}

#environment-name-labels {
  opacity: 0.94;
  transition: opacity 0.35s ease;
}

#map-wrap.intro-mode #environment-name-labels,
#map-wrap.overview-mode #environment-name-labels {
  opacity: 0;
}

#stage {
  z-index: 1;
}

#labels-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
}

.map-label {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 6px;
  border-radius: 7px;
  border: 1px solid rgba(178, 156, 116, 0.55);
  background: rgba(255, 253, 247, 0.92);
  color: #3c3226;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(51, 41, 29, 0.18);
  will-change: transform;
}

.map-label.selected {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

#markers-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.marker {
  position: absolute;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1.5px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1.5px 5px rgba(51, 41, 29, 0.30);
  will-change: transform;
}

.marker.selected {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 5px rgba(47, 93, 74, 0.35), 0 2px 7px rgba(51, 41, 29, 0.35);
}

.marker.dragging {
  opacity: 0.85;
  cursor: grabbing;
}

#route-legend {
  position: absolute;
  left: 12px;
  bottom: 18px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(178, 156, 116, 0.6);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.92);
  color: #7a6b54;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(51, 41, 29, 0.12);
}

#route-legend i {
  display: block;
  width: 20px;
  border-top: 2px dashed #c1502b;
}

#map-disclaimer {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  z-index: 7;
  padding: 0;
  color: #6f624d;
  background: transparent;
  font-size: 9.5px;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 253, 247, 0.95);
  pointer-events: none;
}

#map-hint {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(36, 73, 58, 0.78);
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}

#map-hint.hidden {
  opacity: 0;
}

.zoom-controls {
  position: absolute;
  right: 12px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zoom-controls button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.92);
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(51, 41, 29, 0.18);
}

#info-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 86px;
  z-index: 15;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.97);
  box-shadow: 0 10px 30px rgba(51, 41, 29, 0.22);
}

#info-card h2 {
  margin: 0 30px 4px 0;
  font-size: 20px;
}

.info-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

#info-desc {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.7;
  color: #4a4032;
}

.info-actions {
  display: flex;
  gap: 8px;
}

.primary-btn,
.ghost-btn {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  font-size: 14px;
}

.primary-btn {
  border: none;
  color: #fff;
  background: var(--green);
}

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--green);
  background: #fff;
}

.close-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  color: var(--muted);
  background: #f1ead8;
  font-size: 18px;
  line-height: 1;
}

#player {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 72px;
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fffdf7;
}

.round-play {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: none;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 20px;
}

.player-text {
  min-width: 0;
}

#player-name {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#player-status {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

#backdrop {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(30, 26, 20, 0.42);
}

#list-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: 62%;
  display: flex;
  flex-direction: column;
  border-radius: 20px 20px 0 0;
  background: #fffdf7;
  box-shadow: 0 -8px 30px rgba(51, 41, 29, 0.2);
  transform: translateY(105%);
  transition: transform 0.28s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

#list-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 10px auto 6px;
  border-radius: 999px;
  background: #d9ccb2;
}

.sheet-head {
  padding: 4px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.sheet-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-title {
  font-size: 16px;
  font-weight: 700;
}

.sheet-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.export-btn {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--green);
  background: #fff;
  font-size: 12px;
}

.list-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 20px;
  -webkit-overflow-scrolling: touch;
}

.list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border: none;
  border-bottom: 1px solid #f0e8d5;
  text-align: left;
  background: transparent;
}

.list-item.active {
  background: #f3ead2;
}

.li-num {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.li-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.li-main strong {
  font-size: 15px;
}

.li-main small {
  color: var(--muted);
  font-size: 12px;
}

.li-arrow {
  color: #c9b995;
  font-size: 22px;
}


/* ---------- v20: GPS / language / player ---------- */
.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
}

.title-main,
.title-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.lang-btn {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.auto-btn {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
}

.map-status {
  position: absolute;
  left: 12px;
  top: 14px;
  z-index: 8;
  pointer-events: none;
}

.gps-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(178, 156, 116, 0.6);
  border-radius: 999px;
  color: #4c6f5d;
  background: rgba(255, 253, 247, 0.94);
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(51, 41, 29, 0.12);
}

.gps-chip.warn {
  color: #a45420;
  border-color: rgba(196, 112, 54, 0.55);
  background: rgba(255, 245, 232, 0.96);
}

.map-tools {
  position: absolute;
  right: 12px;
  top: 52px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-tool {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.94);
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(51, 41, 29, 0.16);
}

.map-tool.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.next-chip {
  position: absolute;
  left: 50%;
  top: 52px;
  z-index: 9;
  transform: translateX(-50%);
  max-width: min(78vw, 420px);
  padding: 7px 13px;
  overflow: hidden;
  border: 1px solid rgba(178, 156, 116, 0.55);
  border-radius: 999px;
  color: #5c4a32;
  background: rgba(255, 253, 247, 0.95);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 2px 9px rgba(51, 41, 29, 0.15);
}

.toast {
  position: absolute;
  left: 50%;
  top: 96px;
  z-index: 18;
  transform: translateX(-50%);
  max-width: min(82vw, 460px);
  padding: 9px 14px;
  border-radius: 12px;
  color: #fff;
  background: rgba(36, 73, 58, 0.92);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 6px 20px rgba(36, 73, 58, 0.28);
  pointer-events: none;
}

.gps-dot {
  position: absolute;
  z-index: 12;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2577d9;
  box-shadow: 0 0 0 5px rgba(37, 119, 217, 0.22), 0 2px 7px rgba(27, 61, 104, 0.4);
  pointer-events: none;
  will-change: transform;
}

.gps-dot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(37, 119, 217, 0.38);
  border-radius: 50%;
  animation: gpsPulse 1.9s ease-out infinite;
}

@keyframes gpsPulse {
  0% { transform: scale(0.65); opacity: 0.9; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.player-text {
  flex: 1 1 auto;
  min-width: 0;
}

.player-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}

#player-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#player-time {
  flex: 0 0 auto;
  color: #9b8a6f;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

#info-card {
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.info-actions .primary-btn {
  flex: 1.35;
}

@media (max-width: 420px) {
  .topbar {
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .title-main {
    font-size: 16px;
  }

  .title-sub {
    font-size: 10.5px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .icon-btn {
    width: 34px;
    height: 36px;
    border-radius: 10px;
    font-size: 17px;
  }

  .lang-btn {
    font-size: 12px;
  }

  .auto-btn {
    font-size: 8px;
  }

  #map-hint {
    max-width: 62vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gps-chip {
    font-size: 10px;
    padding: 4px 8px;
  }

  .map-tools {
    top: 48px;
  }

  .map-tool {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .next-chip {
    top: 48px;
    max-width: 55vw;
    font-size: 11px;
  }

  .toast {
    top: 92px;
    font-size: 11px;
  }

  .zoom-controls button {
    width: 38px;
    height: 38px;
  }

  .info-actions {
    gap: 6px;
  }

  .primary-btn,
  .ghost-btn {
    height: 38px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gps-dot::after {
    animation: none;
  }
}


/* ---------- welcome / start ---------- */
.welcome-card {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 160px;
  z-index: 14;
  padding: 18px 18px 16px;
  border: 1px solid rgba(178, 156, 116, 0.55);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.97);
  box-shadow: 0 12px 34px rgba(51, 41, 29, 0.18);
}

.welcome-kicker {
  color: #9a7b45;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.welcome-card h2 {
  margin: 6px 0 7px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0.5px;
}

.welcome-card p {
  margin: 0;
  color: #5c5040;
  font-size: 13px;
  line-height: 1.65;
}

.welcome-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 14px;
}

.welcome-stats span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #5d735f;
  background: #eef3e9;
  font-size: 11px;
  font-weight: 600;
}

.welcome-actions {
  display: flex;
  gap: 8px;
}

.welcome-actions .primary-btn {
  flex: 1.4;
}

@media (max-width: 420px) {
  .welcome-card {
    left: 12px;
    right: 12px;
    bottom: 152px;
    padding: 15px 15px 13px;
  }

  .welcome-card h2 {
    font-size: 19px;
  }

  .welcome-card p {
    font-size: 12px;
  }
}

html[lang="en"] .title-main {
  font-size: 15px;
}

html[lang="ja"] .title-main,
html[lang="ko"] .title-main {
  font-size: 16px;
}

/* ============================================================
   v23 · 祥源旅行品牌化 / 导览页布局精简
   ============================================================ */
:root {
  --brand: #FE7C02;
  --brand-deep: #E96F00;
  --brand-soft: #FFF1E1;
  --brand-line: #F3D6B8;
  --navy: #2F3A66;
  --navy-dark: #232C50;
  --green: var(--navy);
  --green-dark: var(--navy-dark);
  --paper: #F7F2E7;
  --ink: #2D2A25;
  --muted: #83755F;
  --line: #E9DCC7;
}

html,
body {
  background: var(--paper);
}

body {
  color: var(--ink);
}

/* Brand header */
.topbar {
  position: relative;
  z-index: 40;
  display: block;
  flex: 0 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 14px 7px;
  color: var(--navy);
  background: rgba(255, 253, 247, 0.985);
  border-bottom: 1px solid rgba(233, 220, 199, 0.95);
  box-shadow: 0 4px 18px rgba(47, 58, 102, 0.09);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand) 0 48px, transparent 48px);
}

.topbar-brand-row,
.topbar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 25px;
  max-width: 118px;
  object-fit: contain;
}

.topbar-title-row {
  margin-top: 4px;
}

.topbar-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.title-main {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.45px;
  color: var(--navy);
}

.title-sub {
  margin: 0;
  font-size: 10.5px;
  font-weight: 500;
  color: #8C7E68;
  opacity: 1;
  white-space: nowrap;
}

.topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 34px;
  padding: 0;
  border: 1px solid #EADDC9;
  border-radius: 11px;
  color: var(--navy);
  background: #FFFFFF;
  font-size: 16px;
  box-shadow: 0 1px 3px rgba(47, 58, 102, 0.06);
}

.icon-btn.active {
  color: var(--brand-deep);
  border-color: #F4C28E;
  background: var(--brand-soft);
}

/* Language list */
.lang-wrap {
  position: relative;
}

.lang-btn {
  width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 700;
}

.lang-caret {
  font-size: 8px;
  line-height: 1;
  opacity: 0.58;
  transform: translateY(-1px);
}

.lang-btn[aria-expanded="true"] {
  color: #FFFFFF;
  border-color: var(--navy);
  background: var(--navy);
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: 184px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid #E9D9C1;
  border-radius: 14px;
  background: #FFFDF7;
  box-shadow: 0 16px 38px rgba(47, 58, 102, 0.22);
  animation: langMenuIn 0.18s ease both;
}

@keyframes langMenuIn {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 1px 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--navy);
  background: transparent;
  text-align: left;
}

.lang-native {
  grid-column: 1;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.lang-item small {
  grid-column: 1;
  color: #978871;
  font-size: 9.5px;
  line-height: 1.2;
}

.lang-check {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s, transform 0.15s;
}

.lang-item[aria-selected="true"] {
  background: var(--brand-soft);
}

.lang-item[aria-selected="true"] .lang-check {
  opacity: 1;
  transform: scale(1);
}

.lang-item:active {
  background: #FBE6CF;
}

.auto-btn {
  width: 53px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.auto-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C7BAA5;
  transition: background 0.2s, box-shadow 0.2s;
}

.auto-btn.active .auto-dot {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(254, 124, 2, 0.15);
}

.list-btn {
  position: relative;
}

.list-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 1.5px solid #FFFDF7;
  border-radius: 9px;
  color: #FFFFFF;
  background: var(--brand);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(254, 124, 2, 0.32);
}

.title-main,
.title-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Map canvas */
#map-wrap {
  background:
    radial-gradient(circle at 22% 8%, rgba(255, 253, 247, 0.92) 0%, rgba(247, 240, 225, 0.96) 42%, #EDE3CE 100%);
}

#stage {
  will-change: transform;
}

#map-wrap.intro-mode {
  cursor: default;
}

#labels-layer {
  opacity: 1;
  transition: opacity 0.55s ease;
}

#map-wrap.intro-mode #labels-layer {
  opacity: 0;
}

#markers-layer {
  opacity: 1;
  transition: opacity 0.45s ease;
}

#map-wrap.intro-mode #markers-layer {
  opacity: 0;
  pointer-events: none;
}

#map-wrap.map-transitioning #labels-layer {
  opacity: 0;
}

.map-brand {
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 6px;
  border: 1px solid rgba(226, 207, 180, 0.92);
  border-radius: 9px;
  background: rgba(255, 253, 247, 0.87);
  box-shadow: 0 2px 9px rgba(47, 58, 102, 0.10);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0.92;
  pointer-events: none;
}

.map-brand img {
  display: block;
  width: auto;
  height: 16px;
}

.map-brand span {
  color: var(--navy);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.map-status {
  left: 12px;
  top: 46px;
  z-index: 10;
}

.gps-chip {
  color: #55606F;
  border-color: rgba(226, 207, 180, 0.9);
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 2px 8px rgba(47, 58, 102, 0.08);
}

.gps-chip.warn {
  color: #B35513;
  border-color: rgba(254, 124, 2, 0.38);
  background: #FFF5E9;
}

.map-tools {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 11;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-tool {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #EADDC9;
  border-radius: 11px;
  color: var(--navy);
  background: rgba(255, 253, 247, 0.95);
  box-shadow: 0 2px 9px rgba(47, 58, 102, 0.12);
}

.map-tool svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-tool.active {
  color: #FFFFFF;
  border-color: var(--brand);
  background: var(--brand);
}

.map-tool:active {
  transform: scale(0.96);
}

.map-label {
  padding: 1.5px 5px;
  border: 1px solid rgba(226, 207, 180, 0.92);
  border-radius: 6px;
  color: #3E3D48;
  background: rgba(255, 253, 247, 0.95);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: 0 1px 4px rgba(47, 58, 102, 0.15);
}

.map-label.selected {
  z-index: 2;
  border-color: #FFFFFF;
  color: #FFFFFF;
  background: var(--brand);
  box-shadow: 0 2px 10px rgba(254, 124, 2, 0.38);
}

#labels-layer.compact .map-label {
  padding: 1px 3px;
  border-radius: 4px;
  font-size: 8.5px;
  line-height: 1.15;
  box-shadow: 0 1px 2px rgba(47, 58, 102, 0.14);
}

.marker {
  border-color: rgba(255, 253, 247, 0.96);
  box-shadow: 0 2px 8px rgba(47, 58, 102, 0.30);
}

.marker.selected {
  outline: 2px solid rgba(255, 253, 247, 0.96);
  box-shadow: 0 0 0 4px rgba(254, 124, 2, 0.34), 0 2px 8px rgba(47, 58, 102, 0.32);
}

#route-legend {
  left: 12px;
  bottom: 18px;
  padding: 5px 9px;
  border-color: rgba(226, 207, 180, 0.92);
  color: #786A56;
  background: rgba(255, 253, 247, 0.92);
  font-size: 10px;
  box-shadow: 0 2px 8px rgba(47, 58, 102, 0.09);
}

#route-legend i {
  width: 18px;
  border-top-color: var(--brand);
}

#map-disclaimer {
  color: #86775F;
  font-size: 9px;
}

#map-hint {
  left: 50%;
  top: auto;
  bottom: 52px;
  max-width: 62vw;
  overflow: hidden;
  padding: 7px 12px;
  color: #FFFFFF;
  background: rgba(47, 58, 102, 0.90);
  font-size: 11px;
  text-overflow: ellipsis;
  box-shadow: 0 5px 16px rgba(47, 58, 102, 0.20);
}

.toast {
  top: 72px;
  color: #FFFFFF;
  background: rgba(47, 58, 102, 0.94);
  box-shadow: 0 8px 22px rgba(47, 58, 102, 0.22);
  font-size: 11.5px;
}

/* Welcome / start card */
.welcome-card {
  left: 14px;
  right: 14px;
  bottom: 138px;
  padding: 15px 16px 13px;
  border: 1px solid #EADDC9;
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.985);
  box-shadow: 0 16px 36px rgba(47, 58, 102, 0.17);
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#map-wrap.intro-mode .welcome-card {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}

.welcome-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.welcome-brand img {
  display: block;
  width: auto;
  height: 18px;
}

.welcome-brand span {
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.welcome-kicker {
  color: var(--brand-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
}

.welcome-card h2 {
  margin: 4px 0 6px;
  color: var(--navy);
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0.4px;
}

.welcome-card p {
  margin: 0;
  color: #605747;
  font-size: 12.5px;
  line-height: 1.62;
}

.welcome-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}

.welcome-stats span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #8C4B10;
  background: var(--brand-soft);
  font-size: 10.5px;
  font-weight: 600;
}

.welcome-actions {
  display: block;
}

.welcome-actions .primary-btn {
  width: 100%;
  flex: none;
}

.welcome-note {
  margin: 8px 0 0 !important;
  color: #9A8A72 !important;
  font-size: 10.5px !important;
  line-height: 1.35 !important;
  text-align: center;
}

/* Buttons */
.primary-btn,
.ghost-btn {
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}

.primary-btn {
  border: none;
  color: #FFFFFF;
  background: linear-gradient(135deg, #FF8A17 0%, #F27100 100%);
  box-shadow: 0 6px 16px rgba(254, 124, 2, 0.25);
}

.primary-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(254, 124, 2, 0.22);
}

.ghost-btn {
  border: 1px solid #E4D6BF;
  color: var(--navy);
  background: #FFFFFF;
}

.close-btn {
  color: #847560;
  background: #F7EEDC;
}

/* Info card */
#info-card {
  border: 1px solid #EADDC9;
  background: rgba(255, 253, 247, 0.985);
  box-shadow: 0 14px 36px rgba(47, 58, 102, 0.18);
}

#info-card h2 {
  color: var(--navy);
}

.info-meta {
  color: #8C7D66;
}

#info-desc {
  color: #504B43;
}

.info-actions .ghost-btn {
  flex: 1;
}

/* Player */
#player {
  height: 70px;
  gap: 11px;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid #EADDC9;
  background: rgba(255, 253, 247, 0.99);
  box-shadow: 0 -6px 24px rgba(47, 58, 102, 0.07);
}

.round-play {
  width: 46px;
  height: 46px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #FF8A17 0%, #F27100 100%);
  box-shadow: 0 5px 14px rgba(254, 124, 2, 0.28);
}

.player-text {
  flex: 1 1 auto;
  min-width: 0;
}

#player-name {
  color: var(--navy);
  font-size: 14.5px;
}

#player-status {
  margin-top: 2px;
  color: #897A63;
  font-size: 11.5px;
}

#player-time {
  color: #A0917A;
  font-size: 10.5px;
}

.player-next {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #EADDC9;
  border-radius: 10px;
  color: var(--brand-deep);
  background: #FFFFFF;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.player-next b {
  margin-top: -1px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

/* List sheet */
#list-sheet {
  background: #FFFDF7;
}

.sheet-handle {
  background: #DCCDB5;
}

.sheet-head {
  border-bottom-color: #EADDC9;
}

.sheet-title {
  color: var(--navy);
}

.list-item {
  border-bottom-color: #F2E9D9;
}

.list-item.active {
  background: var(--brand-soft);
}

.li-main strong {
  color: var(--navy);
}

.li-main small {
  color: #8A7B64;
}

.li-arrow {
  color: #D0BC9C;
}

.export-btn {
  color: var(--navy);
  border-color: #E4D6BF;
}

/* Small screens */
@media (max-width: 420px) {
  .topbar {
    padding: calc(7px + env(safe-area-inset-top)) 12px 6px;
  }

  .topbar::after {
    left: 12px;
    right: 12px;
  }

  .brand-logo {
    height: 23px;
    max-width: 106px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .icon-btn {
    width: 34px;
    height: 33px;
    border-radius: 10px;
    font-size: 15px;
  }

  .lang-btn {
    width: 44px;
    font-size: 12px;
  }

  .auto-btn {
    width: 49px;
    font-size: 9px;
  }

  .list-badge {
    top: -5px;
    right: -4px;
  }

  .title-main {
    font-size: 14px;
  }

  .title-sub {
    font-size: 9.8px;
  }

  .map-tools {
    top: 10px;
    right: 10px;
  }

  .map-tool {
    width: 37px;
    height: 37px;
  }

  .map-brand {
    left: 10px;
    top: 10px;
  }

  .map-status {
    left: 10px;
    top: 46px;
  }

  #map-hint {
    bottom: 50px;
    max-width: 68vw;
    font-size: 10.5px;
  }

  .welcome-card {
    left: 12px;
    right: 12px;
    bottom: 132px;
    padding: 14px 14px 12px;
  }

  .welcome-card h2 {
    font-size: 19px;
  }

  .welcome-card p {
    font-size: 12px;
  }

  .toast {
    top: 68px;
    font-size: 11px;
  }

  .primary-btn,
  .ghost-btn {
    height: 40px;
    font-size: 13px;
  }

  #player {
    height: 68px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .round-play {
    width: 44px;
    height: 44px;
  }

  #player-name {
    font-size: 14px;
  }

  .player-next {
    height: 32px;
    padding: 0 7px;
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .brand-logo {
    height: 21px;
    max-width: 94px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .lang-btn {
    width: 41px;
  }

  .auto-btn {
    width: 46px;
    font-size: 8.5px;
  }

  .title-sub {
    display: none;
  }

  .player-next {
    padding: 0 6px;
  }
}

@media (max-width: 340px) {
  .auto-btn span:last-child {
    display: none;
  }

  .auto-btn {
    width: 34px;
  }
}

html[lang="en"] .title-main {
  font-size: 14px;
  letter-spacing: 0.1px;
}

html[lang="ja"] .title-main,
html[lang="ko"] .title-main {
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  #labels-layer,
  #markers-layer,
  .welcome-card,
  .lang-menu {
    transition: none !important;
    animation: none !important;
  }
}


/* v23.1 · compact start card + menu anchor */
.lang-menu {
  top: calc(100% + 36px);
}

.welcome-card {
  left: 12px;
  right: 12px;
  bottom: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 3px 12px;
  padding: 12px 14px 10px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(47, 58, 102, 0.16);
}

.welcome-main {
  min-width: 0;
}

.welcome-brand {
  margin-bottom: 5px;
}

.welcome-brand img {
  height: 16px;
}

.welcome-brand span {
  font-size: 9.5px;
  letter-spacing: 0.6px;
}

.welcome-card h2 {
  margin: 0 0 5px;
  font-size: 18px;
  line-height: 1.22;
  letter-spacing: 0.2px;
}

.welcome-stats {
  gap: 4px;
  margin: 0;
}

.welcome-stats span {
  padding: 3px 6px;
  font-size: 9.5px;
}

.welcome-cta {
  width: 112px;
  height: 46px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.16;
  white-space: normal;
}

.welcome-note {
  grid-column: 1 / -1;
  margin: 2px 0 0 !important;
  color: #A0937C !important;
  font-size: 9px !important;
  line-height: 1.3 !important;
  text-align: left;
}

#map-hint {
  bottom: 168px;
  z-index: 8;
}

@media (max-width: 420px) {
  .welcome-card {
    left: 10px;
    right: 10px;
    bottom: 50px;
    grid-template-columns: minmax(0, 1fr) 104px;
    padding: 11px 12px 9px;
    gap: 3px 9px;
  }

  .welcome-card h2 {
    font-size: 17px;
  }

  .welcome-cta {
    width: 104px;
    height: 44px;
    font-size: 12px;
  }

  #map-hint {
    bottom: 164px;
  }
}


/* v23.2 · compact language rows */
.lang-menu {
  width: 168px;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
}

.lang-native {
  font-size: 14px;
}

.lang-item small {
  display: none;
}


/* v24 · continue progress, garden story, playback speed */
.welcome-note.is-progress {
  color: var(--brand-deep) !important;
  font-weight: 700;
}

.info-lore {
  margin-top: 10px;
  padding: 9px 11px 10px;
  border: 1px solid #F3D8B2;
  border-radius: 12px;
  background: #FFF6E8;
}

.info-lore-label {
  margin-bottom: 3px;
  color: var(--brand-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

#info-lore-text {
  margin: 0;
  color: #66533D;
  font-size: 12.5px;
  line-height: 1.6;
}

#info-card {
  max-height: calc(100% - 150px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.player-loop {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 7px;
  border: 1px solid #EADDC9;
  border-radius: 9px;
  color: var(--navy);
  background: #FFFFFF;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.player-loop.active {
  border-color: transparent;
  color: #fff;
  background: var(--brand);
}

.player-rate {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #EADDC9;
  border-radius: 9px;
  color: var(--navy);
  background: #FFFFFF;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.li-check {
  width: 17px;
  flex: 0 0 auto;
  color: #4E8B5C;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.list-item.visited .li-main strong {
  color: #4E6B52;
}

@media (max-width: 420px) {
  .player-rate {
    height: 30px;
    padding: 0 6px;
    font-size: 10px;
  }
}

.map-pic {
  position: absolute;
  inset: 0;
  display: block;
}
#map-skeleton {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.5s ease;
}
#map-skeleton::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/webp;base64,UklGRv4BAABXRUJQVlA4IPIBAAAQEgCdASpgAEAAPrlSoUunJKMhqrYMeOAXCWUAx3HD+qISZaJtHdNAqJSbmUrnKiCHBNcAiJSeOUcOfHVnKzwvxwBWNXHmbA7jVaXy+jOGE+ilKDVkTbFt8fEwc3BA53B7EYk9E7gyzTOJOijVCkVri617En1jOokGFvKvnH0aVV7Wicz/kYWdaszmayJ6RbQfIcPo+qcgFYAA/voWmHfyG8uUzrhyf0l0uQ1UUNb6dVnIZA0ZccXB6LEsONaeQqQWgTVpVMHXNrkZ9ZjaB5MONfe78WYqSy6KVpRiwIZFiYsFCr5Tv+OAoG8HH0SDznfRq7yvzLZjBOIf1tHdcrRL44W0t/4gwRqNDTyBLoieylhOfy85KH69HZk1R3UCo8dxMX3OJxMLB1GX99ImzYosL6Ay6kweb7HGN97XXFiShx6NmR6C97xG1qm0aoIZOfPIrWksZGvgr57/Gr1OB32lYWnknvKEg0m5rc9WudPkG4y+CqO/K9Se4q8gaj5DzQpVIXx7sSf6xzqHu8ZGOks0OrVf0Em8wY5KcbG31YAHGAsllUzBjNbYYzu1J6yvjlgFnmPcYkcmZS5O6JMSr5GAQGYoV+wNRqS5JerKHZeM71Hle9veyNSC2FWC9QLK+wOPxSgVH4e2OsuM0gtKr98AAAA=");
  background-size: cover;
  background-position: center;
  filter: blur(3px) saturate(0.98);
  transform: scale(1.04);
}
#map-skeleton span {
  position: relative;
  z-index: 1;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: #7A6A52;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 6px 18px rgba(88, 70, 40, 0.12);
}
#map-wrap.map-ready #map-skeleton {
  opacity: 0;
  pointer-events: none;
}

#map-wrap:not(.map-ready) #route-layer,
#map-wrap:not(.map-ready) #markers-layer,
#map-wrap:not(.map-ready) #labels-layer {
  opacity: 0 !important;
  pointer-events: none;
}


@media (max-width: 380px) {
  #player {
    gap: 8px;
    padding-left: 12px;
    padding-right: 10px;
  }
  .player-loop,
  .player-rate {
    padding: 0 6px;
    font-size: 10px;
  }
  .player-next {
    padding: 0 7px;
    font-size: 10px;
  }
  #player-status {
    font-size: 11px;
  }
}

@media (max-width: 340px) {
  #player-status {
    display: none;
  }
}


#sim-panel {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 22;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: min(560px, calc(100% - 16px));
  padding: 6px 8px;
  border-radius: 14px;
  color: #FFF7E8;
  background: rgba(47, 58, 102, 0.9);
  box-shadow: 0 6px 18px rgba(34, 30, 20, 0.24);
  transform: translateX(-50%);
  font-size: 11px;
}
#sim-panel.hidden {
  display: none;
}
#sim-panel .sim-label {
  padding: 0 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #FFD9A8;
  white-space: nowrap;
}
#sim-panel button {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: none;
  border-radius: 999px;
  color: #2F3A66;
  background: #FFF7E8;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
#sim-panel #sim-auto,
#sim-panel #sim-walk,
#sim-panel #sim-issue,
#sim-panel #sim-export {
  font-size: 11px;
}
#sim-panel #sim-auto.active,
#sim-panel #sim-walk.active {
  color: #fff;
  background: #FE7C02;
}
#sim-panel #sim-speed {
  min-width: 32px;
  font-size: 10px;
}
#sim-panel #sim-issue,
#sim-panel #sim-export {
  min-width: 56px;
}
#sim-panel #sim-issue {
  color: #6f351d;
  background: #ffe1b8;
}
#sim-panel #sim-export {
  color: #fff;
  background: #2f6a55;
}
#sim-panel #sim-current {
  max-width: 132px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


#map-wrap.sim-mode .map-brand {
  display: none;
}
#map-wrap.sim-mode .map-status {
  top: 72px;
}


/* v25 · facilities: entrance / exit / restrooms */
#facilities-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.45s ease;
}

#markers-layer {
  z-index: 4;
  pointer-events: none;
}

#markers-layer .marker {
  pointer-events: auto;
}

#map-wrap.intro-mode #facilities-layer {
  opacity: 0;
  pointer-events: none;
}

#map-wrap:not(.map-ready) #facilities-layer {
  opacity: 0 !important;
  pointer-events: none;
}

#map-wrap.map-transitioning #facilities-layer {
  opacity: 0.55;
}

.facility {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

.facility-icon {
  width: 23px;
  height: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 253, 247, 0.98);
  border-radius: 8px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(47, 58, 102, 0.28);
}

.facility[data-type="entrance"] .facility-icon,
.facility[data-type="exit"] .facility-icon {
  background: #2d8b57;
}

.facility[data-type="toilet"] .facility-icon {
  border-radius: 50%;
  background: #2f73c9;
}

.facility-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.facility-label {
  padding: 1px 4px;
  border: 1px solid rgba(226, 207, 180, 0.88);
  border-radius: 5px;
  color: #786a56;
  background: rgba(255, 253, 247, 0.94);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(47, 58, 102, 0.12);
}

.facility[data-type="entrance"] .facility-label,
.facility[data-type="exit"] .facility-label {
  color: #1f6b43;
  border-color: rgba(85, 151, 105, 0.38);
}

.facility[data-type="toilet"] .facility-label {
  color: #235ca8;
  border-color: rgba(74, 123, 191, 0.32);
}

#map-wrap.overview-mode .facility[data-type="toilet"] .facility-label {
  display: none;
}

.facility:active .facility-icon {
  transform: scale(0.94);
}

.facility-legend {
  position: absolute;
  left: 12px;
  top: 82px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 76px);
  padding: 5px 9px;
  border: 1px solid rgba(226, 207, 180, 0.92);
  border-radius: 999px;
  color: #786a56;
  background: rgba(255, 253, 247, 0.93);
  font-size: 9.5px;
  box-shadow: 0 2px 8px rgba(47, 58, 102, 0.09);
}

.facility-legend-title {
  color: #9a8a72;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.facility-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.facility-mini {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #fff;
}

.facility-mini[data-type="entrance"],
.facility-mini[data-type="exit"] {
  background: #2d8b57;
}

.facility-mini[data-type="toilet"] {
  border-radius: 50%;
  background: #2f73c9;
}

.facility-mini svg {
  width: 9px;
  height: 9px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 420px) {
  .facility {
    gap: 1px;
  }

  .facility-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
  }

  .facility-icon svg {
    width: 13px;
    height: 13px;
  }

  .facility-label {
    font-size: 8px;
    padding: 1px 3px;
  }

  .facility-legend {
    left: 10px;
    top: 78px;
    gap: 6px;
    max-width: calc(100% - 62px);
    padding: 4px 7px;
    font-size: 9px;
  }
}

@media (max-width: 360px) {
  .facility-legend-title {
    display: none;
  }
}

/* v27 · route switcher + garden welcome intro */
.route-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid #e6d6bd;
  border-radius: 9px;
  background: #f7eedf;
}

.route-option {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 9px;
  border: 0;
  border-radius: 7px;
  color: #7c6c57;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.route-option small {
  color: #a18e73;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.route-option.active {
  color: var(--navy);
  background: #fffdf8;
  box-shadow: 0 2px 7px rgba(47, 58, 102, 0.12);
}

.route-option.active small {
  color: var(--brand-deep);
}

.route-option:active {
  transform: translateY(1px);
}

.route-option:focus-visible,
.welcome-audio:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.welcome-card {
  row-gap: 8px;
}

.welcome-route-row {
  grid-column: 1 / -1;
}

.welcome-route-row .route-switch {
  width: min(240px, 100%);
}

.welcome-main {
  grid-column: 1;
  grid-row: 2;
}

.welcome-cta {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
}

.welcome-body {
  margin: 0 0 7px !important;
  color: #6b604f !important;
  font-size: 11px !important;
  line-height: 1.43 !important;
}

.welcome-audio {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  overflow: hidden;
  padding: 6px 11px 7px;
  border: 1px solid #ead8bb;
  border-radius: 10px;
  color: var(--navy);
  background: linear-gradient(90deg, #fff7e8 0%, #fffdf8 100%);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.welcome-audio-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(254, 124, 2, 0.26);
}

.welcome-audio.playing .welcome-audio-icon {
  font-size: 9px;
  letter-spacing: -1px;
}

.welcome-audio-text {
  min-width: 0;
  display: block;
}

.welcome-audio-text strong,
.welcome-audio-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.welcome-audio-text strong {
  color: var(--navy);
  font-size: 12px;
  line-height: 1.25;
}

.welcome-audio-text small {
  margin-top: 2px;
  color: #96836a;
  font-size: 9.5px;
  line-height: 1.2;
}

#welcome-audio-time::before {
  content: " · ";
}

.welcome-audio-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(206, 178, 134, 0.2);
}

.welcome-audio-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
  transition: width 0.18s linear;
}

.route-switch-sheet {
  width: min(280px, 100%);
  margin: 10px 0 7px;
}

.route-switch-sheet .route-option {
  min-height: 32px;
  font-size: 12.5px;
}

.sheet-head .sheet-sub {
  margin-top: 0;
}

@media (max-width: 420px) {
  .welcome-card {
    row-gap: 7px;
    bottom: 48px;
  }

  .welcome-route-row .route-switch {
    width: min(220px, 100%);
  }

  .route-option {
    min-height: 32px;
    padding-inline: 7px;
  }

  .welcome-body {
    margin-bottom: 6px !important;
    font-size: 10.5px !important;
  }

  .welcome-audio {
    min-height: 42px;
    padding: 5px 9px 6px;
  }

  .welcome-audio-icon {
    width: 26px;
    height: 26px;
  }

  .welcome-audio-text strong {
    font-size: 11.5px;
  }
}

@media (max-width: 360px) {
  .welcome-card {
    left: 8px;
    right: 8px;
    padding: 9px 10px 8px;
    grid-template-columns: minmax(0, 1fr) 98px;
  }

  .welcome-cta {
    width: 98px;
    font-size: 11.5px;
  }

  .welcome-brand span,
  #stat-langs {
    display: none;
  }

  .welcome-audio {
    gap: 7px;
  }
}

@media (max-height: 620px) {
  .welcome-card {
    row-gap: 6px;
    padding-block: 9px;
  }

  .welcome-brand {
    display: none;
  }

  .welcome-card h2 {
    font-size: 16px;
  }

  .welcome-body {
    display: none;
  }

  .welcome-stats {
    margin-top: 2px;
  }
}
