/* ═══════════════════════════════════════════════════════════════
   Cattus Viatorem · sistema de disseny
   Minimalista, clar i elegant. Pensat per a mòbil (iOS i Android).
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --y: #FDD802;
  --y-strong: #F2CC00;
  --y-soft: #FFF6C4;
  --y-ink: #1B1700;

  --bg: #F7F6F2;
  --bg-2: #EFEDE6;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --glass: rgba(255, 255, 255, .78);
  --ink: #121212;
  --ink-2: #3A3A3A;
  --mute: #6D6D6B;
  --faint: #A9A8A4;
  --line: rgba(18, 18, 18, .08);
  --line-2: rgba(18, 18, 18, .14);
  --overlay: rgba(10, 10, 10, .42);

  --ok: #1B8A3F;
  --danger: #D2362B;
  --blue: #1A73E8;

  --shadow-1: 0 1px 2px rgba(18, 18, 18, .04), 0 2px 10px rgba(18, 18, 18, .04);
  --shadow-2: 0 2px 6px rgba(18, 18, 18, .05), 0 14px 34px -12px rgba(18, 18, 18, .18);
  --shadow-3: 0 30px 70px -20px rgba(18, 18, 18, .35);

  --r-xs: 10px;
  --r-sm: 14px;
  --r: 20px;
  --r-lg: 26px;
  --r-xl: 34px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", "Noto Sans Arabic", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Hiragino Mincho ProN", serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --tabbar-h: 62px;
  --pad: 20px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --y: #FDD802;
  --y-strong: #FFE14D;
  --y-soft: rgba(253, 216, 2, .14);
  --y-ink: #1B1700;
  --bg: #0E0E0F;
  --bg-2: #252527;
  --surface: #1A1A1C;
  --surface-2: #202023;
  --glass: rgba(26, 26, 28, .78);
  --ink: #F4F3EF;
  --ink-2: #D6D5D0;
  --mute: #9C9B97;
  --faint: #66655F;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --overlay: rgba(0, 0, 0, .6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 14px 34px -12px rgba(0, 0, 0, .7);
  --shadow-3: 0 30px 70px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* Mode fosc: la tinta és clara i el groc a sobre no es llegeix.
   Els botons principals passen a groc amb la icona fosca; la resta, a fons fosc. */
[data-theme="dark"] :is(.fab.on, .next-card .arrow, .player .play, .mini-player .mini-toggle, .ac-player .play) { background: var(--y); color: var(--y-ink); }
[data-theme="dark"] :is(.stop-item.done .n, .map-card .go) { background: var(--bg-2); color: var(--y); }

/* Idiomes amb alfabets no llatins: tipografia del sistema als títols */
:lang(zh), :lang(ja), :lang(ar) { --serif: var(--font); }
:lang(zh) .display, :lang(ja) .display, :lang(ar) .display { font-weight: 700; letter-spacing: 0; }
/* En CJK i àrab no hi ha cursiva real: destaquem amb un subratllat groc */
:lang(zh) em, :lang(ja) em, :lang(ar) em { font-style: normal; background: linear-gradient(transparent 64%, var(--y) 64%, var(--y) 92%, transparent 92%); }
.portal-hero h1 em, .city-hero em { background: none; }

/* ─────────── Base ─────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
a { color: inherit; text-decoration: none; touch-action: manipulation; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--y); color: var(--y-ink); }
:focus-visible { outline: 2.5px solid var(--y); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { flex: none; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
[hidden] { display: none !important; }

/* Pantalla d'arrencada */
#splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .35s var(--ease), visibility .35s;
}
#splash img { border-radius: 24px; box-shadow: var(--shadow-2); animation: splash-pop .7s var(--spring) both; }
body.ready #splash { opacity: 0; visibility: hidden; }
@keyframes splash-pop { from { transform: scale(.86); opacity: 0; } }

/* ─────────── Tipografia ─────────── */
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.02;
}
.h-xl { font-size: clamp(40px, 11vw, 52px); }
.h-lg { font-size: clamp(32px, 8.6vw, 40px); }
.h-md { font-size: 28px; }
.h-sm { font-size: 22px; }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--mute);
}
:lang(zh) .eyebrow, :lang(ja) .eyebrow, :lang(ar) .eyebrow { letter-spacing: .02em; }
.lead { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.muted { color: var(--mute); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.prose p { margin: 0 0 1em; font-size: 17px; line-height: 1.68; color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }
.prose p:first-child { font-size: 18.5px; color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 650; }
.card.prose p, .card.prose p:first-child { font-size: 16px; color: var(--ink-2); }

/* ─────────── Estructura ─────────── */
#app { min-height: 100vh; min-height: 100dvh; overflow-x: clip; }
.view {
  min-height: 100vh; min-height: 100dvh;
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
  animation: view-in .38s var(--ease) both;
}
.view.no-tabbar { padding-bottom: calc(var(--safe-b) + 24px); }
.view.back-anim { animation-name: view-back; }
.view.fade-anim { animation-name: view-fade; }
@keyframes view-in { from { opacity: 0; transform: translate3d(18px, 0, 0); } }
@keyframes view-back { from { opacity: 0; transform: translate3d(-18px, 0, 0); } }
@keyframes view-fade { from { opacity: 0; } }
[dir="rtl"] .view:not(.fade-anim):not(.back-anim) { animation-name: view-back; }
[dir="rtl"] .view.back-anim { animation-name: view-in; }
.wrap { padding-inline: calc(var(--pad) + var(--safe-l)) calc(var(--pad) + var(--safe-r)); max-width: 640px; margin-inline: auto; }
.stack > * + * { margin-top: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* Barra superior (apareix en fer scroll) */
.topbar {
  position: sticky; top: 0; z-index: 20;
  margin-top: calc(-1 * var(--safe-t));
  padding: calc(var(--safe-t) + 8px) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l));
  display: flex; align-items: center; gap: 8px; min-height: calc(56px + var(--safe-t));
  transition: background-color .25s, box-shadow .25s, border-color .25s;
  border-bottom: 1px solid transparent;
}
.topbar.solid, .topbar.scrolled {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
.topbar-title {
  flex: 1; min-width: 0; text-align: center; font-weight: 650; font-size: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s;
}
.topbar.scrolled .topbar-title, .topbar.solid .topbar-title { opacity: 1; transform: none; }
.topbar .spacer { width: 44px; flex: none; }
.topbar.overlay { position: fixed; inset-inline: 0; }
.topbar.overlay:not(.scrolled) .btn-icon { background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow-1); }

/* Capçalera de les pestanyes principals */
.brandbar { display: flex; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 6px; }
.brandbar .tile { width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--shadow-1); }
.brandbar .name { font-family: var(--serif); font-size: 23px; line-height: 1; letter-spacing: -.01em; }
.brandbar .name small { display: block; font-family: var(--font); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin-top: 4px; }
:lang(zh) .brandbar .name, :lang(ja) .brandbar .name, :lang(ar) .brandbar .name { font-family: "Instrument Serif", var(--serif); }

/* ─────────── Botons ─────────── */
.btn {
  --h: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 17px;
  font-weight: 650; font-size: 16.5px; letter-spacing: -.005em;
  background: var(--y); color: var(--y-ink);
  transition: transform .15s var(--ease), background-color .2s, opacity .2s, box-shadow .2s;
  user-select: none; -webkit-user-select: none; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 8px 20px -10px rgba(190, 150, 0, .7);
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.block { width: 100%; }
.btn.dark { background: var(--ink); color: var(--bg); box-shadow: 0 10px 24px -12px rgba(0,0,0,.5); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.soft { background: var(--bg-2); color: var(--ink); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }
.btn.sm { --h: 40px; padding: 0 16px; border-radius: 13px; font-size: 15px; }
.btn.md { --h: 48px; border-radius: 15px; }
.btn .i { width: 20px; height: 20px; }
.btn.loading::after {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 2.2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn-icon {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink);
  transition: transform .15s var(--ease), background-color .2s;
}
.btn-icon:active { transform: scale(.92); background: var(--bg-2); }
.btn-icon .i { width: 22px; height: 22px; }
.btn-icon.filled { background: var(--surface); box-shadow: var(--shadow-1); }
.link { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--y); text-decoration-thickness: 2.5px; text-underline-offset: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────── Pestanyes inferiors ─────────── */
.tabbar {
  position: fixed; z-index: 40; inset-inline: 0; bottom: 0;
  padding: 6px calc(12px + var(--safe-r)) calc(6px + var(--safe-b)) calc(12px + var(--safe-l));
  display: flex; justify-content: space-around;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
  transition: transform .35s var(--spring);
}
.tabbar.hidden { transform: translateY(110%); }
.tab {
  flex: 1; max-width: 140px; height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--faint);
  transition: color .2s;
}
.tab .ico { position: relative; width: 52px; height: 28px; display: grid; place-items: center; border-radius: 14px; transition: background-color .25s var(--ease); }
.tab .i { width: 23px; height: 23px; }
.tab.active { color: var(--ink); }
.tab.active .ico { background: var(--y); color: var(--y-ink); }
.tab:active .ico { transform: scale(.94); }

/* ─────────── Targetes ─────────── */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card.pad { padding: 20px; }
.card.flat { box-shadow: inset 0 0 0 1px var(--line); }
.pressable { transition: transform .18s var(--ease); }
.pressable:active { transform: scale(.985); }

/* Targeta de ciutat destacada */
.city-hero {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--r-xl); background: #0B0B0B; color: #fff;
  aspect-ratio: 4 / 4.6; box-shadow: var(--shadow-2);
}
.city-hero img.logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; transform: scale(1.02) translateY(-7%); }
.city-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 22%, rgba(0,0,0,.72) 46%, rgba(0,0,0,.93) 62%, #000 100%);
}
.city-hero .body { position: absolute; z-index: 2; inset-inline: 0; bottom: 0; padding: 22px; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.city-hero .brand { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--y); }
.city-hero h3 { font-family: var(--serif); font-weight: 400; font-size: 48px; line-height: 1; margin: 6px 0 8px; letter-spacing: -.01em; }
.city-hero p { color: rgba(255,255,255,.78); font-size: 15px; line-height: 1.45; }
.city-hero .meta { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.city-hero .go {
  position: absolute; z-index: 2; top: 18px; inset-inline-end: 18px;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--y); color: #111;
}

.city-mini {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1);
}
.city-mini .thumb { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #0B0B0B; }
.city-mini .thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.2); opacity: .9; }
.city-mini .name { font-family: var(--serif); font-size: 24px; line-height: 1; padding: 0 2px; }
.city-mini .badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Xips i insígnies */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--bg-2); color: var(--ink-2);
}
.chip .i { width: 15px; height: 15px; }
.chip.y { background: var(--y); color: var(--y-ink); }
.chip.dark { background: rgba(255,255,255,.14); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.chip.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.chip.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; background: var(--ink); color: var(--bg);
}
.badge.y { background: var(--y); color: var(--y-ink); }
.badge.glass-dark { background: rgba(255,255,255,.16); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.badge .i { width: 13px; height: 13px; }

/* Selector d'idioma compacte */
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-1); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.lang-btn .i { width: 17px; height: 17px; }

/* ─────────── Capçalera de portal (ciutat) ─────────── */
.portal-hero {
  position: relative; margin-top: calc(-1 * var(--safe-t));
  padding: calc(var(--safe-t) + 72px) var(--pad) 28px;
  background: #0B0B0B; color: #fff; overflow: hidden;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.portal-hero .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; filter: blur(0px); transform: scale(1.15); }
.portal-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,11,11,.3), rgba(11,11,11,.85) 70%, #0B0B0B); }
.portal-hero > * { position: relative; z-index: 2; }
.portal-hero .logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 10px 40px -8px rgba(253,216,2,.45); }
.portal-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 11vw, 50px); line-height: 1; margin-top: 18px; }
.portal-hero h1 em { font-style: italic; color: var(--y); }
.portal-hero p { color: rgba(255,255,255,.75); margin-top: 10px; font-size: 16px; }
.portal-hero .stats { display: flex; gap: 22px; margin-top: 22px; }
.portal-hero .stats b { display: block; font-size: 20px; font-weight: 650; }
.portal-hero .stats span { font-size: 12.5px; color: rgba(255,255,255,.6); }
:lang(zh) .portal-hero h1, :lang(ja) .portal-hero h1, :lang(ar) .portal-hero h1 { font-family: "Instrument Serif", var(--font); }

/* Targeta de desbloqueig */
.unlock {
  position: relative; overflow: hidden;
  padding: 22px; border-radius: var(--r-lg);
  background: var(--y); color: var(--y-ink);
  box-shadow: 0 20px 44px -22px rgba(170, 130, 0, .8);
}
.unlock .price { font-family: var(--serif); font-size: 44px; line-height: 1; }
.unlock h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.unlock ul { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 8px; }
.unlock li { display: flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 500; }
.unlock li .i { width: 18px; height: 18px; }
.unlock .fine { font-size: 12.5px; opacity: .72; margin-top: 12px; display: flex; align-items: center; gap: 6px; justify-content: center; }
.unlock .fine .i { width: 14px; height: 14px; }
.unlock .deco { position: absolute; inset-inline-end: -26px; top: -10px; width: 124px; opacity: .95; transform: rotate(8deg); pointer-events: none; }
.unlock .btn.dark { background: #111; color: #fff; }
.unlocked-note { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); }
.unlocked-note .dot { width: 36px; height: 36px; border-radius: 50%; background: var(--y); color: var(--y-ink); display: grid; place-items: center; }
.unlocked-note .dot .i { width: 19px; height: 19px; }

/* Presentació de la ciutat (abans de les rutes) */
.city-about {
  position: relative; overflow: hidden; margin-top: 14px;
  padding: 20px 22px 22px; border-radius: var(--r-lg);
  background: radial-gradient(130% 90% at 100% 0%, var(--y-soft) 0%, transparent 60%), var(--surface);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
/* Cometes grans de la marca */
.city-about::before {
  content: "\201C"; position: absolute; top: -2px; inset-inline-end: 18px;
  font-family: "Instrument Serif", Georgia, serif; font-size: 112px; line-height: 1; color: var(--y);
  pointer-events: none;
}
[dir="rtl"] .city-about { background: radial-gradient(130% 90% at 0% 0%, var(--y-soft) 0%, transparent 60%), var(--surface); }
.city-about > * { position: relative; }
.city-about .head { display: flex; align-items: center; gap: 12px; padding-inline-end: 64px; }
.city-about .mark { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--y); color: var(--y-ink); box-shadow: 0 6px 16px -8px rgba(170, 130, 0, .7); }
.city-about .mark .i { width: 21px; height: 21px; }
.city-about h2 { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
:lang(zh) .city-about h2, :lang(ja) .city-about h2, :lang(ar) .city-about h2 { letter-spacing: .02em; font-size: 14px; }
.city-about .txt { margin-top: 16px; padding-inline-start: 14px; border-inline-start: 3px solid var(--y); }
.city-about .txt p { margin: 0 0 .85em; font-size: 16px; line-height: 1.62; color: var(--ink-2); }
.city-about .txt p:last-child { margin-bottom: 0; }
.city-about .txt p:first-child { font-family: var(--serif); font-size: 21px; line-height: 1.28; color: var(--ink); }
:lang(zh) .city-about .txt p:first-child, :lang(ja) .city-about .txt p:first-child, :lang(ar) .city-about .txt p:first-child { font-size: 18px; line-height: 1.55; font-weight: 600; }
.city-about .txt strong { color: var(--ink); font-weight: 650; }
.city-about.clamped .txt {
  max-height: 290px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent);
}
.city-about .more { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; margin-inline-start: 17px; padding: 6px 0; font-weight: 650; font-size: 15px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--y); text-decoration-thickness: 2.5px; text-underline-offset: 4px; }
.city-about .more .i { width: 17px; height: 17px; }

/* ─────────── Targetes de ruta ─────────── */
.route-card { display: block; overflow: hidden; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.route-card .cover { position: relative; aspect-ratio: 16 / 9; background: #111; overflow: hidden; }
.route-card .cover > svg, .route-card .cover > img { width: 100%; height: 100%; object-fit: cover; }
.route-card .cover .tags { position: absolute; top: 12px; inset-inline-start: 12px; display: flex; gap: 6px; }
.route-card .cover .num { position: absolute; bottom: 12px; inset-inline-end: 14px; font-family: var(--serif); font-size: 44px; line-height: 1; color: rgba(255,255,255,.9); }
.route-card .body { padding: 16px 18px 18px; }
.route-card h3 { font-family: var(--serif); font-weight: 400; font-size: 29px; line-height: 1.05; letter-spacing: -.005em; }
:lang(zh) .route-card h3, :lang(ja) .route-card h3, :lang(ar) .route-card h3 { font-size: 22px; font-weight: 700; }
.route-card p { color: var(--mute); font-size: 15px; margin-top: 6px; line-height: 1.45; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; color: var(--ink-2); font-size: 14px; font-weight: 550; }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.meta-row .i { width: 16px; height: 16px; color: var(--mute); }
.progress { height: 5px; border-radius: 9px; background: var(--bg-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 9px; background: var(--y); transition: width .5s var(--ease); }
.route-card .progress { margin-top: 14px; }

/* ─────────── Detall de ruta ─────────── */
.route-map {
  position: relative; height: calc(44vh + var(--safe-t)); min-height: 300px; max-height: 500px;
  margin-top: calc(-1 * var(--safe-t)); background: #0B0B0B; overflow: hidden;
}
.route-map .map, .route-map > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.route-map .expand { position: absolute; bottom: 36px; inset-inline-end: 16px; z-index: 5; }
.route-map .maplibregl-ctrl-bottom-right, .route-map .maplibregl-ctrl-bottom-left { bottom: 26px; }
/* L'atribució va al costat contrari del botó d'ampliar el mapa */
.route-map .maplibregl-ctrl-bottom-right { right: auto; left: 0; }
[dir="rtl"] .route-map .maplibregl-ctrl-bottom-right { left: auto; right: 0; }
.route-map .mk { width: 24px; height: 24px; font-size: 11.5px; box-shadow: 0 0 0 2px #111, 0 3px 8px rgba(0,0,0,.22); }
.sheet-body {
  position: relative; z-index: 3; margin-top: -26px; padding-top: 26px;
  background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.stat { min-width: 0; background: var(--surface); border-radius: 16px; padding: 12px 5px; text-align: center; box-shadow: var(--shadow-1); }
.stat .i { width: 19px; height: 19px; margin: 0 auto 6px; color: var(--mute); }
.stat b { display: block; font-size: 15px; font-weight: 700; line-height: 1.25; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.stat span { display: block; font-size: 11.5px; color: var(--mute); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Fitxa de la ruta: una sola targeta amb quatre dades separades per línies */
.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; padding: 14px 0;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1);
}
.facts > div { min-width: 0; padding: 0 6px; text-align: center; }
.facts > div + div { box-shadow: -1px 0 0 var(--line); }
[dir="rtl"] .facts > div + div { box-shadow: 1px 0 0 var(--line); }
.facts .i { width: 19px; height: 19px; margin: 0 auto 7px; color: var(--mute); }
.facts b { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.22; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.facts span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Punt de sortida amb indicacions per arribar-hi */
.start-point { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); }
.start-point .ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--y); color: var(--y-ink); }
.start-point .ic .i { width: 19px; height: 19px; }
.start-point small { display: block; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
:lang(zh) .start-point small, :lang(ja) .start-point small, :lang(ar) .start-point small { letter-spacing: 0; }
.start-point b { display: block; font-size: 15.5px; font-weight: 650; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start-point .act { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 650; color: var(--ink); text-decoration: underline; text-decoration-color: var(--y); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.start-point .act .i { width: 15px; height: 15px; }

.stops { position: relative; list-style: none; margin: 0; padding: 0; }
.stops::before { content: ""; position: absolute; top: 24px; bottom: 24px; inset-inline-start: 19px; width: 2px; background: repeating-linear-gradient(to bottom, var(--line-2) 0 5px, transparent 5px 10px); }
.stop-item { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.stop-item .n {
  position: relative; z-index: 1; width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink);
}
.stop-item.done .n { background: var(--ink); color: var(--y); box-shadow: none; }
.stop-item.next .n { background: var(--y); color: var(--y-ink); box-shadow: 0 0 0 5px var(--y-soft); }
.stop-item .t { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; line-height: 1.3; }
.stop-item .t small { display: block; color: var(--mute); font-weight: 500; font-size: 13px; margin-top: 2px; }
.stop-item .i { width: 18px; height: 18px; color: var(--faint); }

.cta-bar {
  position: fixed; z-index: 30; inset-inline: 0; bottom: 0;
  padding: 12px calc(var(--pad) + var(--safe-r)) calc(12px + var(--safe-b)) calc(var(--pad) + var(--safe-l));
  background: linear-gradient(to top, var(--bg) 62%, color-mix(in srgb, var(--bg) 0%, transparent));
  display: flex; gap: 10px;
}
.cta-bar .btn { flex: 1; }

/* ─────────── Llistes (compte, configuració) ─────────── */
.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 56px; padding: 12px 16px; text-align: start;
  transition: background-color .15s;
}
.list-item + .list-item { box-shadow: 0 -1px 0 var(--line); }
.list-item:active { background: var(--bg-2); }
.list-item .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); flex: none; }
.list-item .ic .i { width: 19px; height: 19px; }
.list-item .ic.y { background: var(--y); color: var(--y-ink); }
.list-item .label { flex: 1; min-width: 0; font-weight: 550; }
.list-item .label small { display: block; font-weight: 400; color: var(--mute); font-size: 13.5px; }
.list-item .value { color: var(--mute); font-size: 15px; }
.list-item .chev { width: 18px; height: 18px; color: var(--faint); }
.list-item.danger .label { color: var(--danger); }
.list-label { font-size: 13px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; margin: 28px 4px 10px; }
:lang(zh) .list-label, :lang(ja) .list-label, :lang(ar) .list-label { letter-spacing: 0; }

/* Interruptor */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background-color .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-20px); }

/* Control segmentat */
.segmented { display: flex; padding: 3px; border-radius: 13px; background: var(--bg-2); }
.segmented button { flex: 1; height: 34px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--mute); transition: all .2s; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ─────────── Formularis ─────────── */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin: 0 2px 7px; }
.input {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .2s;
}
.input:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.input .i { width: 20px; height: 20px; color: var(--mute); margin-inline-start: 16px; }
.input input {
  flex: 1; min-width: 0; height: 56px; padding: 0 16px; border: 0; outline: 0; background: transparent;
  font-size: 17px; border-radius: 16px;
}
.input input::placeholder { color: var(--faint); }
.input .eye { width: 48px; height: 48px; display: grid; place-items: center; color: var(--mute); }
.input .eye .i { margin: 0; }
/* Text llarg (formulari de contacte) */
.input.area { align-items: stretch; }
.input textarea {
  flex: 1; min-width: 0; min-height: 150px; padding: 15px 16px; border: 0; outline: 0; background: transparent;
  font-size: 17px; line-height: 1.5; border-radius: 16px; resize: vertical;
}
.input textarea::placeholder { color: var(--faint); }
/* Opcions en forma de xip (tema del missatge) */
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topic { position: relative; cursor: pointer; }
.topic input { position: absolute; inset: 0; opacity: 0; margin: 0; pointer-events: none; }
.topic span {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 99px;
  font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color .15s, color .15s;
}
.topic .i { width: 17px; height: 17px; }
.topic input:checked + span { background: var(--ink); color: var(--bg); box-shadow: none; }
.topic input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Camp parany contra el correu brossa: invisible per a les persones */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; }
.form-error { display: none; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); font-size: 14.5px; font-weight: 550; }
.form-error.show { display: flex; animation: shake .35s; }
.form-error .i { width: 18px; height: 18px; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ─────────── Fulls inferiors (bottom sheets) ─────────── */
.sheet-root { position: fixed; inset: 0; z-index: 80; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity .3s; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; inset-inline: 0; bottom: 0;
  max-height: calc(100dvh - var(--safe-t) - 24px); overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px calc(var(--pad) + var(--safe-r)) calc(24px + var(--safe-b)) calc(var(--pad) + var(--safe-l));
  transform: translateY(100%); transition: transform .42s var(--spring);
  box-shadow: var(--shadow-3);
}
.sheet-root.open .sheet { transform: translateY(0); }
.sheet:focus-visible { outline: none; }
.sheet .handle { width: 40px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 14px; }
.sheet .sheet-close { position: absolute; top: 12px; inset-inline-end: 12px; }
@media (min-width: 700px) {
  .sheet { max-width: 520px; margin-inline: auto; bottom: 24px; border-radius: var(--r-xl); }
}

/* Avisos */
.toast-host { position: fixed; z-index: 90; inset-inline: 0; top: calc(var(--safe-t) + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 460px;
  padding: 12px 16px; border-radius: 16px; background: var(--ink); color: var(--bg);
  font-size: 14.5px; font-weight: 550; box-shadow: var(--shadow-3);
  animation: toast-in .45s var(--spring) both;
}
.toast .i { width: 19px; height: 19px; color: var(--y); }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* Esquelets de càrrega */
.skel { position: relative; overflow: hidden; background: var(--bg-2); border-radius: 14px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: shimmer 1.3s infinite; }
[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Estat buit */
.empty { text-align: center; padding: 36px 12px 12px; }
.empty img { width: 150px; margin: 0 auto 18px; }
.empty h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.05; }
.empty p { color: var(--mute); margin: 10px auto 22px; max-width: 320px; }

/* Passos "com funciona" */
.how { display: grid; gap: 10px; }
.how-item { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); }
.how-item .k { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; background: var(--y); color: var(--y-ink); }
.how-item .k .i { width: 21px; height: 21px; }
.how-item b { display: block; font-size: 16px; }
.how-item .step { float: inline-end; margin-inline-start: 8px; font-family: var(--serif); font-size: 26px; line-height: .8; color: var(--faint); }
.how-item p { color: var(--mute); font-size: 14.5px; line-height: 1.45; margin-top: 2px; }

.footer { margin-top: 44px; text-align: center; color: var(--faint); font-size: 13px; }
.footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.footer a { color: var(--mute); font-weight: 550; }

/* ─────────── Mode navegació ─────────── */
.nav-view { position: fixed; inset: 0; background: var(--bg-2); overflow: hidden; }
.nav-view .map { position: absolute; inset: 0; }
.nav-top {
  position: absolute; z-index: 10; top: 0; inset-inline: 0;
  padding: calc(var(--safe-t) + 10px) calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l));
  display: flex; align-items: flex-start; gap: 10px; pointer-events: none;
}
.nav-top > * { pointer-events: auto; }
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-2);
}
.nav-pill { flex: 1; min-width: 0; border-radius: 22px; padding: 10px 14px 12px; }
.nav-pill .t { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-pill .segs { display: flex; gap: 3px; margin-top: 8px; }
.nav-pill .segs i { flex: 1; height: 4px; border-radius: 4px; background: var(--line-2); transition: background-color .3s; }
.nav-pill .segs i.on { background: var(--ink); }
.nav-pill .segs i.cur { background: var(--y); }
.nav-fabs {
  position: absolute; z-index: 10; inset-inline-end: calc(12px + var(--safe-r)); bottom: calc(var(--peek, 190px) + 12px);
  display: flex; flex-direction: column; gap: 10px;
  /* Pugen amb el full quan s'arrossega i s'esvaeixen */
  transform: translateY(calc(-1 * var(--lift, 0px))); opacity: calc(1 - var(--lift-p, 0) * 2.5);
  transition: bottom .5s var(--spring), transform .5s var(--spring), opacity .25s;
}
.nav-view.has-mini .nav-fabs { bottom: calc(var(--peek, 190px) + 76px); }
.nav-view.expanded .nav-fabs { opacity: 0; pointer-events: none; }
.fab { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; }
.fab .i { width: 22px; height: 22px; }
.fab.on { background: var(--ink); color: var(--y); }
.nav-alert {
  position: absolute; z-index: 11; top: calc(var(--safe-t) + 84px); inset-inline: 12px;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; font-size: 14px; font-weight: 600;
  animation: toast-in .4s var(--spring) both;
}
.nav-alert .i { width: 19px; height: 19px; }

/* Targeta de parada al mapa a pantalla completa */
.map-card {
  position: absolute; z-index: 10; inset-inline: calc(12px + var(--safe-l)) calc(12px + var(--safe-r)); bottom: calc(34px + var(--safe-b));
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; text-align: start;
  animation: card-up .35s var(--spring) both; transition: transform .15s var(--ease);
}
.map-card:active { transform: scale(.985); }
button.map-card { width: calc(100% - 24px - var(--safe-l) - var(--safe-r)); }
.map-card .n { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--y); color: var(--y-ink); font-weight: 700; font-size: 15px; }
.map-card b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 650; font-size: 15.5px; line-height: 1.25; }
.map-card small { display: block; color: var(--mute); font-size: 13px; margin-top: 1px; }
.map-card .go { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--y); }
.map-card .go .i { width: 20px; height: 20px; }
@keyframes card-up { from { opacity: 0; transform: translateY(16px); } }

/* Full de navegació arrossegable */
.nav-sheet {
  position: absolute; z-index: 20; inset-inline: 0; bottom: 0; top: calc(var(--safe-t) + 70px);
  max-width: 640px; margin-inline: auto;
  background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -10px 40px -10px rgba(0,0,0,.25);
  transform: translateY(calc(100% - var(--peek, 190px)));
  transition: transform .5s var(--spring);
  display: flex; flex-direction: column;
  will-change: transform;
  /* Plegat, tot el full s'arrossega (no hi ha res a desplaçar) */
  touch-action: none;
}
.nav-sheet.expanded { transform: translateY(0); touch-action: auto; }
.nav-sheet.dragging { transition: none; }
.nav-sheet .grab { position: relative; flex: none; height: 22px; cursor: grab; touch-action: none; transition: height .5s var(--spring); }
.nav-sheet.expanded .grab { height: 50px; }
.nav-sheet.dragging .grab { cursor: grabbing; }
.nav-sheet .grab .handle { position: absolute; top: 9px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 9px; background: var(--line-2); }
.nav-sheet .sheet-down {
  position: absolute; top: 8px; inset-inline-end: calc(12px + var(--safe-r)); width: 38px; height: 38px;
  background: var(--bg-2); opacity: 0; transform: scale(.8); pointer-events: none;
  transition: opacity .2s, transform .3s var(--spring);
}
.nav-sheet .sheet-down .i { width: 22px; height: 22px; }
.nav-sheet.expanded .sheet-down { opacity: 1; transform: none; pointer-events: auto; }
/* Parada anterior / següent (amb el full obert) */
.nav-sheet .sheet-pager {
  position: absolute; top: 8px; inset-inline-start: calc(12px + var(--safe-l));
  display: flex; align-items: center; height: 38px; padding: 0 2px; border-radius: 19px; background: var(--bg-2);
  opacity: 0; transform: scale(.9); pointer-events: none;
  transition: opacity .2s, transform .3s var(--spring);
}
.nav-sheet.expanded .sheet-pager.on { opacity: 1; transform: none; pointer-events: auto; }
.sheet-pager .btn-icon { width: 34px; height: 34px; }
.sheet-pager .btn-icon .i { width: 20px; height: 20px; }
.sheet-pager .btn-icon:disabled { opacity: .3; }
.sheet-pager span { min-width: 40px; text-align: center; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nav-sheet .content {
  flex: 1; min-height: 0; overflow: hidden; overscroll-behavior: contain;
  padding: 0 calc(var(--pad) + var(--safe-r)) calc(var(--safe-b) + 28px) calc(var(--pad) + var(--safe-l));
}
.nav-sheet.expanded .content { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.nav-view.mini-docked .nav-sheet .content { padding-bottom: calc(var(--safe-b) + 96px); }
/* El text que puja amb el full apareix suaument (i la targeta en tornar) */
.nav-sheet [data-detail]:not([hidden]), .nav-sheet [data-peek]:not([hidden]) { animation: sheet-in .28s var(--ease) both; }
@keyframes sheet-in { from { opacity: 0; } }
.nav-detail-actions { --gap: 10px; margin-top: 26px; }
/* Mesura de la zona segura inferior (barra d'inici de l'iPhone) */
.safe-probe { position: absolute; bottom: 0; left: 0; width: 1px; height: var(--safe-b); visibility: hidden; pointer-events: none; }

.next-card { display: flex; align-items: center; gap: 14px; padding: 6px 0 14px; cursor: pointer; }
.next-card .arrow {
  width: 58px; height: 58px; border-radius: 18px; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--y);
}
.next-card .arrow .i { width: 30px; height: 30px; transition: transform .5s var(--ease); }
.next-card .lbl { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.next-card .ttl { font-family: var(--serif); font-size: 26px; line-height: 1.05; margin-top: 2px; }
:lang(zh) .next-card .ttl, :lang(ja) .next-card .ttl, :lang(ar) .next-card .ttl { font-size: 20px; font-weight: 700; }
.next-card .dist { font-weight: 650; font-size: 15px; margin-top: 4px; }
.next-card .dist span { color: var(--mute); font-weight: 500; }
/* Ja s'ha arribat a la parada (pendent d'obrir mentre s'escolta l'anterior) */
.next-card.arrived .arrow { background: var(--y); color: var(--y-ink); animation: pop .6s var(--spring) both; }
.next-card.arrived .lbl { color: var(--ink); }
.nav-actions { display: flex; gap: 10px; }
.nav-actions .btn { flex: 1; }

/* Contingut de parada */
.stop-view .num-hero { display: flex; align-items: flex-end; gap: 14px; padding: 8px 0 4px; }
.stop-view .num-hero .big { font-family: var(--serif); font-size: 76px; line-height: .8; color: var(--y-strong); -webkit-text-stroke: 1px var(--ink); }
[data-theme="dark"] .stop-view .num-hero .big { -webkit-text-stroke: 0; color: var(--y); }
.stop-view .photo { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-2); margin: 6px 0 18px; }
.stop-view .photo img { width: 100%; height: 100%; object-fit: cover; }
.stop-view h2 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.02; }
:lang(zh) .stop-view h2, :lang(ja) .stop-view h2, :lang(ar) .stop-view h2 { font-size: 28px; font-weight: 700; line-height: 1.25; }
.stop-view .directions { margin-top: 12px; color: var(--ink); }
.arrived-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; margin-bottom: 14px;
  background: var(--y); color: var(--y-ink); font-weight: 700; font-size: 14.5px;
  animation: pop .6s var(--spring) both;
}
.arrived-banner .i { width: 20px; height: 20px; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

/* Reproductor d'àudio */
.player { margin: 18px 0 22px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.player .top { display: flex; align-items: center; gap: 14px; }
.player .play {
  width: 60px; height: 60px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--y); transition: transform .15s var(--ease);
}
.player .play:active { transform: scale(.93); }
.player .play .i { width: 26px; height: 26px; }
.player .info { flex: 1; min-width: 0; }
.player .info b { display: block; font-size: 15.5px; }
.player .info span { font-size: 13px; color: var(--mute); }
.player .speed { height: 34px; min-width: 52px; padding: 0 10px; border-radius: 11px; background: var(--bg-2); font-weight: 700; font-size: 13.5px; }
.player .bar { position: relative; height: 28px; margin-top: 10px; touch-action: none; cursor: pointer; }
.player .bar .track { position: absolute; top: 12px; inset-inline: 0; height: 4px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.player .bar .fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--ink); border-radius: 4px; }
.player .bar .knob { position: absolute; top: 7px; width: 14px; height: 14px; margin-inline-start: -7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--y); inset-inline-start: 0; }
.player .times { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.player .skip { display: flex; gap: 4px; }
.player.tts .bar .fill { transition: width .3s linear; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; margin-inline-start: 6px; }
.eq i { width: 3px; background: var(--y-strong); border-radius: 2px; animation: eq 1s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

/* Mini reproductor */
.mini-player {
  position: absolute; z-index: 15; inset-inline: calc(12px + var(--safe-l)) calc(12px + var(--safe-r)); bottom: calc(var(--peek, 190px) + 12px);
  max-width: 616px; margin-inline: auto;
  display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 18px; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.97);
  transition: opacity .25s, transform .5s var(--spring), bottom .5s var(--spring), visibility 0s linear .25s;
}
.mini-player.show {
  visibility: visible; transition-delay: 0s;
  /* Com els botons flotants: puja amb el full i s'esvaeix */
  transform: translateY(calc(-1 * var(--lift, 0px))); opacity: calc(1 - var(--lift-p, 0) * 2.5);
}
.nav-view.dragging :is(.nav-fabs, .mini-player) { transition: none; }
/* Amb el text obert d'una altra parada, a baix de tot i per sobre del full */
.nav-view.mini-docked .mini-player.show {
  z-index: 25; bottom: calc(12px + var(--safe-b)); opacity: 1; transform: none;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-3);
  transition: opacity .25s, transform .5s var(--spring), visibility 0s;
}
.mini-player .mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 8px; text-align: start; border-radius: 12px; }
.mini-player .t { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-player .eq { display: none; margin: 0; flex: none; }
.mini-player.playing .eq { display: inline-flex; }
.mini-player .mini-toggle { width: 40px; height: 40px; background: var(--ink); color: var(--y); }
.mini-player .mini-toggle .i { width: 20px; height: 20px; }
.mini-player .mini-close { width: 36px; height: 36px; color: var(--mute); }
.mini-player .mini-close .i { width: 19px; height: 19px; }
.mini-player .mini-bar { position: absolute; inset-inline: 14px; bottom: 0; height: 2.5px; border-radius: 2px; background: var(--line); overflow: hidden; pointer-events: none; }
.mini-player .mini-bar i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .3s linear; }
[dir="rtl"] .mini-player .mini-bar i { transform-origin: right; }

/* Marcadors del mapa */
.mk {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 700 13px/1 var(--font); color: #111; background: #fff;
  box-shadow: 0 0 0 2.5px #111, 0 4px 10px rgba(0,0,0,.25);
  transition: background-color .3s, width .3s var(--spring), height .3s var(--spring);
  cursor: pointer;
}
.mk.done { background: #111; color: var(--y); box-shadow: 0 0 0 2.5px #111, 0 4px 10px rgba(0,0,0,.2); }
.mk.next { width: 38px; height: 38px; font-size: 15px; background: var(--y); z-index: 3; }
.mk.next::before { content: ""; position: absolute; width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(253,216,2,.7); animation: ring 1.8s infinite; }
.mk.dim { opacity: .75; }
@keyframes ring { 70% { box-shadow: 0 0 0 16px rgba(253,216,2,0); } 100% { box-shadow: 0 0 0 0 rgba(253,216,2,0); } }
.me { position: relative; width: 22px; height: 22px; }
.me .dot { position: absolute; inset: 0; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.me .halo { position: absolute; inset: -18px; border-radius: 50%; background: rgba(26,115,232,.18); animation: halo 2.4s infinite var(--ease); }
.me .cone { position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; background: conic-gradient(from -30deg, rgba(26,115,232,.45), rgba(26,115,232,0) 60deg, rgba(26,115,232,0) 300deg, rgba(26,115,232,.45)); -webkit-mask: radial-gradient(circle, #000 0 34px, transparent 35px); mask: radial-gradient(circle, #000 0 34px, transparent 35px); opacity: 0; transition: opacity .3s; }
.me.has-heading .cone { opacity: 1; }
@keyframes halo { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.maplibregl-ctrl-attrib { font-size: 10px !important; background: var(--glass) !important; border-radius: 8px 0 0 0; }
.maplibregl-ctrl-attrib a { color: var(--mute) !important; }
.maplibregl-ctrl-bottom-right { bottom: 0; }
.maplibregl-canvas:focus { outline: none; }

/* Pantalla final */
.finish { text-align: center; padding: 20px 0; }
.finish img { width: 170px; margin: 0 auto; animation: bounce 1s var(--spring) both; }
.finish h2 { font-family: var(--serif); font-weight: 400; font-size: 42px; line-height: 1; margin-top: 12px; }
.finish p { color: var(--mute); margin: 10px auto 0; max-width: 320px; }
.finish .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 24px 0; }
@keyframes bounce { 0% { transform: translateY(30px) scale(.8); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ─────────── Benvinguda (onboarding) ─────────── */
/* Pantalla fixa: mai fa scroll, s'adapta a l'alçada del mòbil. */
html.onb-open, html.onb-open body { overflow: hidden; }
.onb {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  background: var(--bg); overflow: hidden;
  touch-action: none; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  animation: view-fade .4s var(--ease) both;
}
.onb::before {
  content: ""; position: absolute; z-index: 0; inset: -18% -30% auto; height: 62%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--y) 26%, transparent), transparent);
}
.onb > * { position: relative; z-index: 1; }
.onb.out { opacity: 0; transform: scale(1.02); transition: opacity .35s, transform .35s; pointer-events: none; }
.onb.switching .onb-text, .onb.switching .onb-foot { opacity: .35; transition: opacity .2s; }

.onb-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; padding: 0 10px 0 20px; }
.onb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: "Instrument Serif", Georgia, serif; font-size: 21px; line-height: 1; white-space: nowrap; }
.onb-brand img { width: 32px; height: 32px; border-radius: 10px; box-shadow: var(--shadow-1); }
.onb-skip { flex: none; height: 40px; padding: 0 14px; border-radius: 99px; font-weight: 650; font-size: 14.5px; color: var(--mute); transition: background-color .2s; }
.onb-skip:active { background: var(--bg-2); }

.onb-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.onb-track { display: flex; height: 100%; transition: transform .6s var(--spring); will-change: transform; }
.onb-track.drag { transition: none; }
.onb-slide { flex: 0 0 100%; min-width: 0; height: 100%; display: flex; flex-direction: column; padding: 0 24px 6px; overflow: hidden; overflow: clip; }
.onb-art { flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4px 0 clamp(12px, 2.6vh, 24px); container-type: size; }
.onb-text { flex: none; }
.onb-text .eyebrow { margin-bottom: 8px; color: var(--mute); }
.onb-text h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 5.3vh, 44px); line-height: 1.04; letter-spacing: -.01em; text-wrap: balance; }
:lang(ja) .onb-text h1, :lang(ja) .onb-text p { word-break: auto-phrase; }
.onb-text h1 em { font-style: italic; }
:lang(zh) .onb-text h1, :lang(ja) .onb-text h1, :lang(ar) .onb-text h1 { font-weight: 700; font-size: clamp(23px, 4vh, 31px); line-height: 1.3; letter-spacing: 0; }
.onb-text p { color: var(--mute); font-size: clamp(15px, 2.25vh, 17px); line-height: 1.5; margin-top: clamp(6px, 1.3vh, 12px); text-wrap: pretty; }

/* Entrada de cada pas */
.onb-slide .onb-text > *, .onb-slide .onb-art > * { transition: opacity .55s var(--ease), transform .6s var(--spring); }
.onb-slide:not(.on) .onb-text > * { opacity: 0; transform: translateY(14px); }
.onb-slide:not(.on) .onb-art > * { opacity: 0; transform: scale(.92); }
.onb-slide.on .onb-text > :nth-child(2) { transition-delay: .05s; }
.onb-slide.on .onb-text > :nth-child(3) { transition-delay: .1s; }
.onb-slide.on .onb-text > :nth-child(4) { transition-delay: .15s; }

/* Pas 1: salutació i idioma */
.hello-art { position: relative; height: min(100%, 250px); aspect-ratio: 1; display: grid; place-items: center; }
.hello-art .halo { position: absolute; inset: 9%; border-radius: 50%; background: var(--y); animation: breathe 5s ease-in-out infinite; }
.hello-art img { position: relative; height: 100%; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 14px 22px rgba(0,0,0,.18)); }
@keyframes breathe { 50% { transform: scale(1.05); } }
.onb-hello { position: relative; height: 1.12em; font-size: clamp(46px, 8.6vh, 66px); line-height: 1.12; overflow: hidden; }
.onb-hello span { position: absolute; inset-inline-start: 0; top: 0; white-space: nowrap; font-family: "Instrument Serif", Georgia, serif; letter-spacing: -.01em; }
.onb-hello span[lang="zh"], .onb-hello span[lang="ja"], .onb-hello span[lang="ar"] { font-family: var(--font); font-weight: 700; font-size: .74em; line-height: 1.5; }
.onb-hello span.in { animation: hello-in .7s var(--spring) both; }
.onb-hello span.out { animation: hello-out .45s var(--ease) forwards; }
@keyframes hello-in { from { opacity: 0; transform: translateY(70%); } }
@keyframes hello-out { to { opacity: 0; transform: translateY(-70%); } }
.onb-text p.onb-lead { color: var(--ink-2); margin-top: 4px; }
.onb-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); margin: clamp(12px, 2.4vh, 22px) 0 10px; }
:lang(zh) .onb-label, :lang(ja) .onb-label, :lang(ar) .onb-label { letter-spacing: 0; }
.lang-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lang-grid button { height: clamp(40px, 6.2vh, 50px); border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; font-size: 15px; white-space: nowrap; transition: background-color .2s, color .2s, transform .15s var(--ease); }
.lang-grid button:active { transform: scale(.95); }
.lang-grid button.on { background: var(--ink); color: var(--bg); box-shadow: none; }

/* Pas 2: ciutats d'Europa */
.fan { position: relative; height: min(100%, 270px); aspect-ratio: 1 / .92; font-size: clamp(10px, 6.4cqh, 19px); }
.fc { position: absolute; aspect-ratio: 1; border-radius: 22%; overflow: hidden; background: #0B0B0B; box-shadow: 0 18px 38px -18px rgba(0,0,0,.6); transform: rotate(var(--r, 0deg)); }
.fc img { width: 100%; height: 100%; object-fit: cover; }
.fc::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.78)); }
.fc .nm { position: absolute; z-index: 1; inset-inline: 10%; bottom: 8%; color: #fff; font-family: "Instrument Serif", Georgia, serif; font-size: .95em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc .tag { position: absolute; z-index: 1; top: 8%; inset-inline-start: 8%; padding: .3em .65em; border-radius: 99px; font-size: .52em; font-weight: 700; letter-spacing: .02em; color: #fff; background: rgba(255,255,255,.2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.fc.b0 { width: 38%; left: 4%; top: 13%; --r: -12deg; z-index: 1; }
.fc.b1 { width: 38%; left: 31%; top: 4.5%; --r: 0deg; z-index: 2; }
.fc.b2 { width: 38%; left: 58%; top: 13%; --r: 12deg; z-index: 1; }
/* Noms i etiquetes al costat que queda visible (també en àrab) */
.fc.b0 .nm { text-align: left; } .fc.b1 .nm { text-align: center; } .fc.b2 .nm { text-align: right; }
.fc.b0 .tag { inset-inline-start: auto; left: 8%; }
.fc.b2 .tag { inset-inline-start: auto; left: auto; right: 8%; }
.fc.main { width: 50%; left: 25%; bottom: 0; z-index: 3; box-shadow: 0 0 0 4px var(--bg), 0 26px 50px -18px rgba(0,0,0,.65); }
.fc.main .nm { font-size: 1.35em; }
.fc.main .tag { background: var(--y); color: #111; font-size: .6em; }
.onb-slide.on .fc { animation: fan-in .8s var(--spring) both; }
.onb-slide.on .fc.b0 { animation-delay: .08s; } .onb-slide.on .fc.b1 { animation-delay: .14s; } .onb-slide.on .fc.b2 { animation-delay: .2s; }
@keyframes fan-in { from { opacity: 0; transform: translateY(26%) rotate(0deg) scale(.8); } }

/* Pas 3: mapa guiat */
.mapcard {
  --m-bg: #F3F1EB; --m-blk: #E6E1D4; --m-park: #DCE6CE; --m-road: #FFFFFF;
  position: relative; height: min(100%, 330px); aspect-ratio: 1 / 1.04; border-radius: 30px; overflow: hidden;
  background: var(--m-bg); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
  font-size: clamp(9px, 4.3cqh, 14px);
}
[data-theme="dark"] .mapcard { --m-bg: #141416; --m-blk: #1F1F22; --m-park: #16201A; --m-road: #2C2C30; }
.mapcard > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.m-bg { fill: var(--m-bg); } .m-blk { fill: var(--m-blk); } .m-park { fill: var(--m-park); } .m-road { stroke: var(--m-road); }
.mapcard .rt-case { fill: none; stroke: #111; stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
.mapcard .rt { fill: none; stroke: #FDD802; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.mapcard .rt-2 { stroke-dasharray: .05 .06; }
.onb-slide.on .mapcard .rt:not(.rt-2) { animation: draw 1.4s .25s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 1; } }
.mapcard .mk-t { font: 800 14px/1 var(--font); fill: #111; }
.mapcard .mk-t.sm { font-size: 12px; }
.mapcard .pulse { fill: #FDD802; transform-box: fill-box; transform-origin: center; animation: mk-ring 1.8s ease-out infinite; }
@keyframes mk-ring { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(2.4); } }
.mc-next { position: absolute; inset-inline: 5%; bottom: 5%; display: flex; align-items: center; gap: .8em; padding: .7em .8em; border-radius: 1.3em; background: var(--glass); -webkit-backdrop-filter: saturate(170%) blur(14px); backdrop-filter: saturate(170%) blur(14px); box-shadow: var(--shadow-2); }
.mc-next .ar { flex: none; width: 3em; height: 3em; border-radius: .95em; display: grid; place-items: center; background: #111; color: var(--y); }
.mc-next .ar .i { width: 1.55em; height: 1.55em; transform: rotate(38deg); }
.mc-next .tx { min-width: 0; }
.mc-next small { display: block; font-size: .72em; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mute); }
.mc-next b { display: block; margin-top: .15em; font-family: var(--serif); font-weight: 400; font-size: 1.4em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:lang(zh) .mc-next b, :lang(ja) .mc-next b, :lang(ar) .mc-next b { font-weight: 700; font-size: 1.15em; }
.mc-next .d { display: block; margin-top: .2em; font-size: .88em; font-weight: 650; }

/* Pas 4: audioguia */
.audiocard {
  position: relative; height: min(100%, 300px); aspect-ratio: 1 / 1.02; border-radius: 30px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 1.4em;
  background: var(--surface); box-shadow: var(--shadow-2);
  font-size: clamp(9px, 4.5cqh, 14px);
}
.audiocard .cat { position: absolute; width: 34%; top: 3%; inset-inline-end: 3%; pointer-events: none; filter: drop-shadow(0 8px 12px rgba(0,0,0,.14)); }
.ac-banner { align-self: flex-start; display: inline-flex; align-items: center; gap: .5em; padding: .6em .95em; border-radius: 1em; background: var(--y); color: #111; font-weight: 700; font-size: 1em; }
.ac-banner .i { width: 1.3em; height: 1.3em; }
.ac-head { display: flex; align-items: flex-end; gap: .55em; min-width: 0; }
.ac-head .num { font-family: "Instrument Serif", Georgia, serif; font-size: 3.7em; line-height: .78; color: var(--y-strong); -webkit-text-stroke: 1px var(--ink); flex: none; }
[data-theme="dark"] .ac-head .num { -webkit-text-stroke: 0; color: var(--y); }
.ac-head b { font-family: var(--serif); font-weight: 400; font-size: 1.75em; line-height: 1.05; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:lang(zh) .ac-head b, :lang(ja) .ac-head b, :lang(ar) .ac-head b { font-weight: 700; font-size: 1.35em; }
.ac-player { display: flex; align-items: center; gap: .9em; }
.ac-player .play { flex: none; width: 3.7em; height: 3.7em; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--y); }
.ac-player .play .i { width: 1.5em; height: 1.5em; }
.wave { flex: 1; min-width: 0; height: 3.2em; display: flex; align-items: center; gap: 2.4%; }
.wave i { flex: 1; height: var(--h); border-radius: 9px; background: var(--line-2); }
.wave i.p { background: var(--ink); }
.onb-slide.on .wave i { animation: wave 1s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes wave { from { transform: scaleY(.4); } }
.ac-time { display: flex; justify-content: space-between; font-size: .82em; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; }
.onb-feats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: clamp(10px, 1.8vh, 16px); }
.onb-feats span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.onb-feats .i { width: 15px; height: 15px; }

/* Peu: punts i botó */
.onb-foot { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 20px 16px; }
.onb-dots { flex: 1; display: flex; align-items: center; }
.onb-dots button { height: 36px; padding: 0 3px; display: grid; place-items: center; }
.onb-dots button i { display: block; width: 7px; height: 7px; border-radius: 9px; background: var(--line-2); transition: width .35s var(--ease), background-color .35s; }
.onb-dots button.on i { width: 22px; background: var(--ink); }
.onb-cta { min-width: 150px; }

/* Pantalles baixes */
@media (max-height: 700px) {
  .onb-feats { display: none; }
}
@media (max-height: 620px) {
  .onb-top { height: 50px; }
  .onb-foot { padding-bottom: 12px; }
  .onb-foot .btn { --h: 48px; }
  .lang-grid button { font-size: 14px; }
}
/* Mòbil en horitzontal: s'amaguen les il·lustracions i es permet desplaçar */
@media (max-height: 480px) {
  .onb { touch-action: pan-y; }
  .onb-art { display: none; }
  .onb-slide { overflow-y: auto; padding-top: 8px; }
}

/* Llista d'idiomes (full) */
.lang-list { display: grid; gap: 6px; }
.lang-list button { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-1); font-weight: 600; font-size: 16px; }
.lang-list button.on { box-shadow: inset 0 0 0 2px var(--ink); }
.lang-list button .i { width: 20px; height: 20px; }

/* Perfil */
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--y); color: var(--y-ink); display: grid; place-items: center; font-family: var(--serif); font-size: 32px; flex: none; }
.guest-card { text-align: center; padding: 28px 22px 22px; }
.guest-card img { width: 120px; margin: 0 auto 12px; }

/* Pàgines legals */
.page-body h2 { font-size: 20px; margin: 26px 0 8px; }
.page-body p, .page-body li { color: var(--ink-2); line-height: 1.65; }
.page-body p { margin: 0 0 12px; }

/* Utilitats d'animació */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 359px) {
  :root { --pad: 16px; }
  .city-hero { aspect-ratio: 4 / 5.3; }
  .city-hero h3 { font-size: 42px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .facts > div:nth-child(3) { box-shadow: none; }
  .start-point .act { font-size: 0; gap: 0; }
  .start-point .act .i { width: 20px; height: 20px; }
}
@media (min-width: 700px) {
  :root { --pad: 28px; }
  .city-hero { aspect-ratio: 16 / 10; }
  /* Pantalles grans: pestanyes i botó principal a l'amplada del contingut */
  .tabbar { justify-content: center; gap: 28px; }
  .cta-bar { justify-content: center; }
  .cta-bar .btn { flex: 0 1 584px; }
}

/* ─────────── Contingut per als cercadors ───────────
   El servidor l'inclou a cada pàgina perquè es pugui llegir sense JavaScript.
   Queda sota la pantalla d'arrencada i l'app el substitueix en arrencar. */
.ssr { padding-top: calc(var(--safe-t) + 28px); padding-bottom: 48px; color: var(--ink-2); }
.ssr h1 { font-size: clamp(34px, 9vw, 46px); color: var(--ink); margin: 8px 0 12px; }
.ssr h2 { font-size: 21px; font-weight: 650; color: var(--ink); margin: 30px 0 10px; }
.ssr h3 { font-size: 17px; color: var(--ink); margin: 18px 0 6px; }
.ssr p { margin: 0 0 12px; }
.ssr p, .ssr li, .ssr dd { line-height: 1.6; }
.ssr ul, .ssr ol { margin: 0 0 12px; padding-inline-start: 22px; }
.ssr li { margin: 6px 0; }
.ssr a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--y); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ssr small { color: var(--mute); }
.ssr dt { margin-top: 14px; font-weight: 650; color: var(--ink); }
.ssr dd { margin: 4px 0 0; }
.ssr .crumbs { font-size: 14px; color: var(--mute); }
.ssr .facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 600; }
.ssr-foot { margin-top: 40px; font-size: 14px; }
.ssr-foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.ssr-noscript { position: fixed; z-index: 50; inset-inline: 0; bottom: 0; margin: 0; padding: 12px 20px calc(12px + var(--safe-b)); background: var(--ink); color: var(--bg); font-size: 14px; text-align: center; }

/* ─────────── Inici: continuar una ruta i idiomes ─────────── */
.resume { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); }
.resume .thumb { width: 64px; height: 64px; flex: none; border-radius: 16px; overflow: hidden; background: #111; }
.resume .thumb > * { width: 100%; height: 100%; object-fit: cover; }
.resume .lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:lang(zh) .resume .lbl, :lang(ja) .resume .lbl, :lang(ar) .resume .lbl { letter-spacing: 0; }
.resume b { display: block; margin-top: 2px; font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:lang(zh) .resume b, :lang(ja) .resume b, :lang(ar) .resume b { font-family: var(--font); font-weight: 700; font-size: 17px; line-height: 1.35; }
.resume .sub { display: block; margin-top: 3px; font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume .progress { display: block; margin-top: 8px; }
.resume .go { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--y); color: var(--y-ink); box-shadow: 0 8px 18px -10px rgba(170, 130, 0, .8); }
.resume .go .i { width: 20px; height: 20px; margin-left: 2px; } /* «play» no es gira en àrab: és universal */
.langs-card { width: 100%; gap: 16px; text-align: start; }
.langs-card img { width: 72px; flex: none; }
.langs-card b { font-size: 16.5px; }
.langs-card p { margin-top: 4px; }
.langs-card .chev { width: 20px; height: 20px; color: var(--faint); }

/* ─────────── Preguntes freqüents (portal) ─────────── */
.faq-list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.faq-list details + details { box-shadow: 0 -1px 0 var(--line); }
.faq-list summary {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 14px 18px;
  font-weight: 650; font-size: 16px; line-height: 1.35; cursor: pointer; list-style: none;
  -webkit-tap-highlight-color: transparent; transition: background-color .15s;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:active { background: var(--bg-2); }
.faq-list summary span { flex: 1; min-width: 0; }
.faq-list summary .i { width: 19px; height: 19px; flex: none; color: var(--mute); transition: transform .25s var(--ease); }
.faq-list details[open] summary .i { transform: rotate(180deg); color: var(--ink); }
.faq-list details p { padding: 0 18px 18px; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; animation: sheet-in .3s var(--ease) both; }

/* ─────────── Pantalles grans (ordinador i tauleta) ─────────── */
.route-list { display: grid; gap: 16px; }
.home-title { margin-top: 26px; }
.city-cta { margin-top: 22px; }
@media (min-width: 960px) {
  .wrap.wide { max-width: 980px; }
  .route-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .soon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how-item { flex-direction: column; }
  .city-hero { aspect-ratio: 21 / 9; }
  .city-hero img.logo { object-position: center 30%; transform: none; }
  .home-title { font-size: 64px; }
  /* La capçalera del portal s'alinea amb el contingut */
  .portal-hero { padding-inline: max(calc(var(--pad) + var(--safe-l)), calc((100% - 980px) / 2 + var(--pad))); padding-bottom: 36px; }
  .portal-hero .bg { object-position: center 35%; }
  /* Desbloqueig i presentació de la ciutat, un al costat de l'altre */
  .city-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; margin-top: 22px; }
  .city-top > .city-cta, .city-top > .city-about { margin-top: 0; }
}
.page-body ul { margin: 0 0 14px; padding-inline-start: 22px; }
.page-body li { margin: 6px 0; }
.page-body li::marker { color: var(--y-strong); }
/* El gat decoratiu del full de pagament no tapa el text */
.unlock > .small, .unlock > .eyebrow { max-width: 68%; }
