/* The listener's frame on the website (web/listener.js): the apps' views over the same map. Only
   the :root tokens from index.html (Design System/Tokens.md). body.listener = signed out. */

/* the page's old chrome gives way, for listeners and setters alike: the map takes the window, and
   the setter's blocks the frame needs are moved into it (web/listener.js) */
header, #panel, #patchbar, #pacerbar, #readout, #markbar, #sheet, #layers-btn { display: none !important; }
#app { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; padding: 0 !important; }
#map { grid-row: 1 !important; grid-column: 1 !important; border: 0 !important; }

/* ---- the frame ---- */
#ls {
  display: block; position: absolute; inset: 0; z-index: 7; pointer-events: none;
  font-family: var(--font-body); color: var(--ink);
}
#ls > * { pointer-events: auto; }
/* the site's own button and heading styles are the setter's instrument face (mono, spaced
   capitals, accent when pressed); the listener's are the apps' */
#ls button {
  font: inherit; font-family: var(--font-body); letter-spacing: normal; text-transform: none;
  color: var(--ink); cursor: pointer; transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
#ls button:hover { color: var(--ink); background: var(--raised); }
#ls button[aria-pressed="true"] { color: var(--ink); background: var(--raised); border-color: var(--hairline); }
#ls h2 { text-transform: none; letter-spacing: normal; }
/* the map's own controls move below the top bar */
.maplibregl-ctrl-top-right { top: calc(48px + var(--s-3) * 2); }
#ls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the top bar: the place picker, then Layers and Account */
#ls-top {
  position: absolute; top: calc(var(--s-3) + env(safe-area-inset-top)); left: var(--s-4); right: var(--s-4);
  display: flex; align-items: center; gap: var(--s-2); pointer-events: none;
}
#ls-top > * { pointer-events: auto; }
.ls-gap { flex: 1; }
#ls-place, .ls-round {
  height: 48px; border: 1px solid var(--hairline);
  background: color-mix(in oklch, var(--panel) 94%, transparent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
#ls-place {
  display: flex; align-items: center; gap: var(--s-2); min-width: 0; max-width: 70%;
  padding: 0 var(--s-4); border-radius: 999px;
  font-family: var(--font-display); font-size: var(--t-md); font-weight: 600;
}
#ls-place-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-caret { color: var(--dim); font-family: var(--font-body); font-size: var(--t-sm); }
.ls-round { width: 48px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.ls-round svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }

/* the panel: across the foot of the map on a phone, hugging its content */
#ls-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: 0 var(--s-4) calc(var(--s-5) + env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--hairline); border-radius: 20px 20px 0 0;
}
#ls #ls-grip { height: 44px; margin-bottom: calc(-1 * var(--s-2)); padding: 0; border: 0; background: none; display: grid; place-items: center; }
#ls-grip span { width: 38px; height: 4px; border-radius: 2px; background: var(--hairline); }
#ls-walk { display: flex; flex-direction: column; gap: var(--s-3); }
#ls-walk[hidden], #ls-bar[hidden] { display: none; }

.ls-head, .ls-routeline, #ls-bar { display: flex; align-items: center; gap: var(--s-3); }
.ls-title { flex: 1; min-width: 0; margin: 0; color: var(--ink); font-family: var(--font-display); font-size: var(--t-md); font-weight: 600; line-height: 1.2;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-note { flex: 1; margin: 0; color: var(--dim); font-size: var(--t-sm); line-height: 1.4; }
.ls-note b { color: var(--ink); font-weight: 400; }
.ls-mono, .ls-dist, .ls-chip { font-family: var(--font-mono); }
.ls-chip {
  flex: none; padding: 3px var(--s-2); border: 1px solid var(--hairline); border-radius: 4px;
  font-size: var(--t-xs); letter-spacing: var(--track-meta); color: var(--dim);
}
.ls-btn {
  flex: none; min-width: 64px; min-height: 44px; padding: 0 var(--s-3);
  border: 1px solid var(--hairline); border-radius: 10px; background: var(--raised);
  font-size: var(--t-sm); font-weight: 500;
}
#ls .ls-toggle[aria-pressed="false"] { background: none; color: var(--dim); }
.ls-wide { width: 100%; }

.ls-rows > .ls-row + .ls-row { border-top: 1px solid var(--hairline); }
.ls-row { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-2) 0; min-height: 44px; justify-content: center; }
.ls-rowline { display: flex; align-items: center; gap: var(--s-2); }
.ls-lamp { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--lamp); }
.ls-name { flex: 1; min-width: 0; font-size: var(--t-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-dist { font-size: var(--t-sm); color: var(--dim); }
.ls-level { height: 5px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.ls-level i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width var(--d-fast) var(--ease); }
.ls-level i.ls-quiet { background: color-mix(in oklch, var(--faint) 60%, transparent); }

.ls-bartext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; }
.ls-bartext .ls-note { flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the morph cells: on the map just above the panel, riding with it (bottom set in listener.js) */
#ls-cells { position: absolute; left: var(--s-4); width: 136px; height: 136px; }
#ls-cells[hidden] { display: none; }
#ls-cells #cells { position: static; width: 100%; height: 100%; }

/* a computer: the panel floats over the map's left edge, under the place picker */
@media (min-width: 861px) {
  #ls-panel {
    left: var(--s-4); right: auto; bottom: auto; top: calc(48px + var(--s-3) * 2);
    width: 380px; max-height: calc(100% - 48px - 240px - var(--s-3) * 2 - var(--s-4) * 2);
    padding-bottom: var(--s-4); border: 1px solid var(--hairline); border-radius: 16px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  }
  #ls-cells { bottom: var(--s-4); width: 240px; height: 240px; }
}
@media (prefers-reduced-motion: reduce) { #ls * { transition: none !important; } }

/* ---- sheets and cards (W2/W3) ---- */
#ls-holder[hidden] { display: none; }
.ls-sheet, .ls-card { display: flex; flex-direction: column; gap: var(--s-3); }
.ls-sheethead, .ls-cardhead { display: flex; align-items: center; gap: var(--s-2); }
#ls .ls-close { width: 44px; height: 44px; flex: none; }
.ls-cardtitle { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; line-height: 1.15;
                text-transform: none; letter-spacing: normal; }
.ls-eyebrow { margin: var(--s-2) 0 0; font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: var(--track-eyebrow);
              text-transform: uppercase; color: var(--faint); }
.ls-fine { margin: 0; color: var(--faint); font-size: var(--t-xs); line-height: 1.4; }
.ls-meta { margin: 0; font-family: var(--font-mono); font-size: var(--t-xs); color: var(--dim); }
#ls input.ls-search {
  width: 100%; min-height: 44px; padding: 0 var(--s-3); box-sizing: border-box;
  background: var(--sunk); color: var(--ink); border: 1px solid var(--hairline); border-radius: 10px;
  font: inherit; font-size: 16px;                           /* 16px: iOS does not zoom into it */
}
#ls input.ls-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ls-scroll { overflow-y: auto; max-height: min(52dvh, 440px); display: flex; flex-direction: column; gap: var(--s-1);
             overscroll-behavior: contain; }
#ls .ls-item, #ls .ls-row {
  display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: 44px; padding: var(--s-2) 0;
  background: none; border: 0; border-bottom: 1px solid var(--hairline); border-radius: 0; text-align: left;
}
#ls .ls-row { flex-direction: column; align-items: stretch; gap: var(--s-1); }
#ls .ls-rows > .ls-row:last-child, #ls .ls-routes > .ls-item:last-child, #ls .ls-parks > .ls-item:last-child { border-bottom: 0; }
#ls .ls-item:hover, #ls .ls-row:hover { background: color-mix(in oklch, var(--raised) 50%, transparent); }
.ls-rows > .ls-row + .ls-row { border-top: 0; }
.ls-chev { color: var(--faint); font-size: var(--t-md); line-height: 1; }

/* Layers: a segmented base map, then switches */
.ls-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
#ls .ls-seg button { min-height: 44px; border: 0; border-radius: 0; background: none; color: var(--dim); font-size: var(--t-sm); }
#ls .ls-seg button + button { border-left: 1px solid var(--hairline); }
#ls .ls-seg button[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
.ls-knob { flex: none; width: 36px; height: 20px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--hairline); position: relative; }
.ls-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--faint);
                  transition: transform var(--d-fast) var(--ease), background var(--d-fast) var(--ease); }
#ls .ls-switch[aria-pressed="true"] { background: none; }
.ls-switch[aria-pressed="true"] .ls-knob { background: color-mix(in oklch, var(--accent) 30%, var(--sunk)); }
.ls-switch[aria-pressed="true"] .ls-knob::after { transform: translateX(16px); background: var(--accent); }

/* cards */
.ls-wave { width: 100%; height: 44px; display: block; }
#ls .ls-listen.ls-on { background: var(--accent); color: var(--sunk); border-color: var(--accent); }
.ls-player { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; }
.ls-player .ls-name { font-size: var(--t-sm); }
#ls .ls-play svg { fill: var(--ink); stroke: none; }
#ls .ls-photo[disabled] { opacity: 0.4; cursor: default; }
.ls-prog { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.ls-chord {
  min-width: 0; padding: 5px 2px; border-radius: 4px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); font-size: 10px; color: var(--sunk); background: var(--c); opacity: 0.55;
}
.ls-chord.ls-at { opacity: 1; outline: 2px solid var(--ink); outline-offset: 1px; }
.ls-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.ls-facts > span { display: flex; flex-direction: column; gap: 2px; }
.ls-facts .ls-eyebrow { margin: 0; }
.ls-facts b { color: var(--ink); font-weight: 400; font-size: var(--t-base); }

/* the folded bar is one button back up */
#ls .ls-bartext { background: none; border: 0; padding: 0; text-align: left; }
#ls-bar { display: flex; align-items: center; gap: var(--s-3); }
#ls-bar[hidden] { display: none; }

/* photos */
#ls-photos { position: fixed; inset: 0; z-index: 40; background: color-mix(in oklch, var(--sunk) 94%, transparent); display: flex; flex-direction: column; }
#ls-photos[hidden] { display: none; }
#ls-photos .ls-close { position: absolute; top: var(--s-3); right: var(--s-3); z-index: 1; }
.ls-strip { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; align-items: center; }
.ls-strip img { flex: none; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.ls-strip .ls-note { margin: auto; }

/* the computer's floating panel lets a card or sheet scroll inside it rather than grow past the cells */
@media (min-width: 861px) {
  #ls-panel { overflow-y: auto; overscroll-behavior: contain; }
}
/* while a card or a sheet is open the cells rest, and the panel may use the height they held */
#ls-panel { max-height: calc(100% - 48px - var(--s-3) * 3 - env(safe-area-inset-top)); }
#ls-holder { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* never a scroll bar (Kerem, 2026-09-28): what fits, fits; in a window too short for it the rest is a
   wheel or a swipe away, with no bar drawn */
#ls-panel, #ls-holder { scrollbar-width: none; }
/* while a card is open it has its own Type row and its tab names what it is: the new-point icons and
   the kind label give their height to the card (both back when it closes) */
#ls-panel:has(#ls-card) #ls-tools #mode-icons, #ls-card .cardhead .ckind { display: none; }
/* a short window (a 1366x660 laptop): the panel's rows sit closer rather than the card being cut */
@media (max-height: 720px) { #ls-panel, .ls-card { gap: var(--s-2); } }
#ls-panel::-webkit-scrollbar, #ls-holder::-webkit-scrollbar { display: none; }
@media (min-width: 861px) {
  #ls-panel.ls-tall { max-height: calc(100% - 48px - var(--s-3) * 2 - var(--s-4)); }
}

/* ---- the setter (S1): the page's own blocks, moved into the frame ---- */
#ls-tools { display: flex; flex-direction: column; gap: var(--s-2); }
#ls-tools[hidden], #ls-pub[hidden] { display: none; }
#ls-tools .modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
#ls #ls-tools .modes button { min-height: 44px; border: 0; border-radius: 0; background: none; color: var(--dim); font-size: var(--t-sm); }
#ls #ls-tools .modes button + button { border-left: 1px solid var(--hairline); }
#ls #ls-tools .modes button[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
#ls-tools .iconpick[hidden] { display: none; }
#ls-pub { border-top: 1px solid var(--hairline); padding-top: var(--s-3); }
#ls-pub #publishbar { display: flex; align-items: center; gap: var(--s-3); margin: 0; }
#ls #publishbar #publish-btn:not([disabled]) { background: var(--accent); color: var(--sunk); border-color: var(--accent); }
#ls .ls-primary { background: var(--accent); color: var(--sunk); border-color: var(--accent); }
.ls-setcard #card { display: flex; flex-direction: column; gap: var(--s-3); }
#ls .ls-setcard #f-name {
  width: 100%; box-sizing: border-box; padding: var(--s-1) 0; background: none; border: 0; border-bottom: 1px solid var(--hairline);
  color: var(--ink); font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; letter-spacing: normal; text-transform: none;
}
#ls .ls-setcard #f-name:focus-visible { outline: none; border-bottom-color: var(--accent); }
#ls .ls-setcard textarea, #ls .ls-setcard input[type="text"] { font-size: 16px; }   /* iOS: no zoom into a field */
.ls-setacct { display: flex; flex-direction: column; gap: var(--s-2); }

/* ---- the sound panels (S2): the route patch, in the new look ---- */
#patchpanel { background: var(--ground); }
#patchpanel .viewerbar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--hairline); background: var(--panel); }
#pp-title { font-family: var(--font-display) !important; font-size: var(--t-md) !important; font-weight: 600; letter-spacing: normal !important;
            text-transform: none !important; color: var(--ink) !important; }
#patchpanel .viewerbar button { min-height: 44px; padding: 0 var(--s-3); border: 1px solid var(--hairline); border-radius: 10px; background: var(--raised);
  color: var(--ink); font-family: var(--font-body); font-size: var(--t-sm); letter-spacing: normal; text-transform: none; }
#patchpanel .viewerbar #pp-reset { background: none; color: var(--dim); }
#pp-tabs, #pp-sub { display: none; }

/* a row: name · knob · value (computer); the slider stays, hidden, for the page's own handlers */
.pprow.has-knob { grid-template-columns: minmax(0, 1fr) 24px 3.4rem; margin-bottom: 2px; }
#pp-body input[type=range][data-knob], #rp-body input[type=range][data-knob] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#pp-body .knob, #rp-body .knob { flex: none; }
#pp-body .pprow, #rp-body .pprow { font-family: var(--font-body); font-size: 12.5px; letter-spacing: normal; text-transform: none; color: var(--dim); position: relative; }
#pp-body .pprow i, #rp-body .pprow i { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink); }
#pp-body select, #rp-body select { background: var(--sunk); color: var(--ink); border: 1px solid var(--hairline); border-radius: 6px; font-family: var(--font-body); font-size: 12.5px; }
#pp-body h2, #rp-body h2 { color: var(--faint); }
.knob { width: 24px; height: 24px; cursor: ns-resize; touch-action: none; border-radius: 50%; outline-offset: 2px; }
.knob:focus-visible { outline: 2px solid var(--accent); }
.knob svg { width: 100%; height: 100%; display: block; overflow: visible; }
.knob-track { fill: none; stroke: var(--raised); stroke-width: 3.5; stroke-linecap: round; }
.knob-fill { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.knob-tick { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.knob.on .knob-fill { stroke: var(--lamp); }

/* a phone: one tab at a time, knobs as 44 px cells, three to a row */
@media (max-width: 860px) {
  #pp-tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--hairline); background: var(--panel); }
  #pp-tabs button { min-height: 44px; border: 0; border-radius: 0; background: none; color: var(--dim);
    font-family: var(--font-body); font-size: var(--t-sm); letter-spacing: normal; text-transform: none; padding: 0; }
  #pp-tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
  #pp-body .pp-off { display: none !important; }
  #pp-sub { display: grid; grid-template-columns: repeat(3, 1fr); margin: var(--s-2) var(--s-4) 0; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
  #pp-sub[hidden] { display: none; }
  #pp-sub button { min-height: 40px; border: 0; border-radius: 0; background: none; color: var(--dim); font-family: var(--font-body); font-size: var(--t-sm); letter-spacing: normal; text-transform: none; padding: 0; }
  #pp-sub button + button { border-left: 1px solid var(--hairline); }
  #pp-sub button[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
  #pp-body .ppcol { display: flex; flex-wrap: wrap; align-items: flex-start; }
  #pp-body .ppcol > h2, #pp-body .ppcol > .pprow:not(.has-knob) { flex: 0 0 100%; }
  #pp-body .pprow.has-knob { flex: 0 0 33.333%; box-sizing: border-box; display: grid; grid-template-columns: 1fr; justify-items: center;
    gap: 2px; padding: var(--s-1) 2px; margin: 0; text-align: center; }
  #pp-body .pprow.has-knob .knob { order: -1; width: 44px; height: 44px; }
  #pp-body .pprow.has-knob > span { white-space: normal; line-height: 1.15; font-size: 12px; max-width: 100%; }
  #pp-body .pprow.has-knob i { text-align: center; }
}
.knob-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; margin-right: var(--s-2); vertical-align: top; }
.knob-cap { font-family: var(--font-body); font-size: 10.5px; color: var(--faint); letter-spacing: normal; text-transform: none; }
@media (max-width: 860px) { .knob-cell .knob { width: 44px; height: 44px; } }

/* ---- S3: a point's sound panel (Stretch · Rhythm · Grains), and both panels' own buttons ---- */
#rhythmpanel { background: var(--ground); }
#rhythmpanel .viewerbar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--hairline); background: var(--panel); }
#rp-title { font-family: var(--font-display) !important; font-size: var(--t-md) !important; font-weight: 600; letter-spacing: normal !important;
            text-transform: none !important; color: var(--ink) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#rhythmpanel .viewerbar button { flex: none; min-height: 44px; padding: 0 var(--s-3); border: 1px solid var(--hairline); border-radius: 10px; background: var(--raised);
  color: var(--ink); font-family: var(--font-body); font-size: var(--t-sm); letter-spacing: normal; text-transform: none; }
#rhythmpanel .viewerbar #rp-reset { background: none; color: var(--dim); }
/* the panels' own buttons speak the body face, not the instrument's mono capitals */
#pp-body button, #rp-body button { font-family: var(--font-body); letter-spacing: normal; text-transform: none; font-size: 12.5px; border-radius: 6px; }
#pp-body .pprow button, #rp-body .pprow button { min-height: 26px; }
.pptabs { border: 1px solid var(--hairline) !important; border-radius: 10px; overflow: hidden; }
#rp-body .pptabs button { min-height: 40px; border-radius: 0; background: none; color: var(--dim); font-size: var(--t-sm); }
#rp-body .pptabs button[aria-selected="true"] { background: var(--raised); color: var(--ink); border-color: var(--hairline); }

/* the tabbed sound panel (the page tabs it below 1000 px): knobs as 44 px cells, three to a row */
@media (max-width: 999px) {
  #rp-body :has(> .pprow.has-knob) { display: flex; flex-wrap: wrap; align-items: flex-start; }
  #rp-body :has(> .pprow.has-knob) > :not(.pprow.has-knob) { flex: 0 0 100%; }
  #rp-body .pprow.has-knob { flex: 0 0 33.333%; box-sizing: border-box; display: grid; grid-template-columns: 1fr; justify-items: center;
    gap: 2px; padding: var(--s-1) 2px; margin: 0; text-align: center; }
  #rp-body .pprow.has-knob .knob { order: -1; width: 44px; height: 44px; }
  #rp-body .pprow.has-knob > span { white-space: normal; line-height: 1.15; font-size: 12px; max-width: 100%; }
  #rp-body .pprow.has-knob i { text-align: center; }
}
/* one line under the knob: name, then value — three lines per cell ran the Rhythm and Ratios tabs
   past the phone's height (measured +41 to +109 px) */
@media (max-width: 999px) {
  #rp-body .pprow.has-knob { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k k" "n v"; justify-items: stretch; column-gap: 4px; row-gap: 1px; }
  #rp-body .pprow.has-knob .knob { grid-area: k; justify-self: center; }
  #rp-body .pprow.has-knob > span { grid-area: n; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
  #rp-body .pprow.has-knob i { grid-area: v; text-align: right; font-size: 10.5px; }
}
@media (max-width: 999px) {
  #rp-body :has(> .pprow.has-knob) { flex-direction: row !important; }
  #rp-body .hitcard { display: block; }
  #rp-body .pxratio > .pprow.has-knob { flex-basis: 50%; }
  /* the name and its value read as one caption, centred under the knob */
  #rp-body .pprow.has-knob { grid-template-columns: auto auto; justify-content: center; column-gap: 5px; padding-left: 4px; padding-right: 4px; }
  #rp-body .pprow.has-knob > span { max-width: 4.6rem; }
}
@media (max-width: 999px) {
  /* Ratios: eight ratio-and-level pairs, two pairs to a line */
  #rp-body .pxmod:has(> .pxratio) { display: flex; flex-wrap: wrap; flex-direction: row !important; }
  #rp-body .pxmod:has(> .pxratio) > :not(.pxratio) { flex: 0 0 100%; }
  #rp-body .pxratio { flex: 0 0 50% !important; display: flex !important; flex-direction: row !important; box-sizing: border-box; }
  #rp-body .pxratio > .pprow.has-knob { flex: 0 0 50% !important; }
}

/* ---- S4: the sweep ---- */
/* the setter card: every control a 44 px target, the chips as pills, published lit when on */
#ls .ls-setcard #card button { min-height: 44px; border-radius: 10px; padding-left: var(--s-3); padding-right: var(--s-3); }
#ls .ls-setcard #card .iconpick button { padding: 0; }
#ls .ls-setcard #card .recmode { border-radius: 10px; }
#ls .ls-setcard #card .recmode button { border-radius: 0; }
#ls .ls-setcard .chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
#ls .ls-setcard #f-published[aria-pressed="true"] { background: var(--accent); color: var(--sunk); border-color: var(--accent); }
#ls .ls-setcard .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s-2); }
#ls .ls-setcard #f-delete { color: var(--ink); }
#ls .ls-setcard #rec-play { min-width: 44px; padding: 0; }
/* the map's toast, for everyone: the frame's face instead of the instrument's */
#toast { font-family: var(--font-body) !important; font-size: var(--t-sm) !important; letter-spacing: normal !important; text-transform: none !important;
  color: var(--ink) !important; background: var(--panel) !important; border: 1px solid var(--hairline) !important; border-radius: 10px !important;
  padding: var(--s-2) var(--s-3) !important; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); top: calc(48px + var(--s-3) * 2 + env(safe-area-inset-top)) !important; }
/* the patch's on / off: a small pill, lit when on */
#pp-body .pprow button[aria-pressed], #rp-body .pprow button[aria-pressed] { border-radius: 999px; }
#pp-body .pprow button[aria-pressed="true"], #rp-body .pprow button[aria-pressed="true"] { background: color-mix(in oklch, var(--accent) 28%, var(--raised)); color: var(--ink); border-color: var(--accent); }
/* the setter's Account: its moved buttons as the frame's, 44 px */
#ls .ls-setacct button { min-height: 44px; border-radius: 10px; padding: 0 var(--s-3); border: 1px solid var(--hairline); background: var(--raised); color: var(--ink); }
#ls .ls-setacct .actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin: 0; }
#ls .ls-setacct #setter-reveal { background: none; border: 0; color: var(--dim); padding: 0; text-align: left; }
#ls-pub #saved { margin: var(--s-1) 0 0; color: var(--faint); font-size: var(--t-xs); line-height: 1.4; }
/* the setter card, one part at a time (no scroll bar) */
#ls-cardtabs { flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
#ls #ls-cardtabs button { min-height: 44px; border: 0; border-radius: 0; background: none; color: var(--dim); font-size: var(--t-sm); }
#ls #ls-cardtabs button + button { border-left: 1px solid var(--hairline); }
#ls #ls-cardtabs button[aria-selected="true"] { background: var(--raised); color: var(--ink); }
#ls .ls-setcard .ls-ct-off { display: none !important; }
#ls .ls-fine a { color: var(--accent); }
