/* ==========================================================================
   Totem San Mauro — interfaccia del totem verticale (1080×1920 / 2160×3840)
   Stile istituzionale coerente con i siti dei Comuni italiani (Designers Italia):
   carattere Titillium Web, blu istituzionale, schede bianche, testata con stemma.
   1rem = 1/54 della larghezza dello schermo: identico su Full HD e 4K.
   ========================================================================== */
@font-face { font-family: 'Titillium Web'; src: url('fonts/titillium-light.woff') format('woff'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Titillium Web'; src: url('fonts/titillium-regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Titillium Web'; src: url('fonts/titillium-semibold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Titillium Web'; src: url('fonts/titillium-bold.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  --accent: #0066cc; --accent2: #004d99;
  --ink: #17324d; --ink2: #33485c; --muted: #5d7083; --line: #d9dadb; --bg: #f2f5f8; --white: #fff;
  --danger: #d9364f; --warn: #f2a900; --warn-ink: #3d2700; --ok: #008758;
  --u: calc(min(100vw, 100vh * 0.5625) / 54);
  --head: 14.8rem;
  --ease: cubic-bezier(.22, .9, .25, 1);
  --font: 'Titillium Web', 'Segoe UI', system-ui, sans-serif;
  --shadow: 0 .2rem .6rem rgba(23, 50, 77, .08), 0 .8rem 2.4rem rgba(23, 50, 77, .10);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--u); background: #000; height: 100%; }
body {
  height: 100%; overflow: hidden; display: grid; place-items: center; background: #000;
  font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: none;
}
body.preview, body.preview * { cursor: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: inherit; text-align: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.ico { width: 1em; height: 1em; flex: none; }

#app {
  position: relative; overflow: hidden; isolation: isolate; background: var(--bg);
  width: min(100vw, 100vh * 0.5625); height: min(100vh, 100vw * 1.7778);
  transition: opacity .8s var(--ease);
}
body.booting #app { opacity: 0; }

/* ---------- Testata istituzionale ---------- */
.pa-header { position: absolute; inset: 0 0 auto 0; z-index: 20; transition: transform .7s var(--ease); }
.pa-header.hide { transform: translateY(-105%); }
.slim {
  height: 4.2rem; padding: 0 3rem; display: flex; align-items: center; justify-content: space-between;
  background: var(--accent2); color: rgba(255,255,255,.9); font-size: 1.2rem; font-weight: 600; letter-spacing: .02em;
}
.slim-right { display: flex; align-items: center; gap: 2rem; }
.slim-date { text-transform: capitalize; font-weight: 400; }
.slim-time { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.weather { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; }
.weather .ico { width: 2rem; height: 2rem; }
.center {
  height: 10.6rem; padding: 0 3rem; display: flex; align-items: center; gap: 2rem;
  background: var(--accent); color: #fff;
}
.brand-logo { height: 8rem; width: 8rem; flex: none; display: grid; place-items: center; }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 .2rem .5rem rgba(0,0,0,.25)); }
.brand-logo.empty { border: .25rem solid rgba(255,255,255,.8); border-radius: 50%; font: 700 3.6rem/1 var(--font); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 3.2rem; line-height: 1.1; font-weight: 700; letter-spacing: -.005em; }
.brand-text span { font-size: 1.5rem; font-weight: 400; opacity: .9; margin-top: .3rem; }

/* ---------- Banda allerte (stile "callout" istituzionale) ---------- */
.alertband {
  position: absolute; left: 0; right: 0; top: var(--head); z-index: 60; width: 100%;
  min-height: 8.4rem; display: flex; align-items: stretch; color: #fff; text-align: left;
  box-shadow: 0 .6rem 1.6rem rgba(0,0,0,.18); transition: top .7s var(--ease); animation: bandIn .7s var(--ease) both;
}
.alertband.at-top { top: 0; }
@keyframes bandIn { from { transform: translateY(-30%); opacity: 0; } }
.alertband.critical { background: var(--danger); }
.alertband.important { background: var(--warn); color: var(--warn-ink); }
.alertband.info { background: var(--accent); }
.band-ico { flex: none; width: 8.4rem; display: grid; place-items: center; background: rgba(0,0,0,.14); }
.band-ico .ico { width: 3.6rem; height: 3.6rem; }
.alertband.critical .band-ico .ico { animation: beat 1.8s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.14); } }
.band-body { flex: 1; min-width: 0; padding: 1.2rem 2rem; display: flex; flex-direction: column; justify-content: center; }
.band-kicker { font-size: 1.1rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; opacity: .9; }
.band-title { font-size: 2.2rem; line-height: 1.15; font-weight: 700; margin-top: .1rem; }
.band-text { font-size: 1.4rem; line-height: 1.35; margin-top: .2rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; opacity: .95; }
.band-more { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: 0 2.2rem; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; border-left: 1px solid rgba(255,255,255,.3); }
.alertband.important .band-more { border-left-color: rgba(61,39,0,.25); }
.band-more .ico { width: 2.6rem; height: 2.6rem; }
.band-count { font-size: 1.1rem; opacity: .85; }
.band-swap { animation: swapIn .6s var(--ease) both; }
@keyframes swapIn { from { opacity: 0; transform: translateY(30%); } }

/* ---------- Viste ---------- */
.view { position: absolute; inset: 0; }
.view.enter { animation: viewIn .6s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; } }

/* ---------- HOME ---------- */
.home { display: flex; flex-direction: column; padding-top: var(--head); background: var(--bg); }
body.has-band .home { padding-top: calc(var(--head) + 8.4rem); }
.hero { position: relative; flex: none; height: 16rem; overflow: hidden; background: var(--accent2); }
body.has-band .hero { height: 12.5rem; }
.hero-photo { position: absolute; inset: 0; background-size: cover; background-position: center 40%; opacity: 0; transition: opacity 1.4s var(--ease); }
.hero-photo.on { opacity: 1; animation: slowzoom 40s ease-in-out infinite alternate; }
@keyframes slowzoom { from { transform: scale(1.02); } to { transform: scale(1.1); } }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, color-mix(in srgb, var(--accent2) 92%, transparent) 0%, color-mix(in srgb, var(--accent2) 45%, transparent) 55%, color-mix(in srgb, var(--accent2) 15%, transparent) 100%); }
.hero-text { position: absolute; left: 3rem; right: 3rem; bottom: 2.2rem; z-index: 1; color: #fff; }
.greet { font-size: 1.3rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .92; }
.hero h1 { font-size: 4.4rem; line-height: 1.05; font-weight: 700; margin-top: .3rem; }
body.has-band .hero h1 { font-size: 3.6rem; }

.block { padding: 2.6rem 3rem 0; }
.sec-title { position: relative; font-size: 2.2rem; font-weight: 700; color: var(--ink); padding-bottom: 1rem; margin-bottom: 1.8rem; }
.sec-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 5rem; height: .35rem; background: var(--accent); }
.block-sites { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.tiles { flex: 1; min-height: 0; display: grid; gap: 1.8rem; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(13rem, 1fr); align-content: stretch; overflow-y: auto; scrollbar-width: none; padding: .4rem; margin: -.4rem; }
.tiles::-webkit-scrollbar { display: none; }
.tile {
  --c: var(--accent);
  position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 0;
  background: var(--white); border-radius: .8rem; box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s; animation: tileIn .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms + 100ms);
}
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: .7rem; background: var(--c); z-index: 2; }
@keyframes tileIn { from { opacity: 0; transform: translateY(2rem); } }
.tile:active, .tile.pressed { transform: scale(.975); box-shadow: 0 .1rem .4rem rgba(23,50,77,.12); }
.tile-img { flex: 1 1 45%; min-height: 0; background-size: cover; background-position: center; }
.tile-body { flex: 1 1 auto; display: flex; flex-direction: column; padding: 2rem 2.2rem 1.8rem 2.8rem; min-height: 0; }
.tile-top { display: flex; align-items: center; gap: 1.6rem; }
.tile-logo { width: 6rem; height: 6rem; flex: none; border-radius: .6rem; border: 1px solid var(--line); background: #fff; padding: .5rem; display: grid; place-items: center; }
.tile-logo img { width: 100%; height: 100%; object-fit: contain; }
.tile-logo.empty { border: 0; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.tile-logo.empty .ico { width: 3rem; height: 3rem; }
.tile-name { font-size: 2.5rem; line-height: 1.12; font-weight: 700; color: var(--ink); }
.tile-sub { font-size: 1.4rem; line-height: 1.35; color: var(--muted); margin-top: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-go { margin-top: auto; padding-top: 1rem; display: flex; align-items: center; gap: .8rem; font-size: 1.25rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tile-go .ico { width: 2rem; height: 2rem; transition: transform .3s; }
.tile.pressed .tile-go .ico { transform: translateX(.6rem); }

/* layout in base al numero di siti */
.tiles.n2 { grid-template-columns: 1fr; }
.tiles.n3 { grid-template-rows: 1.15fr 1fr; }
.tiles.n3 .tile:first-child, .tiles.odd .tile:first-child { grid-column: 1 / -1; flex-direction: row; }
.tiles.n3 .tile:first-child .tile-img, .tiles.odd .tile:first-child .tile-img { flex: 0 0 40%; }
.tiles.n3 .tile:first-child .tile-name, .tiles.n2 .tile-name { font-size: 3rem; }
.tiles.n3 .tile:not(:first-child) .tile-top, .tiles.n4 .tile-top, .tiles.many .tile-top { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
.tiles.n3 .tile:not(:first-child) .tile-name, .tiles.n4 .tile-name { font-size: 2.3rem; }
.tiles.n3 .tile:not(:first-child) .tile-logo, .tiles.n4 .tile-logo { width: 5.2rem; height: 5.2rem; }
.tiles.n3 .tile:not(:first-child) .tile-sub, .tiles.n4 .tile-sub { -webkit-line-clamp: 1; font-size: 1.3rem; }
.tiles.n3 .tile:not(:first-child) .tile-img, .tiles.n4 .tile-img { flex-basis: 30%; }
.tiles.many { grid-auto-rows: 17rem; align-content: start; -webkit-mask-image: linear-gradient(#000 85%, transparent); mask-image: linear-gradient(#000 85%, transparent); padding-bottom: 5rem; }
.tiles.many .tile-img { display: none; }
.tiles.many .tile-name { font-size: 2.1rem; }
.tiles.many .tile-logo { width: 4.6rem; height: 4.6rem; }
.tiles.many .tile-sub { display: none; }
.tiles .empty-state { grid-column: 1 / -1; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 1.6rem; border: 2px dashed var(--line); border-radius: .8rem; }

/* ---------- Avvisi ed eventi ---------- */
.news { flex: none; padding-top: 2.4rem; }
.news-head { display: flex; align-items: flex-start; justify-content: space-between; }
.news-dots { display: flex; gap: .6rem; padding-top: 1.2rem; }
.news-dots i { width: 1rem; height: 1rem; border-radius: 99rem; background: #c5cdd6; transition: width .4s var(--ease), background .4s; }
.news-dots i.on { width: 3rem; background: var(--accent); }
.news-track { position: relative; height: 15rem; }
.ncard {
  position: absolute; inset: 0; display: flex; gap: 2rem; align-items: stretch; padding: 1.8rem 2rem 1.8rem 2.6rem;
  background: var(--white); border-radius: .8rem; box-shadow: var(--shadow); overflow: hidden; text-align: left; width: 100%;
  opacity: 0; transform: translateX(6%); transition: opacity .6s var(--ease), transform .6s var(--ease); pointer-events: none;
}
.ncard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: .7rem; background: var(--accent); }
.ncard.critical::before { background: var(--danger); } .ncard.important::before { background: var(--warn); }
.ncard.on { opacity: 1; transform: none; pointer-events: auto; }
.ncard.out { opacity: 0; transform: translateX(-6%); }
.ncard-img { width: 11.4rem; flex: none; border-radius: .6rem; background-size: cover; background-position: center; }
.ncard-ico { width: 6.4rem; height: 6.4rem; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 10%, #fff); color: var(--accent); align-self: center; }
.ncard-ico .ico { width: 3.2rem; height: 3.2rem; }
.ncard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.ncard-when { display: flex; align-items: center; gap: .8rem; font-size: 1.1rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.ncard-title { font-size: 2.1rem; line-height: 1.15; font-weight: 700; color: var(--ink); margin-top: .4rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ncard-text { font-size: 1.35rem; line-height: 1.4; color: var(--muted); margin-top: .4rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ncard-more { margin-top: .6rem; font-size: 1.1rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: .5rem; }
.ncard-more .ico { width: 1.6rem; height: 1.6rem; }
.qr { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; }
.qr-box { width: 9.6rem; height: 9.6rem; background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: .7rem; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr small { font-size: 1rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }

/* ---------- Piè di pagina ---------- */
.pa-footer { flex: none; margin-top: 2.4rem; height: 7.2rem; padding: 0 3rem; display: flex; align-items: center; justify-content: space-between; background: var(--accent2); color: #fff; }
.foot-brand { display: flex; align-items: center; gap: 1.2rem; font-size: 1.4rem; font-weight: 600; min-width: 0; }
.foot-brand span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-logo { width: 4.2rem; height: 4.2rem; flex: none; display: grid; place-items: center; }
.foot-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.foot-logo:empty { display: none; }
.foot-hint { display: flex; align-items: center; gap: .8rem; font-size: 1.25rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .92; white-space: nowrap; }
.foot-hint .ico { width: 2.2rem; height: 2.2rem; animation: tap 2.4s ease-in-out infinite; }
@keyframes tap { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-.4rem); } }

/* ---------- Sito in cornice ---------- */
.site { background: #fff; display: flex; flex-direction: column; }
body.has-band .site { padding-top: 8.4rem; }
.frame-wrap { position: relative; flex: 1; }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.frame-loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 2rem; justify-items: center; background: var(--bg); color: var(--muted); font-size: 1.5rem; transition: opacity .5s; }
.frame-loading.done { opacity: 0; pointer-events: none; }
.spinner { width: 6rem; height: 6rem; border-radius: 50%; border: .5rem solid #d6dde5; border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dock { flex: none; height: 9rem; display: flex; align-items: center; gap: 1.4rem; padding: 0 2rem; background: var(--accent2); color: #fff; }
.dock-btn { height: 6.2rem; min-width: 6.2rem; border-radius: .6rem; display: flex; align-items: center; justify-content: center; gap: .8rem; padding: 0 1.8rem; border: 2px solid rgba(255,255,255,.7); font-size: 1.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; transition: transform .2s; }
.dock-btn:active { transform: scale(.95); }
.dock-btn .ico { width: 2.6rem; height: 2.6rem; }
.dock-btn.dock-home { background: #fff; color: var(--accent2); border-color: #fff; padding: 0 2.6rem; }
.dock-title { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 1rem; font-size: 1.5rem; font-weight: 600; }
.dock-title span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-logo { width: 3.8rem; height: 3.8rem; border-radius: .4rem; background: #fff; padding: .35rem; flex: none; }
.dock-logo:empty { display: none; }
.dock-logo img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Screensaver ---------- */
.saver { background: #000; z-index: 30; }
.slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s var(--ease); overflow: hidden; }
.slide.on { opacity: 1; }
.slide img, .slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide.contain img, .slide.contain video { object-fit: contain; }
.slide.contain::before { content: ''; position: absolute; inset: -10%; background: var(--blur) center/cover; filter: blur(4rem) brightness(.5); }
.slide.kb img { animation: kenburns var(--d, 12s) linear both; transform-origin: var(--ox, 50%) var(--oy, 50%); }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.12); } }
.saver-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, transparent 20%, transparent 62%, rgba(0,0,0,.55) 100%); }
.saver-top { position: absolute; top: 3.6rem; left: 3.4rem; right: 3.4rem; display: flex; justify-content: space-between; align-items: flex-start; color: #fff; text-shadow: 0 .2rem 1.2rem rgba(0,0,0,.45); }
body.has-band .saver-top { top: 12rem; }
.saver-clock span { display: block; font-size: 8.6rem; line-height: .95; font-weight: 300; font-variant-numeric: tabular-nums; }
.saver-clock small { display: block; font-size: 1.6rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-top: .8rem; }
.saver-weather { display: flex; align-items: center; gap: 1rem; font-size: 3.2rem; font-weight: 300; }
.saver-weather .ico { width: 4.4rem; height: 4.4rem; }
.saver-alert { position: absolute; left: 3rem; right: 3rem; bottom: 11.6rem; }
.salert { position: relative; display: flex; gap: 1.8rem; align-items: center; padding: 2rem 2rem 2rem 2.6rem; border-radius: .8rem; background: #fff; overflow: hidden; box-shadow: 0 1rem 3rem rgba(0,0,0,.3); animation: salertIn .8s var(--ease) both; width: 100%; text-align: left; }
.salert::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: .7rem; background: var(--accent); }
@keyframes salertIn { from { opacity: 0; transform: translateY(2rem); } }
.salert.out { animation: salertOut .6s var(--ease) both; }
@keyframes salertOut { to { opacity: 0; transform: translateY(-1.5rem); } }
.salert .ncard-img { width: 10rem; height: 10rem; }
.salert .ncard-title { font-size: 2.3rem; }
.saver-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 9.4rem; padding: 0 3rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; background: color-mix(in srgb, var(--accent2) 94%, transparent); color: #fff; }
.saver-hint { display: flex; align-items: center; gap: 1.2rem; padding: 1.1rem 2.2rem 1.1rem 1.1rem; border-radius: 99rem; background: #fff; color: var(--accent2); font-size: 1.45rem; font-weight: 700; white-space: nowrap; animation: hintFloat 3.4s ease-in-out infinite; }
@keyframes hintFloat { 50% { transform: translateY(-.4rem); } }
.saver-hint .pulse { position: relative; width: 4rem; height: 4rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.saver-hint .pulse .ico { width: 2.2rem; height: 2.2rem; }
.saver-hint .pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: rings 2.2s ease-out infinite; }
@keyframes rings { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
.saver-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 3rem; text-align: center; color: #fff; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.saver-empty .big-logo { width: 24rem; height: 24rem; animation: breathe 6s ease-in-out infinite; }
.saver-empty .big-logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1rem 2rem rgba(0,0,0,.3)); }
.saver-empty h2 { font-size: 4.4rem; line-height: 1.1; font-weight: 700; max-width: 44rem; }
@keyframes breathe { 50% { transform: scale(1.04); } }

/* ---------- Notte ---------- */
.night { background: #000; z-index: 40; }
.night-clock { position: absolute; font-size: 5rem; font-weight: 300; color: rgba(255,255,255,.22); font-variant-numeric: tabular-nums; transition: left 3s, top 3s; }

/* ---------- Avviso a schermo intero ---------- */
.alertfs { position: absolute; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--bg); animation: fsIn .6s var(--ease) both; }
@keyframes fsIn { from { opacity: 0; transform: translateY(3%); } }
.alertfs.out { animation: fsOut .5s var(--ease) both; }
@keyframes fsOut { to { opacity: 0; } }
.fs-head { position: relative; flex: none; padding: 4.4rem 3.6rem 4rem; color: #fff; background: var(--accent); }
.alertfs.critical .fs-head { background: var(--danger); }
.alertfs.important .fs-head { background: var(--warn); color: var(--warn-ink); }
.fs-top { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.fs-kicker { display: flex; align-items: center; gap: 1.4rem; font-size: 1.6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.fs-kicker .fs-ico { width: 7rem; height: 7rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.alertfs.important .fs-kicker .fs-ico { background: rgba(61,39,0,.12); }
.fs-kicker .ico { width: 4rem; height: 4rem; }
.alertfs.critical .fs-kicker .ico { animation: beat 1.8s ease-in-out infinite; }
.fs-close { width: 7rem; height: 7rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid currentColor; opacity: .9; }
.fs-close .ico { width: 3.2rem; height: 3.2rem; }
.fs-title { font-size: 5rem; line-height: 1.06; font-weight: 700; margin-top: 3rem; }
.fs-when { font-size: 1.7rem; font-weight: 600; margin-top: 1.4rem; opacity: .92; }
.fs-progress { position: absolute; left: 0; bottom: 0; height: .6rem; background: rgba(255,255,255,.6); width: 100%; transform-origin: left; }
.alertfs.important .fs-progress { background: rgba(61,39,0,.35); }
.fs-body { flex: 1; min-height: 0; overflow-y: auto; padding: 3.6rem; display: flex; flex-direction: column; gap: 3rem; scrollbar-width: none; }
.fs-body::-webkit-scrollbar { display: none; }
.fs-img { width: 100%; max-height: 38rem; object-fit: cover; border-radius: .8rem; box-shadow: var(--shadow); }
.fs-text { font-size: 2.4rem; line-height: 1.5; color: var(--ink); white-space: pre-line; }
.fs-qr { display: flex; align-items: center; gap: 2.4rem; padding: 2.4rem; background: #fff; border-radius: .8rem; box-shadow: var(--shadow); }
.fs-qr .qr-box { width: 16rem; height: 16rem; padding: 1rem; }
.fs-qr p { font-size: 1.9rem; line-height: 1.35; font-weight: 600; color: var(--ink); }
.fs-qr small { display: block; font-size: 1.3rem; color: var(--muted); margin-top: .6rem; font-weight: 400; word-break: break-all; }
.fs-foot { flex: none; height: 11rem; padding: 0 3.6rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; background: var(--accent2); color: #fff; }
.fs-back { height: 7rem; padding: 0 3.4rem; border-radius: .6rem; background: #fff; color: var(--accent2); font-size: 1.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 1rem; }
.fs-back .ico { width: 2.6rem; height: 2.6rem; }
.fs-counter { font-size: 1.3rem; opacity: .8; margin-left: 1rem; }

/* ---------- Stai ancora navigando? ---------- */
.still { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(23,50,77,.55); animation: fade .3s both; }
@keyframes fade { from { opacity: 0; } }
.still-card { position: relative; width: 44rem; padding: 4rem 3rem 3rem; border-radius: .8rem; text-align: center; background: #fff; box-shadow: 0 2rem 6rem rgba(0,0,0,.35); border-top: .7rem solid var(--accent); animation: pop .4s var(--ease) both; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.ring { width: 12rem; height: 12rem; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: #e3e8ee; stroke-width: 7; }
.ring .prog { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.still-num { position: absolute; top: 4rem; left: 50%; transform: translateX(-50%); width: 12rem; height: 12rem; display: grid; place-items: center; font-size: 4.4rem; font-weight: 300; color: var(--ink); }
.still-card h3 { font-size: 2.8rem; font-weight: 700; margin-top: 2rem; color: var(--ink); }
.still-card p { color: var(--muted); font-size: 1.5rem; margin-top: .6rem; }
.still-actions { display: flex; gap: 1.2rem; margin-top: 2.6rem; }
.btn-pill { flex: 1; height: 6.2rem; border-radius: .6rem; background: var(--accent); color: #fff; font-size: 1.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: center; transition: transform .2s; }
.btn-pill.ghost { background: #fff; color: var(--accent); border: 2px solid var(--accent); }
.btn-pill:active { transform: scale(.96); }

/* ---------- Tocco ---------- */
.ripple-layer { position: absolute; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.ripple { position: absolute; width: 9rem; height: 9rem; margin: -4.5rem 0 0 -4.5rem; border-radius: 50%; background: color-mix(in srgb, var(--accent) 25%, transparent); animation: ripple .6s var(--ease) forwards; }
@keyframes ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.offline { position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 95; font-size: 1.1rem; padding: .5rem 1.4rem; border-radius: 99rem; background: var(--danger); color: #fff; }

/* ---------- Spazi calibrati per lasciare più posto ai riquadri ---------- */
.center { height: auto; min-height: 10.6rem; padding-top: 1.4rem; padding-bottom: 1.4rem; }
.brand-text strong { font-size: 2.9rem; }
.sec-title { font-size: 1.9rem; padding-bottom: .8rem; margin-bottom: 1.4rem; }
.block { padding-top: 2.2rem; }
.news { padding-top: 2rem; }
.news-track { height: 12.6rem; }
.ncard { padding-top: 1.4rem; padding-bottom: 1.4rem; }
.ncard-img { width: 9.6rem; }
.qr-box { width: 8.6rem; height: 8.6rem; }
.pa-footer { margin-top: 1.8rem; height: 6.4rem; }
.hero { height: 14rem; }
body.has-band .hero { height: 9rem; }
body.has-band .greet { display: none; }
body.has-band .hero-text { bottom: 1.6rem; }
body.has-band .hero h1 { font-size: 3.2rem; }
.tiles.n3 .tile:not(:first-child) .tile-top, .tiles.n4 .tile-top { flex-direction: row; align-items: center; gap: 1.2rem; }
.tiles.n3 .tile:not(:first-child) .tile-logo, .tiles.n4 .tile-logo { width: 4.6rem; height: 4.6rem; }
.tiles.n3 .tile:not(:first-child) .tile-name, .tiles.n4 .tile-name { font-size: 2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tiles.n3 .tile:not(:first-child) .tile-body, .tiles.n4 .tile-body { padding: 1.6rem 1.8rem 1.4rem 2.4rem; }
.tiles.n3 .tile:first-child .tile-body { padding-top: 2.2rem; }
.tiles.n3 .tile:not(:first-child) .tile-img, .tiles.n4 .tile-img { display: none; }
.ncard-text { -webkit-line-clamp: 1; }
.pa-footer .foot-brand { font-size: 1.3rem; flex: 1; }
.foot-hint { font-size: 1.1rem; }
.tiles.n3 .tile:not(:first-child) .tile-sub { display: none; }
