/* Mockup styles, scoped to the new Workstation front panels (.wsf). */
.wsf .ws-btn{transition:filter .15s ease,box-shadow .15s ease}
.wsf .ws-btn:hover{filter:brightness(1.12)}
.wsf .ws-btn:focus-visible,.wsf .ws-cell:focus-visible{outline:2px solid #ffd9a0;outline-offset:2px}
.wsf .ws-cell{transition:background .08s ease,box-shadow .1s ease}
.wsf .ws-cell:hover{filter:brightness(1.15)}
.wsf .ws-panel{display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:13px;border:1px solid #5f6b66;background-color:#a7afa9;background-image:repeating-linear-gradient(90deg,rgba(255,255,255,.045) 0 1px,transparent 1px 3px),linear-gradient(180deg,#bec5bf 0%,#a5aea8 45%,#929c96 100%);box-shadow:inset 0 1px 0 rgba(255,255,255,.65),inset 0 -3px 6px rgba(20,32,30,.35),0 10px 20px rgba(0,0,0,.3);min-width:0}
.wsf .ws-label{font-size:10px;font-weight:800;letter-spacing:.12em;color:#1a2624;text-shadow:0 1px 0 rgba(255,255,255,.5)}
.wsf .ws-note{font-size:10px;font-weight:700;color:#33504a}
.wsf .ws-plate{padding:10px;border-radius:11px;border:1px solid #56625d;background:#8b958f;box-shadow:inset 0 3px 8px rgba(20,32,30,.45),0 1px 0 rgba(255,255,255,.45)}
.wsf .ws-screen{padding:10px;border-radius:10px;background:linear-gradient(180deg,#11232a 0%,#0a1416 38%,#060c0d 100%);border:1px solid #070d0e;box-shadow:0 0 0 1px #5f6b66,0 1px 0 1px rgba(255,255,255,.35),inset 0 3px 10px rgba(0,0,0,.85);color:#bff3e1}
.wsf .ws-key{min-height:34px;padding:0 10px;border-radius:7px;cursor:pointer;font:800 11px 'JetBrains Mono',monospace;border:1px solid #9aa59f;background:linear-gradient(180deg,#eef1ed,#d3d9d4);color:#3b4a46;box-shadow:0 2px 0 #8e9a94}
.wsf .ws-key[aria-pressed="true"]{border-color:#f5ddb2;background:linear-gradient(180deg,#f2c27d,#d99a4e);color:#2a1c08;box-shadow:0 0 10px rgba(240,166,64,.5)}
.wsf .ws-dark{min-height:34px;padding:0 10px;border-radius:7px;cursor:pointer;font:800 11px 'JetBrains Mono',monospace;border:1px solid #4f7d70;background:linear-gradient(180deg,#2f4f4a,#1c3330);color:#bff3e1}
.wsf .ws-row{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:11px;font-weight:700;color:#1a2624}
.wsf .ws-row output{min-width:54px;text-align:center;padding:4px 6px;border-radius:5px;background:#050909;color:#bff3e1;font-size:11px;font-weight:800}
.wsf .ws-range{width:100%;accent-color:#d99a4e}
.wsf .ws-fold{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;border-radius:8px;background:linear-gradient(180deg,#26393b,#172628);border:1px solid #3b4a48;color:#f2dfc0;font-size:11px;font-weight:800;letter-spacing:.08em}
.wsf .ws-section-title{display:flex;align-items:center;gap:10px;font-size:11px;font-weight:900;letter-spacing:.16em;color:#1a2624;text-shadow:0 1px 0 rgba(255,255,255,.5)}
.wsf .ws-section-title::after{content:"";flex:1;height:2px;background:linear-gradient(90deg,rgba(26,38,36,.35),transparent);border-radius:1px}
.wsf /* ---- polish: depth pass ---- */
.ws-panel{position:relative;border-color:#58645f #4b5652 #3f4945 #535f5a;background-image:radial-gradient(140% 60% at 20% -10%,rgba(255,255,255,.38),transparent 55%),repeating-linear-gradient(90deg,rgba(255,255,255,.05) 0 1px,transparent 1px 3px),linear-gradient(180deg,#c3c9c3 0%,#a9b1ab 42%,#8f9993 100%);box-shadow:inset 0 1px 0 rgba(255,255,255,.8),inset 1px 0 0 rgba(255,255,255,.25),inset 0 -4px 8px rgba(20,32,30,.38),0 1px 0 rgba(255,255,255,.35),0 14px 26px -6px rgba(0,0,0,.5),0 4px 8px rgba(0,0,0,.25);padding:16px 14px 14px}
.wsf .ws-panel::before,.wsf .ws-panel::after{content:"";position:absolute;top:6px;width:7px;height:7px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#f4f6f2,#8f9a94 55%,#4d5753);box-shadow:inset 0 -1px 1px rgba(0,0,0,.4),0 1px 0 rgba(255,255,255,.6);pointer-events:none}
.wsf .ws-panel::before{left:6px}
.wsf .ws-panel::after{right:6px}
.wsf .ws-plate{background:linear-gradient(180deg,#7c8680,#929c96 30%,#8b958f);border-color:#4a5551;box-shadow:inset 0 4px 10px rgba(15,25,23,.55),inset 0 -1px 0 rgba(255,255,255,.18),0 1px 0 rgba(255,255,255,.55)}
.wsf .ws-screen{position:relative;overflow:hidden;background:radial-gradient(120% 90% at 50% 0%,#17303a 0%,#0b181b 45%,#050a0b 100%);box-shadow:0 0 0 1px #4f5b56,0 0 0 3px #222c2a,0 1px 0 3px rgba(255,255,255,.3),inset 0 4px 14px rgba(0,0,0,.9),inset 0 0 30px rgba(60,160,140,.08)}
.wsf .ws-screen::after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;background:linear-gradient(170deg,rgba(255,255,255,.07) 0%,rgba(255,255,255,.02) 28%,transparent 40%),repeating-linear-gradient(0deg,rgba(0,0,0,.18) 0 1px,transparent 1px 3px)}
.wsf .ws-key,.wsf .ws-btn,.wsf .ws-dark{position:relative;transition:transform .08s ease,filter .15s ease,box-shadow .15s ease}
.wsf .ws-key{background:linear-gradient(180deg,#fbfcfa 0%,#e6eae6 45%,#cdd4cf 100%);border-color:#a3ada7 #959f99 #7d8882;box-shadow:inset 0 1px 0 #fff,inset 0 -2px 3px rgba(60,75,70,.18),0 3px 0 #7f8b85,0 5px 8px rgba(0,0,0,.28)}
.wsf .ws-key[aria-pressed="true"]{background:linear-gradient(180deg,#ffd699 0%,#f0b264 45%,#d48e45 100%);border-color:#ffe2b4 #e8a85c #b8732f;box-shadow:inset 0 1px 0 rgba(255,255,255,.7),inset 0 -2px 3px rgba(120,60,10,.25),0 2px 0 #9a5f26,0 0 16px rgba(240,166,64,.55),0 4px 8px rgba(0,0,0,.3);transform:translateY(1px)}
.wsf .ws-dark{background:linear-gradient(180deg,#3a605a 0%,#284744 50%,#1a302e 100%);box-shadow:inset 0 1px 0 rgba(191,243,225,.3),inset 0 -2px 3px rgba(0,0,0,.35),0 3px 0 #0e1b1a,0 5px 9px rgba(0,0,0,.4)}
.wsf .ws-btn::before,.wsf .ws-key::before,.wsf .ws-dark::before{content:"";position:absolute;left:3px;right:3px;top:2px;height:42%;border-radius:inherit;background:linear-gradient(180deg,rgba(255,255,255,.4),rgba(255,255,255,0));pointer-events:none;opacity:.55}
.wsf .ws-cell::before{content:none}
.wsf .ws-key:active,.wsf .ws-btn:active,.wsf .ws-dark:active{transform:translateY(2px);filter:brightness(.96)}
.wsf .ws-section-title{font-size:12px;color:#17211f;text-shadow:0 1px 0 rgba(255,255,255,.7),0 -1px 0 rgba(0,0,0,.15);padding:4px 0}
.wsf .ws-section-title::before{content:"";width:10px;height:10px;border-radius:2px;background:linear-gradient(135deg,#ffcf86,#c9793a);box-shadow:0 0 10px rgba(255,178,92,.6)}
.wsf .ws-section-title::after{height:3px;background:linear-gradient(180deg,rgba(0,0,0,.3),rgba(255,255,255,.55))}
.wsf .ws-label{font-size:10.5px;color:#14201e;text-shadow:0 1px 0 rgba(255,255,255,.65)}
.wsf .ws-row output{background:linear-gradient(180deg,#0c1719,#030606);box-shadow:inset 0 2px 4px rgba(0,0,0,.9),0 1px 0 rgba(255,255,255,.4);text-shadow:0 0 8px rgba(127,227,200,.55)}
.wsf .ws-range{accent-color:#e59a4c;filter:drop-shadow(0 1px 0 rgba(255,255,255,.4))}
.wsf .ws-chassis{box-shadow:inset 0 2px 0 rgba(255,255,255,.6),inset 0 -6px 14px rgba(0,0,0,.28),0 0 0 1px #2c3532,0 30px 70px rgba(0,0,0,.7),0 0 120px rgba(255,170,80,.06) !important}
.wsf .ws-chassis::before{content:"";position:absolute;inset:8px;pointer-events:none;border-radius:14px;background:radial-gradient(circle,#eef1ed 0 2px,#5d6964 3px,transparent 4px) 0 0/100% 100% no-repeat;background-image:radial-gradient(circle at 50% 50%,#f1f3ef 0 2.5px,#6c7873 3.5px,#3c4542 5px,transparent 5.5px),radial-gradient(circle at 50% 50%,#f1f3ef 0 2.5px,#6c7873 3.5px,#3c4542 5px,transparent 5.5px),radial-gradient(circle at 50% 50%,#f1f3ef 0 2.5px,#6c7873 3.5px,#3c4542 5px,transparent 5.5px),radial-gradient(circle at 50% 50%,#f1f3ef 0 2.5px,#6c7873 3.5px,#3c4542 5px,transparent 5.5px);background-size:12px 12px;background-position:left top,right top,left bottom,right bottom;background-repeat:no-repeat}

/* Front panel base (the mockup's chassis type and color) */
.wsf { box-sizing: border-box; display: flex; flex-direction: column; gap: 16px; font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 12px; color: #f0e8d8; }
.wsf *, .wsf *::before, .wsf *::after { box-sizing: border-box; }
.wsf button { font-family: inherit; }
.wsf button:disabled { opacity: .72; cursor: not-allowed; }
.wsf .wsf-floppy.is-over { outline: 2px solid #ffcf86; outline-offset: 3px; }
.wsf .ws-range { width: 100%; accent-color: #e59a4c; }
/* The app's own Machine header and Disk Load Station stay underneath, hidden;
   the front panels press their controls. */
.heritage-ui #root#root .wsf-on > .anvil-workstation-header,
.heritage-ui #root#root .wsf-on > div:has(> .anvil-disk-drive) { display: none !important; }

/* Section 2 · Perform */
.wsf .wsf-tag { position: absolute; top: 2px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 4px; font-size: 10px; font-weight: 900; color: #050909; pointer-events: none; }
.wsf .wsf-trim { cursor: crosshair; }
.wsf .wsf-pad { user-select: none; -webkit-user-select: none; }
.wsf .wsf-heat > .anvil-console-heat { position: absolute !important; inset: 0 !important; height: 100% !important; min-height: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; }
.wsf.wsf-padflex > .ws-panel, .wsf.wsf-pads > .ws-panel, .wsf.wsf-session > .ws-panel { min-height: 100%; }
/* The app's own Pad Flex windows, pad column and side rails stay underneath, hidden. */
.heritage-ui #root#root .wsf-perform-on .anvil-workstation-left-rail,
.heritage-ui #root#root .wsf-perform-on .anvil-workstation-pad-column,
.heritage-ui #root#root .wsf-perform-on .anvil-workstation-right-rail,
.heritage-ui #root#root .wsf-perform-on .ws-flat > div:has(.anvil-waveform-header) { display: none !important; }

/* Section 3 · Mix Desk */
.wsf .wsf-out-button { min-width: 54px; padding: 4px 6px; border: 0; border-radius: 5px; background: linear-gradient(180deg, #0c1719, #030606); color: #bff3e1; font: 800 11px 'JetBrains Mono', monospace; text-align: center; cursor: pointer; box-shadow: inset 0 2px 4px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.4); text-shadow: 0 0 8px rgba(127,227,200,.55); }
.wsf .wsf-out-button:hover { filter: brightness(1.2); }
.heritage-ui #root#root .wsf-mix-on .anvil-master-console,
.heritage-ui #root#root .wsf-mix-on .anvil-groove-controls,
.heritage-ui #root#root .wsf-mix-on .anvil-master-out-rack,
.heritage-ui #root#root .wsf-mix-on .ws-flat > div:has(.anvil-master-visualizer),
.heritage-ui #root#root .wsf-mix-on .anvil-mix-deck,
.heritage-ui #root#root .wsf-mix-on .anvil-pad-mixer-fold-section { display: none !important; }

/* Section 4 · Step sequencer: mockup header/tools above the grid, step details below */
.heritage-ui #root#root .wsf-seq-on .anvil-sequencer-deck > .anvil-fold-toggle,
.heritage-ui #root#root .wsf-seq-on .anvil-sequencer-deck > .anvil-sequencer-deck__header,
.heritage-ui #root#root .wsf-seq-on .anvil-sequencer-deck > section:not(.anvil-pad-matrix),
.heritage-ui #root#root .wsf-seq-on .anvil-sequencer-deck .anvil-pad-matrix__top { display: none !important; }
.heritage-ui #root#root#root .wsf-seq-on .anvil-sequencer-deck { padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.heritage-ui #root#root#root .wsf-seq-on .anvil-sequencer-deck::before { content: none !important; }

/* Mockup width: the Workstation body runs wider, like the approved design. */
.heritage-ui #root#root .anvil-studio-board-shell--workstation { max-width: min(1290px, 100%) !important; }
/* Side-by-side panels fill their shared height, as in the mockup. */
.wsf > .ws-panel { height: 100%; min-height: inherit; }
.wsf.wsf-mix-console, .wsf.wsf-mix-processing, .wsf.wsf-mix-route, .wsf.wsf-mix-pad, .wsf.wsf-padflex, .wsf.wsf-pads, .wsf.wsf-session { display: flex; flex-direction: column; }
.wsf.wsf-mix-console > .ws-panel, .wsf.wsf-mix-processing > .ws-panel, .wsf.wsf-mix-route > .ws-panel, .wsf.wsf-mix-pad > .ws-panel { flex: 1; }
/* Every side-by-side panel fills its shared row height (mockup grid rows). */
.wsf.wsf-padflex > .ws-panel, .wsf.wsf-pads > .ws-panel, .wsf.wsf-session > .ws-panel { flex: 1 1 auto; height: auto; }
.wsf.wsf-session .wsf-heat { flex: 1 1 auto; }
/* Workstation runs out to the marked edges: about 6.75% of the screen on each side. */
.heritage-ui #root#root .anvil-studio-board-shell--workstation { max-width: none !important; width: min(86.5vw, 100%) !important; margin-left: auto !important; margin-right: auto !important; }
@media (max-width: 899px) { .heritage-ui #root#root .anvil-studio-board-shell--workstation { width: 100% !important; } }
/* The header above (View Config, title, tabs, plans, support) runs the same width as the Workstation. */
.heritage-ui #root .min-h-screen:has(> .anvil-studio-board-shell--workstation) > :not(.anvil-studio-board-shell):not(.sampkai-access-anchor) { width: min(86.5vw, 100%) !important; max-width: none !important; box-sizing: border-box; }
@media (max-width: 899px) { .heritage-ui #root .min-h-screen:has(> .anvil-studio-board-shell--workstation) > :not(.anvil-studio-board-shell):not(.sampkai-access-anchor) { width: 100% !important; } }

/* Top of the page, from the mockup */
.wsf.wsf-top { gap: 12px; margin: 0 auto 14px; }
.wsf.wsf-top .wsf-tabs-scroll::-webkit-scrollbar { display: none; }
.wsf.wsf-note { display: block; margin: 0 0 14px; padding: 10px 14px; border-radius: 9px; border: 1px dashed #5c6d68; color: #9fb3ac; font-size: 11px; line-height: 1.5; }
/* The app's own header pieces stay underneath, hidden, while the mockup header shows. */
.heritage-ui #root .wsf-top-on > :is(.anvil-nav-title, .anvil-main-tabs, .anvil-nav-rail, .anvil-native-access-strip, .sampkai-access-anchor, .anvil-support-bar),
.heritage-ui #root .wsf-top-on > div[class*="z-30"][class*="justify-between"] { display: none !important; }
.heritage-ui #root#root#root .wsf-top-on > :is(.anvil-nav-title, .anvil-main-tabs, .anvil-nav-rail, .anvil-native-access-strip, .sampkai-access-anchor, .anvil-support-bar),
.heritage-ui #root#root#root .wsf-top-on > div[class*="z-30"][class*="justify-between"] { display: none !important; }
.wsf.wsf-top > .ws-panel { height: auto !important; min-height: 0 !important; flex: none !important; }

/* Match the approved picture's proportions: it shows the mockup at 1.15× (tabs 52px,
   plan cards 140px, transport ~100px), with the transport sitting right under Support. */
@media (min-width: 900px) {
  .heritage-ui #root#root .wsf.wsf-top { zoom: 1.15; width: calc(min(86.5vw, 100%) / 1.15) !important; margin-bottom: 2px; }
  .heritage-ui #root#root .anvil-studio-board-shell--workstation > .ws-transport { zoom: 1.15; width: calc(100% / 1.15) !important; }
}
@media (min-width: 900px) {
  .heritage-ui #root#root .wsf.wsf-top { width: min(86.5vw, 100%) !important; }
  .heritage-ui #root#root .anvil-studio-board-shell--workstation > .ws-transport { width: 100% !important; }
}
@media (min-width: 900px) {
  /* Under 1.15× zoom the header's own width shrinks back to the body's edges. */
  .heritage-ui #root#root .wsf.wsf-top { width: calc(min(86.5vw, 100%) * 0.886) !important; }
}
/* Tab keys stretch to fill the row from left to right (they still scroll when the screen is too narrow). */
.wsf.wsf-top [role="tablist"] { min-width: 100% !important; width: max-content; }
.wsf.wsf-top [role="tablist"] > [data-tab] { flex: 1 0 auto; }
/* 60-column layout grid: no track gaps; each panel keeps 7px on each side instead. */
.heritage-ui #root#root#root .ws-layout { grid-template-columns: repeat(60, minmax(0, 1fr)) !important; column-gap: 0 !important; }
.heritage-ui #root#root#root .ws-layout .ws-item, .heritage-ui #root#root#root .ws-layout .ws-band-title { margin: 0 7px !important; }

/* Fixed size (Nov 13): the Workstation and its header keep one design width, 1290px,
   and never stretch with the window. View Config − / + zoom the whole thing. */
.heritage-ui #root#root .anvil-studio-board-shell--workstation { width: 1290px !important; max-width: 100% !important; }
.heritage-ui #root .min-h-screen:has(> .anvil-studio-board-shell--workstation) > :not(.anvil-studio-board-shell):not(.sampkai-access-anchor) { width: 1290px !important; max-width: 100% !important; }
@media (min-width: 900px) {
  .heritage-ui #root#root .wsf.wsf-top { zoom: var(--ws-zoom, 1) !important; width: 1290px !important; max-width: calc(100% / var(--ws-zoom, 1)) !important; }
  .heritage-ui #root#root .anvil-studio-board-shell--workstation > .ws-transport { zoom: 1 !important; width: 100% !important; }
}
@media (max-width: 899px) {
  .heritage-ui #root#root .anvil-studio-board-shell--workstation, .heritage-ui #root .min-h-screen:has(> .anvil-studio-board-shell--workstation) > * { width: 100% !important; }
}

/* Exact size from the owner's recording (Nov 13): the body is 1640px wide and the header and
   transport sit at 1.15×, on every screen. View Config − / + scale all of it from there. */
.heritage-ui #root#root .anvil-studio-board-shell--workstation { width: 1640px !important; max-width: 100% !important; }
.heritage-ui #root .min-h-screen:has(> .anvil-studio-board-shell--workstation) > :not(.anvil-studio-board-shell):not(.sampkai-access-anchor) { width: 1640px !important; max-width: 100% !important; }
@media (min-width: 900px) {
  .heritage-ui #root#root .wsf.wsf-top { zoom: calc(var(--ws-head, 1.15) * var(--ws-zoom, 1)) !important; width: calc(1651px / 1.15) !important; max-width: calc(100% / (var(--ws-head, 1.15) * var(--ws-zoom, 1))) !important; }
  .heritage-ui #root#root .anvil-studio-board-shell--workstation > .ws-transport { zoom: var(--ws-head, 1.15) !important; width: 100% !important; }
}

/* Disk Load Station: the app's own chop editor shows under the new disk panel, with the
   loaded wave, beat lines from the detected BPM, Beat 1, beats per chop (1/16 beat → 4 bars),
   free edit cuts and zoom. Everything else of the old station stays hidden. */
.heritage-ui #root#root#root .wsf-on > div:has(> .anvil-disk-drive) { display: block !important; }
.heritage-ui #root#root#root .wsf-on > div:has(> .anvil-disk-drive) > span,
.heritage-ui #root#root#root .wsf-on .anvil-disk-drive > :not(.anvil-disk-chop-controls):not(input) { display: none !important; }
.heritage-ui #root#root#root .wsf-on .anvil-disk-drive { padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.heritage-ui #root#root#root .wsf-on .anvil-disk-chop-controls { margin: 0 !important; border-radius: 13px !important; border: 1px solid #4a3a78 !important; background: linear-gradient(180deg, #2a2240, #1b1630) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 26px -6px rgba(0,0,0,.5) !important; }
.wsf .wsf-timing { display: none !important; }

/* ---------- Phones (portrait and landscape) ---------- */
html.ws-phone .heritage-ui #root#root#root .anvil-studio-board-shell--workstation,
html.ws-phone .heritage-ui #root#root .min-h-screen:has(> .anvil-studio-board-shell--workstation) > * { width: 100% !important; max-width: 100% !important; }
html.ws-phone .heritage-ui #root#root#root .wsf.wsf-top { zoom: 1 !important; width: 100% !important; max-width: 100% !important; }
html.ws-phone .heritage-ui #root#root#root .anvil-studio-board-shell--workstation > .ws-transport { zoom: 1 !important; width: 100% !important; }
/* compact transport rows on a phone in either orientation */
html.ws-phone .ws-transport { padding: 6px; border-radius: 0 0 12px 12px; }
html.ws-phone .ws-transport__plate { display: grid !important; grid-template-columns: auto 1fr; gap: 6px; padding: 6px; flex-wrap: wrap !important; }
html.ws-phone .ws-transport__deck { grid-column: 1 / -1; display: grid !important; grid-template-columns: 1fr 1fr 2fr 2fr 2fr 1fr; gap: 4px; padding: 4px; }
html.ws-phone .ws-transport__key { min-width: 0 !important; height: 38px; padding: 0 4px; font-size: 10px; }
html.ws-phone .ws-transport__tempo { justify-self: end; }
html.ws-phone .ws-transport__tempo [data-out="sig"], html.ws-phone .ws-transport__tempo [data-out="bars"], html.ws-phone .ws-transport__meter { display: none !important; }
html.ws-phone .ws-transport__modes { grid-column: 1 / -1; flex-wrap: nowrap !important; overflow-x: auto; }
/* Short landscape phone (a regular iPhone on its side): the transport scrolls with the page
   instead of covering half the screen. Big screens on their side (iPhone Duo / fold, tablets)
   keep it pinned, like the web version. */
@media (orientation: landscape) and (max-height: 520px) { html.ws-phone .heritage-ui #root#root .anvil-studio-board-shell--workstation > .ws-transport { position: relative !important; top: auto !important; } }
/* header pieces wrap and the tab keys scroll sideways */
html.ws-phone .wsf.wsf-top [role="tablist"] > [data-tab] { flex: 0 0 auto; }
/* Portable header: one short block, so the instrument starts right below it. */
html.ws-phone .wsf.wsf-top > div:has(> [data-plan]) { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; gap: 8px !important; padding-bottom: 4px !important; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
html.ws-phone .wsf.wsf-top [data-plan], html.ws-phone .wsf.wsf-top > div:has(> [data-plan]) > .ws-screen { flex: 0 0 auto !important; width: 196px !important; min-height: 0 !important; padding: 8px 10px !important; scroll-snap-align: start; }
html.ws-phone .wsf.wsf-top [data-plan] strong { font-size: 13px !important; }
html.ws-phone .wsf.wsf-top [data-plan] .wsf-plan-price { font-size: 16px !important; }
html.ws-phone .wsf.wsf-top [data-plan] > span:last-child { font-size: 9px !important; white-space: normal !important; }
html.ws-phone .wsf.wsf-top > div:has(.wsf-tabs-scroll) > div:first-child { padding: 10px 14px !important; min-height: 0 !important; }
html.ws-phone .wsf.wsf-top > div:has(.wsf-tabs-scroll) > div:first-child strong { font-size: 20px !important; line-height: 1.1 !important; white-space: nowrap !important; }
html.ws-phone .wsf.wsf-top > div:has(.wsf-tabs-scroll) > div:first-child span { font-size: 9px !important; }
html.ws-phone .wsf.wsf-top [role="tablist"] > [role="tab"] { height: 38px !important; min-height: 0 !important; padding: 0 12px !important; font-size: 11px !important; }
html.ws-phone .wsf.wsf-top > .ws-screen:first-child { padding: 6px 10px !important; }
html.ws-phone .wsf.wsf-top > .ws-screen:first-child > div:last-child .ws-key { height: 30px !important; min-height: 0 !important; font-size: 10px !important; }
/* the 16 pads stay a 4 x 4 grid of finger-sized pads */
html.ws-phone .wsf.wsf-pads .ws-plate { grid-auto-rows: minmax(84px, 1fr) !important; gap: 8px !important; padding: 10px !important; }
html.ws-phone .wsf .wsf-pad { min-height: 84px !important; padding: 6px !important; }
/* Keep the thin "swipe here" edge rails thin; the width rules above must not stretch them. */
.heritage-ui #root#root#root .min-h-screen > div[class*="fixed"][class*="w-4"],
html.ws-phone .heritage-ui #root#root#root .min-h-screen > div[class*="fixed"][class*="w-4"] { width: 1rem !important; max-width: 1rem !important; }
@media (min-width: 640px) { .heritage-ui #root#root#root .min-h-screen > div[class*="fixed"][class*="w-4"], html.ws-phone .heritage-ui #root#root#root .min-h-screen > div[class*="fixed"][class*="w-4"] { width: 1.5rem !important; max-width: 1.5rem !important; } }
/* Phones: slimmer padding so the pads get the width */
html.ws-phone .heritage-ui #root#root#root .ws-layout { padding: 6px !important; }
html.ws-phone .heritage-ui #root#root#root .ws-layout .ws-item, html.ws-phone .heritage-ui #root#root#root .ws-layout .ws-band-title { margin: 0 2px !important; }
html.ws-phone .wsf .ws-panel { padding: 10px 8px !important; }
html.ws-phone .wsf.wsf-pads .ws-plate { padding: 8px !important; gap: 6px !important; }

/* Portable header, continued: owner buttons in one row, the support bar in two short rows. */
html.ws-phone .wsf.wsf-top div:has(> [data-owner]) { flex-wrap: nowrap !important; overflow-x: auto !important; justify-content: flex-start !important; gap: 6px !important; }
html.ws-phone .wsf.wsf-top [data-owner] { flex: 0 0 auto !important; min-height: 32px !important; padding: 0 10px !important; font-size: 10px !important; }
html.ws-phone .wsf.wsf-top > .ws-panel:has([data-donate]) { display: grid !important; grid-template-columns: 1fr auto; gap: 6px 8px !important; padding: 8px 10px !important; align-items: center; }
html.ws-phone .wsf.wsf-top > .ws-panel:has([data-donate]) > div:first-child { grid-column: 1; min-width: 0; }
html.ws-phone .wsf.wsf-top > .ws-panel:has([data-donate]) > div:first-child span:not(:first-child), html.ws-phone .wsf.wsf-top > .ws-panel:has([data-donate]) > div:first-child div > :not(strong) { display: none !important; }
html.ws-phone .wsf.wsf-top > .ws-panel:has([data-donate]) > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap !important; overflow-x: auto !important; }
html.ws-phone .wsf.wsf-top > .ws-panel:has([data-donate]) > div:nth-child(2) .ws-note { display: none !important; }
html.ws-phone .wsf.wsf-top > .ws-panel:has([data-donate]) > div:nth-child(2) .ws-btn { flex: 0 0 auto !important; min-height: 32px !important; padding: 0 10px !important; }
html.ws-phone .wsf.wsf-top [data-donate] { grid-column: 2; grid-row: 1; min-height: 32px !important; padding: 0 10px !important; font-size: 10px !important; }

/* ---------- Phones: each section fills the screen ----------
   workstation-layout.js gives the pads, Forge Heat, Pad Flex and the mix panels the
   height of the screen below the pinned bars; these rules let their insides stretch. */
html.ws-phone .ws-layout .ws-page { scroll-margin-top: calc(var(--ws-pinned, 0px) + 6px); }
html.ws-phone .wsf.wsf-pads, html.ws-phone .wsf.wsf-session, html.ws-phone .wsf.wsf-padflex,
html.ws-phone .wsf.wsf-mix-console, html.ws-phone .wsf.wsf-mix-processing, html.ws-phone .wsf.wsf-mix-route, html.ws-phone .wsf.wsf-mix-pad { display: flex !important; flex-direction: column !important; }
html.ws-phone .wsf.wsf-pads > .ws-panel, html.ws-phone .wsf.wsf-session > .ws-panel, html.ws-phone .wsf.wsf-padflex > .ws-panel,
html.ws-phone .wsf[class*="wsf-mix-"] > .ws-panel { flex: 1 1 auto !important; display: flex !important; flex-direction: column !important; }
html.ws-phone .wsf.wsf-pads .ws-plate:has(> .wsf-pad) { flex: 1 1 auto !important; grid-auto-rows: minmax(0, 1fr) !important; grid-template-rows: repeat(4, minmax(0, 1fr)) !important; min-height: 0 !important; flex-basis: 0 !important; }
html.ws-phone .wsf .wsf-pad { min-height: 0 !important; overflow: hidden !important; }
html.ws-phone .wsf .wsf-pad > svg { min-height: 0 !important; }
html.ws-phone .wsf.wsf-session .ws-panel > .ws-plate:has(.wsf-heat) { flex: 1 1 auto !important; display: flex !important; flex-direction: column !important; }
html.ws-phone .wsf.wsf-session .wsf-heat { flex: 1 1 auto !important; height: auto !important; min-height: 220px !important; }
html.ws-phone .wsf.wsf-session .wsf-heat canvas, html.ws-phone .wsf.wsf-session .wsf-heat > * { height: 100% !important; }
html.ws-phone .wsf[class*="wsf-mix-"] .ws-panel { justify-content: space-between; }

/* Slim pinned bars on phones, so each section gets the room. */
html.ws-phone #sampkai-progress-dock { padding: 4px 10px !important; min-height: 0 !important; }
html.ws-phone #sampkai-progress-dock .progress-detail { display: none !important; }
html.ws-phone #sampkai-progress-dock button { min-height: 30px !important; padding: 4px 8px !important; font-size: 10px !important; }
html.ws-phone:not(.ws-duo) .ws-transport__plate { grid-template-columns: auto minmax(0, 1fr) !important; }
html.ws-phone:not(.ws-duo) .ws-transport__lcd { display: none !important; }
html.ws-phone:not(.ws-duo) .ws-transport__tempo { grid-column: 1 !important; justify-self: start !important; }
html.ws-phone:not(.ws-duo) .ws-transport__modes { grid-column: 2 !important; min-width: 0 !important; }

/* ---------- Phones, round 2: fixes from the iPhone fold and Android photos ---------- */
/* Session bar: one slim row (light, then the two buttons). */
html.ws-phone #sampkai-progress-dock { display: flex !important; flex-wrap: nowrap !important; justify-content: flex-start !important; gap: 8px !important; min-height: 0 !important; padding: 5px 10px !important; }
html.ws-phone #sampkai-progress-dock .progress-label { width: auto !important; flex: 0 1 auto; margin: 0 auto 0 0 !important; font-size: 10px !important; white-space: nowrap; overflow: hidden; }
html.ws-phone #sampkai-progress-dock .progress-actions { width: auto !important; flex: 0 0 auto; }
html.ws-phone #sampkai-progress-dock button { flex: 0 0 auto !important; min-height: 32px !important; }
@media (max-width: 479px) {
  html.ws-phone #sampkai-progress-dock .progress-label > span:not(.progress-led) { font-size: 0 !important; }
  html.ws-phone #sampkai-progress-dock .progress-label > span:not(.progress-led)::before { content: 'SESSION'; font-size: 10px; }
  html.ws-phone #sampkai-progress-dock .progress-actions { flex: 1 1 auto; }
  html.ws-phone #sampkai-progress-dock button { flex: 1 1 0 !important; }
}
/* Narrow phones (Android, iPhone): the whole transport fits, no buttons cut off. */
@media (max-width: 559px) {
  html.ws-phone:not(.ws-duo) .ws-transport__tempo > small { display: none !important; }
  html.ws-phone:not(.ws-duo) .ws-transport__tempo { gap: 3px !important; }
  html.ws-phone:not(.ws-duo) .ws-transport__tempo .ws-transport__nudge { width: 30px !important; }
  html.ws-phone:not(.ws-duo) .ws-transport__modes { display: grid !important; grid-template-columns: 1fr 1.1fr 1.4fr 34px 34px; gap: 4px !important; overflow: visible !important; }
  html.ws-phone:not(.ws-duo) .ws-transport__modes .ws-transport__key { padding: 0 2px !important; font-size: 9.5px !important; letter-spacing: 0 !important; white-space: nowrap; }
  html.ws-phone:not(.ws-duo) .ws-transport__modes [data-act="undo"], html.ws-phone:not(.ws-duo) .ws-transport__modes [data-act="redo"] { font-size: 0 !important; }
  html.ws-phone:not(.ws-duo) .ws-transport__modes [data-act="undo"]::before { content: '↶'; font-size: 16px; }
  html.ws-phone:not(.ws-duo) .ws-transport__modes [data-act="redo"]::before { content: '↷'; font-size: 16px; }
  /* Pad names show in full on two lines instead of being cut short. */
  html.ws-phone .wsf .wsf-pad > span:last-child { align-items: flex-end; gap: 3px; font-size: 9px !important; line-height: 1.15; }
  html.ws-phone .wsf .wsf-pad .wsf-pad-name { white-space: normal !important; overflow-wrap: break-word; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
/* Step sequencer: the pad grid fits the screen, scrolls inside, keeps its header row and
   pad names in view, and shows its own scroll bars (top for sideways, right for the rows). */
html.ws-phone .anvil-pad-matrix { position: relative; }
html.ws-phone .anvil-pad-matrix__scroll { overflow: auto !important; margin-top: 20px; padding-right: 18px !important; scrollbar-width: none; }
html.ws-phone .anvil-pad-matrix__scroll::-webkit-scrollbar { display: none; }
html.ws-phone .anvil-pad-matrix__ruler { position: sticky; top: -8px; z-index: 3; background: #56635f; box-shadow: 0 4px 8px rgba(0,0,0,.35); }
html.ws-phone .anvil-pad-matrix__row > :first-child { position: sticky; left: -8px; z-index: 2; }
html.ws-phone .anvil-pad-matrix__ruler > :first-child { background: #56635f; }
.ws-rail { position: absolute; z-index: 5; border-radius: 6px; background: rgba(20, 28, 26, .55); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); touch-action: none; cursor: pointer; }
.ws-rail[hidden] { display: none !important; }
.ws-rail--x { height: 10px; }
.ws-rail--y { width: 10px; }
.ws-rail > i { position: absolute; left: 0; top: 0; display: block; border-radius: 6px; background: linear-gradient(180deg, #ffd699, #e9a85c); box-shadow: 0 0 8px rgba(240,166,64,.6); }
.ws-rail--x > i { height: 100%; }
.ws-rail--y > i { width: 100%; }
/* Pads snap with their section title showing above them. */
html.ws-phone .ws-layout .wsf-pads.ws-page { scroll-margin-top: calc(var(--ws-pinned, 0px) + 42px); }

/* ---------- Phones, round 3 ---------- */
/* Free scrolling: no snapping, the page stops wherever your finger leaves it. */
html.ws-phone .min-h-screen:has(.ws-layout) { scroll-snap-type: none !important; -webkit-overflow-scrolling: touch; overscroll-behavior-y: none; }
/* Forge Heat: a wide bar right above the pads on phones (Session keeps meter, Export, Stop). */
.wsf .wsf-heatbar { display: none; }
html.ws-phone .wsf .wsf-heatbar { display: block; position: relative; flex: none; height: 54px; margin: 6px 0 2px; padding: 0 !important; overflow: hidden; }
.wsf .wsf-heatbar > .anvil-console-heat { position: absolute !important; inset: 0 !important; height: 100% !important; min-height: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; }
html.ws-phone .wsf.wsf-session .wsf-heat, html.ws-phone .wsf.wsf-session .wsf-heat + .ws-note { display: none !important; }
html.ws-phone .wsf.wsf-session .ws-panel > .ws-plate:has(.wsf-heat) { flex: none !important; }
/* Short phones turned sideways (iPhone 13 and similar): pads show key, dot and full name, no clipping. */
@media (max-height: 519px) {
  html.ws-phone .wsf.wsf-pads .ws-panel > div:first-child { display: none !important; }
  html.ws-phone .wsf .wsf-heatbar { height: 34px; margin-top: 0; }
  html.ws-phone .wsf .wsf-pad > svg { display: none !important; }
  html.ws-phone .wsf .wsf-pad { justify-content: space-between !important; padding: 5px 8px !important; }
  html.ws-phone .wsf .wsf-pad > span:last-child { font-size: 10px !important; line-height: 1.2; }
  html.ws-phone .wsf.wsf-pads .ws-plate:has(> .wsf-pad) { gap: 5px !important; padding: 6px !important; }
}

/* RECORD GRID / GROOVE (section 2): set the record grid and swing before recording. */
.wsf.wsf-groove .ws-panel { gap: 8px; }
.wsf .wsf-groove-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.wsf .wsf-groove-body { display: grid; grid-template-columns: 1.35fr 1.6fr 0.6fr 0.9fr; gap: 10px 14px; align-items: start; padding: 12px 14px; }
.wsf .wsf-groove-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wsf .wsf-groove-keys { display: flex; flex-wrap: wrap; gap: 5px; }
.wsf .wsf-groove-keys .ws-key { min-height: 34px; flex: 1 0 auto; }
.wsf .wsf-groove-more { min-height: 34px; padding: 0 6px; border-radius: 7px; border: 1px solid #9aa59f; background: linear-gradient(180deg, #fbfcfa, #cdd4cf); color: #1c2926; font: 800 12px 'JetBrains Mono', monospace; cursor: pointer; }
.wsf .wsf-groove-more.is-on { border-color: #f5ddb2; background: linear-gradient(180deg, #ffd699, #d48e45); color: #1f1405; }
.wsf.wsf-groove.is-unavailable { opacity: 0.6; }
@media (max-width: 1100px) { .wsf .wsf-groove-body { grid-template-columns: 1fr 1fr; } }
html.ws-phone .wsf .wsf-groove-body { grid-template-columns: 1fr; padding: 10px !important; }
html.ws-phone .wsf .wsf-groove-keys .ws-key { padding: 0 6px !important; min-width: 0; }

/* Big phones / open foldables held sideways (ws-duo): the four plan cards share the header width
   in one row (no sideways scrolling, nothing cut off at the right edge). */
html.ws-phone.ws-duo .wsf.wsf-top > div:has(> [data-plan]) { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; overflow: visible !important; scroll-snap-type: none !important; }
html.ws-phone.ws-duo .wsf.wsf-top [data-plan], html.ws-phone.ws-duo .wsf.wsf-top > div:has(> [data-plan]) > .ws-screen { width: auto !important; min-width: 0 !important; }

/* Pad Flex keeps the same height for every pad (no page jump when you play or pick a pad):
   its title and its steps caption are always two fixed lines; long pad names end in "…". */
.wsf.wsf-padflex .ws-panel > div:first-child { flex-direction: column !important; align-items: stretch !important; gap: 2px; }
.wsf.wsf-padflex :is([data-out="padTitle"], [data-out="stripTitle"], [data-out="stripCount"]) { display: block; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wsf.wsf-padflex div:has(> [data-out="stripTitle"]) { flex-direction: column !important; align-items: stretch !important; gap: 2px; }

/* The forged Anvil Kraft logo in the empty middle of the header's dark title bar. */
.wsf.wsf-top .wsf-top-logo-wrap { position: relative; display: block; flex: 0 1 auto; max-width: 40%; margin: -18px auto; pointer-events: none; user-select: none; }
.wsf.wsf-top .wsf-top-logo { position: relative; z-index: 1; display: block; height: 92px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6)); }
/* A warm light behind the red STUDIO lettering so it reads on the dark bar. */
.wsf.wsf-top .wsf-top-logo-wrap::before { content: ""; position: absolute; z-index: 0; left: 47%; right: 15%; top: 56%; bottom: 18%; border-radius: 40%; background: radial-gradient(ellipse at center, rgba(255, 246, 232, 1) 0%, rgba(255, 228, 196, 0.9) 40%, rgba(255, 200, 150, 0.45) 65%, rgba(255, 180, 120, 0) 85%); filter: blur(4px); }
html.ws-phone .wsf.wsf-top .wsf-top-logo { height: 64px; }
html.ws-phone .wsf.wsf-top .wsf-top-logo-wrap { margin: -12px auto; }
@media (max-width: 699px) { .wsf.wsf-top .wsf-top-logo-wrap { display: none; } }

/* Support the Creator: one slim row (message · amounts · donate), desktop and wide screens. */
html:not(.ws-phone) .wsf.wsf-top > .ws-panel:has([data-donate]) { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center !important; gap: 14px !important; padding: 8px 14px !important; }
html:not(.ws-phone) .wsf.wsf-top > .ws-panel:has([data-donate]) > div:first-child { min-width: 0; gap: 12px !important; }
html:not(.ws-phone) .wsf.wsf-top > .ws-panel:has([data-donate]) > div:first-child > div { min-width: 0; gap: 1px !important; }
html:not(.ws-phone) .wsf.wsf-top > .ws-panel:has([data-donate]) > div:first-child span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px !important; color: #1a2622 !important; }
html:not(.ws-phone) .wsf.wsf-top > .ws-panel:has([data-donate]) svg { flex: none; filter: drop-shadow(0 0 6px rgba(216, 69, 63, 0.55)); }
html:not(.ws-phone) .wsf.wsf-top > .ws-panel:has([data-donate]) > div:nth-child(2) { flex-wrap: nowrap !important; gap: 5px !important; padding: 4px 4px 4px 14px; border-left: 1px solid rgba(20, 32, 30, 0.22); }
html:not(.ws-phone) .wsf.wsf-top > .ws-panel:has([data-donate]) > div:nth-child(2) .ws-note { display: none !important; }
html:not(.ws-phone) .wsf.wsf-top > .ws-panel:has([data-donate]) [data-amount] { min-height: 32px !important; padding: 0 10px !important; }
html:not(.ws-phone) .wsf.wsf-top [data-donate] { min-height: 36px !important; padding: 0 16px !important; white-space: nowrap; box-shadow: 0 0 12px rgba(242, 194, 125, 0.45), 0 2px 0 rgba(0, 0, 0, 0.25) !important; }

/* Support the Creator: a warm heart-red / amber wash that slowly breathes. */
@keyframes wsf-support-breathe {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 8px rgba(60, 20, 18, 0.25), 0 0 6px rgba(232, 92, 72, 0.25), 0 10px 22px -8px rgba(0, 0, 0, 0.5); filter: saturate(1); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -3px 8px rgba(60, 20, 18, 0.2), 0 0 26px rgba(240, 120, 88, 0.6), 0 0 10px rgba(255, 196, 120, 0.45), 0 10px 22px -8px rgba(0, 0, 0, 0.5); filter: saturate(1.15); }
}
@keyframes wsf-support-heart { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
.heritage-ui #root#root .wsf.wsf-top > .ws-panel:has([data-donate]) {
  background-color: #e9b8a3 !important;
  background-image: radial-gradient(120% 160% at 0% 50%, rgba(255, 214, 196, 0.85), transparent 55%), linear-gradient(100deg, #efc1ad 0%, #e8b897 45%, #e3c592 75%, #bfd6c4 100%) !important;
  border-color: #c98a74 #b97a66 #a86a58 #c18270 !important;
  animation: wsf-support-breathe 3.2s ease-in-out infinite;
}
.heritage-ui #root#root .wsf.wsf-top > .ws-panel:has([data-donate]) svg { animation: wsf-support-heart 1.6s ease-in-out infinite; transform-origin: center; }
.heritage-ui #root#root .wsf.wsf-top > .ws-panel:has([data-donate]) :is(.ws-label, strong) { color: #3a0f0b !important; }
.heritage-ui #root#root .wsf.wsf-top > .ws-panel:has([data-donate]) > div:first-child span { color: #3b1a12 !important; }
.heritage-ui #root#root .wsf.wsf-top > .ws-panel:has([data-donate]) > div:nth-child(2) { border-left-color: rgba(90, 30, 20, 0.25) !important; }
@media (prefers-reduced-motion: reduce) {
  .heritage-ui #root#root .wsf.wsf-top > .ws-panel:has([data-donate]), .heritage-ui #root#root .wsf.wsf-top > .ws-panel:has([data-donate]) svg { animation: none !important; }
}
/* Donate button: a light, bright face with a crisp edge so it stands apart from the breathing bar. */
.heritage-ui #root#root .wsf.wsf-top [data-donate] {
  background: linear-gradient(180deg, #fffdf7 0%, #fff4e2 55%, #ffe9cc 100%) !important;
  border: 1px solid #ffffff !important;
  color: #3a0f0b !important;
  box-shadow: inset 0 1px 0 #ffffff, 0 0 0 1px rgba(150, 70, 50, 0.35), 0 2px 0 rgba(120, 50, 35, 0.35), 0 4px 10px rgba(80, 30, 20, 0.25) !important;
}
.heritage-ui #root#root .wsf.wsf-top [data-donate]:hover { filter: brightness(1.04); }

/* View Config zoom: the board's layout width is the window width divided by the zoom, so after
   scaling it fills the window exactly. Everything keeps its proportions and nothing is cut off. */
html:not(.ws-phone) .heritage-ui #root#root .anvil-studio-board-shell--workstation { max-width: calc(100% / var(--ws-board-zoom, 1)) !important; }
/* Keep the zoomed board centred even when its layout width is wider than the window (zoom below 100%). */
html:not(.ws-phone) .heritage-ui #root#root .anvil-studio-board-shell--workstation { margin-left: calc((100% - min(1780px, 100% / var(--ws-board-zoom, 1))) / 2) !important; margin-right: calc((100% - min(1780px, 100% / var(--ws-board-zoom, 1))) / 2) !important; align-self: auto !important; }
/* FULL LEVEL pad button: lit amber when on */
.wsf .wsf-fulllevel.is-on, .wsf-fulllevel.is-on { background: #ffb547 !important; border-color: #c97a12 !important; color: #2a1704 !important; box-shadow: 0 0 10px rgba(255, 181, 71, 0.75), inset 0 1px 0 rgba(255,255,255,0.5) !important; }
/* GROUPS strip on the pad panel */
.wsf-grp-pick { display: inline-flex; align-items: center; gap: 6px; font: 800 11px 'JetBrains Mono', monospace; color: #2c3a37; }
.wsf-grp-pick select, .wsf-groups select { font: 800 12px 'JetBrains Mono', monospace; padding: 4px 6px; border-radius: 6px; border: 1px solid #8e9a94; background: #eef1ed; color: #1d2826; }
.wsf-grp-name { font: 900 12px 'JetBrains Mono', monospace; color: #1d2826; letter-spacing: 0.04em; }
.wsf-groups [data-grp-act][aria-pressed="true"] { background: #ffb547 !important; border-color: #c97a12 !important; color: #2a1704 !important; }
.wsf-groups [data-grp-act="mute"][aria-pressed="true"] { background: #e2575c !important; border-color: #9c2b30 !important; color: #fff !important; }
.wsf-groups [data-grp-detail][hidden], .wsf-pad-grp[hidden] { display: none !important; }
.wsf-pad-grp { font: 900 9px 'JetBrains Mono', monospace; padding: 1px 4px; border-radius: 4px; background: #2c3a37; color: #ffcf86; letter-spacing: 0.04em; }
.wsf-pad-grp[data-muted="true"] { background: #9c2b30; color: #fff; }
/* Choke / group drop-downs: always show a clear down arrow */
.wsf .wsf-out-select, .wsf-groups select {
  -webkit-appearance: none !important; appearance: none !important; cursor: pointer;
  font: 800 12px 'JetBrains Mono', monospace !important; min-width: 92px; padding: 5px 28px 5px 9px !important;
  border-radius: 6px !important; border: 1px solid #8e9a94 !important; color: #1d2826 !important;
  background: #eef1ed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231d2826' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center / 11px 8px !important;
}
.wsf .wsf-out-select:disabled { opacity: 0.5; cursor: not-allowed; }
/* Pad tools indent (FULL LEVEL / COPY / GROUPS / GAIN): darker well, larger white text */
.wsf .ws-plate.wsf-pad-tools { background: linear-gradient(180deg, #5d6864, #4f5955) !important; border-color: #3c4542 !important; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(255, 255, 255, 0.08) !important; }
.wsf .ws-plate.wsf-pad-tools .ws-label, .wsf .ws-plate.wsf-pad-tools .ws-note, .wsf .ws-plate.wsf-pad-tools .ws-row > span, .wsf .ws-plate.wsf-pad-tools .wsf-grp-pick > span, .wsf .ws-plate.wsf-pad-tools .wsf-grp-name { color: #ffffff !important; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55) !important; }
.wsf .ws-plate.wsf-pad-tools .ws-label, .wsf .ws-plate.wsf-pad-tools .ws-row > span, .wsf .ws-plate.wsf-pad-tools .wsf-grp-name { font-size: 16px !important; font-weight: 900 !important; letter-spacing: 0.06em !important; }
.wsf .ws-plate.wsf-pad-tools .ws-note, .wsf .ws-plate.wsf-pad-tools .wsf-grp-pick > span { font-size: 14.5px !important; font-weight: 800 !important; }
.wsf .ws-plate.wsf-pad-tools .wsf-grp-pick output { color: #ffcf86 !important; }
.wsf .ws-plate.wsf-pad-tools .wsf-groups { border-top-color: rgba(255, 255, 255, 0.22) !important; }
.wsf .ws-plate.wsf-pad-tools .ws-key { font-size: 13px !important; }
.wsf .ws-plate.wsf-pad-tools select { font-size: 13px !important; }
/* Pad Flex: scroll bar for a zoomed waveform */
.wsf .wsf-flex-pan { display: block; width: 100%; height: 16px; margin: 0; accent-color: #7fe3c8; cursor: grab; }
.wsf .wsf-flex-pan[hidden] { display: none !important; }
html.ws-phone .wsf .wsf-flex-pan { height: 26px; }
/* NORMALIZE: lit while the pad's sound is normalized */
.wsf .wsf-normalize[aria-pressed="true"] { background: #ffb547 !important; border-color: #c97a12 !important; color: #2a1704 !important; box-shadow: 0 0 10px rgba(255, 181, 71, 0.6) !important; }

/* Pad Flex APPLY TO picker: the selected pad is always included (outlined). */
.wsf .wsf-scope-pad[data-locked="true"] { outline: 2px solid #7fe3c8; outline-offset: -2px; }
.wsf .wsf-scope [data-out="scopeNote"] { color: #7fe3c8; }

/* ---------- iPhone Duo / fold (Nov 2026): a two-row transport ----------
   LOOP · CLICK · COUNT · UNDO · REDO move up into the empty middle of the counter / BPM row
   (counter | modes | BPM), so the pinned bar is one row shorter and the board gets that
   space back. Portrait is narrower: UNDO / REDO become ↶ ↷ and the keys tighten up. The
   dark backing under the bar no longer hangs 26px below it. */
html.ws-phone.ws-duo .ws-transport__plate { grid-template-columns: auto minmax(0, 1fr) auto !important; align-items: center; }
html.ws-phone.ws-duo .ws-transport__lcd { grid-column: 1 !important; grid-row: 2 !important; }
html.ws-phone.ws-duo .ws-transport__modes { grid-column: 2 !important; grid-row: 2 !important; justify-content: center; min-width: 0 !important; overflow: visible !important; gap: 4px !important; }
html.ws-phone.ws-duo .ws-transport__tempo { grid-column: 3 !important; grid-row: 2 !important; }
html.ws-phone.ws-duo .ws-transport__modes .ws-transport__key { white-space: nowrap; }
html.ws-phone.ws-duo .heritage-ui #root#root .ws-transport::before { bottom: -6px !important; }
html.ws-phone.ws-duo .heritage-ui #root#root .anvil-studio-board-shell--workstation > .ws-transport { margin-bottom: 6px !important; }
@media (orientation: portrait) {
  html.ws-phone.ws-duo .ws-transport__modes .ws-transport__key { padding: 0 6px !important; font-size: 9.5px !important; letter-spacing: 0 !important; }
  html.ws-phone.ws-duo .ws-transport__modes [data-act="undo"], html.ws-phone.ws-duo .ws-transport__modes [data-act="redo"] { font-size: 0 !important; width: 34px; padding: 0 !important; }
  html.ws-phone.ws-duo .ws-transport__modes [data-act="undo"]::before { content: '↶'; font-size: 16px; }
  html.ws-phone.ws-duo .ws-transport__modes [data-act="redo"]::before { content: '↷'; font-size: 16px; }
  html.ws-phone.ws-duo .ws-transport__lcd { padding: 4px 8px !important; }
}

/* ---------- Group pickers (Nov 2026) ----------
   Our own floating grid instead of the native <select> (whose iPhone picker made Safari
   scroll the page). The note under GROUPS keeps one line so the panel never changes height. */
.wsf .wsf-pick-native { display: none !important; }
.wsf .wsf-pick-btn { min-width: 64px; height: 34px; padding: 0 10px !important; font: 800 12px 'JetBrains Mono', monospace !important; }
.wsf-pick-pop { position: fixed; z-index: 2147483000; display: grid; gap: 6px; padding: 10px; border-radius: 12px; background: linear-gradient(180deg, #24302e, #141c1b); border: 1px solid #5f6b66; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6); box-sizing: border-box; }
.wsf-pick-pop[hidden] { display: none !important; }
.wsf-pick-pop .ws-key { height: 38px; padding: 0 4px; font: 800 12px 'JetBrains Mono', monospace; color: #15201d; background: linear-gradient(180deg, #eef1ed, #d3d9d4); border: 1px solid #8e9a94; border-radius: 8px; box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 2px 0 #6f7a75; cursor: pointer; touch-action: manipulation; }
.wsf-pick-pop .ws-key[aria-selected="true"] { background: linear-gradient(180deg, #ffcf86, #e8964f); color: #2a1c08; border-color: #c46a25; }
.wsf .wsf-groups [data-out="grpNote"] { flex: 1 1 160px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }

/* Narrow phones (Nov 2026): six mode keys (LOOP · CLICK · VOL · COUNT · ↶ · ↷) need the full
   width. The metronome VOL key made a sixth key, and squeezed beside the tempo they were cut
   to "LOO", "CLI". Tempo gets its own row; the mode keys sit full width under it. */
@media (max-width: 559px) {
  html.ws-phone:not(.ws-duo) .ws-transport__tempo { grid-column: 1 / -1 !important; grid-row: auto !important; justify-self: stretch !important; justify-content: center; }
  html.ws-phone:not(.ws-duo) .ws-transport__modes {
    grid-column: 1 / -1 !important; grid-row: auto !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.15fr) 36px 36px !important;
  }
  html.ws-phone:not(.ws-duo) .ws-transport__modes .ws-transport__key { overflow: hidden; text-overflow: clip; }
}

/* Duo / foldable portrait (Nov 2026): six mode keys (the metronome VOL key made the sixth) no
   longer fit between the BAR · BEAT · STEP counter and BPM, so they spilled over both. Like
   the iPad mini: counter left and BPM right on one row, the mode keys full width below. */
@media (orientation: portrait) {
  html.ws-phone.ws-duo .ws-transport__lcd { grid-column: 1 !important; grid-row: 2 !important; }
  html.ws-phone.ws-duo .ws-transport__tempo { grid-column: 2 / -1 !important; grid-row: 2 !important; justify-self: end !important; }
  html.ws-phone.ws-duo .ws-transport__modes {
    grid-column: 1 / -1 !important; grid-row: 3 !important;
    display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) 48px 48px !important;
    gap: 6px !important; justify-content: stretch !important;
  }
  html.ws-phone.ws-duo .ws-transport__modes .ws-transport__key { width: auto !important; min-width: 0 !important; }
}
/* Duo / foldable landscape stays one compact row: tighten only the six mode keys so they fit
   between the counter and BPM instead of spilling 30px over them. */
@media (orientation: landscape) {
  html.ws-phone.ws-duo .ws-transport__modes { gap: 3px !important; }
  html.ws-phone.ws-duo .ws-transport__modes .ws-transport__key { padding: 0 4px !important; font-size: 9px !important; letter-spacing: 0 !important; }
  html.ws-phone.ws-duo .ws-transport__modes [data-act="undo"], html.ws-phone.ws-duo .ws-transport__modes [data-act="redo"] { width: 28px !important; }
}

/* Pad Flex keys in narrow rows (APPLY TO, GROOVE, COPY / PASTE): wrap a long label onto two
   lines instead of cutting it off ("PICK PAD", "PASTE · SAM"). Nov 2026. */
.wsf-padflex .wsf-scope .ws-key, .wsf-padflex .wsf-pgroove .ws-key, .wsf-padflex .wsf-pcopy .ws-key {
  white-space: normal !important; overflow-wrap: anywhere; line-height: 1.1 !important;
  min-height: 30px; height: auto !important; padding: 3px 3px !important; text-align: center;
}
/* Mix pad panel: "▶ TEST THE HIT" was 3px too wide on the Duo; wrap instead of cutting it. */
.wsf-mix-pad .ws-plate > button { white-space: normal !important; line-height: 1.15 !important; height: auto !important; min-height: 34px; }
/* Duo / foldable landscape: UNDO / REDO show just ↶ ↷ (as in portrait). In 28px keys the full
   words "↶ UNDO ↷ REDO" ran over each other. */
@media (orientation: landscape) {
  html.ws-phone.ws-duo .ws-transport__modes [data-act="undo"], html.ws-phone.ws-duo .ws-transport__modes [data-act="redo"] {
    font-size: 0 !important; width: 34px !important; padding: 0 !important; overflow: hidden;
  }
  html.ws-phone.ws-duo .ws-transport__modes [data-act="undo"]::before { content: '↶'; font-size: 16px; }
  html.ws-phone.ws-duo .ws-transport__modes [data-act="redo"]::before { content: '↷'; font-size: 16px; }
}

/* Desktop, Nov 18 2026: the board runs a little wider (1780px, was 1640px), the 16 pads are
   square instead of tall, and Pad Flex scrolls inside the pads' height instead of stretching
   the row. Phones are unchanged. */
html:not(.ws-phone) .heritage-ui #root#root .anvil-studio-board-shell--workstation { width: 1780px !important; }
html:not(.ws-phone) .heritage-ui #root .min-h-screen:has(> .anvil-studio-board-shell--workstation) > :not(.anvil-studio-board-shell):not(.sampkai-access-anchor) { width: 1780px !important; }
@media (min-width: 900px) {
  html:not(.ws-phone) .heritage-ui #root#root .wsf.wsf-top { width: calc(1791px / 1.15) !important; }
}
html:not(.ws-phone) .wsf.wsf-pads .ws-plate:has(> .wsf-pad) { flex: none !important; grid-auto-rows: auto !important; grid-template-rows: none !important; }
html:not(.ws-phone) .wsf.wsf-pads .wsf-pad { aspect-ratio: 1 / 1; height: auto !important; min-height: 0 !important; overflow: hidden; }
html:not(.ws-phone) .wsf.wsf-pads .wsf-pad > svg { min-height: 0 !important; }
html:not(.ws-phone) .wsf.wsf-padflex.ws-flex-scroll { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c98b45 transparent; border-radius: 12px; }
html:not(.ws-phone) .wsf.wsf-padflex.ws-flex-scroll > .ws-panel { height: auto !important; flex: none !important; }

/* Pad hit light (Nov 18 2026): set straight from the tap, no mirror pass needed */
.wsf .wsf-pad.wsf-pad-hit .wsf-pad-dot { background: #ff3b2a !important; box-shadow: 0 0 8px #ff3b2a !important; }
.wsf .wsf-pad.wsf-pad-hit .wsf-pad-wave { stroke: #ff6a4a !important; }
.wsf .wsf-pad.wsf-pad-hit { filter: brightness(1.06); }

/* PAD PAN / BANK PAN (Nov 19 2026): centre tick and an L · C · R scale under the slider. */
.wsf .wsf-pan { background-image: linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 214, 153, .55) calc(50% - 1px), rgba(255, 214, 153, .55) calc(50% + 1px), transparent calc(50% + 1px)); }
.wsf .wsf-pan-scale { display: flex; justify-content: space-between; margin-top: -4px; padding: 0 2px; font: 800 9px 'JetBrains Mono', monospace; letter-spacing: .08em; color: #8fa9a1; }
.wsf .wsf-pan-readout { cursor: pointer; }

/* Step sequencer tools (Nov 19 2026): two even rows, BANK + COPY / PASTE, then BAR 1-4 +
   FOLLOW + the CLEAR keys. Same key height everywhere; phones stack each group full width. */
.wsf-seq-top .wsf-seq-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.wsf-seq-top .wsf-seq-tools { container-type: inline-size; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: #8d9791; border: 1px solid #66716c; box-shadow: inset 0 2px 5px rgba(20, 32, 30, 0.5), 0 1px 0 rgba(255, 255, 255, 0.4); }
.wsf-seq-top .wsf-seq-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wsf-seq-top .wsf-seq-label { flex: 0 0 auto; min-width: 38px; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: #1a2624; }
.wsf-seq-top .wsf-seq-banks,
.wsf-seq-top .wsf-bars,
.wsf-seq-top .wsf-seq-copy,
.wsf-seq-top .wsf-seq-clears { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.wsf-seq-top .wsf-seq-copy,
.wsf-seq-top .wsf-seq-clears { margin-left: auto; }
.wsf-seq-top .wsf-seq-tools .ws-btn { height: 36px !important; min-height: 36px !important; padding: 0 10px !important; border-radius: 7px !important; white-space: nowrap; line-height: 1.05; font-size: 11px !important; letter-spacing: 0.04em !important; }
.wsf-seq-top .wsf-seq-banks .ws-btn { font-size: 12px !important; }
.wsf-seq-top .wsf-seq-banks .ws-btn { min-width: 36px !important; padding: 0 !important; }
.wsf-seq-top .wsf-seq-toast { font-size: 10px; font-weight: 700; color: #1a2624; }
.wsf-seq-top .wsf-seq-toast:empty { display: none; }
/* Narrow (phone portrait, folded Duo): each group gets its own full-width line of equal keys. */
@container (max-width: 620px) {
  .wsf-seq-top .wsf-seq-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 6px 8px; }
  .wsf-seq-top .wsf-seq-copy,
  .wsf-seq-top .wsf-seq-clears { grid-column: 1 / -1; margin-left: 0; }
  .wsf-seq-top .wsf-seq-banks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .wsf-seq-top .wsf-bars { flex-wrap: nowrap; }
  .wsf-seq-top .wsf-bars .ws-btn { flex: 1 1 0; min-width: 0; padding: 0 4px !important; font-size: 10px !important; }
  .wsf-seq-top .wsf-seq-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wsf-seq-top .wsf-seq-clears { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wsf-seq-top .wsf-seq-banks .ws-btn { min-width: 0 !important; }
  .wsf-seq-top .wsf-seq-clears .ws-btn,
  .wsf-seq-top .wsf-seq-copy .ws-btn { padding: 0 4px !important; white-space: normal; font-size: 10px !important; }
}

/* ---------- Slimmer pinned transport on phones and the iPhone Duo (Nov 20 2026) ----------
   The pinned bar took a fifth of the screen (171px on a phone, 180px on an open Duo held
   upright). Keys are a little shorter and the padding tighter everywhere on a phone; the open
   Duo held upright now uses two rows instead of three: transport keys + BAR·BEAT·STEP on top,
   LOOP · CLICK · VOL · COUNT · ↶ · ↷ + BPM underneath. Every control is still there. */
html.ws-phone .heritage-ui #root .ws-transport { padding: 4px 5px !important; }
html.ws-phone .heritage-ui #root .ws-transport__plate { gap: 4px !important; padding: 4px !important; }
html.ws-phone .heritage-ui #root .ws-transport__deck { gap: 3px !important; padding: 3px !important; }
html.ws-phone .heritage-ui #root .ws-transport__deck .ws-transport__key { height: 34px !important; }
html.ws-phone .heritage-ui #root .ws-transport__pass { line-height: 1 !important; }
html.ws-phone .heritage-ui #root .ws-transport__pass small { font-size: 9px !important; }
html.ws-phone .heritage-ui #root .ws-transport__pass b { font-size: 12px !important; }
html.ws-phone .heritage-ui #root .ws-transport__tempo { padding: 2px 4px !important; gap: 3px !important; }
html.ws-phone .heritage-ui #root .ws-transport__tempo .ws-transport__nudge { height: 28px !important; }
html.ws-phone .heritage-ui #root .ws-transport__tempo .ws-transport__readout { height: 28px !important; padding-top: 0 !important; padding-bottom: 0 !important; display: inline-grid; place-items: center; box-sizing: border-box; }
html.ws-phone .heritage-ui #root .ws-transport__tempo select.ws-transport__readout { display: inline-block; line-height: 28px; }
html.ws-phone .heritage-ui #root .ws-transport__modes .ws-transport__key { height: 30px !important; }
html.ws-phone .heritage-ui #root .ws-transport__lcd { padding: 2px 8px !important; gap: 8px !important; }
html.ws-phone .heritage-ui #root .ws-transport__lcd small { font-size: 8px !important; line-height: 1.1; }
html.ws-phone .heritage-ui #root .ws-transport__lcd b { font-size: 15px !important; line-height: 1.1; }
html.ws-phone .heritage-ui #root#root .anvil-studio-board-shell--workstation > .ws-transport { margin-bottom: 6px !important; }
@media (orientation: portrait) {
  html.ws-phone.ws-duo .heritage-ui #root .ws-transport__plate { grid-template-columns: minmax(0, 1fr) auto !important; align-items: center; }
  html.ws-phone.ws-duo .heritage-ui #root .ws-transport__deck { grid-column: 1 !important; grid-row: 1 !important; min-width: 0; }
  html.ws-phone.ws-duo .heritage-ui #root .ws-transport__lcd { grid-column: 2 !important; grid-row: 1 !important; justify-self: stretch; justify-content: center; }
  html.ws-phone.ws-duo .heritage-ui #root .ws-transport__modes { grid-column: 1 !important; grid-row: 2 !important; grid-template-columns: repeat(4, minmax(0, 1fr)) 34px 34px !important; gap: 4px !important; }
  html.ws-phone.ws-duo .heritage-ui #root .ws-transport__modes .ws-transport__key { padding: 0 3px !important; }
  html.ws-phone.ws-duo .heritage-ui #root .ws-transport__tempo { grid-column: 2 !important; grid-row: 2 !important; justify-self: end !important; }
  html.ws-phone.ws-duo .heritage-ui #root .ws-transport__tempo > small { display: none !important; }
}
