/* Museek — appli locale. Scène sombre (bibliothèque, préparation, lecteur) et page de papier (espace d'écriture). */
:root {
  --ink: #0e0b19; --ink-2: #171226; --ink-3: #211a35; --ink-4: #2c2347;
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16);
  --text: #f4effc; --dim: #b0a8c9; --faint: #7d7498;
  --coral: #ff7a59; --gold: #ffc857; --rose: #ff5d8f; --violet: #8b6cff; --mint: #5fe3b0; --amber: #ffb84a;
  --sing: linear-gradient(90deg, #ffc857 0%, #ff8a5c 55%, #ff5d8f 100%);
  --paper: #f6efe2; --paper-2: #efe5d0; --paper-ink: #2b2336; --paper-dim: #7a6f86; --paper-line: #e3d6bb;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-rounded, "SF Pro Rounded", "Avenir Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px; --radius-s: 12px; --shadow: 0 18px 50px -18px rgba(0,0,0,.65);
  --gutter: clamp(16px, 4vw, 40px);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; min-height: 100vh; background: var(--ink); color: var(--text); font: 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 600px at 8% -10%, rgba(139,108,255,.22), transparent 60%), radial-gradient(800px 600px at 105% 105%, rgba(255,93,143,.16), transparent 60%), var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.icon { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.06); color: var(--text); font-weight: 600; letter-spacing: .01em; text-decoration: none; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: rgba(255,255,255,.12); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { border: 0; color: #2a1208; background: var(--sing); box-shadow: 0 10px 30px -10px rgba(255,122,89,.7); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 14px 34px -10px rgba(255,122,89,.85); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn.round { width: 48px; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid currentColor; line-height: 1.5; }
.chip.ready { color: var(--mint); } .chip.working, .chip.queued, .chip.downloading { color: var(--gold); } .chip.needs_lyrics, .chip.needs_models { color: var(--amber); }
.chip.error { color: var(--rose); } .chip.new { color: var(--dim); }

/* ---------- squelette ---------- */
.app-header { display: flex; align-items: center; gap: 18px; padding: 18px var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand .mark { width: 36px; height: 36px; border-radius: 11px; background: var(--sing); display: grid; place-items: center; box-shadow: 0 8px 24px -8px rgba(255,122,89,.8); }
.brand .mark .eq { height: 18px; } .brand .mark .eq i { background: #2a1208; width: 3px; }
.brand .word { font: italic 600 27px/1 var(--serif); letter-spacing: .01em; }
.brand .word b { font-style: normal; color: var(--gold); font-weight: 600; }
.app-header .grow { flex: 1; }
main#view { padding: 0 var(--gutter) 70px; max-width: 1180px; margin: 0 auto; }
main#view.bleed { max-width: none; padding: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(30px, 4.5vw, 46px); } h2 { font-size: clamp(22px, 3vw, 28px); }
.dim { color: var(--dim); } .faint { color: var(--faint); }

/* ---------- équaliseur ---------- */
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; }
.eq i { display: block; width: 4px; border-radius: 2px; background: currentColor; height: 30%; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; height: 60%; } * { scroll-behavior: auto !important; } }

/* ---------- bibliothèque ---------- */
.lib-top { display: grid; gap: 34px; padding-top: 6px; }
.lib-hero h1 { margin-bottom: 8px; }
.lib-hero p { margin: 0; color: var(--dim); max-width: 46ch; font-size: 19px; }
.drop { position: relative; overflow: hidden; display: grid; place-items: center; text-align: center; gap: 10px; padding: clamp(30px, 6vw, 56px) 24px; border-radius: 28px; border: 2px dashed var(--line-2);
  background: linear-gradient(160deg, rgba(139,108,255,.14), rgba(255,93,143,.08)); transition: border-color .2s, background .2s, transform .2s; cursor: pointer; }
.drop::before, .drop::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.07); pointer-events: none; }
.drop::before { width: 420px; height: 420px; left: -120px; top: -180px; box-shadow: 0 0 0 40px rgba(255,255,255,.015), 0 0 0 90px rgba(255,255,255,.012); }
.drop::after { width: 300px; height: 300px; right: -90px; bottom: -150px; box-shadow: 0 0 0 36px rgba(255,255,255,.015); }
.drop:hover, .drop.over { border-color: var(--gold); background: linear-gradient(160deg, rgba(255,200,87,.16), rgba(255,93,143,.12)); }
.drop.over { transform: scale(1.01); }
.drop .glyph { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--sing); color: #2a1208; box-shadow: 0 12px 34px -10px rgba(255,122,89,.8); position: relative; }
.drop h2 { position: relative; } .drop .hint { position: relative; margin: 0; color: var(--dim); font-size: 15px; }
.drop .or { position: relative; color: var(--faint); }
.drop .btn { position: relative; }
.upload-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; width: min(320px, 70%); position: relative; }
.upload-bar > i { display: block; height: 100%; width: 0; background: var(--sing); transition: width .2s; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 16px; }
.section-title h2 { font-size: 24px; } .section-title .count { color: var(--faint); font-family: var(--sans); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 22px; }
.card { position: relative; display: grid; gap: 0; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); overflow: hidden; text-align: left; padding: 0; color: inherit;
  transition: transform .18s, border-color .18s, box-shadow .18s; cursor: pointer; }
.card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card .art { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--ink-3); }
.card .art .cover { width: 100%; height: 100%; display: block; }
.card .art .chip { position: absolute; left: 12px; top: 12px; background: rgba(14,11,25,.78); backdrop-filter: blur(6px); }
.card .art .play { position: absolute; right: 12px; bottom: 12px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--sing); color: #2a1208;
  box-shadow: 0 10px 26px -8px rgba(255,122,89,.9); opacity: 0; transform: translateY(8px); transition: .2s; }
.card:hover .play, .card:focus-visible .play { opacity: 1; transform: none; }
@media (hover: none) { .card .art .play { opacity: 1; transform: none; } }
.card .info { padding: 14px 16px 16px; display: grid; gap: 3px; }
.card .name { font: 600 19px/1.25 var(--serif); overflow-wrap: anywhere; }
.card .artist { color: var(--dim); font-size: 15px; } .card .meta { color: var(--faint); font-size: 14px; margin-top: 4px; }
.card.busy .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%); background-size: 200% 100%; animation: sheen 1.8s linear infinite; }
@keyframes sheen { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { text-align: center; color: var(--dim); padding: 22px 0 0; }
.folder-note { color: var(--faint); font-size: 14px; margin-top: 40px; overflow-wrap: anywhere; }
.page-drop { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(14,11,25,.88); backdrop-filter: blur(8px); font: 600 32px var(--serif); border: 3px dashed var(--gold); margin: 14px; border-radius: 28px; pointer-events: none; }
.page-drop.show { display: grid; }

/* ---------- préparation ---------- */
.prep { display: grid; justify-items: center; padding-top: 4vh; }
.prep-card { width: min(680px, 100%); display: grid; gap: 26px; padding: clamp(22px, 4vw, 38px); border-radius: 28px; background: linear-gradient(170deg, var(--ink-3), var(--ink-2)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.prep-head { display: flex; gap: 20px; align-items: center; }
.prep-head .cover { width: 96px; height: 96px; border-radius: 20px; flex: none; box-shadow: 0 12px 30px -10px rgba(0,0,0,.7); }
.prep-head h1 { font-size: clamp(24px, 4vw, 34px); overflow-wrap: anywhere; }
.prep-head p { margin: 4px 0 0; color: var(--dim); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.step { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 11px 6px; border-radius: 12px; color: var(--faint); transition: color .2s, background .2s; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); }
.step.running { color: var(--text); background: rgba(255,200,87,.07); } .step.running .dot { border-color: var(--gold); color: var(--gold); }
.step.done { color: var(--dim); } .step.done .dot { background: var(--mint); border-color: var(--mint); color: #082a1b; }
.step .note { font-size: 13px; color: var(--faint); }
.prep-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--dim); font-size: 15px; }
.prep-note { margin: 0; color: var(--faint); font-size: 15px; }
.models-box { display: grid; gap: 14px; padding: 18px; border-radius: 16px; background: rgba(255,200,87,.07); border: 1px solid rgba(255,200,87,.3); }
.models-box ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.models-box li { display: flex; justify-content: space-between; gap: 14px; }
.models-box li small { display: block; color: var(--dim); }
.models-box .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.error-box { padding: 18px; border-radius: 16px; background: rgba(255,93,143,.08); border: 1px solid rgba(255,93,143,.35); display: grid; gap: 12px; }
.error-box p { margin: 0; overflow-wrap: anywhere; }

/* ---------- espace d'écriture : une page de papier ---------- */
.write { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 28px; align-items: start; padding-top: 6px; }
.write-head { grid-column: 1 / -1; display: grid; gap: 6px; }
.write-head .crumb { display: flex; align-items: center; gap: 12px; color: var(--dim); }
.write-head .why { color: var(--dim); max-width: 70ch; margin: 0; }
.write-head .reason { color: var(--faint); font-size: 15px; margin: 0; }
.paper { border-radius: 22px; background: var(--paper); color: var(--paper-ink); box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.4); overflow: hidden; display: grid; }
.paper-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 20px; background: var(--paper-2); border-bottom: 1px solid var(--paper-line); }
.paper-bar label { font-size: 14px; font-weight: 700; color: var(--paper-dim); letter-spacing: .05em; text-transform: uppercase; }
.paper-bar select { min-height: 44px; padding: 0 38px 0 14px; border-radius: 12px; border: 1px solid #d7c8a8; background: #fffaf0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%237a6f86' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; color: var(--paper-ink); appearance: none; -webkit-appearance: none; font-weight: 600; max-width: 100%; }
.lang-hint { flex-basis: 100%; margin: 0; font-size: 14px; color: var(--paper-dim); }
.lang-hint.weak { color: #9a4a12; }
.paper textarea { --lh: 38px; width: 100%; min-height: min(62vh, 640px); resize: vertical; border: 0; outline: 0; padding: 22px clamp(18px, 3vw, 34px) 30px; background-color: transparent; color: var(--paper-ink);
  font: 400 22px/var(--lh) var(--serif); background-image: repeating-linear-gradient(transparent 0, transparent calc(var(--lh) - 1px), var(--paper-line) calc(var(--lh) - 1px), var(--paper-line) var(--lh)); background-attachment: local; background-position: 0 22px; }
.paper textarea::placeholder { color: #a89c88; font-style: italic; }
.paper textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 3px rgba(255,138,92,.45); }
.paper-foot { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--paper-line); background: var(--paper-2); }
.paper-foot .count { color: var(--paper-dim); font-size: 14px; }
.tips { margin: 0; padding: 0; color: var(--paper-dim); font-size: 15px; }
.tips summary { cursor: pointer; font-weight: 700; color: var(--paper-ink); padding: 12px 20px; list-style: none; }
.tips summary::-webkit-details-marker { display: none; }
.tips summary::before { content: "＋ "; color: #c25a2d; } .tips[open] summary::before { content: "－ "; }
.tips ul { margin: 0 0 14px; padding: 0 22px 0 42px; display: grid; gap: 6px; }
.aid { border-radius: 22px; border: 1px solid var(--line); background: var(--ink-2); display: grid; overflow: hidden; position: sticky; top: 14px; max-height: calc(100vh - 28px); }
.aid-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; background: linear-gradient(170deg, var(--ink-3), var(--ink-2)); }
.aid-head .tag { display: inline-flex; width: fit-content; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(255,184,74,.12); color: var(--amber); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; border: 1px dashed rgba(255,184,74,.6); }
.aid-head h2 { font-size: 21px; } .aid-head p { margin: 0; color: var(--dim); font-size: 15px; }
.listen { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.listen input[type=range] { flex: 1; min-width: 120px; }
.listen label { display: inline-flex; gap: 8px; align-items: center; color: var(--dim); font-size: 14px; }
.listen .time { font-variant-numeric: tabular-nums; color: var(--faint); font-size: 14px; min-width: 88px; text-align: right; }
.draft { overflow: auto; padding: 8px 8px 12px; min-height: 120px; }
.draft-line { display: grid; grid-template-columns: 62px 1fr; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 9px 12px; color: var(--dim); font-family: var(--serif); font-size: 17px; line-height: 1.35; user-select: text; }
.draft-line:hover { background: rgba(255,255,255,.05); }
.draft-line.on { background: rgba(255,200,87,.12); color: var(--text); }
.draft-line .ts { font: 600 13px var(--sans); color: var(--faint); padding-top: 4px; font-variant-numeric: tabular-nums; }
.draft-line .tx { opacity: calc(.45 + var(--c, .5) * .55); font-style: italic; }
.draft-none { padding: 22px 20px; color: var(--faint); }
.aid-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.aid-foot small { color: var(--faint); }
input[type=range] { accent-color: var(--gold); height: 28px; }

/* ---------- lecteur : la scène ---------- */
.stage { position: relative; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; background: radial-gradient(1200px 700px at 50% -10%, rgba(139,108,255,.28), transparent 62%), radial-gradient(900px 600px at 50% 120%, rgba(255,93,143,.2), transparent 60%), #0b0814; }
.stage.immersive { position: fixed; inset: 0; z-index: 40; }
.stage-top { display: flex; align-items: center; gap: 14px; padding: 14px var(--gutter); transition: opacity .35s, transform .35s; z-index: 5; }
.stage-top .titles { flex: 1; min-width: 0; text-align: center; }
.stage-top .titles .t { font: 600 clamp(17px, 2.2vw, 22px)/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-top .titles .a { color: var(--dim); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-top .right { display: flex; gap: 10px; }
.stage-top .btn.fix span { display: none; } @media (min-width: 600px) { .stage-top .btn.fix span { display: inline; } }
.lyrics { position: relative; min-height: 0; overflow-y: auto; overflow-x: hidden; text-align: center; padding: var(--slot, 120px) clamp(18px, 7vw, 120px) 70vh; scrollbar-width: none; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade, 40px), #000 100%); }
.lyrics::-webkit-scrollbar { display: none; }
.line { font: 500 clamp(26px, 4.3vw, 54px)/1.22 var(--serif); margin: clamp(12px, 2.2vh, 22px) 0; color: var(--faint); opacity: .85; transition: color .25s, opacity .25s, transform .3s; transform-origin: center; overflow-wrap: anywhere; }
.line.current { color: #d9d2ec; opacity: 1; transform: scale(1.035); }
.line.inferred { font-style: italic; }
.line.inferred::before { content: "↻ "; color: var(--violet); font-style: normal; font-size: .6em; vertical-align: .15em; }
.word { cursor: pointer; padding: 0 .06em; border-radius: 6px; transition: background .12s; }
.word:hover { background: rgba(255,255,255,.1); }
.word.past { color: #9a91b8; }
.line.current .word.past { color: var(--gold); }
.word.active { background-image: linear-gradient(90deg, var(--gold) calc(var(--p, 0) * 100%), #e8e2f6 calc(var(--p, 0) * 100%)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; text-shadow: none; }
.word.review { box-shadow: 0 3px 0 -1px rgba(255,184,74,.9); background-color: rgba(255,184,74,.1); }
.word.review.info { box-shadow: 0 3px 0 -1px rgba(139,108,255,.9); background-color: rgba(139,108,255,.1); }
.show-conf .word.lowconf { text-decoration: underline dotted var(--amber); text-underline-offset: .18em; text-decoration-thickness: 2px; }
.show-conf .word.tiny { text-decoration: underline wavy var(--rose); text-underline-offset: .18em; }
.stage-bottom { padding: 8px var(--gutter) max(18px, env(safe-area-inset-bottom)); display: grid; gap: 10px; transition: opacity .35s, transform .35s; z-index: 5; background: linear-gradient(to top, rgba(11,8,20,.95) 40%, transparent); }
.stage.idle .stage-top { opacity: 0; transform: translateY(-14px); pointer-events: none; }
.stage.idle .stage-bottom { opacity: 0; transform: translateY(14px); pointer-events: none; }
.stage.idle { cursor: none; }
.notices { display: grid; gap: 6px; }
.notice { padding: 8px 14px; border-radius: 12px; font-size: 15px; background: rgba(255,184,74,.1); color: #ffe0ad; border: 1px solid rgba(255,184,74,.3); display: flex; gap: 10px; align-items: center; }
.transport { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.transport .bigplay { width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--sing); color: #2a1208; box-shadow: 0 12px 34px -8px rgba(255,122,89,.85); transition: transform .12s; }
.transport .bigplay:active { transform: scale(.94); } .transport .bigplay[disabled] { opacity: .4; }
.scrub-wrap { display: grid; gap: 4px; }
.scrub-wrap input { width: 100%; margin: 0; }
.times { display: flex; justify-content: space-between; color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.voice { display: inline-flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; }
.voice input { width: clamp(90px, 14vw, 150px); }
.review-wrap { position: relative; }
.zones { position: absolute; left: 0; bottom: calc(100% + 14px); width: min(440px, calc(100vw - 2 * var(--gutter))); max-height: min(52vh, 420px); overflow: auto; padding: 14px; border-radius: 20px; background: rgba(23,18,38,.97); backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); display: grid; gap: 6px; z-index: 10; }
.zones h3 { font-size: 18px; margin: 2px 4px 6px; }
.zone-row { display: grid; grid-template-columns: 52px 1fr; gap: 12px; text-align: left; align-items: baseline; padding: 11px 12px; border: 0; border-radius: 12px; background: rgba(255,255,255,.05); color: var(--text); font-size: 15px; line-height: 1.35; }
.zone-row:hover { background: rgba(255,255,255,.1); } .zone-row .ts { font-variant-numeric: tabular-nums; color: var(--amber); font-weight: 700; }
.zone-row:not(.warn) .ts { color: var(--violet); }
@media (max-width: 700px) { .transport { grid-template-columns: auto 1fr; } .tools { grid-column: 1 / -1; justify-content: space-between; } }
.drawer { position: absolute; right: var(--gutter); top: 70px; width: min(380px, calc(100% - 2 * var(--gutter))); z-index: 10; padding: 20px; border-radius: 20px; background: rgba(23,18,38,.96); backdrop-filter: blur(14px); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: grid; gap: 16px; }
.drawer h3 { font-size: 20px; }
.drawer .row { display: grid; gap: 6px; } .drawer .row small { color: var(--faint); }
.drawer select, .drawer input[type=number] { min-height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--ink-3); padding: 0 12px; }
.drawer .check { display: flex; gap: 12px; align-items: flex-start; } .drawer .check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--gold); }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; pointer-events: none; }
.stage-msg .box { pointer-events: auto; padding: 22px 26px; border-radius: 20px; background: var(--ink-3); border: 1px solid var(--line-2); display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 440px; }

/* ---------- alertes ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 10px; z-index: 100; width: min(520px, calc(100% - 32px)); }
.toast { padding: 13px 18px; border-radius: 14px; background: var(--ink-4); border: 1px solid var(--line-2); box-shadow: var(--shadow); transition: opacity .3s, transform .3s; }
.toast.error { border-color: rgba(255,93,143,.6); } .toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- tablette et petits écrans ---------- */
@media (max-width: 960px) { .write { grid-template-columns: 1fr; } .paper textarea { min-height: min(44vh, 460px); } .aid { position: static; max-height: none; } .draft { max-height: 46vh; } }
@media (max-width: 560px) { .prep-head { flex-direction: column; align-items: flex-start; } .paper textarea { font-size: 20px; --lh: 34px; } .app-header { padding-top: 12px; } }

/* ---------- À compléter ---------- */
.complete { display: grid; gap: 20px; max-width: 820px; margin: 0 auto; padding-top: 6px; }
.complete-head { display: grid; gap: 10px; justify-items: start; }
.complete-head .why { margin: 0; color: var(--dim); max-width: 62ch; }
.gap-card { display: grid; gap: 16px; padding: 22px; border-radius: 22px; background: linear-gradient(170deg, var(--ink-3), var(--ink-2)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.gap-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gap-card h2 { font-size: 22px; }
.gap-card .cand { display: grid; gap: 4px; justify-items: start; }
.gap-card blockquote { margin: 0; padding: 12px 18px; border-left: 4px solid var(--gold); background: rgba(255,200,87,.07); border-radius: 0 14px 14px 0; font: 500 21px/1.4 var(--serif); width: 100%; }
.gap-card .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.gap-card.busy { opacity: .8; }
.complete-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 6px; }

/* ---------- lecteur : passage sans texte ---------- */
.line.gapline { font-family: var(--sans); font-weight: 500; font-size: clamp(30px, 4.6vw, 56px); color: var(--faint); opacity: .8; letter-spacing: .3em; padding-left: .3em; }
.line.gapline.current { color: var(--amber); opacity: 1; transform: none; }
.gapline .bar { height: 6px; width: min(380px, 60%); margin: 12px auto 0; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; letter-spacing: 0; }
.gapline .bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--sing); }
.todo-btn { color: var(--amber); border-color: rgba(255,184,74,.5); }

.gap-card.hint { border-style: dashed; background: rgba(255,255,255,.03); }
.gap-card.auto { border-color: rgba(95,227,176,.35); }
.autolist { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--dim); }

.why { display: grid; gap: 10px; }
.why-choice { display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--text); }
.why-choice:hover { background: rgba(255,255,255,.1); border-color: var(--gold); }
.why-choice span { display: grid; gap: 2px; } .why-choice small { color: var(--dim); font-size: 14px; }
.neighbor { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.05); }
.neighbor .serif { font: 500 19px/1.3 var(--serif); }
.shift-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- décor des passages sans paroles (minimaliste) ---------- */
.line { position: relative; }
.decor-canvas { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% + 8px); pointer-events: none; }
.line.upnext { opacity: 1; }

/* ---------- exporter ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8,6,16,.72); backdrop-filter: blur(6px); padding: 16px; }
.modal-card { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 24px; background: linear-gradient(170deg, var(--ink-3), var(--ink-2)); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.modal-card > header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; }
.export-body { display: grid; gap: 14px; padding: 18px 24px 26px; }
.export-body h3 { font-size: 18px; margin-top: 4px; }
.notice.personal { align-items: flex-start; background: rgba(255,200,87,.1); border-color: rgba(255,200,87,.35); color: var(--text); }
.notice.personal small { display: block; margin-top: 4px; }
.choice { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--gold); background: rgba(255,200,87,.08); }
.choice input { accent-color: var(--gold); width: 20px; height: 20px; margin-top: 3px; }
.choice span { display: grid; gap: 2px; } .choice small { color: var(--dim); font-size: 14px; }
.guide-row { display: flex; align-items: center; gap: 14px; padding: 0 6px 0 48px; } .guide-row input { flex: 1; }
.seg { display: inline-flex; border-radius: 999px; border: 1px solid var(--line-2); overflow: hidden; width: fit-content; }
.seg button { border: 0; background: transparent; color: var(--dim); min-height: 42px; padding: 0 20px; font-weight: 700; letter-spacing: .04em; }
.seg button.on { background: var(--sing); color: #2a1208; }
.field { display: flex; align-items: center; gap: 12px; } .field select { min-height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--ink-3); padding: 0 12px; }
.export-file { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); }
.export-name { font: 600 15px/1.4 ui-monospace, Menlo, monospace; overflow-wrap: anywhere; color: var(--gold); }
.progress { display: flex; align-items: center; gap: 12px; } .progress .bar { flex: 1; height: 8px; border-radius: 8px; background: rgba(255,255,255,.1); overflow: hidden; } .progress .bar i { display: block; height: 100%; width: 0; background: var(--sing); transition: width .3s; }
.done { display: flex; gap: 14px; padding: 14px; border-radius: 14px; background: rgba(95,227,176,.08); border: 1px solid rgba(95,227,176,.35); }
.export-path { font: 14px/1.4 ui-monospace, Menlo, monospace; overflow-wrap: anywhere; color: var(--dim); margin: 2px 0; }

.export-pane { display: grid; gap: 14px; } .export-pane[hidden] { display: none; }
.seg.tabs { width: 100%; } .seg.tabs button { flex: 1; }
.bg-extra { display: grid; gap: 6px; padding-left: 48px; }

/* ---- fond d'écran (photos / vidéo) : derrière les paroles, jamais cliquable ---- */
.stage-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #0b0814; }
.stage-bg[hidden] { display: none; }
.stage > .stage-top, .stage > .lyrics, .stage > .stage-bottom { position: relative; }
.bg-editor { display: grid; gap: 14px; }
.bg-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bg-item { display: grid; gap: 6px; }
.bg-item .thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); cursor: crosshair; background: #000; }
.bg-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-item .thumb .focus { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 0 0 2px rgba(0,0,0,.55); pointer-events: none; }
.bg-item-tools { display: flex; gap: 4px; }
.bg-prevbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bg-frames { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bg-frames[data-aspect="9:16"] { grid-template-columns: repeat(4, 1fr); }
.bg-frames figure { margin: 0; display: grid; gap: 4px; } .bg-frames img { width: 100%; border-radius: 10px; border: 1px solid var(--line-2); display: block; }
.bg-frames figcaption { color: var(--dim); font-size: 13px; text-align: center; }

/* ---- service en ligne : connexion, zone utilisateur, installation sur l'écran d'accueil ---- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter, 20px); }
.login-card { width: min(440px, 100%); display: grid; gap: 14px; padding: 28px 24px; border-radius: 24px; background: linear-gradient(170deg, var(--ink-3), var(--ink-2)); border: 1px solid var(--line-2); box-shadow: var(--shadow); text-align: center; }
.login-mark { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(160deg, #ff8a5c, #ffb84a); color: #2a1208; }
.login-card h1 { margin: 0; font: 600 28px/1.15 var(--serif); }
.login-sub { margin: 0; color: var(--dim); font-size: 16px; line-height: 1.45; }
.login-form { display: grid; gap: 12px; text-align: left; }
.login-form label { font-weight: 600; font-size: 15px; }
.login-form input { min-height: 54px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--ink-3); color: inherit; padding: 0 16px; font-size: 18px; width: 100%; box-sizing: border-box; }
.login-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.login-code { text-align: center; letter-spacing: .5em; font-size: 26px !important; font-variant-numeric: tabular-nums; }
.btn.big { min-height: 54px; font-size: 17px; justify-content: center; }
.login-error { margin: 0; color: #ff9f9f; min-height: 1.3em; font-size: 15px; }
.login-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.login-note { margin: 4px 0 0; font-size: 14px; }
.user-area { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; min-width: 0; }
.user-area .who { color: var(--dim); font-size: 13px; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .user-area .who { display: none; } .app-header .word { font-size: 22px; } }
.install-hint { display: grid; gap: 6px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255,200,87,.07); margin: 0 0 16px; }
.install-hint strong { font-size: 15px; } .install-hint p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.45; }
.install-hint .btn { justify-self: start; }
/* téléphone : cibles tactiles confortables, rien ne dépasse de l'écran */
@media (max-width: 640px) {
  .btn { min-height: 44px; } .btn.small { min-height: 40px; }
  .lib-top { padding-bottom: 40px; }
}
@supports (padding: env(safe-area-inset-top)) { .app-header { padding-top: max(10px, env(safe-area-inset-top)); } }
@media (max-width: 640px) { .card .art { aspect-ratio: 16 / 9; } }
select, input, textarea { max-width: 100%; }
