/* NeoOne : console de studio. Encre bleue, papier froid, logos des radios. */
:root {
  --paper: #F2F4F7;
  --panel: #FFFFFF;
  --panel-2: #F7F8FA;
  --text: #14213D;
  --muted: #5B6578;
  --line: #DCE1E8;
  --ink: #14213D;          /* barre latérale et boutons */
  --ink-soft: #2B3A5C;
  --ink-text: #C9D2E3;
  --accent-btn: #14213D;
  --accent-btn-text: #FFFFFF;
  --onair: #E5322D;
  --wave: #2B3A5C; --wave-dim: #C3CAD6;
  --error-bg: #FDECEC; --error-text: #8A1C18;
  --radius-s: 6px;
  --radius-l: 14px;
  --font: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-cond: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1424; --panel: #151E33; --panel-2: #1A2540; --text: #E6EBF5; --muted: #93A0B8;
    --line: #26324D; --ink: #080D19; --ink-soft: #1B2640; --accent-btn: #E6EBF5; --accent-btn-text: #0D1424;
    --error-bg: #3A1716; --error-text: #FFB4AE; color-scheme: dark;
    --wave: #C9D2E3; --wave-dim: #3A4766;
  }
}
:root[data-theme="dark"] {
  --wave: #C9D2E3; --wave-dim: #3A4766;
  --paper: #0D1424; --panel: #151E33; --panel-2: #1A2540; --text: #E6EBF5; --muted: #93A0B8;
  --line: #26324D; --ink: #080D19; --ink-soft: #1B2640; --accent-btn: #E6EBF5; --accent-btn-text: #0D1424;
  --error-bg: #3A1716; --error-text: #FFB4AE; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: var(--font-cond); font-weight: 600; line-height: 1.1; margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #4C7DFF; outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Logos : version couleur en clair, version blanche en sombre */
.logo-white { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-color { display: none; }
  :root:not([data-theme="light"]) .logo-white { display: inline; }
}
:root[data-theme="dark"] .logo-color { display: none; }
:root[data-theme="dark"] .logo-white { display: inline; }

/* Wordmark */
.wordmark {
  font-family: var(--font-cond); font-weight: 700;
  font-size: clamp(3.5rem, 8vw, 6rem); letter-spacing: -0.02em; line-height: 0.9;
  margin: 0; color: #fff; text-decoration: none; display: inline-block;
}
.wordmark span { color: transparent; -webkit-text-stroke: 2px #fff; }
.wordmark-small { font-size: 2.25rem; }
.wordmark-small span { -webkit-text-stroke-width: 1.2px; }

/* Boutons */
.btn-primary {
  font: inherit; font-weight: 600; padding: 0.75rem 1.1rem;
  border: 0; border-radius: var(--radius-s);
  background: var(--accent-btn); color: var(--accent-btn-text); cursor: pointer;
}
.btn-primary:hover { opacity: 0.88; }
.btn-ghost {
  font: inherit; font-size: 0.9rem; padding: 0.35rem 0.6rem;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-link {
  font: inherit; font-size: 0.9rem; padding: 0; border: 0; background: none;
  color: var(--ink-text); text-decoration: underline; cursor: pointer;
}
.btn-link:hover { color: #fff; }

/* ---------- Connexion ---------- */
.login { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; min-height: 100vh; }
.login-console {
  background: #14213D; color: var(--ink-text);
  padding: clamp(2rem, 6vw, 5rem);
  display: flex; flex-direction: column; justify-content: space-between; gap: 3rem;
}
.logo-wall {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1.75rem 1.5rem; align-items: center;
}
.logo-wall img { display: block; width: 100%; max-width: 150px; opacity: 0.92; }
.login-form-wrap { display: grid; place-items: center; padding: 2rem; }
.login-form { width: 100%; max-width: 360px; display: grid; gap: 0.5rem; }
.login-form h1 { font-size: 2.5rem; margin-bottom: 1.25rem; }
.login-form label { font-weight: 500; font-size: 0.95rem; margin-top: 0.75rem; }
.login-form input, .search input {
  font: inherit; padding: 0.75rem 0.9rem;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); color: var(--text);
}
.login-form .btn-primary { margin-top: 1.5rem; padding: 0.85rem 1rem; }
.form-error {
  margin: 0 0 0.5rem; padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--onair); background: var(--error-bg); color: var(--error-text);
  border-radius: var(--radius-s);
}

/* ---------- Application ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink); color: var(--ink-text);
  padding: 1.75rem 1.25rem; display: flex; flex-direction: column; gap: 2rem;
  position: sticky; top: 0; height: 100vh;
}
.nav { display: grid; gap: 0.15rem; }
.nav a, .nav-soon { padding: 0.55rem 0.75rem; border-radius: var(--radius-s); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--ink-soft); color: #fff; }
.nav a.is-active { background: #fff; color: #14213D; }
.nav-soon { color: #6F7C96; cursor: default; }
.sidebar-user { margin-top: auto; border-top: 1px solid var(--ink-soft); padding-top: 1rem; }
.theme-toggle {
  font: inherit; font-size: 0.85rem; margin-bottom: 1rem; padding: 0.35rem 0.6rem;
  background: transparent; color: var(--ink-text); border: 1px solid var(--ink-soft);
  border-radius: var(--radius-s); cursor: pointer;
}
.theme-toggle:hover { color: #fff; border-color: #6F7C96; }
.user-name { margin: 0; color: #fff; font-weight: 600; }
.user-role { margin: 0 0 0.5rem; font-size: 0.9rem; }

.content { padding: clamp(1.5rem, 4vw, 3rem); min-width: 0; }
.page-head h1 { font-size: 3rem; margin-bottom: 2rem; }
.block { margin-bottom: 2.75rem; max-width: 1100px; }
.block h2 { font-size: 1.6rem; margin-bottom: 0.9rem; }

/* Radios */
.radio-strip {
  list-style: none; margin: 0; padding: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
}
.radio-row {
  display: grid; grid-template-columns: 9rem 1fr auto; align-items: center; gap: 1.5rem;
  padding: 1rem 1.25rem; border-left: 5px solid var(--c);
}
.radio-row + .radio-row { border-top: 1px solid var(--line); }
.radio-logo img { height: 42px; width: auto; display: block; }
.radio-logo .logo-white { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .radio-logo .logo-white { display: block; }
  :root:not([data-theme="light"]) .radio-row { border-left-color: color-mix(in srgb, var(--c) 55%, #ffffff); }
}
:root[data-theme="dark"] .radio-logo .logo-white { display: block; }
:root[data-theme="dark"] .radio-row { border-left-color: color-mix(in srgb, var(--c) 55%, #ffffff); }
.radio-info { display: grid; gap: 0.1rem; }
.radio-url { color: var(--muted); font-size: 0.95rem; overflow-wrap: anywhere; }
.radio-pitch { font-size: 0.85rem; color: var(--muted); }
.radio-state { color: var(--muted); font-size: 0.9rem; }
.empty { padding: 1.25rem; color: var(--muted); }

/* Tableaux */
.data {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
}
.data th, .data td { text-align: left; padding: 0.7rem 1rem; vertical-align: middle; }
.data th { font-weight: 600; font-size: 0.9rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.data tbody tr + tr td { border-top: 1px solid var(--line); }
.data .num { font-variant-numeric: tabular-nums; text-align: right; }
.data a { text-decoration: none; font-weight: 500; }
.data a:hover { text-decoration: underline; }

/* ---------- Médiathèque ---------- */
.medialib { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: start; }
.bac-list ul { list-style: none; margin: 0 0 1rem; padding: 0.35rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); }
.bac-list a {
  display: flex; justify-content: space-between; gap: 0.5rem;
  padding: 0.55rem 0.75rem; border-radius: var(--radius-s); text-decoration: none; font-weight: 500;
}
.bac-list a:hover { background: var(--panel-2); }
.bac-list a.is-active { background: var(--accent-btn); color: var(--accent-btn-text); }
.bac-list .count { font-variant-numeric: tabular-nums; opacity: 0.7; }

.bac-view { min-width: 0; }
.bac-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.bac-head h1 { font-size: 2.6rem; }
.bac-meta { margin: 0.35rem 0 0; color: var(--muted); display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.pill { font-size: 0.85rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.search { margin-bottom: 1rem; }
.search input { width: 100%; max-width: 480px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-l); }
.sounds td { font-size: 0.95rem; }
.title-cell { display: flex; align-items: center; gap: 0.75rem; min-width: 15rem; }
.sounds .clip { max-width: 13rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sounds td:nth-child(4) { white-space: nowrap; }
.cover { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex: none; background: var(--panel-2); border: 1px solid var(--line); display: inline-block; }
.sound-title { display: block; font-weight: 500; }
.sound-artist { display: block; color: var(--muted); font-size: 0.9rem; }
.state { display: block; font-size: 0.82rem; color: var(--muted); }
.state-error { color: var(--onair); cursor: help; }
.status-importing, .status-analyzing { opacity: 0.7; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn-ghost + .btn-ghost { margin-left: 0.4rem; }

.play {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; position: relative;
}
.play::before {
  content: ""; position: absolute; left: 12px; top: 9px;
  border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent var(--text);
}
.play.is-playing { background: var(--accent-btn); border-color: var(--accent-btn); }
.play.is-playing::before {
  left: 10px; top: 10px; width: 4px; height: 12px; border: 0; background: var(--accent-btn-text);
  box-shadow: 7px 0 0 var(--accent-btn-text);
}

.upload-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.upload-title { margin: 0 0 0.5rem; font-weight: 600; }
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.92rem; }
.upload-list li { display: flex; justify-content: space-between; gap: 1rem; }
.upload-list .up-state { color: var(--muted); font-variant-numeric: tabular-nums; }
.upload-list .is-ok .up-state { color: #1E8E4E; }
.upload-list .is-error .up-state { color: var(--onair); }

.empty-state { padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius-l); }
.empty-state p { margin: 0.25rem 0; }
.pager { display: flex; gap: 1.25rem; justify-content: center; margin-top: 1.25rem; color: var(--muted); }

.drop-overlay {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: color-mix(in srgb, #14213D 82%, transparent);
  color: #fff; font-family: var(--font-cond); font-size: 2rem; font-weight: 600; text-align: center; padding: 2rem;
}
.drop-overlay[hidden] { display: none; }
.drop-overlay p { border: 2px dashed rgba(255,255,255,0.6); border-radius: var(--radius-l); padding: 3rem 4rem; margin: 0; }

@media (max-width: 980px) {
  .medialib { grid-template-columns: 1fr; }
  .bac-list ul { display: flex; flex-wrap: wrap; gap: 0.25rem; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-console { gap: 1.5rem; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .radio-row { grid-template-columns: 1fr; gap: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 0.3 : logos de radio en vignette ---------- */
.cover-logo { display: inline-grid; place-items: center; padding: 4px; background: var(--panel-2); }
.cover-logo img { width: 100%; height: auto; }
.cover-logo .logo-white { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cover-logo .logo-color, :root:not([data-theme="light"]) .player-cover.is-logo .logo-color { display: none; }
  :root:not([data-theme="light"]) .cover-logo .logo-white, :root:not([data-theme="light"]) .player-cover.is-logo .logo-white { display: block; }
}
:root[data-theme="dark"] .cover-logo .logo-color, :root[data-theme="dark"] .player-cover.is-logo .logo-color { display: none; }
:root[data-theme="dark"] .cover-logo .logo-white, :root[data-theme="dark"] .player-cover.is-logo .logo-white { display: block; }
.cover-all { display: inline-grid; place-items: center; font-size: 0.62rem; font-weight: 600; color: var(--muted); }

/* Tags */
.tags-cell { white-space: nowrap; }
.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.1rem 0.5rem; margin: 0 0.25rem 0.15rem 0; border-radius: 999px;
  color: var(--t); background: color-mix(in srgb, var(--t) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--t) 35%, transparent);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag { color: color-mix(in srgb, var(--t) 55%, #fff); } }
:root[data-theme="dark"] .tag { color: color-mix(in srgb, var(--t) 55%, #fff); }
.dur-pitch { display: block; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

/* Import pour une radio */
.bac-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.import-radio { display: flex; gap: 0.5rem; align-items: center; color: var(--muted); }
select, .import-radio select {
  font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); color: var(--text);
}

/* Menu à trois points */
.menu { position: relative; display: inline-block; }
.menu summary {
  list-style: none; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--radius-s); color: var(--muted); font-size: 0.7rem; letter-spacing: 0.08em;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { background: var(--panel-2); color: var(--text); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 15rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.3rem;
  box-shadow: 0 10px 30px rgba(10, 20, 40, 0.18); display: grid; text-align: left;
}
.menu-pop button {
  font: inherit; font-size: 0.95rem; text-align: left; padding: 0.55rem 0.7rem; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; gap: 1rem;
}
.menu-pop button:hover:not(:disabled) { background: var(--panel-2); }
.menu-pop button:disabled { color: var(--muted); cursor: default; }
.menu-pop button small { font-size: 0.75rem; }
.menu-pop .danger { color: var(--onair); }

/* Fenêtre de fiche */
.sheet {
  width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--panel); color: var(--text);
}
.sheet::backdrop { background: rgba(8, 13, 25, 0.55); }
.sheet-form { padding: 1.5rem; display: grid; gap: 1rem; }
.sheet-head { display: grid; grid-template-columns: 72px 1fr auto; gap: 1rem; align-items: center; }
.sheet-cover { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; }
.sheet-cover img { width: 100%; height: 100%; object-fit: cover; }
.sheet-cover .logo-color, .sheet-cover .logo-white { object-fit: contain; padding: 6px; }
.sheet-cover .logo-white { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sheet-cover .logo-color { display: none; }
  :root:not([data-theme="light"]) .sheet-cover .logo-white { display: block; }
}
:root[data-theme="dark"] .sheet-cover .logo-color { display: none; }
:root[data-theme="dark"] .sheet-cover .logo-white { display: block; }
.sheet-cover-empty { font-size: 0.7rem; color: var(--muted); text-align: center; padding: 0.25rem; }
.sheet-head h2 { font-size: 1.8rem; }
.sheet-sub { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.95rem; }
.sheet-close { font: inherit; font-size: 1.6rem; line-height: 1; width: 40px; height: 40px; border: 0; border-radius: var(--radius-s); background: none; color: var(--muted); cursor: pointer; }
.sheet-close:hover { background: var(--panel-2); color: var(--text); }
.sheet fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field label, .field .label { font-weight: 500; font-size: 0.92rem; }
.field input:not([type=checkbox]):not([type=file]) {
  font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--paper); color: var(--text);
}
.field-hint { margin: 0; font-size: 0.85rem; color: var(--muted); }
.tag-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.tag-choice input { position: absolute; opacity: 0; pointer-events: none; }
.tag-choice span {
  display: inline-block; cursor: pointer; font-size: 0.85rem; font-weight: 600; padding: 0.3rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.tag-choice input:checked + span { color: #fff; background: var(--t); border-color: var(--t); }
.tag-choice input:focus-visible + span { outline: 3px solid #4C7DFF; outline-offset: 2px; }
.field .tag-new { width: 9rem; padding: 0.35rem 0.7rem !important; font-size: 0.85rem; border-radius: 999px !important; }
.siblings { margin: 0; padding-left: 1.1rem; }
.cover-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cover-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.5rem; }
.cover-results:empty { display: none; }
.cover-choice { padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; aspect-ratio: 1; overflow: hidden; }
.cover-choice:hover { border-color: var(--accent-btn); }
.cover-choice img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 0.75rem; }

/* Lecteur persistant */
body.has-player .content { padding-bottom: 7rem; }
.player {
  position: fixed; left: 248px; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 48px minmax(8rem, 16rem) auto 1fr auto 9rem auto; gap: 1rem; align-items: center;
  padding: 0.7rem 1.25rem; background: var(--panel); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(10, 20, 40, 0.08);
}
.player[hidden] { display: none; }
.player-cover { width: 48px; height: 48px; border-radius: 6px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; }
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player-cover.is-logo img { object-fit: contain; padding: 4px; }
.player-cover.is-logo .logo-white { display: none; }
.player-meta { min-width: 0; display: grid; }
.player-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 0.88rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-toggle { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--accent-btn); cursor: pointer; position: relative; }
.player-toggle::before { content: ""; position: absolute; left: 16px; top: 12px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent var(--accent-btn-text); }
.player-toggle.is-playing::before { left: 14px; top: 13px; width: 5px; height: 16px; border: 0; background: var(--accent-btn-text); box-shadow: 9px 0 0 var(--accent-btn-text); }
.player-seek { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.player-seek input { flex: 1; min-width: 4rem; accent-color: var(--accent-btn); }
.player-time { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--muted); }
.player-version select { padding: 0.35rem 0.5rem; font-size: 0.88rem; }
.player-volume input { width: 100%; accent-color: var(--accent-btn); }
.player-close { font: inherit; font-size: 1.4rem; width: 34px; height: 34px; border: 0; border-radius: var(--radius-s); background: none; color: var(--muted); cursor: pointer; }
.player-close:hover { background: var(--panel-2); color: var(--text); }
@media (max-width: 1100px) {
  .player { grid-template-columns: 48px 1fr auto auto; }
  .player-seek { grid-column: 1 / -1; grid-row: 2; }
  .player-volume, .player-version { display: none; }
}
@media (max-width: 860px) { .player { left: 0; } .field-row { grid-template-columns: 1fr; } }
/* Le menu à trois points doit pouvoir déborder du tableau */
.table-wrap { overflow: visible; }
.data.sounds { overflow: visible; }
@media (max-width: 1100px) { .table-wrap { overflow-x: auto; } }

/* ---------- 0.4 : versions, identifiants ---------- */
.version {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.12rem 0.45rem; border-radius: 4px; color: #fff; background: var(--t);
}
.song-id { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; margin-right: 0.4rem; }
.state-match { color: #B45309; }
.menu-pop a { font-size: 0.95rem; padding: 0.55rem 0.7rem; border-radius: var(--radius-s); text-decoration: none; color: var(--text); }
.menu-pop a:hover { background: var(--panel-2); }
.version-new { margin-top: 0.35rem; }
.match-banner {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 0.9rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radius-l);
  background: color-mix(in srgb, #F59E0B 14%, var(--panel)); border: 1px solid color-mix(in srgb, #F59E0B 45%, var(--line));
}
.match-banner p { margin: 0; }
.match-cands { display: grid; gap: 0.5rem; }
.match-cand {
  display: grid; grid-template-columns: auto 48px 1fr; gap: 0.75rem; align-items: center; cursor: pointer;
  padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 10px;
}
.match-cand:has(input:checked) { border-color: var(--accent-btn); background: var(--panel-2); }
.match-cand:not(:has(.match-cover)) { grid-template-columns: auto 1fr; }
.match-cover { width: 48px; height: 48px; border-radius: 6px; overflow: hidden; background: var(--panel-2); }
.match-cover img { width: 100%; height: 100%; object-fit: cover; }
.match-text { display: grid; }
.match-text span { font-size: 0.88rem; color: var(--muted); }
.match-left { margin-right: auto; color: var(--muted); font-size: 0.9rem; align-self: center; }

/* ---------- 0.4 : éditeur de points d'enchaînement ---------- */
.editor { max-width: 1200px; display: grid; gap: 1.25rem; min-width: 0; }
.editor > * { min-width: 0; }
.wave-box { min-width: 0; overflow: hidden; }
.back-link { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.back-link:hover { color: var(--text); text-decoration: underline; }
.editor-head { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; align-items: end; }
.editor-head .back-link { grid-column: 1 / -1; }
.editor-title { display: flex; gap: 1rem; align-items: center; }
.editor-title .cover { width: 64px; height: 64px; }
.editor-title h1 { font-size: 2.4rem; }
.editor-actions { display: flex; gap: 1rem; align-items: center; }
.dirty { color: #B45309; font-size: 0.92rem; }
.editor-tests { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lookup { position: relative; display: grid; gap: 0.35rem; }
.lookup label { font-weight: 500; font-size: 0.92rem; }
.lookup input {
  font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); color: var(--text);
}
.lookup-results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 15; margin-top: 4px; max-height: 18rem; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.3rem;
  box-shadow: 0 10px 30px rgba(10, 20, 40, 0.18);
}
.lookup-results button {
  display: grid; width: 100%; text-align: left; font: inherit; padding: 0.5rem 0.65rem; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--text); cursor: pointer;
}
.lookup-results button:hover { background: var(--panel-2); }
.lookup-results span { font-size: 0.85rem; color: var(--muted); }
.lookup-chosen {
  margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel);
}
.wave-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1rem; display: grid; gap: 0.6rem; position: relative; }
.wave-panel canvas { display: block; width: 100%; }
.wave-overview { cursor: pointer; border-radius: 4px; background: var(--panel-2); }
.wave-main { cursor: text; }
.wave-toolbar { display: flex; align-items: center; gap: 1rem; }
.playhead-time { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: auto; }
.zoom { display: flex; align-items: center; gap: 0.5rem; font-variant-numeric: tabular-nums; }
.editor-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; background: var(--panel); border-radius: var(--radius-l); color: var(--muted); }
.editor-loading[hidden] { display: none; }
.points { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.75rem; }
.point-card { border: 1px solid var(--line); border-top: 4px solid var(--pc); border-radius: 10px; background: var(--panel); padding: 0.6rem; display: grid; gap: 0.4rem; }
.point-name { font-weight: 600; font-size: 0.92rem; }
.point-card input {
  font: inherit; font-variant-numeric: tabular-nums; width: 100%; padding: 0.45rem 0.5rem;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); color: var(--text);
}
.point-btns { display: flex; gap: 0.35rem; }
.point-btns .btn-ghost { padding: 0.25rem 0.55rem; }
.editor-play { display: flex; gap: 0.75rem; justify-content: center; }
.editor-help { color: var(--muted); max-width: 70ch; }
.editor-help summary { cursor: pointer; color: var(--text); font-weight: 500; }
.editor-help dt { font-weight: 600; color: var(--text); margin-top: 0.6rem; }
.editor-help dd { margin: 0.1rem 0 0; }
@media (max-width: 1100px) { .points { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .points { grid-template-columns: repeat(2, minmax(0, 1fr)); } .editor-tests { grid-template-columns: 1fr; } }
