:root {
  color-scheme: dark;
  --canvas: #0d151e;
  --surface: #13202b;
  --raised: #1b2a36;
  --border: #2a3c49;
  --ink: #eef5f3;
  --muted: #a9bec8;
  --mint: #77edc0;
  --mint-wash: #213f3b;
  --gold: #f6c86c;
  font: 15px/1.4 "Segoe UI", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0,1fr) auto; height: 100dvh; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .leaflet-marker-icon:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 23px; letter-spacing: -.025em; font-weight: 600; white-space: nowrap; }
.brand strong { color: var(--mint); font-weight: 700; }
.brand-icon { display: grid; place-items: center; width: 37px; height: 37px; border: 1.5px solid var(--mint); border-radius: 50%; color: var(--mint); }
.brand-icon span { position: relative; width: 25px; height: 25px; border: 1px solid currentColor; border-radius: 50%; opacity: .92; }
.brand-icon span::after { content: ""; position: absolute; top: 6px; left: 8px; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.navigation, .filters { display: flex; gap: 5px; }
.navigation { padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.nav-button, .filters button, .text-button { border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: 8px 13px; font-weight: 650; }
.nav-button[aria-pressed=true], .filters button[aria-pressed=true] { background: var(--mint-wash); color: var(--mint); }
.nav-button:hover, .filters button:hover, .text-button:hover { color: var(--ink); }
.main { min-width: 0; min-height: 0; padding: 0 24px 14px; }
.workspace { height: 100%; display: grid; grid-template-columns: minmax(0,1fr) minmax(310px,365px); gap: 12px; min-height: 0; }
.map-panel, .stations-panel, .favorites-page { position: relative; min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); overflow: hidden; }
#map { position: absolute; inset: 0; background: #101d2a; font: inherit; }
.leaflet-container .leaflet-control-zoom { border: 1px solid var(--border); box-shadow: none; border-radius: 8px; overflow: hidden; }
.leaflet-container .leaflet-control-zoom a { background: #172632; color: var(--ink); border-color: var(--border); }
.leaflet-container .leaflet-control-zoom a:hover { background: #243b48; }
.leaflet-container .leaflet-control-attribution { background: #111e29ee; color: var(--muted); padding: 3px 7px; }
.leaflet-container .leaflet-control-attribution a { color: #d2e5e7; }
.map-controls { position: absolute; z-index: 500; right: 11px; top: 11px; }
.secondary { background: var(--raised); border: 1px solid var(--border); border-radius: 7px; padding: 7px 12px; font-weight: 600; white-space: nowrap; }
.secondary:hover:enabled { border-color: #638292; }
.map-button[aria-pressed=true] { color: var(--mint); background: var(--mint-wash); }
.map-caption { position: absolute; z-index: 400; pointer-events: none; bottom: 11px; left: 11px; padding: 5px 10px; color: var(--ink); background: #111e29ef; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-weight: 650; }
.country-name, .city-name { display: flex; align-items: center; justify-content: center; color: #c2dce0; white-space: nowrap; text-shadow: 0 1px 4px #06101a, 0 0 3px #06101a; font-size: 12px; font-weight: 700; }
.country-name { cursor: pointer; }
.country-name:hover, .country-name:focus { color: var(--mint); text-decoration: underline; }
.country-name.current { color: var(--mint); }
.country-name.on-tiles { background: #11212de8; border-radius: 4px; }
.city-name { color: #b4c7d2; font-size: 10px; font-weight: 600; pointer-events: none !important; }
.city-name::before { content: "·"; margin-right: 4px; }
.map-pin { display: grid; place-items: center; background: #81e9be; color: #0b3026; border-radius: 50%; border: 1px solid #0a3f32; box-shadow: 0 2px 6px #08151abf; font-weight: 800; font-size: 11px; }
.map-pin:hover { background: #b0ffde; }
.map-pin img { width: 20px; height: 20px; border-radius: 50%; object-fit: contain; background: #fff; }
.stations-panel { display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; }
.panel-header { display: grid; gap: 9px; padding: 14px 14px 7px; }
h1 { font-size: 20px; letter-spacing: -.03em; margin: 0 0 2px; }
select, .search-field { width: 100%; border: 1px solid var(--border); border-radius: 7px; color: var(--ink); background: var(--raised); padding: 8px 9px; min-height: 37px; }
.search-field { display: flex; gap: 7px; align-items: center; padding: 0 9px; color: var(--muted); }
.search-field span { font-size: 22px; line-height: 1; }
.search-field input { min-width: 0; width: 100%; padding: 7px 0; border: 0; color: var(--ink); background: transparent; outline-offset: 0; }
.search-field input::placeholder { color: var(--muted); }
.filters { justify-content: space-between; }
.filters button { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
.count-row { display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 6px; padding: 0 14px; color: var(--muted); font-size: 12px; }
.text-button { padding: 4px 0; color: var(--mint); font-size: 12px; }
.station-list { overflow: auto; min-height: 0; padding: 0 9px; scrollbar-color: #405663 transparent; }
.station { display: flex; align-items: stretch; min-width: 0; border-bottom: 1px solid #263743; }
.station:hover { background: #192a36; }
.station.current { background: #19352f; }
.station-play { flex: 1 1 auto; min-width: 0; min-height: 58px; display: flex; align-items: center; gap: 9px; background: transparent; border: 0; text-align: left; padding: 7px 5px; }
.station-logo { flex: 0 0 35px; height: 35px; display: grid; place-items: center; background: var(--raised); border-radius: 6px; color: var(--mint); overflow: hidden; font-size: 12px; }
.station-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.station-text { flex: 1; min-width: 0; }
.station-name, .station-place { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-name { font-weight: 700; font-size: 13px; }
.station-place { color: var(--muted); font-size: 11px; margin-top: 2px; }
.row-play { color: var(--mint); font-size: 11px; flex: 0 0 auto; }
.star { flex: 0 0 35px; align-self: center; min-height: 42px; background: transparent; border: 0; border-radius: 6px; color: var(--muted); font-size: 20px; }
.star[aria-pressed=true] { color: var(--gold); }
.star:hover { background: #243945; }
.empty { padding: 16px 8px; margin: 0; color: var(--muted); }
.pages { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 12px; color: var(--muted); font-size: 12px; }
.page-button { width: 38px; padding: 2px 7px; font-size: 21px; line-height: 1.2; }
.favorites-page { height: 100%; width: min(100%, 860px); margin: 0 auto; display: grid; grid-template-rows: auto minmax(0,1fr); padding: 8px 12px 14px; }
.favorites-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 8px; }
.player { border-top: 1px solid var(--border); background: #14232d; min-height: 68px; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 13px; padding: 9px 24px; }
.play-control { background: var(--mint); color: #0d2a22; border: 0; border-radius: 50%; width: 41px; height: 41px; font-size: 15px; font-weight: 800; display: grid; place-items: center; }
.player-info { overflow: hidden; }
#playing-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
#playback-status { color: var(--muted); font-size: 12px; }
.volume { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; grid-column: 4; }
.volume input { width: 94px; accent-color: var(--mint); }
.volume output { color: var(--mint); min-width: 33px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 780px) {
  body { height: auto; grid-template-rows: auto minmax(0,1fr) auto; }
  .topbar { padding: 11px 12px; }
  .main { padding: 0 12px 12px; }
  .workspace { height: auto; grid-template-columns: minmax(0,1fr); }
  .map-panel { height: clamp(270px,45dvh,420px); }
  .stations-panel { min-height: 430px; height: min(70dvh, 580px); }
  .favorites-page { height: min(76dvh,760px); }
  .player { position: sticky; bottom: 0; z-index: 800; padding: 8px 12px; gap: 9px; }
}
@media (max-width: 475px) {
  .topbar { flex-wrap: wrap; }
  .brand { font-size: 20px; }
  .brand-icon { width: 31px; height: 31px; }
  .nav-button { padding: 5px 7px; font-size: 12px; }
  .navigation { gap: 2px; }
  .map-caption { bottom: 28px; }
  .player { grid-template-columns: auto minmax(0,1fr) auto; }
  .volume { grid-column: 3; }
  .volume span { display: none; }
  .volume input { width: 60px; }
  .vlc-button { grid-row: 2; grid-column: 2 / 4; justify-self: start; padding: 4px 8px; font-size: 11px; }
}
