:root {
  --brand: #0b8f83;
  --brand-dark: #0a6f7f;
  --brand-grad: linear-gradient(135deg, #0b8f83 0%, #0d6f8b 100%);
  --brand-soft: #e6f6f3;
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --border: #e3eaec;
  --text: #16242b;
  --text-muted: #5e7078;
  --danger: #dc3545;
  --danger-soft: #fdecee;
  --warn: #d97706;
  --warn-soft: #fef6e6;
  --ok: #0b8f5e;
  --ok-soft: #e8f8f0;
  --shadow-sm: 0 2px 8px rgba(13, 45, 58, 0.06);
  --shadow-md: 0 8px 24px rgba(13, 45, 58, 0.12);
  --nav-h: 64px;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Segoe UI", Roboto, sans-serif;
  background: #e7eef0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.views-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 18px;
}

.view.active {
  display: flex;
}

.view-map.active {
  overflow: hidden;
  padding-bottom: 0;
}

/* Header */
.top-header {
  background: var(--brand-grad);
  color: #fff;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

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

.top-header h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.header-sub {
  font-size: 12px;
  opacity: 0.88;
  margin-top: 2px;
}

/* Search inputs & chips */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow-sm);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-dark {
  background: #17343f;
  color: #fff;
}

.btn-outline {
  background: var(--surface);
  color: var(--brand-dark);
  border: 1px solid #bfe3dc;
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.btn-warn {
  background: var(--warn-soft);
  color: #9a5104;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 10px;
}

.chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0;
  scrollbar-width: none;
}

.chips-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Map View */
.map-stage {
  position: relative;
  flex: 1;
  min-height: 44%;
}

#leaflet-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-overlay-top {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.map-overlay-top > * {
  pointer-events: auto;
}

.map-lock-banner {
  background: rgba(15, 42, 52, 0.94);
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
}

.map-fabs {
  position: absolute;
  right: 12px;
  bottom: 14px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--brand-dark);
  box-shadow: var(--shadow-md);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-sheet {
  height: 46%;
  background: var(--surface);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: 0 -6px 24px rgba(10, 35, 45, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 400;
  overflow: hidden;
  transition: height 0.2s ease;
}

.map-sheet.expanded {
  height: 68%;
}

.sheet-handle-bar {
  padding: 8px 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-pill {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: #cdd7db;
  margin: 0 auto 4px;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 16px;
}

/* Custom Leaflet Markers */
.stop-pin {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #334e5a;
  color: #fff;
  border: 2.5px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.stop-pin.selected {
  background: var(--brand);
  transform: scale(1.18);
  box-shadow: 0 0 0 4px rgba(11, 143, 131, 0.28);
}

.stop-pin.opposite {
  background: #b93844;
  opacity: 0.88;
}

.stop-pin.target-ok {
  background: #0b8f5e;
  width: 36px;
  height: 36px;
  font-size: 15px;
  box-shadow: 0 0 0 6px rgba(11, 143, 94, 0.28);
}

.user-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #fff;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.25);
}

/* Cards & Lists */
.section-pad {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
}

.card-guide {
  border: 2px solid var(--brand);
  background: linear-gradient(180deg, #effaf7 0%, #ffffff 42%);
}

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

.stop-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dir-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.opposite-badge {
  background: var(--danger-soft);
  color: #a71d2a;
}

.meta-line {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ETA Pills */
.eta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid #cfd8dc;
  color: #37474f;
  background: #fff;
  flex-shrink: 0;
}

.eta-pill.arriving {
  border-color: #e53935;
  color: #d32f2f;
  background: #fff5f5;
  animation: pulseEta 1.5s infinite;
}

.eta-pill.soon {
  border-color: #0b8f83;
  color: #0b8f83;
  background: #effaf8;
}

.eta-pill.eta {
  border-color: #90a4ae;
  color: #263238;
}

.eta-pill.not_departed,
.eta-pill.no_stop,
.eta-pill.last_passed,
.eta-pill.not_operating,
.eta-pill.unknown {
  border-color: #e0e5e7;
  color: #8a99a0;
  background: #f8fafa;
  font-weight: 500;
}

@keyframes pulseEta {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(229, 57, 53, 0); }
}

.route-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #eef3f4;
  cursor: pointer;
}

.route-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-dark);
  min-width: 58px;
}

/* Route Detail Timeline */
.dir-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  padding: 4px;
  border-radius: 12px;
  margin-top: 10px;
}

.dir-tab {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-tab.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid #edf2f4;
  position: relative;
}

.timeline-item.is-nearest {
  background: #edf9f6;
  border-radius: 12px;
  padding: 10px 8px;
  border-bottom: none;
  margin: 4px 0;
}

.bus-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #17343f;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  margin-top: 4px;
}

/* MRT badges */
.mrt-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 3px 7px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.system-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-top: 8px;
  scrollbar-width: none;
}

.system-tabs::-webkit-scrollbar { display: none; }

.system-tab {
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.system-tab.active {
  background: #fff;
  color: var(--brand-dark);
}

/* Food Cards & Modal */
.status-banner {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
}

.status-banner.verified {
  background: var(--ok-soft);
  color: #0b6b46;
  border: 1px solid #b8ead1;
}

.status-banner.warning {
  background: var(--warn-soft);
  color: #925207;
  border: 1px solid #f7d99c;
}

.status-banner.closed_risk {
  background: var(--danger-soft);
  color: #9b1c28;
  border: 1px solid #f5b8bf;
}

.dish-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
}

.dish-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.price-tag {
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 25, 32, 0.54);
  z-index: 1200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  background: var(--surface);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.25);
}

.modal-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-body {
  padding: 14px 16px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Bottom Navigation */
.bottom-nav {
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  flex-shrink: 0;
  z-index: 900;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.nav-btn .nav-ico {
  font-size: 19px;
  line-height: 1;
}

.nav-btn.active {
  color: var(--brand);
}

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 18px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 36, 44, 0.94);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 1500;
  display: none;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  display: block;
}

.skeleton {
  background: linear-gradient(90deg, #eef3f5 25%, #f7fafb 50%, #eef3f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 12px;
  height: 70px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Bus Sequence Number & Real-time Vehicle + Crowd Badge */
.seq-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  background: #8c969c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.timeline-item.is-nearest .seq-badge {
  background: var(--brand);
}

.bus-vehicle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2c6a98;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 9px;
  margin-top: 5px;
  margin-right: 5px;
  box-shadow: 0 2px 6px rgba(24, 70, 107, 0.18);
}

.crowd-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
}

.crowd-meter {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
}

.crowd-dot {
  width: 6px;
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
}

.crowd-comfortable .crowd-dot.on { background: #4ade80; }
.crowd-normal .crowd-dot.on { background: #fbbf24; }
.crowd-crowded .crowd-dot.on { background: #f87171; }

.crowd-text-comfortable { color: #86efac; }
.crowd-text-normal { color: #fde68a; }
.crowd-text-crowded { color: #fca5a5; }

/* Segmented Mode Switch in Bus Header */
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  background: rgba(255, 255, 255, 0.16);
  padding: 4px;
  border-radius: 12px;
  margin-top: 9px;
}

.mode-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.mode-btn.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

/* Direct Point-to-Point Planner */
.trip-planner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggest-wrap {
  position: relative;
}

.suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  z-index: 650;
  display: none;
}

.suggest-list.open {
  display: block;
}

.suggest-item {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f4f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.suggest-item:last-child {
  border-bottom: none;
}

.suggest-item:hover {
  background: var(--brand-soft);
}

.pole-direct-card {
  background: var(--surface);
  border: 1.5px solid #bfe3dc;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}

.pole-direct-head {
  background: linear-gradient(135deg, #effaf7 0%, #f7fbfc 100%);
  padding: 11px 13px;
  border-bottom: 1px solid #dfefec;
}

.pole-direct-body {
  padding: 2px 13px 10px;
}

.eta-pill.not_departed {
  border-color: #f0ad4e;
  color: #b56607;
  background: #fff8eb;
  font-weight: 600;
}

/* Food: dining-scenario mode chips */
.food-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.food-mode-chip {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 4px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.food-mode-chip.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.food-mode-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Settings: free-quota meters */
.usage-row {
  margin: 8px 0;
}

.usage-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.usage-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 4px;
}

.usage-bar > span {
  display: block;
  height: 100%;
  background: var(--ok);
}

.usage-bar.is-high > span {
  background: var(--warn);
}

.usage-bar.is-full > span {
  background: var(--danger);
}

/* Food: new-shop discovery */
.food-new-shops-bar {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid #bfe3dc;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.new-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
}

.nav-btn {
  position: relative;
}

.nav-dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}

.new-shop-section-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.new-shop-area-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.new-shop-add {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.new-shop-add input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 14px;
}

/* Food: place cards */
.food-card {
  margin-bottom: 10px;
}

.food-card.is-mismatch {
  opacity: 0.88;
}

.food-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.food-card-name {
  font-weight: 800;
  font-size: 15.5px;
}

.open-badge {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef2f4;
  color: var(--text-muted);
}

.open-badge.is-open {
  background: var(--ok-soft);
  color: #0b6b46;
}

.open-badge.is-closing {
  background: var(--warn-soft);
  color: #925207;
}

.open-badge.is-closed {
  background: #eef2f4;
  color: var(--text-muted);
}

.food-facts {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--text);
}

.food-dot {
  color: var(--text-muted);
}

.food-fact {
  white-space: nowrap;
}

.food-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.food-tag {
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  padding: 2px 7px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.food-tag.is-reason {
  background: var(--warn-soft);
  color: #925207;
}

.food-dishes {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.food-dishes .dish-price {
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 12px;
}

.closure-warning {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #925207;
  background: var(--warn-soft);
  border-radius: 8px;
  padding: 5px 8px;
}

.closure-warning.is-closed {
  color: #9b1c28;
  background: var(--danger-soft);
}

.closure-evidence {
  border: 1px solid #f7d99c;
  background: var(--warn-soft);
  color: #7a4405;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.closure-evidence.is-closed {
  border-color: #f5b8bf;
  background: var(--danger-soft);
  color: #7a1520;
}

.closure-evidence.is-superseded {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
}

.closure-evidence-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.closure-evidence-item {
  padding: 4px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.closure-evidence-when {
  font-weight: 700;
  margin-right: 4px;
}

.closure-evidence-note {
  margin-top: 4px;
  font-size: 11.5px;
  opacity: 0.8;
}

.food-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.food-others-toggle {
  width: 100%;
  margin: 4px 0 10px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}

.food-others {
  display: none;
}

.food-others.is-open {
  display: block;
}

/* Food search: loading / empty / error notices */
.food-loading {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.food-source-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 2px 2px 8px;
}

.food-notice {
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface);
}

.food-notice.error {
  background: var(--danger-soft);
  border-color: #f5b8bf;
  color: #9b1c28;
}

.food-notice-title {
  font-weight: 800;
  font-size: 15px;
}

.food-notice-detail {
  font-size: 13px;
  margin-top: 4px;
  color: inherit;
  opacity: 0.85;
}

.food-notice-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Multi-modal Plan Cards */
.plan-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.plan-card.is-best {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.plan-card-head {
  padding: 12px 14px;
  background: linear-gradient(135deg, #f3fbf9 0%, #ffffff 100%);
  border-bottom: 1px solid #e6f1ef;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.plan-eta-box {
  text-align: right;
  flex-shrink: 0;
}

.plan-total-min {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-dark);
  line-height: 1.1;
}

.plan-arrive-at {
  font-size: 12px;
  font-weight: 700;
  color: var(--ok);
  margin-top: 2px;
}

.plan-legs {
  padding: 10px 14px 12px;
  display: none;
  flex-direction: column;
  gap: 10px;
}

/* Collapsible plan cards: header is the toggle, body only shows when open */
.plan-card.is-open .plan-legs {
  display: flex;
}

.plan-card-head.js-plan-toggle {
  cursor: pointer;
  user-select: none;
}

.plan-card:not(.is-open) .plan-card-head {
  border-bottom: none;
}

.plan-card-head:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.plan-head-main {
  min-width: 0;
  flex: 1;
}

.plan-head-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15.5px;
}

.plan-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 700;
}

.plan-strip .mrt-code-badge {
  min-width: 28px;
  padding: 1px 6px;
  font-size: 12px;
}

.strip-walk {
  color: var(--text-muted);
  font-weight: 600;
}

.strip-bus {
  color: var(--brand-dark);
}

.strip-sep {
  color: var(--text-muted);
  font-weight: 400;
}

.plan-chevron {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
  transition: transform 0.15s ease;
}

.plan-card.is-open .plan-chevron {
  transform: rotate(180deg);
}

.plan-summary-line {
  font-size: 13px;
  color: var(--text-muted);
}

.plan-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.plan-results-actions {
  display: flex;
  gap: 6px;
}

.plan-route-list .route-extra {
  display: none;
}

.plan-route-list.show-all .route-extra {
  display: flex;
}

.plan-more-routes {
  width: 100%;
  margin: 4px 0 6px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.plan-best-route-tag {
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  background: var(--ok);
  border-radius: 999px;
  padding: 1px 7px;
}

.plan-leg-walk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 7px 10px;
  border-radius: 10px;
}

.plan-leg-mrt {
  border: 1px solid #d7e7ea;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f9fcfd;
}

.plan-leg-bus {
  border: 1px solid #cde8e2;
  border-radius: 12px;
  padding: 10px 12px 4px;
  background: #ffffff;
}

.mrt-seg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 13.5px;
}
