:root {
  color-scheme: light;
  --ink: #111e38; --muted: #536582; --blue: #2457e6; --line: #e1e9f7;
  --paper: #fff; --bg: #f4f7fd; --mono: "IBM Plex Mono", monospace;
  font: 16px/1.5 Geist, Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); padding-bottom: 85px; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, canvas:focus-visible, input:focus-visible { outline: 3px solid #729aff; outline-offset: 3px; }
[hidden] { display: none !important; }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner, main, .player-inner { max-width: 1410px; margin: auto; padding-inline: clamp(18px, 4vw, 58px); }
.top-inner { height: 70px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-size: 21px; letter-spacing: -.65px; font-weight: 700; }
.brand-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--blue); color: white; font-size: 10px; letter-spacing: 1px; box-shadow: 0 4px 10px #2457e633; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.source { color: var(--muted); font-size: 13px; }
.button { background: white; border: 1px solid #d9e4f5; color: var(--ink); border-radius: 10px; padding: 9px 13px; font-size: 14px; font-weight: 600; }
.button:hover { background: #edf3ff; }
.primary { background: var(--blue); color: white; border-color: var(--blue); box-shadow: 0 4px 12px #2457e62b; }
.primary:hover { background: #1745cd; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 28px 0 21px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(32px, 4vw, 49px); letter-spacing: -.062em; line-height: 1.08; margin-bottom: 6px; }
p { color: var(--muted); }
h2 { font-size: 17px; letter-spacing: -.025em; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(315px, .43fr); gap: 18px; }
.globe-card, .directory, .metric-grid article { border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 4px 20px #183b8110; }
.globe-card { position: relative; min-width: 0; height: clamp(430px, 42vw, 560px); overflow: hidden; isolation: isolate;
  background: radial-gradient(ellipse at 53% 53%, #dceaff, #f5f9ff 73%); }
.globe-card::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#7f9ac450 1px, transparent 1px); background-size: 19px 19px; z-index: -1; mask-image: radial-gradient(ellipse, transparent 22%, black); }
.globe-heading, .map-footer { position: absolute; left: 18px; right: 18px; pointer-events: none; z-index: 1; }
.globe-heading { top: 15px; }
.globe-heading p { font-size: 13px; }
canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
canvas:active { cursor: grabbing; }
.map-footer { bottom: 15px; display: flex; justify-content: space-between; align-items: end; gap: 8px; }
.map-key, .map-tip { background: #ffffffed; border: 1px solid #d8e5f8; color: #425674; padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.map-key { display: flex; flex-wrap: wrap; gap: 3px 10px; }
.map-key i { display: inline-block; vertical-align: 1px; margin-right: 4px; width: 7px; height: 7px; background: #0a59ec; border-radius: 50%; }
.map-key .key-live { background: #04a784; box-shadow: 0 0 0 2px #04a7843b; }
.map-key .key-unavailable { background: #69788e; }
.map-actions { display: flex; gap: 5px; pointer-events: auto; }
.map-actions button { padding: 0; width: 36px; height: 36px; font-size: 19px; }
.map-tip { position: absolute; pointer-events: none; max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; box-shadow: 0 5px 18px #2356a329; }
.directory { min-width: 0; min-height: 0; max-height: clamp(430px, 42vw, 560px); background: white; padding: 18px 16px 12px; display: flex; flex-direction: column; }
.directory h2 { margin-bottom: 12px; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #f6f8fd; padding: 0 10px; border-radius: 9px; color: var(--muted); }
.search span { font-size: 21px; }
.search input { border: 0; background: transparent; color: var(--ink); padding: 9px 0; font-size: 14px; width: 100%; min-width: 0; }
.filters { display: flex; gap: 7px; margin: 12px 0; }
.filters button { background: #f4f7fc; border: 1px solid transparent; padding: 5px 11px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.filters button[aria-pressed=true] { background: #e9efff; color: #1d4dd2; border-color: #dae5ff; font-weight: 600; }
.list-head { display: flex; justify-content: space-between; gap: 8px; padding: 0 4px 6px; font-size: 12px; color: var(--muted); }
.station-list { overflow: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #cbd9f3 transparent; }
.station { display: flex; align-items: center; text-align: left; gap: 10px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 9px; background: white; color: var(--ink); }
.station:hover, .station[aria-current=true] { background: #eff4ff; border-color: #e4edff; }
.station-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: #204dca; background: #e9efff; font: 500 12px var(--mono); }
.station-info { min-width: 0; flex: 1; }
.station-info strong, .station-info small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.station-info strong { font-size: 14px; font-weight: 600; }
.station-info small { color: var(--muted); font-size: 12px; }
.station-play { color: var(--blue); font-size: 12px; }
.station[data-status=unavailable] { color: var(--muted); }
.station[data-status=unavailable] .station-icon { color: #56657b; background: #e8ecf2; }
.station[data-status=unavailable] .station-play { color: #596980; }
.station[data-status=live] .station-play { color: #087964; }
.more { margin-top: 8px; font-size: 13px; padding: 5px; }
.insights { margin-top: 19px; }
.insights-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 9px; }
.insights-heading span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insights-heading h2 { flex: none; }
.station-brief { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 15px; margin-bottom: 12px; background: #eaf1ff; border: 1px solid #d9e6fc; border-radius: 15px; }
.station-brief > div { flex: 1; min-width: 0; }
.station-brief h3 { font-size: clamp(17px, 2vw, 22px); letter-spacing: -.03em; overflow-wrap: anywhere; }
.station-brief p, .station-brief > span:last-child { color: #455d81; font-size: 13px; }
.station-brief > span:last-child:empty { display: none; }
.station-flag { display: grid; place-items: center; flex: none; width: 49px; height: 49px; border-radius: 12px; background: #fff; font-size: 26px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.metric-grid article { background: white; padding: 12px 14px; }
.metric-icon { float: right; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: #edf3ff; color: var(--blue); }
.metric-grid h3 { font-size: 13px; font-weight: 500; color: var(--muted); }
.metric-grid strong { display: block; letter-spacing: -.04em; font-size: clamp(16px, 2vw, 24px); margin-top: 6px; }
.metric-grid p, footer { font-size: 12px; color: var(--muted); }
footer { padding: 15px 0; }
.player { position: fixed; bottom: 0; inset-inline: 0; z-index: 4; background: #fffffff5; border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.player-inner { display: flex; gap: 14px; align-items: center; min-height: 68px; }
.play { width: 42px; height: 42px; flex: none; color: white; background: var(--blue); border: 0; border-radius: 12px; }
.playing { flex: 1; min-width: 0; }
.playing strong, .playing span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playing span { color: var(--muted); font-size: 12px; }
.volume { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.volume input { width: 80px; accent-color: var(--blue); }
.auto { display: flex; align-items: center; gap: 6px; }
.switch { width: 24px; height: 14px; border-radius: 12px; background: #a6b4cc; position: relative; }
.switch::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; top: 2px; left: 2px; background: white; }
.auto[aria-pressed=true] .switch { background: var(--blue); }
.auto[aria-pressed=true] .switch::after { left: 12px; }
.toast { position: fixed; z-index: 6; bottom: 78px; left: 50%; transform: translateX(-50%); background: #152745; color: white; border-radius: 9px; padding: 10px 14px; width: max-content; max-width: 91vw; font-size: 14px; }
dialog { width: min(440px, calc(100vw - 26px)); border: 1px solid var(--line); border-radius: 18px; padding: 20px; color: var(--ink); box-shadow: 0 18px 80px #14244840; }
dialog::backdrop { background: #1224405e; }
dialog p { margin: 10px 0 14px; font-size: 14px; }
.dialog-head, #cityForm > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#cityForm { margin-top: 14px; }
#cityForm label { display: block; font-size: 14px; margin-bottom: 5px; }
#city { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
#cityResults { display: grid; gap: 5px; margin-top: 8px; font-size: 14px; }
#cityResults button { text-align: left; }
/* Mood chips scroll sideways instead of wrapping, so the list keeps its height. */
.filters { overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; }
.filters button:hover { background: #e9efff; color: #1d4dd2; }

/* Player controls */
.skip { padding: 0; width: 36px; height: 36px; font-size: 15px; flex: none; }
.fav { padding: 0; width: 36px; height: 36px; font-size: 17px; line-height: 1; flex: none; color: #5d6f8c; }
.fav.is-saved { color: #e0457b; border-color: #f2c4d4; background: #fff4f8; }
.fav[aria-pressed=true]:hover { background: #ffeaf2; }

/* Little equaliser that dances while a station is live. */
.eq { display: none; align-items: flex-end; gap: 3px; height: 18px; flex: none; }
body.is-live .eq { display: inline-flex; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: #00a884; transform-origin: bottom; animation: eq 0.9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.3s; animation-duration: .7s; }
.eq i:nth-child(3) { animation-delay: -.5s; animation-duration: 1.1s; }
.eq i:nth-child(4) { animation-delay: -.2s; animation-duration: .8s; }
.eq i:nth-child(5) { animation-delay: -.6s; animation-duration: .6s; }
@keyframes eq { from { transform: scaleY(.2); } to { transform: scaleY(1); } }

/* Station list */
.station-heart { color: #e0457b; font-size: 12px; flex: none; }
.station-list.scanning { animation: scan .5s ease-out; }
@keyframes scan {
  0% { opacity: .25; filter: blur(1.5px); }
  55% { opacity: 1; filter: none; }
  70% { opacity: .6; }
  100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .station-list.scanning, .eq i { animation: none; }
  .eq i { transform: scaleY(.6); }
}

@media (max-width: 780px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .globe-card { height: clamp(360px, 65vw, 490px); }
  .directory { height: 360px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .top-inner { height: 58px; }
  .source, .volume { display: none; }
  .intro { align-items: start; padding-top: 20px; }
  .intro p { font-size: 14px; }
  .primary { white-space: nowrap; margin-top: 3px; padding-inline: 8px; font-size: 12px; }
  .station-brief > span:last-child { margin-left: 61px; }
  .map-key { font-size: 11px; gap: 2px 5px; }
  .player-inner { gap: 8px; }
  .skip, .fav { width: 32px; height: 32px; }
  .play { width: 38px; height: 38px; }
  .eq { display: none !important; }
  .auto { font-size: 13px; padding-inline: 9px; }
}

