/* Lumières — thème sombre (on s'en sert dans le noir, lumières allumées). */
:root {
  --bg: #07070c;
  --bg-2: #0d0d15;
  --surface: #13131d;
  --surface-2: #1a1a27;
  --surface-3: #232334;
  --line: #2a2a3d;
  --line-2: #383852;
  --text: #ececf5;
  --muted: #9b9bb4;
  --faint: #6b6b85;
  --accent: #ff2d95;
  --accent-2: #00d4ff;
  --accent-3: #8b5cff;
  --ok: #3ddc97;
  --warn: #ffb547;
  --bad: #ff5468;
  --grad: linear-gradient(100deg, #ff2d95 0%, #8b5cff 50%, #00d4ff 100%);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --tabbar: 0px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Boutons et champs --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  cursor: pointer; user-select: none; white-space: nowrap; font-weight: 550;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: var(--surface-3); border-color: #4a4a68; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { color: #ffb3bd; border-color: #5a2a36; }
.btn.danger:hover { background: #2a1219; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 18px rgba(255, 45, 149, 0.25); }

input[type="text"], input[type="url"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); outline: none;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
input[type="color"] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
label.field > span { font-weight: 550; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
code, .code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* --- Structure ------------------------------------------------------------------------ */
.app { display: flex; flex-direction: column; height: 100%; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(10, 10, 16, 0.92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: 0.2px; font-size: 17px; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: conic-gradient(from 200deg, #ff2d95, #8b5cff, #00d4ff, #3ddc97, #ffb547, #ff2d95); box-shadow: 0 0 18px rgba(139, 92, 255, 0.55); position: relative; }
.brand .logo::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg); }
.tabs { display: flex; gap: 4px; }
.tab {
  display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px;
  color: var(--muted); background: none; border: none; cursor: pointer; font-weight: 600;
}
.tab svg { width: 18px; height: 18px; }
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active { color: var(--text); background: var(--surface-2); }
.nowbar { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; justify-content: flex-end; }
.nowbar .cover { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.nowbar .txt { min-width: 0; max-width: 300px; line-height: 1.25; }
.nowbar .t1 { font-weight: 650; font-size: 14px; }
.nowbar .t2 { color: var(--muted); font-size: 12.5px; }
.chips { display: flex; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.live { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.arm {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); cursor: pointer; font-weight: 700; user-select: none; white-space: nowrap;
}
.arm .sw { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background 0.2s; }
.arm .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.arm.on { border-color: transparent; background: linear-gradient(#13131d, #13131d) padding-box, var(--grad) border-box; border: 1px solid transparent; }
.arm.on .sw { background: var(--grad); }
.arm.on .sw::after { transform: translateX(18px); }

main { flex: 1; min-height: 0; overflow: auto; position: relative; }
.view { display: none; min-height: 100%; }
.view.active { display: block; }
.page { max-width: 1180px; margin: 0 auto; padding: 22px 18px 40px; }
.page h1 { font-size: 24px; margin: 4px 0 16px; letter-spacing: -0.2px; }
.page h2 { font-size: 17px; margin: 0 0 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.card h2 { display: flex; align-items: center; gap: 10px; }
.card .lead { color: var(--muted); margin: -4px 0 14px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.note.warn { border-color: #5a4220; color: #ffd49a; background: #1b1408; }
.note.bad { border-color: #5a2a36; color: #ffb3bd; background: #1d0d12; }
.note.ok { border-color: #1f4d3a; color: #a5f3cf; background: #0b1a13; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.badge.claude { background: #2a1d10; color: #ffbe85; }
.badge.local { background: #10202a; color: #8fdcff; }
.badge.manual { background: #22162c; color: #e2b3ff; }
.swatches { display: inline-flex; gap: 3px; }
.swatches i { width: 14px; height: 14px; border-radius: 4px; display: block; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset; }

/* --- Barre de progression ------------------------------------------------------------- */
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width 0.3s; }

/* --- Scène ----------------------------------------------------------------------------- */
.stage { display: grid; grid-template-columns: 1fr 380px; height: 100%; min-height: 0; }
.viewport { position: relative; min-height: 0; background: radial-gradient(ellipse at 50% 40%, #12121c 0%, #050508 75%); overflow: hidden; }
.viewport canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewport .overlay { position: absolute; left: 14px; top: 14px; right: 14px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.viewport .overlay > * { pointer-events: auto; }
.seg { display: inline-flex; background: rgba(19, 19, 29, 0.85); border: 1px solid var(--line); border-radius: 10px; padding: 3px; backdrop-filter: blur(8px); }
.seg button { border: none; background: none; padding: 5px 11px; border-radius: 7px; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button.active { background: var(--surface-3); color: var(--text); }
.viewport .label3d { position: absolute; transform: translate(-50%, -140%); font-size: 11.5px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px #000, 0 0 8px #000; pointer-events: none; white-space: nowrap; }
.viewport .hint { position: absolute; bottom: 12px; left: 14px; font-size: 12px; color: var(--faint); pointer-events: none; }
.side { border-left: 1px solid var(--line); background: var(--bg-2); overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.np { display: flex; gap: 12px; align-items: center; }
.np .cover { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: none; }
.np .title { font-weight: 700; font-size: 16px; line-height: 1.2; }
.np .sub { color: var(--muted); font-size: 13px; }
.mini-timeline { position: relative; height: 26px; border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.mini-timeline canvas { width: 100%; height: 100%; display: block; }
.pads h3 { margin: 6px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--faint); font-weight: 700; }
.padgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad {
  aspect-ratio: 1 / 0.82; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-weight: 700; font-size: 12.5px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: transform 0.06s, background 0.12s, box-shadow 0.12s; color: var(--text); position: relative; padding: 4px; text-align: center; line-height: 1.15;
}
.pad svg { width: 22px; height: 22px; opacity: 0.9; }
.pad:active, .pad.held { transform: scale(0.95); }
.pad.on { background: var(--surface-3); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 22px rgba(255, 45, 149, 0.3); }
.pad.flash { background: linear-gradient(160deg, #2a2a3a, #18182a); }
.pad.flash.held, .pad.strobe.held { background: #fff; color: #000; }
.pad .key { position: absolute; top: 5px; right: 7px; font-size: 10px; color: var(--faint); font-family: var(--mono); }
.pad.swatch { aspect-ratio: 1 / 0.7; }
.pad.swatch i { position: absolute; inset: 6px; border-radius: 8px; }
.pad.swatch.on i { inset: 4px; box-shadow: 0 0 16px currentColor; }
.fader { display: flex; align-items: center; gap: 10px; }
.fader span { width: 46px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

/* --- Shows ----------------------------------------------------------------------------- */
.addbar { display: flex; gap: 10px; }
.addbar input { min-height: 46px; font-size: 15px; }
.addbar .btn { min-height: 46px; }
.drop { margin-top: 10px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.drop label { cursor: pointer; color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.showgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.showcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.showcard .head { display: flex; gap: 12px; padding: 14px; align-items: center; }
.showcard .cover { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: none; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 26px; }
.showcard .t1 { font-weight: 700; line-height: 1.2; }
.showcard .t2 { color: var(--muted); font-size: 13px; }
.showcard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 14px 12px; font-size: 12.5px; color: var(--muted); }
.showcard .status { padding: 0 14px 12px; font-size: 13px; }
.showcard .actions { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); margin-top: auto; flex-wrap: wrap; }
.showcard.playing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.jobs { margin-top: 14px; }
.job { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.job + .job { margin-top: 8px; }

/* --- Éditeur --------------------------------------------------------------------------- */
.editor { display: grid; grid-template-columns: 1fr 330px; grid-template-rows: auto auto 1fr; height: 100%; min-height: 0; }
.ed-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--bg-2); }
.ed-top .title { font-weight: 750; font-size: 16px; }
.ed-transport { grid-column: 1 / 2; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-transport .time { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; min-width: 150px; }
.ed-transport .bar { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.playbtn { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); border: none; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.playbtn svg { width: 20px; height: 20px; }
.ed-main { grid-column: 1 / 2; min-height: 0; display: flex; flex-direction: column; position: relative; }
.timeline { flex: 1; min-height: 260px; position: relative; overflow: hidden; touch-action: none; cursor: default; }
.timeline canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ed-preview { width: 96px; height: 60px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #050508; pointer-events: none; flex: none; position: relative; }
.ed-preview canvas { width: 100%; height: 100%; display: block; }
.inspector { grid-column: 2 / 3; grid-row: 2 / 4; border-left: 1px solid var(--line); overflow: auto; padding: 14px; background: var(--bg-2); display: flex; flex-direction: column; gap: 12px; }
.inspector h3 { margin: 0; font-size: 15px; }
.inspector .about { color: var(--muted); font-size: 13px; margin-top: -4px; }
.colors-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.colors-edit .c { position: relative; }
.colors-edit .c button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: none; background: var(--surface-3); color: var(--text); font-size: 11px; line-height: 18px; padding: 0; cursor: pointer; display: none; }
.colors-edit .c:hover button { display: block; }
.secs { display: flex; flex-direction: column; gap: 4px; }
.secs button { display: flex; gap: 8px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; cursor: pointer; color: var(--text); font-size: 13px; }
.secs button:hover { border-color: var(--line-2); background: var(--surface-2); }
.secs .lvl { width: 40px; height: 6px; border-radius: 9px; background: var(--surface-3); overflow: hidden; flex: none; }
.secs .lvl i { display: block; height: 100%; background: var(--grad); }
.saved { font-size: 12.5px; color: var(--faint); }
.saved.busy { color: var(--warn); }
.popover { position: fixed; max-height: calc(100vh - 24px); overflow: auto; z-index: 40; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; width: min(420px, calc(100vw - 24px)); }
.palette-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.palette-list button { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; color: var(--text); font-size: 12.5px; }
.palette-list button:hover { border-color: var(--line-2); }
.claude-box { display: flex; flex-direction: column; gap: 8px; }
.versions { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.versions .v { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--bg-2); }

/* --- Réglages -------------------------------------------------------------------------- */
.plan { position: relative; width: 100%; aspect-ratio: 1.35 / 1; border-radius: 12px; background: #06060a; border: 1px solid var(--line); overflow: hidden; touch-action: none; }
.plan canvas { width: 100%; height: 100%; display: block; }
.steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.steps li { margin: 6px 0; }
.steps li b { color: var(--text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.lights-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin: 10px 0; }
.countdown { font-size: 42px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }

/* --- Toasts ---------------------------------------------------------------------------- */
.toasts { position: fixed; left: 50%; bottom: calc(18px + var(--tabbar) + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.toast { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow); font-size: 14px; pointer-events: auto; animation: toastin 0.18s ease-out; }
.toast.bad { border-color: #6a2b3a; background: #24111a; }
.toast.ok { border-color: #1f4d3a; }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } }

dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px; padding: 20px; width: min(480px, calc(100vw - 24px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 8px; font-size: 18px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* --- Connexion ------------------------------------------------------------------------- */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse at 30% 20%, rgba(255, 45, 149, 0.18), transparent 50%), radial-gradient(ellipse at 75% 80%, rgba(0, 212, 255, 0.16), transparent 50%), var(--bg); }
.login .box { width: min(380px, 100%); background: rgba(19, 19, 29, 0.85); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.login .brand { font-size: 22px; margin-bottom: 6px; }
.login p { color: var(--muted); margin: 0 0 18px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login input { min-height: 48px; font-size: 17px; text-align: center; letter-spacing: 1px; }
.login .err { color: #ffb3bd; font-size: 14px; min-height: 20px; }

/* --- Petits écrans (iPhone) ------------------------------------------------------------ */
@media (max-width: 860px) {
  :root { --tabbar: 64px; }
  /* Un ancêtre avec backdrop-filter devient le repère des éléments « fixed » :
     sans ceci, la barre d'onglets se colle sous l'en-tête au lieu du bas de l'écran. */
  .topbar { padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); gap: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; background: #0a0a10; }
  .topbar .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around;
    background: rgba(10, 10, 16, 0.96); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .tab { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; flex: 1; }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { background: none; color: var(--accent); }
  .nowbar, .topbar .chips { display: none; }
  .topbar .spacer-m { flex: 1; }
  main { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .stage { display: block; height: auto; }
  .viewport { height: 46vh; min-height: 280px; }
  .side { border-left: none; overflow: visible; }
  .page { padding: 16px 12px 30px; }
  .editor { display: flex; flex-direction: column; height: auto; }
  .ed-transport { padding: 8px 12px; }
  .ed-main { height: 360px; flex: none; }
  .timeline { min-height: 0; }
  .inspector { border-left: none; border-top: 1px solid var(--line); overflow: visible; }
  .addbar { flex-direction: column; }
  .arm .lbl { display: none; }
}
@media (min-width: 861px) { .topbar .spacer-m { display: none; } }

/* --- Choix de conception (style, vitesse, couleurs) ------------------------------------ */
.prefs { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.prefs.compact { margin-top: 0; padding: 0; background: none; border: none; }
.prefrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prefrow.col { flex-direction: column; align-items: stretch; gap: 8px; }
.prefs, .prefrow, .prefrow > * { min-width: 0; max-width: 100%; }
.plabel { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); font-weight: 700; min-width: 64px; }
.palpick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.palchip { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.palchip:hover { border-color: var(--line-2); }
.palchip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.sec-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.lyric-now { font-size: 13px; color: var(--muted); font-style: italic; min-height: 18px; }
.review-box { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: #1b140c; border: 1px solid #4a3418; font-size: 13px; color: #ffd9a8; }
