:root {
  --bg: #13110f;
  --surface: #1c1916;
  --surface-2: #26221e;
  --line: #2f2a25;
  --text: #f2ece5;
  --muted: #a1978c;
  --accent: #e9a23b;
  --accent-ink: #1a1206;
  --ok: #6cc28f;
  --warn: #e9a23b;
  --info: #79a8e0;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 2.4rem; line-height: 1.1; }
h2 { font-size: 1.15rem; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.r { text-align: right; justify-self: end; }

/* barre du haut */
.top { display: flex; align-items: center; gap: 1.5rem; padding: .9rem 2rem; border-bottom: 1px solid var(--line);
       position: sticky; top: 0; background: rgba(19,17,15,.92); backdrop-filter: blur(8px); z-index: 5; }
.brand { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.brand-mark { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent);
              margin-right: .35rem; box-shadow: 0 0 0 3px rgba(233,162,59,.25); }
.crumbs { color: var(--muted); font-size: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }
main { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* boutons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: 999px;
       border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit;
       font-weight: 500; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.1rem 0; }
.copy { background: none; border: 0; color: var(--accent); font: inherit; font-size: .82rem; cursor: pointer; padding: 0; }
.copy:hover { text-decoration: underline; }

/* pochettes */
.cover { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
         background: radial-gradient(120% 120% at 20% 10%, #5a3d1c 0%, #2a1f17 55%, #1a1512 100%); }
.cover::after { content: attr(data-initials); position: absolute; inset: 0; display: grid; place-items: center;
                font-family: var(--serif); font-size: 2.2rem; color: rgba(242,236,229,.55); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.cover.xl { width: 100%; max-width: 320px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.cover.xl::after { font-size: 4rem; }
.cover.sm { width: 44px; height: 44px; flex: none; border-radius: 6px; }
.cover.sm::after { font-size: .85rem; }

/* bibliothèque */
.lib-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.git-bar { margin-left: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.git-bar input { width: 220px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.6rem; }
.card { display: block; }
.card .cover { transition: transform .15s; }
.card:hover .cover { transform: translateY(-3px); }
.card-title { margin-top: .7rem; font-weight: 600; }
.card-sub { color: var(--muted); font-size: .88rem; }
.empty { padding: 3rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* page album */
.album-head { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; align-items: end; margin-bottom: 2.5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; color: var(--accent); margin-bottom: .5rem; }
.desc { font-size: 1.05rem; margin: .8rem 0 .4rem; }

.tracks { list-style: none; margin: 0; padding: 0; }
.track { display: grid; grid-template-columns: 2.2rem minmax(0, 2.2fr) minmax(0, 2fr) 7rem 4rem; gap: 1rem;
         align-items: center; padding: .6rem .8rem; border-radius: 8px; }
.tracks a.track:hover { background: var(--surface); color: var(--text); }
.track-head { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em;
              border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: .3rem; }
.num { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.t-main { display: flex; gap: .8rem; align-items: center; min-width: 0; }
.t-main > span { min-width: 0; display: flex; flex-direction: column; }
.t-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { display: flex; gap: .3rem; margin-top: .15rem; }
.chips { display: flex; gap: .35rem; flex-wrap: nowrap; overflow: hidden; min-width: 0;
         mask-image: linear-gradient(90deg, #000 85%, transparent); }
.chip { font-size: .75rem; padding: .12rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted);
        white-space: nowrap; }
.badge { font-size: .68rem; padding: .05rem .4rem; border-radius: 4px; border: 1px solid var(--line); color: var(--muted);
         text-transform: uppercase; letter-spacing: .05em; }
.badge.ok { color: var(--ok); border-color: rgba(108,194,143,.35); }
.pill { font-size: .75rem; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--muted);
        white-space: nowrap; }
.pill.final { background: rgba(108,194,143,.14); color: var(--ok); }
.pill.a-valider { background: rgba(233,162,59,.14); color: var(--warn); }
.pill.a-relire { background: rgba(121,168,224,.14); color: var(--info); }

.notes { margin-top: 2.5rem; }
.notes pre { white-space: pre-wrap; background: var(--surface); padding: 1rem; border-radius: var(--radius); font: inherit; }

/* page chanson */
.song { display: grid; grid-template-columns: 340px 1fr; gap: 3rem; align-items: start; }
.song-side .cover.xl { margin-bottom: 1.3rem; }
.song-title { font-size: 1.8rem; margin-bottom: .3rem; }
audio { width: 100%; margin-top: .6rem; }
.settings { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.settings h2 { margin-bottom: .8rem; }
.field { margin-bottom: .9rem; }
.field-head { display: flex; justify-content: space-between; font-size: .78rem; text-transform: uppercase;
              letter-spacing: .08em; color: var(--muted); margin-bottom: .3rem; }
.box { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem;
       font-size: .9rem; line-height: 1.45; }
.box.pre { white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.lyrics { background: var(--surface); border-radius: 14px; padding: 2rem 2.4rem 1.5rem; min-width: 0; }
.lyrics-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.2rem; }
.ly { font-family: var(--serif); font-size: 1.12rem; line-height: 1.7; }
.ly-sec { font-family: var(--sans); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent);
          margin: 1.4rem 0 .3rem; }
.ly-sec:first-child { margin-top: 0; }
.ly-hint { text-transform: none; letter-spacing: 0; color: var(--muted); font-size: .82rem; margin-left: .3rem; }
.ly-dir { color: var(--muted); font-style: italic; font-size: .98rem; }
.ly-gap { height: .5rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem;
         border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }

/* formulaires */
.edit-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.edit-head .actions { margin: 0; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.edit.narrow { max-width: 680px; }
label { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; font-size: .85rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 150px; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; width: 100%; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.55; }

.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translate(-50%, 1rem); background: var(--accent);
         color: var(--accent-ink); padding: .5rem 1rem; border-radius: 999px; font-weight: 600; opacity: 0;
         transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  main { padding: 1.2rem; }
  h1 { font-size: 1.8rem; }
  .album-head, .song, .edit-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .album-head .cover.xl { max-width: 220px; }
  .track { grid-template-columns: 1.6rem minmax(0, 1fr) 3.5rem; }
  .hide-sm { display: none; }
  .lyrics { padding: 1.4rem; }
}

/* ---- import d'album */
.import-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.import-table th, .import-table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
.import-table th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.import-table tr:hover td { background: var(--surface); }
.import-table label { cursor: pointer; }
.badge-new { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: .1rem .55rem; font-size: .8rem; font-weight: 600; }
.import-form .opt { display: block; margin: .4rem 0; }
.import-result { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; padding: 1rem; margin: 1rem 0;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.import-result.ok { border-color: #4f8a4b; }
.import-result.err { border-color: #b4483c; }
.import-result details { flex-basis: 100%; }
@media (max-width: 600px) { .import-table th:nth-child(4), .import-table td:nth-child(4) { display: none; } }

/* ---- chansons sélectionnées (MP3 sur Google Drive) */
:root { --sel: #6cc28f; --sel-bg: rgba(108,194,143,.09); }
.sel-count { color: var(--sel); font-weight: 600; }
.badge.sel { color: var(--sel); border-color: rgba(108,194,143,.45); background: var(--sel-bg); font-weight: 600; }
.tracks li.trk { display: flex; align-items: center; gap: .5rem; border-radius: 8px; border-left: 3px solid transparent; }
.tracks li.trk > a.track { flex: 1; min-width: 0; }
.tracks li.trk:not(.choisi):not(.track-head) { opacity: .55; }
.tracks li.trk:not(.choisi):hover { opacity: 1; }
.tracks li.trk.choisi { background: var(--sel-bg); border-left-color: var(--sel); margin: .15rem 0; }
.tracks li.trk.choisi .t-title { font-weight: 650; }
.tracks.filtre-on li.trk:not(.choisi) { display: none; }
.dl { display: inline-flex; gap: .35rem; flex: none; padding-right: .5rem; flex-wrap: wrap; }
.dl-btn { font: inherit; font-size: .78rem; font-weight: 600; padding: .3rem .6rem; border-radius: 999px; cursor: pointer;
          border: 1px solid var(--line); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.dl-btn:hover { border-color: var(--sel); color: var(--text); }
.dl-btn.mp3 { color: var(--sel); border-color: rgba(108,194,143,.45); }
.dl-btn.mp4 { color: var(--info); border-color: rgba(121,168,224,.45); }
.dl-btn.share { color: var(--accent); border-color: rgba(233,162,59,.45); }
.card.choisi .cover { outline: 3px solid var(--sel); outline-offset: 3px; }
.card-sel { color: var(--sel); font-size: .85rem; font-weight: 600; }
label.filtre { margin: 0; align-self: center; }
.partage { margin: .8rem 0 1rem; padding: 1rem; border: 1px solid rgba(108,194,143,.4); border-radius: var(--radius); background: var(--sel-bg); }
.partage .eyebrow { color: var(--sel); }
.partage .dl { margin: .7rem 0 .4rem; padding: 0; }
.lecteur { width: 100%; height: 64px; border: 0; border-radius: 8px; background: #000; }
.lecteur.video { height: auto; aspect-ratio: 16 / 9; }
.liens .field-head { margin-top: .6rem; }
input.lien { font-size: .8rem; padding: .35rem .5rem; color: var(--muted); }
@media (max-width: 860px) {
  .tracks li.trk { flex-wrap: wrap; }
  .tracks li.trk .dl { padding: 0 0 .5rem 2.6rem; }
}
@media (min-width: 861px) {
  .tracks .dl { width: 15rem; justify-content: flex-end; }
  .tracks .track-head { margin-right: calc(15rem + .5rem + 3px); margin-left: 3px; }
}
.dl.vide { padding: 0; }
.dl-btn.wait { color: var(--muted); cursor: default; }
.lecteur-local { width: 100%; border-radius: 8px; background: #000; }
.import-mp3 { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .2rem 0 .8rem; }
.import-mp3 label.btn { flex-direction: row; margin: 0; cursor: pointer; color: var(--text); font-size: .95rem; }
.rapport { margin: .3rem 0 0; padding-left: 1rem; flex-basis: 100%; }
.rapport li.ok { color: var(--ok); }
.rapport li.non { color: #e07a6c; }

/* ---- paroles modifiées */
.lyrics-tools { display: flex; gap: 1rem; }
.ly-tabs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .6rem; }
.ly-tabs form { margin-left: auto; }
.ly-tab { font: inherit; font-size: .82rem; padding: .3rem .8rem; border-radius: 999px; cursor: pointer;
          border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.ly-tab.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ly-count { display: inline-block; min-width: 1.3em; padding: 0 .3em; margin-left: .2em; border-radius: 999px;
            background: rgba(0,0,0,.2); font-weight: 700; }
.copy.danger { color: #e07a6c; }
.ly ins, .ly-legende ins { text-decoration: none; background: rgba(233,162,59,.28); color: var(--text);
                           border-radius: 3px; padding: 0 .12em; box-shadow: inset 0 -2px 0 var(--accent); }
.ly del, .ly-legende del { color: #e07a6c; text-decoration: line-through; text-decoration-thickness: 2px; opacity: .8; }
.ly .ly-mod { border-left: 3px solid var(--accent); padding-left: .6rem; margin-left: -.9rem; }
.ly-legende { margin: 0 0 1rem; }
.badge.modif { color: var(--accent); border-color: rgba(233,162,59,.45); }
a.tri { text-transform: none; letter-spacing: 0; color: var(--accent); }

/* ---- contrôle : note et avis */
.controle textarea { margin-bottom: .2rem; }
.notes-10 { display: grid; grid-template-columns: repeat(10, 1fr); gap: .25rem; margin-bottom: .9rem; }
.notes-10 label { margin: 0; display: block; }
.notes-10 input { position: absolute; opacity: 0; pointer-events: none; }
.notes-10 span { display: grid; place-items: center; height: 2.2rem; border-radius: 6px; cursor: pointer; font-weight: 600;
                 background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.notes-10 label:hover span { border-color: var(--accent); color: var(--text); }
.notes-10 input:checked + span { color: #1a1206; border-color: transparent; }
.notes-10 input:focus-visible + span { outline: 2px solid var(--accent); }
.n1 input:checked + span, .n2 input:checked + span, .n3 input:checked + span { background: #d8644f; }
.n4 input:checked + span, .n5 input:checked + span { background: #e0904a; }
.n6 input:checked + span, .n7 input:checked + span { background: #e9c03b; }
.n8 input:checked + span, .n9 input:checked + span, .n10 input:checked + span { background: #6cc28f; }
.note-big { font-size: 1rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.badge.note { font-weight: 700; color: #1a1206; border-color: transparent; }
.badge.note.n1, .badge.note.n2, .badge.note.n3, .note-big.n1, .note-big.n2, .note-big.n3 { background: #d8644f; }
.badge.note.n4, .badge.note.n5, .note-big.n4, .note-big.n5 { background: #e0904a; }
.badge.note.n6, .badge.note.n7, .note-big.n6, .note-big.n7 { background: #e9c03b; }
.badge.note.n8, .badge.note.n9, .badge.note.n10, .note-big.n8, .note-big.n9, .note-big.n10 { background: #6cc28f; }
.note-big { padding: 0 .5rem; border-radius: 6px; color: #1a1206; }

/* ---- connexion, compte, enregistrement automatique */
.moi { margin-left: auto; display: flex; gap: 1rem; font-size: .88rem; }
.page-connexion main { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.connexion { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line);
             border-radius: 14px; padding: 2rem 1.6rem; }
.connexion .brand { margin-bottom: 1.2rem; }
.connexion h1 { margin-bottom: 1rem; }
.connexion .btn { width: 100%; justify-content: center; margin-top: .4rem; }
.connexion .erreur { color: #e07a6c; margin: 0 0 1rem; }
.compte-bloc { margin: 1.6rem 0; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.compte-bloc h2 { margin-bottom: .8rem; display: flex; gap: .6rem; align-items: center; }
.autosave-etat { margin-right: .6rem; }
.autosave-etat.ok { color: var(--ok); }
.autosave-etat.err { color: #e07a6c; }
.paroles-zone { min-height: 60vh; margin-top: 1rem; }
