/* The layout, in the minimal look: no boxes, hairlines, quiet type, numbers in mono, colour only on
   what's on. (theme.css, after it, is the look the site wears: walnut.) */
:root {
  --bg: #0A0A0B;
  --raise: #17171A;
  --edge: rgba(255, 255, 255, .07);
  --edge-2: rgba(255, 255, 255, .14);
  --ink: #F1EFEA;
  --dim: #A3A0A9;
  --mute: #75727C;
  --pit: #060607;
  --blood: #C2303A;
  --rings: #F2913D;
  --ob: #EE6A5E;     /* the OB */
  --stages: #B79BF2;
  --fx: #7FD1C0;
  --drums: #E8D48A;
  --chord: #7FB9F2; /* the sequencer's chord steps */
  --voice: var(--rings); /* the sequencer, pads and keys light in the voice's colour */
  --font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fh: 132px; /* a fader's height */
  color-scheme: dark;
}

html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
  color: var(--ink); font: 400 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button, select, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }

/* logged in or not (site.js keeps :root.known): the parts for one or the other */
:root:not(.known) [data-when="known"] { display: none !important; }
:root.known [data-when="unknown"] { display: none !important; }

/* ---------- the top bar: the logo on the left; messages and the menu on the right ---------- */
.topbar {
  position: relative; z-index: 70; flex: none; box-sizing: border-box; height: 60px;
  padding: 0 20px; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg); border-bottom: 1px solid var(--edge);
}
/* the logo: "frequency" over the scope and "shifter", the second line as wide as the first (the
   scope takes up the difference) */
.logo { display: grid; width: max-content; margin: 0; font-size: 21px; font-weight: 600; line-height: .95; letter-spacing: -.025em; user-select: none; -webkit-user-select: none; }
.l1 { display: block; }
.l2 { display: flex; align-items: center; gap: .3em; width: 0; min-width: 100%; }
.scope { flex: 1; min-width: 0; height: .9em; overflow: hidden; filter: drop-shadow(0 0 3px rgba(242, 145, 61, .6)); }
.scope path { fill: none; stroke: var(--rings); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.scope .idle { transform: scaleX(var(--k, 1)); transition: transform 1.6s ease-in-out; }
.scope .idle path { animation: drift 2.6s linear infinite; }
.scope .live { opacity: 0; }
.scope.live .idle { opacity: 0; }
.scope.live .live { opacity: 1; }
@keyframes drift { to { transform: translateX(-40px); } }
@media (prefers-reduced-motion: reduce) { .scope .idle path { animation: none; } }

.bar-right { display: flex; align-items: center; gap: 10px; flex: none; }
.menu-btn, .inbox {
  height: 36px; margin: 0; cursor: pointer; font-weight: 500; font-size: 14px;
  background: none; border: 1px solid var(--edge-2); border-radius: 8px;
}
.menu-btn { padding: 0 14px; }
/* MIDI: a lamp (lit with a keyboard connected, flashing as it plays) and the keyboard's name */
.midi {
  display: flex; align-items: center; gap: 8px; height: 36px; margin: 0; padding: 0 12px; cursor: pointer; max-width: 260px;
  font-size: 13px; font-weight: 500; color: var(--dim); background: none; border: 1px solid var(--edge-2); border-radius: 8px;
}
.midi:hover { border-color: rgba(255, 255, 255, .3); color: var(--ink); }
.midi i { flex: none; width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--mute); }
.midi.on i { background: var(--ink); box-shadow: none; }
.midi.lit i { background: #fff; box-shadow: 0 0 8px #fff; }
.midi span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; color: var(--mute); }
.midi span:empty { display: none; }
.menu-btn:hover, .inbox:hover { border-color: rgba(255, 255, 255, .3); }
.inbox-wrap, .menu-wrap { position: relative; }
.inbox-panel, .menu {
  position: absolute; right: 0; top: calc(100% + 10px); box-sizing: border-box; z-index: 2;
  background: #101012; border: 1px solid var(--edge-2); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.panel-head { margin: 0 0 8px; font-weight: 500; font-size: 13px; color: var(--dim); }

/* ---------- messages: an envelope with the unread count; opens a little panel ---------- */
.inbox { position: relative; display: grid; place-items: center; width: 40px; padding: 0; }
.env { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.inbox-count {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  display: grid; place-items: center; font: 500 11px/1 var(--mono); color: #fff; background: var(--blood); border-radius: 9px;
}
.inbox-count.none { display: none; }
.inbox-panel { width: min(300px, 86vw); padding: 14px 14px 8px; }
.inbox-empty { margin: 0 0 6px; font-size: 13px; color: var(--dim); }
.inbox-list { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 420px); overflow: auto; }
.inbox-msg { position: relative; border-top: 1px solid var(--edge); }
.inbox-msg:first-child { border-top: 0; }
.inbox-open {
  display: flex; flex-direction: column; gap: 3px; width: 100%; box-sizing: border-box; margin: 0; padding: 10px 28px 10px 14px;
  font-size: 13px; text-align: left; color: inherit; text-decoration: none; background: none; border: 0; cursor: pointer;
}
.inbox-open b { font-weight: 500; }
.inbox-open:hover b { text-decoration: underline; text-underline-offset: 2px; }
.inbox-open span { color: var(--dim); overflow-wrap: anywhere; }
.inbox-open small { font: 400 11px var(--mono); color: var(--mute); }
.inbox-msg.unread .inbox-open::before {
  content: ""; position: absolute; left: 2px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--blood);
}
.inbox-del { position: absolute; right: 0; top: 6px; padding: 4px 8px; margin: 0; cursor: pointer; font-size: 16px; color: var(--mute); background: none; border: 0; }
.inbox-del:hover { color: var(--ink); }

/* ---------- the menu: how to play, reset; then who you are and the way out ---------- */
.menu { width: max-content; min-width: 220px; max-width: calc(100vw - 32px); padding: 6px 0 12px; }
.menu-list { list-style: none; margin: 0; padding: 0 6px; }
.menu-list button {
  display: block; width: 100%; margin: 0; padding: 10px 12px; text-align: left; cursor: pointer;
  font-size: 14px; font-weight: 400; background: none; border: 0; border-radius: 6px;
}
.menu-list button:hover { background: var(--raise); }
.menu-who { margin: 6px 0 0; padding: 10px 18px 0; border-top: 1px solid var(--edge); font-size: 12px; }
.menu-who .who { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.menu-out { margin: 4px 0 0; padding: 0; color: #F07A84; background: none; border: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.menu-in { margin: 6px 0 0; padding: 12px 14px 2px; border-top: 1px solid var(--edge); width: 280px; max-width: 100%; box-sizing: border-box; }
.menu-in-label { display: block; margin: 0 0 8px; font-size: 12px; color: var(--dim); }
.menu-in .hi input, .menu-in .hi button { height: 36px; font-size: 14px; }
.menu-in .hi button { padding: 0 14px; }

/* empty targets for inline in-app messages: under the top bar, and over the middle */
.slot { width: min(560px, 92vw); position: fixed; left: 50%; translate: -50% 0; z-index: 60; }
.slot:empty { display: none; }
#top-slot { top: 72px; }
#center-slot { top: 30%; }

/* =====================================================================================
   under the top bar: the pages' tabs, and the transport (on every page)
   ===================================================================================== */
.navbar {
  position: relative; z-index: 5; flex: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  padding: 0 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--edge);
}
.pages { display: flex; align-items: stretch; gap: 22px; align-self: stretch; }
.pg {
  display: flex; align-items: center; gap: 7px; margin: 0; padding: 14px 0 12px; cursor: pointer;
  font-size: 17px; font-weight: 400; letter-spacing: -.01em; color: var(--mute); background: none; border: 0;
}
.pg:hover { color: var(--dim); }
.pg[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--pc, var(--ink)); }
.pg.ob { --pc: var(--ob); } .pg.rings { --pc: var(--rings); } .pg.drums { --pc: var(--drums); } .pg.stages { --pc: var(--stages); } .pg.fx { --pc: var(--fx); }
.lamp { width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--mute); }
.pg.on .lamp { background: var(--pc); box-shadow: 0 0 8px var(--pc); }

.transport { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 8px 0; }
.play {
  width: 38px; height: 38px; margin: 0; padding: 0; flex: none; cursor: pointer; border-radius: 50%;
  display: grid; place-items: center; background: none; border: 1px solid var(--edge-2);
}
.play:hover { border-color: rgba(255, 255, 255, .3); }
.play svg { width: 16px; height: 16px; fill: var(--ink); }
.play .i-stop { display: none; }
.play[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); box-shadow: 0 0 18px rgba(255, 255, 255, .2); }
.play[aria-pressed="true"] svg { fill: var(--bg); }
.play[aria-pressed="true"] .i-play { display: none; }
.play[aria-pressed="true"] .i-stop { display: block; }
.transport .tempo { --c: var(--ink); }
.pick { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mute); }
.patch select, .pick select, .stage-out select {
  min-width: 0; height: 32px; margin: 0; padding: 0 4px; cursor: pointer; font-size: 14px; font-weight: 400;
  color: var(--ink); background: var(--bg); border: 0; border-bottom: 1px solid var(--edge-2); border-radius: 0;
}
.patch select:hover, .pick select:hover, .stage-out select:hover { border-bottom-color: rgba(255, 255, 255, .35); }

/* =====================================================================================
   the instrument: one page at a time; the OB, Rings and the drums with their playbar and surface
   ===================================================================================== */
.rig { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; --voice: var(--ink); }
.rig[data-page="ob"] { --voice: var(--ob); }
.rig[data-page="rings"] { --voice: var(--rings); }
.rig[data-page="drums"] { --voice: var(--drums); }
.rig:not(.playable) .playbar, .rig:not(.playable) .surface { display: none; }
.page { --c: var(--voice); flex: none; box-sizing: border-box; padding: 14px 16px 12px; min-width: 0; }
.page.stages { --c: var(--stages); } .page.fx { --c: var(--fx); }
.rig:not(.playable) .page { flex: 1; overflow: auto; padding-top: 18px; }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; min-height: 34px; margin-bottom: 12px; }
.page-head h2 { margin: 0; font-size: 24px; font-weight: 400; letter-spacing: -.02em; color: var(--ink); }
.what { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.page-body { display: flex; gap: 24px; align-items: flex-end; min-width: 0; }

/* buttons: words, not boxes; what's on is underlined in its colour (or lit, with a lamp) */
.models { display: grid; grid-template-columns: auto auto; gap: 2px 20px; flex: none; align-self: stretch; align-content: start; }
.models button {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 0; cursor: pointer; text-align: left; white-space: nowrap;
  font-size: 14px; font-weight: 400; color: var(--mute); background: none; border: 0; border-radius: 0;
}
.models button i { display: none; }
.models button:hover { color: var(--ink); }
.models button[aria-checked="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--c); }
.poly, .views, .pages-8, .choruses, .ob-model, .kit { display: flex; align-items: center; gap: 4px; }
.poly button, .views button, .pages-8 button, .choruses button, .uni, .ob-model button, .kit button {
  height: 28px; margin: 0; padding: 0 6px; cursor: pointer; font-size: 13px; font-weight: 400; color: var(--mute); background: none; border: 0; border-radius: 0;
}
.poly button:hover, .views button:hover, .pages-8 button:hover, .choruses button:hover, .uni:hover, .ob-model button:hover, .kit button:hover { color: var(--ink); }
.poly button[aria-checked="true"], .choruses button[aria-checked="true"], .uni[aria-pressed="true"], .ob-model [aria-checked="true"], .kit [aria-checked="true"] {
  color: var(--ink); box-shadow: inset 0 -2px 0 var(--c);
}
.ob-model button, .kit button { height: 34px; padding: 0 2px; font-size: 22px; letter-spacing: -.02em; margin-right: 12px; }
.poly-label, .ob-label { font-size: 12px; color: var(--mute); margin-right: 2px; }
/* a lit switch: a lamp and its name */
.ob-sw button, .card-btns button, .prog-groups button, .prog-progs button, .seg-loop, .seg-link {
  display: flex; align-items: center; gap: 5px; height: 24px; margin: 0; padding: 0 2px; cursor: pointer; white-space: nowrap;
  font-size: 11.5px; font-weight: 500; letter-spacing: .02em; color: var(--mute); background: none; border: 0;
}
.ob-sw button i, .card-btns button i, .prog-groups button i, .prog-progs button i, .seg-loop i, .seg-link i {
  flex: none; width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--mute);
}
.ob-sw button:hover, .card-btns button:hover, .prog-groups button:hover, .prog-progs button:hover, .seg-loop:hover, .seg-link:hover { color: var(--ink); }
.ob-sw button.lit, .card-btns button.lit, .prog-groups button.lit, .prog-progs button.lit, .seg-loop.lit, .seg-link.lit { color: var(--ink); }
.ob-sw button.lit i, .card-btns button.lit i, .prog-groups button.lit i, .prog-progs button.lit i, .seg-loop.lit i, .seg-link.lit i { background: var(--c); box-shadow: 0 0 8px var(--c); }
.prog-progs button:disabled { opacity: .3; cursor: default; }

/* the on/off switches: a word and a lamp */
.power {
  margin: 0; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0; cursor: pointer;
  font-size: 14px; font-weight: 400; color: var(--mute); background: none; border: 0;
}
.power i { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--mute); }
.power:hover { color: var(--ink); }
.power[aria-pressed="true"] { color: var(--ink); }
.power[aria-pressed="true"] i { background: var(--c, var(--voice)); box-shadow: 0 0 10px var(--c, var(--voice)); }
.mini {
  min-width: 32px; height: 32px; margin: 0; padding: 0 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 16px; font-weight: 400; color: var(--dim); background: none; border: 0; border-radius: 6px;
}
.mini.wide { font-size: 14px; padding: 0 6px; }
.mini svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.mini svg circle { fill: currentColor; stroke: none; }
.mini:hover { color: var(--ink); background: var(--raise); }

/* ---------- faders (synth.js builds them): drag, click one and use the arrow keys, or scroll ---------- */
.faders { display: flex; gap: 4px; min-width: 0; }
.fader { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 60px; flex: none; }
.f-track { position: relative; width: 40px; height: var(--fh); cursor: ns-resize; touch-action: none; outline: none; }
.f-track::before { /* a hairline */
  content: ""; position: absolute; left: 50%; top: 9px; bottom: 9px; width: 1px; translate: -50% 0;
  background: rgba(255, 255, 255, .2);
}
.f-fill { position: absolute; left: 50%; bottom: 9px; width: 1px; height: calc(var(--v, 0) * (100% - 18px)); translate: -50% 0; background: var(--c); }
.f-tick { position: absolute; left: 9px; width: 5px; height: 1px; background: var(--mute); }
.f-tick::after { content: ""; position: absolute; left: 17px; width: 5px; height: 1px; background: var(--mute); }
.f-cap, .f-mod { position: absolute; left: 50%; translate: -50% 50%; }
.f-cap { bottom: calc(9px + var(--v, 0) * (100% - 18px)); width: 20px; height: 5px; border-radius: 3px; background: var(--c); box-shadow: 0 0 0 3px var(--bg); }
.f-track:hover .f-cap { width: 24px; }
/* where Stages has really put it: a ring */
.f-mod { bottom: calc(9px + var(--m, 0) * (100% - 18px)); width: 26px; height: 11px; box-sizing: border-box; border: 1.5px solid var(--stages); border-radius: 6px; box-shadow: 0 0 8px rgba(183, 155, 242, .45); opacity: 0; }
.fader.modded .f-mod { opacity: 1; }
.f-track:focus-visible .f-cap, .fader.held .f-cap { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--c); }
.f-name { font-size: 12px; color: var(--mute); white-space: nowrap; }
.f-val { margin-top: -5px; font: 400 12px/1.2 var(--mono); color: var(--ink); white-space: nowrap; min-height: 1.2em; }
/* lying down: tempo, swing, drift, a Stages group's amount */
.fader.h { flex-direction: row; width: auto; gap: 12px; }
.fader.h .f-track { width: 120px; height: 32px; cursor: ew-resize; }
.fader.h .f-track::before { left: 9px; right: 9px; top: 50%; bottom: auto; width: auto; height: 1px; translate: 0 -50%; }
.fader.h .f-fill { left: 9px; top: 50%; bottom: auto; width: calc(var(--v, 0) * (100% - 18px)); height: 1px; translate: 0 -50%; }
.fader.h .f-cap { left: calc(9px + var(--v, 0) * (100% - 18px)); bottom: auto; top: 50%; width: 5px; height: 20px; translate: -50% -50%; }
.fader.h .f-name { order: -1; }
.fader.h .f-val { margin: 0; min-width: 4.4em; }
.fader.h .f-tick { display: none; }

/* ---------- the OB: its model, its programmer, its panel (sections, left to right) ---------- */
.programmer { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; }
.prog-groups, .prog-progs { display: flex; align-items: center; gap: 2px 8px; }
.prog-progs button, .prog-groups button { font-size: 13px; }
.patch { display: flex; gap: 4px; align-items: center; min-width: 220px; flex: 0 1 320px; }
.patch select { flex: 1; }
.ob-panel { min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.ob-model-panel { display: flex; gap: 0; min-width: max-content; }
.ob-sec { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 0 9px; border-left: 1px solid var(--edge); }
.ob-sec:first-child { padding-left: 6px; border-left: 0; }
.ob-sec h3 { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: .08em; color: var(--dim); white-space: nowrap; }
.ob-cols { display: flex; gap: 2px; flex: 1; }
.ob-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ob-col .faders { gap: 0; --fh: 112px; }
.ob-col .fader { width: 52px; }
.ob-sec.envelope .ob-col .fader { width: 46px; }
.ob-col .f-name { font-size: 10.5px; white-space: normal; text-align: center; line-height: 1.15; min-height: 2.3em; display: flex; align-items: flex-start; }
.ob-sw { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 54px; }
.ob-sw:empty { display: none; }
.ob-sw .ob-label { margin: 4px 0 0; font-size: 10px; letter-spacing: .06em; }
.ob-pick { display: flex; flex-direction: column; }
.ob-sw .ob-label + .ob-pick { flex-direction: row; gap: 6px; }

/* ---------- Rings ---------- */
.rings-body .faders { flex: 1; justify-content: space-between; max-width: 520px; }

/* ---------- the drums: a strip a card ---------- */
.drum-chans { display: flex; gap: 0; overflow-x: auto; scrollbar-width: thin; }
.card-strip { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 0 12px; border-left: 1px solid var(--edge); }
.card-strip:first-child { padding-left: 0; border-left: 0; }
.card-name { font-size: 11px; font-weight: 500; letter-spacing: .08em; color: var(--dim); white-space: nowrap; }
.card-btns { display: flex; flex-wrap: wrap; gap: 0 10px; min-height: 48px; align-content: flex-start; max-width: 160px; }
.card-strip .faders { gap: 0; --fh: 104px; }
.card-strip .fader { width: 46px; }

/* ---------- Stages: six segments, links between; each group's output under its segments ---------- */
.stages-head-row { display: flex; }
.segs, .stage-outs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr) auto) minmax(0, 1fr); column-gap: 6px; max-width: 1100px; }
.seg { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; border-top: 2px solid var(--edge); }
.seg[data-type="ramp"] { --sc: #8FD18A; } .seg[data-type="hold"] { --sc: #F07A6A; } .seg[data-type="step"] { --sc: #E8C94F; } /* (the module's lamps: green, red, yellow) */
.seg { border-top-color: color-mix(in srgb, var(--sc) 50%, transparent); }
.seg-type { margin: 0; height: 26px; padding: 0 8px; cursor: pointer; font-size: 14px; color: var(--ink); background: none; border: 0; box-shadow: inset 0 -2px 0 var(--sc); }
.seg .faders { gap: 0; --fh: 120px; }
.seg .fader { width: 58px; }
.seg-link { align-self: center; flex-direction: column; height: auto; gap: 4px; padding: 6px 0; font-size: 10.5px; }
.stage-outs { margin-top: 10px; row-gap: 8px; }
.stage-out { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 6px; min-width: 0; }
.out-name { width: 100%; font-size: 11px; color: var(--mute); }
.stage-out select { max-width: 100%; }
.out-amt .fader.h { gap: 8px; }
.out-amt .fader.h .f-track { width: 76px; }
.out-amt .fader.h .f-val { min-width: 3em; }
.page.stages .contour { display: block; width: 100%; max-width: 1100px; height: 70px; margin-top: 14px; background: var(--bg); }
#stages-drift .f-track { width: 90px; }

/* ---------- FX: the four effects in a row; under each, a slider for each instrument (one grid, so
   each slider sits under its effect) ---------- */
.fx-board {
  display: grid; grid-template-columns: 110px minmax(250px, 1fr) minmax(235px, .8fr) minmax(330px, 1.3fr) minmax(380px, 1.5fr);
  column-gap: 0; row-gap: 0; align-items: stretch; max-width: 1340px;
}
.fx-corner { grid-column: 1; grid-row: 1; }
.unit { display: flex; flex-direction: column; gap: 12px; padding: 0 20px 18px; border-left: 1px solid var(--edge); }
.unit.off .faders { opacity: .55; }
.unit-head { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; min-height: 34px; }
.unit-head h2 { margin: 0 4px 0 0; font-size: 22px; font-weight: 400; letter-spacing: -.02em; }
.unit-opts { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 14px; min-height: 30px; }
.unit .faders { margin-top: auto; }
.drive-types, .choruses { display: flex; align-items: center; gap: 2px; }
.drive-types button, .choruses button { height: 28px; margin: 0; padding: 0 6px; cursor: pointer; font-size: 14px; font-weight: 400; color: var(--mute); background: none; border: 0; }
.drive-types button:hover, .choruses button:hover { color: var(--ink); }
.drive-types button[aria-checked="true"], .choruses button[aria-checked="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--c); }
.choruses { margin-left: -6px; } .drive-types { margin-left: -6px; }
.fx-caption { grid-column: 2 / -1; margin: 0; padding: 14px 22px 8px; font-size: 12px; color: var(--mute); border-top: 1px solid var(--edge-2); border-left: 1px solid var(--edge); }
.fx-name { grid-column: 1; display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--edge); }
.fx-name::before { content: ""; width: 3px; align-self: stretch; border-radius: 2px; background: var(--c); opacity: .8; }
.fx-name[data-ch="ob"], .fx-send[data-ch="ob"] { --c: var(--ob); }
.fx-name[data-ch="rings"], .fx-send[data-ch="rings"] { --c: var(--rings); }
.fx-name[data-ch="drums"], .fx-send[data-ch="drums"] { --c: var(--drums); }
.fx-name b { font-size: 18px; font-weight: 400; letter-spacing: -.01em; color: var(--ink); }
.fx-send { display: flex; align-items: center; padding: 10px 22px; border-top: 1px solid var(--edge); border-left: 1px solid var(--edge); min-width: 0; }
.fx-send .fader.h { flex: 1; gap: 10px; min-width: 0; }
.fx-send .fader.h .f-track { flex: 1; width: auto; min-width: 80px; }
.fx-send .fader.h .f-name { display: none; }
.fx-send .fader.h .f-val { min-width: 3em; }

/* ---------- Mix: a strip a channel ---------- */
.strips { display: flex; gap: 0; flex-wrap: wrap; row-gap: 24px; }
.strip { --c: var(--rings); display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 0 32px; border-left: 1px solid var(--edge); }
.strip:first-child { padding-left: 0; border-left: 0; }
.strip[data-ch="ob"] { --c: var(--ob); } .strip[data-ch="drums"] { --c: var(--drums); }
.strip-head { display: flex; align-items: baseline; gap: 10px; }
.strip-head b { font-size: 20px; font-weight: 400; letter-spacing: -.01em; color: var(--ink); }
.mute { margin: 0 0 0 auto; height: 28px; padding: 0 4px; cursor: pointer; font-size: 13px; color: var(--mute); background: none; border: 0; }
.mute:hover { color: var(--ink); }
.mute[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 #F07A84; }
.strip.muted .faders { opacity: .4; }
.page.mix .faders { --fh: 200px; }
.meter { position: absolute; left: calc(50% + 7px); top: 9px; bottom: 9px; width: 3px; background: rgba(255, 255, 255, .06); pointer-events: none; }
.meter i { position: absolute; inset: 0; background: linear-gradient(to top, var(--c) 0 83%, #F07A84 83%); clip-path: inset(calc((1 - var(--lvl, 0)) * 100%) 0 0 0); }
.zero { position: absolute; left: calc(50% - 13px); width: 6px; height: 1px; bottom: calc(9px + 0.75 * (100% - 18px)); background: var(--mute); pointer-events: none; }

/* ---------- the playbar: what the OB, Rings or the drums are played with ---------- */
.playbar {
  --c: var(--voice); flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; padding: 8px 16px;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  border-top: 1px solid var(--edge);
}
.views { gap: 10px; }
.views button { font-size: 14px; padding: 0 2px; }
.views button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--voice); }
.rig[data-page="drums"] .views, .rig[data-page="drums"] .chord-pick { display: none; }
.rig[data-view="keys"] .chord-pick { display: none; }
.ctx { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.ctx b { min-width: 2.2em; text-align: center; font: 400 13px var(--mono); color: var(--ink); }
.ctx-label { font-size: 12px; color: var(--mute); }
.ctx-hint { color: var(--mute); white-space: nowrap; }
.ctx .power { margin-right: 8px; }
.ctx .seq-label { margin-right: -2px; }
.playbar .play { width: 34px; height: 34px; }
.playbar .play svg { width: 14px; height: 14px; }
/* a sequencer that's off: its steps dimmed (touch one and it's on) */
.rig.seq-off .seq, .rig.seq-off .grid .g-step { opacity: .45; }
.ctx .tempo .f-track { width: 100px; }
.pages-8 { display: none; }
.pages-8 button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--voice); }
kbd {
  display: inline-block; min-width: 1.5em; margin: 0 1px; padding: 0 4px; box-sizing: border-box; text-align: center;
  font: 400 11px/1.6 var(--mono); color: var(--ink); background: none; border: 1px solid var(--edge-2); border-radius: 4px;
}
@media (pointer: coarse) { .ctx-hint { display: none; } }

.surface { position: relative; flex: 1; min-height: 120px; border-top: 1px solid var(--edge); background: var(--bg); }
.seq, .pads, .keys {
  position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}

/* ---------- the sequencer: each step a line up to its note, over its button ---------- */
.seq { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.step { position: relative; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid rgba(255, 255, 255, .035); transition: opacity .2s; }
.step:nth-child(4n) { border-right-color: var(--edge); }
.step.out { opacity: .28; }
.step.now { background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .04)); }
.s-track { position: relative; flex: 1; min-height: 0; cursor: ns-resize; outline: none; }
.s-track:focus-visible { box-shadow: inset 0 0 0 1.5px var(--voice); }
.s-bar { /* the line, up to the note */
  position: absolute; left: calc(50% - 1px); width: 2px; bottom: 0; height: calc(var(--v, 0) * (100% - 30px) + 15px);
  background: color-mix(in srgb, var(--voice) 60%, transparent);
}
.s-cap { /* the note: a dot, its name above */
  position: absolute; left: 0; right: 0; bottom: calc(var(--v, 0) * (100% - 30px)); height: 30px; box-sizing: border-box;
  display: grid; place-items: center; padding-bottom: 24px; overflow: visible;
  font: 400 12px/8px var(--mono); white-space: nowrap; color: var(--dim);
}
.s-cap::after {
  content: ""; position: absolute; left: 50%; bottom: 15px; width: 9px; height: 9px; translate: -50% 50%; border-radius: 50%;
  background: var(--voice); box-shadow: 0 0 0 3px var(--bg);
}
.step.note .s-cap, .step.chord .s-cap { color: var(--ink); }
.step.chord .s-bar { background: color-mix(in srgb, var(--chord) 60%, transparent); }
.step.chord .s-cap::after { background: var(--chord); }
.step.off .s-bar { background: var(--edge-2); }
.step.off .s-cap { color: var(--mute); }
.step.off .s-cap::after { background: var(--bg); box-shadow: 0 0 0 3px var(--bg), inset 0 0 0 1.5px var(--mute); }
.step.now.note .s-cap::after { box-shadow: 0 0 0 3px var(--bg), 0 0 14px 2px var(--voice); }
.step.now.chord .s-cap::after { box-shadow: 0 0 0 3px var(--bg), 0 0 14px 2px var(--chord); }
.s-gate {
  flex: none; height: 46px; margin: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px; color: var(--mute); background: var(--bg); border: 0; border-top: 1px solid var(--edge);
}
.s-gate i { width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--mute); }
.step.note .s-gate i { background: color-mix(in srgb, var(--voice) 55%, transparent); box-shadow: none; }
.step.chord .s-gate i { background: color-mix(in srgb, var(--chord) 55%, transparent); box-shadow: none; }
.step.now.note .s-gate i { background: var(--voice); box-shadow: 0 0 10px var(--voice); }
.step.now.chord .s-gate i { background: var(--chord); box-shadow: 0 0 10px var(--chord); }
.step.now.off .s-gate i { box-shadow: inset 0 0 0 1px var(--ink); }
.s-gate:hover { color: var(--dim); }
/* repeats: how many times the step plays its note in its time (×1 is once) */
.s-rep {
  flex: none; height: 26px; margin: 0; padding: 0; cursor: pointer; display: grid; place-items: center;
  font: 400 11px var(--mono); color: #3B3942; background: var(--bg); border: 0; border-top: 1px solid var(--edge);
}
.s-rep:hover { color: var(--dim); }
.step.rep .s-rep { color: var(--voice); }
.step.rep.chord .s-rep { color: var(--chord); }
.step.rep.off .s-rep { color: var(--mute); }
/* fluctuate: its switch, under the step; behind the dot, how far it can wander; on each play, a
   ring where it went */
.s-fluct {
  flex: none; height: 28px; margin: 0; padding: 0; cursor: pointer; display: grid; place-items: center;
  color: #3B3942; background: var(--bg); border: 0; border-top: 1px solid var(--edge);
}
.s-fluct svg { width: 16px; height: 8px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.s-fluct:hover { color: var(--dim); }
.step.fluct .s-fluct { color: var(--voice); }
.step.fluct.chord .s-fluct { color: var(--chord); }
.step.fluct.off .s-fluct { color: var(--mute); }
.s-range {
  display: none; position: absolute; left: calc(50% - 4px); width: 8px; border-radius: 4px; pointer-events: none;
  bottom: calc(var(--lo, 0) * (100% - 30px) + 9px); height: calc((var(--hi, 0) - var(--lo, 0)) * (100% - 30px) + 12px);
  background: color-mix(in srgb, var(--voice) 12%, transparent);
}
.step.fluct:not(.off) .s-range { display: block; }
.step.chord .s-range { background: color-mix(in srgb, var(--chord) 12%, transparent); }
.s-ghost {
  position: absolute; left: 50%; bottom: calc(var(--g, 0) * (100% - 30px) + 15px); width: 11px; height: 11px; translate: -50% 50%;
  border-radius: 50%; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 1.5px var(--voice), 0 0 12px var(--voice);
}
.step.chord .s-ghost { box-shadow: inset 0 0 0 1.5px var(--chord), 0 0 12px var(--chord); }
.s-ghost.flash { animation: went 1s ease-out; }
@keyframes went { from { opacity: 1; } to { opacity: 0; } }

/* ---------- chord pads: a row for each octave, a pad for each degree of the scale ---------- */
.pads { display: grid; grid-auto-rows: minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.pad-row { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); min-height: 0; }
.pad {
  position: relative; overflow: hidden; margin: 0; padding: 8px 4px; cursor: pointer; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg); border: 0; border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge);
}
.pad b { font-size: clamp(17px, 2.2vw, 28px); font-weight: 300; letter-spacing: -.02em; white-space: nowrap; }
.pad small { font: 400 12px var(--mono); color: var(--mute); }
.pad kbd { position: absolute; left: 10px; top: 10px; opacity: .7; }
.pad:hover { background: #0E0E10; }
.pad.tonic b { color: var(--voice); }
.pad::after { /* struck: it lights, and fades as it rings */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(110% 80% at 50% 100%, color-mix(in srgb, var(--voice) 30%, transparent), transparent 70%);
}
.pad.hit::after { animation: ring 1.8s ease-out; }
.pad.down { background: var(--raise); }
@keyframes ring { from { opacity: 1; } to { opacity: 0; } }
@media (pointer: coarse) { .pad kbd { display: none; } }

/* ---------- the keys ---------- */
.key { position: absolute; top: 0; box-sizing: border-box; cursor: pointer; }
.key.w { bottom: 0; background: #0F0F11; border-right: 1px solid var(--edge); }
.key.w:hover { background: #141417; }
.key.b { z-index: 2; height: 60%; background: #050506; border: 1px solid var(--edge); border-top: 0; }
.key.w.down { background: #1A1A1E; }
.key.b.down { background: #141417; }
/* ringing: a line rising from the bottom, as tall as the note is loud (synth.js sets --glow) */
.key::after {
  content: ""; position: absolute; left: calc(50% - 1px); width: 2px; bottom: 40px; height: calc(var(--glow, 0) * 62%); pointer-events: none;
  background: linear-gradient(to top, var(--voice), color-mix(in srgb, var(--voice) 10%, transparent)); box-shadow: 0 0 12px color-mix(in srgb, var(--voice) 50%, transparent);
  opacity: min(1, calc(var(--glow, 0) * 1.4));
}
.key.b::after { bottom: 14px; height: calc(var(--glow, 0) * 70%); }
.key .lbl { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; pointer-events: none; font: 400 12px var(--mono); color: var(--mute); }
.key .lbl small { display: block; margin-top: 2px; font-size: 10px; color: #4E4B55; }
.key.b .lbl { bottom: 8px; font-size: 11px; color: #4E4B55; }
/* the notes in key: a dot; the key's own note: a lit one */
.key.in::before, .key.tonic::before {
  content: ""; position: absolute; left: 50%; top: 12px; width: 5px; height: 5px; translate: -50% 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 1px #57545E;
}
.key.tonic::before { width: 6px; height: 6px; background: var(--voice); box-shadow: 0 0 8px var(--voice); }

/* ---------- over the instrument: the cards ---------- */
.veil {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 14px; box-sizing: border-box;
  background: rgba(6, 6, 7, .78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); overflow: auto;
}
.card {
  box-sizing: border-box; width: min(500px, 100%); max-height: 100%; overflow: auto;
  padding: 26px 26px 22px; font-size: 14px; background: #0E0E10; border: 1px solid var(--edge-2); border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.card h2 { margin: 0 0 6px; font-size: 28px; font-weight: 400; letter-spacing: -.025em; color: var(--ink); }
.card .lede { margin: 0 0 20px; color: var(--dim); }
.hi { display: flex; gap: 8px; }
.hi input, .hi button, .big { height: 46px; margin: 0; border-radius: 8px; font-size: 15px; font-weight: 500; }
.hi input { flex: 1; min-width: 0; padding: 0 14px; color: var(--ink); background: var(--pit); border: 1px solid var(--edge-2); outline: none; }
.hi input:focus { border-color: rgba(255, 255, 255, .4); }
.hi input.bad { border-color: #F07A84; }
.hi button, .big { padding: 0 22px; cursor: pointer; color: var(--bg); background: var(--ink); border: 0; }
.hi button:hover, .big:hover { background: #fff; }
.big { display: block; width: 100%; }
.card.nudge { animation: nudge .4s ease-in-out; }
@keyframes nudge { 20% { translate: -7px 0 } 40% { translate: 6px 0 } 60% { translate: -4px 0 } 80% { translate: 2px 0 } }
.help { list-style: none; margin: 0 0 14px; padding: 0; font-size: 13px; }
.help li { padding: 9px 0; border-top: 1px solid var(--edge); color: var(--dim); }
.help li:first-child { border-top: 0; padding-top: 0; }
.help b { color: var(--ink); font-weight: 500; }
.help i { font-style: normal; color: var(--ink); }
.c-rings { color: var(--rings) !important; } .c-ob { color: var(--ob) !important; } .c-stages { color: var(--stages) !important; } .c-fx { color: var(--fx) !important; }
.credit { margin: 0 0 16px; font-size: 11px; color: var(--mute); }
.credit a { color: var(--dim); }
.no-audio { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 31; margin: 0; padding: 12px 14px; border-radius: 8px; font-size: 13px; background: var(--blood); }

/* =====================================================================================

/* ---------- the drums' pattern: a row a card, sixteen steps ---------- */
.grid { position: absolute; inset: 0; display: grid; grid-auto-rows: minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom); user-select: none; -webkit-user-select: none; touch-action: none; }
.g-row { display: grid; grid-template-columns: 150px repeat(16, minmax(0, 1fr)); min-height: 0; border-bottom: 1px solid var(--edge); }
.g-head {
  position: relative; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 10px; cursor: pointer; min-width: 0; text-align: left;
  color: var(--dim); background: var(--bg); border: 0; border-right: 1px solid var(--edge);
}
.g-head kbd { flex: none; opacity: .7; }
.g-head b { font-size: 12px; font-weight: 500; letter-spacing: .04em; white-space: nowrap; }
.g-head small { margin-left: auto; font-size: 11px; color: var(--drums); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-head:hover { color: var(--ink); }
.g-head::after { content: ""; position: absolute; inset: 0; background: var(--drums); opacity: 0; pointer-events: none; }
.g-head.hit::after { animation: ring 0.5s ease-out; }
.g-step {
  position: relative; margin: 0; padding: 0; min-width: 0; cursor: pointer; display: grid; place-items: center;
  font: 500 11px var(--mono); color: var(--bg); background: transparent; border: 0; border-right: 1px solid rgba(255, 255, 255, .035);
}
.g-step.beat { border-left: 1px solid var(--edge); }
.g-step::before { content: ""; position: absolute; inset: 5px 4px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--edge-2); }
.g-step.on::before { box-shadow: none; background: var(--drums); }
.g-step.v1::before { opacity: .45; } .g-step.v2::before { opacity: .72; }
.g-step span, .g-step { z-index: 0; }
.g-step.on { color: #111; }
.g-step:hover::before { box-shadow: inset 0 0 0 1px var(--dim); }
.g-step.now { background: rgba(255, 255, 255, .05); }
.g-step.now.on::before { box-shadow: 0 0 14px var(--drums); }
.g-step.out { opacity: .3; }
.g-step:focus-visible { outline-offset: -3px; }
.g-step { isolation: isolate; }
.g-step::before { z-index: -1; }

/* =====================================================================================
   narrower: the OB's panel and the drum cards scroll sideways; the transport under the tabs
   ===================================================================================== */
@media (min-width: 641px) and (max-width: 1199px) { .page.fx { overflow-x: auto; } .fx-board { min-width: 1200px; } } /* (between: it scrolls sideways) */
@media (max-width: 1199px) {
  .navbar { padding-top: 2px; }
  .transport { gap: 8px 14px; }
}
/* narrow: tighter, the sequencers and the pattern eight steps at a time */
@media (max-width: 640px) {
  :root { --fh: 96px; }
  .topbar { height: 54px; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .logo { font-size: 17px; }
  .bar-right { gap: 8px; }
  .menu-btn { padding: 0 11px; }
  .midi { padding: 0 10px; }
  .midi span { display: none; }
  .inbox-panel, .menu { position: fixed; left: 12px; right: 12px; top: 62px; width: auto; min-width: 0; max-width: none; }
  .navbar { padding: 0 12px; gap: 0 12px; }
  .pages { gap: 14px; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .pg { font-size: 15px; padding: 11px 0 9px; }
  .transport { width: 100%; gap: 8px 10px; padding: 6px 0 8px; flex-wrap: nowrap; }
  .transport .tempo { flex: 1; min-width: 0; }
  .transport .fader.h { flex: 1; min-width: 0; gap: 8px; }
  .transport .fader.h .f-track { flex: 1; width: auto; min-width: 60px; }
  .transport .fader.h .f-name { display: none; }
  .transport .fader.h .f-val { min-width: 0; }
  .pick > span { display: none; }
  .pick select { max-width: 104px; }
  .page { padding: 10px 12px 8px; }
  .rig.playable .page { max-height: 52%; overflow: auto; }
  .page-head { gap: 6px 12px; margin-bottom: 8px; }
  .page-head h2, .ob-model button, .kit button { font-size: 19px; }
  .what { display: none; }
  .page-body { gap: 12px; }
  .rings-body { flex-direction: column; align-items: stretch; }
  .models { grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .models button { padding: 9px 0; }
  .faders { justify-content: space-between; }
  .fader { width: 54px; }
  .patch { flex: 1 1 100%; }
  .playbar { gap: 6px 12px; padding: 6px 12px; }
  .ctx { flex-wrap: wrap; row-gap: 2px; }
  .ctx-label { display: none; }
  .ctx .seq-label { display: inline; } /* (this one says what the switch is) */
  .pages-8 { display: flex; }
  .pages-8 button { white-space: nowrap; }
  .poly button, .views button, .pages-8 button, .uni { height: 36px; }
  .strip, .unit { padding: 0 16px; }
  .fx-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fx-board .unit, .fx-caption { grid-column: 1 / -1; padding: 0 0 16px; border-left: 0; }
  .fx-caption { padding-top: 12px; }
  .fx-name { grid-column: 1 / -1; }
  .fx-send { flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0; border-left: 0; }
  .fx-send:nth-of-type(odd) { padding-right: 8px; }
  .fx-send::before { content: attr(data-label); font-size: 11px; color: var(--mute); }
  .fx-send .fader.h .f-track { min-width: 50px; }
  .segs, .stage-outs { column-gap: 2px; }
  .seg .fader { width: 46px; }
  .seg-link { font-size: 0; gap: 0; }
  /* the sequencer and the pattern: a page of eight at a time */
  .seq { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .seq:not(.page2) .step:nth-child(n + 9), .seq.page2 .step:nth-child(-n + 8) { display: none; }
  .g-row { grid-template-columns: 74px repeat(8, minmax(0, 1fr)); }
  .grid:not(.page2) .g-step:nth-child(n + 10), .grid.page2 .g-step:nth-child(-n + 9):not(.g-head) { display: none; }
  .g-head { padding: 0 6px; }
  .g-head kbd, .g-head small { display: none; }
  .s-gate { height: 40px; }
  .s-fluct, .s-rep { height: 30px; }
  .s-cap { font-size: 11px; }
}
@media (max-width: 420px) {
  .transport { flex-wrap: wrap; }
  .transport .tempo { flex: 1 1 calc(100% - 52px); }
  .transport .pick { flex: 1; }
  .transport .pick select { width: 100%; max-width: none; }
}
/* short (a phone on its side): everything smaller, so there's room to play */
@media (max-height: 560px) {
  :root { --fh: 70px; }
  .topbar { height: 46px; }
  .logo { font-size: 15px; }
  .inbox-panel, .menu { top: calc(100% + 6px); }
  .pg { padding: 8px 0 6px; }
  .page { padding-top: 6px; }
  .page-head { margin-bottom: 4px; min-height: 26px; }
  .rig.playable .page { max-height: 48%; overflow: auto; }
  .fader { gap: 4px; }
  .f-val { font-size: 11px; }
  .s-gate { height: 30px; }
  .s-fluct, .s-rep { height: 22px; }
}
