/* =============================================================
   zukunvt Live Translator
   Linguaggio visivo di zukunvt.com: blu pieno #001CFF, testo blu su
   bianco e bianco su blu, grandi titoli in una grotesk geometrica.
   Il nero è solo colore del testo.
   ============================================================= */

/* ----- Font ospitati sul nostro dominio (niente Google Fonts) -----
   Hanken Grotesk (OFL) al posto di RM Neue / Aktiv Grotesk del sito,
   che sono a licenza. Roboto copre cirillico e greco. */
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/hanken-grotesk-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/hanken-grotesk-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-display: swap; font-weight: 300; src: url(/fonts/roboto-cyrillic-300-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/roboto-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/roboto-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto"; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/roboto-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto"; font-style: normal; font-display: swap; font-weight: 300; src: url(/fonts/roboto-greek-300-normal.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/roboto-greek-400-normal.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/roboto-greek-500-normal.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/roboto-greek-700-normal.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }

/* ----- Token ----- */
:root {
  --blue: #001cff;          /* blu zukunvt (sito) */
  --blue-deep: #0014bf;     /* hover, pressione */
  --lavender: #c3caff;      /* testo secondario su blu (contrasto 5:1) */
  --ice: #eef0ff;           /* campi e superfici leggere su bianco */
  --ice-2: #dde2ff;
  --night: #00062e;         /* fondo scuro: schermo grande, tema scuro */
  --ink: #000000;
  --white: #ffffff;
  --grey: #878787;
  --fog: #f2f2f2;
  --red: #e6332a;
  --green: #3aaa35;

  --bg: var(--white);
  --text: var(--ink);
  --muted: #5e6070;
  --line: #e2e4ef;
  --accent: var(--blue);
  --fill: var(--blue);
  --field: var(--ice);
  --cap-old: #8b8ea3;

  --font: "Hanken Grotesk", "Roboto", "Helvetica Neue", Arial, system-ui, sans-serif;
  --r-s: 10px;
  --r: 16px;
  --r-l: 24px;
  --cap-size: 32px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

/* Tema scuro (partecipanti): blu notte, mai nero pieno */
[data-theme="dark"] {
  --bg: var(--night);
  --text: #ffffff;
  --muted: #a9afdc;
  --line: #1b2260;
  --accent: #8e9bff;
  --fill: var(--blue);
  --field: #0d1452;
  --cap-old: #7f87c4;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" 0;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ----- Tipografia ----- */
.display {
  margin: 0; color: var(--blue);
  font-size: clamp(40px, 5.2vw, 72px); line-height: 0.98; font-weight: 500; letter-spacing: -0.035em;
}
.h2 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 500; letter-spacing: -0.015em; }
.h3 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; }
.lede { margin: 0; font-size: 21px; line-height: 1.4; color: var(--muted); max-width: none; text-wrap: balance; }

/* ----- Bottoni ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px;
  border: 1.5px solid transparent; border-radius: 999px;
  background: transparent; color: var(--text);
  font-weight: 500; font-size: 15px; line-height: 1.1; text-decoration: none; letter-spacing: 0.005em;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { flex: none; }
.btn-primary { background: var(--fill); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-deep); }
.btn-soft { background: var(--field); color: var(--accent); }
.btn-soft:hover:not(:disabled) { background: var(--ice-2); }
[data-theme="dark"] .btn-soft:hover:not(:disabled) { background: #18207a; }
.btn-line { border-color: var(--line); }
.btn-line:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-danger { border-color: rgba(230, 51, 42, 0.45); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #fff; }
.btn-white { background: #fff; color: var(--blue); }
.btn-white:hover:not(:disabled) { background: var(--ice); }
.btn-outline-white { border-color: rgba(255, 255, 255, 0.55); color: #fff; }
.btn-outline-white:hover:not(:disabled) { background: #fff; border-color: #fff; color: var(--blue); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-icon { min-width: 44px; padding: 0 12px; }

/* ----- Campi ----- */
.input, .select {
  width: 100%; min-height: 50px; padding: 12px 16px;
  border: 0; border-radius: var(--r-s);
  background: var(--field); color: var(--text);
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: box-shadow 0.15s, background-color 0.15s;
}
.input::placeholder { color: #8c90ad; }
/* background-color, non "background": la scorciatoia azzererebbe anche la freccia del menu (che si ripeteva a strisce) */
.input:focus, .select:focus { outline: none; background-color: var(--bg); box-shadow: inset 0 0 0 2px var(--accent); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.select {
  appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23001cff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 16px center;
}
.select-sm { width: auto; min-height: 38px; padding: 6px 36px 6px 14px; font-size: 14px; border-radius: 999px; background-position: right 13px center; }

.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label { font-weight: 600; font-size: 15px; padding: 0; }
.field-hint { font-size: 14px; color: var(--muted); }
.form-error { color: var(--red); font-size: 15px; margin: 0; }
.form-error:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border-radius: 999px; background: var(--field); color: var(--blue);
  font-size: 15px; font-weight: 500; cursor: pointer; user-select: none;
  transition: background-color 0.15s, color 0.15s;
}
.chip input:hover:not(:disabled) + span { background: var(--ice-2); }
.chip input:checked + span { background: var(--blue); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.chip input:disabled:not(:checked) + span { opacity: 0.4; cursor: not-allowed; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--ice-2); position: relative; margin: 0; cursor: pointer; transition: background-color 0.18s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 10, 80, 0.25); transition: transform 0.18s var(--ease); }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:disabled { opacity: 0.5; cursor: not-allowed; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-label { font-weight: 600; font-size: 15px; }

.pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--fog); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.pill-live { background: #e7f6e6; color: #1f7a1b; }
.pill-live::before { background: var(--green); opacity: 1; }

/* Selettore lingua interfaccia: tre parole, niente menu */
.ui-langs { display: inline-flex; gap: 2px; }
.ui-langs button {
  border: 0; background: none; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted);
}
.ui-langs button:hover { color: var(--accent); }
.ui-langs button[aria-pressed="true"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.on-blue .ui-langs button { color: var(--lavender); }
.on-blue .ui-langs button:hover, .on-blue .ui-langs button[aria-pressed="true"] { color: #fff; }

/* Bagliore del sito zukunvt.com sulle superfici blu */
.on-blue { background: var(--blue); color: #fff; --accent: #fff; position: relative; isolation: isolate; }
.on-blue :focus-visible { outline-color: #fff; }
.glow::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 22% 38%, rgba(150, 165, 255, 0.55), transparent 70%),
    radial-gradient(45% 50% at 90% 95%, rgba(0, 8, 120, 0.55), transparent 70%);
}

/* =============================================================
   Speaker
   ============================================================= */
body.speaker { display: flex; flex-direction: column; }

.appbar {
  display: flex; align-items: center; gap: 20px;
  height: 64px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.brand-logo { height: 22px; width: auto; }
.brand-name { font-size: 16px; font-weight: 500; padding-left: 14px; border-left: 1.5px solid var(--line); line-height: 22px; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.nav-link:hover { color: var(--blue); }
.appbar-tools { margin-left: auto; display: flex; align-items: center; gap: 14px; }

#app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view-center { flex: 1; display: grid; place-items: center; padding: 40px; }

/* ----- Accesso: la pagina d'ingresso ----- */
.landing {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr; gap: 32px;
  padding: clamp(20px, 3vw, 44px);
  overflow: hidden;
}
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.landing-logo { height: 28px; width: auto; }
.landing-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: end; gap: clamp(32px, 5vw, 80px);
  padding-bottom: clamp(8px, 3vh, 40px);
}
.hello {
  margin: 0 0 0 -0.04em; height: 1.02em; position: relative; overflow: hidden;
  font-size: clamp(76px, 15.5vw, 250px); line-height: 1; font-weight: 500; letter-spacing: -0.05em;
}
.hello-word { display: inline-block; white-space: nowrap; transition: transform 0.6s var(--ease), opacity 0.6s var(--ease); }
.hello-word.is-out { transform: translateY(-0.5em); opacity: 0; }
.hello-word.is-in { transform: translateY(0.5em); opacity: 0; transition: none; }
.hello-lang { margin: 10px 0 0; font-size: 15px; font-weight: 500; color: var(--lavender); letter-spacing: 0.02em; min-height: 1.5em; transition: opacity 0.6s var(--ease); }
.hello-lang.is-out { opacity: 0; }
.landing-title { margin: clamp(24px, 5vh, 56px) 0 10px; font-size: clamp(30px, 3.4vw, 52px); line-height: 1.05; font-weight: 500; letter-spacing: -0.03em; }
.landing-lede { margin: 0; max-width: 32ch; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.4; color: var(--lavender); }

.login-card {
  background: #fff; color: var(--ink); --accent: var(--blue);
  border-radius: var(--r-l); padding: 34px 32px 30px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 30px 80px rgba(0, 6, 90, 0.35);
}
.login-card :focus-visible { outline-color: var(--blue); }
.login-card .h2 { color: var(--blue); }
.login-hint { margin: -6px 0 0; font-size: 15px; color: var(--muted); }

/* ----- Home: nuova sessione (bianco) + recenti (blu) ----- */
.home { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); }
.home-new { padding: clamp(32px, 5vw, 72px) clamp(24px, 5vw, 80px) 64px; }
.home-new > .lede { margin-top: 18px; }
.form { display: flex; flex-direction: column; gap: 28px; margin-top: 44px; max-width: 680px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; padding-top: 6px; }
.form-actions .field-hint { max-width: 36ch; }

/* Verifica servizi: tre righe con pallino di stato */
.services { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); max-width: 680px; }
.services-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px 28px; }
.services-head .field-hint { margin: 6px 0 0; max-width: 48ch; }
.services-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 8px; }
.svc { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 14px; padding: 14px 18px; border-radius: var(--r-s); background: var(--field); }
.svc-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--grey); }
.svc[data-state="ok"] .svc-dot { background: var(--green); }
.svc[data-state="fail"] .svc-dot { background: var(--red); }
.svc[data-state="wait"] .svc-dot { background: var(--lavender); animation: svc-wait 1s var(--ease) infinite alternate; }
@keyframes svc-wait { to { background: var(--blue); } }
.svc p { margin: 0; }
.svc-name { font-weight: 600; }
.svc-tech { font-weight: 400; color: var(--muted); font-size: 14px; }
.svc .svc-msg { margin-top: 2px; }
.svc[data-state="fail"] .svc-msg { color: #b3221b; }
.svc .svc-sample { margin-top: 4px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.services-time { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .svc[data-state="wait"] .svc-dot { animation: none; } }

.home-recent { padding: clamp(32px, 5vw, 72px) 36px 48px; display: flex; flex-direction: column; gap: 22px; }
.home-recent .h2 { color: #fff; }
.recent-list { display: flex; flex-direction: column; }
.recent-empty { color: var(--lavender); margin: 0; max-width: 30ch; }
.recent-item { padding: 18px 0; border-top: 1px solid rgba(255, 255, 255, 0.22); display: flex; flex-direction: column; gap: 10px; }
.recent-item:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.22); }
.recent-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.recent-title { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.recent-meta { margin: 2px 0 0; font-size: 14px; color: var(--lavender); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.recent-meta .num { color: #fff; }
.recent-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.home-recent .pill { background: rgba(255, 255, 255, 0.14); color: var(--lavender); }
.home-recent .pill-live { background: #fff; color: var(--blue); }
.home-recent .pill-live::before { background: var(--green); }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 210px;
  background: #fff; color: var(--ink); border-radius: 14px; padding: 6px;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 48px rgba(0, 6, 90, 0.22), 0 0 0 1px rgba(0, 6, 90, 0.06);
}
.menu-list.right { left: auto; right: 0; }
/* altezza massima calcolata in speaker.js (fitMenu): oltre, il menu scorre */
.menu-list { overflow-y: auto; overscroll-behavior: contain; }
.menu-list.up { top: auto; bottom: calc(100% + 6px); }
.menu-list > a, .menu-list > button {
  display: block; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 10px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 15px;
}
.menu-list > a:hover, .menu-list > button:hover { background: var(--ice); color: var(--blue); }
.menu-list :focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* ----- Sessione live ----- */
.live { flex: 1; display: flex; flex-direction: column; min-height: 0; }
/* La pagina della sessione scorre normalmente con la rotella (le tendine aperte sono sempre complete). */

.band {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 20px 32px; padding: 22px 32px;
}
.band-join { display: flex; align-items: center; gap: 20px; min-width: 0; }
.qr-mini { flex: none; width: 104px; height: 104px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #fff; cursor: zoom-in; }
.qr-mini svg { width: 100%; height: 100%; display: block; }
.band-label { margin: 0; font-size: 14px; color: var(--lavender); }
.band-code { margin: 0; font-size: 52px; line-height: 1; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.band-url { margin: 6px 0 0; font-size: 14px; color: var(--lavender); overflow-wrap: anywhere; }
.band-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.band-session { min-width: 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.band-title { margin: 0; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.band .pill { background: rgba(255, 255, 255, 0.16); color: #fff; }
.band .pill-live { background: #fff; color: var(--blue); }
.band .pill-live::before { background: var(--green); }
.band-audience { text-align: right; min-width: 150px; }
.aud-total { margin: 0; font-size: 52px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.aud-label { margin: 4px 0 0; font-size: 14px; color: var(--lavender); }
.aud-langs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.aud-langs li { font-size: 13px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-variant-numeric: tabular-nums; }
.aud-langs b { font-weight: 600; margin-right: 5px; }
.aud-stage { margin: 10px 0 0; font-size: 13px; color: var(--lavender); }
.aud-stage[data-on="true"] { color: #fff; }
.aud-stage[data-on="true"]::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); vertical-align: 1px; }

.controlbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 14px 32px; border-bottom: 1px solid var(--line);
}
.controls-spacer { flex: 1; }
.btn-mic { min-height: 54px; padding: 0 26px 0 20px; font-size: 17px; }
.btn-mic .mic-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25); }
.btn-mic.is-live { background: var(--red); }
.btn-mic.is-live:hover:not(:disabled) { background: #c92a22; }
@media (prefers-reduced-motion: no-preference) {
  .btn-mic.is-live .mic-dot { animation: pulse 1.4s ease-in-out infinite; }
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.05); } }
.meter { width: 120px; height: 8px; background: var(--ice); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width 0.08s linear; }
.stt-state { font-size: 15px; color: var(--muted); }
.stt-state[data-state="listening"] { color: #1f7a1b; }
.stt-state[data-state="reconnecting"] { color: var(--red); }
.field-inline { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.mock { display: flex; flex-direction: column; gap: 6px; margin: 14px 32px 0; padding: 14px; border-radius: var(--r); background: var(--ice); }
.mock .field-label { color: var(--blue); }
.mock .input { background: #fff; }

.banner { display: flex; align-items: flex-start; gap: 12px; margin: 14px 32px 0; padding: 14px 16px; border-radius: var(--r); font-size: 15px; }
.banner p { margin: 0; flex: 1; }
.banner-error { background: #fdecea; color: #a01c15; }
.banner-warn { background: var(--ice); color: var(--blue); }
.banner-close { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; color: inherit; }

.live-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); min-height: 0; }
.live-grid.single { grid-template-columns: minmax(0, 1fr); }
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane + .pane { border-left: 1px solid var(--line); }
.pane-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 20px 32px 14px; }
.pane-head .h3 { margin-right: auto; }
.pane-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 0; background: var(--field); color: var(--blue); min-height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500; }
.tab:hover { background: var(--ice-2); }
.tab[aria-selected="true"] { background: var(--blue); color: #fff; }

.feed {
  flex: 1; min-height: 200px; overflow-y: auto; padding: 6px 32px 18px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
          mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
}
.feed-empty { color: var(--muted); max-width: none; margin: 14px 0; font-size: 17px; text-wrap: balance; }
.row { padding: 14px 0; border-bottom: 1px solid var(--line); max-width: 64ch; }
.row-src { margin: 0 0 4px; font-size: 14.5px; color: var(--muted); }
.row-tr { margin: 0; font-size: 21px; line-height: 1.35; font-weight: 400; letter-spacing: -0.005em; }
.row-tr.pending { color: var(--grey); }
.row.skipped .row-tr { font-size: 14px; color: var(--grey); font-style: italic; }
.row-flag { margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--red); vertical-align: middle; }

.interim { display: flex; align-items: baseline; gap: 12px; padding: 14px 32px; background: var(--ice); min-height: 54px; }
.tag { flex: none; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 6px; background: var(--blue); color: #fff; }
.interim-text { margin: 0; color: var(--blue); font-style: italic; }

/* ----- Contesto e glossario (sopra traduzione e slide, chiudibile) ----- */
.ctx-pane { border-bottom: 1px solid var(--line); background: #fff; }
.ctx-summary { display: flex; align-items: center; gap: 14px; padding: 12px 32px; cursor: pointer; list-style: none; }
.ctx-summary::-webkit-details-marker { display: none; }
.ctx-summary::before {
  content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue);
  transform: rotate(-45deg); transition: transform 0.18s var(--ease); margin-right: 2px;
}
.ctx-pane[open] > .ctx-summary::before { transform: rotate(45deg); }
.ctx-summary-title { font-weight: 600; font-size: 16px; color: var(--ink); }
.ctx-status { font-size: 14px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-status.is-busy { color: var(--blue); }
.ctx-status.is-busy::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--ice-2); border-top-color: var(--blue); vertical-align: -1px; }
@media (prefers-reduced-motion: no-preference) { .ctx-status.is-busy::before { animation: spin 0.9s linear infinite; } }
.ctx-status.is-error { color: var(--red); }
.ctx-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 24px; padding: 4px 32px 22px; }
.ctx-main, .ctx-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ctx-hint { margin: 0; max-width: 72ch; }
.ctx-main .textarea { min-height: 180px; font-size: 15px; }
.ctx-main .textarea[readonly] { opacity: 0.6; cursor: progress; }
#ctxSaveState.is-error { color: var(--red); }
.ctx-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ctx-foot #ctxSaveState { margin-right: auto; }
.ctx-side .field-label { margin: 0; }
.ctx-side .btn { align-self: flex-start; }
.dropzone.dropzone-sm { flex: none; min-height: 0; padding: 16px 20px; gap: 4px; border-radius: var(--r); }
.dropzone-sm .dropzone-title { font-size: 17px; letter-spacing: -0.01em; }
.ctx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ctx-list:empty { display: none; }
.ctx-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 10px; background: var(--field); font-size: 14px; }
.ctx-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ctx-item-meta { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctx-item.is-busy .ctx-item-meta { color: var(--blue); }
.ctx-item.is-error { background: #fdecea; }
.ctx-item.is-error .ctx-item-meta { color: #a01c15; white-space: normal; flex: 1 1 100%; }
.ctx-item.is-error { flex-wrap: wrap; }
.ctx-item-x { flex: none; border: 0; background: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.ctx-item-x:hover { background: rgba(0, 10, 80, 0.08); color: var(--ink); }
.form .ctx-list { margin-top: 8px; }
@media (max-width: 900px) {
  .ctx-body { grid-template-columns: 1fr; max-height: none; }
  .ctx-summary, .ctx-body { padding-left: 16px; padding-right: 16px; }
}

/* ----- Presentazione ----- */
.pane-slides { background: #f7f8fc; }
.slide-count { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.slides-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 32px 24px; overflow-y: auto; }

.dropzone {
  flex: 1; min-height: 280px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px;
  padding: 36px; border-radius: var(--r-l); border: 2px dashed #c5cbf2; background: #fff; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: var(--ice); }
.dropzone:focus-within { border-color: var(--blue); }
.dropzone-title { margin: 0; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.1; font-weight: 500; letter-spacing: -0.025em; color: var(--blue); max-width: 18ch; }
.dropzone p { margin: 0; max-width: 46ch; color: var(--muted); }
.dropzone .btn { margin-top: 6px; }

.deck-start { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.deck-start .dropzone { flex: none; min-height: 0; padding: 28px 32px; gap: 12px; }
.gs-form { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; border-radius: var(--r-l); background: #fff; }
.gs-form .field-hint { margin: 0; max-width: 60ch; }
.gs-row { display: flex; gap: 10px; }
.gs-row .input { flex: 1; min-width: 0; }
.gs-row .btn { flex: none; }

.progress { display: flex; flex-direction: column; gap: 14px; padding: 36px; border-radius: var(--r-l); background: #fff; }
.progress-text { margin: 0; font-size: 19px; font-weight: 500; color: var(--blue); }
.bar { height: 8px; border-radius: 999px; background: var(--ice); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width 0.25s var(--ease); }
.progress .btn { align-self: flex-start; }

.deck { display: flex; flex-direction: column; gap: 16px; }
.deck-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 26%); gap: 16px; align-items: start; }
.slide-frame { margin: 0; position: relative; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--night); overflow: hidden; }
.slide-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.media-badge, .thumb-media {
  position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #fff; background: rgba(0, 6, 46, 0.78); padding: 4px 10px 4px 8px; border-radius: 999px;
}
.media-badge::before, .thumb-media::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; }
.thumb-media { left: auto; right: 5px; top: 4px; font-size: 10.5px; font-style: normal; padding: 1px 6px 1px 5px; gap: 4px; }
.thumb-media::before { border-width: 3.5px 0 3.5px 6px; }
/* Comandi del video sopra l'anteprima della slide, come in un lettore video */
.media-controls {
  position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px;
  padding: 6px; border-radius: 999px; background: rgba(0, 6, 46, 0.82); color: #fff; backdrop-filter: blur(8px);
}
.media-btn {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #fff; cursor: pointer; transition: background-color 0.15s;
}
.media-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.media-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.media-btn:disabled { opacity: 0.45; cursor: default; }
#mediaPlay { background: var(--blue); }
#mediaPlay:hover:not(:disabled) { background: #2a43ff; }
.media-status { flex: 1; min-width: 0; padding: 0 10px 0 6px; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-next { display: flex; flex-direction: column; gap: 8px; }
.slide-next .slide-frame { opacity: 0.92; }
.slide-next figcaption, .slide-next p { margin: 0; font-size: 14px; color: var(--muted); }
.deck-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.deck-nav .btn:first-child { justify-self: start; }
.deck-nav .btn:last-child { justify-self: end; }
.deck-pos { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--blue); }
.deck-hint { margin: 0; font-size: 14px; color: var(--muted); }
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.thumb {
  flex: none; width: 112px; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 8px; overflow: hidden;
  background: var(--night); cursor: pointer; position: relative; scroll-snap-align: center;
  box-shadow: 0 0 0 2px transparent; transition: box-shadow 0.15s;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.thumb span { position: absolute; left: 5px; bottom: 4px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 6, 46, 0.7); padding: 1px 6px; border-radius: 5px; }
.thumb:hover { box-shadow: 0 0 0 2px var(--ice-2); }
.thumb[aria-current="true"] { box-shadow: 0 0 0 3px var(--blue); }

.stage-panel { min-width: 280px; width: min(460px, calc(100vw - 32px)); padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stage-panel > p, .stage-panel-actions { grid-column: 1 / -1; }
.stage-panel p { margin: 0; font-size: 14px; color: var(--muted); }
.stage-panel .select { min-height: 44px; }
.stage-panel-actions { display: flex; gap: 8px; }
.stage-panel-actions .btn { flex: 1; }

.ended { padding: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; }

/* ----- QR a tutto schermo ----- */
.projector {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6vw; padding: 6vw;
}
.projector-qr { width: min(40vw, 72vh); aspect-ratio: 1; border-radius: 3vh; overflow: hidden; background: #fff; }
.projector-qr svg { width: 100%; height: 100%; display: block; }
.projector-line { margin: 0 0 0.35em; font-size: clamp(20px, 2.5vw, 44px); line-height: 1.15; font-weight: 400; letter-spacing: -0.015em; }
.projector-line:nth-child(n + 2) { color: var(--lavender); }
.projector-code { margin: 0.5em 0 0.05em; font-size: clamp(64px, 10vw, 180px); line-height: 1; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.projector-url { margin: 0; font-size: clamp(16px, 1.7vw, 30px); color: var(--lavender); }
.projector-close { position: absolute; top: 20px; right: 24px; border: 1.5px solid rgba(255, 255, 255, 0.55); background: none; color: #fff; font-size: 28px; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; }
.projector-close:hover { background: #fff; color: var(--blue); }

@media (max-width: 1180px) {
  .live-grid { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
  .pane-feed { order: 2; }
  .feed { max-height: 60vh; }
  .slides-body { overflow: visible; }
  .dropzone { min-height: 220px; }
}
@media (max-width: 1080px) {
  .home { grid-template-columns: 1fr; }
  .band { grid-template-columns: minmax(0, 1fr) auto; }
  .band-session { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 900px) {
  .landing-body { grid-template-columns: 1fr; align-items: start; }
  .projector { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .projector-qr { width: min(80vw, 46vh); }
}
@media (max-width: 640px) {
  .appbar { padding: 0 16px; gap: 12px; }
  .brand-name { display: none; }
  .home-new { padding: 32px 16px 48px; }
  .home-recent { padding: 32px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .band { grid-template-columns: 1fr; padding: 20px 16px; }
  .band-audience { text-align: left; }
  .aud-langs { justify-content: flex-start; }
  .band-code { font-size: 40px; }
  .qr-mini { width: 88px; height: 88px; }
  .controlbar, .pane-head, .feed, .interim { padding-left: 16px; padding-right: 16px; }
  .slides-body { padding: 0 16px 20px; }
  .banner, .mock { margin-left: 16px; margin-right: 16px; }
  .controls-spacer { display: none; }
  .deck-view { grid-template-columns: 1fr; }
  .slide-next { display: none; }
  .landing-top .landing-logo { height: 22px; }
}

/* =============================================================
   Schermo grande: traduzione e slide in cinque disposizioni
   (data-layout: left, right, bottom, slides, captions)
   ============================================================= */
body.stage {
  height: 100vh; height: 100dvh; overflow: hidden;
  background: var(--night); color: #fff;
  --split: 36%;
  --split-h: 28vh;
  --cap-scale: 1;
  --stage-pad: clamp(16px, 2.4vw, 56px);
}
body.stage.is-idle, body.stage.is-idle * { cursor: none !important; }
.stage-grid { height: 100%; display: grid; grid-template-columns: var(--split) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.stage-captions { grid-column: 1; grid-row: 1; }
.stage-slides { grid-column: 2; grid-row: 1; }
/* Traduzione a destra */
body.stage[data-layout="right"] .stage-grid { grid-template-columns: minmax(0, 1fr) var(--split); }
body.stage[data-layout="right"] .stage-captions { grid-column: 2; }
body.stage[data-layout="right"] .stage-slides { grid-column: 1; }
/* Traduzione sotto: slide sopra, fascia orizzontale sotto */
body.stage[data-layout="bottom"] .stage-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) var(--split-h); }
body.stage[data-layout="bottom"] .stage-slides { grid-column: 1; grid-row: 1; }
/* fascia: a sinistra la traduzione su tutta l'altezza, a destra logo e lingua sopra, QR sotto */
body.stage[data-layout="bottom"] .stage-captions {
  grid-column: 1; grid-row: 2;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr);
  column-gap: var(--stage-pad); row-gap: 1.4vh; padding: calc(var(--stage-pad) * 0.55) var(--stage-pad);
}
body.stage[data-layout="bottom"] .stage-head { grid-column: 2; grid-row: 1; font-size: clamp(12px, 1.8vh, 22px); }
body.stage[data-layout="bottom"] .stage-log { grid-column: 1; grid-row: 1 / 3; margin-top: 0; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%); mask-image: linear-gradient(to bottom, transparent 0, #000 30%); }
body.stage[data-layout="bottom"] .stage-cap { font-size: calc(3.6vh * var(--cap-scale)); margin-bottom: 0.35em; }
body.stage[data-layout="bottom"] .stage-waiting { font-size: calc(2.8vh * var(--cap-scale)); }
body.stage[data-layout="bottom"] .stage-join {
  grid-column: 2; grid-row: 2; align-self: end; margin: 0; padding: 0;
  border-top: 0; font-size: clamp(11px, 1.6vh, 19px);
}
body.stage[data-layout="bottom"] .stage-qr { width: clamp(52px, calc(var(--split-h) * 0.5), 180px); border-radius: 0.8vh; }
/* Solo slide / solo traduzione (anche quando non c'è ancora una presentazione) */
body.stage.slides-only .stage-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
body.stage.slides-only .stage-captions { display: none; }
body.stage.slides-only .stage-slides { grid-column: 1; grid-row: 1; }
body.stage.cap-only .stage-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
body.stage.cap-only .stage-slides { display: none; }
body.stage.cap-only .stage-captions { grid-column: 1; grid-row: 1; display: flex; padding: var(--stage-pad); padding-bottom: calc(var(--stage-pad) * 0.8); }
body.stage.cap-only .stage-head { font-size: clamp(13px, 1.05vw, 22px); }
body.stage.cap-only .stage-log { margin-top: 3vh; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%); mask-image: linear-gradient(to bottom, transparent 0, #000 22%); }
body.stage.cap-only .stage-join { align-self: auto; margin-top: 3vh; padding: 2.4vh 0 0; border-top: 1px solid rgba(255, 255, 255, 0.22); font-size: clamp(12px, 0.95vw, 20px); }
body.stage.cap-only .stage-qr { width: clamp(64px, 6.2vw, 140px); }

.stage-captions { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: var(--stage-pad); padding-bottom: calc(var(--stage-pad) * 0.8); }
.stage-head { display: flex; align-items: center; gap: 0.9em; font-size: clamp(13px, 1.05vw, 22px); }
.stage-logo { height: 1.35em; width: auto; }
.stage-lang { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.3em 0.85em; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-weight: 600; }
.stage-lang::before { content: ""; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--green); }
.stage-lang[data-state="reconnecting"]::before { background: var(--red); }

.stage-log {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  margin-top: 3vh;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}
.stage-cap {
  margin: 0 0 0.55em; flex: none;
  font-size: calc(2.15vw * var(--cap-scale)); line-height: 1.24; font-weight: 400; letter-spacing: -0.01em;
  color: var(--lavender); overflow-wrap: anywhere;
}
body.stage.cap-only .stage-cap { font-size: calc(3.3vw * var(--cap-scale)); max-width: 30em; margin-bottom: 0.55em; }
body.stage.cap-only .stage-cap:last-child { margin-bottom: 0; }
body.stage[data-layout="bottom"] .stage-cap:last-child { margin-bottom: 0; }
body.stage.cap-only .stage-waiting { font-size: calc(1.6vw * var(--cap-scale)); }
.stage-cap:nth-last-child(2) { color: rgba(255, 255, 255, 0.86); }
.stage-cap:last-child { color: #fff; font-weight: 500; margin-bottom: 0; }
@media (prefers-reduced-motion: no-preference) {
  .stage-cap:last-child { animation: arrive 0.4s var(--ease); }
}
.stage-waiting { margin: 0; font-size: calc(1.6vw * var(--cap-scale)); color: var(--lavender); }

.stage-join { display: flex; align-items: center; gap: 1.1vw; margin-top: 3vh; padding-top: 2.4vh; border-top: 1px solid rgba(255, 255, 255, 0.22); font-size: clamp(12px, 0.95vw, 20px); }
.stage-qr { flex: none; width: clamp(64px, 6.2vw, 140px); aspect-ratio: 1; background: #fff; border-radius: 0.6vw; overflow: hidden; }
.stage-qr svg { width: 100%; height: 100%; display: block; }
.stage-join p { margin: 0; display: flex; flex-direction: column; gap: 0.15em; color: var(--lavender); min-width: 0; }
.stage-join strong { font-size: 2em; line-height: 1.05; font-weight: 500; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
body.stage.hide-qr .stage-join { display: none; }

.stage-slides { position: relative; min-width: 0; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: var(--stage-pad); background: var(--night); }
.stage-slide {
  grid-area: 1 / 1; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  border-radius: clamp(4px, 0.5vw, 12px); box-shadow: 0 2.5vh 7vh rgba(0, 0, 0, 0.45);
  opacity: 0; transition: opacity 0.12s ease-out;
}
.stage-slide.is-shown { opacity: 1; }
/* Video o GIF sopra l'immagine della slide (stessa posizione e dimensione, vedi stage.js) */
.stage-media { position: absolute; z-index: 1; overflow: hidden; border-radius: clamp(4px, 0.5vw, 12px); pointer-events: none; }
.stage-media > * { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.12s ease-out; }
.stage-media.is-on { background: #000; }
.stage-media.is-on > * { opacity: 1; }
.stage-media.is-loading::after {
  content: ""; position: absolute; right: 1.2vw; bottom: 1.2vw; width: clamp(18px, 1.6vw, 34px); aspect-ratio: 1;
  border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
}
@media (prefers-reduced-motion: no-preference) {
  .stage-media.is-loading::after { animation: spin 0.9s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }
.stage-sound {
  /* In alto: in basso c'è la barra degli strumenti quando si muove il mouse. */
  position: absolute; z-index: 2; left: 50%; top: calc(var(--stage-pad) * 1.2); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 0; border-radius: 999px;
  background: rgba(0, 6, 46, 0.9); color: #fff; font: inherit; font-size: clamp(13px, 0.95vw, 19px); font-weight: 600; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.stage-sound:hover, .stage-sound:focus-visible { background: var(--blue); }
.stage-num { position: absolute; right: var(--stage-pad); bottom: calc(var(--stage-pad) * 0.35); margin: 0; font-size: clamp(11px, 0.85vw, 18px); color: rgba(195, 202, 255, 0.75); font-variant-numeric: tabular-nums; }

/* Temi dello schermo grande */
.stage-cap.is-prov { opacity: 0.72; }
.stage-cap { transition: opacity 0.25s; }
body.stage[data-look="blue"] .stage-captions { background: var(--blue); }
body.stage[data-look="night"] .stage-captions { background: var(--night); border-right: 1px solid #141b5c; }
body.stage[data-look="night"][data-layout="right"] .stage-captions { border-right: 0; border-left: 1px solid #141b5c; }
body.stage[data-look="night"][data-layout="bottom"] .stage-captions { border-right: 0; border-top: 1px solid #141b5c; }
body.stage[data-look="night"].cap-only .stage-captions { border: 0; }
body.stage[data-look="night"] .stage-slides { background: #000; }
body.stage[data-look="light"] { background: #fff; }
body.stage[data-look="light"] .stage-captions { background: #fff; color: var(--ink); }
body.stage[data-look="light"] .stage-cap { color: #8b8ea3; }
body.stage[data-look="light"] .stage-cap:nth-last-child(2) { color: #3a3d55; }
body.stage[data-look="light"] .stage-cap:last-child { color: var(--blue); }
body.stage[data-look="light"] .stage-lang { background: var(--ice); color: var(--blue); }
body.stage[data-look="light"] .stage-waiting, body.stage[data-look="light"] .stage-join p { color: var(--muted); }
body.stage[data-look="light"] .stage-join strong { color: var(--blue); }
body.stage[data-look="light"] .stage-join { border-top-color: var(--line); }
body.stage[data-look="light"][data-layout="bottom"]:not(.cap-only) .stage-captions { border-top: 1px solid var(--line); }
body.stage[data-look="light"] .stage-qr { box-shadow: inset 0 0 0 1px var(--line); }
body.stage[data-look="light"] .stage-slides { background: var(--fog); }
body.stage[data-look="light"] .stage-slide { box-shadow: 0 2vh 6vh rgba(0, 6, 60, 0.18); }
body.stage[data-look="light"] .stage-num { color: var(--muted); }

.stage-toolbar {
  /* left: calcolato in stage.js (al centro delle slide, non sopra la traduzione) */
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 0); z-index: 10;
  display: flex; align-items: center; gap: 6px; padding: 8px;
  background: rgba(0, 6, 46, 0.88); color: #fff; border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); backdrop-filter: blur(10px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.stage-toolbar.is-hidden { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }
.stage-toolbar.at-top { bottom: auto; top: 24px; }
/* Traduzione sotto: la barra sta in fondo alle slide, sopra la fascia */
.stage-toolbar.above-band { bottom: calc(var(--split-h) + 16px); }
.stage-toolbar.at-top.is-hidden { transform: translate(-50%, -16px); }
.stage-toolbar [hidden] { display: none !important; }
/* I pulsanti della larghezza seguono la posizione della traduzione */
body.stage[data-layout="right"] .tool-split svg { transform: scaleX(-1); }
body.stage[data-layout="bottom"] .tool-split svg { transform: rotate(-90deg); }

.tool-wrap { position: relative; display: inline-flex; }
.layout-menu {
  position: absolute; left: 50%; bottom: calc(100% + 14px); transform: translateX(-50%); z-index: 11;
  width: max-content; max-width: min(92vw, 560px); padding: 16px; border-radius: 18px;
  background: rgba(0, 6, 46, 0.96); color: #fff; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 10px; text-align: left;
}
.stage-toolbar.at-top .layout-menu { bottom: auto; top: calc(100% + 14px); }
.layout-title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--lavender); }
.layout-title + .layout-hint { margin-top: -4px; }
.layout-hint { margin: 0; font-size: 13px; line-height: 1.4; color: rgba(195, 202, 255, 0.85); max-width: 46ch; }
.layout-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.layout-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 6px; min-width: 88px;
  border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: #fff; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; text-align: center;
}
.layout-opt:hover { background: rgba(255, 255, 255, 0.14); }
.layout-opt[aria-checked="true"] { background: #fff; color: var(--blue); }
/* Schema della disposizione: <i> = slide, <b> = traduzione */
.layout-pic { width: 56px; height: 36px; display: grid; gap: 3px; padding: 3px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px currentColor; }
.layout-pic i { background: currentColor; opacity: 0.35; border-radius: 2px; }
.layout-pic b { background: currentColor; border-radius: 2px; }
.layout-pic[data-pic="left"] { grid-template-columns: 2fr 3fr; }
.layout-pic[data-pic="left"] b { grid-column: 1; grid-row: 1; }
.layout-pic[data-pic="left"] i { grid-column: 2; grid-row: 1; }
.layout-pic[data-pic="right"] { grid-template-columns: 3fr 2fr; }
.layout-pic[data-pic="bottom"] { grid-template-rows: 2fr 1fr; }
.layout-pic[data-pic="slides"], .layout-pic[data-pic="captions"] { grid-template: 1fr / 1fr; }
.layout-second { display: flex; flex-wrap: wrap; gap: 8px; }
.layout-link {
  flex: 1 1 200px; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: #fff; font: inherit; font-size: 14px; font-weight: 600;
}
.layout-link:hover { background: rgba(255, 255, 255, 0.22); }
.layout-menu :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 640px) { .layout-options { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* "Solo slide" senza presentazione: logo, messaggio e QR */
.stage-empty { display: none; }
body.stage.slides-only.no-slides .stage-empty {
  grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 3vh; text-align: center;
}
.stage-empty-logo { height: clamp(24px, 3vw, 60px); width: auto; }
.stage-empty > p { margin: 0; font-size: clamp(18px, 2vw, 40px); color: var(--lavender); }
.stage-empty-join { display: flex; align-items: center; gap: 1.4vw; margin-top: 2vh; }
.stage-empty-join .stage-qr { width: clamp(90px, 10vw, 220px); }
.stage-empty-join p { margin: 0; display: flex; flex-direction: column; gap: 0.2em; text-align: left; font-size: clamp(13px, 1.1vw, 22px); color: var(--lavender); }
.stage-empty-join strong { font-size: 2em; color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; }
body.stage.hide-qr .stage-empty-join { display: none; }
body.stage[data-look="light"] .stage-empty > p, body.stage[data-look="light"] .stage-empty-join p { color: var(--muted); }
body.stage[data-look="light"] .stage-empty-join strong { color: var(--blue); }

/* Messaggio breve (es. finestra aperta sull'altro schermo) */
.stage-note {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%); z-index: 15; max-width: min(90vw, 640px);
  padding: 12px 20px; border-radius: 14px; background: rgba(0, 6, 46, 0.94); color: #fff;
  font-size: 15px; line-height: 1.4; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
/* Seconda finestra: un clic per lo schermo intero */
.stage-gofull {
  position: fixed; inset: 0; z-index: 18; display: grid; place-items: center;
  border: 0; background: rgba(0, 6, 46, 0.55); color: #fff; cursor: pointer; font: inherit; font-size: clamp(18px, 2vw, 36px); font-weight: 600;
}
.stage-gofull > span { display: inline-flex; align-items: center; gap: 0.6em; padding: 0.6em 1.3em; border-radius: 999px; background: var(--blue); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.stage-gofull svg { width: 1em; height: 1em; }
.stage-toolbar .select-sm {
  min-height: 40px; padding: 0 40px 0 18px; font-size: 15px; font-weight: 600; color: #fff;
  background-color: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 15px center;
}
.stage-toolbar .select-sm:hover { background-color: rgba(255, 255, 255, 0.24); }
.stage-toolbar .select-sm:focus { background-color: rgba(255, 255, 255, 0.24); box-shadow: inset 0 0 0 2px #fff; }
.stage-toolbar .select-sm option { color: var(--ink); background: #fff; }
.tool { border: 0; background: none; color: #fff; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 999px; cursor: pointer; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tool:hover { background: rgba(255, 255, 255, 0.14); }
.tool[aria-pressed="true"] { background: #fff; color: var(--blue); }
.tool-sep { width: 1px; height: 24px; background: rgba(255, 255, 255, 0.2); margin: 0 4px; }
.stage-toolbar :focus-visible { outline-color: #fff; }

.stage-msg { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 8vw; background: var(--blue); }
.stage-msg p { margin: 0; max-width: 24ch; font-size: clamp(24px, 3vw, 56px); line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; }

/* =============================================================
   Partecipante
   ============================================================= */
body.participant { display: flex; flex-direction: column; }

/* 1. Codice: tutto blu, come l'ingresso */
.j-entry { flex: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); overflow: hidden; }
.j-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.j-logo { height: 22px; width: auto; }
.j-entry-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; width: min(460px, 100%); margin: 0 auto; padding: 6vh 0; }
.j-title { margin: 0; font-size: clamp(44px, 12vw, 72px); line-height: 0.98; font-weight: 500; letter-spacing: -0.04em; }
.j-lede { margin: 12px 0 0; font-size: 19px; line-height: 1.4; color: var(--lavender); max-width: 26ch; }
.j-form { display: flex; flex-direction: column; gap: 12px; }
.j-form label { font-size: 15px; font-weight: 500; color: var(--lavender); }
.code-input {
  width: 100%; border: 0; border-radius: var(--r); padding: 16px 0;
  background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28);
  font-size: clamp(44px, 13vw, 60px); font-weight: 500; letter-spacing: 0.08em; text-align: center;
  font-variant-numeric: tabular-nums; outline: none; transition: box-shadow 0.15s, background-color 0.15s;
}
.code-input::placeholder { color: rgba(195, 202, 255, 0.45); }
.code-input:focus { background: rgba(255, 255, 255, 0.18); box-shadow: inset 0 0 0 2px #fff; }
.j-entry .form-error { color: #fff; background: rgba(230, 51, 42, 0.9); border-radius: 10px; padding: 0 12px; min-height: 0; }
.j-entry .form-error:not(:empty) { padding: 10px 12px; }
.j-entry-foot { margin: 0; text-align: center; font-size: 13px; color: var(--lavender); }

/* 2. Lingua */
.j-view { flex: 1; display: flex; justify-content: center; padding: max(24px, env(safe-area-inset-top)) 20px 32px; }
.j-card { width: min(520px, 100%); display: flex; flex-direction: column; gap: 22px; }
.j-card .j-top { margin-bottom: 4vh; }
.j-session { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }
.j-privnote { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); text-wrap: balance; text-align: center; }
.j-privnote a { color: var(--accent); text-decoration: underline; }
[data-theme="dark"] .j-privnote a { color: #fff; }
.j-ask { margin: -10px 0 4px; font-size: clamp(30px, 8vw, 44px); line-height: 1.05; font-weight: 500; letter-spacing: -0.03em; color: var(--accent); }
[data-theme="dark"] .j-ask { color: #fff; }
.lang-list { display: flex; flex-direction: column; gap: 10px; }
.lang-tile {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 14px 22px; text-align: left;
  border: 0; border-radius: var(--r); background: var(--field); color: var(--text); cursor: pointer;
  transition: background-color 0.15s;
}
.lang-tile:hover { background: var(--ice-2); }
[data-theme="dark"] .lang-tile:hover { background: #18207a; }
.lang-tile.is-suggested { background: var(--blue); color: #fff; }
.lang-tile.is-suggested .lang-note { color: var(--lavender); }
.lang-name { font-size: 21px; font-weight: 500; letter-spacing: -0.01em; }
.lang-note { font-size: 14px; color: var(--muted); }

/* 3. Sottotitoli */
.j-live { flex: 1; display: flex; flex-direction: column; min-height: 0; height: 100vh; height: 100dvh; position: relative; }
.j-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
}
.j-lang {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; min-height: 40px; padding: 0 14px; border-radius: 999px;
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.j-lang:hover { background: rgba(255, 255, 255, 0.24); }
.j-tools { display: flex; gap: 4px; align-items: center; }
.j-bar .btn-icon, .j-bar .btn-audio { color: #fff; min-height: 40px; }
.j-bar .btn-icon:hover { background: rgba(255, 255, 255, 0.14); }
.btn-audio { background: #fff; color: var(--blue) !important; padding: 0 14px; }
.btn-audio .wave { opacity: 0.4; }
.btn-audio.is-on { background: var(--green); color: #fff !important; }
.btn-audio.is-on .wave { opacity: 1; }

.cap-log {
  flex: 1; overflow-y: auto; padding: 28px 20px 40vh;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 44px);
          mask-image: linear-gradient(to bottom, transparent 0, #000 44px);
}
.cap-log > * { max-width: 32em; margin-left: auto; margin-right: auto; }
.cap {
  margin-top: 0; margin-bottom: 0.7em;
  font-size: var(--cap-size); line-height: 1.28; font-weight: 400; letter-spacing: -0.01em;
  color: var(--cap-old); overflow-wrap: anywhere;
}
/* L'ultima frase in pieno contrasto, la penultima quasi: l'occhio trova subito il punto. */
.cap:nth-last-child(2) { color: var(--text); opacity: 0.85; }
.cap:last-child { color: var(--text); font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  .cap:last-child { animation: arrive 0.35s var(--ease); }
}
@keyframes arrive { from { opacity: 0; transform: translateY(0.25em); } }
/* Traduzione dal vivo: la frase ancora in corso resta un po' più leggera finché arriva quella definitiva. */
.cap.is-prov { opacity: 0.72; }
.cap { transition: opacity 0.25s; }
.cap-flag { display: inline-block; margin-left: 0.6em; font-size: 13px; font-weight: 600; color: var(--red); vertical-align: middle; }
.cap-waiting, .cap-end { color: var(--muted); font-size: 19px; }
.cap-end { margin-top: 1.5em; }

.back-live {
  position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%);
  border: 0; border-radius: 999px; min-height: 44px; padding: 0 20px; background: var(--blue); color: #fff;
  font-weight: 600; cursor: pointer; box-shadow: 0 10px 28px rgba(0, 10, 120, 0.3);
}
.audio-note { position: absolute; left: 16px; right: 16px; bottom: 64px; margin: 0; padding: 12px 16px; background: var(--field); border-radius: var(--r); font-size: 15px; }

.j-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted);
}
.conn { display: inline-flex; align-items: center; gap: 6px; }
.conn[data-state="open"]::before, .conn[data-state="reconnecting"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.conn[data-state="reconnecting"]::before { background: var(--red); }
.disclaimer { text-align: right; }

@media (max-width: 420px) {
  .j-bar { padding-left: 12px; }
  .j-tools .btn-icon { min-width: 38px; padding: 0 8px; }
  .btn-audio { padding: 0 12px; }
  .disclaimer { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
[data-theme="dark"] .j-logo-color { filter: brightness(0) invert(1); }

/* =============================================================
   Protocolli: scarica in PDF o TXT, elimina sessione
   ============================================================= */
.menu-list.dl-list { min-width: 250px; padding: 6px 6px 4px; }
.dl-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 9px; }
.dl-row + .dl-row { border-top: 1px solid var(--line); border-radius: 0; }
.dl-name { flex: 1; min-width: 0; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-fmt {
  border: 0; background: var(--ice); color: var(--blue); text-decoration: none; cursor: pointer;
  min-width: 46px; height: 32px; padding: 0 10px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.03em;
}
.dl-fmt:hover:not(:disabled) { background: var(--blue); color: #fff; }
.dl-fmt:disabled { opacity: 0.6; cursor: progress; }
.dl-fmt:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ended .dl-rows { display: flex; flex-direction: column; width: min(420px, 100%); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; }
.recent-actions .btn-delete { margin-left: auto; border-color: transparent; color: var(--lavender); padding: 0 12px; }
.recent-actions .btn-delete:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* Versione stampabile del protocollo (/print) */
body.print-doc { max-width: 760px; margin: 0 auto; padding: 32px 24px 56px; background: #fff; color: var(--ink); }
.print-hint { margin: 0 0 24px; padding: 12px 16px; border-radius: var(--r-s); background: var(--ice); color: var(--blue); font-size: 15px; }
.print-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.print-head img { height: 20px; width: auto; }
.print-head span { color: var(--muted); font-size: 14px; }
body.print-doc h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; color: var(--blue); }
.print-sub { margin: 0 0 6px; font-size: 17px; }
.print-meta { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 2px solid var(--blue); color: var(--muted); font-size: 13px; white-space: pre; }
.print-lines { list-style: none; margin: 0; padding: 0; }
.print-lines li { padding: 0 0 12px; break-inside: avoid; }
.print-text { font-size: 15px; line-height: 1.5; }
.print-lines li.is-untranslated .print-text { color: var(--muted); }
.print-sum { margin: 0 0 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); break-inside: avoid; }
.print-sum-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; color: var(--blue); }
.print-sum-list { margin: 0; padding-inline-start: 20px; font-size: 15px; line-height: 1.5; }
.print-sum-list li { margin-bottom: 4px; }
.print-sum-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.print-note { margin-top: 18px; color: var(--muted); font-size: 12px; }
@media print {
  @page { size: A4; margin: 18mm 18mm 20mm; }
  body.print-doc { padding: 0; max-width: none; }
  .print-hint { display: none; }
}

/* Impostazione consigliata: sempre sottolineata */
.rec-note { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; color: var(--blue, inherit); font-size: 13px; margin-left: 6px; }
.next-hint { margin: 4px 0 0; }

/* ---- Semplicità: testi grandi e chiari ---- */
.home-new .lede { font-size: 24px; max-width: 40ch; color: var(--ink); }
.home-new .form { max-width: 760px; gap: 34px; }
.home-new .field-label { font-size: 21px; font-weight: 700; margin-bottom: 4px; }
.home-new .field-hint { font-size: 17px; line-height: 1.45; color: #4b4f6b; }
.home-new .input, .home-new .select { min-height: 58px; font-size: 19px; }
.home-new .chip span { font-size: 19px; padding: 13px 24px; }
.home-new .btn-lg { min-height: 64px; font-size: 20px; padding: 0 40px; }
.step-note { margin: 0; padding: 16px 20px; border-radius: 14px; background: var(--ice); color: var(--ink); font-size: 18px; line-height: 1.45; border-left: 5px solid var(--blue); }
.ctx-summary { padding: 18px 32px; }
.ctx-summary-title { font-size: 20px; font-weight: 700; }
.ctx-toggle { margin-left: auto; padding: 8px 18px; border-radius: 999px; background: var(--ice); color: var(--blue); font-weight: 600; font-size: 15px; }
.ctx-pane[open] .ctx-toggle-open, .ctx-pane:not([open]) .ctx-toggle-close { display: none; }
.ctx-pane .field-hint { font-size: 16px; }
.ctx-next { display: flex; justify-content: flex-end; padding: 8px 32px 28px; }
.pane-slides .pane-head .h3 { font-size: 22px; }
.rec-note { font-size: 15px; }
@media (max-width: 720px) { .ctx-next { padding: 8px 16px 24px; } .ctx-next .btn { width: 100%; } .home-new .lede { font-size: 20px; } }

/* ---- Schermata sessione: compatta, con impostazioni separate ---- */
.band { padding: 14px 24px; gap: 14px 24px; }
.qr-mini { width: 84px; height: 84px; }
.band-code { font-size: 40px; }
.band-actions { margin-top: 8px; }
.aud-total { font-size: 40px; }
.band-title { font-size: clamp(20px, 2vw, 26px); }
.settings { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fafbff; }
.setcard { flex: 1 1 360px; display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.setcard-audience { border-color: #c9d0ff; background: var(--ice); }
.setcard-title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); }
.setcard-sub { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 6px; }
.expected-row { align-items: flex-start; }
.expected-label { font-size: 13px; font-weight: 600; color: var(--ink, inherit); padding-top: 9px; }
.expected-hint { flex: 1 1 100%; margin: 0; font-size: 13px; color: var(--muted); text-wrap: balance; }
.setcard-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.btn-mic { min-height: 46px; font-size: 16px; }
.meter { width: 90px; }
.info-btn { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--blue); background: #fff; color: var(--blue); font: italic 700 14px/1 inherit; cursor: pointer; padding: 0; }
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--blue); color: #fff; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(8, 16, 90, 0.5); }
.modal[hidden] { display: none; }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 20px; padding: 28px 30px; box-shadow: 0 24px 80px rgba(8, 16, 90, 0.4); }
.latency-help-title { margin: 0 0 8px; font-weight: 700; font-size: 22px; }
.modal-card dl { margin: 0 0 22px; }
.modal-card dt { font-weight: 700; font-size: 18px; margin-top: 16px; }
.modal-card dd { margin: 4px 0 0; color: #4b4f6b; font-size: 16px; line-height: 1.5; }
.help-rec { font-weight: 600; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
/* Traduzione e presentazione: più compatte, tutto visibile senza scorrere */
.ctx-summary { padding: 10px 24px; }
.ctx-summary-title { font-size: 17px; }
.ctx-toggle { padding: 5px 14px; font-size: 14px; }
.pane-head { padding: 12px 24px 8px; }
.pane-slides .pane-head .h3, .pane-feed .pane-head .h3 { font-size: 18px; }
.feed { padding: 4px 24px 12px; min-height: 140px; }
.row { padding: 10px 0; }
.row-tr { font-size: 19px; }
.interim { padding: 10px 24px; min-height: 44px; }
.slides-body { padding: 0 24px 16px; }
.deck-start { gap: 10px; }
.deck-start .dropzone { padding: 16px 22px; gap: 8px; flex-direction: column; }
.dropzone-title { font-size: 20px; max-width: none; }
.deck-start .dropzone p { font-size: 14px; }
.gs-form { padding: 12px 16px; }
@media (max-width: 720px) { .settings { padding: 10px 16px; } .band { padding: 14px 16px; } }

.field-group { display: inline-flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.field-group .field-inline { flex-wrap: nowrap; }

/* ---- Etichetta "traduzione automatica (IA)" sul grande schermo (B2.5) ---- */
.stage-ai { margin-left: auto; font-size: 1em; font-weight: 600; letter-spacing: 0.02em; opacity: 0.95; padding: 0.25em 0.7em; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.45); white-space: nowrap; }
body.stage[data-look="light"] .stage-ai { border-color: var(--blue); color: var(--blue); }

/* ---- Privacy e conservazione (B2.12, B2.10) ---- */
.priv-body { padding: 0 32px 12px; display: grid; gap: 8px; }
.priv-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.priv-check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--blue); cursor: pointer; }
.priv-check-text { display: grid; gap: 2px; }
.priv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.priv-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.priv-body .field-hint { font-size: 14px; line-height: 1.4; }
.priv-body .input, .priv-body .select { padding-top: 8px; padding-bottom: 8px; }
.priv-delete { color: var(--red); }
.priv-pane.is-todo > .ctx-summary .ctx-status { color: var(--red); font-weight: 600; }
.priv-pane.is-ok > .ctx-summary .ctx-status { color: var(--green); }
@media (max-width: 900px) { .priv-grid { grid-template-columns: 1fr; } .priv-body { padding: 4px 16px 16px; } }

/* ---- Tendine uniformi: stessa barra, stessa altezza, stesso comportamento (v3.4.6) ---- */
.set-pane .settings { border-bottom: 0; padding: 4px 24px 14px; }
.work-pane[open] { display: flex; flex-direction: column; flex: none; }
/* Altezza propria: traduzione e presentazione scorrono dentro i loro riquadri, la pagina scorre sotto. */
.work-pane > .live-grid { flex: none; height: clamp(520px, 78vh, 920px); border-top: 1px solid var(--line); }
.btn-end { margin-top: 10px; background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.7); color: #fff; }
.btn-end:hover:not(:disabled) { background: #fff; color: var(--red); border-color: #fff; }
.step-note { text-wrap: balance; }
/* Allineamenti: tutti i blocchi della sessione usano gli stessi margini laterali (24 px) */
.priv-body { padding-left: 24px; padding-right: 24px; }
.mock { margin-left: 24px; margin-right: 24px; }
.band-session { justify-content: center; }
@media (max-width: 720px) { .priv-body { padding-left: 16px; padding-right: 16px; } .mock { margin-left: 16px; margin-right: 16px; } }

/* Numero del passo davanti al titolo di ogni tendina (v3.4.7) */
.ctx-step { flex: none; display: inline-flex; align-items: center; gap: 0.35em; padding: 3px 11px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }

/* Punti chiave nella schermata di fine sessione */
.sum-box { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: min(520px, 100%); padding-top: 8px; }
.sum-box .h3 { margin: 0; }
.sum-box p { margin: 0; }
.sum-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Impostazioni pubblico: le tre modalità elencate sotto la scelta, il riquadro si riempie come quello dello speaker */
.mode-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; justify-content: space-between; }
.mode-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; border: 1px solid #c9d0ff; background: #fff; }
.mode-item.is-current { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.mode-name { font-weight: 700; font-size: 15px; }
.mode-hint { font-size: 14px; color: var(--muted); line-height: 1.4; }

/* Impostazioni speaker: le righe si distribuiscono in tutta l'altezza del riquadro */
.setcard:not(.setcard-audience) > .setcard-row { flex: 1 1 auto; align-content: space-around; }
.setcard:not(.setcard-audience) > .expected-row { align-content: center; }

/* =============================================================
   Schermo grande personalizzato (Passo 6)
   Variabili del cliente (stage.js → applyPalette): --brand, --brand-ink, --brand-deep,
   --brand-accent, --brand-accent-light, --brand-on-light, --slides-ink
   ============================================================= */
body.stage:not(.ready) .stage-grid, body.stage:not(.ready) .stage-mark { visibility: hidden; }

/* Marchio del cliente (in alto) */
.stage-brand { display: inline-flex; align-items: center; min-width: 0; }
.stage-brand [hidden] { display: none !important; }
.stage-brand-name { font-size: 1.35em; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-brand-logo { max-width: 11em; height: 2.2em; object-fit: contain; object-position: left center; }
.stage-brand-logo.on-plate { padding: 0.3em 0.6em; border-radius: 0.5em; background: #fff; box-sizing: content-box; }

/* Titolo dell'evento e relatori */
.stage-event { margin-top: 2.4vh; display: grid; gap: 0.5em; }
.stage-event [hidden] { display: none; }
.stage-event p { margin: 0; overflow-wrap: anywhere; }
.stage-event-title { font-size: clamp(15px, 1.35vw, 30px); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stage-event-speakers { font-size: clamp(12px, 0.95vw, 21px); line-height: 1.35; white-space: pre-line; color: var(--lavender); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
body.stage[data-layout="bottom"] .stage-event { display: none; }
body.stage[data-look="light"] .stage-event-speakers { color: var(--muted); }

/* Marchio del tool: sempre in basso a destra */
.stage-mark {
  --mark-h: clamp(13px, 1.4vw, 28px);
  position: fixed; right: var(--stage-pad); bottom: calc(var(--stage-pad) * 0.35); z-index: 4; pointer-events: none;
  color: rgba(255, 255, 255, 0.72);
}
.stage-mark span { display: block; height: var(--mark-h); width: calc(var(--mark-h) * 4.75); background: currentColor; -webkit-mask: url(/img/logo-white.svg) no-repeat right center / contain; mask: url(/img/logo-white.svg) no-repeat right center / contain; }
body.stage[data-look="light"] .stage-mark { color: var(--muted); }
body.stage[data-layout="bottom"] .stage-mark { bottom: calc(var(--split-h) + 1.2vh); }
body.stage[data-layout="left"] .stage-num, body.stage[data-layout="bottom"] .stage-num, body.stage.slides-only .stage-num { right: calc(var(--stage-pad) + var(--mark-w, 7.4vw)); }
body.stage .stage-num { bottom: calc(var(--stage-pad) * 0.35 + 0.15em); }
body.stage.is-branded[data-look="blue"][data-layout="left"] .stage-mark,
body.stage.is-branded[data-look="blue"].slides-only .stage-mark { color: color-mix(in srgb, var(--slides-ink) 75%, transparent); }
body.stage.is-branded[data-look="blue"][data-layout="right"] .stage-mark,
body.stage.is-branded[data-look="blue"].cap-only .stage-mark { color: color-mix(in srgb, var(--brand-ink) 78%, transparent); }
body.stage.is-branded[data-look="blue"][data-layout="bottom"] .stage-mark { color: color-mix(in srgb, var(--slides-ink) 75%, transparent); }

/* Colori del cliente nell'aspetto "brand" */
body.stage.is-branded[data-look="blue"] .stage-captions { background: var(--brand); color: var(--brand-ink); }
body.stage.is-branded[data-look="blue"] .stage-slides { background: var(--brand-deep); }
body.stage.is-branded[data-look="blue"] .stage-num { color: color-mix(in srgb, var(--slides-ink) 70%, transparent); }
body.stage.is-branded[data-look="blue"] .stage-cap { color: color-mix(in srgb, var(--brand-ink) 62%, var(--brand)); }
body.stage.is-branded[data-look="blue"] .stage-cap:nth-last-child(2) { color: color-mix(in srgb, var(--brand-ink) 86%, var(--brand)); }
body.stage.is-branded[data-look="blue"] .stage-cap:last-child { color: var(--brand-ink); }
body.stage.is-branded.has-accent[data-look="blue"] .stage-cap:last-child { color: var(--brand-accent); }
body.stage.is-branded[data-look="blue"] .stage-waiting,
body.stage.is-branded[data-look="blue"] .stage-join p,
body.stage.is-branded[data-look="blue"] .stage-event-speakers { color: color-mix(in srgb, var(--brand-ink) 75%, var(--brand)); }
body.stage.is-branded[data-look="blue"] .stage-join strong { color: var(--brand-ink); }
body.stage.is-branded[data-look="blue"] .stage-join { border-top-color: color-mix(in srgb, var(--brand-ink) 28%, transparent); }
body.stage.is-branded[data-look="blue"] .stage-lang { background: color-mix(in srgb, var(--brand-ink) 16%, transparent); }
body.stage.is-branded[data-look="blue"] .stage-ai { border-color: color-mix(in srgb, var(--brand-ink) 50%, transparent); }
/* Aspetto chiaro con i colori del cliente */
body.stage.is-branded[data-look="light"] .stage-cap:last-child { color: var(--brand-on-light); }
body.stage.is-branded.has-accent[data-look="light"] .stage-cap:last-child { color: var(--brand-accent-light, var(--brand-on-light)); }
body.stage.is-branded[data-look="light"] .stage-lang { color: var(--brand-on-light); }
body.stage.is-branded[data-look="light"] .stage-ai { border-color: var(--brand-on-light); color: var(--brand-on-light); }
body.stage.is-branded[data-look="light"] .stage-join strong { color: var(--brand-on-light); }
body.stage.is-branded[data-look="night"] .stage-cap:last-child { color: #fff; }
body.stage.is-branded.has-accent[data-look="night"] .stage-cap:last-child { color: var(--brand-accent, #fff); }

/* Schermata di attesa, pausa e finale */
.stage-cover {
  position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3.2vh; padding: 6vh 8vw; text-align: center; background: var(--blue); color: #fff;
}
.stage-cover[hidden] { display: none; }
body.stage[data-look="night"] .stage-cover { background: var(--night); }
body.stage[data-look="light"] .stage-cover { background: #fff; color: var(--ink); }
body.stage.is-branded[data-look="blue"] .stage-cover { background: var(--brand); color: var(--brand-ink); }
.stage-cover > * { margin: 0; max-width: 60ch; }
.stage-cover [hidden] { display: none !important; }
.cover-brand { display: flex; justify-content: center; align-items: center; max-width: 80%; }
.cover-brand img { height: clamp(48px, 9vh, 150px); width: auto; max-width: 60vw; object-fit: contain; }
.cover-brand img.on-plate { padding: 1.6vh 2.6vh; border-radius: 1.6vh; background: #fff; box-sizing: content-box; }
.cover-brand span { font-size: clamp(30px, 5vw, 96px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.cover-title { font-size: clamp(22px, 3.2vw, 64px); font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; }
.cover-speakers { font-size: clamp(15px, 1.7vw, 34px); line-height: 1.4; white-space: pre-line; opacity: 0.82; }
.cover-text { font-size: clamp(20px, 2.6vw, 52px); font-weight: 500; line-height: 1.2; }
.stage-cover[data-kind="pause"] .cover-text, .stage-cover[data-kind="end"] .cover-text { font-size: clamp(30px, 5vw, 96px); font-weight: 600; letter-spacing: -0.02em; }
.cover-join { display: flex; align-items: center; gap: 1.6vw; margin-top: 1.5vh; text-align: left; }
.cover-join .stage-qr { width: clamp(90px, 11vh, 220px); }
.cover-join p { margin: 0; display: flex; flex-direction: column; gap: 0.2em; font-size: clamp(13px, 1.2vw, 26px); opacity: 0.85; }
.cover-join strong { font-size: 2em; font-weight: 500; font-variant-numeric: tabular-nums; opacity: 1; }
.cover-end strong { font-size: 1.2em; overflow-wrap: anywhere; }
body.stage.hide-qr .cover-join:not(.cover-end) { display: none; }
body.stage.hide-qr .stage-cover { }

/* =============================================================
   Tendina "Personalizza il tuo schermo" (dashboard dello speaker)
   ============================================================= */
.scr-body { display: grid; gap: 16px; padding: 4px 24px 22px; }
.scr-intro { margin: 0; max-width: 80ch; }
.scr-card { display: flex; flex-direction: column; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; min-width: 0; }
.scr-card-head { display: grid; gap: 4px; }
.scr-card-head .field-hint, .scr-card .field-hint, .scr-card .field-label { margin: 0; }
.scr-title { margin: 0; font-size: 19px; font-weight: 700; }
.scr-sub { margin: 0 0 2px; font-size: 16px; font-weight: 700; color: var(--blue); }
.scr-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.scr-settings { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.scr-block { display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.scr-block:last-child { padding-bottom: 0; border-bottom: 0; }
.scr-aside { display: flex; flex-direction: column; gap: 10px; min-width: 0; align-self: start; position: sticky; top: 84px; }
.scr-screens .scr-aside { position: static; align-self: stretch; }
.scr-logo { display: flex; align-items: center; gap: 14px; }
.scr-logo-box { flex: none; width: 132px; height: 72px; display: grid; place-items: center; border: 1px dashed var(--ice-2); border-radius: 12px; background: var(--ice); overflow: hidden; padding: 6px; }
.scr-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.scr-logo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scr-colors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.scr-color { display: grid; gap: 6px; min-width: 0; }
.scr-color-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.scr-pick { flex: none; width: 44px; height: 44px; padding: 3px; border: 1px solid var(--ice-2); border-radius: 10px; background: #fff; cursor: pointer; }
.scr-hex { min-width: 0; font-variant-numeric: tabular-nums; text-transform: lowercase; }
.scr-row { display: flex; flex-wrap: wrap; gap: 8px; }
.scr-msg:empty { display: none; }
.scr-msg[data-bad="1"], #scrSaveState[data-bad="1"] { color: var(--red); }
.scr-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--ice); }
.scr-seg button { flex: 1; min-height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.scr-seg button[aria-checked="true"] { background: var(--blue); color: #fff; }
.scr-seg button:focus-visible, .scr-modes button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Le quattro schermate, ognuna con la sua spiegazione */
.scr-modes { display: grid; gap: 8px; flex: 1; grid-auto-rows: 1fr; }
.scr-modes button { display: grid; gap: 4px; align-content: center; text-align: left; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
.scr-modes button strong { font-size: 16px; }
.scr-modes button span { font-size: 14px; line-height: 1.4; color: var(--muted); }
.scr-modes button[aria-checked="true"] { border-color: var(--blue); background: var(--ice); box-shadow: inset 0 0 0 1px var(--blue); }
.scr-modes button[aria-checked="true"] strong { color: var(--blue); }
.scr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 960px) {
  .scr-body { padding-left: 16px; padding-right: 16px; }
  .scr-split { grid-template-columns: 1fr; }
  .scr-aside { position: static; }
  .scr-colors { grid-template-columns: 1fr; }
  .scr-seg { flex-wrap: wrap; }
}

/* Apertura dello schermo grande, fuori dalle tendine */
.launch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: center; margin: 16px 24px 24px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--ice); }
.launch.is-ready { border-color: var(--blue); }
.launch-text { display: grid; gap: 8px; justify-items: start; }
.launch-title { margin: 0; font-size: 21px; font-weight: 700; }
.launch-hint { margin: 0; font-size: 15px; color: var(--muted); }
.launch:not(.is-ready) .launch-hint { color: var(--red); }
.launch-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.launch-form .field { margin: 0; }
.launch-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.launch-actions .btn { width: 100%; justify-content: center; }
.launch-form :disabled, .launch-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 960px) { .launch { grid-template-columns: 1fr; margin-left: 16px; margin-right: 16px; } .launch-form { grid-template-columns: 1fr; } .launch-actions { grid-template-columns: 1fr; } }

/* Anteprima del pannello della traduzione */
.scr-preview { --pv-bg: var(--blue); --pv-ink: #fff; --pv-soft: var(--lavender); --pv-slides: var(--night); --pv-mark: #fff;
  display: grid; grid-template-columns: 62% 38%; border-radius: 12px; overflow: hidden; min-height: 230px; border: 1px solid var(--line); }
.scr-preview[data-look="night"] { --pv-bg: var(--night); --pv-slides: #000; }
.scr-preview[data-look="light"] { --pv-bg: #fff; --pv-ink: var(--ink); --pv-soft: var(--muted); --pv-slides: var(--fog); --pv-mark: var(--muted); }
.scr-preview.is-branded[data-look="blue"] { --pv-bg: var(--brand); --pv-ink: var(--brand-ink); --pv-soft: color-mix(in srgb, var(--brand-ink) 72%, var(--brand)); --pv-slides: var(--brand-deep); }
.scr-preview.is-branded[data-look="blue"] .sp-slides { --pv-mark: color-mix(in srgb, var(--brand-ink) 70%, var(--brand-deep)); }
.sp-panel { background: var(--pv-bg); color: var(--pv-ink); padding: 4% 5%; display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: clamp(9px, 1.1vw, 13px); }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sp-brand { display: inline-flex; align-items: center; min-width: 0; font-weight: 700; font-size: 1.3em; }
.sp-brand img { height: 2em; max-width: 8em; object-fit: contain; }
.sp-brand img.on-plate { padding: 0.25em 0.5em; border-radius: 0.4em; background: #fff; box-sizing: content-box; }
.sp-brand [hidden] { display: none; }
.sp-pill { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.2em 0.7em; border-radius: 999px; background: color-mix(in srgb, var(--pv-ink) 16%, transparent); font-weight: 600; }
.sp-pill i { width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--green); }
.sp-event { color: var(--pv-soft); font-size: 0.95em; }
.sp-caps { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.4em; }
.sp-caps p { margin: 0; line-height: 1.25; color: var(--pv-soft); font-size: 1.15em; }
.sp-caps .sp-last { color: var(--pv-ink); font-weight: 500; }
.scr-preview.is-branded.has-accent .sp-last { color: var(--brand-accent); }
.scr-preview.is-branded[data-look="light"] .sp-last { color: var(--brand-on-light); }
.sp-join { display: flex; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--pv-ink) 25%, transparent); }
.sp-qr { width: 2.8em; aspect-ratio: 1; background: #fff; border-radius: 4px; background-image: repeating-conic-gradient(#000 0 25%, #fff 0 50%); background-size: 6px 6px; }
.sp-code { font-size: 1.3em; font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-slides { background: var(--pv-slides); position: relative; }
.sp-slides::before { content: ""; position: absolute; inset: 14% 10% 26%; border-radius: 4px; background: color-mix(in srgb, var(--pv-mark) 14%, transparent); }
.sp-mark { position: absolute; right: 8%; bottom: 7%; height: 1.15em; width: 5.4em; background: var(--pv-mark); opacity: 0.8; -webkit-mask: url(/img/logo-white.svg) no-repeat right center / contain; mask: url(/img/logo-white.svg) no-repeat right center / contain; font-size: clamp(9px, 1.1vw, 13px); }
body.stage[data-look="light"] .stage-brand-logo.on-plate { background: transparent; padding: 0; }
.stage-mark { z-index: 9; }
body.stage.is-branded[data-look="blue"]:has(.stage-cover:not([hidden])) .stage-mark { color: color-mix(in srgb, var(--brand-ink) 75%, transparent); }
.scr-aside .scr-block-theme { margin-top: 8px; padding-top: 18px; padding-bottom: 0; border-top: 1px solid var(--line); border-bottom: 0; }

/* Controlli audio: prova di 10 secondi, avvisi sul livello e consigli per il mixer */
.audio-result { flex: 1 1 240px; margin: 0; font-size: 14px; line-height: 1.4; color: var(--muted); text-wrap: balance; }
.audio-result[data-state="ok"] { color: #1f7a1b; font-weight: 600; }
.audio-result[data-state="low"], .audio-result[data-state="high"], .audio-result[data-state="absent"] { color: var(--red); font-weight: 600; }
.audio-guide { padding: 12px 16px; border-radius: 10px; background: var(--ice); font-size: 14px; line-height: 1.45; color: var(--blue); }
.audio-guide-title { margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.audio-guide ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.meter.is-hot span { background: var(--red); }
.audio-guide li { text-wrap: pretty; }

/* Vista semplice / tecnica: interruttore, PIN, riquadro Microfono */
.tech-toggle.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.launch-note { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.45; }
.mic-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: center; }
.mic-controls .btn { width: 100%; justify-content: center; }
.mic-level { display: grid; gap: 8px; }
.mic-level .meter { width: 100%; }
.mic-controls .audio-result { flex: none; }
@media (max-width: 960px) { .mic-controls { grid-template-columns: 1fr; } }
.tech-pin { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-size: 14px; }
.tech-pin-label { font-weight: 600; }
.tech-pin-value { font-size: 20px; letter-spacing: 0.25em; color: var(--blue); }
.tech-pin-hint { color: var(--muted); }
.pinnote { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 14px 24px 0; padding: 14px 16px; border-radius: var(--r); background: var(--ice); color: var(--blue); font-size: 15px; }
.pinnote p { margin: 0; flex: 1 1 320px; }
.pinnote-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tech-card { display: grid; gap: 12px; width: min(420px, 100%); }
.tech-card p { margin: 0; }
.tech-input { font-size: 24px; letter-spacing: 0.4em; text-align: center; }
.tech-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tech-actions .btn { width: 100%; justify-content: center; }
.tech-toggle.is-on:hover:not(:disabled) { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
#micLaunch { margin-bottom: 0; }
.mic-controls .btn-soft { background: #fff; border: 1px solid var(--line); }
.mic-controls .btn-soft:hover:not(:disabled) { border-color: var(--accent); }

/* =============================================================
   Vista semplice: una sola schermata compatta.
   Tre schede affiancate sempre aperte (Privacy, Contesto, Schermo), poi traduzione e presentazione,
   poi Microfono e Schermo grande affiancati. Le opzioni secondarie (.adv) stanno dietro "Altre opzioni".
   La vista tecnica (senza body.view-client) resta quella a tendine.
   ============================================================= */
.more-btn { display: none; }
body.view-client #view-live { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; align-content: start; padding: 0 24px 28px; }
body.view-client #view-live > * { grid-column: 1 / -1; margin: 0; min-width: 0; }
body.view-client #view-live > .band { margin: 0 -24px; }
body.view-client #view-live > .banner, body.view-client #view-live > .pinnote, body.view-client #view-live > .mock { margin-top: 16px; margin-bottom: 0; }
body.view-client #privPane, body.view-client #ctxPane, body.view-client #screenPane { grid-column: span 2; order: 1; }
body.view-client #ctxPane { order: 2; }
body.view-client #screenPane { order: 3; }
body.view-client #workPane { order: 4; }
body.view-client #micLaunch, body.view-client #stageLaunch { grid-column: span 3; order: 5; }
body.view-client #view-live > .band { margin-bottom: 0; }
body.view-client #view-live > .band + * { margin-top: 16px; }

/* Le schede */
body.view-client .ctx-pane { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; }
body.view-client .ctx-pane > .ctx-summary { cursor: default; padding: 14px 18px 6px; flex-wrap: wrap; gap: 6px 10px; }
body.view-client .ctx-summary::before, body.view-client .ctx-step, body.view-client .ctx-toggle { display: none; }
body.view-client .ctx-summary-title { font-size: 18px; }
body.view-client .ctx-status { margin-left: auto; font-size: 13px; }
body.view-client .more-btn { display: inline-flex; flex: none; margin-left: 0; padding: 4px 12px; font-size: 13px; }
body.view-client .ctx-pane:not(.show-more) .adv { display: none !important; }

/* Privacy */
body.view-client .priv-body { padding: 4px 18px 16px; gap: 10px; }
body.view-client .priv-grid { grid-template-columns: 1fr; gap: 10px; }
body.view-client .priv-check { align-items: flex-start; }
body.view-client .priv-foot { justify-content: flex-end; }

/* Contesto */
body.view-client .ctx-body { grid-template-columns: 1fr; gap: 12px; padding: 4px 18px 16px; }
body.view-client .ctx-main .textarea { min-height: 110px; }
body.view-client .ctx-hint { font-size: 14px; }
body.view-client .ctx-pane:not(.show-more) .ctx-side .field-label { display: none; }
body.view-client .ctx-pane:not(.show-more) #ctxFiles:empty { display: none; }

/* Schermo */
body.view-client .scr-body { padding: 4px 18px 16px; gap: 12px; }
body.view-client .scr-card { padding: 0; border: 0; gap: 12px; }
body.view-client .scr-split { grid-template-columns: 1fr; gap: 12px; }
body.view-client .scr-block { padding-top: 0; }

/* Traduzione e presentazione: area di lavoro a tutta larghezza */
body.view-client #workPane > .ctx-summary { padding-bottom: 10px; }
body.view-client #workPane > .live-grid { height: clamp(460px, 70vh, 800px); border-top: 1px solid var(--line); }

/* Microfono e Schermo grande affiancati */
body.view-client .launch { grid-template-columns: 1fr; gap: 14px; align-items: start; margin: 0; padding: 18px; }
body.view-client .launch-form, body.view-client .mic-controls { grid-template-columns: 1fr 1fr; }
body.view-client .launch-text { gap: 4px; }

@media (max-width: 1100px) {
  body.view-client #privPane, body.view-client #ctxPane, body.view-client #screenPane { grid-column: 1 / -1; }
  body.view-client #micLaunch, body.view-client #stageLaunch { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body.view-client #view-live { padding: 0 16px 24px; }
  body.view-client #view-live > .band { margin: 0 -16px; }
  body.view-client .launch-form, body.view-client .mic-controls { grid-template-columns: 1fr; }
}
body.view-client .ctx-pane > .ctx-summary { display: flex; flex-wrap: wrap; align-items: center; }
body.view-client .ctx-summary-title { order: 0; }
body.view-client .more-btn { order: 1; margin-left: auto; }
body.view-client .ctx-status { order: 2; flex: 1 1 100%; margin-left: 0; min-height: 1.3em; white-space: normal; }
body.view-client #workPane > .live-grid { height: clamp(360px, 48vh, 540px); }
body.view-client .scr-block { border-bottom: 0; padding-bottom: 0; }

/* Rifiniture vista semplice: intestazione a griglia (titolo, poi stato e "Altre opzioni" sulla stessa riga) */
body.view-client .ctx-pane > .ctx-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
body.view-client .ctx-summary-title { grid-column: 1 / -1; }
body.view-client .ctx-status { grid-column: 1; grid-row: 2; order: 0; flex: none; min-height: 0; }
body.view-client .ctx-status:empty { display: none; }
body.view-client .more-btn { grid-column: 2; grid-row: 2; order: 0; margin: 0; }
body.view-client .ctx-next { display: none; }
body.view-client .launch { align-content: space-between; }
body.view-client .launch .btn-outline { background: #fff; }

/* =============================================================
   Identità dei blocchi: ogni blocco ha un colore proprio (--blk), bordo alto marcato,
   testata tinta e un punto colorato davanti al titolo. Vale per la vista cliente e per quella tecnica.
   ============================================================= */
#privPane { --blk: #1f9d55; }
#ctxPane { --blk: #6a4cff; }
#screenPane { --blk: #f08a00; }
#workPane { --blk: #001cff; }
#micLaunch { --blk: #e6332a; }
#stageLaunch { --blk: #00062e; }
.setcard { --blk: #e6332a; }
.setcard-audience { --blk: #6a4cff; }

body.view-client .ctx-pane, body.view-tech .setcard, body.view-client .launch, body.view-tech .launch {
  border: 1px solid color-mix(in srgb, var(--blk) 28%, #fff);
  border-top: 5px solid var(--blk);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--blk) 10%, transparent);
}
body.view-client .ctx-pane > .ctx-summary { background: color-mix(in srgb, var(--blk) 9%, #fff); }
body.view-client .ctx-summary-title, body.view-tech .setcard-title, body.view-client .launch-title, body.view-tech .launch-title {
  display: inline-flex; align-items: center; gap: 10px; color: var(--ink);
}
body.view-client .ctx-summary-title::before, body.view-tech .setcard-title::before, body.view-client .launch-title::before, body.view-tech .launch-title::before {
  content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--blk);
}
body.view-client .launch, body.view-tech .launch { background: color-mix(in srgb, var(--blk) 7%, #fff); }
#stageLaunch { background: #fff; }
body.view-client #stageLaunch, body.view-tech #stageLaunch { background: color-mix(in srgb, var(--blk) 6%, #fff); }

/* Vista tecnica: solo microfono, audio e voce del pubblico, tutto in una schermata. */
body.view-tech #privPane, body.view-tech #ctxPane, body.view-tech #workPane, body.view-tech #screenPane { display: none; }
body.view-tech #controls > .ctx-summary { display: none; }
body.view-tech #controls { display: block; border: 0; background: transparent; order: 1; }
body.view-tech #view-live { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; align-content: start; padding: 0 24px 28px; }
body.view-tech #view-live > * { grid-column: 1 / -1; margin: 0; min-width: 0; }
body.view-tech #view-live > .band { margin: 0 -24px 0; }
body.view-tech #view-live > .band + * { margin-top: 16px; }
body.view-tech #view-live > .banner, body.view-tech #view-live > .mock { margin-top: 16px; margin-bottom: 0; }
body.view-tech #micLaunch, body.view-tech #stageLaunch { grid-column: span 3; order: 2; }
body.view-tech .set-pane .settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0; background: transparent; border: 0; }
body.view-tech .setcard { flex: none; padding: 16px 18px 18px; border-radius: var(--r); background: color-mix(in srgb, var(--blk) 6%, #fff); border-color: color-mix(in srgb, var(--blk) 28%, #fff); }
body.view-tech .setcard-audience { background: color-mix(in srgb, var(--blk) 6%, #fff); }
body.view-tech .tech-pin { grid-column: 1 / -1; }
body.view-tech .launch { grid-template-columns: 1fr; gap: 14px; align-items: start; margin: 0; padding: 18px; align-content: space-between; }
body.view-tech .launch-form, body.view-tech .mic-controls { grid-template-columns: 1fr 1fr; }
body.view-tech .launch .btn-outline { background: #fff; }
@media (max-width: 1100px) {
  body.view-tech .set-pane .settings { grid-template-columns: 1fr; }
  body.view-tech #micLaunch, body.view-tech #stageLaunch { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body.view-tech #view-live { padding: 0 16px 24px; }
  body.view-tech #view-live > .band { margin: 0 -16px; }
  body.view-tech .launch-form, body.view-tech .mic-controls { grid-template-columns: 1fr; }
}

/* =============================================================
   Adattamento a ogni schermo: barra in alto e barra strumenti dello schermo grande
   ============================================================= */
.stage-toolbar { max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
@media (max-width: 640px) {
  .appbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 16px; row-gap: 8px; }
  .appbar-tools { flex: 1 1 100%; margin-left: 0; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-width: 0; }
  .appbar-tools .btn { padding-left: 14px; padding-right: 14px; }
  .stage-toolbar { border-radius: 26px; bottom: 12px; }
}

/* Traduzione e presentazione: sotto i 1180 px le due colonne si impilano e l'altezza segue il contenuto
   (prima l'altezza fissa faceva sovrapporre i due blocchi). */
@media (max-width: 1180px) {
  .work-pane > .live-grid, body.view-client #workPane > .live-grid { height: auto; grid-template-rows: auto auto; }
  .work-pane .pane { min-height: 0; overflow: visible; }
  .work-pane .pane-feed { min-height: 320px; }
  .work-pane .feed { max-height: 50vh; min-height: 200px; }
}
.brand-name { white-space: nowrap; }
@media (max-width: 900px) { .brand-name { display: none; } }

/* Anche su schermi PC piccoli il contenuto della presentazione non viene più tagliato: altezza minima, non fissa. */
@media (min-width: 1181px) {
  body.view-client #workPane > .live-grid, .work-pane > .live-grid { height: auto; min-height: clamp(420px, 60vh, 760px); }
  .work-pane .feed { max-height: 68vh; }
}
body.view-tech .set-pane .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.view-tech .setcard, body.view-tech .tech-pin { min-width: 0; max-width: 100%; }
@media (max-width: 1100px) { body.view-tech .set-pane .settings { grid-template-columns: minmax(0, 1fr); } }
