:root {
  color-scheme: dark;
  --bg: #020b13;
  --panel: #061521;
  --panel-strong: #081c2a;
  --line: #153649;
  --line-bright: #1f536b;
  --text: #e8f7ff;
  --muted: #74a7bd;
  --cyan: #31d7ff;
  --green: #36e7a1;
  --amber: #ffc247;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
a { font: inherit; }

.station-shell {
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  padding: 8px;
  gap: 8px;
  background:
    radial-gradient(circle at 50% -20%, rgba(34, 118, 151, .18), transparent 40%),
    var(--bg);
}

.station-header {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 20, 31, .97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

.station-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: #2fc7f4;
  color: #00111c;
  font-weight: 950;
  letter-spacing: .08em;
}

.station-brand div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.station-brand strong {
  overflow: hidden;
  font-size: 15px;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-brand small,
.panel-header small {
  color: var(--muted);
  font-size: 10px;
}

.station-summary,
.station-actions,
.station-module-nav,
.station-tool-row,
.panel-actions,
.panel-header > div {
  display: flex;
  align-items: center;
}

.station-summary { gap: 16px; }
.station-actions { justify-content: flex-end; gap: 6px; }
.station-module-nav,
.station-tool-row { display: flex; align-items: center; gap: 3px; }
.station-module-nav {
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
}
.panel-actions { gap: 7px; }
.panel-header > div { min-width: 0; gap: 8px; }

.station-summary span,
.station-summary time,
.panel-live {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
}

.receiver-state.is-live,
.panel-live { color: var(--green); }
.receiver-state.is-error { color: var(--amber); }

.station-actions button,
.station-actions a,
.panel-actions button,
.panel-actions a {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.station-module-nav a {
  min-height: 26px;
  padding: 4px 8px;
  border-color: transparent;
  background: transparent;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
}
.station-module-nav a[aria-current="page"] {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 14%, var(--panel-strong));
  color: var(--cyan);
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--cyan) 10%, transparent);
}
.station-tool-row button {
  min-width: 30px;
  padding-inline: 7px;
  font-size: 15px;
}

.station-actions button:hover,
.station-actions a:hover,
.panel-actions button:hover,
.panel-actions a:hover,
.station-actions button:focus-visible,
.station-actions a:focus-visible,
.panel-actions button:focus-visible,
.panel-actions a:focus-visible {
  outline: none;
  border-color: var(--cyan);
  background: #0a2637;
  color: var(--cyan);
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  min-height: 0;
  gap: 8px;
}

.station-panel {
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  background: #071925;
}

.panel-index {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.panel-header strong {
  overflow: hidden;
  font-size: 11px;
  letter-spacing: .055em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-actions button,
.panel-actions a {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 9px;
}

.frame-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #020b13;
}

iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #020b13;
}

.station-grid.focus-mode {
  grid-template-columns: minmax(0, 1fr);
}

.station-grid.focus-mode .station-panel:not(.is-focused) { display: none; }

@media (max-width: 1280px) {
  .station-header {
    grid-template-columns: minmax(260px, 1fr) auto;
  }
  .station-summary { display: none; }
}

@media (max-width: 920px) {
  body { overflow: auto; }
  .station-shell {
    min-width: 920px;
    min-height: 680px;
  }
  .station-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .station-grid {
    grid-template-columns: repeat(3, minmax(294px, 1fr));
  }
  .panel-actions a { display: none; }
}

