/* ==========================================================
   Audyo — feuille de style
   Palette inspirée du logo : bleu nuit, bleu électrique,
   orange, rouge et touches arc-en-ciel.
   ========================================================== */
:root {
  --bg: #070c26;
  --bg2: #0c1440;
  --panel: #111a4a;
  --panel2: #18235c;
  --panel3: #202d70;
  --line: rgba(130, 160, 255, .16);
  --line2: rgba(130, 160, 255, .28);
  --text: #f2f5ff;
  --muted: #aab5df;
  --dim: #7d89bd;

  --blue: #3b82f6;
  --sky: #38bdf8;
  --cyan: #22d3ee;
  --teal: #14b8a6;
  --mint: #34d399;
  --green: #22c55e;
  --lime: #a3e635;
  --yellow: #facc15;
  --amber: #f59e0b;
  --orange: #ff8a1f;
  --red: #ff4757;
  --red2: #ef4444;
  --pink: #ec4899;
  --purple: #a855f7;
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --slate: #94a3b8;

  --grad-brand: linear-gradient(135deg, #ff8a1f 0%, #ff4757 55%, #ec4899 100%);
  --grad-rainbow: linear-gradient(90deg, #22d3ee, #3b82f6, #a855f7, #ec4899, #ff8a1f, #facc15, #22c55e);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font-ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --z-overlay: 10;
  --z-drawer: 30;
  --z-busy: 50;
  --z-toast: 60;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* les tiroirs repliés (inspecteur, barre latérale) attendent hors de l'écran : sans cela, un téléphone élargit la page pour les montrer */
html { overflow-x: hidden; }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(59, 130, 246, .22), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(255, 138, 31, .14), transparent 60%),
    radial-gradient(700px 400px at 70% -20%, rgba(168, 85, 247, .16), transparent 60%),
    var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.ico { flex: none; display: block; }

.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}

/* ===================== TOPBAR ===================== */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(17, 26, 74, .95), rgba(12, 20, 64, .9));
  border-bottom: 1px solid var(--line);
  position: relative;
  min-width: 0;
}
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--grad-rainbow);
  opacity: .7;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }
.brand { border-radius: 50%; }
.brand img { width: 88px; height: 88px; margin: -6px 0; filter: drop-shadow(0 4px 10px rgba(59, 130, 246, .45)); transition: transform .3s ease; }
.brand:hover img { transform: rotate(-8deg) scale(1.05); }
.brand-text { font-family: var(--font-title); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: .5px; }
.b1 { color: #fff; }
.b2 { color: var(--red); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}
.toolbar::-webkit-scrollbar { display: none; }
.tgroup {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  flex: none;
  position: relative;
}
.tgroup::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: -1px; height: 2px; border-radius: 2px;
  background: var(--accent);
  opacity: .9;
}
.tbtn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 10px;
  border: 0; border-radius: 11px;
  background: transparent;
  color: var(--accent);
  transition: background-color .18s ease, color .18s ease, opacity .18s ease;
}
.tbtn span { font-weight: 700; font-size: 13px; color: var(--text); }
.tbtn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.tbtn:active:not(:disabled) { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.tbtn:disabled { opacity: .3; }
.tbtn.active { background: var(--accent); color: #06102e; }
.tbtn.active span { color: #06102e; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--yellow);
  transition: background-color .18s ease;
}
.icon-btn:hover { background: rgba(250, 204, 21, .14); }
.top-right { display: flex; gap: 8px; flex: none; }
.only-small, .only-medium { display: none; }

/* infobulles */
.tooltip {
  position: fixed; top: 0; left: 0;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .12s ease;
  padding: 5px 9px; border-radius: 8px;
  background: #050a22; border: 1px solid var(--line2);
  color: var(--text); font-size: 12px; font-weight: 700;
  z-index: var(--z-toast);
  box-shadow: var(--shadow);
}
.tooltip.show { opacity: 1; }

/* ===================== MAIN ===================== */
.main {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr) 272px;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

.panel {
  background: linear-gradient(180deg, rgba(24, 35, 92, .75), rgba(17, 26, 74, .75));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  backdrop-filter: blur(6px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.panel-head h2 {
  font-family: var(--font-title); font-weight: 700; font-size: 17px; margin: 0; letter-spacing: .3px;
}
.count {
  min-width: 26px; height: 22px; padding: 0 8px; border-radius: 99px;
  display: inline-grid; place-items: center;
  background: var(--grad-brand); color: #fff; font-weight: 800; font-size: 12px;
}
.hint { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Sidebar ---------- */
.sidebar, .inspector {
  display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--panel3) transparent;
}
.sidebar > .panel, .inspector > .panel { flex: none; }
.files-panel { display: flex; flex-direction: column; }
.file-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 32vh; overflow-y: auto; }
.file-item {
  display: grid; grid-template-columns: 6px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 6px 8px 8px; border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}
.file-item:hover { background: rgba(255, 255, 255, .07); }
.file-item.active { background: color-mix(in srgb, var(--fc) 18%, transparent); border-color: color-mix(in srgb, var(--fc) 60%, transparent); }
.file-item .bar { width: 6px; height: 34px; border-radius: 4px; background: var(--fc); }
.file-item .meta { min-width: 0; }
.file-item .name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .sub { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.file-item .close {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; transition: background-color .18s ease, color .18s ease;
}
.file-item .close:hover { background: rgba(255, 71, 87, .2); color: var(--red); }
.file-item .dot-dirty { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; margin-left: 6px; vertical-align: middle; }

.dropzone {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px; border-radius: 12px;
  border: 2px dashed var(--line2); background: rgba(59, 130, 246, .06);
  color: var(--sky);
  transition: background-color .2s ease, border-color .2s ease;
}
.dropzone strong { color: var(--text); }
.dropzone small { color: var(--muted); }
.dropzone:hover { background: rgba(59, 130, 246, .14); border-color: var(--blue); }

.fx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fx-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px; min-height: 46px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  text-align: left; font-size: 12.5px; font-weight: 700; line-height: 1.15;
  transition: background-color .18s ease, border-color .18s ease;
}
.fx-btn .fx-ico {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent);
}
.fx-btn .fx-ico .ico { width: 16px; height: 16px; }
.fx-btn > span:last-child { min-width: 0; hyphens: auto; }
.fx-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.fx-btn:disabled { opacity: .35; }

/* ---------- Editor ---------- */
.editor {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0; min-height: 0;
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0b1440, #081034);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), var(--shadow);
}
.track-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.track-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--fc, var(--dim)); box-shadow: 0 0 12px var(--fc, transparent); flex: none; }
.track-name {
  font-family: var(--font-title); font-size: 20px; font-weight: 700; margin: 0 6px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40ch;
}
.chip {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--muted);
}
.dirty-flag { font-size: 12px; font-weight: 800; color: #1b0d00; background: var(--orange); padding: 3px 9px; border-radius: 99px; }

.overview-wrap { height: 54px; border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); flex: none; }
#overview { width: 100%; height: 100%; display: block; cursor: pointer; }

.wave-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #060b28; }
.ruler { width: 100%; height: 26px; display: block; flex: none; background: #0a123a; border-bottom: 1px solid var(--line); }
.wave-stage { position: relative; flex: 1; min-height: 0; }
.wave-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { cursor: text; touch-action: none; }
#overlay:focus-visible { outline-offset: -3px; }
#overlay.resize { cursor: ew-resize; }

.empty-state {
  position: absolute; inset: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
  border-radius: 12px; padding: 24px;
  background:
    radial-gradient(500px 280px at 50% 30%, rgba(59, 130, 246, .2), transparent 70%),
    #081034;
  z-index: var(--z-overlay);
}
.empty-state img { width: min(340px, 38vh); height: min(340px, 38vh); animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 16px 30px rgba(59, 130, 246, .45)); }
.empty-state h2 { font-family: var(--font-title); font-size: 30px; margin: 6px 0 0; }
.empty-state p { color: var(--muted); max-width: 52ch; line-height: 1.6; margin: 0 0 10px; }
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent;
  color: var(--yellow); font-weight: 800; text-decoration: underline; text-underline-offset: 4px;
  transition: background-color .18s ease;
}
.link-btn:hover { background: rgba(250, 204, 21, .1); }
.link-btn .ico { width: 18px; height: 18px; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }

.drop-overlay {
  position: absolute; inset: 0; z-index: var(--z-overlay);
  display: none; align-items: center; justify-content: center; gap: 12px;
  border-radius: var(--radius); border: 3px dashed var(--cyan);
  background: rgba(34, 211, 238, .12); backdrop-filter: blur(3px);
  font-family: var(--font-title); font-size: 26px; font-weight: 700; color: var(--cyan);
}
.drop-overlay .ico { width: 36px; height: 36px; }
body.dragging .drop-overlay { display: flex; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line2); background: rgba(255, 255, 255, .06);
  font-weight: 800; font-size: 14px;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .1s ease;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: translateY(1px); }
.btn.primary { border: 0; background: var(--grad-brand); color: #fff; box-shadow: 0 6px 18px rgba(255, 71, 87, .35); }
.btn.primary:hover { box-shadow: 0 8px 24px rgba(255, 71, 87, .5); }
.btn.ghost { background: transparent; }
.btn.rec { color: #ffd5d9; border-color: rgba(255, 71, 87, .5); }
.btn.rec:hover { background: rgba(255, 71, 87, .16); }
.btn .ico { width: 18px; height: 18px; }

/* ---------- Inspector ---------- */
.stats { margin: 0; display: grid; gap: 4px; }
.stats div { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .03); }
.stats dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.stats dd { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--cyan); }
.stats div:nth-child(4) dd { color: var(--orange); }
.stats div:nth-child(5) dd { color: var(--lime); }

.meters { display: grid; gap: 8px; }
.meter { display: grid; grid-template-columns: 14px 1fr; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.meter-track { position: relative; height: 12px; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.meter-fill {
  position: absolute; inset: 0; width: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #a3e635 55%, #facc15 75%, #ff8a1f 88%, #ff4757 100%);
  clip-path: inset(0 100% 0 0);
  transition: clip-path .05s linear;
}
.meter-peak { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; left: 0; opacity: .9; }
.meter-scale { display: flex; justify-content: space-between; padding-left: 22px; font-size: 10px; color: var(--dim); font-family: var(--font-mono); }

.spectrum { width: 100%; height: 110px; display: block; border-radius: 10px; background: rgba(0, 0, 0, .25); }

.palettes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pal {
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
  padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  font-size: 12px; font-weight: 700; text-align: left;
  transition: border-color .18s ease, background-color .18s ease;
}
.pal i { display: block; height: 10px; border-radius: 6px; }
.pal:hover { background: rgba(255, 255, 255, .07); }
.pal[aria-checked="true"] { border-color: var(--cyan); background: rgba(34, 211, 238, .1); }

/* ===================== TRANSPORT ===================== */
.transport {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 16px;
  background: linear-gradient(0deg, rgba(17, 26, 74, .98), rgba(12, 20, 64, .92));
  border-top: 1px solid var(--line);
  min-width: 0;
}
.time-box {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 16px; border-radius: 14px;
  background: #050a22; border: 1px solid var(--line2);
  box-shadow: inset 0 0 20px rgba(34, 211, 238, .08);
  flex: none;
}
.time {
  font-family: var(--font-mono); font-weight: 700; font-size: 28px; letter-spacing: 1px;
  color: var(--cyan); text-shadow: 0 0 14px rgba(34, 211, 238, .55);
  font-variant-numeric: tabular-nums; min-width: 9.5ch;
}
.time.rec { color: var(--red); text-shadow: 0 0 14px rgba(255, 71, 87, .6); }
.time-sub { font-family: var(--font-mono); font-size: 13px; color: var(--dim); }

.tcontrols { display: flex; align-items: center; gap: 6px; flex: none; }
.pbtn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); color: var(--text);
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .1s ease;
}
.pbtn:hover { background: rgba(255, 255, 255, .12); }
.pbtn:active { transform: scale(.95); }
.pbtn.play {
  width: 58px; height: 58px; border: 0; color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 6px 20px rgba(255, 71, 87, .45);
}
.pbtn.play .ico { width: 26px; height: 26px; }
.pbtn.play:hover { box-shadow: 0 8px 28px rgba(255, 71, 87, .65); }
.pbtn.play.playing { background: linear-gradient(135deg, #22d3ee, #3b82f6); box-shadow: 0 6px 20px rgba(59, 130, 246, .5); }
.pbtn.toggle[aria-pressed="true"] { background: var(--green); color: #052e14; border-color: transparent; box-shadow: 0 0 16px rgba(34, 197, 94, .5); }
.recbtn { color: var(--red); }
.recbtn[aria-pressed="true"] { background: var(--red); color: #fff; border-color: transparent; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 71, 87, .2); } }

.volume { display: flex; align-items: center; gap: 10px; color: var(--orange); flex: 1; min-width: 140px; max-width: 280px; }
.volume output { font-family: var(--font-mono); font-size: 12px; color: var(--muted); min-width: 4ch; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--orange) 0 var(--p, 50%), rgba(255, 255, 255, .12) var(--p, 50%) 100%);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .12); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--orange); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 3px solid var(--orange); box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--orange); }

.zoom-info { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ===================== GLOSSAIRE ===================== */
.gloss-btn { width: auto; gap: 8px; padding: 0 14px; color: var(--cyan); font-weight: 800; font-size: 14px; }
.gloss-btn span { color: var(--text); }
.gloss-btn:hover { background: rgba(34, 211, 238, .14); }

.modal.glossary { width: min(860px, calc(100vw - 32px)); height: min(820px, calc(100dvh - 32px)); }
.modal.glossary .modal-body { height: 100%; }
.gloss-tools { display: grid; gap: 10px; }
.gloss-search {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line2); background: #0a1238; color: var(--muted);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.gloss-search:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .2); }
.gloss-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 15px; font-weight: 600; outline: none; }
.gloss-search input::placeholder { color: var(--dim); }
.gloss-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.gloss-cat {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line2); background: rgba(255, 255, 255, .04);
  font-weight: 800; font-size: 13px; color: var(--accent);
  transition: background-color .18s ease, border-color .18s ease;
}
.gloss-cat span { color: var(--text); }
.gloss-cat small { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.gloss-cat:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.gloss-cat[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); }

.gloss-list {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; align-content: start;
  padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--panel3) transparent;
}
.gloss-item {
  padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
}
.gloss-item header { display: flex; align-items: center; gap: 10px; }
.gloss-ico {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent);
}
.gloss-item h3 { margin: 0; flex: 1; font-family: var(--font-title); font-size: 18px; font-weight: 700; line-height: 1.2; }
.gloss-tag { font-size: 11px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.gloss-item p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.gloss-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; border: 1px solid; }
.badge.ok { color: #86efac; border-color: rgba(34, 197, 94, .5); background: rgba(34, 197, 94, .12); }
.badge.mid { color: #fde68a; border-color: rgba(250, 204, 21, .45); background: rgba(250, 204, 21, .1); }
.badge.no { color: #fda4af; border-color: rgba(255, 71, 87, .45); background: rgba(255, 71, 87, .1); }
.gloss-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; margin: 0; }
.gloss-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
@media (max-width: 860px) {
  .gloss-btn span { display: none; }
  .gloss-btn { width: 42px; padding: 0; }
  .gloss-list { grid-template-columns: 1fr; }
}

/* ===================== COPYRIGHT ===================== */
.copyright {
  text-align: center; font-size: 11px; color: var(--dim); letter-spacing: .3px;
  padding: 3px 16px 5px; background: rgba(12, 20, 64, .98);
}

/* ===================== À PROPOS ===================== */
.modal.about { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.about-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding-top: 4px; }
.about-hero img {
  width: 240px; height: 240px; max-width: 60vw; height: auto;
  filter: drop-shadow(0 18px 36px rgba(59, 130, 246, .5));
  animation: bob 4s ease-in-out infinite;
}
.about-hero h2 { margin: 6px 0 0; font-family: var(--font-title); font-size: 44px; font-weight: 800; line-height: 1; }
.about-tag { margin: 0; font-family: var(--font-title); font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-size: 14px; }
.version-pill {
  margin-top: 10px; padding: 4px 12px; border-radius: 99px;
  background: var(--grad-brand); color: #fff; font-weight: 800; font-size: 13px; font-family: var(--font-mono);
}
.about-text { margin: 0; color: var(--text); line-height: 1.6; text-align: center; }
.about-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.about-features li {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--muted);
}
.about-features li b { color: var(--text); }
.about-features li > span:first-child {
  flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent);
}
.about-features li > span:first-child .ico { width: 18px; height: 18px; }
.about-copy { margin: 0; text-align: center; font-size: 12px; color: var(--dim); }

/* ===================== MODALS ===================== */
.modal {
  border: 1px solid var(--line2); border-radius: 20px; padding: 0;
  width: min(520px, calc(100vw - 32px));
  background: linear-gradient(180deg, #18235c, #111a4a);
  color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal::backdrop { background: rgba(3, 6, 22, .7); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .2s ease-out; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-head { display: flex; gap: 14px; align-items: center; }
.modal-head h2 { margin: 0; font-family: var(--font-title); font-size: 24px; line-height: 1.1; }
.modal-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.modal-icon {
  width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent, var(--blue)) 22%, transparent); color: var(--accent, var(--blue));
}
.modal-icon .ico { width: 26px; height: 26px; }
.modal-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.fx-params { display: grid; gap: 14px; }
.param { display: grid; gap: 6px; }
.param-top { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.param-top output { font-family: var(--font-mono); color: var(--accent, var(--cyan)); font-size: 13px; }
.param input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--accent) 0 var(--p, 50%), rgba(255, 255, 255, .12) var(--p, 50%) 100%); }
.param input[type="range"]::-webkit-slider-thumb { border-color: var(--accent); }
.param input[type="range"]::-moz-range-progress { background: var(--accent); }
.param input[type="range"]::-moz-range-thumb { border-color: var(--accent); }
.fx-scope { margin: 0; font-size: 13px; color: var(--muted); padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.fx-scope b { color: var(--text); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.form-grid label.full { grid-column: 1 / -1; }
input[type="text"], input[type="number"], select {
  height: 44px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line2); background: #0a1238; color: var(--text); font-size: 15px; font-weight: 600;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(34, 211, 238, .2); }

.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.keys div { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); padding: 4px 0; }
.keys span { margin-left: auto; text-align: right; color: var(--text); font-weight: 600; }
kbd {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 3px 7px; border-radius: 6px; background: #0a1238; border: 1px solid var(--line2); border-bottom-width: 3px; color: var(--yellow);
}

/* ===================== BUSY + TOASTS ===================== */
.busy {
  position: fixed; inset: 0; z-index: var(--z-busy);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(3, 6, 22, .6); backdrop-filter: blur(3px);
  font-family: var(--font-title); font-size: 20px; font-weight: 700;
}
.busy[hidden] { display: none; }
.spinner {
  width: 54px; height: 54px; border-radius: 50%;
  background: conic-gradient(from 0deg, #22d3ee, #3b82f6, #a855f7, #ec4899, #ff8a1f, #facc15, #22d3ee);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toasts { position: fixed; right: 16px; bottom: 96px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px; max-width: min(380px, calc(100vw - 32px));
  background: #0a1238; border: 1px solid var(--line2); border-left: 4px solid var(--tc, var(--cyan));
  box-shadow: var(--shadow); font-weight: 700; font-size: 14px;
  animation: toastIn .25s ease-out;
}
.toast .ico { color: var(--tc, var(--cyan)); }
.toast.out { opacity: 0; transform: translateX(20px); transition: opacity .3s ease, transform .3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1280px) {
  .main { grid-template-columns: 288px minmax(0, 1fr); }
  .only-medium { display: inline-flex; }
  .inspector {
    position: fixed; right: 12px; top: 104px; bottom: 116px; width: 290px; z-index: var(--z-drawer);
    padding: 12px; border-radius: 18px; background: #0c1440; border: 1px solid var(--line2); box-shadow: var(--shadow);
    transform: translateX(calc(100% + 24px)); transition: transform .25s ease;
  }
  .inspector.open { transform: none; }
}
@media (max-width: 860px) {
  .main { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .only-small { display: inline-flex; }
  .brand-text { display: none; }
  .brand img { width: 60px; height: 60px; margin: -4px 0; }
  .sidebar {
    position: fixed; left: 12px; top: 104px; bottom: 116px; width: 290px; z-index: var(--z-drawer);
    padding: 12px; border-radius: 18px; background: #0c1440; border: 1px solid var(--line2); box-shadow: var(--shadow);
    transform: translateX(calc(-100% - 24px)); transition: transform .25s ease;
  }
  .sidebar.open { transform: none; }
  .transport { flex-wrap: wrap; gap: 10px; justify-content: center; }
  .time { font-size: 22px; }
  .zoom-info { display: none; }
  .volume { max-width: none; }
  .track-name { font-size: 17px; }
}
@media (max-width: 520px) {
  .tcontrols { gap: 4px; }
  .pbtn { width: 40px; height: 40px; }
  #btnRew, #btnFwd { display: none; }
  .time-box { padding: 6px 12px; }
  .form-grid, .keys { grid-template-columns: 1fr; }
  .empty-state h2 { font-size: 24px; }
  .empty-state img { width: min(240px, 34vh); height: min(240px, 34vh); }
}

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

/* bouton d'installation (application) */
.install-btn { width: auto; gap: 8px; padding: 0 14px; color: var(--green); font-weight: 800; font-size: 14px; }
.install-btn span { color: var(--text); }
.install-btn:hover { background: rgba(34, 197, 94, .14); }
.install-btn[hidden] { display: none; }
@media (max-width: 860px) { .install-btn span { display: none; } .install-btn { width: 42px; padding: 0; } }

/* fenêtre « CD audio détecté » */
.cda-modal { width: min(600px, calc(100vw - 32px)); }
.cda-disc .ico { animation: spin 3s linear infinite; }
.cda-list { list-style: none; margin: 0; padding: 0; max-height: 210px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--line); }
.cda-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; font-size: 14px; }
.cda-list li + li { border-top: 1px solid var(--line); }
.cda-num { font: 800 13px var(--font-mono); color: var(--cyan); }
.cda-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.cda-dur { font: 700 13px var(--font-mono); font-variant-numeric: tabular-nums; }
.cda-warn { margin: 0; font-size: 13px; color: var(--yellow); }
.cda-steps { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .25); }
.cda-steps h3 { margin: 0; font-family: var(--font-title); font-size: 17px; }
.cda-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.cda-steps b { color: var(--text); }
.cda-alt { margin: 2px 0 0; font-size: 13px; color: var(--dim); }
@media (prefers-reduced-motion: reduce) { .cda-disc .ico { animation: none; } }
