/* ── Regia: binario di schede + contenuto ─────────────────── */
.regia {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  overflow-y: auto;
  background: var(--void);
  border-right: 1px solid var(--line);
}
.tab {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 10px 4px 9px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: 600 10px/1 var(--font-ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--fast), background var(--fast);
}
.tab .icon { width: 20px; height: 20px; }
.tab:hover { color: var(--text); background: var(--hull-2); }
.tab[aria-selected='true'] { color: var(--volt); background: var(--hull); }
.tab[aria-selected='true']::before {
  content: '';
  position: absolute;
  inset: 6px auto 6px 0;
  width: 1px;
  background: var(--volt);
}
.tab-badge {
  position: absolute;
  top: 6px;
  right: 14px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--hood);
  color: var(--ink);
  font: 700 10px/16px var(--font-ui);
  text-align: center;
}

.tab-panel {
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 28px;
}
.tab-title {
  margin-bottom: 14px;
  font: 700 20px/1.1 var(--font-ui);
  letter-spacing: 0.04em;
}

.group { padding: 14px 0 16px; border-top: 1px solid var(--line); }
.group:first-of-type { border-top: 0; padding-top: 0; }
.group > h3 {
  margin-bottom: 10px;
  font: 700 12px/1.2 var(--font-ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.field-value { font: 12px/1.4 var(--font-data); font-variant-numeric: tabular-nums; color: var(--text); }
.field-row { display: flex; align-items: center; gap: 8px; }
.hint { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--text-3); max-width: 62ch; }
.hint code, .hint kbd {
  padding: 1px 4px;
  background: var(--hull-2);
  font: 12px/1.3 var(--font-data);
  color: var(--text-2);
}
.hint.is-warn { color: var(--amber); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }

.copy-line {
  display: flex;
  gap: 6px;
  align-items: center;
}
.copy-line code {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--hull-2);
  border: 1px solid var(--line);
  font: 12px/1.3 var(--font-data);
  color: var(--neon);
}

/* Account */
.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--hull-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.account-card .who { flex: 1; min-width: 0; }
.account-card .who strong { display: block; font: 700 16px/1.2 var(--font-ui); }
.account-card .who span { font-size: 12px; color: var(--text-3); }

.cap-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.cap-list li { display: flex; align-items: center; gap: 8px; color: var(--text-2); }

/* Voci rapide */
.voice-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.voice-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--line-hi);
  background: var(--hull-2);
  color: var(--text);
  font: 600 13px/1.1 var(--font-ui);
  cursor: pointer;
  text-align: left;
}
.voice-chip kbd {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  background: var(--hull-3);
  color: var(--text-3);
  font: 600 11px/1 var(--font-data);
}
.voice-chip small { display: block; font: 500 10px/1.2 var(--font-ui); letter-spacing: 0.06em; color: var(--text-3); text-transform: uppercase; }
.voice-chip:hover { border-color: var(--text-2); }
.voice-chip[aria-pressed='true'] { border-color: var(--volt); background: color-mix(in srgb, var(--volt) 14%, var(--hull-2)); }
.voice-chip[aria-pressed='true'] kbd { background: var(--volt); color: var(--ink); }
.voice-chip .chip-remove {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 2px;
  color: var(--text-3);
}
.voice-chip .chip-remove:hover { color: var(--hood); }
.voice-chip .chip-remove .icon { width: 14px; height: 14px; }

.now-speaking {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  margin-bottom: 14px;
  background: var(--hull-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  color: var(--text-3);
}
.now-speaking.is-on { color: var(--text); box-shadow: inset 0 0 0 1px var(--volt); }
.now-speaking p { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-speaking .icon { color: var(--volt); }

/* Misuratore microfono con soglia */
.meter {
  position: relative;
  height: 26px;
  background: var(--hull-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.meter-fill {
  position: absolute;
  inset: 0;
  background: var(--neon);
  transform-origin: left;
  transform: scaleX(var(--level, 0));
  transition: transform 70ms linear, background var(--fast);
}
.meter.is-speaking .meter-fill { background: var(--volt); }
.meter-threshold {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--threshold, 0.3) * 100%);
  width: 2px;
  background: var(--hood);
}
.meter-threshold::after {
  content: 'soglia';
  position: absolute;
  top: 5px;
  left: 6px;
  font: 600 10px/1 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hood);
}

/* Layout: miniature delle disposizioni */
.layout-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
  max-width: 560px;
}
.layout-preset {
  display: block;
  padding: 5px;
  border: 1px solid var(--line);
  background: var(--void);
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}
.layout-preset:hover { border-color: var(--line-hi); background: var(--hull-2); }
.layout-preset[aria-pressed='true'] { border-color: var(--volt); box-shadow: inset 0 0 0 1px var(--volt); }
.layout-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
}
.layout-thumb i {
  position: absolute;
  border: 1.5px solid var(--void);
  background: color-mix(in srgb, var(--cell-tone) 70%, var(--hull));
}
.layout-preset:not([aria-pressed='true']) .layout-thumb i { background: color-mix(in srgb, var(--cell-tone) 38%, var(--hull-2)); }
.layout-caption { margin-top: 8px; font-size: 13px; color: var(--text-2); }
.layout-caption strong { font: 700 13px/1.3 var(--font-ui); letter-spacing: 0.04em; color: var(--text); }

/* Layout: mappa dei riquadri della disposizione corrente */
.slot-map {
  position: relative;
  max-width: 460px;
  aspect-ratio: 16 / 10;
  background: var(--void);
  box-shadow: inset 0 0 0 1px var(--line);
}
.slot-cell {
  position: absolute;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px 6px 6px;
  border: 3px solid var(--void);
  background: var(--hull-2);
  box-shadow: inset 0 3px 0 var(--cell-tone, var(--line-hi));
  overflow: hidden;
}
.slot-cell span { font: 700 11px/1 var(--font-data); color: var(--text-3); }
.slot-cell .select {
  min-width: 0;
  min-height: 30px;
  padding: 4px 18px 4px 6px;
  font: 600 13px/1.2 var(--font-ui);
  background-position: calc(100% - 11px) 55%, calc(100% - 6px) 55%;
}

/* Registro eventi in stile tabellone */
.board { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.board li {
  display: grid;
  grid-template-columns: 52px 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.board time { font: 12px/1 var(--font-data); font-variant-numeric: tabular-nums; color: var(--text-3); }
.board .board-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--tone, var(--line-hi));
  color: var(--ink);
}
.board .board-icon .icon { width: 15px; height: 15px; stroke-width: 2; }
.board .board-text { min-width: 0; }
.board .board-text strong { font: 700 14px/1.2 var(--font-ui); }
.board .board-text span { color: var(--text-2); }
.board-empty { padding: 18px 0; color: var(--text-3); }

/* Editor liste filtro */
.list-editor { display: grid; gap: 6px; }
.filter-preview {
  min-height: 38px;
  padding: 8px 10px;
  background: var(--hull-2);
  border: 1px dashed var(--line-hi);
  color: var(--text);
  font-size: 14px;
}
.filter-preview mark { background: var(--hood); color: var(--ink); padding: 0 3px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.stat-row .chip b { color: var(--text); font-weight: 700; }

.shortcut-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; color: var(--text-2); }
.shortcut-list kbd {
  justify-self: start;
  padding: 2px 6px;
  background: var(--hull-2);
  box-shadow: inset 0 -1px 0 var(--line-hi);
  font: 12px/1.4 var(--font-data);
  color: var(--text);
}

@media (max-width: 520px) {
  .regia { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .tabs { flex-direction: row; overflow-x: auto; padding: 0 6px; border-right: 0; border-bottom: 1px solid var(--line); }
  .tab { min-width: 72px; }
  .tab[aria-selected='true']::before { inset: auto 6px 0 6px; width: auto; height: 2px; box-shadow: none; }
}

.tab-host { display: grid; min-width: 0; min-height: 0; overflow: hidden; }
.tab-host > .tab-panel { grid-area: 1 / 1; }
.mt { margin-top: 10px; }
.alert-types li { grid-template-columns: 26px minmax(0, 1fr) auto; }
.alert-types .switch { min-height: 26px; }
.account-card .who .is-warn { color: var(--amber); }
.account-card { flex-wrap: wrap; }

/* ── Musica ───────────────────────────────────────────────── */
.np {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px 14px;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--hull-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.np.is-playing { box-shadow: inset 0 0 0 1px var(--pink); }
.np-art {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: var(--hull-3);
  color: var(--text-3);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.np-art .icon { width: 26px; height: 26px; }
.np.is-playing .np-art { background: var(--pink); color: var(--ink); }
.np-info { align-self: center; min-width: 0; }
.np-title { font: 700 18px/1.2 var(--font-ui); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-artist { margin-top: 2px; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np.is-ducked .np-artist::after { content: ' · abbassata'; color: var(--amber); }
.np-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.np-time { font: 12px/1 var(--font-data); font-variant-numeric: tabular-nums; color: var(--text-3); min-width: 44px; }
.np-time:last-child { text-align: right; }
.np-seek:disabled { opacity: 0.4; cursor: default; }
.np-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.np-controls .icon-btn { width: 40px; height: 40px; color: var(--text-2); }
.np-controls .icon-btn:hover { background: var(--hull-3); color: var(--text); }
.np-controls .icon-btn[aria-pressed='true'] { color: var(--pink); background: transparent; }
.np-play { width: 52px; min-height: 44px; padding: 0; }
.np-play .icon { width: 20px; height: 20px; }

.stream-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 6px; }

.playlist {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.track { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.track-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.track-main:hover { background: var(--hull-2); }
.track-num { font: 12px/1 var(--font-data); color: var(--text-3); min-width: 22px; }
.track-text { display: grid; min-width: 0; flex: 1; }
.track-text strong { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-text span { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track.is-current { background: color-mix(in srgb, var(--pink) 12%, transparent); }
.track.is-current .track-num,
.track.is-current strong { color: var(--pink); }
.track .icon-btn { color: var(--text-3); }
.track .icon-btn:hover { color: var(--hood); background: var(--hull-2); }

/* Mic: cattura in Streamlabs */
.capture-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--hull-2);
  font: 600 13px/1.3 var(--font-ui);
  letter-spacing: 0.03em;
  color: var(--text-2);
}
.capture-status .icon { width: 16px; height: 16px; flex: none; }
.capture-status[data-state='live'] { border-color: color-mix(in srgb, var(--neon) 55%, transparent); color: var(--text); }
.capture-status[data-state='live'] .icon { color: var(--neon); }
.capture-status[data-state='hidden'] { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--hull-2)); color: var(--amber); }
.capture-steps {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  max-width: 62ch;
}
.capture-steps li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  counter-increment: step;
}
.capture-steps li::before {
  content: counter(step);
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--volt);
  color: var(--ink);
  font: 700 12px/1 var(--font-ui);
}
.capture-steps strong { font: 700 13px/1.4 var(--font-ui); letter-spacing: 0.04em; color: var(--text); }
.capture-steps span { overflow-wrap: anywhere; }
.capture-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.capture-copy code {
  padding: 5px 8px;
  background: var(--void);
  border: 1px solid var(--line);
  color: var(--neon);
  font: 12px/1.4 var(--font-data);
  overflow-wrap: anywhere;
}
