:root {
  --bg: #04030a;
  --glass: rgba(14, 12, 30, 0.62);
  --glass-strong: rgba(14, 12, 30, 0.86);
  --line: rgba(190, 180, 255, 0.16);
  --text: #ece9ff;
  --muted: #9a94c4;
  --accent: #ffd98e;
  --grad: linear-gradient(120deg, #ffd98e, #ff7fb6 50%, #4fe3ff);
  --radius: 999px;
  font-family: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
button { font: inherit; color: inherit; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#scene.dragging { cursor: grabbing; }
#scene.pointing { cursor: pointer; }

/* ---------- labels ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.label {
  position: absolute; left: 0; top: 0;
  white-space: nowrap; pointer-events: none;
  font-weight: 600; letter-spacing: 0.01em;
  text-shadow: 0 0 6px rgba(0,0,0,0.9), 0 0 14px rgba(0,0,0,0.6);
  opacity: 0; transition: opacity 0.35s ease, color 0.2s;
  will-change: transform, opacity;
  user-select: none;
  padding: 2px 4px;
}
.label.on { opacity: 0.92; }
.label.on.dim { opacity: 0.28; }
.label.on.hot { opacity: 1 !important; color: #fff !important; text-shadow: 0 0 10px currentColor, 0 0 3px #000; }
.label.on.sel { opacity: 1 !important; color: #fff !important; font-weight: 700; }
.label.song { font-weight: 500; letter-spacing: 0; text-shadow: 0 0 5px #000, 0 0 10px rgba(0,0,0,0.8); }
.label.song.on { opacity: 0.75; }
.label.family {
  font-family: 'Lilita One', 'Sansation', sans-serif; font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.22em;
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; pointer-events: none; z-index: 10;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; line-height: 1; margin-right: 4px; }
.logo { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.logo span { background: linear-gradient(90deg, #ffd98e, #ff7fb6 50%, #4fe3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.linkish { background: none; border: 0; padding: 4px 0 0; font-size: 11px; color: var(--muted); cursor: pointer; text-align: left; }
.linkish:hover { color: var(--text); }

.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.5); background: var(--glass);
  backdrop-filter: blur(10px); cursor: pointer; font-weight: 700; font-size: 13px;
  transition: background 0.2s, border-color 0.2s;
}
.pill:hover { background: rgba(255,255,255,0.1); }
.pill, .icon-btn { position: relative; }
/* Boutons actifs : contour, texte et icône en dégradé (mêmes couleurs que le logo) */
.pill.active, .icon-btn.active {
  border-color: transparent; color: #fff;
  background: linear-gradient(120deg, rgba(255,217,142,0.14), rgba(255,127,182,0.14) 50%, rgba(79,227,255,0.14)), var(--glass);
  box-shadow: 0 0 14px rgba(255,127,182,0.28);
}
.pill.active::before, .icon-btn.active::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.pill.active span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pill.active svg [stroke="currentColor"], .icon-btn.active svg [stroke="currentColor"] { stroke: url(#btnGrad); }
.pill.active svg [fill="currentColor"], .icon-btn.active svg [fill="currentColor"] { fill: url(#btnGrad); }

.search { position: relative; flex: 0 1 420px; }
.search input {
  width: 100%; height: 38px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(10px); color: var(--text);
  padding: 0 40px 0 38px; font: 500 14px 'Manrope', sans-serif; outline: none;
  transition: border-color 0.2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: rgba(255, 217, 142, 0.6); }
.search-ico { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.search kbd { position: absolute; right: 12px; top: 9px; font: 600 11px 'Manrope'; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
#searchResults {
  position: absolute; top: 44px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--glass-strong); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px;
  display: none; max-height: 60vh; overflow: auto;
}
#searchResults.open { display: block; }
#searchResults li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
#searchResults li.active, #searchResults li:hover { background: rgba(255,255,255,0.08); }
#searchResults .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; background: currentColor; }
#searchResults small { color: var(--muted); margin-left: auto; font-size: 12px; }

.tools { margin-left: auto; display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(10px); display: grid; place-items: center; cursor: pointer; color: var(--text);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }

/* ---------- settings ---------- */
.popover {
  position: fixed; top: 60px; right: 14px; width: 260px; z-index: 11; padding: 14px 16px;
  background: var(--glass-strong); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 18px;
}
.popover h3 { margin: 0 0 10px; font: 600 12px 'Unbounded'; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; padding: 7px 0; }
.row input[type=range] { width: 120px; accent-color: var(--accent); }
.row.check { justify-content: flex-start; cursor: pointer; }
.row select {
  width: 120px; height: 28px; padding: 0 26px 0 10px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer;
  background: rgba(255,255,255,0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ff7fb6' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text); font: 600 12.5px 'Manrope', sans-serif; appearance: none; -webkit-appearance: none; outline: none;
}
.row select:focus-visible { border-color: rgba(255,127,182,0.7); }
.row select option { background: #16122a; color: var(--text); }
.row.check input { accent-color: var(--accent); }

/* ---------- panel ---------- */
.panel {
  position: fixed; right: 0; top: 62px; bottom: 0; width: min(360px, 100vw); z-index: 9;
  background: var(--glass-strong); backdrop-filter: blur(16px); border: 1px solid var(--line); border-right: 0; border-bottom: 0;
  border-radius: 22px 0 0 0;
  padding: 22px 20px; overflow-y: auto; overflow-x: hidden; animation: slidein 0.45s cubic-bezier(.2,.8,.2,1);
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel h2 { font: 700 26px/1.1 'Unbounded', sans-serif; margin: 10px 0 4px; letter-spacing: -0.01em; }
.panel .sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.panel h4 { font: 600 11px 'Unbounded'; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-family: 'Sansation', sans-serif; font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; padding: 4px 10px; border-radius: var(--radius); background: rgba(255,255,255,0.06); }
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.06); cursor: pointer; font-size: 20px; line-height: 1; }
.close:hover { background: rgba(255,255,255,0.14); }

.artists { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.artists li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; cursor: pointer; transition: background 0.2s; }
.artists li:hover { background: rgba(255,255,255,0.06); }
.artists .play { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); flex: none; }
.artists li.playing .play { border-color: currentColor; box-shadow: 0 0 12px currentColor; }
.artists li.loading .play { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.artists .name { font-weight: 600; font-size: 14px; }
.artists .track { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }

.neighbors { display: flex; flex-wrap: wrap; gap: 6px; }
.neighbors button {
  border: 1px solid var(--line); background: rgba(255,255,255,0.03); border-radius: var(--radius);
  padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.neighbors button:hover { background: rgba(255,255,255,0.1); border-color: currentColor; }
.ext { display: inline-block; margin-top: 22px; font-size: 13px; color: var(--muted); text-decoration: none; }
.ext:hover { color: var(--text); }

/* ---------- now playing ---------- */
.nowplaying {
  position: fixed; left: 14px; bottom: 44px; z-index: 9; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: 16px; background: var(--glass-strong); backdrop-filter: blur(14px);
  border: 1px solid var(--line); max-width: min(360px, calc(100vw - 90px)); overflow: hidden;
  animation: slidein 0.35s ease;
}
.nowplaying img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: #222; }
.np-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.np-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-text span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,0.08); }
.np-bar i { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: 0 0 8px rgba(255,127,182,0.7); }
/* contour en dégradé, comme les boutons du haut */
.nowplaying::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--grad); opacity: 0.75;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.nowplaying { border-color: transparent; box-shadow: 0 0 16px rgba(255,127,182,0.18); }
.np-next svg [fill="currentColor"] { fill: url(#btnGrad); }
/* radio en direct : la barre respire au lieu d'avancer */
.nowplaying.live .np-bar i { animation: live 2.4s ease-in-out infinite; }
@keyframes live { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---------- misc ---------- */
.hint { position: fixed; bottom: 34px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); margin: 0; pointer-events: none; transition: opacity 1s; }
.recenter { position: fixed; right: 14px; bottom: 30px; z-index: 8; }
.zoom-level {
  position: fixed; right: 60px; bottom: 37px; z-index: 8; height: 24px; padding: 0 10px; display: grid; place-items: center;
  border-radius: 999px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line);
  font: 600 11.5px 'Manrope', sans-serif; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none;
}
body:has(.panel:not([hidden])) .zoom-level { right: calc(min(360px, 100vw) + 60px); }
#searchResults .dot.radio { border-radius: 2px; }
.credits { position: fixed; left: 14px; bottom: 8px; font-size: 10.5px; color: rgba(154, 148, 196, 0.7); pointer-events: none; }
.credits b { color: rgba(220, 212, 255, 0.85); font-weight: 600; }
.linkish.inline { display: inline; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px; pointer-events: auto; }
.linkish.inline:hover { color: var(--text); }
.modal-card .by { font-size: 13.5px; }
.modal-card.legal { max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(180, 160, 255, 0.35) transparent; }
.modal-card.legal h4 { font: 600 11px 'Unbounded'; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 18px 0 4px; }
.modal-card.legal p { margin: 0 0 8px; font-size: 13.5px; }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(2, 1, 8, 0.6); backdrop-filter: blur(4px); }
.modal[hidden], .panel[hidden], .popover[hidden], .nowplaying[hidden] { display: none; }
.modal-card { position: relative; width: min(520px, calc(100vw - 32px)); padding: 28px; border-radius: 24px; background: var(--glass-strong); border: 1px solid var(--line); line-height: 1.6; font-size: 14.5px; }
.modal-card h2 { font: 700 24px 'Unbounded'; margin: 0 0 12px; }
.modal-card .muted { color: var(--muted); font-size: 12.5px; }

.loader { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--bg); transition: opacity 1.2s ease; font: 500 13px 'Unbounded'; letter-spacing: 0.2em; color: var(--muted); }
.loader.gone { opacity: 0; pointer-events: none; }
.loader span { animation: pulse 1.6s infinite; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .search { order: 5; flex: 1 1 100%; }
  .pill span { display: none; }
  .panel { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-height: 55vh; border-radius: 22px 22px 0 0; }
  .hint { display: none; }
}

/* ---------- système stellaire dans le panneau ---------- */
.panel .sys { color: var(--muted); font-size: 12px; margin: -2px 0 10px; }
.artists li.artist { display: block; padding: 0; cursor: default; }
.artists li.artist:hover { background: none; }
.artist-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; cursor: pointer; transition: background 0.2s; }
.artist-head:hover { background: rgba(255,255,255,0.06); }
.artist-head .name { font-weight: 700; font-size: 14px; color: var(--text); }
.songs { list-style: none; margin: 0 0 6px 22px; padding: 0 0 0 14px; border-left: 1px dashed rgba(255,255,255,0.12); }
.songs .song { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 9px; font-size: 12.5px; color: var(--text); cursor: pointer; opacity: 0.82; }
.songs .song span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.songs .song i { width: 5px; height: 5px; border-radius: 50%; background: var(--fam); flex: none; }
.songs .song:hover { background: rgba(255,255,255,0.07); opacity: 1; }
.songs .song.playing { opacity: 1; background: rgba(255,255,255,0.08); font-weight: 700; }
.songs .song.playing i { box-shadow: 0 0 8px 2px var(--fam); }
.songs .song.empty { cursor: default; color: var(--muted); font-style: italic; }
.np-next { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,0.05); display: grid; place-items: center; cursor: pointer; margin-left: 4px; }
.np-next:hover { background: rgba(255,255,255,0.14); }
.np-next[hidden] { display: none; }
.np-next svg [stroke="currentColor"] { stroke: url(#btnGrad); }
.np-next.active { border-color: rgba(255,127,182,0.7); background: rgba(255,127,182,0.12); }
/* ---------- choix de la radio du style en cours ---------- */
.stations {
  position: fixed; left: 14px; bottom: 112px; z-index: 10; width: min(340px, calc(100vw - 28px)); max-height: min(380px, 55vh);
  display: flex; flex-direction: column; padding: 10px 6px 6px; border-radius: 16px;
  background: var(--glass-strong); backdrop-filter: blur(14px); border: 1px solid var(--line); animation: slidein 0.25s ease;
}
.stations[hidden] { display: none; }
.stations-head { padding: 0 10px 8px; font-size: 12px; color: var(--muted); }
.stations-head span { font-weight: 700; color: var(--text); }
#stationList { list-style: none; margin: 0; padding: 0; overflow: auto; }
#stationList li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; cursor: pointer; font-size: 13px; }
#stationList li:hover { background: rgba(255,255,255,0.08); }
#stationList li.on { background: rgba(255,127,182,0.12); font-weight: 700; }
#stationList li.on .st-name { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
#stationList li.empty { color: var(--muted); cursor: default; font-style: italic; }
#stationList img, #stationList .st-ph { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; flex: none; background: rgba(255,255,255,0.08); }
.st-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stationList small { color: var(--muted); font-size: 11px; flex: none; }
.mini { border: 1px solid var(--line); background: rgba(255,255,255,0.05); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.mini:hover { background: rgba(255,255,255,0.12); }

.popover input[type=checkbox] { accent-color: var(--accent); }

/* ---------- source audio ---------- */
.popover { max-height: calc(100vh - 80px); overflow-y: auto; }
.popover .sub-h { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.popover input[type=radio] { accent-color: var(--accent); }
.row.check small { color: var(--muted); font-size: 11px; margin-left: auto; }
/* ---------- sources audio ---------- */
.popover.sources { width: 280px; }
.src-opt { display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 0 -4px 6px; border-radius: 14px; border: 1px solid transparent; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.src-opt:hover { background: rgba(255,255,255,0.05); }
.src-opt input { position: absolute; opacity: 0; pointer-events: none; }
.src-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,0.06); color: var(--muted); transition: color 0.2s, background 0.2s, box-shadow 0.2s; }
.src-txt { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.src-txt b { font-weight: 600; }
.src-txt small { color: var(--muted); font-size: 11px; }
.src-opt:has(input:checked) { background: rgba(255,255,255,0.06); border-color: var(--line); }
.src-opt:has(input:checked) .src-ico { color: #0b0716; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.src-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.spotify-box { margin: 4px 0 2px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.spotify-box[hidden] { display: none; }
.sp-status { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.sp-status.ok { color: #5dff9a; }
.sp-label { display: block; font-size: 11px; color: var(--muted); margin: 8px 0 4px; }
.spotify-box input[type=text] { width: 100%; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,0.25); color: var(--text); padding: 0 8px; font: 500 12px 'Manrope'; outline: none; }
.sp-copy { display: flex; gap: 6px; align-items: center; }
.sp-copy code { flex: 1; font-size: 11px; background: rgba(0,0,0,0.25); padding: 5px 7px; border-radius: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-btn { width: 100%; margin-top: 10px; height: 32px; border-radius: 999px; border: 0; background: #1ed760; color: #04120a; font-weight: 700; font-size: 13px; cursor: pointer; }
.sp-btn:hover { filter: brightness(1.1); }
.sp-btn[hidden], #spSetup[hidden], #spLogout[hidden] { display: none; }
#spLogout { margin-top: 8px; }

/* ---------- invitation Spotify ---------- */
.sp-offer { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin: -6px 0 4px; height: 40px; border-radius: 999px; border: 0; background: #1ed760; color: #04120a; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.sp-offer svg { color: #04120a; }
.sp-offer svg circle { fill: #04120a; }
.sp-offer svg path { stroke: #1ed760; }
.sp-offer:hover { filter: brightness(1.08); }
.sp-offer[hidden], .np-sp[hidden], .toast[hidden] { display: none; }
.np-sp { display: inline-flex; align-items: center; gap: 5px; flex: none; margin-left: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 0; background: #1ed760; color: #04120a; font-weight: 700; font-size: 11.5px; cursor: pointer; }
.np-sp svg circle { fill: #04120a; }
.np-sp svg path { stroke: #1ed760; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 25; max-width: min(460px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--line); backdrop-filter: blur(14px); font-size: 13px; line-height: 1.45; text-align: center; animation: slidein 0.35s ease; }

/* ---------- panneau ouvert : le bouton recentrer se décale ---------- */
.recenter { transition: right 0.35s cubic-bezier(.2,.8,.2,1); }
body:has(.panel:not([hidden])) .recenter { right: calc(min(360px, 100vw) + 14px); }

/* ---------- barres de défilement ---------- */
.panel, .popover, #searchResults { scrollbar-width: thin; scrollbar-color: rgba(180, 160, 255, 0.35) transparent; }
.panel::-webkit-scrollbar, .popover::-webkit-scrollbar, #searchResults::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-track, .popover::-webkit-scrollbar-track, #searchResults::-webkit-scrollbar-track { background: transparent; margin: 18px 0; }
.panel::-webkit-scrollbar-thumb, .popover::-webkit-scrollbar-thumb, #searchResults::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(200, 170, 255, 0.45), rgba(120, 200, 255, 0.35)); border-radius: 6px;
}
.panel::-webkit-scrollbar-thumb:hover, .popover::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(220, 190, 255, 0.75), rgba(140, 215, 255, 0.6)); }

/* valeur affichée à côté d'un curseur */
.row .val { margin-left: auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ---------- compte ---------- */
#accountBtn { position: relative; overflow: hidden; }
#accountAvatar { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); border-radius: 50%; object-fit: cover; }
#accountBtn.signed #accountIcon { display: none; }
#accountBtn.signed.initial::after { content: attr(data-initial); position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.popover.account { width: 300px; }
.acc-lead, .acc-note { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 0 0 12px; }
.acc-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.acc-btn:hover { background: rgba(255,255,255,0.12); }
.acc-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; margin: 12px 0; }
.acc-sep::before, .acc-sep::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.1); }
.acc-link { display: flex; flex-direction: column; gap: 8px; }
.acc-link input { padding: 9px 11px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: rgba(0,0,0,0.25); color: var(--text); font: inherit; font-size: 13px; outline: none; }
.acc-link input:focus { border-color: rgba(255,127,182,0.6); }
.acc-msg { font-size: 12px; margin: 10px 0 0; color: var(--muted); line-height: 1.4; }
.acc-msg.err { color: #ff8f8f; }
.acc-who { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.acc-who img, .acc-ph { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.acc-ph { display: grid; place-items: center; font-weight: 700; background: rgba(255,255,255,0.08); }
.acc-who strong { display: block; font-size: 14px; }
.acc-who small { color: var(--muted); font-size: 11.5px; word-break: break-all; }
.popover.account h4 { margin: 14px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#favList { list-style: none; margin: 0 0 10px; padding: 0; max-height: 260px; overflow: auto; }
#favList li { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 9px; cursor: pointer; font-size: 13px; }
#favList li:hover { background: rgba(255,255,255,0.08); }
#favList li.empty { color: var(--muted); font-style: italic; font-size: 12px; cursor: default; }
#favList li.empty:hover { background: none; }
#favList img, #favList .st-ph { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; flex: none; background: rgba(255,255,255,0.08); }
#favList .fav-txt { flex: 1; min-width: 0; }
#favList .fav-txt span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#favList .fav-txt small { color: var(--muted); font-size: 11px; }
#favList .fav-del { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; }
#favList .fav-del:hover { color: var(--text); }
#npFav.on svg path { fill: url(#btnGrad); stroke: url(#btnGrad); }
#stationList .st-fav { color: #ff7fb6; font-size: 12px; flex: none; }

/* ---------- infobulles maison ---------- */
.tip {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  max-width: 260px; padding: 7px 11px; border-radius: 10px;
  font-size: 12px; line-height: 1.4; color: var(--text); letter-spacing: .01em;
  background: var(--glass-strong); backdrop-filter: blur(14px);
  border: 1px solid transparent;
  background-image: linear-gradient(var(--glass-strong), var(--glass-strong)), linear-gradient(120deg, rgba(255,217,142,.55), rgba(255,127,182,.55) 50%, rgba(79,227,255,.55));
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 8px 28px rgba(0,0,0,.45), 0 0 18px rgba(255,127,182,.12);
  opacity: 0; translate: 0 -4px; transition: opacity .16s ease, translate .16s ease;
}
.tip.above { translate: 0 4px; }
.tip.on { opacity: 1; translate: 0 0; }
.tip::after {
  content: ''; position: absolute; left: var(--ax, 50%); top: -4px; width: 7px; height: 7px; margin-left: -4px;
  background: #ff7fb6; opacity: .55; transform: rotate(45deg); border-radius: 1px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.tip.above::after { top: auto; bottom: -4px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.acc-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mini.danger { color: #ff9a9a; border-color: rgba(255,120,120,0.35); }
.mini.danger:hover { background: rgba(255,90,90,0.12); }
/* Équivalent texte de la galaxie : lisible par les lecteurs d'écran et les moteurs, invisible à l'écran. */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--text); background: var(--bg); z-index: 200; }

/* ---------- contrôles au dégradé (curseurs, cases, sources) ---------- */
.popover input[type=range] {
  -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; accent-color: auto;
  --p: 50%;
}
.popover input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, #ffd98e, #ff7fb6 calc(var(--p) * 0.5 + 25%), #4fe3ff) left / var(--p) 100% no-repeat, rgba(255,255,255,0.12);
}
.popover input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.12); }
.popover input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #ffd98e, #ff7fb6, #4fe3ff); }
.popover input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 2px #ff7fb6, 0 0 10px rgba(255,127,182,0.7);
}
.popover input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 2px #ff7fb6, 0 0 10px rgba(255,127,182,0.7); }
.popover input[type=range]:focus-visible { outline: none; }
.popover input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ff7fb6; }

.popover input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer;
  border-radius: 5px; border: 1.5px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.04);
  display: inline-grid; place-content: center; transition: background .15s, border-color .15s, box-shadow .15s;
}
.popover input[type=checkbox]::after {
  content: ''; width: 9px; height: 5px; margin-top: -2px; border: 2px solid #0b0716; border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0); transition: transform .15s;
}
.popover input[type=checkbox]:checked { border-color: transparent; background: var(--grad); box-shadow: 0 0 10px rgba(255,127,182,0.45); }
.popover input[type=checkbox]:checked::after { transform: rotate(-45deg) scale(1); }
.popover input[type=checkbox]:focus-visible { outline: 2px solid #ff7fb6; outline-offset: 2px; }

.src-opt:has(input:checked) .src-ico { color: #0b0716; background: var(--grad); box-shadow: 0 0 14px rgba(255,127,182,0.55); }
.src-opt:has(input:focus-visible) { outline-color: #ff7fb6; }
