/* The Guide · pages and the app shell (mobile first; desktop: web/desktop.css).
   Tokens: web/tokens.css (generated from design/tokens.json). Base and shared components (buttons, chips, fields,
   cards, notices, focus, motion): web/ui.css, loaded before this file. Module pages: their own stylesheets. */

/* ---------- Shell ---------- */
.app-header {
  position: sticky; top: 0; z-index: var(--layer-header); height: calc(var(--header-h) + var(--safe-top)); padding: var(--safe-top) var(--gutter) 0;
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.app-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; min-height: 44px; font-weight: 800; font-size: var(--type-title-size); letter-spacing: -0.03em; }
.brand-symbol { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--color-block-blue); color: #f7efe3; font: italic 600 var(--type-display-s-size)/1 var(--display); padding-bottom: 3px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); font-stretch: var(--display-stretch);}
.brand-dot { color: var(--accent); }
.brand-logo { display: block; height: 38px; width: auto; }
.auth-brand .brand-logo { height: 40px; padding: 6px 12px; border-radius: 14px; background: #fdf6e8; box-sizing: content-box; }
.app-city { display: none; align-items: center; gap: 6px; font-size: var(--type-caption-size); font-weight: 700; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.app-header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.workspace { min-height: calc(100dvh - var(--header-h) - var(--safe-top)); padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px); }
/* Page templates (web/page-layout.js sets main[data-layout]): «lista» and «cruscotto» use the content width, «modulo» and
   «dettaglio» the reading width, «mappa a tutto schermo» all of it (docs/DESIGN_SYSTEM.md §6.3). */
main { display: block; min-width: 0; overflow-x: clip; max-width: calc(var(--layout-content) + 2 * var(--gutter)); margin: 0 auto; padding: var(--space-2) var(--gutter) var(--space-8); outline: none; animation: page-in .28s var(--ease); }
main:is([data-layout="form"], [data-layout="detail"]) { max-width: calc(var(--layout-reading) + 2 * var(--gutter)); }
main[data-layout="map"] { max-width: none; }
/* a form with a side column (help, privacy, what you sent): the reading column plus 360 (docs/DESIGN_SYSTEM.md §6.3) */
@media (min-width: 1100px) {
  main[data-layout="form"]:has(.tg-form-cols) { max-width: calc(var(--layout-reading) + 360px + var(--space-8) + 2 * var(--gutter)); }
  .tg-form-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: var(--space-8); align-items: start; }
}
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.app-footer { display: none; }
.loading { display: flex; align-items: center; gap: 12px; padding: 48px 4px; color: var(--muted); font-weight: 650; }
.loading::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--layer-nav); height: calc(var(--nav-h) + var(--safe-bottom)); padding: 6px 8px var(--safe-bottom);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  background: var(--color-surface); border-top: var(--border-width) solid var(--color-outline);
}
.app-bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 9px; gap: 3px; text-decoration: none; color: var(--muted); font: var(--type-caption); font-weight: 800; border-radius: var(--r-md); transition: color .15s; min-width: 0; }
.app-nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bottom-nav .app-nav-icon { width: 24px; height: 24px; padding: 0; transition: transform .2s var(--ease); }
.app-bottom-nav a::before { content: ""; position: absolute; top: 4px; width: 46px; height: 32px; border-radius: var(--radius-pill); background: var(--color-yellow); opacity: 0; transform: scale(.6); transition: opacity var(--motion-base) var(--motion-ease), transform var(--motion-base) var(--motion-ease); z-index: -1; }
.app-bottom-nav a.active { color: var(--color-ink); }
.app-bottom-nav a.active::before { opacity: 1; transform: scale(1); }
:where([data-theme="dark"]) .app-bottom-nav a.active { color: var(--color-yellow); }
:where([data-theme="dark"]) .app-bottom-nav a.active::before { background: var(--color-yellow-soft); }
.app-bottom-nav a:active .app-nav-icon { transform: scale(.9); }
/* Iris: the yellow circle in the middle of the bar (red while its page is open) */
.app-bottom-nav a[data-nav="iris"] { align-self: start; justify-self: center; width: 58px; height: 58px; margin-top: -22px; padding-top: 0; justify-content: center; border-radius: 50%; background: var(--color-yellow); color: var(--color-block-yellow-text); border: var(--border-width) solid var(--color-outline); box-shadow: var(--elevation-2); gap: 0; }
.app-bottom-nav a[data-nav="iris"] .app-nav-icon { width: 28px; height: 28px; }
.app-bottom-nav a[data-nav="iris"] .app-nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.app-bottom-nav a[data-nav="iris"]::before { display: none; }
.app-bottom-nav a[data-nav="iris"].active { background: var(--color-accent); color: var(--color-accent-ink); }
.app-bottom-nav a[data-nav="iris"]:active { transform: translate(2px, 2px); box-shadow: var(--elevation-pressed); }
.nav-count { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--color-accent-ink); font-size: var(--type-kicker-size); font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.nav-count:is(:empty) { display: none; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px); z-index: var(--layer-toast); transform: translate(-50%, 20px); width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--bg); font-weight: 650; font-size: var(--type-label-size); box-shadow: var(--shadow-3); opacity: 0; pointer-events: none; transition: .25s var(--ease); }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }

.personal-tracking-banner { position: sticky; top: calc(var(--header-h) + var(--safe-top)); z-index: var(--layer-raised); margin: 0 auto; max-width: calc(var(--layout-content) + 2 * var(--gutter)); padding: 8px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 750; font-size: var(--type-body-s-size); }
.personal-tracking-banner a { text-decoration: none; }
.personal-tracking-banner button { padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-weight: 750; font-size: var(--type-caption-size); }

/* ---------- Home (#explore): one story from top to bottom (docs/ECOSISTEMA_V2.md §4) ----------
   Slots in order: alert, hero, quick, groups, foryou, events, museums, business, community, plan.
   Every section uses the same header (.home-head) and the same carousel (.home-rail); empty slots take no space. */
.home { display: flex; flex-direction: column; gap: 28px; padding-top: 6px; }
.home > *, .home-slot > * { min-width: 0; }
.home-slot { display: flex; flex-direction: column; gap: 28px; }
.home-slot:empty, .home-weather:empty { display: none; }
.home-section { display: block; min-width: 0; }
.home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.home-head h2 { font: 650 var(--type-display-s-size)/1.2 var(--display); letter-spacing: -0.01em; margin: 0; min-width: 0; font-stretch: var(--display-stretch);}
.home-more { flex: none; display: inline-flex; align-items: center; gap: 2px; font-weight: 750; font-size: var(--type-body-s-size); color: var(--accent-deep); text-decoration: none; white-space: nowrap; position: relative; }
.home-more::after { content: ""; position: absolute; inset: -12px -4px; }
:where([data-theme="dark"]) .home-more { color: var(--accent); }
.home-more .tg-i { width: 15px; height: 15px; }
/* Sections that still bring their own header (.app-section-title) look like the shared one. */
.home .app-section-title { margin: 0 0 12px; align-items: baseline; }
.home .app-section-title .app-kicker { display: none; }
.home .app-section-title h2 { font: 650 var(--type-display-s-size)/1.2 var(--display); letter-spacing: -0.01em; margin: 0; font-stretch: var(--display-stretch);}
.home .app-section-title .text-button { flex: none; padding: 0; font-size: var(--type-body-s-size); white-space: nowrap; }
.home-rail { --rail-w: min(76%, 272px); display: grid; grid-auto-flow: column; grid-auto-columns: var(--rail-w); gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; padding: 2px var(--gutter) 10px; margin: 0 calc(-1 * var(--gutter)) -10px; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.home-rail::-webkit-scrollbar { display: none; }
.home-rail > * { scroll-snap-align: start; min-width: 0; }
.home-rail > .tg-card { height: 100%; }
/* Hero: greeting and context, the proposal of the moment, search. */
.home-hero { display: grid; gap: 12px; }
.home-hello { margin: 0; color: var(--muted); font-weight: 700; font-size: var(--type-label-size); }
.home-title { font: var(--type-display-xl); font-stretch: var(--type-display-xl-stretch); text-transform: uppercase; letter-spacing: 0; margin: -8px 0 0; overflow-wrap: anywhere; }
.home-weather { margin: -2px 0 0; display: flex; }
.home-pick { position: relative; overflow: hidden; isolation: isolate; display: grid; gap: 8px; border-radius: var(--r-xl); padding: 18px 18px 16px; color: var(--color-block-blue-text); background: var(--color-block-blue); border: var(--border-width) solid var(--color-outline); box-shadow: var(--elevation-3); }
.home-pick-kicker { font: var(--type-kicker); letter-spacing: var(--type-kicker-tracking); text-transform: uppercase; color: var(--color-yellow); }
.home-pick-title { font: 850 var(--type-display-m-size)/1.1 var(--display); letter-spacing: 0; margin: 0; overflow-wrap: anywhere; font-stretch: var(--font-stretch-display); }
.home-pick-sub { margin: 0; color: rgba(255, 255, 255, .88); font-size: var(--type-label-size); }
.home-pick-steps { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 4px; }
.home-pick-steps li { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: var(--type-label-size); color: rgba(255, 255, 255, .88); }
.home-pick-time { flex: none; min-width: 42px; font-weight: 800; font-size: var(--type-caption-size); color: var(--gold); font-variant-numeric: tabular-nums; }
.home-pick-step { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-pick-steps .is-more { color: rgba(243,239,232,.65); font-size: var(--type-body-s-size); padding-left: 52px; }
.home-pick-why { display: flex; gap: 6px; align-items: flex-start; margin: 2px 0 0; color: rgba(243,239,232,.78); font-size: var(--type-body-s-size); }
.home-pick-why .tg-i { width: 15px; height: 15px; margin-top: 2px; color: var(--gold); }
.home-pick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.home-pick-actions .button { min-height: 44px; padding: 0 14px; font-size: var(--type-label-size); gap: 6px; }
.home-pick-actions .button .tg-i { width: 17px; height: 17px; }
.home-pick .home-pick-go { background: #fff; color: var(--color-block-blue); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.home-pick .home-pick-go:hover { background: var(--gold); }
.home-pick .home-pick-propose { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.home-pick .home-pick-propose:hover { background: rgba(255,255,255,.2); }
.home-pick.is-route .tg-time-chips { margin: 6px 0 0; }
.home-pick.is-skeleton { min-height: 184px; align-content: start; }
.home-pick.is-skeleton .home-skel-line { background: rgba(255,255,255,.14); }
.tg-time-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 320px; }
.tg-time-chip { height: 36px; padding: 0 14px; border-radius: var(--r-pill); display: inline-flex; align-items: center; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; font-weight: 750; font-size: var(--type-body-s-size); border: 1px solid rgba(255,255,255,.18); transition: .15s; }
.tg-time-chip:hover, .tg-time-chip:focus-visible { background: #fff; color: var(--color-block-blue); }
.home-search { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 8px 0 16px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--card-shadow); border: var(--card-border); text-decoration: none; color: var(--muted); font-weight: 650; font-size: var(--type-body-size); min-width: 0; }
.home-search-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* «Cerca» (#cerca): the field lives inside the search pill, without a second contour */
.home-search input.home-search-text { min-height: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-weight: 650; color: var(--color-ink); }
.app-search-page .home-search { height: 52px; margin-bottom: var(--space-4); }
.app-search-page .home-search:focus-within { border-color: var(--color-accent); }
.home-search-count { flex: none; font-size: var(--type-caption-size); font-weight: 800; color: var(--sea); background: var(--sea-soft); border-radius: var(--r-pill); padding: 6px 10px; }
/* Quick actions: six round shortcuts in one row. */
.home-quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: -8px -4px 0; }
.home-quick-item { --q: var(--color-blue); --q-soft: var(--color-blue-soft); display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 4px 0; text-decoration: none; color: var(--ink-2); border-radius: var(--r-md); }
.home-quick-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--q-soft); color: var(--q); transition: transform var(--motion-fast) var(--motion-ease); }
.home-quick-icon .tg-i { width: 23px; height: 23px; }
.home-quick-item:active .home-quick-icon { transform: scale(.92); }
.home-quick-label { max-width: 100%; font-size: var(--type-caption-size); font-weight: 750; font-stretch: 88%; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* category colours (design/tokens.json color.cat.*): full colour icon on its soft bubble */
.home-quick-item.is-food { --q: var(--color-cat-food); --q-soft: var(--color-cat-food-soft); }
.home-quick-item.is-drink { --q: var(--color-cat-drink); --q-soft: var(--color-cat-drink-soft); }
.home-quick-item.is-night { --q: var(--color-cat-night); --q-soft: var(--color-cat-night-soft); }
.home-quick-item.is-culture { --q: var(--color-cat-culture); --q-soft: var(--color-cat-culture-soft); }
.home-quick-item.is-nature { --q: var(--color-cat-nature); --q-soft: var(--color-cat-nature-soft); }
.home-quick-item.is-trips { --q: var(--color-blue); --q-soft: var(--color-blue-soft); }
@media (max-width: 380px) {
  .home-pick { padding: 18px 16px 16px; }
  .home-pick-propose-more { display: none; }
  .home-quick { gap: 0; margin: -8px calc(-0.5 * var(--gutter)) 0; }
  .home-quick-icon { width: 46px; height: 46px; }
  .home-quick-label { font-size: var(--type-caption-size); }
}
/* «Per te» asks for the quiz with a quiet line: the proposal of the moment stays the loudest thing on the page. */
#home-slot-foryou .tg-invite { margin: 0 0 var(--space-4); }
/* Alert (urgent notices of the Comune), notes and compact cards of the modules. */
.home-alert { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 8px 12px 14px; border-radius: var(--r-lg); background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent); }
.home-alert-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }
.home-alert-icon svg { width: 20px; height: 20px; }
.home-alert-copy { min-width: 0; display: grid; gap: 1px; }
.home-alert-copy strong { font-size: var(--type-body-size); line-height: 1.3; color: var(--ink); }
.home-alert-copy span { font-size: var(--type-caption-size); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-alert-open { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--danger); }
.home-alert-open svg { width: 18px; height: 18px; }
.home-alert-open::after { content: ""; position: absolute; inset: 0; }
.home-alert-more::after { content: ""; position: absolute; inset: -13px -4px; }
.home-alert-more { position: relative; z-index: 1; grid-column: 2 / 4; justify-self: start; font-size: var(--type-caption-size); font-weight: 750; color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }
.home-note { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); font-size: var(--type-body-s-size); font-weight: 700; text-align: left; }
.home-note > span { flex: 1; }
.home-note svg { width: 16px; height: 16px; flex: none; }
.home-feature { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 10px 12px 12px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); text-decoration: none; color: var(--ink); }
.home-feature-art { width: 76px; height: 76px; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg, #2458a6 0%, #1d4a8f 100%); }
.home-feature-art svg { width: 100%; height: 100%; }
.home-feature-copy { display: grid; gap: 3px; min-width: 0; }
.home-feature-kicker { display: inline-flex; align-items: center; gap: 5px; font-size: var(--type-kicker-size); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); }
:where([data-theme="dark"]) .home-feature-kicker { color: var(--accent); }
.home-feature-kicker svg { width: 14px; height: 14px; }
.home-feature-copy strong { font-size: var(--type-body-l-size); line-height: 1.25; }
.home-feature-copy small { color: var(--muted); font-size: var(--type-body-s-size); line-height: 1.35; }
.home-feature-chev { color: var(--muted); }
.home-feature-chev svg { width: 18px; height: 18px; }
.home-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.home-grid3 > * { min-width: 0; }
.home-grid3 .social-home-card { flex: none; width: auto; height: auto; aspect-ratio: 3 / 4; }
.home-plan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px dashed var(--line-strong); color: var(--ink-2); text-decoration: none; }
.home-plan-copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.home-plan-copy strong { font-size: var(--type-label-size); color: var(--ink); }
.home-plan-copy small { font-size: var(--type-caption-size); color: var(--muted); }
.home-plan-cta { flex: none; font-size: var(--type-body-s-size); font-weight: 750; color: var(--sea); }
/* Home by audience (web/audience.js): the «Home: …» chip, the card that asks or proposes, the link lists, the places. */
.home-audience-chip { justify-self: start; margin: -4px 0 0; display: inline-flex; align-items: center; gap: 4px; position: relative; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); background: var(--sea-soft); color: var(--sea); font-weight: 800; font-size: var(--type-body-s-size); }
.home-hero > .home-audience-chip::after { content: ""; position: absolute; inset: -4px 0; }
.home-audience-card { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); }
.home-audience-card.is-suggestion { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
.home-audience-text { margin: 0; font-weight: 800; font-size: var(--type-body-l-size); line-height: 1.3; color: var(--ink); }
.home-audience-note { margin: 0; font-size: var(--type-body-s-size); color: var(--ink-2); }
.home-audience-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.home-audience-auto { margin-top: 10px; width: 100%; }
.home-links { list-style: none; margin: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); overflow: hidden; }
.home-links li + li { border-top: 1px solid var(--line); }
.home-link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px 10px 14px; color: var(--ink); text-decoration: none; }
.home-link > .tg-i { flex: none; width: 18px; height: 18px; color: var(--muted); }
.home-link-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); }
.home-link-icon .tg-i { width: 21px; height: 21px; }
.home-link.is-sos .home-link-icon { background: var(--danger-soft); color: var(--danger); }
.home-link-copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.home-link-copy strong { font-size: var(--type-body-size); line-height: 1.3; }
.home-link-copy small { font-size: var(--type-body-s-size); color: var(--muted); line-height: 1.35; }
.home-place-card { display: grid; align-content: start; gap: 4px; min-height: 120px; padding: 14px; text-align: left; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); border-top: 6px solid var(--cover, var(--sea)); color: var(--ink); }
.home-place-kicker { font-size: var(--type-kicker-size); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.home-place-card strong { font-size: var(--type-body-l-size); line-height: 1.25; }
.home-place-card small { display: inline-flex; align-items: center; gap: 4px; font-size: var(--type-body-s-size); color: var(--muted); }
.home-place-card small .tg-i { width: 15px; height: 15px; }
/* «Vivi qui?» on the welcome screen (first entry only, optional). */
.setup-live { margin: 0; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.setup-live legend { padding: 0 4px; font-size: var(--type-body-size); }
.setup-live legend small { color: var(--muted); font-weight: 600; }
.setup-live .setup-helper { margin: 2px 0 10px; }
.setup-live-options { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-live-option { position: relative; display: inline-flex; }
.setup-live-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.setup-live-option span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 2px solid var(--line); font-weight: 750; font-size: var(--type-label-size); }
.setup-live-option input:checked + span { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); border-color: var(--ink); }
.setup-live-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Skeletons: the shell is on screen at once, content arrives slot by slot. */
.home-skel-line, .home-skel-card i, .home-skel-card b { display: block; border-radius: 8px; background: var(--surface-3); animation: home-shimmer 1.4s ease-in-out infinite; }
.home-skel-line { height: 14px; width: 80%; }
.home-skel-line.is-title { height: 22px; width: 55%; }
.home-skel-line.is-kicker { height: 10px; width: 30%; }
.home-skel-line.is-short { width: 40%; }
.home-pick.is-skeleton .home-skel-line.is-title { height: 26px; width: 75%; }
.home-skel-card { display: grid; gap: 10px; padding-bottom: 12px; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: var(--card-border); }
.home-skel-card i { aspect-ratio: 16 / 9; border-radius: 0; }
.home-skel-card b { height: 12px; margin: 0 14px; width: 70%; }
.home-skel-card b + b { width: 45%; }
@keyframes home-shimmer { 50% { opacity: .55; } }
.app-carousel { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 300px); gap: 14px; overflow-x: auto; padding: 8px var(--gutter) 14px; margin: 0 calc(-1 * var(--gutter)); scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.app-carousel::-webkit-scrollbar { display: none; }
.app-carousel > * { scroll-snap-align: start; }
.place-card { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--card-shadow); border: var(--card-border); display: flex; flex-direction: column; }
.app-place-cover, .place-cover, .trip-cover, .sheet-hero, .fav-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; color: rgba(255,255,255,.92); background: radial-gradient(90% 80% at 85% 10%, color-mix(in srgb, var(--cover) 55%, #ffffff) 0%, transparent 60%), linear-gradient(155deg, color-mix(in srgb, var(--cover) 92%, #ffffff) 0%, var(--cover) 45%, color-mix(in srgb, var(--cover) 62%, #000000) 100%); overflow: hidden; text-align: left; }
.app-place-visual { position: absolute; inset: 12% 14% 8%; width: 72%; height: 80%; stroke-width: 2.2; filter: drop-shadow(0 2px 6px rgba(0,0,0,.12)); }
.app-place-cover:hover .app-place-visual { transform: scale(1.03); transition: transform .4s var(--ease); }
.cover-badge { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: rgba(10, 22, 27, .52); color: #fff; font-size: var(--type-caption-size); font-weight: 750; backdrop-filter: blur(8px); }
.cover-badge .tg-i { width: 14px; height: 14px; }
.cover-draft { position: absolute; top: 10px; right: 10px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: rgba(255,255,255,.9); color: #6b4a10; font-size: var(--type-kicker-size); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; }
.cover-index { position: absolute; top: 12px; left: 14px; font: italic 600 40px/1 var(--display); color: rgba(255,255,255,.9); font-stretch: var(--display-stretch);}
.place-content { padding: 14px 16px 12px; display: flex; flex-direction: column; flex: 1; }
.place-content .eyebrow { font-size: var(--type-caption-size); color: var(--muted); letter-spacing: .08em; }
.place-content h3 { font-size: var(--type-title-size); margin: 5px 0 6px; }
.place-content p { color: var(--muted); font-size: var(--type-body-s-size); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.place-content .text-button { margin-top: auto; }
.app-cta-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 18px 0 4px; border-radius: var(--r-lg); background: var(--color-block-red); color: var(--color-block-red-text); border: var(--border-width) solid var(--color-outline); box-shadow: var(--elevation-3); text-decoration: none; }
.app-cta-card > span:nth-child(2) { flex: 1; }
.app-cta-card strong { display: block; font-size: var(--type-body-size); }
.app-cta-card small { color: var(--muted); font-size: var(--type-body-s-size); }
.iris-avatar { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: conic-gradient(from 210deg, #c8371f, #f7c23b, #2458a6, #c8371f); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); flex: none; }
.iris-avatar .tg-i { width: 24px; height: 24px; }
.app-cta-card small { color: rgba(255,255,255,.85); }
.app-cta-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.app-trip-links { margin: 8px 0 4px; gap: 18px; }
.territory-notices .notice { background: var(--sea-soft); color: var(--ink); }
.territory-notices small { color: var(--muted); display: block; margin-top: 2px; }

/* ---------- Bottom sheet dialog ---------- */
.sheet-title, .dialog-inner h2, #dialog-title { font-weight: 850; font-stretch: var(--font-stretch-display); letter-spacing: 0; }
#detail-dialog { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--surface); color: var(--ink); border-top: var(--border-width) solid var(--color-outline); box-shadow: none; transition: transform .22s var(--ease); touch-action: pan-y; overflow: auto; overscroll-behavior: contain; }
#detail-dialog.is-dragging { transition: none; }
#detail-dialog[open] { animation: sheet-up .32s var(--ease); }
#detail-dialog::backdrop { background: rgba(29, 31, 36, .45); backdrop-filter: blur(2px); animation: fade .25s; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.dialog-inner { position: relative; padding: 10px 20px calc(24px + var(--safe-bottom)); }
.sheet-grabber { display: block; width: 44px; height: 6px; border-radius: 3px; background: var(--color-ink); opacity: .85; margin: 0 auto 10px; }
.dialog-inner.has-hero { padding-top: 0; }
.dialog-inner.has-hero .sheet-grabber { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.7); z-index: 2; }
.sheet-hero { margin: 0 -20px 14px; width: calc(100% + 40px); aspect-ratio: 16 / 8; }
.sheet-hero .app-place-visual { inset: 14% 22% 10%; width: 56%; height: 76%; }
.sheet-hero-meta { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 6px; }
.sheet-hero-meta .cover-badge, .sheet-hero-meta .cover-draft { position: static; }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dialog-top h2 { font: 650 26px/1.1 var(--display); margin-top: 4px; letter-spacing: -0.015em; font-stretch: var(--display-stretch);}
.close-dialog { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.close-dialog .tg-i { width: 18px; height: 18px; }
.has-hero .close-dialog { position: absolute; top: 12px; right: 14px; background: rgba(10,22,27,.45); color: #fff; backdrop-filter: blur(8px); z-index: 3; }
.dialog-body { font-size: var(--type-body-l-size); line-height: 1.6; color: var(--ink-2); }
.dialog-body p { margin-bottom: .9em; }
.place-actions-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 6px; }
.action-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); font-size: var(--type-caption-size); font-weight: 750; text-decoration: none; text-align: center; transition: .15s; }
.action-tile .tg-i { width: 22px; height: 22px; color: var(--accent-deep); }
:where([data-theme="dark"]) .action-tile .tg-i { color: var(--accent); }
.action-tile:active { transform: scale(.95); }
.action-tile.is-done { background: var(--ok-soft); color: var(--ok); }
.action-tile.is-done .tg-i { color: var(--ok); }
.source-link { display: inline-flex; font-size: var(--type-body-s-size); font-weight: 750; color: var(--sea); text-decoration: none; margin-top: 4px; }
.fav-toggle[aria-pressed="true"] { color: var(--danger); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 40%, transparent); }
.request-result { padding: 16px; border-radius: var(--r-md); background: var(--ok-soft); color: var(--ok); font-size: var(--type-label-size); }
.request-result strong { display: block; font-size: var(--type-body-l-size); margin-bottom: 4px; }

/* ---------- Route ---------- */
.route-result:not(:empty) { margin-top: 18px; }
.route-card { display: block; }
.route-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.route-heading h2 { font: 650 22px/1.15 var(--display); margin-top: 4px; font-stretch: var(--display-stretch);}
.step-label, .saved-mark { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-deep); font-size: var(--type-caption-size); font-weight: 800; }
.saved-mark { background: var(--ok-soft); color: var(--ok); }
.saved-mark .tg-i { width: 14px; height: 14px; }
.route-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.route-meta span { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--type-body-s-size); color: var(--ink-2); font-weight: 650; }
.route-meta b { color: var(--ink); font-weight: 800; }
.route-method.is-real { background: var(--ok-soft); color: var(--ok); }
.route-method.is-mixed, .route-method.is-estimate { background: var(--warn-soft); color: var(--warn); }
.route-list { list-style: none; padding: 0; margin: 16px 0 6px; }
.route-origin, .route-stop { position: relative; display: flex; gap: 14px; align-items: flex-start; }
.route-origin { align-items: center; padding: 4px 0; }
.route-origin strong { display: block; font-size: var(--type-body-size); }
.route-origin small { color: var(--muted); font-size: var(--type-caption-size); }
.stop-number { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--cover, var(--accent)); color: #fff; font-weight: 800; font-size: var(--type-label-size); box-shadow: 0 0 0 4px var(--surface), 0 4px 10px rgba(0,0,0,.12); z-index: 1; }
.stop-number.is-origin { background: var(--ink); color: var(--bg); }
.stop-number.is-origin .tg-i { width: 16px; height: 16px; }
.route-stop-body { flex: 1; min-width: 0; background: var(--surface); border: var(--card-border); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--card-shadow); }
.route-stop-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.route-stop-top strong { font-size: var(--type-body-l-size); }
.route-stop-time { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--type-caption-size); font-weight: 750; white-space: nowrap; }
.route-stop-time .tg-i { width: 13px; height: 13px; }
.route-stop p { color: var(--muted); font-size: var(--type-body-s-size); margin: 4px 0 10px; }
.personal-stop-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.route-leg { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 0 10px 50px; color: var(--muted); font-size: var(--type-caption-size); font-weight: 700; min-height: 44px; }
.route-leg .tg-i { width: 16px; height: 16px; }
.route-leg-line { position: absolute; left: 16px; top: -6px; bottom: -6px; width: 2px; background-image: linear-gradient(var(--line-strong) 50%, transparent 0); background-size: 2px 8px; }
.route-leg.is-real { color: var(--sea); }
.route-leg.is-real .route-leg-line { background: var(--sea); opacity: .55; }
.route-actions { margin-top: 18px; }
.personal-route-tracking { display: flex; gap: 14px; align-items: flex-start; margin-top: 20px; padding: 16px; border-radius: var(--r-lg); background: var(--sea-soft); }
.personal-route-tracking .tg-icon-bubble { background: var(--surface); color: var(--sea); }
.personal-route-tracking h3 { font-size: var(--type-body-l-size); }
.personal-route-tracking .actions { margin-top: 8px; }

/* ---------- Map (full screen) ---------- */
body[data-page="map"] .app-header { display: none; }
body[data-page="map"] .workspace { padding-bottom: 0; }
body[data-page="map"] main { max-width: none; padding: 0; animation: none; }
.tg-map-page { position: fixed; inset: 0 0 calc(var(--nav-h) + var(--safe-bottom)) 0; z-index: 1; background: var(--surface-2); }
.tg-map-main, .tg-map-main .tg-map-frame { position: absolute; inset: 0; }
.tg-map-frame { position: relative; overflow: hidden; }
.tg-map-canvas { position: absolute; inset: 0; background: #e8e4dc; }
.tg-map-loading, .tg-map-unavailable { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 700; padding: 20px; text-align: center; }
.tg-map-warning { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 500; }
.tg-map-warning:not([hidden]) { display: block; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); font-size: var(--type-body-s-size); font-weight: 650; box-shadow: var(--shadow-2); }
.tg-map-attribution { position: absolute; right: 0; bottom: 0; z-index: 400; display: flex; gap: 10px; padding: 2px 8px; background: color-mix(in srgb, var(--surface) 80%, transparent); font-size: var(--type-caption-size); border-top-left-radius: 8px; }
.tg-map-attribution a { position: relative; color: var(--ink-2); }
.tg-map-attribution a::after { content: ""; position: absolute; inset: -18px -4px -8px; }   /* 44 px to tap, the bar stays thin */
.tg-map-page .tg-map-attribution { bottom: 96px; }
.tg-map-overlay { position: absolute; left: 0; right: 0; top: 0; z-index: 600; padding: calc(10px + var(--safe-top)) 12px 0; pointer-events: none; }
.tg-map-overlay > * { pointer-events: auto; }
.tg-map-search > div { display: flex; align-items: center; gap: var(--space-3); height: 52px; padding: 0 4px 0 var(--space-5); border-radius: var(--radius-pill); background: var(--color-surface); border: var(--border-width) solid var(--color-outline); box-shadow: var(--elevation-2), 0 2px 12px color-mix(in srgb, var(--color-shadow) 18%, transparent); color: var(--color-muted); }
.tg-map-search input { flex: 1; min-height: 0; height: 100%; border: 0; background: transparent; padding: 0; font-weight: 650; box-shadow: none !important; }
.tg-map-search input::-webkit-search-cancel-button { display: none; }
.tg-map-clear { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--color-surface-2); color: var(--color-ink-2); font-size: var(--type-display-s-size); line-height: 1; }
.tg-map-filters { margin-top: 10px; }
.tg-chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 12px 8px; margin: 0 -12px; scrollbar-width: none; }
.tg-chip-scroll::-webkit-scrollbar { display: none; }
.tg-map-filter { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-pill); border: var(--border-width) solid var(--color-outline); background: var(--color-surface); color: var(--color-ink); box-shadow: var(--elevation-1); font: var(--type-label); font-size: var(--type-body-s-size); white-space: nowrap; cursor: pointer; }
.tg-map-filter::after { content: ""; position: absolute; inset: -5px 0; }
.tg-map-filter input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tg-map-filter small { color: var(--muted); font-weight: 650; font-size: var(--type-caption-size); }
.tg-map-filter:has(input:checked) { background: var(--ink); color: var(--bg); }
.tg-map-filter:has(input:checked) small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.tg-map-filter:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.tg-map-filter-dot, .tg-map-result-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.tg-map-dot-curated { background: var(--color-block-red); }
.tg-map-dot-cultura { background: #765b87; }
.tg-map-dot-ristoro { background: #b57640; }
.tg-map-dot-serate { background: #a4466f; }
.tg-map-dot-natura { background: #3d8a4f; }
.tg-map-dot-negozi { background: #49817b; }
.tg-map-dot-servizi { background: #718352; }
.tg-map-dot-trasporti { background: #4b7397; }
.tg-map-dot-partners { background: #ad7040; }
.tg-map-page-warning { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); font-size: var(--type-body-s-size); font-weight: 650; box-shadow: var(--shadow-1); }
.tg-map-fabs { position: absolute; right: 12px; bottom: 120px; z-index: 600; display: grid; gap: 10px; }
/* round controls over the map (§8): 48, surface, ink contour, elevation 2 */
.tg-fab { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--color-surface); color: var(--color-ink); border: var(--border-width) solid var(--color-outline); box-shadow: var(--elevation-2); }
.tg-map-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 700; height: 92px; overflow: hidden; border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--surface); box-shadow: 0 -8px 30px rgba(8,18,22,.18); transition: height .32s var(--ease); display: flex; flex-direction: column; }
.tg-map-page[data-view="list"] .tg-map-sheet { height: min(72%, 640px); }
.tg-map-page[data-view="list"] .tg-map-fabs { opacity: 0; pointer-events: none; }
.tg-map-sheet-head { flex: none; padding: 8px 16px 10px; }
.tg-map-grabber { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 10px; }
.tg-map-view-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); }
.tg-map-view-switch button { min-height: 44px; border-radius: var(--radius-pill); border: var(--border-width) solid transparent; font: var(--type-label); color: var(--color-ink-2); transition: background var(--motion-base) var(--motion-ease); }
.tg-map-view-switch button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-ink); border-color: var(--color-outline); box-shadow: var(--elevation-1); }
.tg-map-sheet > :not(.tg-map-sheet-head) { padding-left: 16px; padding-right: 16px; }
.tg-map-results { flex: none; }
.tg-map-page[data-view="list"] .tg-map-sheet { overflow-y: auto; overscroll-behavior: contain; }
.tg-map-page[data-view="list"] .tg-map-sheet-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.leaflet-control-attribution { display: none; }
.tg-map-results-heading h2 { font-size: var(--type-title-size); }
.tg-map-results-heading p { color: var(--muted); font-size: var(--type-body-s-size); margin: 2px 0 8px; }
.tg-map-result-list { display: grid; }
.tg-map-result-item { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.tg-map-result { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0; text-align: left; }
.tg-map-result > span:nth-child(2) { flex: 1; min-width: 0; }
.tg-map-result strong { display: block; font-size: var(--type-body-size); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-map-result small { color: var(--muted); font-size: var(--type-caption-size); }
.tg-map-result > span:last-child { color: var(--muted); }
.tg-map-read { position: relative; flex: none; min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-pill); background: var(--color-surface-2); font: var(--type-caption); font-weight: 750; }
.tg-map-read::after { content: ""; position: absolute; inset: -4px 0; }
.tg-map-map-actions, .tg-map-note, .tg-map-list-credit { color: var(--muted); font-size: var(--type-caption-size); margin: 10px 0; }
.tg-map-sheet .app-info-disclosure { margin: 8px 16px; }
.tg-map-provenance { display: grid; gap: 6px; font-size: var(--type-body-s-size); }
.tg-map-provenance strong { color: var(--ink); }
.tg-map-marker-count { display: none; }
.tg-map-route-wrap .tg-map-frame { position: relative; height: 260px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.tg-map-route-wrap .tg-map-note { margin-top: 8px; }
.tg-map-stop-icon span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--color-accent-ink); font: 800 var(--type-body-s-size)/1 var(--font); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.leaflet-container { font: inherit; background: #e8e4dc; isolation: isolate; }   /* the map panes (z 400–1000) stay inside their map, under the header and the bars */
/* itinerary: «Inizia» keeps its distance from the walk below */
.app-planner-page > .actions { margin-bottom: var(--space-7); }
.leaflet-popup-content-wrapper { border-radius: var(--r-md); box-shadow: var(--shadow-3); background: var(--surface); color: var(--ink); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 14px 16px; font-size: 13.5px; line-height: 1.45; }
.tg-map-popup h3 { font-size: var(--type-body-l-size); margin: 4px 0 6px; }
.tg-map-popup p { margin: 0 0 6px; color: var(--muted); }
.tg-map-popup-kicker { font-size: var(--type-kicker-size); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-deep); }
.tg-map-popup .button { margin: 6px 0 4px; min-height: 40px; color: #fff; }
.tg-map-popup a { font-size: var(--type-caption-size); color: var(--sea); font-weight: 700; display: block; }
.tg-map-popup-demo { color: var(--warn) !important; font-weight: 750; }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-tooltip { border-radius: 8px; font-weight: 700; font-size: 12px; }
:where([data-theme="dark"]) .tg-map-canvas .leaflet-tile-pane { filter: brightness(.78) contrast(1.08) saturate(.8); }
.tg-place-detail { display: grid; gap: 14px; }
.tg-place-story h3, .tg-place-practical h3, .tg-place-missing h3 { font-size: var(--type-body-size); margin-bottom: 6px; }
.tg-place-practical dl { display: grid; gap: 8px; }
.tg-place-practical dl div { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.tg-place-practical dt { font-size: var(--type-caption-size); font-weight: 750; color: var(--muted); }
.tg-place-practical dd { margin: 2px 0 0; font-weight: 650; }
.tg-place-missing { padding: 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); }
.tg-place-provenance { font-size: var(--type-caption-size); color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.tg-place-provenance div { display: flex; flex-wrap: wrap; gap: 12px; }
.tg-place-provenance a { color: var(--sea); font-weight: 700; }
.tg-place-loading { color: var(--muted); }

/* ---------- Iris chat ---------- */
body[data-page="iris"] .workspace { padding-bottom: 0; }
body[data-page="iris"] main { padding-bottom: 0; }
.app-iris-page { display: flex; flex-direction: column; min-height: calc(100dvh - var(--header-h) - var(--safe-top) - var(--nav-h) - var(--safe-bottom) - 8px); }
.iris-header { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; }
.iris-header h1 { font: 650 26px/1 var(--display); font-stretch: var(--display-stretch);}
.iris-header .icon-button { margin-left: auto; background: var(--surface); box-shadow: var(--shadow-1); }
.iris-mode-badge { display: inline-flex; margin-top: 4px; font-size: var(--type-caption-size); font-weight: 750; color: var(--muted); }
.iris-mode-badge.is-ai { color: var(--ok); }
.iris-mode-badge.is-ai::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin: 4px 6px 0 0; }
.iris-card { flex: 1; display: flex; flex-direction: column; padding: 0; background: transparent; box-shadow: none; border: 0; }
.iris-welcome { padding: 30px 6px 16px; text-align: center; }
.iris-welcome h2 { font: 650 28px/1.1 var(--display); margin-bottom: 8px; font-stretch: var(--display-stretch);}
.iris-intro { color: var(--muted); max-width: 36ch; margin: 0 auto; }
.messages { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 20px; flex: 1; }
.message { max-width: 86%; padding: 12px 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--card-shadow); border: var(--card-border); font-size: var(--type-body-size); line-height: 1.5; animation: pop .25s var(--ease); align-self: flex-start; border-bottom-left-radius: 6px; }
.message p { margin: 0; white-space: pre-wrap; }
.message.user { align-self: flex-end; background: var(--ink); color: var(--bg); border: 0; border-bottom-left-radius: 20px; border-bottom-right-radius: 6px; }
.message.is-ai { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.message-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.message-sources a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 10px 0 4px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: var(--type-caption-size); font-weight: 700; text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.message-sources b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--sea); color: var(--color-block-blue-text); font-size: var(--type-caption-size); flex: none; }
.message .chip-button { margin-top: 8px; margin-right: 6px; }
/* Iris answers (services/iris_brain.py): cards from The Guide's data, actions and follow-up chips under the bubble. */
.iris-extra { display: grid; gap: 10px; min-width: 0; margin: -2px 0 4px; animation: pop .25s var(--ease); }
.iris-cards { display: grid; grid-auto-flow: column; grid-auto-columns: min(88%, 320px); gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 2px 2px 6px; scrollbar-width: none; }
.iris-cards::-webkit-scrollbar { display: none; }
.iris-cards > * { scroll-snap-align: start; min-width: 0; display: grid; }
.iris-cards .tg-card.is-compact .tg-cover { min-height: 100px; }
.iris-cards .tg-cover-badge { display: none; }
.iris-cards .tg-card-sub { -webkit-line-clamp: 1; }
.iris-extra .tg-plan { margin: 0; max-width: 560px; }
.iris-mini-card a { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); color: var(--ink); text-decoration: none; }
.iris-mini-card small { color: var(--muted); }
.iris-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.iris-action { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--ink-2); font-size: var(--type-body-s-size); font-weight: 750; text-decoration: none; }
.iris-action .tg-i { width: 16px; height: 16px; }
.iris-actions .grp-propose-chip { height: 34px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); font-size: var(--type-body-s-size); }
.iris-follow { display: flex; flex-wrap: wrap; gap: 6px; }
.iris-follow .chip-button { box-shadow: inset 0 0 0 1.5px var(--line); background: transparent; }
/* Iris text (web/iris-text.js): the safe Markdown of AI answers, the text that appears while the AI writes, and the
   tools under an answer («Ascolta», «Approfondisci», plans). */
.iris-md { display: grid; gap: 8px; }
.iris-md p { margin: 0; white-space: normal; }
.iris-md-h { margin: 4px 0 0; font-size: var(--type-body-l-size); font-weight: 800; line-height: 1.3; color: var(--ink); }
.iris-md-list { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.iris-md strong { font-weight: 800; }
.iris-md-link { display: inline; padding: 0; border: 0; background: none; font: inherit; color: var(--accent); font-weight: 750; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.message.is-streaming .iris-md > :last-child::after { content: ""; display: inline-block; width: .5em; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--accent); border-radius: 2px; animation: iris-caret 1s steps(2) infinite; }
@keyframes iris-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .message.is-streaming .iris-md > :last-child::after { animation: none; } }
.iris-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.iris-tools .chip-button { margin: 0; display: inline-flex; align-items: center; gap: 6px; box-shadow: inset 0 0 0 1.5px var(--line); background: transparent; text-decoration: none; }
.iris-tools .tg-i { width: 16px; height: 16px; }
.iris-route-hint { margin: 8px 0 0; font-size: var(--type-caption-size); font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.iris-route-hint::before { content: "⚡ "; }
.iris-route-hint.is-ai { color: var(--ok); }
.iris-route-hint.is-ai::before { content: "✦ "; }
.iris-status { color: var(--muted); font-size: var(--type-body-s-size); font-weight: 650; min-height: 0; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.iris-dock { position: sticky; bottom: calc(var(--nav-h) + var(--safe-bottom)); z-index: 20; padding: 8px 0 12px; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); background: var(--bg); box-shadow: 0 -12px 16px -8px var(--bg); }
.iris-suggestions { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.iris-suggestions::-webkit-scrollbar { display: none; }
.iris-suggestions button { flex: none; position: relative; height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); font-size: var(--type-body-s-size); font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.iris-suggestions button::after { content: ""; position: absolute; inset: -4px 0; }
.iris-form { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--card-shadow); border: var(--card-border); }
.iris-form input { flex: 1; border: 0; background: transparent; min-height: 44px; padding: 0; box-shadow: none !important; }
.iris-form button { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--color-accent-ink); flex: none; }
.iris-mode { margin: 4px 0 18px; font-size: var(--type-body-s-size); color: var(--muted); }
.iris-mode summary { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; min-height: 44px; padding: 0; }
.iris-mode summary .tg-i { width: 16px; height: 16px; }
.iris-mode p { margin: 6px 0; }

/* ---------- Trips, favourites, more, experiences ---------- */
.trip-grid, .experience-grid, .fav-list { display: grid; gap: 14px; margin: 12px 0; }
.trip-card { padding: 0; overflow: hidden; display: grid; grid-template-columns: 110px 1fr; }
.trip-cover { aspect-ratio: auto; height: 100%; min-height: 140px; }
.trip-cover .app-place-visual { inset: 18% 10% 22%; width: 80%; height: 60%; }
.trip-body { padding: 14px 14px 12px; min-width: 0; }
.topline { display: flex; justify-content: space-between; gap: 8px; font-size: var(--type-caption-size); font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.trip-card h2 { font-size: var(--type-title-size); margin: 6px 0 4px; }
.trip-stats { display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: var(--type-body-s-size); font-weight: 700; margin: 0; }
.trip-stats .tg-i { width: 14px; height: 14px; }
.trip-stops { color: var(--muted); font-size: var(--type-caption-size); margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trip-card .actions { margin-top: 10px; gap: 6px; }
.app-menu-group { margin: 6px 0 18px; }
.app-menu-title { font-size: var(--type-caption-size); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 4px 8px; }
.app-more-grid { background: var(--surface); border-radius: var(--r-lg); border: var(--card-border); box-shadow: var(--card-shadow); overflow: hidden; }
.app-more-grid a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none; }
.app-more-grid a + a { border-top: 1px solid var(--line); }
.app-more-grid a:active { background: var(--surface-2); }
.app-menu-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.app-menu-copy { flex: 1; min-width: 0; }
.app-menu-copy strong { display: block; font-size: var(--type-body-size); }
.app-menu-copy small { color: var(--muted); font-size: var(--type-caption-size); }
.app-menu-arrow { color: var(--muted); }
.app-about-card { margin-top: 10px; }
.app-about-card h2 { font: 650 22px/1.2 var(--display); margin: 6px 0 8px; font-stretch: var(--display-stretch);}
.app-about-card p { color: var(--muted); font-size: var(--type-label-size); }
.fav-item { display: flex; gap: 14px; padding: 12px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); }
.fav-thumb { width: 84px; height: 84px; aspect-ratio: auto; border-radius: var(--r-md); flex: none; display: grid; place-items: center; }
.fav-thumb .app-place-visual { inset: 14%; width: 72%; height: 72%; }
.fav-item h2 { font-size: var(--type-body-l-size); }
.fav-item p { color: var(--muted); font-size: var(--type-body-s-size); margin: 2px 0 0; }
.fav-item .actions { margin-top: 8px; gap: 6px; }
.fav-item .button { min-height: 40px; padding: 0 12px; font-size: var(--type-body-s-size); }
.fav-item .button::after, .tg-map-popup .button::after { content: ""; position: absolute; inset: -2px 0; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 12px; }
.price-row strong { font-size: var(--type-display-s-size); }
.price-row span { color: var(--muted); font-size: var(--type-caption-size); }

/* ---------- Personal (journey, profile, history) ---------- */
.personal-page { display: block; }
.personal-local-note, .setup-local-note { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-md); background: var(--sea-soft); color: var(--sea); font-size: var(--type-body-s-size); font-weight: 700; margin: 0 0 14px; }
.personal-local-note svg { width: 18px; height: 18px; flex: none; }
.personal-profile-summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); margin-bottom: 14px; }
.personal-profile-summary > div { flex: 1; min-width: 0; }
.personal-profile-summary strong { display: block; font-size: var(--type-body-size); }
.personal-profile-summary small { color: var(--muted); font-size: var(--type-caption-size); }
.personal-summary-icon, .personal-step, .personal-empty-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); flex: none; }
.personal-summary-icon svg, .personal-step svg, .personal-empty-icon svg { width: 20px; height: 20px; }
.personal-journey-card, .personal-section { margin-bottom: 14px; }
.personal-section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.personal-section-heading h2 { font-size: var(--type-title-size); }
.personal-section-heading p { color: var(--muted); font-size: var(--type-body-s-size); margin: 3px 0 0; }
.personal-section > .personal-section-heading { display: block; }
.personal-section > .personal-section-heading h2 { margin-top: 4px; }
.personal-origin-heading { margin-top: 20px; }
.personal-duration, .personal-interest-options, .setup-interest-options { display: flex; flex-wrap: wrap; gap: 8px; }
.personal-duration label, .personal-interest-options label, .setup-interest-options label { position: relative; }
.personal-duration input, .personal-interest-options input, .setup-interest-options input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.personal-duration span, .personal-interest-options span, .setup-interest-options span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--r-pill); background: var(--surface-2); font-weight: 750; font-size: var(--type-label-size); color: var(--ink-2); transition: .15s; }
.personal-duration input:checked + span, .personal-interest-options input:checked + span, .setup-interest-options input:checked + span { background: var(--ink); color: var(--bg); }
.personal-duration input:focus-visible + span, .personal-interest-options input:focus-visible + span, .setup-interest-options input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.personal-origin-status { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); margin: 0 0 10px; }
.personal-origin-status strong { display: block; font-size: var(--type-body-size); }
.personal-origin-status small { color: var(--muted); font-size: var(--type-caption-size); }
.personal-origin-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); flex: none; }
.personal-origin-status.is-live .personal-origin-dot { background: var(--ok); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 22%, transparent); animation: pulse 2s infinite; }
.personal-origin-status.is-demo .personal-origin-dot { background: var(--warn); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--ok) 5%, transparent); } }
.personal-journey-card .button svg, .personal-propose svg { width: 18px; height: 18px; }
.personal-demo, .personal-details, .personal-data-controls, .personal-manual { margin: 12px 0; border-radius: var(--r-md); }
.personal-demo > summary, .personal-data-controls > summary { display: flex; align-items: center; min-height: 44px; font-size: var(--type-body-s-size); font-weight: 750; color: var(--accent-deep); padding: 0; }
.personal-demo-options { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.personal-details > summary { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-weight: 750; padding: var(--space-1) 0; }
.personal-details > summary small { display: block; color: var(--muted); font-weight: 650; font-size: var(--type-caption-size); }
.personal-details-body { padding-top: 8px; }
.personal-manual { padding: 12px 14px; background: var(--surface); border: 1px dashed var(--line-strong); }
.personal-propose { margin-top: 14px; }
.personal-recommendation { margin-top: 18px; outline: none; }
.personal-why { display: flex; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--accent-soft), var(--surface)); margin-bottom: 16px; }
.personal-why h2 { font: 650 22px/1.15 var(--display); margin: 4px 0 6px; font-stretch: var(--display-stretch);}
.personal-why p, .personal-why li { color: var(--ink-2); font-size: var(--type-body-s-size); }
.personal-why ul { margin: 6px 0 0; }
.personal-proposal-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 8px; }
.personal-proposal-actions svg { width: 18px; height: 18px; }
.personal-check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; font-size: var(--type-label-size); }
.personal-check span { flex: 1; }
.personal-check strong { display: block; font-size: var(--type-label-size); line-height: 1.35; }
.personal-check small { display: block; color: var(--muted); font-size: var(--type-caption-size); margin-top: 3px; }
.personal-consent { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.personal-shopping { margin-top: 10px; }
.personal-save-profile { margin-top: 6px; }
.personal-tracker-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: 12px; }
.personal-tracker-status p { margin: 2px 0 0; color: var(--muted); font-size: var(--type-body-s-size); }
.personal-tracker-status small { display: block; color: var(--muted); font-size: var(--type-caption-size); margin-top: 4px; }
.personal-tracker-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); margin-top: 4px; flex: none; }
.personal-tracker-dot.is-active { background: var(--ok); animation: pulse 2s infinite; box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 22%, transparent); }
.personal-tracker-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.personal-history-title { margin-top: 22px; }
.personal-visit-list { display: grid; gap: 10px; }
.personal-visit-card { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); }
.personal-visit-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); flex: none; }
.personal-visit-icon.is-confirmed { background: var(--ok-soft); color: var(--ok); }
.personal-visit-icon svg { width: 18px; height: 18px; }
.personal-visit-copy { flex: 1; min-width: 0; }
.personal-visit-meta { display: flex; justify-content: space-between; gap: 8px; font-size: var(--type-caption-size); color: var(--muted); }
.personal-visit-badge { font-weight: 800; color: var(--warn); }
.personal-visit-badge.is-confirmed { color: var(--ok); }
.personal-visit-card h3 { font-size: var(--type-body-l-size); margin: 4px 0; }
.personal-visit-card p { color: var(--muted); font-size: var(--type-body-s-size); margin: 0 0 8px; }
.personal-visit-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.personal-learning { margin: 18px 0; padding: 16px; border-radius: var(--r-lg); background: var(--sea-soft); }
.personal-learning strong { display: block; margin-bottom: 4px; }
.personal-learning p { color: var(--ink-2); font-size: var(--type-body-s-size); }
.personal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.personal-footnote, .personal-form-footnote { margin-top: 12px; }

/* ---------- Onboarding ---------- */
body[data-page="welcome"] .app-bottom-nav { display: none; }
body[data-page="welcome"] .workspace { padding-bottom: 32px; }
.setup-page { max-width: 560px; margin: 0 auto; }
.setup-heading { position: relative; overflow: hidden; margin: 6px 0 16px; padding: 26px 20px 22px; border-radius: var(--r-xl); color: #f3efe8; background: radial-gradient(120% 90% at 100% 0%, #3a6fc0 0%, transparent 60%), linear-gradient(160deg, #2458a6 0%, #1d4a8f 100%); box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 14px; }
.setup-heading .app-kicker { color: var(--gold); }
.setup-heading h1 { font: 650 clamp(30px, 8vw, 40px)/1.05 var(--display); margin: 6px 0 8px; letter-spacing: -0.02em; font-stretch: var(--display-stretch);}
.setup-heading p { color: rgba(243,239,232,.82); margin: 0; }
.setup-welcome-mark { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: conic-gradient(from 210deg, #c8371f, #f7c23b, #2458a6, #c8371f); color: #fff; }
.setup-welcome-mark svg { width: 26px; height: 26px; }
.setup-form { background: var(--surface); border-radius: var(--r-xl); padding: 20px 18px; border: var(--card-border); box-shadow: var(--card-shadow); }
.setup-section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.setup-section-heading h2 { font: 650 22px/1.2 var(--display); font-stretch: var(--display-stretch);}
.setup-section-heading span { font-size: var(--type-caption-size); font-weight: 750; color: var(--muted); background: var(--surface-2); padding: 4px 10px; border-radius: var(--r-pill); }
.setup-helper { margin: 8px 0 0; }
.setup-choice-list { display: grid; gap: 10px; margin: 18px 0; }
.setup-choice, .setup-history-choice { padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.setup-history-choice { margin-top: 12px; background: var(--surface); }
.setup-check { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; font-size: var(--type-body-size); line-height: 1.4; }
.setup-check input { margin-top: 1px; }
.setup-check + .setup-helper { padding-left: 32px; }
.setup-legal { padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); }
.setup-legal-links { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0 0 32px; }
.setup-link { color: var(--accent-deep); font-weight: 750; font-size: var(--type-body-s-size); text-decoration: underline; text-underline-offset: 3px; }
.setup-status { background: var(--sea-soft); color: var(--sea); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--type-body-s-size); }
.setup-submit { margin-top: 18px; }
.setup-submit svg { width: 18px; height: 18px; }
.setup-local-note { margin: 14px 0 0; }
/* Welcome screen v2 and the taste prompt (web/onboarding.js, docs/ECOSISTEMA_V2.md §1) */
.setup-v2 .setup-form { display: grid; gap: 14px; }
.setup-default-line { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px; border-radius: var(--r-md); background: var(--sea-soft); color: var(--ink); font-size: var(--type-body-size); line-height: 1.5; font-weight: 600; }
.setup-default-line > svg { flex: none; width: 22px; height: 22px; color: var(--sea); margin-top: 1px; }
.setup-default-line .setup-link { font-size: inherit; padding: 0; }
.setup-nowrap { white-space: nowrap; }
.setup-legal-note, .legal-variant { margin: 0 0 16px; }
.setup-offers { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.setup-offers-icon { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); }
.setup-offers-icon svg { width: 20px; height: 20px; }
.setup-offers-copy { flex: 1; min-width: 0; }
.setup-offers-copy strong { display: block; font-size: var(--type-body-size); line-height: 1.3; }
.setup-offers-copy small { display: block; color: var(--muted); font-size: var(--type-caption-size); line-height: 1.4; margin-top: 2px; }
.setup-switch { position: relative; flex: none; width: 52px; height: 32px; }
.setup-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.setup-switch-ui { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--surface-3); transition: background .2s; }
.setup-switch-ui::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.setup-switch input:checked + .setup-switch-ui { background: var(--ok); }
.setup-switch input:checked + .setup-switch-ui::after { transform: translateX(20px); }
.setup-switch input:focus-visible + .setup-switch-ui { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.setup-terms-box { padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); }
.setup-terms-check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.setup-terms-check .setup-link { font-size: inherit; padding: 0; }
.setup-v2 .setup-submit, .setup-v2 .setup-local-note, .setup-v2 .setup-error, .setup-v2 .setup-status { margin: 0; }
.setup-taste { display: grid; min-height: calc(100dvh - 190px); align-content: center; }
.setup-taste-card { text-align: center; padding: 28px 20px 22px; border-radius: var(--r-xl); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); }
.setup-taste-art { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: conic-gradient(from 210deg, #c8371f, #f7c23b, #2458a6, #c8371f); box-shadow: var(--shadow-2); }
.setup-taste-art svg { width: 34px; height: 34px; }
.setup-taste-card h1 { font: 650 clamp(28px, 8vw, 36px)/1.08 var(--display); margin: 6px 0 10px; letter-spacing: -0.02em; font-stretch: var(--display-stretch);}
.setup-taste-card > p { color: var(--muted); margin: 0 auto 18px; max-width: 34ch; line-height: 1.5; }
.setup-taste-actions { display: grid; gap: 10px; margin-bottom: 14px; }
.setup-taste-actions svg { width: 18px; height: 18px; }
.setup-taste .setup-status { margin: 0 0 14px; text-align: left; }
/* Informativa and Termini (web/app-legal.js) */
.legal-doc { font-size: var(--type-body-size); line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.legal-doc h3 { font: 650 var(--type-display-s-size)/1.25 var(--display); color: var(--ink); margin: 24px 0 8px; font-stretch: var(--display-stretch);}
.legal-doc h4 { font-size: var(--type-body-size); color: var(--ink); margin: 14px 0 4px; }
.legal-doc p { margin: 0 0 10px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 10px; padding-left: 20px; }
.legal-doc li { margin: 0 0 6px; }
.legal-doc strong { color: var(--ink); }
.legal-meta { font-size: var(--type-caption-size); color: var(--muted); margin: 0 0 12px; }
.legal-summary { margin: 0 0 18px; padding: 16px; border-radius: var(--r-md); background: var(--sea-soft); color: var(--ink); }
.legal-summary h3 { margin: 0 0 8px; font-size: var(--type-title-size); }
.legal-summary ul { margin: 0; padding-left: 18px; }
.legal-summary li { margin: 0 0 6px; }
.legal-cards { list-style: none; padding: 0 !important; display: grid; gap: 10px; margin: 8px 0 14px !important; }
.legal-card { margin: 0 !important; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.legal-card > strong { display: block; font-size: var(--type-body-size); margin-bottom: 6px; }
.legal-card dl { display: grid; grid-template-columns: minmax(84px, max-content) minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: var(--type-body-s-size); line-height: 1.45; }
.legal-card dt { color: var(--muted); font-weight: 700; }
.legal-card dd { margin: 0; min-width: 0; }
.legal-ph { background: var(--warn-soft); color: var(--ink); border-radius: 4px; padding: 0 4px; font-weight: 700; }
.legal-doc .dialog-note { margin-top: 18px; }

/* ---------- Nearby (geo) ---------- */
.geo-workspace { display: block; }
.geo-choice-panel, .geo-position-panel { background: var(--surface); border-radius: var(--r-lg); padding: 16px; border: var(--card-border); box-shadow: var(--card-shadow); margin: 12px 0; }
.geo-section-heading { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 12px; }
.geo-section-heading h2 { font: 650 var(--type-display-s-size)/1.2 var(--display); font-stretch: var(--display-stretch);}
.geo-section-heading p { color: var(--muted); font-size: var(--type-body-s-size); margin: 3px 0 0; }
.geo-step { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; font-size: var(--type-body-s-size); flex: none; }
.geo-controls, .geo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.geo-control-label { font-weight: 750; font-size: var(--type-body-s-size); color: var(--ink-2); }
.geo-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); margin: 10px 0; }
.geo-status p { margin: 2px 0 0; color: var(--muted); font-size: var(--type-body-s-size); }
.geo-status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); margin-top: 4px; flex: none; }
.geo-status-dot.active { background: var(--ok); animation: pulse 2s infinite; }
.geo-status-dot.simulated { background: var(--warn); }
.geo-results { display: grid; gap: 10px; }
.geo-card { padding: 14px; border-radius: var(--r-md); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); }
.geo-card h3 { font-size: var(--type-body-l-size); margin: 4px 0; }
.geo-card p { color: var(--muted); font-size: var(--type-body-s-size); margin: 0 0 6px; }
.geo-card-top { display: flex; justify-content: space-between; gap: 8px; font-size: var(--type-caption-size); font-weight: 750; color: var(--muted); }
.geo-distance { color: var(--sea); }
.geo-sponsored { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.geo-ad-label { color: var(--warn); }
.geo-why, .geo-purpose, .geo-choice-note, .geo-consent { font-size: var(--type-caption-size); color: var(--muted); }
.geo-manual, .geo-radius-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.geo-revoke { margin-top: 6px; }
.geo-choice-state { font-weight: 750; color: var(--ink-2); font-size: var(--type-body-s-size); }

/* ---------- Commercial ---------- */
.commercial-preferences, .commercial-route-summary, .commercial-stop { border-radius: var(--r-md); }
.commercial-preferences { padding: 12px; background: var(--surface); margin-top: 12px; }
.commercial-heading { font-weight: 750; margin: 4px 0; }
.commercial-intro, .commercial-note, .commercial-demo-note, .commercial-optional, .commercial-location-note, .commercial-operator { color: var(--muted); font-size: var(--type-caption-size); }
.commercial-opt-in, .commercial-interests label { display: flex; gap: 10px; align-items: flex-start; font-size: var(--type-label-size); font-weight: 650; margin: 8px 0; }
.commercial-route-summary { padding: 10px 12px; background: var(--warn-soft); color: var(--warn); font-size: var(--type-body-s-size); margin: 10px 0; }
.commercial-summary-meta { display: block; font-size: var(--type-caption-size); margin-top: 2px; }
.commercial-stop { margin: 8px 0; padding: 10px 12px; background: var(--warn-soft); font-size: var(--type-body-s-size); }
.commercial-sponsored { font-size: var(--type-kicker-size); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.commercial-why { font-size: var(--type-caption-size); color: var(--ink-2); }

/* ---------- Workspaces (operators, PA) ---------- */
.ws-workspace { display: block; }
.ws-page-header p { color: var(--muted); }
.ws-context-note, .ws-closed { padding: 12px 14px; border-radius: var(--r-md); background: var(--sea-soft); color: var(--ink-2); font-size: var(--type-body-s-size); margin: 10px 0; }
.ws-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.ws-metric { padding: 14px; border-radius: var(--r-md); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); }
.ws-metric strong { display: block; font: 650 28px/1 var(--display); font-stretch: var(--display-stretch);}
.ws-metric span, .ws-metric small { color: var(--muted); font-size: var(--type-caption-size); }
.ws-section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin: 22px 0 10px; }
.ws-section-heading h2 { font: 650 var(--type-display-s-size)/1.2 var(--display); font-stretch: var(--display-stretch);}
.ws-request-list, .ws-content-list, .ws-catalog-grid, .ws-territory-grid { display: grid; gap: 10px; }
.ws-request-card, .ws-content-card, .ws-catalog-card, .ws-editor-section, .ws-editorial-aside, .ws-archive, .ws-distribution { padding: 14px; border-radius: var(--r-md); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); }
.ws-card-top, .ws-card-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: var(--type-caption-size); color: var(--muted); }
.ws-card-bottom { margin-top: 10px; }
.ws-request-info { font-size: var(--type-body-s-size); color: var(--ink-2); }
.ws-status { display: inline-flex; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--type-caption-size); font-weight: 800; align-items: center; background: var(--surface-2); color: var(--ink-2); }
.ws-status-pending, .ws-status-draft { background: var(--warn-soft); color: var(--warn); }
.ws-status-confirmed, .ws-status-published { background: var(--ok-soft); color: var(--ok); }
.ws-status-cancelled, .ws-status-archived { background: var(--danger-soft); color: var(--danger); }
.ws-actions, .ws-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ws-form { display: grid; gap: 4px; }
.ws-form-intro, .ws-body-copy { color: var(--muted); font-size: var(--type-body-s-size); }
.ws-bars { display: grid; gap: 8px; }
.ws-bar-item { display: grid; gap: 4px; font-size: var(--type-body-s-size); }
.ws-bar-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ws-bar-track > * { display: block; height: 100%; background: var(--sea); border-radius: 4px; }
.ws-flow { color: var(--muted); font-size: var(--type-body-s-size); }
.ws-empty-compact { padding: 14px; }

/* ---------- Roadmap ---------- */
.phase-list { display: grid; gap: 12px; margin: 12px 0; }
.phase-card > summary { min-height: 44px; display: flex; align-items: center; }
.phase-card { padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); }
.phase-number { font: italic 600 30px/1 var(--display); color: var(--accent); font-stretch: var(--display-stretch);}
.phase-card h2, .phase-card h3 { font-size: var(--type-title-size); margin: 6px 0; }
.phase-card p, .phase-card li { color: var(--ink-2); font-size: var(--type-body-s-size); }
.phase-proof { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--type-body-s-size); }
.phase-expand { margin-top: 8px; }

/* ---------- Larger screens ---------- */
@media (min-width: 560px) {
  .home-pick { padding: 22px 24px 20px; }
  .home-pick-title { font-size: 28px; }
  .home-quick { gap: 10px; margin: -6px 0 0; }
  .home-quick-icon { width: 54px; height: 54px; }
  .home-quick-label { font-size: var(--type-caption-size); }
  .experience-grid { grid-template-columns: repeat(2, 1fr); }
  .ws-metrics { grid-template-columns: repeat(4, 1fr); }
  #detail-dialog { margin: auto; border-radius: var(--r-xl); max-height: 88dvh; }
  .sheet-grabber { display: none; }
  .has-hero .sheet-hero { border-radius: 0; }
}
@media (min-width: 960px) {
  .app-city { display: inline-flex; }
  .app-carousel { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 8px 0 14px; }
  .home-rail { --rail-w: calc((100% - 24px) / 3); padding: 2px 0 10px; margin: 0 0 -10px; scroll-padding: 0; }
  .home-grid3 .social-home-card { aspect-ratio: 4 / 3; }
  .trip-grid { grid-template-columns: repeat(2, 1fr); }
  .tg-map-sheet-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
  .app-iris-page { min-height: calc(100dvh - 2 * var(--space-7)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Accesso e account ---------- */
body[data-page="auth"] .app-bottom-nav, body[data-page="auth"] .app-header { display: none; }
body[data-page="auth"] .workspace { padding-bottom: 24px; padding-left: 0; }
body[data-page="auth"] main { max-width: 520px; padding-top: calc(12px + var(--safe-top)); }
.auth-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 26px 22px 150px; color: #f3efe8; background: radial-gradient(120% 90% at 100% 0%, #3a6fc0 0%, transparent 60%), linear-gradient(160deg, #2458a6 0%, #1d4a8f 100%); box-shadow: var(--shadow-2); isolation: isolate; }
.auth-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: var(--type-title-size); letter-spacing: -0.03em; margin-bottom: 26px; }
.auth-brand .brand-symbol { background: #f3efe8; color: var(--color-block-blue); }
.auth-hero h1 { font: 650 clamp(30px, 8.4vw, 40px)/1.05 var(--display); letter-spacing: -0.02em; margin-bottom: 8px; font-stretch: var(--display-stretch);}
.auth-hero p { color: rgba(243,239,232,.82); max-width: 32ch; margin: 0; }
.auth-hero-art { position: absolute; right: -30px; bottom: -40px; width: 300px; z-index: -1; opacity: .95; }
.auth-hero-art svg { width: 100%; height: auto; }
.auth-card { position: relative; margin: -60px 10px 0; padding: 18px; border-radius: var(--r-xl); background: var(--surface); border: var(--card-border); box-shadow: var(--shadow-3); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); margin-bottom: 8px; }
.auth-tabs button { height: 40px; border-radius: var(--r-pill); font-weight: 750; font-size: var(--type-label-size); color: var(--muted); }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.auth-form .field small { font-weight: 600; font-size: var(--type-caption-size); }
.auth-form .button { margin-top: 10px; }
.auth-terms { align-items: flex-start; font-size: var(--type-body-s-size); line-height: 1.45; }
.auth-terms .setup-link { font-size: var(--type-body-s-size); }
.auth-note, .auth-footnote { text-align: center; margin: 12px 0 0; }
.auth-link { display: flex; width: fit-content; margin: 10px auto 0; }
.auth-lead { margin: 0 0 6px; font-size: var(--type-label-size); line-height: 1.45; }
.auth-notice { margin: 10px 0 0; }
.app-account-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; margin: 0 0 8px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); }
.app-android-card .account-copy { flex: 1 1 180px; min-width: 0; }
#android-update-note.is-update { color: var(--accent-deep); font-weight: 700; overflow-wrap: anywhere; }
.account-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: var(--type-title-size); color: #fff; background: conic-gradient(from 210deg, #c8371f, #f7c23b, #2458a6, #c8371f); flex: none; }
.account-copy { flex: 1; min-width: 0; }
.account-copy strong { display: block; font-size: var(--type-body-l-size); }
.account-copy small { color: var(--muted); font-size: var(--type-caption-size); overflow-wrap: anywhere; }
.account-actions { display: flex; gap: 12px; align-items: center; width: 100%; justify-content: flex-end; }
@media (min-width: 560px) { .account-actions { width: auto; } }
.account-avatar.is-android { background: var(--sea); }
.account-avatar.is-android .tg-i { width: 22px; height: 22px; }
.app-android-download { margin: 0 0 8px; }


/* ---------- Header on phones ----------
 * Logo + city chip + actions must always fit the screen: the city chip shrinks (ellipsis), the
 * status pill is hidden on narrow screens, and the page itself never scrolls sideways. */
html, body { overflow-x: clip; }
.app-header > * { min-width: 0; }
.app-brand, .app-header-actions { flex: none; }
.app-header .app-city.city-switch { flex: 0 1 auto; min-width: 0; }
@media (max-width: 600px) {
  .app-header { gap: 6px; }
  .app-header #connection { display: none; }
  .app-header .app-city.city-switch { margin-left: 0; max-width: none; }
  .app-header-actions { gap: 0; }
}
/* below 430 px «Informazioni» leaves the header (it is in Tu › Aiuto e informazioni), the logo is a little smaller
   and the status dot goes: the name of the city fits */
@media (max-width: 430px) {
  .app-header [data-action="about"], .app-header .city-switch .status-dot { display: none; }
  .app-header .brand-logo { height: 34px; }
  .app-header .app-city.city-switch { padding: 0 var(--space-3) 0 var(--space-4); margin-left: var(--space-1); }
}
/* below 390 px the logo and the round actions give up a few pixels more (the actions keep 44 px to tap) */
@media (max-width: 389px) {
  .app-header .brand-logo { height: 30px; }
  .app-header-actions .icon-button { width: 38px; }
  .app-header-actions .icon-button::after { content: ""; position: absolute; inset: 0 -3px; }
}

/* ---------- Amici (#amici): segments Gruppi | Community (docs/ECOSISTEMA_V2.md §4) ---------- */
.amici-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 12px; min-height: 66px; }
.amici-title { font: 650 clamp(28px, 7.5vw, 36px)/1.08 var(--display); letter-spacing: -0.02em; margin: 0; font-stretch: var(--display-stretch);}
.amici-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); margin: 0 0 16px; }
.amici-seg-link { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px; border: var(--border-width) solid transparent; border-radius: var(--r-pill); text-decoration: none; font-weight: 750; font-size: var(--type-label-size); color: var(--muted); transition: background .15s, color .15s; }
.amici-seg-link[aria-current="page"] { background: var(--color-surface); color: var(--color-ink); border-color: var(--color-outline); box-shadow: var(--elevation-1); }
.amici-seg-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--accent); color: var(--color-accent-ink); font-size: var(--type-caption-size); font-weight: 800; }
.amici-body { min-width: 0; }
/* The community feed keeps its actions (new post, notifications, profile); the segment is its title. */
.amici-page .social-top .social-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.amici-page { position: relative; }
.amici-page .social-top { position: absolute; top: 10px; right: 0; margin: 0; padding: 0; border: 0; background: none; justify-content: flex-end; }
.amici-page .grp-page > .app-page-intro:first-child { display: none; }

/* ---------- Tu (#tu): profile, choices and everything that was in «Altro» ---------- */
.tu-profile { padding: 4px 0 6px; }
.tu-plain-head { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.tu-plain-head h1 { font: 650 28px/1.1 var(--display); font-stretch: var(--display-stretch);}
.tu-tastes-box:empty { display: none; }
.tu-tastes { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); text-decoration: none; color: var(--ink); min-width: 0; }
.tu-taste-chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tu-taste { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-deep); font-size: var(--type-caption-size); font-weight: 750; white-space: nowrap; }
:where([data-theme="dark"]) .tu-taste { color: var(--accent); }
.tu-taste.is-more { background: var(--surface-2); color: var(--muted); }
.tu-tastes-edit { flex: none; display: inline-flex; align-items: center; gap: 2px; font-weight: 750; font-size: var(--type-body-s-size); color: var(--muted); }
.tu-tastes-edit .tg-i, .tu-tastes > .tg-i { width: 16px; height: 16px; }
.tu-tastes.is-empty { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.tu-tastes.is-empty > span { flex: 1; min-width: 0; }
.tu-tastes.is-empty strong { display: block; font-size: var(--type-body-size); }
.tu-tastes.is-empty small { color: var(--ink-2); font-size: var(--type-caption-size); }
.tu-tastes.is-empty > .tg-i:first-child { width: 22px; height: 22px; color: var(--accent-deep); }
.tu-count { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-size: var(--type-caption-size); font-weight: 800; }
.app-more-grid > button, .app-more-grid > .tu-account-line { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; text-align: left; color: inherit; }
.app-more-grid > * + * { border-top: 1px solid var(--line); }
.app-more-grid > button:active { background: var(--surface-2); }
.tu-account-line small { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tu-danger strong { color: var(--danger); }
.tu-danger .app-menu-icon { color: var(--danger); }
.tu-page .app-account-card, .tu-page .app-cta-card { margin: 6px 0 18px; }
.tu-subpage .app-back { margin-top: 8px; }
.tu-subpage .app-page-intro { padding-bottom: 12px; }
/* Tu: four tiles */
.tu-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 22px; }
.tu-tile { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 14px; min-height: 118px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); text-decoration: none; color: var(--ink); transition: transform .12s var(--ease), box-shadow .12s; }
.tu-tile:active { transform: translate(3px, 3px); box-shadow: var(--press-shadow); }
.tu-tile-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--ink); }
.tu-tile-icon .tg-i, .tu-tile-icon svg { width: 22px; height: 22px; }
.tu-tile-copy { display: grid; gap: 2px; }
.tu-tile-copy strong { font-size: var(--type-body-l-size); font-weight: 850; }
.tu-tile-copy small { font-size: var(--type-caption-size); color: var(--muted); line-height: 1.3; }
.tu-tile.is-accent { background: var(--accent); color: var(--color-accent-ink); }
.tu-tile.is-accent .tu-tile-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.tu-tile.is-accent small { color: rgba(255, 255, 255, .85); }
.tu-tile .tu-count { position: absolute; top: 12px; right: 12px; }
:where([data-theme="dark"]) .tu-tile.is-accent { color: #121418; } :where([data-theme="dark"]) .tu-tile.is-accent small { color: rgba(18, 20, 24, .8); } :where([data-theme="dark"]) .tu-tile.is-accent .tu-tile-icon { color: #121418; background: rgba(18,20,24,.12); }
/* The section brings its own heading: on this page the title above says it already. */
.tu-subpage .personal-section-heading > :is(h2, .personal-overline) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tg-theme-card .tg-seg { margin: 0 0 var(--space-3); }
.tg-theme-card .tiny { margin: 0 var(--space-1) var(--space-6); }

/* ====== Gestures, map details, cover photos and phone-only features (until 2026-10 in creuza.css) ====== */
/* Flat colour blocks and covers of the app pages (the module ones: web/creuza.css) */
.setup-heading, .auth-hero { background: var(--color-block-blue); color: var(--color-block-blue-text); border: var(--border-width) solid var(--color-outline); box-shadow: var(--elevation-3); }
.home-feature-art { background: var(--color-block-blue); }
.personal-why { background: var(--color-yellow-soft); border: var(--border-width) solid var(--color-outline); }
:where([data-theme="dark"]) .personal-why { color: var(--color-ink); }
.app-place-cover, .place-cover, .trip-cover, .sheet-hero, .fav-thumb { background: var(--cover, var(--color-blue)); }
.iris-avatar, .setup-welcome-mark, .setup-taste-art { background: var(--color-yellow); color: var(--color-block-yellow-text); border: var(--border-width) solid var(--color-outline); box-shadow: none; }

/* Page transitions (web/gestures.js): deeper pages slide in from the right, back from the left, tabs rise */
main.nav-forward { animation: nav-forward .26s var(--ease); }
main.nav-back { animation: nav-back .26s var(--ease); }
main.nav-tab { animation: page-in .22s var(--ease); }
@keyframes nav-forward { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes nav-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main, main.nav-forward, main.nav-back, main.nav-tab { animation: none; } }

/* Pull to refresh */
.ptr { position: fixed; left: 50%; top: calc(var(--header-h) + var(--safe-top) - 44px); z-index: 45; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink); border: 2px solid var(--color-outline); box-shadow: 3px 3px 0 var(--color-shadow); opacity: 0; transform: translateY(var(--pull, 0px)) rotate(var(--turn, 0deg)); transition: opacity .15s; pointer-events: none; }
.ptr.is-visible { opacity: 1; }
.ptr.is-ready { background: var(--gold); color: var(--color-block-yellow-text); }
.ptr.is-loading svg { animation: spin .8s linear infinite; }

/* Long press on the map: «Portami qui» */
.tg-press-popup .leaflet-popup-content-wrapper { border-radius: 999px; border: 2px solid var(--color-outline); box-shadow: 3px 3px 0 var(--color-shadow); padding: 0; background: var(--accent); }
.tg-press-popup .leaflet-popup-content { margin: 0; }
.tg-press-popup .leaflet-popup-tip { background: var(--accent); }
.tg-press-go { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; color: #ffffff; font: 800 var(--type-body-size) var(--font); text-decoration: none; }
:where([data-theme="dark"]) .tg-press-go { color: #121418; }

/* Map: the sheet follows the finger (web/gestures.js); up = list, down = map */
@media (max-width: 959px) {
  .tg-map-sheet { transition: height .26s var(--ease); border-top: 2px solid var(--color-outline); touch-action: pan-y; }
  .tg-map-sheet.is-dragging { transition: none; }
  .tg-map-grabber { display: block; width: 56px; height: 6px; margin: 2px auto 10px; border-radius: 999px; background: var(--ink); opacity: .85; cursor: grab; }
  .tg-map-sheet-head { cursor: grab; }
}

/* Long press on a place: quick actions (web/gestures.js) */
.qa-layer { position: fixed; inset: 0; z-index: var(--layer-overlay); }
.qa-backdrop { position: absolute; inset: 0; background: rgba(29, 31, 36, .45); animation: fade .2s; }
.qa-sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 18px calc(18px + var(--safe-bottom)); border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--surface); color: var(--ink); border-top: 2px solid var(--color-outline); animation: sheet-up .26s var(--ease); display: grid; gap: 12px; max-width: 640px; margin: 0 auto; }
.qa-grab { width: 44px; height: 6px; margin: 0 auto 2px; border-radius: 999px; background: var(--ink); opacity: .85; }
.qa-title { font: 900 var(--type-display-m-size)/1 var(--display); font-stretch: 68%; text-transform: uppercase; }
.qa-actions { display: grid; gap: 8px; }
.qa-item { display: flex; align-items: center; min-height: 50px; padding: 0 16px; border-radius: var(--r-md); border: 2px solid var(--color-outline); background: var(--surface); color: var(--ink); font-weight: 800; font-size: var(--type-body-l-size); text-decoration: none; text-align: left; }
.qa-item.is-go { background: var(--accent); color: var(--color-accent-ink); box-shadow: 3px 3px 0 var(--color-shadow); }
:where([data-theme="dark"]) .qa-item { border-color: var(--color-outline); } :where([data-theme="dark"]) .qa-item.is-go { color: #121418; }

/* Map places enriched with Overture Maps (web/map.js, web/hours.js, docs/OVERTURE.md) */
.tg-map-subchips { margin-top: 2px; padding-top: 0; }
/* the «tipo» chips take a row under the category chips (vistas that show the filters): «Stile e viste» moves down */
.tg-map-page:is([data-vista="tutto"], [data-vista="per-te"]):has(.tg-map-subchips) .tgv-bar { top: calc(var(--safe-top) + 164px); }
@media (min-width: 960px) { .tg-map-page:is([data-vista="tutto"], [data-vista="per-te"]):has(.tg-map-subchips) .tgv-bar { top: 14px; } }
.tg-map-subchip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); border: 2px solid var(--color-outline); font: inherit; font-size: var(--type-caption-size); font-weight: 750; white-space: nowrap; cursor: pointer; }
.tg-map-subchip::after { content: ""; position: absolute; inset: -4px 0; }
.tg-map-subchip small { color: var(--muted); font-size: var(--type-caption-size); font-weight: 650; }
/* selected = ink, like every filter chip (§4.2) */
.tg-map-subchip[aria-pressed="true"] { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); box-shadow: var(--elevation-1); }
.tg-map-subchip[aria-pressed="true"] small { color: inherit; }
.tg-map-subchip:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.tg-map-popup-source { display: block; margin-top: 4px; font-size: var(--type-caption-size); color: var(--muted); }
.tg-place-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-place-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px; border-radius: var(--r-pill); background: var(--gold); color: var(--color-block-yellow-text); border: 2px solid var(--color-outline); font-weight: 850; font-size: var(--type-body-s-size); }
.tg-place-chip.is-kind { background: var(--surface); color: var(--ink); font-weight: 700; }
.tg-place-contacts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tg-place-contacts .button { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.tg-place-call { background: var(--ok); color: var(--color-block-blue-text); }
.tg-place-social { font-size: var(--type-body-s-size); font-weight: 750; color: var(--sea); padding: 6px 2px; }
.tg-place-hours h3 { font-size: var(--type-body-size); margin-bottom: 6px; }
.tg-hours-now { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 9px 12px; border-radius: var(--r-sm); border: 2px solid var(--color-outline); font-weight: 800; }
.tg-hours-now.is-open { background: var(--ok-soft); color: var(--ok); }
.tg-hours-now.is-closed { background: var(--danger-soft); color: var(--danger); }
.tg-hours-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.tg-hours-week summary { cursor: pointer; font-weight: 750; font-size: var(--type-body-s-size); padding: 6px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
.tg-hours-week summary::-webkit-details-marker { display: none; }
.tg-hours-week summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.tg-hours-week[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.tg-hours-week table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: var(--type-body-s-size); }
.tg-hours-week th, .tg-hours-week td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tg-hours-week th { font-weight: 700; white-space: nowrap; }
.tg-hours-week th small { font-weight: 650; color: var(--muted); }
.tg-hours-week td { overflow-wrap: anywhere; }
.tg-hours-week tr.is-today th, .tg-hours-week tr.is-today td { background: var(--gold-soft); font-weight: 850; color: #1d1f24; }
.tg-hours-raw { font-size: var(--type-caption-size); color: var(--muted); overflow-wrap: anywhere; margin-top: 6px; }
.tg-hours-raw code { font-size: var(--type-caption-size); }
.tg-hours-note { font-size: var(--type-caption-size); color: var(--muted); margin-top: 6px; }
.biz-public-data:empty { display: none; }
.biz-public-data { margin-top: 10px; padding: 12px; border-radius: var(--r-sm); background: var(--gold-soft); border: var(--card-border); color: #1d1f24; display: grid; gap: 8px; }
.biz-public-data small { color: #4b4f57; }
.biz-public-data dl { display: grid; gap: 4px; margin: 0; font-size: var(--type-body-s-size); }
.biz-public-data dt { font-weight: 800; display: inline; }
.biz-public-data dd { display: inline; margin: 0 0 0 6px; overflow-wrap: anywhere; }
:where([data-theme="dark"]) .tg-hours-now.is-open { background: color-mix(in srgb, var(--ok) 22%, var(--surface)); color: #9fe0bb; }
:where([data-theme="dark"]) .tg-hours-now.is-closed { background: color-mix(in srgb, var(--danger) 22%, var(--surface)); color: #ffb4a8; }
:where([data-theme="dark"]) .tg-place-call { background: #7fd3a4; color: #10231a; }
:where([data-theme="dark"]) .tg-hours-week tr.is-today th, :where([data-theme="dark"]) .tg-hours-week tr.is-today td { background: var(--gold); color: var(--color-block-yellow-text); }

/* ---- Cover photos of places and activities (web/covers.js, docs/FOTO_COPERTINA.md) ---- */
.sheet-hero .tg-photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.sheet-hero.has-photo .app-place-visual { display: none; }
.sheet-hero.has-photo::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.45)); pointer-events: none; }
.sheet-hero .sheet-hero-meta { z-index: 1; }
.sheet-hero.is-photo-only { background: var(--ink); }
.tg-photo-credit { position: absolute; left: 12px; top: 22px; z-index: 2; max-width: calc(100% - 84px); color: #fff; font-size: var(--type-caption-size); line-height: 1.3; }
.tg-photo-credit summary { list-style: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(10,22,27,.55); font: italic 700 var(--type-body-s-size)/1 Georgia, serif; cursor: pointer; }
.tg-photo-credit summary::-webkit-details-marker { display: none; }
.tg-photo-credit > span { display: block; margin-top: 4px; padding: 4px 8px; border-radius: 8px; background: rgba(10,22,27,.72); }
.tg-photo-credit a { color: inherit; text-decoration: underline; }
.tg-photo-credit .tg-photo-src { text-decoration: none; font-weight: 800; }

/* ---- Phone-only features on the web (web/platform.js, docs/SITO_E_APP.md) ---- */
.tg-apponly { max-width: 640px; margin: var(--space-6) 0; }
.tg-apponly-card { display: grid; gap: 10px; justify-items: start; padding: 24px; border: var(--card-border); border-radius: 22px; background: var(--surface, #fff); box-shadow: var(--card-shadow); }
.tg-apponly-card p { margin: 0; color: var(--muted, #5b5f66); line-height: 1.5; }
.tg-apponly-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--gold, #f7c23b); color: var(--ink, #1d1f24); border: var(--card-border); }
.tg-apponly-icon svg { width: 28px; height: 28px; }
.tg-apponly-qr { display: flex; gap: 16px; align-items: center; margin-top: 6px; }
.tg-apponly-qr .tg-qr { width: 132px; height: 132px; flex: none; border: var(--card-border); border-radius: 12px; }
.tg-apponly-note { font-weight: 600; }
@media (max-width: 1099px) { .tu-tiles > .tu-tile:last-child:nth-child(odd) { grid-column: 1 / -1; } }
