:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1d1b19;
  --muted: #6d665e;
  --line: #e4ddd3;
  --accent: #e2462f;
  --accent-ink: #ffffff;
  --live: #e2462f;
  --ok: #2f7d4f;
  --warn: #b7791f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.05);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312; --card: #1e1c1a; --ink: #f1ece4; --muted: #a39b90;
    --line: #2f2c28; --shadow: none;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; }
img, audio { max-width: 100%; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* --- testata --- */
header.top { border-bottom: 1px solid var(--line); background: var(--card); }
header.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; font-size: 1.15rem; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; color: var(--muted); font-size: .95rem; }
nav a:hover, nav a.on { color: var(--ink); background: var(--bg); }

main { padding: 28px 0 60px; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.03em; line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: 1.25rem; letter-spacing: -.01em; margin: 32px 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* --- blocchi --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

/* --- player in prima pagina --- */
.onair {
  background: var(--ink); color: var(--bg); border-radius: 22px; padding: 26px;
  display: grid; gap: 18px; grid-template-columns: auto 1fr; align-items: center;
}
.onair .play {
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  transition: transform .15s;
}
.onair .play:hover { transform: scale(1.05); }
.onair .play svg { width: 34px; height: 34px; }
.onair .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; opacity: .7; }
.onair .title { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.onair .meta { opacity: .75; font-size: .92rem; }
.eq { display: inline-flex; gap: 3px; align-items: flex-end; height: 14px; margin-right: 6px; }
.eq i { width: 3px; background: currentColor; animation: eq 1s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .2s } .eq i:nth-child(3) { animation-delay: .4s }
.paused .eq i { animation: none; height: 4px; }
@keyframes eq { 0%,100% { height: 4px } 50% { height: 14px } }
@media (max-width: 520px) { .onair { grid-template-columns: 1fr; text-align: center; justify-items: center; } }

/* --- etichette --- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.tag.live { background: var(--live); color: #fff; border-color: transparent; }
.tag.ok { color: var(--ok); border-color: currentColor; }
.tag.warn { color: var(--warn); border-color: currentColor; }
.tag.err { color: var(--accent); border-color: currentColor; }

/* --- liste --- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 100px; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* --- form --- */
form.inline { display: inline; }
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
textarea { min-height: 90px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); text-decoration: none;
}
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.danger { color: var(--accent); }
button.small, .btn.small { padding: 5px 10px; font-size: .85rem; }
button:disabled { opacity: .5; cursor: not-allowed; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--card); }
.flash.ok { border-color: var(--ok); }
.flash.errore { border-color: var(--accent); }

/* --- pagina diretta --- */
.studio { text-align: center; padding: 30px 18px; }
.big-btn { font-size: 1.2rem; padding: 18px 34px; border-radius: 999px; }
.meter { height: 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: 22px auto; max-width: 420px; }
.meter div { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--warn) 75%, var(--accent)); transition: width .08s; }
.timer { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }

.week { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.week .today { outline: 2px solid var(--accent); }
footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .88rem; }
