:root {
    --ui-font-base: 15px;
    --ui-font-small: 13px;
    --ui-font-xs: 12px;
    --ui-font-xxs: 11px;
    --sidebar-gap: 12px;
    --sidebar-width-desktop: 470px;
    --sidebar-width-medium: 420px;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: var(--ui-font-base); overflow: hidden; height: 100%; width: 100%; }
  #map { width: 100%; height: 100%; }
  .maplibregl-marker { transform-origin: center center; }

  /* ── Sidebar ── */
  #sidebar {
    position: absolute; top: 12px; right: 12px; width: var(--sidebar-width-desktop); max-height: calc(100vh - 24px);
    background: rgba(255,255,255,0.97); border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    overflow-y: auto; overflow-x: hidden; font-size: var(--ui-font-small); z-index: 200;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
  #sidebar.collapsed { width: auto; }
  #sidebar.collapsed .sidebar-content { display: none; }
  #sidebar-header {
    padding: 12px 16px; font-weight: 700; font-size: 16px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    border-bottom: 1px solid #eee; user-select: none; position: sticky; top: 0;
    background: rgba(255,255,255,0.97); z-index: 1;
  }
  .sidebar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .sidebar-tools { display: flex; align-items: center; gap: 8px; }
  #stays-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 6px; border: 1px solid #ddd;
    background: #f8f8f8; color: #888; cursor: pointer; padding: 0; flex-shrink: 0;
  }
  #stays-toggle .mi { font-size: 18px; }
  #stays-toggle:hover { background: #eee; color: #555; }
  #stays-toggle.active { background: #2563eb; border-color: #2563eb; color: #fff; }

  #locate-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 6px; border: 1px solid #ddd;
    background: #f8f8f8; color: #888; cursor: pointer; padding: 0; flex-shrink: 0;
  }
  #locate-toggle .mi { font-size: 18px; }
  #locate-toggle:hover { background: #eee; color: #555; }
  #itinerary-link {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 6px; border: 1px solid #ddd;
    background: #f8f8f8; color: #888; padding: 0; flex-shrink: 0; text-decoration: none;
  }
  #itinerary-link .mi { font-size: 18px; }
  #itinerary-link:hover { background: #eee; color: #555; }
  #locate-toggle.active { background: #2563eb; border-color: #2563eb; color: #fff; }
  #locate-toggle.tracking-error { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }

  .user-location-marker {
    position: relative; width: 18px; height: 18px;
    pointer-events: none;
  }
  .user-location-dot {
    position: absolute; left: 0; top: 0; width: 18px; height: 18px;
    border-radius: 50%; background: #2563eb;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    z-index: 2;
  }
  .user-location-arrow {
    position: absolute; left: 50%; top: 50%;
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 14px solid #2563eb;
    transform-origin: 50% 100%;
    transform: translate(-50%, -100%) rotate(var(--heading, 0deg));
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
  }
  .user-location-arrow.hidden { display: none; }
  .user-location-pulse {
    position: absolute; left: -11px; top: -11px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(37, 99, 235, 0.4);
    animation: locate-pulse 2s ease-out infinite;
    z-index: 0;
  }
  @keyframes locate-pulse {
    0%   { transform: scale(0.4); opacity: 0.7; }
    100% { transform: scale(1.4); opacity: 0;   }
  }
  #sidebar-mode {
    font-size: 12px; padding: 4px 6px; border: 1px solid #ddd; border-radius: 6px;
    background: #f8f8f8; color: #444; cursor: pointer; font-weight: 500;
  }
  #sort-select {
    font-size: var(--ui-xxs, 11px); padding: 4px 6px; border: 1px solid #ddd; border-radius: 6px;
    background: #f8f8f8; color: #555; cursor: pointer; font-weight: 400;
  }
  .sidebar-content { padding: 14px 0 20px 0; overflow: hidden; }
  .section-label {
    padding: 12px 22px 8px; font-weight: 700; color: #888; font-size: var(--ui-font-xxs);
    text-transform: uppercase; letter-spacing: 0.6px;
  }

  /* ── Pin rows ── */
  .pin-item {
    padding: 12px 18px; cursor: pointer; display: flex; align-items: flex-start; gap: 12px;
    transition: background 0.12s; border-radius: 10px; margin: 0 10px;
  }
  .pin-item:hover, .pin-item.active { background: #f0f4ff; }
  .pin-badge {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; color: #fff;
  }
  .pin-badge img { width: 100%; height: 100%; }
  .pin-badge-sub {
    position: absolute; bottom: -2px; right: -2px; width: 14px !important; height: 14px !important;
    border-radius: 50%; background: #fff; border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  }
  .pin-info { flex: 1; min-width: 0; }
  .pin-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pin-tagline { font-size: var(--ui-font-xs); color: #777; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pin-meta { display: flex; align-items: center; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
  .pin-rating { font-size: var(--ui-font-xxs); color: #e67e22; background: #fef9e7; padding: 2px 6px; border-radius: 999px; font-weight: 700; }
  .rating-val { font-size: var(--ui-font-xs); color: #888; }
  .service-icons { font-size: 14px; letter-spacing: 1px; }
  .pin-distance { font-size: var(--ui-font-xxs); color: #1565c0; background: #e3f2fd; padding: 2px 6px; border-radius: 999px; font-weight: 700; }
  .pin-bookable { font-size: 10px; color: #2e7d32; background: #e8f5e9; padding: 2px 6px; border-radius: 999px; font-weight: 700; }
  .pin-website { font-size: 10px; color: #6a1b9a; background: #f3e5f5; padding: 2px 6px; border-radius: 999px; font-weight: 700; }

  /* ── Route / Isochrone rows ── */
  .iso-item { padding: 8px 16px; color: #555; font-size: 13px; }

  /* ── Itinerary ── */
  .itinerary { padding: 10px 16px 6px; }
  .itin-station { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
  .itin-dot {
    width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid currentColor;
    background: #fff; flex-shrink: 0;
  }
  .itin-name { font-weight: 700; font-size: 14px; }
  .itin-connector {
    display: flex; align-items: stretch; gap: 8px; padding: 2px 0;
  }
  .itin-line-wrap {
    display: flex; flex-direction: column; align-items: center;
    width: 12px; flex-shrink: 0; padding: 0;
  }
  .itin-line { flex: 1; width: 2px; background: #ddd; margin: 0 auto; }
  .itin-leg-info {
    font-size: 12px; color: #888; padding: 4px 0;
    display: flex; gap: 6px; align-items: center;
  }
  .itin-leg-info b { color: #555; font-weight: 600; }
  .trip-card {
    margin: 0 10px 10px; padding: 12px 12px 10px; border-radius: 12px; border: 1px solid #eceff3;
    background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .trip-card-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px;
  }
  .trip-card-title { font-size: 14px; font-weight: 700; color: #1f2933; }
  .trip-card-sub { font-size: 12px; color: #6b7280; margin-top: 2px; line-height: 1.35; }
  .trip-card-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
  .trip-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px;
    background: #eef3ff; color: #294c9b; font-size: 11px; font-weight: 700;
  }
  .trip-chip.low { background: #fdecea; color: #c0392b; }
  .trip-chip.medium { background: #fff7e5; color: #a06400; }
  .trip-chip.high { background: #e8f5e9; color: #2e7d32; }
  .trip-card-summary { font-size: 13px; color: #344054; line-height: 1.5; }
  .trip-card-fallback { margin-top: 8px; font-size: 12px; color: #6b7280; }
  .trip-route-block { margin: 0 10px 12px; padding: 12px; border-radius: 12px; background: #f7f9fc; border: 1px solid #ebeff5; }
  .trip-route-block.trip-route-walking { background: #f5f3ff; border-color: #ddd6fe; }
  .trip-route-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
  .trip-route-title { font-size: 14px; font-weight: 700; color: #1f2933; }
  .trip-route-walking .trip-route-title { color: #7c3aed; }
  .trip-route-total { font-size: 12px; color: #59636f; font-weight: 600; }
  .trip-overview-card {
    margin: 0 10px 12px; padding: 12px; border-radius: 12px; background: #fffdf6; border: 1px solid #f0e6c9;
  }
  .trip-overview-title { font-size: 14px; font-weight: 700; color: #5d4920; margin-bottom: 6px; }
  .trip-overview-text { font-size: 13px; color: #5c523b; line-height: 1.5; }
  .route-items-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .route-stop-block {
    margin: 0 14px; padding: 16px 16px 15px; border-radius: 16px; border: 1px solid #e8edf4;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03); min-width: 0; overflow: hidden;
  }
  .route-stop-block.compact {
    padding: 10px 16px 9px; background: transparent; border: 0; box-shadow: none;
  }
  .route-stop-block.overnight { border-color: #d7e6ff; box-shadow: 0 3px 14px rgba(43,108,176,0.08); }
  .route-stop-block.ferry { border-color: #d8ecf7; background: linear-gradient(180deg, #fbfeff 0%, #f4fbff 100%); }
  .route-stop-block.home { border-color: #e9e2c4; background: linear-gradient(180deg, #fffef9 0%, #fffaf0 100%); }
  .route-stop-block.compact .route-stop-kicker { margin-bottom: 2px; }
  .route-stop-block.compact .route-stop-title { font-size: 14px; font-weight: 700; }
  .route-stop-block.compact .route-stop-sub { margin-top: 1px; color: #7b8794; }
  .route-stop-head { display: flex; gap: 10px; align-items: flex-start; }
  .route-stop-rail { width: 20px; display: flex; justify-content: center; flex-shrink: 0; }
  .route-stop-dot {
    width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: #2b6cb0; flex-shrink: 0;
    box-shadow: 0 0 0 4px #e8f1ff;
  }
  .route-stop-dot.overnight { background: #1f7a44; box-shadow: 0 0 0 4px #e8f7ee; }
  .route-stop-dot.ferry { background: #0f6c8c; box-shadow: 0 0 0 4px #e6f5fa; }
  .route-stop-dot.home { background: #8b6b14; box-shadow: 0 0 0 4px #faf1d6; }
  .route-stop-main { min-width: 0; flex: 1; }
  .route-stop-kicker {
    font-size: 10px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase; color: #8a94a3; margin-bottom: 4px;
  }
  .route-stop-title { font-size: 15px; font-weight: 800; color: #1f2933; }
  .route-stop-sub { font-size: 12px; color: #667085; margin-top: 3px; line-height: 1.4; }
  .route-stop-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .route-stop-chip {
    display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 700; background: #eef3ff; color: #294c9b;
  }
  .route-stop-chip.booking { background: #ecfdf3; color: #1f7a44; }
  .route-stop-summary { font-size: 13px; color: #475467; line-height: 1.65; margin: 12px 14px 12px 24px; }
  .route-stop-primary { margin-top: 8px; }
  .route-stop-secondary-label {
    font-size: 10px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase; color: #8a94a3; margin: 14px 14px 7px 24px;
  }
  .route-stop-secondary-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .route-stop-collapsible { margin-top: 10px; }
  .route-stop-collapsible > summary.route-stop-secondary-label {
    cursor: pointer; list-style: none; user-select: none; margin-bottom: 0;
  }
  .route-stop-collapsible > summary.route-stop-secondary-label::-webkit-details-marker { display: none; }
  .route-stop-collapsible > summary.route-stop-secondary-label::before {
    content: '\25B8'; display: inline-block; margin-right: 4px; transition: transform 0.15s;
  }
  .route-stop-collapsible[open] > summary.route-stop-secondary-label::before {
    transform: rotate(90deg);
  }
  .route-stop-collapsible[open] > .route-stop-secondary-list { margin-top: 7px; }
  .route-stop-empty {
    margin-left: 24px; font-size: 12px; color: #8a94a3; padding: 10px 12px; border-radius: 10px; background: #f7f9fc;
  }
  .route-place-row {
    display: flex; align-items: flex-start; gap: 12px; cursor: pointer; border-radius: 12px; transition: background 0.12s;
  }
  .route-place-row:hover { background: #f4f7fb; }
  .route-place-row.primary {
    margin-left: 24px; margin-right: 14px; padding: 13px 13px; background: #f8fbff; border: 1px solid #dfe9f7;
  }
  .route-place-row.secondary {
    margin-left: 38px; margin-right: 14px; padding: 10px 10px; background: #fcfdff; border: 1px solid #edf1f6;
  }
  .route-place-row.fallback {
    margin-left: 24px; margin-right: 14px; padding: 11px 11px; background: #fffdf8; border: 1px solid #efe3c1;
  }
  .route-place-icon {
    width: 28px; height: 28px; border-radius: 50%; background: #dbe7f8; color: #23426f; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; flex-shrink: 0; margin-top: 1px;
  }
  .route-place-icon img { width: 100%; height: 100%; }
  .route-place-main { min-width: 0; flex: 1; }
  .route-place-name { font-size: 14px; font-weight: 800; color: #1f2933; }
  .route-place-tagline { font-size: 12px; color: #536273; line-height: 1.45; margin-top: 3px; }
  .route-place-meta { font-size: 11px; color: #7a8694; line-height: 1.4; margin-top: 6px; }
  .route-fallback-row {
    display: flex; align-items: flex-start; gap: 12px; margin-left: 24px; margin-right: 14px; padding: 11px 12px;
    border-radius: 12px; background: #fffdf8; border: 1px solid #efe3c1;
  }
  .route-fallback-row.clickable { cursor: pointer; transition: background 0.12s; }
  .route-fallback-row.clickable:hover, .route-fallback-row.clickable.active { background: #fbf5e8; }
  .route-fallback-badge {
    width: 26px; height: 26px; border-radius: 50%; background: #f4e6b7; color: #7a5a08;
    display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; margin-top: 1px;
  }
  .route-fallback-main { min-width: 0; flex: 1; }
  .route-leg-row {
    display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; margin: 0 14px; padding: 8px 0 14px;
  }
  .route-leg-line {
    width: 3px; justify-self: center; background: linear-gradient(180deg, #bfd2ea 0%, #dce6f3 100%); border-radius: 999px;
  }
  .route-leg-card {
    padding: 11px 13px; border-radius: 12px; background: #f7f9fc; border: 1px solid #e7edf4;
  }
  .route-leg-meta { font-size: 14px; font-weight: 800; color: #334155; line-height: 1.35; }
  .route-leg-note { font-size: 12px; color: #4b5563; margin-top: 6px; line-height: 1.5; }
  .route-extra-section { margin-top: 2px; padding: 0 22px; }
  .route-extra-section > summary.route-extra-label {
    cursor: pointer; list-style: none; user-select: none; margin: 0; padding: 12px 0 8px 0;
  }
  .route-extra-section > summary.route-extra-label::-webkit-details-marker { display: none; }
  .route-extra-section > summary.route-extra-label::before {
    content: '\25B8'; display: inline-block; margin-right: 4px; transition: transform 0.15s;
  }
  .route-extra-section[open] > summary.route-extra-label::before { transform: rotate(90deg); }
  .route-extra-section[open] > .route-unassigned-list { margin-top: 7px; }
  .route-extra-label { margin-top: 2px; }
  .route-unassigned-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .diary-shell {
    position: absolute; top: 12px; right: 12px; bottom: 12px;
    width: min(760px, calc(100vw - 36px));
    background: rgba(255,255,255,0.98); border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.16);
    border: 1px solid #eceff3; z-index: 210; overflow: hidden; display: none; min-height: 0;
  }
  .diary-shell.visible { display: flex; flex-direction: column; min-height: 0; }
  .diary-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 18px; border-bottom: 1px solid #eef1f5; background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  }
  .diary-title { font-size: 20px; font-weight: 800; color: #1f2933; }
  .diary-subtitle { font-size: 13px; color: #667085; margin-top: 4px; line-height: 1.45; }
  .diary-lang-toggle {
    padding: 4px 10px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: #344054;
    font-size: 12px; font-weight: 700; cursor: pointer; letter-spacing: 0.5px;
  }
  .diary-lang-toggle:hover { background: #f4f7fb; border-color: #98a2b3; }
  .diary-close {
    width: 42px; height: 42px; border: 0; border-radius: 50%; background: #f4f7fb; color: #51606f;
    font-size: 24px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  }
  .diary-close:hover { background: #e9eef5; color: #1f2933; }
  .diary-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 18px 20px; display: block; }
  .diary-body > * + * { margin-top: 14px; }
  .diary-overview {
    padding: 14px 16px; border-radius: 14px; background: linear-gradient(180deg, #fffdf6 0%, #fff9ea 100%);
    border: 1px solid #f1e4bf;
  }
  .diary-overview-title { font-size: 15px; font-weight: 800; color: #664d03; margin-bottom: 6px; }
  .diary-overview-text { font-size: 14px; color: #6c5b2f; line-height: 1.6; }
  /* ── Diary prose typography ── */
  .diary-prose-loading, .diary-prose-empty {
    padding: 20px 4px; font-size: 14px; color: #667085; line-height: 1.6;
  }
  .diary-body h1 { font-size: 22px; font-weight: 800; color: #1f2933; margin: 24px 0 12px; line-height: 1.3; }
  .diary-body h1:first-child { margin-top: 0; }
  .diary-body h2 { font-size: 18px; font-weight: 800; color: #1f2933; margin: 28px 0 10px; border-bottom: 1px solid #eef1f5; padding-bottom: 8px; line-height: 1.35; }
  .diary-body h3 { font-size: 15px; font-weight: 700; color: #334155; margin: 18px 0 6px; line-height: 1.4; }
  .diary-body p { font-size: 15px; line-height: 1.75; color: #334155; margin: 0 0 14px; }
  .diary-body blockquote {
    margin: 14px 0; padding: 12px 16px; background: #fffdf6; border-left: 4px solid #e6c45c;
    border-radius: 0 8px 8px 0; font-style: italic; color: #5c523b; font-size: 14px; line-height: 1.65;
  }
  .diary-body blockquote p { color: inherit; margin-bottom: 6px; }
  .diary-body blockquote p:last-child { margin-bottom: 0; }
  .diary-body hr { border: none; border-top: 1px solid #e7ecf2; margin: 24px 0; }
  .diary-body ul, .diary-body ol { margin: 0 0 14px 20px; padding: 0; }
  .diary-body li { font-size: 14px; line-height: 1.65; color: #475467; margin-bottom: 4px; }
  .diary-body em { font-style: italic; color: #667085; }
  .diary-body strong { font-weight: 700; color: #1f2933; }

  /* ── Info card ── */
  #info-card {
    position: absolute; top: 12px; right: 494px; bottom: 12px; left: auto;
    width: min(520px, calc(100vw - 830px)); min-width: 420px; max-width: calc(100vw - 430px);
    background: #fff; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    z-index: 220; overflow-y: auto; display: none;
  }
  #info-card.visible { display: block; }
  #info-card-header {
    padding: 16px 18px 12px; border-bottom: 1px solid #f0f0f0;
  }
  #info-card-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%; font-size: 13px;
    font-weight: 800; color: #fff; margin-right: 8px; vertical-align: middle;
  }
  #info-card-name { font-weight: 700; font-size: 18px; }
  #info-card-type { font-size: 14px; color: #888; margin-top: 4px; }
  #info-card-body { padding: 14px 18px 18px; }
  .info-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
  .info-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
  .info-section-title {
    font-size: var(--ui-font-xxs); color: #8a8a8a; text-transform: uppercase; letter-spacing: 0.7px;
    font-weight: 700; margin-bottom: 6px;
  }
  .info-summary { font-size: 14px; color: #333; line-height: 1.55; }
  .info-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
  .info-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 700; line-height: 1; background: #f1f3f5; color: #3b3b3b;
  }
  .info-badge.type-overnight { background: #eef2ff; color: #3949ab; }
  .info-badge.type-food      { background: #e3f2fd; color: #1565c0; }
  .info-badge.type-supply    { background: #e0f2f1; color: #00695c; }
  .info-badge.type-activity  { background: #fff3e0; color: #e65100; }
  .info-badge.type-detour    { background: #f3e5f5; color: #7b1fa2; }
  .info-badge.type-ferry     { background: #0369a1; color: #fff; }
  .info-badge.type-book      { background: #efebe9; color: #5d4037; }
  .info-badge.type-fallback  { background: #fffde7; color: #8d6e00; }
  .info-badge.info-badge-outline { background: transparent; border: 1.5px solid currentColor; }
  .info-badge.info-badge-outline.risk { color: #c0392b; }
  .info-badge.booking-booked { background: #e8f5e9; color: #1b5e20; }
  .info-badge.booking-dropin { background: #fff3e0; color: #bf360c; }
  .info-badge.booking-unverified { background: #fff8e1; color: #8d6e00; }
  .info-badge.booking-fallback { background: #fce4ec; color: #ad1457; }
  .info-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px;
  }
  .info-snapshot-card {
    background: #f8fafc; border: 1px solid #e8edf4; border-radius: 12px; padding: 10px 11px;
  }
  .info-snapshot-label {
    font-size: 10px; color: #7a8694; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 800;
  }
  .info-snapshot-value {
    font-size: 14px; color: #223041; font-weight: 700; margin-top: 5px; line-height: 1.4;
  }
  .info-kv { background: #f8f9fb; border-radius: 8px; padding: 8px 10px; }
  .info-kv-label { font-size: 10px; color: #8a8a8a; text-transform: uppercase; letter-spacing: 0.6px; }
  .info-kv-value { font-size: 14px; color: #222; font-weight: 700; margin-top: 3px; line-height: 1.35; }
  .info-narrative {
    display: grid; gap: 10px; padding: 14px 15px; border-radius: 14px;
    background: linear-gradient(180deg, #fcfeff 0%, #f5f9fc 100%); border: 1px solid #e7edf4;
    margin-bottom: 10px;
  }
  .info-narrative:last-child { margin-bottom: 0; }
  .info-narrative-lead { font-size: 16px; line-height: 1.65; color: #1f2937; font-weight: 500; }
  .info-narrative-body { font-size: 14px; line-height: 1.65; color: #475467; }
  .info-strategy-card {
    padding: 12px 13px; border-radius: 14px; border: 1px solid #e7edf4; background: #fff; margin-bottom: 10px;
  }
  .info-strategy-card:last-child { margin-bottom: 0; }
  .info-strategy-card.overnight { background: linear-gradient(180deg, #fffdf8 0%, #fff8ea 100%); border-color: #f0dfb0; }
  .info-strategy-card.arrival { background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%); border-color: #d7e6ff; }
  .info-strategy-card.food { background: linear-gradient(180deg, #fcfff8 0%, #f2faec 100%); border-color: #d8ebc8; }
  .info-strategy-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 800; color: #7a8694; }
  .info-strategy-title { font-size: 15px; font-weight: 800; color: #223041; margin-top: 4px; display: none; }
  .info-strategy-text { font-size: 14px; color: #334155; line-height: 1.55; margin-top: 6px; }
  .info-trigger-box {
    margin-top: 10px; padding: 12px 13px; border-radius: 12px; background: #fff8ef; border: 1px solid #f2d3a1;
  }
  .info-trigger-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 800; color: #946200;
  }
  .info-trigger-text { font-size: 14px; color: #5b4b27; line-height: 1.6; margin-top: 5px; }
  .fallback-list, .activity-list, .note-list { display: grid; gap: 8px; margin-bottom: 10px; }
  .fallback-list:last-child, .activity-list:last-child, .note-list:last-child { margin-bottom: 0; }
  .info-subsection { display: grid; gap: 8px; margin-top: 10px; }
  .info-subsection-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 800; color: #7a8694;
  }
  .fallback-item, .activity-item {
    border: 1px solid #eceff3; border-radius: 10px; padding: 9px 10px; background: #fbfcfe;
  }
  .fallback-head, .activity-head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px;
  }
  .fallback-label, .activity-title { font-size: 14px; font-weight: 700; color: #222; }
  .activity-title[data-poi-refs] {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(29, 78, 216, 0.28);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
  }
  .activity-title[data-poi-refs]:hover {
    color: #1d4ed8;
    text-decoration-color: rgba(29, 78, 216, 0.7);
  }
  .fallback-meta, .activity-meta { font-size: 12px; color: #6f7782; line-height: 1.45; }
  .activity-desc { font-size: 13px; color: #475467; line-height: 1.5; margin-top: 4px; }
  .risk-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .risk-chip {
    display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px;
    background: #fff1f0; color: #c0392b; font-size: 12px; font-weight: 700;
  }
  #info-card-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  #info-card-stars { color: #f39c12; font-size: 16px; letter-spacing: 1px; }
  #info-card-rating-val { font-size: 14px; color: #555; }
  #info-card-services { font-size: 15px; letter-spacing: 2px; margin-bottom: 8px; }
  #info-card-services-label { font-size: var(--ui-font-xxs); color: #aaa; margin-bottom: 3px; }
  #info-card-link { font-size: 13px; line-height: 1.5; }
  #info-card-link a { color: #3498db; text-decoration: none; }
  #info-card-link a:hover { text-decoration: underline; }
  #info-card-popup { font-size: 13px; color: #444; margin-top: 8px; line-height: 1.55; border-top: 1px solid #f0f0f0; padding-top: 8px; }
  #info-card-popup .popup-line { padding: 2px 0; }
  #info-card-popup .popup-label { color: #999; font-size: 11px; }
  #info-card-popup .popup-verdict { font-weight: 700; padding: 4px 10px; border-radius: 999px; font-size: 12px; display: inline-block; margin-bottom: 6px; }
  #info-card-popup .popup-verdict.solid { background: #e8f5e9; color: #2e7d32; }
  #info-card-popup .popup-verdict.mixed { background: #fff3e0; color: #e65100; }
  #info-card-close {
    position: absolute; top: 10px; right: 12px; cursor: pointer;
    color: #6f7782; font-size: 24px; line-height: 1;
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #f5f7fa;
  }
  #info-card-close:hover { color: #222; background: #e9edf2; }

  /* ── Status ── */
  #status {
    position: absolute; bottom: 10px; left: 10px; background: rgba(0,0,0,0.7);
    color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 12px; z-index: 10;
  }
  #status.connected { background: rgba(34,139,34,0.75); }
  #status.disconnected { background: rgba(200,50,50,0.75); }
  .route-label { pointer-events: none; }
  .map-pin { transition: outline 0.15s; }
  .map-pin:hover, .map-pin.pin-highlighted {
    outline: 3px solid #fff;
    outline-offset: 2px;
    border-radius: 50%;
    z-index: 100 !important;
    animation: pin-pulse 1s ease-in-out infinite;
  }
  @keyframes pin-pulse {
    0%, 100% { outline-offset: 2px; outline-width: 3px; }
    50% { outline-offset: 4px; outline-width: 4px; }
  }

  /* ── Legend ── removed */

  /* ── Mobile sidebar fab ── */
  #sidebar-fab {
    display: none; position: absolute; bottom: 16px; right: 16px;
    width: 48px; height: 48px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    z-index: 200; cursor: pointer; border: none;
    align-items: center; justify-content: center;
  }
  #sidebar-fab .mi { font-size: 24px; color: #333; }

  /* ── Mobile responsive ── */
  @media (max-width: 640px) {
    /* Sidebar: bottom sheet that slides off-screen when collapsed */
    #sidebar {
      top: auto; right: 0; bottom: 0; left: 0;
      width: 100%; max-height: 48vh;
      border-radius: 14px 14px 0 0;
      box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
      transition: transform 0.25s ease;
      z-index: 200;
      overscroll-behavior: contain;
    }
    #sidebar.collapsed {
      transform: translateY(100%);
      pointer-events: none;
    }
    #sidebar-header {
      padding: 12px 16px; font-size: 15px;
      border-radius: 14px 14px 0 0;
    }
    #sidebar-header::before {
      content: ''; display: block; width: 36px; height: 4px;
      background: #ccc; border-radius: 2px; margin: 0 auto 8px;
    }
    #toggle-btn {
      width: 36px; height: 36px; border-radius: 50%;
      background: #f0f2f5; display: flex; align-items: center; justify-content: center;
      font-size: 20px; font-weight: 700; color: #555; cursor: pointer;
      border: none; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
      flex-shrink: 0;
    }

    /* FAB: visible when sidebar is collapsed */
    #sidebar-fab { display: flex; }
    #sidebar-fab.hidden { display: none; }

    /* Info card: stacks above sidebar */
    #info-card {
      bottom: 0; left: 0; right: 0; width: 100%;
      top: auto; min-width: 0; max-width: 100%;
      max-height: 65vh; overflow-y: auto;
      border-radius: 14px 14px 0 0;
      box-shadow: 0 -4px 20px rgba(0,0,0,0.18);
      z-index: 210;
      overscroll-behavior: contain;
    }
    #info-card-header { padding: 14px 16px 10px; }
    #info-card-body { padding: 10px 16px 16px; }
    #info-card-close {
      top: 12px; right: 14px; font-size: 22px;
      width: 32px; height: 32px; display: flex;
      align-items: center; justify-content: center;
    }

    /* Status: top-right on mobile */
    #status { bottom: auto; top: 10px; left: auto; right: 10px; }

    /* Bigger touch targets */
    .pin-item { padding: 10px 16px; gap: 10px; }
    .pin-badge { width: 30px; height: 30px; }
    .pin-badge img { width: 100%; height: 100%; }
    .pin-name { font-size: 13px; }

    /* Service chips */
    #info-card-services { display: flex; flex-wrap: wrap; gap: 4px; }
    .service-chip { font-size: 11px; padding: 3px 6px; }
    .diary-shell {
      top: 0; right: 0; bottom: 0; left: 0; width: 100%; border-radius: 0; max-width: 100%;
    }
    .diary-body { padding: 12px 12px 18px; }
  }

  @media (max-width: 1180px) and (min-width: 641px) {
    #sidebar { width: var(--sidebar-width-medium); }
    #info-card {
      right: 444px;
      width: min(460px, calc(100vw - 450px));
      min-width: 360px;
      max-width: calc(100vw - 430px);
    }
  }

  /* Small phones */
  @media (max-width: 380px) {
    #sidebar { max-height: 40vh; }
    #info-card { max-height: 40vh; }
    .pin-tagline { font-size: 10px; }
  }
  .mi { font-family: 'Material Symbols Outlined'; font-size: 16px; line-height: 1;
        font-weight: normal; font-style: normal; letter-spacing: normal;
        text-transform: none; display: inline-block; white-space: nowrap;
        word-wrap: normal; direction: ltr; -webkit-font-feature-settings: 'liga';
        font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; }
  .service-chip { display:inline-flex; align-items:center; gap:4px; background:#f0f2f5;
                  border-radius:6px; padding:4px 8px; font-size:12px; color:#333; margin:2px; }
  .service-chip .mi { font-size:15px; color:#555; }
