/* cortexlab/app/ui/app.css, copied by web/art/demo.py without its width queries */
:root {
  --ground: #10141b;
  --bar: #0c0f14;
  --side: #141922;
  --line: #212a3a;
  --line-2: #263042;
  --raised: #1c2330;
  --text: #e6e7e9;
  --muted: #a2a9b6;
  --faint: #8b94a4;
  /* colours by role (Giovanni, 2026-10-05; APP-DESIGN "Everywhere"). The device's own
     colours - footswitch letters, scene colours, the loaded preset - are content and
     span the whole rainbow, so the interface keeps its hues out of their way: */
  --brand: #2e8bff;               /* the icon's blue (the wand): the main button of a screen */
  --brand-hover: #4d9dff;
  --brand-ink: #04101f;           /* text on the brand colour: white on this blue reads at 3.4:1, this at 5.5:1 */
  --mark: #e8f4ff;                /* the icon's near-white blue (the sparkles), as the neutral:
                                     selection, focus, where a dragged item goes */
  --progress: #e8f4ff;            /* neutral: progress bars */
  --attention: #f5c542;           /* yellow: warnings, why something cannot be done */
  --attention-ink: #ffe39a;
  --attention-line: #6b5a1e;
  --attention-bg: #262113;
  --offline: #52617b;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column; overflow: hidden; min-width: 720px;
  background: var(--ground); color: var(--text);
  font-family: 'Barlow', system-ui, sans-serif; font-size: 15px;
  user-select: none;
}
button { font-family: inherit; color: inherit; }
button:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.4; }
.label { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); }

/* header */
.top {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 28px; padding: 0 20px;
  background: var(--bar); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { display: block; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: 0.02em; }
.tools { display: flex; gap: 4px; }
.tools button, .views button {
  height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent;
  color: var(--faint); font-size: 15px; font-weight: 500; cursor: pointer;
}
.tools button[aria-pressed="true"], .views button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 600; }
.tools button:disabled, .views button:disabled { cursor: default; }
.spacer { flex-grow: 1; }

/* layout */
.body { flex-grow: 1; min-height: 0; display: flex; }
/* the open setlist takes the content's ground and joins it (Giovanni, 2026-10-04) */
.setlists {
  width: 264px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--side);
}
.side-head { display: flex; align-items: center; gap: 6px; padding: 14px 10px 8px 20px; }
.side-head #setlist-count { margin-left: auto; }
.icon-button {
  width: 32px; height: 32px; flex-shrink: 0; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-button:hover:not(:disabled) { background: #1c2330; color: var(--text); }
.icon-button:disabled { opacity: 0.5; cursor: default; }
.icon-button.turning svg { animation: turn 0.9s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.setlist-buttons { flex-grow: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.setlist-buttons button {
  min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 12px; border: 0; border-radius: 8px; background: transparent; text-align: left;
  font-size: 15px; font-weight: 500; cursor: pointer;
}
.setlist-buttons button:hover { background: #181f2a; }
.setlist-buttons button[aria-current="true"] {
  margin-right: -10px; padding-right: 22px; border-radius: 8px 0 0 8px; background: var(--ground); font-weight: 600;
}
/* no scrollbar between the open setlist and the content: a fade says there is more below */
.setlist-buttons::-webkit-scrollbar { width: 0; height: 0; }
.setlist-buttons.more-below {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent);
}
.setlist-buttons .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the ⋯ of a setlist (Rename, Delete): on hover and on the open one, as a preset's */
.setlist-buttons button .more { flex: none; margin-right: -6px; }
.setlist-buttons button:hover .more, .setlist-buttons button[aria-current="true"] .more { opacity: 1; }
/* Delete a setlist: every preset it holds, in two columns filled top to bottom (the rows
   are set by app.js); it scrolls when long */
.delete-list {
  list-style: none; margin: 4px 0 0; padding: 10px 12px; max-height: min(46vh, 420px); overflow-y: auto;
  display: grid; grid-auto-flow: column; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px;
  background: var(--ground); border: 1px solid var(--line); border-radius: 8px;
}
.delete-list li { display: flex; gap: 10px; padding: 2px 0; font-size: 14px; min-width: 0; }
.delete-list .pos { flex: none; width: 3.2em; color: var(--muted); }
.delete-list .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setlist-buttons .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
/* a filled grey, so an active secondary button never looks switched off (Giovanni,
   2026-10-04); switched off = no fill, faint border and text */
.secondary {
  height: 44px; border: 1px solid #455167; border-radius: 8px; background: #252f40; color: var(--text);
  font-size: 15px; font-weight: 500; cursor: pointer;
}
.secondary:hover:not(:disabled) { background: #313a4a; border-color: #53627d; }
.secondary:disabled { background: transparent; border-color: var(--line-2); color: var(--faint); cursor: default; }

.content { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.views { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 10px; flex-shrink: 0; }
.views button { height: 34px; padding: 0 14px; }
.views button:disabled { opacity: 0.4; }

.list-wrap { flex-grow: 1; min-height: 0; overflow-y: auto; padding: 8px 28px 24px; }
.message { display: none; max-width: 560px; margin: 48px auto; text-align: center; line-height: 1.5; color: var(--muted); }
.message.show { display: block; }
.message strong { display: block; margin-bottom: 6px; font-size: 18px; color: var(--text); }
.message button { margin-top: 18px; padding: 0 22px; }

/* the list */
.presets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bank { display: flex; align-items: center; gap: 10px; padding: 14px 2px 6px; }
.bank .label { font-size: 12px; }
.bank .rule { flex-grow: 1; height: 1px; background: var(--line-2); }
.row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 90px) minmax(0, 170px) 30px; align-items: center; gap: 12px;
  min-height: 42px; padding: 0 6px 0 12px; border-radius: 8px; background: #151b25;
}
.row .pos { font-family: var(--mono); font-size: 15px; font-weight: 500; }
.row .pos .num { color: var(--faint); }
.row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .instrument, .row .author { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.empty { background: transparent; border: 1px dashed var(--line-2); }
.row.empty .name { font-weight: 400; font-style: italic; color: var(--faint); }
.row.loaded { background: var(--loaded-bg); }

button.small { height: 36px; padding: 0 12px; font-size: 14px; }

/* reorder: rows as drag sources and targets */
.row { position: relative; cursor: grab; }
.row.empty { cursor: default; }
.slot.selected { box-shadow: inset 0 0 0 2px var(--mark); }
.slot.dragging { opacity: 0.35; }
.chip-moved {
  margin-left: 10px; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600;
  color: #d1d2d6; background: #263042; vertical-align: 2px;
}
.row.line-before::before, .row.line-after::after {
  content: ''; position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: var(--mark); pointer-events: none;
}
.row.line-before::before { top: -3px; }
.row.line-after::after { bottom: -3px; }
.slot .onto, .slot .place { display: none; pointer-events: none; }
.slot.onto-replace .onto, .slot.onto-swap .onto {
  position: absolute; inset: 0; display: flex; gap: 5px; background: var(--ground);
}
.onto .half {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 7px;
  font-weight: 600; font-size: 14px;
}
.onto .half small { font-weight: 400; font-size: 12px; opacity: 0.8; }
.onto .replace { border: 2px solid #6e262b; background: #2a1214; color: #b5474d; }
.onto .swap { border: 2px solid #364051; background: #181f2a; color: var(--faint); }
.slot.onto-replace .onto .replace { border-color: #ff4d55; background: #4a1519; color: #ffe9ea; }
.slot.onto-swap .onto .swap { border-color: var(--mark); background: #252f40; color: #fff; }
.slot.over-place .place {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px;
  background: #2c3442; color: #fff; font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 2px var(--mark);
}

/* the bottom bar: one line (Giovanni, 2026-10-04) */
.draftbar {
  flex-shrink: 0; display: flex; align-items: center; gap: 12px; min-height: 52px;
  padding: 8px 20px 8px 28px; border-top: 1px solid var(--line); background: var(--side);
}
.draftbar[hidden] { display: none; }
.bar-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.bar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.bar-text.muted { font-weight: 400; }
.bar-gap { flex-grow: 1; }
.draftbar button.secondary, .draftbar button.primary { height: 36px; padding: 0 14px; font-size: 14px; flex-shrink: 0; }
.draftbar button.icon { width: 38px; padding: 0; }
.icon svg { display: block; margin: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.progress { flex: 0 0 160px; height: 6px; border-radius: 3px; background: #263042; }
.progress .fill { height: 100%; border-radius: 3px; background: var(--progress); transition: width 0.2s; }
.primary {
  height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--brand); color: var(--brand-ink);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.primary:hover { background: var(--brand-hover); }
.danger {
  height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: #b3261e; color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
}

/* dialogs */
.modal-back { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); z-index: 10; }
.modal-back[hidden] { display: none; }
.modal {
  width: 520px; max-width: calc(100% - 32px); padding: 24px 26px 20px; border-radius: 12px;
  background: #181f2a; border: 1px solid #263042; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal h2 { margin: 0 0 10px; font-size: 20px; font-weight: 700; }
.modal p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; color: #d1d2d6; user-select: text; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-actions button { padding: 0 16px; }

/* replace: what the save will delete */
.deleted-strip {
  flex-shrink: 0; padding: 8px 28px; font-size: 14px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #ffd9db; background: #2a1214; border-top: 1px solid #6e262b;
}
.deleted-strip[hidden] { display: none; }

/* save as new setlist */
.text-input {
  width: 100%; height: 44px; margin: 6px 0 10px; padding: 0 12px; border-radius: 8px;
  border: 1px solid #364051; background: #10141b; color: var(--text); font-family: inherit; font-size: 16px;
  user-select: text;
}
.text-input:focus { outline: 2px solid var(--mark); outline-offset: 1px; }
.facts .fact { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.facts .fact.bad { color: var(--attention); font-weight: 600; }
.modal-actions button:disabled { opacity: 0.4; cursor: default; }

/* banks view: the Preset-mode Gig View, Cortex Control's version */
/* banks side by side are divided by a vertical line too: every card draws one on its
   left, and the first card of each row pushes its line out of the clipped box */
.banks { display: flex; flex-wrap: wrap; align-content: flex-start; row-gap: 22px; padding-top: 4px; overflow: hidden; }
.banks[hidden], .presets[hidden] { display: none; }
.bank-card { width: 384px; max-width: 100%; display: flex; flex-direction: column; gap: 4px; box-sizing: border-box;
  margin-left: -1px; padding: 0 24px; border-left: 1px solid var(--line-2); }
.banks.eight .bank-card { width: 584px; }
.bank-card .bank { padding: 0 2px 4px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.banks.eight .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile {
  position: relative; min-height: 112px; padding: 10px 12px 12px; border-radius: 8px; background: #181f2a;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px; cursor: grab;
}
.tile:hover { background: #1d2533; }
.tile.empty { background: transparent; border: 1px dashed var(--line-2); cursor: default; }
.tile-pos { align-self: flex-end; font-size: 30px; font-weight: 400; line-height: 1; }
.tile-pos .num { color: var(--faint); }
.tile-name { padding-right: 26px; font-size: 15px; font-weight: 500; line-height: 1.25; color: #d1d2d6; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile.empty .tile-name { font-style: italic; color: var(--faint); }
.tile.loaded, .tile.loaded:hover { color: #0c0f14; }
.tile.loaded .tile-name, .tile.loaded .tile-pos .num { color: #0c0f14; font-weight: 600; }
.tile-chip { position: absolute; top: 10px; left: 12px; margin: 0; }
.tile.line-before::before, .tile.line-after::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--mark); pointer-events: none;
}
.tile.line-before::before { left: -5px; }
.tile.line-after::after { right: -5px; }
.tile .onto { flex-direction: column; }

/* preset details */
.field-label { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
select.text-input { appearance: auto; }
.danger-text { color: #ff8a8f; }

/* keyboard focus on the list area */
.list-wrap:focus { outline: none; }

/* context menu */
.ctxmenu {
  position: fixed; z-index: 20; min-width: 230px; padding: 6px; border-radius: 10px;
  background: #1c2330; border: 1px solid #364051; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.ctxmenu[hidden] { display: none; }
.ctxmenu .item {
  width: 100%; height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 10px; border: 0; border-radius: 6px; background: transparent; font-size: 14px; text-align: left; cursor: pointer;
}
.ctxmenu .item:hover:not(:disabled), .ctxmenu .item:focus-visible { background: #263042; outline: none; }
.ctxmenu .item:disabled { opacity: 0.4; cursor: default; }
.ctxmenu .keys { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ctxmenu .sep { height: 1px; margin: 5px 4px; background: var(--line-2); }

/* loading: the slot fills like a progress bar */
.slot .loadfill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; pointer-events: none; }
.slot.loading > :not(.loadfill) { position: relative; }
.slot.loading .onto, .slot.loading .place, .tile.loading .more, .tile.loading .tile-chip { position: absolute; }
.tile.loading .letter, .tile.loading .tile-pos .num { color: var(--text) !important; }   /* the fill is the letter's colour */

/* the ⋯ of a preset: on hover and on the selected one */
.more {
  width: 30px; height: 28px; display: flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0;
}
.more svg { display: block; fill: currentColor; }
.slot:hover .more, .slot.selected .more, .more:focus-visible { opacity: 1; }
.more:hover, .more[aria-expanded="true"] { background: #263042; color: var(--text); opacity: 1; }
.tile .more { position: absolute; right: 6px; bottom: 6px; }
.tile.loaded .more { color: #0c0f14; }
.tile.loaded .more:hover { background: rgba(0, 0, 0, 0.15); }

/* scrollbars in the app's colours */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2d3543; border: 2px solid transparent; border-radius: 5px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #394355; }

/* the start notice's "don't show again" */
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: #d1d2d6; }

/* narrower windows */

/* small screens and large text: columns give way, the header and the bar tighten */



/* settings */
.sizes { align-self: flex-start; width: max-content; margin: 6px 0 4px; }
.sizes button { height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent;
  color: var(--faint); font-size: 15px; font-weight: 500; cursor: pointer; }
.sizes button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 600; }
.about { margin-top: 18px !important; font-size: 13px !important; color: var(--faint) !important; }
.top .icon-button { width: 38px; height: 38px; }

/* settings: the device's name */
.name-row { display: flex; gap: 8px; align-items: center; }
.name-row .text-input { margin: 6px 0; }
.name-row button { flex-shrink: 0; padding: 0 16px; }

/* plugins the user owns */
.plugin-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; margin: 8px 0 12px; }
.plugin-list .check { margin-top: 6px; color: var(--text); }
#modal > .secondary { padding: 0 16px; }

/* -- Preset merge ------------------------------------------------------------------- */
.body[hidden], .views[hidden] { display: none; }
.source-note { margin: 6px 2px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.source-note button { margin-top: 6px; height: 34px; padding: 0 12px; font-size: 14px; }

.merge-main { position: relative; }
.merge-scroll { flex-grow: 1; min-height: 0; overflow-y: auto; padding: 18px 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.merge-head { display: flex; align-items: center; gap: 12px; }
.merge-head[hidden] { display: none; }
.merge-head h1 { margin: 0; font-size: 24px; font-weight: 700; }
.merge-head .secondary { align-self: center; padding: 0 14px; }
.merge-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 24px; }
.merge-pages.qc { grid-template-columns: 1fr; }
.merge-page { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.merge-page .label { font-size: 12px; }
.mtiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.merge-pages.qc .mtiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* a scene: the Scene-mode Gig View (data/ui-reference/NOTES.md) - the default scene in
   the "selected" look, as the device shows it right after loading */
.mtile {
  position: relative; height: 148px; overflow: hidden; border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px;
  background: var(--tint, #1e1e1e); color: #d3cfcf;
}
.mtile.real { cursor: grab; }
.mtile.free { background: transparent; border: 1px dashed var(--line-2); color: var(--faint); }
.mtile.default { background: var(--colour); color: #000; }
.mtile .mark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); pointer-events: none;
  font-size: 96px; font-weight: 700; line-height: 1; color: var(--watermark, #252525);   /* the big scene letter; not --mark, the neutral */
}
.mtile > :not(.mark):not(.onto):not(.place):not(.loadfill) { position: relative; }
.mtile .mtop { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; }
.mtile .letter { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.mtile .x {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: rgba(0, 0, 0, 0.35);
  color: inherit; font-size: 16px; line-height: 1; cursor: pointer;
}
.mtile.default .x { background: rgba(0, 0, 0, 0.15); }
.mtile .scene-label {
  font-size: 20px; font-weight: 600; line-height: 1.15; text-align: center; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mtile.free .scene-label { font-size: 14px; font-weight: 400; }
.mtile .mbottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; }
.mtile .from {
  min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; opacity: 0.8; text-align: left;
  font-size: 12px; line-height: 1.3; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mtile .from:hover { opacity: 1; text-decoration: underline; }
.mtile .tag { flex-shrink: 0; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(0, 0, 0, 0.18); }
.mtile .make-default {
  flex-shrink: 0; height: 24px; padding: 0 8px; border: 1px solid #364051; border-radius: 999px;
  background: rgba(0, 0, 0, 0.35); color: inherit; font-size: 11px; cursor: pointer;
}
.mtile.reading .scene-label { opacity: 0.6; }
.mtile .loadfill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.08); pointer-events: none; }
.mtile.dragging { opacity: 0.35; }
.mtile .onto, .mtile .place { display: none; pointer-events: none; }
.mtile.onto-replace .onto, .mtile.onto-swap .onto { position: absolute; inset: 0; display: flex; gap: 5px; padding: 0; background: var(--ground); }
.mtile.onto-replace .onto .replace { border-color: #ff4d55; background: #4a1519; color: #ffe9ea; }
.mtile.onto-swap .onto .swap { border-color: var(--mark); background: #252f40; color: #fff; }
.mtile.over-place .place {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  background: #2c3442; color: #fff; font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 2px var(--mark);
}

.merge-options { display: flex; flex-direction: column; gap: 12px; }
.mopt { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--side); }
.mopt h2 { margin: 0; font-size: 15px; font-weight: 600; }
.mopt p { margin: 0; font-size: 14px; line-height: 1.45; color: #d1d2d6; user-select: text; }
.mopt .check { margin-top: 2px; color: var(--text); }
.mopt .choice { display: flex; gap: 2px; padding: 2px; align-self: flex-start; border: 1px solid var(--line-2); border-radius: 10px; }
.mopt .choice button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); font-size: 14px; cursor: pointer; }
.mopt .choice button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 600; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); align-items: center; gap: 12px; }
.setting-row .what { font-size: 14px; line-height: 1.4; }
.setting-row .what small { display: block; font-size: 13px; color: var(--muted); }
.setting-row select { height: 36px; margin: 0; font-size: 14px; }
.blocker { color: var(--attention); }

/* the source dialog: which scene, which sound, the name */
.scene-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 6px 0 4px; }
.scene-pick button {
  position: relative; min-height: 58px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px;
  background: var(--tint); color: #d3cfcf; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.scene-pick button .l { font-family: var(--mono); font-size: 11px; opacity: 0.8; }
.scene-pick button .n { font-size: 14px; font-weight: 600; line-height: 1.2; word-break: break-word; }
.scene-pick button .i { font-size: 11px; opacity: 0.75; }
.scene-pick button[aria-pressed="true"] { background: var(--colour); color: #000; }
.scene-pick button:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
.inputs-pick { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.inputs-pick .check { margin-top: 6px; color: var(--text); }
.layout-grid { display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 10px 14px; margin: 8px 0; }
.layout-grid .views button { height: 32px; padding: 0 12px; font-size: 14px; }
.modal.wide { width: 640px; }

/* report a problem (report.js): it scrolls in a short window */
.modal.report { max-height: calc(100vh - 32px); overflow-y: auto; }
.report-text { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.4; resize: vertical; }
.link-button {
  margin-top: 12px; padding: 0; height: auto; border: 0; background: none; color: var(--muted);
  font-size: 14px; text-decoration: underline; cursor: pointer;
}
.link-button:hover { color: var(--text); }
.report-preview {
  max-height: 180px; overflow: auto; margin: 8px 0 0; padding: 10px 12px; border-radius: 8px;
  border: 1px solid #364051; background: #10141b; color: var(--muted);
  font-family: var(--mono); font-size: 12px; line-height: 1.45; white-space: pre-wrap; user-select: text;
}
.report-preview[hidden] { display: none; }




/* Preset merge, step 2: Try it, then save */
.merge-try { display: flex; flex-direction: column; gap: 16px; }
.merge-try[hidden] { display: none; }
.sources.locked .setlist-buttons { opacity: 0.45; pointer-events: none; }
.try-busy { max-width: 560px; margin: 40px auto; display: flex; flex-direction: column; gap: 12px; }
.try-busy h1 { margin: 0; font-size: 22px; }
.try-busy p { margin: 0; line-height: 1.5; }
.try-busy .progress { flex: none; width: 100%; }
.try-actions { display: flex; gap: 8px; margin-top: 8px; }
.try-actions button { padding: 0 18px; }
button.mtile { width: 100%; border: 0; font-family: inherit; text-align: left; cursor: pointer; }
button.mtile:disabled { cursor: default; }
button.mtile .from { cursor: inherit; }
button.mtile .from:hover { text-decoration: none; }
.try-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.save-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 6px 12px; }
.save-grid .field-label { margin: 0; }
.save-grid .text-input { height: 38px; margin: 0; font-size: 14px; }
.problems { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; color: #d1d2d6; user-select: text; }
.merge-pages[hidden], .merge-options[hidden] { display: none; }
.mtile .scene-label.unnamed { font-size: 15px; font-weight: 400; font-style: italic; opacity: 0.6; }
#modal > .progress { flex: none; width: 100%; margin: 12px 0 0; }
#modal > .progress[hidden] { display: none; }

/* Preset merge, Giovanni's layout (2026-10-04): the presets above, the new preset below */
.merge-main { display: flex; flex-direction: column; }
.merge-main > .message.show { flex-grow: 1; }
.sources .side-label { padding: 14px 12px 6px; font-size: 12px; }
.merge-top { flex: 1 1 auto; min-height: 140px; display: flex; flex-direction: column; }
.merge-top[hidden], .merge-bottom[hidden] { display: none; }
.merge-top-head { display: flex; align-items: center; gap: 14px; padding: 10px 28px 4px; }
.merge-top-head .text-input { width: 280px; height: 36px; margin: 0; font-size: 14px; flex-shrink: 0; }
.merge-top-head .small { font-size: 13px; }
.merge-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 28px 10px; }
.merge-list .bank { padding: 10px 2px 4px; }
.srow {
  position: relative; min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 2px 6px 2px 8px;
  border-radius: 8px; background: #151b25; cursor: pointer; overflow: hidden;
}
.srow:hover { background: #1a212d; }
.srow.open { background: #1f2735; border-radius: 8px 8px 0 0; }
.srow > :not(.loadfill) { position: relative; }
.srow .pos { width: 34px; flex-shrink: 0; font-family: var(--mono); font-size: 13px; color: var(--faint); }
.srow .nm { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.srow .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .nm .n { font-weight: 600; }
.srow .nm .where { font-size: 12px; color: var(--faint); }
.srow .used { padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 11px; font-weight: 600; color: #0c0f14; }
.srow .chev {
  width: 30px; height: 30px; flex-shrink: 0; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.srow .chev svg { display: block; margin: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.srow:not(.open) .chev svg { transform: rotate(-90deg); }
.srow .chev:hover { background: #263042; color: var(--text); }
.srow .loadfill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(233, 231, 227, 0.08); pointer-events: none; }
.sscenes {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px 30px; margin-bottom: 4px;
  border-radius: 0 0 8px 8px; background: #1f2735; font-size: 13px;
}
.sscenes .secondary { align-self: flex-start; }
.sscene-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
/* what can be dragged is blue, the brand's (Giovanni, 2026-10-09: red read as "not allowed");
   a scene's own colour is the stripe on the left */
.sscene {
  min-height: 54px; padding: 5px 8px; border-radius: 7px; background: rgba(46, 139, 255, 0.14); color: #dfe4ec;
  display: flex; flex-direction: column; gap: 1px; cursor: grab;
  border: 1px solid rgba(46, 139, 255, 0.28); border-left: 4px solid var(--colour, var(--brand));
}
.sscene:hover { border-color: var(--brand); border-left-color: var(--colour, var(--brand)); background: rgba(46, 139, 255, 0.2); }
.sscene:active { cursor: grabbing; }
.sscene.whole { max-width: 360px; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; }
.sscene .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sscene .went { margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: rgba(46, 139, 255, 0.3); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.sscene .drag-me {
  flex-shrink: 0; padding: 3px 9px; border-radius: 999px; background: var(--brand); color: var(--brand-ink);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.sscene .l { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-family: var(--mono); font-size: 11px; opacity: 0.85; }
.sscene .grip { display: inline-flex; flex-shrink: 0; color: var(--brand-hover); }
.sscene.whole .grip svg { width: 10px; height: 16px; }
.sscene .grip svg { fill: currentColor; }
.sscene .n { font-size: 14px; font-weight: 600; line-height: 1.2; word-break: break-word; }
.sscene .i { font-size: 11px; opacity: 0.75; }
.merge-bottom { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 8px 28px 10px; border-top: 1px solid var(--line); background: #0e1219; }
.merge-bottom .merge-head .secondary { height: 32px; padding: 0 12px; font-size: 14px; }
.merge-bottom .mtile { height: 98px; padding: 6px 9px; gap: 2px; }
.merge-bottom .merge-page > .label { display: none; }      /* AI / AII on the tiles say the page */
.merge-bottom .mtile .mark { font-size: 64px; }
.merge-bottom .mtile .mtop, .merge-bottom .mtile .mbottom { min-height: 22px; }
.merge-bottom .mtile .x { width: 22px; height: 22px; font-size: 14px; }
.merge-bottom .mtile .make-default { height: 22px; }
.merge-bottom .mtile .scene-label { font-size: 14px; line-height: 1.15; }
.merge-bottom .merge-pages { gap: 8px 20px; }
.merge-bottom .mtiles { gap: 6px; }
.merge-options { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; }
.try-busy .stage-line { min-height: 1.5em; font-size: 14px; color: var(--text); }
.try-busy .progress .fill, .draftbar .progress .fill { transition: width 0.6s ease-out; }
/* footswitches and pedals after Try it: copyable facts */
.pedal-list { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 0; user-select: text; }
.pedal-list h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.pedal-list p { margin: 0 0 2px; font-size: 14px; line-height: 1.4; color: #d1d2d6; }
.pedal-list .who { color: var(--muted); }
.pedal-list .merge-row { color: var(--text); font-weight: 600; }
/* the warning after Try it: the attention yellow; red stays for what deletes */
.warn { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 14px; border: 1px solid var(--attention-line); border-radius: 10px; background: var(--attention-bg); }
.warn-head { display: flex; align-items: center; gap: 10px; }
.warn-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--attention-ink); }
.warn-icon svg { display: block; }
.warn .muted { margin: 0; font-size: 14px; line-height: 1.45; }
.warn .secondary.small { height: 32px; padding: 0 12px; font-size: 14px; }
.warn.flash { box-shadow: 0 0 0 3px var(--attention); transition: box-shadow 0.2s; }
.warn.folded { padding: 8px 16px; }
.warn.folded .warn-head h2 { font-size: 14px; font-weight: 600; }
/* a disabled primary looks it (Giovanni, 2026-10-04: Save stayed blue and did nothing) */
.primary:disabled, .primary:disabled:hover { background: #252f40; color: var(--faint); cursor: default; }
.bar-text.why { color: var(--attention); font-weight: 600; }
/* every kind of button looks switched off when it is (Giovanni, 2026-10-04) */
button:disabled { cursor: default; }
.danger:disabled, .danger:disabled:hover { background: #252f40; color: var(--faint); }
.mtile .x:disabled, .mtile .make-default:disabled, .srow .chev:disabled, .sscene[aria-disabled="true"] { opacity: 0.4; }
