*, *::before, *::after { box-sizing: border-box; }
:root {
  --blue: #0072ce;
  --blue2: #3ea0ff;
  --ink: #f4f7fc;
  --mute: #a9b6cc;
  --glass: rgba(14, 24, 44, 0.55);
  --glass2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.12);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
html, body {
  margin: 0; height: 100%; width: 100%;
  background: #050a16; color: var(--ink);
  font: 16px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, label { font: inherit; color: inherit; }
button { -webkit-user-select: none; user-select: none; touch-action: manipulation; cursor: pointer; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.nojs { position: fixed; z-index: 50; left: 50%; top: calc(var(--sat) + 16px); transform: translateX(-50%); width: min(92vw, 440px); margin: 0;
  padding: 14px 16px; border-radius: 14px; background: #10203e; border: 1px solid var(--line); text-align: center; }

.app {
  position: relative; z-index: 1;
  width: 100%; height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* never let wide content (genre chips) stretch the app past the screen */
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 12px;
  padding: calc(var(--sat) + 12px) calc(var(--sar) + 14px) 0 calc(var(--sal) + 14px);
  max-width: 1100px; margin: 0 auto;
}

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; user-select: none; -webkit-user-select: none; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.flag { display: grid; grid-template-rows: repeat(3, 1fr); width: 34px; height: 24px; border-radius: 5px; overflow: hidden; flex: none; box-shadow: 0 2px 10px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.15); }
.flag i:nth-child(1) { background: var(--blue); }
.flag i:nth-child(2) { background: #000; }
.flag i:nth-child(3) { background: #fff; }
h1 { margin: 0; font-size: clamp(20px, 5.5vw, 26px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.sub { margin: 2px 0 0; font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-btn {
  min-width: 48px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass2); font-weight: 700; font-size: 15px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .12s, background .2s;
}
.chip-btn:active { transform: scale(.94); background: rgba(255,255,255,.16); }
.brand > div { min-width: 0; }
h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }

/* running clock (Tallinn time) */
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; font-variant-numeric: tabular-nums; }
.clk-t { font-size: clamp(20px, 5.6vw, 26px); font-weight: 800; letter-spacing: -.01em; background: linear-gradient(180deg, #fff, #bcd9ff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 18px rgba(62,160,255,.25); }
.clk-t small { font-size: .58em; font-weight: 700; margin-left: 1px; opacity: .75; }
.clk-d { font-size: 12px; font-weight: 600; color: var(--mute); text-transform: capitalize; white-space: nowrap; margin-top: 2px; }

/* weather */
.wx {
  position: relative; min-width: 0;
  /* Never overflow:hidden here: it turns the card into a scroll box whose automatic min height is 0, and
     mobile Chromium/Brave then squashed it to an empty strip under the tabs (min-height:max-content was
     not honoured there). overflow:clip rounds the corners without that; old engines just keep visible. */
  overflow: visible; overflow: clip;
  min-height: max-content; flex-shrink: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px;
  padding: 6px 8px 6px 6px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--wxbg, linear-gradient(120deg, rgba(40,80,140,.55), rgba(10,20,40,.7)));
  box-shadow: 0 12px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.1);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  user-select: none; -webkit-user-select: none; transition: background .6s;
}
.wx::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .5;
  background: radial-gradient(60% 120% at 8% 0%, rgba(255,255,255,.18), transparent 60%); }
.wx.k-clear { --wxbg: linear-gradient(120deg, rgba(44,134,230,.7), rgba(255,190,80,.35)); }
.wx.k-part  { --wxbg: linear-gradient(120deg, rgba(50,120,200,.65), rgba(120,150,190,.4)); }
.wx.k-cloud, .wx.k-fog { --wxbg: linear-gradient(120deg, rgba(90,110,140,.6), rgba(40,52,74,.7)); }
.wx.k-rain  { --wxbg: linear-gradient(120deg, rgba(40,70,120,.7), rgba(20,34,60,.8)); }
.wx.k-snow  { --wxbg: linear-gradient(120deg, rgba(140,170,210,.55), rgba(60,80,120,.65)); }
.wx.k-storm { --wxbg: linear-gradient(120deg, rgba(60,40,100,.7), rgba(20,16,40,.85)); }
.wx.night   { --wxbg: linear-gradient(120deg, rgba(20,30,70,.8), rgba(8,12,30,.85)); }
.wx-main {
  position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 52px;
  padding: 0 6px 0 0; border: 0; background: none; text-align: left; border-radius: 14px; transition: transform .12s;
}
.wx-main:active { transform: scale(.98); }
.wx-main:focus-visible, .wx-city select:focus-visible, .wx-link:focus-visible { outline: 2px solid #67e8f9; outline-offset: 2px; }
#wxIcon { flex: none; width: 52px; height: 52px; display: block; }
.wx-temp { flex: none; font-size: clamp(24px, 7vw, 30px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.wx-txt { min-width: 0; display: flex; flex-direction: column; }
.wx-desc { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-det { font-size: 13px; color: #d3def0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-city { position: relative; display: block; min-width: 0; }
.wx-city::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; opacity: .8; }
.wx-city select {
  -webkit-appearance: none; appearance: none; font: inherit; color: inherit; font-size: 15px; font-weight: 700;
  height: 44px; max-width: 38vw; padding: 0 30px 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.22); text-overflow: ellipsis;
}
.wx-city select option { color: #06204a; background: #fff; }
.wx-more { grid-column: 1 / -1; position: relative; padding: 2px 2px 4px; }
.wx-more[hidden] { display: none; }
.wx-days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wx-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.08); min-width: 0; }
.wx-day b { font-size: 13px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.wx-day canvas { width: 34px; height: 34px; display: block; }
.wx-day span { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wx-day span i { font-style: normal; font-weight: 500; color: #b9c7dc; margin-left: 4px; }
.wx-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; color: #c4d0e4; min-width: 0; }
.wx-foot > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-link { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 800; color: #fff; text-decoration: none; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); }
.wx-link:active { background: rgba(255,255,255,.26); }

/* player */
.player {
  display: flex; align-items: center; gap: clamp(12px, 4vw, 22px);
  padding: clamp(12px, 3.5vw, 18px);
  border-radius: 24px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(0,114,206,.35), transparent 60%),
    linear-gradient(160deg, rgba(20,36,66,.78), rgba(8,14,28,.78));
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  user-select: none; -webkit-user-select: none;
  min-width: 0;
}
.disc-wrap { position: relative; flex: none; width: clamp(96px, 30vw, 150px); aspect-ratio: 1; display: grid; place-items: center; }
#rings { position: absolute; inset: -18%; width: 136%; height: 136%; pointer-events: none; }
.disc {
  position: relative; width: 74%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: conic-gradient(from 200deg, #0b3f7a, #0072ce, #6cc0ff, #0b3f7a);
  box-shadow: 0 10px 30px rgba(0,0,0,.55), inset 0 0 0 3px rgba(255,255,255,.14), inset 0 -10px 24px rgba(0,0,0,.35);
}
.disc .mono { font-size: clamp(26px, 9vw, 44px); font-weight: 800; letter-spacing: -.03em; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.disc img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; border-radius: 12%; background: rgba(255,255,255,.94); padding: 6%; opacity: 0; transition: opacity .3s; }
.disc img.ok { opacity: 1; }
.np-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.np-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.np-q { display: inline-flex; }
.q {
  flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: #c9d4e6; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
}
.q.hi { color: #bfe3ff; background: rgba(62,160,255,.16); border-color: rgba(62,160,255,.45); }
.q.max {
  color: #2a1a00; border-color: rgba(255,230,150,.9);
  background: linear-gradient(135deg, #fff1b8 0%, #ffd34d 40%, #e9a91c 60%, #ffe58a 100%);
  box-shadow: 0 0 10px rgba(255,200,60,.35), inset 0 1px 0 rgba(255,255,255,.7);
}
.np-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.np-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #61708a; }
.np-status.live { color: #ff8a8a; }
.np-status.live .dot { background: #ff4d4d; box-shadow: 0 0 0 0 rgba(255,77,77,.6); animation: pulse 1.6s infinite; }
.np-status.busy .dot { background: #ffd34d; }
.np-status.err { color: #ffb4a0; }
.np-status.err .dot { background: #ff7a50; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255,77,77,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,77,0); } }
.np-name { margin: 0; font-size: clamp(19px, 5.6vw, 26px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta { margin: 0; font-size: 14px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.controls { display: flex; align-items: center; gap: clamp(6px, 3vw, 14px); margin-top: 6px; }
.ctl {
  position: relative; flex: none;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,.08);
  display: grid; place-items: center;
  transition: transform .12s, background .2s, box-shadow .2s;
}
.ctl svg { width: 22px; height: 22px; fill: currentColor; }
.ctl:active { transform: scale(.9); background: rgba(255,255,255,.18); }
.ctl:focus-visible, .chip-btn:focus-visible, .chip:focus-visible, .st:focus-visible, .search input:focus-visible { outline: 2px solid #67e8f9; outline-offset: 2px; }
.ctl.big { width: 62px; height: 62px; border: 0; background: linear-gradient(180deg, #2b9bff, #0062b8); box-shadow: 0 8px 22px rgba(0,114,206,.55), inset 0 1px 0 rgba(255,255,255,.35); }
.ctl.big svg { width: 28px; height: 28px; }
.ctl .ic-pause { display: none; }
.playing .ctl.big .ic-play { display: none; }
.playing .ctl.big .ic-pause { display: block; }
.spinner { position: absolute; inset: -4px; border-radius: 50%; border: 3px solid transparent; border-top-color: #fff; opacity: 0; }
.loading .spinner { opacity: .9; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.row2 { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ctl.sm { width: 44px; height: 44px; }
.ctl.sm svg { width: 20px; height: 20px; }
#favBtn svg { fill: none; stroke: currentColor; stroke-width: 2; }
#favBtn[aria-pressed="true"] { color: #ff5d7a; }
#favBtn[aria-pressed="true"] svg { fill: currentColor; }
.ctl.sleep { width: auto; min-width: 44px; padding: 0 10px; border-radius: 999px; display: inline-flex; gap: 4px; }
.ctl.sleep span { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ctl.sleep.on { color: #ffd34d; border-color: rgba(255,211,77,.5); }
.vol { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 44px; color: var(--mute); }
.vol svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 40px; height: 44px; background: transparent; margin: 0; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(90deg, #3ea0ff var(--p, 85%), rgba(255,255,255,.18) var(--p, 85%)); }
input[type=range]::-moz-range-track { height: 5px; border-radius: 5px; background: rgba(255,255,255,.18); }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 5px; background: #3ea0ff; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8.5px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; }

/* browse */
.browse { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.search { position: relative; display: flex; align-items: center; }
.search > svg { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--mute); pointer-events: none; }
.search input {
  width: 100%; height: 48px; border-radius: 14px; padding: 0 48px 0 44px;
  border: 1px solid var(--line); background: rgba(10,18,34,.6); font-size: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: #7f8ca3; }
.search input::-webkit-search-cancel-button { display: none; }
.clear { position: absolute; right: 2px; width: 44px; height: 44px; border: 0; background: none; font-size: 24px; color: var(--mute); display: none; border-radius: 12px; }
.clear.show { display: block; }
.clear:active { background: rgba(255,255,255,.1); }
.chips-wrap { position: relative; flex: none; min-width: 0; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  padding: 4px 2px; margin: -4px -2px; min-width: 0; max-width: calc(100% + 4px);
  touch-action: pan-x; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 44px; user-select: none; -webkit-user-select: none;
  --fl: 0px; --fr: 0px;
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chips.more-l { --fl: 36px; }
.chips.more-r { --fr: 36px; }
.chips.drag { cursor: grabbing; }
.chips.drag .chip { pointer-events: none; }
.chips .chip { touch-action: pan-x; }
.chip-arrow {
  position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; margin-top: -22px;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(10,18,34,.85);
  display: grid; place-items: center; opacity: 0; pointer-events: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0,0,0,.45); transition: opacity .2s, transform .12s;
}
.chip-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chip-arrow.l { left: -4px; }
.chip-arrow.r { right: -4px; }
.chip-arrow.show { opacity: 1; pointer-events: auto; }
.chip-arrow:active { transform: scale(.9); }
.chip-arrow:focus-visible { outline: 2px solid #67e8f9; outline-offset: 2px; }
.chip {
  flex: none; height: 40px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.06);
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: background .2s, transform .12s;
  position: relative;
}
.chip::after { content: ""; position: absolute; inset: -3px 0; } /* 46px touch target */
.chip:active { transform: scale(.95); }
.chip[aria-selected="true"] { background: #fff; color: #06204a; border-color: #fff; }
.chip .n { opacity: .6; font-weight: 500; margin-left: 4px; font-size: 13px; }
.chip-top {
  color: #ffe9a8; border-color: rgba(255,210,90,.6);
  background: linear-gradient(135deg, rgba(255,214,90,.22), rgba(233,169,28,.08)), rgba(255,255,255,.04);
  box-shadow: inset 0 1px 0 rgba(255,240,190,.25), 0 0 12px rgba(255,200,60,.18);
}
.chip-top::before { content: "★"; margin-right: 6px; color: #ffd34d; }
.chip-top[aria-selected="true"] {
  color: #2a1a00; border-color: rgba(255,230,150,.9);
  background: linear-gradient(135deg, #fff1b8 0%, #ffd34d 40%, #e9a91c 60%, #ffe58a 100%);
  box-shadow: 0 0 12px rgba(255,200,60,.4), inset 0 1px 0 rgba(255,255,255,.7);
}
.chip-top[aria-selected="true"]::before { color: #6b4300; }
.notice { font-size: 14px; color: #ffd9a8; background: rgba(255,170,60,.12); border: 1px solid rgba(255,170,60,.3); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.notice[hidden], .notice:empty { display: none; } /* display:flex above would otherwise override [hidden] */
.notice button { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,217,168,.4); background: rgba(255,217,168,.12); font-weight: 700; }

.list {
  list-style: none; margin: 0; padding: 0 0 calc(var(--sab) + 36px);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  min-height: 0; flex: 1; touch-action: pan-y;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent;
  mask-image: linear-gradient(180deg, transparent 0, #000 10px, #000 calc(100% - 40px), transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 10px, #000 calc(100% - 40px), transparent);
}
.list::-webkit-scrollbar { width: 5px; }
.list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 5px; }
.list.drag { cursor: grabbing; }
.list.drag .st { pointer-events: none; }
.list .count { padding: 6px 4px 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--mute); user-select: none; -webkit-user-select: none; }
.st {
  width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; margin: 0 0 6px; border-radius: 16px; text-align: left;
  border: 1px solid transparent; background: rgba(12,20,38,.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background .2s, transform .12s, border-color .2s;
}
.st:active { transform: scale(.985); background: rgba(40,70,120,.55); }
.st.cur { border-color: rgba(62,160,255,.6); background: linear-gradient(90deg, rgba(0,114,206,.35), rgba(12,20,38,.55)); }
.logo { position: relative; flex: none; width: 46px; height: 46px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 17px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 4px; opacity: 0; transition: opacity .25s; }
.logo img.ok { opacity: 1; }
.st-txt { flex: 1; min-width: 0; }
.st-name { display: block; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tags { display: block; font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-side { flex: none; display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 12px; }
.st-side .heart { color: #ff5d7a; font-size: 14px; }
.eq { display: none; gap: 2px; align-items: flex-end; height: 16px; }
.eq i { width: 3px; background: var(--blue2); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 16px; } }
.playing .st.cur .eq { display: flex; }
.st.down { opacity: .55; }
.down-b { flex: none; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; color: #ffc3a8; background: rgba(255,110,60,.14); border: 1px solid rgba(255,110,60,.35); white-space: nowrap; }
.empty, .loading-list { color: var(--mute); text-align: center; padding: 30px 10px; font-size: 15px; }
.skel { height: 64px; border-radius: 16px; margin-bottom: 6px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.1), rgba(255,255,255,.04)); background-size: 200% 100%; animation: sh 1.3s linear infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* autoplay blocked: the Play button itself invites the tap (no separate overlay) */
.ctl.big.blocked { animation: nudge 2s ease-in-out infinite; box-shadow: 0 0 0 4px rgba(103,232,249,.45), 0 8px 22px rgba(0,114,206,.55), inset 0 1px 0 rgba(255,255,255,.35); }
.ctl.big:focus-visible { outline: 3px solid #67e8f9; outline-offset: 3px; }
@keyframes nudge { 50% { transform: scale(1.06); } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--sab) + 84px); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 40px); padding: 10px 16px; border-radius: 14px;
  background: rgba(10,16,30,.92); border: 1px solid var(--line); font-size: 15px;
  transition: opacity .25s, transform .25s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- now playing song card ---------- */
.player { flex-wrap: wrap; row-gap: 12px; }
.np-status.off { color: #ffd9a0; }
.np-status.off .dot { background: #ffb347; }
.np-status { min-width: 0; max-width: 100%; }
#npStatusText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.disc .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; padding: 0; background: transparent; opacity: 0; transition: opacity .4s; }
.disc .art.ok { opacity: 1; }
.disc.has-art::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #0a1426 0 7%, rgba(255,255,255,.5) 7.5% 8.5%, transparent 9%), repeating-radial-gradient(circle, rgba(0,0,0,.08) 0 1px, transparent 1px 4px); }
.playing .disc.has-art { animation: spinDisc 14s linear infinite; }
@keyframes spinDisc { to { transform: rotate(360deg); } }
.track {
  flex: 1 1 100%; min-width: 0; position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px;
  padding: 8px 8px 8px 8px; border-radius: 18px; text-align: left;
  background: linear-gradient(100deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.tr-art { position: relative; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; flex: none;
  box-shadow: 0 6px 16px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.14); }
.tr-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.tr-art img.ok { opacity: 1; }
.tr-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tr-kicker { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8fc8ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-title { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-artist { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track.nometa .tr-artist { color: #ffd98a; }
#songFavBtn svg, .star svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
#songFavBtn[aria-pressed="true"], .star[aria-pressed="true"] { color: #ffd34d; border-color: rgba(255,211,77,.5); }
#songFavBtn[aria-pressed="true"] svg, .star[aria-pressed="true"] svg { fill: currentColor; }
#songFavBtn:disabled { opacity: .35; }
.idb svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.track.nometa .idb { color: #2a1a00; border-color: transparent; background: linear-gradient(180deg, #ffe08a, #f0a92a); box-shadow: 0 0 14px rgba(255,200,60,.4); }
.idb.busy svg path { animation: wave .8s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes wave { 50% { transform: scaleY(.45); } }
.tr-show { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 5px; padding: 2px 2px 0; min-width: 0; }
.tr-show[hidden] { display: none; }
.tr-show-l { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; min-width: 0; }
.tr-show-l b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-show-l span { flex: none; color: var(--mute); font-variant-numeric: tabular-nums; }
.prog { display: block; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.prog b { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #3ea0ff, #7fe3ff); box-shadow: 0 0 8px rgba(110,200,255,.7); transition: width .9s linear; }
.prog.big { height: 6px; margin-top: 10px; }

/* ---------- tabs & panes ---------- */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px;
  background: rgba(10,18,34,.6); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); flex: none; user-select: none; -webkit-user-select: none; }
.tab { min-height: 44px; min-width: 0; padding: 0 4px; border: 0; border-radius: 12px; background: none; font-size: 15px; font-weight: 700; color: var(--mute);
  display: flex; align-items: center; justify-content: center; gap: 4px; transition: background .2s, color .2s, transform .12s; }
.tab > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab:active { transform: scale(.95); }
.tab[aria-selected="true"] { color: #06204a; background: linear-gradient(180deg, #fff, #dfeaff); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.tab .n { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: #ffd34d; color: #2a1a00; flex: none; }
.tab .n:empty { display: none; }
.tab:focus-visible, .seg button:focus-visible, .pill-btn:focus-visible, .keybox input:focus-visible { outline: 2px solid #67e8f9; outline-offset: 2px; }
.pane { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pane[hidden] { display: none; }
.pane-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--line); min-width: 0; }
.seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; font-weight: 700; font-size: 15px; color: var(--mute); position: relative; }
.seg button::after { content: ""; position: absolute; inset: -2px 0; }
.seg button[aria-pressed="true"] { background: rgba(62,160,255,.3); color: #fff; box-shadow: inset 0 0 0 1px rgba(62,160,255,.6); }
.pill-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink); text-decoration: none; white-space: nowrap; transition: transform .12s, background .2s; }
.pill-btn:active { transform: scale(.95); background: rgba(255,255,255,.16); }
.pill-btn.danger { color: #ffb4a0; }
.pill-btn.danger.armed { color: #fff; background: #d8432a; border-color: #ff7a5c; }
.pill-btn:disabled { opacity: .4; }
.hrow { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.hrow .st { margin: 0; flex: 1; min-width: 0; }
.st-side .tm, .sch-it .tm { font-variant-numeric: tabular-nums; font-weight: 700; color: #c9d4e6; }
.st-side .go { font-size: 13px; color: var(--blue2); }
.art-logo img { padding: 0; object-fit: cover; background: #000; }
.ctl.open svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.ctl { color: inherit; text-decoration: none; }
.keybox { margin: 14px 0 6px; padding: 12px; border-radius: 16px; background: rgba(12,20,38,.6); border: 1px dashed rgba(255,255,255,.18); display: flex; flex-direction: column; gap: 8px; }
.key-l { font-size: 14px; font-weight: 700; }
.keybox input { width: 100%; height: 46px; border-radius: 12px; padding: 0 12px; font-size: 16px; border: 1px solid var(--line); background: rgba(0,0,0,.3); -webkit-appearance: none; appearance: none; }
.key-h { margin: 0; font-size: 13px; color: var(--mute); }

/* ---------- schedule ---------- */
.list.sched { display: block; }
.sch-hd { display: flex; align-items: center; gap: 12px; padding: 4px 2px 10px; }
.sch-ht { min-width: 0; display: flex; flex-direction: column; }
.sch-ht b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-ht span { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-now { position: relative; overflow: hidden; padding: 14px; border-radius: 18px; margin-bottom: 10px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(62,160,255,.35), transparent 60%), linear-gradient(160deg, rgba(20,40,80,.85), rgba(8,14,28,.85));
  border: 1px solid rgba(62,160,255,.45); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.sch-now-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.live-b { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: #ff4d4d; color: #fff; }
.sch-now h3 { margin: 8px 0 2px; font-size: 20px; line-height: 1.2; }
.sch-desc { margin: 2px 0 0; font-size: 14px; color: #c9d4e6; }
.sch-left { display: block; margin-top: 6px; font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.sch-list { list-style: none; margin: 0; padding: 0; }
.sch-it { display: flex; gap: 12px; padding: 10px 12px; border-radius: 14px; margin-bottom: 4px; background: rgba(12,20,38,.5); min-height: 48px; align-items: flex-start; }
.sch-it .tm { flex: none; width: 3.2em; padding-top: 1px; }
.sch-it.past { opacity: .45; }
.sch-it.now { background: rgba(0,114,206,.3); box-shadow: inset 3px 0 0 #3ea0ff; }
.sch-tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sch-tx b { font-size: 15px; overflow-wrap: anywhere; }
.sch-tx .nx { align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #ffd34d; }
.sch-d { font-size: 13px; color: var(--mute); }
.sch-msg { margin: 6px 2px; font-size: 15px; color: #dbe5f5; }
.sch-sub { margin: 0 2px 12px; font-size: 14px; color: var(--mute); }
.sch-empty { padding: 16px; border-radius: 18px; background: rgba(12,20,38,.55); border: 1px solid var(--line); }
.sch-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* short portrait screens: keep room for the lists */
@media (orientation: portrait) and (max-height: 760px) {
  .disc-wrap { width: clamp(80px, 25vw, 118px); }
  .player { row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .tr-art { width: 44px; height: 44px; }
  .track { padding: 6px; }
  .controls { margin-top: 2px; }
}

/* landscape / wide: two columns */
@media (orientation: landscape) and (min-width: 600px), (min-width: 820px) {
  .app {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto minmax(0, max-content) auto minmax(0, 1fr);
    column-gap: 18px;
  }
  .top { grid-column: 1 / -1; }
  .wx { grid-row: 2; grid-column: 1; }
  .player { grid-row: 3; grid-column: 1; flex-direction: column; align-items: stretch; text-align: center; align-self: start; max-height: 100%; overflow: auto; }
  .disc-wrap { align-self: center; width: clamp(90px, 22vh, 190px); }
  .np-status, .np-line, .controls, .row2 { justify-content: center; }
  .np-status { align-self: center; }
  .browse { grid-row: 2 / -1; grid-column: 2; }
}
@media (orientation: landscape) and (max-height: 480px) and (min-width: 600px) {
  .player { flex-direction: row; text-align: left; }
  .np-status { align-self: flex-start; }
  .np-line, .controls, .row2 { justify-content: flex-start; }
  .disc-wrap { width: clamp(80px, 26vh, 130px); }
  .wx { padding-top: 2px; padding-bottom: 2px; }
  .wx-main { min-height: 46px; }
  #wxIcon { width: 44px; height: 44px; }
}
@media (max-width: 400px) {
  .clk-d { font-size: 11px; }
  .top-actions { gap: 8px; }
}
@media (max-width: 360px) {
  .brand { gap: 8px; }
  .wx-city select { padding-left: 10px; }
  .ctl { width: 44px; height: 44px; }
  .ctl.big { width: 56px; height: 56px; }
  .player { gap: 10px; padding: 12px 10px; }
  .disc-wrap { width: clamp(72px, 24vw, 96px); }
  .controls { gap: 6px; }
  .row2 { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.station-directory h2 { margin: 0; font-size: 14px; }
.station-directory p { margin: 3px 0; font-size: 13px; color: var(--mute); }
.station-directory ul { display: flex; gap: 12px; overflow-x: auto; list-style: none; margin: 4px 0 0; padding: 0 0 4px; }
.station-directory li { flex: none; }
.station-directory a { color: inherit; font-size: 13px; }
