/* Musique : thème sombre, PC (barre latérale + barre de lecture) et mobile (onglets + mini-lecteur). */

@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #121212;
  --panel: #181818;
  --panel-2: #1f1f1f;
  --hover: #2a2a2a;
  --line: #2e2e2e;
  --text: #fff;
  --muted: #b3b3b3;
  --dim: #7a7a7a;
  --accent: #1ed760;
  --accent-2: #1fdf64;
  --radius: 8px;
  --player-h: 80px;
  --tab-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.3, .7, .4, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: #000; color: var(--text);
  font: 14px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow: hidden; overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 20px; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
h3 { font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 48px 16px; }
.ic { fill: currentColor; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Mise en page PC ---------- */
.app {
  display: grid; height: 100dvh; gap: 8px; padding: 8px 8px 0;
  grid-template-columns: 300px minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) var(--player-h);
  grid-template-areas: "side main queue" "player player player";
}
.panel { background: var(--bg); border-radius: var(--radius); }
.sidebar { grid-area: side; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.nav a, .lib-head { display: flex; align-items: center; gap: 16px; padding: 10px 12px; border-radius: 6px; color: var(--muted); font-weight: 700; font-size: 15px; transition: color .2s; }
.nav a:hover, .lib-head:hover, .nav a.active, .lib-head.active { color: var(--text); }
.brand { color: var(--text) !important; margin-bottom: 4px; }
.brand .ic { color: var(--accent); }
.lib { flex: 1; padding: 8px 12px; overflow: auto; }
.lib-empty { color: var(--dim); font-size: 13px; padding: 0 12px; }

.main { grid-area: main; overflow-y: auto; overflow-x: hidden; position: relative; scroll-behavior: auto; }
.page { padding: 16px 24px 40px; position: relative; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page > * { position: relative; }
.page > .hero-grad { position: absolute; inset: 0 0 auto; height: 280px; background: linear-gradient(#1e3b2c, transparent); pointer-events: none; z-index: 0; }
.greeting { margin-top: 12px; }

.queue { grid-area: queue; width: 340px; overflow: hidden; display: flex; flex-direction: column; }
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 8px 16px; }
.queue-head h2 { font-size: 16px; }
.queue-body { overflow-y: auto; padding: 0 8px 16px; }
.queue-body h3 { padding: 0 8px; }
.queue-empty { color: var(--dim); padding: 8px; }

/* ---------- Boutons ---------- */
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); position: relative; transition: color .15s, transform .1s; }
.icon-btn:hover { color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.toggle.on { color: var(--accent); }
.icon-btn.toggle.on::after { content: ""; position: absolute; bottom: -2px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.icon-btn .one { display: none; position: absolute; top: 3px; right: 2px; font-size: 9px; background: var(--accent); color: #000; border-radius: 50%; width: 12px; height: 12px; line-height: 12px; text-align: center; }
.icon-btn.repeat-one .one { display: block; }
.icon-btn.big { width: 48px; height: 48px; color: var(--text); }
.play-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: #000; transition: transform .1s; }
.play-btn:hover { transform: scale(1.06); }
.play-btn:active { transform: scale(.95); }
.play-btn.huge { width: 68px; height: 68px; }
.play-btn .i-pause, body.playing .play-btn .i-play { display: none; }
body.playing .play-btn .i-pause { display: block; }
.link-btn { color: var(--muted); font-weight: 600; font-size: 13px; }
.link-btn:hover { color: var(--text); text-decoration: underline; }

/* ---------- Barres de défilement (range) ---------- */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; margin: 0; cursor: pointer; --p: 0%; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--p), #4d4d4d var(--p)); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--p), #4d4d4d var(--p)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; margin-top: -4px; opacity: 0; transition: opacity .15s; }
.range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; opacity: 0; }
.range:hover::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) var(--p), #4d4d4d var(--p)); }
.range:hover::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { opacity: 1; }
.range:hover::-moz-range-thumb { opacity: 1; }

/* ---------- Barre de lecture ---------- */
.player { grid-area: player; display: grid; grid-template-columns: minmax(180px, 30%) 1fr minmax(180px, 30%); align-items: center; padding: 0 8px; gap: 12px; background: #000; }
.pl-left { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.pl-art { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; background: var(--panel-2); }
.player[data-empty] .pl-art { visibility: hidden; }
.pl-meta { min-width: 0; }
.pl-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-artist { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-center { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 720px; width: 100%; justify-self: center; }
.pl-buttons { display: flex; align-items: center; gap: 16px; }
.pl-progress { display: flex; align-items: center; gap: 8px; width: 100%; }
.time { font-size: 11px; color: var(--muted); min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.pl-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.pl-right .volume { width: 100px; }
.i-mute, body.muted .i-vol { display: none; }
body.muted .i-mute { display: block; }
.mini-play, .mini-bar { display: none; }
.player.loading .pl-art { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .5; } }

/* ---------- Cartes et rayons ---------- */
.shelf { margin: 28px 0 8px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.shelf-more { color: var(--muted); font-weight: 700; font-size: 13px; }
.shelf-more:hover { text-decoration: underline; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); gap: 4px; overflow-x: auto; margin: 0 -12px; padding: 0 0 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }
@media (min-width: 1200px) { .shelf-row { grid-auto-columns: calc((100% - 20px) / 6); } }
.card { display: block; padding: 12px; border-radius: var(--radius); transition: background .2s; cursor: pointer; scroll-snap-align: start; min-width: 0; }
.card:hover { background: var(--panel-2); }
.card-art { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.5); color: var(--dim); margin-bottom: 8px; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-art.round { border-radius: 50%; overflow: visible; }
.card-art.round img { border-radius: 50%; }
.card-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-play { position: absolute; right: 8px; bottom: 8px; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; box-shadow: 0 8px 8px rgba(0,0,0,.3); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s var(--ease); }
.card:hover .card-play, .top-card:hover .card-play, .card.current .card-play { opacity: 1; transform: none; }

/* ---------- Listes de morceaux ---------- */
.tracks { list-style: none; margin: 0; padding: 0; }
.track { display: grid; grid-template-columns: 24px 40px minmax(0, 4fr) minmax(0, 3fr) 84px 32px; align-items: center; gap: 12px; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.tracks:not(:has(.n)) .track-n { display: none; }
.tracks:not(:has(.n)) .track { grid-template-columns: 40px minmax(0, 4fr) minmax(0, 3fr) 84px 32px; }
.tracks:has(.n) .track { grid-template-columns: 24px minmax(0, 4fr) minmax(0, 3fr) 84px 32px; }
.track:hover, .track:focus-visible { background: var(--hover); }
.track-art { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--panel-2); }
.track-n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.track-main { display: flex; flex-direction: column; min-width: 0; }
.track-title { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub, .track-album { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub a:hover, .track-album a:hover { color: var(--text); text-decoration: underline; }
.track-dur { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.track-more { opacity: 0; }
.track:hover .track-more { opacity: 1; }
.track.current .track-title { color: var(--accent); }
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; justify-content: flex-end; }
.eq i { width: 3px; background: var(--accent); animation: eq .9s infinite ease-in-out alternate; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { from { height: 3px; } to { height: 14px; } }
.track.current .eq { display: flex; }
.track.current .n { display: none; }
body:not(.playing) .eq i { animation-play-state: paused; }
.tracks.compact .track { grid-template-columns: 40px minmax(0, 1fr) 32px; padding: 6px 8px; }
.tracks.compact .track-album, .tracks.compact .track-dur, .tracks.compact .track-n { display: none; }

/* ---------- Recherche ---------- */
.search-box { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; max-width: 480px; height: 48px; padding: 0 8px 0 14px; margin: 0 0 20px; background: #242424; border-radius: 999px; border: 1px solid transparent; transition: border-color .2s, background .2s; color: var(--muted); }
.search-box:focus-within { border-color: #fff; background: #2a2a2a; }
.search-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 16px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.suggest { position: absolute; top: 54px; left: 0; right: 0; list-style: none; margin: 0; padding: 6px 0; background: #282828; border-radius: 8px; box-shadow: 0 16px 32px rgba(0,0,0,.6); }
.suggest:empty { display: none; }
.suggest li { padding: 10px 16px; color: var(--text); cursor: pointer; display: flex; gap: 12px; align-items: center; }
.suggest li:hover, .suggest li.sel { background: #3e3e3e; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.chip { padding: 6px 14px; border-radius: 999px; background: #2a2a2a; font-weight: 500; font-size: 13px; transition: background .15s; }
.chip:hover { background: #333; }
.chip.active { background: var(--text); color: #000; }
.search-top { display: grid; grid-template-columns: minmax(280px, 2fr) 3fr; gap: 24px; margin-bottom: 8px; }
.search-top h2, section > h2 { margin-bottom: 12px; }
.top-card { position: relative; display: block; padding: 20px; border-radius: var(--radius); background: var(--panel); transition: background .2s; cursor: pointer; min-height: 220px; }
.top-card:hover { background: var(--panel-2); }
.top-card img { width: 96px; height: 96px; border-radius: 6px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,.5); margin-bottom: 18px; }
.top-card img.round { border-radius: 50%; }
.top-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sub { color: var(--muted); margin-top: 4px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #121212; color: var(--text); font-size: 12px; font-weight: 700; margin-right: 6px; }
.top-card .card-play { right: 20px; bottom: 20px; }

/* ---------- Panneau « En cours de lecture » (plein écran) ---------- */
.np { position: fixed; inset: 0; z-index: 40; background: #121212; display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(100%); transition: transform .38s var(--ease); visibility: hidden; padding-top: var(--safe-t); }
.np.open { transform: none; visibility: visible; }
.np-bg { position: absolute; inset: -20%; background-size: cover; background-position: center; filter: blur(60px) saturate(1.4) brightness(.45); transform: scale(1.1); z-index: 0; transition: background-image .6s; }
.np-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0,0,0,.6)); }
.np > * { position: relative; z-index: 1; }
.np > .np-bg { position: absolute; z-index: 0; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.np-head .icon-btn { color: var(--text); width: 40px; height: 40px; }
.np-source { text-align: center; min-width: 0; display: flex; flex-direction: column; }
.np-source small { text-transform: uppercase; letter-spacing: .1em; font-size: 10px; color: var(--muted); }
.np-source span { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 480px); gap: 48px; padding: 16px 84px 32px; align-items: center; max-width: 1200px; width: 100%; margin: 0 auto; }
.np-art-wrap { display: grid; place-items: center; min-height: 0; height: 100%; }
.np-art { width: min(100%, 60vh); aspect-ratio: 1; object-fit: cover; border-radius: 10px; box-shadow: 0 24px 64px rgba(0,0,0,.6); transition: transform .35s var(--ease); }
body:not(.playing) .np-art { transform: scale(.92); }
.np-side { display: flex; flex-direction: column; gap: 18px; min-height: 0; max-height: 100%; }
.np-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-artist { color: var(--muted); font-size: 17px; }
.np-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.np-progress .range::-webkit-slider-thumb { opacity: 1; }
.np-buttons { display: flex; align-items: center; justify-content: space-between; }
.np-buttons .icon-btn.toggle { width: 44px; height: 44px; }
.np-lyrics { background: rgba(0,0,0,.25); border-radius: 12px; padding: 4px 18px 14px; overflow-y: auto; min-height: 120px; }

/* ---------- Divers ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 24px); transform: translate(-50%, 20px); background: #fff; color: #000; padding: 10px 16px; border-radius: 8px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); z-index: 60; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loadbar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 70; opacity: 0; transition: width .4s ease, opacity .3s; }
.loadbar.on { opacity: 1; width: 70%; transition: width 4s cubic-bezier(.1,.6,.3,1); }
.loadbar.done { opacity: 0; width: 100%; transition: width .2s, opacity .4s .2s; }
.tabbar { display: none; }

/* ---------- Tablette ---------- */
@media (max-width: 1100px) {
  .app { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .nav span, .lib-head span, .lib-empty { display: none; }
  .nav a, .lib-head { justify-content: center; padding: 12px 0; }
  .queue { width: 300px; }
  .search-top { grid-template-columns: 1fr; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  :root { --mini-h: 60px; }
  body { background: var(--bg); }
  .app { display: block; padding: 0; height: 100dvh; }
  .sidebar { display: none; }
  .main { position: fixed; inset: 0; border-radius: 0; padding-top: var(--safe-t);
    padding-bottom: calc(var(--tab-h) + var(--mini-h) + 16px + var(--safe-b)); }
  .page { padding: 12px 16px 24px; }
  h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  .shelf-row { grid-auto-columns: 42%; margin: 0 -8px; }
  .card { padding: 8px; }
  .card:hover { background: none; }
  .card-play { display: none; }
  .track { grid-template-columns: 48px minmax(0, 1fr) 32px !important; padding: 6px 0; gap: 12px; }
  .track:hover { background: none; }
  .track:active { background: var(--hover); }
  .track-art { width: 48px; height: 48px; }
  .track-album, .track-end, .tracks .track-n { display: none !important; }
  .tracks:has(.n) .track { grid-template-columns: minmax(0, 1fr) 32px !important; }
  .track-more { opacity: 1; }
  .search-box { max-width: none; }
  .top-card { min-height: 0; display: flex; align-items: center; gap: 14px; padding: 12px; }
  .top-card img { width: 64px; height: 64px; margin: 0; }
  .top-title { font-size: 18px; }
  .top-card .card-play { display: none; }

  /* Mini-lecteur au-dessus des onglets */
  .player { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tab-h) + var(--safe-b) + 4px); height: var(--mini-h); z-index: 20;
    display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: #2b2b2b;
    box-shadow: 0 8px 24px rgba(0,0,0,.5); overflow: hidden; transition: transform .3s var(--ease), opacity .3s; }
  .player[data-empty] { transform: translateY(20px); opacity: 0; pointer-events: none; }
  .pl-left { flex: 1; }
  .pl-art { width: 44px; height: 44px; }
  .pl-center, .pl-right { display: none; }
  .mini-play { display: grid; background: none; color: var(--text); width: 40px; height: 40px; }
  .mini-bar { display: block; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: rgba(255,255,255,.2); border-radius: 1px; }
  .mini-bar i { display: block; height: 100%; width: var(--p, 0%); background: #fff; border-radius: 1px; }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: linear-gradient(rgba(0,0,0,.6), #000 60%); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; }
  .tabbar a.active { color: var(--text); }

  .queue { position: fixed; inset: 0; z-index: 50; width: auto; border-radius: 0; padding-top: var(--safe-t); padding-bottom: var(--safe-b);
    animation: slideup .3s var(--ease); }
  @keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }

  .np-body { grid-template-columns: 1fr; grid-template-rows: auto auto; gap: 24px; padding: 8px 24px calc(24px + var(--safe-b)); overflow-y: auto; align-items: start; }
  .np-art-wrap { height: auto; }
  .np-art { width: 100%; max-width: 420px; }
  .np-title { font-size: 22px; }
  .np-artist { font-size: 15px; }
  .np-lyrics { min-height: 200px; max-height: 60vh; }
  .lyr p { font-size: 20px; }
  .hero { flex-direction: column; align-items: center; text-align: center; min-height: 0; padding-top: 8px; gap: 16px; }
  .hero-art { width: min(64vw, 260px); height: min(64vw, 260px); }
  .hero-title { font-size: 28px; -webkit-line-clamp: 3; }
  .hero-text { align-items: center; }
  .hero-meta { justify-content: center; }
  .hero.artist .hero-title { font-size: 34px; }
  .actions { justify-content: flex-end; flex-direction: row-reverse; padding: 4px 0 12px; }
  .toast { bottom: calc(var(--tab-h) + var(--mini-h) + 20px + var(--safe-b)); }
}

/* ---------- En-têtes album / artiste / playlist ---------- */
.page > .hero-bg { position: absolute; inset: 0 0 auto; height: 420px; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center; filter: blur(70px) saturate(1.6) brightness(.55); opacity: .9;
  -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); transform: scale(1.2); }
.hero { display: flex; align-items: flex-end; gap: 24px; padding: 24px 0 20px; min-height: 260px; }
.hero-art { width: 232px; height: 232px; object-fit: cover; border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,.55); flex: none; background: var(--panel-2); }
.hero-art.round { border-radius: 50%; }
.hero-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hero-kind { font-size: 13px; font-weight: 600; }
.hero-title { font-size: clamp(32px, 6vw, 84px); line-height: 1; letter-spacing: -.04em; margin: 4px 0 8px; font-weight: 800;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.hero-desc { color: var(--muted); margin: 0; font-size: 13px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; color: #ddd; }
.hero-meta .strong { font-weight: 700; color: var(--text); }
.hero-meta a:hover { text-decoration: underline; }
.actions { display: flex; align-items: center; gap: 20px; padding: 16px 0 20px; }
.play-btn.accent { width: 56px; height: 56px; background: var(--accent); }
.play-btn.accent:hover { background: var(--accent-2); }
.icon-btn.lg { width: 44px; height: 44px; }
.about { color: var(--muted); white-space: pre-line; max-width: 800px; margin: 24px 0; font-size: 14px; }
.track.unavailable { opacity: .4; pointer-events: none; }
.card-play { cursor: pointer; }
.card-play:hover { transform: scale(1.06) !important; background: var(--accent-2); }

/* ---------- Paroles ---------- */
.np-lyrics { scroll-behavior: smooth; position: relative; }
.np-lyrics h3 { padding: 12px 0 4px; margin: 0; }
.lyr { padding: 8px 0 40%; }
.lyr p { margin: 0; padding: 6px 0; font-size: 22px; font-weight: 700; line-height: 1.3; color: rgba(255,255,255,.42);
  transition: color .3s, transform .3s var(--ease); transform-origin: left center; letter-spacing: -.01em; }
.lyr.synced p { cursor: pointer; }
.lyr.synced p:hover { color: rgba(255,255,255,.75); }
.lyr p.past { color: rgba(255,255,255,.7); }
.lyr p.on { color: #fff; transform: scale(1.03); }
.lyr p.gap { font-size: 14px; letter-spacing: .4em; }
.lyr.plain p { color: #fff; font-size: 18px; font-weight: 600; cursor: default; }
.lyr-src { color: var(--muted); font-size: 12px; margin-top: 16px; }
.np-lyrics .muted { margin: 8px 0 16px; }

/* ---------- Bibliothèque ---------- */
.lib { display: flex; flex-direction: column; min-height: 0; }
.lib-top { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.side-lists { list-style: none; margin: 8px 0 0; padding: 0; overflow-y: auto; }
.side-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; }
.side-item:hover { background: var(--panel-2); }
.side-item.active { background: var(--hover); }
.side-art { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; background: var(--panel-2); display: grid; place-items: center; color: var(--dim); flex: none; }
.side-text { min-width: 0; display: flex; flex-direction: column; }
.side-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item.active .side-title { color: var(--accent); }
.side-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liked-art { background: linear-gradient(135deg, #450af5, #8e8ee5) !important; color: #fff !important; display: grid; place-items: center; }
.hero-grad.liked { background: linear-gradient(#3b2a7a, transparent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; margin: 0 -12px; }
.new-card { text-align: left; width: 100%; }
.new-card .card-art { background: var(--panel-2); color: var(--muted); box-shadow: none; border: 2px dashed #3a3a3a; }
.new-card:hover .card-art { color: var(--text); border-color: #666; }
.collage { width: 100%; height: 100%; display: grid; grid-template-columns: 1fr 1fr; place-items: center; color: var(--dim); background: var(--panel-2); }
.collage img { width: 100%; height: 100%; object-fit: cover; }
.collage img.one { grid-column: 1 / -1; grid-row: 1 / -1; }
.collage:not(:has(img)) { grid-template-columns: 1fr; }
.hero-art .collage { border-radius: 6px; overflow: hidden; }
.hero-art:has(.collage) { display: block; }
.editable { cursor: pointer; }
.editable:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* J'aime */
.track-end { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.like-btn .i-on, .like-btn.liked .i-off { display: none; }
.like-btn.liked .i-on { display: block; }
.like-btn.liked { color: var(--accent); }
.track .like-btn { opacity: 0; }
.track:hover .like-btn, .track .like-btn.liked { opacity: 1; }
.pl-left .like-btn { flex: none; }
.player[data-empty] .like-btn { display: none; }
.np-meta { display: flex; align-items: center; gap: 4px; }
.np-meta-text { flex: 1; min-width: 0; }

/* Menu ⋯ */
.menu-backdrop { position: fixed; inset: 0; z-index: 80; }
.menu { position: fixed; z-index: 81; min-width: 230px; max-width: 320px; max-height: min(70vh, 480px); overflow-y: auto; padding: 4px; border-radius: 6px;
  background: #282828; box-shadow: 0 16px 24px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04); animation: pop .14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; padding: 11px 12px; border-radius: 3px; font-size: 14px; }
.menu button:hover { background: #3e3e3e; }
.menu hr { border: 0; border-top: 1px solid #3e3e3e; margin: 4px 0; }
.menu hr:last-child, .menu hr + hr { display: none; }
.menu .chev { color: var(--muted); font-size: 18px; line-height: 1; }
.menu-empty { color: var(--muted); padding: 8px 12px; margin: 0; }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 8px 12px 14px; border-bottom: 1px solid #3e3e3e; margin-bottom: 4px; }
.menu-head img { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; }
.menu-head .t { font-weight: 700; } .menu-head .s { color: var(--muted); font-size: 13px; }
.menu.sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; max-width: none; max-height: 75vh; border-radius: 14px 14px 0 0;
  padding: 10px 8px calc(16px + var(--safe-b)); animation: slideup .25s var(--ease); }
.menu.sheet button { padding: 14px 12px; font-size: 16px; }
.menu-backdrop:has(+ .menu.sheet) { background: rgba(0,0,0,.6); }

/* Boîte de dialogue */
.dlg { border: 0; border-radius: 10px; padding: 0; background: #282828; color: var(--text); width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 48px rgba(0,0,0,.6); }
.dlg::backdrop { background: rgba(0,0,0,.65); }
.dlg form { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { font-size: 22px; }
.dlg p { margin: 0; }
.dlg label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.dlg input, .dlg textarea { font: inherit; font-size: 16px; color: var(--text); background: #3e3e3e; border: 1px solid transparent; border-radius: 4px; padding: 10px 12px; outline: 0; resize: vertical; }
.dlg input:focus, .dlg textarea:focus { border-color: #888; background: #333; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.btn { padding: 10px 24px; border-radius: 999px; background: var(--text); color: #000; font-weight: 700; transition: transform .1s; }
.btn:hover { transform: scale(1.04); }
.btn.ghost { background: none; color: var(--text); }
.btn.danger { background: #f15e6c; color: #000; }

/* ---------- Connexion ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn.small { padding: 7px 16px; font-size: 13px; border: 1px solid #555; }
.btn.small:hover { border-color: #fff; }
.login-page { overflow: auto; background: linear-gradient(#1e3b2c, #121212 55%); min-height: 100dvh; }
.login { max-width: 360px; margin: 0 auto; padding: calc(48px + var(--safe-t)) 24px 48px; display: flex; flex-direction: column; gap: 28px; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-logo img { border-radius: 18px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.login-logo h1 { margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.login-form input:not([type=checkbox]) { font: inherit; font-size: 16px; color: var(--text); background: #121212; border: 1px solid #727272; border-radius: 6px; padding: 12px 14px; outline: 0; transition: border-color .15s; }
.login-form input:focus { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.login-remember { flex-direction: row !important; align-items: center; font-weight: 500 !important; color: var(--muted); }
.login-remember input { accent-color: var(--accent); width: 18px; height: 18px; }
.accent-btn { background: var(--accent); padding: 14px; font-size: 16px; margin-top: 8px; }
.accent-btn:disabled { opacity: .5; transform: none; cursor: not-allowed; }
.login-error { margin: 0; padding: 12px 14px; border-radius: 6px; background: #e91429; color: #fff; font-weight: 600; }
.offline-banner { position: fixed; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 90; background: #e9a100; color: #000; font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px; }

/* La zone centrale rétrécit quand la file d'attente est ouverte : on s'adapte à sa largeur réelle */
.main { container-type: inline-size; }
@container (max-width: 860px) {
  .search-top { grid-template-columns: 1fr; }
  .track, .tracks:not(:has(.n)) .track { grid-template-columns: 40px minmax(0, 1fr) 84px 32px; }
  .tracks:has(.n) .track { grid-template-columns: 24px minmax(0, 1fr) 84px 32px; }
  .track-album { display: none; }
  .shelf-row { grid-auto-columns: minmax(150px, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Mobile, en dernier pour passer devant les règles PC des en-têtes et de la bibliothèque */
@media (max-width: 767px) {
  .hero { flex-direction: column; align-items: center; text-align: center; min-height: 0; padding-top: 8px; gap: 16px; }
  .hero-art { width: min(64vw, 260px); height: min(64vw, 260px); }
  .hero-text { align-items: center; }
  .hero-meta { justify-content: center; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 -8px; }
  .track .like-btn { opacity: 1; }
}

/* ---------- Téléchargements ---------- */
.dl-art { background: linear-gradient(135deg, #0d7a3e, #1ed760) !important; color: #fff !important; display: grid; place-items: center; }
.hero-grad.dl { background: linear-gradient(#0f4d2a, transparent); }
.dl-folder { font-size: 12px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.icon-btn.dl-all.on { color: var(--accent); }
/* Petite flèche verte devant l'artiste des titres téléchargés */
.track.dl-done .track-sub::before, .track.dl-busy .track-sub::before {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v8.2l3-3 1.4 1.4L12 17l-5.4-5.4L8 10.2l3 3z'/%3E%3C/svg%3E") center / 11px no-repeat; }
.track.dl-busy .track-sub::before { background-color: #777; animation: pulse 1s infinite alternate; }
.dl-list { list-style: none; margin: 0; padding: 0; }
.dl-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 32px; gap: 12px; align-items: center; padding: 6px 12px; border-radius: 6px; }
.dl-row .track-art { width: 40px; height: 40px; }
.dl-bar { display: block; height: 3px; background: #3a3a3a; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.dl-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s; }
.dl-row[data-dl-status=error] .dl-bar { display: none; }
.dl-err { color: #f15e6c; }
@media (max-width: 767px) {
  .dl-row { grid-template-columns: 48px minmax(0, 1fr) auto 32px; padding: 6px 0; }
  .dl-row .track-art { width: 48px; height: 48px; }
}

/* ---------- Barre du haut : retour / suivant ---------- */
.topbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 24px;
  transition: background .2s; pointer-events: none; }
.topbar.scrolled { background: rgba(18,18,18,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.nav-btn { pointer-events: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.7); color: var(--text); transition: transform .1s, opacity .2s; }
.nav-btn:hover:not(:disabled) { transform: scale(1.06); }
.nav-btn:disabled { opacity: .35; cursor: default; }
.page { padding-top: 0; }
.search-box { top: 56px; }
.menu-backdrop { cursor: pointer; }
.menu .menu-close { justify-content: center; color: var(--muted); font-weight: 600; margin-top: 4px; border-top: 1px solid #3e3e3e; border-radius: 0; }
@media (max-width: 767px) {
  .topbar { height: 48px; padding: 0 12px; }
  .topbar .fwd { display: none; }
  .topbar.empty, .topbar.no-back { display: none; }
  .nav-btn { width: 36px; height: 36px; }
  .search-box { top: 48px; }
  .topbar.no-back ~ .page .search-box { top: 0; }
}
/* Les dégradés de haut de page passent derrière la barre du haut */
.page > .hero-grad, .page > .hero-bg { top: -56px; }
@media (max-width: 767px) { .page > .hero-grad, .page > .hero-bg { top: -48px; } }

/* =====================================================================
   Design v2 : tailles harmonisées, barre de navigation iOS, bibliothèque en liste.
   (En fin de fichier pour passer devant les règles précédentes.)
   ===================================================================== */

/* Barre du haut : retour / suivant + titre de la page au défilement */
.topbar { gap: 8px; }
.topbar-title { position: absolute; left: 50%; transform: translateX(-50%); max-width: 60%; font-weight: 700; font-size: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; pointer-events: none; }
.topbar.titled .topbar-title { opacity: 1; }
.nav-btn { width: 32px; height: 32px; }

/* Les icônes dessinées en grand dans les gabarits sont ramenées à des tailles raisonnables */
.actions .icon-btn.lg { width: 40px; height: 40px; }
.actions .icon-btn.lg svg { width: 24px; height: 24px; }
.actions .play-btn.accent { width: 52px; height: 52px; }
.actions .play-btn.accent svg { width: 24px; height: 24px; }
.hero-art.liked-art svg, .hero-art.dl-art svg, .hero-art.device-art svg { width: 72px; height: 72px; }
.hero-art { width: 200px; height: 200px; }
.hero-title { font-size: clamp(30px, 5vw, 64px); }

/* Bibliothèque : tuiles sur PC, liste sur mobile */
.page-head { margin: 4px 0 12px; }
.page-head h1 { margin: 0; }
.page-head-actions { display: flex; align-items: center; gap: 8px; }
.lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; margin: 0 -12px 8px; }
.lib-item { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px; text-align: left;
  transition: background .2s; min-width: 0; width: 100%; cursor: pointer; }
.lib-item:hover { background: var(--panel-2); }
.lib-art { position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; display: grid; place-items: center;
  background: var(--panel-2); color: var(--dim); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.lib-art img { width: 100%; height: 100%; object-fit: cover; }
.lib-art svg { width: 44px; height: 44px; }
.lib-new .lib-art { box-shadow: none; border: 2px dashed #3a3a3a; }
.lib-text { display: flex; flex-direction: column; min-width: 0; }
.lib-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-play { position: absolute; right: 20px; top: calc(12px + (100% - 24px) * 0); width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #000; display: grid; place-items: center; opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .2s var(--ease); box-shadow: 0 8px 8px rgba(0,0,0,.3); }
.lib-item:hover .lib-play { opacity: 1; transform: none; }
.device-art { background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important; color: #fff !important; }
.side-art.device-art { display: grid; place-items: center; }

@media (max-width: 767px) {
  :root { --tab-h: 52px; --mini-h: 56px; }

  /* Navigation iOS : chevron sans cercle, titre centré au défilement */
  .topbar { height: 44px; padding: 0 4px; }
  .topbar.scrolled { background: #121212; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
  .nav-btn { width: 40px; height: 40px; background: none; }
  .nav-btn svg { width: 24px; height: 24px; }
  .search-box { top: 44px; height: 44px; margin-bottom: 14px; }

  /* Typographie */
  h1 { font-size: 26px; margin: 4px 0 14px; }
  h2 { font-size: 19px; }
  .page { padding: 4px 16px 24px; }
  .greeting { margin-top: 8px; }

  /* Rayons de cartes */
  .shelf { margin: 22px 0 4px; }
  .shelf-head { margin-bottom: 6px; }
  .shelf-row { grid-auto-columns: 140px; gap: 2px; }
  .card { padding: 6px; }
  .card-art { margin-bottom: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
  .card-title { font-size: 13px; }
  .card-sub { font-size: 12px; }
  .chip { padding: 6px 12px; }

  /* En-têtes album / artiste / playlist */
  .hero { gap: 12px; padding: 4px 0 6px; }
  .hero-art { width: min(56vw, 230px); height: min(56vw, 230px); }
  .hero.artist .hero-art { width: min(48vw, 200px); height: min(48vw, 200px); }
  .hero-title { font-size: 26px; margin: 2px 0 4px; }
  .hero.artist .hero-title { font-size: 30px; }
  .hero-kind { font-size: 12px; }
  .hero-meta { font-size: 13px; }
  .hero-art.liked-art svg, .hero-art.dl-art svg, .hero-art.device-art svg { width: 56px; height: 56px; }
  .actions { gap: 14px; padding: 6px 0 10px; }

  /* Bibliothèque en liste */
  .lib-list { grid-template-columns: 1fr; gap: 0; margin: 0 0 8px; }
  .lib-item { flex-direction: row; align-items: center; gap: 12px; padding: 8px 0; border-radius: 0; }
  .lib-item:hover { background: none; }
  .lib-item:active { background: var(--hover); }
  .lib-art { width: 60px; height: 60px; flex: none; border-radius: 4px; box-shadow: none; }
  .lib-art svg { width: 26px; height: 26px; }
  .lib-new .lib-art { border-width: 1.5px; }
  .lib-title { font-size: 15px; font-weight: 500; }
  .lib-play { display: none; }
  .page-head .btn.small { padding: 6px 12px; font-size: 12px; }

  /* Lignes de morceaux */
  .track-art { width: 46px !important; height: 46px !important; }
  .track { grid-template-columns: 46px minmax(0, 1fr) 36px !important; }
  .track-title { font-size: 15px; }

  /* Onglets et mini-lecteur */
  .tabbar a { font-size: 10px; gap: 3px; }
  .tabbar svg { width: 24px; height: 24px; }
  .player { border-radius: 10px; }
  .pl-art { width: 40px; height: 40px; }
  .pl-title { font-size: 14px; }

  /* Plein écran « En cours de lecture » (iPhone 16 Pro Max : 430 × 932) */
  .np-head { padding: 6px 12px; }
  .np-body { gap: 18px; padding: 4px 24px calc(20px + var(--safe-b)); }
  .np-art { max-width: 360px; margin: 0 auto; }
  .np-title { font-size: 22px; }
  .np-buttons .icon-btn.big svg { width: 32px; height: 32px; }
  .np-buttons .play-btn.huge { width: 64px; height: 64px; }
}

/* Petits iPhone (SE, mini) */
@media (max-width: 380px) {
  .shelf-row { grid-auto-columns: 124px; }
  .hero-title { font-size: 22px; }
}
.lib-play { top: auto; right: 8px; bottom: 8px; }
.lib-play svg { width: 20px !important; height: 20px !important; }

/* Hors connexion (sur cet appareil) */
.hero-grad.device { background: linear-gradient(#1e3a8a, transparent); }
.icon-btn.on[data-action=device-all] { color: #60a5fa; }
.track.dev-done .track-title::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 6px; vertical-align: -1px;
  background: #60a5fa; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 2h8a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm0 3v13h8V5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 2h8a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm0 3v13h8V5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.notice { background: #1f2937; border: 1px solid #374151; border-radius: 10px; padding: 14px 16px; margin: 8px 0 16px; color: #d1d5db; font-size: 14px; line-height: 1.5; }
.notice code { background: #111827; padding: 1px 5px; border-radius: 4px; }

/* =====================================================================
   Comptes et administration
   ===================================================================== */
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #1ed760, #0d7a3e); color: #000; font-weight: 800; font-size: 15px; }
.avatar.big { width: 64px; height: 64px; font-size: 26px; }
.avatar-btn { display: inline-flex; border-radius: 50%; }
.avatar-btn .avatar { width: 32px; height: 32px; font-size: 14px; }
.badge.role-admin { background: rgba(250, 204, 21, .15); color: #facc15; }
.badge.role-user { background: rgba(255,255,255,.08); color: var(--muted); }
.badge.state-on { background: rgba(30, 215, 96, .14); color: var(--accent); }
.badge.state-off { background: rgba(241, 94, 108, .15); color: #f15e6c; }
.badge { margin-right: 0; font-weight: 700; font-size: 11px; padding: 3px 8px; }
.tag { font-size: 11px; font-weight: 700; color: #000; background: var(--text); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 6px 0 8px; }
.stat-grid.small { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--panel); border: 1px solid #262626; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-icon { color: var(--accent); display: flex; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-value small { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-grid.small .stat { align-items: center; text-align: center; padding: 12px 8px; }
.stat-grid.small .stat-value { font-size: 22px; }

.user-list { display: flex; flex-direction: column; gap: 6px; }
.user-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 36px; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid #262626; border-radius: 12px; padding: 12px 10px 12px 14px; }
.user-row .avatar { width: 40px; height: 40px; }
.user-row.inactive { opacity: .6; }
.user-row.inactive .avatar { background: #444; color: #ddd; }
.user-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-badges { display: flex; gap: 6px; margin: 4px 0; flex-wrap: wrap; }
.user-stats { font-size: 12.5px; line-height: 1.4; }
.small-text { font-size: 12.5px; margin-top: 18px; }
.btn.accent-small { background: var(--accent); color: #000; border: 0; display: inline-flex; align-items: center; gap: 6px; }
.btn.accent-small:hover { background: var(--accent-2); }
.menu button.danger-item { color: #f15e6c; }

.account-card { display: flex; align-items: center; gap: 16px; padding: 8px 0 18px; }
.account-name { font-size: 22px; font-weight: 800; }
.account-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 13px; }
.settings-link { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid #262626; border-radius: 12px;
  padding: 14px 14px; margin: 14px 0; }
.settings-link:hover { background: var(--panel-2); }
.settings-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(250,204,21,.12); color: #facc15; flex: none; }
.settings-text { flex: 1; display: flex; flex-direction: column; font-size: 13px; }
.settings-text strong { font-size: 15px; }
.form-card { background: var(--panel); border: 1px solid #262626; border-radius: 12px; padding: 18px 16px; margin: 14px 0; max-width: 520px; }
.form-card h2 { font-size: 17px; margin-bottom: 12px; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form label, .dlg label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stack-form input, .dlg select { font: inherit; font-size: 16px; color: var(--text); background: #2a2a2a; border: 1px solid #3a3a3a; border-radius: 8px; padding: 11px 12px; outline: 0; }
.stack-form input:focus, .dlg select:focus { border-color: #888; }
.stack-form .btn { align-self: flex-start; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; }
.flash { padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; margin: 0 0 12px; }
.flash.ok { background: rgba(30,215,96,.14); color: var(--accent); }
.flash.error { background: rgba(241,94,108,.15); color: #f87171; }
#dlg-text { white-space: pre-line; }
.btn.outline { border: 1px solid #555; }
.btn.wide { width: 100%; max-width: 520px; padding: 12px; }
.logout-form { margin: 8px 0 24px; }

@media (max-width: 767px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 24px; }
  .page-head .btn.accent-small span { display: none; }
  .page-head .btn.accent-small { padding: 8px; border-radius: 50%; }
  .form-card { padding: 16px 14px; }
}
.small-text { overflow-wrap: anywhere; }
