:root {
  --head-w: 260px;
  --row-h: 76px;
  --bg: #14161a;
  --bg-raised: #1c1f26;
  --bg-lane: #101216;
  --line: #2a2f39;
  --text: #e6e9ef;
  --text-dim: #8b93a3;
  --accent: #4cc9f0;
  --accent-dim: #2b7f96;
  --danger: #e5576b;
  --solo: #f2c14e;
  --mute: #ff7a59;
  --hq: #3ddc84;
  --radius: 6px;
  --key: #1e222a;
  --key-hover: #252a34;
  --key-edge: #2c323d;
  --well: #0c0e12;
}

* { box-sizing: border-box; }

/* Author `display` rules outrank the UA's [hidden] rule at equal specificity. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  --lamp: var(--accent);
  --legend: #041016;
  font: inherit;
  color: var(--text);
  background: var(--key);
  border: 1px solid var(--key-edge);
  border-radius: var(--radius);
  padding: 5px 10px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 0 rgba(0, 0, 0, .45);
}
/* :where() keeps these at a bare element's weight, so an engaged key's lamp
   outranks hovering or pressing it without an !important. */
button:where(:hover:not(:disabled)) { border-color: #3c4454; background: var(--key-hover); }
button:where(:active:not(:disabled)) {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
}
button:disabled { opacity: .4; cursor: default; }
button.primary { color: var(--accent); }

button[aria-pressed="true"],
#btn-play[data-state="playing"],
#btn-hq.lit {
  background: var(--lamp);
  border-color: var(--lamp);
  color: var(--legend);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 0 0 1px var(--lamp),
    0 0 12px color-mix(in srgb, var(--lamp) 35%, transparent);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease; }
}

/* WebKit has no progress pseudo-element: the fill is a gradient stop at `--fill`
   (0..1), written by fill() in ui/dom.js. 5px and 10px are half and all of the cap. */
input[type="range"] {
  --fill: 0;
  --fill-color: var(--accent);
  --cap: linear-gradient(to right, transparent 4px, #454b57 4px 6px, transparent 6px), linear-gradient(#e6eaf0, #b8bfcb);
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]:disabled { opacity: .4; cursor: default; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right,
    var(--fill-color) 0 calc(5px + (100% - 10px) * var(--fill)),
    var(--well) 0);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .04);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 18px;
  margin-top: -7px;
  border: 0;
  border-radius: 2px;
  background: var(--cap);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .6);
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--well);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .04);
}
input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--fill-color);
}
input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 18px;
  border: 0;
  border-radius: 2px;
  background: var(--cap);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
}

.brand {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.transport { display: flex; }
.transport button {
  position: relative;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  margin-left: -1px;
  border-radius: 0;
}
.transport button:first-child { margin-left: 0; border-radius: var(--radius) 0 0 var(--radius); }
.transport button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
/* Above its neighbours, or they paint over its edge, its glow and its focus ring. */
.transport button:hover,
.transport button:focus-visible,
.transport button[aria-pressed="true"],
.transport button[data-state="playing"] { z-index: 1; }
#btn-play { min-width: 52px; }
/* Inline SVG: media-control glyphs are tofu without an emoji font installed. */
.transport svg { width: 14px; height: 14px; fill: currentColor; display: block; }

.clock {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-dim);
}
.clock #time-now { color: var(--text); }
.clock .sep { margin: 0 6px; }

.master {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 200px;
  color: var(--text-dim);
}

.speed {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 170px;
  color: var(--text-dim);
}
/* A flex item shrinks without limit; below this a fader has no room for a thumb. */
.master input[type="range"],
.speed input[type="range"] { min-width: 44px; }

.pitch {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 264px;
  color: var(--text-dim);
}
.pitch button {
  min-width: 26px;
  padding: 5px 0;
  line-height: 1;
}
#pitch-cents { width: 54px; min-width: 40px; }

/* Fixed widths, so a changing number does not shove the topbar. "-12 st" is the widest. */
#speed-value,
#pitch-value,
#pitch-cents-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
#speed-value { min-width: 4ch; }

/* The right padding is the spinner's room, kept while it is hidden so a load
   does not shove the bar sideways. */
.hq {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding-right: 18px;
}
#btn-hq { --lamp: var(--hq); --legend: #04160c; padding: 5px 8px; font-weight: 600; letter-spacing: .04em; }
/* Nothing to render, but not greyed out. The id and class outrank `button:disabled`. */
#btn-hq.lit { opacity: 1; }
/* A drawn chevron: the native arrow cannot be coloured. 22ch holds "100% +12 st -50¢ HQ". */
#hq-select,
.split select {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  color: var(--text);
  background: var(--key) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b93a3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 10px 6px;
  border: 1px solid var(--key-edge);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 0 rgba(0, 0, 0, .45);
  padding: 5px 24px 5px 8px;
  width: 22ch;
  cursor: pointer;
}
#hq-select:hover:not(:disabled),
.split select:hover:not(:disabled) { border-color: #3c4454; background-color: var(--key-hover); }
#hq-select:disabled,
.split select:disabled { opacity: .4; cursor: default; }
#hq-select option,
.split select option { background: var(--bg-raised); color: var(--text); }

.spinner {
  position: absolute;
  right: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid var(--line);
  border-top-color: var(--hq);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.spinner-inline {
  position: static;
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 12px;
  border-top-color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-color: var(--hq); border-right-color: var(--line); }
  .spinner.spinner-inline { border-color: var(--accent); border-right-color: var(--line); }
}
#pitch-value { min-width: 6ch; }
#pitch-cents-value { min-width: 5ch; }

.topbar-actions { margin-left: auto; display: flex; gap: 6px; }
/* The narrow-viewport rule wraps the bar, not the labels. */
.topbar-actions button { white-space: nowrap; }

#workspace {
  position: relative;
  flex: 1;
  overflow: auto;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 36px 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.dropzone-inner { text-align: center; color: var(--text-dim); }
.dropzone-inner h2 { margin: 0 0 6px; font-size: 18px; font-weight: 500; color: var(--text); }
.dropzone-inner p { margin: 0 0 14px; }
/* The dropzone's footprint exactly, so the home screen does not jump. */
.creating {
  display: grid;
  place-content: center;
  min-height: 160px;
  padding: 36px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  color: var(--text-dim);
}
.creating h2 { margin: 0 0 6px; font-size: 18px; font-weight: 500; color: var(--text); }
.creating p { margin: 0; min-height: 1.4em; overflow-wrap: anywhere; }
.creating progress {
  justify-self: center;
  width: min(320px, 100%);
  height: 6px;
  margin-top: 12px;
  accent-color: var(--accent);
}
.creating button { justify-self: center; margin-top: 12px; }

.home-drops { display: grid; gap: 12px; }
@media (min-width: 760px) {
  .home-drops:has(> .split:not([hidden])) { grid-template-columns: 1fr 1fr; }
}
.home-drops > .creating { grid-column: 1 / -1; }
.home-drops.busy > .split { display: none; }

.split {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 160px;
  padding: 20px 18px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--text-dim);
}
.split h2 { margin: 0; font-size: 18px; font-weight: 500; color: var(--text); }
.split p { margin: 0; }
.split-reason { color: var(--mute); }
.split-device { font-size: 12px; }
.split-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.split-quality { display: flex; align-items: center; gap: 6px; }
.split select { width: auto; }
.split-settings summary { cursor: pointer; color: var(--text-dim); width: max-content; }
.split-settings[open] summary { margin-bottom: 8px; }
.split-levers { display: grid; gap: 8px; margin-bottom: 8px; }
.lever {
  display: grid;
  grid-template-columns: 17ch 1fr 5ch;
  align-items: center;
  gap: 8px;
}
.lever output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.lever input[type="checkbox"] { justify-self: start; accent-color: var(--accent); }
.lever select { grid-column: 2 / -1; justify-self: start; }
.split-cost { font-size: 12px; min-height: 1.4em; }
/* Raised through the veil during a drag, as a second place to let go. */
body.dragging .split:not([hidden]) { position: relative; z-index: 51; background: var(--bg); }
.split.drag-over { border-color: var(--accent); border-style: solid; }

.drop-veil {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(20, 22, 26, .82);
  border: 2px dashed var(--accent);
  color: var(--accent);
  font-size: 18px;
  z-index: 50;
  pointer-events: none;
}

.mixer { position: relative; }

.row {
  display: grid;
  grid-template-columns: var(--head-w) 1fr;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.head {
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: var(--bg-raised);
  min-width: 0;
}

.lane {
  position: relative;
  background: var(--bg-lane);
  min-width: 0;
}
/* Absolute, so the canvas takes its size from the lane rather than feeding its
   intrinsic height back into the grid row. */
.lane canvas {
  position: absolute;
  top: 0;
  left: 0;
  /* An abspos replaced element ignores right/bottom and falls back to 300x150. */
  width: 100%;
  height: 100%;
  display: block;
}

/* Below the overlay, so the ruler lane is part of the timeline's hit area. */
.ruler-row { height: 30px; position: sticky; top: 0; z-index: 20; }
.ruler-row .head { display: flex; align-items: center; padding: 0 10px; }
.head-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.track { height: var(--row-h); }
.track.pending .lane { background: repeating-linear-gradient(45deg, #101216, #101216 8px, #14171d 8px, #14171d 16px); }
.track.pending .head { opacity: .65; }

/* A pending head is already faded, so it ghosts less rather than into nothing. */
.track { --dim: 1; }
.track.silent { --dim: .3; }
.track.pending.silent { --dim: .55; }
.track .track-name,
.track .track-volume,
.track .lane canvas {
  opacity: var(--dim);
  transition: opacity .15s ease, filter .15s ease;
}
.track.silent .lane canvas { filter: saturate(.25); }

.track.excluded { --dim: .3; }
.track.excluded .lane canvas { filter: saturate(.25); }

.track .head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px 8px;
  align-content: center;
}

.track-name {
  grid-column: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-name small {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-buttons { grid-column: 2; display: flex; align-items: start; gap: 4px; }
.track-buttons button { padding: 3px 7px; font-size: 11px; }
.track-buttons .mute { --lamp: var(--mute); --legend: #200a03; }
.track-buttons .solo { --lamp: var(--solo); --legend: #241c05; }

.track-volume { grid-column: 1; }

/* Transparent rather than hidden, to keep its place in the tab order. */
.track .remove {
  grid-column: 2;
  align-self: end;
  justify-self: end;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  transition: opacity .12s ease;
}
.track:hover .remove,
.track .remove:hover,
.track .remove:focus-visible { opacity: 1; }
.track .remove:hover { border-color: var(--danger); color: var(--danger); }

/* Above the sticky ruler row too, so a click anywhere down the timeline reaches it. */
.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--head-w);
  right: 0;
  z-index: 30;
  cursor: text;
}
.overlay.at-edge { cursor: ew-resize; }

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(76, 201, 240, .6);
  pointer-events: none;
}
.playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  border: 4px solid transparent;
  border-top-color: var(--accent);
}

.selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(76, 201, 240, .10);
  border-left: 1px solid rgba(76, 201, 240, .55);
  border-right: 1px solid rgba(76, 201, 240, .55);
  pointer-events: none;
}
.selection.armed { background: rgba(76, 201, 240, .18); }

.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 14px;
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 11px;
}
#status { flex: 1; }
.hints,
.tempo,
.project-size { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tempo,
.project-size { white-space: nowrap; }

/* Above the timeline overlay, or a click on a dismiss button would seek instead. */
.jobs {
  position: fixed;
  right: 14px;
  bottom: 36px;
  z-index: 40;
  width: 280px;
  max-height: 40vh;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.jobs ul { list-style: none; margin: 0; padding: 4px 0; }
.job {
  display: grid;
  grid-template-columns: auto 1fr 7ch 24px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}
.job + .job { border-top: 1px solid var(--line); }
.job-label { white-space: nowrap; }
.job progress { width: 100%; height: 6px; accent-color: var(--accent); }
.job-state {
  grid-column: 3;
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.job[data-state="failed"] .job-state { color: var(--danger); }
.job-dismiss {
  grid-column: 4;
  padding: 1px 0;
  font-size: 11px;
  line-height: 1;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text-dim);
}
.job-dismiss:hover,
.job-dismiss:focus-visible {
  border-color: var(--key-edge);
  background: var(--key-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 0 rgba(0, 0, 0, .45);
  color: var(--text);
}

.project-name {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  min-width: 56px;
  width: 22ch;
  max-width: 30vw;
}
.project-name:hover { border-color: var(--line); }
.project-name:focus { outline: none; border-color: var(--accent); background: var(--bg-raised); }

.home {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow-y: auto;
  padding: 32px 16px;
}
.home-inner { width: 100%; max-width: 560px; }
.home-inner:has(.split:not([hidden])) { max-width: 880px; }
.home-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
}
.project-list { list-style: none; margin: 0 0 28px; padding: 0; }
.project {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--bg-raised);
}
.project:hover { border-color: var(--accent); }
.project-open {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  text-align: left;
  cursor: pointer;
}
/* The whole card is its hit area, so its ring goes inside the card's border. */
.project-open:focus-visible { outline-offset: -2px; border-radius: 8px; }
.project-title { font-size: 15px; color: var(--text); }
.project-meta { color: var(--text-dim); font-size: 12px; }
.project-export,
.project-log,
.project-delete {
  align-self: center;
  flex: none;
  color: var(--text-dim);
  padding: 4px 10px;
}
.project-export,
.project-log { font-size: 12px; white-space: nowrap; }
.project-delete { margin-right: 10px; }
.project-export:hover,
.project-log:hover { color: var(--accent); }
.project-delete:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 480px) {
  .project { gap: 2px; }
  .project-open { min-width: 0; padding: 10px 10px; }
  .project-title, .project-meta { overflow-wrap: anywhere; }
  .project-export, .project-log, .project-delete { padding: 4px 7px; }
  .project-export > span { display: none; }
  .project-delete { margin-right: 6px; }
}

.log-view {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.log-view[open] { display: flex; flex-direction: column; }
.log-view::backdrop { background: rgba(20, 22, 26, .82); }
.log-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.log-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.log-close { flex: none; }
.log-scroll { overflow: auto; min-height: 0; }
.log-empty { margin: 0; padding: 20px 16px; color: var(--text-dim); }
.log-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.log-table th {
  position: sticky;
  top: 0;
  padding: 8px 10px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
}
.log-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.log-entry:last-child td { border-bottom: 0; }
.log-when, .log-took {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-dim);
}
.log-took { text-align: right; color: var(--text); }
.log-op { color: var(--accent); white-space: nowrap; }
.log-stage { white-space: nowrap; }
.log-details { color: var(--text-dim); overflow-wrap: anywhere; min-width: 16ch; }
.log-entry[data-stage="failed"] .log-stage,
.log-entry[data-stage="failed"] .log-details { color: var(--danger); }
.log-entry[data-stage="cancelled"] .log-stage { color: var(--mute); }
.log-entry[data-stage="done"] .log-stage { color: var(--hq); }
@media (max-width: 600px) {
  .log-view { width: calc(100vw - 16px); max-height: calc(100vh - 32px); }
  .log-table thead { display: none; }
  .log-table, .log-table tbody { display: block; }
  .log-entry {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    column-gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
  }
  .log-entry:last-child { border-bottom: 0; }
  .log-table td { padding: 0; border: 0; }
  .log-details { grid-column: 1 / -1; min-width: 0; margin-top: 2px; }
  .log-details:empty { display: none; }
}

/* Here rather than in setProject(), which the first-run screen never calls. */
body[data-view="home"] .project-name,
body[data-view="home"] .transport,
body[data-view="home"] .clock,
body[data-view="home"] .master,
body[data-view="home"] .speed,
body[data-view="home"] .pitch,
body[data-view="home"] .hq,
body[data-view="home"] .jobs,
body[data-view="home"] #btn-add,
body[data-view="home"] #project-size,
body[data-view="home"] #tempo,
body[data-view="home"] #btn-projects { display: none; }

/* Keep this block last: a selector inside @media carries no extra specificity,
   so a later unscoped rule of equal specificity would win. */
@media (max-width: 1530px) {
  /* The full-width bar measures about 1513px in headless Chromium's fonts; a bar that
     wraps beats one that scrolls. Measure again whenever the topbar gains a child. */
  .topbar { gap: 10px; flex-wrap: wrap; row-gap: 8px; }

  /* The clock yields first: the ruler still shows the full duration. */
  .clock .sep,
  .clock #time-total { display: none; }

  .project-name { width: 13ch; }

  .master { width: 120px; min-width: 90px; }
  /* Below its content a group spills over its neighbour rather than squeezing. */
  .speed { width: 140px; min-width: 138px; }
  /* The group's width with the cents slider at its 40px floor; less spills it. */
  .pitch { width: 250px; min-width: 250px; }
}

/* Wrap rather than clip: Projects is the only way back from the mixer. */
@media (max-width: 860px) {
  :root { --head-w: 180px; }
  .hints { display: none; }
}
