:root {
  --bg: #f6f6f2;
  --surface: #ffffff;
  --text: #1c1a19;
  --muted: #6f6a67;
  --line: #e3e5de;
  --accent: #2f6f5e;          /* verde abete: pallini e accenti */
  --player: #7c7976;
  --chip: #eceee7;
  --plan-bg: transparent;
  --plan-block: #e9e4df;
  --plan-square: #fbf3df;
  --plan-portico: #f3dfb0;
  --plan-church: #f6e7bd;
  --plan-stroke: #3a3633;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(40, 25, 20, .12);
  --maxw: 560px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.unplaced a, .page a { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { max-width: var(--maxw); margin: 0 auto; min-height: 100dvh; padding-bottom: 120px; }

/* ---------- icone (SVG inline via mask) ---------- */
.ico { width: 20px; height: 20px; display: inline-block; background: currentColor; -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; flex: none; }
.i-back { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E"); }
.i-close { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
.i-pad { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='6' cy='5' r='1.8'/%3E%3Ccircle cx='12' cy='5' r='1.8'/%3E%3Ccircle cx='18' cy='5' r='1.8'/%3E%3Ccircle cx='6' cy='11' r='1.8'/%3E%3Ccircle cx='12' cy='11' r='1.8'/%3E%3Ccircle cx='18' cy='11' r='1.8'/%3E%3Ccircle cx='6' cy='17' r='1.8'/%3E%3Ccircle cx='12' cy='17' r='1.8'/%3E%3Ccircle cx='18' cy='17' r='1.8'/%3E%3Ccircle cx='12' cy='22' r='1.8'/%3E%3C/svg%3E"); }
.i-chev { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.i-right { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E"); }
.i-arrow { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
.i-play { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5z'/%3E%3C/svg%3E"); }
.i-pause { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Crect x='6' y='4' width='4' height='16' rx='1'/%3E%3Crect x='14' y='4' width='4' height='16' rx='1'/%3E%3C/svg%3E"); }
.i-head { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 15v-3a8 8 0 0 1 16 0v3'/%3E%3Crect x='3' y='14' width='4' height='7' rx='1.5' fill='black'/%3E%3Crect x='17' y='14' width='4' height='7' rx='1.5' fill='black'/%3E%3C/svg%3E"); }
.i-pin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E"); }
.i-list { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11'/%3E%3Ccircle cx='4.5' cy='6' r='1' fill='black'/%3E%3Ccircle cx='4.5' cy='12' r='1' fill='black'/%3E%3Ccircle cx='4.5' cy='18' r='1' fill='black'/%3E%3C/svg%3E"); }
.i-globe { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3z'/%3E%3C/svg%3E"); }
.i-layers { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 5-9 5-9-5 9-5z'/%3E%3Cpath d='M3 12l9 5 9-5M3 16l9 5 9-5'/%3E%3C/svg%3E"); }

/* ---------- home: tutto in una schermata, menu compreso ---------- */
.home { height: calc(100dvh - var(--tabbar-h)); display: flex; flex-direction: column; overflow: hidden; }
.home-head { position: relative; text-align: center; padding: 18px 64px 14px; flex: none; }
.home-head .i-pin { width: 20px; height: 20px; color: #77716d; }
.home-head h1 { font-size: 30px; line-height: 1.15; margin: 4px 0 2px; letter-spacing: -.02em; }
.home-head p { margin: 0; color: var(--muted); font-size: 14px; }
.home-head .icon-btn { position: absolute; inset-inline-end: 16px; top: 16px; }
.lang-btn { position: absolute; inset-inline-start: 16px; top: 16px; height: 40px; padding: 0 12px; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.08); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.lang-btn .ico { width: 18px; height: 18px; }

.carousel {
  flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  /* la card al centro, le vicine si intravedono a destra e a sinistra */
  padding: 4px calc((100% - var(--card-w)) / 2) 6px;
  --card-w: calc(min(100vw, var(--maxw)) - 56px);
  gap: 8px;
}
.carousel::-webkit-scrollbar { display: none; }
.card {
  position: relative; flex: 0 0 var(--card-w); height: 100%; border-radius: 28px; overflow: hidden;
  scroll-snap-align: center; background: #ccc center/cover no-repeat; color: #fff; text-align: left;
  box-shadow: var(--shadow);
}
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 55%, rgba(0,0,0,.65) 100%); }
.card > * { position: relative; z-index: 1; }
.card .badge { position: absolute; top: 16px; inset-inline-start: 16px; font-size: 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; background: rgba(0,0,0,.28); backdrop-filter: blur(6px); padding: 6px 10px; border-radius: 10px; }
.card .badge .ico { width: 14px; height: 14px; }
.card .card-body { position: absolute; left: 20px; right: 20px; bottom: 22px; }
.card h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.15; }
.card .count { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.card .count .ico { width: 16px; height: 16px; color: #f0613f; }
.dots { display: flex; gap: 6px; justify-content: center; padding: 10px 0 12px; flex: none; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: #d9d1cc; transition: all .2s; }
.dots span.on { background: var(--text); width: 18px; border-radius: 3px; }

/* ---------- menu in basso (stile tab bar) ---------- */
:root { --tabbar-h: calc(88px + env(safe-area-inset-bottom)); --gold: #a8741f; }
.tabbar {
  position: fixed; z-index: 45; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom)); width: min(calc(100% - 24px), calc(var(--maxw) - 24px));
  height: 64px; display: none; align-items: stretch;
  background: #fffdf9; border-radius: 22px; box-shadow: 0 2px 6px rgba(60,40,20,.10), 0 10px 30px rgba(60,40,20,.12);
}
body.with-nav .tabbar { display: flex; }
.tabbar a { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; font-weight: 500; font-size: 15px; color: var(--text); }
.tabbar a.on { font-weight: 700; }
.tabbar a.on::after { content: ""; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 64%; max-width: 110px; height: 4px; border-radius: 2px; background: var(--text); }
body.with-nav #app { padding-bottom: var(--tabbar-h); }
body.with-nav .player { bottom: calc(88px + env(safe-area-inset-bottom)); }
body.with-nav.has-player .home { height: calc(100dvh - var(--tabbar-h) - 82px); }

/* ---------- mappa città e ristoranti ---------- */
.page-head { padding: 18px 20px 10px; }
.page-head h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.01em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.citymap { height: calc(100dvh - var(--tabbar-h) - 150px); min-height: 320px; margin: 0 16px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); background: #e8e2dc; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 12px 20px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.mk { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

.leaflet-popup-content { font: 500 14px/1.4 Inter, sans-serif; margin: 12px 14px; }
.leaflet-popup-content a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.dish-list { list-style: none; margin: 0; padding: 0 16px; display: grid; gap: 10px; }
.dish-list li { background: var(--surface); border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.dish-list b { display: block; font-size: 15px; margin-bottom: 2px; }
.dish-list span { font-size: 14px; color: #4d4845; line-height: 1.5; }
.prose { padding: 16px 20px 0; font-size: 15px; line-height: 1.6; color: #3d3936; }
.prose h2 { font-size: 17px; margin: 8px 0 6px; color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px 8px; }
.btn-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--text); color: #fff; border-radius: 999px; padding: 11px 18px; font-weight: 600; font-size: 14px; }
.btn-pill .ico { width: 16px; height: 16px; }
.btn-pill.light { background: var(--chip); color: var(--text); }
.foot { padding: 22px 20px 10px; font-size: 12px; color: var(--muted); }
.foot a { text-decoration: underline; }

/* ---------- barra superiore itinerario ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.08); flex: none; }
.select { flex: 1; min-width: 0; height: 40px; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.08); display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 18px; font-weight: 500; font-size: 14px; }
.select span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select.open .i-chev { transform: rotate(180deg); }
.menu { position: absolute; left: max(16px, calc(50% - var(--maxw) / 2 + 16px)); right: max(16px, calc(50% - var(--maxw) / 2 + 16px)); top: 58px; max-height: 70dvh; overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.menu button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 12px; border-radius: 10px; text-align: start; font-size: 15px; }
.menu button.on { font-weight: 600; background: var(--chip); }
.menu button .grow { flex: 1; }
.menu .i-layers { width: 16px; height: 16px; color: var(--muted); }

/* ---------- elenco ---------- */
.list-head { text-align: center; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); margin: 0 16px; }
.list-head .i-layers { width: 24px; height: 24px; }
.list-head h1 { font-size: 24px; margin: 6px 0 2px; letter-spacing: -.01em; }
.list-head p { margin: 0; color: var(--muted); font-size: 13px; }
.poi-list { list-style: none; margin: 0; padding: 8px 16px; }
.poi-row { display: flex; gap: 14px; align-items: center; padding: 10px 0; width: 100%; text-align: left; }
.thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--chip) center/cover no-repeat; flex: none; }
.poi-row .t { font-size: 14px; font-weight: 500; line-height: 1.3; }
.num { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); margin-top: 3px; font-weight: 600; }
.num .ico { width: 13px; height: 13px; }
.poi-row.playing .t { color: var(--accent); }

.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 25; display: inline-flex; align-items: center; gap: 10px; background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); }
.fab .ico { width: 16px; height: 16px; }
body.has-player .fab { bottom: calc(104px + env(safe-area-inset-bottom)); }

/* ---------- mappa / pianta ---------- */
/* la pianta riempie tutto lo spazio fra la barra in alto e il fondo dello schermo */

.unplaced { padding: 10px 16px 0; font-size: 12px; color: var(--muted); }

.peek { position: fixed; left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), calc(var(--maxw) - 32px)); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 26; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
body.has-player .peek { bottom: calc(156px + env(safe-area-inset-bottom)); }
.peek-img { height: 92px; background: var(--chip) center/cover no-repeat; }
.peek-body { display: flex; align-items: center; gap: 12px; padding: 12px 14px 14px; }
.peek-body .grow { flex: 1; min-width: 0; text-align: left; }
.peek-body .t { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek .x { position: absolute; top: 6px; inset-inline-end: 6px; width: 40px; height: 40px; z-index: 2; border-radius: 50%; background: rgba(255,255,255,.85); display: grid; place-items: center; }
.peek .x .ico { width: 14px; height: 14px; }
.round-play { width: 44px; height: 44px; border-radius: 50%; background: var(--player); color: #fff; display: grid; place-items: center; flex: none; }
.round-play .ico { width: 16px; height: 16px; }

/* ---------- scheda ---------- */
.poi-hero { position: relative; aspect-ratio: 4 / 3.4; background: var(--chip) center/cover no-repeat; }
.poi-hero .icon-btn { position: absolute; top: 14px; inset-inline-end: 14px; background: rgba(255,255,255,.7); backdrop-filter: blur(6px); }
.poi-hero .credit { position: absolute; left: 10px; bottom: 8px; font-size: 10px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); opacity: .9; }
.poi-body { padding: 20px 20px 0; }
.poi-body h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.01em; }
.poi-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.poi-meta .num { color: var(--text); margin: 0; }
.poi-body h2 { font-size: 15px; margin: 0 0 8px; }
.poi-text { font-size: 15px; line-height: 1.65; color: #3d3936; }
.poi-text p { margin: 0 0 12px; }
.poi-text.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.poi-actions { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 24px; }
.link { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.btn-play { display: inline-flex; align-items: center; gap: 10px; background: var(--player); color: #fff; border-radius: 12px; padding: 12px 18px; font-weight: 600; font-size: 15px; }
.btn-play .ico { width: 14px; height: 14px; }
.poi-nav { display: flex; gap: 10px; padding: 0 20px; }
.poi-nav button { flex: 1; text-align: left; background: var(--surface); border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); font-size: 13px; }
.poi-nav button small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.poi-nav button.next { text-align: end; }
.poi-nav button:disabled { visibility: hidden; }

/* ---------- player ---------- */
.player { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); width: min(calc(100% - 24px), calc(var(--maxw) - 24px)); background: var(--player); color: #fff; border-radius: 22px; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; box-shadow: var(--shadow); }
.player[hidden] { display: none; }
.player-info { flex: 1; min-width: 0; text-align: left; color: #fff; }
.player-title { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; }
.player-bar { display: block; height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; position: relative; }
.player-fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0; background: #fff; border-radius: 2px; }
.player-fill::after { content: ""; position: absolute; inset-inline-end: -5px; top: -3.5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.player-times { display: flex; justify-content: space-between; font-size: 10px; opacity: .85; margin-top: 6px; font-variant-numeric: tabular-nums; }
.player-btn { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--player); display: grid; place-items: center; flex: none; }
.player-btn .ico { width: 18px; height: 18px; }

/* ---------- tastierino ---------- */
.keypad { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; align-items: center; padding: 14px 20px calc(24px + env(safe-area-inset-bottom)); }
.keypad[hidden] { display: none; }
.keypad-head { width: 100%; max-width: 420px; display: flex; align-items: center; justify-content: center; position: relative; height: 40px; font-weight: 500; font-size: 14px; }
.keypad-head .icon-btn { position: absolute; right: 0; }
.keypad-display { font-size: 56px; font-weight: 300; margin: auto 0 4px; font-variant-numeric: tabular-nums; min-height: 70px; }
.keypad-msg { min-height: 22px; font-size: 14px; color: var(--accent); margin-bottom: 18px; text-align: center; }
.keypad-grid { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 28px; margin-bottom: auto; }
.keypad-grid button { width: 76px; height: 76px; border-radius: 50%; background: var(--chip); font-size: 26px; font-weight: 400; }
.keypad-grid button:active { background: var(--line); }
.keypad-grid .k-text { background: none; font-size: 14px; color: var(--muted); }
.keypad-grid .k-go { background: var(--player); color: #fff; display: grid; place-items: center; }
.keypad-grid .k-go:disabled { opacity: .35; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- crediti ---------- */
.page { padding: 8px 20px; }
.page h1 { font-size: 24px; margin: 8px 0 12px; }
.page li { font-size: 13px; margin-bottom: 6px; color: #3d3936; }
.page p { font-size: 14px; color: #3d3936; }

@media (min-width: 700px) {
  body { background: #efe9e6; }
  #app { background: var(--bg); box-shadow: 0 0 40px rgba(0,0,0,.06); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* avviso traduzione */
.notice { background: #fff6e0; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #6b5420; margin: -8px 0 18px; }

/* lingue da destra a sinistra (arabo): le frecce si specchiano */
[dir="rtl"] .i-back, [dir="rtl"] .i-arrow, [dir="rtl"] .i-right { transform: scaleX(-1); }
[dir="rtl"] .poi-text, [dir="rtl"] .poi-body, [dir="rtl"] .page-head, [dir="rtl"] .prose { text-align: start; }
[dir="rtl"] .keypad-grid, [dir="rtl"] .keypad-display, [dir="rtl"] .player-times { direction: ltr; }

/* ---------- itinerari sparsi in città (chiese, musei) ---------- */

.geo-wrap { height: calc(100dvh - 64px); }
body.has-player .geo-wrap { height: calc(100dvh - 64px - 82px); }
.citymap.geo { height: 100%; min-height: 0; margin: 0; border-radius: 0; box-shadow: none; }

.fab, .peek { z-index: 1000; }

/* segnaposto sulla mappa: goccia con numero, ombra, alone pulsante e (se pochi) nome del luogo */
.geo-pin { position: relative; }
.geo-pin .gp { position: absolute; left: 2px; top: 0; width: 50px; height: 50px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--pc, var(--accent)); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.35); display: grid; place-items: center; transition: transform .15s; }
.geo-pin .gp-n { transform: rotate(45deg); color: #fff; font: 800 15px/1 Inter, sans-serif; letter-spacing: -.02em; }
.geo-pin::before { content: ""; position: absolute; left: 15px; top: 56px; width: 24px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.25); filter: blur(2px); }
.geo-pin::after { content: ""; position: absolute; left: 2px; top: 0; width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--accent);
  animation: gp-pulse 1.8s ease-out infinite; pointer-events: none; }
@keyframes gp-pulse { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }
.geo-pin.sel .gp { background: #1c1a19; transform: rotate(-45deg) scale(1.12); }
.geo-pin.sel::after { border-color: #1c1a19; }
.geo-pin .gp-label { position: absolute; left: 62px; top: 13px; white-space: nowrap; background: #fff; color: #1c1a19; font: 700 13px/1 Inter, sans-serif;
  padding: 7px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.25); max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .geo-pin::after { animation: none; opacity: 0; } }

/* ---------- mappa città: colori per tipo di luogo + elenco opere con numeri ---------- */
.page-head.with-tool { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

 
 
 

.geo-pin.sel .gp { background: #1c1a19; }

/* ---------- pagina B&B ---------- */
.bnb-hero { height: 46dvh; min-height: 260px; background: #ccc center/cover no-repeat; position: relative; }
.bnb-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.65)); }
.bnb-hero-in { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 20px; color: #fff; }
.bnb-hero-in h1 { margin: 2px 0 0; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.bnb-lead p { font-size: 16px; }

.btn-pill.small { padding: 9px 14px; font-size: 13px; }

/* ---------- ristorante in evidenza ---------- */

.btn-row.tight { padding: 4px 0 0; }
/* segnaposto più piccoli sulla mappa della città, dove i luoghi sono tanti */
.geo-pin.sm .gp { width: 38px; height: 38px; border-width: 2px; }
.geo-pin.sm .gp-n { font-size: 12px; }
.geo-pin.sm::after { width: 38px; height: 38px; border-width: 2px; }
.geo-pin.sm::before { left: 11px; top: 43px; width: 20px; }

/* ---------- galleria della scheda: foto da scorrere col dito ---------- */
.poi-hero { overflow: hidden; }
.gal-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.gal-track::-webkit-scrollbar { display: none; }
.gal-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; background: var(--chip) center/cover no-repeat; }
.poi-hero .icon-btn, .poi-hero .credit { z-index: 2; }
.gal-dots { position: absolute; z-index: 2; left: 0; right: 0; bottom: 26px; display: flex; justify-content: center; gap: 5px; }
.gal-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 3px rgba(0,0,0,.4); cursor: pointer; transition: all .2s; }
.gal-dots span.on { background: #fff; width: 16px; border-radius: 3px; }
.gal-count { position: absolute; z-index: 2; top: 18px; inset-inline-start: 14px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0,0,0,.4); padding: 4px 9px; border-radius: 999px; }

/* il lettore audio resta sempre sopra le mappe; le mappe finiscono dove inizia il lettore */
.player { z-index: 1100; }
body.has-player .geo-wrap { height: calc(100dvh - 64px - 110px - env(safe-area-inset-bottom)); }
body.has-player .fab { bottom: calc(110px + env(safe-area-inset-bottom)); }
body.has-player .peek { bottom: calc(176px + env(safe-area-inset-bottom)); }
.locate-btn.on { background: #2b7de9; color: #fff; }

/* ---------- piantine di chiese e musei ---------- */

.select.static { justify-content: flex-start; cursor: default; }

/* schedina della mappa: numero e luogo su una riga, titolo pieno, "Pianta" in basso a destra */
.peek-body .grow { display: flex; flex-direction: column; gap: 4px; }
.peek-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.peek-line .num { margin: 0; flex: none; }

.peek-body .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }

/* scheda estesa: luogo e pulsante "Pianta" */

/* schede ancora senza foto propria */
.thumb.nophoto { display: grid; place-items: center; color: var(--muted); }
.gal-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: linear-gradient(160deg, #efe6dc, #e2d3c3); color: #6d5a49; text-align: center; padding: 0 24px; }
.gal-empty .n { font-size: 56px; font-weight: 800; line-height: 1; opacity: .55; }
.gal-empty span:not(.n) { font-size: 15px; font-weight: 600; }

/* piantina: con il player aperto finisce appena sopra il riquadro audio (alto 75px, a 14px dal fondo) */

/* mappa della città: con il player aperto finisce sopra il riquadro audio */
body.has-player .citymap:not(.geo) { height: calc(100dvh - var(--tabbar-h) - 150px - 50px); }

/* ---------------------------------------------------------------- itinerari tematici */
.route-list { display: grid; gap: 14px; padding: 6px 16px 120px; }
.route-card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border-top: 4px solid var(--rc); }
.route-img { display: block; height: 150px; background: var(--chip) center/cover no-repeat; }
.route-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.route-who { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rc); }
.route-title { font-size: 21px; font-weight: 700; line-height: 1.2; }
.route-meta { font-size: 13px; color: var(--muted); }
.route-head { padding: 12px 20px 6px; }
.route-head p { margin: 0 0 6px; }
.route-head .route-who { display: block; }
.route-intro { font-size: 15px; line-height: 1.55; margin-top: 8px !important; }
.route-map { height: 46vh; min-height: 260px; margin: 8px 16px 0; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: #e8e2dc; }
.route-pin span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.btn-start { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 16px 4px; padding: 14px; border-radius: 14px; background: var(--rc); color: #fff; font-weight: 700; font-size: 16px; }
.btn-start .ico { width: 16px; height: 16px; }
.route-stops { list-style: none; margin: 10px 16px 0; padding: 0; display: grid; gap: 10px; }
.route-stops:last-child { padding-bottom: 120px; }
.route-stop { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 12px 12px 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.rs-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; }
.rs-body { flex: 1; min-width: 0; }
.rs-title { display: block; font-weight: 700; font-size: 16px; line-height: 1.25; }
.rs-title small { font-weight: 500; color: var(--muted); }
.rs-nums { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.rs-nums a { min-width: 34px; text-align: center; padding: 3px 7px; border-radius: 8px; background: var(--chip); color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.route-stop.extra { opacity: .9; }
.route-sub { font-size: 15px; margin: 22px 20px 0; color: var(--muted); }
.route-bar { display: flex; gap: 10px; align-items: stretch; margin: -6px 0 18px; }
.route-bar a, .route-bar span { display: flex; flex-direction: column; justify-content: center; border-radius: 14px; padding: 10px 12px; font-size: 14px; font-weight: 600; line-height: 1.25; }
.route-bar small { display: block; font-size: 11px; font-weight: 600; opacity: .8; margin-bottom: 2px; }
.route-bar > a:first-child { flex: 1; background: var(--surface); border-left: 4px solid var(--rc); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.route-bar .rb-next { flex: 1; background: var(--rc); color: #fff; text-align: end; }
.route-bar .rb-next .ico { width: 12px; height: 12px; display: inline-block; vertical-align: -1px; }
.route-bar .rb-next.done { background: var(--chip); color: var(--muted); }
#tabbar a { font-size: 14px; }

/* avviso di aggiornamento del sito */
#update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1300; width: min(calc(100% - 24px), calc(var(--maxw) - 24px)); display: flex; align-items: center; gap: 12px; background: var(--text); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px; box-shadow: var(--shadow); font-size: 14px; line-height: 1.3; animation: upd-in .3s ease-out; }
#update-bar span { flex: 1; }
#update-bar button { flex: none; background: #fff; color: var(--text); font-weight: 700; border-radius: 10px; padding: 9px 14px; }
@keyframes upd-in { from { opacity: 0; transform: translate(-50%, 16px); } }

/* velocità di ascolto nel player */
.player-speed { flex: none; min-width: 46px; height: 34px; padding: 0 8px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.7); color: #fff; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ================================================================ Bormio7 Guide */
.i-car { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 16V11l2-5h10l2 5v5'/%3E%3Cpath d='M3 16h18v3H3z'/%3E%3Ccircle cx='7.5' cy='16' r='1.6' fill='black'/%3E%3Ccircle cx='16.5' cy='16' r='1.6' fill='black'/%3E%3C/svg%3E"); }
.card .badge { background: color-mix(in srgb, var(--ic, #000) 70%, transparent); }
.geo-pin::after { border-color: var(--pc, var(--accent)); }
.geo-pin.home-pin .gp { background: #1c1a19; }
.geo-pin.home-pin::after { border-color: #1c1a19; }
.mk-home { background: #1c1a19; }

/* elenco della sezione: titolo, sottotitolo, numero, stagione, distanza */
.poi-row .row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.poi-row .row-sub { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.poi-row .row-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 3px; }
.poi-row .row-meta .num { margin-top: 0; }
.poi-row .thumb { width: 72px; height: 72px; border-radius: 12px; }
.row-dist { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.row-dist .ico, .chip-dist .ico { width: 14px; height: 14px; }
.season { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--chip); color: #3d3936; }
.season.s-inverno { background: #e3edf8; color: #24527f; }
.season.s-estate { background: #eaf3df; color: #3d6420; }

/* scheda: stagione, distanza, informazioni pratiche */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.chip-dist { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #3d3936; }
.facts { margin: 12px 0 6px; padding: 4px 16px; background: var(--surface); border-radius: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.facts > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 14.5px; line-height: 1.45; color: #2b2826; }
.poi-body .btn-row.tight { padding: 8px 0 4px; }

/* mangiare */
.place-list { list-style: none; margin: 0; padding: 0 16px; display: grid; gap: 8px; }
.place-list a { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 12px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.place-list .pl-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.place-list b { font-size: 15px; }
.place-list span span, .place-list .pl-body > span { font-size: 13.5px; color: #4d4845; }
.place-list small { font-size: 12px; color: var(--muted); }
.place-list .ico { color: var(--accent); }

/* eventi */
.events { list-style: none; margin: 0; padding: 4px 16px; display: grid; gap: 8px; }
.ev-month { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); padding: 12px 4px 0; }
.ev { background: var(--surface); border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); display: flex; flex-direction: column; gap: 4px; }
.ev b { font-size: 15px; }
.ev span { font-size: 14px; color: #4d4845; line-height: 1.5; }
.ev a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-top: 4px; }
.ev a .ico { width: 14px; height: 14px; }

/* Bormio7 */
.h7-facts { list-style: none; margin: 14px 16px 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.h7-facts li { background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); display: flex; flex-direction: column; }
.h7-facts b { font-size: 18px; letter-spacing: -.01em; }
.h7-facts span { font-size: 12.5px; color: var(--muted); }
.h7-gallery { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 14px; scrollbar-width: none; }
.h7-gallery::-webkit-scrollbar { display: none; }
.h7-ph { flex: 0 0 82%; aspect-ratio: 3 / 2; border-radius: 18px; background: #ddd center/cover no-repeat; scroll-snap-align: center; box-shadow: var(--shadow); }
.rules { margin: 0; padding: 4px 20px 0 38px; font-size: 14.5px; line-height: 1.7; color: #3d3936; }
.prose.small { padding-top: 0; font-size: 13px; color: var(--muted); }
.geo-pin.home-pin .gp-n { font-size: 12px; }
.geo-pin.sm.home-pin .gp-n { font-size: 10px; }
.tabbar a { font-size: 13px; letter-spacing: -.01em; }
.ev-live { flex-direction: row; align-items: center; gap: 12px; }
.ev-img { width: 64px; height: 64px; flex: none; border-radius: 12px; background: var(--chip) center/cover no-repeat; }
.ev-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev-body small { font-size: 12px; color: var(--accent); font-weight: 600; }
.ev-month { text-transform: none; letter-spacing: 0; font-size: 14px; }
.ev-month::first-letter { text-transform: uppercase; }
.route-home { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.route-home .ico { width: 14px; height: 14px; }
