    /* =================== TYPE SYSTEM ===================
       Two faces, two roles, nothing else.

       H1 is the one big title on a screen: the country on a destination
       card, the destination hero line, a screen title, the gallery title,
       the map sheet title.
       H2 is every heading below that: card titles, section headings, list
       rows, chip labels.
       Everything that is not a heading — blurbs, meta, chips, buttons,
       inputs, eyebrows — stays in the body sans and is outside this.

       Each title declares the size it wants at scale 1 in --t-size, and
       the two role rules scale from there, so one interpretation resizes
       the whole ladder without touching any element. Blazter's cap height
       runs short of Jakarta's, which is why every Blazter scale below
       sits above 1.

       The display face is reserved for where a place is named: the country
       on a card, the destination hero line, the gallery and map sheet
       titles. Everything else in the ladder is set in the sans. */
    :root {
      --display: 'Blazter', Impact, sans-serif;
      --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    }

    /* --- each title's size at scale 1 --- */
    .card-title          { --t-size: 22px; }
    .section-title       { --t-size: var(--section-title-size, 21px); }
    .detail-header-title { --t-size: var(--detail-title-size, 23px); }
    .screen-title        { --t-size: 24px; }
    .gallery-title       { --t-size: 22px; }
    .map-sheet-title     { --t-size: 17px; }
    .wordmark            { --t-size: 19px; }
    .fc-title            { --t-size: var(--fc-title-size, 19px); }
    .body-section-title  { --t-size: 15px; }
    .tour-name           { --t-size: 14px; }
    .map-poi-name        { --t-size: 13.5px; }
    .search-row-main     { --t-size: 14px; }
    .sheet-row           { --t-size: 15.5px; }
    .chip-label          { --t-size: 13px; }

    /* --- H1 --- */
    .card-title,
    .fc-title.dest-title,
    .section-title,
    .detail-header-title,
    .screen-title,
    .gallery-title,
    .map-sheet-title {
      font-family: var(--h1-font);
      font-weight: var(--h1-weight);
      font-size: calc(var(--t-size) * var(--h1-scale));
      letter-spacing: var(--h1-track);
      line-height: var(--h1-leading);
      text-transform: var(--h1-case);
    }

    /* --- H2 --- */
    .fc-title,
    .body-section-title,
    .tour-name,
    .map-poi-name,
    .search-row-main,
    .sheet-row,
    .chip-label,
    .wordmark {
      font-family: var(--h2-font);
      font-weight: var(--h2-weight);
      font-size: calc(var(--t-size) * var(--h2-scale));
      letter-spacing: var(--h2-track);
      line-height: var(--h2-leading);
      text-transform: var(--h2-case);
    }

    /* Place Names — the display face only where a place is named. Screen
       titles step back to a large, tight sans, so the display face earns
       its place by meaning rather than by level. */
    body {
      --h1-font: var(--display); --h1-weight: 400; --h1-scale: 1.34;
      --h1-track: 0.5px; --h1-leading: 1; --h1-case: none;
      --h2-font: var(--sans); --h2-weight: 800; --h2-scale: 1;
      --h2-track: -0.3px; --h2-leading: 1.2; --h2-case: none;
    }

    .screen-title,
    .section-title {
      font-family: var(--sans);
      font-weight: 800;
      font-size: calc(var(--t-size) * 1.08);
      letter-spacing: -0.55px;
      line-height: 1.15;
    }

    /* =================== DAY / NIGHT SWITCH ===================
       A pill that sits to the left of the menu button: a sun and a moon in
       one track, with the accent knob parked over whichever one is live.
       It rides in .home-topbar, in every .screen-head, and as a floating
       control on the detail screen, so it is reachable from any screen.

       All three copies are built from one template in the script and read
       their state from data-theme on <body>, so they never fall out of
       step with each other. */
    .theme-toggle {
      position: relative;
      width: 60px;
      height: 34px;
      flex-shrink: 0;
      padding: 0;
      border: none;
      border-radius: 17px;
      background: var(--surface);
      box-shadow: 0 4px 14px rgba(var(--shade-rgb), 0.18),
                  inset 0 0 0 1px var(--hairline);
      cursor: pointer;
      transition: transform 0.15s ease, background 0.4s ease, box-shadow 0.4s ease;
      -webkit-tap-highlight-color: transparent;
    }

    .theme-toggle:active {
      transform: scale(0.94);
    }

    .theme-toggle:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    /* The knob. Overshoots a touch on the way across, which is what makes
       the switch feel like a switch rather than a fade. */
    .tt-knob {
      position: absolute;
      top: 3px;
      left: 3px;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--accent);
      box-shadow: 0 2px 6px rgba(var(--shade-rgb), 0.32);
      transition: transform 0.42s cubic-bezier(0.34, 1.4, 0.5, 1), background 0.4s ease;
    }

    body[data-theme="dark"] .tt-knob {
      transform: translateX(26px);
    }

    .tt-icon {
      position: absolute;
      top: 3px;
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--ink-4);
      pointer-events: none;
      transition: color 0.3s ease;
    }

    .tt-icon svg {
      width: 15px;
      height: 15px;
      display: block;
    }

    .tt-sun { left: 3px; }
    .tt-moon { left: 29px; }

    /* Whichever icon the knob is parked on is drawn on the accent. */
    .tt-sun { color: var(--on-accent); }
    body[data-theme="dark"] .tt-sun { color: var(--ink-4); }
    body[data-theme="dark"] .tt-moon { color: var(--on-accent); }

    /* In the home bar the row is centred, so the pill needs no nudge. In a
       .screen-head everything hangs from the top, and the menu button's
       margin-left: auto moves to the pill so the pair still sits right. */
    .screen-head .theme-toggle {
      margin-left: auto;
      margin-top: 8px;
    }

    .screen-head .theme-toggle + .menu-btn.head-menu {
      margin-left: 0;
    }

    .home-topbar .theme-toggle {
      margin-left: auto;
      margin-right: 10px;
    }

    /* The detail screen has no header bar: its back and menu buttons float
       over the illustration. The switch floats with them, on the same
       show-and-hide as .back-floating-btn. */
    .theme-toggle.theme-floating {
      position: fixed;
      top: max(16px, env(safe-area-inset-top));
      right: 68px;
      z-index: 70;
      margin: 4px 0 0;
      opacity: 0;
      transform: scale(0.65) translateY(-6px);
      transition: opacity 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
                  transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
                  background 0.4s ease, box-shadow 0.4s ease;
      pointer-events: none;
    }

    .theme-toggle.theme-floating.nav-btn-visible {
      opacity: 1;
      transform: scale(1) translateY(0);
      pointer-events: auto;
    }

    .theme-toggle.theme-floating:active {
      transform: scale(0.92) translateY(0);
    }

    .card-sub {
      font-size: 12.5px;
      color: var(--ink-2);
      margin-top: 4px;
      font-weight: 600;
    }

    /* =================== SCENE PALETTES ===================
       The six scenes every non-destination illustration is drawn from. They
       used to be a table of literal colours in the script, in a pastel
       family of their own, which is why the rest of the app stopped looking
       like the home screen. Now they are custom properties on the <svg>, so
       a scene re-colours the instant the theme changes and always sits in
       the same family as the ground under it.

       Six variants rather than one keeps a grid of cards from reading flat;
       they differ by tone, not by hue, so nothing fights the theme.

       The destination cards do not come through here — they draw from the
       flag table below and are the one thing both themes leave alone. */
    svg[data-pal="clay"] {
      --p-sky-a: #FDF5E2; --p-sky-b: #F6E7C2; --p-sky-c: #EBD199; --p-sun: #E0A538;
      --p-hill-1: #CC9F62; --p-hill-2: #AB7B42; --p-hill-3: #80572A;
    }

    svg[data-pal="lagoon"] {
      --p-sky-a: #FBF2DA; --p-sky-b: #F1E3B6; --p-sky-c: #DEC98C; --p-sun: #D9A02F;
      --p-hill-1: #BCA257; --p-hill-2: #8E7C3A; --p-hill-3: #605524;
    }

    svg[data-pal="forest"] {
      --p-sky-a: #F7F2DE; --p-sky-b: #E9E5C0; --p-sky-c: #D3CE99; --p-sun: #C2B55E;
      --p-hill-1: #7F8C57; --p-hill-2: #59683C; --p-hill-3: #374327;
    }

    svg[data-pal="rose"] {
      --p-sky-a: #FDF1E0; --p-sky-b: #F7DDC8; --p-sky-c: #E9C1A5; --p-sun: #D97B41;
      --p-hill-1: #CB916D; --p-hill-2: #A7644C; --p-hill-3: #764131;
    }

    svg[data-pal="reef"] {
      --p-sky-a: #FCF0D4; --p-sky-b: #F5E1AA; --p-sky-c: #EAC273; --p-sun: #DE912C;
      --p-hill-1: #AB7C3E; --p-hill-2: #805C2C; --p-hill-3: #543B1C;
    }

    svg[data-pal="dusk"] {
      --p-sky-a: #FBEBD0; --p-sky-b: #F1D1A2; --p-sky-c: #DDA670; --p-sun: #C26421;
      --p-hill-1: #B26D3A; --p-hill-2: #8C4C24; --p-hill-3: #5E3116;
    }

    /* The same six after dark: the sky drops to a warm near-black, the sun
       keeps the theme's gold, and the strata read as bands of shadow. */
    body[data-theme="dark"] svg[data-pal="clay"] {
      --p-sky-a: #3A2F22; --p-sky-b: #2A2218; --p-sky-c: #1C170F; --p-sun: #F0B429;
      --p-hill-1: #4C3C28; --p-hill-2: #34291C; --p-hill-3: #211912;
    }

    body[data-theme="dark"] svg[data-pal="lagoon"] {
      --p-sky-a: #34311F; --p-sky-b: #272516; --p-sky-c: #1A1810; --p-sun: #E8C24A;
      --p-hill-1: #47452C; --p-hill-2: #31301E; --p-hill-3: #1F1E13;
    }

    body[data-theme="dark"] svg[data-pal="forest"] {
      --p-sky-a: #273125; --p-sky-b: #1D261C; --p-sky-c: #141B13; --p-sun: #CBD46A;
      --p-hill-1: #394931; --p-hill-2: #283322; --p-hill-3: #192215;
    }

    body[data-theme="dark"] svg[data-pal="rose"] {
      --p-sky-a: #3C2B25; --p-sky-b: #2C1F1B; --p-sky-c: #1E1512; --p-sun: #E88A52;
      --p-hill-1: #4E352C; --p-hill-2: #37251E; --p-hill-3: #231814;
    }

    body[data-theme="dark"] svg[data-pal="reef"] {
      --p-sky-a: #3B2F1E; --p-sky-b: #2B2216; --p-sky-c: #1D170F; --p-sun: #F0A52A;
      --p-hill-1: #4D3C22; --p-hill-2: #362A17; --p-hill-3: #231B0F;
    }

    body[data-theme="dark"] svg[data-pal="dusk"] {
      --p-sky-a: #3D2B1D; --p-sky-b: #2D1F15; --p-sky-c: #1F150E; --p-sun: #D9722A;
      --p-hill-1: #55351F; --p-hill-2: #3C2415; --p-hill-3: #261709;
    }

    /* =================== DESTINATION PALETTE ===================
       Every destination illustration draws its colours from the same eleven
       slots, so one table colours all of them: the carousel card art
       ([data-id]), the Destinations grid card and the expanded hero art
       ([data-dest]).

       sky-a/b/c  gradient stops, top to bottom
       sun        the sun or celestial disc
       band-1/2   mid-layer land or water bands
       band-3/4   foreground land or water bands
       motif-a/b/c  the landmark: tree, boat, mountain, waterfall

       The values are each country flag, flat and saturated. */

    [data-id="angola"],
    [data-dest="angola"] {
      --sky-a: #FFE9A3; --sky-b: #FFC400; --sky-c: #D81E34; --sun: #B00D22;
      --band-1: #CE1126; --band-2: #8E0A1A; --band-3: #1A1A1A; --band-4: #CE1126;
      --motif-a: #000000; --motif-b: #000000; --motif-c: #FFCB00;
    }

    [data-id="jamaica"],
    [data-dest="jamaica"] {
      --sky-a: #FFF07A; --sky-b: #FED100; --sky-c: #00A34A; --sun: #009B3A;
      --band-1: #007A2E; --band-2: #00561F; --band-3: #131313; --band-4: #FED100;
      --motif-a: #000000; --motif-b: #007A2E; --motif-c: #FED100;
    }

    [data-id="senegal"],
    [data-dest="senegal"] {
      --sky-a: #FFF9A8; --sky-b: #FDEF42; --sky-c: #E31B23; --sun: #00853F;
      --band-1: #E31B23; --band-2: #A81119; --band-3: #00853F; --band-4: #F4E04D;
      --motif-a: #0A0A0A; --motif-b: #A81119; --motif-c: #FDEF42;
    }

    [data-id="cote_divoire"],
    [data-dest="cote_divoire"] {
      --sky-a: #FFFFFF; --sky-b: #FFC880; --sky-c: #F77F00; --sun: #FFFFFF;
      --band-1: #FFFFFF; --band-2: #E4E4E4; --band-3: #F77F00; --band-4: #009E60;
      --motif-a: #1A1A1A; --motif-b: #00764A; --motif-c: #00A865;
    }

    [data-id="cameroon"],
    [data-dest="cameroon"] {
      --sky-a: #FFE98A; --sky-b: #FCD116; --sky-c: #CE1126; --sun: #FCD116;
      --band-1: #00926E; --band-2: #00624A; --band-3: #003D2E; --band-4: #00926E;
      --motif-a: #007A5E; --motif-b: #FCD116; --motif-c: #FCD116;
    }

    /* Coordinated Home Elements Retraction State */
    .home-elements-retracted .home-header {
      transform: translateY(-28px);
      opacity: 0;
      pointer-events: none;
    }

    .home-elements-retracted .category-row {
      transform: translateY(-20px);
      opacity: 0;
      pointer-events: none;
    }

    .home-elements-retracted .section-title {
      transform: translateY(-12px);
      opacity: 0;
    }

