:root {
  color-scheme: light;
  --paper: #fff;
  --page: #f7f5fb;
  --ink: #231b35;
  --muted: #625b70;
  --accent: #57358c;
  --accent-hover: #452470;
  --shade: #f2edf9;
  --border: #dcd3e8;
  font: 16px system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .16em; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, .file-control:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 0 max(24px, calc((100vw - 1110px) / 2));
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
header a { text-decoration: none; }
.brand { font-weight: 760; color: var(--ink); }
main, footer { width: min(calc(100% - 48px), 1110px); margin-left: auto; margin-right: auto; }
main { margin-top: 44px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.04; letter-spacing: -.06em; margin-bottom: 8px; }
.intro p, .track p, .notes, .scale, .estimate span { color: var(--muted); }
.files { display: flex; flex-wrap: wrap; gap: 7px; }
button, .button {
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  white-space: nowrap;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 680;
  text-decoration: none;
}
.primary { background: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.secondary { background: var(--paper); color: var(--accent); border-color: var(--border); }
.secondary:hover:not(:disabled) { background: var(--shade); }
button:disabled { opacity: .55; cursor: default; }
.file-control { position: relative; }
.file-control input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.workspace { display: grid; grid-template-columns: minmax(250px, .43fr) minmax(310px, 1fr); gap: 14px; }
.settings, .track { background: var(--paper); border: 1px solid var(--border); border-radius: 11px; padding: 18px; min-width: 0; }
.panel-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; min-height: 32px; margin-bottom: 12px; }
h2 { font-size: 1.15rem; letter-spacing: -.018em; }
.text-button { color: var(--accent); background: transparent; padding: 0 2px; min-height: 27px; }
.text-button:hover { text-decoration: underline; text-underline-offset: .15em; }
.param { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; font-size: .89rem; font-weight: 690; margin: 12px 0 6px; }
output { padding: 3px 8px; border-radius: 5px; background: var(--shade); color: var(--accent); font-family: ui-monospace, monospace; }
input[type="range"] { display: block; width: 100%; height: 24px; margin: 0; accent-color: var(--accent); }
.scale { display: flex; justify-content: space-between; font-size: .74rem; margin-bottom: 17px; }
.estimate { display: flex; justify-content: space-between; gap: 5px; font-size: .83rem; border-top: 1px solid var(--border); padding-top: 12px; margin: 15px 0; }
.estimate strong { font-variant-numeric: tabular-nums; }
#render { width: 100%; }
.tracks { display: grid; gap: 14px; }
.track { min-height: 142px; }
.track p { font-size: .78rem; line-height: 1.38; margin-top: 4px; overflow-wrap: anywhere; }
canvas { display: block; width: 100%; height: 56px; background: var(--shade); border-radius: 5px; }
audio { display: block; width: 100%; height: 38px; margin-top: 7px; }
#status { margin-top: 10px; font-size: .84rem; }
#status.error { color: #a02b3d; }
.notes, footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 13px; font-size: .78rem; }
footer { justify-content: flex-start; gap: 16px; margin-bottom: 25px; }
.info { max-width: 720px; line-height: 1.55; }
.info section { margin: 24px 0; }
.info section p { margin-top: 8px; }
@media (max-width: 730px) {
  main, footer { width: calc(100% - 30px); }
  main { margin-top: 30px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .settings, .track { padding: 14px; }
}
@media (max-width: 390px) {
  .track .panel-head { flex-wrap: wrap; }
  header { padding: 0 15px; }
}
