:root {
  --bg: #0d0f14; --bg2: #151923; --surface: #171b24; --surface2: #1f2430; --line: rgba(255, 255, 255, .08);
  --text: #f1f3f8; --muted: #8e97a8; --accent: #ffb454; --accent2: #ff7a59; --on-accent: #1b1004;
  --grad: linear-gradient(135deg, #ffc15e, #ff7a59); --ok: #3ddc84; --bad: #ff6b6b;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35); --r: 18px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --bg: #f5f3ee; --bg2: #ece8df; --surface: #fff; --surface2: #f3f0e9; --line: rgba(20, 24, 33, .09); --text: #171b24; --muted: #667085; --accent: #d9730a; --accent2: #e0452b; --on-accent: #fff; --grad: linear-gradient(135deg, #f2a03a, #e0452b); --ok: #159a4d; --bad: #d03030; --shadow: 0 8px 24px rgba(40, 30, 10, .1); color-scheme: light; } }
:root[data-theme="light"] { --bg: #f5f3ee; --bg2: #ece8df; --surface: #fff; --surface2: #f3f0e9; --line: rgba(20, 24, 33, .09); --text: #171b24; --muted: #667085; --accent: #d9730a; --accent2: #e0452b; --on-accent: #fff; --grad: linear-gradient(135deg, #f2a03a, #e0452b); --ok: #159a4d; --bad: #d03030; --shadow: 0 8px 24px rgba(40, 30, 10, .1); color-scheme: light; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; color: var(--text); font: 16px/1.45 Inter, "Segoe UI Variable", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
body { background: radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .6rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }

.app { display: grid; grid-template-rows: 1fr auto; height: 100dvh; padding-top: env(safe-area-inset-top); }
main { overflow: auto; min-height: 0; }
nav { display: flex; gap: .25rem; margin: 0 .75rem calc(.6rem + env(safe-area-inset-bottom)); padding: .35rem; border-radius: 24px; background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow); }
nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: .5rem 0; border-radius: 18px; font-size: .72rem; font-weight: 600; color: var(--muted); min-height: 54px; transition: background .2s, color .2s; }
nav a svg { width: 24px; height: 24px; }
nav a.on { color: var(--on-accent); background: var(--grad); }
body.reading nav { display: none; }
@media (min-width: 900px) and (orientation: landscape) {
  .app { grid-template-rows: 1fr; grid-template-columns: 104px 1fr; }
  nav { order: -1; flex-direction: column; justify-content: center; margin: .75rem 0 .75rem .75rem; }
  body.reading .app { grid-template-columns: 1fr; }
}

.page { max-width: 960px; margin: 0 auto; padding: 1.2rem 1rem 2rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
input, select, textarea { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; font: inherit; min-height: 50px; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .95rem; }
label { display: block; font-size: .8rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); margin-bottom: .9rem; }
label input, label select, label textarea { margin-top: .3rem; color: var(--text); font-weight: 400; letter-spacing: 0; }
.form code { background: var(--surface2); padding: 0 .35em; border-radius: 6px; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row > label { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: 0 1.1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; user-select: none; transition: transform .12s, filter .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--grad); color: var(--on-accent); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent2) 35%, transparent); }
.btn.danger { color: var(--bad); }
.btn.icon { min-width: 48px; padding: 0 .6rem; font-size: 1.15rem; }
.btn.big { min-height: 64px; font-size: 1.1rem; border-radius: 18px; }
.btn:disabled { opacity: .35; }

.list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; }
.list li { display: flex; gap: .5rem; align-items: stretch; }
.list li > a:first-child { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .8rem; padding: .9rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-height: 62px; box-shadow: var(--shadow); transition: transform .12s, border-color .2s; }
.list li > a:first-child:active { transform: scale(.985); border-color: var(--accent); }
.list li > a:first-child b { font-size: 1.05rem; }
.list li .btn.icon { min-height: 62px; border-radius: var(--r); }
.tag { margin-left: auto; font-style: normal; font-weight: 800; font-size: .85rem; color: var(--on-accent); background: var(--grad); padding: .15rem .6rem; border-radius: 999px; }
.empty { padding: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
.chip { min-width: 48px; min-height: 44px; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s; }
.chip.on { background: var(--grad); color: var(--on-accent); border-color: transparent; }
#title { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; margin: 1rem 0 .6rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
.card { display: flex; flex-direction: column; align-items: center; gap: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: .8rem; color: var(--text); cursor: pointer; font: inherit; box-shadow: var(--shadow); transition: transform .12s, border-color .2s; }
.card:active { transform: scale(.97); border-color: var(--accent); }
.cd { width: 100%; max-width: 170px; height: auto; }

dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 28px; padding: 1.4rem; width: min(92vw, 400px); text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(5, 7, 10, .65); backdrop-filter: blur(6px); }
dialog h2 { margin: 0 0 .4rem; font-size: 2.4rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dlg-diagram { display: flex; align-items: center; gap: .3rem; }
.dlg-diagram .cd { flex: 1; min-width: 0; max-height: 46vh; }
dialog .row { justify-content: center; margin-top: .6rem; }

.tuner { display: flex; flex-direction: column; align-items: center; gap: .9rem; padding: 1.2rem 1rem 2rem; max-width: 560px; margin: 0 auto; }
.tn-note { font-size: clamp(5.5rem, 24vw, 10rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; transition: filter .2s; }
.tuner.ok .tn-note { background: none; color: var(--ok); filter: drop-shadow(0 0 24px color-mix(in srgb, var(--ok) 55%, transparent)); }
.tn-hint { font-size: 1.15rem; font-weight: 600; min-height: 1.6em; }
.tn-freq { color: var(--muted); font-variant-numeric: tabular-nums; }
.meter { position: relative; width: 100%; height: 64px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; box-shadow: inset 0 2px 10px rgba(0, 0, 0, .25); background-image: repeating-linear-gradient(90deg, var(--line) 0 2px, transparent 2px calc(10% )); }
.meter .zone { position: absolute; left: 45%; width: 10%; top: 0; bottom: 0; background: color-mix(in srgb, var(--ok) 28%, transparent); }
.needle { position: absolute; top: 8px; bottom: 8px; left: 50%; width: 6px; margin-left: -3px; background: var(--grad); border-radius: 3px; transition: left .12s; box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 60%, transparent); }
.tuner.ok .needle { background: var(--ok); box-shadow: 0 0 14px var(--ok); }
.strings { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; min-height: 66px; }
.str { min-width: 58px; min-height: 66px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 1.1rem; cursor: pointer; touch-action: manipulation; transition: transform .12s; }
.str:active { transform: scale(.94); }
.str.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.str.locked { background: var(--grad); color: var(--on-accent); border-color: transparent; }
.tuner select { max-width: 320px; text-align: center; }
.tuner .big { width: 100%; max-width: 320px; }

/* Lecteur */
.reader { display: flex; flex-direction: column; height: 100%; --fs: 20px; }
.reader-bar { display: flex; align-items: center; gap: .4rem; padding: .45rem .6rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(14px); }
.reader-bar .titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reader-bar .titles b { font-size: 1.02rem; }
.reader-bar .titles b, .reader-bar .titles span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-bar .btn { min-height: 44px; background: transparent; border-color: transparent; }
.grp { display: flex; align-items: center; gap: .1rem; background: var(--surface2); border-radius: 14px; } .tr { min-width: 2ch; text-align: center; font-weight: 800; color: var(--accent); }
.stage { position: relative; flex: 1; min-height: 0; }
.song-view { position: absolute; inset: 0; overflow-y: auto; padding: 1.2rem 3.5rem 70vh; font-size: var(--fs); overscroll-behavior: contain; }
.song { line-height: 1.25; }
.mode-pages .song-view { overflow: hidden; padding: 1.2rem 3.5rem; }
.mode-pages .song { height: 100%; overflow: hidden; column-width: 22em; column-gap: 3rem; column-fill: auto; }
.line { margin: 0 0 .5em; break-inside: avoid; }
.seg { display: inline-flex; flex-direction: column; vertical-align: top; }
.ly { white-space: pre-wrap; }
.ly:empty::before { content: "\00a0"; }
.ch { min-height: 1.3em; padding: .05em .5em .1em 0; margin-right: .2em; font-weight: 800; color: var(--accent); cursor: pointer; white-space: pre; letter-spacing: .01em; }
.ch[data-chord]:active { color: var(--accent2); }
.ch.note { color: var(--muted); font-weight: 400; cursor: default; }
.sec { display: inline-block; margin: 1.1em 0 .5em; padding: .15em .8em; font-size: .72em; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--surface2); border-radius: 999px; break-after: avoid; }
.gap { height: .8em; }
.edge { position: absolute; top: 12%; bottom: 12%; width: 2.8rem; border: 0; border-radius: 0 20px 20px 0; background: transparent; color: var(--muted); font-size: 2rem; opacity: .6; cursor: pointer; }
.edge.prev { left: 0; } .edge.next { right: 0; border-radius: 20px 0 0 20px; }
.edge:active { background: color-mix(in srgb, var(--accent) 22%, transparent); opacity: 1; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10rem; font-weight: 800; color: var(--accent); background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(6px); pointer-events: none; }
.overlay.small-msg { inset: auto 0 1rem; font-size: 1.05rem; background: none; backdrop-filter: none; }
.reader-dock { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 .6rem calc(.5rem + env(safe-area-inset-bottom)); padding: .45rem; border-radius: 26px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.reader-dock .auto { display: flex; align-items: center; gap: .4rem; }
.reader-dock .auto .big { min-width: 76px; border-radius: 22px; } .speed { min-width: 5.5ch; text-align: center; font-size: .8rem; font-weight: 600; color: var(--muted); }
.reader-dock > .big { flex: 1; max-width: 220px; background: transparent; border-color: transparent; }
.mode-pages .auto { visibility: hidden; }
@media (max-width: 480px) { .lbl { display: none; } .reader-bar .btn { min-width: 40px; padding: 0 .4rem; } .song-view, .mode-pages .song-view { padding-left: 3rem; padding-right: 3rem; } }
.overlay[hidden] { display: none; }
@media (max-width: 480px) { .reader-bar a[href$="/edit"] { display: none; } .str { min-width: 48px; } .strings { gap: .4rem; } }

/* Bandeau de diagrammes d'accords du lecteur */
.chordstrip { position: absolute; z-index: 2; display: none; gap: .5rem; pointer-events: none; }
.has-strip .chordstrip { display: flex; }
.chordstrip .mini { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 0; padding: .35rem .5rem .3rem; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); color: var(--text); font: inherit; box-shadow: var(--shadow); cursor: pointer; }
.chordstrip .mini .cd { width: 56px; height: auto; }
.chordstrip .mini b { font-size: .85rem; margin-top: -.2rem; }
.chordstrip .mini.now { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow); color: var(--accent); }
.btn.active { color: var(--accent); background: var(--surface2); }
/* Téléphone : rangée en bas du texte */
.chordstrip { left: 0; right: 0; bottom: .5rem; justify-content: center; }
.has-strip.mode-pages .song-view { padding-bottom: 130px; }
/* Tablette / large : colonne à droite */
@media (min-width: 760px) {
  .chordstrip { left: auto; right: 3rem; top: 1rem; bottom: auto; flex-direction: column; }
  .chordstrip .mini .cd { width: 78px; }
  .has-strip .song-view { padding-right: 9.5rem; }
  .has-strip.mode-pages .song-view { padding-bottom: 1.2rem; }
}

/* Repère de lecture : la ligne à chanter maintenant */
.guide { position: absolute; left: 0; right: 0; top: 30%; height: 0; z-index: 1; pointer-events: none; display: none; }
.guide::before { content: ""; position: absolute; left: .35rem; top: -9px; border: 9px solid transparent; border-left: 13px solid var(--accent); border-right: 0; }
.mode-pages .guide { display: none; }
.reader:not(.mode-pages) .guide { display: block; }
.line { border-radius: 10px; transition: background .2s; }
.line.cur { background: color-mix(in srgb, var(--accent) 13%, transparent); box-shadow: inset 4px 0 0 var(--accent); }

/* ---- Habillage plus vivant ---- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#view > * { animation: rise .35s ease both; }
.brand { display: flex; align-items: center; gap: .8rem; }
.brand img { border-radius: 14px; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent2) 35%, transparent); }
.brand h1 { font-size: 1.5rem; line-height: 1.1; }

.cover { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; font-weight: 800; font-size: 1.5rem; text-shadow: 0 1px 6px rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.c0 { background: linear-gradient(135deg, #ffb454, #ff7a59); } .c1 { background: linear-gradient(135deg, #7c5cff, #c264fe); }
.c2 { background: linear-gradient(135deg, #1fc8b4, #2c8cf4); } .c3 { background: linear-gradient(135deg, #ff6b9a, #ff9a5a); }
.c4 { background: linear-gradient(135deg, #3ddc84, #1aa3a0); } .c5 { background: linear-gradient(135deg, #4facfe, #7c5cff); }
.c6 { background: linear-gradient(135deg, #f7c948, #ef6c3c); } .c7 { background: linear-gradient(135deg, #e0529c, #7c3aed); }
.meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li > a.song { flex-wrap: nowrap; gap: .9rem; }
.list li > a.song .meta { flex: 1; }

.hero { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 1rem; border-radius: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero .cover { width: 68px; height: 68px; font-size: 2rem; border-radius: 20px; }
.hero .meta { flex: 1; } .hero .meta b { font-size: 1.25rem; white-space: normal; }
.hero small { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; }
.hero .go { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--grad); color: var(--on-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent2) 40%, transparent); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2.5rem 1rem; text-align: center; }
.empty-state div { font-size: 3rem; }

/* Accordeur : tête de guitare */
.strings.head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; width: 100%; max-width: 360px; }
.strings .col { display: flex; flex-direction: column; gap: .8rem; }
.strings.head .str { width: 64px; border-radius: 50%; min-height: 64px; }
.neck { position: relative; align-self: stretch; min-height: 230px; display: flex; justify-content: space-evenly; padding: 18px 10px 0; border-radius: 40px 40px 12px 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, #3a2412), #2a1a0e 70%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), var(--shadow); }
.neck i { width: 2px; height: 100%; border-radius: 1px; background: linear-gradient(180deg, #e8e8ee, #8a8a99); opacity: .75; }
.neck i.on { width: 4px; background: var(--accent); opacity: 1; box-shadow: 0 0 12px var(--accent); }

.card .cd { transition: transform .2s; } .card:active .cd { transform: scale(.94); }
dialog[open] { animation: rise .25s ease both; }

/* ---- Lecteur : plus de caractère ---- */
.reader { --tint: #ffb454; position: relative; }
.t0 { --tint: #ffb454; } .t1 { --tint: #9b7bff; } .t2 { --tint: #2fd0c0; } .t3 { --tint: #ff7fa6; }
.t4 { --tint: #3ddc84; } .t5 { --tint: #5aa9ff; } .t6 { --tint: #f7c948; } .t7 { --tint: #e0529c; }
.reader::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 55%; pointer-events: none; background: radial-gradient(70% 100% at 50% 0, color-mix(in srgb, var(--tint) 20%, transparent), transparent 75%); }
.reader > * { position: relative; }
.cover.sm { width: 38px; height: 38px; border-radius: 12px; font-size: 1.1rem; }
.progress { height: 3px; background: var(--line); }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--tint), var(--accent2)); border-radius: 0 3px 3px 0; transition: width .15s linear; }

/* Accords en pastilles, ligne en cours aérée, voisines atténuées */
.ch { padding: .02em .42em .06em; margin: 0 .35em .08em 0; border-radius: 9px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ch.note { background: none; }
.line { padding: .22em .7em .26em; margin: 0 0 .3em -.7em; border-radius: 14px; transition: background .25s, opacity .25s, box-shadow .25s; }
.reader:not(.mode-pages) .line { opacity: .62; }
.reader:not(.mode-pages) .line.cur { opacity: 1; background: color-mix(in srgb, var(--tint) 16%, transparent); box-shadow: inset 4px 0 0 var(--tint), 0 4px 18px color-mix(in srgb, var(--tint) 14%, transparent); }
.guide::before { border-left-color: var(--tint, var(--accent)); }
.sec { color: var(--tint); background: color-mix(in srgb, var(--tint) 16%, transparent); }
.grp .tr, .chordstrip .mini.now { color: var(--tint); }
.chordstrip .mini.now { border-color: var(--tint); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tint) 40%, transparent), var(--shadow); }
.ch { align-self: flex-start; }
.ch:not([data-chord]) { background: none; }

/* ---- Bibliothèque, setlists, feuille d'options, mode scène ---- */
.seg2 { display: flex; gap: .25rem; padding: .25rem; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.seg2 a { flex: 1; text-align: center; padding: .55rem; border-radius: 12px; font-weight: 700; color: var(--muted); }
.seg2 a.on { background: var(--grad); color: var(--on-accent); }
.tools { flex-wrap: nowrap; margin-bottom: .2rem; } .tools input { flex: 1; } .tools select { width: auto; flex: none; }
.btn.star { color: var(--muted); } .btn.star.on { color: var(--accent); }
.list li .btn.icon { min-height: 62px; border-radius: var(--r); }
.num { flex: none; width: 1.6rem; text-align: center; font-weight: 800; color: var(--muted); }
.btn-row { display: flex; align-items: center; gap: .9rem; width: 100%; padding: .7rem 1rem; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font: inherit; cursor: pointer; }
.btn-row .meta { flex: 1; }
.adder { margin: 1rem 0; } .adder summary { list-style: none; width: 100%; } .adder summary::-webkit-details-marker { display: none; } .adder input { margin: .6rem 0; }
#name { outline: none; min-width: 3ch; flex: 1; border-bottom: 2px dashed transparent; } #name:focus { border-color: var(--accent); }
.page-head h1[contenteditable] { cursor: text; }

.setbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .15rem .6rem; background: color-mix(in srgb, var(--tint) 14%, var(--surface)); font-weight: 700; font-size: .85rem; }
.setbar[hidden] { display: none; }
.setbar .btn { min-height: 38px; background: transparent; border-color: transparent; }
.nextcard { position: absolute; z-index: 3; left: 0; right: 0; bottom: .8rem; display: flex; justify-content: center; pointer-events: none; }
.nextcard[hidden] { display: none; } .nextcard .btn { pointer-events: auto; max-width: 90%; box-shadow: var(--shadow); }
.beat { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--line); transition: background .08s, transform .08s; }
.beat.on { background: var(--tint); transform: scale(1.5); box-shadow: 0 0 10px var(--tint); }
.speed small { display: block; font-size: .7rem; color: var(--tint); font-weight: 700; }
.ch small.orig { margin-left: .35em; font-weight: 500; opacity: .6; font-size: .72em; }

dialog.sheet { margin: auto auto 0; width: min(100vw, 560px); max-width: 100vw; border-radius: 28px 28px 0 0; text-align: left; padding: 1.2rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); }
dialog.sheet h2 { font-size: 1.3rem; background: none; color: var(--text); -webkit-text-fill-color: currentColor; margin-bottom: .6rem; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.opt .ctl { display: flex; align-items: center; gap: .4rem; flex: none; }
.opt .val { min-width: 3ch; text-align: center; font-weight: 800; }
dialog .row.end { justify-content: flex-end; margin-top: 1rem; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface2); cursor: pointer; padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch.on { background: color-mix(in srgb, var(--accent) 35%, var(--surface2)); } .switch.on i { transform: translateX(22px); background: var(--accent); }

/* Mode scène : noir profond, texte agrandi, interface discrète */
.stage-mode { background: #000; }
.stage-mode::before { display: none; }
.stage-mode .reader-bar, .stage-mode .reader-dock { background: #050505; backdrop-filter: none; box-shadow: none; }
.stage-mode .reader-dock { opacity: .75; }
.stage-mode .line:not(.cur) { opacity: .45 !important; }
.stage-mode .line.cur { background: #15110a; box-shadow: inset 5px 0 0 #ffc15e; }
.stage-mode .ch { background: transparent; color: #ffd27a; text-shadow: 0 0 12px rgba(255, 190, 90, .45); }
.stage-mode .ly { color: #fff; font-weight: 600; }
.stage-mode .sec { background: #1a1a1a; color: #aaa; }
.opt { flex-wrap: wrap; } .opt > span { flex: 1 1 9rem; } .opt .ctl { flex-wrap: wrap; justify-content: flex-end; }

/* Capo malin, accordage guidé */
.opt.col { flex-direction: column; align-items: stretch; }
.sugg { display: grid; gap: .4rem; }
.sg { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sg.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.sg span { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg em { font-style: normal; font-size: .75rem; font-weight: 700; color: var(--ok); }
.str.done { border-color: var(--ok); color: var(--ok); }
.str.done::after { content: " ✓"; }
.snip { margin-top: .15rem; font-size: .8rem; color: var(--muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snip mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); border-radius: 4px; padding: 0 .1em; }

/* ---- Impression / PDF ---- */
.printbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.printbar b { flex: 1; min-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.printbar .chk { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .9rem; color: var(--text); } .printbar .chk input { width: auto; min-height: 0; }
.printdoc { max-width: 900px; margin: 1rem auto; padding: 1.5rem; background: #fff; color: #000; font: 12pt/1.3 Georgia, "Times New Roman", serif; box-shadow: var(--shadow); }
.psong { break-after: page; padding-bottom: 1rem; } .psong:last-child { break-after: auto; }
.psong header h2 { margin: 0; font-size: 20pt; } .psong header span { color: #444; font: 10pt sans-serif; }
.pchords { display: flex; flex-wrap: wrap; gap: .5rem; margin: .7rem 0; color: #000; }
.pchords figure { margin: 0; width: 58px; text-align: center; font: 700 9pt sans-serif; } .pchords .cd { width: 100%; max-width: none; }
.pbody { column-width: 19em; column-gap: 2rem; }
.pl { margin: 0 0 .35em; break-inside: avoid; } .ps { display: inline-flex; flex-direction: column; vertical-align: top; }
.pc { min-height: 1.2em; padding-right: .4em; font: 700 10pt sans-serif; color: #000; white-space: pre; } .pw { white-space: pre-wrap; }
.psec { margin: .9em 0 .3em; font: 700 9pt sans-serif; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid #999; break-after: avoid; }
.pgap { height: .6em; }
@media print {
  @page { margin: 14mm; }
  .noprint { display: none !important; }
  html, body { height: auto !important; background: #fff !important; background-image: none !important; }
  .app { display: block !important; height: auto !important; padding: 0 !important; }
  main { overflow: visible !important; }
  #view > * { animation: none !important; }
  .printdoc { max-width: none; margin: 0; padding: 0; box-shadow: none; }
}

/* Comptes */
.error { margin: 0 0 .8rem; padding: .7rem .9rem; border-radius: 12px; font-weight: 600; color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); }
.error:empty { display: none; }
.error.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.notice { margin: 0 0 .8rem; padding: .7rem .9rem; border-radius: 12px; font-weight: 600; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.who { display: flex; align-items: center; gap: .9rem; margin-bottom: .8rem; }
.copy { font-size: .85rem; }
.users li { align-items: center; flex-wrap: wrap; gap: .5rem; padding: .6rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.users .meta { flex: 1; min-width: 10rem; }
.users .btn { min-height: 40px; }

/* Import en masse */
.progress.big { height: 8px; border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.progress.big i { background: var(--grad); }
.qtools { margin: .4rem 0 .8rem; }
.queue .qi { display: flex; align-items: center; gap: .8rem; padding: .6rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.queue .meta { flex: 1; } .queue .meta b { text-transform: capitalize; }
.qi .st { flex: none; width: 1.6rem; text-align: center; font-weight: 800; color: var(--muted); }
.qi.ok .st { color: var(--ok); } .qi.error .st, .qi.error .meta .muted { color: var(--bad); } .qi.skip .st { color: var(--accent); } .qi.running { border-color: var(--accent); }
.qi .btn.icon { min-height: 40px; min-width: 40px; }

/* Installation, hors ligne, bandeau réseau */
.status { list-style: none; margin: .8rem 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.status li { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .9rem; border-top: 1px solid var(--line); font-size: .92rem; }
.status li:first-child { border-top: 0; } .status span { color: var(--muted); }
.status .ok, .okline { color: var(--ok); font-weight: 700; } .status .warn { color: var(--accent); font-weight: 700; }
.bar { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + .5rem); max-width: min(92vw, 520px); padding: .55rem .9rem; border-radius: 16px; border: 1px solid var(--line); background: var(--surface2); box-shadow: var(--shadow); font-size: .85rem; font-weight: 600; text-align: center; }
.bar.offline { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.bar .btn { min-height: 34px; padding: 0 .8rem; margin-left: .4rem; }
body.reading .bar.offline { display: none; }
