:root {
  color-scheme: dark;
  --cyan: #2b7c89;
  --cyan-dark: #236975;
  --gold: #f4d783;
  --gold-dark: #c9ad59;
  --cream: #fffde5;
  --bg: #001840;
  --surface: #062147;
  --surface-2: #0a294d;
  --surface-3: #103455;
  --line: rgba(255, 255, 255, 0.105);
  --line-strong: rgba(244, 215, 131, 0.42);
  --text: #fffde5;
  --muted: #a8b4c5;
  --radius: 18px;
  font-family: Inter, Montserrat, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 1080px; min-height: 100%; margin: 0; background: var(--bg); }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, rgba(24, 183, 207, 0.08), transparent 28%),
    radial-gradient(circle at 92% 92%, rgba(245, 158, 11, 0.06), transparent 26%),
    #001840;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.studio-app {
  display: grid;
  grid-template: 78px minmax(calc(100vh - 78px), auto) / 260px minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 24, 64, 0.96);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 50px; height: 50px; object-fit: cover; border-radius: 50%; filter: drop-shadow(0 0 14px rgba(244, 215, 131, 0.2)); }
.brand div { display: grid; line-height: 1; }
.brand span { color: var(--cream); font-size: 10px; font-weight: 900; letter-spacing: 0.3em; }
.brand strong {
  margin-top: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--cream) 54%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 19px;
  letter-spacing: 0.08em;
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.public-site-link, .logout-button { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--cream); background: transparent; text-decoration: none; font-size: 11px; font-weight: 800; cursor: pointer; }
.public-site-link:hover, .logout-button:hover { border-color: var(--gold); color: var(--gold); }

.service-state { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.service-state i { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.09); }
.service-state.connected i { background: var(--cyan); box-shadow: 0 0 0 5px rgba(24, 183, 207, 0.09), 0 0 14px rgba(24, 183, 207, 0.65); }

.sidebar {
  position: sticky;
  top: 78px;
  display: flex;
  height: calc(100vh - 78px);
  flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(3, 29, 67, 0.92);
}

.sidebar-label, .eyebrow { margin: 0; color: var(--cyan); font-size: 10px; font-weight: 900; letter-spacing: 0.18em; }
.station-switcher { display: grid; gap: 7px; margin: 12px 0; overflow-y: auto; }
.station-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  text-align: left;
}
.station-button:hover { background: rgba(255, 255, 255, 0.035); }
.station-button.active { border-color: rgba(24, 183, 207, 0.34); background: rgba(24, 183, 207, 0.075); }
.station-code { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--cream); background: var(--surface-2); font-size: 10px; font-weight: 900; }
.station-code img { width: 29px; height: 29px; object-fit: contain; border-radius: 8px; }
.station-button strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.station-button i { width: 7px; height: 7px; border-radius: 50%; background: #526068; }
.station-button.live i { background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }

.button {
  min-height: 42px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 17px;
  font-weight: 850;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled, .transport-button:disabled, .text-button:disabled { cursor: not-allowed; opacity: 0.38; transform: none; }
.button.primary { color: #071114; background: linear-gradient(100deg, var(--cyan), var(--cream) 58%, var(--gold)); }
.button.secondary { border-color: var(--line); background: rgba(255, 255, 255, 0.035); }
.button.secondary:hover { border-color: var(--line-strong); background: rgba(24, 183, 207, 0.055); }
.button.warning { border-color: rgba(245, 158, 11, 0.38); color: var(--gold); background: rgba(245, 158, 11, 0.07); }
.button.warning:hover { border-color: rgba(245, 158, 11, 0.7); background: rgba(245, 158, 11, 0.12); }
.compact-button { min-height: 34px; border-radius: 9px; padding-inline: 11px; font-size: 10px; }
.button.full { width: 100%; }

.nav-tabs { display: grid; gap: 5px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav-button {
  min-height: 42px;
  cursor: pointer;
  border: 0;
  border-radius: 11px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 750;
}
.nav-button:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-button.active { color: var(--cream); background: linear-gradient(90deg, rgba(24, 183, 207, 0.12), rgba(245, 158, 11, 0.035)); }
.sidebar-note { display: flex; align-items: flex-start; gap: 9px; margin-top: auto; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.025); }
.note-mark { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #071114; background: linear-gradient(135deg, var(--cyan), var(--gold)); font-size: 11px; font-weight: 950; }
.sidebar-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.workspace { min-width: 0; padding: 30px clamp(28px, 4vw, 62px) 60px; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.station-heading-copy { display: flex; align-items: center; gap: 15px; }
.studio-station-logo { width: 58px; height: 58px; object-fit: contain; border: 1px solid var(--line); border-radius: 15px; padding: 5px; background: var(--surface-2); }
.workspace-heading h1 { margin: 7px 0 0; color: var(--cream); font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.045em; }
.air-badge { padding: 9px 13px; border: 1px solid rgba(245, 158, 11, 0.38); border-radius: 999px; color: var(--gold); background: rgba(245, 158, 11, 0.08); font-size: 10px; font-weight: 900; letter-spacing: 0.12em; }
.air-badge.live { border-color: rgba(24, 183, 207, 0.46); color: var(--cyan); background: rgba(24, 183, 207, 0.08); }
.air-badge.paused { border-color: rgba(245, 158, 11, 0.46); color: var(--gold); background: rgba(245, 158, 11, 0.08); }
.air-badge.stopped { border-color: var(--line); color: var(--muted); background: rgba(255, 255, 255, 0.035); }

.on-air-console {
  display: grid;
  grid-template-columns: minmax(420px, 1.4fr) minmax(310px, 0.85fr);
  gap: 12px;
  margin: 27px 0 12px;
}
.on-air-card, .quick-play-card, .queue-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(13, 25, 31, 0.96), rgba(6, 13, 17, 0.97));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}
.on-air-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 17px;
  overflow: hidden;
  min-height: 176px;
  padding: 21px 22px;
  border-color: rgba(24, 183, 207, 0.31);
}
.on-air-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(to bottom, var(--cyan), var(--cream), var(--gold)); content: ""; }
.on-air-copy { display: grid; min-width: 0; align-content: start; gap: 8px; }
.on-air-copy .eyebrow { display: flex; align-items: center; gap: 7px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.on-air-copy > strong { overflow: hidden; color: var(--cream); font-size: clamp(22px, 2.4vw, 32px); letter-spacing: -0.035em; text-overflow: ellipsis; white-space: nowrap; }
.on-air-copy > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.air-timing { display: flex; align-items: flex-start; gap: 9px; }
.air-timing div { display: grid; min-width: 78px; gap: 5px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 10px; background: rgba(255, 255, 255, 0.025); text-align: right; }
.air-timing small { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: 0.12em; }
.air-timing strong { color: var(--cream); font-size: 14px; font-variant-numeric: tabular-nums; }
.transport-controls { display: flex; grid-column: 1 / -1; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.transport-button { display: grid; width: 42px; height: 38px; cursor: pointer; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: #dfe8eb; background: rgba(255, 255, 255, 0.035); font-size: 12px; font-weight: 900; }
.transport-button:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(24, 183, 207, 0.08); }
.transport-button.play { width: 52px; border-color: rgba(24, 183, 207, 0.42); color: #071114; background: linear-gradient(110deg, var(--cyan), var(--cream)); }
.quick-play-card { display: grid; align-content: start; gap: 15px; padding: 19px; }
.quick-play-heading, .queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quick-play-heading h2 { margin: 5px 0 0; color: var(--cream); font-size: 18px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.queue-card { display: grid; grid-column: 1 / -1; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 18px; min-height: 76px; padding: 13px 17px; }
.queue-heading { padding-right: 17px; border-right: 1px solid var(--line); }
.queue-heading > div { display: grid; gap: 4px; }
.queue-heading strong { font-size: 13px; }
.text-button { cursor: pointer; border: 0; padding: 5px; color: var(--cyan); background: transparent; font-size: 10px; font-weight: 850; }
.queue-list { display: flex; min-width: 0; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.queue-item { display: flex; min-width: max-content; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: rgba(255, 255, 255, 0.027); }
.queue-item b { color: var(--cyan); font-size: 9px; }
.queue-item span { max-width: 210px; overflow: hidden; font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.queue-empty { color: var(--muted); font-size: 10px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin: 0 0 20px; }
.metric { display: grid; min-height: 85px; align-content: center; padding: 14px 17px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(13, 25, 31, 0.93), rgba(7, 14, 18, 0.94)); }
.metric > span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 0.15em; }
.metric strong { overflow: hidden; margin-top: 5px; color: var(--cream); font-size: 23px; text-overflow: ellipsis; white-space: nowrap; }
.metric small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.view { display: none; }
.view.active { display: block; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.7fr); gap: 16px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, rgba(12, 23, 29, 0.96), rgba(6, 12, 16, 0.95)); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2); }
.panel-heading { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 21px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 6px 0 0; color: var(--cream); font-size: 19px; letter-spacing: -0.025em; }
.panel-tag { padding: 6px 9px; border: 1px solid rgba(24, 183, 207, 0.25); border-radius: 8px; color: var(--cyan); background: rgba(24, 183, 207, 0.06); font-size: 9px; font-weight: 900; }

.form-grid { display: grid; grid-template-columns: 1fr 170px; gap: 16px; padding: 22px; }
.field { display: grid; align-content: start; gap: 8px; }
.field.wide, .wide { grid-column: 1 / -1; }
.field > span { color: #c6d0d5; font-size: 11px; font-weight: 800; }
.field small { color: var(--muted); font-size: 10px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  padding: 0 13px;
  color: var(--text);
  background: #0b161c;
}
select { color-scheme: dark; }
select option, select optgroup { color: var(--text); background-color: #091319; }
input, select { height: 43px; }
textarea { padding-block: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(24, 183, 207, 0.07); }
.password-input { position: relative; display: block; }
.password-input input { padding-right: 50px; }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 35px; height: 35px; transform: translateY(-50%); cursor: pointer; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
.password-toggle:hover, .password-toggle:focus-visible { outline: 0; color: var(--cream); background: rgba(24, 183, 207, .09); }
.password-toggle svg { width: 19px; height: 19px; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.password-toggle .eye-off-icon, .password-toggle.visible .eye-on-icon { display: none; }
.password-toggle.visible .eye-off-icon { display: block; }
.input-unit { display: grid; grid-template-columns: 1fr auto; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.035); }
.input-unit input { border: 0; border-radius: 0; background: transparent; }
.input-unit em { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-size: 10px; font-style: normal; }

.sequence { display: grid; gap: 0; margin: 0; padding: 10px 22px 22px; list-style: none; }
.sequence li { position: relative; display: flex; gap: 13px; padding: 15px 0; }
.sequence li:not(:last-child) { border-bottom: 1px solid var(--line); }
.sequence li > span { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--cyan); background: var(--surface-2); font-size: 10px; font-weight: 900; }
.sequence li div { display: grid; gap: 4px; }
.sequence strong { font-size: 12px; }
.sequence small { color: var(--muted); font-size: 10px; line-height: 1.4; }

.automation-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.automation-summary > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.024);
}
.automation-summary span { color: var(--cyan); font-size: 8px; font-weight: 900; letter-spacing: 0.14em; }
.automation-summary strong { color: var(--cream); font-size: 12px; }
.automation-summary small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.news-panel { margin-top: 16px; }
.news-form-grid { grid-template-columns: minmax(0, 1fr); }
.news-time-add { display: flex; flex-wrap: wrap; gap: 10px; }
.news-time-add input { width: min(200px, 100%); }
.news-time-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px; max-height: 126px; overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.024); }
.news-time-list:empty::before { content: 'Nessun orario configurato'; color: var(--muted); font-size: 10px; }
.news-time-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; border: 1px solid rgba(24, 183, 207, 0.3); border-radius: 9px; padding: 0 8px; color: var(--cream); background: rgba(24, 183, 207, 0.075); font-size: 11px; font-weight: 800; }
.news-time-chip button { width: 18px; height: 18px; cursor: pointer; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 14px; line-height: 1; }
.news-time-chip button:hover { color: var(--cream); background: rgba(255, 255, 255, 0.1); }
.news-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.panel-note { margin: 0; border-bottom: 1px solid var(--line); padding: 13px 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.system-chip { border: 1px solid rgba(24, 183, 207, 0.24); border-radius: 7px; padding: 5px 7px; color: var(--cyan); background: rgba(24, 183, 207, 0.055); font-size: 8px; font-weight: 900; }

.split-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; }
.inline-form { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; padding: 16px; border-bottom: 1px solid var(--line); }
.playlist-list { display: grid; gap: 7px; max-height: 510px; overflow-y: auto; padding: 14px; }
.playlist-button { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; width: 100%; min-height: 62px; cursor: pointer; border: 1px solid transparent; border-radius: 12px; padding: 9px; background: transparent; text-align: left; }
.playlist-button:hover { background: rgba(255, 255, 255, 0.03); }
.playlist-button.active { border-color: rgba(24, 183, 207, 0.3); background: rgba(24, 183, 207, 0.065); }
.type-icon { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 10px; color: var(--cream); background: var(--surface-3); font-size: 9px; font-weight: 900; }
.playlist-button div { display: grid; min-width: 0; gap: 3px; }
.playlist-button strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.playlist-button small, .playlist-button > small { color: var(--muted); font-size: 9px; }
.repeat-toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.repeat-toggle input { width: 16px; height: 16px; accent-color: var(--cyan); }
.playlist-toolbar { display: flex; align-items: center; gap: 12px; }
.empty-state { padding: 50px 24px; color: var(--muted); text-align: center; }
.playlist-items { display: grid; gap: 7px; padding: 14px; }
.playlist-row, .media-row { display: grid; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.024); }
.playlist-row { grid-template-columns: 32px minmax(0, 1fr) auto; min-height: 58px; padding: 9px 10px; }
.row-number { color: var(--muted); font-size: 10px; font-weight: 900; text-align: center; }
.row-copy { display: grid; min-width: 0; gap: 3px; }
.row-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.row-copy small { color: var(--muted); font-size: 9px; }
.row-actions { display: flex; gap: 5px; }
.mini-button { display: grid; width: 30px; height: 30px; cursor: pointer; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255, 255, 255, 0.025); }
.mini-button:hover { border-color: var(--line-strong); color: var(--cream); }

.library-grid { grid-template-columns: minmax(330px, 0.72fr) minmax(0, 1.28fr); }
.drop-zone { display: grid; grid-column: 1 / -1; min-height: 170px; cursor: pointer; place-items: center; align-content: center; gap: 6px; border: 1px dashed rgba(24, 183, 207, 0.36); border-radius: 14px; background: rgba(24, 183, 207, 0.035); text-align: center; }
.drop-zone.dragging { border-color: var(--cream); background: rgba(24, 183, 207, 0.08); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { color: var(--cream); }
.drop-zone small { color: var(--muted); }
.upload-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: #071114; background: linear-gradient(135deg, var(--cyan), var(--gold)); font-size: 22px; font-weight: 500; }
.upload-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.upload-progress span { height: 5px; overflow: hidden; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--cream), var(--gold)); animation: progress 1.2s ease-in-out infinite alternate; }
.upload-progress strong { color: var(--muted); font-size: 10px; }
.compact-select { width: 125px; height: 36px; }
.media-list { display: grid; gap: 7px; max-height: 570px; overflow-y: auto; padding: 14px; }
.media-row { grid-template-columns: 38px minmax(0, 1fr) auto; min-height: 62px; padding: 10px; }
.media-actions { display: flex; align-items: center; gap: 6px; }
.media-kind { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--cream); background: var(--surface-3); font-size: 9px; font-weight: 900; }
.media-add { min-height: 34px; padding-inline: 11px; border-radius: 9px; font-size: 10px; }
.station-settings { max-width: 780px; }

.advertising-grid { margin-bottom: 16px; }
.station-assignment { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.station-assignment legend { padding: 0 6px; color: #c6d0d5; font-size: 11px; font-weight: 800; }
.station-assignment > div { display: flex; flex-wrap: wrap; gap: 8px; }
.station-assignment label { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--muted); background: rgba(255, 255, 255, 0.025); font-size: 10px; font-weight: 800; }
.station-assignment input { width: 14px; height: 14px; accent-color: var(--cyan); }
.advertiser-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; }
.advertiser-card { display: grid; align-content: start; gap: 10px; border: 1px solid var(--line); border-radius: 16px; padding: 17px; background: linear-gradient(150deg, rgba(12, 23, 29, 0.96), rgba(6, 12, 16, 0.95)); }
.advertiser-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.advertiser-heading h3 { margin: 5px 0 0; color: var(--cream); font-size: 17px; }
.advertiser-card > p { margin: 0; color: var(--text); font-size: 11px; line-height: 1.5; }
.advertiser-card > small { color: var(--muted); font-size: 9px; }
.package-badge { border: 1px solid rgba(245, 158, 11, 0.32); border-radius: 9px; padding: 6px 8px; color: var(--gold); background: rgba(245, 158, 11, 0.06); font-size: 8px; font-weight: 900; white-space: nowrap; }
.package-badge.ready { border-color: rgba(24, 183, 207, 0.36); color: var(--cyan); background: rgba(24, 183, 207, 0.07); }
.spot-list { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 11px; }
.spot-list > div { display: grid; grid-template-columns: 24px minmax(0, 1fr) 30px 30px; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 7px; background: rgba(255, 255, 255, 0.022); }
.spot-list > div > b { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; color: var(--cyan); background: rgba(24, 183, 207, 0.08); font-size: 9px; }
.spot-list > div > span { display: grid; min-width: 0; gap: 2px; }
.spot-list strong, .spot-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-list strong { font-size: 10px; }
.spot-list small { color: var(--muted); font-size: 8px; }
.empty-inline { color: var(--muted); font-size: 10px; }
.advertiser-empty { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.02); }
.station-logo-editor { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 17px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: rgba(255, 255, 255, 0.022); }
.station-logo-editor > img { width: 84px; height: 84px; object-fit: contain; border: 1px solid var(--line); border-radius: 15px; padding: 6px; background: #071116; }
.station-logo-editor > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 10px; }
.station-logo-editor strong, .station-logo-editor p { grid-column: 1 / -1; }
.station-logo-editor p { margin: 0; color: var(--muted); font-size: 10px; }
.station-logo-editor input[type="file"] { height: 38px; padding: 4px; font-size: 10px; }
.station-logo-editor input[type="file"]::file-selector-button { height: 28px; margin-right: 9px; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; color: var(--cream); background: var(--surface-3); font-size: 10px; font-weight: 800; }

dialog { width: min(460px, calc(100% - 32px)); border: 1px solid var(--line-strong); border-radius: 20px; padding: 0; color: var(--text); background: #091319; box-shadow: 0 28px 100px rgba(0, 0, 0, 0.65); }
dialog::backdrop { background: rgba(2, 7, 10, 0.78); }
.dialog-card { display: grid; gap: 16px; padding-bottom: 21px; }
.dialog-card > .field, .dialog-card > .button { margin-inline: 21px; }
.delete-dialog-card > p { margin: 0 21px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0 21px; }
.close-button { width: 34px; height: 34px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255, 255, 255, 0.03); font-size: 20px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; max-width: 380px; transform: translateY(20px); border: 1px solid rgba(24, 183, 207, 0.36); border-radius: 13px; padding: 13px 16px; color: var(--cream); background: #0b171d; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { border-color: rgba(201, 116, 8, 0.65); }
.access-block { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; place-items: center; padding: 30px; background: radial-gradient(circle at 50% 12%, rgba(43,124,137,.25), transparent 30%), var(--bg); text-align: center; }
.login-card { width: min(420px, calc(100vw - 36px)); display: grid; gap: 17px; padding: 34px; border: 1px solid rgba(244,215,131,.3); border-radius: 24px; background: rgba(6,33,71,.94); box-shadow: 0 35px 100px rgba(0,8,28,.55); text-align: left; }
.login-card img { justify-self: center; object-fit: cover; border-radius: 18px; box-shadow: 0 0 35px rgba(244,215,131,.12); }
.login-card .eyebrow { margin: 4px 0 -12px; text-align: center; color: var(--gold); }
.login-card h1 { margin: 0; color: var(--cream); text-align: center; font-size: 30px; }
.login-card > p:not(.eyebrow) { margin: -8px 0 2px; color: var(--muted); text-align: center; line-height: 1.5; }
.login-card > a { color: var(--gold); text-align: center; font-size: 12px; text-decoration: none; }
.login-error { min-height: 16px; color: #ff9d8f; text-align: center; }
.quick-console-panel { margin: 16px 0; }
.quick-pad-builder { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .8fr) auto; align-items: end; gap: 12px; }
.quick-pad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 11px; margin-top: 18px; }
.quick-pad { position: relative; min-height: 92px; display: grid; align-content: center; gap: 6px; padding: 15px 40px 15px 15px; border: 1px solid rgba(244,215,131,.3); border-radius: 15px; color: var(--cream); background: linear-gradient(135deg, rgba(43,124,137,.24), rgba(6,33,71,.92)); cursor: pointer; text-align: left; }
.quick-pad:hover { border-color: var(--gold); box-shadow: 0 10px 30px rgba(0,8,28,.28); }
.quick-pad strong { color: var(--gold); font-size: 13px; }
.quick-pad small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-pad-remove { position: absolute; right: 9px; top: 9px; width: 25px; height: 25px; border: 0; border-radius: 50%; color: #ffb1a4; background: rgba(255,255,255,.07); cursor: pointer; }
.current-user-badge { display: grid; gap: 2px; border-right: 1px solid var(--line); padding-right: 15px; text-align: right; }
.current-user-badge strong { max-width: 190px; overflow: hidden; color: var(--cream); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.current-user-badge small { color: var(--cyan); font-size: 8px; font-weight: 900; letter-spacing: .11em; }
.user-management-grid { grid-template-columns: minmax(360px, .85fr) minmax(440px, 1.15fr); }
.user-form-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.permission-assignment > div { display: grid; grid-template-columns: 1fr 1fr; }
.permission-option { align-items: flex-start !important; }
.permission-option > span { display: grid; gap: 3px; }
.permission-option strong { color: var(--cream); font-size: 10px; }
.permission-option small { max-width: 290px; color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.4; }
.station-assignment input:disabled + span { opacity: .72; }
.user-list { display: grid; gap: 9px; max-height: 690px; overflow-y: auto; padding: 15px; }
.user-card { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 13px; padding: 14px; background: rgba(255,255,255,.023); }
.user-card.inactive { opacity: .62; }
.user-card-heading, .user-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.user-card-heading > div { display: grid; min-width: 0; gap: 3px; }
.user-card-heading strong { overflow: hidden; color: var(--cream); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-card-heading small { color: var(--muted); font-size: 9px; }
.user-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.user-card p b { color: #cbd6da; }
.user-card-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.role-badge, .account-state { border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.role-badge.admin { border-color: rgba(244,215,131,.34); color: var(--gold); background: rgba(244,215,131,.06); }
.role-badge.staff, .account-state.active { border-color: rgba(24,183,207,.32); color: var(--cyan); background: rgba(24,183,207,.055); }
.account-state { margin-right: auto; }
.audit-panel { margin-top: 16px; }
.audit-list { display: grid; max-height: 430px; overflow-y: auto; }
.audit-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 16px; min-height: 58px; border-bottom: 1px solid var(--line); padding: 10px 21px; }
.audit-row:last-child { border-bottom: 0; }
.audit-row time { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.audit-row > span { display: grid; min-width: 0; gap: 4px; }
.audit-row strong { color: var(--cream); font-size: 11px; }
.audit-row small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }

@keyframes progress { from { opacity: 0.35; transform: scaleX(0.3); transform-origin: left; } to { opacity: 1; transform: scaleX(1); transform-origin: left; } }

@media (max-width: 1250px) {
  .on-air-console { grid-template-columns: minmax(390px, 1.25fr) minmax(290px, 0.75fr); }
  .metrics { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .workspace { padding-inline: 28px; }
  .user-management-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  html, body { min-width: 0; overflow-x: hidden; }
  .studio-app { display: block; padding-top: 184px; }
  .topbar { position: fixed; right: 0; left: 0; height: 68px; padding: 0 14px; }
  .brand img { width: 44px; height: 44px; }
  .brand span { font-size: 8px; }
  .brand strong { font-size: 16px; }
  .topbar-actions { gap: 8px; }
  .current-user-badge { display: none; }
  .service-state { gap: 7px; font-size: 10px; }
  .service-state i { width: 8px; height: 8px; }
  .public-site-link, .logout-button { padding: 7px 10px; font-size: 10px; }
  .sidebar {
    position: fixed;
    right: 0;
    left: 0;
    top: 68px;
    z-index: 18;
    display: block;
    height: auto;
    padding: 10px 12px 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(3, 29, 67, 0.98);
    backdrop-filter: blur(16px);
  }
  .sidebar-label, .sidebar-note { display: none; }
  .station-switcher { display: flex; gap: 7px; margin: 0; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
  .station-switcher, .nav-tabs { scrollbar-width: none; }
  .station-switcher::-webkit-scrollbar, .nav-tabs::-webkit-scrollbar { display: none; }
  .station-button { min-width: 145px; grid-template-columns: 32px minmax(0, 1fr) 7px; gap: 8px; padding: 7px 9px; }
  .station-code { width: 30px; height: 30px; border-radius: 8px; }
  .station-code img { width: 25px; height: 25px; }
  .station-button strong { font-size: 11px; }
  .nav-tabs { display: flex; gap: 6px; margin: 0; overflow-x: auto; padding-top: 8px; }
  .nav-button { min-height: 36px; flex: 0 0 auto; border: 1px solid transparent; padding: 0 11px; font-size: 10px; white-space: nowrap; }
  .nav-button.active { border-color: rgba(24, 183, 207, .22); }
  .workspace { padding: 22px 14px 54px; }
  .workspace-heading { align-items: center; }
  .focused-view .workspace-heading { margin-bottom: 18px; }
  .focused-view .on-air-console, .focused-view .metrics { display: none; }
  .workspace-heading h1 { font-size: clamp(28px, 8vw, 38px); }
  .studio-station-logo { width: 50px; height: 50px; border-radius: 13px; }
  .on-air-console { grid-template-columns: 1fr; margin-top: 18px; }
  .queue-card { grid-column: auto; grid-template-columns: 180px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid, .library-grid, .advertising-grid, .user-management-grid { grid-template-columns: 1fr; }
  .split-layout { grid-template-columns: 1fr; }
  .quick-pad-builder { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 18px; }
  .quick-pad-builder > .button { grid-column: 1 / -1; }
  .advertiser-list { grid-template-columns: 1fr; }
  .station-settings { max-width: none; }
}

@media (max-width: 760px) {
  .studio-app { padding-top: 178px; }
  .topbar { height: 62px; padding-inline: 10px; }
  .brand { gap: 8px; }
  .brand img { width: 40px; height: 40px; }
  .brand span { display: none; }
  .brand strong { margin: 0; font-size: 14px; letter-spacing: .06em; }
  .topbar-actions { gap: 6px; }
  .service-state span { display: none; }
  .public-site-link, .logout-button { padding: 7px 9px; font-size: 9px; }
  .sidebar { top: 62px; padding-inline: 10px; }
  .station-button { min-width: 118px; }
  .workspace { padding: 18px 10px 48px; }
  .workspace-heading { gap: 10px; }
  .station-heading-copy { min-width: 0; gap: 10px; }
  .studio-station-logo { width: 44px; height: 44px; }
  .workspace-heading h1 { overflow: hidden; margin-top: 4px; font-size: 28px; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-heading .eyebrow { font-size: 8px; }
  .air-badge { flex: 0 0 auto; padding: 7px 9px; font-size: 8px; }
  .on-air-card { grid-template-columns: 1fr; min-height: 0; padding: 17px; }
  .on-air-copy > strong { font-size: 23px; white-space: normal; }
  .air-timing { justify-content: stretch; }
  .air-timing div { min-width: 0; flex: 1; text-align: left; }
  .transport-controls { justify-content: space-between; }
  .transport-button { width: 44px; }
  .transport-button.play { width: 54px; }
  .quick-play-card { padding: 17px; }
  .quick-actions { grid-template-columns: 1fr; }
  .queue-card { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
  .queue-heading { padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metrics { gap: 8px; }
  .metric { min-height: 78px; padding: 12px; }
  .metric strong { font-size: 20px; }
  .panel { border-radius: 15px; }
  .panel-heading { min-height: 68px; align-items: flex-start; padding: 15px; }
  .panel-heading h2 { font-size: 17px; }
  .panel-heading .panel-tag { flex: 0 0 auto; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .automation-summary { grid-template-columns: 1fr; }
  .news-time-add { display: grid; grid-template-columns: 1fr 1fr; }
  .news-time-add input { grid-column: 1 / -1; width: 100%; }
  .news-actions, .user-form-actions { display: grid; grid-template-columns: 1fr; }
  .news-actions .button, .user-form-actions .button { width: 100%; }
  .quick-pad-builder { grid-template-columns: 1fr; padding: 16px; }
  .quick-pad-builder > .button { grid-column: auto; }
  .quick-pad-grid { grid-template-columns: 1fr; margin-top: 12px; }
  .inline-form { grid-template-columns: 1fr; }
  .media-row { grid-template-columns: 38px minmax(0, 1fr); }
  .media-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); }
  .media-actions .button { width: 100%; }
  .advertiser-card { padding: 14px; }
  .advertiser-heading { align-items: flex-start; }
  .station-logo-editor { grid-template-columns: 1fr; text-align: center; }
  .station-logo-editor > img { justify-self: center; }
  .station-logo-editor > div { grid-template-columns: 1fr; }
  .station-logo-editor strong, .station-logo-editor p { grid-column: auto; }
  .station-logo-editor input[type="file"], .station-logo-editor .button { width: 100%; }
  .permission-assignment > div { grid-template-columns: 1fr; }
  .station-assignment > div { display: grid; grid-template-columns: 1fr; }
  .station-assignment label { width: 100%; }
  .user-card-heading, .user-card-actions { flex-wrap: wrap; }
  .user-card-actions .account-state { width: max-content; }
  .audit-row { grid-template-columns: 1fr; gap: 4px; }
  .audit-row small { white-space: normal; }
  dialog { max-height: calc(100dvh - 24px); overflow-y: auto; }
  .dialog-actions { grid-template-columns: 1fr; }
  .toast { right: 10px; bottom: 10px; left: 10px; max-width: none; }
  .access-block { padding: 14px; }
  .login-card { width: min(100%, 420px); gap: 14px; padding: 24px 18px; border-radius: 20px; }
  .login-card img { width: 92px; height: 92px; }
  .login-card h1 { font-size: 26px; }
}

@media (max-width: 390px) {
  .brand strong { font-size: 12px; }
  .station-button { min-width: 134px; }
  .station-button strong { font-size: 9px; }
  .workspace-heading h1 { font-size: 25px; }
  .air-badge { max-width: 104px; text-align: center; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .panel-heading { gap: 8px; }
  .panel-tag { font-size: 7px; }
  .spot-list > div { grid-template-columns: 22px minmax(0, 1fr) 28px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
