:root {
  /* graphite grounds + muted-indigo accent (Spotify-style redesign) */
  --bg: #09090d;
  --panel: #131318;
  --panel-2: #1b1b22;
  --raise: #232330;
  --border: rgba(255,255,255,.07);
  --border-2: rgba(255,255,255,.11);
  --text: #f4f4f7;
  --muted: #9a9aa7;
  --faint: #5e5e6b;
  --accent: #7c5cff;
  --accent-2: #4f3bc0;
  --accent-dim: rgba(124,92,255,.14);
  --ok: #38d39b;
  --warn: #e5b800;
  --danger: #ff5a6b;
  --mono: "Manrope", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --disp: "Sora", "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  /* subtle indigo glow up top */
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(124,92,255,.12) 0%, transparent 62%),
    var(--bg);
}

.hidden { display: none !important; }

/* ---------------- LOGIN ---------------- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 330px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-logo {
  font-family: var(--disp);
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--text);
  font-weight: 800;
}
.login-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--muted);
  margin: 6px 0 26px;
}
.login-card input,
.login-card button {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  font-size: 16px;
  border: 1px solid var(--border);
}
.login-card input {
  background: var(--bg);
  color: var(--text);
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 14px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  letter-spacing: 2px;
  font-weight: 700;
  cursor: pointer;
}
.login-card button:hover { filter: brightness(1.08); }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 12px; }

/* ---------------- APP SHELL ---------------- */
.app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(158px + env(safe-area-inset-bottom)); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 4px 14px;
}
.brand-name {
  font-family: var(--disp);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--text);
  font-weight: 800;
}
.brand-sub {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-top: 2px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); transition: background .3s; }
.conn.online .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.conn.offline .dot { background: var(--danger); }
.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 2px;
  font-family: var(--mono);
  cursor: pointer;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- DOCK: now-playing bar + bottom nav ---------------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 720px; margin: 0 auto; }
.nowbar { margin: 0 8px 6px; padding: 9px 12px; position: relative; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(100deg, #241d4a, #2a2438);
  border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.nowbar-av { width: 42px; height: 42px; border-radius: 9px; flex: none; overflow: hidden;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); display: grid; place-items: center; font-size: 20px; }
.nowbar-av img { width: 100%; height: 100%; object-fit: cover; }
.nowbar-meta { flex: 1; min-width: 0; }
.nowbar-t { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowbar-s { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.nowbar-btn { background: none; border: none; color: var(--text); cursor: pointer; display: grid; place-items: center; padding: 6px; flex: none; }
.nowbar-prog { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255,255,255,.08); }
.nowbar-pf { --rankc: var(--accent); height: 100%; width: 0; border-radius: 0 3px 3px 0; transition: width .4s;
  background: linear-gradient(100deg, transparent 42%, rgba(255,255,255,.92) 50%, transparent 58%), var(--rankc);
  background-size: 220% 100%, 100% 100%; background-repeat: no-repeat;
  animation: glint 3s ease-in-out infinite; }
@media (prefers-reduced-motion:reduce){ .nowbar-pf{ animation: none; } }

.bottomnav {
  display: flex; gap: 2px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  background: rgba(9,9,13,.9); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.bottomnav::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 1 0; min-width: 52px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--faint);
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 4px; transition: color .15s;
}
.tab svg { width: 23px; height: 23px; }
.tab:hover { color: var(--muted); }
.tab.active { color: var(--text); }
.tab.active svg { color: var(--accent); }

/* ---------------- CLOCK ---------------- */
.clock-card {
  text-align: center;
  padding: 22px 0 26px;
}
.clock {
  font-family: var(--mono);
  font-size: 68px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  letter-spacing: 2px;
}
.clock .secs {
  font-size: 26px;
  color: var(--accent);
  vertical-align: super;
  margin-left: 6px;
  letter-spacing: 1px;
}
.date {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--muted);
  margin-top: 10px;
}

/* ---------------- CARDS ---------------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px 18px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title {
  font-family: var(--disp);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}
.card-tag { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.card-tag.stale { color: var(--warn); }

.wx { display: flex; align-items: center; gap: 16px; }
.wx-icon { width: 56px; height: 56px; flex: none; color: var(--accent); font-size: 44px; line-height: 56px; text-align: center; }
.wx-icon svg { width: 56px; height: 56px; }
.wx-temp { font-size: 46px; font-weight: 700; line-height: 1; color: #fff; }
.wx-cond { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--muted); margin-top: 6px; }

.metrics {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.metric { flex: 1; text-align: center; }
.m-val { display: block; font-size: 17px; font-weight: 600; color: var(--text); }
.m-lbl { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px; color: var(--faint); margin-top: 3px; }

.updated {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  margin-top: 18px;
  letter-spacing: 1px;
}

/* ---------------- PLACEHOLDERS ---------------- */
.soon {
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 40px 26px;
  text-align: center;
  color: var(--muted);
}
.soon-title {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 5px;
  color: var(--accent);
  margin-bottom: 12px;
}
.soon p { line-height: 1.6; font-size: 14px; max-width: 420px; margin: 0 auto; }

/* ---------------- GALLERY ---------------- */
.uploader {
  display: block;
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 22px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.uploader:hover, .uploader.drag { border-color: var(--accent); background: var(--panel-2); }
.up-icon { font-size: 30px; color: var(--accent); line-height: 1; }
.up-text { margin-top: 8px; font-size: 14px; color: var(--text); }
.up-sub { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--faint); margin-top: 4px; }

.galstatus { font-family: var(--mono); font-size: 12px; color: var(--accent); min-height: 16px; margin: 10px 2px; text-align: center; }
.galstatus.err { color: var(--danger); }

.galgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 520px) { .galgrid { grid-template-columns: repeat(3, 1fr); } }

.tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.tile.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile-img {
  position: relative;
  width: 100%;
  aspect-ratio: 240 / 320;
  background: #05080c;
  border-bottom: 1px solid var(--border);
}
/* Placeholder shown only when there's no image (the <img> covers it when
   loaded; on error the <img> removes itself and this shows through). */
.tile-img::after {
  content: "no preview";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-family: var(--mono); font-size: 10px;
}
.tile-img img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #05080c;              /* opaque so it hides the placeholder */
  display: block;
}
.tile-body { padding: 8px 10px; }
.tile-name { font-size: 11px; word-break: break-all; color: var(--text); min-height: 26px; }
.tile-badge { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--accent); }
.tile-actions { display: flex; gap: 6px; margin-top: 8px; }
.tile-actions button {
  flex: 1; font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  padding: 7px 0; border-radius: 7px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--muted); cursor: pointer;
}
.tile-actions .show { color: var(--accent); border-color: var(--accent-dim); }
.tile-actions .show.on { background: var(--accent-dim); }
.tile-actions .del:hover { color: var(--danger); border-color: var(--danger); }

/* ---------------- DEVICE DISPLAY REMOTE ---------------- */
.screen-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.screen-btns button {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  padding: 9px 12px; border-radius: 8px;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--border); cursor: pointer;
}
.screen-btns button:hover { color: var(--text); border-color: var(--accent-dim); }
.screen-btns button.cur {
  background: var(--accent-dim); color: var(--accent); border-color: var(--accent);
}
.muted-small { color: var(--faint); font-family: var(--mono); font-size: 11px; }

/* ---------------- RADIO (FM) ---------------- */
.fm-display { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 18px 0 4px; }
.fm-freq { font-family: var(--mono); font-size: 56px; font-weight: 700; color: var(--accent); letter-spacing: 2px; line-height: 1; }
.fm-unit { font-family: var(--mono); font-size: 14px; color: var(--muted); letter-spacing: 2px; }
.fm-station { text-align: center; font-family: var(--mono); font-size: 14px; letter-spacing: 2px; color: var(--text); min-height: 18px; margin-bottom: 16px; }
.fm-controls { display: flex; gap: 10px; }
.fm-btn {
  flex: 1; font-family: var(--mono); font-size: 13px; letter-spacing: 1px;
  padding: 14px 10px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.fm-btn:hover:not(:disabled) { color: var(--text); border-color: var(--accent-dim); }
.fm-btn:disabled { opacity: .4; cursor: default; }
.fm-btn.power.on { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.fm-tune { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
.fm-btn.fine { flex: 0 0 46px; font-size: 18px; padding: 0; }
.fm-btn.set { flex: 0 0 64px; }
.fm-manual {
  flex: 1; min-width: 0; text-align: center;
  font-family: var(--mono); font-size: 18px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px;
}
.fm-manual:focus { outline: none; border-color: var(--accent); }
.fm-presets-label { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--faint); margin: 16px 0 8px; }
.fm-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fm-preset {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted);
  padding: 10px 6px; border-radius: 8px; background: var(--panel-2);
  border: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 3px; align-items: center;
}
.fm-preset span { color: var(--accent); font-size: 13px; font-weight: 600; }
.fm-preset:hover:not(:disabled) { border-color: var(--accent-dim); color: var(--text); }
.fm-preset:disabled { opacity: .4; cursor: default; }

/* ---------------- RADIO: now-playing hero ---------------- */
#brAudio { display: none; }
.out-toggle { display: flex; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 3px; margin-bottom: 14px; }
.out-btn { flex: 1; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); background: transparent; border: none; border-radius: 6px; padding: 8px; cursor: pointer; }
.out-btn.active { background: var(--accent-dim); color: var(--accent); }
/* hero: one gradient panel — NOW PLAYING/live on top, name, then the live wave */
.np-stage {
  position: relative; border-radius: 14px; padding: 12px 16px 12px; overflow: hidden;
  background:
    radial-gradient(130% 120% at 50% 0%, rgba(56,189,248,.16), transparent 60%),
    linear-gradient(160deg, rgba(34,211,238,.10), rgba(168,85,247,.10) 55%, rgba(10,14,20,.2));
  border: 1px solid var(--accent-dim);
  box-shadow: inset 0 0 40px rgba(34,211,238,.05);
}
.np-top { display: flex; justify-content: space-between; align-items: center; }
.np-label { font-family: var(--mono); font-size: 9px; letter-spacing: 3px; color: #9fb6c9; }
.np-dot { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); display: inline-flex; align-items: center; }
.np-dot.on { color: var(--ok); }
.livedot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; animation: livepulse 1.4s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px var(--ok); } 50% { opacity: .35; transform: scale(.6); box-shadow: 0 0 0 var(--ok); } }
.np-name {
  text-align: center; font-family: var(--mono); font-size: 18px; font-weight: 700;
  line-height: 1.2; padding: 0 6px; margin: 8px 0 4px; word-break: break-word;
  background: linear-gradient(90deg, #22d3ee, #7dd3fc, #c084fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.np-wavebox { position: relative; height: 74px; margin: 6px -16px -12px; overflow: hidden; }  /* full-bleed to the panel edges */
.np-wave { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.np-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.np-row .np-vol { flex: 1; margin: 0; }
.np-card.browser-out .np-vol { display: none; }        /* volume is on-device in browser mode */
.np-card.browser-out .np-row { justify-content: center; }
.np-stopbtn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px; padding: 10px 16px;
  border-radius: 10px; color: var(--danger); background: var(--panel-2); border: 1px solid var(--border);
}
.np-stopbtn:not(.stop) { color: var(--accent); border-color: var(--accent-dim); }
.np-stopbtn:hover { filter: brightness(1.2); }
.np-vol { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.np-vol .slider { margin: 0; flex: 1; }
.np-volval { font-family: var(--mono); font-size: 12px; color: var(--muted); flex: 0 0 34px; text-align: right; }
.np-sleep { margin-top: 18px; }
.np-sleep-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.np-sleep-head .net-lbl { flex: 0 0 auto; white-space: nowrap; }
.sleep-status { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--faint); }
.sleep-status.on { color: var(--accent); }
.sleep-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sleep-custom {
  width: 52px; font-family: var(--mono); font-size: 16px; text-align: center; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 6px;
}
.sleep-custom:focus { outline: none; border-color: var(--accent); }
.sleep-btn.go { color: var(--accent); border-color: var(--accent-dim); }
.sleep-btn.go:hover { border-color: var(--accent); }

/* RADIO: segmented tuner toggle */
.seg { display: flex; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.seg-btn { flex: 1; font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--muted); background: transparent; border: none; border-radius: 7px; padding: 9px; cursor: pointer; }
.seg-btn.active { background: var(--accent-dim); color: var(--accent); }
.fm-toprow { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.tuner-view.hidden { display: none; }

/* ---------------- INTERNET RADIO ---------------- */
.net-now { font-family: var(--mono); font-size: 15px; letter-spacing: 1px; color: var(--accent); text-align: center; margin: 10px 0 12px; min-height: 18px; }
.net-ctrl { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.net-vol { display: flex; align-items: center; gap: 10px; }
.net-vol .slider { margin: 0; flex: 1; }
.net-lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--faint); flex: 0 0 42px; }
.net-sleep { display: flex; align-items: center; gap: 6px; }
.sleep-btn {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted);
  padding: 7px 10px; border-radius: 8px; background: var(--panel-2);
  border: 1px solid var(--border); cursor: pointer;
}
.sleep-btn:hover { color: var(--text); border-color: var(--accent-dim); }
.net-search { display: flex; gap: 8px; }
.net-input, .net-select {
  min-width: 0; font-family: var(--mono); font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px;
}
.net-input { flex: 1; }
.net-select {
  flex: 0 0 36%; appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236fb7c9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.net-input:focus, .net-select:focus { outline: none; border-color: var(--accent); }
/* iOS/Android zoom in on focus if input font < 16px — keep all text inputs at 16 */
input[type="text"], input[type="number"], select { font-size: 16px; }

.net-results { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 320px; overflow-y: auto; }
.net-sentinel { height: 1px; flex: 0 0 auto; }
.net-item, .fav-item { display: flex; gap: 6px; align-items: stretch; }
.net-play, .fav-play {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.net-play:hover, .fav-play:hover { border-color: transparent; }
.net-name { color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.net-meta { color: var(--faint); font-size: 10px; letter-spacing: 1px; flex: 0 0 auto; }
.net-star, .fav-btn {
  flex: 0 0 40px; cursor: pointer; font-size: 15px;
  background: var(--panel-2); color: var(--faint);
  border: 1px solid var(--border); border-radius: 8px;
}
.net-star.on { color: #FFC64A; border-color: #6b5a1e; }
.fav-btn.del { color: var(--danger); }
.net-star:hover, .fav-btn:hover { border-color: var(--accent-dim); }
.fav-badge {
  flex: 0 0 auto; font-size: 9px; letter-spacing: 1px; padding: 2px 5px; border-radius: 4px;
  color: var(--bg); font-weight: 700;
}
.fav-badge.fm { background: #2FCf9e; }
.fav-badge.net { background: var(--accent); }
.net-favs { display: flex; flex-direction: column; gap: 6px; }
.save-btn {
  display: block; width: 100%; margin-top: 12px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px;
  padding: 11px; border-radius: 10px; background: var(--panel-2);
  color: var(--accent); border: 1px solid var(--border);
}
.save-btn:hover { border-color: var(--accent); }
.net-stop {
  display: none; width: 100%; margin-top: 10px; cursor: pointer;
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px;
  padding: 12px; border-radius: 10px; background: var(--panel-2);
  color: var(--danger); border: 1px solid var(--border);
}
.net-stop:hover { border-color: var(--danger); }

/* ---------------- SETTINGS ---------------- */
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 4px;
  background: var(--border); margin: 18px 0 6px; outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer; box-shadow: 0 0 8px var(--accent-dim);
}
.slider::-moz-range-thumb {
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}
.slider-ends { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--faint); }
.setting-note { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 14px 0 0; }

.quiet-row { display: flex; gap: 16px; margin-top: 6px; }
.quiet-row label { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.quiet-row input[type="number"] {
  width: 58px; padding: 8px 10px; font-family: var(--mono); font-size: 15px;
  color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; text-align: center;
}
.quiet-row input[type="number"]:focus { outline: none; border-color: var(--accent); }

.foot {
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--faint);
  margin-top: 30px;
}

/* ---- profile + admin (SETTINGS) ---------------------------------------- */
.prof-field { display: block; margin-top: 10px; font-family: var(--mono);
  font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.prof-field .net-input, .prof-field .net-select { width: 100%; margin-top: 5px;
  box-sizing: border-box; }
.user-list { display: flex; flex-direction: column; margin-top: 4px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.user-row + .user-row { border-top: 1px solid var(--border); }
.u-info { flex: 1; min-width: 0; }
.user-row .u-nick { color: var(--text); font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-handle { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row .u-role { flex: none; font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px 8px; }
.user-row .u-role.admin { color: var(--accent); border-color: transparent; background: var(--accent-dim); }
.user-row .u-del { flex: none; cursor: pointer; background: none; border: none;
  color: var(--faint); font-size: 15px; padding: 4px 6px; }
.user-row .u-del:hover { color: var(--danger); }
.prof-msg { min-height: 16px; margin-top: 10px; font-family: var(--mono);
  font-size: 12px; }
.prof-msg.ok { color: var(--accent); }
.prof-msg.err { color: #ff5a5a; }

/* Kill Chrome's yellow autofill wash — keep our dark field bg + light text. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  box-shadow: 0 0 0 1000px var(--bg) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

/* ---- role gating: hide device-owner UI from non-admins ----------------- */
body:not([data-role="admin"]) .admin-only { display: none !important; }

/* ---- profile page ------------------------------------------------------ */
.profile-hero { display: block; }
.prof-top { display: flex; align-items: center; gap: 16px; }
.prof-avatar { width: 76px; height: 76px; flex: none; border-radius: 18px;
  background: var(--panel-2); border: 1px solid var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 42px; }
.prof-avatar img { width: 100%; height: 100%; object-fit: cover; }
.prof-id { min-width: 0; }
.prof-pagenick { font-size: 23px; color: var(--text); font-weight: 600;
  line-height: 1.15; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prof-pagerole { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
  color: var(--muted); margin-top: 5px; }
.prof-stats { display: flex; gap: 10px; }
.prof-stats .stat { flex: 1; text-align: center; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 6px; }
.stat-val { display: block; font-size: 24px; color: var(--accent); font-family: var(--mono); }
.stat-lbl { display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 1px; color: var(--muted); margin-top: 5px; }

/* ---- people / community list ------------------------------------------- */
.people-list { display: flex; flex-direction: column; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border); }
.person-row:last-child { border-bottom: none; }
.person-av { width: 40px; height: 40px; flex: none; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 22px; }
.person-av img { width: 100%; height: 100%; object-fit: cover; }
.person-info { flex: 1; min-width: 0; }
.person-nick { color: var(--text); font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.person-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.person-role { font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  color: var(--accent); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }

/* ---- profile stats: top stations --------------------------------------- */
.stat-toplabel { font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  color: var(--muted); margin: 16px 0 4px; }
.stat-top { display: flex; flex-direction: column; }
.stat-toprow { display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border); }
.stat-toprow:last-child { border-bottom: none; }
.stat-rank { font-family: var(--mono); font-size: 12px; color: var(--accent); width: 26px; }
.stat-name { flex: 1; min-width: 0; color: var(--text); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-time { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---- presence + clickable people / now-playing ------------------------- */
.person-row.clickable { cursor: pointer; }
.person-row.clickable:hover { background: var(--panel-2); }
.person-av { position: relative; }
.person-av.online::after { content: ""; position: absolute; right: -2px; bottom: -2px;
  width: 11px; height: 11px; border-radius: 50%; background: #2ec26a;
  border: 2px solid var(--panel); }
.prof-now { margin-top: 12px; font-family: var(--mono); font-size: 12px;
  color: var(--accent); display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-dim); border-radius: 10px; padding: 6px 12px; max-width: 100%; }
.prof-now .np-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- listen-along: clickable stations, co-listener counter, toast ------- */
.np-link.clickable { cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; }
.np-link.clickable:hover { color: #fff; }
.np-together { margin-left: 10px; padding: 1px 7px; border-radius: 10px;
  background: var(--accent-dim); color: var(--accent); font-family: var(--mono);
  font-size: 11px; }
.stat-toprow.clickable { cursor: pointer; }
.stat-toprow.clickable:hover { background: var(--panel-2); }
.stat-toprow.clickable .stat-name { color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--panel-2); color: var(--text); border: 1px solid var(--accent);
  border-radius: 12px; padding: 10px 16px; font-family: var(--mono); font-size: 13px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5); z-index: 50; max-width: 80vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.hidden { display: none; }

/* ---- gamification: ranks, crown, leaderboard --------------------------- */
.crown { filter: drop-shadow(0 0 3px rgba(255,210,80,.6)); }
.rankicon { font-size: 0.95em; }
.person-pos { font-family: var(--mono); font-size: 12px; color: var(--muted);
  width: 26px; flex: none; text-align: right; }
.person-hrs { font-family: var(--mono); font-size: 13px; color: var(--accent);
  flex: none; }
.person-row.me { background: rgba(0,229,255,.05); }
.prof-rank { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.rank-name { display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 1px; color: var(--accent); background: var(--accent-dim);
  border-radius: 8px; padding: 3px 9px; }
.rank-bar { margin-top: 10px; height: 8px; border-radius: 5px;
  background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; }
.rank-bar-fill { height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), #7af7d0); }
.rank-next { margin-top: 6px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 1px; color: var(--muted); }

/* ---- profile meta (member since / last seen) --------------------------- */
.prof-meta { margin-top: 12px; font-family: var(--mono); font-size: 11px;
  color: var(--muted); }

/* ---- avatar preview in settings + users list --------------------------- */
.avatar-edit { display: flex; align-items: flex-end; gap: 12px; }
.avatar-prev { width: 52px; height: 52px; flex: none; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 28px; }
.avatar-prev img { width: 100%; height: 100%; object-fit: cover; }
.u-av { width: 40px; height: 40px; flex: none; border-radius: 11px;
  background: var(--panel-2); border: 1px solid var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 20px; }
.u-av img { width: 100%; height: 100%; object-fit: cover; }

/* ============ PARTY — live co-listeners ============ */
.party { display: flex; align-items: center; gap: 10px; margin-top: 14px;
  padding: 8px 12px 8px 8px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--accent-dim); width: fit-content; max-width: 100%; }
.party-avs { display: flex; align-items: center; }
.party-av { width: 30px; height: 30px; flex: none; border-radius: 50%; padding: 0;
  margin-left: -9px; border: 2px solid var(--panel); background: var(--panel-2);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer; transition: transform .15s ease; }
.party-av:first-child { margin-left: 0; }
.party-av:hover { transform: translateY(-2px) scale(1.08); z-index: 2; }
.party-av img { width: 100%; height: 100%; object-fit: cover; }
.party-more { width: 30px; height: 30px; margin-left: -9px; border-radius: 50%;
  border: 2px solid var(--panel); background: var(--panel-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  font-family: var(--mono); }
.party-label { font-size: 12.5px; font-weight: 600; color: var(--text);
  letter-spacing: .2px; white-space: nowrap; }

/* ============ PROFILE — redesign R2 (Spotify-style) ============ */
/* Fade the edges of horizontal scrollers so cut-off content dissolves instead of
   hard-clipping. The fade on a side shows only when that side can still scroll —
   JS sets --l/--r (0 = no fade). */
.bottomnav, .ptabs, .pchips, .h-sleep-chips{
  --l:0px; --r:0px;
  -webkit-mask-image:linear-gradient(to right, transparent 0, #000 var(--l), #000 calc(100% - var(--r)), transparent 100%);
          mask-image:linear-gradient(to right, transparent 0, #000 var(--l), #000 calc(100% - var(--r)), transparent 100%);
}
.phero{ position:relative; margin:0 -16px; height:340px; overflow:hidden; }
.phero-media{ position:absolute; inset:0; transform-origin:top center; will-change:transform,opacity; }
.phero-canvas,.phero-img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.phero-tint{ position:absolute; inset:0;
  background:radial-gradient(120% 90% at 72% 12%, rgba(124,92,255,.40), transparent 55%),
             radial-gradient(120% 90% at 18% 0%, rgba(79,59,192,.34), transparent 50%); }
.phero-scrim{ position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(9,9,13,.12) 0%, rgba(9,9,13,0) 32%, rgba(9,9,13,.62) 72%, var(--bg) 100%); }
.phero-back{ position:absolute; top:calc(14px + env(safe-area-inset-top)); left:14px; z-index:6;
  width:36px; height:36px; border-radius:50%;
  border:none; cursor:pointer; background:rgba(0,0,0,.42); backdrop-filter:blur(6px); color:var(--text);
  display:grid; place-items:center; }
.phero-online{ position:absolute; top:calc(20px + env(safe-area-inset-top)); right:16px; z-index:6;
  font-family:var(--mono); font-size:11px; font-weight:600; letter-spacing:.12em; color:var(--muted);
  display:inline-flex; align-items:center; gap:7px; }
.phero-online .dot{ width:8px; height:8px; border-radius:50%; background:var(--ok); box-shadow:0 0 10px var(--ok); }
.phero-online.off{ color:var(--faint); }
.phero-online.off .dot{ background:var(--faint); box-shadow:none; }
/* immersive profile: cover goes to the very top, global header hidden there */
body[data-view="profile"] .topbar{ display:none; }
.phero-body{ position:absolute; left:16px; right:16px; bottom:12px; z-index:5; will-change:opacity,transform;
  display:flex; align-items:center; gap:14px; }   /* nick centred to the avatar, not bottom-aligned */
.phero-id{ min-width:0; flex:1; }   /* lets a long nick shrink/wrap instead of shoving the avatar */
.phero-av-wrap{ position:relative; flex:none; }
/* canvas for the "symbiote" orb fx (sits around the avatar, behind it) */
.phero-av-fx{ position:absolute; left:50%; top:50%; width:132px; height:132px;
  transform:translate(-50%,-50%); pointer-events:none; z-index:3; }   /* above the avatar: draws its gold frame */
.phero-av{ position:relative; z-index:2; width:62px; height:62px; border-radius:16px; overflow:hidden;
  display:grid; place-items:center; font-size:32px; line-height:1; color:#fff;
  background:linear-gradient(135deg,var(--accent-2),var(--accent));   /* the gold frame is drawn on the canvas above */
  box-shadow:0 0 0 1px rgba(0,0,0,.5), 0 8px 20px rgba(0,0,0,.5); }
.phero-av img{ width:100%; height:100%; object-fit:cover; display:block; }
.phero-name{ font-family:var(--disp); font-weight:800; letter-spacing:-.02em; line-height:1.0;
  font-size:clamp(30px,9vw,48px); text-wrap:balance; text-shadow:0 2px 30px rgba(0,0,0,.55);
  overflow-wrap:anywhere; word-break:break-word; }
.phero-name.long{ font-size:clamp(24px,7.2vw,36px); }
.phero-name.xlong{ font-size:clamp(20px,6vw,29px); }
.phero-name.xxlong{ font-size:clamp(16px,4.8vw,23px); }
.phero-handle{ margin-top:9px; font-family:var(--mono); font-size:13.5px; font-weight:600;
  color:var(--muted); letter-spacing:.01em; }
.phero-badge{ font-size:15px; line-height:1; }
#profPageRole{ text-transform:uppercase; letter-spacing:.12em; font-size:11px; font-weight:700; color:var(--accent); }

.pmeta{ padding:0; margin-top:0; }
.pm-rankline{ margin-bottom:10px; }
.pm-dimline{ display:flex; flex-wrap:wrap; align-items:center; gap:5px 10px; line-height:1.6; }
.pmeta .pm-rank{ font-family:var(--disp); font-weight:800; color:var(--accent); font-size:16px; letter-spacing:-.01em; }
.pmeta .pm-dim{ font-weight:500; color:var(--muted); font-size:13px; }
.pmeta .msep{ color:var(--faint); font-weight:400; }
/* rank pill has no leading separator */
.pmeta .pm-rank + .msep{ display:none; }
.pafter{ display:flex; align-items:center; gap:14px; padding:12px 2px 2px; }
.pfab{ width:52px; height:52px; border-radius:50%; flex:none; border:none; cursor:pointer; background:var(--accent);
  color:#fff; display:grid; place-items:center; box-shadow:0 10px 28px rgba(124,92,255,.42); transition:transform .12s; }
.pfab:active{ transform:scale(.94); }
.prank{ flex:1; }
.rank-name{ display:inline-block; font-family:var(--disp); font-size:12px; font-weight:700; color:var(--accent);
  background:var(--accent-dim); border-radius:8px; padding:3px 9px; }
.rank-bar{ margin-top:8px; height:7px; border-radius:5px; background:var(--panel-2); overflow:hidden; }
.rank-bar-fill{ height:100%; border-radius:5px; background:linear-gradient(90deg,var(--accent-2),var(--accent)); }
.rank-next{ margin-top:5px; font-size:11px; color:var(--muted); }

/* profile "now playing" banner */
.pnow{ margin-top:14px; display:flex; align-items:center; gap:12px; padding:10px 12px;
  background:linear-gradient(100deg, rgba(124,92,255,.18), rgba(124,92,255,.05));
  border:1px solid var(--border-2); border-radius:14px; }
/* segmented dot-matrix visualizer — pure white squares, mirrored, organic */
.pnow-art{ flex:none; height:46px; display:flex; align-items:center; padding:0 5px; }
.eq{ display:flex; align-items:center; gap:3px; height:34px; }
.eq i{ width:2.5px; height:6px; border-radius:3px; background:#fff;
  animation:eqbar ease-in-out infinite; }
.eq i:nth-child(1){ animation-duration:1.1s;  animation-delay:-.20s; }
.eq i:nth-child(2){ animation-duration:1.5s;  animation-delay:-.62s; }
.eq i:nth-child(3){ animation-duration:.95s;  animation-delay:-.10s; }
.eq i:nth-child(4){ animation-duration:1.3s;  animation-delay:-.45s; }
.eq i:nth-child(5){ animation-duration:1.05s; animation-delay:-.30s; }
.eq i:nth-child(6){ animation-duration:1.45s; animation-delay:-.55s; }
.eq i:nth-child(7){ animation-duration:1.15s; animation-delay:-.15s; }
@keyframes eqbar{ 0%,100%{ height:6px; } 50%{ height:32px; } }
@media (prefers-reduced-motion:reduce){ .eq i{ animation:none; height:20px; } }
.pnow-body{ flex:1; min-width:0; }
.pnow-label{ display:flex; align-items:center; gap:7px; font-family:var(--mono); font-size:10px;
  font-weight:700; letter-spacing:.12em; color:var(--muted); text-transform:uppercase; }
.pnow-label .livedot{ position:relative; flex:none; width:7px; height:7px; border-radius:50%; background:#fff;
  box-shadow:0 0 6px 1px rgba(255,255,255,.35); }
.pnow-label .livedot::after{ content:""; position:absolute; inset:-3px; border-radius:50%;
  background:radial-gradient(circle, rgba(255,255,255,.5) 0%, rgba(255,255,255,0) 68%);
  animation:ripple 2.4s ease-out infinite; }
@keyframes ripple{ 0%{ transform:scale(.5); opacity:0; } 22%{ opacity:.9; } 100%{ transform:scale(3.6); opacity:0; } }
@media (prefers-reduced-motion:reduce){ .pnow-label .livedot::after{ animation:none; } }
.pnow-cnt{ display:inline-flex; align-items:center; gap:6px; color:var(--accent); letter-spacing:.02em; }
.pnow-avs{ display:inline-flex; align-items:center; }
.pnow-av{ width:20px; height:20px; flex:none; border-radius:50%; padding:0; margin-left:-7px;
  border:1.5px solid var(--panel); background:var(--panel-2); overflow:hidden; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:10px; line-height:1;
  transition:transform .15s ease; }
.pnow-av:first-child{ margin-left:0; }
.pnow-av:hover{ transform:translateY(-1px) scale(1.12); z-index:2; }
.pnow-av img{ width:100%; height:100%; object-fit:cover; }
.pnow-name{ font-family:var(--disp); font-weight:700; font-size:16px; color:var(--text); margin-top:3px; }
.pnow-play{ width:44px; height:44px; border-radius:50%; flex:none; border:none; cursor:pointer;
  background:var(--accent); color:#fff; display:grid; place-items:center; box-shadow:0 8px 22px rgba(124,92,255,.4); }
.pnow-play:active{ transform:scale(.94); }

/* marquee for long names */
.marq{ overflow:hidden; }
.marq .marq-inner{ display:inline-block; white-space:nowrap; will-change:transform; }
.marq .marq-inner.run{ animation:marq linear infinite; }
@keyframes marq{ 0%,8%{transform:translateX(0)} 46%,54%{transform:translateX(var(--mq))} 92%,100%{transform:translateX(0)} }

.ptabs{ display:flex; gap:24px; padding:18px 2px 0; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.ptabs::-webkit-scrollbar{ display:none; }
.ptab{ background:none; border:none; cursor:pointer; color:var(--muted); font-family:var(--disp);
  font-weight:700; font-size:16px; padding:0 0 11px; position:relative; flex:none; white-space:nowrap; }
.ptab.on{ color:var(--text); }
.ptab.on::after{ content:""; position:absolute; left:0; right:0; bottom:0; height:3px; border-radius:3px; background:var(--accent); }
.ptabline{ height:1px; background:var(--border); margin:0 2px 4px; }
.ppane{ display:none; } .ppane.on{ display:block; animation:fadeup .25s ease; }
@keyframes fadeup{ from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none} }

.pchips{ display:flex; gap:12px; overflow-x:auto; padding:16px 2px 6px; scrollbar-width:none; }
.pchips::-webkit-scrollbar{display:none}
.pchip{ flex:0 0 auto; min-width:116px; background:var(--panel); border:1px solid var(--border); border-radius:16px; padding:15px 17px; }
.pchip.accent{ background:linear-gradient(160deg,var(--accent-2),#2c2450); border-color:transparent; }
.pchip .v{ font-family:var(--disp); font-weight:800; font-size:25px; font-variant-numeric:tabular-nums; }
.pchip .l{ margin-top:4px; font-size:11px; font-weight:600; letter-spacing:.09em; text-transform:uppercase; color:var(--muted); }
.pchip.accent .l{ color:#cbc2ff; }
/* Statistics tab hero: the headline listen-time number */
.psh{ margin:16px 0 6px; padding:20px 20px 18px; border-radius:20px;
  background:linear-gradient(160deg,var(--accent-2),#241d40); border:1px solid transparent; }
.psh-big{ font-family:var(--disp); font-weight:800; font-size:44px; line-height:1;
  letter-spacing:-.02em; font-variant-numeric:tabular-nums; color:var(--text); }
.psh-cap{ margin-top:8px; font-size:12px; font-weight:600; letter-spacing:.1em;
  text-transform:uppercase; color:#cbc2ff; }
.psh-sub{ display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:14px;
  padding-top:14px; border-top:1px solid rgba(255,255,255,.10); }
.psh-sub span{ font-size:13px; color:#b6aee0; }
.psh-sub b{ font-family:var(--disp); font-weight:800; font-size:16px; color:var(--text);
  font-variant-numeric:tabular-nums; margin-right:3px; }

.pblock{ padding:20px 2px 2px; }
.pblock-h h3{ font-family:var(--disp); font-weight:700; font-size:18px; margin-bottom:4px; }
.prow{ display:flex; align-items:center; gap:13px; padding:10px 0; }
.prow + .prow{ border-top:1px solid var(--border); }
.prow.clickable{ cursor:pointer; }
.prow.clickable:active{ opacity:.6; }
.prow .rn{ width:16px; text-align:center; color:var(--faint); font-weight:700; font-size:14px; }
.prow .art{ width:46px; height:46px; border-radius:11px; flex:none; display:grid; place-items:center; font-size:20px; background:var(--panel-2); overflow:hidden; }
.prow .art img{ width:100%; height:100%; object-fit:cover; }
.prow .info{ flex:1; min-width:0; }
.prow .nm{ font-weight:600; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.prow .sub{ color:var(--muted); font-size:12.5px; margin-top:2px; }
.prow .rt{ color:var(--muted); font-size:13px; white-space:nowrap; }
.prow .live{ color:var(--accent); font-weight:700; font-size:12px; display:inline-flex; gap:5px; align-items:center; }
.prow .live .ld{ width:7px; height:7px; border-radius:50%; background:var(--accent); animation:pulse 1.4s infinite; }
.prow .star{ color:var(--accent); }
.pempty{ color:var(--muted); font-size:13px; padding:6px 0; }

.pcard{ margin-top:14px; background:var(--panel); border:1px solid var(--border); border-radius:16px; padding:16px; }
.pcard h4{ font-family:var(--disp); font-weight:700; font-size:15px; }
.pcard .pcap{ color:var(--muted); font-size:12.5px; margin:2px 0 14px; }
.chartwrap svg{ width:100%; height:auto; display:block; }
.hbars{ display:flex; flex-direction:column; gap:11px; }
.hbar{ display:grid; grid-template-columns:76px 1fr auto; align-items:center; gap:10px; }
.hbar .hn{ font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hbar .track{ position:relative; height:9px; border-radius:6px; background:var(--panel-2); overflow:hidden; }
/* the fill is a <span> — it MUST be block or its width/height are ignored */
.hbar .fill{ display:block; height:100%; border-radius:6px; background:linear-gradient(90deg,var(--accent-2),var(--accent)); }
/* rank progress fill: tinted to the rank colour, with the same flowing sheen as the now-bar */
.hbar .fill.rank{ --rankc:var(--accent);
  background:linear-gradient(100deg, transparent 42%, rgba(255,255,255,.9) 50%, transparent 58%), var(--rankc);
  background-size:220% 100%, 100% 100%; background-repeat:no-repeat;
  animation:glint 3s ease-in-out infinite; }
@media (prefers-reduced-motion:reduce){ .hbar .fill.rank{ animation:none; } }
.hbar .hv{ font-size:12.5px; color:var(--text); font-variant-numeric:tabular-nums; }

/* avatar/cover upload row in settings */
.cover-prev{ height:96px; border-radius:14px; overflow:hidden; background:var(--panel-2);
  border:1px solid var(--border); position:relative; display:grid; place-items:center; color:var(--faint); font-size:12px; }
.cover-prev img{ width:100%; height:100%; object-fit:cover; }

.nowbar-together{ color:#cbc2ff; font-weight:700; font-size:12px; margin-left:6px; }

/* colorful station tiles in profile lists (were falling back to grey) */
.prow .art.g1{ background:linear-gradient(135deg,#3a2f7a,#6d5bd0); }
.prow .art.g2{ background:linear-gradient(135deg,#7a2f5e,#d05b9c); }
.prow .art.g3{ background:linear-gradient(135deg,#2f5a7a,#5b9cd0); }
.prow .art.g4{ background:linear-gradient(135deg,#2f7a5a,#5bd0a0); }

/* ============ shared page header (redesign) ============ */
.page-head{ display:flex; align-items:baseline; justify-content:space-between; padding:22px 2px 12px; gap:12px; }
.page-title{ font-family:var(--disp); font-weight:800; font-size:27px; letter-spacing:-.015em; }
.page-sub{ color:var(--muted); font-size:13px; font-weight:600; flex:none; }

/* ============ PEOPLE — community leaderboard ============ */
.ulist{ display:flex; flex-direction:column; }
.urow{ display:flex; align-items:center; gap:13px; padding:12px 6px; position:relative; }
.urow + .urow{ border-top:1px solid var(--border); }
.urow.clickable{ cursor:pointer; }
.urow.clickable:active{ opacity:.6; }
/* highlight "you" with a subtle left accent bar, not a floating rounded box */
.urow.me::before{ content:""; position:absolute; left:-6px; top:6px; bottom:6px; width:3px;
  border-radius:3px; background:var(--accent); }
.urow-pos{ width:22px; text-align:center; font-family:var(--disp); font-weight:700; font-size:15px;
  color:var(--faint); font-variant-numeric:tabular-nums; flex:none; }
.urow-pos.p1{ color:#ffd25a; } .urow-pos.p2{ color:#cfd6df; } .urow-pos.p3{ color:#e0925a; }
.urow-av{ width:46px; height:46px; border-radius:12px; flex:none; overflow:hidden; position:relative;
  background:var(--panel-2); display:grid; place-items:center; font-size:22px; }
.urow-av img{ width:100%; height:100%; object-fit:cover; }
.urow-av.online::after{ content:""; position:absolute; right:-2px; bottom:-2px; width:12px; height:12px;
  border-radius:50%; background:var(--ok); border:2px solid var(--bg); }
.urow-info{ flex:1; min-width:0; }
.urow-nick{ font-size:15.5px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.urow-nick .crown,.urow-nick .rankicon{ font-size:.92em; }
.urow-you{ color:var(--muted); font-weight:500; font-size:12px; }
.urow-sub{ font-size:12.5px; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.urow-sub .up-live{ color:var(--accent); font-weight:600; display:inline-flex; align-items:center; gap:6px; }
.urow-sub .up-live .ld{ width:7px; height:7px; border-radius:50%; background:var(--accent); animation:pulse 1.4s infinite; }
.urow-hrs{ font-family:var(--disp); font-weight:700; font-size:14px; color:var(--accent); flex:none; font-variant-numeric:tabular-nums; }

.nowbar-btn.on{ color:var(--accent); }

/* ============ RADIO — redesign pass (visual only) ============ */
#view-radio .card{ background: var(--panel); border-color: var(--border); }
#view-radio .card-title{ font-family: var(--disp); font-size: 15px; font-weight: 700; letter-spacing: 0; color: var(--text); }
#view-radio .card-head{ margin-bottom: 14px; }

/* NOW PLAYING hero */
#view-radio .np-card{ background: linear-gradient(160deg, #1d1830, #131318); border-color: var(--border-2); }
.np-label{ font-family: var(--disp); font-weight: 700; letter-spacing: .02em; color: var(--muted); font-size: 12px; }
.np-name{ font-family: var(--disp); font-weight: 800; letter-spacing: -.01em; }
.np-dot{ font-family: var(--sans); }

/* segmented controls → clean solid pill */
.out-toggle, .seg{ background: var(--panel-2); border-color: transparent; }
.out-btn, .seg-btn{ font-family: var(--sans); font-weight: 700; letter-spacing: .03em; font-size: 12px; }
.out-btn.active, .seg-btn.active{ background: var(--accent); color: #fff; }

/* inputs */
#view-radio .net-input, #view-radio .net-select{ background: var(--panel-2); border-color: var(--border);
  font-family: var(--sans); border-radius: 12px; }

/* station rows: borderless, hairline dividers, subtle hover */
.net-results{ gap: 0; }
.net-item, .fav-item{ gap: 8px; align-items: center; }
.net-item + .net-item, .fav-item + .fav-item{ border-top: 1px solid var(--border); }
.net-play, .fav-play{ background: none; border: none; border-radius: 10px; padding: 10px 6px; font-family: var(--sans); }
.net-play:hover, .fav-play:hover{ background: none; }
.net-name{ font-size: 14.5px; font-weight: 600; }
.net-meta{ font-size: 11px; letter-spacing: .04em; color: var(--muted); }
.net-star, .fav-btn{ background: none; border: none; flex: 0 0 34px; color: var(--faint); font-size: 18px; }
.net-star.on{ color: var(--accent); border: none; }
.net-star:hover, .fav-btn:hover{ border: none; color: var(--text); }
.net-favs{ gap: 0; }

/* buttons */
.save-btn{ background: var(--panel-2); border-color: var(--border); font-family: var(--sans);
  font-weight: 700; letter-spacing: .02em; }
.fm-btn{ font-family: var(--sans); font-weight: 600; }
.fm-freq{ font-family: var(--disp); }

/* ============ heart favorite icon (replaces star) ============ */
.net-star{ color: var(--faint); display: grid; place-items: center; }
.net-star svg{ width: 19px; height: 19px; }
.net-star.on{ color: var(--accent); }
.net-star.on svg{ fill: currentColor; }
.prow .star{ color: var(--accent); display: grid; place-items: center; }
.prow .star svg{ width: 18px; height: 18px; fill: currentColor; }
.nowbar-btn.heart-btn{ color: var(--muted); }
.nowbar-btn.heart-btn svg{ width: 20px; height: 20px; }
.nowbar-btn.heart-btn.on{ color: var(--accent); }
.nowbar-btn.heart-btn.on svg{ fill: currentColor; }

/* ============ DASHBOARD — cleaner device remote pills ============ */
.screen-btns button{ font-family: var(--sans); font-weight: 600; letter-spacing: .02em; font-size: 12px;
  background: var(--panel-2); border-color: transparent; }
.screen-btns button.cur{ background: var(--accent); color: #fff; border-color: transparent; }
.card-tag{ font-family: var(--sans); }

/* image upload rows (avatar/cover) */
.img-row{ display:flex; align-items:center; gap:12px; }
.img-row .save-btn{ flex:1; margin-top:0; }
.link-btn{ background:none; border:none; color:var(--muted); font-family:var(--sans); font-size:13px;
  cursor:pointer; text-decoration:underline; text-underline-offset:2px; flex:none; }
.link-btn:hover{ color:var(--danger); }

/* favorites: name marquee width + drag reorder */
.net-play .net-name, .fav-play .net-name{ min-width:0; }
.net-favs.editing .fav-item{ gap:10px; padding:2px 0; }
.fav-handle{ flex:none; width:38px; align-self:stretch; min-height:40px; background:var(--panel-2);
  border:1px solid var(--border); border-radius:9px; color:var(--muted); font-size:18px;
  cursor:grab; touch-action:none; }
.fav-handle:active{ cursor:grabbing; }
.fav-item.dragging{ opacity:.9; background:var(--panel-2); border-radius:10px; box-shadow:0 6px 20px rgba(0,0,0,.4); }

/* settings: avatar/cover preview with X remove button */
.avatar-wrap{ position:relative; flex:none; }
.cover-wrap{ position:relative; margin-top:8px; }
.img-x{ position:absolute; top:-7px; right:-7px; width:24px; height:24px; border-radius:50%;
  background:var(--danger); color:#fff; border:2px solid var(--panel); cursor:pointer;
  font-size:11px; line-height:1; display:grid; place-items:center; z-index:2; padding:0; }
.img-x:hover{ filter:brightness(1.1); }
.cover-wrap .img-x{ top:9px; right:9px; }

/* ==================================================================
   RADIO — NOW PLAYING hero, v2 ("On-Air Deck")
   Self-contained: the h-* classes replace the old np-stage/np-name/etc.
   markup. Deep-indigo card (matches the profile gradient), switchable
   equalizers, an optional station-track plate, glass output toggle,
   and a reworked sleep timer with a live progress bar.
   ================================================================== */
/* borderless hero — no card frame; a view-level glow flows from the hero down
   behind the sections below (negative z within an isolated view context, so it
   sits under the cards but over the page ground) */
#view-radio{position:relative; isolation:isolate;}
#view-radio .np-card{
  position:relative; overflow:visible; border-radius:0; padding:4px 0 6px;
  background:transparent; border:none; box-shadow:none;
}
#view-radio > .h-glow{position:absolute; top:-56px; left:0; width:100%; height:720px; z-index:-1;
  background:
    radial-gradient(62% 40% at 30% 12%, var(--vizglow,rgba(56,189,248,.22)), transparent 68%),
    radial-gradient(58% 44% at 78% 26%, rgba(124,92,255,.13), transparent 72%),
    radial-gradient(90% 60% at 50% 44%, rgba(34,211,238,.05), transparent 75%);
  filter:blur(58px); opacity:.95; transition:background .7s ease; pointer-events:none;}

/* header: live status + glass output toggle */
.h-head{position:relative; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:30px;}
.h-live{display:inline-flex; align-items:center; gap:8px; font-family:var(--sans); font-size:11px;
  font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--muted);}
.h-live.on{color:var(--ok);}
.h-live .livedot{position:relative; width:8px; height:8px; border-radius:50%; background:var(--ok); box-shadow:0 0 8px 1px var(--ok);}
.h-live .livedot::after{content:""; position:absolute; inset:-4px; border-radius:50%;
  background:radial-gradient(circle, rgba(56,211,155,.55), transparent 66%); animation:ripple 2.4s ease-out infinite;}
@keyframes ripple{0%{transform:scale(.5); opacity:0;} 22%{opacity:.9;} 100%{transform:scale(3.4); opacity:0;}}

#view-radio .out-toggle{display:inline-flex; gap:3px; margin:0; background:rgba(0,0,0,.42);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); border:1px solid var(--border); border-radius:11px; padding:3px;}
#view-radio .out-btn{flex:0 0 auto; font-family:var(--sans); font-size:10px; font-weight:700; letter-spacing:.03em;
  color:var(--muted); background:transparent; border:none; border-radius:8px; padding:6px 10px; cursor:pointer; white-space:nowrap;}
#view-radio .out-btn.active{background:var(--accent); color:#fff;}

.h-station{position:relative; z-index:2; font-family:var(--disp); font-weight:800; font-size:27px; line-height:1.08; letter-spacing:-.02em;
  margin:9px 0 0; overflow-wrap:anywhere; color:#fff;
  background:linear-gradient(168deg,#ffffff 0%,#f2efff 46%,#dcd6ff 100%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  /* dark shadow for legibility over the equalizer that now rises behind it, + the violet glow */
  filter:drop-shadow(0 2px 10px rgba(9,9,13,.6)) drop-shadow(0 2px 18px rgba(124,92,255,.22));}
/* When the station name scrolls (marquee), the text lives in a nested span —
   -webkit-background-clip:text does NOT apply to nested content on iOS Safari,
   so the gradient text renders invisible. Re-apply the clip on the inner span. */
.h-station .marq-inner{
  background:linear-gradient(168deg,#ffffff 0%,#f2efff 46%,#dcd6ff 100%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;}

/* station-track plate — hidden unless a station broadcasts a track */
/* station-track plate — neutral frosted glass (on-brand: white glass + a hint of
   the indigo accent), sits above the equalizer window */
.h-plate{position:relative; z-index:2; display:flex; align-items:center; gap:11px; margin-top:12px;
  padding:9px 12px; border-radius:13px; cursor:pointer; -webkit-tap-highlight-color:transparent; transition:transform .12s;
  background:linear-gradient(100deg, rgba(255,255,255,.055), rgba(124,92,255,.06));
  border:1px solid rgba(255,255,255,.10); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);}
.h-plate:active{transform:scale(.99);}
/* the profile "now playing" wave (.eq), reused here — scaled + out of flow */
.h-plate-art{flex:none; position:relative; width:24px; height:22px;}
.h-plate-art .eq{position:absolute; top:50%; left:0; transform:translateY(-50%) scale(.6); transform-origin:left center;}
.h-plate-body{flex:1; min-width:0;}
.h-plate-lbl{font-family:var(--sans); font-size:9px; font-weight:800; letter-spacing:.18em; text-transform:uppercase; color:#b3a5ff; margin-bottom:2px;}
.h-plate-track{font-family:var(--disp); font-weight:700; font-size:14.5px; color:#fff; letter-spacing:-.01em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.h-plate-track b{font-weight:800;} .h-plate-track .dash{color:var(--muted); margin:0 5px;}
.h-plate-track.marq{text-overflow:clip;}

/* equalizer window: a contained canvas the ambient #hGlow shows through; it tucks
   slightly under the plate above, and its top/bottom edges fade out via a CSS
   mask so the bars never look cut. Tap the open area to cycle styles. */
.h-core{position:relative; z-index:1; margin:-76px -16px 0; padding:0 16px; cursor:pointer; -webkit-tap-highlight-color:transparent;}
.h-plate.hidden + .h-core{margin-top:-34px;}   /* no track plate → still reach up behind the name */
/* soft top fade so the equalizer rises gently behind the name/plate (they float
   on top, z-index:2), generous bottom fade before the controls */
.h-canvas{position:absolute; inset:0; width:100%; height:100%; display:block; z-index:0; pointer-events:none;
  -webkit-mask-image:linear-gradient(180deg, transparent 0%, #000 12%, #000 84%, transparent 100%);
          mask-image:linear-gradient(180deg, transparent 0%, #000 12%, #000 84%, transparent 100%);}
.h-spacer{position:relative; z-index:1; min-height:340px;}   /* the equalizer window height */
.h-viz-name{position:relative; z-index:1; text-align:center; margin-top:-4px; font-family:var(--disp); font-weight:700; font-size:12px;
  letter-spacing:.08em; text-transform:uppercase; color:var(--faint); transition:color .2s;}
.h-core:hover .h-viz-name, .h-core:active .h-viz-name{color:var(--accent);}

/* volume (below the equalizer window, on calm ground) */
.h-vol{margin-top:14px; min-width:0;}
.h-vol-top{display:flex; justify-content:space-between; align-items:center; margin-bottom:8px;}
.h-vol-l{font-family:var(--sans); font-size:10px; font-weight:700; letter-spacing:.16em; color:var(--faint);}
.h-vol-v{font-family:var(--sans); font-size:12px; font-weight:700; color:var(--muted); font-variant-numeric:tabular-nums;}
.h-vol .slider{margin:0; width:100%;}
.np-card.browser-out .h-vol{display:none;}   /* browser volume is on-device */

/* sleep — reworked */
.h-sleep{margin-top:20px;}
.h-sleep-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;}
.h-sleep-l{font-family:var(--sans); font-size:11px; font-weight:700; letter-spacing:.1em; color:var(--muted);
  display:inline-flex; align-items:center; gap:7px;}
.h-sleep-l .moon{width:13px; height:13px; flex:none; opacity:.9;}
.h-sleep-s{font-family:var(--sans); font-size:12px; font-weight:700; color:var(--faint); font-variant-numeric:tabular-nums; letter-spacing:.04em; transition:color .2s;}
.h-sleep-s.on{color:var(--air);}
.h-sleep-prog{display:none; height:6px; border-radius:6px; background:var(--panel-2); overflow:hidden; margin-bottom:12px;}
.h-sleep-prog.on{display:block;}
/* a bright white glint sweeps across (with a pause) — a light reflection that
   keeps the bar alive while its width creeps down very slowly */
@keyframes glint { 0% { background-position: -35% 0, 0 0; } 55%, 100% { background-position: 135% 0, 0 0; } }
.h-sleep-prog i{display:block; height:100%; border-radius:6px; width:100%;
  background:linear-gradient(100deg, transparent 42%, rgba(255,255,255,.9) 50%, transparent 58%),
             linear-gradient(90deg, var(--accent-2), var(--accent));
  background-size:220% 100%, 100% 100%; background-repeat:no-repeat;
  animation:glint 3s ease-in-out infinite;
  box-shadow:0 0 8px rgba(124,92,255,.4); transition:width 1s linear;}
@media (prefers-reduced-motion:reduce){ .h-sleep-prog i{animation:none;} }
/* single row, horizontal scroll (no wrapping) so all presets fit any width */
.h-sleep-chips{display:flex; flex-wrap:nowrap; gap:6px; align-items:center; overflow-x:auto;
  scrollbar-width:none; -webkit-overflow-scrolling:touch; padding-bottom:2px; margin:0 -2px;}
.h-sleep-chips::-webkit-scrollbar{display:none;}
.h-sleep-chips .sleep-btn{flex:none; font-family:var(--sans); font-size:12.5px; font-weight:600; color:var(--muted);
  padding:8px 11px; border-radius:10px; background:var(--panel-2); border:1px solid var(--border); cursor:pointer; transition:.15s;}
.h-sleep-chips .sleep-btn:hover{color:var(--text); border-color:var(--border-2);}
.h-sleep-chips .sleep-btn.on{color:var(--accent); border-color:var(--accent-dim); background:var(--accent-dim);}
.h-sleep-chips .sleep-btn.cust{display:inline-flex; align-items:center; gap:6px; color:var(--accent);}
.h-sleep-chips .sleep-btn.cust svg{width:13px; height:13px;}
.h-sleep-chips .sleep-btn.cust.on{color:var(--accent); border-color:var(--accent-dim); background:var(--accent-dim);}
.h-sleep-chips .sleep-btn.off{color:var(--faint);}
.h-sleep-chips .sleep-btn.off:hover{color:var(--danger); border-color:rgba(255,90,107,.3);}
.h-sleep-cust{display:none; align-items:center; gap:8px; margin-top:10px; padding:8px; border-radius:12px; background:var(--panel-2); border:1px solid var(--border);}
.h-sleep-cust.on{display:flex;}
.h-step{width:34px; height:34px; flex:none; border-radius:9px; border:1px solid var(--border); background:var(--bg); color:var(--text); font-size:19px; cursor:pointer; display:grid; place-items:center; line-height:1;}
.h-step:hover{border-color:var(--accent); color:var(--accent);}
.h-step-val{flex:1; text-align:center; font-family:var(--disp); font-weight:800; font-size:20px; color:var(--text); font-variant-numeric:tabular-nums;}
.h-step-val em{font-family:var(--sans); font-weight:600; font-size:12px; color:var(--muted); font-style:normal; margin-left:4px;}
.h-set{flex:none; font-family:var(--sans); font-size:12px; font-weight:700; letter-spacing:.06em; color:var(--accent);
  background:var(--accent-dim); border:1px solid var(--accent-dim); border-radius:9px; padding:9px 15px; cursor:pointer;}
.h-set:hover{border-color:var(--accent);}

/* party strip — match the mockup card (was the old pill) */
#view-radio .party{width:auto; margin-top:16px; padding:10px 12px; border-radius:14px;
  border:1px solid var(--border-2); background:linear-gradient(100deg, rgba(124,92,255,.15), rgba(124,92,255,.03));}
#view-radio .party-av{width:29px; height:29px; border:2px solid var(--panel); margin-left:-9px;}
#view-radio .party-av:first-child{margin-left:0;}
#view-radio .party-more{width:29px; height:29px; border:2px solid var(--panel);}
#view-radio .party-label{font-size:13px; font-weight:500; color:var(--text); letter-spacing:0;}

@media (prefers-reduced-motion:reduce){ .h-live .livedot::after{animation:none;} }

/* custom station by URL — collapsible block in the INTERNET tuner */
.net-custom-toggle{display:inline-flex; align-items:center; gap:7px; margin-top:12px; padding:8px 12px;
  font-family:var(--sans); font-size:12.5px; font-weight:600; color:var(--muted); cursor:pointer;
  background:var(--panel-2); border:1px solid var(--border); border-radius:10px; transition:.15s;}
.net-custom-toggle:hover{color:var(--text); border-color:var(--border-2);}
.net-custom-toggle svg{width:15px; height:15px; color:var(--accent); transition:transform .2s;}
.net-custom-toggle[aria-expanded="true"]{color:var(--accent); border-color:var(--accent-dim); background:var(--accent-dim);}
.net-custom-toggle[aria-expanded="true"] svg{transform:rotate(45deg);}
.net-custom{display:flex; flex-direction:column; gap:8px; margin-top:10px; padding:12px;
  background:var(--panel-2); border:1px solid var(--border); border-radius:12px;}
.net-custom .net-input{width:100%;}
.net-custom-row{display:flex; gap:8px;}
.net-custom-row .fm-btn{flex:1;}
.net-custom .setting-note{margin:2px 0 0;}

/* ---- achievements / badges (profile sub-tab) --------------------------- */
/* rarity colours come from the API per badge (same hues as the ranks) */
/* unseen-unlock pip on the Achievements sub-tab */
.tnote{ display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px;
  padding:0 5px; margin-left:7px; border-radius:999px; background:var(--accent); color:#fff;
  font-family:var(--sans); font-size:10.5px; font-weight:800; vertical-align:middle;
  box-shadow:0 0 11px rgba(124,92,255,.6); animation:notepulse 2s ease-in-out infinite; }
@keyframes notepulse{ 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
/* a small dot on the bottom-nav Profile tab so a new badge is noticed from anywhere */
.tab{ position:relative; }
.tab.has-note::after{ content:""; position:absolute; top:6px; right:calc(50% - 16px); width:8px; height:8px;
  border-radius:50%; background:var(--accent); box-shadow:0 0 8px rgba(124,92,255,.8); }

.ach-summary{ display:flex; align-items:center; gap:22px; flex-wrap:wrap;
  background:linear-gradient(180deg,var(--panel-2),var(--panel)); border:1px solid var(--border);
  border-radius:18px; padding:18px 22px; margin-top:16px; }
.ach-comp{ display:flex; align-items:center; gap:16px; min-width:0; flex:1; }
.ach-ring{ width:66px; height:66px; flex:none; position:relative; }
.ach-ring svg{ transform:rotate(-90deg); }
.ach-ring .rb-num{ position:absolute; inset:0; display:grid; place-items:center;
  font-family:var(--disp); font-weight:800; font-size:17px; }
.ach-comp-t{ display:flex; flex-direction:column; gap:2px; }
.ach-comp-t .big{ font-family:var(--disp); font-weight:800; font-size:19px; letter-spacing:-.01em; }
.ach-comp-t .sm{ color:var(--muted); font-size:12.5px; font-weight:600; }
.ach-tally{ display:flex; gap:9px; flex-wrap:wrap; }
.ach-tpill{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700;
  padding:5px 10px; border-radius:999px; border:1px solid var(--border-2); background:rgba(255,255,255,.02);
  color:var(--muted); font-variant-numeric:tabular-nums; }
.ach-tpill i{ width:8px; height:8px; border-radius:50%; display:inline-block; }
.ach-tpill b{ color:var(--text); }

.ach-sechead{ display:flex; align-items:baseline; justify-content:space-between; gap:8px 14px;
  flex-wrap:wrap; margin:24px 2px 14px; }
.ach-hgroup{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ach-h{ font-family:var(--disp); font-weight:700; font-size:13px; letter-spacing:.16em;
  text-transform:uppercase; color:var(--muted); margin:0; }
.ach-new{ display:inline-flex; align-items:center; gap:5px; color:var(--accent); font-weight:800; font-size:12px;
  background:color-mix(in srgb,var(--accent) 13%, transparent);
  border:1px solid color-mix(in srgb,var(--accent) 34%, transparent); padding:3px 10px; border-radius:999px; }
.ach-count{ font-size:13px; color:var(--faint); font-weight:600; font-variant-numeric:tabular-nums; }
.ach-count b{ color:var(--text); }

.ach-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:13px; }
.ach-badge{ position:relative; border:1px solid var(--border); border-radius:18px;
  background:linear-gradient(180deg,var(--panel-2),var(--panel)); padding:18px 14px 15px;
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; overflow:hidden;
  transition:box-shadow .2s ease, border-color .2s ease; }
.ach-badge::before{ content:""; position:absolute; inset:0 0 auto 0; height:76px; pointer-events:none;
  background:radial-gradient(78% 100% at 50% 0%, var(--rc, transparent), transparent 72%); opacity:.32; }
.ach-badge.earned{ border-color:color-mix(in srgb,var(--rc) 38%, var(--border)); }
.ach-badge.earned:hover{ box-shadow:0 0 26px color-mix(in srgb,var(--rc) 16%, transparent); }
.ach-badge.neu{ border-color:color-mix(in srgb,var(--rc) 55%, var(--border)); animation:achpulse 2.6s ease-in-out infinite; }
@keyframes achpulse{
  0%,100%{ box-shadow:0 0 0 1px color-mix(in srgb,var(--rc) 26%, transparent); }
  50%{ box-shadow:0 0 0 1px color-mix(in srgb,var(--rc) 60%, transparent), 0 0 22px color-mix(in srgb,var(--rc) 26%, transparent); } }

.ach-medal{ position:relative; width:70px; height:70px; display:grid; place-items:center; margin-top:2px; }
.ach-medal .ring{ position:absolute; inset:0; width:70px; height:70px; transform:rotate(-90deg); }
.ach-medal .ring .track{ fill:none; stroke:rgba(255,255,255,.055); stroke-width:2.5; }
.ach-medal .ring .prog{ fill:none; stroke-width:2.5; stroke-linecap:round; stroke-dasharray:201.06;
  stroke-dashoffset:calc(201.06 * (1 - var(--p,0)/100)); transition:stroke-dashoffset .5s ease; }
.ach-medal .disc{ width:52px; height:52px; border-radius:50%; display:grid; place-items:center; font-size:26px;
  background:radial-gradient(120% 120% at 30% 25%, color-mix(in srgb,var(--rc) 24%, #191922), #131319);
  border:1px solid color-mix(in srgb,var(--rc) 40%, transparent); }
.ach-badge.earned .prog{ stroke:var(--rc); }
.ach-badge.earned .disc{ box-shadow:0 0 20px color-mix(in srgb,var(--rc) 40%, transparent), inset 0 1px 0 rgba(255,255,255,.1); }
.ach-badge.locked .prog{ stroke:var(--accent); }
.ach-badge.locked .disc{ filter:grayscale(1) brightness(.62);
  background:radial-gradient(120% 120% at 30% 25%,#1c1c24,#131319); border-color:var(--border-2); }
.ach-badge.locked::before{ opacity:.1; }
.ach-badge.soon .prog{ stroke:rgba(255,255,255,.14); }
/* legendary + mythic earned get a slow conic halo — the premium tell */
.ach-badge.earned.hi .ach-medal::after{ content:""; position:absolute; inset:-3px; border-radius:50%; z-index:-1;
  background:conic-gradient(from 0deg, transparent, color-mix(in srgb,var(--rc) 70%, transparent), transparent 55%);
  animation:achspin 7s linear infinite; opacity:.55; }
@keyframes achspin{ to{ transform:rotate(360deg); } }

.ach-badge .nm{ font-family:var(--disp); font-weight:700; font-size:14.5px; letter-spacing:-.01em; line-height:1.2; }
.ach-badge .ds{ font-size:11.5px; color:var(--muted); line-height:1.32; min-height:31px; }
.ach-badge .ft{ margin-top:1px; font-size:10.5px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--rc); }
.ach-badge .dt{ color:var(--faint); font-weight:600; letter-spacing:0; text-transform:none; font-size:11px; margin-top:-4px; }
.ach-badge .pc{ font-size:11.5px; color:var(--muted); font-weight:700; font-variant-numeric:tabular-nums; margin-top:-2px; }
.ach-badge.locked .nm{ color:#c9c9d3; }
.ach-tag{ position:absolute; top:10px; right:10px; font-size:9px; font-weight:800; letter-spacing:.08em;
  border-radius:6px; padding:2px 6px; text-transform:uppercase; }
.ach-tag.new{ color:#0b0b0f; background:var(--ok); }
.ach-tag.soon{ color:var(--faint); border:1px solid var(--border-2); }

.ach-legend{ display:flex; flex-wrap:wrap; gap:15px; margin:18px 2px 4px; font-size:11.5px; color:var(--muted); }
.ach-legend span{ display:inline-flex; align-items:center; gap:6px; font-weight:600; }
.ach-legend .dot{ width:9px; height:9px; border-radius:50%; }

/* unlock toast — richer than the plain text toast */
.badge-toast{ position:fixed; left:50%; bottom:24px; transform:translateX(-50%);
  display:flex; align-items:center; gap:11px; z-index:60; max-width:calc(100% - 32px);
  background:linear-gradient(180deg,#20202b,#17171e); color:var(--text);
  border:1px solid color-mix(in srgb,var(--rc,var(--accent)) 45%, var(--border-2));
  border-radius:14px; padding:11px 15px 11px 12px; font-size:13.5px;
  box-shadow:0 16px 40px rgba(0,0,0,.5), 0 0 22px color-mix(in srgb,var(--rc,var(--accent)) 20%, transparent); }
.badge-toast.hidden{ display:none; }
.badge-toast .bt-m{ width:40px; height:40px; border-radius:50%; display:grid; place-items:center; font-size:21px; flex:none;
  background:radial-gradient(120% 120% at 30% 25%, color-mix(in srgb,var(--rc,var(--accent)) 28%, #14141b), #14141b);
  border:1px solid color-mix(in srgb,var(--rc,var(--accent)) 50%, transparent);
  box-shadow:0 0 16px color-mix(in srgb,var(--rc,var(--accent)) 40%, transparent); }
.badge-toast .bt-l{ color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; display:block; margin-bottom:1px; }
.badge-toast b{ font-family:var(--disp); }

@media (max-width:480px){
  .ach-grid{ grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
  .ach-summary{ padding:16px; gap:16px; }
  .ach-badge{ padding:16px 12px 13px; }
  .ach-badge .nm{ font-size:14px; }
  .ach-new{ font-size:11px; padding:2px 8px; }
}
@media (prefers-reduced-motion:reduce){
  .tnote{ animation:none; }
  .ach-badge{ transition:none; }
  .ach-badge.earned.hi .ach-medal::after{ animation:none; }
  .ach-badge.neu{ animation:none; box-shadow:0 0 0 1px color-mix(in srgb,var(--rc) 50%, transparent); }
}

/* badge tiles are buttons (tappable) — reset the UA button chrome */
.ach-badge{ -webkit-appearance:none; appearance:none; font:inherit; color:inherit; width:100%; cursor:pointer; }
.ach-badge:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* ---- badge detail overlay + reward burst (tap a badge) ---------------- */
.ach-overlay{ position:fixed; inset:0; z-index:80; display:grid; place-items:center; padding:20px;
  background:rgba(6,6,10,.72); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  opacity:0; transition:opacity .22s ease; }
.ach-overlay.show{ opacity:1; }
.ach-overlay.hidden{ display:none; }
.ach-fx{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.ach-modal{ position:relative; width:min(330px,84vw); border-radius:22px; padding:30px 24px 24px; text-align:center;
  background:linear-gradient(180deg,#1b1b24,#131318);
  border:1px solid color-mix(in srgb,var(--rc) 42%, var(--border-2));
  box-shadow:0 30px 80px rgba(0,0,0,.6), 0 0 50px color-mix(in srgb,var(--rc) 22%, transparent);
  transform:scale(.86); opacity:0; transition:transform .3s cubic-bezier(.2,.9,.3,1.3), opacity .25s ease; }
.ach-overlay.show .ach-modal{ transform:scale(1); opacity:1; }
.ach-close{ position:absolute; top:10px; right:13px; background:none; border:none; color:var(--muted);
  font-size:25px; line-height:1; cursor:pointer; padding:4px; }
.ach-close:hover{ color:var(--text); }
.am-medal{ position:relative; width:100px; height:100px; margin:6px auto 16px; display:grid; place-items:center; }
.am-medal .ring{ position:absolute; inset:0; width:100px; height:100px; transform:rotate(-90deg); }
.am-medal .ring .track{ fill:none; stroke:rgba(255,255,255,.06); stroke-width:3; }
.am-medal .ring .prog{ fill:none; stroke-width:3; stroke-linecap:round; stroke-dasharray:276.46;
  stroke-dashoffset:calc(276.46 * (1 - var(--p,0)/100)); }
.am-medal .disc{ width:74px; height:74px; border-radius:50%; display:grid; place-items:center; font-size:38px;
  background:radial-gradient(120% 120% at 30% 25%, color-mix(in srgb,var(--rc) 26%, #191922), #131319);
  border:1px solid color-mix(in srgb,var(--rc) 45%, transparent); }
.am-medal.earned .ring .prog{ stroke:var(--rc); }
.am-medal.earned .disc{ box-shadow:0 0 26px color-mix(in srgb,var(--rc) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.12);
  animation:ampop .55s cubic-bezier(.2,.9,.3,1.4) both; }
.am-medal.locked .ring .prog{ stroke:var(--accent); }
.am-medal.locked .disc{ filter:grayscale(1) brightness(.6); border-color:var(--border-2); }
.am-medal.earned.hi::after{ content:""; position:absolute; inset:-6px; border-radius:50%; z-index:-1;
  background:conic-gradient(from 0deg, transparent, color-mix(in srgb,var(--rc) 75%, transparent), transparent 55%);
  animation:achspin 6s linear infinite; opacity:.6; }
@keyframes ampop{ 0%{ transform:scale(0) } 60%{ transform:scale(1.16) } 100%{ transform:scale(1) } }
.am-rarity{ font-family:var(--disp); font-weight:800; font-size:11px; letter-spacing:.16em; text-transform:uppercase; }
.am-name{ font-family:var(--disp); font-weight:800; font-size:24px; letter-spacing:-.01em; margin:4px 0 6px; }
.am-desc{ color:var(--muted); font-size:14px; line-height:1.4; }
.am-foot{ margin-top:15px; color:var(--faint); font-size:13px; font-weight:600; }
.am-unlocked{ color:var(--rc); font-weight:800; }
.am-bar{ height:8px; border-radius:999px; background:rgba(255,255,255,.08); overflow:hidden; margin:0 auto 8px; max-width:220px; }
.am-bar>span{ display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,var(--accent-2),var(--accent)); }
.am-pc{ font-variant-numeric:tabular-nums; }
@media (prefers-reduced-motion:reduce){
  .ach-modal{ transition:opacity .2s ease; transform:none; }
  .am-medal.earned .disc{ animation:none; }
  .am-medal.earned.hi::after{ animation:none; }
}
