/* Thumpkin. A night stage of glowing pads, and warm paper controls beside it.
   Sundry Mill palette: night ink, cream paper, the three sunrise oranges. */

@font-face {
  font-family: 'Satoshi';
  src: url('fonts/Satoshi-Variable.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'Departure Mono';
  src: url('fonts/DepartureMono-Regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/InstrumentSerif-Italic.ttf') format('truetype');
  font-style: italic;
  font-display: swap;
}

:root {
  --night: #0B1120;
  --night-2: #141E33;
  --night-3: #1D2A47;
  --night-line: rgba(253, 249, 241, 0.08);
  --cream: #FDF9F1;
  --paper: #F6EBD9;
  --paper-2: #EEDDC3;
  --type: #17202C;
  --type-soft: rgba(23, 32, 44, 0.62);
  --sun-pale: #FFDD9B;
  --sun: #FFB23F;
  --sun-hot: #FF7A2F;
  --c0: #FF7A2F;
  --c1: #FFB23F;
  --c2: #FFE3A8;
  --c3: #FF8FA3;
  --c4: #7DD3B0;
  --c5: #8FA8FF;
  --c6: #C9A2FF;
  --radius: 14px;
  --sans: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Departure Mono', ui-monospace, 'Cascadia Mono', monospace;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --transport-h: 76px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night-2); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 85% -120px, rgba(255, 140, 50, 0.22), transparent 70%),
    linear-gradient(180deg, var(--night) 0, var(--night-2) 900px, var(--night-2) 100%);
  background-color: var(--night);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  padding-bottom: calc(var(--transport-h) + 24px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 6px;
  max-width: 1400px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 6px; color: var(--cream); text-decoration: none; flex: none; }
.brand .mill { width: 34px; height: 34px; fill: var(--cream); }
.mill-hub { fill: var(--sun-hot); }
.mill-sails { transform-origin: 0 0; transition: transform 0.25s cubic-bezier(.3,1.6,.5,1); }
.word { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1; letter-spacing: -0.01em; }
.title-field { flex: 1; min-width: 0; }
.title-field input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(253, 249, 241, 0.25);
  padding: 6px 2px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--sun-pale);
}
.title-field input::placeholder { color: rgba(253, 249, 241, 0.35); }
.title-field input:focus { outline: none; border-bottom-color: var(--sun); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--type);
  background: var(--cream);
  color: var(--type);
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--type);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--type); }
.btn.primary { background: var(--sun); }
.btn.big { min-height: 54px; font-size: 17px; width: 100%; }
.btn.ghost {
  background: transparent;
  color: var(--cream);
  border-color: rgba(253, 249, 241, 0.35);
  box-shadow: none;
  min-height: 38px;
  padding: 6px 12px;
}
.btn.ghost svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------- layout ---------- */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

/* ---------- starters ---------- */
.starters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px 12px;
  margin: 0 -12px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.starters::-webkit-scrollbar { display: none; }
.starter {
  flex: none;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px 9px 11px;
  border-radius: 999px;
  border: 1.5px solid rgba(253, 249, 241, 0.18);
  background: rgba(253, 249, 241, 0.05);
  font-weight: 650;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.starter:active { transform: scale(0.96); }
.starter .swatch { width: 14px; height: 14px; border-radius: 5px; background: var(--sw, var(--sun)); transform: rotate(12deg); }
.starter[aria-pressed="true"] { background: var(--cream); color: var(--type); border-color: var(--cream); }
.starter.dice { border-style: dashed; }
.starter.dice .swatch { background: conic-gradient(var(--c0), var(--c2), var(--c4), var(--c5), var(--c6), var(--c3), var(--c0)); border-radius: 50%; }

/* ---------- the stage ---------- */
.stage {
  --gutter: 26px;
  --gap: 5px;
  background: linear-gradient(180deg, rgba(29, 42, 71, 0.65), rgba(14, 22, 40, 0.65));
  border: 1px solid var(--night-line);
  border-radius: 24px;
  padding: 12px 10px 10px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(253, 249, 241, 0.06);
}
.pads, .grid-row {
  display: grid;
  grid-template-columns: var(--gutter) repeat(7, minmax(0, 1fr));
  gap: var(--gap);
}
.pads { margin-bottom: 10px; }
.pads::before { content: ''; }
.pad {
  --c: var(--sun);
  position: relative;
  aspect-ratio: 1 / 1.05;
  border-radius: 14px;
  border: 0;
  background: color-mix(in srgb, var(--c) 24%, var(--night-3));
  color: var(--cream);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0 7px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.06s;
}
.pad .glyph {
  position: absolute;
  top: 18%;
  left: 50%;
  width: 34%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent);
}
.pad[data-row="1"] .glyph, .pad[data-row="3"] .glyph { border-radius: 6px; transform: translateX(-50%) rotate(45deg); width: 28%; }
.pad[data-row="2"] .glyph, .pad[data-row="4"] .glyph { border-radius: 3px; width: 26%; top: 22%; }
.pad[data-row="5"] .glyph, .pad[data-row="6"] .glyph { border-radius: 40% 40% 12px 12px; }
.pad.muted { opacity: 0.4; }
.pad.muted .glyph { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.pad:active { transform: scale(0.95); }
.pad.lit { background: var(--c); color: var(--type); box-shadow: 0 0 28px color-mix(in srgb, var(--c) 70%, transparent), inset 0 -4px 0 rgba(0, 0, 0, 0.18); }
.pad.lit .glyph { background: var(--type); box-shadow: none; }

.grid { display: grid; gap: var(--gap); }
.grid-row .num {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(253, 249, 241, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.grid-row:nth-child(4n + 1) .num { color: rgba(253, 249, 241, 0.75); }
.grid-row.beat-gap { margin-top: 4px; }
.cell {
  --c: var(--sun);
  height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: rgba(253, 249, 241, 0.045);
  box-shadow: inset 0 0 0 1px rgba(253, 249, 241, 0.03);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--type);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  transition: background 0.12s, transform 0.08s;
}
.grid-row:nth-child(4n + 1) .cell:not(.on) { background: rgba(253, 249, 241, 0.075); }
.cell.on {
  background: color-mix(in srgb, var(--c) 82%, var(--night));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.cell.accent { background: var(--c); }
.cell.accent::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--type);
  opacity: 0.6;
}
.cell.muted.on { opacity: 0.35; }
.grid-row.now .num { color: var(--sun); }
.grid-row.now .cell:not(.on) { background: rgba(253, 249, 241, 0.14); }
.grid-row.now .cell.on { filter: brightness(1.18); }
.hint { margin: 10px 4px 2px; font-size: 12.5px; color: rgba(253, 249, 241, 0.5); }

/* ---------- transport ---------- */
.transport {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
  height: var(--transport-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: 22px;
  background: var(--paper);
  color: var(--type);
  border: 1.5px solid var(--type);
  box-shadow: 0 4px 0 var(--type), 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}
.play {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--type);
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.4);
}
.play svg { width: 46px; height: 46px; }
.play .sails { fill: var(--sun); transform-origin: 0 0; }
.play .hub { fill: var(--cream); }
.play[aria-pressed="true"] { background: var(--sun-hot); }
.play[aria-pressed="true"] .sails { fill: var(--cream); }
.play[aria-pressed="true"] .hub { fill: var(--type); }
.tempo { display: flex; align-items: center; gap: 2px; }
.nudge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--type);
  background: var(--cream);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.nudge.small { width: 28px; height: 28px; }
.bpm { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.bpm input {
  width: 3.2ch;
  border: 0;
  background: transparent;
  text-align: center;
  font-family: var(--mono);
  font-size: 22px;
  color: var(--type);
  -moz-appearance: textfield;
  appearance: textfield;
  padding: 0;
}
.bpm input::-webkit-inner-spin-button, .bpm input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bpm span { font-family: var(--mono); font-size: 9px; color: var(--type-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.swing { flex: 1; min-width: 60px; display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--type-soft); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--track, var(--sun)) var(--fill, 0%), rgba(23, 32, 44, 0.14) var(--fill, 0%)); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 99px; background: rgba(23, 32, 44, 0.14); }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--track, var(--sun)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%; background: var(--cream); border: 2px solid var(--type); box-shadow: 0 2px 0 var(--type); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--cream); border: 2px solid var(--type); }
.ab, .seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(23, 32, 44, 0.08);
  border: 1.5px solid var(--type);
}
.ab button, .seg button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  min-width: 34px;
  min-height: 32px;
  padding: 4px 10px;
  font-weight: 700;
  color: var(--type);
}
.ab button { font-family: var(--mono); }
.ab button[aria-checked="true"], .seg button[aria-checked="true"] { background: var(--type); color: var(--cream); }
.chain-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--type);
  border-radius: 999px;
  background: var(--cream);
  min-height: 38px;
  padding: 4px 12px 4px 10px;
  font-weight: 700;
  color: var(--type);
}
.chain-toggle.in-panel { display: inline-flex; margin-bottom: 12px; }
.chain-toggle .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--type); }
.chain-toggle[aria-pressed="true"] { background: var(--sun); }
.chain-toggle[aria-pressed="true"] .dot { background: var(--type); }

/* ---------- panels ---------- */
.panels { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(253, 249, 241, 0.06);
  border-radius: 999px;
  padding: 4px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 9px 10px;
  font-weight: 650;
  color: rgba(253, 249, 241, 0.7);
  white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: var(--cream); color: var(--type); }
.tabs .tab-make { color: var(--sun); }
.panel {
  background: var(--paper);
  color: var(--type);
  border-radius: 22px;
  padding: 16px;
  border: 1.5px solid var(--type);
  box-shadow: 0 4px 0 var(--type);
  background-image: radial-gradient(rgba(23, 32, 44, 0.05) 1px, transparent 1.2px);
  background-size: 14px 14px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel h2 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 30px; line-height: 1; }
.panel h3.sub { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--type-soft); margin: 16px 0 8px; }
.note { margin: 0 0 12px; color: var(--type-soft); font-size: 14px; }

/* notes / piano roll */
.roll-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.voices { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--type);
  background: var(--cream);
  border-radius: 999px;
  padding: 5px 12px;
  min-height: 34px;
  font-weight: 650;
  font-size: 13.5px;
  color: var(--type);
}
.chip[aria-checked="true"] { background: var(--type); color: var(--cream); }
.oct { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; }
.roll { display: grid; gap: 3px; }
.roll-row { display: grid; grid-template-columns: 26px repeat(8, minmax(0, 1fr)); gap: 3px; }
.roll-row.head span { font-family: var(--mono); font-size: 11px; text-align: center; color: var(--type-soft); padding-bottom: 2px; }
.roll-row .num { font-family: var(--mono); font-size: 11px; color: var(--type-soft); display: flex; align-items: center; justify-content: center; }
.roll-row:nth-child(4n + 2) .num { color: var(--type); }
.key {
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: rgba(23, 32, 44, 0.07);
  padding: 0;
  touch-action: manipulation;
}
.key.root { background: rgba(23, 32, 44, 0.12); }
.key.on { background: var(--c); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.roll-row.now .key:not(.on) { background: rgba(255, 178, 63, 0.3); }

/* mixer */
.mixer { display: grid; gap: 8px; }
.strip { display: grid; grid-template-columns: 14px 54px 44px 1fr 34px; align-items: center; gap: 10px; }
.strip .sw { width: 14px; height: 14px; border-radius: 5px; background: var(--c); transform: rotate(12deg); }
.strip .name { font-weight: 700; font-size: 14px; }
.strip .mute {
  border: 1.5px solid var(--type);
  border-radius: 8px;
  background: var(--cream);
  font-family: var(--mono);
  font-size: 11px;
  min-height: 30px;
  padding: 0;
  color: var(--type);
}
.strip .mute[aria-pressed="true"] { background: var(--type); color: var(--cream); }
.strip input[type="range"] { --track: var(--c); }
.strip output { font-family: var(--mono); font-size: 12px; text-align: right; }

/* sound */
.kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.kit {
  text-align: left;
  border: 1.5px solid var(--type);
  background: var(--cream);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--type);
}
.kit strong { font-size: 15px; }
.kit small { font-size: 12px; color: var(--type-soft); line-height: 1.3; }
.kit .tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sun-hot); }
.kit[aria-checked="true"] { background: var(--type); color: var(--cream); }
.kit[aria-checked="true"] small { color: rgba(253, 249, 241, 0.7); }
.kit[aria-checked="true"] .tag { color: var(--sun); }
.keyrow { display: flex; gap: 8px; }
.select select {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--type);
  border-radius: 12px;
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2317202C' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding: 9px 34px 9px 12px;
  font-weight: 650;
  color: var(--type);
  min-height: 42px;
}

/* song */
.chain { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.slot {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--type);
  background: var(--cream);
  font-family: var(--mono);
  font-size: 16px;
  color: var(--type);
}
.slot.b { background: var(--c6); }
.slot.now { box-shadow: 0 0 0 3px var(--sun); }
.chain-tools, .pattern-tools, .save-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.saved { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.saved li { display: flex; align-items: center; gap: 8px; background: var(--cream); border: 1.5px solid var(--type); border-radius: 12px; padding: 6px 6px 6px 12px; }
.saved .nm { flex: 1; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved .when { font-family: var(--mono); font-size: 10.5px; color: var(--type-soft); }
.saved button { border: 0; background: transparent; font-weight: 700; padding: 6px 8px; border-radius: 8px; color: var(--type); }
.saved button.load { background: var(--sun); }
.saved .empty { color: var(--type-soft); font-size: 14px; }

/* video */
.make-body { display: grid; grid-template-columns: 1fr; gap: 14px; }
.preview-wrap {
  justify-self: center;
  width: min(100%, 230px);
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid var(--type);
  box-shadow: 0 4px 0 var(--type);
  background: var(--night);
}
#preview { width: 100%; height: 100%; display: block; }
.make-side { display: flex; flex-direction: column; gap: 10px; }
.lengths { align-self: flex-start; }
.progress .bar { height: 12px; border-radius: 99px; background: rgba(23, 32, 44, 0.12); overflow: hidden; border: 1.5px solid var(--type); }
.progress .bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--sun-pale), var(--sun), var(--sun-hot)); transition: width 0.2s; }
.progress p { margin: 6px 0 0; font-family: var(--mono); font-size: 12px; }
.warn { margin: 0; padding: 10px 12px; border-radius: 12px; background: #FFE0D1; border: 1.5px solid var(--sun-hot); font-size: 14px; }
.result video { width: min(100%, 230px); aspect-ratio: 9 / 16; border-radius: 14px; background: var(--night); border: 1.5px solid var(--type); display: block; }
.result-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* footer and toast */
.foot { max-width: 1400px; margin: 24px auto 0; padding: 0 16px; color: rgba(253, 249, 241, 0.5); font-size: 13px; }
.foot a { color: var(--sun-pale); }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--transport-h) + 26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--cream);
  color: var(--type);
  border: 1.5px solid var(--type);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 30;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- wider phones and tablets ---------- */
@media (min-width: 420px) {
  .chain-toggle { display: inline-flex; }
}
@media (max-width: 380px) {
  .swing { display: none; }
}

/* ---------- desktop ---------- */
@media (min-width: 960px) {
  body { padding-bottom: 32px; }
  .top { padding: 18px 24px 8px; }
  .layout {
    padding: 0 24px;
    grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
    grid-template-areas: "stage transport" "stage panels";
    grid-template-rows: auto 1fr;
    column-gap: 24px;
    row-gap: 14px;
    align-items: start;
  }
  .stage-col { grid-area: stage; position: sticky; top: 12px; }
  .starters { margin: 0; padding: 4px 0 12px; flex-wrap: wrap; overflow: visible; }
  .transport { grid-area: transport; position: sticky; top: 12px; left: auto; right: auto; bottom: auto; }
  .panels { grid-area: panels; }
  .cell { height: 30px; }
  .stage { --gutter: 30px; }
  .toast { bottom: 32px; }
  .chain-toggle { display: inline-flex; }
}
@media (min-width: 1240px) {
  .tabs { display: none; }
  .panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "notes make" "mix make" "sound song";
    gap: 14px;
    align-items: start;
  }
  .panel[hidden] { display: block !important; }
  #panel-notes { grid-area: notes; }
  #panel-mix { grid-area: mix; }
  #panel-make { grid-area: make; }
  #panel-sound { grid-area: sound; }
  #panel-song { grid-area: song; }
  .make-body { grid-template-columns: 1fr; }
  .preview-wrap { width: min(100%, 270px); }
}

@media (prefers-reduced-motion: reduce) {
  .mill-sails, .btn, .pad, .cell { transition: none; }
}
