/* ==================================================================
   PitchFlow — foglio di stile, temi chiaro e scuro
   ================================================================== */
/* --- Temi ---------------------------------------------------------------
   Un solo insieme di nomi, due valori. Il tema e' scritto su <html> da
   app.js (`data-theme`), quindi qui non servono media query: la scelta
   dell'utente e quella di sistema arrivano gia' risolte. */
:root {
  color-scheme: dark;

  --bg:          #12161f;   /* fondo pagina */
  --bg-2:        #171d28;   /* campi, incassi */
  --panel:       #1b222e;   /* superfici */
  --panel-2:     #222a38;   /* superfici in rilievo, bottoni */
  --line:        #2c3545;   /* bordi */
  --line-soft:   #232b39;

  --txt:         #eef2f8;
  --txt-dim:     #a3b0c2;
  --txt-faint:   #7c8a9d;

  --accent:      #35d6c4;   /* verde acqua: azione principale */
  --accent-2:    #5aa9ff;   /* azzurro: fuoco, collegamenti */
  --accent-ink:  #04211d;   /* testo sopra l'accento */
  --ref:         #45cfff;   /* traccia di riferimento */
  --mark:        #a78bfa;   /* porzione segnata */

  --ok:          #35e07a;
  --warn:        #ffc244;
  --bad:         #ff5f7a;
  --ok-ink:      #052613;
  --warn-ink:    #2b1c00;
  --bad-ink:     #2a0007;

  /* Sfondi tenui: la stessa tinta al 10%, il bordo al 32% */
  --tint-accent: rgba(53,214,196,.10);
  --edge-accent: rgba(53,214,196,.32);
  --tint-ok:     rgba(53,224,122,.10);
  --edge-ok:     rgba(53,224,122,.34);
  --tint-warn:   rgba(255,194,68,.10);
  --edge-warn:   rgba(255,194,68,.34);
  --tint-bad:    rgba(255,95,122,.11);
  --edge-bad:    rgba(255,95,122,.34);
  --tint-mark:   rgba(167,139,250,.12);
  --edge-mark:   rgba(167,139,250,.38);
  --txt-on-tint: #ffc9d2;   /* testo dentro i riquadri d'errore */

  --hover:       rgba(255,255,255,.06);
  --glass:       rgba(23,29,40,.78);
  --scrim:       rgba(6,9,14,.66);
  --halo:        rgba(90,169,255,.16);   /* alone del fuoco da tastiera */
  --tint-ref:    rgba(69,207,255,.13);
  --edge-ref:    rgba(69,207,255,.36);
  --needle:      #ffffff;
  --needle-edge: rgba(255,255,255,.32);
  --needle-halo: rgba(255,255,255,.22);

  --radius:      14px;
  --radius-sm:   10px;
  --radius-xs:   7px;
  --shadow:      0 18px 44px rgba(0,0,0,.42);
  --shadow-sm:   0 6px 18px rgba(0,0,0,.28);
  --page-glow-1: rgba(90,169,255,.10);
  --page-glow-2: rgba(53,214,196,.09);

  --mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;

  --bg:          #eef1f6;
  --bg-2:        #f6f8fb;
  --panel:       #ffffff;
  --panel-2:     #f2f5f9;
  --line:        #d9e0ea;
  --line-soft:   #e8edf3;

  --txt:         #1b2432;
  --txt-dim:     #55627a;
  --txt-faint:   #646f80;

  --accent:      #0a7d70;
  --accent-2:    #1f63c7;
  --accent-ink:  #ffffff;
  --ref:         #0a6ea6;
  --mark:        #7c5cf0;

  --ok:          #0e7a3c;
  --warn:        #8a5a0f;
  --bad:         #c22743;
  --ok-ink:      #ffffff;
  --warn-ink:    #ffffff;
  --bad-ink:     #ffffff;

  --tint-accent: rgba(10,125,112,.10);
  --edge-accent: rgba(10,125,112,.30);
  --tint-ok:     rgba(14,122,60,.10);
  --edge-ok:     rgba(14,122,60,.30);
  --tint-warn:   rgba(138,90,15,.11);
  --edge-warn:   rgba(138,90,15,.32);
  --tint-bad:    rgba(194,39,67,.09);
  --edge-bad:    rgba(194,39,67,.30);
  --tint-mark:   rgba(124,92,240,.11);
  --edge-mark:   rgba(124,92,240,.34);
  --txt-on-tint: #8d1f34;

  --hover:       rgba(16,26,42,.05);
  --glass:       rgba(255,255,255,.82);
  --scrim:       rgba(24,32,45,.34);
  --halo:        rgba(31,99,199,.18);
  --tint-ref:    rgba(10,110,166,.11);
  --edge-ref:    rgba(10,110,166,.32);
  --needle:      #1b2432;
  --needle-edge: rgba(27,36,50,.28);
  --needle-halo: rgba(27,36,50,.14);

  --shadow:      0 18px 40px rgba(28,40,62,.14);
  --shadow-sm:   0 4px 14px rgba(28,40,62,.09);
  --page-glow-1: rgba(31,99,199,.08);
  --page-glow-2: rgba(10,125,112,.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-image:
    radial-gradient(1100px 560px at 12% -12%, var(--page-glow-1), transparent 62%),
    radial-gradient(950px 520px at 92% -4%, var(--page-glow-2), transparent 58%);
  background-attachment: fixed;
}

.hidden { display: none !important; }

/* ------------------------------------------------------------------ */
/*  Topbar                                                             */
/* ------------------------------------------------------------------ */
.topbar {
  display: flex; flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  padding: 14px 22px;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}

.brand { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; }
.logo {
  width: 28px; height: 28px;
  align-self: center; flex-shrink: 0;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.auth-brand .logo { width: 34px; height: 34px; }
.brand h1 {
  font-size: 19px; font-weight: 700; margin: 0;
  letter-spacing: -.4px;
}
.brand h1 em, .auth-brand h2 em { font-style: normal; color: var(--accent); }
.brand-sub { font-size: 11px; color: var(--txt-faint); letter-spacing: .02em; }

.url-form { display: flex; gap: 8px; flex: 1; max-width: 720px; }

.url-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--txt);
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.url-form input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--halo);
}
.url-form input::placeholder { color: var(--txt-faint); }

.engine-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

/* --- Scelta del tema --------------------------------------------------- */
.theme-switch {
  display: flex; gap: 2px; flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
}
.theme-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: none; border-radius: 999px;
  background: transparent; color: var(--txt-faint);
  font-family: inherit; font-size: 12px; font-weight: 550;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.theme-opt:hover { color: var(--txt-dim); }
.theme-opt[aria-pressed="true"] {
  background: var(--panel-2);
  color: var(--txt);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------ */
/*  Bottoni                                                            */
/* ------------------------------------------------------------------ */
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--txt);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
  font-family: inherit;
}
.btn:hover:not(:disabled) { background: var(--hover); border-color: var(--txt-faint); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
  font-weight: 650;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }

.btn-ghost { background: transparent; }
.btn-small { padding: 7px 12px; font-size: 12px; }
.btn-ok { border-color: var(--edge-ok); background: var(--tint-ok); color: var(--ok); }

.btn-round {
  width: 42px; height: 42px;
  border-radius: 50%;
  padding: 0;
  font-size: 15px;
  display: grid; place-items: center;
}
#btn-play {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink); border-color: transparent;
  box-shadow: var(--shadow-sm);
}
#btn-play.playing { background: var(--panel-2); color: var(--txt); border-color: var(--line); }

.btn-mic.active {
  background: var(--bad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px var(--tint-bad);
}

/* spinner nel bottone Analizza */
.btn.loading .btn-label { opacity: .35; }
.btn.loading::after {
  content: ""; position: absolute;
  width: 14px; height: 14px; margin-left: -7px; left: 50%; top: calc(50% - 7px);
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-primary { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/*  Schermata di accesso                                               */
/* ------------------------------------------------------------------ */
.auth-gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--scrim);
  backdrop-filter: blur(10px);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; }
.auth-brand h2 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: -.4px; }

.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  background: var(--bg-2); padding: 4px; border-radius: 9px;
}
.auth-tab {
  flex: 1; padding: 7px 0;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--txt-dim);
  font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer;
}
.auth-tab.is-active { background: var(--panel-2); color: var(--txt); }

.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; color: var(--txt-dim);
}
.auth-form input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2); color: var(--txt);
  font-size: 13.5px; font-family: inherit;
  outline: none;
}
.auth-form input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--halo);
}
.auth-submit { margin-top: 5px; }

.auth-error {
  margin-top: 14px; padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--tint-bad);
  border: 1px solid var(--edge-bad);
  color: var(--txt-on-tint); font-size: 12px;
}
.auth-hint { margin: 14px 0 0; font-size: 11.5px; color: var(--txt-faint); text-align: center; }

.user-badge {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; color: var(--txt-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 6px 5px 12px; white-space: nowrap;
}
.user-badge button {
  border: 0; background: var(--panel-2); color: var(--txt-faint);
  border-radius: 999px; padding: 3px 9px;
  font: inherit; font-size: 10.5px; cursor: pointer;
}
.user-badge button:hover { background: var(--bad); color: var(--bad-ink); }

/* ------------------------------------------------------------------ */
/*  Combo dei brani già elaborati                                      */
/* ------------------------------------------------------------------ */
.combo { position: relative; flex: 1; min-width: 0; max-width: 520px; }
.combo-button {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--txt);
  font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.combo-button:hover { border-color: var(--txt-faint); }
.combo-button > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.combo-caret { color: var(--txt-faint); flex-shrink: 0; }

.combo-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  max-height: 320px; overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 5px;
}
.combo-row {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius-sm);
}
.combo-row:hover { background: var(--panel-2); }
.combo-open {
  flex: 1; min-width: 0; text-align: left;
  border: 0; background: none; color: var(--txt);
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 9px 4px 9px 11px;
  display: flex; flex-direction: column; gap: 2px;
}
.combo-open strong {
  font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.combo-open small { color: var(--txt-faint); font-family: var(--mono); font-size: 10px; }
.combo-row.is-current .combo-open strong { color: var(--accent); }
.combo-del {
  width: 24px; height: 24px; margin-right: 7px; flex-shrink: 0;
  border: 0; border-radius: 50%;
  background: none; color: var(--txt-faint);
  font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
.combo-del:hover { background: var(--bad); color: var(--bad-ink); }
.combo-empty { padding: 14px; text-align: center; color: var(--txt-faint); font-size: 12px; }
.recent-count { font-size: 11px; color: var(--txt-faint); font-family: var(--mono); white-space: nowrap; }

/* ------------------------------------------------------------------ */
/*  Descrizione della sessione                                         */
/* ------------------------------------------------------------------ */
.track-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.desc-field {
  flex: 1; display: flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--txt-faint);
}
.desc-field input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--txt);
  font-family: inherit; font-size: 13.5px; letter-spacing: normal; text-transform: none;
  outline: none;
}
.desc-field input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--halo);
}
.desc-saved { font-size: 11px; color: var(--ok); }

/* ------------------------------------------------------------------ */
/*  Sessioni riutilizzabili                                            */
/* ------------------------------------------------------------------ */
.recent-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin: 14px 22px 0;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.recent-label {
  font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--txt-faint); white-space: nowrap;
}
.recent-list {
  display: flex; gap: 8px; flex-wrap: wrap;
  overflow-x: auto; min-width: 0;
}
.recent-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 12px;
  max-width: 340px;
}
.recent-chip button {
  border: 0; background: none; color: inherit;
  font: inherit; cursor: pointer; padding: 0;
}
.recent-open {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--txt);
}
.recent-chip:hover { border-color: var(--accent-2); }
.recent-open:hover { color: var(--accent); }
.recent-meta { color: var(--txt-faint); font-family: var(--mono); font-size: 10.5px; }
.recent-stale { color: var(--warn); font-size: 11px; }
.recent-del {
  width: 18px; height: 18px; border-radius: 50%;
  color: var(--txt-faint); line-height: 1;
  display: grid; place-items: center; flex-shrink: 0;
}
.recent-del:hover { background: var(--bad); color: var(--bad-ink); }

.cache-note {
  display: flex; align-items: center; gap: 9px;
  margin-left: auto;
  min-width: 0; max-width: 46%;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: var(--tint-accent);
  border: 1px solid var(--edge-accent);
  color: var(--accent);
  font-size: 11.5px;
}
.cache-note span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cache-note .btn { flex-shrink: 0; padding: 4px 10px; font-size: 11px; }

.cache-note.cache-note-warn {
  background: var(--tint-warn);
  border-color: var(--edge-warn);
  color: var(--warn);
}

/* ------------------------------------------------------------------ */
/*  Progress & errori                                                  */
/* ------------------------------------------------------------------ */
.progress-panel {
  margin: 18px 22px 0;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.progress-head {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  font-size: 13px; margin-bottom: 10px;
}
#progress-pct { font-family: var(--mono); color: var(--accent); }
.progress-track {
  height: 6px; border-radius: 3px;
  background: var(--bg-2); overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .35s ease;
}
.progress-hint { margin: 10px 0 0; font-size: 11.5px; color: var(--txt-faint); }

.error-box {
  margin: 18px 22px 0;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--tint-bad);
  border: 1px solid var(--edge-bad);
  color: var(--txt-on-tint);
  font-size: 13px;
}

/* ------------------------------------------------------------------ */
/*  Stage                                                              */
/* ------------------------------------------------------------------ */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 22px 22px;
  min-height: 0;
}

/* --- Piano roll --------------------------------------------------- */
.roll-wrap {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 440px;
  flex: 1;
}
.roll { display: block; width: 100%; height: 100%; }

.readout {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 14px;
  box-shadow: var(--shadow-sm);
}
.hud-item {
  padding: 2px 12px 2px 0;
  border-right: 1px solid var(--line-soft);
  min-width: 92px;
}
.hud-item:last-of-type { border-right: 0; }
.hud-label {
  display: block; font-size: 9.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--txt-faint);
}
.hud-value {
  display: block; font-family: var(--mono);
  font-size: 17px; font-weight: 600; line-height: 1.3;
}
.hud-score .hud-value { color: var(--accent); }
.hud-alt {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt-faint);
  line-height: 1.1;
  min-height: 11px;
}

/* --- Cents meter --------------------------------------------------- */
.cents-meter {
  margin-left: auto;
  width: 230px; flex-shrink: 0;
  padding: 2px 0 0;
  pointer-events: none;
}
.cents-scale {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 9px; color: var(--txt-faint);
  margin-bottom: 5px;
}
.cents-track {
  position: relative; height: 8px;
  background: linear-gradient(90deg,
    var(--bad) 0%, var(--warn) 26%, var(--ok) 46%,
    var(--ok) 54%, var(--warn) 74%, var(--bad) 100%);
  border-radius: 4px;
  opacity: .5;
}
.cents-zone-ok {
  position: absolute; left: 42.5%; width: 15%; top: -2px; bottom: -2px;
  border-left: 1px solid var(--needle-edge);
  border-right: 1px solid var(--needle-edge);
}
.cents-needle {
  position: absolute; top: -4px; left: 50%;
  width: 3px; height: 16px; border-radius: 2px;
  background: var(--needle);
  box-shadow: 0 0 0 2px var(--needle-halo);
  transform: translateX(-50%);
  transition: left .06s linear, background .1s;
}

/* --- Barra karaoke --------------------------------------------------- */
.karaoke-bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 18px;
  text-align: center;
  min-height: 62px;
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
}
.karaoke-line {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.2px;
  color: var(--txt-dim);
  line-height: 1.25;
  min-height: 26px;
}
.karaoke-line .w { transition: color .1s; }
.karaoke-line .w-past { color: var(--txt-faint); }
.karaoke-line .w-now {
  color: var(--accent);
  text-shadow: none;
}
.karaoke-line .w-next { color: var(--txt); }
.karaoke-next {
  font-size: 13px;
  color: var(--txt-faint);
  min-height: 17px;
}

/* --- Transport ------------------------------------------------------ */
.transport {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.transport-left, .transport-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.time { font-family: var(--mono); font-size: 13px; }
.time-dim { color: var(--txt-faint); }

.seek { flex: 1; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--line);
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--txt);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--line);
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--txt); border: 2px solid var(--panel);
}

.mini-field { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--txt-dim); }
.mini-field input[type="range"] { width: 96px; }
.mini-field.wide { width: 100%; }
.mini-value {
  font-family: var(--mono); font-size: 10.5px; color: var(--txt-faint);
  min-width: 30px; text-align: right;
}
.mini-field.wide input[type="range"] { flex: 1; width: auto; }

/* --- Lower (mixer + voce) ------------------------------------------- */
.lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 14px;
}

.mixer, .voice-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.panel-title {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--txt-faint); margin-bottom: 12px;
}

/* --- Canali del mixer ----------------------------------------------------
   Ogni traccia e' una riga bassa: pallino, nome, interruttore, fader. Le
   righe stanno affiancate, perche' non hanno bisogno di essere larghe: su uno
   schermo ampio ci stanno tre o quattro tracce per fila, su uno stretto
   scendono da sole a una per fila. */
.channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 7px;
}

.channel {
  display: grid;
  grid-template-columns: 8px minmax(52px, auto) auto minmax(0, 1fr) 46px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  min-width: 0;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  transition: opacity .15s, border-color .15s;
}
.channel.off { opacity: .45; }

.channel-dot { width: 8px; height: 8px; border-radius: 50%; }
.channel-name {
  font-size: 12.5px; font-weight: 600; text-transform: capitalize;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.channel-fader { width: 100%; min-width: 0; }
.channel-value {
  font-family: var(--mono); font-size: 10.5px; color: var(--txt-faint);
  text-align: right;
}

/* Interruttore della traccia */
.chan-toggle {
  position: relative;
  width: 34px; height: 19px; flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.chan-toggle .knob {
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--txt-faint);
  transition: transform .16s, background .16s;
}
.chan-toggle.on { background: var(--accent); border-color: transparent; }
.chan-toggle.on .knob { transform: translateX(15px); background: var(--accent-ink); }
.chan-toggle:hover { border-color: var(--txt-faint); }
.chan-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--halo); }

/* Interruttore in forma di bottone (modalita' karaoke) */
.btn-toggle { display: inline-flex; align-items: center; gap: 8px; }
.toggle-pip {
  width: 30px; height: 17px; flex-shrink: 0;
  position: relative;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  transition: background .16s, border-color .16s;
}
.toggle-pip::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--txt-faint);
  transition: transform .16s, background .16s;
}
.btn-toggle.on { border-color: var(--accent); color: var(--accent); }
.btn-toggle.on .toggle-pip { background: var(--accent); border-color: transparent; }
.btn-toggle.on .toggle-pip::after { transform: translateX(13px); background: var(--accent-ink); }

/* --- Condivisione ------------------------------------------------------- */
.share-list {
  display: flex; flex-direction: column; gap: 5px;
  margin: 0 20px; padding: 5px;
  max-height: 250px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.share-user {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 9px 11px;
  border: 1px solid transparent; border-radius: var(--radius-xs);
  background: transparent; color: var(--txt);
  font-family: inherit; font-size: 13.5px; text-align: left;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.share-user:hover { background: var(--hover); }
.share-user.selected {
  border-color: var(--accent);
  background: var(--tint-accent);
}
.share-avatar {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--txt-dim);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.share-user.selected .share-avatar { background: var(--accent); color: var(--accent-ink); }
.share-user > span:nth-child(2) {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-user .tick { margin-left: auto; color: var(--accent); opacity: 0; }
.share-user.selected .tick { opacity: 1; }
.share-empty { padding: 16px 12px; color: var(--txt-dim); font-size: 12.5px; line-height: 1.6; }
.modal-hint { flex: 1; font-size: 11.5px; color: var(--txt-faint); }

.channel-value { font-family: var(--mono); font-size: 10px; color: var(--txt-faint); text-align: right; }

.mixer-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.mixer-foot .mini-field { flex: 1; }

/* --- Voice panel ----------------------------------------------------- */
.vu-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.vu {
  flex: 1; height: 7px; border-radius: 4px;
  background: var(--bg-2); overflow: hidden;
}
.vu-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--ok), var(--warn) 78%, var(--bad));
  transition: width .05s linear;
}
.vu-label { font-size: 10.5px; color: var(--txt-faint); font-family: var(--mono); white-space: nowrap; }

.stats { margin: 0 0 14px; display: flex; flex-direction: column; gap: 7px; }
.stats > div { display: flex; justify-content: space-between; align-items: baseline; }
.stats dt { font-size: 11.5px; color: var(--txt-dim); }
.stats dd { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  font-size: 10px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid currentColor;
}
.chip-green { color: var(--ok); }
.chip-amber { color: var(--warn); }
.chip-red   { color: var(--bad); }

/* --- Modali ------------------------------------------------------------ */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  padding: 22px;
}
.modal-card {
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-wide { max-width: 760px; }

.modal-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 620; }
.modal-close {
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: var(--panel-2); color: var(--txt-dim);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--bad); color: var(--bad-ink); }

.modal-note {
  margin: 0; padding: 13px 20px;
  font-size: 12px; color: var(--txt-faint); line-height: 1.5;
}
.modal-textarea {
  margin: 0 20px;
  min-height: 260px; flex: 1;
  padding: 13px 15px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--txt);
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
  resize: vertical; outline: none;
}
.modal-textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--halo);
}
.ref-method {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 14px 20px 0; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2);
  font-size: 11.5px; color: var(--txt-dim); line-height: 1.55;
  cursor: pointer;
}
.ref-method input { margin-top: 2px; accent-color: var(--accent); }
.ref-method strong { color: var(--txt); font-weight: 600; }

.modal-result {
  margin: 13px 20px 0; padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--tint-accent);
  border: 1px solid var(--edge-accent);
  color: var(--accent); font-size: 12px; line-height: 1.6;
}
.modal-result.is-warn {
  background: var(--tint-warn);
  border-color: var(--edge-warn);
  color: var(--warn);
}
.modal-result.is-error {
  background: var(--tint-bad);
  border-color: var(--edge-bad);
  color: var(--txt-on-tint);
}
.modal-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
  margin-top: 15px;
}
.modal-spacer { flex: 1; }

/* --- Ricerca del testo -------------------------------------------------- */
.find-bar { display: flex; gap: 8px; padding: 15px 20px 0; }
.find-bar input {
  flex: 1; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--txt);
  font-family: inherit; font-size: 13px; outline: none;
}
.find-bar input:focus { border-color: var(--accent-2); }

.find-results {
  padding: 0 20px; margin-top: 13px;
  max-height: 230px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 5px;
}
.find-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--panel-2);
  cursor: pointer; text-align: left;
  font: inherit; color: var(--txt);
}
.find-row:hover { border-color: var(--accent-2); }
.find-row div { flex: 1; min-width: 0; }
.find-row strong { display: block; font-size: 13px; font-weight: 550; }
.find-row small { color: var(--txt-faint); font-size: 11px; }

.find-site { margin: 13px 20px 20px; }
.find-site summary {
  cursor: pointer; font-size: 12px; color: var(--txt-dim);
  padding: 8px 0;
}
.find-frame {
  width: 100%; height: 380px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff;
}
.find-extern { display: block; margin-top: 8px; font-size: 11.5px; color: var(--accent-2); }

/* --- Meta / footer ---------------------------------------------------- */
.track-meta { font-size: 11.5px; color: var(--txt-faint); font-family: var(--mono); }

/* --- Piede ---------------------------------------------------------------
   Le due parti vanno a capo invece di comprimersi l'una contro l'altra: la
   riga delle scorciatoie e' lunga, e senza `wrap` finiva addosso allo stato
   della sessione. */
.footer {
  display: flex; flex-wrap: wrap; align-items: baseline;
  column-gap: 18px; row-gap: 8px;
  padding: 12px 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--txt-faint);
}
.footer-keys {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 14px;
  margin: 0; padding: 0; list-style: none;
  min-width: 0;
}
.footer-keys li { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.footer-keys kbd {
  font-family: var(--mono); font-size: 10px; line-height: 1;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--txt-dim);
}

/* --- Segnalibri ---------------------------------------------------------
   La barra sta sotto il transport; il riquadro di creazione e' flottante e
   volutamente stretto, perche' mentre e' aperto si clicca sul grafico. */
.bookmark-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.bookmark-select {
  min-width: 200px; max-width: 340px;
  padding: 5px 9px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--txt);
  font-family: var(--sans); font-size: 12.5px;
}
.bookmark-info { font-family: var(--mono); font-size: 11px; color: var(--txt-faint); }
.btn.bm-running { border-color: var(--accent); color: var(--accent); }

.bm-editor {
  position: fixed; top: 96px; right: 18px; z-index: 70;
  width: 268px; padding: 13px 15px 14px;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.bm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bm-head strong { font-size: 13px; }
.bm-hint { margin: 7px 0 11px; font-size: 11.5px; color: var(--txt-faint); line-height: 1.5; }

.bm-points { display: flex; gap: 8px; }
.bm-point {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--txt-dim);
  cursor: pointer; text-align: left;
}
.bm-point span { font-size: 10px; letter-spacing: .08em; }
.bm-point strong { font-family: var(--mono); font-size: 15px; color: var(--txt); }
.bm-point:hover { border-color: var(--accent-2); }
.bm-point.active {
  border-color: var(--mark); color: var(--mark);
  box-shadow: inset 0 0 0 1px var(--edge-mark);
}

.bm-desc { display: block; margin-top: 11px; }
.bm-desc span { display: block; margin-bottom: 4px; font-size: 11px; color: var(--txt-dim); }
.bm-desc input {
  width: 100%; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--txt);
  font-family: var(--sans); font-size: 12.5px;
}
.bm-error { margin-top: 9px; font-size: 11.5px; color: var(--bad); }
.bm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (max-width: 700px) {
  .bookmark-bar { padding: 8px 12px; }
  .bookmark-select { min-width: 0; flex: 1 1 100%; max-width: none; }
  .bm-editor { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; }
}

/* --- Pannello esercizi -------------------------------------------------
   Non e' una finestra modale che copre tutto: gli esercizi si disegnano sul
   piano roll, che deve restare visibile. E' un cassetto ancorato in basso, e
   quando e' aperto il corpo della pagina guadagna un margine pari alla sua
   altezza, cosi' nulla resta nascosto sotto. */
.ex-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-height: 46vh; overflow-y: auto;
}

/* Lo spazio per il cassetto si aggiunge UNA volta sola, in fondo alla pagina.
   Applicandolo sia allo stage sia al piede diventava il doppio, e le
   scorciatoie restavano appese in mezzo al vuoto. */
body.ex-open { padding-bottom: var(--ex-h, 220px); }
/* Con il cassetto aperto le scorciatoie generiche non servono: comandano i
   tasti del pannello, e qui sotto ci sarebbero solo d'intralcio. */
body.ex-open .footer { display: none; }

.ex-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2);
  position: sticky; top: 0; z-index: 2;
}
.ex-title { font-size: 13px; letter-spacing: .02em; }
.ex-hint {
  font-size: 11px; color: var(--txt-faint);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ex-head-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 7px; }

.ex-tabs {
  display: flex; gap: 6px; padding: 9px 18px 0;
  overflow-x: auto; scrollbar-width: thin;
}
.ex-tab {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--bg-2);
  color: var(--txt-dim);
  font-size: 12.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap;
}
.ex-tab:hover { color: var(--txt); border-color: var(--accent-2); }
.ex-tab.active {
  background: var(--panel);
  color: var(--txt);
  border-color: var(--accent);
  box-shadow: inset 0 2px 0 var(--accent);
}
.ex-tab .ex-tab-range { color: var(--txt-faint); font-size: 11px; }
.ex-tab.active .ex-tab-range { color: var(--ref); }

.ex-body { padding: 12px 18px 16px; border-top: 1px solid var(--line); margin-top: -1px; }
.ex-empty { color: var(--txt-dim); font-size: 12.5px; line-height: 1.7; max-width: 62ch; }

.ex-stale {
  margin-bottom: 10px; padding: 8px 11px;
  border: 1px solid var(--edge-warn); border-radius: var(--radius-sm);
  background: var(--tint-warn);
  color: var(--warn); font-size: 12px;
}

.ex-info {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px;
  margin-bottom: 12px;
}
.ex-range { font-family: var(--mono); font-size: 12px; color: var(--txt-dim); }
.ex-notes { display: flex; flex-wrap: wrap; gap: 5px; }
.ex-note-chip {
  padding: 3px 8px; border-radius: 999px;
  background: var(--tint-ref); border: 1px solid var(--edge-ref);
  color: var(--ref); font-family: var(--mono); font-size: 12px;
}
.ex-note-chip.off { border-style: dashed; }
.ex-note-chip.sung { background: var(--tint-ok); border-color: var(--edge-ok); color: var(--ok); }
/* Il frammento di testo puo' essere lungo: prende una riga sua e va a capo
   invece di allargare la riga delle informazioni. */
.ex-text {
  flex: 1 1 100%;
  min-width: 0; overflow-wrap: anywhere;
  color: var(--txt-faint); font-size: 12px; font-style: italic;
}

.ex-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ex-score { font-family: var(--mono); font-size: 13px; color: var(--txt-dim); }
.ex-panel .mini-field { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--txt-dim); }
.ex-panel .mini-field input[type="range"] { width: 90px; }

.btn.ex-armed { border-color: var(--accent); color: var(--accent); }

@media (max-width: 700px) {
  .ex-panel { max-height: 56vh; }
  .ex-hint { display: none; }
  .ex-head, .ex-tabs, .ex-body { padding-left: 12px; padding-right: 12px; }
  .ex-controls { gap: 9px; }
  .ex-panel .mini-field input[type="range"] { width: 70px; }
}

/* --- Responsive -------------------------------------------------------- */

/* Tablet e finestre strette: il pannello voce va sotto il mixer. */
@media (max-width: 1000px) {
  .topbar { flex-wrap: wrap; }
  .url-form { order: 3; width: 100%; max-width: none; }
  .lower { grid-template-columns: 1fr; }
  .readout { flex-wrap: wrap; }
  .cents-meter { width: 100%; margin-left: 0; }
  .cache-note { max-width: 100%; margin-left: 0; }
  .roll-wrap { min-height: 360px; }
}

/* Telefono. Ogni riga orizzontale dell'interfaccia supera i 375 px di
   larghezza: qui vanno tutte a capo, e gli elementi che non hanno senso
   compressi (miniature, etichette ripetitive) spariscono. */
@media (max-width: 700px) {
  body { -webkit-text-size-adjust: 100%; }

  .topbar { gap: 10px; padding: 10px 12px; }
  .brand h1 { font-size: 17px; }
  .brand-sub { display: none; }
  .engine-badge { font-size: 10px; padding: 4px 9px; }

  .progress-panel, .error-box, .recent-bar, .cache-note { margin-left: 12px; margin-right: 12px; }
  .stage { padding: 12px; gap: 10px; }

  /* Elenco brani: etichetta via, combo a tutta larghezza. */
  .recent-bar { flex-wrap: wrap; gap: 8px; }
  .recent-label, .recent-count { display: none; }
  .combo { max-width: none; width: 100%; }
  .cache-note { max-width: none; width: 100%; margin-left: 0; }

  /* Lettura valori: due colonne invece di cinque. */
  .readout { flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; }
  .hud-item {
    flex: 1 1 calc(50% - 12px);
    min-width: 0; padding: 2px 0; border-right: 0;
  }
  .hud-value { font-size: 15px; }
  .cents-meter { width: 100%; margin-left: 0; padding-top: 6px; }

  /* Grafico: più basso, ma resta l'elemento dominante. */
  .roll-wrap { min-height: 260px; }

  /* Trasporto: due file, la barra di scorrimento occupa la sua. */
  .transport { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .transport-left, .transport-right { flex-wrap: wrap; gap: 8px; }
  .seek { order: 5; flex: 1 0 100%; }
  .mini-field input[type="range"] { width: 70px; }
  .btn-round { width: 38px; height: 38px; }

  /* Descrizione e azioni sul brano: una riga per elemento. */
  .track-bar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .desc-field { flex: 1 0 100%; }
  .track-bar .btn { flex: 1; }

  .karaoke-line { font-size: 17px; }
  .karaoke-bar { padding: 10px 12px; min-height: 54px; }

  /* Su telefono la riga del canale perde la colonna dei decibel: il fader
     e l'interruttore sono quello che serve davvero. */
  .channels { grid-template-columns: 1fr; }
  .channel { grid-template-columns: 8px minmax(52px, auto) auto minmax(0, 1fr); gap: 8px; padding: 6px 9px; }
  .channel-value { display: none; }
  .share-box { flex: 1 0 100%; }
  .share-select { max-width: none; flex: 1; }
  .mixer-foot { flex-wrap: wrap; }

  /* Modali a tutto schermo: su un telefono i margini sono spazio sprecato. */
  .modal { padding: 0; }
  .modal-card, .modal-wide {
    max-width: none; width: 100%; height: 100%; max-height: none;
    border-radius: 0; border: 0;
  }
  .modal-textarea { min-height: 200px; }
  .find-bar { flex-wrap: wrap; }
  .find-bar input { flex: 1 0 100%; }
  .find-frame { height: 260px; }

  .auth-card { max-width: none; border-radius: 12px; padding: 20px; }
  .footer { flex-direction: column; gap: 4px; align-items: flex-start; }
  .footer-keys { display: none; }
  .track-meta { font-size: 10.5px; line-height: 1.5; }
}

/* Schermi molto stretti (iPhone SE e simili). */
@media (max-width: 400px) {
  .hud-item { flex: 1 1 100%; }
  .transport-left .time-dim + .time { font-size: 12px; }
  .roll-wrap { min-height: 220px; }
}
