/* Identité : grotesque grasse + monospace, outremer électrique, surligneur fluo, angles nets.
   Police embarquée (SIL Open Font License) : aucun appel externe au chargement. */
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --sunken: #f7f7f5;
  --ink: #0b0b0d;
  --ink-2: #4a4a52;
  --ink-3: #8a8a93;
  --line: #e6e6e3;
  --line-strong: #0b0b0d;
  --accent: #3a28ff;          /* outremer électrique */
  --accent-hover: #2a17f0;
  --accent-ink: #ffffff;
  --accent-soft: #eceaff;
  --hl: #d7ff3a;              /* surligneur */
  --hl-ink: #0b0b0d;
  --ok: #0f9f5b; --ok-soft: #e3f6ec;
  --warn: #c27a00; --warn-soft: #fdf1d8;
  --bad: #e03a2f; --bad-soft: #fde6e4;
  --radius: 6px;
  --radius-sm: 4px;
  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --qobuz: #0b0b0d; --spotify: #1ed760; --deezer: #a238ff; --tidal: #000000; --apple: #fa243c; --youtube: #ff0033; --demo: #3a28ff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --surface: #111114;
    --surface-2: #1b1b20;
    --sunken: #0d0d10;
    --ink: #f4f4f5;
    --ink-2: #b4b4bc;
    --ink-3: #74747e;
    --line: #232329;
    --line-strong: #f4f4f5;
    --accent: #7a6bff;
    --accent-hover: #9284ff;
    --accent-ink: #ffffff;
    --accent-soft: #1d1840;
    --ok: #34d399; --ok-soft: #0c2a1e;
    --warn: #fbbf24; --warn-soft: #2b2108;
    --bad: #f87171; --bad-soft: #321313;
    --qobuz: #f4f4f5;
    --tidal: #f4f4f5;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--sans); font-feature-settings: 'tnum' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--hl); color: var(--hl-ink); }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--ink-3); }
.spacer { flex: 1; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Barre du haut --- */
.topbar { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand::before { content: ''; width: 18px; height: 18px; background: var(--accent); border-radius: 50%; box-shadow: 9px 0 0 -1px var(--hl); margin-right: 8px; }
.topbar-meta { margin-left: auto; display: flex; align-items: center; gap: 16px; font: 12px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.privacy { display: inline-flex; align-items: center; gap: 6px; }
.privacy svg { width: 13px; height: 13px; }
.version { color: var(--ink-3); }
/* Langue : textes affichés une fois le dictionnaire chargé (pas de flash de la langue par défaut). */
.i18n-pending body { visibility: hidden; }
.lang-select {
  font: inherit; color: var(--ink-2); background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 3px 4px; cursor: pointer; text-transform: uppercase; letter-spacing: .04em;
}
.lang-select:hover, .lang-select:focus-visible { border-color: currentColor; color: var(--ink); }
.lang-select option { text-transform: none; color: initial; }

/* --- Intro --- */
.intro { padding: 84px 0 64px; }
.kicker { font: 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 22px; }
.intro h1 { font: 700 clamp(42px, 7.4vw, 92px)/.95 var(--sans); letter-spacing: -.04em; word-spacing: .06em; margin: 0; max-width: 980px; }
.intro h1 mark { background: none; color: inherit; background-image: linear-gradient(var(--hl), var(--hl)); background-size: 100% .42em; background-position: 0 88%; background-repeat: no-repeat; padding: 0 .04em; }
.lede { font-size: 19px; line-height: 1.45; color: var(--ink-2); margin: 28px 0 0; max-width: 580px; }

/* --- Blocs --- */
.block { border-top: 1.5px solid var(--line-strong); padding: 28px 0 56px; }
.block-head { margin-bottom: 28px; }
.block-num { display: block; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 14px; }
.block-head h2 { font: 700 34px/1.05 var(--sans); letter-spacing: -.025em; word-spacing: .08em; margin: 0; }
.block-head p { margin: 8px 0 0; color: var(--ink-2); max-width: 620px; }

/* --- Boutons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--radius); border: 1.5px solid var(--ink); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .12s, color .12s, border-color .12s, transform .05s; }
.btn:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-primary::after { content: '→'; font-weight: 400; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 14px; }
.textbtn { background: none; border: 0; padding: 2px 0; color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.textbtn:hover { color: var(--ink); text-decoration-color: var(--accent); }

/* --- Pastilles de plateforme (logo officiel ou initiale) --- */
.mono { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--pc, var(--ink)); color: var(--bg); font: 700 19px/1 var(--sans); letter-spacing: -.03em; }
.mono.sm { width: 28px; height: 28px; border-radius: 7px; font-size: 13px; }
.mono.logo { background: #fff; box-shadow: inset 0 0 0 1px rgba(11, 11, 13, .1); }
.mono.logo img { width: 58%; height: 58%; display: block; }
.mono.file { background: var(--surface-2); color: var(--ink-2); }
.mono.file svg { width: 15px; height: 15px; }
[data-p=qobuz] { --pc: var(--qobuz); }
[data-p=spotify] { --pc: var(--spotify); }
[data-p=deezer] { --pc: var(--deezer); }
[data-p=tidal] { --pc: var(--tidal); }
[data-p=apple] { --pc: var(--apple); }
[data-p=youtube] { --pc: var(--youtube); }
[data-p=demo] { --pc: var(--demo); }

/* --- Plateformes --- */
.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.platform { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); min-width: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); position: relative; }
.platform .meta { min-width: 0; flex: 1; }
.platform .meta strong { display: block; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.platform .meta span { display: flex; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.platform[data-state=connected]::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ok); }
.platform[data-state=connected] .meta span { color: var(--ink-2); }
.platform[data-state=soon] { background: var(--sunken); }
.platform[data-state=soon] .mono { filter: grayscale(1); opacity: .45; }
.platform[data-state=soon] .meta strong { color: var(--ink-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.tag { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px 7px; white-space: nowrap; }

/* --- Trajet --- */
.route { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: start; }
.route-col { min-width: 0; }
.route-label { font: 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 12px; }
.route-arrow { color: var(--accent); padding-top: 44px; display: grid; place-items: center; }
.route-arrow svg { width: 40px; height: 20px; }
.options { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--radius); cursor: pointer; font-weight: 600; transition: border-color .12s; }
.opt:hover { border-color: var(--ink-3); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .radio { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink-3); display: grid; place-items: center; flex: none; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt.on .radio { border-color: var(--accent); background: var(--accent); }
.opt.on .radio::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt small { color: var(--ink-3); font: 400 12px var(--mono); }
.empty-note { font-size: 14px; color: var(--ink-2); padding: 14px; border: 1.5px dashed var(--line); border-radius: var(--radius); margin: 0; }
.hint { font-size: 14px; color: var(--ink-2); margin: 14px 2px 0; }

.panel { margin-top: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid var(--line); }
.toggle-row strong { display: block; font-weight: 600; }
.toggle-row small { display: block; color: var(--ink-3); font: 12px var(--mono); }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); position: relative; flex: none; transition: background .12s; }
.toggle-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-3); transition: transform .15s, background .12s; }
.toggle-row input:checked + .toggle-ui { background: var(--accent); box-shadow: none; }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(16px); background: #fff; }
.toggle-row:has(input:focus-visible) .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel-sub { padding: 14px 16px 10px; }
.panel-sub-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.panel-sub-head .muted { font: 12px var(--mono); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sunken); color: var(--ink-3); margin-bottom: 6px; }
.search svg { width: 15px; height: 15px; flex: none; }
.search input { border: 0; background: none; outline: none; width: 100%; color: var(--ink); }
.search:focus-within { border-color: var(--accent); }
.pl-list { max-height: 280px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.pl-row { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.pl-row:last-child { border-bottom: 0; }
.pl-pick { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.pl-row .name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-row .name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row .name small { color: var(--ink-3); font: 12px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-line { display: flex; align-items: center; gap: 12px; padding-right: 18px; border-bottom: 1px solid var(--line); }
.fav-line .toggle-row { flex: 1; border-bottom: 0; min-width: 0; }

/* --- Pochettes --- */
.cover { flex: none; display: block; width: 40px; height: 40px; object-fit: cover; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent); }
.cover.xs { width: 34px; height: 34px; }
.cover.lg { width: 132px; height: 132px; border-radius: 4px; }
.cover.ph { display: grid; place-items: center; color: var(--ink-3); }
.cover.ph svg { width: 42%; height: 42%; }
.cover.ico { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.cover.ico.fav { background: var(--hl); color: var(--hl-ink); }
.cover.mosaic { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.cover.mosaic > * { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 18px; border: 1.5px dashed var(--ink-3); border-radius: var(--radius); margin: 10px; text-align: center; color: var(--ink-2); cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone svg { width: 26px; height: 26px; color: var(--accent); }
.dropzone strong { color: var(--ink); font-weight: 600; }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-info { margin: 0; padding: 0 16px 14px; font: 12px/1.5 var(--mono); color: var(--ink-2); }
.file-info:empty { display: none; }
.file-info.err { color: var(--bad); }

.route-actions { display: flex; align-items: center; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.status { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.msg { font-size: 14px; color: var(--ink-2); }
.msg:empty { display: none; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }
.bar { height: 6px; background: var(--surface-2); overflow: hidden; max-width: 420px; border-radius: 99px; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .3s; }
.bar.indeterminate span { width: 30%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* --- Vérification --- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1.5px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 16px 18px 14px; border-left: 1px solid var(--line); background: var(--surface); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font: 700 42px/1 var(--sans); letter-spacing: -.04em; }
.stat span { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.stat.matched b { color: var(--ok); }
.stat.uncertain b { color: var(--warn); }
.stat.notfound b { color: var(--bad); }
.stat.selected { background: var(--hl); }
.stat.selected b, .stat.selected span { color: var(--hl-ink); }

.toolbar { display: flex; align-items: center; gap: 16px; margin: 22px 0 14px; flex-wrap: wrap; }
.segmented { display: inline-flex; gap: 0; border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented button, .segmented label span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.segmented > * + * { border-left: 1.5px solid var(--line); }
.segmented button .c { font: 11px var(--mono); color: var(--ink-3); }
.segmented button[aria-selected=true], .segmented label input:checked + span { background: var(--ink); color: var(--bg); }
.segmented button[aria-selected=true] .c { color: inherit; opacity: .7; }
.segmented label { position: relative; display: flex; }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:focus-visible) span { outline: 2px solid var(--accent); outline-offset: -2px; }
.segmented.small button, .segmented.small label span { height: 30px; font-size: 13px; padding: 0 12px; }

.groups { display: flex; flex-direction: column; gap: 10px; }
.group { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary .chev { width: 13px; height: 13px; color: var(--ink-3); transition: transform .15s; flex: none; }
.group[open] > summary .chev { transform: rotate(90deg); }
.group > summary h3 { margin: 0; font: 700 17px/1.2 var(--sans); letter-spacing: -.015em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group > summary .count { font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.mix { margin-left: auto; display: flex; width: 120px; height: 6px; overflow: hidden; background: var(--surface-2); flex: none; border-radius: 99px; }
.mix i { display: block; height: 100%; }
.mix .m { background: var(--ok); } .mix .u { background: var(--warn); } .mix .n { background: var(--bad); }

.rows { border-top: 1px solid var(--line); max-height: 520px; overflow: auto; }
.row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 20px minmax(0, 1fr) 96px; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--sunken); }
.row.off { color: var(--ink-3); }
.row .t { min-width: 0; display: flex; align-items: center; gap: 10px; }
.row .t .tt { min-width: 0; flex: 1; }
.row .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t small { display: block; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .arr { color: var(--accent); width: 16px; height: 16px; }
.row .none { font-size: 13px; color: var(--ink-3); }
.row.excluded .t:not(.src) { opacity: .4; text-decoration: line-through; }
.conf { justify-self: end; display: inline-flex; align-items: center; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 4px 8px; border-radius: var(--radius-sm); white-space: nowrap; }
.conf.matched { background: var(--ok-soft); color: var(--ok); }
.conf.uncertain { background: var(--warn-soft); color: var(--warn); }
.conf.notfound, .conf.error { background: var(--bad-soft); color: var(--bad); }
.no-rows { padding: 18px; color: var(--ink-3); font-size: 14px; border-top: 1px solid var(--line); }

.actionbar { position: sticky; bottom: 16px; z-index: 10; margin-top: 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 12px 12px 18px; background: var(--ink); color: var(--bg); border-radius: 10px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .5); }
.actionbar .muted { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.actionbar .segmented { border-color: color-mix(in srgb, var(--bg) 25%, transparent); }
.actionbar .segmented > * + * { border-left-color: color-mix(in srgb, var(--bg) 25%, transparent); }
.actionbar .segmented label span { background: transparent; color: color-mix(in srgb, var(--bg) 75%, transparent); }
.actionbar .segmented label input:checked + span { background: var(--bg); color: var(--ink); }
.actionbar .msg { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.actionbar .msg.err { color: #ff8a80; }
.actionbar .bar { background: color-mix(in srgb, var(--bg) 20%, transparent); }
.actionbar .btn-primary { background: var(--hl); border-color: var(--hl); color: var(--hl-ink); }
.actionbar .btn-primary:hover:not(:disabled) { background: #e6ff7a; border-color: #e6ff7a; }
.actionbar-mode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.actionbar-go { display: flex; align-items: center; gap: 14px; margin-left: auto; min-width: 0; }
.actionbar-go .status { align-items: flex-end; text-align: right; }

.report { margin-top: 22px; padding: 28px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius); }
.report h3 { font: 700 34px/1.05 var(--sans); letter-spacing: -.025em; word-spacing: .08em; margin: 0 0 8px; }
.report h3 em { font-style: normal; background-image: linear-gradient(var(--hl), var(--hl)); background-size: 100% .4em; background-position: 0 88%; background-repeat: no-repeat; }
.report.has-errors h3 em { background-image: linear-gradient(var(--warn-soft), var(--warn-soft)); }
.report ul { list-style: none; padding: 0; margin: 18px 0; border-top: 1px solid var(--line); }
.report li { display: flex; gap: 12px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.report li .what { flex: 1; min-width: 0; font-weight: 600; }
.report li .k { color: var(--ink-3); font: 12px var(--mono); white-space: nowrap; }
.report .errors { color: var(--bad); font-size: 14px; background: var(--bad-soft); padding: 12px 14px; border-radius: var(--radius-sm); margin: 12px 0; }

.foot { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; padding: 28px 32px 64px; color: var(--ink-3); font: 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; border-top: 1px solid var(--line); }

/* --- Dialogue de connexion --- */
.dialog { border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 0; width: min(460px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.dialog::backdrop { background: rgba(9, 9, 11, .55); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.dlg { padding: 24px 24px 22px; }
.dlg-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.dlg-head h2 { font: 700 26px/1 var(--sans); letter-spacing: -.02em; margin: 0; }
.dlg-head .x { margin-left: auto; width: 34px; height: 34px; border-radius: var(--radius); border: 1.5px solid var(--line); background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.dlg-head .x:hover { border-color: var(--ink); color: var(--ink); }
.dlg-head .x svg { width: 13px; height: 13px; }
.dlg .segmented { margin-bottom: 6px; }
.field { display: block; margin: 14px 0 0; }
.field > span { display: flex; gap: 6px; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field > span .muted { font: 400 12px var(--mono); align-self: center; }
.field input { width: 100%; height: 44px; padding: 0 13px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--sunken); color: var(--ink); }
.field input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.dlg details { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.dlg details summary { cursor: pointer; font-weight: 600; }
.dlg details ol { margin: 10px 0 0; padding-left: 20px; }
.dlg details li { margin: 4px 0; }
.dlg code { font: 12px var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: var(--radius-sm); user-select: all; word-break: break-all; }
.dlg .note { font-size: 13px; color: var(--ink-3); margin: 12px 0 0; }
.dlg-foot { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.dlg-foot .btn { flex: none; }
.btn-oauth { width: 100%; height: 52px; margin-top: 16px; justify-content: flex-start; gap: 12px; font-size: 16px; }
.btn-oauth .mono { width: 30px; height: 30px; }

/* --- Import en direct --- */
.live { margin-top: 20px; padding: 22px 24px 18px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius); }
.live-head { display: flex; align-items: center; gap: 12px; }
.live-head h3 { margin: 0; font: 700 20px/1.2 var(--sans); letter-spacing: -.015em; }
.live-time { margin-left: auto; font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px transparent; } }
.live-big { display: flex; align-items: flex-end; gap: 18px; margin: 18px 0 12px; }
.live-big b { font: 700 64px/.85 var(--sans); letter-spacing: -.05em; }
.live-big b small { font-size: 28px; margin-left: 2px; letter-spacing: 0; color: var(--ink-3); }
.live-big > span { font: 13px/1.5 var(--mono); color: var(--ink-3); padding-bottom: 2px; }
.live-big strong { color: var(--ink); font-weight: 600; }
.bar.lg { height: 10px; max-width: none; }
.bar.lg span { transition: width .25s linear; }
.live-label { margin: 10px 0 14px; font-size: 14px; color: var(--ink-2); min-height: 1.5em; }
.live-tasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 330px; overflow: auto; }
.live-tasks li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 90px; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.live-tasks li:last-child { border-bottom: 0; }
.live-tasks .nm { min-width: 0; display: flex; flex-direction: column; }
.live-tasks .nm b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-tasks .nm small { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-tasks .ct { font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.live-tasks .mini { height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.live-tasks .mini i { display: block; height: 100%; background: var(--accent); transition: width .25s linear; }
.st { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font: 700 11px/1 var(--sans); }
li[data-state=waiting] { color: var(--ink-3); }
li[data-state=waiting] .nm b { color: var(--ink-2); }
li[data-state=running] { background: var(--accent-soft); }
li[data-state=running] .st { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
li[data-state=running] .nm small { color: var(--accent); }
li[data-state=done] .st { background: var(--ok); border-color: var(--ok); color: #fff; }
li[data-state=done] .st::after { content: '✓'; }
li[data-state=done] .mini i { background: var(--ok); }
li[data-state=failed] .st { background: var(--bad); border-color: var(--bad); color: #fff; }
li[data-state=failed] .st::after { content: '✕'; }
li[data-state=failed] .nm small { color: var(--bad); white-space: normal; }
li[data-state=failed] .mini i { background: var(--bad); }
#plan-card.locked .groups, #plan-card.locked .toolbar { opacity: .45; pointer-events: none; transition: opacity .2s; }

/* --- Compte --- */
.account { display: flex; align-items: center; gap: 14px; text-transform: none; letter-spacing: 0; font: 13px var(--sans); }
.acc-btn { height: 32px; font-size: 13px; }
.acc-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.acc-link:hover { color: var(--accent); }
.acc-email { font: 12px var(--mono); color: var(--ink-3); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font: 600 12px var(--sans); text-decoration: none; }
.pulse.sm { width: 7px; height: 7px; }
.mono.mail { background: var(--accent); color: #fff; font-size: 15px; }
.dlg .lead { color: var(--ink-2); margin: 0 0 4px; }
.dlg .note.dev { color: var(--warn); }
.waiting { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 14px; background: var(--sunken); border-radius: var(--radius); font: 13px var(--mono); color: var(--ink-2); }
.live-bg { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); }
.live-bg p { margin: 0; flex: 1; min-width: 220px; font-size: 14px; color: var(--ink-2); }
.live-bg b { color: var(--ink); }

/* --- Mes transferts --- */
.transfers { display: flex; flex-direction: column; gap: 10px; }
.tr { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tr[data-state=running] { border-color: var(--accent); }
.tr > summary { list-style: none; display: grid; grid-template-columns: 14px auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 18px; cursor: pointer; }
.tr > summary::-webkit-details-marker { display: none; }
.tr > summary .chev { width: 13px; height: 13px; color: var(--ink-3); transition: transform .15s; }
.tr[open] > summary .chev { transform: rotate(90deg); }
.tr-route { display: inline-flex; align-items: center; gap: 6px; }
.tr-route .arr { width: 14px; height: 14px; color: var(--accent); }
.tr-what { min-width: 0; display: flex; flex-direction: column; }
.tr-what b { font-weight: 700; letter-spacing: -.01em; }
.tr-what small { font: 12px var(--mono); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-num { font: 700 22px/1 var(--sans); letter-spacing: -.03em; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 5px 9px; border-radius: var(--radius-sm); white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.chip.running { background: var(--accent-soft); color: var(--accent); }
.chip.done { background: var(--ok-soft); color: var(--ok); }
.chip.partial, .chip.interrupted { background: var(--warn-soft); color: var(--warn); }
.chip.failed { background: var(--bad-soft); color: var(--bad); }
.tr-live { padding: 0 18px 16px; border-top: 1px solid var(--line); }
.tr-live .live-big { margin-top: 14px; }
.tr-live .live-big b { font-size: 44px; }
.tr-lists { list-style: none; margin: 0; padding: 4px 18px 12px; border-top: 1px solid var(--line); }
.tr-lists li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tr-lists li:last-child { border-bottom: 0; }
.tr-lists li span { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-lists li small { font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.tr-lists li.bad span, .tr-lists li.bad small { color: var(--bad); }
.tr-lists li.errs span { white-space: normal; font-weight: 400; font-size: 13px; }
.tr-note { margin: 0; padding: 12px 18px 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.tr-foot { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.textbtn.danger:hover { color: var(--bad); text-decoration-color: var(--bad); }

/* --- Bibliothèque (exploration + recherche) --- */
.dialog.lib { width: min(1060px, calc(100vw - 24px)); height: min(780px, calc(100dvh - 32px)); max-height: none; overflow: hidden; }
.lib-wrap { position: relative; display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100%; }
.lib-side { border-right: 1px solid var(--line); overflow: auto; padding: 16px 10px; background: var(--sunken); display: flex; flex-direction: column; gap: 2px; }
.lib-side-title { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 2px 8px 14px; letter-spacing: -.01em; }
.lib-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 8px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; min-width: 0; }
.lib-item:hover { background: var(--surface-2); }
.lib-item[aria-current=true] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.lib-item > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.lib-item b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item small { font: 11px var(--mono); color: var(--ink-3); }
.lib-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.lib-head { display: flex; align-items: flex-end; gap: 22px; padding: 26px 70px 20px 26px; min-height: 178px; }
.lib-head-txt { min-width: 0; }
.lib-kind { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.lib-head h2 { font: 700 34px/1.05 var(--sans); letter-spacing: -.025em; word-spacing: .08em; margin: 6px 0 8px; overflow-wrap: anywhere; }
.lib-head p { margin: 0; font: 12px var(--mono); color: var(--ink-2); }
.lib-head p.desc { font: 14px var(--sans); color: var(--ink-3); margin-top: 6px; max-width: 560px; }
.lib-loading { font: 13px var(--mono); color: var(--ink-3); }
.lib-tools { display: flex; align-items: center; gap: 14px; padding: 0 26px 12px; border-bottom: 1px solid var(--line); }
.lib-tools .search { flex: 1; margin: 0; height: 40px; }
.lib-count { font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.lib-list { flex: 1; overflow: auto; padding: 8px 14px 18px; }
.lib-empty { color: var(--ink-3); padding: 30px 12px; text-align: center; }
.lib-more { margin: 14px auto 0; display: flex; }
.lib-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.lib-close:hover { border-color: var(--ink); color: var(--ink); }
.lib-close svg { width: 13px; height: 13px; }

.trk > summary { list-style: none; display: grid; grid-template-columns: 30px 40px minmax(0, 2fr) minmax(0, 1.4fr) 96px 46px; gap: 12px; align-items: center; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.trk > summary::-webkit-details-marker { display: none; }
.trk > summary:hover, .trk[open] > summary { background: var(--sunken); }
.trk .n { font: 12px var(--mono); color: var(--ink-3); text-align: right; }
.trk .tt, .trk .al { min-width: 0; display: flex; flex-direction: column; }
.trk .tt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk .tt small, .trk .al { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk .al small { font: 11px var(--mono); }
.trk .d { font: 12px var(--mono); color: var(--ink-3); text-align: right; }
.trk.gone .tt, .trk.gone .cover { opacity: .45; }
.badge { display: inline-flex; align-items: center; justify-self: start; font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; border-radius: 3px; white-space: nowrap; }
.badge.q:not(:empty) { padding: 4px 6px; border: 1px solid var(--line); color: var(--ink-3); }
.badge.q.hires { border-color: var(--accent); color: var(--accent); }
.badge.e { margin-left: 6px; padding: 2px 4px; background: var(--ink-3); color: var(--bg); vertical-align: 2px; }
.trk-more { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 14px; margin: 0; padding: 10px 12px 16px 94px; font-size: 13px; }
.trk-more dt { font: 11px/1.7 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.trk-more dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }

/* --- Responsive --- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .intro { padding: 48px 0 40px; }
  .lede { font-size: 17px; }
  .block { padding: 22px 0 40px; }
  .block-head h2 { font-size: 28px; }
  .route { grid-template-columns: 1fr; }
  .route-arrow { padding: 14px 0; }
  .route-arrow svg { transform: rotate(90deg); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
  .stat b { font-size: 32px; }
  .row { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: 'c s k' '. m m'; row-gap: 4px; padding: 10px 14px; }
  .row > :nth-child(1) { grid-area: c; } .row > :nth-child(2) { grid-area: s; }
  .row > :nth-child(3) { display: none; }
  .row > :nth-child(4) { grid-area: m; padding-left: 10px; border-left: 2px solid var(--accent); }
  .row > :nth-child(5) { grid-area: k; }
  .mix { width: 56px; }
  .topbar-meta .privacy, .topbar-meta .version, .acc-email { display: none; }
  .tr > summary { grid-template-columns: 14px minmax(0, 1fr) auto; row-gap: 6px; padding: 12px 14px; }
  .tr-route { display: none; }
  .tr-num { display: none; }
  .toolbar .segmented { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .toolbar .segmented button { flex: 1 0 auto; padding: 0 10px; font-size: 13px; }
  .actionbar { bottom: 8px; padding: 12px; }
  .live { padding: 18px 16px 14px; }
  .live-big b { font-size: 48px; }
  .live-tasks li { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .live-tasks .mini { display: none; }
  .actionbar-mode .segmented { max-width: 100%; overflow-x: auto; }
  .actionbar-go { width: 100%; margin-left: 0; }
  .actionbar-go .status { align-items: flex-start; text-align: left; }
  .dialog.lib { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; border: 0; }
  .lib-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .lib-side { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; margin-right: 56px; scrollbar-width: none; }
  .lib-side-title { display: none; }
  .lib-item { width: auto; flex: none; max-width: 210px; }
  .lib-head { min-height: 0; padding: 18px 16px 14px; gap: 16px; }
  .cover.lg { width: 84px; height: 84px; }
  .lib-head h2 { font-size: 24px; }
  .lib-tools { padding: 0 16px 10px; }
  .lib-list { padding: 6px 6px 16px; }
  .lib-close { top: 10px; right: 10px; }
  .trk > summary { grid-template-columns: 40px minmax(0, 1fr) 42px; gap: 10px; }
  .trk .n, .trk .al, .trk .badge.q { display: none; }
  .trk-more { padding-left: 12px; grid-template-columns: 84px minmax(0, 1fr); }
}
/* Barre du haut : jamais de libellé coupé sur deux lignes (les traductions n'ont pas toutes la même longueur). */
.brand, .account > *, .lang-select { white-space: nowrap; }
@media (max-width: 480px) {
  .topbar-meta { gap: 10px; }
  .account { gap: 10px; }
  .account .acc-link { display: none; } /* la pastille « en cours » et la section 04 y mènent déjà */
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Sombre : texte clair sur fluo = illisible, le surlignage devient la couleur du texte. */
@media (prefers-color-scheme: dark) {
  .intro h1 mark, .report h3 em { background-image: none; color: var(--hl); }
}

/* Opérateur du service et pages légales */
.offered { margin: 18px 0 0; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.offered a { color: var(--ink-3); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.offered a:hover { color: var(--ink); }
.offered b { color: var(--ink); font-weight: 600; }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.legal-note { font-size: 13px; }
.legal-note a { color: inherit; text-decoration: underline; }
