:root {
  /* FretBlade : fond sombre, blanc et argent, accent orangé miel */
  --bg: #0a0a0f;
  --bg2: #111118;
  --card: #16161f;
  --card2: #1f1f2b;
  --line: #2b2b3a;
  --text: #f4f4f8;
  --muted: #9c9fb0;
  --silver: #c7cad6;
  --accent: #e3a23b;
  --accent2: #dcdfe8;
  --accent-ink: #1a1206;
  --honey: #f3c77a;
  --char: #93c5fd;
  --good: #4ade80;
  --bad: #f87171;
  --T: #4ade80;
  --SD: #60a5fa;
  --D: #f87171;
  --M: #c084fc;
  --radius: 14px;
  --nav-h: 62px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-h) + 16px);
  overscroll-behavior-y: contain;
  user-select: none;
}
input, select, textarea { user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
h2 { font-size: 1.25rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; color: var(--accent2); }
.card h3:first-child, .row-between h3 { margin-top: 0; }
p { margin: .4rem 0; }
.small { font-size: .82rem; }
.muted { color: var(--muted); }
b { font-weight: 650; }

/* En-tête */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(var(--bg) 70%, rgba(10, 10, 15, 0.92));
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: .3px; flex: 1; }
.logo { color: var(--honey); }
.tuning-badge {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 5px 12px; font-size: .8rem; color: var(--accent2); max-width: 55vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

main { padding: 12px 12px 0; max-width: 760px; margin: 0 auto; }

/* Navigation */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: var(--nav-h); display: flex;
  background: var(--bg2); border-top: 1px solid var(--line);
}
.nav button {
  flex: 1; background: none; border: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .66rem; padding: 0;
}
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav svg .f { fill: currentColor; stroke: none; }
.nav button.on { color: var(--honey); }
.nav button.on svg { filter: drop-shadow(0 0 6px rgba(227, 162, 59, .45)); }

/* Cartes et contrôles */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-row.center { justify-content: center; margin-bottom: 12px; }
.btn-row.between { justify-content: space-between; }
.btn {
  background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 14px; font-weight: 600; transition: transform .08s, background .15s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--honey); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: .85rem; }
.btn.big { padding: 12px 18px; font-size: 1rem; flex: 1; }
.btn.rec { background: #8e2a26; border-color: #c0453f; color: #fff; }
.icon-btn {
  min-width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card2); font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px;
}
.icon-btn:active { transform: scale(.94); }
.chip {
  border: 1px solid var(--line); background: var(--card2); border-radius: 999px;
  padding: 6px 12px; font-size: .88rem; white-space: nowrap; font-weight: 600;
}
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--honey); }
.chip.shape { border-color: var(--c); color: var(--c); }
.chip.shape.on { background: var(--c); color: #111; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 4px 10px; background: var(--bg2); border: 1px solid var(--line); font-size: .85rem;
}
.pill b { color: var(--accent2); }
.pill.char { border-color: var(--char); }
.pill.char b { color: var(--char); }
.pill.link { cursor: pointer; }
.pill.link:active { background: var(--card2); }
.wrap { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.scroll-x { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.roots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 8px; }
.roots .chip { padding: 8px 0; text-align: center; }
.seg {
  display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 12px;
}
.seg button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card2); color: var(--accent2); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.seg.small { margin: 0; }
.seg.small button { padding: 5px 10px; font-size: .8rem; }
.field { display: block; margin: 10px 0; font-size: .85rem; color: var(--muted); }
.field select, .field input:not([type=range]) {
  display: block; width: 100%; margin-top: 4px; background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: .95rem;
}
.field input[type=range] { width: 100%; accent-color: var(--honey); }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--honey); }
.ctl { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.ctl > span:first-child { flex: 1; color: var(--muted); font-size: .88rem; }
.ctl b { min-width: 70px; text-align: center; }
.tip {
  background: rgba(227, 162, 59, .1); border: 1px solid rgba(227, 162, 59, .35);
  border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: .9rem;
}
.mood { color: #d6d8e2; font-style: italic; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .78rem; color: var(--muted); margin-top: 8px; }

/* Diagrammes */
.diagram .d-fret { stroke: #474758; stroke-width: 1.2; }
.diagram .d-nut { stroke: #e8e9f0; stroke-width: 5; }
.diagram .d-string { stroke: #b9bcc8; }
.diagram .d-dot { fill: var(--text); }
.diagram .d-dot.is-root { fill: var(--accent); }
.diagram .d-open { fill: none; stroke: var(--text); stroke-width: 1.6; }
.diagram .d-open.is-root { stroke: var(--accent); stroke-width: 2.2; }
.diagram .d-x { fill: var(--muted); font-size: 15px; font-weight: 700; }
.diagram .d-lbl { fill: var(--accent-ink); font-size: 10px; font-weight: 800; pointer-events: none; }
.diagram .d-pos { fill: var(--accent2); font-size: 12px; font-weight: 700; }
.diagram .d-name { fill: var(--muted); font-size: 10px; }
.diagram .d-barre { fill: var(--text); opacity: .85; }
.diagram-wrap { display: flex; justify-content: center; padding: 6px 0; cursor: pointer; }
.chord-main .chord-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.chord-title { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--accent2); }
.vnav { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.formula-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.thumbs .thumb { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; flex: 0 0 auto; }
.thumbs .thumb.on { border-color: var(--honey); background: rgba(227, 162, 59, .1); }
.id-wrap { display: flex; justify-content: center; }
.col-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.id-result { text-align: center; min-height: 70px; margin-top: 6px; }

/* Manche */
.neck-scroll { overflow-x: auto; margin: 8px -14px; padding: 0 14px; }
.neck { display: block; }
.neck .n-fret { stroke: #5a5a6e; stroke-width: 1.5; }
.neck .n-nut { stroke: #e8e9f0; stroke-width: 5; }
.neck .n-string { stroke: #b9bcc8; }
.neck .n-inlay { fill: #26263a; }
.neck .n-sname { fill: var(--muted); font-size: 11px; font-weight: 700; }
.neck .n-fnum { fill: var(--muted); font-size: 10px; }
.neck .n-box { font-size: 12px; font-weight: 800; }
.neck .n-mark circle { fill: #3a3a4c; stroke: #0a0a0f; stroke-width: 1; }
.neck .n-mark text { fill: var(--text); font-size: 9.5px; font-weight: 800; pointer-events: none; }
.neck .n-mark.m-root circle { fill: var(--accent); }
.neck .n-mark.m-root text, .neck .n-mark.m-shape text { fill: var(--accent-ink); }
.neck .n-mark.m-char circle { fill: var(--char); }
.neck .n-mark.m-dim circle { fill: #24242f; }
.neck .n-mark.m-dim text { fill: #8a8a9c; }
.neck .n-mark.m-dim.m-root circle { fill: #6b4c1c; }
.neck .n-mark.m-scale circle { fill: #4a4a5e; }
.neck .n-mark { cursor: pointer; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #3a3a4c; }
.dot.d-root { background: var(--accent); }
.dot.d-char { background: var(--char); }
.caged-sel { display: flex; gap: 12px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Degrés */
.mode-card h2 { color: var(--accent2); }
.char-t { color: var(--char); }
.degrees { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.deg {
  display: flex; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; cursor: pointer; transition: background .2s;
}
.deg.is-char { border-color: var(--char); }
.deg.flash { background: rgba(227, 162, 59, .18); }
.deg-roman { min-width: 54px; font-size: 1.25rem; font-weight: 800; color: var(--honey); text-align: center; font-family: Georgia, serif; }
.deg-body { flex: 1; min-width: 0; }
.deg-name { font-weight: 700; font-size: 1.05rem; }
.fn { display: inline-block; font-size: .66rem; font-weight: 800; padding: 1px 6px; border-radius: 6px; color: #111; vertical-align: middle; }
.fn-T { background: var(--T); } .fn-SD { background: var(--SD); } .fn-D { background: var(--D); } .fn-M { background: var(--M); }
.badge { font-size: .65rem; border: 1px solid var(--char); color: var(--char); border-radius: 6px; padding: 1px 5px; vertical-align: middle; }
.prog { border-top: 1px solid var(--line); padding: 10px 0; }
.prog:first-of-type { border-top: 0; }
.prog-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* Composer */
.title-input {
  flex: 1; min-width: 0; background: none; border: 0; border-bottom: 1px dashed var(--line);
  color: var(--text); font-size: 1.3rem; font-weight: 800; padding: 4px 0;
}
.title-input:focus { outline: none; border-bottom-color: var(--honey); }
.song-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.transport { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.bpm { display: flex; align-items: center; gap: 8px; }
.bpm > div { display: flex; flex-direction: column; align-items: center; min-width: 46px; line-height: 1.1; }
.bpm > div b { font-size: 1.35rem; }
.section .section-name { background: none; border: 0; font-size: 1.05rem; font-weight: 800; color: var(--accent2); padding: 0; }
.sec-tools { display: flex; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.cchip {
  flex: 1 1 0; min-width: 64px; display: flex; flex-direction: column; align-items: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; line-height: 1.15;
  transition: background .12s, border-color .12s, transform .12s;
}
.cchip b { font-size: 1.05rem; }
.cchip span { font-size: .72rem; color: var(--honey); font-family: Georgia, serif; }
.cchip i { font-size: .65rem; color: var(--muted); font-style: normal; }
.cchip.on { border-color: var(--honey); }
.cchip.playing { background: var(--accent); color: var(--accent-ink); transform: scale(1.04); }
.cchip.playing span, .cchip.playing i { color: var(--accent-ink); }
.cchip.add { flex: 0 0 auto; min-width: 54px; justify-content: center; color: var(--honey); font-size: 1rem; border-style: dashed; }
.editor { display: flex; gap: 10px; align-items: center; background: var(--bg2); border-radius: 12px; padding: 8px; margin: 8px 0; flex-wrap: wrap; }
.editor-ctl { flex: 1; min-width: 180px; }
.editor-diag { cursor: pointer; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.np { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.np-next { text-align: center; opacity: .75; }
.chart { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: .8rem; white-space: pre-wrap; user-select: text; max-height: 220px; overflow: auto; }
.songlist { display: flex; flex-direction: column; gap: 6px; }
.song-row { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; flex: 1; min-width: 0; }
.song-row.on { border-color: var(--honey); }
.song-row .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.idea-row { display: flex; gap: 6px; align-items: stretch; }
.idea-row .icon-btn { height: auto; }
.menu { display: flex; flex-direction: column; gap: 8px; }
.pick-preview { display: flex; gap: 12px; align-items: center; margin-top: 10px; }

/* Idées / enregistrement */
.rec-card h3 { margin-top: 0; }
#rec-zone { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.rec-live { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--bg2); border-radius: 12px; padding: 12px; }
.rec-live b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.rec-count { font-size: 2.2rem; font-weight: 900; color: var(--honey); min-width: 40px; text-align: center; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: #e0453f; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.meter { flex: 1 1 100%; height: 6px; background: #000; border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--good), var(--accent), var(--bad)); transition: width .1s; }
.takes { display: flex; flex-direction: column; gap: 6px; }
.take { display: flex; align-items: center; gap: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.take-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Théorie */
.lessons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.lesson-card {
  display: flex; gap: 12px; align-items: center; text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.lesson-card > span:last-child { display: flex; flex-direction: column; }
.l-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--honey); }
.back { background: none; border: 0; color: var(--honey); padding: 0 0 8px; font-weight: 700; }
.lesson h2 { color: var(--accent2); }
.lesson-body { font-size: .96rem; }
.lesson-body ul, .lesson-body ol { padding-left: 20px; }
.lesson-body li { margin: 5px 0; }
.lesson-body .formula, .formula { text-align: center; font-weight: 800; font-size: 1.1rem; color: var(--accent2); letter-spacing: .5px; margin: 10px 0; }
.big-notes { text-align: center; font-weight: 700; color: var(--accent2); }
.steps li { margin: 10px 0; }
.playbtn {
  background: rgba(227, 162, 59, .14); border: 1px solid rgba(227, 162, 59, .5); color: var(--accent2);
  border-radius: 999px; padding: 4px 11px; font-size: .84rem; font-weight: 700; margin: 2px 2px;
}
.playbtn:active { background: var(--accent); color: var(--accent-ink); }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 8px 0; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 5px 4px; }
.tbl td { border-bottom: 1px solid var(--line); padding: 6px 4px; vertical-align: middle; }
.quiz .q { font-size: 1.1rem; margin: 12px 0; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.opt { padding: 14px 8px; }
.opt.good { background: var(--good); color: #0d1a10; border-color: var(--good); opacity: 1; }
.opt.bad { background: var(--bad); color: #1d0b0a; border-color: var(--bad); opacity: 1; }

/* Accordeur */
.tuner { text-align: center; }
.t-display { background: var(--bg2); border-radius: 16px; padding: 18px 10px; margin: 12px 0; }
.t-note { font-size: 3.6rem; font-weight: 900; line-height: 1; color: var(--text); transition: color .2s; }
.t-note.ok { color: var(--good); text-shadow: 0 0 18px rgba(95, 184, 122, .5); }
.t-meter { position: relative; height: 80px; margin: 10px auto; max-width: 300px; overflow: hidden; }
.t-scale { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); border-bottom: 2px solid var(--line); padding-bottom: 2px; }
.t-needle {
  position: absolute; left: 50%; bottom: 0; width: 3px; height: 70px; background: var(--accent);
  transform-origin: 50% 100%; transform: translateX(-50%); border-radius: 2px; transition: transform .12s;
}
.t-needle.idle { opacity: .25; }
.t-freq { color: var(--muted); font-size: .9rem; }
.t-strings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.custom-tuning { display: flex; justify-content: space-between; gap: 4px; margin: 8px 0; }
.ct { display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* Feuille modale */
.sheet { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  background: var(--card); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
  padding: 6px 16px 24px; transform: translateY(100%); transition: transform .25s ease;
  max-width: 760px; margin: 0 auto;
}
.sheet.open { pointer-events: auto; }
.sheet.open .sheet-bg { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.sheet-grip { width: 44px; height: 5px; background: var(--line); border-radius: 3px; margin: 6px auto 12px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px); transform: translate(-50%, 20px);
  background: var(--accent2); color: #0a0a0f; font-weight: 700; padding: 10px 16px; border-radius: 12px;
  opacity: 0; transition: all .25s; z-index: 60; pointer-events: none; max-width: 90vw; text-align: center; font-size: .9rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  .roots { grid-template-columns: repeat(12, 1fr); }
  .options { grid-template-columns: repeat(3, 1fr); }
}

/* Assistant d'ambiance */
.gen-cta { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border-color: rgba(227, 162, 59, .5); background: linear-gradient(135deg, rgba(227, 162, 59, .16), var(--card)); }
.gen-cta > span:last-child { display: flex; flex-direction: column; }
.moods { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mood-btn { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: .86rem; font-weight: 600; }
.mood-btn span { font-size: 1.15rem; color: var(--honey); width: 22px; text-align: center; }
.mood-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--honey); }
.mood-btn.on span { color: var(--accent-ink); }
.gen-result { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid rgba(227, 162, 59, .45); }
.gen-result .cchip { background: var(--card); }

/* Conseiller d'accordage */
.tadv { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; }
.tadv.best { border-color: var(--honey); box-shadow: 0 0 0 1px rgba(227, 162, 59, .25); }
.tadv-name { font-size: 1.05rem; color: var(--accent2); }
.bars { display: grid; gap: 4px; margin: 8px 0; }
.bars > div { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); }
.bars i { display: block; height: 7px; background: #000; border-radius: 4px; overflow: hidden; }
.bars b { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 4px; }
.facts { margin: 6px 0; padding-left: 18px; }
.facts li { margin: 2px 0; }
.tthumb { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 4px 0; font-size: .8rem; }

/* En-tête : deux badges (son + accordage) */
.top .tuning-badge { max-width: 34vw; }
#tone-badge { color: var(--text); }

/* Écran de jeu (défilement des accords) */
.stage {
  position: fixed; inset: 0; z-index: 70; background: radial-gradient(ellipse at top, #221a0e, var(--bg) 70%);
  display: none; flex-direction: column; padding: 14px 14px 18px; overflow: hidden;
}
.stage.open { display: flex; }
.st-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.st-top .row { display: flex; gap: 8px; }
.st-title { font-weight: 800; font-size: 1.05rem; }
.st-label { text-align: center; color: var(--honey); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; font-size: .8rem; margin-top: 10px; min-height: 1em; }
.st-main { flex: 1; display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 0; }
.st-now { display: flex; flex-direction: column; align-items: center; }
.st-chord { font-size: 3.6rem; font-weight: 900; color: #fff; line-height: 1; margin-bottom: 6px; text-shadow: 0 0 24px rgba(227, 162, 59, .35); }
.st-next { display: flex; flex-direction: column; align-items: center; opacity: .6; }
.st-next b { font-size: 1.3rem; }
.st-beats { display: flex; justify-content: center; gap: 10px; margin: 10px 0 14px; }
.st-beats span { width: 16px; height: 16px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); transition: background .06s, transform .06s; }
.st-beats span.on { background: var(--accent); transform: scale(1.25); border-color: var(--honey); }
.st-beats span:first-child.on { background: var(--accent2); }
.st-strip-wrap { position: relative; height: 70px; overflow: hidden; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.st-head { position: absolute; left: 30%; top: 0; bottom: 0; width: 3px; background: var(--accent); z-index: 2; box-shadow: 0 0 10px var(--accent); }
.st-strip { position: absolute; left: 30%; top: 0; bottom: 0; display: flex; will-change: transform; }
.st-cell { flex: 0 0 auto; border-right: 1px solid var(--line); padding: 8px 6px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; white-space: nowrap; }
.st-cell b { font-size: 1.05rem; }
.st-cell span { font-size: .7rem; color: var(--honey); font-family: Georgia, serif; }
.st-cell i { font-size: .6rem; color: var(--muted); font-style: normal; letter-spacing: 2px; }
.st-cell.on { background: rgba(227, 162, 59, .16); }
.st-count { position: absolute; top: 40%; left: 0; right: 0; text-align: center; font-size: 5rem; font-weight: 900; color: var(--honey); pointer-events: none; }
.st-mini {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 10px); z-index: 40; display: none;
  background: var(--card2); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 14px; text-align: left;
}
.st-mini.show { display: block; }

/* Tablature */
.tab-scroll { overflow-x: auto; margin: 10px -4px; padding-bottom: 6px; }
.tab { font-family: ui-monospace, "Roboto Mono", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.35; white-space: nowrap; display: inline-block; }
.tab-row { display: flex; }
.tab-s { width: 22px; color: var(--muted); flex: 0 0 auto; }
.tab-pm { color: var(--honey); font-size: 10px; }
.tc { white-space: pre; color: #c9ccd6; border-radius: 3px; }
.tc.on { background: var(--accent); color: var(--accent-ink); }
.tab-bar { color: var(--muted); }

/* Mouvement de basse */
.bass-line { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; padding-bottom: 4px; }
.bl-cell { flex: 1 0 84px; display: flex; flex-direction: column; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px 0; }
.bl-cell > .small { color: var(--honey); }
.bl-cell.playing { border-color: var(--honey); background: rgba(227, 162, 59, .15); }
.mood-btn .mood-txt { display: flex; flex-direction: column; line-height: 1.2; }
.mood-btn small { font-size: .7rem; font-weight: 500; opacity: .7; }

/* Analyse des riffs */
.score { display: inline-block; font-weight: 800; font-size: .85rem; padding: 2px 8px; border-radius: 8px; vertical-align: middle; }
.score.good { background: var(--good); color: #0d1a10; }
.score.ok { background: var(--accent); color: var(--accent-ink); }
.score.low { background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.ra-sum { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 6px; }
.ra li { margin: 6px 0; }
.tab-deg .tc { color: var(--honey); font-size: 10px; }
.riff-sec { border-left: 3px solid var(--accent); }
.section.playing { box-shadow: 0 0 0 2px var(--accent); }
/* Chanson */
.plan { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.plan-sec { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
details summary { cursor: pointer; color: var(--accent2); margin: 8px 0; }

/* ===== Thème FretBlade : argent + orangé miel ===== */
body { background: radial-gradient(ellipse at 50% -10%, #1d1709 0%, var(--bg) 55%) fixed, var(--bg); }
.brand { font-weight: 900; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.brand-name { background: linear-gradient(180deg, #ffffff 0%, #c7cad6 55%, #8f93a3 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .logo svg { width: 24px; height: 24px; display: block; filter: drop-shadow(0 0 6px rgba(227, 162, 59, .55)); }
.chord-title, .tadv-name { background: linear-gradient(180deg, #ffffff 0%, #d4d7e1 50%, #9da1b2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.st-chord { text-shadow: none; filter: drop-shadow(0 0 18px rgba(227, 162, 59, .55)); }
.card { background: linear-gradient(180deg, #181822 0%, var(--card) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset; }
.btn.primary { background: linear-gradient(180deg, #f2b957 0%, #d48a22 100%); border-color: #f2b957; box-shadow: 0 4px 14px rgba(212, 138, 34, .35); }
.chip.on, .mood-btn.on { background: linear-gradient(180deg, #f2b957 0%, #d48a22 100%); border-color: #f2b957; }
.seg button.on { color: #fff; box-shadow: inset 0 -2px 0 var(--accent), 0 1px 3px rgba(0, 0, 0, .35); }
.nav { background: rgba(14, 14, 20, .96); backdrop-filter: blur(8px); }
.nav button.on { color: #fff; }
.nav button.on svg { color: var(--honey); }
.tuning-badge { color: var(--silver); }
.diagram .d-dot { fill: #e8e9f0; }
.diagram .d-lbl { fill: #0a0a0f; }
.diagram .d-lbl.on-root { fill: #1a1206; }
.diagram .d-barre { fill: #e8e9f0; }
.neck .n-mark.m-shape text, .neck .n-mark.m-char text { fill: #0a0a0f; }
.neck .n-mark.m-root.m-dim text { fill: #fff; }
.deg-roman { color: var(--honey); }
.meter i, .bars b { background: linear-gradient(90deg, #c9822a, #f3c77a, #e4e6ee); }
.meter i { background: linear-gradient(90deg, var(--good), #f3c77a, var(--bad)); }
.st-head { background: #fff; box-shadow: 0 0 12px var(--accent); }
.st-beats span.on { background: var(--accent); border-color: var(--honey); }
.st-beats span:first-child.on { background: #fff; }
.tip { color: #e2e4ec; }

/* ===== iPhone : encoche et barre d'accueil (zones de sécurité) ===== */
.top { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); }
.nav { height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
body { padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
main { padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }
.sheet-panel { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.stage { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.st-mini { bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); }
/* iOS : pas de surbrillance ni de zoom intempestif */
html.ios input, html.ios select { font-size: 16px; }
html.ios body { -webkit-user-select: none; -webkit-touch-callout: none; }

/* ===== Bouton « Installer l'application » (version web) ===== */
.install-bar {
  display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; padding: 10px 12px;
  background: linear-gradient(135deg, rgba(227, 162, 59, .16), var(--card)); border: 1px solid rgba(227, 162, 59, .45);
  border-radius: var(--radius); max-width: 736px;
}
@media (min-width: 760px) { .install-bar { margin: 10px auto 0; } }
.install-bar[hidden] { display: none; }
.ib-icon img { width: 40px; height: 40px; border-radius: 10px; display: block; }
.ib-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ib-close { min-width: 32px; height: 32px; font-size: 1.2rem; }
.ig-steps { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.ig-steps li { display: flex; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ig-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.ig-ico { width: 22px; height: 22px; vertical-align: middle; color: var(--honey); }
.mood-btn .mood-txt { flex: 1; min-width: 0; text-align: left; }

/* listes déroulantes : options lisibles (Windows affiche sinon du texte clair sur fond blanc) */
select { color-scheme: dark; }
select option, select optgroup { background-color: #1f1712; color: #f4f4f8; }
