/* ============================================================
   SciGlob · Pandora Global Network — kiosk theme
   ============================================================ */
:root {
  --bg:        #05070f;
  --bg-2:      #0a1024;
  --panel:     rgba(12, 20, 42, 0.72);
  --panel-2:   rgba(16, 26, 52, 0.86);
  --line:      rgba(120, 170, 230, 0.14);
  --line-soft: rgba(120, 170, 230, 0.08);

  --accent:        #37c6ff;   /* SciGlob cyan-blue */
  --accent-light:  #8fd9f6;
  --accent-deep:   #0e6cb6;
  --accent-glow:   rgba(55, 198, 255, 0.55);

  --text:   #eaf2fb;
  --muted:  #9fb2cc;
  --muted-2:#6f86a6;

  /* data-mark pair (validated with the dataviz palette checker on #0a1024) */
  --site: #1fa9e6;
  --new:  #d48a00;
  --new-tint: rgba(212, 138, 0, 0.16);
  --new-line: rgba(212, 138, 0, 0.55);

  --radius: 16px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --font:   "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display:"Space Grotesk", var(--font);

  /* iPad notch / status bar / home-indicator insets (0 on desktop) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* touch-kiosk hardening: no rubber-band / pull-to-refresh, no long-press
     menus, no accidental text selection, no grey tap flash */
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
input, select { -webkit-user-select: text; user-select: text; }
button, select, input, a, label { touch-action: manipulation; } /* no double-tap zoom */

#map { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 40%, #0c1430 0%, #05070f 70%); }

/* MapLibre overrides ----------------------------------------- */
.maplibregl-ctrl-group {
  background: var(--panel-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow) !important;
}
.maplibregl-ctrl-group button { background: transparent !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line-soft) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) hue-rotate(180deg) brightness(1.1); }
.maplibregl-ctrl-attrib {
  background: rgba(5, 7, 15, 0.55) !important;
  color: var(--muted-2);
  border-radius: 8px 0 0 0;
  font-size: 10px;
}
.maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-ctrl-bottom-right { padding-right: var(--safe-right); padding-bottom: var(--safe-bottom); }

/* Loader ----------------------------------------------------- */
#loader {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; gap: 22px;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #0a1024 0%, #05070f 75%);
  transition: opacity .8s ease, visibility .8s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-orb {
  width: 74px; height: 74px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, var(--accent-light), var(--accent) 38%, var(--accent-deep) 70%, #06203a 100%);
  box-shadow: 0 0 60px var(--accent-glow), inset -8px -10px 26px rgba(0,0,0,.55);
  animation: spin 2.6s linear infinite, pulse 2.6s ease-in-out infinite;
}
.loader-text { color: var(--muted); font-size: 14px; letter-spacing: .04em; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 40px var(--accent-glow), inset -8px -10px 26px rgba(0,0,0,.55);} 50% { box-shadow: 0 0 80px var(--accent-glow), inset -8px -10px 26px rgba(0,0,0,.55);} }

/* Top bar ---------------------------------------------------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: calc(14px + var(--safe-top)) calc(22px + var(--safe-right)) 14px calc(22px + var(--safe-left));
  background: linear-gradient(180deg, rgba(5,7,15,.82) 0%, rgba(5,7,15,.45) 70%, rgba(5,7,15,0) 100%);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo { height: 38px; width: auto; filter: drop-shadow(0 2px 10px rgba(55,198,255,.35)); }
.brand-divider { width: 1px; height: 34px; background: var(--line); }
.brand-title h1 {
  font-family: var(--display); font-weight: 600; font-size: 20px;
  margin: 0; letter-spacing: .01em; line-height: 1.1;
}
.brand-title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); letter-spacing: .02em; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.basemap-toggle {
  display: flex; padding: 4px; gap: 2px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 11px; backdrop-filter: blur(12px);
}
.basemap-toggle button {
  border: 0; background: transparent; color: var(--muted);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: .2s;
}
.basemap-toggle button:hover { color: var(--text); }
.basemap-toggle button.is-active {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #fff; box-shadow: 0 4px 16px -4px var(--accent-glow);
}

.btn-ghost {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 9px 16px; border-radius: 11px; cursor: pointer;
  backdrop-filter: blur(12px); transition: .2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-light); }

.agu-badge {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 15px 7px 12px; border-radius: 11px;
  background: linear-gradient(135deg, rgba(14,108,182,.30), rgba(55,198,255,.12));
  border: 1px solid rgba(55,198,255,.35); backdrop-filter: blur(12px);
}
.agu-badge strong { display: block; font-family: var(--display); font-size: 14px; letter-spacing: .03em; }
.agu-badge small { display: block; font-size: 10.5px; color: var(--muted); }
.agu-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Panel ------------------------------------------------------ */
.panel {
  position: fixed; top: calc(92px + var(--safe-top)); left: calc(22px + var(--safe-left)); z-index: 18;
  width: 332px; max-width: calc(100vw - 44px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  display: flex; flex-direction: column;
  transition: transform .4s cubic-bezier(.4,0,.2,1), opacity .3s;
}
.panel.collapsed { transform: translateX(calc(-100% - 30px)); opacity: 0; pointer-events: none; }
.panel-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.panel-collapse {
  position: absolute; top: 24px; right: 14px;
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  cursor: pointer; font-size: 16px; line-height: 1; transition: .2s;
}
.panel-collapse:hover { color: var(--accent-light); border-color: var(--accent); }
.panel-reopen {
  position: fixed; top: calc(92px + var(--safe-top)); left: calc(22px + var(--safe-left)); z-index: 18;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); color: var(--accent-light);
  cursor: pointer; font-size: 20px; backdrop-filter: blur(12px); box-shadow: var(--shadow);
}

/* Search */
.search { position: relative; margin-right: 34px; }   /* leaves room for the panel's collapse button */
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); pointer-events: none; }
#search-input {
  width: 100%; padding: 11px 34px 11px 36px;
  background: rgba(5,9,20,.6); border: 1px solid var(--line); border-radius: 11px;
  color: var(--text); font-family: var(--font); font-size: 13.5px; outline: none; transition: .2s;
}
#search-input::placeholder { color: var(--muted-2); }
#search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(55,198,255,.14); }
.search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5;
  max-height: 280px; overflow-y: auto; display: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.search-results.open { display: block; }
.search-result {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  cursor: pointer; border-bottom: 1px solid var(--line-soft); transition: background .15s;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result.active { background: rgba(55,198,255,.12); }
.search-result .sr-name { font-size: 13px; font-weight: 500; }
.search-result .sr-meta { font-size: 11px; color: var(--muted); }
.search-result .sr-flag { font-size: 15px; }
.search-result .sr-new {
  margin-left: 4px; padding: 1px 6px; border-radius: 6px; vertical-align: 1px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); background: var(--new-tint); border: 1px solid var(--new-line);
}
.search-empty { padding: 14px 12px; color: var(--muted-2); font-size: 12.5px; text-align: center; }

/* Stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat {
  padding: 13px 14px; border-radius: 12px;
  background: linear-gradient(160deg, rgba(55,198,255,.10), rgba(14,108,182,.05));
  border: 1px solid var(--line-soft);
}
.stat-num { display: block; font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; color: #fff; letter-spacing: .01em; }
.stat-label { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

/* Filters */
.filters { display: flex; flex-direction: column; gap: 12px; padding-top: 2px; }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filter-row label { font-size: 12.5px; color: var(--muted); }
#continent-filter {
  flex: 1; max-width: 190px; padding: 8px 10px;
  background: rgba(5,9,20,.6); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-family: var(--font); font-size: 13px; cursor: pointer; outline: none;
}
#continent-filter:focus { border-color: var(--accent); }
#continent-filter option { background: #0a1024; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch-track { width: 40px; height: 22px; border-radius: 22px; background: rgba(120,150,190,.22); border: 1px solid var(--line); position: relative; transition: .25s; flex: none; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cdd9ea; transition: .25s; }
.switch input:checked + .switch-track { background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); background: #fff; }
.switch-label { font-size: 12.5px; color: var(--text); }

/* Legend */
.legend { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 13px; height: 13px; border-radius: 50%; flex: none; }
.dot-single { background: #cdeeff; box-shadow: 0 0 8px var(--accent-glow), 0 0 0 1.5px var(--site); }
.dot-multi { background: #fff; box-shadow: 0 0 12px var(--accent-glow), 0 0 0 2px var(--site); width: 16px; height: 16px; }
.dot-cluster { background: radial-gradient(circle, var(--accent) 40%, rgba(55,198,255,.25) 100%); box-shadow: 0 0 12px var(--accent-glow); }
.dot-new { width: 16px; height: 16px; background: radial-gradient(circle, #cdeeff 0 28%, transparent 31%); border: 2px solid var(--new); box-shadow: 0 0 10px var(--new-line); }

/* "New in 2026" count next to its filter */
.count-chip {
  margin-left: auto; padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 600; color: var(--text);
  background: var(--new-tint); border: 1px solid var(--new-line);
}
.count-chip:empty { display: none; }

/* Network growth timeline ---------------------------------------- */
.growth { display: flex; flex-direction: column; gap: 6px; }
.growth-head { display: flex; align-items: center; justify-content: space-between; }
.section-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.growth-play {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px 6px 10px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(55,198,255,.10); color: var(--accent-light);
  font-family: var(--font); font-size: 12px; font-weight: 600; transition: .2s;
}
.growth-play:hover { border-color: var(--accent); }
.growth-play svg { width: 13px; height: 13px; }
.growth-play .ic-stop, .growth-play.is-playing .ic-play { display: none; }
.growth-play.is-playing .ic-stop { display: inline; }
.growth-play.is-playing { background: rgba(55,198,255,.22); border-color: var(--accent); }
.growth-readout { display: flex; align-items: baseline; gap: 9px; font-size: 12.5px; color: var(--muted); }
.growth-readout b { font-size: 17px; font-weight: 600; color: #fff; }
.growth-chart svg, .story-chart svg { display: block; overflow: visible; }
.ghit { fill: transparent; cursor: pointer; }
.gval { font-family: var(--font); font-size: 11.5px; font-weight: 600; fill: var(--text); }
.gtick { font-family: var(--font); font-size: 10.5px; font-weight: 500; fill: var(--muted-2); font-variant-numeric: tabular-nums; }
.gaxis { stroke: rgba(120,170,230,.22); stroke-width: 1; }

/* "The network in 2019" banner */
.year-badge {
  position: fixed; z-index: 19; top: calc(86px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 7px 7px 7px 16px; border-radius: 30px;
  background: var(--panel-2); border: 1px solid var(--line); backdrop-filter: blur(14px); box-shadow: var(--shadow);
  font-size: 13.5px; color: var(--text); white-space: nowrap;
}
.year-badge[hidden] { display: none; }
.year-badge b { font-weight: 700; }
.year-badge button {
  border: 1px solid var(--line); background: rgba(55,198,255,.12); color: var(--accent-light);
  font-family: var(--font); font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 20px; cursor: pointer;
}

/* map "back to the whole globe" control */
.maplibregl-ctrl-group button.ctrl-home { display: flex; align-items: center; justify-content: center; color: #d6e8fb; }

.panel-footer { padding: 12px 16px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted-2); }
.panel-footer a { color: var(--muted); text-decoration: none; transition: .2s; }
.panel-footer a:hover { color: var(--accent-light); }

/* Idle hint -------------------------------------------------- */
.idle-hint {
  position: fixed; bottom: calc(22px + var(--safe-bottom)); left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 15; padding: 9px 18px; border-radius: 30px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(12px);
  font-size: 12.5px; color: var(--muted); letter-spacing: .02em;
  opacity: 0; transition: opacity .5s, transform .5s; pointer-events: none;
}
.idle-hint.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Popup ------------------------------------------------------ */
.maplibregl-popup { z-index: 16; }
.maplibregl-popup-content {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 0; overflow: hidden; box-shadow: var(--shadow);
  backdrop-filter: blur(18px); min-width: 230px;
}
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; padding: 4px 9px; right: 2px; top: 2px; }
.maplibregl-popup-close-button:hover { background: transparent; color: var(--accent-light); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--panel-2); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--panel-2); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--panel-2); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--panel-2); }

.pop { padding: 14px 16px 15px; }
.pop-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.pop-name { font-family: var(--display); font-weight: 600; font-size: 16px; color: #fff; }
.pop-loc { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.pop-flag { font-size: 15px; }
.pop-count { display: inline-flex; align-items: baseline; gap: 6px; margin-bottom: 9px; }
.pop-count b { font-family: var(--display); font-size: 19px; color: var(--accent-light); }
.pop-count span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pop-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pop-chip {
  font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 7px;
  background: rgba(55,198,255,.12); border: 1px solid rgba(55,198,255,.28); color: var(--accent-light);
  font-variant-numeric: tabular-nums;
}
.pop-chip.is-new { background: var(--new-tint); border-color: var(--new-line); color: var(--text); }
.pop-chip em { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-left: 6px; }
.pop-head { padding-right: 22px; }   /* room for the close button */
.pop-badge {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 7px; padding: 3px 10px 3px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text);
  background: var(--new-tint); border: 1px solid var(--new-line);
}
.dot-new-sm { width: 7px; height: 7px; border-radius: 50%; background: var(--new); box-shadow: 0 0 8px var(--new); }
.pop-facts { display: flex; gap: 20px; margin: 0 0 11px; }
.pop-facts span { display: flex; flex-direction: column; font-size: 13px; font-weight: 500; color: var(--text); }
.pop-facts small { margin-bottom: 2px; font-size: 10.5px; font-weight: 500; color: var(--muted-2); text-transform: uppercase; letter-spacing: .07em; }

/* Exhibit showcase (self-running tour) ---------------------------- */
.touch-catcher { position: fixed; inset: 0; z-index: 40; display: none; cursor: pointer; }
body.showcase .touch-catcher { display: block; }

.basemap-toggle, #about-btn, .maplibregl-ctrl-bottom-right, .panel-reopen { transition: opacity .5s; }
body.showcase .panel,
body.showcase .panel-reopen,
body.showcase .basemap-toggle,
body.showcase #about-btn,
body.showcase .maplibregl-ctrl-bottom-right,
body.showcase .idle-hint,
body.showcase .year-badge { opacity: 0 !important; pointer-events: none !important; }

.cta {
  display: none; align-items: center; gap: 12px; padding: 10px 20px 10px 15px; border-radius: 40px;
  background: linear-gradient(135deg, rgba(14,108,182,.6), rgba(55,198,255,.28));
  border: 1px solid rgba(55,198,255,.6); box-shadow: 0 10px 40px -10px var(--accent-glow);
  backdrop-filter: blur(12px); font-size: 15px; font-weight: 600; letter-spacing: .02em; color: #fff;
  white-space: nowrap;
}
body.showcase .cta { display: flex; animation: fade .6s ease; }
@media (max-width: 1180px) { body.showcase .brand-title p { display: none; } }  /* portrait iPad: room for the pill */
.cta-ring { position: relative; width: 12px; height: 12px; border-radius: 50%; background: #fff; flex: none; }
.cta-ring::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.75); animation: ripple 1.8s ease-out infinite;
}
@keyframes ripple { from { transform: scale(.55); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }

.story {
  position: fixed; z-index: 42;
  left: calc(32px + var(--safe-left)); bottom: calc(32px + var(--safe-bottom));
  width: min(500px, calc(100vw - 64px)); padding: 22px 26px 24px;
  background: linear-gradient(160deg, rgba(13,23,48,.88), rgba(8,13,30,.84));
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  pointer-events: none; overflow: hidden;
  opacity: 0; transform: translateY(16px); transition: opacity .5s, transform .5s;
}
body.showcase .story.show { opacity: 1; transform: none; }
.story-kicker {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}
.story-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--site); box-shadow: 0 0 10px var(--site); flex: none; }
.story.tone-new .story-dot { background: var(--new); box-shadow: 0 0 12px var(--new); }
.story-title { margin-top: 10px; font-family: var(--display); font-size: 32px; font-weight: 600; line-height: 1.12; color: #fff; }
.story-hero { margin-top: 6px; font-family: var(--font); font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -.01em; color: #fff; }
.story-sub { margin-top: 10px; font-size: 17px; line-height: 1.4; color: var(--muted); text-wrap: pretty; }
.story-chart { margin-top: 16px; }
.story-chart .gval { font-size: 13px; }
.story-chart .gtick { font-size: 12px; }
.story-hero:empty, .story-sub:empty, .story-chart:empty { display: none; }
.story-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(120,170,230,.10); }
.story-progress span { display: block; width: 0; height: 100%; background: var(--accent); opacity: .75; }
.story.tone-new .story-progress span { background: var(--new); }

.qr-card {
  position: fixed; z-index: 42; right: calc(32px + var(--safe-right)); bottom: calc(32px + var(--safe-bottom));
  display: flex; align-items: center; gap: 16px; padding: 14px 22px 14px 14px;
  background: linear-gradient(160deg, rgba(13,23,48,.88), rgba(8,13,30,.84));
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(18px);
  pointer-events: none; opacity: 0; transition: opacity .6s;
}
.qr-card[hidden] { display: none; }
body.showcase .qr-card { opacity: 1; }
.qr-code { width: 116px; height: 116px; padding: 8px; background: #fff; border-radius: 10px; flex: none; }
.qr-code img, .qr-code canvas { width: 100% !important; height: 100% !important; }
.qr-text strong { display: block; font-family: var(--display); font-size: 17px; font-weight: 600; color: #fff; }
.qr-text span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

/* About modal ------------------------------------------------ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(3, 6, 14, 0.7); backdrop-filter: blur(8px);
  animation: fade .3s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: relative; max-width: 540px; width: 100%;
  background: linear-gradient(170deg, #0d1730, #080d1e);
  border: 1px solid var(--line); border-radius: 20px; padding: 34px 34px 28px;
  box-shadow: var(--shadow); animation: rise .4s cubic-bezier(.2,.7,.3,1);
}
@keyframes rise { from { transform: translateY(18px); opacity: 0; } }
.modal-logo { height: 34px; margin-bottom: 18px; }
.modal-share {
  display: flex; align-items: center; gap: 16px; margin: 0 0 16px; padding: 12px;
  border-radius: 14px; background: rgba(55,198,255,.06); border: 1px solid var(--line-soft);
}
.modal-share[hidden] { display: none; }
.modal-share .qr-code { width: 92px; height: 92px; padding: 6px; }
.modal .modal-share p { margin: 0; }
.modal h2 { font-family: var(--display); font-weight: 600; font-size: 23px; margin: 0 0 14px; }
.modal p { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0 0 16px; }
.modal p strong { color: var(--text); font-weight: 600; }
.modal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.modal-stats .ms { padding: 13px 8px; text-align: center; border-radius: 12px; background: rgba(55,198,255,.08); border: 1px solid var(--line-soft); }
.modal-stats .ms b { display: block; font-family: var(--display); font-size: 22px; color: var(--accent-light); }
.modal-stats .ms span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.modal-foot { font-size: 12.5px !important; color: var(--muted-2) !important; margin-bottom: 0 !important; }
.modal-close { position: absolute; top: 16px; right: 18px; border: 0; background: transparent; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; transition: .2s; }
.modal-close:hover { color: var(--accent-light); }

/* Responsive ------------------------------------------------- */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: calc(12px + var(--safe-top)) 14px 12px; gap: 10px; }
  .brand-title p { display: none; }
  .brand-logo { height: 30px; }
  .brand-title h1 { font-size: 16px; }
  .agu-badge { order: 3; }
  .panel { top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: 100%;
           border-radius: 18px 18px 0 0; max-height: 52vh; }
  .panel.collapsed { transform: translateY(calc(100% + 30px)); }
  .panel-reopen { top: auto; bottom: 16px; left: 16px; }
  .panel-body { overflow-y: auto; }
  .idle-hint { display: none; }
  .story { left: 16px; right: 16px; bottom: calc(16px + var(--safe-bottom)); width: auto; padding: 18px 20px 20px; }
  .story-title { font-size: 24px; }
  .story-hero { font-size: 48px; }
  .story-sub { font-size: 15px; }
  .qr-card { display: none !important; }
  .cta { font-size: 13px; padding: 8px 16px 8px 12px; }
}
@media (max-width: 480px) {
  .topbar-actions { gap: 8px; }
  .basemap-toggle button { padding: 6px 10px; font-size: 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* Touchscreens (iPad): finger-sized targets */
@media (pointer: coarse) {
  .panel-collapse { width: 36px; height: 36px; top: 18px; right: 12px; font-size: 20px; }
  .search { margin-right: 40px; }
  .maplibregl-ctrl-group button { width: 40px !important; height: 40px !important; }
  .maplibregl-popup-close-button { font-size: 26px; padding: 6px 12px; }
}

/* Home-Screen kiosk mode (class set by app.js): outbound links would leave
   the exhibit, so they stay visible but are not tappable */
.is-kiosk .panel-footer a,
.is-kiosk .maplibregl-ctrl-attrib a { pointer-events: none; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .loader-orb, .agu-dot, .cta-ring::after { animation: none; }
}
