/* thetu.be — stile dell'interfaccia (Fase 2) */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/AtkinsonHyperlegibleNext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ardesia: #1C2733;      /* testo */
  --binario: #5E6B78;      /* testo secondario, icone */
  --banchina: #F3F5F6;     /* pannelli */
  --carta: #E9EDF0;        /* fondo mappa */
  --bordo: #D3DAE0;
  --superficie: #FFFFFF;
  --focus: #1D5FD1;
  --avviso: #8A4B00;
  --avviso-bg: #FFF1DC;
  --ombra: 0 1px 2px rgba(28, 39, 51, .12), 0 6px 18px rgba(28, 39, 51, .10);
  --r-pannello: 16px;
  --r-controllo: 12px;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ardesia: #E6EBF0;
    --binario: #9AA7B4;
    --banchina: #18222D;
    --carta: #121A23;
    --bordo: #2A3744;
    --superficie: #1F2B37;
    --focus: #7FB0FF;
    --avviso: #FFD08A;
    --avviso-bg: #3A2A12;
    --ombra: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ardesia);
  background: var(--carta);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}

a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--superficie); padding: 10px 14px; border-radius: var(--r-controllo); box-shadow: var(--ombra);
}
.skip:focus { top: 12px; }

/* --- Marchio: un tondo vuoto, come una fermata ------------------------------ */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  border: 6px solid var(--ardesia); background: var(--superficie); flex: none;
}

/* --- Tondi delle linee ------------------------------------------------------ */
.roundel {
  --size: 38px;
  display: inline-grid; place-items: center;
  min-width: var(--size); height: var(--size); padding: 0 .45em;
  border-radius: calc(var(--size) / 2);
  background: var(--c); color: var(--t);
  font-weight: 800; font-size: calc(var(--size) * .46); letter-spacing: -.01em; line-height: 1;
  border: 0; box-shadow: 0 0 0 2px var(--superficie);
}
button.roundel { cursor: pointer; transition: transform .12s ease, opacity .12s ease; }
button.roundel:hover { transform: translateY(-1px); }
.roundels.has-selection button.roundel[aria-pressed="false"] { opacity: .35; }
.roundel-sm { --size: 28px; }
.roundel-xs { --size: 20px; box-shadow: none; }

/* --- Mappa -------------------------------------------------------------------- */
/* più specifico di .maplibregl-map, che altrimenti la rimette in position: relative */
.map, .map.maplibregl-map { position: fixed; inset: 0; background: var(--carta); }
.page-city { overflow: hidden; overscroll-behavior: none; }

/* --- Barra superiore -------------------------------------------------------- */
.bar {
  position: fixed; z-index: 10; top: max(12px, env(safe-area-inset-top)); left: 12px;
  width: min(420px, calc(100% - 24px));
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "brand title lang" "lines lines lines" "search search search";
  align-items: center; gap: 10px 12px;
  padding: 12px 14px; background: var(--superficie); border-radius: var(--r-pannello); box-shadow: var(--ombra);
}
.bar .brand { grid-area: brand; }
.bar-title { grid-area: title; min-width: 0; }
.bar-title h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bar-city { margin: 0; font-size: 1.375rem; font-weight: 750; letter-spacing: -.015em; line-height: 1.1; }
.bar .lang { grid-area: lang; }
.lang select {
  appearance: none; border: 1px solid var(--bordo); background: transparent; border-radius: 999px;
  padding: 4px 12px; font-size: .875rem; color: var(--binario); cursor: pointer;
}
.roundels { grid-area: lines; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.search { grid-area: search; position: relative; }
.search input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-controllo);
  border: 1px solid var(--bordo); background: var(--banchina);
}
.search input::placeholder { color: var(--binario); }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; margin: 0; padding: 6px;
  list-style: none; background: var(--superficie); border-radius: var(--r-controllo); box-shadow: var(--ombra);
  max-height: 50vh; overflow: auto;
}
.search-results li {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer;
}
.search-results li[aria-selected="true"], .search-results li:hover { background: var(--banchina); }
.search-results .empty { color: var(--binario); cursor: default; }
.search-results .xfer { margin-left: auto; }
/* Fase 6: risultati su due righe (nome e tipo) */
.search-results li[role="option"] { flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 10px; }
.q-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.q-name { font-weight: 600; overflow-wrap: anywhere; }
.q-sub { font-size: .8125rem; color: var(--binario); padding-left: 22px; }
.search-results li[data-kind="line"] .q-sub { padding-left: 28px; }
.q-ico { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ardesia); background: var(--superficie); margin: 0 !important; }
.q-ico.q-station { border-width: 3px; }
.q-ico.q-landmark { border-radius: 3px; background: var(--ardesia); }
.q-ico.q-service { border-radius: 3px; border-color: var(--binario); }
.q-ico.q-street { border-radius: 2px; height: 6px; border-width: 0; background: var(--binario); }
.q-ico.q-city, .q-ico.q-gstation, .q-ico.q-gpoi { border-style: dashed; }

/* --- Scheda del luogo ----------------------------------------------------- */
.poi-cat { font-weight: 600; }
.poi-walk { margin: 16px 0 0; }
.poi-walk h3 { font-size: 1rem; margin: 0 0 8px; }
.poi-walk ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.poi-walk li { display: grid; gap: 2px; }
.walk-opt {
  width: 100%; text-align: left; display: grid; gap: 3px; padding: 10px 12px; border: 2px solid transparent; border-radius: var(--r-controllo);
  background: var(--banchina); color: inherit; font: inherit; cursor: pointer;
}
.walk-opt.is-on { border-color: var(--ardesia); }
.walk-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.walk-det { font-size: .875rem; color: var(--binario); }
.poi-walk .linkish { justify-self: start; font-size: .8125rem; margin-left: 12px; }
.poi-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 0; }
.poi-links a { color: var(--ardesia); }
.poi-source { margin-top: 10px; }

/* --- Comandi ------------------------------------------------------------------ */
.controls {
  position: fixed; z-index: 10; right: 12px; top: max(12px, env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 8px;
}
.ctl {
  width: 44px; height: 44px; display: grid; place-items: center; border: 0; cursor: pointer;
  border-radius: var(--r-controllo); background: var(--superficie); color: var(--ardesia); box-shadow: var(--ombra);
  font-size: 1.4rem; line-height: 1;
}
.ctl[aria-pressed="true"], .ctl[aria-expanded="true"] { background: var(--ardesia); color: var(--superficie); }
.layers-menu {
  position: absolute; right: 52px; top: 156px; margin: 0; min-width: 210px; padding: 12px 14px;
  border: 0; background: var(--superficie); border-radius: var(--r-controllo); box-shadow: var(--ombra);
}
.layers-menu legend { float: left; width: 100%; font-weight: 700; margin-bottom: 6px; }
.layers-menu label { display: flex; gap: 10px; align-items: center; padding: 6px 0; cursor: pointer; }
.layers-menu input { width: 18px; height: 18px; accent-color: var(--ardesia); }

/* --- Avvisi --------------------------------------------------------------------- */
.banner {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); top: max(12px, env(safe-area-inset-top));
  width: min(520px, calc(100% - 24px)); padding: 12px 16px; border-radius: var(--r-controllo);
  background: var(--avviso-bg); color: var(--avviso); box-shadow: var(--ombra); font-weight: 600;
}

/* --- Pannello ------------------------------------------------------------------ */
.panel {
  position: fixed; z-index: 9; display: flex; flex-direction: column;
  background: var(--superficie); box-shadow: var(--ombra);
}
.panel-body { overflow: auto; overscroll-behavior: contain; padding: 4px 18px 18px; }
.panel h2 { font-size: 1.125rem; margin: 10px 0 12px; }
.panel-handle { display: flex; justify-content: center; padding: 8px 0 2px; }
.panel-grip {
  width: 52px; height: 22px; border: 0; background: transparent; cursor: pointer; position: relative;
}
.panel-grip::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 8px; height: 5px; border-radius: 3px; background: var(--bordo);
}

/* desktop: colonna a sinistra sotto la barra */
@media (min-width: 760px) {
  .panel {
    left: 12px; top: calc(var(--bar-bottom, 190px) + 12px); bottom: 44px; width: min(420px, calc(100% - 24px));
    border-radius: var(--r-pannello);
  }
  .panel-handle { display: none; }
  .panel[data-state="hidden"] { display: none; }
}

/* mobile: foglio dal basso, tre altezze */
@media (max-width: 759.98px) {
  .bar { grid-template-areas: "brand title lang" "lines lines lines" "search search search"; padding: 10px 12px; }
  .bar-city { font-size: 1.2rem; }
  .roundel { --size: 34px; }
  .controls { top: auto; bottom: calc(28vh + 12px); }
  .layers-menu { top: auto; bottom: 0; }
  .panel {
    left: 0; right: 0; bottom: 0; height: 88vh; border-radius: var(--r-pannello) var(--r-pannello) 0 0;
    transform: translateY(calc(88vh - 28vh)); transition: transform .22s ease;
  }
  .panel[data-state="full"] { transform: translateY(12vh); }
  .panel[data-state="hidden"] { transform: translateY(calc(88vh - 46px)); }
  .attribution { display: none; }
  body[data-panel="full"] .controls { display: none; }
  .board-row { gap: 10px; padding: 10px; }
  .board-times { gap: 12px; }
  .board-time b { font-size: 1.125rem; }
}
@media (max-width: 400px) {
  .board-time:nth-child(3) { display: none; }
}

/* --- Elenco linee e stazioni ------------------------------------------------- */
.line-block h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; margin: 18px 0 8px; }
.stops { list-style: none; margin: 0 0 0 13px; padding: 0; border-left: 4px solid var(--c); }
.stops li { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 0 5px 18px; }
.stops li::before {
  content: ""; position: absolute; left: -9px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%; background: var(--superficie); border: 3px solid var(--c);
}
.stops a { text-decoration: none; }
.stops a:hover { text-decoration: underline; }
.xfer { display: inline-flex; gap: 4px; }

/* --- Scheda stazione --------------------------------------------------------- */
.station-head { display: flex; align-items: flex-start; gap: 12px; margin-top: 6px; }
.station-head h2:focus { outline: none; }
.station-head h2 { margin: 0; font-size: 1.6rem; line-height: 1.1; letter-spacing: -.015em; flex: 1; }
.station-close {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--banchina); cursor: pointer; font-size: 1.2rem;
}
.station-lines { list-style: none; margin: 12px 0 6px; padding: 0; display: grid; gap: 8px; }
.station-lines li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.station-lines .dirs { font-size: .9375rem; line-height: 1.25; overflow-wrap: anywhere; }
.station-lines .monitor { grid-column: 2; justify-self: start; font-size: .875rem; margin-top: 2px; }
.station-head .roundel { flex: none; margin-top: 2px; }

/* --- Treni ---------------------------------------------------------------- */
.trains-chip {
  position: fixed; z-index: 8; right: 12px; bottom: 44px; max-width: min(520px, calc(100% - 24px));
  font-size: .8125rem; color: var(--ardesia); background: color-mix(in srgb, var(--superficie) 90%, transparent);
  padding: 5px 12px; border-radius: 999px; box-shadow: var(--ombra);
}
@media (max-width: 759px) { .trains-chip { right: auto; left: 12px; top: calc(var(--bar-bottom, 120px) + 8px); bottom: auto; } }
.prov { font-weight: 600; }
.prov-frequency { font-style: italic; }
.train-status { margin: 10px 0 8px; font-size: 1.0625rem; font-weight: 700; }
.follow {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--ardesia); background: var(--superficie);
  color: var(--ardesia); font: inherit; font-weight: 600; cursor: pointer;
}
.follow[aria-pressed="true"] { background: var(--ardesia); color: var(--superficie); }
.stops-title { font-size: 1rem; margin: 18px 0 6px; }
.stops { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 4px solid var(--bordo); }
.stops li { position: relative; }
.stops li::before {
  content: ''; position: absolute; left: -21px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--superficie); border: 2px solid var(--binario);
}
.stops button {
  width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 7px 8px; min-height: 38px; border: 0; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px;
}
.stops button:hover { background: var(--banchina); }
.stops time { color: var(--binario); font-variant-numeric: tabular-nums; }
.stops li.past button { color: var(--binario); }
.stops li.past::before { background: var(--bordo); border-color: var(--bordo); }
.stops li.next button, .stops li.here button { font-weight: 700; }
.stops li.next::before, .stops li.here::before { background: var(--ardesia); border-color: var(--ardesia); }

/* --- Vista linea ---------------------------------------------------------- */
.line-diagram { margin: 12px -6px 0; overflow-x: auto; }
.ld-svg { display: block; font: 13px/1 'Atkinson Hyperlegible Next', system-ui, sans-serif; }
.ld-line { fill: none; stroke-width: 6; stroke-linecap: round; }
.ld-station { cursor: pointer; }
.ld-station > circle { fill: var(--superficie); stroke-width: 3; }
.ld-station > circle.ld-xfer { stroke: var(--ardesia) !important; stroke-width: 3.5; }
.ld-station > text { fill: var(--ardesia); }
.ld-station:hover > text, .ld-station:focus > text { text-decoration: underline; }
.ld-station:focus { outline: none; }
.ld-station.is-dim { opacity: .3; }
.ld-badge text { font-size: 10px; font-weight: 700; }
.ld-train { cursor: pointer; }
.ld-train path { stroke: var(--superficie); stroke-width: 1.5; }
.ld-train.is-freq path { fill: var(--superficie) !important; stroke: currentColor; stroke-width: 2; }
.ld-train.is-sel path { stroke: var(--ardesia); stroke-width: 2.5; }
.station-meta { color: var(--binario); margin: 4px 0 0; font-size: .9375rem; }

.board { margin: 18px 0 0; }
.board h3 { font-size: 1rem; margin: 0 0 8px; }
.board-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--r-controllo); background: var(--banchina); margin-bottom: 8px;
}
.board-dir { font-weight: 700; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.board-dir small { display: block; font-weight: 400; color: var(--binario); }
.board-times { display: flex; gap: 12px; justify-content: flex-end; white-space: nowrap; }
.board-time { text-align: right; line-height: 1.1; }
.board-time b { display: block; font-size: 1.1875rem; font-weight: 800; }
.board-time span { font-size: .8125rem; color: var(--binario); }
.board-note { color: var(--binario); font-size: .875rem; margin: 6px 0 0; }

/* --- Ingressi della stazione ------------------------------------------------ */
.entrances { margin: 18px 0 0; }
.entrances h3 { font-size: 1rem; margin: 0 0 8px; }
.entrances ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.entrance {
  width: 100%; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: left;
  padding: 9px 12px; min-height: 44px; border: 0; border-radius: var(--r-controllo); background: var(--banchina);
  color: inherit; font: inherit; cursor: pointer;
}
.entrance:hover { outline: 2px solid var(--bordo); }
.entrance i { grid-row: span 2; width: 20px; height: 20px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--ardesia); background: var(--superficie) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M5 7h4v4h4v4h4' fill='none' stroke='%231C2733' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
@media (prefers-color-scheme: dark) {
  .entrance i { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M5 7h4v4h4v4h4' fill='none' stroke='%23E6EBF0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
.entrance span { font-weight: 600; overflow-wrap: anywhere; }
.entrance small { grid-column: 2; color: var(--binario); font-size: .8125rem; }
.entrance.is-closed span { text-decoration: line-through; color: var(--binario); }
.entrance-pop { font: inherit; color: var(--ardesia); }
.entrance-pop b { display: block; font-size: .9375rem; margin-right: 16px; }
.entrance-pop p { margin: 4px 0 0; font-size: .8125rem; color: var(--binario); }
.entrance-pop .linkish { margin-top: 6px; font-size: .8125rem; }
.maplibregl-popup-content { background: var(--superficie); border-radius: var(--r-controllo); box-shadow: var(--ombra); padding: 10px 12px; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--superficie); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--superficie); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--superficie); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--superficie); }
.maplibregl-popup-close-button { color: var(--binario); font-size: 18px; padding: 0 6px; }

.actions { margin-top: 20px; }
.linkish {
  background: none; border: 0; padding: 0; color: var(--binario); text-decoration: underline; cursor: pointer; font-size: inherit;
}

/* --- Legenda tratti approssimati ------------------------------------------- */
.legend { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--binario); font-size: .875rem; }
.legend i { width: 34px; height: 0; border-top: 4px dashed var(--binario); display: inline-block; }

/* --- Attribuzioni --------------------------------------------------------- */
.attribution {
  position: fixed; z-index: 8; right: 12px; bottom: 10px; max-width: calc(100% - 460px);
  font-size: .75rem; color: var(--binario); background: color-mix(in srgb, var(--superficie) 82%, transparent);
  padding: 4px 10px; border-radius: 999px;
}
.attribution .linkish { font-size: .75rem; }

/* --- Segnalazione --------------------------------------------------------- */
dialog.report {
  width: min(440px, calc(100% - 24px)); border: 0; border-radius: var(--r-pannello); padding: 20px;
  background: var(--superficie); color: var(--ardesia); box-shadow: var(--ombra);
}
dialog.report::backdrop { background: rgba(18, 26, 35, .45); }
.report h2 { margin: 0 0 4px; font-size: 1.25rem; }
.report p.subject { margin: 0 0 14px; color: var(--binario); }
.report label { display: block; font-weight: 700; margin: 12px 0 6px; }
.report select, .report textarea {
  width: 100%; border: 1px solid var(--bordo); border-radius: var(--r-controllo); background: var(--banchina); padding: 10px 12px;
}
.report textarea { min-height: 110px; resize: vertical; }
.report .hp { position: absolute; left: -9999px; }
.report .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.btn {
  height: 44px; padding: 0 18px; border-radius: var(--r-controllo); border: 1px solid var(--bordo); background: transparent; cursor: pointer;
  font-weight: 700;
}
.btn-primary { background: var(--ardesia); color: var(--superficie); border-color: var(--ardesia); }
.report .msg { margin: 12px 0 0; font-weight: 600; }

/* --- Pagina iniziale ------------------------------------------------------- */
.page-home { background: var(--carta); }
.home { max-width: 640px; margin: 0 auto; padding: 48px 20px; }
.home h1 { font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.05; letter-spacing: -.025em; margin: 36px 0 28px; }
.home h2 { font-size: 1rem; color: var(--binario); font-weight: 600; margin: 0 0 10px; }
.city-list { list-style: none; margin: 0 0 32px; padding: 0; }
.city-list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 16px 18px; margin-bottom: 8px;
  background: var(--superficie); border-radius: var(--r-controllo); text-decoration: none; box-shadow: var(--ombra);
}
.city-name { font-size: 1.375rem; font-weight: 750; }
.city-country { color: var(--binario); }

.noscript { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: 12px; padding: 12px; background: var(--avviso-bg); color: var(--avviso); border-radius: var(--r-controllo); }

/* --- MapLibre ------------------------------------------------------------- */
.maplibregl-ctrl-attrib { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===================== Fase 3: mappamondo ed earth zoom ===================== */

/* passaggio fra globo e città: la pagina vecchia resta visibile finché la nuova è pronta */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

.page-globe { overflow: hidden; background: #0B1622; color-scheme: dark; }
.map.globe { background: radial-gradient(120% 90% at 50% 45%, #18304A 0%, #0B1622 55%, #070E16 100%); }

.bar-globe { grid-template-areas: "brand title lang" "search search search"; }
.bar-globe .brand-name { font-size: 1.05rem; }
.bar-globe .bar-title h1 {
  position: static; width: auto; height: auto; overflow: visible; clip: auto;
  margin: 0; font-size: .9375rem; font-weight: 600; color: var(--binario); line-height: 1.2;
}

/* chip con il risultato della geolocalizzazione */
.geo-chip {
  position: fixed; z-index: 10; left: 12px; top: calc(var(--bar-bottom, 140px) + 10px);
  width: min(420px, calc(100% - 24px)); padding: 10px 14px; border-radius: var(--r-controllo);
  background: var(--superficie); box-shadow: var(--ombra); font-size: .9375rem;
}
.geo-chip .linkish { color: var(--focus); font-weight: 700; }

/* legenda degli stati: forme diverse, leggibili anche senza colore */
.legend-globe {
  position: fixed; z-index: 8; left: 12px; bottom: 12px; display: flex; gap: 16px;
  padding: 8px 12px; border-radius: 999px; font-size: .8125rem;
  background: rgba(11, 22, 34, .72); color: #E6EBF0;
}
.legend-globe span { display: inline-flex; align-items: center; gap: 8px; }
.lg-pub, .globe-cities .is-published i, .search-results .is-published i {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid #1C2733; box-shadow: 0 0 0 1px #fff;
}
.lg-coming, .globe-cities .is-coming i, .search-results .is-coming i {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .8;
}
.page-globe .attribution { bottom: 12px; }

/* elenco delle città */
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.list-summary { color: var(--binario); margin: 0 0 6px; }
.country-block h3 { font-size: .9375rem; color: var(--binario); margin: 18px 0 6px; font-weight: 700; }
.globe-cities { list-style: none; margin: 0; padding: 0; }
.globe-cities li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; }
.globe-cities li > a, .globe-cities li > span:first-child { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.globe-cities .is-published a { font-weight: 700; }
.globe-cities .is-coming { color: var(--binario); }
.city-meta { color: var(--binario); font-size: .875rem; }
.search-results li i { margin-right: 4px; }

@media (min-width: 760px) {
  .panel-globe { top: calc(var(--bar-bottom, 140px) + 12px); }
}
.panel-globe[data-state="hidden"] { display: none; }
@media (max-width: 759.98px) {
  .page-globe .controls { bottom: 64px; }
  .panel-globe[data-state="peek"] { transform: translateY(calc(88vh - 28vh)); }
  .legend-globe { bottom: 12px; }
}

/* etichetta delle città in arrivo */
.city-popup .maplibregl-popup-content {
  background: var(--superficie); color: var(--ardesia); border-radius: var(--r-controllo); padding: 8px 12px; box-shadow: var(--ombra);
  font-family: var(--font); display: grid; gap: 2px;
}
.city-popup .maplibregl-popup-content span { color: var(--binario); font-size: .8125rem; }
.city-popup .maplibregl-popup-tip { display: none; }

/* nuvole: sopra la mappa, sotto pannelli e comandi */
canvas.clouds {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none;
  opacity: 0; transition: opacity .15s linear;
}
.ez-hint {
  position: fixed; z-index: 6; left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px; background: rgba(28, 39, 51, .7); color: #fff; font-size: .875rem; pointer-events: none;
}
body.ez-active .panel, body.ez-active .controls, body.ez-active .legend-globe, body.ez-active .geo-chip { opacity: .0; pointer-events: none; transition: opacity .2s; }
body.ez-active .ez-hint { opacity: 1; }
.ez-fade { animation: ez-fade .35s ease-out; }
@keyframes ez-fade { from { opacity: 0; } to { opacity: 1; } }
