/* Single dark look by choice: this is a piece of video gear. */
  :root {
    color-scheme: dark;
    --chassis: #101713;
    --panel: #151e18;
    --raise: #1c2a21;
    --raise-2: #26372b;
    --well: #090f0b;
    --line: #304a38;
    --ink: #e1eee4;
    --dim: #9eb7a5;
    --faint: #698572;
    --loop-a: #279658;
    --loop-b: #4fd1c5;
    --loop-a-ink: #83e6a5;   /* the accent, lightened, for text and icons on the dark panels */
    --amber: var(--loop-a);
    --amber-ink: var(--loop-a-ink);
    --amber-glow: rgba(39,150,88,.45);
    --press-1: #204b30;
    --press-2: #173622;
    --press-ink: #dcffe6;
    --tally: #ff4b3e;
    --gun-r: #ff4a4a;
    --gun-g: #3ddc84;
    --gun-b: #4f86ff;
    --osd: #e9fbe9;
    --f-display: var(--f-body);
    --f-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
    --f-osd: var(--f-body);
  }
  html, body { height: 100%; }
  body {
    background: var(--chassis);
    color: var(--ink);
    font: 15px/1.45 var(--f-body);
    -webkit-font-smoothing: antialiased;
  }
  button, select { font: inherit; color: inherit; }
  :focus-visible { outline: 2px solid var(--amber-ink); outline-offset: 2px; }

  .app { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }

  /* ---------- top bar ---------- */
  .top {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(#1e1a1f, var(--chassis));
  }
  .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .guns { position: relative; width: 22px; height: 20px; flex: none; }
  .guns i { position: absolute; width: 9px; height: 9px; border-radius: 25%; }
  .guns i:nth-child(1) { background: var(--gun-r); left: 0; top: 0; box-shadow: 0 0 8px var(--gun-r); }
  .guns i:nth-child(2) { background: var(--gun-g); right: 0; top: 0; box-shadow: 0 0 8px var(--gun-g); }
  .guns i:nth-child(3) { background: var(--gun-b); left: 6.5px; bottom: 0; box-shadow: 0 0 8px var(--gun-b); }
  .wordmark {
    font-family: var(--f-display); font-size: 15px; letter-spacing: .22em; text-transform: none;
    white-space: nowrap;
  }
  .readout {
    font-family: var(--f-osd); font-size: 20px; color: var(--dim); letter-spacing: .04em;
    display: flex; gap: 10px; align-items: baseline; white-space: nowrap;
  }
  .readout .tc-label { color: var(--faint); }
  .readout #tc { color: var(--loop-a-ink); min-width: 11ch; }

  /* ---------- main deck ---------- */
  .deck { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; }

  .monitor { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 14px; min-height: 0; min-width: 0; }
  .stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; }
  .stage:fullscreen { background: #000; padding: 0; }
  .stage:-webkit-full-screen { background: #000; }
  .stage:fullscreen .bezel { padding: 0; border-radius: 0; background: #000; box-shadow: none; }
  .stage:fullscreen .screen { border-radius: 0; }
  .stage:-webkit-full-screen .bezel { padding: 0; border-radius: 0; background: #000; box-shadow: none; }
  .stage:-webkit-full-screen .screen { border-radius: 0; }
  /* Full screen: a big way out, shown when the mouse moves or the picture is tapped, gone again when still */
  .fs-exit {
    position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); z-index: 6;
    display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 20px; border-radius: 10px;
    border: 1px solid var(--loop-a); background: rgba(11,10,12,.82); color: #dcffe6;
    font: 600 18px/1 var(--f-body); cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); transition: opacity .4s;
  }
  .fs-exit:hover { background: rgba(67,31,81,.92); }
  .fs-exit .x { font-size: 22px; line-height: 1; }
  .fs-exit kbd { font: 600 11px/1.2 var(--f-body); padding: 3px 6px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 2px; color: var(--dim); }
  @media (hover: none) { .fs-exit kbd { display: none; } }
  .fs-exit.away { opacity: 0; pointer-events: none; }
  /* Full screen during a taste session: the timer and the rating buttons come and go together with the mouse */
  .fs-taste {
    position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 6;
    display: flex; align-items: center; gap: 10px; transition: opacity .4s;
  }
  .fs-taste.away { opacity: 0; pointer-events: none; }
  .fs-taste[hidden] { display: none; }
  .fs-rate {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 60px; padding: 8px 16px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .25); background: rgba(11,10,12,.82); color: var(--ink);
    font: 600 17px/1 var(--f-body); cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); transition: opacity .4s;
    white-space: nowrap;
  }
  .fs-rate .thumb { width: 22px; height: 22px; }
  .fs-rate.rate-up { border-color: rgba(61, 220, 132, .6); }
  .fs-rate.rate-down { border-color: rgba(255, 75, 62, .6); }
  .fs-rate:hover { background: rgba(38,32,40,.92); }
  .fs-clock {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 10px;
    background: rgba(0, 0, 0, .55); color: rgba(255, 255, 255, .85); font: 600 14px/1 var(--f-body);
    font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .fs-clock .ring {
    width: 12px; height: 12px; border-radius: 25%; flex: none;
    background: conic-gradient(var(--gun-g) calc(var(--p, 0) * 1turn), rgba(255, 255, 255, .2) 0);
  }
  .stage.idle canvas { cursor: none; }
  .bezel {
    padding: 8px;
    border-radius: 7px;
    background: linear-gradient(160deg, #312b34 0%, #201c22 45%, #141215 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 -2px 0 rgba(0,0,0,.4), 0 24px 50px rgba(0,0,0,.5);
  }
  .screen {
    position: relative; overflow: hidden; line-height: 0;
    border-radius: 4.5px / 5px;
    background: #030303;
    box-shadow: 0 0 0 2px #09080a;
  }
  .screen canvas { display: block; touch-action: none; cursor: crosshair; }

  .osd {
    position: absolute; left: 5.5%; top: 6%; pointer-events: none;
    display: grid; line-height: 1; gap: 2px;
    font-family: var(--f-osd); color: var(--osd);
    text-shadow: 0 0 6px rgba(120,255,150,.7), 2px 2px 0 rgba(0,0,0,.85);
    opacity: 0; transition: opacity .5s ease;
  }
  .osd.on { opacity: 1; transition: none; }
  .osd-a { font-size: clamp(28px, 4.4vw, 46px); }
  .osd-b { font-size: clamp(18px, 2.4vw, 26px); letter-spacing: .08em; }

  .rec-ind {
    position: absolute; right: 5.5%; top: 6%; pointer-events: none;
    font-family: var(--f-osd); font-size: clamp(20px, 2.6vw, 28px); line-height: 1; color: var(--tally);
    text-shadow: 0 0 8px rgba(255,75,62,.7), 2px 2px 0 rgba(0,0,0,.85);
  }
  .rec-ind .dot { animation: blink 1s steps(2, start) infinite; }
  @keyframes blink { to { visibility: hidden; } }

  .tip {
    position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%);
    pointer-events: none; line-height: 1.3; text-align: center;
    max-width: 86%;
    padding: 7px 14px; border-radius: 10px;
    background: rgba(9,8,10,.72); color: var(--ink); font-size: 14px;
    border: 1px solid rgba(255,255,255,.12);
    transition: opacity .6s ease;
  }
  .tip.gone { opacity: 0; }
  .name-box {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5;
    width: min(440px, 90%); display: flex; flex-direction: column; gap: 9px; padding: 14px 16px;
    border-radius: 5px; background: rgba(31,27,32,.97); border: 1px solid var(--line);
    box-shadow: 0 14px 44px rgba(0,0,0,.65); cursor: auto; text-align: left;
  }
  .name-box[hidden] { display: none; }
  .name-title { font-weight: 600; font-size: 15px; color: var(--ink); }
  .name-ext { align-self: center; color: var(--dim); font-size: 14px; }
  .name-btns { justify-content: flex-end; }
  .name-save { border-color: var(--amber); }

  .drop, .screen-msg {
    position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
    padding: 24px; line-height: 1.4;
    font-family: var(--f-osd); font-size: 26px; color: var(--osd);
    background: rgba(5,5,5,.72);
  }
  .screen-msg { font-family: var(--f-body); font-size: 16px; color: var(--ink); background: #080708; }

  .transport { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
  .transport .spacer { width: 12px; }

  .foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; min-height: 22px; font-size: 13px; color: var(--faint); }
  .foot kbd {
    font: 12px/1 var(--f-body); color: var(--dim);
    padding: 2px 5px; border-radius: 1.5px; border: 1px solid var(--line); background: var(--raise);
  }
  .toast { color: var(--loop-a-ink); margin: 0; }
  .keys { margin: 0; }
  @media (hover: none) { .keys { display: none; } }

  /* ---------- buttons ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 38px; padding: 7px 14px;
    border-radius: 3px; border: 1px solid var(--line); border-bottom-color: #0a100c;
    background: linear-gradient(var(--raise-2), var(--raise));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.4);
    font-weight: 500; cursor: pointer; white-space: nowrap;
  }
  .btn:hover { background: linear-gradient(#3a323d, #2d272f); }
  .btn:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
  .led {
    width: 8px; height: 8px; border-radius: 25%; flex: none;
    background: #39303c; box-shadow: inset 0 1px 1px rgba(0,0,0,.6);
  }
  .btn[aria-pressed="true"] .led { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow), 0 0 2px var(--amber); }
  .btn.rec[aria-pressed="true"] .led { background: var(--tally); box-shadow: 0 0 8px rgba(255,75,62,.7); }
  .btn.rec[aria-pressed="true"] { color: #ffd9d5; }
  .btn.wide { width: 100%; }
  .btn.small { min-height: 32px; padding: 5px 11px; font-size: 14px; }
  .linkish {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--amber-ink); text-decoration: underline; text-underline-offset: 2px; font-weight: 600;
  }

  /* ---------- control panel ---------- */
  .panel {
    overflow-y: auto; min-height: 0;
    border-left: 1px solid var(--line); background: var(--panel);
    padding: 20px;
    display: flex; flex-direction: column; gap: 26px;
  }
  .lede { margin: 0; color: var(--dim); max-width: 60ch; }
  .lede b { color: var(--ink); font-weight: 600; }
  .group { display: flex; flex-direction: column; gap: 12px; }
  .group h2 {
    margin: 0; display: flex; align-items: center; gap: 10px;
    font: 11px/1 var(--f-display); letter-spacing: .2em; text-transform: none; color: var(--dim);
  }
  .group h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  /* folding sections */
  .group h2.fold::after { display: none; }
  .group-toggle {
    flex: 1; display: flex; align-items: center; gap: 10px; min-height: 28px; padding: 0; margin: -4px 0;
    background: none; border: 0; cursor: pointer; text-align: left;
    font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  }
  .group-toggle:hover { color: var(--ink); }
  .group-toggle .rule { flex: 1; height: 1px; background: var(--line); }
  .group-toggle .chev {
    width: 8px; height: 8px; margin-right: 3px; flex: none;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s ease;
  }
  .group-toggle[aria-expanded="false"] .chev { transform: rotate(-45deg); }
  .group-body { display: flex; flex-direction: column; gap: 12px; }
  .panel-tools { display: flex; gap: 14px; margin-top: -14px; font-size: 13px; }
  .panel-tools .linkish { font-weight: 500; }

  /* my presets */
  .presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .pre { position: relative; min-width: 0; }
  .pre-load {
    width: 100%; display: flex; flex-direction: column; gap: 5px; padding: 4px 4px 6px;
    border-radius: 3.5px; border: 1px solid var(--line); border-bottom-color: #0a100c;
    background: linear-gradient(var(--raise-2), var(--raise)); cursor: pointer; text-align: left;
  }
  .pre-load:hover { border-color: #45624c; }
  .pre-load .sw { display: block; height: 44px; border-radius: 2px; background: #090e0a center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
  .pre-load .nm { font-size: 13px; line-height: 1.15; padding-inline: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pre-load[aria-pressed="true"] { border-color: var(--loop-a); box-shadow: 0 0 0 1px var(--loop-a); }
  .pre-auto {
    position: absolute; top: 8px; left: 8px; padding: 3px 5px; border-radius: 2px; pointer-events: none;
    border: 1px solid rgba(39,150,88,.55); background: rgba(9,8,10,.82); color: var(--amber-ink);
    font: 600 10px/1 var(--f-body); letter-spacing: .08em;
  }
  #presetApNote { display: none; color: var(--amber-ink); }
  .ap-on #presetApNote { display: block; }
  .pre-del, .pre-ren {
    position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 25%;
    display: grid; place-items: center; padding: 0; cursor: pointer;
    border: 1px solid rgba(255,255,255,.2); background: rgba(9,8,10,.8); color: var(--ink); font: 600 14px/1 var(--f-body);
    opacity: 0; transition: opacity .15s;
  }
  .pre-ren { right: 32px; font-size: 12px; }
  .pre:hover .pre-del, .pre-del:focus-visible, .pre:hover .pre-ren, .pre-ren:focus-visible { opacity: 1; }
  @media (hover: none) { .pre-del, .pre-ren { opacity: 1; } }
  .admin { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .admin-tag { font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--amber-ink); }
  .admin .linkish { align-self: flex-start; font-size: 13px; font-weight: 500; }
  #adminMsg.warn { color: #ffc98a; }
  .pre-confirm {
    position: absolute; inset: 0; border-radius: 3.5px; background: rgba(11,10,12,.94); border: 1px solid var(--tally);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px;
  }
  .pre-confirm div { display: flex; gap: 6px; }
  .pre-confirm button { min-height: 28px; padding: 3px 10px; border-radius: 2.5px; border: 1px solid var(--line); background: var(--raise-2); cursor: pointer; font-size: 13px; }
  .pre-confirm .yes { border-color: var(--tally); color: #ffd9d5; }
  .preset-form { display: flex; flex-direction: column; gap: 6px; }
  .preset-row { display: flex; gap: 6px; }
  .preset-row input {
    flex: 1; min-width: 0; min-height: 34px; padding: 5px 10px; border-radius: 3px;
    border: 1px solid var(--line); background: var(--well); color: var(--ink); font: inherit; font-size: 14px;
  }
  .preset-row input:focus-visible { outline: 2px solid var(--loop-a-ink); outline-offset: 1px; }
  .hint { margin: 0; font-size: 13px; color: var(--faint); }
  .feed-note { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 3px;
    border: 1px solid #4e305a; background: rgba(39,150,88,.07); color: var(--amber-ink); }
  .feed-note .linkish { align-self: flex-start; font-size: 13px; }


  .meter { display: flex; align-items: stretch; gap: 8px; height: 58px; padding: 6px 8px 4px; border-radius: 3px; background: #070707; border: 1px solid var(--line); }
  .mbar { flex: 1; display: flex; flex-direction: column; gap: 3px; position: relative; }
  .mbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 16px; border-radius: 1px; background: rgba(255,255,255,.05); }
  .mbar i { position: relative; }
  .mbar i { flex: 1; display: block; border-radius: 1px; transform-origin: bottom; transform: scaleY(0);
    background: linear-gradient(0deg, var(--loop-a), #f4defc); }
  .mbar span { font: 600 10px/1.2 var(--f-body); color: var(--faint); text-align: center; }
  .mbeat { align-self: center; font: 600 12px/1.2 var(--f-body); color: #39303c; padding-inline: 4px; }
  .mbeat.on { color: var(--tally); text-shadow: 0 0 8px rgba(255,75,62,.7); }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  .chip {
    display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 4px 11px; border-radius: 10px;
    border: 1px solid var(--line); border-bottom-color: #0a100c; background: linear-gradient(var(--raise-2), var(--raise));
    font-size: 13.5px; font-weight: 500; cursor: pointer;
  }
  .chip[aria-pressed="true"] { border-color: var(--loop-a); color: var(--press-ink); }
  .chip[aria-pressed="true"] .led { background: var(--loop-a); box-shadow: 0 0 8px var(--amber-glow); }
  .quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .quick-actions .btn { padding-inline: 8px; }
  .seg { display: grid; gap: 6px; }
  .seg-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ctl .seg + .hint, .ctl .ends + .seg { margin-top: 4px; }
  .seg-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .seg button {
    min-height: 36px; padding: 6px 2px; border-radius: 3px;
    border: 1px solid var(--line); border-bottom-color: #0a100c;
    background: linear-gradient(var(--raise-2), var(--raise));
    cursor: pointer; font-size: 13.5px; font-weight: 500; min-width: 0;
  }
  .seg button:hover { border-color: #45624c; }
  .seg button:disabled { opacity: .45; cursor: default; }
  .seg button[aria-pressed="true"] {
    background: linear-gradient(var(--press-1), var(--press-2)); border-color: var(--amber); color: var(--press-ink);
    box-shadow: inset 0 1px 3px rgba(0,0,0,.4);
  }

  select {
    width: 100%; min-height: 36px; padding: 6px 10px; border-radius: 3px;
    border: 1px solid var(--line); background: var(--raise); color: var(--ink); font-size: 14px; cursor: pointer;
  }

  /* loop editor: B swaps the accent to teal */
  .editor { display: flex; flex-direction: column; gap: 18px; }
  .editor[data-loop="B"], #minimalVisual[data-loop="B"] {
    --amber: var(--loop-b); --amber-ink: var(--loop-b); --amber-glow: rgba(79, 209, 197, .45);
    --press-1: #1d4440; --press-2: #15312e; --press-ink: #cafff8;
  }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 4.5px; background: var(--well); border: 1px solid var(--line); }
  .tabs button {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px;
    border: 1px solid transparent; border-radius: 3px; background: transparent; cursor: pointer; font-weight: 600; color: var(--dim);
  }
  .tabs button .tag {
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 2px;
    font: 600 12px/1.2 var(--f-body); color: #111;
  }
  #tabA .tag { background: var(--loop-a); }
  #tabB .tag { background: var(--loop-b); }
  .tabs button[aria-selected="true"] { background: linear-gradient(var(--raise-2), var(--raise)); border-color: var(--line); color: var(--ink); }
  .tabs button { white-space: nowrap; }
  .tabs .vis { width: 8px; height: 8px; border-radius: 25%; background: #39303c; box-shadow: inset 0 1px 1px rgba(0,0,0,.6); }
  .tabs .vis.on { background: var(--tally); box-shadow: 0 0 8px rgba(255,75,62,.7); }

  .dev { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 3px; background: var(--well); border: 1px solid var(--line); }
  .dev-status { font-size: 14px; color: var(--dim); overflow-wrap: anywhere; }
  .dev-status b { color: var(--ink); font-weight: 600; }
  .dev-status.warn, .dev-status.warn b { color: #ffc98a; }
  .dev-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .live { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 25%; background: var(--tally); box-shadow: 0 0 8px rgba(255,75,62,.7); vertical-align: 1px; }
  .vcr { display: flex; flex-direction: column; gap: 10px; }
  .vcr-time { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
  .vcr-time .tc { font: 600 13px/1.2 var(--f-body); color: var(--amber-ink); font-variant-numeric: tabular-nums; min-width: 4ch; }
  .vcr-keys { display: flex; flex-wrap: wrap; gap: 6px; }
  details.adj { border-top: 1px solid var(--line); padding-top: 8px; }
  details.adj summary {
    cursor: pointer; font-weight: 600; font-size: 14px; color: var(--dim); list-style-position: inside;
    padding-block: 4px;
  }
  details.adj summary:hover { color: var(--ink); }
  details.adj[open] summary { color: var(--ink); margin-bottom: 6px; }
  .adj-body { display: flex; flex-direction: column; gap: 8px; }

  /* show setup and MIDI */
  .midi-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
  .midi-list li {
    display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 3px 4px 3px 10px;
    border-radius: 3px; background: var(--well); border: 1px solid var(--line); font-size: 13.5px;
  }
  .midi-list .src { font: 600 11px/1.2 var(--f-body); color: var(--dim); white-space: nowrap; }
  .midi-list .dst { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .midi-list button {
    flex: none; width: 28px; height: 28px; padding: 0; border-radius: 25%; cursor: pointer;
    border: 1px solid var(--line); background: var(--raise); font: 600 15px/1 var(--f-body);
  }
  #offlineNote:not(:empty) { margin-top: 6px; color: var(--dim); }
  .midi-can { outline: 1px dashed var(--faint); outline-offset: 2px; cursor: cell; }
  .midi-mapped { outline: 1px solid var(--loop-b); outline-offset: 2px; }
  .midi-target { outline: 2px solid var(--tally) !important; outline-offset: 2px; }

  .ctl { display: grid; gap: 2px; }
  .ctl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .ctl-head label, .ctl-head .lbl { font-weight: 600; font-size: 15px; }
  .mini {
    display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 1.5px; vertical-align: 1px;
    font: 600 11px/1.2 var(--f-body); color: #111;
  }
  .mini.a { background: var(--loop-a); }
  .mini.b { background: var(--loop-b); }
  #inputs button[data-src="loop"] { grid-column: 1 / -1; }
  .ctl-head output { font-family: var(--f-osd); font-size: 19px; line-height: 1; color: var(--amber-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); letter-spacing: .02em; }
  .ctl select { margin-top: 4px; }

  /* Autopilot pins: shown beside each setting while Autopilot runs, and whenever one is pinned */
  .pin {
    display: none; place-items: center; flex: none; align-self: center; margin-left: auto;
    width: 30px; height: 24px; padding: 0; border-radius: 2.5px; cursor: pointer;
    border: 1px solid var(--line); background: var(--well); color: var(--faint);
  }
  .pin svg { width: 14px; height: 14px; display: block; }
  .pin:hover { color: var(--ink); border-color: #45624c; }
  .pin[aria-pressed="true"] { color: var(--amber-ink); border-color: var(--amber); background: rgba(39,150,88,.12); }
  .editor[data-loop="B"] .pin[aria-pressed="true"] { background: rgba(79,209,197,.12); }
  .ap-on .pin, .pin[aria-pressed="true"] { display: inline-grid; }
  /* A pin holding the setting on both loops (right-click) is wider and says AB */
  .pin .pin-ab { display: none; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; line-height: 1; }
  .pin.both { width: auto; padding: 0 7px; grid-auto-flow: column; gap: 4px; }
  .pin.both .pin-ab { display: block; }
  .ctl-head:has(.pin) { align-items: center; }
  .ap-state { margin: 0; font-size: 14px; color: var(--dim); }
  .ap-state b { color: var(--ink); font-weight: 600; }
  .ap-state .live { background: var(--loop-a); box-shadow: 0 0 8px var(--amber-glow); }
  .ap-reset { align-self: flex-start; font-size: 13px; font-weight: 500; }

  /* Next look: Autopilot's next new look straight away */
  .next-look .skip { width: 15px; height: 11px; flex: none; color: var(--loop-a-ink); }
  /* More like this and Not this, under the picture: just a thumb up and a thumb down (no words), and a quick glow when pressed */
  .rate .thumb { width: 18px; height: 18px; flex: none; }
  /* The small strip under the picture: More like this, Not this, and how long this look has left */
  .taste-strip {
    width: fit-content; max-width: 100%; margin-inline: auto; gap: 6px; padding: 5px 6px;
    border: 1px solid var(--line); border-radius: 4.5px; background: rgba(255,255,255,.025);
  }
  .taste-strip .btn { min-height: 34px; padding: 5px 12px; }
  .taste-strip .rate { min-width: 46px; justify-content: center; }
  .look-clock {
    display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px 0 8px;
    border-radius: 3px; background: var(--well); color: var(--dim); font-size: 14px; white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .look-clock b { color: var(--ink); font-weight: 600; display: inline-block; min-width: 3.2ch; text-align: right; }
  .look-clock .ring {
    width: 14px; height: 14px; border-radius: 25%; flex: none;
    background: conic-gradient(var(--loop-a) calc(var(--p, 0) * 1turn), rgba(255,255,255,.13) 0);
  }
  .look-clock.off .ring { background: rgba(255,255,255,.13); }
  .look-clock .lc-s { display: none; }
  @media (max-width: 480px) {
    .look-clock .lc-l { display: none; }
    .look-clock .lc-s { display: inline; }
    .taste-strip .btn { padding-inline: 10px; }
    .look-clock { padding-inline: 7px 8px; }
  }
  .look-clock.off { color: var(--faint); }
  .rate-up .thumb { color: var(--gun-g); }
  .rate-down .thumb { color: var(--tally); transform: rotate(180deg); }
  .rate.flash { animation: rate-flash .9s ease-out; }
  .rate-up.flash { --rate-glow: rgba(61, 220, 132, .55); }
  .rate-down.flash { --rate-glow: rgba(255, 75, 62, .55); }
  @keyframes rate-flash {
    from { box-shadow: 0 0 0 2px var(--rate-glow), 0 0 18px var(--rate-glow); }
    to { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.4); }
  }
  /* Lit for as long as this very look is rated that way, so you can see at a glance that you've already pressed it */
  .rate.rated.rate-up, .rate.rated.rate-up:hover {
    --rate-glow: rgba(61, 220, 132, .6); border-color: rgba(61, 220, 132, .95);
    background: linear-gradient(rgba(61, 220, 132, .38), rgba(61, 220, 132, .24)); color: #eafff1;
  }
  .rate.rated.rate-down, .rate.rated.rate-down:hover {
    --rate-glow: rgba(255, 75, 62, .6); border-color: rgba(255, 75, 62, .95);
    background: linear-gradient(rgba(255, 75, 62, .38), rgba(255, 75, 62, .24)); color: #ffe6e3;
  }
  .rate.rated { box-shadow: 0 0 0 1px var(--rate-glow), 0 0 16px var(--rate-glow); }
  @media (prefers-reduced-motion: reduce) { .rate.flash { animation: none; } }
  .taste-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
  /* Taste profiles: tiles like presets, two to a row so their buttons fit */
  .tp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-load {
    width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 4px 4px 6px;
    border-radius: 3.5px; border: 1px solid var(--line); border-bottom-color: #0a100c;
    background: linear-gradient(var(--raise-2), var(--raise)); cursor: pointer; text-align: left;
  }
  .tp-load:hover { border-color: #45624c; }
  .tp-load[aria-pressed="true"] { border-color: var(--gun-g); box-shadow: 0 0 0 1px var(--gun-g); }
  .tp-load .sw { display: block; height: 44px; border-radius: 2px; background: #090e0a center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
  .tp-load .sw.blank { background: radial-gradient(circle at 30% 40%, rgba(61,220,132,.55) 0 18%, transparent 40%), radial-gradient(circle at 72% 60%, rgba(39,150,88,.5) 0 16%, transparent 38%), #090e0a; }
  .tp-load .nm { font-size: 13px; line-height: 1.15; padding-inline: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tp-load .ct { font-size: 11.5px; line-height: 1.1; padding-inline: 2px; color: var(--faint); }
  .tp-load[aria-pressed="true"] .ct { color: var(--gun-g); }
  .tp-ics { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
  .tp-ic {
    width: 24px; height: 24px; border-radius: 25%; display: grid; place-items: center; padding: 0; cursor: pointer;
    border: 1px solid rgba(255,255,255,.2); background: rgba(9,8,10,.82); color: var(--ink); font: 600 13px/1 var(--f-body);
  }
  .tp-ic:hover { border-color: var(--loop-a); }
  .tp-ic.share { color: var(--loop-a-ink); }
  #tasteAdminNote .admin-tag { margin-right: 4px; }
  /* The taste session bar, under the buttons under the picture */
  .session-bar {
    display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; border-radius: 4px;
    border: 1px solid rgba(61,220,132,.45); background: rgba(61,220,132,.07);
  }
  .session-bar[hidden] { display: none; }
  .session-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; }
  .session-row .live { background: var(--gun-g); box-shadow: 0 0 8px rgba(61,220,132,.7); }
  .session-row #sessionText { color: var(--ink); }
  .session-form { max-width: 460px; width: 100%; align-self: center; }
  #tasteState .live { background: var(--gun-g); box-shadow: 0 0 8px rgba(61,220,132,.7); }
  .session-btn[aria-pressed="true"] .led { background: var(--gun-g); box-shadow: 0 0 8px rgba(61,220,132,.7); }
  .btn.armed { border-color: var(--tally); color: #ffd9d5; }

  /* Fader limits: the button under Autopilot settings, and the menu it opens over the controls */
  .lim-btn svg { width: 24px; height: 12px; flex: none; color: var(--amber-ink); }
  .lim-btn[aria-expanded="true"] { border-color: var(--amber); color: var(--press-ink); }
  .lim-count {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
    background: var(--amber); color: #f5fef7; font: 700 12px/1 var(--f-body);
  }
  .lim-count[hidden] { display: none; }
  .lim {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: 420px; max-width: 100vw;
    display: flex; flex-direction: column;
    background: var(--panel); border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(0,0,0,.5);
  }
  .lim[hidden] { display: none; }
  .lim-bar { position: static; flex: none; }
  .lim-bar .wordmark { color: var(--loop-a-ink); }
  .lim-inner {
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 18px 20px calc(28px + env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column; gap: 24px;
  }
  .lim-lede { margin: 0; color: var(--dim); }
  .lim-lede b { color: var(--ink); font-weight: 600; }
  .lim-list { display: flex; flex-direction: column; gap: 14px; }
  .lim-row .ctl-head output.any { color: var(--faint); }
  .lim-row.set .ctl-head .lbl::after {
    content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 25%; vertical-align: 2px;
    background: var(--amber); box-shadow: 0 0 8px var(--amber-glow);
  }
  /* A fader with two handles: two sliders stacked on one track, each grabbed only by its handle */
  .dual { position: relative; height: 30px; --fa: 0; --fb: 1; touch-action: none; cursor: pointer; }
  .dual-track {
    position: absolute; left: 0; right: 0; top: 11px; height: 8px; border-radius: 2px; pointer-events: none;
    background: linear-gradient(90deg,
      var(--well) 0 calc(8px + (100% - 16px) * var(--fa)),
      var(--amber) calc(8px + (100% - 16px) * var(--fa)) calc(8px + (100% - 16px) * var(--fb)),
      var(--well) calc(8px + (100% - 16px) * var(--fb)) 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.04);
  }
  .dual.bipolar .dual-track::after {
    content: ""; position: absolute; left: calc(50% - 1px); top: -3px; width: 2px; height: 14px; border-radius: 0.5px; background: var(--dim); opacity: .6;
  }
  .dual input[type="range"] { position: absolute; inset: 0; pointer-events: none; }
  .dual input[type="range"]::-webkit-slider-runnable-track { background: transparent; box-shadow: none; }
  .dual input[type="range"]::-moz-range-track { background: transparent; box-shadow: none; }
  .dual input[type="range"]::-webkit-slider-thumb { pointer-events: auto; cursor: grab; }
  .dual input[type="range"]::-moz-range-thumb { pointer-events: auto; cursor: grab; }
  /* Mirror's five stops, named under the slider, each centred under the spot its handle stops at */
  .lim-ticks { position: relative; height: 16px; margin-top: 2px; font: 12px/16px var(--f-body); color: var(--dim); }
  .lim-ticks span { position: absolute; top: 0; left: calc(8px + (100% - 16px) * var(--p)); transform: translateX(-50%); }
  @media (max-width: 900px) {
    .lim { width: 100vw; border-left: 0; box-shadow: none; }
  }
  @media (max-width: 520px) {
    .lim-inner { padding-inline: 16px; }
    .lim-bar { padding-inline: 16px; }
  }

  /* fader */
  input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 0;
    background: transparent; cursor: pointer; --a: 0%; --b: 50%;
  }
  input[type="range"]:focus-visible { outline: none; }
  input[type="range"]::-webkit-slider-runnable-track {
    height: 8px; border-radius: 2px;
    background: linear-gradient(90deg, var(--well) 0 var(--a), var(--amber) var(--a) var(--b), var(--well) var(--b) 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.04);
  }
  input[type="range"]::-moz-range-track {
    height: 8px; border-radius: 2px;
    background: linear-gradient(90deg, var(--well) 0 var(--a), var(--amber) var(--a) var(--b), var(--well) var(--b) 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.7);
  }
  input[type="range"].bipolar::-webkit-slider-runnable-track {
    background:
      linear-gradient(90deg, transparent calc(50% - 1px), var(--dim) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
      linear-gradient(90deg, var(--well) 0 var(--a), var(--amber) var(--a) var(--b), var(--well) var(--b) 100%);
  }
  input[type="range"].bipolar::-moz-range-track {
    background:
      linear-gradient(90deg, transparent calc(50% - 1px), var(--dim) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
      linear-gradient(90deg, var(--well) 0 var(--a), var(--amber) var(--a) var(--b), var(--well) var(--b) 100%);
  }
  /* the A/B view fader: amber on the A side, teal on the B side */
  input[type="range"].ab::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--loop-a), #517b5d 50%, var(--loop-b)); }
  input[type="range"].ab::-moz-range-track { background: linear-gradient(90deg, var(--loop-a), #517b5d 50%, var(--loop-b)); }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 20px; margin-top: -6px; border-radius: 2px;
    border: 1px solid #090e0a;
    background: linear-gradient(90deg, transparent 6.5px, var(--slider-core, #1f2b22) 6.5px 8.5px, transparent 8.5px), linear-gradient(#e3ede5, #9db4a3);
    box-shadow: 0 2px 5px rgba(0,0,0,.55);
  }
  input[type="range"]::-moz-range-thumb {
    width: 14px; height: 18px; border-radius: 2px;
    border: 1px solid #090e0a;
    background: linear-gradient(90deg, transparent 6px, var(--slider-core, #1f2b22) 6px 8px, transparent 8px), linear-gradient(#e3ede5, #9db4a3);
    box-shadow: 0 2px 5px rgba(0,0,0,.55);
  }
  input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--amber-ink); outline-offset: 2px; }
  input[type="range"]:focus-visible::-moz-range-thumb { outline: 2px solid var(--amber-ink); outline-offset: 2px; }

  /* ---------- top bar guide button ---------- */
  .top-right { display: flex; align-items: center; gap: 16px; }
  .guide-btn { min-height: 34px; padding: 5px 14px; gap: 7px; }
  .guide-btn .q {
    display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 25%;
    background: var(--loop-a); color: #f5fef7; font: 700 12px/1 var(--f-body);
  }

  /* ---------- guide page ---------- */
  .guide {
    position: fixed; inset: 0; z-index: 50; overflow-y: auto; overscroll-behavior: contain;
    background: var(--chassis); color: var(--ink);
  }
  .guide-bar {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; gap: 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px;
    background: rgba(24,22,25,.94); backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
  }
  .guide-bar .wordmark { font-size: 13px; }
  .guide-bar .spacer { flex: 1; }
  .guide-inner { max-width: 880px; margin: 0 auto; padding: 32px 20px calc(56px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 44px; }
  .guide .g-eyebrow { margin: 0 0 12px; font: 600 13px/1.2 var(--f-body); color: var(--loop-a-ink); letter-spacing: .04em; }
  .guide h1 { margin: 0; font: 400 clamp(22px, 3.4vw, 32px)/1.25 var(--f-display); letter-spacing: .06em; text-transform: none; text-wrap: balance; }
  .guide .g-lede { margin: 16px 0 0; font-size: 17px; line-height: 1.55; color: var(--dim); max-width: 62ch; }
  .guide h2 { margin: 0 0 14px; font: 600 22px/1.2 var(--f-body); text-wrap: balance; }
  .guide h2 small { font: 11px/1 var(--f-display); letter-spacing: .2em; text-transform: none; color: var(--faint); display: block; margin-bottom: 8px; }
  .guide h3 { margin: 0; font: 600 16px/1.3 var(--f-body); }
  .guide p { margin: 0; line-height: 1.55; }
  .g-flow { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
  .g-node { flex: 1 1 150px; padding: 12px 14px; border-radius: 5px; background: var(--panel); border: 1px solid var(--line); }
  .g-node b { display: block; font: 600 13px/1.2 var(--f-body); color: var(--loop-a-ink); letter-spacing: .04em; margin-bottom: 4px; }
  .g-node span { font-size: 14px; color: var(--dim); }
  .g-arrow { align-self: center; font: 600 16px/1.2 var(--f-body); color: var(--faint); }
  .g-return { flex-basis: 100%; font: 600 12px/1.2 var(--f-body); color: var(--faint); text-align: center; padding-top: 2px; }
  .g-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
  .g-steps li { counter-increment: step; padding: 14px; border-radius: 5px; background: var(--panel); border: 1px solid var(--line); color: var(--dim); line-height: 1.5; }
  .g-steps li::before { content: counter(step); display: block; font: 600 20px/1.2 var(--f-body); color: var(--loop-a-ink); margin-bottom: 6px; }
  .g-steps li b { color: var(--ink); }
  .g-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
  .g-card { padding: 16px; border-radius: 5px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
  .g-card dl, .g-fix { margin: 0; display: grid; gap: 8px; }
  .g-card dt, .g-fix dt { font-weight: 600; }
  .g-card dd, .g-fix dd { margin: -6px 0 0; color: var(--dim); line-height: 1.5; }
  .g-list { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--dim); line-height: 1.5; max-width: 66ch; }
  .g-list b { color: var(--ink); }
  .g-keys { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px 16px; font-size: 14px; color: var(--dim); }
  .g-keys div { display: flex; gap: 10px; align-items: baseline; }
  .g-keys kbd { min-width: 64px; text-align: center; font: 13px/1 var(--f-body); color: var(--ink); padding: 4px 6px; border-radius: 2px; border: 1px solid var(--line); background: var(--raise); }
  .g-recipes { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 14px; }
  .g-recipe { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 14px; border-radius: 5px; background: var(--panel); border: 1px solid var(--line); }
  .g-recipe .g-swatch { height: 54px; border-radius: 3px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
  .g-recipe p { color: var(--dim); font-size: 14.5px; }
  .g-recipe .g-how { font: 600 11px/1.2 var(--f-body); color: var(--loop-a-ink); letter-spacing: .02em; }
  .g-recipe .g-act { margin-top: auto; padding-top: 4px; }
  .g-recipe .g-act .hint { display: block; }
  .g-fix { max-width: 70ch; }

  .g-foot { display: flex; justify-content: center; }

  /* ---------- narrow screens ---------- */
  @media (max-width: 900px) {
    html, body { height: auto; }
    .app { height: auto; display: block; }
    .deck { grid-template-columns: minmax(0, 1fr); }
    .monitor { padding: 16px; }
    .stage { flex: none; }
    .panel { border-left: 0; border-top: 1px solid var(--line); overflow: visible; padding: 20px 16px 32px; }
    .top { padding: 10px 16px; }
    .readout .lines { display: none; }
    .top-right { gap: 10px; }
    .bezel { padding: 6px; border-radius: 6px; }
  }
  @media (max-width: 520px) {
    .top .readout { display: none; }
    .g-arrow { display: none; }
    .g-return { text-align: left; }
  }
  @media (max-width: 420px) {
    .wordmark { font-size: 13px; letter-spacing: .16em; }
    .readout { font-size: 18px; }
    .readout .tc-label { display: none; }
    .guide-btn { padding-inline: 10px; }
    .transport .btn { padding-inline: 11px; }
    .seg button { font-size: 12.5px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .osd, .tip { transition: none; }
    .rec-ind .dot { animation: none; }
  }

/* The HTML starts in the focused layout; never paint the legacy controls.
   Reveal the monitor after fit() has sized its canvas, avoiding an intrinsic-size flash. */
.minimal:not(.ui-ready) .bezel { visibility: hidden; }
.minimal:not(.ui-ready) .screen-msg:not([hidden]) { visibility: visible; }

/* Focused 3D edition */
.minimal .taste-strip, .minimal #fsTaste, .minimal #sessionBar,
.minimal #outBtn, .minimal #drift, .minimal #clear { display: none !important; }
.minimal .panel { padding: 24px; background: #111b15; }
.minimal .deck { grid-template-columns: minmax(0, 1fr) 310px; }
.minimal .minimal-intro { color: var(--loop-a-ink); margin: 0 0 24px; font-size: 18px; }
.minimal-section { padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.minimal-section h2 { color: var(--loop-a-ink); font: 12px var(--f-display); letter-spacing: .08em; margin: 0 0 18px; }
.minimal-section select { width: 100%; margin: 8px 0 16px; }
.minimal-section .ctl { margin-top: 16px; }
.minimal-section .meter { margin: 16px 0; }
.minimal-section .dev-status { display: block; margin-top: 12px; }
.minimal .guns i { background: var(--loop-a-ink); box-shadow: 0 0 8px #27965866; }
@media (max-width: 850px) { .minimal .deck { grid-template-columns: 1fr; } .minimal .panel { overflow: visible; } }

.minimal #rec, .minimal #recMic, .minimal #snap { display: none !important; }
.minimal .bezel { background: #243228; border-color: #354b3a; }
.minimal-section details { margin: 14px 0; }
.minimal-section summary { cursor: pointer; color: var(--dim); }
.minimal-section { padding-bottom: 16px; margin-bottom: 16px; }
.minimal-section h2 { margin-bottom: 12px; }
.minimal .panel { padding: 20px; }

.minimal .top .wordmark { text-transform: none; }
.project-credit { margin-left: auto; text-align: right; font-size: 12px; color: var(--dim); }
.minimal .foot { align-items: baseline; }
.minimal .foot .toast { flex-basis: 100%; margin: 0; }
.project-credit a { color: var(--loop-a-ink); text-underline-offset: 3px; }
.project-credit a:hover { color: var(--ink); }

/* Compact header and transport leave more vertical space for the picture. */
.minimal .top { padding: 5px 16px; gap: 12px; background: var(--chassis); }
.minimal .top .wordmark { font-size: 12px; letter-spacing: .14em; }
.minimal .top .readout { font-size: 17px; }
.minimal .top-right { gap: 18px; }
.minimal .top .project-credit { margin: 0; font-size: 11px; white-space: nowrap; }
.minimal .monitor { position: relative; padding: 8px 12px 6px; gap: 6px; }
.minimal .monitor > .transport { margin-top: auto; flex-shrink: 0; }
.minimal .transport .spacer { display: none; }
.minimal .foot { position: absolute; bottom: 54px; left: 24px; right: 24px; min-height: 0; pointer-events: none; z-index: 3; }
.minimal .foot .toast:not(:empty) { padding: 6px 10px; border-radius: 2.5px; background: #101713e6; }
@media (max-width: 650px) {
  .minimal .top { flex-wrap: wrap; gap: 4px 12px; }
  .minimal .top-right { margin-left: auto; }
}

.minimal .bottom-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px 12px; align-items: center; }
.playback-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.current-texture { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--loop-a-ink); }
.render-stats { display: flex; justify-content: flex-end; gap: 10px; white-space: nowrap; color: var(--dim); font: 14px var(--f-osd); font-variant-numeric: tabular-nums; }
@media (max-width: 1300px) {
  .minimal .bottom-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .playback-buttons { grid-row: 2; grid-column: 1 / -1; }
}

.minimal .monitor { padding: 2px 4px 2px; gap: 4px; }
.minimal .bezel { padding: 2px; border-radius: 3px; }
.minimal .screen { border-radius: 1.5px; }
.minimal .bottom-bar { padding: 0 4px; }

/* A quiet overlay stays within the fullscreen element and gives the picture all the height. */
.minimal .bottom-bar {
  position: absolute; inset: auto 0 0; z-index: 5; margin: 0;
  padding: 22px 12px max(8px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(4, 12, 7, .72));
  opacity: .55; line-height: 1.3; transition: opacity .2s; pointer-events: none;
}
.minimal .bottom-bar:hover, .minimal .bottom-bar:focus-within { opacity: 1; }
.minimal .stage.idle .bottom-bar:not(:hover):not(:focus-within) { opacity: .3; }
.minimal .bottom-bar .btn {
  pointer-events: auto; min-height: 30px; padding: 5px 9px;
  font-size: 12px; border: 1px solid rgba(160, 205, 175, .2);
  background: rgba(8, 20, 12, .55); box-shadow: none;
}
.minimal .bottom-bar .btn:hover { background: rgba(25, 63, 39, .85); }
.minimal .bottom-bar .btn[aria-pressed="true"] { color: var(--loop-a-ink); border-color: var(--loop-a); }
.minimal .bottom-bar .current-texture, .minimal .bottom-bar .render-stats { text-shadow: 0 1px 3px #000; }
.minimal #fsExit { display: none !important; }
@media (hover: none) { .minimal .bottom-bar { opacity: .8; } }

#rhythmPhase { width: 100%; height: 4px; accent-color: var(--accent, #78dfaa); }

#musicMappings summary { color: var(--ink); font-size: 13px; }
#musicMappings .music-route { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 7px; padding: 12px 0; border-top: 1px solid var(--line); }
#musicMappings select { width: 100%; min-width: 0; font-size: 12px; padding: 6px; }
#musicMappings .music-strength { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
#musicMappings input { flex: 1; min-width: 0; }
#musicMappings output { width: 36px; text-align: right; color: var(--dim); font-size: 12px; }
#musicMappings input:disabled { opacity: .3; }

#localPreviewNotice a { color: var(--loop-a-ink); text-underline-offset: 3px; }

/* Original source decks inside the compact, per-loop editor. */
.minimal-section .tabs { margin-bottom: 14px; }
.minimal-section .dev { min-width: 0; margin: 12px 0; }
.minimal-section .dev-actions, .minimal-section .vcr-keys { flex-wrap: wrap; }
.minimal-section .vcr-time input { min-width: 0; }
.minimal-section .dev select { max-width: 100%; }

/* Tiny LFO controls; orange endpoints live on the track itself. */
.lfo-control { display: flex; align-items: center; gap: 8px; min-height: 14px; margin: 0 0 2px; padding: 0; }
.lfo-toggle { display: inline-flex; align-items: center; gap: 2px; font-size: 8px; line-height: 12px; cursor: pointer; color: var(--dim); }
.lfo-toggle input[type="checkbox"] { width: 9px; height: 9px; min-height: 0; margin: 0; accent-color: #f2813c; }
.lfo-active .lfo-toggle { color: #ffac6c; }
.lfo-fields { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lfo-fields[hidden], .lfo-bounds[hidden] { display: none; }
.lfo-fields label { display: inline-flex; align-items: center; gap: 2px; font-size: 8px; line-height: 12px; color: #ffbf8d; }
.minimal .minimal-section .lfo-fields select, #musicMappings .lfo-fields select {
  box-sizing: border-box; width: 32px; min-width: 0; min-height: 0; height: 13px;
  margin: 0; padding: 0 1px; border-radius: 1px; font-size: 7px; line-height: 11px;
}
.minimal .minimal-section .lfo-fields select.lfo-curve { width: 48px; }
.lfo-fields select option { font-size: 7px; padding: 0; }
.lfo-status { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lfo-slider { position: relative; min-width: 0; width: 100%; height: 30px; }
.lfo-slider > input[type="range"] { display: block; --slider-core: #1f2b22; }
.lfo-slider > input.lfo-active-slider { --slider-core: #ff983f; }
.lfo-bounds { position: absolute; inset: 0; pointer-events: none; }
.lfo-bound {
  position: absolute; top: 0; transform: translateX(-50%); width: 14px; height: 10px;
  min-height: 0; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: #ffa454; cursor: ew-resize; pointer-events: auto; touch-action: none;
}
.lfo-bound::after { content: ''; position: absolute; left: 6px; top: 5px; width: 2px; height: 20px; background: #ff983f; pointer-events: none; box-shadow: 0 0 2px #17100b; }
.lfo-bound span { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); font: 8px/9px var(--f-body); pointer-events: none; background: #111b15; padding: 0 1px; }
.lfo-bound:focus-visible { outline: 1px solid #ffc18b; outline-offset: 1px; }
#musicMappings .lfo-control { grid-column: 1 / -1; }
#musicMappings .lfo-toggle input { flex: none; width: 9px; }
.music-strength > .lfo-slider { flex: 1; }
.vcr-time > .lfo-slider { min-width: 0; }

/* Quieter typography and inline control help. */
.minimal .readout, .minimal .top .readout, .render-stats { font: 600 11px/1.3 var(--f-body); letter-spacing: 0; }
.ctl-head output { font: 600 12px/1.3 var(--f-body); }
.minimal-section h2 { font: 600 12px/1.4 var(--f-body); letter-spacing: 0; }
.wordmark, .minimal .top .wordmark { font: 600 12px/1.3 var(--f-body); letter-spacing: .02em; }
.osd { font-weight: 600; text-shadow: 0 1px 4px #000; }
.osd-a { font-size: clamp(17px, 2.4vw, 26px); }
.osd-b { font-size: clamp(12px, 1.5vw, 17px); letter-spacing: 0; }
.rec-ind { font-size: 14px; font-weight: 600; }
.tip { font-size: 13px; font-weight: 500; }
.ctl-head { justify-content: flex-start; }
.ctl-head output { margin-left: auto; }
button.control-help { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; flex: none;
  width: 13px; height: 13px; min-height: 0; margin: 0 0 0 5px; padding: 0; border: 1px solid var(--line);
  border-radius: 25%; background: transparent; color: var(--dim); font: 600 9px/1 var(--f-body); cursor: help; }
.control-tooltip { position: fixed; z-index: 10000; box-sizing: border-box; width: max-content; max-width: min(320px, calc(100vw - 16px));
  max-height: min(400px, 75vh); overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px;
  background: #101b14; color: var(--ink); font: 500 12px/1.5 var(--f-body); white-space: pre-line; box-shadow: 0 6px 24px #0008; }

/* The workspace is always viewport-sized; only the right controls panel scrolls. */
html { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.minimal { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
.minimal .app { position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); height: auto; min-height: 0; overflow: hidden; }
.minimal .deck { grid-template-columns: minmax(0, 1fr) clamp(190px, 32vw, 310px); min-height: 0; min-width: 0; overflow: hidden; }
.minimal .monitor { min-height: 0; min-width: 0; overflow: hidden; box-sizing: border-box; }
.minimal .monitor .stage { flex: 1; min-height: 0; min-width: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.minimal .stage .bezel { place-self: center; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; box-sizing: border-box; }
.minimal .panel { min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box;
  border-top: 0; border-left: 1px solid var(--line); }
.minimal .panel > * { flex-shrink: 0; }
@media (max-width: 650px) {
  .minimal .panel { padding: 12px; }
  .minimal .project-credit { font-size: 9px; white-space: normal; }
}

/* A little more room around controls; LFO micro-controls retain their compact size. */
.minimal-section .ctl { margin-top: 21px; margin-bottom: 5px; }
.minimal-section .ctl-head { margin-bottom: 5px; }
.lfo-control { margin-bottom: 7px; }
.minimal-section > label { display: inline-block; margin-top: 5px; }
.minimal-section > select { margin-top: 13px; margin-bottom: 21px; }
details.minimal-section > summary { margin: 0 0 17px; color: var(--loop-a-ink); font: 600 12px/1.4 var(--f-body); cursor: pointer; }
details.minimal-section:not([open]) > summary { margin-bottom: 0; }
input[type="range"]:disabled { opacity: .35; cursor: not-allowed; }
.dependency-disabled > .ctl-head label, .dependency-disabled > .ctl-head output { opacity: .45; }
.lfo-control.dependency-disabled { opacity: .45; }
.lfo-bound:disabled { opacity: .3; cursor: not-allowed; }

/* Compact controls, with larger but quieter main section headings. */
.minimal .btn { min-height: 28px; padding: 4px 8px; font-size: 12px; line-height: 1.1; }
.minimal .btn.small { min-height: 24px; padding: 3px 7px; font-size: 11px; line-height: 1.1; }
.minimal .tabs button, .minimal .seg button { min-height: 28px; padding: 4px 5px; font-size: 12px; line-height: 1.1; }
.minimal select { min-height: 28px; padding: 3px 6px; font-size: 12px; line-height: 1.1; }
.minimal .ctl-head label, .minimal .ctl-head .lbl, .minimal-section > label { font-size: 12px; line-height: 1.2; }
.minimal .ctl-head { align-items: center; gap: 6px; }
.control-label { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.control-label > button.control-help { margin: 0; }
.minimal .panel { gap: 7px; }
.minimal details.minimal-section { border: 0; padding: 5px 0; margin: 0; }
.minimal details.minimal-section > summary { font: 600 15px/1.2 var(--f-body); margin: 0 0 12px; }
.minimal details.minimal-section:not([open]) > summary { margin: 0; }
.video-grade-group { margin: 12px 0; }
.video-grade-group > summary { font-size: 12px; line-height: 1.2; font-weight: 600; }

/* Transport above, information hugging the bottom edge at every viewport size. */
.minimal .bottom-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-rows: auto auto;
  gap: 8px 10px; align-items: end; padding: 18px 10px max(3px, env(safe-area-inset-bottom, 0px)); }
.minimal .bottom-bar .playback-buttons { grid-row: 1; grid-column: 1 / -1; margin-bottom: 3px; gap: 6px; }
.minimal .bottom-bar .current-texture { grid-row: 2; grid-column: 1; align-self: end; font-size: 10px; line-height: 1.1; }
.minimal .bottom-bar .render-stats { grid-row: 2; grid-column: 2; min-width: 0; align-self: end;
  flex-wrap: wrap; gap: 2px 7px; white-space: normal; font-size: 10px; line-height: 1.1; }
.minimal .bottom-bar .render-stats > span { white-space: nowrap; }
.minimal .bottom-bar .btn { min-height: 25px; padding: 3px 7px; font-size: 11px; line-height: 1.1; }

#musicMappings select { padding: 3px 6px; line-height: 1.1; }

.minimal .minimal-intro { font-size: 12px; line-height: 1.2; margin-bottom: 8px; }

/* Reset controls share existing rows and never enlarge the LFO strip. */
.minimal button.mini-reset { display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 14px; height: 14px; min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent;
  color: var(--dim); font: 600 11px/1 var(--f-body); cursor: pointer; opacity: .7; }
.minimal button.mini-reset:hover, .minimal button.mini-reset:focus-visible { color: var(--ink); opacity: 1; }
.slider-reset { margin-left: auto; }
.minimal details.minimal-section > summary { display: flex; align-items: center; gap: 6px; }
.minimal details.minimal-section > summary::before { content: '▸'; font-size: 10px; }
.minimal details.minimal-section[open] > summary::before { content: '▾'; }
.minimal details.minimal-section > summary::-webkit-details-marker { display: none; }
.section-reset { margin-left: auto; }

/* Uniform slider title actions and expandable LFO settings. */
.slider-controls .ctl-head { justify-content: space-between; gap: 8px; }
.slider-controls .control-label { min-width: 0; }
.slider-actions { display: inline-flex; flex: none; align-items: center; gap: 3px; }
.minimal .slider-actions .slider-reset,
.minimal .slider-actions .control-help {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; width: 15px; height: 15px; min-width: 15px; min-height: 15px;
  margin: 0; padding: 0; border: 1px solid var(--line, #303a34);
  border-radius: 2px; background: rgba(255,255,255,.035); color: var(--dim);
  font: 600 10px/1 var(--f-body);
}
.slider-actions .lfo-toggle {
  box-sizing: border-box; width: 15px; height: 15px; justify-content: center; gap: 0; padding: 0;
  border: 1px solid #9c582d; border-radius: 2px;
  background: #f2813c12; font: 600 8px/1 var(--f-body);
}
.minimal .slider-actions .slider-reset { font-size: 15px; }
.slider-actions .slider-action-glyph { display: block; line-height: 1; transform: translateY(-.5px); }
.slider-actions .slider-reset .slider-action-glyph { transform: translateY(-1px); }
.slider-actions .lfo-toggle input[type="checkbox"] { width: 8px; height: 8px; }
.slider-actions.lfo-active .lfo-toggle { border-color: #9c582d; color: #ffac6c; background: #f2813c12; }
.minimal .slider-actions output {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: flex-end;
  min-width: 27px; height: 15px; margin: 0; padding: 0 3px;
  border: 1px solid var(--line, #303a34); border-radius: 2px;
  background: rgba(255,255,255,.08); font: 600 9px/1 var(--f-body); font-variant-numeric: tabular-nums;
}
.slider-lfo-menu { margin: 0 0 5px; min-height: 20px; }
.slider-lfo-menu[hidden] { display: none; }
.slider-lfo-menu .lfo-fields { width: 100%; justify-content: flex-end; }
.slider-actions button:hover, .slider-actions .lfo-toggle:hover { background: rgba(255,255,255,.1); }
.slider-actions button:focus-visible, .slider-actions .lfo-toggle:focus-within { outline: 1px solid #ffac6c; outline-offset: 2px; }

/* Compact ordered actions and modulation markers. */
.slider-actions { padding-left: 4px; gap: 4px; }
.minimal .slider-actions .slider-reset,
.minimal .slider-actions .control-help,
.slider-actions .lfo-toggle {
  width: 16.5px; height: 16.5px; min-width: 16.5px; min-height: 16.5px;
}
.slider-actions .lfo-toggle { order: 0; }
.slider-actions .control-help { order: 1; }
.slider-actions .slider-reset { order: 2; }
.minimal .slider-actions output { order: 3; height: 16.5px; margin-left: 4px; padding-left: 5px; }
.slider-actions .slider-reset .slider-action-glyph { transform: translateY(-2px); }
.slider-lfo-menu .lfo-fields { gap: 14px; }
.slider-lfo-menu .lfo-fields label { gap: 4px; }
.minimal .minimal-section .slider-lfo-menu .lfo-fields select {
  appearance: none; -webkit-appearance: none; padding-right: 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='3' viewBox='0 0 5 3'%3E%3Cpath d='M.5.5 2.5 2.5 4.5.5' fill='none' stroke='%23ffbf8d' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center; background-size: 5px 3px;
}
.slider-controls .lfo-bound { width: 10.5px; height: 7.5px; }
.slider-controls .lfo-bound::after { left: 50%; transform: translateX(-50%); top: 7.5px; width: 1.5px; height: 15px; }
.slider-controls .lfo-bound span { top: -1px; font-size: 6px; line-height: 7px; }

.minimal .slider-actions.lfo-active output {
  color: #ffac6c; border-color: #9c582d; background: #f2813c22;
}

/* Stable readout columns and neutral inactive modulation toggles. */
.minimal .slider-actions output { width: 30px; min-width: 30px; max-width: 30px; flex: 0 0 30px; padding: 0 4px; }
.slider-actions:not(.lfo-active) .lfo-toggle {
  border-color: var(--line, #303a34); background: rgba(255,255,255,.035); color: var(--dim);
}
.slider-actions:not(.lfo-active) .lfo-toggle input { accent-color: #78877d; }

/* Shared help/reset affordances outside slider rows. */
.minimal button.control-help, .minimal button.mini-reset {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 16.5px; width: 16.5px; height: 16.5px; min-width: 16.5px; min-height: 16.5px;
  padding: 0; border: 1px solid var(--line, #303a34); border-radius: 2px;
  background: rgba(255,255,255,.035); color: var(--dim); opacity: 1;
  font: 600 10px/1 var(--f-body);
}
.minimal button.mini-reset { font-size: 15px; }
.minimal .mini-reset .slider-action-glyph { display: block; line-height: 1; transform: translateY(-2px); }
.control-heading { display: flex; align-items: center; flex: 1; width: 100%; min-width: 0; gap: 4px; }
.control-heading > button.control-help { margin-left: auto; }
.minimal .section-reset { margin-left: auto; }
.minimal button.control-help:hover, .minimal button.mini-reset:hover { background: rgba(255,255,255,.1); color: var(--ink); }
