/* Espace membres N&S Record : même style que le site public (noir et blanc, Archivo, JetBrains Mono). Connexion : login.css. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --bg: #050505;
  --panel: #0d0d0d;
  --panel-2: #161616;
  --fg: #f4f4f1;
  --muted: rgba(244, 244, 241, 0.56);
  --line: rgba(244, 244, 241, 0.12);
  --line-2: rgba(244, 244, 241, 0.26);
  --danger: #ff6b6b;
  --pad: clamp(16px, 3.2vw, 44px);
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.muted { color: var(--muted); }
.error { margin: 0; color: var(--danger); }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }
.ico { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
.ico svg { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------------ boutons et champs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.btn:hover { border-color: var(--fg); }
.btn .ico { width: 14px; height: 14px; }
.btn.solid { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn.solid:hover { background: transparent; color: var(--fg); }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 107, 0.35); }
.btn.danger:hover { border-color: var(--danger); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #0a0a0a; }
.btn.danger-solid:hover { background: transparent; color: var(--danger); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--fg); border-color: var(--line-2); }

.field { display: grid; gap: 8px; }
.field > span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea, .search {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus, .search:focus { border-color: var(--fg); }
.field textarea { resize: vertical; min-height: 84px; }

/* ------------------------------------------------------------------ en-tête */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mark { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; font-stretch: 118%; text-transform: uppercase; white-space: nowrap; }
.mark i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.crumbs a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.2s; }
.crumbs a:hover, .crumbs a[aria-current] { color: var(--fg); }
.crumbs .sep { opacity: 0.45; }
.menu { position: relative; margin-left: auto; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.me { display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 600; transition: border-color 0.2s; }
.me:hover, .menu[open] .me { border-color: var(--fg); }
.me .role { padding: 4px 9px; border-radius: 999px; background: var(--fg); color: var(--bg); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}
.menu-list button { all: unset; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--panel-2); }

/* ------------------------------------------------------------------ vues */
.view { padding: clamp(28px, 5vh, 52px) var(--pad) 160px; animation: view-in 0.5s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.kicker { margin: 0 0 14px; color: var(--muted); }
.page-title { margin: 0 0 clamp(32px, 6vh, 64px); font-size: clamp(2.2rem, 5.4vw, 5rem); font-weight: 280; line-height: 1; letter-spacing: -0.02em; }
.page-title strong { font-weight: 800; font-stretch: 112%; }
.empty { display: grid; justify-items: center; gap: 12px; padding: 72px 16px; text-align: center; }
.empty strong { font-size: 18px; }

/* Accueil : tuiles carrées */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 340px)); gap: 20px; }
.tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--panel);
  transition: border-color 0.4s, transform 0.6s var(--ease);
}
.tile:hover, .tile:focus-visible { border-color: var(--fg); transform: translateY(-4px); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(5, 5, 5, 0.9), rgba(5, 5, 5, 0.05) 65%); }
.tile-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  opacity: 0.32;
  filter: grayscale(1);
  transition: opacity 0.6s var(--ease), filter 0.6s, transform 0.9s var(--ease);
}
.tile-art.n1 { grid-template-columns: 1fr; }
.tile-art.n2 img { grid-row: span 2; }
.tile-art.n3 img:first-child { grid-row: span 2; }
.tile-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile:hover .tile-art { opacity: 0.6; filter: grayscale(0); transform: scale(1.04); }
.tile-index, .tile-count { position: absolute; top: 18px; color: var(--muted); }
.tile-index { left: 20px; }
.tile-count { right: 20px; }
.tile-name { position: absolute; left: 20px; bottom: 16px; font-size: clamp(2.6rem, 4.8vw, 4.1rem); font-weight: 800; font-stretch: 118%; line-height: 0.9; letter-spacing: -0.02em; text-transform: uppercase; }
.tile-arrow { position: absolute; right: 20px; bottom: 24px; transition: transform 0.45s var(--ease); }
.tile-arrow .ico { width: 24px; height: 24px; }
.tile:hover .tile-arrow { transform: translate(3px, -3px); }

/* Cover : barre d'outils et grille */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 32px; }
.toolbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.search { width: min(300px, 56vw); padding: 10px 16px; border-radius: 999px; }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(44%, 210px), 1fr)); gap: 30px 20px; }
.cover-card { position: relative; display: grid; gap: 3px; min-width: 0; }
.cover-art { position: relative; aspect-ratio: 1; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.cover-art img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.cover-card:hover .cover-art img { transform: scale(1.045); }
.cover-card:hover .cover-art { border-color: var(--line-2); }
.art-none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line-2); font-size: clamp(48px, 7vw, 96px); font-weight: 800; }
.cover-link { overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cover-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 14px; }
.cover-meta { color: var(--muted); font-size: 11px; }
.card-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.45s var(--ease);
}
.card-play .ico { width: 18px; height: 18px; }
.cover-card:hover .card-play, .card-play:focus-visible, .card-play.is-playing { opacity: 1; transform: none; }

/* Une cover */
.cover-head { display: grid; grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: end; margin-bottom: clamp(32px, 6vh, 60px); }
.cover-head-art { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel-2); }
.cover-head-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-title { margin: 0 0 16px; font-size: clamp(2.4rem, 6.5vw, 6.6rem); font-weight: 800; font-stretch: 112%; line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase; overflow-wrap: anywhere; }
.cover-comment { margin: 0 0 16px; max-width: 62ch; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; opacity: 0.88; }
.cover-meta-line { margin: 0 0 22px; color: var(--muted); }
.cover-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Explorateur de dossiers */
.browser { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(13, 13, 13, 0.7); }
.browser-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.browser-path { display: grid; min-width: 0; }
.browser-title { margin: 0; font-size: 18px; font-weight: 700; }
.browser-path .mono { font-size: 11px; }
.browser-bar > .btn { margin-left: auto; }
.rows { display: grid; }
.row { display: grid; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); transition: background-color 0.2s, box-shadow 0.2s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--panel-2); }
.row-folder { grid-template-columns: 44px minmax(0, 1fr) 90px 90px 20px; }
.row-file { grid-template-columns: 44px minmax(0, 1fr) 90px auto; }
.row.is-drop { background: rgba(244, 244, 241, 0.08); box-shadow: inset 0 0 0 1px var(--fg); }
.row-lead { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--panel-2); color: var(--muted); }
.row-folder .row-lead { color: var(--fg); }
.row-lead .ico { width: 20px; height: 20px; }
.row-main { display: grid; min-width: 0; }
.row-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.row-count, .row-date { color: var(--muted); font-size: 11px; }
.row-end { justify-self: end; color: var(--muted); transition: transform 0.3s var(--ease), color 0.2s; }
.row-folder:hover .row-end { color: var(--fg); transform: translateX(3px); }
.row-actions { display: flex; justify-self: end; gap: 2px; }
.row-play {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.row-play .ico { width: 16px; height: 16px; }
.row-play:hover, .row-play.is-playing { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.row-thumb { display: block; width: 44px; height: 44px; overflow: hidden; border-radius: 8px; background: var(--panel-2); }
.row-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.empty-drop { display: grid; justify-items: center; gap: 8px; margin: 16px; padding: 56px 20px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--muted); text-align: center; }
.empty-drop strong { color: var(--fg); font-size: 16px; }
.empty-drop .ico { width: 28px; height: 28px; color: var(--fg); }

/* Glisser-déposer et imports */
.drop-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(5, 5, 5, 0.74); backdrop-filter: blur(6px); pointer-events: none; }
.drop-overlay > div { display: grid; justify-items: center; gap: 10px; padding: 40px 56px; border: 1px dashed var(--fg); border-radius: 22px; text-align: center; }
.drop-overlay .mono { color: var(--muted); }
.drop-overlay strong { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; font-stretch: 112%; line-height: 1; text-transform: uppercase; }
.uploads {
  position: fixed;
  right: var(--pad);
  bottom: 24px;
  z-index: 45;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  max-height: 50vh;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.has-player .uploads { bottom: 112px; }
.upload { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 10px; font-size: 13px; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-state { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.upload .bar { grid-column: 1 / -1; height: 3px; overflow: hidden; border-radius: 3px; background: var(--line); }
.upload .bar span { display: block; width: 0; height: 100%; background: var(--fg); transition: width 0.2s; }
.upload.failed .upload-state { color: var(--danger); }
.upload.failed .bar span { width: 100%; background: var(--danger); }
.upload-x { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.upload-x .ico { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ fenêtres */
dialog.dlg {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: var(--panel);
  color: var(--fg);
}
dialog.dlg[open] { animation: dlg-in 0.35s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
dialog.dlg::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(4px); }
dialog.dlg-small { width: min(440px, calc(100vw - 24px)); }
.dlg-body { display: grid; gap: 18px; padding: 24px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-body h2 { margin: 0; font-size: 22px; font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; text-transform: uppercase; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.pick:hover, .pick.is-drop { border-color: var(--fg); background: var(--panel-2); }
.pick.is-set { border-style: solid; }
.pick-thumb { display: grid; place-items: center; flex: none; width: 64px; height: 64px; overflow: hidden; border-radius: 10px; background: var(--panel-2); color: var(--muted); }
.pick-thumb .ico { width: 24px; height: 24px; }
.pick-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pick-label { display: grid; gap: 3px; min-width: 0; }
.pick-name { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.create-progress { display: grid; gap: 10px; }
.msgs-list { display: grid; gap: 10px; max-height: 62vh; overflow: auto; }
.msg { display: grid; justify-items: start; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.msg-head a { text-decoration: underline; text-underline-offset: 3px; }
.msg-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tag { padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 999px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ------------------------------------------------------------------ lecteur */
.player {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 50;
  display: grid;
  grid-template-columns: 48px minmax(0, 1.2fr) 44px auto minmax(80px, 2fr) auto 38px;
  align-items: center;
  gap: 14px;
  width: min(1000px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: rgba(16, 16, 16, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
}
.player-art { display: block; width: 48px; height: 48px; overflow: hidden; border-radius: 10px; background: var(--panel-2); }
.player-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.player-info { display: grid; min-width: 0; }
.player-info strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.player-info span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.player-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); cursor: pointer; }
.player-btn .ico { width: 18px; height: 18px; }
.player-time { color: var(--muted); font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
#player-seek {
  --p: 0%;
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 4px;
  background: linear-gradient(to right, var(--fg) var(--p), var(--line-2) var(--p));
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
#player-seek::-webkit-slider-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--fg); -webkit-appearance: none; appearance: none; }
#player-seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--fg); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 70;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  animation: toast-in 0.35s var(--ease);
}
.has-player .toast { bottom: 108px; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ------------------------------------------------------------------ NS Tools (owner) */
.tile-tools { background: radial-gradient(120% 90% at 100% 0%, rgba(244, 244, 241, 0.07), transparent 60%), var(--panel); }
.tile-glyph { position: absolute; top: 52px; right: 18px; z-index: -1; color: var(--line-2); transition: color 0.5s var(--ease), transform 0.9s var(--ease); }
.tile-glyph .ico { width: 120px; height: 120px; }
.tile-tools:hover .tile-glyph { color: var(--muted); transform: rotate(-14deg) scale(1.05); }
.tile-foot { position: absolute; left: 20px; right: 60px; bottom: 16px; display: grid; gap: 14px; }
.tile-foot .tile-name { position: static; }
.tile-list { color: var(--muted); font-size: 10px; line-height: 1.6; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; max-width: 1300px; }
.tool-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  min-height: 250px;
  padding: 22px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--panel);
  transition: color 0.45s var(--ease), border-color 0.4s, transform 0.6s var(--ease);
}
.tool-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fg); transform: translateY(101%); transition: transform 0.6s var(--ease); }
.tool-card:hover, .tool-card:focus-visible { color: var(--bg); border-color: var(--fg); transform: translateY(-3px); }
.tool-card:hover::before, .tool-card:focus-visible::before { transform: translateY(0); }
.tool-index { color: var(--muted); transition: color 0.45s; }
.tool-icon .ico { width: 34px; height: 34px; }
.tool-name { font-size: 26px; font-weight: 800; font-stretch: 112%; line-height: 1; letter-spacing: -0.01em; text-transform: uppercase; }
.tool-desc { align-self: start; max-width: 36ch; color: var(--muted); font-size: 14px; transition: color 0.45s; }
.tool-card:hover .tool-desc, .tool-card:hover .tool-index { color: rgba(5, 5, 5, 0.62); }
.tool-arrow { position: absolute; top: 20px; right: 20px; transition: transform 0.45s var(--ease); }
.tool-arrow .ico { width: 20px; height: 20px; }
.tool-card:hover .tool-arrow { transform: translate(3px, -3px); }

.tool-head { margin-bottom: clamp(24px, 4vh, 40px); }
.tool-title { margin: 0 0 10px; font-size: clamp(2.4rem, 6vw, 5.4rem); font-weight: 800; font-stretch: 112%; line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase; }
.tool-lead { margin: 0; max-width: 62ch; color: var(--muted); font-size: 16px; }
.tool-panel { display: grid; gap: 22px; max-width: 1100px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 20px; background: rgba(13, 13, 13, 0.7); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 16px; border: 1px solid var(--line-2); border-radius: 999px; background: none; font-size: 14px; cursor: pointer; transition: background-color 0.25s, color 0.25s, border-color 0.25s; }
.chip:hover { border-color: var(--fg); }
.chip.is-on { border-color: var(--fg); background: var(--fg); color: var(--bg); }

.art-layout { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 24px; align-items: end; }
.art-stage { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.art-stage img { display: block; width: 100%; height: 100%; object-fit: cover; animation: view-in 0.5s var(--ease); }
.art-empty { display: grid; justify-items: center; gap: 12px; padding: 24px; color: var(--muted); text-align: center; }
.art-empty .ico { width: 36px; height: 36px; }
.art-side { display: grid; gap: 14px; }
.art-meta { margin: 0; }
.art-actions { display: flex; flex-wrap: wrap; gap: 10px; }
a.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.spinner { width: 26px; height: 26px; flex: none; border: 2px solid var(--line-2); border-top-color: var(--fg); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tool-drop { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; border: 1px dashed var(--line-2); border-radius: 16px; text-align: center; cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.tool-drop:hover, .tool-drop.is-drop { border-color: var(--fg); background: var(--panel-2); }
.tool-drop.is-set { border-style: solid; }
.tool-drop > .ico { width: 30px; height: 30px; }
.tool-drop strong { font-size: 17px; }
.drop-name { color: var(--muted); overflow-wrap: anywhere; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.pct-field { display: inline-flex; align-items: center; gap: 10px; }
.pct-field input { width: 92px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); text-align: right; outline: none; }
.pct-field input:focus { border-color: var(--fg); }
.tool-panel .upload { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.tool-result { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel-2); animation: view-in 0.4s var(--ease); }
.result-head { display: grid; gap: 2px; }
.result-head strong { font-size: 20px; }
.tool-result audio { width: 100%; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* TikTok song analyser */
.worker { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); font-size: 14px; }
.worker i { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15); }
.worker.is-on i { background: #3ddc97; box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15); }
.tt-form { display: flex; flex-wrap: wrap; gap: 10px; }
.tt-input { flex: 1 1 320px; min-width: 0; padding: 13px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); outline: none; }
.tt-input:focus { border-color: var(--fg); }
.tt-card { display: grid; gap: 16px; padding: 20px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel-2); animation: view-in 0.4s var(--ease); }
.tt-error strong { color: var(--danger); }
.tt-pending-head { display: flex; align-items: center; gap: 12px; }
.tt-card .bar { height: 3px; overflow: hidden; border-radius: 3px; background: var(--line); }
.tt-card .bar span { display: block; width: 0; height: 100%; background: var(--fg); transition: width 0.4s; }
.tt-sound { display: flex; align-items: center; gap: 16px; min-width: 0; }
.tt-cover { display: grid; place-items: center; flex: none; width: 76px; height: 76px; border-radius: 12px; background: var(--panel); color: var(--muted); object-fit: cover; }
.tt-sound-info { display: grid; gap: 4px; min-width: 0; }
.tt-sound-title { font-size: 20px; overflow-wrap: anywhere; }
.tt-open { display: inline-flex; align-items: center; gap: 6px; width: max-content; }
.tt-open .ico { width: 14px; height: 14px; }
.tt-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { display: grid; align-content: start; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.stat:first-child { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.stat:first-child .stat-label, .stat:first-child .stat-note { color: rgba(5, 5, 5, 0.6); }
.stat-label { color: var(--muted); font-size: 11px; }
.stat-value { font-size: clamp(24px, 3vw, 36px); font-weight: 800; font-stretch: 110%; line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-note { color: var(--muted); font-size: 12px; }
.section-label { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 400; }
.country-list { display: grid; gap: 8px; }
.country { display: grid; grid-template-columns: minmax(90px, 190px) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 14px; }
.country-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-bar { height: 8px; overflow: hidden; border-radius: 8px; background: var(--line); }
.country-fill { display: block; height: 100%; border-radius: 8px; background: var(--fg); }
.country-n { min-width: 104px; color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; }
.tt-note { margin: 0; color: var(--muted); font-size: 13px; }
.tt-history { max-width: 1100px; margin-top: 36px; }
.tt-history .rows { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.row-job { grid-template-columns: minmax(0, 1fr) 110px 70px 38px; }
.row-job.is-current { background: var(--panel-2); }

/* ------------------------------------------------------------------ petits écrans */
@media (max-width: 760px) {
  .art-layout { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .country { grid-template-columns: minmax(70px, 120px) minmax(0, 1fr) auto; gap: 8px; }
  .row-job { grid-template-columns: minmax(0, 1fr) auto 34px; }
  .row-job .row-date { display: none; }
  .tool-card { min-height: 210px; }
  .top { flex-wrap: wrap; gap: 10px 12px; padding-block: 12px; }
  .crumbs { order: 3; width: 100%; overflow-x: auto; }
  .me { padding: 5px 5px 5px 12px; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .search { flex: 1; width: auto; }
  .cover-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .cover-head-art { width: min(100%, 300px); }
  .row { gap: 12px; padding: 10px 14px; }
  .row-folder { grid-template-columns: 40px minmax(0, 1fr) auto 16px; }
  .row-file { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .row-folder .row-date, .row-file .row-date { display: none; }
  .row-lead, .row-play, .row-thumb { width: 40px; height: 40px; }
  .pick-row { grid-template-columns: minmax(0, 1fr); }
  .player { grid-template-columns: 40px minmax(0, 1fr) 44px 34px; gap: 10px; bottom: 10px; }
  .player-art { width: 40px; height: 40px; }
  .player-time { display: none; }
  #player-seek { grid-column: 1 / -1; order: 5; }
  .has-player .uploads { bottom: 132px; }
  .has-player .toast { bottom: 130px; }
  .card-play { opacity: 1; transform: none; width: 42px; height: 42px; }
}
@media (hover: none) {
  .card-play { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .view, dialog.dlg[open], .toast { animation: none; }
}
