/* Copyright (c) 2026 RZ Sounds LLC. All rights reserved. Use subject to the Terms of Use. */
:root {
  color-scheme: dark;
  --bg: #0b0c0e;
  --panel: #14171c;
  --line: #2a3038;
  --text: #e7e4dc;
  --muted: #9aa094;
  --green: #1f9d6a;
  --brass: #d4a24c;
  --bad: #d4654c;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
header, .transport, .rhythms, .side, .stage { border-color: var(--line); }
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #101216;
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.mark { width: 28px; height: 28px; }
.legal { color: var(--muted); font-size: 12px; padding: 16px; }
.legal a { color: var(--brass); }
.terms-modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: grid; place-items: center; z-index: 20; padding: 16px; }
.terms-modal[hidden] { display: none; }
.terms-card { width: min(640px, 100%); max-height: min(90vh, 720px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
#terms-text { max-height: 45vh; overflow: auto; white-space: pre-wrap; background: #0e1114; padding: 12px; border-radius: 8px; }
#terms-agree:disabled { opacity: 0.45; }
nav { display: flex; gap: 6px; }
button, .button, select, input {
  background: #1c2128; color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 10px; font: inherit;
}
button.primary, button.nav.on { background: var(--green); color: #04140c; border-color: transparent; font-weight: 650; }
button.nav { background: transparent; }
a.button { text-decoration: none; display: inline-block; }
.view { min-height: calc(100vh - 58px); }
#view-player { display: grid; grid-template-columns: 280px 1fr 300px; }
#view-player[hidden] { display: none; }
#decl-list { list-style: none; padding: 0; margin: 0 0 8px; max-height: 160px; overflow: auto; }
#decl-list li { padding: 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
#decl-list li.on { background: #1b2a24; }
#analyze:disabled { opacity: 0.45; }
#view-admin { padding: 20px 24px; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin td, table.admin th { border-bottom: 1px solid var(--line); text-align: left; padding: 6px; }
.rhythms, .side { padding: 12px; background: var(--panel); overflow: auto; max-height: calc(100vh - 58px); }
.stage { padding: 14px 16px 28px; }
.rhythms input, .side input, .side select, .filters select { width: 100%; margin-bottom: 8px; }
.filters { display: flex; gap: 8px; align-items: center; }
#rhythm-list, #fs-results, #batch-list, #library-list { list-style: none; padding: 0; margin: 0; }
#rhythm-list li, #fs-results li, #library-list li, #batch-list li {
  padding: 8px; border-bottom: 1px solid var(--line); cursor: pointer;
}
#rhythm-list li.on { background: #1b2a24; }
#rhythm-list small, .hint, .muted { color: var(--muted); }
.transport { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.transport .grow { display: flex; gap: 8px; align-items: center; min-width: 220px; }
.readout { display: flex; gap: 14px; font-variant-numeric: tabular-nums; }
.readout b { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.flag { color: var(--brass); }
#progress { margin: 10px 0; display: flex; gap: 8px; align-items: center; }
#progress[hidden] { display: none; }
#progress i { height: 6px; width: 180px; background: #2a3038; border-radius: 99px; position: relative; overflow: hidden; }
#progress i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 20%); background: var(--green); }
#warnings { color: var(--brass); font-size: 13px; }
#alts { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
canvas { width: 100%; height: auto; background: #0e1114; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
#steps { display: flex; gap: 4px; overflow-x: auto; padding: 10px 0; }
.step {
  min-width: 46px; height: 92px; border: 1px solid var(--line); border-radius: 6px;
  background: #12161b; position: relative; cursor: ns-resize; flex: 1;
}
.step .dot {
  position: absolute; left: 8px; right: 8px; height: 8px; border-radius: 4px; background: var(--brass);
}
.step span { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font: 10px/1.2 ui-monospace, monospace; color: var(--muted); }
.step.on { border-color: var(--green); }
.drop { border: 1px dashed var(--line); border-radius: 8px; padding: 16px; text-align: center; color: var(--muted); margin-bottom: 8px; }
.row, .stack { display: flex; gap: 6px; margin: 6px 0; }
.stack { flex-direction: column; }
#mixer label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin: 4px 0; }
#view-batch, #view-library, #view-credits { padding: 20px 24px; max-width: 860px; }
pre { white-space: pre-wrap; color: var(--muted); font-size: 12px; }
@media (max-width: 980px) {
  #view-player { grid-template-columns: 1fr; }
  .rhythms, .side { max-height: none; }
  #rhythm-list { max-height: 280px; overflow: auto; }
}
@media (max-width: 430px) {
  header { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .brand strong { font-size: 1rem; }
  nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  button, .button, select, input { font-size: 16px; min-height: 44px; }
  button.nav { min-height: 44px; }
  .transport { flex-direction: column; align-items: stretch; }
  .transport .grow { min-width: 0; width: 100%; }
  .readout { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .readout b { display: block; font-size: 1.35rem; }
  #rhythm-list { max-height: 220px; }
  #steps { gap: 8px; padding-bottom: 16px; }
  .step { flex: 0 0 56px; min-width: 56px; height: 120px; }
  .row { flex-wrap: wrap; }
  .row > * { flex: 1 1 calc(50% - 6px); text-align: center; }
  #view-batch, #view-library, #view-credits { padding: 16px; }
  #progress i { width: 100%; }
  canvas { margin-top: 12px; }
}
