/* uniCHARTA — Trascrittore Audio. Nessuno stile in linea: la pagina regge una CSP 'self'. */
:root {
  --fondo: #0f1117;
  --pannello: #1a1d27;
  --bordo: #2a2d3a;
  --testo: #e0e0e0;
  --tenue: #9a9fae;
  --accento: #4f8ef7;
  --accento-scuro: #3a7ae0;
  --verde: #4caf50;
  --rosso: #ff6b6b;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--fondo);
  color: var(--testo);
  min-height: 100vh;
  line-height: 1.5;
}
[hidden] { display: none !important; }
.nascosto {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.testata {
  padding: 1.25rem 1rem; border-bottom: 1px solid #222;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.testata a { color: var(--tenue); text-decoration: none; font-size: .9rem; }
.testata a:hover, .testata a:focus-visible { color: #fff; }
.testata h1 { font-size: 1.2rem; font-weight: 400; color: #fff; }
.testata h1 span { color: var(--accento); font-weight: 700; }

.contenitore { max-width: 700px; margin: 2.5rem auto; padding: 0 1rem; }

.zona {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  border: 2px dashed var(--bordo); border-radius: 16px; padding: 2.5rem 1.25rem;
  text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
}
.zona:hover, .zona.trascina, .zona:focus-visible { border-color: var(--accento); outline: none; }
.zona.trascina { background: rgba(79, 142, 247, .06); }
.zona .icona { width: 3rem; height: 3rem; fill: var(--accento); margin-bottom: .5rem; }
.zona strong { color: #fff; font-size: 1.05rem; }
.zona .sotto { color: var(--tenue); font-size: .9rem; }

.scelto { margin-top: 1rem; color: var(--tenue); font-size: .9rem; word-break: break-all; }

.bottone, .secondario, .scarica {
  display: inline-block; border-radius: 8px; font-size: 1rem; cursor: pointer;
  font-family: inherit; text-decoration: none; transition: background .2s, color .2s;
}
.bottone {
  padding: .8rem 2rem; background: var(--accento); color: #fff; border: none; margin-top: 1.5rem;
}
.bottone:hover:not(:disabled) { background: var(--accento-scuro); }
.bottone:disabled { background: var(--bordo); color: #666; cursor: not-allowed; }
.bottone:focus-visible, .secondario:focus-visible, .scarica:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px;
}

.avanzamento { margin-top: 2rem; }
.stato { color: var(--tenue); font-size: .95rem; }
progress {
  display: block; width: 100%; height: 12px; margin: 1rem 0 .4rem; border: none;
  border-radius: 8px; overflow: hidden; background: var(--pannello); appearance: none;
}
progress::-webkit-progress-bar { background: var(--pannello); border-radius: 8px; }
progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accento), #7b5ef8); border-radius: 8px;
  transition: width .5s;
}
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--accento), #7b5ef8); }
.percentuale { color: var(--tenue); font-size: .85rem; text-align: right; }
.codice {
  margin-top: .75rem; color: var(--tenue); font-size: .8rem; word-break: break-all;
}
.codice code { font-family: ui-monospace, Consolas, monospace; color: var(--testo); }

.errore {
  margin-top: 1.25rem; padding: .8rem 1rem; border: 1px solid #5a2a2a; border-radius: 8px;
  background: #2a1717; color: var(--rosso); font-size: .95rem;
}

.manutenzione {
  margin-bottom: 1.5rem; padding: .9rem 1rem; border: 1px solid var(--bordo); border-radius: 8px;
  background: var(--pannello); color: var(--testo); font-size: .95rem;
}

.risultato { margin-top: 2rem; }
.risultato h2 { margin-bottom: .5rem; color: #fff; font-size: 1.15rem; }
.risultato .nota { color: var(--tenue); font-size: .9rem; margin-bottom: 1rem; }
.testo {
  background: var(--pannello); border: 1px solid var(--bordo); border-radius: 10px;
  padding: 1.25rem; max-height: 420px; overflow-y: auto; font-size: .88rem;
  line-height: 1.7; white-space: pre-wrap; word-wrap: break-word;
}
.testo .voce { color: var(--accento); font-weight: 700; }
.testo .ts { color: #6b7080; font-family: ui-monospace, Consolas, monospace; }
.azioni { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.scarica {
  padding: .7rem 1.5rem; background: #1a3a1a; color: var(--verde);
  border: 1px solid var(--verde); font-size: .95rem;
}
.scarica:hover { background: var(--verde); color: #fff; }
.secondario {
  padding: .7rem 1.5rem; background: transparent; color: var(--tenue);
  border: 1px solid var(--bordo); font-size: .95rem;
}
.secondario:hover { color: #fff; border-color: var(--tenue); }

.informazioni {
  background: var(--pannello); border: 1px solid var(--bordo); border-radius: 10px;
  padding: 1rem 1.25rem; margin-top: 2rem; font-size: .85rem; color: var(--tenue);
}
.informazioni h2 { font-size: .95rem; color: var(--testo); margin: .9rem 0 .3rem; }
.informazioni h2:first-child { margin-top: 0; }
.informazioni p + p { margin-top: .5rem; }

@media (max-width: 480px) {
  .contenitore { margin-top: 1.5rem; }
  .bottone { width: 100%; }
  .azioni > * { flex: 1 1 100%; text-align: center; }
}
