/* ==========================================================================
   PUMA TAIPEI — 11/27 全市大車掃互動地圖
   Design tokens faithfully calibrated to https://puma.taipei/
   ========================================================================== */

:root {
  /* puma.taipei Official Palette */
  --brand-surface: #fff8f4;
  --brand-surface-warm: #f9ece4;
  --brand-white: #ffffff;
  --brand-primary: #db6a41;
  --brand-orange: #df7e2c;
  --brand-deep-orange: #db682a;
  --brand-action: #ad4d2a;
  --brand-action-hover: #963f24;
  --brand-peach: #e6b881;
  --brand-pink: #e18a81;
  --brand-yellow: #fcea8b;
  --brand-ink: #211d1d;
  --brand-ink-soft: #3a2a24;
  --brand-muted: #665b57;
  --brand-border: #efc5ad;
  --brand-border-subtle: rgba(219, 106, 65, 0.22);

  /* Official HEART 5-Pillar + Brand Primary 6-Leg Route Palette */
  --leg-1: #db6a41; /* Brand Terracotta - 中正萬華 */
  --leg-2: #21586c; /* HEART R Teal - 士林北投 */
  --leg-3: #0753a7; /* HEART A Cobalt - 中山大同 */
  --leg-4: #13744b; /* HEART T Emerald - 內湖南港 */
  --leg-5: #5d3188; /* HEART E Plum - 松山信義 */
  --leg-6: #b00201; /* HEART H Crimson - 大安終點 */

  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Space Grotesk", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --shadow-card: 0 18px 44px rgba(33, 29, 29, 0.08);
  --shadow-soft: 0 8px 24px rgba(33, 29, 29, 0.07);
  --shadow-action: 0 10px 22px rgba(33, 29, 29, 0.18);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--brand-surface);
  color: var(--brand-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--brand-surface);
  color: var(--brand-ink);
  line-height: 1.75;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font-family: inherit;
}

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

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.container {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
}

/* ==========================================================================
   Sticky Frosted-Glass Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--brand-border-subtle);
}

.header-inner {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.brand-badge {
  background: var(--brand-primary);
  color: var(--brand-white);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(219, 106, 65, 0.28);
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--brand-border);
}

.brand-subtitle {
  font-size: 0.98rem;
  font-weight: 900;
  color: var(--brand-ink);
  letter-spacing: 0.02em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-muted);
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-link:hover {
  color: var(--brand-primary);
  background: rgba(219, 106, 65, 0.09);
}

.btn-offset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--brand-white);
  color: var(--brand-ink);
  font-size: 0.88rem;
  font-weight: 900;
  border: 1.5px solid var(--brand-primary);
  box-shadow: 4px 4px 0 var(--brand-peach);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn-offset:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--brand-peach);
  background: var(--brand-surface);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--brand-action);
  color: var(--brand-white);
  font-weight: 900;
  font-size: 0.96rem;
  border: 1px solid rgba(219, 106, 65, 0.6);
  box-shadow: var(--shadow-action);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary:hover {
  background: var(--brand-action-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(33, 29, 29, 0.22);
}

.btn-primary.btn-sm {
  padding: 10px 18px;
  font-size: 0.88rem;
}

.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--brand-ink);
  color: var(--brand-white);
  font-weight: 900;
  font-size: 0.95rem;
  border: 1px solid var(--brand-ink);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.btn-dark svg {
  color: var(--brand-peach);
}

.btn-dark:hover {
  background: var(--brand-ink-soft);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 999px;
  background: transparent;
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 0.94rem;
  border: 1.5px solid var(--brand-primary);
  transition: background 0.18s ease, color 0.18s ease;
}

.btn-outline:hover {
  background: var(--brand-primary);
  color: var(--brand-white);
}

.btn-yellow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--brand-yellow);
  color: var(--brand-ink);
  font-weight: 900;
  font-size: 0.94rem;
  box-shadow: 0 8px 20px rgba(33, 29, 29, 0.18);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.btn-yellow:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

/* ==========================================================================
   Editorial Hero Section
   ========================================================================== */

.hero-section {
  position: relative;
  padding: 36px 0 32px;
  overflow: hidden;
  border-bottom: 1px solid var(--brand-border-subtle);
  background: linear-gradient(145deg, #fffaf6 0%, #fff3ea 60%, #fde9dc 100%);
}

.hero-stripe-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    radial-gradient(circle at 88% 18%, rgba(219, 106, 65, 0.18) 0%, transparent 42%),
    radial-gradient(circle at 12% 85%, rgba(230, 184, 129, 0.25) 0%, transparent 46%),
    repeating-linear-gradient(
      -28deg,
      rgba(219, 106, 65, 0.045) 0px,
      rgba(219, 106, 65, 0.045) 14px,
      transparent 14px,
      transparent 34px
    );
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.92fr);
  gap: 28px;
  align-items: center;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.eyebrow-pill {
  display: inline-block;
  background: var(--brand-yellow);
  color: var(--brand-ink);
  font-weight: 900;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(33, 29, 29, 0.12);
}

.eyebrow-tag {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--brand-action);
  letter-spacing: 0.03em;
}

.hero-title {
  margin: 0 0 14px;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.hero-slogan {
  display: block;
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  font-weight: 900;
  color: var(--brand-primary);
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}

.hero-main {
  display: block;
  font-size: clamp(1.9rem, 3.4vw, 2.85rem);
  font-weight: 900;
  color: var(--brand-ink);
}

.hero-lead {
  margin: 0 0 22px;
  font-size: 1rem;
  color: var(--brand-muted);
  max-width: 62ch;
}

.hero-lead strong {
  color: var(--brand-ink);
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Hero Stats Card */
.hero-stats-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px 22px 24px;
  position: relative;
  overflow: hidden;
}

.hero-stats-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-orange), var(--brand-yellow));
}

.stats-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--brand-ink);
  margin-bottom: 14px;
}

.stats-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(219, 106, 65, 0.2);
}

.stats-soon {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-action);
  background: var(--brand-surface-warm);
  padding: 2px 9px;
  border-radius: 999px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-item {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.stat-item--highlight {
  background: linear-gradient(135deg, #211d1d 0%, #3a2a24 100%);
  color: var(--brand-white);
  border-color: transparent;
}

.stat-value {
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brand-primary);
  margin-bottom: 4px;
}

.stat-item--highlight .stat-value {
  color: var(--brand-yellow);
}

.stat-label {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--brand-muted);
  font-weight: 500;
}

.stat-item--highlight .stat-label {
  color: rgba(255, 255, 255, 0.86);
}

.stat-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--brand-action);
  margin-top: 2px;
}

.stats-card-note {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--brand-muted);
}

.stats-card-note svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--brand-primary);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.section-header-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 18px;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--brand-primary);
  margin-bottom: 4px;
}

.section-title {
  margin: 0;
  font-size: clamp(1.38rem, 2.2vw, 1.85rem);
  font-weight: 900;
  line-height: 1.25;
  color: var(--brand-ink);
}

.section-desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--brand-muted);
  max-width: 54ch;
}

/* ==========================================================================
   Interactive Map Workbench (Split Command Center)
   ========================================================================== */

.map-section {
  padding: 36px 0 48px;
}

.mobile-view-tabs {
  display: none;
  margin-bottom: 12px;
  background: var(--brand-white);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: 4px;
}

.mobile-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--brand-muted);
  cursor: pointer;
}

.mobile-tab.active {
  background: var(--brand-primary);
  color: var(--brand-white);
}

.map-workbench {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  height: min(760px, calc(100vh - 116px));
  min-height: 600px;
  background: var(--brand-white);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Left Route Sidebar */
.route-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--brand-border-subtle);
  background: #fffdfb;
}

.sidebar-top {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--brand-border-subtle);
  background: var(--brand-white);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  color: var(--brand-primary);
  pointer-events: none;
}

#routeSearchInput {
  width: 100%;
  height: 44px;
  padding: 0 36px 0 40px;
  border-radius: 12px;
  border: 1.5px solid var(--brand-border);
  background: var(--brand-surface);
  color: var(--brand-ink);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

#routeSearchInput:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: var(--brand-white);
  box-shadow: 0 0 0 3px rgba(219, 106, 65, 0.16);
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(33, 29, 29, 0.08);
  color: var(--brand-ink);
  font-size: 0.78rem;
  cursor: pointer;
}

.search-meta {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-action);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.leg-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.leg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--brand-border-subtle);
  background: var(--brand-surface);
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.leg-chip:hover {
  border-color: var(--brand-primary);
  background: var(--brand-white);
}

.leg-chip.active {
  background: var(--brand-ink);
  color: var(--brand-white);
  border-color: var(--brand-ink);
}

.leg-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

/* Route Timeline Scrollable Area */
.route-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-border) transparent;
}

.route-timeline::-webkit-scrollbar {
  width: 6px;
}

.route-timeline::-webkit-scrollbar-thumb {
  background: var(--brand-border);
  border-radius: 999px;
}

/* Stop Node Card inside Timeline */
.timeline-stop {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--brand-white);
  border: 1.5px solid var(--brand-border-subtle);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  margin-bottom: 8px;
}

.timeline-stop:hover,
.timeline-stop.active {
  border-color: var(--brand-primary);
  box-shadow: 0 8px 20px rgba(219, 106, 65, 0.14);
  transform: translateY(-1px);
}

.timeline-stop-pin {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand-white);
  font-weight: 900;
  font-size: 0.86rem;
  box-shadow: 0 4px 10px rgba(33, 29, 29, 0.18);
  margin-top: 2px;
}

.timeline-stop-body {
  flex: 1;
  min-width: 0;
}

.timeline-stop-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.timeline-stop-tag {
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-surface-warm);
  color: var(--brand-action);
}

.timeline-stop-time {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.timeline-stop-name {
  font-size: 0.96rem;
  font-weight: 900;
  color: var(--brand-ink);
  line-height: 1.35;
}

.timeline-stop-addr {
  font-size: 0.79rem;
  color: var(--brand-muted);
  margin-top: 2px;
  line-height: 1.45;
}

/* Leg Accordion Block inside Timeline */
.timeline-leg {
  margin: 0 0 10px 15px;
  padding-left: 16px;
  border-left: 3px solid var(--leg-color, var(--brand-primary));
}

.timeline-leg-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--brand-border-subtle);
  background: var(--brand-surface);
  color: var(--brand-ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.timeline-leg-header:hover {
  background: var(--brand-white);
  border-color: var(--leg-color, var(--brand-primary));
}

.timeline-leg-title {
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.timeline-leg-meta {
  font-size: 0.74rem;
  color: var(--brand-muted);
  font-weight: 600;
  white-space: nowrap;
}

.timeline-leg-chevron {
  transition: transform 0.2s ease;
  color: var(--brand-muted);
}

.timeline-leg.open .timeline-leg-chevron {
  transform: rotate(180deg);
}

.timeline-turns {
  list-style: none;
  margin: 6px 0 4px;
  padding: 0;
  display: none;
}

.timeline-leg.open .timeline-turns {
  display: block;
}

.turn-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.84rem;
  transition: background 0.14s ease;
}

.turn-item:hover {
  background: rgba(219, 106, 65, 0.08);
}

.turn-item.active {
  background: rgba(219, 106, 65, 0.15);
  font-weight: 700;
}

.turn-item.match {
  background: rgba(252, 234, 139, 0.55);
}

.turn-seq {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-muted);
  min-width: 24px;
}

.turn-dir {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--brand-white);
  border: 1px solid var(--brand-border-subtle);
  color: var(--brand-action);
  white-space: nowrap;
}

.turn-dir--straight {
  color: var(--brand-muted);
}

.turn-street {
  font-weight: 700;
  color: var(--brand-ink);
  flex: 1;
}

mark.hl {
  background: var(--brand-yellow);
  color: var(--brand-ink);
  padding: 0 2px;
  border-radius: 3px;
}

.empty-search {
  text-align: center;
  padding: 36px 18px;
  color: var(--brand-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Right Map Stage & Floating Controls
   ========================================================================== */

.map-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  background: #f5efe9;
}

.leaflet-canvas {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Subtle warm editorial filter on default Taiwan e-Map tiles */
.leaflet-canvas.warm-basemap .leaflet-tile-pane {
  filter: saturate(48%) contrast(94%) brightness(1.04) sepia(12%);
}

.map-floating-top {
  position: absolute;
  top: 14px;
  left: 56px;
  z-index: 500;
  pointer-events: none;
}

.active-leg-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-soft);
  font-size: 0.83rem;
  font-weight: 900;
  color: var(--brand-ink);
  pointer-events: auto;
}

.active-leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-primary);
}

.map-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;
  display: flex;
  gap: 6px;
}

.map-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  color: var(--brand-ink);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: all 0.16s ease;
}

.map-tool-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.map-tool-btn.active {
  background: var(--brand-ink);
  color: var(--brand-white);
  border-color: var(--brand-ink);
}

/* Playback HUD */
.playback-hud {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(33, 29, 29, 0.93);
  backdrop-filter: blur(14px);
  color: var(--brand-white);
  box-shadow: 0 14px 36px rgba(33, 29, 29, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.play-toggle-btn {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--brand-primary);
  color: var(--brand-white);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(219, 106, 65, 0.45);
  transition: transform 0.15s ease, background 0.15s ease;
}

.play-toggle-btn:hover {
  background: var(--brand-orange);
  transform: scale(1.05);
}

.playback-info {
  flex: 1;
  min-width: 0;
}

.playback-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 0.82rem;
}

.playback-badge {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-yellow);
  color: var(--brand-ink);
}

.playback-street {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playback-time {
  margin-left: auto;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-peach);
  flex: 0 0 auto;
}

.playback-scrubber {
  width: 100%;
  height: 5px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  margin: 0;
}

.playback-controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--brand-white);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hud-mini-btn.active {
  background: var(--brand-peach);
  color: var(--brand-ink);
  border-color: var(--brand-peach);
}

/* Custom Leaflet Markers & Popups */
.custom-stop-marker {
  background: transparent;
  border: 0;
}

.stop-pin-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.stop-pin-core {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 13px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(33, 29, 29, 0.34);
  transition: transform 0.18s ease;
}

.stop-pin-wrap:hover .stop-pin-core,
.stop-pin-wrap.is-active .stop-pin-core {
  transform: scale(1.18);
}

.stop-pin-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px solid var(--pin-color, #db6a41);
  opacity: 0;
  pointer-events: none;
}

.stop-pin-wrap.is-active .stop-pin-pulse {
  animation: pinPulse 1.5s ease-out infinite;
}

@keyframes pinPulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(1.55); opacity: 0; }
}

.stop-time-tag {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-ink);
  color: var(--brand-yellow);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(33, 29, 29, 0.28);
  pointer-events: none;
}

.stop-time-tag--bottom {
  top: auto;
  bottom: -22px;
}

.stop-time-tag--left {
  top: 50%;
  left: auto;
  right: 42px;
  transform: translateY(-50%);
}

.stop-time-tag--right {
  top: 50%;
  left: 42px;
  transform: translateY(-50%);
}

/* Motorcade Simulation Vehicle Marker */
.motorcade-marker {
  background: transparent;
  border: 0;
}

.motorcade-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-yellow);
  border: 3.5px solid var(--brand-ink);
  box-shadow: 0 0 0 6px rgba(219, 106, 65, 0.36), 0 6px 18px rgba(33, 29, 29, 0.4);
  display: grid;
  place-items: center;
}

.motorcade-dot::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-action);
}

/* Turn Focus Beacon */
.turn-beacon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-yellow);
  border: 3px solid var(--brand-ink);
  box-shadow: 0 0 0 8px rgba(252, 234, 139, 0.55);
}

/* Arrowhead Marker on Polylines */
.route-arrow-icon {
  background: transparent;
  border: 0;
  pointer-events: none;
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  border-radius: 16px !important;
  box-shadow: 0 16px 38px rgba(33, 29, 29, 0.2) !important;
  border: 1px solid var(--brand-border) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 276px !important;
  font-family: var(--font-sans);
}

.map-popup {
  padding: 14px 16px 15px;
}

.map-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.map-popup-badge {
  font-size: 0.72rem;
  font-weight: 900;
  color: #fff;
  padding: 2px 9px;
  border-radius: 999px;
}

.map-popup-time {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.map-popup-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 900;
  color: var(--brand-ink);
  line-height: 1.35;
}

.map-popup-addr {
  margin: 0 0 8px;
  font-size: 0.81rem;
  color: var(--brand-muted);
  line-height: 1.45;
}

.map-popup-note {
  font-size: 0.77rem;
  background: var(--brand-surface);
  border-left: 3px solid var(--brand-primary);
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--brand-ink);
  margin-bottom: 10px;
}

.map-popup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brand-action);
  color: #fff !important;
  font-size: 0.8rem;
  font-weight: 800;
}

.map-popup-link:hover {
  background: var(--brand-action-hover);
}

/* ==========================================================================
   6 Soapbox Stops Showcase Grid
   ========================================================================== */

.stops-section {
  padding: 20px 0 54px;
}

.stops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.stop-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 244, 239, 0.96) 100%);
  border: 1px solid var(--brand-border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stop-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--card-accent, var(--brand-primary));
}

.stop-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--card-accent, var(--brand-primary));
}

.stop-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stop-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 900;
  color: #fff;
  background: var(--card-accent, var(--brand-primary));
  padding: 3px 11px;
  border-radius: 999px;
}

.stop-card-time {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-ink);
}

.stop-card-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 900;
  color: var(--brand-ink);
  line-height: 1.35;
}

.stop-card-address {
  margin: 0;
  font-size: 0.86rem;
  color: var(--brand-muted);
  line-height: 1.5;
}

.stop-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.meta-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-white);
  border: 1px solid var(--brand-border-subtle);
  color: var(--brand-ink);
}

.stop-card-actions {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  gap: 8px;
}

.stop-card-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid var(--brand-border);
  background: var(--brand-white);
  color: var(--brand-ink);
  transition: all 0.16s ease;
}

.stop-card-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.stop-card-btn--primary {
  background: var(--brand-ink);
  color: var(--brand-white);
  border-color: var(--brand-ink);
}

.stop-card-btn--primary:hover {
  background: var(--brand-action);
  border-color: var(--brand-action);
  color: var(--brand-white);
}

/* ==========================================================================
   Full Route Archive Card
   ========================================================================== */

.full-route-section {
  padding: 0 0 54px;
}

.editorial-card {
  background: var(--brand-white);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-card);
}

.editorial-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--brand-border-subtle);
}

.full-route-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.archive-leg-box {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border-subtle);
  border-left: 4px solid var(--leg-color, var(--brand-primary));
  border-radius: 14px;
  padding: 14px 16px;
}

.archive-leg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.archive-leg-name {
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--brand-ink);
}

.archive-leg-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-action);
}

.archive-leg-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.85;
  color: var(--brand-muted);
}

.archive-leg-text strong {
  color: var(--brand-ink);
}

/* ==========================================================================
   Event Background & Citizens' Night Bento
   ========================================================================== */

.event-info-section {
  padding: 0 0 64px;
}

.info-bento {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 20px;
}

.info-card {
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-card);
}

.info-card--night {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #211d1d 0%, #3d241b 55%, #8a3a1e 100%);
  color: var(--brand-white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 32px;
}

.info-card--night::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: var(--brand-yellow);
}

.info-card--night .info-eyebrow {
  display: inline-block;
  align-self: flex-start;
  background: var(--brand-yellow);
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.info-card--night h3 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.3;
}

.info-time-highlight {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-yellow);
}

.info-card--night p {
  margin: 0 0 18px;
  font-size: 0.94rem;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.9);
}

.info-card--guide {
  background: var(--brand-white);
  border: 1.5px solid var(--brand-border);
}

.info-card--guide .info-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--brand-primary);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.info-card--guide h3 {
  margin: 0 0 16px;
  font-size: 1.4rem;
  font-weight: 900;
}

.guide-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.guide-bullet {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--brand-surface-warm);
  color: var(--brand-action);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.guide-list > li > div > strong {
  display: block;
  font-size: 0.94rem;
  color: var(--brand-ink);
  margin-bottom: 2px;
}

.guide-list p strong {
  display: inline;
  font-weight: 800;
  color: var(--brand-ink);
}

.guide-list p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--brand-muted);
  line-height: 1.65;
}

.source-box {
  padding-top: 14px;
  border-top: 1px solid var(--brand-border-subtle);
  font-size: 0.8rem;
  color: var(--brand-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.source-box a {
  color: var(--brand-action);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Brand Footer (puma.taipei #e18a81 coral-pink)
   ========================================================================== */

.site-footer {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(219, 106, 65, 0.16)), var(--brand-pink);
  color: var(--brand-white);
  padding: 34px 0;
  border-top: 4px solid var(--brand-primary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.footer-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.footer-tagline {
  margin: 4px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0.95;
}

.footer-meta p {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.9;
  max-width: 56ch;
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  background: var(--brand-ink);
  color: var(--brand-yellow);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 14px 32px rgba(33, 29, 29, 0.34);
  opacity: 0;
  pointer-events: none;
  z-index: 2000;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .map-workbench {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .info-bento {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .header-nav {
    display: none;
  }

  .brand-divider, .brand-subtitle {
    font-size: 0.86rem;
  }

  .mobile-view-tabs {
    display: flex;
  }

  .map-workbench {
    grid-template-columns: 1fr;
    height: 76vh;
    min-height: 540px;
  }

  .map-workbench[data-mobile-view="map"] .route-sidebar {
    display: none;
  }

  .map-workbench[data-mobile-view="list"] .map-stage {
    display: none;
  }

  .full-route-columns {
    grid-template-columns: 1fr;
  }

  .map-floating-top {
    left: 12px;
    top: 60px;
  }

  .playback-hud {
    flex-wrap: wrap;
    gap: 8px;
  }

  .playback-controls-right {
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .container {
    width: calc(100% - 22px);
  }

  .hero-section {
    padding: 24px 0;
  }

  .desktop-br {
    display: none;
  }

  .btn-offset span {
    display: none;
  }

  .btn-offset::before {
    content: "官網";
  }

  .editorial-card,
  .info-card {
    padding: 20px 18px;
  }
}
