    :root{
      color-scheme: light dark;
      --bg: #f1f1f0;
      --panel: rgba(247,247,246,0.92);
      --text: #0f0f0f;
      --muted: rgba(0,0,0,0.55);
      --line: rgba(0,0,0,0.10);
      --shadow: 0 18px 54px rgba(0,0,0,0.12);
      --orange: #ff6a00;
      --surface: #ffffff;
      /* Pull-up sheet only — same as terminal .left overview glass */
      --sheet-frost-fill: rgba(255, 255, 255, 0.22);
      --sheet-frost-stroke: rgba(255, 255, 255, 0.62);
      --sheet-frost-blur: 44px;
      --glass-stroke: rgba(255, 255, 255, 0.55);
      --glass-fill: rgba(255, 255, 255, 0.38);
      --glass-fill-menu: rgba(255, 255, 255, 0.52);
      --glass-inset: rgba(255, 255, 255, 0.72);
      --glass-shadow-outer: rgba(0, 0, 0, 0.07);
      --glass-keyline: rgba(0, 0, 0, 0.04);
      --input-fg: rgba(0, 0, 0, 0.72);
      --input-ph: rgba(0, 0, 0, 0.36);
      --icon-fg: rgba(0, 0, 0, 0.45);
      --menu-hover: rgba(0, 0, 0, 0.04);
      --menu-shadow: rgba(0, 0, 0, 0.1);
      --hairline: rgba(0, 0, 0, 0.08);
      --hi-label: rgba(0, 0, 0, 0.72);
      --hi-value: rgba(0, 0, 0, 0.88);
      --oil: rgba(0, 0, 0, 0.78);
      --metric-k: rgba(0, 0, 0, 0.52);
      --metric-v: rgba(0, 0, 0, 0.88);
      --grab: rgba(0, 0, 0, 0.2);
      --scroll-thumb: rgba(0, 0, 0, 0.22);
      --sticky-raised: rgba(0, 0, 0, 0.12);
      --export-icon: rgba(0, 0, 0, 0.42);
      --chart-legend: rgba(0, 0, 0, 0.48);
      --chart-tick: rgba(0, 0, 0, 0.45);
      --chart-grid: rgba(0, 0, 0, 0.06);
      --chart-line-muted: #111827;
      --chart-empty: #d4d4d4;
      --sphere: #e7eef7;
      --land: #d9d6d2;
      --land-live: rgba(17, 24, 39, 0.28);
      --land-live-selected: rgba(255, 106, 0, 0.26);
      --graticule: rgba(48, 48, 48, 0.05);
      --border-mesh: rgba(48, 48, 48, 0.14);
      --map-country-outline: rgba(48, 48, 48, 0.22);
      --border-live: rgba(17, 24, 39, 0.45);
      --border-live-selected: rgba(255, 106, 0, 0.78);
      --sg-stroke: rgba(32, 32, 32, 0.58);
      --sg-stroke-selected: rgba(255, 106, 0, 0.9);
      --export-story-img-bg: #ffffff;
    }

    @media (prefers-color-scheme: dark) {
      :root {
        /* Monochrome dark — neutral grays only (no slate / navy tint) */
        --bg: #0c0c0c;
        --panel: rgba(32, 32, 32, 0.94);
        --text: #ececec;
        --muted: rgba(255, 255, 255, 0.55);
        --line: rgba(255, 255, 255, 0.12);
        --shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
        --surface: #1a1a1a;
        --sheet-frost-fill: rgba(32, 32, 32, 0.48);
        --sheet-frost-stroke: rgba(255, 255, 255, 0.18);
        --glass-stroke: rgba(255, 255, 255, 0.12);
        --glass-fill: rgba(42, 42, 42, 0.78);
        --glass-fill-menu: rgba(42, 42, 42, 0.94);
        --glass-inset: rgba(255, 255, 255, 0.08);
        --glass-shadow-outer: rgba(0, 0, 0, 0.4);
        --glass-keyline: rgba(255, 255, 255, 0.06);
        --input-fg: rgba(255, 255, 255, 0.88);
        --input-ph: rgba(255, 255, 255, 0.38);
        --icon-fg: rgba(255, 255, 255, 0.5);
        --menu-hover: rgba(255, 255, 255, 0.06);
        --menu-shadow: rgba(0, 0, 0, 0.45);
        --hairline: rgba(255, 255, 255, 0.1);
        --hi-label: rgba(255, 255, 255, 0.72);
        --hi-value: rgba(255, 255, 255, 0.95);
        --oil: rgba(255, 255, 255, 0.82);
        --metric-k: rgba(255, 255, 255, 0.52);
        --metric-v: rgba(255, 255, 255, 0.92);
        --grab: rgba(255, 255, 255, 0.28);
        --scroll-thumb: rgba(255, 255, 255, 0.22);
        --sticky-raised: rgba(0, 0, 0, 0.5);
        --export-icon: rgba(255, 255, 255, 0.45);
        --chart-legend: rgba(255, 255, 255, 0.5);
        --chart-tick: rgba(255, 255, 255, 0.45);
        --chart-grid: rgba(255, 255, 255, 0.08);
        --chart-line-muted: #8c8c8c;
        --chart-empty: #666666;
        --sphere: #262626;
        --land: #3a3a3a;
        --land-live: rgba(255, 255, 255, 0.13);
        --land-live-selected: rgba(255, 106, 0, 0.32);
        --graticule: rgba(255, 255, 255, 0.06);
        --border-mesh: rgba(255, 255, 255, 0.12);
        --map-country-outline: rgba(255, 255, 255, 0.2);
        --border-live: rgba(255, 255, 255, 0.28);
        --border-live-selected: rgba(255, 106, 0, 0.85);
        --sg-stroke: rgba(255, 255, 255, 0.42);
        --sg-stroke-selected: rgba(255, 200, 140, 0.95);
        --export-story-img-bg: #1a1a1a;
      }
    }

    *{ box-sizing: border-box; }
    html, body { height: 100%; margin: 0; }
    body{
      background: var(--bg);
      color: var(--text);
      font-family: var(--font);
      overflow: hidden;
    }

    /* Map + dashboard: shared body hook (modifiers: .ppx-shell--map / .ppx-shell--dashboard). */
    body.ppx-shell{
      overscroll-behavior: none;
    }

    /* Map root (.app.app--map) and standalone dashboard (.app-dashboard--page): unified viewport chrome. */
    .app.app--map,
    .app-dashboard.app-dashboard--page{
      overscroll-behavior: none;
    }
    .app.app--map{
      position: relative;
      height: 100dvh;
      width: 100%;
    }

    /* Map layer — full viewport behind UI */
    .map{
      position: absolute;
      inset: 0;
      z-index: 0;
      background: transparent;
      overflow: hidden;
    }
    /* OpenFreeMap (MapLibre) fills the map pane */
    #map.app-map-openfreemap-root {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }
    .map .maplibregl-map,
    .map .maplibregl-canvas-container {
      position: absolute !important;
      inset: 0;
    }

    /* Pinch / wheel zoom on the globe — browser must not handle gestures here */
    .map svg{ width: 100%; height: 100%; display:block; touch-action: none; }
    .sphere { fill: var(--sphere); }
    .graticule { fill: none; stroke: var(--graticule); stroke-width: 0.3; }
    .country {
      fill: none;
      stroke: var(--map-country-outline);
      stroke-width: 0.5;
      vector-effect: non-scaling-stroke;
      paint-order: stroke fill;
    }
    .country.live { fill: var(--land-live); stroke: none; }
    .country.live.selected { fill: var(--land-live-selected); }
    /* Singapore is not a separate polygon in countries-110m (merged into Malaysia); overlay + stroke vs MY */
    .country.live.country-sg{
      stroke: var(--sg-stroke);
      stroke-width: 1.15px;
      vector-effect: non-scaling-stroke;
      paint-order: stroke fill;
    }
    .country.live.country-sg.selected{
      stroke: var(--sg-stroke-selected);
      stroke-width: 1.85px;
    }
    .border-mesh { fill:none; stroke: var(--border-mesh); stroke-width: 0.5; pointer-events:none; }
    .border-live { fill:none; stroke: var(--border-live); stroke-width: 1; pointer-events:none; }
    .border-live.selected { stroke: var(--border-live-selected); }

    /* Top chrome — above country/region bottom sheets (.app-dashboard-bottom-sheet z-index: 200). */
    .topbar{
      position: absolute;
      top: max(12px, env(safe-area-inset-top, 0px));
      left: max(12px, env(safe-area-inset-left, 0px));
      right: max(12px, env(safe-area-inset-right, 0px));
      z-index: 220;
      display:flex;
      gap: 10px;
      align-items: center;
    }
    .topbar.topbar--map-actions{
      justify-content: flex-end;
    }
    /* Combobox: dropdown anchors under the pill; stays above the sheet. */
    .search-field{
      flex: 1;
      min-width: 0;
      position: relative;
      z-index: 46;
    }
    .search{
      width: 100%;
      height: 40px;
      display:flex;
      align-items:center;
      gap: 8px;
      padding: 0 14px;
      border-radius: 999px;
      border: 1px solid var(--sheet-frost-stroke);
      background: var(--sheet-frost-fill);
      backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      -webkit-backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      box-shadow: var(--shadow);
    }
    .search svg{
      width: 14px;
      height: 14px;
      flex-shrink: 0;
      opacity: 0.42;
      color: var(--icon-fg);
    }
    .search input{
      flex: 1;
      min-width: 0;
      border: none;
      outline: none;
      background: transparent;
      font-family: var(--font);
      /* 14px: smaller UI; iOS Safari may auto-zoom on focus (below ~16px) on some versions. */
      font-size: 0.875rem;
      font-weight: 400;
      letter-spacing: 0.02em;
      color: var(--input-fg);
    }
    .search input::placeholder{
      color: var(--input-ph);
      font-weight: 300;
    }
    .app-topbar-settings-btn{
      box-sizing: border-box;
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      position: relative;
      z-index: 46;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      margin: 0;
      border-radius: 999px;
      border: 1px solid var(--sheet-frost-stroke);
      background: var(--sheet-frost-fill);
      backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      -webkit-backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      box-shadow: var(--shadow);
      cursor: pointer;
      color: var(--icon-fg);
      -webkit-tap-highlight-color: transparent;
    }
    .app-topbar-settings-btn svg{
      flex-shrink: 0;
      display: block;
    }
    .app-topbar-settings-btn:focus-visible{
      outline: 2px solid color-mix(in srgb, var(--text) 35%, transparent);
      outline-offset: 2px;
    }
    .search-field .search-menu{
      position: absolute;
      left: 0;
      right: 0;
      top: calc(100% + 8px);
      z-index: 50;
      display: none;
      max-height: min(420px, calc(100dvh - 200px));
      overflow: auto;
      padding: 4px 0;
      margin: 0;
      border-radius: 14px;
      border: 1px solid var(--sheet-frost-stroke);
      background: var(--sheet-frost-fill);
      backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      -webkit-backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      box-shadow: var(--shadow);
      -webkit-overflow-scrolling: touch;
    }
    .search-field .search-menu.open{ display: block; }
    .search-item{
      margin: 0 4px;
      padding: 10px 12px;
      border-radius: 8px;
      cursor: pointer;
      user-select: none;
      display: flex;
      justify-content: space-between;
      gap: 12px;
      font-weight: 400;
      font-size: 0.9375rem;
      letter-spacing: 0.01em;
      color: var(--text);
    }
    .search-field .search-menu .search-item:hover,
    .search-field .search-menu .search-item:focus-visible,
    .search-field .search-menu .search-item.active{
      background: var(--menu-hover);
      outline: none;
      color: var(--text);
    }
    .search-field .search-menu .search-item:hover .search-item-chevron,
    .search-field .search-menu .search-item:focus-visible .search-item-chevron,
    .search-field .search-menu .search-item.active .search-item-chevron{
      color: inherit;
      opacity: 0.9;
    }
    @media (prefers-color-scheme: dark) {
      .search-field .search-menu .search-item:hover,
      .search-field .search-menu .search-item:focus-visible,
      .search-field .search-menu .search-item.active{
        color: #fff;
      }
    }
    .search-empty{
      padding: 12px 14px;
      color: var(--text-muted);
      font-size: 0.9rem;
    }
    .search-item-expand{
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      cursor: pointer;
    }
    .search-item-label{
      flex: 1;
      min-width: 0;
    }
    .search-item-chevron{
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.55;
      color: var(--text-muted);
      transition: transform 0.18s ease;
    }
    .search-item-chevron-open{
      transform: rotate(-180deg);
    }
    .search-item-nested{
      padding-left: 22px;
      font-size: 0.9rem;
    }
    .search-item-dropdown-icon{
      display: block;
      pointer-events: none;
    }
    .search-suggest-wrap{
      padding: 2px 0 6px;
    }
    .search-suggest-section{
      margin: 0 4px 10px;
    }
    .search-suggest-head{
      padding: 6px 12px 4px;
      font-size: 0.7rem;
      font-weight: 400;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--text-muted);
    }
    .search-suggest-empty{
      padding: 6px 12px 4px;
      font-size: 0.85rem;
      font-weight: 400;
      color: var(--text-muted);
    }
    .search-suggest-divider{
      height: 1px;
      margin: 4px 8px 8px;
      background: color-mix(in srgb, var(--sheet-frost-stroke) 85%, transparent);
    }
    .search-item-suggest{
      align-items: center;
      gap: 10px;
    }
    .search-suggest-left{
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: flex-start;
      gap: 10px;
    }
    .search-suggest-flag{
      flex-shrink: 0;
      width: 1.15rem;
      height: 0.82rem;
      margin-top: 0.2rem;
      border-radius: 2px;
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
    }
    .search-suggest-flag--ph{
      display: inline-block;
      background: color-mix(in srgb, var(--text-muted) 22%, transparent);
    }
    .search-suggest-text{
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .search-suggest-primary{
      font-size: 0.9375rem;
      font-weight: 400;
      line-height: 1.25;
    }
    .search-suggest-sub{
      font-size: 0.78rem;
      font-weight: 400;
      color: var(--text-muted);
      line-height: 1.2;
    }
    .search-suggest-metric{
      flex-shrink: 0;
      font-size: 0.8125rem;
      font-weight: 400;
      font-variant-numeric: tabular-nums;
      color: var(--text-muted);
      text-align: right;
      max-width: 42%;
    }
    .search-item-suggest .search-suggest-metric .app-dsh-pct{
      font-weight: 400;
    }
    button.topbar-home{
      appearance: none;
      -webkit-appearance: none;
      margin: 0;
      padding: 0;
      font: inherit;
      color: inherit;
      cursor: pointer;
    }
    a.topbar-home{
      text-decoration: none;
      color: inherit;
      box-sizing: border-box;
    }
    .topbar-home{
      position: relative;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      overflow: hidden;
      isolation: isolate;
      border: 1px solid var(--glass-stroke);
      background:
        linear-gradient(
          145deg,
          rgba(255, 255, 255, 0.52) 0%,
          rgba(255, 255, 255, 0.14) 36%,
          rgba(255, 255, 255, 0.05) 100%
        ),
        var(--glass-fill);
      backdrop-filter: blur(40px) saturate(200%);
      -webkit-backdrop-filter: blur(40px) saturate(200%);
      box-shadow:
        0 1px 0 var(--glass-inset) inset,
        0 0 0 0.5px var(--glass-keyline),
        inset 0 0 0 1px rgba(255, 255, 255, 0.22),
        0 8px 28px var(--glass-shadow-outer),
        0 2px 8px var(--glass-shadow-outer);
      -webkit-tap-highlight-color: transparent;
    }
    .topbar-home::after{
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 50%;
      pointer-events: none;
      background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.45) 0%,
        transparent 48%
      );
      opacity: 0.28;
      z-index: 1;
    }
    .topbar-home__icon{
      position: relative;
      z-index: 2;
      width: 22px;
      height: 22px;
      flex-shrink: 0;
      display: block;
      color: var(--icon-fg);
      opacity: 0.92;
    }
    .topbar-home:focus-visible{
      outline: 2px solid rgba(255, 106, 0, 0.45);
      outline-offset: 2px;
    }
    @media (prefers-color-scheme: dark) {
      .topbar-home{
        background:
          linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.14) 0%,
            rgba(255, 255, 255, 0.04) 40%,
            transparent 100%
          ),
          var(--glass-fill);
        box-shadow:
          0 1px 0 var(--glass-inset) inset,
          0 0 0 0.5px var(--glass-keyline),
          inset 0 0 0 1px rgba(255, 255, 255, 0.08),
          0 8px 28px var(--glass-shadow-outer),
          0 2px 8px var(--glass-shadow-outer);
      }
      .topbar-home::after{
        opacity: 0.22;
        background: linear-gradient(
          165deg,
          rgba(255, 255, 255, 0.22) 0%,
          transparent 52%
        );
      }
      .topbar-home__icon{
        opacity: 0.96;
      }
    }

    /*
     * Cross-document view transitions (Chrome 126+): same-named nav is morphed between
     * app.html and dashboard.html so the bar appears to stay put on in-app navigations.
     */
    @view-transition {
      navigation: auto;
    }

    /*
     * Bottom tab bar (flush to viewport bottom): bar fill matches page (--bg), separated from
     * content by a hairline top border; soft downward shadow only (no upward “lift” shadow).
     * Inactive tabs use outline icons; active (and drag-preview) uses orange label + filled icon,
     * no decorative underline/glow. Tokens: --liquid-nav-* on .app-liquid-nav; dark overrides in
     * prefers-color-scheme only (no data-theme toggle in app). Drag hit-testing stays on
     * .app-liquid-nav__pill.
     */
    .app-liquid-nav{
      view-transition-name: app-liquid-nav;
      /* Light: same surface as body; icons/hover use --text-derived tokens (not on-charcoal). */
      --liquid-nav-bar: var(--bg);
      --liquid-nav-bar-keyline: var(--hairline);
      --liquid-nav-bar-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
      /* Muted copy on bar (reserved); tab labels are sr-hidden until active. */
      --liquid-nav-on-bar-fg-muted: var(--muted);
      --liquid-nav-on-bar-icon: color-mix(in srgb, var(--text) 88%, transparent);
      --liquid-nav-icon-inactive: var(--icon-fg);
      --liquid-nav-hover-bg: var(--menu-hover);
      --liquid-nav-press-bg: rgba(0, 0, 0, 0.08);
      --liquid-nav-search-hover-bg: rgba(0, 0, 0, 0.08);
      --liquid-nav-search-hover-fg: var(--text);
      --liquid-nav-search-press-bg: rgba(0, 0, 0, 0.06);
      --liquid-nav-focus-ring: color-mix(in srgb, var(--text) 38%, transparent);
      --liquid-nav-search-focus-ring: color-mix(in srgb, var(--text) 48%, transparent);
      --liquid-nav-active-fg: var(--orange);
      --liquid-nav-active-icon: var(--orange);
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      /* Above .app-dashboard (120) and above pull-up sheets (200); below export modal (250). */
      z-index: 220;
      display: block;
      pointer-events: none;
      padding: 0;
    }
    .app-liquid-nav__bar{
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: 20px;
      width: 100%;
      max-width: none;
      pointer-events: auto;
      padding:
        6px
        max(12px, env(safe-area-inset-right, 0px))
        max(10px, env(safe-area-inset-bottom, 0px))
        max(12px, env(safe-area-inset-left, 0px));
      border-radius: 0;
      background: var(--liquid-nav-bar);
      border: none;
      border-top: 1px solid var(--liquid-nav-bar-keyline);
      box-shadow: var(--liquid-nav-bar-shadow);
      touch-action: manipulation;
    }
    .app-liquid-nav__pill{
      /* Flatten Map + Dashboard into the bar flex row; bar uses centered layout + gap
         so controls stay grouped on wide phones (pill stays display:contents for drag rects). */
      display: contents;
      position: relative;
      isolation: isolate;
      pointer-events: auto;
      touch-action: manipulation;
      padding: 0;
      margin: 0;
      border-radius: 100vmax;
      border: none;
      background: transparent;
      box-shadow: none;
      max-width: none;
      width: auto;
      min-height: 0;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
    .app-liquid-nav__pill::before,
    .app-liquid-nav__pill::after{
      content: none;
    }
    .app-liquid-nav__search{
      flex: 0 0 auto;
      width: 44px;
      min-width: 44px;
      height: 44px;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      padding: 0;
      margin: 0;
      border: none;
      border-radius: 100vmax;
      background: transparent;
      color: var(--liquid-nav-icon-inactive);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      appearance: none;
      -webkit-appearance: none;
      touch-action: manipulation;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
      box-shadow: none;
      transition: background 0.18s ease, color 0.16s ease, transform 0.12s ease;
    }
    .app-liquid-nav__search:hover{
      background: var(--liquid-nav-search-hover-bg);
      color: var(--liquid-nav-search-hover-fg);
    }
    .app-liquid-nav__search:active{
      transform: scale(0.94);
      background: var(--liquid-nav-search-press-bg);
    }
    .app-liquid-nav__search:focus-visible{
      outline: 2px solid var(--liquid-nav-search-focus-ring);
      outline-offset: 2px;
    }
    .app-liquid-nav__search .app-liquid-nav__icon{
      color: var(--liquid-nav-icon-inactive);
    }
    a.app-liquid-nav__item:visited{
      color: inherit;
    }
    a.app-liquid-nav__item--active:visited{
      color: var(--liquid-nav-active-fg);
    }
    .app-liquid-nav__item{
      position: relative;
      z-index: 2;
      flex: 0 0 auto;
      min-width: 0;
      min-height: 44px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      padding: 6px 12px 5px;
      margin: 0;
      border: none;
      border-radius: 100vmax;
      background: transparent;
      color: var(--liquid-nav-on-bar-fg-muted);
      font-family: var(--font);
      font-size: 0.62rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      line-height: 1.1;
      text-decoration: none;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      appearance: none;
      -webkit-appearance: none;
      transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        color 0.18s ease,
        transform 0.12s ease;
    }
    .app-liquid-nav__item:hover:not(.app-liquid-nav__item--active):not(.app-liquid-nav__item--sliding-hover){
      background: var(--liquid-nav-hover-bg);
    }
    .app-liquid-nav__item:active:not(.app-liquid-nav__item--active):not(.app-liquid-nav__item--sliding-hover){
      transform: scale(0.97);
      background: var(--liquid-nav-press-bg);
    }
    .app-liquid-nav__icon-wrap{
      position: relative;
      display: block;
      width: 24px;
      height: 24px;
      flex-shrink: 0;
    }
    .app-liquid-nav__icon{
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: 21px;
      height: 21px;
      display: block;
      color: var(--liquid-nav-icon-inactive);
      pointer-events: none;
    }
    .app-liquid-nav__icon--strong{
      display: none;
      color: var(--liquid-nav-active-icon);
    }
    .app-liquid-nav__item--active .app-liquid-nav__icon--muted,
    .app-liquid-nav__item--sliding-hover .app-liquid-nav__icon--muted{
      display: none;
    }
    .app-liquid-nav__item--active .app-liquid-nav__icon--strong,
    .app-liquid-nav__item--sliding-hover .app-liquid-nav__icon--strong{
      display: block;
    }
    .app-liquid-nav__label{
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .app-liquid-nav__item:not(.app-liquid-nav__item--active):not(.app-liquid-nav__item--sliding-hover) .app-liquid-nav__label{
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .app-liquid-nav__item--active,
    .app-liquid-nav__item--sliding-hover{
      background-color: transparent;
      color: var(--liquid-nav-active-fg);
      font-weight: 600;
      box-shadow: none;
    }
    .app-liquid-nav__item--active .app-liquid-nav__icon--muted,
    .app-liquid-nav__item--active .app-liquid-nav__icon--strong,
    .app-liquid-nav__item--sliding-hover .app-liquid-nav__icon--muted,
    .app-liquid-nav__item--sliding-hover .app-liquid-nav__icon--strong{
      color: var(--liquid-nav-active-icon);
    }
    .app-liquid-nav__pill.app-liquid-nav__pill--dragging{
      -webkit-user-select: none;
      user-select: none;
    }
    .app-liquid-nav__pill.app-liquid-nav__pill--dragging > .app-liquid-nav__item{
      opacity: 0.38;
      transition: opacity 0.06s ease;
    }
    .app-liquid-nav__pill.app-liquid-nav__pill--dragging > .app-liquid-nav__item.app-liquid-nav__item--sliding-hover{
      opacity: 1;
    }
    .app-liquid-nav__item:focus-visible{
      outline: 2px solid var(--liquid-nav-focus-ring);
      outline-offset: 3px;
    }
    .app-liquid-nav__item--active:focus-visible,
    .app-liquid-nav__item--sliding-hover:focus-visible{
      outline: 2px solid color-mix(in srgb, var(--orange) 65%, transparent);
      outline-offset: 2px;
    }
    @media (prefers-color-scheme: dark) {
      .app-liquid-nav{
        /* Same fill as body --bg; hairline + mild downward shadow only. */
        --liquid-nav-bar: var(--bg);
        --liquid-nav-bar-keyline: var(--hairline);
        --liquid-nav-bar-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
        --liquid-nav-on-bar-fg-muted: var(--muted);
        --liquid-nav-on-bar-icon: color-mix(in srgb, var(--text) 90%, transparent);
        --liquid-nav-icon-inactive: var(--icon-fg);
        --liquid-nav-hover-bg: var(--menu-hover);
        --liquid-nav-press-bg: rgba(255, 255, 255, 0.1);
        --liquid-nav-search-hover-bg: rgba(255, 255, 255, 0.12);
        --liquid-nav-search-hover-fg: var(--text);
        --liquid-nav-search-press-bg: rgba(255, 255, 255, 0.08);
        --liquid-nav-focus-ring: color-mix(in srgb, var(--text) 55%, transparent);
        --liquid-nav-search-focus-ring: color-mix(in srgb, var(--text) 62%, transparent);
      }
    }
    @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))){
      .app-liquid-nav__bar{
        background: var(--liquid-nav-bar);
      }
    }
    body.ppx-shell:has(.app-liquid-nav) .app-dashboard-scroll{
      /* Flush bar (~56px row) + bar vertical padding + home indicator inset (also inside the bar). */
      padding-bottom: max(16px, calc(80px + env(safe-area-inset-bottom, 0px)));
    }
    /* App sheet: fixed nav (z-index above sheet) overlaps the scroll area — pad so last cards clear it. */
    body.ppx-shell:has(.app-liquid-nav) .sheet-scroll{
      padding-bottom: max(
        28px,
        calc(86px + var(--sheet-bottom-extra-deadspace) + env(safe-area-inset-bottom, 0px))
      );
    }

    /* Bottom sheet — three stops: ~¼, ~½, expanded; inner scroll only at expanded (full) height */
    /* Cards-only embed mode (?cards=1) — used by the dashboard row pull-up to iframe just the details sheet. */
    html.app-cards-only-root,
    html.app-cards-only-root body{
      background: transparent !important;
    }
    html.app-cards-only-root body{
      overflow: visible !important;
    }
    body.app-cards-only .map,
    body.app-cards-only .topbar,
    body.app-cards-only .app-liquid-nav,
    body.app-cards-only #app-settings-sheet,
    body.app-cards-only #sg-provider-menu,
    body.app-cards-only #hk-provider-menu,
    body.app-cards-only #app-dashboard{
      display: none !important;
    }
    /* Keep .export-story-modal alive in cards-only so the highlight / chart export
       button works from inside the dashboard pull-up. The modal is `position: fixed;
       inset: 0` and scopes to the iframe viewport (== the panel), centering nicely
       on the pull-up sheet. */
    body.app-cards-only .app.app--map{
      position: static;
      height: auto;
      min-height: 100%;
    }
    body.app-cards-only .sheet{
      position: static;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      max-width: 100%;
      height: 100dvh;
      max-height: 100dvh;
      border-radius: 0;
      border: none;
      box-shadow: none;
      /* Stay transparent so the parent dashboard's frosted panel shows through. */
      background: transparent !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }
    body.app-cards-only .grab{
      display: none;
    }
    body.app-cards-only .sheet-scroll{
      overflow-y: auto !important;
      overflow-x: hidden !important;
      overscroll-behavior-y: contain;
      -webkit-overflow-scrolling: touch;
      /* Modest padding inside the iframe scroll. The dashboard panel reserves
         clearance for the bottom nav so the chart card never lives under it. */
      padding-bottom: 28px !important;
      margin-bottom: 0 !important;
    }
    body.app-cards-only .sheet-region-sticky{
      padding-top: 18px;
    }
    .sheet{
      /* Horizontal rhythm: sticky headline + .sheet-scroll + .card .pad must match (inherited by children). */
      /* Extra empty band inside the card below the last card (scroll + margin below scroller). */
      --sheet-bottom-extra-deadspace: 80px;
      --sheet-gutter-x: 8px;
      --sheet-scroll-pad-left: 12px;
      --sheet-scroll-pad-right: 4px;
      --sheet-card-pad-x: 14px;
      --sheet-text-inset-left: calc(var(--sheet-gutter-x) + var(--sheet-scroll-pad-left) + var(--sheet-card-pad-x));
      position: absolute;
      left: max(10px, env(safe-area-inset-left, 0px));
      right: max(10px, env(safe-area-inset-right, 0px));
      /* Sit above home indicator + display corner radius so bottom corners stay visible in PWA */
      bottom: calc(10px + env(safe-area-inset-bottom, 0px));
      z-index: 20;
      height: var(--sheetH, 50vh);
      max-height: calc(100dvh - 72px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
      display: flex;
      flex-direction: column;
      border-radius: 26px 26px 36px 36px;
      border: 1px solid var(--sheet-frost-stroke);
      /* Frost tapers to transparent at the physical bottom so the map reads through the lower card. */
      background: linear-gradient(
        to bottom,
        var(--sheet-frost-fill) 0%,
        var(--sheet-frost-fill) 50%,
        transparent 100%
      );
      backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      -webkit-backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    /* Quarter/half: drag anywhere resizes. Full (scrollable): whole sheet can resize; JS probes scroll vs resize on the scroller. */
    .sheet:not(.sheet-scrollable){
      touch-action: none;
    }
    .sheet.sheet-scrollable{
      touch-action: none;
    }
    .grab{
      position: relative;
      z-index: 4;
      flex-shrink: 0;
      min-height: 36px;
      padding: 5px 0 6px;
      margin: 0;
      background: transparent;
      touch-action: none;
      -webkit-user-select: none;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
      cursor: grab;
    }
    .grab:active{ cursor: grabbing; }
    .grab::before{
      content:'';
      display:block;
      width: 46px;
      height: 5px;
      border-radius: 999px;
      background: var(--grab);
      margin: 0 auto;
    }
    .sheet-scroll{
      flex: 1;
      min-height: 0;
      overflow-y: hidden;
      overscroll-behavior-y: none;
      /* Inset from sheet edges so the scrollbar stops above the rounded bottom corners */
      margin: 0 var(--sheet-gutter-x) calc(16px + var(--sheet-bottom-extra-deadspace) / 2) var(--sheet-gutter-x);
      padding: 0 var(--sheet-scroll-pad-right) calc(16px + var(--sheet-bottom-extra-deadspace)) var(--sheet-scroll-pad-left);
      display: flex;
      flex-direction: column;
      gap: 0;
      box-sizing: border-box;
      border-radius: 0 0 24px 24px;
      scrollbar-width: thin;
      scrollbar-color: var(--scroll-thumb) transparent;
      position: relative;
      z-index: 1;
    }
    .sheet-scroll::-webkit-scrollbar{
      width: 5px;
    }
    .sheet-scroll::-webkit-scrollbar-thumb{
      background: var(--scroll-thumb);
      border-radius: 999px;
    }
    .sheet-scroll::-webkit-scrollbar-track{
      background: transparent;
    }
    .sheet-cards-stack{
      display: flex;
      flex-direction: column;
      gap: 22px;
      min-height: 0;
    }
    .sheet.sheet-scrollable .sheet-scroll{
      overflow-y: auto;
      /* Let highlights price/delta extend or scroll horizontally; hidden was clipping the right column. */
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
      touch-action: pan-x pan-y;
    }
    .card{
      border-radius: 0;
      border: none;
      overflow: visible;
      background: transparent;
    }
    .card .pad{
      padding: 14px var(--sheet-card-pad-x, 14px);
    }
    #card-highlights .pad{
      padding-top: 2px;
      padding-right: max(18px, env(safe-area-inset-right, 0px));
      min-width: 0;
    }
    /* Region headline: direct flex child of .sheet (above sheet-scroll) so content never scrolls behind it */
    .sheet-region-sticky{
      flex-shrink: 0;
      z-index: 6;
      /* Same left inset as first line of text inside .sheet-scroll > .card .pad (fallback: export clone off-sheet) */
      /* Top padding balances the horizontal insets so the headline sits evenly below the grab handle */
      padding: 12px max(22px, env(safe-area-inset-right, 0px)) 8px var(--sheet-text-inset-left, 34px);
      background: transparent;
      box-shadow: none;
      transition: box-shadow 0.2s ease;
    }
    .sheet-region-head{
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .sheet-region-head .title{
      flex: 1;
      min-width: 0;
      margin: 0;
      padding-top: 0;
    }
    .sheet-region-sticky.sheet-region-sticky--raised{
      box-shadow: 0 6px 12px -8px var(--sticky-raised);
    }
    /* Highlights: section label above date line */
    .hi-highlight-kicker{
      display: block;
      margin: 0 0 6px;
      font-family: var(--font);
      font-size: 0.72rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      opacity: 0.85;
    }
    /* Highlights: date line + export beside the text */
    .card-sub-row{
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-start;
      gap: 6px;
      min-width: 0;
      margin-top: 6px;
    }
    #card-highlights .card-sub-row{
      margin-top: 0;
    }
    #card-highlights .card-sub-row .sub{
      margin-top: 0;
      flex: 0 1 auto;
      min-width: 0;
      max-width: 100%;
    }
    /* Kicker + export beside the text */
    .card-head-inline{
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-start;
      gap: 6px;
      min-width: 0;
    }
    .card-head-inline .kicker{
      flex: 0 1 auto;
      min-width: 0;
      max-width: 100%;
    }
    .card-export{
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      margin: 0;
      padding: 0;
      border: none;
      border-radius: 6px;
      background: transparent;
      color: var(--export-icon);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .card-export:disabled{
      opacity: 0.45;
      cursor: wait;
      pointer-events: none;
    }
    .card-export svg{
      width: 14px;
      height: 14px;
    }
    .card-export:focus-visible{
      outline: 2px solid rgba(255, 106, 0, 0.45);
      outline-offset: 2px;
    }
    .kicker{
      font-family: var(--font);
      font-size: 0.72rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      opacity: 0.85;
    }
    .title{
      margin: 8px 0 0;
      font-size: 1.9rem;
      font-weight: 850;
      letter-spacing: -0.02em;
      line-height: 1.05;
    }
    /* Singapore: tap headline to change petrol provider */
    #hi-title.switchable{
      text-decoration: underline;
      text-underline-offset: 3px;
      text-decoration-thickness: 1px;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .sg-provider-menu{
      position: fixed;
      z-index: 30;
      min-width: 220px;
      max-width: min(360px, calc(100vw - 24px));
      max-height: min(280px, calc(100dvh - 120px));
      overflow: auto;
      padding: 6px;
      border: 1px solid var(--glass-stroke);
      background: var(--glass-fill-menu);
      backdrop-filter: blur(28px) saturate(180%);
      -webkit-backdrop-filter: blur(28px) saturate(180%);
      border-radius: 16px;
      box-shadow:
        0 1px 0 var(--glass-inset) inset,
        0 12px 40px var(--menu-shadow),
        0 2px 10px var(--glass-shadow-outer);
      display: none;
    }
    .sg-provider-menu.open{
      display: block;
    }
    .sg-provider-item{
      padding: 11px 12px;
      border-radius: 12px;
      cursor: pointer;
      user-select: none;
      font-weight: 600;
      letter-spacing: 0.02em;
      color: var(--text);
    }
    .sg-provider-item:hover,
    .sg-provider-item:focus-visible{
      background: var(--menu-hover);
      outline: none;
    }
    .sg-provider-item.active{
      background: color-mix(in srgb, var(--orange) 16%, transparent);
    }
    .sub{
      margin-top: 6px;
      font-family: var(--font);
      font-size: 0.8rem;
      opacity: 0.85;
    }
    .lines{
      margin-top: 12px;
      display:grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px 12px;
      font-family: var(--font);
      font-size: 0.78rem;
    }
    /* Two columns: label | stacked price + delta (delta never competes for width with a third grid track). */
    .lines.hi-lines{
      display: flex;
      flex-direction: column;
      gap: 0;
      margin-top: 14px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      overflow-x: auto;
      overflow-y: visible;
      scrollbar-width: thin;
    }
    .hi-row{
      display: grid;
      grid-template-columns: minmax(0, 1fr) max-content;
      column-gap: 12px;
      align-items: center;
      padding: 11px 0;
      border-bottom: 1px solid var(--hairline);
      font-family: var(--font);
      font-size: 0.84rem;
      min-width: min-content;
    }
    .hi-row:last-child{ border-bottom: none; padding-bottom: 2px; }
    .hi-k{
      font-weight: 600;
      letter-spacing: 0.04em;
      color: var(--hi-label);
      min-width: 0;
    }
    .hi-price-block{
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      justify-content: center;
      gap: 3px;
      width: max-content;
      min-width: max-content;
      flex-shrink: 0;
    }
    .hi-v{
      font-weight: 750;
      font-variant-numeric: tabular-nums;
      color: var(--hi-value);
      text-align: right;
      white-space: nowrap;
    }
    .hi-v--alone{
      grid-column: 2;
      text-align: right;
      justify-self: end;
      min-width: 0;
      max-width: 100%;
      white-space: normal;
      overflow-wrap: break-word;
    }
    .hi-delta{
      font-size: 0.78em;
      font-weight: 400;
      font-variant-numeric: tabular-nums;
      color: var(--hi-delta, var(--muted));
      white-space: nowrap;
      text-align: right;
      width: max-content;
    }
    .kv .k{ opacity: 0.82; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.62rem; }
    .kv .v{ margin-top: 6px; font-weight: 850; font-family: var(--font); }
    .chart-wrap{ height: 210px; padding: 12px; }
    .chart-wrap canvas{ width:100% !important; height:100% !important; display:block; }
    .sheet.sheet-scrollable .chart-wrap{
      touch-action: pan-y;
    }
    .oil{ font-size: 0.95rem; line-height: 1.45; font-weight: 600; color: var(--oil); }
    .overview-metrics{
      display: flex;
      flex-direction: column;
      gap: 0;
      margin-top: 14px;
    }
    .overview-row{
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      border-top: 1px solid var(--hairline);
      padding-top: 10px;
      padding-bottom: 14px;
    }
    .overview-metric-empty{
      min-width: 0;
      pointer-events: none;
    }
    .overview-metrics .metric{
      min-width: 0;
    }
    .overview-metrics .metric .k{
      font-family: var(--font);
      font-size: 0.66rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--metric-k);
    }
    .overview-metrics .metric .v{
      margin-top: 6px;
      font-family: var(--font);
      font-size: 0.95rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      font-variant-numeric: tabular-nums;
      color: var(--metric-v);
      line-height: 1.25;
    }

    @media (min-width: 900px){
      /* "App" can still run on desktop, but keep it phone-ish */
      .sheet{
        left: max(16px, env(safe-area-inset-left, 0px));
        right: max(16px, env(safe-area-inset-right, 0px));
        max-width: 520px;
        margin: 0 auto;
      }
      .topbar{
        left: max(16px, env(safe-area-inset-left, 0px));
        right: max(16px, env(safe-area-inset-right, 0px));
        max-width: 520px;
        margin: 0 auto;
      }
    }

    /* Export: IG story preview (9:16) — save via share sheet or download on tap.
       Above top chrome (.topbar / .app-dashboard-top z-index: 220) so the modal fully covers the app. */
    .export-story-modal{
      position: fixed;
      inset: 0;
      z-index: 250;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 12px;
      padding-bottom: max(12px, env(safe-area-inset-bottom));
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.22s ease, visibility 0.22s;
    }
    .export-story-modal.export-story-modal--open{
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
    .export-story-backdrop{
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }
    .export-story-dialog{
      position: relative;
      z-index: 1;
      width: min(100%, 380px);
      max-height: min(94dvh, 900px);
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 12px;
    }
    .export-story-header{
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 0 2px;
    }
    .export-story-heading{
      margin: 0;
      font-size: 1.05rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: #fff;
      text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
    }
    .export-story-close{
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      margin: 0;
      padding: 0;
      border: none;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.2);
      color: #fff;
      font-size: 1.35rem;
      line-height: 1;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .export-story-close:focus-visible{
      outline: 2px solid var(--orange);
      outline-offset: 2px;
    }
    .export-story-frame{
      width: min(100%, 300px);
      aspect-ratio: 9 / 16;
      margin: 0 auto;
      border-radius: 14px;
      overflow: hidden;
      background: #0a0a0a;
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    }
    .export-story-frame img{
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      background: var(--export-story-img-bg);
    }
    .export-story-save{
      margin: 0;
      padding: 14px 20px;
      border: none;
      border-radius: 14px;
      background: var(--orange);
      color: #fff;
      font-family: var(--font);
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      cursor: pointer;
      box-shadow: 0 4px 20px rgba(255, 106, 0, 0.35);
      -webkit-tap-highlight-color: transparent;
    }
    .export-story-save:focus-visible{
      outline: 2px solid #fff;
      outline-offset: 3px;
    }
    .export-story-save:disabled{
      opacity: 0.55;
      cursor: wait;
    }

    /* Full-screen prices dashboard — uses same tokens as map app (light / dark via prefers-color-scheme) */
    .app-dashboard{
      position: fixed;
      inset: 0;
      z-index: 120;
      display: flex;
      flex-direction: column;
      background: var(--bg);
      color: var(--text);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.2s ease, visibility 0.2s;
    }
    .app-dashboard.app-dashboard--open{
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
    /* Standalone dashboard.html — always visible full-screen layout */
    .app-dashboard.app-dashboard--page{
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    /* Light mode: CoinGecko-style list — white canvas, slate chrome, cool gray controls */
    @media (prefers-color-scheme: light) {
      .app-dashboard{
        --text: #0f172a;
        --muted: #64748b;
        --bg: #ffffff;
        --line: #e2e8f0;
        --hairline: #f1f5f9;
        --surface: #ffffff;
        --metric-k: #64748b;
        --icon-fg: #475569;
        --glass-fill: #f1f5f9;
        --glass-stroke: #e2e8f0;
        --glass-inset: rgba(255, 255, 255, 0.98);
        --glass-keyline: rgba(15, 23, 42, 0.05);
        --glass-shadow-outer: rgba(15, 23, 42, 0.06);
        --scroll-thumb: rgba(100, 116, 139, 0.35);
        --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
      }
      .app-dashboard .app-dashboard-table-outer{
        margin-left: 12px;
        margin-right: 12px;
        border: none;
        background: #ffffff;
        box-shadow: none;
      }
      .app-dashboard .app-dashboard-td{
        border-bottom-color: #f1f5f9;
        padding-top: 7px;
        padding-bottom: 7px;
      }
      .app-dashboard .app-dashboard-flag--placeholder{
        background: #e2e8f0;
        border-color: #cbd5e1;
      }
      .app-dashboard .app-dashboard-toolbar{
        margin-left: 12px;
        margin-right: 12px;
      }
      .app-dashboard .app-dsh-pct--up{ color: #16a34a; }
      .app-dashboard .app-dsh-pct--down{ color: #dc2626; }
      .app-dashboard .app-dashboard-td--err{
        color: #dc2626;
      }
      .app-dashboard .app-dashboard-period-btn{
        background: transparent;
        color: #64748b;
      }
      .app-dashboard .app-dashboard-period-btn--active,
      .app-dashboard .app-dashboard-period-btn--active:hover{
        color: #0f172a;
      }
      .app-dashboard .app-dashboard-period-menu{
        background: #ffffff;
        border: 1px solid #e2e8f0;
      }
      .app-dashboard .app-dashboard-period-option:hover{
        background: #f1f5f9;
      }
      .app-dashboard .app-dashboard-country-trigger,
      .app-dashboard .app-dashboard-fuel-trigger,
      .app-dashboard .app-dashboard-sort-trigger{
        border: none;
        background: #f8fafc;
        color: #0f172a;
      }
      .app-dashboard .app-dashboard-bottom-sheet-panel{
        background: #ffffff;
        box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.12);
      }
      .app-dashboard .app-dashboard-sort-option:hover,
      .app-dashboard .app-dashboard-fuel-option:hover,
      .app-dashboard .app-dashboard-country-option:hover{
        background: #f1f5f9;
      }
    }

    .app-dashboard-top{
      flex-shrink: 0;
      position: relative;
      z-index: 220;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: flex-start;
      gap: 10px;
      padding: max(10px, env(safe-area-inset-top, 0px)) 12px 12px;
      padding-left: max(12px, env(safe-area-inset-left, 0px));
      padding-right: max(12px, env(safe-area-inset-right, 0px));
      background: var(--bg);
    }
    .app-dashboard-top-brand-row{
      display: flex;
      flex-direction: row;
      align-items: center;
      flex-wrap: nowrap;
      gap: 0.5rem;
      min-width: 0;
      flex: 1 1 auto;
      justify-content: flex-start;
    }
    .app-dashboard-brand{
      min-width: 0;
      max-width: 100%;
      flex: 1 1 auto;
    }
    /** Don’t grow the wordmark — keeps lockup compact. */
    .app-dashboard-top-brand-row .app-dashboard-brand{
      flex: 0 1 auto;
    }
    .app-dashboard-brand.site-wordmark.site-wordmark-lockup{
      margin: 0;
      font-size: var(--header-lockup-font-size);
      font-weight: 600;
      line-height: 1;
      cursor: default;
    }
    .app-dashboard-brand .site-wordmark-logo{
      height: var(--header-lockup-logo-height);
      width: auto;
    }
    .app-dashboard-brand > span{
      font-size: var(--header-lockup-font-size);
      font-weight: 600;
      line-height: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    @media (max-width: 639px) {
      .app-dashboard-brand.site-wordmark.site-wordmark-lockup{
        font-size: var(--header-lockup-font-size-sm);
      }
      .app-dashboard-brand .site-wordmark-logo{
        height: var(--header-lockup-logo-height-sm);
      }
      .app-dashboard-brand > span{
        font-size: var(--header-lockup-font-size-sm);
      }
    }
    .app-dashboard-region-search-sheet-field{
      flex-shrink: 0;
      /* Top/side inset matches former sheet title so the field clears the rounded top edge. */
      padding: 14px 20px 10px;
    }
    .app-dashboard-region-search-sheet-field.search-field{
      flex: none;
      width: auto;
      min-width: 0;
      z-index: auto;
    }
    .app-dashboard-scroll{
      flex: 1;
      min-height: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      /* No top padding — padding here lets tbody paint above sticky thead in the inset. */
      padding: 0 0 max(12px, env(safe-area-inset-bottom, 0px));
      scrollbar-width: thin;
      scrollbar-color: var(--scroll-thumb) transparent;
    }
    .app-dashboard-scroll::-webkit-scrollbar{
      width: 6px;
    }
    .app-dashboard-scroll::-webkit-scrollbar-thumb{
      background: var(--scroll-thumb);
      border-radius: 999px;
    }
    .app-dashboard-scroll::-webkit-scrollbar-track{
      background: transparent;
    }
    .app-dashboard-search-suggestions{
      margin-top: 2px;
      padding: 8px 0 4px;
    }
    .app-dashboard-search-suggest-section + .app-dashboard-search-suggest-section{
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
    }
    .app-dashboard-search-suggest-head{
      margin-bottom: 6px;
    }
    .app-dashboard-search-suggest-title{
      display: block;
      font-size: 0.6875rem;
      font-weight: 600;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: var(--muted);
    }
    .app-dashboard-search-suggest-list{
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .app-dashboard-search-suggest-empty{
      font-size: 0.8125rem;
      font-weight: 400;
      color: var(--muted);
      padding: 4px 0 6px;
    }
    .app-dashboard-search-suggest-item{
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      width: 100%;
      margin: 0;
      padding: 7px 2px;
      border: none;
      border-radius: 8px;
      background: transparent;
      color: inherit;
      text-align: left;
      cursor: pointer;
      font-family: var(--font);
      font-size: 0.875rem;
      font-weight: 400;
      letter-spacing: 0.02em;
      -webkit-tap-highlight-color: transparent;
    }
    .app-dashboard-search-suggest-item:hover,
    .app-dashboard-search-suggest-item:focus-visible{
      background: color-mix(in srgb, var(--line) 45%, transparent);
      outline: none;
    }
    .app-dashboard-search-suggest-item-main{
      display: flex;
      flex-direction: row;
      align-items: flex-start;
      gap: 8px;
      min-width: 0;
      flex: 1 1 auto;
    }
    .app-dashboard-search-suggest-item-main .app-dashboard-flag{
      margin-top: 0.2em;
    }
    .app-dashboard-search-suggest-text{
      min-width: 0;
      flex: 1 1 auto;
    }
    .app-dashboard-search-suggest-primary{
      line-height: 1.25;
      word-break: normal;
      overflow-wrap: break-word;
    }
    .app-dashboard-search-suggest-sub{
      margin-top: 2px;
      font-size: 0.75rem;
      font-weight: 400;
      color: var(--muted);
      line-height: 1.2;
    }
    .app-dashboard-search-suggest-value{
      flex-shrink: 0;
      text-align: right;
      font-variant-numeric: tabular-nums;
      font-weight: 500;
      font-size: 0.8125rem;
      white-space: nowrap;
    }
    .app-dashboard-search-suggest-value .app-dsh-pct{
      font-weight: 500;
    }
    @keyframes app-dashboard-row-flash{
      0%, 100%{ background-color: transparent; }
      40%{ background-color: color-mix(in srgb, var(--orange) 20%, transparent); }
    }
    .app-dashboard-table tbody tr.app-dashboard-row.app-dashboard-row--flash{
      animation: app-dashboard-row-flash 1.25s ease-out;
    }
    .app-dashboard-toolbar{
      position: relative;
      z-index: 50;
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 6px 8px;
      margin: 0 16px 20px;
      /* Fuel + sort use fixed bottom sheets, not dropdowns in this box. */
      overflow: visible;
      padding-bottom: 2px;
    }
    /** One row: three equal flex slots so controls stay on a single line on narrow viewports. */
    .app-dashboard-toolbar-field{
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 6px 8px;
      min-width: 0;
      flex: 1 1 0;
    }
    .app-dashboard-country-dropdown,
    .app-dashboard-fuel-dropdown,
    .app-dashboard-sort-dropdown{
      position: relative;
      display: block;
      min-width: 0;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }
    .app-dashboard-sort-trigger,
    .app-dashboard-country-trigger,
    .app-dashboard-fuel-trigger{
      margin: 0;
      width: 100%;
      padding: 5px 8px;
      border-radius: 6px;
      border: none;
      background: var(--surface);
      color: var(--text);
      font-family: var(--font);
      font-size: 0.75rem;
      font-weight: 500;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
      justify-content: flex-start;
      text-align: left;
    }
    .app-dashboard-sort-trigger-row{
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
      flex: 1 1 auto;
      width: 0;
    }
    .app-dashboard-sort-trigger-icon{
      display: flex;
      flex-shrink: 0;
      align-items: center;
      justify-content: center;
      color: var(--metric-k);
    }
    .app-dashboard-sort-trigger-icon svg{
      display: block;
    }
    .app-dashboard-sort-trigger-label,
    .app-dashboard-country-trigger-label,
    .app-dashboard-fuel-trigger-label{
      flex: 1 1 auto;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .app-dashboard-sort-trigger::after,
    .app-dashboard-country-trigger::after,
    .app-dashboard-fuel-trigger::after{
      content: '▾';
      flex-shrink: 0;
      margin-left: 4px;
      font-size: 0.65em;
      opacity: 0.5;
      line-height: 1;
    }
    .app-dashboard-bottom-sheet{
      position: fixed;
      inset: 0;
      /* Below fixed top chrome (.topbar / .app-dashboard-top at z-index 220). */
      z-index: 200;
    }
    .app-dashboard-bottom-sheet-backdrop{
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      border: none;
      background: rgba(15, 23, 42, 0.42);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    @media (prefers-color-scheme: dark) {
      .app-dashboard-bottom-sheet-backdrop{
        background: rgba(0, 0, 0, 0.58);
      }
    }
    .app-dashboard-bottom-sheet-panel{
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 1;
      display: flex;
      flex-direction: column;
      min-height: 0;
      max-height: min(72vh, 560px);
      border-radius: 20px 20px 0 0;
      background: var(--surface);
      box-shadow: 0 -12px 48px rgba(15, 23, 42, 0.18);
      padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
      animation: app-dashboard-sheet-in 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    }
    /* Same frosted treatment as map `.sheet` (country/region detail pull-up). */
    .app-dashboard-bottom-sheet-panel.app-dashboard-bottom-sheet-panel--sheet-frost{
      border-radius: 26px 26px 36px 36px;
      border: 1px solid var(--sheet-frost-stroke);
      background: linear-gradient(
        to bottom,
        var(--sheet-frost-fill) 0%,
        var(--sheet-frost-fill) 50%,
        transparent 100%
      );
      backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      -webkit-backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      box-shadow: var(--shadow);
    }
    @keyframes app-dashboard-sheet-in{
      from{
        transform: translateY(100%);
      }
      to{
        transform: translateY(0);
      }
    }
    .app-dashboard-bottom-sheet-handle{
      flex-shrink: 0;
      padding: 10px 16px 6px;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .app-dashboard-bottom-sheet-handle-bar{
      display: block;
      width: 40px;
      height: 5px;
      margin: 0 auto;
      border-radius: 999px;
      background: var(--line);
      opacity: 0.85;
    }
    .app-dashboard-bottom-sheet-title{
      margin: 0;
      padding: 2px 20px 14px;
      font-family: var(--font);
      font-size: 1rem;
      font-weight: 600;
      letter-spacing: -0.02em;
      text-align: center;
      color: var(--text);
    }
    .app-dashboard-bottom-sheet-list{
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      flex: 1 1 auto;
      min-height: 0;
      padding: 0 8px 4px;
    }
    .app-dashboard-sort-sheet-list,
    .app-dashboard-fuel-sheet-list,
    .app-dashboard-period-sheet-list{
      /* Dead space so the last option isn't flush against the sheet edge / home indicator. */
      padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }
    .app-dashboard-country-sheet-list{
      padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
    .app-dashboard-sort-option,
    .app-dashboard-fuel-option{
      display: block;
      width: 100%;
      margin: 0;
      padding: 14px 16px;
      border: none;
      border-radius: 0;
      border-bottom: 1px solid var(--hairline);
      background: transparent;
      color: var(--text);
      font-family: var(--font);
      font-size: 0.9375rem;
      font-weight: 600;
      text-align: left;
      letter-spacing: 0.01em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      position: relative;
      box-sizing: border-box;
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
    }
    .app-dashboard-country-option{
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      margin: 0;
      padding: 12px 44px 12px 16px;
      border: none;
      border-radius: 0;
      border-bottom: none;
      background: transparent;
      color: var(--text);
      font-family: var(--font);
      font-size: 0.9375rem;
      font-weight: 400;
      text-align: left;
      letter-spacing: 0.01em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      position: relative;
      box-sizing: border-box;
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
    }
    .app-dashboard-country-option-label{
      flex: 1 1 auto;
      min-width: 0;
      text-align: left;
    }
    .app-dashboard-country-option-flag{
      flex-shrink: 0;
      align-self: center;
      width: 24px;
      height: 24px;
      min-width: 24px;
      min-height: 24px;
      aspect-ratio: 1;
      border-radius: 50%;
      overflow: hidden;
      box-sizing: border-box;
    }
    /* flag-icons `.fi.fis` sets `width: 1em` (beats single class); lock a square box + circle clip */
    .app-dashboard-country-option-flag.fi{
      display: block;
      line-height: 0;
      width: 24px;
      height: 24px;
      min-width: 24px;
      min-height: 24px;
      background-size: cover;
      background-position: 50% 50%;
    }
    .app-dashboard-country-option-flag.fi::before{
      display: none;
    }
    .app-dashboard-country-option-flag--spacer{
      pointer-events: none;
    }
    .app-dashboard-country-option-flag--placeholder{
      background: color-mix(in srgb, var(--muted) 35%, var(--surface));
      border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    }
    @media (prefers-color-scheme: dark) {
      .app-dashboard-country-option-flag--placeholder{
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.14);
      }
    }
    .app-dashboard-fuel-option[aria-selected='true']::after{
      content: '✓';
      position: absolute;
      right: 16px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 0.95em;
      color: color-mix(in srgb, var(--muted) 75%, var(--text));
      opacity: 0.9;
    }
    .app-dashboard-country-option[aria-selected='true']::after{
      content: '✓';
      position: absolute;
      right: 16px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 0.95em;
      color: color-mix(in srgb, var(--muted) 75%, var(--text));
      opacity: 0.9;
    }
    .app-dashboard-bottom-sheet-list [role='option']:last-child{
      border-bottom: none;
    }
    .app-dashboard-sort-option:hover,
    .app-dashboard-fuel-option:hover,
    .app-dashboard-country-option:hover{
      background: var(--menu-hover);
    }
    .app-dashboard-sort-option:focus-visible,
    .app-dashboard-fuel-option:focus-visible,
    .app-dashboard-country-option:focus-visible{
      outline: 2px solid rgba(255, 106, 0, 0.45);
      outline-offset: 0;
    }
    .app-dashboard-fuel-trigger:focus-visible,
    .app-dashboard-country-trigger:focus-visible,
    .app-dashboard-sort-trigger:focus-visible{
      outline: 2px solid rgba(255, 106, 0, 0.45);
      outline-offset: 2px;
    }
    /* Region search + map country search: tall bottom sheets (shared panel animation). */
    .app-dashboard-region-search-sheet,
    .app-country-search-sheet{
      z-index: 200;
    }
    .app-dashboard-region-search-sheet-panel.app-dashboard-bottom-sheet-panel,
    .app-country-search-sheet-panel.app-dashboard-bottom-sheet-panel{
      /* `dvh` tracks the on-screen keyboard; it shrinks while typing and was collapsing these sheets.
         `lvh` keeps a stable ceiling; `min-height` keeps short filter results from shrinking the card. */
      min-height: min(50lvh, 520px);
      max-height: min(92lvh, 760px);
      --pull-sheet-side-inset: 20px;
      --pull-sheet-top-radius: 20px;
      left: auto;
      right: auto;
      margin-left: auto;
      margin-right: auto;
      width: calc(100% - 2 * var(--pull-sheet-side-inset, 0px));
      border-radius: var(--pull-sheet-top-radius, 20px) var(--pull-sheet-top-radius, 20px) 0 0;
    }
    /* Search pull-ups: no top drag pill — field top padding clears the rounded top edge. */
    .app-country-search-sheet-query{
      flex-shrink: 0;
      padding: 14px max(12px, env(safe-area-inset-left, 0px)) 10px max(12px, env(safe-area-inset-right, 0px));
    }
    .app-country-search-sheet-query .search-field{
      margin: 0;
    }
    .app-dashboard-region-search-sheet-field .search,
    .app-country-search-sheet-query .search{
      min-height: 44px;
      height: auto;
      padding: 0 4px;
      border: none;
      border-bottom: 1px solid var(--sheet-frost-stroke);
      border-radius: 0;
      background: transparent;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      box-shadow: none;
    }
    .app-dashboard-region-search-sheet-field .search:focus-within,
    .app-country-search-sheet-query .search:focus-within{
      border-bottom-color: color-mix(in srgb, var(--orange) 65%, var(--sheet-frost-stroke));
      outline: 2px solid rgba(255, 106, 0, 0.45);
      outline-offset: 2px;
    }
    .app-dashboard-region-search-sheet-scroll,
    .app-country-search-sheet-scroll{
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      touch-action: pan-y;
      -webkit-overflow-scrolling: touch;
      padding-top: 0;
      padding-right: max(12px, env(safe-area-inset-right, 0px));
      padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
      padding-left: max(12px, env(safe-area-inset-left, 0px));
    }
    body:has(.app-liquid-nav) .app-dashboard-region-search-sheet-scroll,
    body:has(.app-liquid-nav) .app-country-search-sheet-scroll{
      /* Nav (z-index 220) stacks above these sheets (z-index 200); match
         `body:has(.app-liquid-nav) .app-dashboard-scroll` so the last row can scroll clear. */
      padding-bottom: max(
        16px,
        calc(80px + env(safe-area-inset-bottom, 0px))
      );
    }
    .app-dashboard-search-filtered-wrap{
      margin-top: 4px;
    }
    .app-country-search-sheet-menu.search-menu{
      position: relative;
      left: auto;
      right: auto;
      top: auto;
      z-index: 0;
      display: block;
      max-height: none;
      margin-top: 8px;
      border-radius: 14px;
      border: 1px solid var(--sheet-frost-stroke);
      background: color-mix(in srgb, var(--sheet-frost-fill) 92%, transparent);
      backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      -webkit-backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      box-shadow: var(--shadow);
    }
    .app-country-search-sheet-menu .search-item:hover,
    .app-country-search-sheet-menu .search-item:focus-visible,
    .app-country-search-sheet-menu .search-item.active{
      background: var(--menu-hover);
      outline: none;
      color: var(--text);
    }
    .app-country-search-sheet-menu .search-item:hover .search-item-chevron,
    .app-country-search-sheet-menu .search-item:focus-visible .search-item-chevron,
    .app-country-search-sheet-menu .search-item.active .search-item-chevron{
      color: inherit;
      opacity: 0.9;
    }
    @media (prefers-color-scheme: dark) {
      .app-country-search-sheet-menu .search-item:hover,
      .app-country-search-sheet-menu .search-item:focus-visible,
      .app-country-search-sheet-menu .search-item.active{
        color: #fff;
      }
    }
    .app-country-search-sheet .app-dashboard-bottom-sheet-panel{
      padding-left: 0;
      padding-right: 0;
    }

    /* Row-detail pull-up sheet — opens when a dashboard table row is tapped. The body
       is an iframe loading `app.html?cards=1&country=<id>` so the cards are
       byte-for-byte identical to the map view. The panel borrows the same frosted
       glass treatment as the map's `.sheet` for visual parity. */
    .app-dashboard-detail-sheet{
      z-index: 130;
    }
    /* Quarter/half card: sheet + backdrop ignore pointers so the list behind can scroll.
       Full-height card removes this class — backdrop behaves like a normal modal scrim again. */
    .app-dashboard-detail-sheet.app-dashboard-detail-sheet--peek{
      pointer-events: none;
    }
    .app-dashboard-detail-sheet.app-dashboard-detail-sheet--peek .app-dashboard-detail-sheet-backdrop{
      pointer-events: none;
    }
    .app-dashboard-detail-sheet.app-dashboard-detail-sheet--peek .app-dashboard-detail-sheet-panel{
      pointer-events: auto;
    }
    /* Drop the dark scrim so the dashboard table behind the panel is what gets
       blurred — that's what makes the frost effect visible. A tap anywhere on the
       (now invisible) backdrop still closes the sheet. */
    .app-dashboard-detail-sheet .app-dashboard-bottom-sheet-backdrop{
      background: transparent;
    }
    @media (prefers-color-scheme: dark){
      .app-dashboard-detail-sheet .app-dashboard-bottom-sheet-backdrop{
        background: transparent;
      }
    }
    .app-dashboard-detail-sheet .app-dashboard-bottom-sheet-panel{
      /* Same three stops as map `app.html` sheet: ~¼ / ~½ / expanded (`--dashboard-detail-sheet-h`). */
      min-height: 0;
      height: var(--dashboard-detail-sheet-h, 50vh);
      max-height: calc(100dvh - 72px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
      padding: 0;
      /* Fixed bottom nav (z-index 220) covers the panel's bottom strip. Pad the panel
         so the iframe's flex: 1 child shrinks and stops above the nav, instead of
         letting the chart card's axis labels sit underneath it. Padding lives on the
         panel (not the iframe scroll container) so it works whether the cards overflow or not. */
      padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
      overflow: hidden;
      border-radius: 26px 26px 0 0;
      border: 1px solid var(--sheet-frost-stroke);
      border-bottom: none;
      /* Frost tapers toward the bottom so the dashboard table reads through softly. */
      background: linear-gradient(
        to bottom,
        var(--sheet-frost-fill) 0%,
        var(--sheet-frost-fill) 70%,
        color-mix(in srgb, var(--sheet-frost-fill) 65%, transparent) 100%
      );
      backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      -webkit-backdrop-filter: blur(var(--sheet-frost-blur)) saturate(175%);
      box-shadow: var(--shadow);
    }
    .app-dashboard-detail-sheet .app-dashboard-bottom-sheet-handle{
      /* Drag-down-to-dismiss is bound to the handle; let the browser yield vertical
         gestures to our pointer handlers instead of treating them as page scroll. */
      touch-action: none;
      padding: 12px 16px 8px;
      cursor: grab;
    }
    .app-dashboard-detail-sheet .app-dashboard-bottom-sheet-handle:active{
      cursor: grabbing;
    }
    .app-dashboard-detail-sheet .app-dashboard-bottom-sheet-handle-bar{
      background: var(--grab, var(--line));
      opacity: 0.85;
    }
    .app-dashboard-detail-sheet-sr-title{
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .app-dashboard-detail-frame{
      flex: 1 1 auto;
      width: 100%;
      min-height: 0;
      border: 0;
      background: transparent;
      display: block;
      color-scheme: light dark;
    }
    .app-dashboard-table-outer{
      margin: 0 8px;
      /* `overflow: hidden` breaks `position: sticky` on thead in many browsers */
      overflow: visible;
      max-width: 100%;
      border-radius: 12px;
      border: none;
      background: transparent;
      box-shadow: none;
      box-sizing: border-box;
    }
    .app-dashboard-table{
      width: 100%;
      max-width: 100%;
      table-layout: fixed;
      min-width: 0;
      /* `collapse` breaks sticky header backgrounds in WebKit/Blink — rows bleed through. */
      border-collapse: separate;
      border-spacing: 0;
      font-size: 0.72rem;
    }
    .app-dashboard-th{
      text-align: left;
      padding: 6px 3px;
      font-weight: 600;
      font-size: 0.58rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--metric-k);
      border-bottom: 1px solid var(--hairline);
      white-space: normal;
      word-break: break-word;
      hyphens: auto;
      line-height: 1.2;
    }
    .app-dashboard-th--rank{
      width: 1.65rem;
      text-align: left;
      font-size: 0.55rem;
      padding-left: 2px;
      padding-right: 2px;
    }
    .app-dashboard-th--name{
      width: 38%;
    }
    .app-dashboard-th--sortable{
      padding: 4px 3px;
    }
    .app-dashboard-col-head-btn{
      margin: 0;
      padding: 2px 0;
      width: 100%;
      box-sizing: border-box;
      border: none;
      background: transparent;
      font: inherit;
      font-size: inherit;
      font-weight: inherit;
      letter-spacing: inherit;
      text-transform: inherit;
      color: inherit;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .app-dashboard-th--sortable.app-dashboard-th--name .app-dashboard-col-head-btn{
      text-align: left;
    }
    .app-dashboard-th--sortable.app-dashboard-th--price .app-dashboard-col-head-btn{
      text-align: right;
    }
    .app-dashboard-col-head-btn:hover{
      color: var(--text);
    }
    .app-dashboard-th--sortable .app-dashboard-col-head-btn--active,
    .app-dashboard-th--sortable .app-dashboard-col-head-btn--active:hover{
      color: var(--text);
      font-weight: 700;
    }
    .app-dashboard-col-head-btn:focus-visible{
      outline: 2px solid rgba(255, 106, 0, 0.45);
      outline-offset: 2px;
      border-radius: 4px;
    }
    .app-dashboard-th--price{
      text-align: right;
      width: 24%;
    }
    .app-dashboard-th--chg{
      text-align: right;
      min-width: 0;
      width: 32%;
    }
    .app-dashboard-table tbody{
      position: relative;
      z-index: 0;
    }
    .app-dashboard-table tbody tr.app-dashboard-row{
      cursor: pointer;
      transition: background-color 120ms ease;
    }
    .app-dashboard-table tbody tr.app-dashboard-row:hover,
    .app-dashboard-table tbody tr.app-dashboard-row:focus-visible{
      background: var(--menu-hover, rgba(0, 0, 0, 0.04));
    }
    .app-dashboard-table tbody tr.app-dashboard-row:focus-visible{
      outline: 2px solid var(--metric-k, currentColor);
      outline-offset: -2px;
    }
    .app-dashboard-table thead th{
      position: sticky;
      top: 0;
      z-index: 20;
      background: var(--bg);
      background-clip: padding-box;
    }
    .app-dashboard-th--period{
      text-transform: none;
      vertical-align: bottom;
      white-space: normal;
    }
    .app-dashboard-period-head{
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      align-items: center;
      min-width: 0;
    }
    .app-dashboard-period-dropdown{
      position: relative;
      display: inline-block;
      max-width: 100%;
    }
    .app-dashboard-period-btn{
      margin: 0;
      padding: 3px 5px 3px 6px;
      border-radius: 6px;
      border: none;
      background: transparent;
      color: var(--metric-k);
      font-family: var(--font);
      font-size: 0.62rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      display: inline-flex;
      align-items: center;
      gap: 2px;
      max-width: 100%;
    }
    .app-dashboard-period-btn:hover{
      color: var(--text);
    }
    .app-dashboard-period-btn--active,
    .app-dashboard-period-btn--active:hover{
      color: var(--text);
      font-weight: 700;
    }
    .app-dashboard-period-btn::after{
      content: '▾';
      font-size: 0.65em;
      opacity: 0.5;
      line-height: 1;
    }
    .app-dashboard-period-btn:focus-visible{
      outline: 2px solid rgba(255, 106, 0, 0.45);
      outline-offset: 2px;
    }
    .app-dashboard-period-option{
      display: block;
      width: 100%;
      margin: 0;
      padding: 8px 12px;
      border: none;
      border-radius: 6px;
      background: transparent;
      color: var(--text);
      font-family: var(--font);
      font-size: 0.8125rem;
      font-weight: 600;
      text-align: left;
      letter-spacing: 0.02em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .app-dashboard-period-option:hover{
      background: var(--menu-hover);
    }
    .app-dashboard-period-option:focus-visible{
      outline: 2px solid rgba(255, 106, 0, 0.45);
      outline-offset: 0;
    }
    .app-dashboard-td{
      padding: 7px 3px;
      vertical-align: middle;
      border-bottom: 1px solid var(--hairline);
      color: var(--text);
    }
    .app-dashboard-td--rank{
      text-align: left;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
      font-size: 0.62rem;
      line-height: 1.3;
    }
    .app-dashboard-td--name{
      font-weight: 500;
      max-width: none;
    }
    .app-dashboard-region-cell{
      display: flex;
      align-items: flex-start;
      gap: 4px;
      min-width: 0;
    }
    .app-dashboard-flag{
      flex-shrink: 0;
      align-self: center;
      width: 14px;
      height: 14px;
      min-width: 14px;
      min-height: 14px;
      aspect-ratio: 1;
      margin-top: 0.1em;
      border-radius: 50%;
      overflow: hidden;
      box-sizing: border-box;
    }
    .app-dashboard-flag.fi{
      display: block;
      line-height: 0;
      width: 14px;
      height: 14px;
      min-width: 14px;
      min-height: 14px;
      background-size: cover;
      background-position: 50% 50%;
    }
    .app-dashboard-flag.fi::before{
      display: none;
    }
    .app-dashboard-flag--placeholder{
      background: color-mix(in srgb, var(--muted) 35%, var(--surface));
      border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    }
    @media (prefers-color-scheme: dark) {
      .app-dashboard-flag--placeholder{
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.14);
      }
    }
    .app-dashboard-region-label{
      min-width: 0;
      overflow: visible;
      white-space: normal;
      /* Wrap at word boundaries only; avoid hyphenating mid-word (e.g. "Semenan-jung"). */
      word-break: normal;
      overflow-wrap: break-word;
      hyphens: manual;
      line-height: 1.25;
    }
    .app-dashboard-td--price{
      text-align: right;
      font-variant-numeric: tabular-nums;
      font-weight: 500;
      white-space: nowrap;
    }
    .app-dashboard-td--chg{
      text-align: right;
    }
    .app-dashboard-td .app-dsh-pct{
      display: inline-block;
      text-align: right;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }
    .app-dsh-pct--up{ color: #15803d; }
    .app-dsh-pct--down{ color: #b91c1c; }
    .app-dsh-pct--flat{ color: var(--muted); }
    .app-dsh-pct--na{ color: var(--muted); }
    @media (prefers-color-scheme: dark) {
      .app-dsh-pct--up{ color: #4ade80; }
      .app-dsh-pct--down{ color: #f87171; }
    }
    .app-dashboard-td--err{
      text-align: center;
      padding: 24px;
      color: #b91c1c;
    }
    @media (prefers-color-scheme: dark) {
      .app-dashboard-td--err{
        color: #f87171;
      }
    }
    .app-dashboard-foot{
      margin: 12px 16px 0;
      font-size: 0.65rem;
      color: var(--muted);
    }

    @media (max-width: 420px) {
      .app-dashboard-table{
        font-size: 0.68rem;
      }
      .app-dashboard-th{
        font-size: 0.54rem;
        padding: 5px 2px;
      }
      .app-dashboard-td{
        padding: 6px 2px;
      }
      .app-dashboard-period-btn{
        font-size: 0.58rem;
        padding: 2px 4px;
      }
    }

    /* Settings (highlight USD toggle) */
    /* Settings pull-up sheet — rides on top of the shared .app-dashboard-bottom-sheet* base. */
    .app-settings-sheet{
      /* Sit behind the bottom tab bar (z-index 220) so the bar stays tappable. */
      z-index: 130;
    }
    .app-settings-sheet .app-dashboard-bottom-sheet-panel{
      /* Taller than the dashboard sheets since the content is sparse and
         the sheet should feel like a proper settings surface, not a menu. */
      min-height: min(60vh, 520px);
      max-height: min(85vh, 680px);
    }
    .app-settings-sheet-header{
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 2px 14px 10px 20px;
    }
    .app-settings-sheet-header .app-settings-sheet-title{
      padding: 0;
      text-align: left;
    }
    .app-settings-close{
      flex-shrink: 0;
      width: 36px;
      height: 36px;
      margin: 0;
      padding: 0;
      border: none;
      border-radius: 999px;
      background: var(--menu-hover);
      color: var(--text);
      font-size: 1.25rem;
      line-height: 1;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .app-settings-close:focus-visible{
      outline: 2px solid var(--orange);
      outline-offset: 2px;
    }
    .app-settings-sheet-body{
      /* Extra bottom padding so content clears the flush bottom tab bar. */
      padding: 6px 20px calc(100px + env(safe-area-inset-bottom, 0px));
      display: flex;
      flex-direction: column;
      gap: 18px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .app-settings-sheet-row{
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }
    .app-settings-sheet-copy{
      flex: 1;
      min-width: 0;
    }
    .app-settings-sheet-label{
      font-size: 1rem;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--text);
    }
    .app-settings-switch{
      position: relative;
      flex-shrink: 0;
      width: 52px;
      height: 32px;
      margin-top: 2px;
      cursor: pointer;
    }
    .app-settings-switch input{
      position: absolute;
      opacity: 0;
      width: 0;
      height: 0;
    }
    .app-settings-switch-ui{
      position: relative;
      display: block;
      width: 100%;
      height: 100%;
      border-radius: 999px;
      background: var(--menu-hover);
      border: 1px solid var(--line);
      transition: background 0.2s ease;
    }
    .app-settings-switch-ui::after{
      content: '';
      position: absolute;
      top: 4px;
      left: 4px;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: var(--surface);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
      transition: transform 0.2s ease;
    }
    .app-settings-switch input:checked + .app-settings-switch-ui{
      background: rgba(255, 106, 0, 0.35);
      border-color: rgba(255, 106, 0, 0.55);
    }
    .app-settings-switch input:checked + .app-settings-switch-ui::after{
      transform: translateX(20px);
      background: var(--orange);
    }
    .app-settings-switch input:focus-visible + .app-settings-switch-ui{
      outline: 2px solid var(--orange);
      outline-offset: 3px;
    }
