:root {
  color-scheme: dark;
  --bg: #0b141d;
  --line: #2b3d4b;
  --text: #e7e8e4;
  --muted: #93a4b6;
  --green: #79d6aa;
  --gold: #edb35d;
  --blue: #65b9ef;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 65% 0, #1a2d42 0, #0b141d 65%);
  color: var(--text);
  font:
    13px system-ui,
    sans-serif;
}
main {
  max-width: 1560px;
  margin: auto;
  padding: 22px;
}
header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0 10px 25px;
}
header img {
  width: 66px;
  height: 60px;
}
h1 {
  font-weight: 400;
  letter-spacing: 5px;
  font-size: 24px;
  margin: 0;
}
sup {
  font-size: 10px;
}
header p {
  letter-spacing: 6px;
  color: var(--muted);
  font-size: 11px;
  margin: 8px 0;
}
header small {
  margin-left: auto;
  font-size: 8px;
  letter-spacing: 3px;
  line-height: 1.9;
  color: var(--muted);
}
.panel {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(145deg, #1a242d, #0d171e);
  box-shadow:
    inset 0 1px 2px #ffffff09,
    0 4px 12px #0006;
}
button,
select,
input[type="number"] {
  background: linear-gradient(#24313c, #141e27);
  border: 1px solid #3a4a57;
  border-radius: 5px;
  color: var(--text);
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 13px;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:hover {
  border-color: #7c9fb9;
  background: #293d4c;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
button.active {
  border-color: var(--blue);
  box-shadow:
    0 0 12px #65b9ef35,
    inset 0 0 8px #65b9ef25;
}
.transport {
  display: flex;
  gap: 25px;
  padding: 12px;
  justify-content: space-between;
  align-items: center;
}
.buttons {
  display: flex;
  gap: 9px;
}
.buttons button {
  font-size: 9px;
  letter-spacing: 1px;
  min-width: 72px;
  max-width: 132px;
  min-height: 78px;
}
.buttons b {
  display: block;
  font-size: 26px;
  margin-bottom: 8px;
  font-weight: 400;
}
.record b {
  color: #ff6c70;
  text-shadow: 0 0 17px #f35;
}
.play b {
  color: var(--green);
  text-shadow: 0 0 15px #6fa;
}
.prep {
  display: flex;
  gap: 15px;
  align-items: center;
}
.prep label,
label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #c1cbd6;
}
select,
input[type="number"] {
  min-height: 42px;
  padding: 7px;
  max-width: 100%;
}
#bpm {
  width: 72px;
}
#metro {
  width: 35px;
  height: 25px;
  accent-color: var(--blue);
}
#beat {
  color: #32434f;
  font-size: 24px;
}
.statusbar {
  display: flex;
  justify-content: space-between;
  padding: 15px 7px;
  color: var(--muted);
  gap: 15px;
}
#clock {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
  font-size: 18px;
}
.track {
  --color: var(--green);
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr) 142px;
  gap: 18px;
  padding: 15px;
  margin-bottom: 12px;
}
.track:nth-child(2) {
  --color: var(--gold);
}
.track h2 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--color);
}
.trackmix {
  display: grid;
  grid-template-columns: 1fr 44px 44px;
  gap: 6px;
}
.trackmix label {
  grid-column: 1/-1;
}
.trackmix input {
  width: 100%;
  accent-color: var(--color);
}
.trackmix button {
  padding: 5px;
}
.wavehead {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 10px;
}
.wavebox {
  height: 105px;
  position: relative;
  border: 1px solid #385247;
  border-radius: 4px;
  overflow: hidden;
  background: #081216;
}
.wavebox canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.trim {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: center;
}
.trim h2 {
  grid-column: 1/-1;
}
.trim input {
  width: 100%;
  font-size: 12px;
  padding: 4px;
}
.trim button {
  grid-column: 1/-1;
  font-size: 10px;
}
.lower {
  display: grid;
  grid-template-columns: 1fr 1.3fr 0.85fr;
  gap: 12px;
  margin-top: 8px;
}
.lower .panel {
  padding: 18px;
  min-width: 0;
}
h2 {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 500;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h2 i {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px #9f98;
}
h2 span {
  margin-left: auto;
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1px;
}
#presetGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
#presetGrid button {
  height: 78px;
  text-align: left;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(ellipse at 50% 0, #294450, #0b151e);
  padding: 9px;
}
#presetGrid button:nth-child(3n + 2) {
  background: radial-gradient(ellipse at 50% 0, #57412b, #10181f);
}
#presetGrid b {
  font-size: 22px;
  color: var(--blue);
  font-weight: 300;
}
.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.knobs {
  display: flex;
  gap: 14px;
  justify-content: space-around;
  margin: 22px 0;
}
.knobs label {
  align-items: center;
  flex: 1;
  min-width: 0;
  font-size: 9px;
}
.knobs input {
  appearance: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #172028;
  background: radial-gradient(circle at 38% 30%, #35434b, #11171c 65%);
  box-shadow:
    0 0 0 2px #5ca7bd,
    0 4px 7px #000;
  cursor: ew-resize;
}
.knobs input::-webkit-slider-thumb {
  appearance: none;
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: #c8dedf;
  box-shadow: 0 0 4px #fff;
}
.knobs input::-moz-range-thumb {
  width: 4px;
  height: 24px;
  background: #c8dedf;
  border: 0;
}
.knobs output {
  color: var(--muted);
}
#spectrum {
  display: block;
  width: 100%;
  height: 115px;
  background: #091219;
  border: 1px solid #2e3d48;
  touch-action: none;
}
.freq {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  margin-top: 7px;
}
.masterbody {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
}
#meter {
  width: 85px;
  height: 140px;
  background: #091219;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.masterbody label {
  align-items: center;
  max-width: 135px;
}
input[type="range"] {
  accent-color: var(--blue);
  min-height: 30px;
  max-width: 100%;
}
#clip {
  display: block;
  color: var(--green);
  font-size: 9px;
  letter-spacing: 1px;
  margin: 14px 0;
}
.exports {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.exports button {
  font-size: 10px;
}
progress {
  width: 100%;
  margin: 10px 0;
  accent-color: var(--green);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}
footer div {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
footer button {
  font-size: 9px;
  letter-spacing: 1px;
}
.footnote {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  margin: 24px 0 0;
}
dialog {
  background: #142330;
  color: var(--text);
  border: 1px solid #597188;
  border-radius: 15px;
  padding: 32px;
  max-width: calc(100% - 28px);
  text-align: center;
}
dialog::backdrop {
  background: #020910d9;
  backdrop-filter: blur(5px);
}
#countNumber {
  font-size: 96px;
  font-weight: 300;
  display: block;
  color: var(--green);
}
#diag {
  text-align: left;
  max-width: 500px;
}
#diag pre {
  white-space: pre-wrap;
  font: 12px/1.9 system-ui;
}
#diag p {
  color: var(--muted);
  line-height: 1.7;
}
.danger {
  color: #ff7373 !important;
}
@media (max-width: 1100px) {
  .transport {
    flex-wrap: wrap;
  }
  .prep {
    flex: 1;
    justify-content: space-around;
  }
  .buttons {
    flex: 1;
    justify-content: space-between;
  }
  .lower {
    grid-template-columns: 1fr 1.2fr;
  }
  .master {
    grid-column: 1/-1;
  }
  .masterbody {
    justify-content: flex-start;
  }
  .master #meter {
    height: 90px;
    width: 140px;
  }
  .track {
    grid-template-columns: 150px minmax(0, 1fr) 125px;
  }
  header small {
    display: none;
  }
}
@media (max-width: 600px) {
  main {
    padding: 12px;
  }
  header {
    gap: 12px;
    margin: 7px 0 20px;
  }
  header img {
    width: 45px;
  }
  h1 {
    font-size: 16px;
    letter-spacing: 2px;
  }
  header p {
    font-size: 8px;
    letter-spacing: 2.5px;
  }
  .transport {
    padding: 9px;
    gap: 15px;
  }
  .buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }
  .buttons button {
    max-width: none;
    min-height: 65px;
  }
  .buttons b {
    font-size: 22px;
    margin-bottom: 5px;
  }
  .prep {
    gap: 8px;
    flex-wrap: wrap;
  }
  .prep label {
    font-size: 8px;
  }
  .track {
    grid-template-columns: 1fr;
    padding: 13px;
    gap: 12px;
  }
  .trackmix {
    grid-template-columns: 1fr 44px 44px;
    align-items: center;
  }
  .trackmix label {
    grid-column: auto;
  }
  .trackmix label:last-child {
    grid-column: 1/-1;
  }
  .wavebox {
    height: 120px;
  }
  .trim {
    grid-template-columns: 1fr 1fr 1.2fr;
    align-items: end;
  }
  .trim h2 {
    display: none;
  }
  .trim button {
    grid-column: auto;
    font-size: 9px;
  }
  .lower {
    grid-template-columns: 1fr;
  }
  .master {
    grid-column: auto;
  }
  .lower .panel {
    padding: 15px;
  }
  .knobs {
    gap: 10px;
  }
  .knobs input {
    width: 53px;
    height: 53px;
  }
  .knobs label {
    font-size: 8px;
  }
  .statusbar {
    font-size: 10px;
    align-items: center;
  }
  #clock {
    font-size: 15px;
  }
  footer {
    flex-direction: column;
  }
  footer div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .wavehead {
    font-size: 10px;
  }
  #presetGrid button {
    height: 70px;
  }
}
@media (max-width: 600px) {
  .transport {
    display: block;
  }
  .buttons {
    margin-bottom: 16px;
  }
  .prep {
    display: flex;
    justify-content: space-between;
  }
  .prep label {
    flex: 0 1 auto;
  }
  .prep select {
    width: 115px;
  }
}
.buttons b,
.trim button {
  font-variant-emoji: text;
}

/* v002 additions: retain the established layout; move only the mobile import action. */
#helpButton {
  flex: 0 0 44px;
  width: 44px;
  border-radius: 50%;
  font-size: 20px;
  color: var(--muted);
}
.mobile-import {
  display: none;
}
#saveStatus {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  padding: 0 4px;
  overflow-wrap: anywhere;
}
.clear-take {
  margin-top: 10px;
  width: 100%;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold);
}
.trim-summary {
  font-size: 10px;
  line-height: 1.5;
  margin: 0 0 7px;
  color: var(--muted);
}
.wavehead {
  flex-wrap: wrap;
}
.wavehead span {
  overflow-wrap: anywhere;
  min-width: 0;
}
#help,
#diag {
  width: 600px;
  max-width: calc(100% - 24px);
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.dialog-heading h2 {
  margin-bottom: 0;
}
#help details {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
#help summary {
  cursor: pointer;
  padding: 12px 0;
  font-size: 13px;
  line-height: 1.5;
}
#help details p,
#diag p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.diagnostics-link {
  margin-top: 18px;
  font-size: 10px;
  color: var(--muted);
}
#micTestStatus {
  color: var(--green);
}
@media (max-width: 600px) {
  header {
    gap: 10px;
  }
  header .studio-home {
    min-width: 0;
    flex: 1;
  }
  h1 {
    font-size: 14px;
  }
  header p {
    letter-spacing: 1.6px;
  }
  .mobile-import {
    display: block;
    margin-bottom: 12px;
  }
  .mobile-import button {
    width: 100%;
    color: var(--blue);
    letter-spacing: 1px;
  }
  #importDesktop {
    display: none;
  }
  .trim {
    grid-template-columns: 1fr 1fr;
  }
  .trim button {
    grid-column: auto;
  }
  #help,
  #diag {
    padding: 20px;
  }
  #helpButton {
    flex-basis: 44px;
  }
}

/* Maintenance 2026-11-06: local Universe emblem and restrained navigation. */
.studio-home { flex:0 1 auto; display:inline-flex; align-items:center; gap:22px; min-width:0; color:var(--text); text-decoration:none; border-radius:3px; }
.studio-home > div { min-width:0; }
.studio-home .studio-word { color:#a8deff; }
@media(max-width:600px) {
  .studio-home { gap:10px; }
  header { min-height:72px; }
}
.studio-home img { display:block; filter:drop-shadow(0 0 7px #67c8ff); }
.studio-home:focus-visible { outline:2px solid #8bd5ff; outline-offset:3px; }
footer.studio-legal { display:block; margin-top:18px; padding-top:10px; border-top:1px solid var(--line); }
.mv-legal-line { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:0 8px; margin:0; color:#9caebb; font:400 12px/1.6 Arial,Helvetica,sans-serif; letter-spacing:normal; }
.mv-legal-line a { display:inline-flex; align-items:center; justify-content:center; min-height:44px; color:inherit; text-decoration:none; border-radius:3px; white-space:nowrap; }
.mv-legal-line a:hover { color:#d9efff; text-decoration:none; }
.mv-legal-line a:focus-visible { outline:2px solid #8bd5ff; outline-offset:3px; color:#e4f5ff; }
/* Marks describe existing values; they never modify the slider or its signal. */
.range-reference { position:relative; display:block; height:12px; margin:-7px 8px 0; color:var(--muted); font-size:8px; line-height:12px; letter-spacing:0; }
.level-reference > span { position:absolute; left:var(--reference-position); transform:translateX(-50%); white-space:nowrap; }
.level-reference > span::before,.pan-reference > span:nth-child(2)::before { content:""; position:absolute; top:-4px; left:50%; width:1px; height:4px; background:var(--muted); }
.pan-reference { display:flex; justify-content:space-between; }
.pan-reference > span { position:relative; }
/* The blue state belongs to .active only; keyboard focus stays visible in grey. */
.trackmix button { -webkit-tap-highlight-color:transparent; }
.trackmix button:not(.active):hover { border-color:#3a4a57; background:linear-gradient(#24313c,#141e27); }
.trackmix button:focus-visible { outline-color:var(--muted); }
.trackmix button:not(.active) { box-shadow:none; }
.range-reference { align-self:stretch; pointer-events:none; }
.trackmix input[type="range"],#master { margin-inline:0; }
.trackmix button { transition:background .15s; }
.pan-reference > span:nth-child(2) { position:absolute; left:50%; transform:translateX(-50%); }
