@font-face {
  font-family: "Psalterion Accidentals";
  src: url("assets/psalterion-accidentals.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: "BZ Fthores";
  src: url("assets/BZFthores.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root {
  color-scheme: dark;
  --ink: #edf5f7;
  --muted: #91a5ae;
  --deep: #071523;
  --panel: #0c2233;
  --panel-2: #102b3d;
  --line: #244255;
  --gold: #f2c14e;
  --cyan: #69d8e7;
  --green: #49e39a;
  --red: #ff6b6b;
}

* { box-sizing: border-box; }
html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(38, 111, 142, .26), transparent 43rem),
    linear-gradient(180deg, #081a29 0%, var(--deep) 70%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Psalterion Accidentals", sans-serif;
}

button, select, input { font: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(100% - 2rem, 62rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(1.1rem, env(safe-area-inset-top)) 0 max(1.5rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 1rem;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .72rem;
}

.brand-icon {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: .78rem;
  box-shadow: 0 .3rem 1rem rgba(0, 0, 0, .2);
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Psalterion Accidentals", serif;
  font-size: clamp(1.22rem, 4vw, 1.62rem);
  font-weight: 600;
  letter-spacing: .035em;
}

.brand-subtitle {
  margin: .18rem 0 0;
  max-width: 30rem;
  color: var(--muted);
  font-size: clamp(.62rem, 1.7vw, .76rem);
  line-height: 1.25;
}

.masthead-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .55rem;
}

.language-select,
.field select,
.field input[type="number"],
.microphone-block select {
  border: 1px solid #315167;
  border-radius: .62rem;
  color: var(--ink);
  background: #0a1d2d;
}

.language-select {
  min-height: 2.4rem;
  padding: .42rem 1.8rem .42rem .65rem;
  font-size: .8rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.4rem;
  padding: .5rem .72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(7, 21, 35, .66);
  font-size: .8rem;
}

.status-dot {
  width: .52rem;
  height: .52rem;
  border-radius: 50%;
  background: #58707b;
}

.status-chip[data-state="listening"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 .24rem rgba(73, 227, 154, .13);
}

.status-chip[data-state="error"] .status-dot { background: var(--red); }

.tuner {
  min-height: 27rem;
  padding: clamp(1.35rem, 5vw, 2.6rem);
  display: grid;
  place-content: center stretch;
  gap: 1.25rem;
  border: 1px solid rgba(105, 216, 231, .14);
  border-radius: 1.65rem;
  background:
    linear-gradient(145deg, rgba(16, 43, 61, .94), rgba(8, 26, 41, .98)),
    var(--panel);
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, .27);
  overflow: hidden;
}

.active-profile-label {
  margin: -.25rem 0 0;
  color: var(--gold);
  font-size: clamp(1rem, 2.7vw, 1.25rem);
  font-weight: 750;
  letter-spacing: .02em;
  text-align: center;
}

.trace-toolbar {
  display: grid;
  grid-template-columns: auto minmax(7.5rem, .55fr) minmax(9.5rem, .7fr) auto;
  align-items: end;
  gap: .65rem;
}

.display-mode {
  min-height: 2.45rem;
  padding: .2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #315167;
  border-radius: .68rem;
  background: #071a29;
}

.trace-mode-button,
.trace-action-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: .76rem;
  font-weight: 750;
  cursor: pointer;
}

.trace-mode-button {
  min-width: 3.5rem;
  padding: .38rem .55rem;
  border-radius: .48rem;
}

.trace-mode-button.selected {
  color: #071523;
  background: var(--cyan);
}

.trace-select-field {
  min-width: 0;
  display: grid;
  gap: .25rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}

.trace-select-field select {
  width: 100%;
  min-height: 2.45rem;
  padding: .4rem .6rem;
  border: 1px solid #315167;
  border-radius: .62rem;
  color: var(--ink);
  background: #0a1d2d;
  font-size: .78rem;
}

.trace-actions {
  min-height: 2.45rem;
  display: flex;
  border: 1px solid #315167;
  border-radius: .62rem;
  overflow: hidden;
}

.trace-action-button {
  padding: .4rem .65rem;
  white-space: nowrap;
}

.trace-action-button + .trace-action-button { border-left: 1px solid #315167; }
.trace-action-button:hover { color: var(--gold); background: rgba(242, 193, 78, .08); }
.trace-action-button:disabled { cursor: not-allowed; opacity: .42; }

.note-stage {
  position: relative;
  min-height: var(--trace-stage-height, 15rem);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(105, 216, 231, .12);
  border-radius: .9rem;
  background: rgba(6, 19, 31, .38);
}

.melograph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 180ms ease;
}

.note-stage[data-trace-mode="note"] .melograph { opacity: 0; }
.note-stage[data-trace-mode="trace"] .note-name { opacity: 0; }
.note-stage[data-trace-mode="both"] .note-name:not(.is-empty) {
  opacity: 1;
  color: rgba(237, 245, 247, .14);
  -webkit-text-stroke: 1.35px rgba(237, 245, 247, .52);
  paint-order: stroke fill;
  text-shadow: 0 0 1.1rem rgba(4, 13, 22, .35);
}

.note-name {
  position: relative;
  z-index: 2;
  display: inline-block;
  font-family: Georgia, "Times New Roman", "Psalterion Accidentals", serif;
  font-size: clamp(6.8rem, 26vw, 11.5rem);
  font-weight: 400;
  line-height: .9;
  color: var(--ink);
  text-shadow: 0 .08em .3em rgba(0, 0, 0, .23);
  transition: opacity 300ms ease, transform 300ms ease;
}

.note-name.is-long { font-size: clamp(3.2rem, 13vw, 6rem); }
.note-name.is-empty { opacity: 0; transform: scale(.97); }

.in-tune-light {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: .55rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(237, 245, 247, .16);
  border-radius: 50%;
  background: rgba(237, 245, 247, .08);
  transform: translateX(-50%);
  transition: background 90ms ease, border-color 90ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.in-tune-light.on {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 .55rem rgba(73, 227, 154, .9), 0 0 1.8rem rgba(73, 227, 154, .5);
  transform: translateX(-50%) scale(1.18);
}

.meter-range {
  margin-top: .55rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: .75rem;
  color: var(--muted);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.meter-range > :last-child { text-align: right; }

.meter-track {
  position: relative;
  height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background:
    linear-gradient(90deg, transparent 24.8%, rgba(255,255,255,.08) 25%, transparent 25.2%, transparent 74.8%, rgba(255,255,255,.08) 75%, transparent 75.2%),
    #06131f;
  box-shadow: inset 0 .2rem .8rem rgba(0, 0, 0, .42);
}

.tolerance-zone {
  position: absolute;
  inset: 0 auto 0 33.333%;
  width: 33.333%;
  background: rgba(73, 227, 154, .07);
}

.centre-line {
  position: absolute;
  top: -.28rem;
  bottom: -.28rem;
  left: 50%;
  width: .16rem;
  border-radius: 999px;
  background: var(--gold);
  transform: translateX(-50%);
  box-shadow: 0 0 .65rem rgba(242, 193, 78, .35);
}

.needle {
  position: absolute;
  top: .32rem;
  bottom: .32rem;
  left: 50%;
  width: .28rem;
  border-radius: 999px;
  background: var(--cyan);
  transform: translateX(-50%);
  box-shadow: 0 0 .8rem rgba(105, 216, 231, .56);
  transition: opacity 180ms ease;
  will-change: left;
}

.meter[data-active="false"] .needle { opacity: .16; }

.pitch-readouts {
  width: min(100%, 34rem);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid rgba(105, 216, 231, .18);
  border-radius: .75rem;
  overflow: hidden;
  background: rgba(6, 19, 31, .34);
}

.pitch-readout {
  min-width: 0;
  padding: .72rem .9rem;
  display: grid;
  gap: .22rem;
  text-align: center;
}

.pitch-readout:nth-child(odd) { border-right: 1px solid rgba(105, 216, 231, .14); }
.pitch-readout:nth-child(n + 3) { border-top: 1px solid rgba(105, 216, 231, .14); }

.pitch-readout-label {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.25;
}

.pitch-readout output {
  color: var(--ink);
  font-size: clamp(.94rem, 2.4vw, 1.08rem);
  font-variant-numeric: tabular-nums;
}

.ison-deck,
.controls {
  border: 1px solid var(--line);
  background: rgba(12, 34, 51, .88);
}

.ison-deck {
  padding: 1rem;
  display: grid;
  gap: .85rem;
  border-color: rgba(242, 193, 78, .28);
  border-radius: 1.15rem;
  box-shadow: 0 .7rem 2rem rgba(0, 0, 0, .12);
}

.ison-toolbar {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) auto minmax(12rem, .75fr);
  align-items: center;
  gap: 1rem;
}

.ison-title h2,
.section-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.ison-title p,
.section-heading p {
  margin: .12rem 0 0;
  color: var(--muted);
  font-size: .78rem;
}

.toggle-button {
  min-width: 5.2rem;
  min-height: 2.75rem;
  padding: .42rem .9rem;
  border: 1px solid #315167;
  border-radius: 999px;
  color: var(--muted);
  background: #0a1d2d;
  font-weight: 800;
  cursor: pointer;
}

.toggle-button.selected {
  border-color: var(--green);
  color: #071523;
  background: var(--green);
  box-shadow: 0 0 1.2rem rgba(73, 227, 154, .18);
}

.toggle-button:disabled { cursor: not-allowed; opacity: .48; }

.level-field {
  min-width: 0;
  display: grid;
  gap: .35rem;
}

.level-field input[type="range"],
#input-gain {
  width: 100%;
  min-height: 1.5rem;
  margin: 0;
  accent-color: var(--cyan);
  cursor: pointer;
}

.range-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.range-heading output { color: var(--gold); font-variant-numeric: tabular-nums; }

.ison-notes {
  display: grid;
  grid-template-columns: repeat(12, minmax(3.25rem, 1fr));
  gap: .42rem;
}

.ison-note-button {
  min-width: 0;
  min-height: 3rem;
  padding: .38rem .25rem;
  border: 1px solid #38586c;
  border-radius: .62rem;
  color: var(--ink);
  background: #091b2a;
  display: grid;
  place-content: center;
  gap: .06rem;
  font-family: Georgia, "Times New Roman", "Psalterion Accidentals", serif;
  font-size: .93rem;
  line-height: 1.05;
  cursor: pointer;
  transition: transform 100ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.ison-note-button:hover { border-color: var(--gold); }
.ison-note-button:active { transform: translateY(1px); }

.ison-note-button.selected {
  border-color: var(--gold);
  color: #071523;
  background: var(--gold);
  box-shadow: 0 .2rem .8rem rgba(242, 193, 78, .14);
  font-weight: 800;
}

.ison-note-main { display: block; }

.ison-note-qualifier {
  display: block;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: .62rem;
  font-weight: 650;
  line-height: 1;
}

.ison-note-button.selected .ison-note-qualifier { color: rgba(7, 21, 35, .68); }

.controls {
  padding: 1.1rem;
  display: grid;
  gap: 1rem;
  border-radius: 1.15rem;
}

.tuning-settings {
  display: grid;
  gap: .82rem;
}

.capture-reference {
  display: grid;
  grid-template-columns: minmax(12rem, auto) 1fr;
  align-items: center;
  gap: .75rem;
}

.capture-button {
  min-height: 2.75rem;
  padding: .52rem .9rem;
  border: 1px solid rgba(242, 193, 78, .55);
  border-radius: .68rem;
  color: var(--gold);
  background: rgba(242, 193, 78, .07);
  font-weight: 800;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.capture-button.capturing {
  color: #071523;
  background: var(--gold);
  box-shadow: 0 0 1.2rem rgba(242, 193, 78, .2);
}

.capture-button:disabled { cursor: not-allowed; opacity: .42; }

.capture-status {
  min-height: 1.2rem;
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.capture-status[data-state="success"] { color: var(--green); }
.capture-status[data-state="error"] { color: var(--red); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}

.field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: .42rem;
}

.field > label,
.field > .field-label,
.microphone-block > label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.field select,
.field input[type="number"],
.microphone-block select {
  width: 100%;
  min-height: 2.75rem;
  padding: .48rem .7rem;
  font-size: .88rem;
}

.custom-select { position: relative; }

.custom-select-button {
  width: 100%;
  min-height: 2.75rem;
  padding: .48rem .7rem;
  border: 1px solid #315167;
  border-radius: .62rem;
  color: var(--ink);
  background: #0a1d2d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-size: .88rem;
  text-align: left;
  cursor: pointer;
}

.custom-select-arrow { color: var(--muted); font-size: 1.05rem; }

.custom-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + .35rem);
  left: 0;
  width: 100%;
  max-height: 18rem;
  padding: .3rem;
  overflow-y: auto;
  border: 1px solid #315167;
  border-radius: .65rem;
  background: #071a29;
  box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .42);
}

.custom-select-menu[hidden] { display: none; }

.custom-select-option {
  width: 100%;
  min-height: 2.4rem;
  padding: .45rem .55rem;
  border: 0;
  border-radius: .42rem;
  color: var(--ink);
  background: transparent;
  font-size: .88rem;
  text-align: left;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option:focus-visible { background: rgba(105, 216, 231, .1); }

.custom-select-option[aria-selected="true"] {
  color: var(--gold);
  background: rgba(242, 193, 78, .1);
  font-weight: 750;
}

.inline-accidental {
  width: auto;
  height: .9em;
  margin: 0 .06em;
  vertical-align: -.08em;
}

.note-name .inline-accidental {
  height: .45em;
  margin-inline: .03em;
}

.runtime-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(49, 81, 103, .55);
}

.microphone-block {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(12rem, .8fr) minmax(13rem, 1fr);
  align-items: end;
  gap: .48rem .85rem;
}

.microphone-block > label,
#microphone-select { grid-column: 1; }
.input-monitor,
.gain-control { grid-column: 2; }
.input-monitor { grid-row: 1; }
.gain-control { grid-row: 2; }
.control-message { grid-column: 1 / -1; }

#microphone-select:disabled { opacity: .55; }

.input-monitor {
  display: grid;
  grid-template-columns: auto 1fr 4.2rem;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .8rem;
}

.input-level-track {
  height: .42rem;
  overflow: hidden;
  border-radius: 999px;
  background: #06131f;
  box-shadow: inset 0 0 0 1px var(--line);
}

.input-level-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transition: width 80ms linear;
}

#input-level-text { text-align: right; }

.gain-control { display: grid; gap: .3rem; }

.gain-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
}

.control-message {
  margin: 0;
  color: var(--red);
  font-size: .8rem;
}

.control-message:empty { display: none; }

.primary-button {
  min-width: 10rem;
  min-height: 3.15rem;
  padding: .7rem 1.15rem;
  border: 0;
  border-radius: .75rem;
  color: #071523;
  background: var(--cyan);
  box-shadow: 0 .55rem 1.4rem rgba(105, 216, 231, .13);
  font-weight: 800;
  cursor: pointer;
}

.primary-button[data-running="true"] {
  color: var(--ink);
  background: transparent;
  border: 1px solid #3d6075;
  box-shadow: none;
}

.primary-button:disabled { cursor: wait; opacity: .6; }

footer {
  display: grid;
  justify-items: center;
  gap: .55rem;
  color: var(--muted);
  text-align: center;
  font-size: .78rem;
}

footer p { margin: 0; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .15rem .9rem;
}

.text-button {
  padding: .25rem .1rem;
  border: 0;
  color: var(--cyan);
  background: transparent;
  font-size: .8rem;
  cursor: pointer;
}

.text-button:hover { color: var(--gold); }
.release-mark { opacity: .7; }

.capture-status:empty { display: none; }

.info-dialog {
  width: min(52rem, calc(100% - 1.2rem));
  max-height: min(88vh, 54rem);
  padding: 0;
  border: 1px solid #315167;
  border-radius: 1.1rem;
  color: var(--ink);
  background: #091c2b;
  box-shadow: 0 1.5rem 6rem rgba(0, 0, 0, .65);
}

.info-dialog::backdrop { background: rgba(2, 9, 15, .78); backdrop-filter: blur(4px); }
.info-dialog-frame { display: grid; grid-template-rows: auto auto minmax(0, 1fr); max-height: inherit; }
.info-dialog-header { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem .65rem; }
.dialog-close { width: 2.25rem; height: 2.25rem; border: 1px solid #315167; border-radius: 50%; color: var(--ink); background: #0c2639; font-size: 1.45rem; cursor: pointer; }
.info-tabs { padding: 0 1rem .75rem; display: flex; gap: .4rem; overflow-x: auto; }
.info-tabs button { padding: .5rem .7rem; border: 1px solid #315167; border-radius: 999px; color: var(--muted); background: transparent; white-space: nowrap; cursor: pointer; }
.info-tabs button[aria-selected="true"] { color: #071523; border-color: var(--cyan); background: var(--cyan); font-weight: 750; }
.info-content { padding: .2rem clamp(1rem, 4vw, 2.2rem) 2rem; overflow-y: auto; line-height: 1.62; }
.info-content h1 { margin: 1rem 0 .7rem; color: var(--gold); font-family: inherit; font-size: 1.65rem; }
.info-content h2 { margin: 1.7rem 0 .55rem; color: var(--cyan); font-size: 1.15rem; }
.info-content h3 { margin: 1.3rem 0 .35rem; font-size: 1rem; }
.info-content p { margin: .65rem 0; }
.info-content li + li { margin-top: .35rem; }
.info-content a { color: var(--cyan); overflow-wrap: anywhere; }
.info-content hr { margin: 1.8rem 0; border: 0; border-top: 1px solid #315167; }

.install-button {
  min-height: 2.5rem;
  padding: .45rem .9rem;
  border: 1px solid #38586c;
  border-radius: 999px;
  color: var(--ink);
  background: #0a1d2d;
  font-weight: 700;
  cursor: pointer;
}

.install-hint { max-width: 28rem; }

:focus-visible {
  outline: 3px solid rgba(105, 216, 231, .6);
  outline-offset: 3px;
}

@media (max-width: 700px) {
  .app-shell { width: min(100% - .8rem, 48rem); gap: .7rem; }
  .masthead { padding: .15rem .2rem; align-items: flex-start; }
  .brand-icon { width: 2.65rem; height: 2.65rem; }
  .masthead-actions { align-items: flex-end; flex-direction: column; gap: .35rem; }
  .language-select { min-height: 2.15rem; padding-top: .3rem; padding-bottom: .3rem; }
  .status-chip { min-height: 2.05rem; padding: .35rem .55rem; }
  #status-text { max-width: 7.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .tuner {
    min-height: 24rem;
    padding: 1.05rem .7rem 1.2rem;
    gap: .9rem;
    border-radius: 1.2rem;
  }

  .trace-toolbar {
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }
  .display-mode { grid-column: 1 / -1; }
  .trace-actions { grid-column: 1 / -1; }
  .trace-action-button { flex: 1; }
  .note-stage { min-height: var(--trace-stage-height, 13.5rem); }
  .note-name { font-size: clamp(6.2rem, 31vw, 9rem); }
  .meter-track { height: 2.35rem; }

  .ison-deck { padding: .82rem .72rem; border-radius: 1rem; }
  .ison-toolbar { grid-template-columns: 1fr auto; gap: .75rem; }
  .ison-title p { display: none; }
  .level-field { grid-column: 1 / -1; }
  .ison-notes {
    grid-template-columns: repeat(12, minmax(3.25rem, 1fr));
    overflow-x: auto;
    padding: 0 0 .35rem;
    scroll-snap-type: x proximity;
    scrollbar-color: #38586c transparent;
  }
  .ison-note-button { scroll-snap-align: start; min-height: 3.15rem; }

  .controls { padding: .9rem; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .capture-reference { grid-template-columns: 1fr; gap: .4rem; }
  .capture-button { width: 100%; }
  .capture-status { text-align: center; }
  .runtime-controls { grid-template-columns: 1fr; }
  .microphone-block { grid-template-columns: 1fr; }
  .microphone-block > label,
  #microphone-select,
  .input-monitor,
  .gain-control,
  .control-message { grid-column: 1; grid-row: auto; }
  .primary-button { width: 100%; }
  .pitch-readout { padding: .62rem .68rem; }
  .pitch-readout-label { font-size: .66rem; }
}

@media (max-width: 430px) {
  .settings-grid { grid-template-columns: 1fr; }
  .section-heading p { max-width: 20rem; }
  .trace-select-field select { font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
