/* ============================================================
   KARAOKÉ GM — Feuille de style
   Palette scène : fond #0f0f0f, texte #f0f0f0,
   accords #4ade80, ligne active #fbbf24.
   ============================================================ */

/* ------------------------------------------------------------
   Jetons & base
   ------------------------------------------------------------ */

:root {
  --bg: #0f0f0f;
  --bg-soft: #141414;
  --bg-elev: #191919;
  --bg-elev-2: #222222;
  --bg-elev-3: #2b2b2b;
  --text: #f0f0f0;
  --text-dim: #b3b3b3;
  --text-faint: #7a7a7a;
  --green: #4ade80;
  --green-strong: #22c55e;
  --green-soft: rgba(74, 222, 128, .12);
  --yellow: #fbbf24;
  --yellow-soft: rgba(251, 191, 36, .12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .12);
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --shadow: 0 24px 70px rgba(0, 0, 0, .55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --lyrics-size: clamp(1.2rem, 1rem + 1.2vw, 2.1rem);
  --chord-size: clamp(.7rem, .58rem + .55vw, 1.2rem);
  --lyrics-scale: 1;
  --chord-scale: 1;
  --line-progress: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.page-leader,
body.page-follower {
  height: 100dvh;
  overflow: hidden;
}

body.page-landing {
  overflow-x: hidden;
  overflow-y: auto;
}

body.page-follower {
  --lyrics-size: clamp(1.35rem, 1rem + 2.35vw, 4.2rem);
  --chord-size: clamp(.8rem, .6rem + 1.2vw, 2.3rem);
  background:
    radial-gradient(900px 600px at 50% -10%, rgba(74, 222, 128, .05), transparent 60%),
    var(--bg);
}

body.page-leader {
  --lyrics-size: clamp(1.15rem, .95rem + 1.45vw, 2.35rem);
  --chord-size: clamp(.68rem, .56rem + .7vw, 1.3rem);
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(74, 222, 128, .3);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.stage,
.library-list,
.dialog-body,
textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.stage::-webkit-scrollbar,
.library-list::-webkit-scrollbar,
.dialog-body::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.stage::-webkit-scrollbar-thumb,
.library-list::-webkit-scrollbar-thumb,
.dialog-body::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

/* ------------------------------------------------------------
   Boutons, champs, badges
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 42px;
  padding: .55rem .9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #07130b;
}

.btn-primary:hover {
  background: #6ee7a0;
  border-color: #6ee7a0;
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  border-color: #ef4444;
  background: #ef4444;
  color: #1a0505;
}

.btn-danger:hover {
  border-color: #f87171;
  background: #f87171;
}

.btn-sm {
  min-height: 32px;
  padding: .35rem .65rem;
  border-radius: 9px;
  font-size: .78rem;
}

.btn-sm svg {
  width: 15px;
  height: 15px;
}

.btn-lg {
  min-height: 52px;
  padding: .8rem 1.2rem;
  border-radius: 14px;
  font-size: 1rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-dim);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  background: var(--bg-elev-2);
  border-color: var(--border);
  color: var(--text);
}

.icon-btn--glass {
  background: rgba(15, 15, 15, .6);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px);
}

.icon-btn.is-spinning svg {
  animation: spin .9s linear infinite;
}

.input,
.select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.input:focus,
.select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(74, 222, 128, .55);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .12);
}

.input--mono {
  font-family: var(--mono);
  font-size: .8rem;
}

.select {
  width: auto;
  padding-right: 1.9rem;
  appearance: none;
  background-color: var(--bg-elev);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 14px 14px;
}

.select--compact {
  min-height: 30px;
  padding: .2rem 1.7rem .2rem .55rem;
  border-radius: 8px;
  font-size: .72rem;
}

textarea {
  min-height: 160px;
  resize: vertical;
  font-family: var(--mono);
  font-size: .86rem;
  line-height: 1.55;
}

.field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}

.field > span {
  color: var(--text-faint);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 36px;
  padding: 0 .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge:hover {
  background: var(--bg-elev-2);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--text-faint);
}

.status-badge.is-online {
  border-color: rgba(74, 222, 128, .25);
  background: rgba(74, 222, 128, .06);
  color: var(--green);
}

.status-badge.is-online .status-dot {
  background: var(--green);
  animation: statusPulse 2.4s ease-in-out infinite;
}

.status-badge.is-offline {
  border-color: rgba(248, 113, 113, .25);
  background: rgba(248, 113, 113, .06);
  color: var(--red);
}

.status-badge.is-offline .status-dot {
  background: var(--red);
}

.status-badge.is-warn {
  border-color: rgba(251, 191, 36, .25);
  background: rgba(251, 191, 36, .06);
  color: var(--yellow);
}

.status-badge.is-warn .status-dot {
  background: var(--yellow);
}

.status-badge.is-warn .status-dot,
.status-badge.is-offline .status-dot {
  box-shadow: none;
}

/* ------------------------------------------------------------
   Bandeaux, toasts
   ------------------------------------------------------------ */

.banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  flex: none;
  padding: .55rem clamp(.75rem, 2vw, 1.1rem);
  border-bottom: 1px solid rgba(251, 191, 36, .18);
  background: rgba(251, 191, 36, .08);
  color: #fde68a;
  font-size: .8rem;
  line-height: 1.35;
  z-index: 18;
}

.banner-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: rgba(251, 191, 36, .16);
  color: var(--yellow);
  font-size: .72rem;
  font-weight: 800;
}

.banner-text {
  flex: 1;
  min-width: 12rem;
}

.banner .btn {
  flex: none;
}

.banner--error {
  border-color: rgba(248, 113, 113, .2);
  background: rgba(248, 113, 113, .08);
  color: #fecaca;
}

.banner--error .banner-icon {
  background: rgba(248, 113, 113, .16);
  color: var(--red);
}

.banner--danger {
  border-color: rgba(248, 113, 113, .32);
  background: rgba(248, 113, 113, .13);
  color: #fecaca;
}

.banner--danger .banner-icon {
  background: rgba(248, 113, 113, .22);
  color: #fecaca;
}

.toasts {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  width: min(460px, calc(100vw - 1.5rem));
  transform: translateX(-50%);
  pointer-events: none;
}

.page-leader .toasts {
  bottom: calc(150px + var(--safe-bottom));
}

/* Pendant la calibration, les messages ne doivent pas couvrir
   la barre TAP ni les boutons de correction. */
body.page-leader.is-calibrating .toasts {
  top: calc(64px + var(--safe-top));
  bottom: auto;
}

.page-follower .toasts {
  bottom: calc(64px + var(--safe-bottom));
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(25, 25, 25, .96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  font-size: .82rem;
  line-height: 1.4;
  cursor: pointer;
  animation: toastIn .18s ease-out;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: .05rem;
  border-radius: 50%;
  background: var(--bg-elev-3);
  color: var(--text-dim);
  font-size: .68rem;
  font-weight: 800;
}

.toast--success {
  border-color: rgba(74, 222, 128, .3);
}

.toast--success .toast-icon {
  background: var(--green-soft);
  color: var(--green);
}

.toast--error {
  border-color: rgba(248, 113, 113, .3);
}

.toast--error .toast-icon {
  background: rgba(248, 113, 113, .14);
  color: var(--red);
}

.toast.is-out {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}

/* ------------------------------------------------------------
   Dialogues
   ------------------------------------------------------------ */

dialog.dialog {
  width: min(560px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: min(88dvh, 900px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog.dialog::backdrop {
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(6px);
}

dialog.dialog[open] {
  display: flex;
  animation: dialogIn .18s ease-out;
}

.dialog-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(88dvh, 900px);
  min-height: 0;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex: none;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.dialog-head > div {
  min-width: 0;
}

.dialog-head h2 {
  margin-top: .15rem;
  font-size: 1.2rem;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.dialog-sub {
  margin-top: .2rem;
  color: var(--text-faint);
  font-size: .78rem;
}

.dialog-body {
  min-height: 0;
  padding: 1.15rem;
  overflow: auto;
}

.dialog-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  flex: none;
  padding: .8rem 1.15rem calc(.9rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
}

.foot-spacer {
  flex: 1;
}

.eyebrow {
  color: var(--green);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.version {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: .7rem;
}

dialog.dialog--wide {
  width: min(800px, calc(100vw - 2rem));
}

dialog.dialog--library {
  width: min(880px, calc(100vw - 2rem));
  height: min(82dvh, 820px);
}

.dialog--library .dialog-shell {
  height: 100%;
}

dialog.dialog--editor {
  width: min(1100px, calc(100vw - 2rem));
  height: min(88dvh, 900px);
}

.dialog--editor .dialog-shell {
  height: 100%;
}

dialog.dialog--help {
  width: min(760px, calc(100vw - 2rem));
  height: min(88dvh, 900px);
}

.dialog--help .dialog-shell {
  height: 100%;
}

dialog.dialog--small {
  width: min(440px, calc(100vw - 2rem));
}

dialog.dialog--playlist {
  width: min(680px, calc(100vw - 2rem));
  height: min(82dvh, 820px);
}

.dialog--playlist .dialog-shell {
  height: 100%;
}

/* ------------------------------------------------------------
   Bibliothèque et playlists
   ------------------------------------------------------------ */

.playlist-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  flex: none;
  padding: .55rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .018);
}

.playlist-select {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex: 1;
  min-width: 190px;
  color: var(--green);
}

.playlist-select > svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.playlist-select .select {
  width: 100%;
  min-height: 34px;
  background-color: var(--bg);
  color: var(--text);
  font-size: .8rem;
  font-weight: 600;
}

.playlist-bar .icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
}

.playlist-bar .icon-btn:disabled {
  opacity: .3;
}

.playlist-pick-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .55rem;
  min-height: 0;
}

.playlist-pick-body .search-field {
  flex: none;
}

.playlist-pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.playlist-pick-list {
  flex: 1;
  min-height: 180px;
  overflow: auto;
  padding: .2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, .12);
}

.playlist-pick-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .55rem;
  border-radius: 9px;
  cursor: pointer;
}

.playlist-pick-row:hover {
  background: rgba(255, 255, 255, .035);
}

.playlist-pick-row input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--green);
}

.playlist-pick-copy {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}

.playlist-pick-copy strong {
  overflow: hidden;
  font-size: .86rem;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.playlist-pick-copy small {
  overflow: hidden;
  color: var(--text-faint);
  font-size: .7rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.playlist-pick-empty {
  padding: 1.5rem 1rem;
  color: var(--text-faint);
  font-size: .82rem;
  text-align: center;
}

.playlist-count {
  color: var(--text-faint);
  font-size: .72rem;
}

.song-order {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: none;
}

.song-order button {
  width: 24px;
  height: 21px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: .55rem;
  line-height: 1;
}

.song-order button:hover:not(:disabled) {
  border-color: rgba(74, 222, 128, .35);
  color: var(--green);
}

.song-order button:disabled {
  opacity: .22;
}

.library-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  flex: none;
  padding: .75rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.search-field {
  display: flex;
  align-items: center;
  flex: 1;
  gap: .5rem;
  min-width: 180px;
  height: 42px;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text-faint);
}

.search-field:focus-within {
  border-color: rgba(74, 222, 128, .5);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .1);
}

.search-field svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .85rem;
}

.library-list {
  flex: 1;
  min-height: 0;
  padding: .55rem .65rem;
  overflow: auto;
}

.library-foot {
  flex: none;
  padding: .65rem 1.15rem;
  border-top: 1px solid var(--border);
}

.library-hint {
  color: var(--text-faint);
  font-size: .72rem;
  line-height: 1.5;
}

.library-hint code {
  color: var(--text-dim);
  font-family: var(--mono);
}

.library-hint a {
  color: var(--green);
  text-decoration: none;
}

.library-hint a:hover {
  text-decoration: underline;
}

.song-row {
  display: flex;
  align-items: stretch;
  gap: .25rem;
  padding: .15rem;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background .15s ease, border-color .15s ease;
}

.song-row + .song-row {
  margin-top: .2rem;
}

.song-row:hover {
  background: rgba(255, 255, 255, .03);
}

.song-row.is-current {
  border-color: rgba(74, 222, 128, .25);
  background: rgba(74, 222, 128, .06);
}

.song-row.is-flash {
  animation: rowFlash 1.4s ease-out;
}

.song-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
  padding: .6rem .7rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.song-line {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.song-title {
  overflow: hidden;
  color: var(--text);
  font-size: .95rem;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.song-meta {
  overflow: hidden;
  color: var(--text-faint);
  font-size: .72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 .4rem;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-elev-2);
  color: var(--text-faint);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.source-badge--local {
  border-color: rgba(251, 191, 36, .2);
  background: rgba(251, 191, 36, .06);
  color: var(--yellow);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 18px;
  padding: 0 .45rem;
  flex: none;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.live-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: statusPulse 2s ease-in-out infinite;
}

.song-menu {
  align-self: center;
  color: var(--text-faint);
}

.library-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 2rem 1rem;
  gap: .5rem;
  color: var(--text-dim);
  text-align: center;
}

.library-empty > svg {
  width: 42px;
  height: 42px;
  margin-bottom: .4rem;
  color: var(--text-faint);
}

.library-empty h3 {
  color: var(--text);
  font-size: 1.05rem;
}

.library-empty p {
  max-width: 34em;
  font-size: .82rem;
}

.library-empty .empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: .7rem;
}

.library-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 2.5rem 1rem;
  color: var(--text-faint);
  font-size: .82rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ------------------------------------------------------------
   Éditeur
   ------------------------------------------------------------ */

.editor-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  flex: 1;
  gap: 1.1rem;
  padding: 1.15rem;
  overflow: hidden;
}

.editor-fields {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  min-height: 0;
}

.field--grow {
  flex: 1;
  min-height: 0;
}

.field--grow textarea {
  height: 100%;
  min-height: 220px;
  resize: none;
}

.editor-help {
  color: var(--text-faint);
  font-size: .75rem;
  line-height: 1.5;
}

.editor-help code {
  color: var(--green);
  font-family: var(--mono);
  font-size: .72rem;
}

.editor-preview-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex: none;
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--border);
}

.preview-hint {
  color: var(--text-faint);
  font-size: .7rem;
}

.lyrics.lyrics--preview {
  --lyrics-size: 1rem;
  --chord-size: .65rem;
  flex: 1;
  width: 100%;
  padding: 1rem .85rem;
  overflow: auto;
}

.lyrics--preview .lyric-line {
  padding: .2rem .45rem .25rem .7rem;
  opacity: .75;
}

.lyrics--preview .lyric-line + .lyric-line {
  margin-top: .1rem;
}

.lyrics--preview .lyric-line.is-active {
  opacity: 1;
}

.preview-empty {
  padding: 1rem 0;
  color: var(--text-faint);
  font-size: .8rem;
  text-align: center;
}

/* ------------------------------------------------------------
   QR code
   ------------------------------------------------------------ */

.qr-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
}

.qr-card {
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

.qr-code {
  display: grid;
  place-items: center;
  width: min(320px, 62vw);
  aspect-ratio: 1;
}

.qr-code img {
  width: 100% !important;
  height: 100% !important;
}

.qr-code canvas {
  width: 100% !important;
  height: 100% !important;
}

.qr-help {
  max-width: 30em;
  color: var(--text-dim);
  font-size: .85rem;
  text-align: center;
}

.qr-warning {
  padding: .6rem .75rem;
  border: 1px solid rgba(248, 113, 113, .2);
  border-radius: 10px;
  background: rgba(248, 113, 113, .08);
  color: #fecaca;
  font-size: .78rem;
}

.qr-warning code {
  font-family: var(--mono);
}

.url-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
}

.url-row .input {
  flex: 1;
  min-width: 0;
}

dialog.qr-large {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
}

dialog.qr-large .dialog-shell {
  height: 100dvh;
  max-height: 100dvh;
}

dialog.qr-large .dialog-body {
  flex: 1;
  justify-content: center;
  overflow: hidden;
}

dialog.qr-large .qr-card {
  padding: 28px;
}

dialog.qr-large .qr-code {
  width: min(78vmin, 820px);
}

dialog.qr-large .qr-help,
dialog.qr-large .qr-warning,
dialog.qr-large .url-row {
  display: none;
}

/* ------------------------------------------------------------
   Aide & configuration
   ------------------------------------------------------------ */

.help-body {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.help-section {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.section-head h3 {
  margin-top: .2rem;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}

.config-item {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
  padding: .6rem .7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.config-item span {
  color: var(--text-faint);
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.config-item strong {
  overflow-wrap: anywhere;
  font-size: .8rem;
  font-weight: 600;
}

.config-item strong.is-ok {
  color: var(--green);
}

.config-item strong.is-warn {
  color: var(--yellow);
}

.config-item strong.is-bad {
  color: var(--red);
}

.config-grid .mono {
  font-family: var(--mono);
  font-size: .72rem;
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.config-result {
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: .75rem;
  line-height: 1.45;
}

.config-result.is-ok {
  border-color: rgba(74, 222, 128, .25);
  background: var(--green-soft);
  color: var(--green);
}

.config-result.is-bad {
  border-color: rgba(248, 113, 113, .25);
  background: rgba(248, 113, 113, .08);
  color: #fecaca;
}

.config-note {
  color: var(--text-dim);
  font-size: .78rem;
  line-height: 1.55;
}

.config-note strong {
  color: var(--text);
}

.code-block {
  margin: 0;
  padding: .8rem .9rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0a0a0a;
  color: #d4d4d4;
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.diag summary {
  color: var(--text-dim);
  font-size: .78rem;
  cursor: pointer;
}

.diag .code-block {
  margin-top: .5rem;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem .8rem;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-height: 30px;
  color: var(--text-dim);
  font-size: .78rem;
}

.shortcut span {
  margin-left: .2rem;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 .4rem;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg-elev-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
}

/* ------------------------------------------------------------
   Actions chanson / confirmation
   ------------------------------------------------------------ */

.actions-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.action-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-height: 48px;
  padding: .6rem .7rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  text-align: left;
}

.action-row svg {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--text-dim);
}

.action-row:hover {
  background: var(--bg-elev-2);
}

.action-row--danger {
  color: #fecaca;
}

.action-row--danger svg {
  color: var(--red);
}

.confirm-message {
  color: var(--text-dim);
  font-size: .9rem;
  line-height: 1.55;
}

/* ------------------------------------------------------------
   Page d'accueil
   ------------------------------------------------------------ */

.page-landing {
  background: var(--bg);
}

.landing-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
}

.orb--green {
  top: -280px;
  left: 50%;
  width: 680px;
  height: 680px;
  background: radial-gradient(circle, rgba(74, 222, 128, .22), transparent 65%);
  transform: translateX(-50%);
}

.orb--yellow {
  right: -100px;
  bottom: -240px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(251, 191, 36, .12), transparent 65%);
}

.landing-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 70%);
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 70%);
}

.landing {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100% - 2rem));
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 6rem) 0 2rem;
}

.landing-hero {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.2rem;
  border: 1px solid rgba(74, 222, 128, .28);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(74, 222, 128, .16), rgba(74, 222, 128, .03));
  color: var(--green);
  box-shadow: 0 0 60px rgba(74, 222, 128, .12), inset 0 1px rgba(255, 255, 255, .08);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
}

.landing-hero .eyebrow {
  margin-bottom: .6rem;
}

.landing h1 {
  font-size: clamp(3.2rem, 9vw, 6.4rem);
  font-weight: 800;
  line-height: .92;
  letter-spacing: -.065em;
}

.landing h1 .accent {
  color: var(--green);
  text-shadow: 0 0 40px rgba(74, 222, 128, .25);
}

.tagline {
  max-width: 34em;
  margin: 1rem auto 0;
  color: var(--text-dim);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.5;
}

.hero-eq {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 38px;
  margin-top: 1.6rem;
}

.hero-eq span {
  width: 4px;
  border-radius: 99px;
  background: var(--green);
  opacity: .8;
  transform-origin: bottom;
  animation: eq 1.6s ease-in-out infinite;
}

.hero-eq span:nth-child(1) { height: 14px; animation-delay: -.2s; }
.hero-eq span:nth-child(2) { height: 24px; animation-delay: -.5s; }
.hero-eq span:nth-child(3) { height: 38px; animation-delay: -.1s; }
.hero-eq span:nth-child(4) { height: 20px; animation-delay: -.7s; }
.hero-eq span:nth-child(5) { height: 11px; animation-delay: -.35s; }

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: clamp(2.2rem, 6vh, 3.5rem);
}

.role-grid--single {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.6rem;
  min-height: 270px;
  padding: 1.6rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012));
  color: var(--text);
  text-decoration: none;
  transition: transform .22s ease, border-color .22s ease;
}

.role-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 20% 0%, rgba(74, 222, 128, .08), transparent 60%);
  opacity: 0;
  transition: opacity .22s ease;
}

.role-card:hover {
  border-color: rgba(74, 222, 128, .3);
  transform: translateY(-4px);
}

.role-card:hover::before {
  opacity: 1;
}

.role-card--join {
  border-color: rgba(74, 222, 128, .18);
  background: linear-gradient(160deg, rgba(74, 222, 128, .09), rgba(255, 255, 255, .012) 55%);
}

.role-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.role-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(74, 222, 128, .2);
  border-radius: 16px;
  background: rgba(74, 222, 128, .1);
  color: var(--green);
}

.role-icon svg {
  width: 25px;
  height: 25px;
}

.role-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}

.role-arrow svg {
  width: 18px;
  height: 18px;
}

.role-card:hover .role-arrow {
  border-color: rgba(74, 222, 128, .4);
  color: var(--green);
  transform: translateX(3px);
}

.role-copy {
  position: relative;
}

.role-kicker {
  color: var(--green);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.role-title {
  margin: .35rem 0 .5rem;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -.035em;
}

.role-desc {
  max-width: 30em;
  color: var(--text-dim);
  font-size: .9rem;
  line-height: 1.55;
}

.role-foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.role-foot span {
  padding: .25rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: .65rem;
}

.how {
  margin-top: clamp(3.5rem, 9vh, 6rem);
}

.how-head {
  margin-bottom: 1.5rem;
  text-align: center;
}

.how-head h2 {
  margin-top: .35rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -.04em;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-grid li {
  display: flex;
  gap: 1rem;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--border);
}

.step-number {
  padding-top: .15rem;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: .75rem;
}

.how-grid h3 {
  margin-bottom: .3rem;
  font-size: .95rem;
}

.how-grid p {
  color: var(--text-dim);
  font-size: .82rem;
  line-height: 1.5;
}

.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: auto;
  padding-top: 3rem;
  color: var(--text-faint);
  font-size: .75rem;
}

.footer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
}

.footer-sep {
  opacity: .5;
}

.config-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.config-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}

.config-chip.is-ok {
  color: var(--green);
}

.config-chip.is-ok .dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(74, 222, 128, .6);
}

.config-chip.is-warn {
  color: var(--yellow);
}

.config-chip.is-warn .dot {
  background: var(--yellow);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-dim);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text);
}

.footer-link svg {
  width: 14px;
  height: 14px;
}

/* ------------------------------------------------------------
   Porte d’entrée du meneur
   ------------------------------------------------------------ */

.leader-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  padding: calc(1.25rem + var(--safe-top)) 1rem calc(1.25rem + var(--safe-bottom));
  overflow-y: auto;
  background:
    radial-gradient(700px 500px at 50% -10%, rgba(74, 222, 128, .1), transparent 65%),
    radial-gradient(500px 400px at 100% 100%, rgba(251, 191, 36, .06), transparent 60%),
    var(--bg);
}

.gate-card {
  flex: none;
  width: min(440px, 100%);
  margin: auto;
  padding: clamp(1.4rem, 5vw, 2.1rem);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
  box-shadow: var(--shadow);
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.5rem;
  font-size: .92rem;
  font-weight: 750;
  letter-spacing: -.02em;
}

.gate-card h1 {
  margin-top: .4rem;
  font-size: clamp(1.8rem, 5vw, 2.35rem);
  letter-spacing: -.045em;
  line-height: 1.1;
}

.gate-text {
  margin-top: .65rem;
  color: var(--text-dim);
  font-size: .87rem;
  line-height: 1.55;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  margin-top: 1.35rem;
}

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-right: 5.6rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: .35rem;
  min-height: 32px;
  padding: 0 .5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  font-size: .72rem;
  font-weight: 650;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--green);
}

.gate-error {
  padding: .6rem .7rem;
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: 10px;
  background: var(--red-soft);
  color: #fca5a5;
  font-size: .8rem;
  line-height: 1.45;
}

.gate-notice {
  margin-top: 1.1rem;
  padding: .6rem .7rem;
  border: 1px solid rgba(251, 191, 36, .3);
  border-radius: 10px;
  background: var(--yellow-soft);
  color: #fcd34d;
  font-size: .8rem;
  line-height: 1.45;
}

.gate-submit {
  width: 100%;
  min-height: 48px;
  margin-top: .15rem;
  font-size: .95rem;
}

.gate-join {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: 1.1rem;
  color: var(--text-dim);
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
}

.gate-join:hover {
  color: var(--green);
}

.gate-join span {
  transition: transform .16s ease;
}

.gate-join:hover span {
  transform: translateX(3px);
}

.gate-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  margin-top: 1.6rem;
  text-align: center;
}

.gate-state h2 {
  font-size: 1.12rem;
  letter-spacing: -.02em;
}

.gate-state p {
  color: var(--text-dim);
  font-size: .85rem;
  line-height: 1.55;
}

.gate-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(251, 191, 36, .35);
  border-radius: 50%;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 1.2rem;
  font-weight: 800;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: .45rem;
}

.gate-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: .72rem;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 480px) {
  .leader-gate {
    padding-top: calc(1rem + var(--safe-top));
  }

  .gate-card {
    margin: 0 auto;
    border-radius: 20px;
  }
}

/* ------------------------------------------------------------
   Affichage : taille, jauge, diagrammes
   ------------------------------------------------------------ */

.aa-label {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: -.04em;
}

.song-gauge {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: none;
  height: 30px;
  padding: 0 clamp(.55rem, 2vw, 1.1rem);
  border-top: 1px solid var(--border);
  background: rgba(15, 15, 15, .84);
}

.song-gauge-track {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
}

.song-gauge-fill {
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green-strong), var(--green));
  box-shadow: 0 0 10px rgba(74, 222, 128, .35);
}

.song-gauge-label {
  min-width: 36px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: .68rem;
  text-align: right;
}

.display-settings {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.display-size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.display-size-row > span {
  font-size: .82rem;
  font-weight: 650;
}

.size-stepper {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.size-stepper button {
  width: 34px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 800;
}

.size-stepper button:hover {
  border-color: rgba(74, 222, 128, .35);
  color: var(--green);
}

.size-stepper strong {
  min-width: 52px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: .72rem;
  text-align: center;
}

.display-toggle {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  color: var(--text-dim);
  font-size: .82rem;
  cursor: pointer;
}

.display-toggle input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--green);
}

.display-toggle small {
  margin-left: auto;
  color: var(--text-faint);
  font-size: .65rem;
}

.display-toggle.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

dialog.dialog--chords {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(90dvh, 900px);
}

.chord-dialog-body {
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.chord-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.chord-chip {
  min-height: 30px;
  padding: 0 .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
}

.chord-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chord-chip.is-active {
  border-color: rgba(74, 222, 128, .45);
  background: var(--green-soft);
  color: var(--green);
}

.chord-diagrams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.chord-panel {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, .16);
}

.chord-panel h3 {
  color: var(--text-faint);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.chord-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.chord-diagram svg {
  width: 100%;
  max-width: 320px;
  height: auto;
}

.diagram-note {
  color: var(--text-faint);
  font-size: .72rem;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 720px) {
  .chord-diagrams {
    grid-template-columns: 1fr;
  }

  .chord-diagram {
    min-height: 170px;
  }

  .chord-diagram svg {
    max-width: 300px;
  }
}

/* ------------------------------------------------------------
   Structure de l'application
   ------------------------------------------------------------ */

.app-shell,
.follower-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  min-height: 0;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  flex: none;
  z-index: 20;
  padding: calc(.55rem + var(--safe-top)) clamp(.6rem, 2vw, 1.1rem) .55rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 15, 15, .88);
  backdrop-filter: blur(16px);
}

/* Même quand la marque est masquée sur mobile, les trois colonnes
   restent stables : titre au centre/gauche, actions à droite. */
.topbar > .brand {
  grid-column: 1;
}

.topbar > .topbar-song,
.topbar > .converter-heading {
  grid-column: 2;
}

.topbar > .topbar-actions {
  grid-column: 3;
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  font-size: .9rem;
  font-weight: 750;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(74, 222, 128, .6);
}

.topbar-song {
  min-width: 0;
  text-align: center;
}

.topbar-title {
  display: block;
  overflow: hidden;
  font-size: .92rem;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar-sub {
  display: block;
  margin-top: .05rem;
  overflow: hidden;
  color: var(--text-faint);
  font-size: .7rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: .1rem;
}

/* ------------------------------------------------------------
   Scène & paroles
   ------------------------------------------------------------ */

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  outline: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 34px, #000 calc(100% - 42px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 34px, #000 calc(100% - 42px), transparent 100%);
}

.stage-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: clamp(1.5rem, 6vh, 4rem) 1rem;
}

.empty-card {
  width: min(600px, 100%);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01));
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 1rem;
  border: 1px solid rgba(74, 222, 128, .2);
  border-radius: 18px;
  background: var(--green-soft);
  color: var(--green);
}

.empty-icon svg {
  width: 28px;
  height: 28px;
}

.empty-card h1 {
  margin: .35rem 0 .6rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -.04em;
}

.empty-text {
  max-width: 32em;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: .92rem;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.3rem;
}

.empty-hint {
  margin-top: 1rem;
  color: var(--text-faint);
  font-size: .75rem;
}

.lyrics {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(4rem, 18vh, 220px) clamp(.75rem, 4vw, 3rem) 34vh;
}

.lyric-line {
  position: relative;
  margin: 0 auto;
  padding: .32rem .75rem .4rem 1rem;
  border-left: 3px solid transparent;
  border-radius: 10px;
  opacity: .66;
  --line-progress: 0;
  transition: opacity .22s ease, border-color .22s ease;
}

.lyric-line + .lyric-line {
  margin-top: .18rem;
}

.lyric-line.is-past {
  opacity: .32;
}

.lyric-line.is-active {
  border-left-color: var(--green);
  background:
    linear-gradient(90deg, rgba(74, 222, 128, .22) calc(var(--line-progress) * 100%), transparent calc(var(--line-progress) * 100%)),
    linear-gradient(90deg, rgba(251, 191, 36, .08), rgba(251, 191, 36, .015));
  opacity: 1;
}

.lyric-line.is-active::after {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: -3px;
  width: 3px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(74, 222, 128, .6);
}

.page-leader .lyric-line[data-singable] {
  cursor: pointer;
}

.page-leader .lyric-line[data-singable]:hover {
  background: rgba(255, 255, 255, .035);
  opacity: .95;
}

.page-leader .lyric-line[data-singable].is-active:hover {
  background: linear-gradient(90deg, rgba(251, 191, 36, .1), rgba(251, 191, 36, .02));
}

.segments {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 0;
  row-gap: .1em;
}

.word {
  display: inline-flex;
  align-items: flex-start;
  max-width: 100%;
  min-width: 0;
}

.seg {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
  min-width: 0;
}

.seg--chord-only {
  margin-right: .3em;
}

.syll {
  font-family: var(--font);
  font-size: calc(var(--lyrics-size) * var(--lyrics-scale));
  font-weight: 520;
  line-height: 1.28;
  letter-spacing: -.012em;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.chord {
  min-height: 1.15em;
  margin-top: .08em;
  color: var(--green);
  font-family: var(--mono);
  font-size: calc(var(--chord-size) * var(--chord-scale));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  white-space: nowrap;
  opacity: .88;
}

.is-active .chord {
  text-shadow: 0 0 18px rgba(74, 222, 128, .35);
  opacity: 1;
}

.chords-enabled .chord[data-chord] {
  cursor: pointer;
  border-radius: 4px;
}

.chords-enabled .chord[data-chord]:hover {
  color: #86efac;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lyric-line--comment {
  padding-top: 1.1rem;
  padding-bottom: .25rem;
  border-left: 0;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: .68rem;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .8;
}

.lyric-line--comment.is-past {
  opacity: .4;
}

.lyric-line--blank {
  height: .7rem;
  padding: 0;
  border-left: 0;
  opacity: 1;
}

/* ------------------------------------------------------------
   Dock meneur
   ------------------------------------------------------------ */

.dock {
  flex: none;
  z-index: 15;
  padding: .45rem clamp(.55rem, 2vw, 1.1rem) calc(.55rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: rgba(15, 15, 15, .92);
  backdrop-filter: blur(18px);
}

.dock-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .45rem .7rem;
  padding: .1rem 0 .4rem;
}

.meta-group {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.meta-label {
  color: var(--text-faint);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.stepper {
  display: flex;
  align-items: stretch;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
}

.stepper button {
  min-width: 30px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: .8rem;
  font-weight: 700;
}

.stepper button:hover {
  background: var(--bg-elev-2);
  color: var(--text);
}

.stepper-value {
  min-width: 40px;
  border-right: 1px solid var(--border) !important;
  border-left: 1px solid var(--border) !important;
  color: var(--yellow) !important;
  font-family: var(--mono);
  font-size: .75rem !important;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 30px;
  padding: 0 .55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: .72rem;
  font-weight: 650;
}

.toggle svg {
  width: 15px;
  height: 15px;
}

.toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.toggle[aria-pressed="true"] {
  border-color: rgba(251, 191, 36, .35);
  background: rgba(251, 191, 36, .08);
  color: var(--yellow);
}

.toggle .icon-volume {
  display: none;
}

.toggle[aria-pressed="true"] .icon-volume {
  display: block;
}

.toggle[aria-pressed="true"] .icon-muted {
  display: none;
}

.icon-btn[data-sound-toggle] .icon-volume {
  display: none;
}

.icon-btn[data-sound-toggle][aria-pressed="true"] .icon-volume {
  display: block;
}

.icon-btn[data-sound-toggle][aria-pressed="true"] .icon-muted {
  display: none;
}

.line-counter {
  margin-left: auto;
  padding-right: .2rem;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: .68rem;
}

.map-badge {
  height: 30px;
  padding: 0 .55rem;
  border: 1px solid rgba(74, 222, 128, .3);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: .66rem;
  font-weight: 750;
  white-space: nowrap;
}

.map-badge:hover {
  background: rgba(74, 222, 128, .18);
}

.calibration-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex: none;
  padding: .5rem clamp(.55rem, 2vw, 1.1rem);
  border-top: 1px solid rgba(251, 191, 36, .22);
  background:
    linear-gradient(180deg, rgba(251, 191, 36, .08), rgba(251, 191, 36, .02)),
    var(--bg-soft);
}

.calibration-copy {
  min-width: 0;
}

.calibration-copy .eyebrow {
  color: var(--yellow);
}

.calibration-copy p:last-child {
  margin-top: .15rem;
  color: var(--text-dim);
  font-size: .78rem;
  line-height: 1.4;
}

.calibration-controls {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: none;
}

.calibration-tap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  min-width: 124px;
  min-height: 56px;
  padding: .25rem .8rem;
  border: 1px solid rgba(251, 191, 36, .5);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(251, 191, 36, .22), rgba(251, 191, 36, .1));
  color: var(--yellow);
  font-weight: 900;
  letter-spacing: .08em;
}

.calibration-tap span {
  font-size: 1.1rem;
  line-height: 1;
}

.calibration-tap small {
  font-size: .55rem;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .7;
}

.calibration-tap:not(:disabled):hover {
  background: linear-gradient(180deg, rgba(251, 191, 36, .32), rgba(251, 191, 36, .16));
}

.calibration-tap:active {
  transform: scale(.99);
}

.dock-transport {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(260px, auto) minmax(120px, 1fr);
  align-items: stretch;
  gap: .55rem;
  width: min(1080px, 100%);
  margin: 0 auto;
}

.transport-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  min-height: 76px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-soft));
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
}

.transport-btn svg {
  width: 22px;
  height: 22px;
  color: var(--green);
}

.transport-btn kbd {
  position: absolute;
  top: 7px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  font-size: .58rem;
  opacity: .65;
}

.transport-btn:hover {
  border-color: rgba(74, 222, 128, .35);
  background: var(--bg-elev-2);
}

.transport-btn:active {
  transform: scale(.992);
}

.transport-center {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
}

.bpm-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
}

.bpm-chip {
  min-width: 34px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-elev);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
}

.bpm-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.bpm-display {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 0 .55rem;
  font-family: var(--mono);
}

.bpm-display #bpmValue {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.05em;
}

.bpm-display small {
  color: var(--text-faint);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.beat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  opacity: .35;
  transform-origin: center;
  will-change: transform, opacity;
}

.beat-dot.is-accent {
  background: var(--yellow);
}

.play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  border: 1px solid rgba(74, 222, 128, .35);
  border-radius: 12px;
  background: rgba(74, 222, 128, .13);
  color: var(--green);
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .01em;
}

.play-btn svg {
  width: 18px;
  height: 18px;
}

.play-btn:hover {
  background: rgba(74, 222, 128, .2);
}

.play-btn .icon-pause {
  display: none;
}

.play-btn.is-playing {
  border-color: rgba(251, 191, 36, .35);
  background: rgba(251, 191, 36, .1);
  color: var(--yellow);
}

.play-btn.is-playing .icon-play {
  display: none;
}

.play-btn.is-playing .icon-pause {
  display: block;
}

/* ------------------------------------------------------------
   Page suiveur
   ------------------------------------------------------------ */

.follower-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  flex: none;
  z-index: 20;
  padding: calc(.5rem + var(--safe-top)) clamp(.6rem, 2vw, 1.1rem) .5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 15, 15, .78);
  backdrop-filter: blur(14px);
}

.follower-topbar > .brand {
  grid-column: 1;
}

.follower-topbar > .follower-song {
  grid-column: 2;
}

.follower-topbar > .follower-actions {
  grid-column: 3;
}

.brand--follower {
  font-size: .82rem;
}

.follower-song {
  min-width: 0;
  text-align: center;
}

.follower-title {
  display: block;
  overflow: hidden;
  font-size: clamp(.9rem, 2vw, 1.05rem);
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.follower-artist {
  display: block;
  margin-top: .05rem;
  overflow: hidden;
  color: var(--text-faint);
  font-size: .68rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.follower-actions {
  display: flex;
  align-items: center;
  gap: .05rem;
}

.stage--follower .lyrics {
  width: min(1400px, 100%);
  padding: clamp(5rem, 22vh, 280px) clamp(.8rem, 4vw, 4rem) 32vh;
}

.page-follower .lyric-line {
  opacity: .72;
}

.page-follower .lyric-line.is-past {
  opacity: .3;
}

.page-follower .lyric-line.is-active {
  opacity: 1;
}

.waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 2rem 1.2rem;
  gap: .3rem;
  text-align: center;
}

.waiting-pulse {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  border: 1px solid rgba(74, 222, 128, .25);
  border-radius: 50%;
  animation: waiting 2.6s ease-in-out infinite;
}

.waiting-pulse span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 22px rgba(74, 222, 128, .7);
}

.waiting h1 {
  margin: .35rem 0 .5rem;
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  letter-spacing: -.04em;
}

.waiting-text {
  color: var(--text-dim);
  font-size: clamp(.85rem, 1.5vw, 1rem);
  line-height: 1.6;
}

.tempo-float {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: .4rem;
  height: 34px;
  padding: 0 .8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 15, 15, .7);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  transform: translateX(-50%);
}

.tempo-bpm {
  color: var(--text);
  font-size: .9rem;
  font-weight: 800;
}

.tempo-unit {
  color: var(--text-faint);
  font-size: .55rem;
  letter-spacing: .1em;
}

.focus-title {
  display: none;
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: clamp(.7rem, 2vw, 1.2rem);
  z-index: 55;
  max-width: 55vw;
  padding: .3rem .7rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 15, 15, .4);
  color: var(--text-dim);
  font-size: .8rem;
  letter-spacing: .02em;
  white-space: nowrap;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
}

body.focus-mode .focus-title {
  display: block;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.1rem;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
}

.info-bullet {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: .05rem;
  border: 1px solid rgba(74, 222, 128, .25);
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 700;
}

.info-item p {
  color: var(--text-dim);
  font-size: .84rem;
  line-height: 1.55;
}

/* ------------------------------------------------------------
   Mode focus / plein écran
   ------------------------------------------------------------ */

.fs-toolbar {
  display: none;
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 60;
  gap: .4rem;
  opacity: .4;
  transition: opacity .2s ease;
}

.fs-toolbar:hover,
.fs-toolbar:focus-within {
  opacity: 1;
}

body.focus-mode .topbar,
body.focus-mode .follower-topbar {
  display: none;
}

/* En plein écran, on masque les rappels de configuration mais on
   conserve les alertes critiques (règles ouvertes, écriture refusée). */
body.focus-mode .banner--warning {
  display: none;
}

body.focus-mode .fs-toolbar {
  display: flex;
}

body.focus-mode .dock-meta .transpose-group,
body.focus-mode .dock-meta .sound-group,
body.focus-mode .dock-meta .calibrate-group,
body.focus-mode .line-counter {
  display: none;
}

body.focus-mode .dock {
  background: rgba(15, 15, 15, .78);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 720px) {
  .topbar {
    gap: .3rem;
  }

  .brand {
    display: none;
  }

  .topbar-song,
  .follower-song {
    text-align: left;
  }

  .topbar-sub {
    display: none;
  }

  .topbar-title {
    font-size: .82rem;
  }

  .page-leader .status-badge .status-label {
    display: none;
  }

  .page-leader .status-badge {
    width: 36px;
    justify-content: center;
    padding: 0;
  }

  .icon-btn {
    width: 37px;
    height: 37px;
  }

  .follower-topbar {
    gap: .3rem;
  }

  .follower-title {
    font-size: .85rem;
  }

  .follower-artist {
    font-size: .62rem;
  }

  .page-follower .status-badge {
    padding: 0 .5rem;
    font-size: .64rem;
  }

  .meta-label {
    display: none;
  }

  .toggle span {
    display: none;
  }

  .line-counter {
    display: none;
  }

  .dock-meta {
    gap: .35rem .45rem;
  }

  .dock-transport {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "center center"
      "prev next";
    gap: .45rem;
  }

  .transport-center {
    grid-area: center;
  }

  #btnPrev {
    grid-area: prev;
  }

  #btnNext {
    grid-area: next;
  }

  .transport-btn {
    min-height: 84px;
    font-size: .85rem;
  }

  .transport-btn svg {
    width: 20px;
    height: 20px;
  }

  .transport-btn kbd {
    display: none;
  }

  .bpm-chip {
    min-width: 32px;
    height: 27px;
  }

  .bpm-display #bpmValue {
    font-size: 1.45rem;
  }

  .play-btn {
    min-height: 44px;
  }

  .dock {
    padding-right: .5rem;
    padding-left: .5rem;
  }

  #btnCalibrate span {
    display: inline;
  }

  .map-badge {
    height: 28px;
    font-size: .62rem;
  }

  .calibration-bar {
    flex-direction: column;
    align-items: stretch;
    gap: .45rem;
    padding: .45rem .5rem;
  }

  .calibration-copy p:last-child {
    font-size: .72rem;
  }

  .calibration-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .calibration-tap {
    grid-column: 1 / -1;
    min-height: 64px;
  }

  .stage-empty {
    padding: 1rem .6rem;
  }

  .empty-card {
    padding: 1.4rem 1rem;
    border-radius: 19px;
  }

  .empty-actions .btn {
    flex: 1;
    min-width: 140px;
  }

  .editor-body {
    grid-template-columns: 1fr;
    padding: .9rem;
    overflow: auto;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .editor-preview-wrap {
    min-height: 240px;
  }

  .field--grow textarea {
    min-height: 190px;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }

  .shortcut-grid {
    grid-template-columns: 1fr;
  }

  .library-toolbar {
    padding: .6rem .75rem;
  }

  .library-toolbar .search-field {
    flex-basis: 100%;
  }

  .library-toolbar .btn {
    padding: .5rem .65rem;
  }

  .song-title {
    font-size: .9rem;
  }

  .role-grid,
  .how-grid {
    grid-template-columns: 1fr;
  }

  dialog.dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .dialog-shell {
    height: 100dvh;
    max-height: 100dvh;
  }

  dialog.dialog--small {
    width: calc(100vw - 1.5rem);
    height: auto;
    max-height: 80dvh;
    margin: auto;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
  }

  dialog.dialog--small .dialog-shell {
    height: auto;
  }

  .page-leader .toasts {
    bottom: calc(238px + var(--safe-bottom));
  }

  .page-follower .toasts {
    bottom: calc(64px + var(--safe-bottom));
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .dock-meta {
    display: none;
  }

  .dock-transport {
    grid-template-columns: minmax(100px, 1fr) minmax(240px, auto) minmax(100px, 1fr);
    grid-template-areas: none;
    gap: .45rem;
  }

  .transport-center {
    flex-direction: row;
    align-items: center;
    gap: .55rem;
  }

  .bpm-row {
    flex: 1;
  }

  .play-btn {
    min-width: 150px;
    min-height: 44px;
  }

  .transport-btn {
    min-height: 64px;
  }

  .topbar,
  .follower-topbar {
    padding-top: .35rem;
    padding-bottom: .35rem;
  }

  .topbar-sub {
    display: none;
  }

  .lyrics,
  .stage--follower .lyrics {
    padding-top: 18vh;
    padding-bottom: 22vh;
  }

  .page-leader .toasts {
    bottom: calc(100px + var(--safe-bottom));
  }
}

@media (max-width: 480px) {
  .landing {
    width: calc(100% - 1.25rem);
  }

  .landing h1 {
    font-size: clamp(3rem, 17vw, 4.2rem);
  }

  .brand-mark {
    width: 54px;
    height: 54px;
  }

  .role-card {
    min-height: 220px;
    padding: 1.25rem;
    border-radius: 20px;
  }

  .landing-footer {
    justify-content: center;
    text-align: center;
  }

  .status-badge {
    height: 34px;
  }

  .follower-actions {
    gap: 0;
  }

  .page-follower .icon-btn {
    width: 35px;
    height: 35px;
  }

  .follower-title {
    font-size: .8rem;
  }

  .bpm-display {
    padding: 0 .25rem;
  }

  .bpm-chip {
    min-width: 29px;
  }
}

/* ------------------------------------------------------------
   Convertisseur d'accords
   ------------------------------------------------------------ */

.page-converter {
  min-height: 100dvh;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(74, 222, 128, .06), transparent 60%),
    radial-gradient(700px 400px at 90% 10%, rgba(251, 191, 36, .04), transparent 60%),
    var(--bg);
}

.converter-topbar {
  position: sticky;
  top: 0;
}

.converter-heading {
  min-width: 0;
  text-align: left;
}

.converter-heading h1 {
  margin-top: .1rem;
  font-size: clamp(1rem, 2vw, 1.22rem);
  letter-spacing: -.025em;
}

.converter-main {
  display: flex;
  flex-direction: column;
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2.4rem) 0 3rem;
  gap: 1rem;
}

.converter-intro {
  max-width: 62em;
}

.converter-intro h2 {
  margin: .2rem 0 .5rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -.04em;
}

.converter-intro p {
  color: var(--text-dim);
  font-size: .88rem;
  line-height: 1.55;
}

.converter-intro code,
.converter-footnote code {
  color: var(--green);
  font-family: var(--mono);
  font-size: .78rem;
}

.converter-note {
  margin-top: .5rem;
  color: var(--text-faint) !important;
  font-size: .78rem !important;
}

.converter-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elev);
}

.converter-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  flex: 1;
  gap: .6rem;
  min-width: 0;
}

.converter-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-dim);
  font-size: .78rem;
  cursor: pointer;
}

.check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: .3rem;
}

.field--inline > span {
  white-space: nowrap;
}

.input--tiny {
  width: 64px;
  min-height: 34px;
  padding: .25rem .45rem;
  text-align: center;
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.converter-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elev);
}

.converter-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem .8rem;
  margin-bottom: .6rem;
}

.converter-panel-head h2 {
  font-size: 1rem;
  letter-spacing: -.02em;
}

.converter-panel-head > span {
  color: var(--text-faint);
  font-size: .7rem;
}

.converter-panel-head > span.is-error {
  color: var(--red);
}

.converter-textarea {
  width: 100%;
  min-height: 330px;
  resize: vertical;
  font-size: .8rem;
  line-height: 1.55;
}

.converter-textarea[readonly] {
  color: #d4d4d4;
  background: #0a0a0a;
}

.converter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .65rem;
}

.converter-link {
  display: inline-flex;
  align-self: flex-start;
  margin-top: .55rem;
  color: var(--green);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
}

.converter-link:hover {
  text-decoration: underline;
}

.converter-preview-panel {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elev);
}

.converter-preview-panel .lyrics {
  --lyrics-size: 1.05rem;
  --chord-size: .68rem;
  width: 100%;
  max-height: 320px;
  padding: .9rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.converter-footnote {
  max-width: 70em;
  color: var(--text-faint);
  font-size: .74rem;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .converter-fields {
    grid-template-columns: 1fr 1fr;
  }

  .converter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .converter-main {
    width: calc(100% - 1.5rem);
  }

  .converter-topbar {
    padding-top: calc(.45rem + var(--safe-top));
    padding-bottom: .45rem;
  }

  .converter-heading h1 {
    font-size: 1rem;
  }

  .converter-fields {
    grid-template-columns: 1fr;
  }

  .converter-controls {
    align-items: stretch;
  }

  .converter-options {
    justify-content: flex-start;
  }

  .converter-textarea {
    min-height: 250px;
  }

  .converter-actions .btn {
    flex: 1;
    min-width: 140px;
  }
}

/* ------------------------------------------------------------
   Animations
   ------------------------------------------------------------ */

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .25); }
  50% { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: none; }
}

@keyframes eq {
  0%, 100% { transform: scaleY(.45); }
  50% { transform: scaleY(1); }
}

@keyframes waiting {
  0%, 100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes rowFlash {
  0% { background: rgba(251, 191, 36, .18); }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
