/* Ufficio Giallo V7: interfaccia nello stile di giallostudio.it (Satoshi, nero/bianco/giallo).
   Il tema segue la luce dell'ufficio (ora di Roma): data-theme="day" | "night" su <html>. */
@font-face {
  font-family: Satoshi;
  src: url("./fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0e0e0e;
  --paper: #ffffff;
  --giallo: #f5f505;
  --muted: rgba(14, 14, 14, .62);
  --line: rgba(14, 14, 14, .16);
  --scene: #ededed;
  --glass: rgba(255, 255, 255, .58);
  --glass-line: rgba(255, 255, 255, .78);
  --shadow: rgba(22, 27, 34, .14);
  --live: #1f9a4a;
  --stop: #d93a2b;
  --header-h: 80px;
  --gutter: clamp(1.5rem, 5vw, 5.5rem);
  --font: Satoshi, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="night"] {
  --ink: #f7f7ef;
  --paper: #0d1119;
  --muted: rgba(247, 247, 239, .68);
  --line: rgba(247, 247, 239, .24);
  --scene: #111a28;
  --glass: rgba(17, 23, 35, .6);
  --glass-line: rgba(255, 255, 255, .14);
  --shadow: rgba(0, 0, 0, .42);
  --live: #5fd38a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, main { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--scene);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  transition: background-color .6s ease;
}
button { font: inherit; color: inherit; border: 0; background: transparent; cursor: pointer; padding: 0; }
button:disabled { cursor: wait; opacity: .45; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; }
.overline { font-size: .75rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; margin: 0; }
.wrap { width: 100%; margin-inline: auto; max-width: 88rem; padding-inline: var(--gutter); }

#viewport { position: relative; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none !important; }

/* --- Header del sito: trasparente, colore dal tema --------------------------------------------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 70; color: var(--ink); transition: color .4s ease; }
.site-header-row { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.logo { display: inline-flex; color: inherit; }
.logo-svg { height: 40px; width: auto; display: block; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.cta {
  display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; padding: .75rem 1.5rem;
  font-size: .875rem; font-weight: 500; background: var(--ink); color: var(--paper);
  transition: background-color .3s ease, color .3s ease;
}
.cta:hover { background: var(--giallo); color: #000; }
.cta .icon { width: 1rem; height: 1rem; transition: transform .3s ease; }
.cta:hover .icon { transform: translate(2px, -2px); }
.lang-switch { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: .25rem; font-size: .875rem; font-weight: 500; color: inherit; text-underline-offset: 4px; }
.lang-switch:hover { text-decoration: underline; }
html.menu-open .lang-switch { color: #f7f7ef; }
.menu-toggle { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 500; }
.menu-toggle .icon { width: 1.5rem; height: 1.5rem; transition: transform .3s ease; }
.menu-toggle:hover .icon-menu { transform: scale(1.1); }
.menu-toggle .icon-close, html.menu-open .menu-toggle .icon-menu { display: none; }
html.menu-open .menu-toggle .icon-close { display: block; }
html.menu-open .site-header { color: #f7f7ef; }
html.menu-open .cta { display: none; }

.site-menu {
  position: fixed; inset: 0; z-index: 65; height: 100dvh; background: #0e0e0e; color: #f7f7ef;
  transform-origin: top; animation: menu-in .42s cubic-bezier(.76, 0, .24, 1) both;
}
.site-menu-inner { height: 100%; display: flex; flex-direction: column; padding-top: 8rem; padding-bottom: max(2.5rem, env(safe-area-inset-bottom)); }
.site-menu-grid { display: grid; gap: 2.5rem; align-content: start; overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1; }
.menu-primary, .menu-explore { list-style: none; margin: 0; padding: 0; }
.menu-primary li { overflow: hidden; }
.menu-primary a { display: flex; align-items: center; gap: 1rem; padding-block: .25rem; animation: line-up .7s cubic-bezier(.76, 0, .24, 1) both; }
.menu-primary li:nth-child(2) a { animation-delay: .06s; } .menu-primary li:nth-child(3) a { animation-delay: .12s; }
.menu-primary li:nth-child(4) a { animation-delay: .18s; } .menu-primary li:nth-child(5) a { animation-delay: .24s; }
.menu-primary li:nth-child(6) a { animation-delay: .3s; } .menu-primary li:nth-child(7) a { animation-delay: .36s; }
.menu-primary li:nth-child(8) a { animation-delay: .42s; } .menu-primary li:nth-child(9) a { animation-delay: .48s; }
.menu-index { font-size: .875rem; color: var(--giallo); }
.menu-label { font-size: clamp(2rem, min(8vw, calc(10.2svh - 34px)), 6.25rem); font-weight: 600; letter-spacing: -.03em; line-height: .95; transition: color .3s ease; }
.menu-primary .icon { width: 2rem; height: 2rem; opacity: 0; transform: translateX(-1rem); transition: opacity .3s ease, transform .3s ease; }
.menu-primary a:hover .menu-label, .menu-primary a[aria-current="page"] .menu-label { color: var(--giallo); }
.menu-primary a:hover .icon { opacity: 1; transform: none; }
.menu-side { display: flex; flex-direction: column; justify-content: center; gap: 2.5rem; }
.menu-side .overline { color: rgba(247, 247, 239, .4); }
.menu-explore { margin-top: 1rem; display: grid; gap: .5rem; }
.menu-explore a { color: rgba(247, 247, 239, .7); transition: color .3s ease; }
.menu-explore a:hover { color: var(--giallo); }
.menu-contacts { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.menu-contacts li { list-style: none; margin: 0; padding: 0; }
.menu-contacts a { display: inline-flex; width: 3rem; height: 3rem; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid rgba(247, 247, 239, .25); color: #f7f7ef; transition: background-color .3s ease, border-color .3s ease, color .3s ease; }
.menu-contacts a:hover { background: var(--giallo); border-color: var(--giallo); color: #111; }
.menu-contacts a:focus-visible { outline: 2px solid var(--giallo); outline-offset: 2px; }
@media (min-width: 1024px) { .site-menu-grid { grid-template-columns: 1.5fr 1fr; align-content: safe center; } }

/* --- Titolo e orologio ----------------------------------------------------------------------- */
.intro {
  position: absolute; inset: var(--header-h) 0 auto; padding-top: clamp(.5rem, 2.2vh, 1.75rem);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; pointer-events: none; z-index: 5;
}
.intro h1 {
  margin: 0; font-weight: 600; letter-spacing: -.035em; line-height: .96; text-wrap: balance;
  font-size: clamp(2.3rem, 4.9vw, 5.4rem); max-width: 12ch;
}
#subtitle { margin: 1rem 0 0; max-width: 34ch; font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.4; color: var(--muted); font-weight: 500; }
.clock-block { text-align: right; flex: none; }
.clock { margin: 0; font-weight: 600; font-size: clamp(2.4rem, 5.4vw, 5.6rem); letter-spacing: -.045em; line-height: .9; font-variant-numeric: tabular-nums; }
.scene-status {
  margin: .9rem 0 0 auto; font: inherit; font-size: .8125rem; font-weight: 500; color: var(--muted); max-width: 42ch; text-align: right;
  display: flex; align-items: baseline; justify-content: flex-end; gap: .35rem; padding: .2rem 0; background: none; border: 0;
  cursor: pointer; pointer-events: auto; transition: color .25s ease;
}
.scene-status::before { content: ""; flex: none; align-self: flex-start; margin-top: .42em; width: .5rem; height: .5rem; margin-right: .15rem; border-radius: 50%; background: currentColor; opacity: .5; }
.scene-status[data-live="diretta"]::before { background: var(--live); opacity: 1; box-shadow: 0 0 0 0 var(--live); animation: live-dot 2.4s ease-out infinite; }
.scene-status:hover, .scene-status[aria-expanded="true"] { color: var(--ink); }
.scene-status #status { white-space: pre-line; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25em; }
.scene-status .icon-chevron { flex: none; align-self: flex-start; margin-top: .1em; width: .9rem; height: .9rem; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.scene-status[aria-expanded="true"] .icon-chevron { transform: rotate(180deg); }
.scene-status:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* Elenco di chi lavora: si apre dalla riga in diretta (clic, o passaggio del mouse) e porta alle schede. */
.crew {
  position: absolute; right: 0; top: 100%; margin-top: .6rem; width: min(19rem, calc(100vw - 2 * var(--gutter))); text-align: left;
  padding: 1.1rem 1.2rem 1rem; border-radius: 20px; color: var(--ink); pointer-events: auto; z-index: 31;
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: 0 24px 64px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  animation: card-in .32s cubic-bezier(.2, .8, .2, 1) both;
}
.clock-block { position: relative; pointer-events: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.crew-title { color: var(--muted); }
.crew-group { margin: .9rem 0 .35rem; display: flex; align-items: center; gap: .45rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
.crew-group::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); }
.crew-group[data-mode="lavoro"]::before { background: var(--giallo); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.crew-group[data-mode="fatto"]::before { background: var(--live); }
.crew ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.crew-name {
  width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; padding: .3rem 0; font: inherit;
  font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; color: inherit; background: none; border: 0; text-align: left; cursor: pointer;
}
.crew-name:hover span:first-child { text-decoration: underline; text-decoration-color: var(--giallo); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.crew-name:disabled { cursor: default; }
.crew-name:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.crew-model { flex: none; font-size: .75rem; font-weight: 500; color: var(--muted); }
.crew-empty { margin: .7rem 0 0; font-size: .875rem; line-height: 1.45; font-weight: 500; }
.crew-hint { margin: .8rem 0 0; padding-top: .7rem; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }

/* --- Fumetti a evento (V8.1): inizio e fine di un compito, ~4 s, al massimo 2 --------------------- */
.bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.bubble { position: absolute; left: 0; top: 0; will-change: transform; pointer-events: none; cursor: pointer; }
.bubble-body {
  display: block; position: relative; pointer-events: auto; transform: translate(calc(-50% + var(--dx, 0px)), calc(-100% - 12px)); transform-origin: 50% 100%;
  background: #fff; color: #0e0e0e; border-radius: 14px; padding: .4rem .7rem .45rem; max-width: 13.5rem; width: max-content;
  font-size: .78rem; line-height: 1.28; box-shadow: 0 10px 28px rgba(16, 20, 28, .16); animation: bubble-in .35s cubic-bezier(.2, .9, .3, 1.2) backwards;
}
.bubble-body::after { content: ""; position: absolute; left: clamp(14px, calc(50% - var(--dx, 0px)), calc(100% - 14px)); bottom: -6px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.bubble strong { font-weight: 700; }
.bubble strong::after { content: ":"; }
.bubble[data-mode="fatto"] .bubble-body { color: rgba(14, 14, 14, .72); }
.bubble.is-leaving .bubble-body { opacity: 0; transition: opacity .35s ease; }
/* V8.2: battuta di chi chiacchiera in pausa: più piccola e leggera dei fumetti a evento, visibile anche sul telefono. */
.bubble[data-mode="chat"] .bubble-body > .bubble-chat { display: inline; }
.bubble[data-mode="chat"] .bubble-body { font-size: .74rem; font-weight: 500; padding: .3rem .62rem .34rem; color: rgba(14, 14, 14, .82); box-shadow: 0 6px 18px rgba(16, 20, 28, .12); }
.bubble[data-mode="lavoro"] strong::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--giallo); box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); margin-right: .35rem; vertical-align: .05em; }

/* --- Passaggi veri: etichetta del contenuto sopra l'icona 3D in volo -------------------------------- */
.handoff-chip {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap;
  background: var(--giallo); color: #0e0e0e; font-size: .75rem; font-weight: 700; letter-spacing: .01em;
  padding: .28rem .6rem .3rem; border-radius: 999px; box-shadow: 0 6px 18px rgba(16, 20, 28, .18);
}
.handoff-chip::before { content: "→ "; }

/* --- Scheda in vetro ------------------------------------------------------------------------- */
.agent-card {
  position: absolute; z-index: 30; right: var(--gutter); top: calc(var(--header-h) + clamp(9rem, 22vh, 13rem)); width: min(23rem, calc(100% - 2rem));
  padding: 1.6rem 1.6rem 1.4rem; border-radius: 24px; color: var(--ink);
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: 0 24px 64px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  animation: card-in .4s cubic-bezier(.2, .8, .2, 1) both;
}
.card-close { position: absolute; top: 1rem; right: 1rem; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; transition: background-color .25s ease, color .25s ease; }
.card-close:hover { background: var(--ink); color: var(--paper); }
.card-department { color: var(--muted); }
.agent-card h2 { margin: .6rem 2.5rem 0 0; font-size: clamp(1.6rem, 2.2vw, 2.1rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; text-wrap: balance; }
.card-state { margin: .9rem 0 0; display: flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 600; }
.card-state::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--muted); flex: none; }
.card-state[data-mode="lavoro"]::before { background: var(--giallo); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.card-state[data-mode="fatto"]::before { background: var(--live); }
.card-state[data-mode="blocco"]::before { background: var(--stop); }
.card-task { margin: .9rem 0 0; font-size: .9375rem; line-height: 1.5; }
.card-facts { margin: 1.2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); display: grid; gap: .55rem; font-size: .8125rem; }
.card-facts div { display: grid; grid-template-columns: 5.5rem 1fr; gap: .75rem; }
.card-facts dt { color: var(--muted); }
.card-facts dd { margin: 0; font-weight: 500; }
.engine { display: inline-flex; align-items: center; gap: .35rem; margin-right: .7rem; white-space: nowrap; }

/* --- Barra in basso: legenda, didascalia, controlli -------------------------------------------- */
.bottom-bar {
  position: absolute; inset: auto 0 0; padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); z-index: 6;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; pointer-events: none;
}
.bottom-bar > * { pointer-events: auto; }
.caption { margin: 0; font-size: .8125rem; font-weight: 500; color: var(--muted); max-width: 22ch; }
.controls { display: flex; align-items: center; gap: .5rem; }
.hint { margin: 0 .75rem 0 0; font-size: .8125rem; font-weight: 500; color: var(--muted); }
.hint-touch { display: none; }
.round {
  width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
  border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 62%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.round:hover:not(:disabled) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.round .icon-sound-off, .round[aria-pressed="false"] .icon-sound-on { display: none; }
.round[aria-pressed="false"] .icon-sound-off { display: block; }

/* --- Reparti (V9): elenco a sinistra sul computer, striscia che scorre sul telefono ------------------- */
.room-bar {
  position: absolute; z-index: 6; left: max(1.75rem, calc(env(safe-area-inset-left) + 1.25rem)); bottom: calc(max(1.5rem, env(safe-area-inset-bottom)) + 3.6rem);
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
}
.room-chip {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 1.75rem; padding: .1rem .55rem .1rem .1rem; border-radius: 999px;
  font-size: .8125rem; font-weight: 500; color: var(--muted); transition: color .25s ease, background-color .25s ease;
}
.room-chip:hover, .room-chip[aria-pressed="true"] { color: var(--ink); }
.room-chip[aria-pressed="true"] .room-name { text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1.5px; }
.room-dot { width: .5rem; height: .5rem; border-radius: 50%; flex: none; border: 1px solid var(--line); background: transparent; transition: background-color .3s ease, border-color .3s ease; }
.room-chip[data-busy="true"] .room-dot { background: var(--giallo); border-color: var(--ink); }
.room-chip[data-room="tutto"] .room-dot { visibility: hidden; }

/* --- Da vicino (V9): la scena riempie lo schermo, i testi non le stanno sopra ---------------------------- */
.intro-copy { transition: opacity .35s ease, visibility 0s; }
#viewport.is-close .intro-copy { opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s .35s; }
.clock-block { border-radius: 20px; border: 1px solid transparent; transition: background-color .35s ease, border-color .35s ease; }
#viewport.is-close .clock-block {
  background: var(--glass); border-color: var(--glass-line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 12px 36px var(--shadow); padding: .5rem 1rem .8rem; margin: -.5rem -1rem -.8rem;
}
.caption { transition: opacity .35s ease; }
#viewport.is-close .caption { opacity: 0; }
@media (min-width: 640px) {
  .room-bar { border-radius: 18px; border: 1px solid transparent; padding: .5rem .6rem; margin: -.5rem -.6rem; transition: background-color .35s ease, border-color .35s ease; }
  #viewport.is-close .room-bar { background: var(--glass); border-color: var(--glass-line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 12px 36px var(--shadow); }
}

/* --- Anteprima statica (V9): si vede subito, il 3D la sostituisce al primo fotogramma -------------- */
#scene { position: absolute; inset: 0; }
.poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none;
  opacity: 1; transition: opacity .5s ease;
}
.poster.is-gone { opacity: 0; }

/* --- Caricamento ------------------------------------------------------------------------------- */
.loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; text-align: center; min-width: 15rem;
  padding: 1.4rem 1.6rem; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 18px 48px var(--shadow);
}
.loading p { font-size: .875rem; font-weight: 500; line-height: 1.5; margin: .8rem 0 0; }
.loading-line { display: block; height: 3px; border-radius: 3px; background: var(--giallo); transform-origin: left; animation: breathe 1.5s ease-in-out infinite; }
.loading.error .loading-line { animation: none; background: var(--stop); }
.loading.error { max-width: calc(100% - 2rem); }
/* V9: mentre si carica l'anteprima resta in vista: l'avviso è una pastiglia in basso, al centro solo se c'è un errore. */
.loading:not(.error):not(.note) { top: auto; bottom: calc(max(1.5rem, env(safe-area-inset-bottom)) + 4.6rem); transform: translateX(-50%); min-width: 11rem; padding: .7rem 1.1rem .8rem; border-radius: 16px; }
.loading:not(.error):not(.note) p { margin-top: .5rem; font-size: .8125rem; }
.loading.note { top: auto; bottom: calc(max(1.5rem, env(safe-area-inset-bottom)) + 4.6rem); transform: translateX(-50%); max-width: min(26rem, calc(100% - 2rem)); }
.loading.note .loading-line { display: none; }
.loading.note p { margin: 0; }

/* --- Telefono e tablet ----------------------------------------------------------------------- */
@media (pointer: coarse) { .hint-mouse { display: none; } .hint-touch { display: inline; } }
@media (max-width: 1023px) { .hint { display: none; } }
@media (max-width: 639px) {
  :root { --header-h: 68px; --gutter: 1rem; }
  .logo-svg { height: 32px; }
  /* Telefono: il CTA dell'audit resta (chi arriva dalle ads deve vederlo), compatto; del Menu resta l'icona. */
  .header-actions { gap: .5rem; }
  .cta { padding: .6rem .95rem; font-size: .8125rem; white-space: nowrap; }
  .cta .icon, .menu-word { display: none; }
  .menu-toggle { min-width: 2.75rem; min-height: 2.75rem; justify-content: center; }
  .intro { gap: 1rem; }
  .intro h1 { font-size: clamp(1.9rem, 8.6vw, 2.6rem); max-width: 9ch; }
  #subtitle { font-size: .875rem; margin-top: .6rem; max-width: 24ch; }
  .clock { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .scene-status { font-size: .75rem; max-width: 21ch; margin-top: .55rem; }
  .caption { font-size: .75rem; max-width: 16ch; }
  .round { width: 2.6rem; height: 2.6rem; }
  .controls { gap: .4rem; }
  /* Reparti: una riga che scorre col dito sopra i controlli, con bersagli da 44 px. */
  .room-bar {
    left: 0; right: 0; bottom: calc(max(1.5rem, env(safe-area-inset-bottom)) + 3.3rem); flex-direction: row; align-items: center; gap: .4rem;
    padding: .25rem 1rem; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity; scroll-padding-inline: 1rem;
  }
  /* Da vicino il pannello dell'orologio resta dentro lo schermo, con gli angoli interi. */
  #viewport.is-close .clock-block { padding: .5rem .6rem .8rem; margin: -.5rem -.6rem -.8rem; }
  .room-bar::-webkit-scrollbar { display: none; }
  .room-chip {
    flex: none; min-height: 2.75rem; padding: 0 .9rem 0 .75rem; color: var(--ink); scroll-snap-align: start;
    border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 62%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .room-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .room-chip[aria-pressed="true"] .room-name { text-decoration: none; }
  .room-chip[data-room="tutto"] .room-dot { display: none; }
  .agent-card { left: .75rem; right: .75rem; top: auto; bottom: max(.75rem, env(safe-area-inset-bottom)); width: auto; max-height: 62dvh; overflow-y: auto; padding: 1.3rem 1.3rem 1.2rem; border-radius: 22px; }
  /* Telefono: fumetto compatto col solo nome; la frase è nella scheda (tocco sul fumetto). */
  .bubble-body { font-size: .75rem; max-width: 11rem; padding: .32rem .6rem .36rem; }
  .bubble-body > span, .bubble strong::after { display: none; }
}
/* Telefoni stretti (320): CTA e menu prima della lingua. */
@media (max-width: 359px) { .lang-switch { display: none; } }
@media (min-width: 768px) { .logo-svg { height: 44px; } }

@keyframes breathe { 0%, 100% { transform: scaleX(.18); } 50% { transform: scaleX(1); } }
@keyframes live-dot { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 .5rem transparent; } }
@keyframes menu-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes line-up { from { transform: translateY(115%); } to { transform: none; } }
@keyframes bubble-in { from { transform: translate(calc(-50% + var(--dx, 0px)), calc(-100% - 12px)) scale(.6); opacity: 0; } to { transform: translate(calc(-50% + var(--dx, 0px)), calc(-100% - 12px)); opacity: 1; } }
@keyframes card-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
