:root {
  --tr-bg: var(--site-bg);
  --tr-text: var(--site-text);
  --tr-muted: var(--site-muted);
  --tr-surface: var(--site-surface);
  --tr-panel: var(--site-panel);
  --tr-border: color-mix(in srgb, var(--site-text) 40%, var(--site-bg));
  --tr-border-soft: var(--site-soft-border);
  /* Neutral rules frame controls; red communicates state and keyboard focus. */
  --tr-border-hover: var(--tr-text);
  --tr-accent: var(--site-accent);
  --tr-accent-soft: color-mix(in srgb, var(--tr-accent) 13%, transparent);
  --tr-hover: var(--site-panel);
  --tr-disabled: var(--site-muted);
  --tr-grid: rgb(10 10 10 / 0.1);
  --tr-canvas-border: rgb(10 10 10 / 0.24);
  --tr-canvas-border-strong: rgb(10 10 10 / 0.55);
}
:root[data-theme="dark"] {
  --tr-grid: rgb(246 246 246 / 0.1);
  --tr-canvas-border: rgb(246 246 246 / 0.24);
  --tr-canvas-border-strong: rgb(246 246 246 / 0.55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --tr-grid: rgb(246 246 246 / 0.1);
    --tr-canvas-border: rgb(246 246 246 / 0.24);
    --tr-canvas-border-strong: rgb(246 246 246 / 0.55);
  }
}

html,
body.transcribe-shell {
  overflow: hidden;
  background: var(--tr-bg);
  color: var(--tr-text);
}

body.transcribe-shell {
  display: block;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-ui);
}

.transcribe-shell .skip-link {
  border-color: var(--tr-text);
  background: var(--tr-bg);
  color: var(--tr-text);
}

.transcribe-app {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--tr-bg);
  color: var(--tr-text);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}

.transcribe-app *,
.transcribe-app *::before,
.transcribe-app *::after {
  box-sizing: border-box;
}

.transcribe-app [hidden] {
  display: none !important;
}

.transcribe-app button,
.transcribe-app input,
.transcribe-app select {
  border-radius: 0;
  font-family: inherit;
}


:root[data-keyboard-navigation="on"] .transcribe-app button:focus-visible,
:root[data-keyboard-navigation="on"] .transcribe-app input:focus-visible,
:root[data-keyboard-navigation="on"] .transcribe-app select:focus-visible {
  outline: 2px solid var(--tr-accent) !important;
  outline-offset: -2px;
}

:root[data-keyboard-navigation="on"] .transcribe-app canvas:focus-visible,
:root[data-keyboard-navigation="on"] .transcribe-app label[for]:focus-visible {
  outline: 2px solid var(--tr-accent) !important;
  outline-offset: -2px;
}

.transcribe-gate {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-rows: auto 1fr;
  background: var(--tr-bg);
}

.transcribe-gate-brand {
  padding: 1.45rem clamp(1rem, 3.6vw, 3rem);
  color: var(--tr-muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
}

.transcribe-gate-form {
  display: grid;
  width: min(100% - 2rem, 31rem);
  align-content: center;
  justify-self: center;
  padding-bottom: 8vh;
}

.transcribe-gate-form h1 {
  margin: 0 0 0.75rem;
  font-size: 2.15rem;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.transcribe-gate-form > p {
  margin: 0 0 2.25rem;
  color: var(--tr-muted);
}

.transcribe-gate-form label {
  margin-bottom: 0.45rem;
  color: var(--tr-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.transcribe-gate-entry {
  display: grid;
  grid-template-columns: 1fr auto;
}

.transcribe-gate-entry input,
.transcribe-gate-entry button {
  min-height: 3rem;
  border: 0;
  background: var(--tr-surface);
  color: var(--site-accent-ink);
  font: inherit;
}

.transcribe-gate-entry input {
  min-width: 0;
  padding: 0.65rem 0.8rem;
}

.transcribe-gate-entry button {
  min-width: 6.5rem;
  cursor: pointer;
  background: var(--tr-accent);
  color: var(--tr-text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.transcribe-gate-entry button:hover {
  background: var(--tr-accent);
}

.transcribe-gate-status {
  min-height: 1.45rem;
  margin: 0.55rem 0 1rem !important;
  color: var(--tr-accent) !important;
  font-weight: 700;
}

.transcribe-gate-form a {
  width: fit-content;
  color: var(--tr-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.transcribe-workspace {
  display: grid;
  height: 100vh;
  height: 100svh;
  min-width: 0;
  grid-template-rows: auto minmax(15rem, 1.15fr) minmax(12rem, 0.9fr) auto;
  overflow: hidden;
  background: var(--tr-bg);
}

.transcribe-control-bar {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(12rem, 1fr) auto;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: var(--tr-band-rule);
}

.transcribe-identity,
.transcribe-file-control,
.transcribe-tool-strip {
  display: flex;
  min-width: 0;
  align-items: stretch;
}

.transcribe-identity {
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.4rem;
  white-space: nowrap;
}

.transcribe-identity a,
.transcribe-identity strong {
  color: var(--tr-text);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
}

.transcribe-identity strong {
  color: var(--tr-accent);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.transcribe-identity a {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.transcribe-identity span {
  color: var(--tr-muted);
}

.transcribe-file-control {
  grid-column: 2;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding-left: 0.6rem;
}

.transcribe-file-name {
  min-width: 0;
  max-width: min(20rem, 26vw);
  flex: 0 1 auto;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transcribe-file-button {
  flex: 0 0 auto;
}

.transcribe-local-status {
  color: var(--tr-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.transcribe-file-button,
.transcribe-empty label {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  padding: 0.5rem 0.8rem;
  background: var(--tr-surface);
  color: var(--tr-text);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.transcribe-file-button:hover,
.transcribe-empty label:hover {
  background: var(--tr-panel);
}

.transcribe-tool-strip {
  grid-column: 3;
  justify-self: end;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-color: var(--tr-border) var(--tr-bg);
  scrollbar-width: thin;
}

.transcribe-tool-field,
.transcribe-tool-toggle,
.transcribe-tool-command {
  display: grid;
  min-width: max-content;
  min-height: 3.7rem;
  align-content: center;
  gap: 0.15rem;
  border: 0;
  padding: 0.55rem 0.7rem;
  background: transparent;
  color: var(--tr-text);
}

.transcribe-speed-control {
  display: grid;
  min-width: max-content;
  align-content: center;
  gap: 0.3rem;
  margin: 0;
  border: 0;
  padding: 0.35rem 0.7rem;
}

.transcribe-speed-control legend {
  padding: 0;
  color: var(--tr-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.transcribe-speed-buttons {
  display: flex;
  gap: 0.2rem;
}

.transcribe-speed-buttons button {
  width: 2.45rem;
  height: 2.45rem;
  cursor: pointer;
  border: 1px solid var(--tr-border);
  padding: 0;
  background: transparent;
  color: var(--tr-muted);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.transcribe-speed-buttons button:hover {
  border-color: var(--tr-border-hover);
  color: var(--tr-text);
}

.transcribe-speed-buttons button.is-active {
  border-color: var(--tr-accent);
  background: var(--tr-accent-soft);
  color: var(--tr-text);
}

.transcribe-speed-buttons .transcribe-custom-speed-toggle {
  font-size: 0.58rem;
  text-transform: uppercase;
}

.transcribe-custom-speed-slot {
  display: block;
  width: 2.45rem;
  height: 2.45rem;
}

.transcribe-speed-buttons .transcribe-custom-speed-slot input {
  width: 2.45rem;
  height: 2.45rem;
  appearance: textfield;
  border: 1px solid var(--tr-border);
  padding: 0.2rem;
  background: var(--tr-bg);
  color: var(--tr-text);
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}

.transcribe-custom-speed-slot input::-webkit-inner-spin-button,
.transcribe-custom-speed-slot input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.transcribe-tool-field > span,
.transcribe-tool-toggle > span {
  color: var(--tr-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.transcribe-tool-field select {
  appearance: none;
  min-width: 5.5rem;
  cursor: pointer;
  border: 0;
  padding: 0.12rem 1rem 0.12rem 0;
  background: linear-gradient(45deg, transparent 50%, currentColor 50%) right 0.3rem center / 0.3rem 0.3rem no-repeat;
  color: var(--tr-text);
  font-size: 0.84rem;
  font-weight: 700;
}

.transcribe-tool-toggle,
.transcribe-tool-command {
  cursor: pointer;
  text-align: left;
}

.transcribe-tool-toggle strong {
  color: var(--tr-muted);
  font-size: 0.84rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.transcribe-tool-toggle.is-active strong {
  color: var(--tr-accent);
}

.transcribe-tool-toggle:hover,
.transcribe-tool-command:hover:not(:disabled) {
  background: var(--tr-surface);
}

.transcribe-tool-command {
  justify-items: start;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.transcribe-tool-command:disabled {
  cursor: not-allowed;
  color: var(--tr-muted);
  opacity: 0.55;
}

.transcribe-timeline,
.transcribe-analysis {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.transcribe-timeline {
  display: grid;
  grid-template-rows: 4.25rem minmax(0, 1fr) auto;
}

.transcribe-overview-wrap,
.transcribe-waveform-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--tr-bg);
}

.transcribe-overview-wrap {
  border-bottom: 1px solid var(--tr-border-soft);
  cursor: ew-resize;
}

:root[data-keyboard-navigation="on"] .transcribe-overview-wrap:focus-visible,
:root[data-keyboard-navigation="on"] .transcribe-app #transcribe-waveform:focus-visible,
:root[data-keyboard-navigation="on"] .transcribe-app #transcribe-mark-ruler:focus-visible {
  outline: none;
}

.transcribe-overview,
.transcribe-waveform,
.transcribe-keyboard,
.transcribe-spectrogram {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.transcribe-waveform {
  cursor: crosshair;
}

#transcribe-waveform-hover-guide {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  border-left: 1px dashed var(--tr-text);
  opacity: 0.75;
  pointer-events: none;
}

.transcribe-empty {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.35rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: var(--tr-bg);
}

.transcribe-empty strong {
  font-size: 2.15rem;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.transcribe-empty span {
  margin-bottom: 0.75rem;
  color: var(--tr-muted);
}

.transcribe-empty label {
  background: var(--tr-accent);
  color: var(--tr-text);
}

.transcribe-timeline-status {
  display: grid;
  min-height: 4.25rem;
  grid-template-columns:
    minmax(8rem, 0.75fr)
    minmax(10rem, 1fr)
    minmax(10rem, 1fr)
    minmax(8.5rem, auto)
    minmax(8.5rem, auto)
    minmax(10rem, 0.85fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid var(--tr-border-soft);
  color: var(--tr-muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.transcribe-timeline-zoom {
  grid-column: 1;
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(3.75rem, 1fr);
  align-items: center;
  gap: 0.55rem;
  color: var(--tr-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.transcribe-timeline-zoom input {
  width: 100%;
  min-width: 3.75rem;
  accent-color: var(--tr-accent);
}

.transcribe-pitch-controls {
  display: contents;
}

.transcribe-pitch-adjustment {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1.8rem;
  align-items: center;
  gap: 0.3rem;
  color: var(--tr-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.transcribe-pitch-entry {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(3.75rem, 1fr) 3.5rem;
  align-items: center;
  gap: 0.45rem;
}

.transcribe-pitch-entry input[type="range"] {
  width: 100%;
  min-width: 3.75rem;
  accent-color: var(--tr-accent);
}

.transcribe-pitch-entry input[type="number"] {
  width: 3.5rem;
  min-height: 1.8rem;
  border: 1px solid var(--tr-border);
  padding: 0.2rem 0.25rem;
  background: var(--tr-surface);
  color: var(--tr-text);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.transcribe-tolerance-control {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1.8rem;
  align-items: center;
  gap: 0.3rem;
  color: var(--tr-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.transcribe-tolerance-control select {
  appearance: none;
  cursor: pointer;
  border: 0;
  width: 100%;
  min-width: 0;
  height: 1.8rem;
  padding: 0.2rem 1rem 0.2rem 0;
  background: linear-gradient(45deg, transparent 50%, currentColor 50%) right 0.3rem center / 0.3rem 0.3rem no-repeat;
  color: var(--tr-text);
  font: inherit;
  text-transform: none;
}

.transcribe-analysis {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.transcribe-pitch-readout {
  display: grid;
  grid-column: 6;
  justify-self: end;
  min-width: 12.75rem;
  grid-template-columns: 1fr 3.5rem 3.5rem;
  align-items: baseline;
  color: var(--tr-text);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.transcribe-pitch-readout span,
.transcribe-pitch-readout strong {
  padding-left: 0.5rem;
}

.transcribe-pitch-readout strong,
.transcribe-pitch-readout span:last-child {
  color: var(--tr-accent);
}

.transcribe-view-switcher {
  display: none;
  gap: 0.15rem;
  background: var(--tr-panel);
}

.transcribe-view-switcher button {
  min-height: 2rem;
  cursor: pointer;
  border: 0;
  padding: 0.35rem 0.65rem;
  background: transparent;
  color: var(--tr-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.transcribe-view-switcher button.is-active {
  background: var(--tr-surface);
  color: var(--tr-text);
}

.transcribe-analysis-grid {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-color: var(--tr-muted) var(--tr-bg);
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

:root[data-keyboard-navigation="on"] .transcribe-analysis-grid:focus-visible {
  outline: 2px solid var(--tr-accent);
  outline-offset: -2px;
}

.transcribe-spectrum-scroll {
  --tr-keyboard-height: clamp(4.25rem, 6vw, 5.5rem);
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: grid;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr) var(--tr-keyboard-height);
}

.transcribe-spectrum-scroll > canvas {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
}
.transcribe-spectrum-scroll > .transcribe-spectrogram { height: auto; align-self: stretch; }
.transcribe-spectrum-scroll > .transcribe-keyboard { height: var(--tr-keyboard-height); }

.transcribe-spectrogram,
.transcribe-keyboard {
  cursor: default;
}

.transcribe-analysis-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  background: var(--tr-border-soft);
}

.transcribe-analysis-progress::after {
  position: absolute;
  inset: 0;
  width: 35%;
  background: var(--tr-accent);
  content: "";
  animation: transcribe-progress 0.9s ease-in-out infinite;
}

.transcribe-analysis-progress span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@keyframes transcribe-progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(310%); }
}

.transcribe-transport {
  display: grid;
  min-height: 5rem;
  grid-template-columns: repeat(4, 3.4rem) minmax(5rem, auto) minmax(12rem, 1fr) minmax(8rem, 0.35fr);
  align-items: center;
  gap: 0.15rem;
  border-top: 1px solid var(--tr-border-soft);
  background: var(--tr-panel);
  padding-inline: 0.45rem;
  padding-bottom: env(safe-area-inset-bottom);
}

.transcribe-transport > button,
.transcribe-loop-control,
.transcribe-timecode,
.transcribe-volume {
  border: 0;
  background: transparent;
  color: var(--tr-text);
}

.transcribe-transport > button {
  display: grid;
  min-width: 0;
  min-height: 3.5rem;
  place-items: center;
  cursor: pointer;
  padding: 0.65rem;
  font-size: 0.9rem;
}

.transcribe-transport > button:hover:not(:disabled) {
  background: var(--tr-surface);
}

.transcribe-transport > button:disabled {
  cursor: not-allowed;
  color: var(--tr-muted);
  opacity: 0.45;
}

.transcribe-transport svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.transcribe-transport .transcribe-skip-icon {
  width: 1.65rem;
  height: 1.65rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.transcribe-skip-icon text {
  fill: currentColor;
  stroke: none;
  font: 700 10px var(--font-body, sans-serif);
  text-anchor: middle;
}

.transcribe-playback-progress {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
  padding: 0.4rem 1rem;
}

#transcribe-seek {
  width: 100%;
  min-width: 0;
  height: 1.5rem;
  margin: 0;
  accent-color: var(--tr-accent);
  cursor: pointer;
}

#transcribe-seek:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.transcribe-playback-progress .transcribe-timecode {
  padding: 0;
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.transcribe-play {
  background: var(--tr-surface);
}

.transcribe-play.is-playing {
  background: var(--tr-accent);
  color: var(--tr-text);
}

.transcribe-pause-icon,
.transcribe-play.is-playing .transcribe-play-icon {
  display: none;
}

.transcribe-play.is-playing .transcribe-pause-icon {
  display: block;
}

.transcribe-transport .transcribe-repeat-icon {
  width: 1.65rem;
  height: 1.65rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.transcribe-volume span {
  color: var(--tr-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.transcribe-transport .transcribe-loop-control.is-active {
  color: var(--tr-accent);
}

.transcribe-timecode {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  font-size: clamp(0.8rem, 1.6vw, 1.25rem);
  font-weight: 700;
  white-space: nowrap;
}

.transcribe-volume {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  background: var(--tr-bg);
}

.transcribe-volume input {
  width: 100%;
  min-width: 3rem;
  accent-color: var(--tr-accent);
}

@media (max-width: 1180px) {
  .transcribe-control-bar {
    grid-template-columns: auto minmax(12rem, 1fr);
  }

  .transcribe-tool-strip {
    grid-column: 1 / -1;
  }

  .transcribe-tool-field,
  .transcribe-tool-toggle,
  .transcribe-tool-command {
    min-height: 3.7rem;
  }

  .transcribe-workspace {
    grid-template-rows: auto minmax(13rem, 1.1fr) minmax(11rem, 0.9fr) auto;
  }

  .transcribe-volume {
    display: none;
  }

  .transcribe-transport {
    grid-template-columns: repeat(4, 3.25rem) minmax(5rem, auto) minmax(10rem, 1fr);
  }
}

@media (max-width: 720px) {
  html,
  body.transcribe-shell {
    overflow: auto;
    overflow-x: hidden;
  }

  .transcribe-workspace {
    min-height: 100svh;
    height: auto;
    grid-template-rows: auto minmax(25rem, 51svh) minmax(18rem, 39svh) auto;
    overflow: visible;
    padding-bottom: calc(7rem + env(safe-area-inset-bottom));
  }

  .transcribe-control-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    background: var(--tr-bg);
    padding: 0.35rem 0.5rem 0;
  }

  .transcribe-identity {
    min-height: 3.85rem;
    border-right: 0;
    padding: 0.7rem 0.85rem;
  }

  .transcribe-identity a,
  .transcribe-identity strong {
    font-size: 0.82rem;
  }

  .transcribe-file-control {
    display: contents;
  }

  .transcribe-local-status {
    display: none;
  }

  .transcribe-file-name {
    max-width: 5rem;
    padding-inline: 0.5rem;
  }

  .transcribe-file-button {
    grid-column: 3;
    min-width: 4.6rem;
    height: 100%;
  }

  .transcribe-tool-strip {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .transcribe-tool-field,
  .transcribe-tool-toggle,
  .transcribe-tool-command {
    min-height: 4.55rem;
    padding-inline: 0.85rem;
  }

  .transcribe-speed-control {
    padding-inline: 0.85rem;
  }

  .transcribe-filter-field {
    display: none;
  }

  .transcribe-timeline {
    grid-template-rows: 4.7rem minmax(0, 1fr) auto;
  }

  .transcribe-timeline-status {
    min-height: 7.2rem;
    grid-template-columns: auto minmax(5rem, 1fr) auto;
    grid-template-rows: auto auto auto;
    gap: 0.6rem;
    padding-inline: 0.55rem;
  }

  .transcribe-timeline-zoom {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: minmax(4.5rem, 1fr);
  }

  .transcribe-timeline-zoom > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .transcribe-view-switcher {
    display: flex;
    grid-column: 1;
    grid-row: 1;
  }

  .transcribe-pitch-readout {
    grid-column: 3;
    grid-row: 1;
    min-width: 2.6rem;
    grid-template-columns: 2.6rem;
    font-size: 0.72rem;
  }

  .transcribe-pitch-readout span {
    display: none;
  }

  .transcribe-tolerance-control {
    grid-column: auto;
    grid-row: 3;
    padding-block: 0.2rem;
  }

  .transcribe-tolerance-control[for="transcribe-spectrum-scale"] {
    grid-column: 1 / 3;
  }

  .transcribe-tolerance-control[for="transcribe-note-tolerance"] {
    grid-column: 3;
  }

  .transcribe-pitch-controls {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .transcribe-pitch-entry {
    grid-template-columns: minmax(4.5rem, 1fr) 3.25rem;
  }

  .transcribe-spectrum-scroll {
    width: 100%;
    min-width: 0;
    grid-template-rows: minmax(0, 1fr) 4.25rem;
  }

  .transcribe-transport {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 5.8rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: auto auto;
    border-top: 1px solid var(--tr-border-soft);
    background: var(--tr-panel);
  }

  .transcribe-volume {
    display: none;
  }

  .transcribe-loop-control {
    grid-column: 5;
  }

  .transcribe-playback-progress {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 0.15rem 0.65rem 0;
  }

  .transcribe-transport > button {
    min-height: 2.75rem;
  }

  .transcribe-timecode {
    min-width: 0;
    padding-inline: 0.45rem;
    font-size: 0.72rem;
    white-space: normal;
    text-align: center;
  }

  .transcribe-play {
    border-left: 1px solid var(--tr-border);
  }

  .transcribe-app[data-view-mode="timeline"] .transcribe-workspace {
    grid-template-rows: auto minmax(27rem, 58svh) minmax(13rem, 30svh) auto;
  }

  .transcribe-app[data-view-mode="analysis"] .transcribe-workspace {
    grid-template-rows: auto minmax(12rem, 23svh) minmax(21rem, 47svh) auto;
  }
}

@media (max-width: 420px) {
  .transcribe-identity {
    gap: 0.35rem;
    padding-inline: 0.55rem;
  }

  .transcribe-identity a,
  .transcribe-identity strong,
  .transcribe-identity span {
    font-size: 0.65rem;
  }

  .transcribe-pitch-readout {
    min-width: 2.25rem;
    grid-template-columns: 2.25rem;
  }

  .transcribe-pitch-readout span,
  .transcribe-pitch-readout strong {
    padding-left: 0.35rem;
  }

  .transcribe-gate-entry {
    grid-template-columns: 1fr;
  }

  .transcribe-gate-entry button {
    min-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .transcribe-analysis-progress::after {
    animation: none;
    width: 100%;
  }
}

/* Controls live with the signal or playback operation they affect. */
.transcribe-control-bar { grid-template-columns: auto minmax(0, 1fr); }
.transcribe-file-control { justify-content: flex-end; }
.transcribe-workspace {
  grid-template-rows: auto minmax(13rem, 1.1fr) minmax(16rem, 1fr) auto;
}
.transcribe-timeline { grid-template-rows: auto 3.5rem minmax(0, 1fr); }
.transcribe-timeline-status {
  display: flex;
  flex-wrap: wrap;
  min-height: 3rem;
  gap: 0.65rem 1.25rem;
  border-top: 0;
  border-bottom: 1px solid var(--tr-border-soft);
}
#transcribe-selection-status { flex: 1; order: 1; }
.transcribe-timeline-zoom { width: 14rem; }
.transcribe-timeline-status .transcribe-loop-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  order: 2;
}
.transcribe-loop-control svg {
  width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.transcribe-loop-control:disabled { opacity: 0.45; cursor: not-allowed; }
.transcribe-loop-control.is-active { color: var(--tr-accent); }
.transcribe-analysis { grid-template-rows: auto minmax(0, 1fr); }
.transcribe-analysis-controls {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.55rem 0.75rem;
  border-block: 1px solid var(--tr-border-soft);
}
.transcribe-analysis-controls .transcribe-tolerance-control { min-width: 8.5rem; }
.transcribe-pitch-readout { margin-left: auto; }
.transcribe-audio-pitch {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--tr-border-soft);
}
.transcribe-audio-pitch > strong {
  color: var(--tr-muted); font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.transcribe-pitch-controls {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem; width: min(100%, 42rem);
}
.transcribe-transport {
  grid-template-columns: repeat(4, 3.4rem) minmax(12rem, 1fr) minmax(8rem, 0.35fr);
  padding-top: 0.25rem;
}
.transcribe-playback-settings {
  grid-column: 1 / -1; display: flex; align-items: center;
  gap: 1rem; border-top: 1px solid var(--tr-border-soft);
  padding: 0.35rem 0.3rem;
}
.transcribe-speed-control { padding: 0.2rem 0; }
.transcribe-playback-settings .transcribe-tool-toggle { min-height: 2.75rem; }
@media (max-width: 1180px) {
  .transcribe-transport { grid-template-columns: repeat(4, 3.25rem) minmax(10rem, 1fr) minmax(7rem, 0.3fr); }
  .transcribe-volume { display: flex; }
}
@media (max-width: 720px) {
  .transcribe-control-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .transcribe-workspace,
  .transcribe-app[data-view-mode="timeline"] .transcribe-workspace {
    grid-template-rows: auto minmax(23rem, 52svh) minmax(23rem, 52svh) auto;
    padding-bottom: calc(7rem + env(safe-area-inset-bottom));
  }
  .transcribe-app[data-view-mode="analysis"] .transcribe-workspace {
    grid-template-rows: auto minmax(16rem, 35svh) minmax(27rem, 60svh) auto;
  }
  .transcribe-timeline { grid-template-rows: auto 3.5rem minmax(0, 1fr); }
  .transcribe-timeline-status { gap: 0.35rem 0.65rem; padding: 0.4rem 0.55rem; }
  .transcribe-view-switcher { display: flex; }
  .transcribe-timeline-zoom { flex: 1; width: auto; grid-template-columns: auto minmax(3rem, 1fr); }
  .transcribe-timeline-zoom > span { position: static; width: auto; height: auto; clip: auto; font-size: 0.65rem; }
  #transcribe-selection-status { flex-basis: 70%; font-size: 0.68rem; }
  .transcribe-analysis-controls { gap: 0.6rem; flex-wrap: wrap; padding: 0.5rem 0.65rem; }
  .transcribe-analysis-controls .transcribe-tolerance-control { flex: 1; min-width: 7rem; }
  .transcribe-pitch-readout {
    display: flex; flex-basis: 100%; justify-content: flex-end; gap: 0.75rem; min-width: 0;
  }
  .transcribe-pitch-readout span { display: block; }
  .transcribe-audio-pitch { display: grid; gap: 0.5rem; padding: 0.6rem 0.65rem; }
  .transcribe-pitch-controls { grid-column: auto; grid-row: auto; width: 100%; gap: 0.75rem; }
  .transcribe-transport {
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(5rem, 1.2fr);
    grid-template-rows: auto auto auto; padding-inline: 0.5rem;
  }
  .transcribe-playback-progress { grid-row: 1; }
  .transcribe-volume { padding: 0.35rem; gap: 0.25rem; flex-direction: column; }
  .transcribe-volume span { font-size: 0.6rem; }
  .transcribe-playback-settings { flex-wrap: wrap; gap: 0 0.5rem; padding: 0.25rem 0; }
  .transcribe-speed-control { flex-basis: 100%; }
  .transcribe-speed-buttons { justify-content: space-between; }
  .transcribe-speed-control legend { margin-bottom: 0.15rem; font-size: 0.65rem; }
  .transcribe-playback-settings .transcribe-tool-toggle { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; min-height: 2rem; }
  .transcribe-sound-controls .transcribe-tool-field { display: grid; min-height: 3.5rem; padding-inline: 0.6rem; }
}

/* Navbar owns file selection and playback settings. */
.transcribe-control-bar {
  position: relative; z-index: 30;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 1rem;
}
.transcribe-identity a,
.transcribe-identity strong,
.transcribe-identity span { font-size: clamp(1.08rem, 2vw, 1.45rem); }
.transcribe-file-control { justify-content: center; padding: 0; }
.transcribe-file-name {
  max-width: 100%; min-height: 2.75rem; padding: 0.5rem;
  border: 0; background: transparent; color: var(--tr-muted);
  cursor: pointer; text-decoration: underline; text-underline-offset: 0.25em;
  text-decoration-color: var(--tr-border);
}
.transcribe-file-name:hover { color: var(--tr-text); text-decoration-color: currentColor; }
.transcribe-control-bar .transcribe-playback-settings {
  grid-column: 3; justify-self: end; border: 0; padding: 0;
  flex-wrap: nowrap; gap: 0.75rem;
}
@media (max-width: 1180px) {
  .transcribe-control-bar { grid-template-columns: auto minmax(0, 1fr); gap: 0.35rem 1rem; }
  .transcribe-control-bar .transcribe-playback-settings { grid-column: 1 / -1; }
  .transcribe-file-control { justify-content: flex-end; }
}
@media (max-width: 1040px) {
  .transcribe-identity a,
  .transcribe-identity strong,
  .transcribe-identity span { font-size: clamp(1.45rem, 7vw, 2rem); }
}
@media (max-width: 720px) {
  .transcribe-control-bar { position: sticky; grid-template-columns: minmax(0, 1fr); gap: 0.25rem; padding: 0.5rem; }
  .transcribe-identity { min-height: 0; padding: 0.35rem 0; gap: 0.5rem; flex-wrap: wrap; }
  .transcribe-file-control { display: flex; grid-column: 1; justify-content: flex-start; }
  .transcribe-file-name { min-height: 2rem; text-align: left; padding: 0.25rem 0; }
  .transcribe-control-bar .transcribe-playback-settings { width: 100%; flex-wrap: wrap; gap: 0.1rem 0.5rem; }
  .transcribe-control-bar .transcribe-speed-control { flex-basis: 100%; }
  .transcribe-transport { grid-template-rows: auto auto; }
}
@media (max-width: 560px) {
  .transcribe-identity a,
  .transcribe-identity strong,
  .transcribe-identity span { font-size: clamp(1.1rem, 6.2vw, 1.45rem); }
}

.transcribe-identity > span {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: center; font-family: var(--font-ui); font-weight: 400;
  line-height: 1; transform: translateY(-0.04em);
}
.transcribe-file-name { font-size: 1rem; }
.transcribe-sound-controls { display: flex; align-items: center; gap: 0.25rem; }
.transcribe-sound-controls .transcribe-tool-field { display: grid; padding-inline: 0.5rem; }
@media (max-width: 720px) {
  .transcribe-control-bar .transcribe-playback-settings { justify-content: flex-end; }
  .transcribe-sound-controls { flex: 1; justify-content: flex-end; gap: 0; }
  .transcribe-sound-controls .transcribe-tool-field { min-width: 0; padding-inline: 0.4rem; }
  .transcribe-control-bar .transcribe-tool-toggle { display: grid; gap: 0.15rem; }
}
@media (max-width: 720px) {
  .transcribe-control-bar .transcribe-playback-settings {
    display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); align-items: center;
  }
  .transcribe-control-bar .transcribe-speed-control { grid-column: 1 / -1; min-width: 0; }
  .transcribe-sound-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
  .transcribe-sound-controls .transcribe-tool-field { padding-inline: 0.25rem; }
  .transcribe-sound-controls select { min-width: 0; width: 100%; }
}

/* Pitch adjustments share the row above the spectrum. */
.transcribe-analysis-controls .transcribe-audio-pitch {
  flex: 1; min-width: 0; padding: 0; border: 0; gap: 1rem;
}
.transcribe-analysis-controls .transcribe-pitch-controls { flex: 1; min-width: 0; width: auto; }
@media (max-width: 1180px) {
  .transcribe-analysis-controls .transcribe-audio-pitch > strong { display: none; }
}
@media (max-width: 720px) {
  .transcribe-analysis-controls .transcribe-audio-pitch { flex-basis: 100%; }
  .transcribe-analysis-controls .transcribe-audio-pitch > strong { display: block; }
  .transcribe-analysis-controls .transcribe-pitch-controls { width: 100%; }
}

/* Compact middle-row labels and centered square pitch values. */
.transcribe-analysis-controls .transcribe-pitch-adjustment,
.transcribe-analysis-controls .transcribe-tolerance-control {
  grid-template-rows: auto 2rem;
  gap: 0;
  line-height: 1.2;
}
.transcribe-analysis-controls .transcribe-pitch-entry {
  grid-template-columns: minmax(3.75rem, 1fr) 2rem;
}
.transcribe-analysis-controls .transcribe-pitch-entry input[type="number"] {
  appearance: textfield;
  width: 2rem;
  height: 2rem;
  min-height: 0;
  padding: 0;
  line-height: normal;
  text-align: center;
}
.transcribe-analysis-controls input[type="number"]::-webkit-inner-spin-button,
.transcribe-analysis-controls input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.transcribe-analysis-controls .transcribe-tolerance-control select {
  height: 2rem;
  padding-block: 0;
}

/* Timeline navigation joins the middle controls; Loop joins transport. */
.transcribe-timeline { grid-template-rows: 3.5rem minmax(0, 1fr); }
.transcribe-timeline-status {
  position: absolute; bottom: 0; left: 0; z-index: 2;
  min-height: 0; border: 0; padding: 0; background: var(--tr-bg);
}
#transcribe-selection-status:not(:empty) { display: block; padding: 0.4rem 0.75rem; }
.transcribe-analysis-controls .transcribe-timeline-zoom {
  flex: 0 1 10rem; min-width: 7rem; width: auto;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 2rem;
  gap: 0; line-height: 1.2;
}
.transcribe-transport {
  grid-template-columns: repeat(5, 3.4rem) minmax(10rem, 1fr) minmax(7rem, 0.3fr);
}
.transcribe-transport .transcribe-loop-control { display: flex; justify-content: center; gap: 0.35rem; }
.transcribe-transport .transcribe-loop-control span { font-size: 0.65rem; }
@media (max-width: 720px) {
  .transcribe-timeline { grid-template-rows: 3.5rem minmax(0, 1fr); }
  .transcribe-analysis-controls .transcribe-timeline-zoom { flex: 1; }
  .transcribe-transport { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(4rem, 1.1fr); }
  .transcribe-playback-progress { grid-column: 1 / -1; }
  .transcribe-transport .transcribe-loop-control { flex-direction: column; gap: 0.1rem; }
}
.transcribe-transport .transcribe-loop-control {
  flex-direction: column; gap: 0.1rem;
}
.transcribe-transport .transcribe-loop-control svg { flex-shrink: 0; }

.transcribe-playback-times { display: flex; justify-content: space-between; gap: 1rem; }
.transcribe-playback-times .transcribe-timecode { display: block; white-space: nowrap; }

/* Flat surface system: band rules, joined groups, and filled controls. */
.transcribe-app {
  --tr-band-rule: 1px solid var(--tr-border);
}
.transcribe-control-bar,
.transcribe-analysis-controls,
.transcribe-transport {
  background: var(--tr-bg);
  border-color: var(--tr-border);
}
.transcribe-app :is(button, select, input[type="number"], input[type="password"]),
.transcribe-empty label {
  border: 1px solid var(--tr-border);
  background-color: var(--tr-surface);
  color: var(--tr-text);
}
.transcribe-file-name {
  padding-inline: 0.65rem;
  text-decoration: none;
}
.transcribe-tool-field select,
.transcribe-tolerance-control select {
  padding-inline: 0.4rem 1rem;
  min-height: 2rem;
}
.transcribe-speed-buttons { gap: 0; }
.transcribe-speed-buttons > button + button,
.transcribe-custom-speed-slot { margin-left: -1px; }
.transcribe-speed-buttons > button,
.transcribe-custom-speed-slot { position: relative; }
.transcribe-speed-buttons button.is-active,
:root[data-keyboard-navigation="on"] .transcribe-speed-buttons > button:focus-visible,
:root[data-keyboard-navigation="on"] .transcribe-custom-speed-slot:focus-within { z-index: 1; }
.transcribe-speed-buttons button.is-active,
.transcribe-app button[aria-pressed="true"] {
  border-color: var(--tr-accent);
  background-color: var(--tr-accent-soft);
  color: var(--tr-text);
}
.transcribe-control-bar .transcribe-tool-toggle {
  padding: 0.4rem 0.5rem;
}
.transcribe-sound-controls {
  border-left: 1px solid var(--tr-border-soft);
  padding-left: 0.25rem;
}
.transcribe-analysis-controls .transcribe-audio-pitch {
  border-inline: 1px solid var(--tr-border-soft);
  padding-inline: 0.75rem;
}
.transcribe-transport { gap: 0; }
.transcribe-transport > button + button { border-left: 0; }
.transcribe-volume { background: var(--tr-bg); }
.transcribe-empty label {
  background: var(--tr-surface);
  border-color: var(--tr-border);
}
.transcribe-view-switcher { gap: 0; background: transparent; }
.transcribe-view-switcher button + button { border-left: 0; }
@media (hover: hover) {
  .transcribe-app :is(button, select, input[type="number"], input[type="password"]):hover:not(:disabled),
  .transcribe-empty label:hover {
    border-color: var(--tr-border-hover);
    background-color: var(--tr-surface);
    color: var(--tr-text);
  }
  .transcribe-speed-buttons > button:hover { z-index: 2; }
}
@media (max-width: 720px) {
  .transcribe-speed-buttons > button,
  .transcribe-custom-speed-slot { flex: 1; }
  .transcribe-speed-buttons .transcribe-custom-speed-slot :is(button, input) { width: 100%; }
  .transcribe-analysis-controls .transcribe-audio-pitch {
    border: 0;
    padding: 0;
  }
}
.transcribe-transport > button { height: 3.5rem; }
@media (max-width: 720px) {
  .transcribe-control-bar .transcribe-playback-settings {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }
  .transcribe-control-bar .transcribe-tool-toggle { min-width: 0; }
  .transcribe-sound-controls { border-left: 0; padding-left: 0; }
  .transcribe-transport > button { height: 3.5rem; }
}

/* Compensate for the UI font's slightly low optical center. */
.transcribe-file-name {
  padding-top: calc(0.5rem - 1px);
  padding-bottom: calc(0.5rem + 1px);
}
.transcribe-tool-field select,
.transcribe-analysis-controls .transcribe-tolerance-control select {
  padding-top: 0;
  padding-bottom: 2px;
}
@media (max-width: 720px) {
  .transcribe-file-name {
    padding-top: calc(0.25rem - 1px);
    padding-bottom: calc(0.25rem + 1px);
  }
}

/* Separate dropdown labels from their controls. */
.transcribe-tool-field,
.transcribe-analysis-controls .transcribe-tolerance-control {
  gap: 0.35rem;
}

/* Shared label spacing and aligned control edges. */
.transcribe-control-bar .transcribe-speed-control {
  padding: 0;
  gap: 0;
}
.transcribe-speed-control legend {
  margin-bottom: 0.35rem;
}
.transcribe-control-bar .transcribe-playback-settings,
.transcribe-sound-controls {
  align-items: end;
}
.transcribe-sound-controls .transcribe-tool-field {
  min-height: 0;
  padding-block: 0;
}
.transcribe-sound-controls select {
  height: 2.45rem;
}
.transcribe-control-bar .transcribe-tool-toggle {
  min-height: 2.45rem;
}
.transcribe-analysis-controls .transcribe-pitch-adjustment,
.transcribe-analysis-controls .transcribe-timeline-zoom {
  gap: 0.35rem;
}

/* Musical annotations share the timeline's field and coordinate space. */
.transcribe-timeline { grid-template-rows: 3.5rem auto 2rem minmax(0, 1fr); }
.transcribe-mark-tools { min-width: 0; border-bottom: 1px solid var(--tr-border-soft); font-size: 0.78rem; }
.transcribe-mark-tools summary { padding: 0.45rem 0.65rem; cursor: pointer; font-weight: 700; }
.transcribe-mark-tools summary span { margin-left: 1rem; color: var(--tr-muted); font-weight: 400; }
.transcribe-mark-tools fieldset { margin: 0; padding: 0.5rem 0.65rem; border: 0; max-height: 15rem; overflow: auto; }
.transcribe-mark-tools legend { font-weight: 700; }
.transcribe-mark-tools p { margin: 0.5rem 0; }
.transcribe-mark-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.transcribe-mark-actions label { display: inline-flex; gap: 0.4rem; align-items: center; }
.transcribe-mark-tools button, .transcribe-mark-tools select, .transcribe-mark-tools input[type="number"] { color: var(--tr-text); background: var(--tr-bg); border: 1px solid var(--tr-border); border-radius: 0; padding: 0.35rem 0.5rem; min-height: 2rem; font: inherit; }
.transcribe-mark-tools input[type="number"] { width: 8rem; }
.transcribe-mark-tools input[type="checkbox"] { accent-color: var(--tr-accent); }
.transcribe-mark-tools button:disabled { opacity: 0.45; cursor: default; }
.transcribe-mark-tools button[aria-pressed="true"] { border-color: var(--tr-accent); }
:root[data-keyboard-navigation="on"] .transcribe-mark-tools :focus-visible { outline: 2px solid var(--tr-accent) !important; outline-offset: -2px; }
.transcribe-mark-tools ol { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; padding: 0; margin: 0.5rem 0; max-height: 6rem; overflow: auto; }
.transcribe-mark-tools [data-status]:not(:empty) { display: block; padding: 0.25rem 0.65rem; }
.transcribe-mark-help { color: var(--tr-muted); }
#transcribe-mark-ruler { display: block; width: 100%; height: 2rem; min-width: 0; touch-action: none; border-bottom: 1px solid var(--tr-border-soft); }
.transcribe-mark-tools [hidden] { display: none !important; }
@media (max-width: 720px) {
  .transcribe-mark-tools button, .transcribe-mark-tools select, .transcribe-mark-tools input[type="number"] { min-height: 2.75rem; }
  .transcribe-mark-tools summary { min-height: 2.75rem; display: flex; align-items: center; }
  .transcribe-mark-tools summary span { margin-left: 0.6rem; }
}

/* Secondary controls expand from the navbar; transport keeps both sliders. */
.transcribe-control-bar { grid-template-columns: auto minmax(0, 1fr) auto auto; }
#transcribe-controls-toggle { grid-column: 4; min-height: 2.75rem; padding: 0.4rem 0.65rem; cursor: pointer; }
#transcribe-controls-toggle[aria-expanded="true"] { border-color: var(--tr-accent); }
.transcribe-controls-panel {
  position: absolute; top: 100%; right: 0; width: min(100%, 60rem);
  max-height: min(70svh, 36rem); overflow: auto;
  border: 1px solid var(--tr-border); background: var(--tr-bg);
}
.transcribe-controls-panel .transcribe-analysis-controls { flex-wrap: wrap; gap: 0.85rem; border: 0; }
.transcribe-controls-panel .transcribe-audio-pitch { flex-basis: 100%; border: 0; padding: 0; }
.transcribe-controls-panel .transcribe-tolerance-control { flex: 1; }
.transcribe-controls-panel .transcribe-mark-tools { border-top: 1px solid var(--tr-border-soft); border-bottom: 0; }
.transcribe-timeline { grid-template-rows: 3.5rem 2rem minmax(0, 1fr); }
.transcribe-analysis { grid-template-rows: minmax(0, 1fr); }
.transcribe-transport-sliders { display: grid; min-width: 0; gap: 0.25rem; padding: 0.25rem 0.65rem; }
.transcribe-transport-sliders > label {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center;
  min-width: 0; width: auto; padding: 0; gap: 0.5rem;
}
.transcribe-transport-sliders input { width: 100%; min-width: 0; margin: 0; }
.transcribe-transport-sliders span { font-size: 0.65rem; }
.transcribe-transport { grid-template-columns: repeat(5, 3.4rem) minmax(10rem, 1fr) minmax(15rem, 0.45fr); }
@media (max-width: 1380px) {
  .transcribe-control-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
  #transcribe-controls-toggle { grid-column: 3; grid-row: 1; }
  .transcribe-control-bar .transcribe-playback-settings { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 720px) {
  .transcribe-control-bar { grid-template-columns: minmax(0, 1fr) auto; }
  #transcribe-controls-toggle { grid-column: 2; font-size: 0.75rem; }
  .transcribe-identity { grid-column: 1; }
  .transcribe-file-control { grid-row: 2; grid-column: 1 / -1; }
  .transcribe-control-bar .transcribe-playback-settings { grid-row: 3; }
  .transcribe-analysis { grid-template-rows: auto minmax(0, 1fr); }
  .transcribe-analysis > .transcribe-view-switcher { justify-content: flex-start; }
  .transcribe-transport { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .transcribe-transport-sliders { grid-column: 1 / -1; grid-row: 3; grid-template-columns: 1fr; }
  .transcribe-transport-sliders > label { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .transcribe-workspace { padding-bottom: calc(11rem + env(safe-area-inset-bottom)) !important; }
}
.transcribe-transport-sliders > label { grid-column: 1; grid-row: auto; }
.transcribe-numbering-control { flex: 1; min-width: 12rem; }
.transcribe-numbering-control fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
#transcribe-controls-toggle {
  height: 2.45rem; min-height: 2.45rem; align-self: end;
  padding: 0 0.65rem; background: var(--tr-surface);
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
@media (max-width: 1380px) {
  #transcribe-controls-toggle { align-self: center; }
}

/* Recording configuration lives beside the audio filename. */
.transcribe-file-control { flex-wrap: nowrap; min-width: 0; align-self: end; align-items: center; }
#transcribe-config-actions { display: inline-flex; flex-direction: column; gap: 0; flex-shrink: 0; }
#transcribe-config-actions[hidden] { display: none; }
#transcribe-config-actions button {
  height: 1.225rem; min-height: 0; padding: 0 0.5rem; line-height: 1;
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap;
}
#transcribe-config-actions button + button { border-top: 0; }
#transcribe-config-status {
  position: fixed; top: calc(0.75rem + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%); z-index: 100;
  width: max-content; max-width: calc(100vw - 2rem); box-sizing: border-box;
  padding: 0.6rem 0.9rem; border: 1px solid var(--tr-border);
  background: var(--tr-surface); color: var(--tr-text);
  font-size: 0.8rem; line-height: 1.4; text-align: center; pointer-events: none;
}
#transcribe-config-status { display: flex; align-items: center; gap: 0.75rem; pointer-events: auto; }
#transcribe-config-status[hidden] { display: none; }
#transcribe-config-dismiss {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 1.75rem; height: 1.75rem; min-height: 0; padding: 0;
  color: inherit; background: transparent; border: 0;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
}
:root[data-keyboard-navigation="on"] #transcribe-config-dismiss:focus-visible { outline: 2px solid var(--tr-accent) !important; outline-offset: -2px; }
@media (max-width: 1380px) {
  .transcribe-file-control { align-self: center; }
}

/* The empty timeline is one keyboard-accessible upload target. */
.transcribe-app .transcribe-empty {
  width: 100%; height: 100%; border: 0; border-radius: 0;
  justify-items: center; text-align: center; cursor: pointer;
  background: var(--tr-bg); color: var(--tr-text); gap: 0.75rem;
}
.transcribe-empty svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.5; }
.transcribe-empty strong { font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.4; letter-spacing: 0; }
.transcribe-empty span { font-size: 0.8rem; margin: 0; }
.transcribe-timeline.is-file-drop { outline: 2px solid var(--tr-accent); outline-offset: -2px; }
.transcribe-timeline.is-file-drop .transcribe-empty { background: var(--tr-surface); }

#transcribe-chords { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2; display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 0.375rem 0.75rem; max-width: calc(100% - 1rem); padding: 0.375rem 0.5rem; border: 1px solid var(--tr-border); background: var(--tr-bg); font-size: 0.9rem; color: var(--tr-text); pointer-events: none; }
#transcribe-chords[hidden], #transcribe-chords:empty { display: none; }
#transcribe-chords span { font-weight: 400; color: var(--tr-muted); }
#transcribe-chords strong { font-weight: 800; }
.transcribe-analysis { grid-template-rows: minmax(0, 1fr); }
@media (max-width: 720px) {
  .transcribe-analysis { grid-template-rows: auto minmax(0, 1fr); }
  #transcribe-chords { top: 3rem; }
}

/* Keep recovery status with the recording name without crowding config actions. */
.transcribe-file-summary { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.transcribe-file-summary .transcribe-file-name { max-width: 100%; }
#transcribe-autosave-status { color: var(--tr-muted); font-size: 0.65rem; line-height: 1.4; }
#transcribe-autosave-status[data-error="true"] { color: var(--tr-accent); }

/* Workbench rhythm: 4px within fields, 8px within groups, 16px between tasks. */
.transcribe-app {
  --tr-field-gap: 0.25rem;
  --tr-group-gap: 0.5rem;
  --tr-section-gap: 1rem;
  --tr-control-height: 2.25rem;
}
.transcribe-control-bar {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--tr-group-gap) var(--tr-section-gap);
  padding: 0.75rem 1rem;
}
.transcribe-identity { padding: 0; gap: 0.5rem; }
.transcribe-identity :is(a, strong, span) { font-size: 1.125rem; }
.transcribe-file-control {
  grid-column: 2; grid-row: 1; justify-self: end; align-self: start;
  width: min(100%, 34rem); align-items: start; gap: var(--tr-group-gap);
}
.transcribe-file-summary { gap: var(--tr-field-gap); }
.transcribe-file-summary .transcribe-file-name {
  min-height: var(--tr-control-height); height: var(--tr-control-height);
  padding: 0 0.75rem; text-align: left; font-size: 0.875rem;
}
#transcribe-autosave-status { min-height: 1rem; font-size: 0.75rem; line-height: 1rem; }
#transcribe-config-actions { flex-direction: row; gap: 0; }
#transcribe-config-actions button {
  height: var(--tr-control-height); padding: 0 0.5rem; font-size: 0.6875rem;
}
#transcribe-config-actions button + button { border-top: 1px solid var(--tr-border); border-left: 0; }
#transcribe-controls-toggle {
  grid-column: 3; grid-row: 1; align-self: start;
  height: var(--tr-control-height); min-height: var(--tr-control-height);
}
.transcribe-control-bar .transcribe-playback-settings {
  grid-column: 1 / -1; grid-row: 2; justify-self: stretch;
  display: flex; justify-content: flex-start; align-items: end;
  gap: var(--tr-section-gap); width: 100%;
}
.transcribe-speed-control legend,
.transcribe-tool-field > span { font-size: 0.6875rem; line-height: 1rem; }
.transcribe-speed-control legend { margin-bottom: var(--tr-field-gap); }
.transcribe-speed-buttons > button,
.transcribe-speed-buttons .transcribe-custom-speed-slot,
.transcribe-speed-buttons .transcribe-custom-speed-slot :is(button, input) {
  width: 2.75rem; height: var(--tr-control-height); font-size: 0.6875rem;
}
.transcribe-control-bar .transcribe-tool-toggle {
  height: var(--tr-control-height); min-height: var(--tr-control-height);
  display: flex; align-items: center; gap: var(--tr-group-gap); padding: 0 0.625rem;
}
.transcribe-tool-toggle strong { font-size: 0.875rem; }
.transcribe-sound-controls {
  margin-left: auto; padding: 0; border: 0;
  display: grid; grid-template-columns: repeat(3, 6rem); gap: var(--tr-group-gap);
}
.transcribe-sound-controls .transcribe-tool-field { padding: 0; gap: var(--tr-field-gap); }
.transcribe-sound-controls select { height: var(--tr-control-height); min-height: 0; width: 100%; font-size: 0.875rem; }
.transcribe-controls-panel { width: min(calc(100% - 2rem), 42rem); right: 1rem; }
.transcribe-controls-panel .transcribe-analysis-controls {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end; padding: 1rem; gap: 1rem;
}
.transcribe-controls-panel .transcribe-audio-pitch { grid-column: 1 / -1; }
.transcribe-controls-panel .transcribe-pitch-controls { gap: 1rem; }
.transcribe-controls-panel .transcribe-numbering-control { grid-column: 1 / -1; min-width: 0; }
.transcribe-controls-panel .transcribe-tolerance-control,
.transcribe-controls-panel .transcribe-pitch-adjustment {
  grid-column: auto; grid-row: auto; min-width: 0;
  grid-template-rows: auto var(--tr-control-height); gap: var(--tr-field-gap); padding: 0;
}
.transcribe-controls-panel .transcribe-tolerance-control select {
  height: var(--tr-control-height); width: 100%; min-width: 0;
}
.transcribe-controls-panel .transcribe-pitch-entry { grid-template-columns: minmax(0, 1fr) 2.75rem; gap: var(--tr-group-gap); }
.transcribe-controls-panel .transcribe-pitch-entry input[type="number"] { width: 2.75rem; height: var(--tr-control-height); }
.transcribe-transport {
  min-height: 0; grid-template-columns: repeat(5, 2.75rem) minmax(8rem, 1fr) minmax(16rem, 0.4fr);
  padding: 0 1rem env(safe-area-inset-bottom);
}
.transcribe-transport > button { height: 2.75rem; min-height: 2.75rem; padding: 0.375rem; }
.transcribe-transport .transcribe-repeat-icon { height: 1.25rem; width: 1.25rem; }
.transcribe-playback-progress { padding: 0 1rem; gap: 0; }
.transcribe-transport-sliders { padding: 0; gap: var(--tr-field-gap); }
.transcribe-transport-sliders > label { grid-template-columns: 6rem minmax(0, 1fr); gap: var(--tr-group-gap); }
.transcribe-transport-sliders span { font-size: 0.6875rem; }
#transcribe-chords:empty { min-height: 0; padding: 0; }
@media (max-width: 900px) {
  .transcribe-identity { flex-wrap: wrap; max-width: 13rem; }
  .transcribe-control-bar .transcribe-playback-settings { gap: 0.75rem; }
  .transcribe-sound-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .transcribe-sound-controls .transcribe-tool-field { min-width: 0; }
  .transcribe-transport { grid-template-columns: repeat(5, 2.75rem) minmax(6rem, 1fr) 13rem; }
  .transcribe-transport-sliders > label { grid-template-columns: 5.5rem minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .transcribe-app { --tr-control-height: 2.75rem; }
  .transcribe-control-bar { grid-template-columns: minmax(0, 1fr) auto; padding: 0.75rem; gap: 0.75rem; }
  .transcribe-identity { gap: 0.25rem 0.5rem; min-height: 0; }
  .transcribe-identity :is(a, strong, span) { font-size: 1.125rem; }
  #transcribe-controls-toggle { grid-column: 2; align-self: center; }
  .transcribe-file-control {
    grid-column: 1 / -1; grid-row: 2; width: 100%;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--tr-field-gap) var(--tr-group-gap);
  }
  .transcribe-file-summary { display: contents; }
  .transcribe-file-summary .transcribe-file-name { grid-column: 1 / -1; }
  #transcribe-autosave-status { align-self: center; }
  #transcribe-config-actions { grid-column: 2; grid-row: 2; }
  #transcribe-config-actions button { height: 2rem; }
  .transcribe-control-bar .transcribe-playback-settings {
    grid-row: 3; display: grid; grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.5rem 0.75rem;
  }
  .transcribe-control-bar .transcribe-speed-control { grid-column: 1 / -1; }
  .transcribe-speed-buttons > button, .transcribe-speed-buttons .transcribe-custom-speed-slot { width: auto; min-width: 0; }
  .transcribe-speed-buttons .transcribe-custom-speed-slot :is(button, input) { width: 100%; }
  .transcribe-control-bar .transcribe-tool-toggle { display: grid; gap: 0; justify-content: start; padding: 0.25rem 0.5rem; }
  .transcribe-sound-controls { width: 100%; gap: 0.5rem; margin: 0; }
  .transcribe-sound-controls select { padding-inline: 0.25rem 0.75rem; font-size: 0.8125rem; }
  .transcribe-controls-panel { right: 0.75rem; width: calc(100% - 1.5rem); max-height: 55svh; }
  .transcribe-controls-panel .transcribe-analysis-controls { gap: 0.75rem; padding: 0.75rem; }
  .transcribe-controls-panel .transcribe-pitch-controls { gap: 0.75rem; }
  .transcribe-workspace,
  .transcribe-app[data-view-mode="timeline"] .transcribe-workspace {
    grid-template-rows: auto minmax(17rem, 40svh) minmax(18rem, 44svh) auto;
    padding-bottom: calc(10rem + env(safe-area-inset-bottom)) !important;
  }
  .transcribe-app[data-view-mode="analysis"] .transcribe-workspace {
    grid-template-rows: auto minmax(14rem, 30svh) minmax(21rem, 52svh) auto;
  }
  .transcribe-transport {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom)); gap: 0.375rem 0;
  }
  .transcribe-transport > button { width: 3rem; justify-self: center; border: 1px solid var(--tr-border); }
  .transcribe-playback-progress { padding: 0; }
  .transcribe-transport-sliders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .transcribe-transport-sliders > label { grid-column: auto; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .transcribe-transport-sliders input { height: 1.5rem; }
}
@media (min-width: 721px) {
  .transcribe-controls-panel .transcribe-analysis-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .transcribe-controls-panel .transcribe-numbering-control { grid-column: auto; }
}
@media (min-width: 721px) and (max-width: 900px) {
  .transcribe-speed-buttons > button,
  .transcribe-speed-buttons .transcribe-custom-speed-slot,
  .transcribe-speed-buttons .transcribe-custom-speed-slot :is(button, input) { width: 2.5rem; }
}

/* Keep the navbar on one row; leave its popover outside the scroll area. */
.transcribe-control-bar { display: block; min-width: 0; padding: 0 0.75rem; }
.transcribe-navbar-row {
  display: flex; align-items: center; gap: 0.75rem;
  min-width: 0; overflow-x: auto; overscroll-behavior-x: contain;
}
.transcribe-navbar-row > * { flex-shrink: 0; }
.transcribe-navbar-row .transcribe-identity { flex-wrap: nowrap; max-width: none; white-space: nowrap; }
.transcribe-navbar-row .transcribe-identity :is(a, strong, span) { font-size: 0.875rem; }
.transcribe-navbar-row .transcribe-file-control {
  display: flex; flex: 1 0 10rem; width: auto; max-width: 24rem;
  align-self: center; align-items: center;
}
.transcribe-navbar-row .transcribe-file-summary { display: grid; min-width: 0; flex: 1; }
.transcribe-navbar-row #transcribe-autosave-status:empty { display: none; }
.transcribe-navbar-row #transcribe-config-actions button { height: var(--tr-control-height); }
.transcribe-navbar-row .transcribe-playback-settings {
  display: flex; flex: 0 0 auto; flex-wrap: nowrap; width: auto; align-items: flex-end; gap: 0.75rem;
}
.transcribe-navbar-row .transcribe-speed-control { position: relative; flex: 0 0 auto; padding: 0; }
.transcribe-navbar-row .transcribe-speed-control legend {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.transcribe-navbar-row .transcribe-speed-buttons { display: flex; flex-wrap: nowrap; }
.transcribe-navbar-row .transcribe-speed-buttons > button,
.transcribe-navbar-row .transcribe-custom-speed-slot,
.transcribe-navbar-row .transcribe-custom-speed-slot :is(button, input) { width: 2.5rem; flex-shrink: 0; }
.transcribe-navbar-row .transcribe-tool-toggle { display: flex; gap: 0.375rem; }
.transcribe-navbar-row .transcribe-sound-controls {
  display: flex; width: auto; margin: 0; gap: 0.5rem;
}
.transcribe-navbar-row .transcribe-tool-field { display: flex; align-items: center; gap: 0.375rem; }
.transcribe-navbar-row .transcribe-tool-field > span { white-space: nowrap; }
.transcribe-navbar-row .transcribe-tool-field select { width: 5.25rem; font-size: 0.75rem; }
.transcribe-navbar-row #transcribe-controls-toggle { align-self: flex-end; }

/* Three stable navbar groups, with save status inside the filename box. */
.transcribe-navbar-row { gap: 1rem; padding-block: 0.75rem; }
.transcribe-navbar-row .transcribe-file-control {
  position: relative; flex: 1 0 17rem; max-width: none; justify-content: center;
  gap: 0.5rem;
}
.transcribe-navbar-row .transcribe-file-summary { position: relative; display: block; flex: 0 1 15rem; }
.transcribe-navbar-row .transcribe-file-name { width: 100%; padding-right: 2rem; }
.transcribe-navbar-row #transcribe-autosave-status,
.transcribe-navbar-row #transcribe-autosave-status:empty {
  display: flex; align-items: center; position: absolute; top: 50%; left: auto; right: 0.5rem;
  transform: translateY(-50%); width: 1rem; height: 1rem; min-height: 0; margin: 0;
}
#transcribe-autosave-status svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#transcribe-autosave-status path { display: none; }
#transcribe-autosave-status[data-state="saved"] .save-check,
#transcribe-autosave-status[data-state="error"] .save-error,
#transcribe-autosave-status[data-state="pending"] .save-pending { display: block; }
#transcribe-autosave-status[data-state="idle"] { opacity: 0.4; }
#transcribe-autosave-status[data-state="error"] { color: var(--tr-accent); }
.transcribe-navbar-controls { display: flex; align-items: flex-end; gap: 0.75rem; margin-left: auto; }
.transcribe-navbar-row .transcribe-tool-field { position: relative; display: grid; gap: 0.25rem; }
.transcribe-navbar-row .transcribe-tool-field > span { position: static; font-size: 0.6rem; line-height: 0.75rem; }
.transcribe-navbar-row .transcribe-tool-field select { width: 4.75rem; }
.transcribe-navbar-row #transcribe-config-actions button:disabled {
  color: var(--tr-muted); opacity: 1; cursor: not-allowed;
}

.transcribe-navbar-row .transcribe-file-name { padding-right: 0.75rem; }
.transcribe-navbar-row .transcribe-restore-status {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  color: var(--tr-muted);
  font-size: 0.625rem;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.transcribe-navbar-row .transcribe-file-summary.has-restore-status .transcribe-file-name {
  padding-right: 6rem;
}
.transcribe-navbar-row .transcribe-file-control { flex-basis: 13rem; align-self: flex-end; }
.transcribe-navbar-row #transcribe-config-actions { flex-direction: column; }
.transcribe-navbar-row #transcribe-config-actions button {
  height: calc(var(--tr-control-height) / 2); min-height: 0;
  padding: 0 0.5rem; line-height: 1; font-size: 0.625rem;
}
.transcribe-navbar-row #transcribe-config-actions button + button {
  border: 1px solid var(--tr-border); margin-top: -1px;
}
.transcribe-navbar-row .transcribe-identity {
  transform: none;
}
.transcribe-navbar-row .transcribe-identity :is(a, strong, span) { font-size: 1.5rem; line-height: 1.1; }

#transcribe-chords-toggle {
  justify-self: start; width: max-content; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}

/* Motion acknowledges commands; signal canvases remain immediate and unfiltered. */
.transcribe-app {
  --tr-motion-fast: 120ms;
  --tr-motion-open: 220ms;
  --tr-motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
.transcribe-app :is(button, select, .transcribe-empty) {
  transition: border-color var(--tr-motion-fast),
    background-color var(--tr-motion-fast), color var(--tr-motion-fast);
}
.transcribe-controls-panel:not([hidden]) {
  transform-origin: top right;
  animation: transcribe-controls-open var(--tr-motion-open) var(--tr-motion-ease);
}
@keyframes transcribe-controls-open {
  from { opacity: 0.65; transform: translateY(-6px); clip-path: inset(0 0 12% 0); }
  to { opacity: 1; transform: translateY(0); clip-path: inset(0); }
}
.transcribe-empty svg {
  transition: transform var(--tr-motion-open) var(--tr-motion-ease), color var(--tr-motion-fast);
}
.transcribe-timeline.is-file-drop .transcribe-empty svg {
  transform: translateY(-4px);
  color: var(--tr-accent);
}
.transcribe-play:not(.is-playing) .transcribe-play-icon,
.transcribe-play.is-playing .transcribe-pause-icon {
  animation: transcribe-command-confirm var(--tr-motion-fast) ease-out;
}
@keyframes transcribe-command-confirm {
  from { opacity: 0.45; }
  to { opacity: 1; }
}
#transcribe-config-status:not([hidden]) {
  animation: transcribe-command-confirm 180ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .transcribe-app { --tr-motion-fast: 80ms; }
  .transcribe-controls-panel:not([hidden]),
  #transcribe-config-status:not([hidden]) {
    animation: transcribe-command-confirm 80ms ease-out;
  }
  .transcribe-timeline.is-file-drop .transcribe-empty svg { transform: none; }
}

/* A pocket reference for working a phrase without leaving the keyboard. */
.transcribe-shortcuts { border-top: 1px solid var(--tr-border); padding: 0.75rem 1rem; }
.transcribe-shortcuts h2 { margin: 0; font: inherit; font-size: 0.8rem; font-weight: 700; }
.transcribe-shortcuts h3 { margin: 1rem 0 0.75rem; font: inherit; font-size: 0.8rem; font-weight: 700; }
.transcribe-shortcuts h2 > kbd { float: right; }
:root[data-keyboard-navigation="on"] .transcribe-shortcuts h2:focus-visible { outline: 2px solid var(--tr-accent); outline-offset: 4px; }
.transcribe-shortcuts kbd {
  display: inline-block; min-width: 1.5rem; padding: 0.15rem 0.35rem;
  border: 1px solid var(--tr-border); background: var(--tr-surface);
  color: var(--tr-text); font: inherit; font-size: 0.75rem; text-align: center;
}
.transcribe-shortcuts p { margin: 0.75rem 0; font-size: 0.875rem; line-height: 1.5; }
.transcribe-shortcuts dl { margin: 0; display: grid; gap: 0.5rem; }
.transcribe-shortcuts dl > div { display: grid; grid-template-columns: 13rem minmax(0, 1fr); align-items: center; gap: 0.75rem; }
.transcribe-shortcuts dt { white-space: normal; font-size: 0.75rem; }
.transcribe-shortcuts dd { margin: 0; font-size: 0.8125rem; }
.transcribe-shortcuts .transcribe-shortcuts-note { color: var(--tr-muted); font-size: 0.75rem; margin-bottom: 0; }
@media (max-width: 720px) {
  .transcribe-shortcuts { padding: 0.75rem; }

  .transcribe-shortcuts dl > div { grid-template-columns: 8rem minmax(0, 1fr); gap: 0.5rem; }
}

.transcribe-loop-range { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 10px; }
.transcribe-loop-range label { display: grid; gap: 4px; }
.transcribe-loop-range input { width: 8em; }
.transcribe-loop-help, #transcribe-marks [data-status] { font-size: 12px; line-height: 1.4; }
.transcribe-loop-help { margin: 8px 0 0; }

/* Mobile: the signal workspace fits the viewport; only Controls scrolls. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  html, body.transcribe-shell { overflow: hidden; }
  .transcribe-app { min-height: 100svh; min-height: 100dvh; }
  .transcribe-app[data-view-mode] .transcribe-workspace {
    height: 100svh; height: 100dvh; min-height: 0;
    grid-template-rows: auto minmax(0, 1.2fr) minmax(0, 0.8fr) auto;
    padding-bottom: 0 !important; overflow: hidden;
  }
  .transcribe-control-bar { position: relative; padding: 0 0.5rem; z-index: 30; }
  .transcribe-navbar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.375rem; padding-block: 0.5rem; overflow: visible; }
  .transcribe-navbar-row .transcribe-identity { grid-column: 1; white-space: nowrap; }
  .transcribe-navbar-row .transcribe-identity :is(a, strong, span) { font-size: clamp(0.8rem, 3.3vw, 1.125rem); }
  .transcribe-navbar-row .transcribe-navbar-controls { grid-column: 2; grid-row: 1 / 3; margin: 0; align-self: stretch; align-items: center; }
  .transcribe-navbar-row .transcribe-file-control { grid-column: 1; grid-row: 2; width: 100%; min-width: 0; justify-content: start; }
  .transcribe-navbar-row .transcribe-file-summary { flex: 1; min-width: 0; }
  .transcribe-navbar-row .transcribe-file-name { height: 2.75rem; min-width: 0; }
  .transcribe-timeline { min-height: 0; grid-template-rows: 2rem 2.75rem minmax(0, 1fr); }
  #transcribe-mark-ruler { height: 2.75rem; }
  .transcribe-analysis { min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .transcribe-view-switcher { display: none; }
  .transcribe-spectrum-scroll { --tr-keyboard-height: 3rem; width: 100%; min-width: 0; grid-template-rows: minmax(0, 1fr) var(--tr-keyboard-height); }
  .transcribe-transport { position: static; min-height: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: auto auto; padding: 0.25rem 0.5rem max(0.5rem, env(safe-area-inset-bottom)); }
  .transcribe-transport > button { grid-row: 2; }
  .transcribe-playback-progress { grid-column: 1 / -1; grid-row: 1; }
  .transcribe-controls-panel { right: 0.5rem; width: calc(100% - 1rem); max-height: calc(100dvh - 7rem); overscroll-behavior: contain; }
  .transcribe-mobile-controls { display: grid; gap: 1rem; padding: 0.75rem; border-bottom: 1px solid var(--tr-border); }
  .transcribe-mobile-controls .transcribe-playback-settings { display: flex; flex-wrap: wrap; width: 100%; gap: 0.75rem; }
  .transcribe-mobile-controls .transcribe-speed-control { flex-basis: 100%; }
  .transcribe-mobile-controls .transcribe-speed-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .transcribe-mobile-controls .transcribe-sound-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .transcribe-mobile-controls .transcribe-filter-field { display: grid; }
  .transcribe-mobile-controls #transcribe-config-actions { display: flex; gap: 0.5rem; }
  .transcribe-mobile-controls #transcribe-config-actions button { min-height: 2.75rem; }
  .transcribe-mobile-controls .transcribe-transport-sliders { grid-column: auto; grid-row: auto; display: grid; grid-template-columns: 1fr; }
  .transcribe-mobile-controls .transcribe-transport-sliders > label { display: grid; grid-template-columns: 6rem minmax(0, 1fr); grid-column: auto; }
  .transcribe-mobile-controls input[type="range"] { height: 2.75rem; }
  .transcribe-mobile-controls select { min-height: 2.75rem; }
  .transcribe-empty { gap: 0.25rem; padding: 0.5rem; }
  .transcribe-empty svg { width: 1.5rem; height: 1.5rem; }
}

/* Playback range and repetition are independent transport controls. */
.transcribe-transport { grid-template-columns: repeat(6, 2.75rem) minmax(8rem, 1fr) minmax(16rem, 0.4fr); }
.transcribe-transport .transcribe-selection-control { grid-column: 5; display: flex; align-items: center; justify-content: center; }
.transcribe-transport .transcribe-selection-control svg { width: 1.5rem; height: 1.5rem; }
@media (min-width: 721px) and (max-width: 900px) {
  .transcribe-transport { grid-template-columns: repeat(6, 2.75rem) minmax(4rem, 1fr) 11rem; }
}
@media (max-width: 720px) {
  .transcribe-transport { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.transcribe-transport #transcribe-loop-bottom { grid-column: 6; }

/* Filled controls indicate an active playback mode; dim controls are unavailable. */
.transcribe-app .transcribe-transport > button {
  border: 1px solid var(--tr-border);
  background: var(--tr-surface);
  color: var(--tr-text);
  opacity: 1;
}
.transcribe-app .transcribe-transport > button:is([aria-pressed="true"], .is-playing):not(:disabled) {
  border-color: var(--tr-accent);
  background: var(--tr-accent);
  color: var(--tr-bg);
}
@media (hover: hover) {
  .transcribe-app .transcribe-transport > button:hover:not(:disabled) {
    border-color: var(--tr-border-hover);
    background: var(--tr-hover);
  }
  .transcribe-app .transcribe-transport > button:is([aria-pressed="true"], .is-playing):hover:not(:disabled) {
    border-color: var(--tr-border-hover);
    background: var(--tr-accent);
    color: var(--tr-bg);
  }
}
:root[data-keyboard-navigation="on"] .transcribe-app .transcribe-transport > button:focus-visible {
  outline: 2px solid var(--tr-accent) !important;
  outline-offset: -2px;
}
:root[data-keyboard-navigation="on"] .transcribe-app .transcribe-transport > button:is([aria-pressed="true"], .is-playing):focus-visible {
  outline-color: var(--tr-bg) !important;
}
.transcribe-app .transcribe-transport > button:disabled {
  border-color: var(--tr-border-soft);
  background: var(--tr-panel);
  color: var(--tr-disabled);
  opacity: 1;
  cursor: not-allowed;
}

/* Highlight-only stems use the same compact, square secondary panel as Controls. */
#transcribe-stems-toggle { min-height: 2.75rem; padding: 0.4rem 0.65rem; white-space: nowrap; cursor: pointer; }
#transcribe-stems-toggle strong { font-weight: 400; color: var(--tr-muted); }
#transcribe-stems-toggle[aria-expanded="true"] { border-color: var(--tr-accent); }
.transcribe-stems-panel { padding: 0.85rem; }
.transcribe-stems-heading, .transcribe-stems-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.transcribe-stems-heading h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.transcribe-stems-heading h2 span { display: block; color: var(--tr-muted); font-size: 0.75rem; font-weight: 400; }
.transcribe-stems-panel p { margin: 0.65rem 0; font-size: 0.8rem; line-height: 1.45; }
.transcribe-stems-actions { justify-content: flex-start; flex-wrap: wrap; }
.transcribe-stems-actions button { min-height: 2.5rem; padding: 0.4rem 0.65rem; }
#transcribe-stems-progress { width: 100%; height: 0.4rem; margin-top: 0.75rem; accent-color: var(--tr-accent); }
.transcribe-stem-list { list-style: none; padding: 0; margin: 0.75rem 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.transcribe-stem-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-width: 0; padding: 0.5rem 0; border-top: 1px solid var(--tr-border-soft); }
.transcribe-stem-list li > span { min-width: 0; font-size: 0.875rem; }
.transcribe-stem-list small { display: block; margin-top: 0.15rem; font-size: 0.7rem; color: var(--tr-muted); }
.transcribe-stem-list button { flex: 0 0 2.75rem; min-height: 2.5rem; }
.transcribe-stem-list li.is-quiet > span { color: color-mix(in srgb, var(--tr-text) 65%, var(--tr-muted)); }
.transcribe-stem-list [data-stem-activity] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.transcribe-stems-help { color: var(--tr-muted); }
@media (max-width: 600px) {
  #transcribe-stems-toggle { min-height: 2.5rem; padding: 0.3rem 0.45rem; }
  .transcribe-stems-panel { padding: 0.65rem; }
  .transcribe-stem-list { grid-template-columns: minmax(0, 1fr); }
}
.transcribe-panel-buttons { display: flex; flex-direction: column; align-self: flex-end; }
.transcribe-navbar-row .transcribe-panel-buttons :is(#transcribe-stems-toggle, #transcribe-controls-toggle) {
  width: 5.5rem; min-height: 1.4rem; padding: 0.2rem 0.45rem; font-size: 0.65rem; line-height: 1;
}
.transcribe-panel-buttons #transcribe-controls-toggle { border-top: 0; }
@media (min-width: 721px) and (max-width: 1550px) {
  .transcribe-navbar-row { gap: 0.65rem; }
  .transcribe-navbar-row .transcribe-identity :is(a, strong, span) { font-size: 1.15rem; }
  .transcribe-navbar-row .transcribe-file-control { flex-basis: 11rem; }
}
@media (max-width: 720px) {
  .transcribe-panel-buttons { align-self: center; }
  .transcribe-navbar-row .transcribe-panel-buttons :is(#transcribe-stems-toggle, #transcribe-controls-toggle) { width: 5.25rem; min-height: 2rem; font-size: 0.7rem; }
}
@media (max-width: 720px) {
  .transcribe-navbar-row .transcribe-identity { grid-column: 1 / -1; grid-row: 1; }
  .transcribe-navbar-row .transcribe-navbar-controls { grid-row: 2; }
}
@media (max-width: 720px) {
  .transcribe-stems-panel { max-height: calc(100dvh - 12rem); }
}


/* Compact measure fields expand above their playback button. */
.transcribe-transport { grid-template-columns: repeat(7, 2.75rem) minmax(4rem, 1fr) minmax(11rem, 0.4fr); }
.transcribe-transport #transcribe-measures {
  grid-column: 7;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
  text-transform: none;
}
#transcribe-measure-panel { position: fixed; inset: auto; margin: 0; width: min(17rem, calc(100vw - 1rem)); box-sizing: border-box; padding: 0.65rem; color: var(--tr-text); background: var(--tr-surface); border: 1px solid var(--tr-border); }
#transcribe-measure-panel::backdrop { background: transparent; pointer-events: none; }
#transcribe-measure-panel form { display: flex; gap: 0.5rem; margin: 0; }
#transcribe-measure-panel form + form { margin-top: 0.5rem; }
#transcribe-measure-panel label { display: grid; gap: 0.2rem; flex: 1; min-width: 0; font-size: 0.75rem; }
#transcribe-measure-panel input {
  width: 100%; min-width: 0; box-sizing: border-box;
  appearance: none; border: 1px solid var(--tr-border); border-radius: 0;
  background: var(--tr-bg); color: var(--tr-text); box-shadow: none;
  padding: 0.375rem 0.5rem; min-height: 2rem; font: inherit;
}
:root[data-keyboard-navigation="on"] #transcribe-measure-panel input:focus-visible { border-color: var(--tr-accent); outline: none; }
#transcribe-measure-panel input::placeholder { color: var(--tr-muted); opacity: 1; }
#transcribe-measure-panel output { display: block; margin-top: 0.4rem; font-size: 0.75rem; }
#transcribe-measure-panel output:empty { display: none; }
@media (max-width: 720px) {
  .transcribe-transport { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* Persistent stem-job notification, independent of the controls panel. */
#transcribe-stems-banner {
  position: fixed; top: calc(0.75rem + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%); z-index: 100;
  display: flex; align-items: center; gap: 0.75rem;
  width: 34rem; max-width: calc(100vw - 2rem); box-sizing: border-box;
  padding: 0.75rem 0.9rem 0.9rem; border: 1px solid var(--tr-border);
  background: var(--tr-surface); color: var(--tr-text); font-size: 0.8rem;
}
#transcribe-stems-banner[hidden] { display: none; }
#transcribe-stems-banner-message { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#transcribe-stems-banner-dismiss { flex: 0 0 auto; min-height: 0; padding: 0.25rem 0.5rem; font-size: 1.25rem; }
#transcribe-stems-banner-progress {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 3px;
  border: 0; border-radius: 0; appearance: none; background: var(--tr-border);
}
#transcribe-stems-banner-progress::-webkit-progress-bar { background: var(--tr-border); }
#transcribe-stems-banner-progress::-webkit-progress-value { background: var(--tr-accent); }
#transcribe-stems-banner-progress::-moz-progress-bar { background: var(--tr-accent); }

#transcribe-stems-toggle, .transcribe-section-buttons button[aria-controls="transcribe-section-stems"] { position: relative; isolation: isolate; overflow: hidden; }
#transcribe-stems-toggle-progress {
  position: absolute; inset: 0 auto 0 0; z-index: -1;
  background: rgba(128, 128, 128, 0.22); pointer-events: none;
}
#transcribe-stems-banner:not([hidden]) { animation: transcribe-command-confirm 180ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  #transcribe-stems-banner:not([hidden]) { animation: none; }
}

/* Modular workspace: one narrow rail, one consistent spacing system. */
.transcribe-workspace { grid-template-columns: minmax(0, 1fr); }
.transcribe-control-bar { grid-column: 1 / -1; grid-row: 1; }
.transcribe-timeline { grid-column: 1; grid-row: 2; }
.transcribe-analysis { grid-column: 1; grid-row: 3; }
.transcribe-transport { grid-column: 1; grid-row: 4; }
.transcribe-workspace.has-sidebar { grid-template-columns: minmax(0, 1fr) clamp(26rem, 33.333vw, 32rem); overflow-y: auto; }
.transcribe-sidebar { grid-column: 2; grid-row: 2 / 5; display: grid; grid-auto-rows: max-content; align-content: start; min-width: 0; border-left: 1px solid var(--tr-border); }
.transcribe-sidebar[hidden], .transcribe-sidebar-section[hidden], #transcribe-stems-toggle[hidden], #transcribe-controls-toggle[hidden], #transcribe-analysis[hidden] { display: none; }
#transcribe-controls-panel { display: none !important; }
.transcribe-workspace.spectrum-hidden .transcribe-timeline { grid-row: 2 / 4; }
.transcribe-sidebar-section { min-width: 0; padding: 12px; border-bottom: 1px solid var(--tr-border); }
.transcribe-sidebar-section > h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 0.85rem; line-height: 1.25; }
.transcribe-sidebar-section :is(label,fieldset,select) { min-width: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis):not([hidden]) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; align-items: end; }
:is(#transcribe-section-sound, #transcribe-section-analysis) > h2 { grid-column: 1 / -1; margin: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-settings-toggles > .transcribe-tool-toggle { display: flex; flex-direction: row; justify-content: space-between; align-items: center; height: 28px; min-height: 28px; padding: 4px 8px; font-size: 0.7rem; letter-spacing: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-sound-controls { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-tool-field, :is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-tolerance-control { grid-column: auto; grid-row: auto; display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; padding: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) :is(.transcribe-tool-field,.transcribe-tolerance-control,.transcribe-pitch-adjustment) > span:first-child { text-align: left; font-size: 0.65rem; line-height: 1.2; letter-spacing: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) select, :is(#transcribe-section-sound, #transcribe-section-analysis) input[type=number] { width: 100%; height: 28px; min-height: 28px; padding: 2px 6px; font-size: 0.75rem; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-audio-pitch { grid-column: 1 / -1; padding: 0; margin: 0; border: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-pitch-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-pitch-adjustment { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-pitch-entry { display: grid; grid-template-columns: minmax(0,1fr) 3rem; gap: 6px; width: 100%; height: 28px; }
:is(#transcribe-section-sound, #transcribe-section-analysis) input[type=range] { min-width: 0; width: 100%; height: 28px; margin: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-numbering-control { grid-column: auto; min-width: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-numbering-control fieldset { border: 0; padding: 0; margin: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-numbering-control label { flex-direction: column; align-items: stretch; gap: 4px; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-numbering-control select { width: 100%; }
/* A single reading path prevents narrow columns of broken shortcut text. */
.transcribe-sidebar .transcribe-shortcuts { display: block; padding: 0; border: 0; }
.transcribe-sidebar .transcribe-shortcuts h3 { margin: 12px 0 6px; font-size: 0.75rem; line-height: 1.2; }
.transcribe-sidebar .transcribe-shortcuts dl { display: grid; gap: 4px; margin: 0; }
.transcribe-sidebar .transcribe-shortcuts dl > div { display: grid; grid-template-columns: 9rem minmax(0,1fr); align-items: baseline; gap: 12px; }
.transcribe-sidebar .transcribe-shortcuts :is(dt,dd) { margin: 0; font-size: 0.75rem; line-height: 1.25; text-align: left; }
.transcribe-sidebar .transcribe-shortcuts kbd { border: 0; padding: 0; background: none; font-size: inherit; color: var(--tr-text); }
.transcribe-sidebar .transcribe-shortcuts p { margin: 8px 0 0; font-size: 0.7rem; line-height: 1.4; color: var(--tr-muted); }
.transcribe-sidebar .transcribe-shortcuts > p:first-of-type { margin-top: 0; }
/* Stem help is disclosed separately from the working controls. */
.transcribe-sidebar #transcribe-stems-panel { position: static; width: auto; max-height: none; padding: 0; border: 0; overflow: visible; animation: none; }
.transcribe-sidebar #transcribe-stems-panel:not([hidden]) { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; }
.transcribe-sidebar .transcribe-stems-heading { display: none; }
#transcribe-section-stems .transcribe-stems-actions #transcribe-stems-enabled { margin-left: 0; display: flex; flex-direction: row; gap: 6px; height: 28px; min-height: 28px; padding: 4px 8px; font-size: 0.7rem; }
.transcribe-sidebar .transcribe-stems-actions { margin: 0; }
.transcribe-sidebar .transcribe-stems-actions button { min-height: 28px; height: 28px; padding: 4px 8px; }
.transcribe-sidebar #transcribe-stems-panel p { margin: 0; font-size: 0.7rem; line-height: 1.35; }
.transcribe-sidebar .transcribe-stem-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 0; margin: 2px 0 0; }
.transcribe-sidebar .transcribe-stem-list li { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 4px; padding: 0; border: 0; }
.transcribe-sidebar .transcribe-stem-list li > span { font-size: 0.75rem; line-height: 1.2; }
.transcribe-sidebar .transcribe-stem-list small { display: block; margin: 3px 0 0; font-size: 0.6rem; line-height: 1.2; }
.transcribe-sidebar .transcribe-stem-list button { min-width: 28px; min-height: 28px; height: 28px; padding: 2px 4px; }
.transcribe-info-button { display: grid; place-items: center; width: 28px; height: 28px; min-height: 28px; padding: 4px; }
.transcribe-info-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
#transcribe-stems-info, #transcribe-eq-info { max-width: min(28rem,calc(100vw - 2rem)); padding: 1rem; border: 1px solid var(--tr-border); background: var(--tr-bg); color: var(--tr-text); font-size: 0.85rem; line-height: 1.5; }
.transcribe-section-buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.transcribe-section-buttons button { display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; background: var(--tr-bg); }
.transcribe-section-buttons svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.transcribe-section-buttons button[aria-pressed=true] { border-color: var(--tr-accent); color: var(--tr-accent); background: var(--tr-surface); }
.transcribe-section-buttons button[aria-controls=transcribe-section-stems] svg { transform: rotate(-90deg); }
.transcribe-navbar-row, .transcribe-navbar-controls { flex-wrap: wrap; }
.transcribe-navbar-controls { gap: 8px; }
@media (max-width: 1000px) {
  html:has(.has-sidebar),body.transcribe-shell:has(.has-sidebar) { overflow-y: auto; }
  .transcribe-app[data-view-mode] .transcribe-workspace.has-sidebar { grid-template-columns: minmax(0,1fr); height: auto; min-height: 100dvh; grid-template-rows: auto minmax(14rem,35dvh) minmax(12rem,30dvh) auto auto; overflow: visible; }
  .transcribe-sidebar { grid-column: 1; grid-row: 5; border-left: 0; }
  .has-sidebar .transcribe-transport { position: sticky; bottom: 0; z-index: 5; background: var(--tr-bg); }
  .transcribe-navbar-row .transcribe-navbar-controls { grid-column: 1 / -1; grid-row: auto; display: flex; flex-wrap: wrap; width: 100%; }
  .transcribe-navbar-controls .transcribe-playback-settings,.transcribe-navbar-controls .transcribe-speed-buttons { display: flex; flex-wrap: wrap; overflow: visible; gap: 4px; }
  .transcribe-section-buttons button { width: 44px; height: 44px; }
  .transcribe-sidebar .transcribe-shortcuts dl > div { grid-template-columns: 8rem minmax(0,1fr); }
}

/* Sidebar type roles: title, label, value, reference, and supporting text. */
.transcribe-sidebar {
  --tr-type-title: 0.875rem;
  --tr-type-label: 0.75rem;
  --tr-type-value: 0.8125rem;
  --tr-type-note: 0.6875rem;
  font-family: var(--font-ui);
  font-size: var(--tr-type-value);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums;
}
.transcribe-sidebar-section > h2 {
  font-family: inherit;
  font-size: var(--tr-type-title);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: none;
}
:is(#transcribe-section-sound, #transcribe-section-analysis) :is(.transcribe-tool-field,.transcribe-tolerance-control,.transcribe-pitch-adjustment) > span:first-child {
  font-size: var(--tr-type-label);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  color: var(--tr-muted);
}
:is(#transcribe-section-sound, #transcribe-section-analysis) :is(select,input[type=number]) {
  font-family: inherit;
  font-size: var(--tr-type-value);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-settings-toggles > .transcribe-tool-toggle,
#transcribe-section-stems .transcribe-stems-actions #transcribe-stems-enabled {
  font-family: inherit;
  font-size: var(--tr-type-label);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.transcribe-sidebar .transcribe-tool-toggle strong { font-weight: 700; }
.transcribe-sidebar .transcribe-shortcuts h3 {
  font-size: var(--tr-type-label);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}
.transcribe-sidebar .transcribe-shortcuts :is(dt,dd) {
  font-size: var(--tr-type-label);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}
.transcribe-sidebar .transcribe-shortcuts dt { color: var(--tr-muted); }
.transcribe-sidebar .transcribe-shortcuts kbd {
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  white-space: nowrap;
  color: var(--tr-text);
}
.transcribe-sidebar .transcribe-shortcuts p,
.transcribe-sidebar #transcribe-stems-panel p {
  font-size: var(--tr-type-note);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.005em;
}
.transcribe-sidebar .transcribe-stem-list li > span {
  font-size: var(--tr-type-label);
  font-weight: 500;
  line-height: 1.3;
}
.transcribe-sidebar .transcribe-stem-list small {
  font-size: var(--tr-type-note);
  font-weight: 400;
  line-height: 1.3;
  color: var(--tr-muted);
}
.transcribe-sidebar .transcribe-stem-list button,
.transcribe-sidebar .transcribe-stems-actions button {
  font-family: inherit;
  font-size: var(--tr-type-label);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.transcribe-sidebar .transcribe-tool-toggle :is(span,strong) { text-transform: none; letter-spacing: 0; }

:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-sound-controls { align-items: end; }

/* Keycaps distinguish keys from the instructions between them. */
.transcribe-sidebar .transcribe-shortcuts kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  min-height: 1.25rem;
  padding: 0 0.25rem;
  border: 1px solid var(--tr-border);
  background: var(--tr-surface);
  color: var(--tr-text);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  vertical-align: baseline;
}
.transcribe-sidebar .transcribe-shortcuts .transcribe-key-combo {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}
.transcribe-sidebar .transcribe-shortcuts dt { line-height: 1.8; }
.transcribe-sidebar .transcribe-shortcuts dl > div { align-items: center; }

/* Share a content-sized key column across each shortcut group. */
.transcribe-sidebar .transcribe-shortcuts dl {
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 12px;
}
.transcribe-sidebar .transcribe-shortcuts dl > div {
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}
.transcribe-sidebar .transcribe-shortcuts dt { white-space: nowrap; }
.transcribe-sidebar .transcribe-shortcuts dd { min-width: 0; }

/* Settings rows occupy the full rail rather than retaining navbar sizing. */
:is(#transcribe-section-sound, #transcribe-section-analysis) { justify-items: stretch; }
:is(#transcribe-section-sound, #transcribe-section-analysis) > * { min-width: 0; width: 100%; justify-self: stretch; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-sound-controls {
  margin: 0;
  width: 100%;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.35fr);
}
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-sound-controls > * { grid-column: auto; grid-row: auto; width: 100%; min-width: 0; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-audio-pitch { display: block; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-pitch-controls { width: 100%; min-width: 0; grid-column: auto; grid-row: auto; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-pitch-adjustment { width: 100%; align-items: stretch; }
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-tool-field select,
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-tolerance-control select { width: 100%; max-width: none; }

/* Scroll the utility rail while keeping the recording workspace stationary. */
.transcribe-sidebar { grid-template-rows: minmax(0,1fr) auto; min-height: 0; overflow: hidden; align-content: stretch; }
.transcribe-sidebar-scroll { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--tr-muted) var(--tr-bg); }
.transcribe-sidebar-links { display: grid; background: var(--tr-bg); border-top: 1px solid var(--tr-border); }
.transcribe-sidebar-links[hidden], .transcribe-sidebar-links button[hidden] { display: none; }
.transcribe-sidebar-links button { width: 100%; min-height: 36px; padding: 8px 12px; border: 0; background: var(--tr-bg); text-align: left; font-size: 0.8rem; font-weight: 600; }
.transcribe-sidebar-links button + button { border-top: 1px solid var(--tr-border-soft); }
@media (min-width: 1001px) {
  .transcribe-workspace.has-sidebar { overflow: hidden; }
}
@media (max-width: 1000px) {
  .transcribe-sidebar { height: 65dvh; }
}
.transcribe-sidebar { grid-template-rows: auto minmax(0,1fr) auto; }
.transcribe-sidebar-links-top { grid-row: 1; border-top: 0; border-bottom: 1px solid var(--tr-border); }
.transcribe-sidebar-scroll { grid-row: 2; }
.transcribe-sidebar > .transcribe-sidebar-links:not(.transcribe-sidebar-links-top) { grid-row: 3; }

/* Fixed-order accordion: collapsed sections retain their real headings. */
.transcribe-sidebar { grid-template-rows: minmax(0,1fr); }
.transcribe-sidebar-scroll { grid-row: 1; }
.transcribe-section-disclosure { display: flex; flex: 1; align-items: center; justify-content: space-between; min-width: 0; min-height: 32px; gap: 8px; padding: 4px 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; text-align: left; }
.transcribe-section-disclosure svg { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; }
.transcribe-section-disclosure[aria-expanded=false] svg { transform: rotate(-90deg); }
.transcribe-sidebar-section.is-collapsed:not([hidden]) { display: block !important; padding-block: 6px; }
.transcribe-sidebar-section.is-collapsed > :not(h2), .transcribe-sidebar-section.is-collapsed > h2 > :not(.transcribe-section-disclosure) { display: none !important; }
.transcribe-sidebar-section.is-collapsed > h2 { margin: 0; }

/* Headers belong to the sidebar field; a single rule separates their contents. */
.transcribe-sidebar-section > h2 {
  margin: 0 0 8px;
  padding: 0 0 6px;
  border: 0;
  border-bottom: 1px solid var(--tr-border);
  background: transparent;
}
.transcribe-sidebar .transcribe-section-disclosure,
.transcribe-sidebar .transcribe-section-disclosure:hover,
.transcribe-sidebar .transcribe-section-disclosure:active {
  border: 0;
  background: transparent;
  box-shadow: none;
  width: 100%;
  cursor: pointer;
}
.transcribe-sidebar-section.is-collapsed > h2 { margin: 0; padding: 0; border: 0; }

/* Override the shared site's button chrome only for sidebar disclosures. */
.transcribe-app .transcribe-sidebar button.transcribe-section-disclosure,
.transcribe-app .transcribe-sidebar button.transcribe-section-disclosure:is(:hover,:active), :root[data-keyboard-navigation="on"] .transcribe-app .transcribe-sidebar button.transcribe-section-disclosure:focus {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
:root[data-keyboard-navigation="on"] .transcribe-app .transcribe-sidebar button.transcribe-section-disclosure:focus-visible { color: var(--tr-accent); }
.transcribe-app .transcribe-sidebar-section > h2 {
  width: calc(100% + 24px);
  max-width: none;
  margin: -6px -12px 8px;
  padding: 0 12px 6px;
  border: 0;
  border-bottom: 1px solid var(--tr-border);
}
.transcribe-app .transcribe-sidebar-section.is-collapsed > h2 {
  margin: 0 -12px;
  padding: 0 12px;
  border: 0;
}
:is(#transcribe-section-sound, #transcribe-section-analysis) > h2 { width: calc(100% + 24px); margin: -6px -12px 8px; }
:is(#transcribe-section-sound, #transcribe-section-analysis).is-collapsed > h2 { margin: 0 -12px; }

/* Brief directional feedback without animating the audio workspace geometry. */
.transcribe-section-disclosure svg {
  transition: transform 180ms cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-reduced-motion: reduce) {
  .transcribe-section-disclosure svg { transition: none; }
}

/* Tablet retains the desktop workspace and an adjacent, compact settings rail. */
@media (min-width: 721px) and (max-width: 1100px) {
  .transcribe-navbar-row { display: grid; grid-template-columns: auto minmax(0, 1fr); overflow: visible; }
  .transcribe-navbar-row .transcribe-file-control { width: 100%; max-width: none; min-width: 0; }
  .transcribe-navbar-row .transcribe-navbar-controls { grid-column: 1 / -1; width: 100%; justify-content: space-between; flex-wrap: nowrap; }
  .transcribe-navbar-controls .transcribe-speed-buttons { flex-wrap: nowrap; }
  .transcribe-app[data-view-mode] .transcribe-workspace.has-sidebar { grid-template-columns: minmax(0, 1fr) 20rem; grid-template-rows: auto minmax(0, 1.2fr) minmax(0, 0.8fr) auto; height: 100dvh; min-height: 0; overflow: hidden; }
  .transcribe-sidebar { grid-column: 2; grid-row: 2 / 5; height: auto; border-left: 1px solid var(--tr-border); }
  .has-sidebar .transcribe-transport { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .has-sidebar .transcribe-playback-progress { grid-column: 1 / -1; grid-row: 1; }
  .has-sidebar .transcribe-transport > button { grid-row: 2; }
}

/* Three mobile rows: identity, file and section controls, then speed. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-control-bar { padding: 0; }
  .transcribe-navbar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 0 8px 8px; overflow: visible; }
  .transcribe-navbar-row .transcribe-identity { grid-column: 1 / -1; grid-row: 1; min-height: var(--header-height); margin-inline: -8px; padding: 0.75rem var(--page-gutter); gap: 0.5rem; }
  .transcribe-navbar-row .transcribe-identity a { font-size: clamp(1.45rem, 7vw, 2rem); font-weight: 800; line-height: 1; letter-spacing: 0.02em; }
  .transcribe-navbar-row .transcribe-identity :is(span,strong) { font-size: 0.8rem; line-height: 1; }
  .transcribe-navbar-row .transcribe-file-control { grid-column: 1; grid-row: 2; max-width: none; gap: 4px; align-self: center; }
  .transcribe-navbar-row .transcribe-file-name { padding: 0 6px; font-size: 0.75rem; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
  .transcribe-navbar-row #transcribe-config-actions { flex: 0 0 56px; }
  .transcribe-navbar-row #transcribe-config-actions button { width: 100%; padding: 0 2px; height: 22px; min-height: 22px; font-size: 0.625rem; }
  .transcribe-navbar-row .transcribe-navbar-controls { display: contents; }
  .transcribe-navbar-row .transcribe-panel-buttons { grid-column: 2; grid-row: 2; margin: 0; }
  .transcribe-section-buttons { flex-wrap: nowrap; gap: 2px; }
  .transcribe-section-buttons button { width: 44px; height: 44px; }
  .transcribe-navbar-row .transcribe-playback-settings { grid-column: 1 / -1; grid-row: 3; display: block; width: 100%; margin: 0; }
  .transcribe-navbar-row .transcribe-speed-control { display: block; width: 100%; min-width: 0; }
  .transcribe-navbar-row .transcribe-speed-buttons { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; width: 100%; }
  .transcribe-navbar-row .transcribe-speed-buttons > button,
  .transcribe-navbar-row .transcribe-custom-speed-slot,
  .transcribe-navbar-row .transcribe-custom-speed-slot :is(button,input) { width: 100%; min-width: 0; height: 44px; padding-inline: 0; font-size: 0.7rem; }
  .transcribe-app .transcribe-timeline { grid-template-rows: 3.25rem 2.75rem minmax(0, 1fr); }
  .transcribe-sidebar .transcribe-shortcuts dl > div { grid-template-columns: subgrid; }
}
@media (max-width: 560px) {
  .transcribe-navbar-row .transcribe-identity { padding-inline: 1rem; }
  .transcribe-navbar-row .transcribe-identity a { font-size: clamp(1.1rem, 6.2vw, 1.45rem); }
}

@media (max-width: 1100px) {
  :is(#transcribe-section-sound, #transcribe-section-analysis) > * { grid-row: auto; }
  :is(#transcribe-section-sound, #transcribe-section-analysis) > h2 { grid-column: 1 / -1; }
  :is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-settings-toggles > .transcribe-tool-toggle { grid-column: auto; }
  :is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-sound-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transcribe-sidebar .transcribe-shortcuts dl > div { grid-template-columns: subgrid; }
}
@media (max-height: 500px) {
  html, body.transcribe-shell { overflow: hidden; }
  .transcribe-app[data-view-mode] .transcribe-workspace { height: 100dvh; min-height: 0; grid-template-rows: auto minmax(0, 1.2fr) minmax(0, 0.8fr) auto; overflow: hidden; }
  .transcribe-timeline, .transcribe-analysis { min-height: 0; }
}

/* One inset red focus rule across controls; filled red actions use field ink. */
:root[data-keyboard-navigation="on"] .transcribe-app :is(button, input, select):focus-visible {
  outline: 2px solid var(--tr-accent) !important;
  outline-offset: -2px;
}
:root[data-keyboard-navigation="on"] .transcribe-app :is(#transcribe-overview-navigator, #transcribe-waveform, #transcribe-mark-ruler, .transcribe-analysis-grid):focus-visible {
  outline: 2px solid var(--tr-accent);
  outline-offset: -2px;
}
:root[data-keyboard-navigation="on"] .transcribe-sidebar .transcribe-section-disclosure:focus-visible {
  outline: 2px solid var(--tr-accent) !important;
  outline-offset: -2px;
}
.transcribe-app input { caret-color: var(--tr-accent); }
.transcribe-app ::selection { background: var(--tr-accent); color: var(--tr-bg); }
.transcribe-navbar-row .transcribe-file-name { text-overflow: ellipsis; }

/* Mobile quick settings occupy the signal area without moving the workspace. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-workspace { position: relative; }
  .transcribe-workspace > .transcribe-sidebar {
    position: absolute;
    grid-column: 1 / -1;
    grid-row: 2 / 4;
    inset: 0;
    z-index: 25;
    width: 100%;
    height: 100%;
    border: 0;
    border-bottom: 1px solid var(--tr-border);
    background: var(--tr-bg);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .transcribe-sidebar-scroll { overflow: visible; }
  .transcribe-sidebar-section { border-bottom: 0; }
  .transcribe-sidebar-section[hidden] { display: none !important; }
  .transcribe-sidebar #transcribe-stems-panel { max-height: none; overflow: visible; }
}

#transcribe-stems-range:empty, #transcribe-stems-status:empty { display: none; }

/* Complete per-control borders, including the shared edge of stacked config buttons. */
.transcribe-navbar-row #transcribe-config-actions button { position: relative; }
.transcribe-navbar-row #transcribe-config-actions button:hover:not(:disabled),
:root[data-keyboard-navigation="on"] .transcribe-navbar-row #transcribe-config-actions button:focus-visible {
  z-index: 1;
  border-color: var(--tr-border-hover);
}
.transcribe-navbar-row .transcribe-section-buttons button {
  height: var(--tr-control-height);
  min-height: var(--tr-control-height);
}
.transcribe-navbar-row .transcribe-navbar-controls { align-items: center; }

/* Touching playback controls at left, two compact sliders at right. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-app .transcribe-transport {
    grid-template-columns: repeat(7, minmax(0, 1fr)) clamp(5rem, 25vw, 8rem);
    grid-template-rows: auto 44px;
    gap: 4px 0;
    padding: 4px 8px max(8px, env(safe-area-inset-bottom));
  }
  .transcribe-app .transcribe-transport > button {
    grid-row: 2;
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 3px;
    justify-self: stretch;
    position: relative;
  }
  .transcribe-app .transcribe-transport > button svg { width: 20px; height: 20px; }
  .transcribe-app .transcribe-transport #transcribe-measures { font-size: 0.85rem; }
  .transcribe-app .transcribe-transport .transcribe-playback-progress { grid-column: 1 / -1; grid-row: 1; }
  .transcribe-app .transcribe-transport-sliders {
    grid-column: 8;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 2px;
    padding: 0 0 0 8px;
    align-self: stretch;
  }
  .transcribe-app .transcribe-transport-sliders > label {
    display: grid;
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 10px 11px;
    gap: 0;
    min-width: 0;
  }
  .transcribe-app .transcribe-transport-sliders span { font-size: 0.5625rem; line-height: 10px; white-space: nowrap; }
  .transcribe-app .transcribe-transport-sliders input { width: 100%; height: 11px; min-height: 0; margin: 0; }
}

/* Share a single pixel between controls; stronger states own that seam. */
.transcribe-app .transcribe-transport > button {
  position: relative;
  width: 100%;
  justify-self: stretch;
  z-index: 0;
}
.transcribe-app .transcribe-transport > button + button {
  margin-left: -1px;
  width: calc(100% + 1px);
}
.transcribe-app .transcribe-transport > button:not(:disabled) { z-index: 1; }
.transcribe-app .transcribe-transport > button:is([aria-pressed="true"], .is-playing):not(:disabled) { z-index: 2; }
:root[data-keyboard-navigation="on"] .transcribe-app .transcribe-transport > button:focus-visible { z-index: 3; }
@media (hover: hover) {
  .transcribe-app .transcribe-transport > button:hover:not(:disabled) { z-index: 3; }
}

/* Keep the complete wordmark on one line and align every control group. */
.transcribe-control-bar {
  padding-inline: max(var(--page-gutter), calc((100vw - 1680px) / 2 + var(--page-gutter)));
}
.transcribe-navbar-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  padding-block: 12px;
  min-height: var(--header-height);
  overflow: visible;
}
.transcribe-navbar-row .transcribe-file-control { align-self: center; min-width: 0; }
.transcribe-navbar-row .transcribe-navbar-controls { align-items: center; flex-wrap: nowrap; }
.transcribe-navbar-row .transcribe-identity {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}
.transcribe-navbar-row .transcribe-identity :is(a, strong, span) { font: inherit; letter-spacing: inherit; line-height: inherit; }
.transcribe-identity-suffix { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
@media (min-width: 721px) and (max-width: 1350px) {
  .transcribe-navbar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: 12px;
    padding-block: 16px 12px;
  }
  .transcribe-navbar-row .transcribe-identity { grid-column: 1 / -1; grid-row: 1; font-size: clamp(1.45rem, 3vw, 2rem); }
  .transcribe-navbar-row .transcribe-file-control { grid-column: 1; grid-row: 2; width: 100%; max-width: none; }
  .transcribe-navbar-row .transcribe-navbar-controls { display: contents; }
  .transcribe-navbar-row .transcribe-playback-settings { grid-column: 2; grid-row: 2; width: 100%; display: block; padding: 0; }
  .transcribe-navbar-row .transcribe-speed-control { width: 100%; min-width: 0; }
  .transcribe-navbar-row .transcribe-speed-buttons { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); width: 100%; gap: 2px; }
  .transcribe-navbar-row .transcribe-speed-buttons > button,
  .transcribe-navbar-row .transcribe-custom-speed-slot,
  .transcribe-navbar-row .transcribe-custom-speed-slot :is(button,input) { width: 100%; min-width: 0; padding-inline: 0; }
  .transcribe-navbar-row .transcribe-panel-buttons { grid-column: 3; grid-row: 2; }
}
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-control-bar { padding-inline: 0; }
  .transcribe-navbar-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; padding: 0 8px 8px; }
  .transcribe-navbar-row .transcribe-navbar-controls { display: contents; }
  .transcribe-navbar-row .transcribe-identity {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: var(--header-height);
    margin-inline: -8px;
    padding: 0.75rem var(--page-gutter);
    font-size: clamp(1rem, 5vw, 1.45rem);
  }
}
@media (max-width: 560px) {
  .transcribe-navbar-row .transcribe-identity { padding-inline: 1rem; }
}
.transcribe-navbar-row .transcribe-identity > .transcribe-identity-suffix { transform: none; }

@media (min-width: 721px) and (max-width: 1350px) {
  .transcribe-navbar-row .transcribe-file-control { justify-content: flex-start; }
  .transcribe-navbar-row .transcribe-file-summary { flex: 1 1 0; }
}
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-navbar-row .transcribe-identity { border-bottom: 1px solid var(--tr-border); }
}

.transcribe-navbar-row .transcribe-identity a:hover,
:root[data-keyboard-navigation="on"] .transcribe-navbar-row .transcribe-identity a:focus-visible { color: var(--tr-accent); }

/* Let the empty signal guides remain visible around the upload invitation. */
.transcribe-app .transcribe-empty,
.transcribe-app .transcribe-empty:hover:not(:disabled) { background: transparent; }
.transcribe-app .transcribe-empty :is(strong, span) {
  background: var(--tr-bg);
  padding: 0.25rem 0.65rem;
  max-width: 100%;
}
.transcribe-app .transcribe-empty svg { background: var(--tr-bg); }
.transcribe-app .transcribe-empty:hover strong { color: var(--tr-accent); }
.transcribe-app button.transcribe-empty,
.transcribe-app button.transcribe-empty:hover:not(:disabled) {
  background: transparent !important;
  border: 0 !important;
}

.transcribe-app .transcribe-analysis {
  border-top: 1px solid var(--tr-border-soft);
}
.transcribe-app button.transcribe-empty,
.transcribe-app button.transcribe-empty:hover:not(:disabled) {
  background: var(--tr-surface) !important;
}
.transcribe-app .transcribe-empty :is(strong, span, svg) { background: transparent; }

#transcribe-stems-enabled:disabled { opacity: 0.45; cursor: not-allowed; }

/* Keep the shared theme control compact within the workbench identity. */
.transcribe-navbar-row .transcribe-identity .theme-toggle {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  min-height: 2.75rem;
  margin-left: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--tr-text);
}
.transcribe-navbar-row .transcribe-identity .theme-toggle:hover {
  border: 0;
  background: transparent;
  color: var(--tr-accent);
}
:root[data-keyboard-navigation="on"] .transcribe-navbar-row .transcribe-identity .theme-toggle:focus-visible {
  outline-offset: -2px;
}
/* All header controls share the same neutral perimeter, including disabled config. */
.transcribe-navbar-row :is(.transcribe-file-name, :where(#transcribe-config-actions) button, .transcribe-speed-buttons button, .transcribe-section-buttons button, .transcribe-panel-buttons button):not([aria-pressed="true"]):not(.is-active):where(:not([aria-expanded="true"])) {
  border-color: var(--tr-border);
}
@media (hover: hover) {
  .transcribe-navbar-row :is(.transcribe-file-name, .transcribe-speed-buttons button, .transcribe-section-buttons button):hover:not(:disabled) {
    border-color: var(--tr-border-hover);
  }
}
.transcribe-app ::selection { background: var(--tr-accent); color: var(--tr-bg); }
@media (max-width: 720px) {
  .transcribe-navbar-row .transcribe-identity {
    font-size: clamp(0.875rem, calc(6.1vw - 0.3125rem), 1.25rem);
    gap: 0.375rem;
  }
  .transcribe-navbar-row .transcribe-identity .theme-toggle { margin-left: auto; }
}

/* Console-style parametric EQ editor. */
#transcribe-eq-panel { min-width: 0; }
.transcribe-eq-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .75rem; }
.transcribe-eq-actions button { min-height: 28px; padding: 3px 8px; }
#transcribe-eq-graph { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
#transcribe-eq-graph text { fill: var(--tr-muted); font-size: 9px; }
#transcribe-eq-graph .eq-grid { stroke: var(--tr-border); stroke-width: .6; }
#transcribe-eq-graph .eq-point { cursor: grab; touch-action: none; outline: none; }
:root[data-keyboard-navigation="on"] #transcribe-eq-graph .eq-point:focus-visible { outline-offset: -2px; }
:root[data-keyboard-navigation="on"] #transcribe-eq-graph .eq-point:focus circle { stroke: var(--tr-accent); stroke-width: 3; }
#transcribe-eq-graph .eq-point text { fill: #fff; font-size: 11px; font-weight: 700; pointer-events: none; }
.transcribe-eq-hint { margin: 0 0 12px; color: var(--tr-muted); font-size: .7rem; }
.transcribe-eq-cuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--tr-border); }
.transcribe-eq-row { display: grid; grid-template-columns: 14px minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); align-items: center; gap: 6px; margin-top: 10px; }
.transcribe-eq-row > span { font-size: .85rem; font-weight: 700; }
#transcribe-eq-panel label { display: grid; gap: 3px; min-width: 0; font-size: .7rem; }
#transcribe-eq-panel input { box-sizing: border-box; width: 100%; min-width: 0; height: 30px; padding: 3px 5px; font-size: .8rem; }

:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-sound-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }

#transcribe-eq-graph .eq-cut-guide { stroke: var(--tr-muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
#transcribe-eq-graph .eq-cut-point rect { fill: var(--tr-bg); stroke: var(--tr-text); stroke-width: 1.5; }
:root[data-keyboard-navigation="on"] #transcribe-eq-graph .eq-cut-point:focus rect { stroke: var(--tr-accent); stroke-width: 2; }

/* Keep file loading usable on narrow phones; config remains in Settings. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-navbar-row .transcribe-file-summary { width: 100%; }
  .transcribe-navbar-row .transcribe-file-name { width: 100%; }
  :is(#transcribe-section-sound, #transcribe-section-analysis) > #transcribe-config-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
  }
  :is(#transcribe-section-sound, #transcribe-section-analysis) > #transcribe-config-actions button { width: 100%; min-height: 36px; }
  :is(#transcribe-section-sound, #transcribe-section-analysis) > #transcribe-config-actions button + button { border-left: 1px solid var(--tr-border); }
}
@media (max-width: 720px) and (max-height: 650px) {
  .transcribe-app .transcribe-empty { gap: 0.15rem; }
  .transcribe-app .transcribe-empty strong { font-size: 0.9rem; line-height: 1.2; }
  .transcribe-app .transcribe-empty span { display: none; }
}
@media (max-width: 375px) {
  .transcribe-navbar-row .transcribe-section-buttons button { width: 40px; }
  .transcribe-navbar-row .transcribe-speed-buttons :is(button, input) { font-size: 0.625rem; }
  .transcribe-app .transcribe-transport {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: auto 44px 36px;
  }
  .transcribe-app .transcribe-transport-sliders {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1fr;
    gap: 8px;
    padding: 0;
  }
  .transcribe-app .transcribe-transport-sliders > label { grid-column: auto; grid-row: 1; }
}
@media (max-width: 375px) and (max-height: 650px) {
  .transcribe-app .transcribe-empty svg { display: none; }
}

/* Short iPhone screens give an open section the transport's space. */
@media (max-width: 720px) and (max-height: 700px) {
  .transcribe-workspace.mobile-section-open > .transcribe-sidebar { grid-row: 2 / 5; }
  .transcribe-workspace.mobile-section-open > .transcribe-transport { visibility: hidden; }
}


/* Shared band headings and color keys match the graph. */
.transcribe-eq-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: 10px; }
.transcribe-eq-table th, .transcribe-eq-table td { padding: 4px 3px; border: 0; text-align: left; background: transparent; }
.transcribe-eq-table thead th { font-size: .7rem; font-weight: 500; color: var(--tr-muted); }
.transcribe-eq-table th:first-child { width: 32px; }
.transcribe-eq-table tbody tr { background: color-mix(in srgb, var(--eq-band-color) 7%, transparent); }
.transcribe-eq-swatch { display: block; width: 9px; height: 9px; margin-left: 5px; border-radius: 50%; background: var(--eq-band-color); }
#transcribe-eq-graph .eq-cut-point.is-off rect { stroke: var(--tr-muted); }

/* Keep the three analysis switches together above the settings fields. */
:is(#transcribe-section-sound, #transcribe-section-analysis) > .transcribe-settings-toggles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-settings-toggles > .transcribe-tool-toggle {
  min-width: 0;
  width: 100%;
  justify-self: stretch;
  box-sizing: border-box;
  height: auto;
  gap: 4px;
}
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-settings-toggles > .transcribe-tool-toggle > span {
  min-width: 0;
  white-space: normal;
  text-align: left;
}
:is(#transcribe-section-sound, #transcribe-section-analysis) .transcribe-settings-toggles > .transcribe-tool-toggle > strong {
  flex-shrink: 0;
}

/* Keep the full pitch range swipeable on narrow touch screens. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-app .transcribe-analysis-grid {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .transcribe-app .transcribe-analysis-grid::-webkit-scrollbar { display: none; }
  .transcribe-app .transcribe-spectrum-scroll { width: 190.9091%; }
}

/* An empty marker ruler gives its mobile height back to both signal panes. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-app[data-view-mode] .transcribe-workspace:not(.has-markers) {
    grid-template-rows: auto minmax(0, 1.15fr) minmax(0, 0.85fr) auto;
  }
  .transcribe-app .transcribe-timeline:not(.has-markers) {
    grid-template-rows: 3.25rem minmax(0, 1fr);
  }
  .transcribe-app .transcribe-timeline:not(.has-markers) #transcribe-mark-ruler {
    display: none;
  }
  .transcribe-app .transcribe-workspace:not(.has-markers) #transcribe-measures {
    display: none;
  }
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport-sliders {
    grid-column: 7 / -1;
  }
}
@media (max-width: 375px) {
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport-sliders {
    grid-column: 1 / -1;
  }
}

.transcribe-tooltip {
  position: fixed;
  z-index: 1000;
  box-sizing: border-box;
  max-width: min(17rem, calc(100vw - 1rem));
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--tr-text);
  border-radius: 0;
  background: var(--tr-panel);
  color: var(--tr-text);
  font: 700 0.72rem/1.25 var(--font-ui);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.transcribe-tooltip[hidden] { display: none; }

.transcribe-sidebar-section .transcribe-section-reset { flex: 0 0 auto; min-height: 28px; padding: 3px 6px; font-size: .7rem; font-weight: 400; }
.transcribe-sidebar-section > h2 .transcribe-section-disclosure { flex: 1; min-width: 0; width: auto; }
.transcribe-data-actions { display: flex; flex-direction: column; gap: .5rem; border-top: 1px solid var(--tr-border); margin-top: .75rem; padding-top: .75rem; }
.transcribe-data-actions button { white-space: normal; }

.transcribe-speed-modes { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.transcribe-speed-modes > [hidden] { display: none !important; }

/* Flat, fixed controls; keyboard help uses the same exclusive sidebar rail. */
.transcribe-navbar-row .transcribe-panel-buttons { display: flex; flex-direction: row; gap: 4px; align-items: center; }
.transcribe-navbar-row .transcribe-panel-buttons :is(#transcribe-controls-toggle,#transcribe-shortcuts-toggle) { display: grid; place-items: center; width: 36px; min-width: 36px; height: var(--tr-control-height); min-height: var(--tr-control-height); padding: 6px; border: 1px solid var(--tr-border); }
.transcribe-panel-buttons svg, .transcribe-sidebar-header svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; }
.transcribe-panel-buttons button[aria-expanded=true] { color: var(--tr-accent); border-color: var(--tr-accent); }
.transcribe-flat-sidebar { grid-template-rows: 28px minmax(0,1fr); grid-template-columns: minmax(0,1fr); overflow: hidden; }
.transcribe-sidebar-header { grid-row: 1; display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 6px 10px; border-bottom: 1px solid var(--tr-border-soft); }
.transcribe-sidebar-header h2 { margin: 0; font-size: var(--tr-type-label); }
.transcribe-app .transcribe-sidebar-header button { display: grid; place-items: center; padding: 4px; min-height: 28px; width: 28px; border: 0; background: transparent; box-shadow: none; }
.transcribe-flat-sidebar > :is(.transcribe-controls-grid,.transcribe-shortcuts-pane) { grid-row: 2; min-height: 0; }
.transcribe-controls-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 8px 12px; padding: 8px; overflow: visible; }
.transcribe-controls-grid[hidden], .transcribe-shortcuts-pane[hidden] { display: none !important; }
.transcribe-flat-sidebar .transcribe-sidebar-section:not([hidden]) { display: block; min-width: 0; padding: 0; border: 0; }
.transcribe-flat-sidebar .transcribe-sidebar-section > h3 { display: flex; align-items: center; gap: 4px; margin: 0 0 4px; padding: 0; font-size: var(--tr-type-label); line-height: 1; min-height: 20px; }
.transcribe-flat-sidebar .transcribe-sidebar-section > h3 > span { margin-right: auto; }
.transcribe-flat-sidebar .transcribe-section-reset { min-height: 20px; padding: 2px 4px; font-size: var(--tr-type-note); font-weight: 400; }
.transcribe-flat-sidebar .transcribe-info-button { min-width: 20px; width: 20px; min-height: 20px; height: 20px; padding: 2px; }
.transcribe-flat-sidebar .transcribe-group-content { display: grid; gap: 4px; min-width: 0; }
.transcribe-flat-sidebar :is(button, input, select) { font-family: inherit; }
.transcribe-flat-sidebar .transcribe-group-content > .transcribe-tool-toggle { display: flex; flex-direction: row; align-items: center; justify-content: space-between; min-height: 26px; height: 26px; width: 100%; padding: 3px 5px; font-size: var(--tr-type-label); letter-spacing: 0; text-transform: none; }
.transcribe-flat-sidebar :is(#transcribe-section-sound,#transcribe-section-analysis) :is(input[type=number],select) { height: 26px; min-height: 26px; padding: 2px 4px; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-sound-controls { display: block; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-tool-field { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4px; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-controls { display: grid; grid-template-columns: minmax(0,1fr); gap: 4px; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4px; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry { grid-template-columns: minmax(0,1fr) 34px; gap: 4px; height: 26px; }
.transcribe-flat-sidebar #transcribe-section-sound input[type=range] { height: 26px; }
.transcribe-flat-sidebar #transcribe-analysis-contents { grid-template-columns: repeat(2,minmax(0,1fr)); }
.transcribe-flat-sidebar #transcribe-analysis-contents > button { grid-column: 1 / -1; }
.transcribe-flat-sidebar #transcribe-analysis-contents label { gap: 2px; }
.transcribe-flat-sidebar #transcribe-marks { display: grid; grid-template-columns: minmax(0,1fr) 2fr; gap: 4px 8px; }
.transcribe-flat-sidebar #transcribe-marks > fieldset label { gap: 2px; }
.transcribe-flat-sidebar #transcribe-marks > output:empty { display: none; }
.transcribe-flat-sidebar #transcribe-delete-measures { min-height: 26px; font-size: var(--tr-type-note); padding: 3px 5px; }
.transcribe-flat-sidebar #transcribe-eq-panel { display: grid; gap: 4px; }
.transcribe-flat-sidebar .transcribe-eq-actions { display: none; }
.transcribe-flat-sidebar #transcribe-eq-graph { width: 100%; height: 100px; margin: 0; }
.transcribe-flat-sidebar .transcribe-eq-cuts { gap: 4px; border: 0; padding: 0; }
.transcribe-flat-sidebar #transcribe-eq-panel label { gap: 2px; font-size: var(--tr-type-note); }
.transcribe-flat-sidebar #transcribe-eq-panel input { height: 24px; padding: 2px 3px; font-size: var(--tr-type-label); }
.transcribe-flat-sidebar .transcribe-eq-row { grid-template-columns: 8px minmax(0,1.3fr) repeat(2,minmax(0,1fr)); margin: 4px 0 0; gap: 4px; }
.transcribe-flat-sidebar .transcribe-eq-row > span { font-size: var(--tr-type-label); }
.transcribe-flat-sidebar #transcribe-stems-panel { padding: 0; border: 0; margin: 0; display: grid; gap: 4px; max-height: none; overflow: visible; }
.transcribe-flat-sidebar .transcribe-stems-heading { display: none; }
.transcribe-flat-sidebar .transcribe-stems-actions { margin: 0; padding: 0; min-height: 26px; }
.transcribe-flat-sidebar #transcribe-stems-enabled { flex: 1; min-height: 26px; height: 26px; padding: 3px 5px; font-size: var(--tr-type-label); }
.transcribe-flat-sidebar .transcribe-stem-list { margin: 0; gap: 4px; }
.transcribe-flat-sidebar .transcribe-stem-list li { display: grid; grid-template-columns: minmax(0,1fr) 32px; gap: 4px; padding: 0; min-height: 26px; }
.transcribe-flat-sidebar .transcribe-stem-list li > span { font-size: var(--tr-type-label); line-height: 1.1; }
.transcribe-flat-sidebar .transcribe-stem-list small { font-size: var(--tr-type-note); line-height: 1; }
.transcribe-flat-sidebar .transcribe-stem-list button { min-height: 26px; height: 26px; padding: 2px; font-size: var(--tr-type-label); }
.transcribe-flat-sidebar #transcribe-stems-panel > p { margin: 0; line-height: 1.1; }
.transcribe-flat-sidebar .transcribe-sidebar-footer { grid-column: 1 / -1; padding: 0; border-top: 1px solid var(--tr-border-soft); }
.transcribe-flat-sidebar .transcribe-data-actions { margin: 0; padding: 4px 0 0; border: 0; }
.transcribe-flat-sidebar .transcribe-data-actions button { min-height: 24px; padding: 2px 6px; font-size: var(--tr-type-note); }
.transcribe-shortcuts-pane { overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.transcribe-shortcuts-pane .transcribe-shortcuts { margin: 0; }
.transcribe-shortcuts-pane .transcribe-shortcuts h3 { margin-top: 8px; }
.transcribe-flat-sidebar > [popover] { max-width: min(24rem,calc(100vw - 24px)); padding: 12px; font-size: var(--tr-type-label); }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-workspace.mobile-section-open > .transcribe-flat-sidebar { grid-row: 2 / 4; overflow: hidden; }
  .transcribe-navbar-row .transcribe-file-control { display: flex; align-items: center; gap: 4px; }
  .transcribe-navbar-row .transcribe-file-summary { width: auto; flex: 1; min-width: 0; }
  .transcribe-navbar-row #transcribe-config-actions { display: flex; flex-direction: column; flex: 0 0 auto; }
  .transcribe-navbar-row #transcribe-config-actions button { font-size: 0.65rem; height: calc((var(--tr-control-height) + 1px) / 2); min-height: 0; padding: 0 4px; }
  .transcribe-flat-sidebar .transcribe-controls-grid { gap: 6px 8px; padding: 6px; overflow: visible; }
  .transcribe-flat-sidebar #transcribe-delete-measures { justify-self: end; }
}

/* Supersede the old section grids rather than inheriting their auto-placement. */
.transcribe-flat-sidebar :is(#transcribe-section-sound,#transcribe-section-analysis):not([hidden]) { display: block; }
.transcribe-flat-sidebar #transcribe-marks > fieldset { grid-column: 1; grid-row: 1; }
.transcribe-flat-sidebar #transcribe-marks > #transcribe-delete-measures { grid-column: 1; grid-row: 2; justify-self: stretch; }
.transcribe-flat-sidebar #transcribe-marks > output:not(:empty) { grid-column: 1; grid-row: 3; margin: 0; font-size: var(--tr-type-note); }
.transcribe-flat-sidebar .transcribe-stem-list { grid-template-columns: minmax(0,1fr); }
.transcribe-flat-sidebar .transcribe-stem-list li { border: 0; }
.transcribe-flat-sidebar #transcribe-analysis-contents > label > span { font-size: var(--tr-type-note); white-space: nowrap; }
.transcribe-flat-sidebar :is(.transcribe-stems-actions,.transcribe-info-button) svg { width: 16px; height: 16px; }
.transcribe-flat-sidebar #transcribe-stems-progress { width: 100%; height: 4px; }

.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment { grid-template-rows: 26px; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment > span:first-child { grid-column: 1; grid-row: 1; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry { grid-column: 2; grid-row: 1; }
.transcribe-flat-sidebar #transcribe-section-sound input[type=range] { min-width: 0; }
.transcribe-flat-sidebar #transcribe-chords-toggle { width: 100%; max-width: none; justify-self: stretch; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table { margin: 0; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table th, .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table td { padding: 2px 1px; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table th:first-child { width: 14px; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table thead th { font-size: var(--tr-type-note); }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-swatch { width: 6px; height: 6px; }
.transcribe-flat-sidebar .transcribe-stems-actions { gap: 4px; }
.transcribe-flat-sidebar #transcribe-stems-info + * { margin: 0; }

/* Shared rows make the whole panel fit without a scrolling control surface. */
.transcribe-flat-sidebar #transcribe-sound-contents { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; }
.transcribe-flat-sidebar #transcribe-sound-contents > .transcribe-audio-pitch { grid-column: 1 / -1; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-tool-field { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.transcribe-flat-sidebar #transcribe-analysis-contents > :is(#transcribe-spectrum-visible,#transcribe-chords-toggle) { grid-column: auto; }
.transcribe-flat-sidebar #transcribe-analysis-contents > button { font-size: var(--tr-type-note); }
.transcribe-flat-sidebar #transcribe-section-eq { grid-column: 1 / -1; }
.transcribe-flat-sidebar #transcribe-eq-panel { grid-template-columns: minmax(0,1fr) minmax(0,1.5fr); align-items: start; gap: 4px 8px; }
.transcribe-flat-sidebar #transcribe-eq-graph { grid-column: 1; grid-row: 1; height: 90px; }
.transcribe-flat-sidebar .transcribe-eq-cuts { grid-column: 1; grid-row: 2; }
.transcribe-flat-sidebar #transcribe-eq-bands { grid-column: 2; grid-row: 1 / 3; }
.transcribe-flat-sidebar #transcribe-eq-panel input { height: 24px; min-height: 24px; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table :is(th,td) { line-height: 1; padding: 2px 1px; }
.transcribe-flat-sidebar #transcribe-section-stems { grid-column: 1 / -1; }
.transcribe-flat-sidebar #transcribe-section-stems > h3 { min-height: 26px; }
.transcribe-flat-sidebar #transcribe-section-stems .transcribe-stems-actions { display: flex; flex-wrap: nowrap; gap: 4px; }
.transcribe-flat-sidebar #transcribe-stems-enabled { min-width: 80px; }
.transcribe-flat-sidebar .transcribe-stem-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px 8px; }
.transcribe-flat-sidebar .transcribe-stem-list li > span { font-size: var(--tr-type-note); }
.transcribe-flat-sidebar .transcribe-stem-list small { font-size: 0.6rem; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-cuts label { font-size: 0.6rem; white-space: nowrap; }
@media (min-width:1101px) {
  .transcribe-flat-sidebar .transcribe-stem-list { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .transcribe-flat-sidebar .transcribe-stem-list li { grid-template-columns: minmax(0,1fr); }
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-sound-controls { grid-column: 2; grid-row: 1; }
.transcribe-flat-sidebar #transcribe-pitch-lock { grid-column: 1; grid-row: 1; }
.transcribe-flat-sidebar #transcribe-eq-graph { height: 70px; }
.transcribe-flat-sidebar #transcribe-eq-panel input { min-height: 22px; height: 22px; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table :is(th,td) { padding: 1px; }
.transcribe-flat-sidebar .transcribe-controls-grid { gap: 4px 8px; }
.transcribe-flat-sidebar .transcribe-sidebar-footer .transcribe-data-actions { padding-top: 2px; }
.transcribe-flat-sidebar .transcribe-sidebar-footer button { height: 22px; min-height: 22px; }
@media (max-width: 400px) {
  .transcribe-flat-sidebar .transcribe-sidebar-section > h3 { min-height: 18px; margin-bottom: 2px; }
  .transcribe-flat-sidebar .transcribe-group-content > .transcribe-tool-toggle { min-height: 24px; height: 24px; }
  .transcribe-flat-sidebar :is(#transcribe-section-sound,#transcribe-section-analysis) :is(input,select) { min-height: 24px; height: 24px; }
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment { grid-template-rows: 24px; }
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry { height: 24px; }
  .transcribe-flat-sidebar #transcribe-section-sound input[type=range] { height: 24px; }
  .transcribe-flat-sidebar .transcribe-stem-list li { min-height: 24px; }
  .transcribe-flat-sidebar #transcribe-section-stems > h3 { min-height: 24px; }
  .transcribe-flat-sidebar #transcribe-stems-enabled { min-height: 24px; height: 24px; }
  .transcribe-flat-sidebar .transcribe-stems-actions { min-height: 24px; }
}
@media (max-width: 350px) {
  .transcribe-flat-sidebar .transcribe-controls-grid { gap: 2px 6px; padding: 4px; }
  .transcribe-flat-sidebar .transcribe-group-content { gap: 2px; }
  .transcribe-flat-sidebar #transcribe-marks { gap: 2px 4px; }
  .transcribe-flat-sidebar #transcribe-eq-panel { gap: 2px 4px; }
  .transcribe-flat-sidebar .transcribe-stem-list { gap: 2px 4px; }
}

.transcribe-flat-sidebar .transcribe-stems-actions .transcribe-info-button { width: 20px; min-width: 20px; height: 20px; min-height: 20px; padding: 2px; }
@media (max-width: 350px) {
}
/* The native channel selection shares the first toggle row. */
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-tool-field > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-tool-field { display: block; }
/* Use the available rail height for comfortable controls and a usable EQ plot. */
.transcribe-flat-sidebar .transcribe-controls-grid {
  grid-template-rows: auto auto minmax(0,1fr) auto auto;
  align-content: stretch;
  gap: 8px 10px;
  padding: 10px;
}
.transcribe-flat-sidebar #transcribe-section-eq { display: flex !important; flex-direction: column; min-height: min-content; }
.transcribe-flat-sidebar #transcribe-eq-contents { flex: 1; min-height: 0; display: flex; }
.transcribe-flat-sidebar #transcribe-eq-panel { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2.5fr); grid-template-rows: minmax(70px,1fr) auto; gap: 6px 8px; }
.transcribe-flat-sidebar #transcribe-eq-graph { grid-column: 1 / -1; grid-row: 1; width: 100%; height: 100%; min-height: 70px; }
.transcribe-flat-sidebar .transcribe-eq-cuts { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: minmax(0,1fr); align-self: start; gap: 6px; }
.transcribe-flat-sidebar #transcribe-eq-bands { grid-column: 2; grid-row: 2; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table { display: block; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.transcribe-flat-sidebar .transcribe-eq-table tbody { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 6px; }
.transcribe-flat-sidebar .transcribe-eq-table tbody tr { display: grid; grid-template-columns: 8px minmax(0,1.4fr) repeat(2,minmax(0,1fr)); align-items: end; gap: 2px; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table :is(th,td) { padding: 0; min-width: 0; }
.transcribe-flat-sidebar .transcribe-eq-table td::before { display: block; margin-bottom: 2px; font-size: var(--tr-type-note); line-height: 1; color: var(--tr-muted); }
.transcribe-flat-sidebar .transcribe-eq-table td:nth-child(2)::before { content: 'Hz'; }
.transcribe-flat-sidebar .transcribe-eq-table td:nth-child(3)::before { content: 'dB'; }
.transcribe-flat-sidebar .transcribe-eq-table td:nth-child(4)::before { content: 'Q'; }
.transcribe-flat-sidebar .transcribe-eq-table tbody th { display: grid; align-items: center; height: 28px; }
.transcribe-flat-sidebar #transcribe-eq-graph .eq-point { touch-action: none; }
@media (min-width: 721px) {
  .transcribe-flat-sidebar { --tr-type-label: 0.8125rem; --tr-type-note: 0.6875rem; }
  .transcribe-flat-sidebar .transcribe-group-content { gap: 6px; }
  .transcribe-flat-sidebar .transcribe-sidebar-section > h3 { min-height: 22px; margin-bottom: 6px; }
  .transcribe-flat-sidebar .transcribe-group-content > .transcribe-tool-toggle { height: 32px; min-height: 32px; }
  .transcribe-flat-sidebar :is(#transcribe-section-sound,#transcribe-section-analysis) :is(input,select) { height: 32px; min-height: 32px; font-size: var(--tr-type-label); }
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment { grid-template-rows: 32px; }
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry { height: 32px; grid-template-columns: minmax(0,1fr) 42px; }
  .transcribe-flat-sidebar #transcribe-section-sound input[type=range] { height: 32px; }
  .transcribe-flat-sidebar .transcribe-stem-list li { min-height: 32px; }
  .transcribe-flat-sidebar .transcribe-stem-list li > span { font-size: var(--tr-type-label); }
  .transcribe-flat-sidebar #transcribe-stems-enabled { height: 32px; min-height: 32px; }
  .transcribe-flat-sidebar #transcribe-section-stems > h3 { min-height: 32px; }
  .transcribe-flat-sidebar #transcribe-eq-panel input { height: 28px; min-height: 28px; font-size: var(--tr-type-label); }
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-cuts label { font-size: var(--tr-type-note); }
  .transcribe-flat-sidebar .transcribe-sidebar-footer button { height: 28px; min-height: 28px; }
}
@media (max-width:720px) {
  .transcribe-flat-sidebar .transcribe-controls-grid { padding: 6px; gap: 4px 8px; }
  .transcribe-flat-sidebar #transcribe-eq-panel { gap: 4px 6px; }
  .transcribe-flat-sidebar .transcribe-eq-cuts { gap: 4px; }
  .transcribe-flat-sidebar .transcribe-eq-table tbody { gap: 4px; }
}
@media (max-width:350px) {
  .transcribe-flat-sidebar .transcribe-controls-grid { padding: 4px; gap: 2px 6px; }
  .transcribe-flat-sidebar #transcribe-eq-panel { grid-template-columns: minmax(0,1fr) minmax(0,2.8fr); gap: 2px 4px; }
  .transcribe-flat-sidebar .transcribe-eq-table tbody { gap: 2px; }
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-cuts label { font-size: 0.5625rem; }
}

#transcribe-eq-graph .eq-hit { fill: transparent; stroke: none !important; pointer-events: all; }
#transcribe-eq-graph .eq-point ellipse:not(.eq-hit) { vector-effect: non-scaling-stroke; }
:root[data-keyboard-navigation="on"] #transcribe-eq-graph .eq-point:focus ellipse:not(.eq-hit) { stroke: var(--tr-accent); stroke-width: 2; }

/* Keep cuts at hand and give each numeric band enough room for its value. */
.transcribe-flat-sidebar #transcribe-section-eq > h3 { align-items: end; }
.transcribe-flat-sidebar #transcribe-section-eq > h3 > span { align-self: center; }
.transcribe-flat-sidebar #transcribe-section-eq > h3 .transcribe-eq-cuts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 48%; gap: 4px; margin-left: auto; }
.transcribe-flat-sidebar #transcribe-section-eq > h3 .transcribe-eq-cuts label { display: grid; gap: 2px; min-width: 0; font-size: var(--tr-type-note); line-height: 1; white-space: nowrap; font-weight: 400; }
.transcribe-flat-sidebar #transcribe-section-eq > h3 .transcribe-eq-cuts input { width: 100%; min-width: 0; min-height: 24px; height: 24px; padding: 2px 4px; font-size: var(--tr-type-label); }
.transcribe-flat-sidebar #transcribe-eq-panel { grid-template-columns: minmax(0,1fr); }
.transcribe-flat-sidebar #transcribe-eq-bands { grid-column: 1; grid-row: 2; }
@media (min-width:721px) {
  .transcribe-flat-sidebar #transcribe-section-eq > h3 .transcribe-eq-cuts input { height: 28px; min-height: 28px; }
}
@media (max-width:720px) {
  .transcribe-flat-sidebar .transcribe-controls-grid { gap: 2px 8px; }
  .transcribe-flat-sidebar .transcribe-eq-table tbody tr:nth-child(n+3) td::before { display: none; }
  .transcribe-flat-sidebar .transcribe-stem-list { gap: 2px 8px; }
}
@media (max-width:720px) {
  .transcribe-flat-sidebar .transcribe-eq-table tbody th { height: 22px; }
  .transcribe-flat-sidebar .transcribe-eq-table td::before { margin-bottom: 1px; }
}
@media (max-width:350px) {
  .transcribe-flat-sidebar #transcribe-eq-panel { grid-template-rows: minmax(60px,1fr) auto; }
  .transcribe-flat-sidebar #transcribe-eq-graph { min-height: 60px; }
}

@media (max-width:350px) {
  .transcribe-workspace.mobile-section-open .transcribe-navbar-row { grid-template-rows: 40px 44px 44px; }
  .transcribe-workspace.mobile-section-open .transcribe-navbar-row .transcribe-identity { min-height: 40px; height: 40px; padding-block: 8px; }
}
/* One operational type family, with distinct titles, labels, values, and notes. */
.transcribe-flat-sidebar {
  --tr-type-section: 0.875rem;
  --tr-type-command: 0.72rem;
  --tr-type-helper: 0.6875rem;
  --tr-type-value: 0.8125rem;
  font-family: var(--font-ui);
}
.transcribe-flat-sidebar .transcribe-sidebar-header h2,
.transcribe-flat-sidebar .transcribe-sidebar-section > h3 {
  font-family: var(--font-ui);
  font-size: var(--tr-type-section);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
}
.transcribe-flat-sidebar .transcribe-controls-grid :is(button,input,select,label) {
  font-family: var(--font-ui);
  letter-spacing: 0;
  text-transform: none;
}
.transcribe-flat-sidebar .transcribe-controls-grid :is(input,select) {
  font-size: var(--tr-type-value);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.transcribe-flat-sidebar .transcribe-group-content > .transcribe-tool-toggle,
.transcribe-flat-sidebar #transcribe-analysis-contents > button {
  font-size: var(--tr-type-label);
  font-weight: 500;
}
.transcribe-flat-sidebar .transcribe-tool-toggle > span { color: var(--tr-text); font-weight: 500; }
.transcribe-flat-sidebar .transcribe-tool-toggle > strong { font-weight: 700; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment > span:first-child,
.transcribe-flat-sidebar #transcribe-analysis-contents > label > span,
.transcribe-flat-sidebar #transcribe-marks label,
.transcribe-flat-sidebar #transcribe-marks legend{
  font-size: var(--tr-type-label);
  font-weight: 500;
  line-height: 1.15;
  color: var(--tr-text);
}
.transcribe-flat-sidebar #transcribe-stems-enabled { font-weight: 600; }
.transcribe-flat-sidebar .transcribe-stem-list li > span {
  font-size: var(--tr-type-label);
  font-weight: 500;
  line-height: 1.15;
}
.transcribe-flat-sidebar .transcribe-eq-table td::before,
.transcribe-flat-sidebar #transcribe-section-eq > h3 .transcribe-eq-cuts label {
  font-size: var(--tr-type-helper);
  font-weight: 500;
  line-height: 1;
  color: var(--tr-muted);
}
@media (max-width: 720px) {
  .transcribe-flat-sidebar {
    --tr-type-section: 0.8125rem;
    --tr-type-label: 0.72rem;
    --tr-type-command: 0.6875rem;
    --tr-type-helper: 0.625rem;
    --tr-type-value: 0.75rem;
  }
}
/* Short rails reserve space for legible fields below the editable graph. */
@media (max-width: 720px), (max-height: 800px) {
  .transcribe-flat-sidebar #transcribe-eq-panel { grid-template-rows: minmax(60px,1fr) auto; }
  .transcribe-flat-sidebar #transcribe-eq-graph { min-height: 60px; }
}
@media (max-width: 350px) {
  .transcribe-flat-sidebar #transcribe-eq-panel { grid-template-rows: minmax(55px,1fr) auto; }
  .transcribe-flat-sidebar #transcribe-eq-graph { min-height: 55px; }
}

/* Shared alignment rails keep the flat controls easy to scan. */
.transcribe-flat-sidebar {
  --tr-group-gap: 8px;
  --tr-column-gap: 12px;
  --tr-field-gap: 4px;
  --tr-sidebar-row-height: 32px;
}
.transcribe-flat-sidebar .transcribe-controls-grid {
  column-gap: var(--tr-column-gap);
  row-gap: var(--tr-group-gap);
}
.transcribe-flat-sidebar #transcribe-section-sound {
  display: flex !important;
  flex-direction: column;
  gap: 0;
}
.transcribe-flat-sidebar #transcribe-sound-contents {
  flex: 1;
  grid-template-rows: var(--tr-sidebar-row-height) minmax(0,1fr);
  align-items: stretch;
}
.transcribe-flat-sidebar #transcribe-section-sound #transcribe-channel {
  height: var(--tr-sidebar-row-height);
  min-height: var(--tr-sidebar-row-height);
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-controls {
  height: 100%;
  grid-template-rows: repeat(2,var(--tr-sidebar-row-height));
  align-content: space-between;
  align-items: start;
}
.transcribe-flat-sidebar #transcribe-marks {
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: var(--tr-field-gap);
  align-items: end;
}
.transcribe-flat-sidebar #transcribe-marks > fieldset{
  display: contents;
}
.transcribe-flat-sidebar #transcribe-marks > fieldset > label { grid-column: 1; grid-row: 1; }
.transcribe-flat-sidebar #transcribe-marks > output:not(:empty){ grid-column: 1 / -1; grid-row: auto; }
.transcribe-flat-sidebar .transcribe-eq-table tbody { column-gap: var(--tr-column-gap); }
.transcribe-flat-sidebar .transcribe-stem-list { column-gap: var(--tr-column-gap); }
.transcribe-flat-sidebar #transcribe-section-eq > h3 .transcribe-eq-cuts { gap: var(--tr-field-gap); }
@media (max-width: 720px) {
  .transcribe-flat-sidebar { --tr-group-gap: 4px; --tr-column-gap: 8px; --tr-sidebar-row-height: 24px; }
}
@media (max-width: 350px), (min-width: 721px) and (max-height: 800px) {
  .transcribe-flat-sidebar { --tr-group-gap: 2px; }
}

/* Keep headings for titles and reset actions; all settings live beneath them. */
.transcribe-flat-sidebar .transcribe-controls-grid {
  grid-template-rows: repeat(5,auto);
  align-content: space-between;
}
.transcribe-flat-sidebar #transcribe-section-eq { flex: none; }
.transcribe-flat-sidebar #transcribe-eq-contents { flex: none; }
.transcribe-flat-sidebar #transcribe-eq-panel {
  flex: none;
  grid-template-rows: auto auto auto;
  gap: 8px;
}
.transcribe-flat-sidebar #transcribe-eq-graph {
  grid-column: 1;
  grid-row: 1;
  height: clamp(44px,12vh,110px);
  min-height: 44px;
}
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-cuts {
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: var(--tr-column-gap);
  width: 100%;
  margin: 0;
}
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-cuts label {
  font-size: var(--tr-type-helper);
  font-weight: 500;
  line-height: 1;
}
.transcribe-flat-sidebar #transcribe-eq-bands { grid-column: 1; grid-row: 3; }
.transcribe-flat-sidebar #transcribe-section-stems > h3 { min-height: 22px; }
.transcribe-flat-sidebar #transcribe-stems-panel .transcribe-stems-actions { display: block; }
.transcribe-flat-sidebar #transcribe-stems-enabled { width: 100%; min-width: 0; }
@media (max-width: 720px) {
  .transcribe-flat-sidebar #transcribe-eq-panel { gap: 4px; }
  .transcribe-flat-sidebar #transcribe-eq-graph { height: 48px; }
  .transcribe-flat-sidebar #transcribe-section-stems > h3 { min-height: 18px; }
}
.transcribe-flat-sidebar #transcribe-section-eq { display: block !important; }
.transcribe-flat-sidebar #transcribe-eq-contents { display: block; }
.transcribe-flat-sidebar #transcribe-section-eq { min-height: min-content; }
.transcribe-flat-sidebar:has(.transcribe-stem-list:not([hidden])) #transcribe-eq-graph {
  height: clamp(36px,7vh,64px);
  min-height: 36px;
}
@media (max-width: 720px) {
  .transcribe-flat-sidebar:has(.transcribe-stem-list:not([hidden])) #transcribe-eq-graph { height: 36px; }
}

/* Pitch labels follow the same above-field pattern as analysis settings. */
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-controls {
  height: auto;
  grid-template-rows: repeat(2,auto);
  align-content: start;
  gap: 4px;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment {
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto var(--tr-sidebar-row-height);
  gap: 2px;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment > span:first-child {
  grid-column: 1;
  grid-row: 1;
  font-size: var(--tr-type-note);
  font-weight: 500;
  line-height: 1.15;
  color: var(--tr-muted);
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry {
  grid-column: 1;
  grid-row: 2;
}

/* Manual fields match each graph band's outline color with a faint fill. */
.transcribe-flat-sidebar .transcribe-eq-table tbody tr {
  position: relative;
  grid-template-columns: minmax(0,1.4fr) repeat(2,minmax(0,1fr));
  background: transparent;
}
.transcribe-flat-sidebar .transcribe-eq-table tbody th {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.transcribe-flat-sidebar .transcribe-eq-swatch { display: none; }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table input {
  width: 100%;
  background: color-mix(in srgb, var(--eq-band-color) 9%, var(--tr-bg));
  border-color: var(--eq-band-color);
}

/* Quiet rules separate groups; spare height belongs inside the working controls. */
.transcribe-flat-sidebar .transcribe-controls-grid {
  grid-template-rows: auto auto minmax(0,1fr) auto auto;
  align-content: stretch;
  row-gap: 8px;
}
.transcribe-flat-sidebar #transcribe-section-analysis {
  position: relative;
  display: flex !important;
  flex-direction: column;
  gap: 0;
}
.transcribe-flat-sidebar #transcribe-section-analysis::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--tr-column-gap) / -2);
  border-left: 1px solid var(--tr-border-soft);
}
.transcribe-flat-sidebar #transcribe-analysis-contents {
  flex: 1;
  align-content: space-between;
}
.transcribe-flat-sidebar #transcribe-sound-contents > .transcribe-audio-pitch { height: 100%; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-controls {
  height: 100%;
  align-content: space-between;
}
@media (min-width: 1101px) and (min-height: 850px) {
  .transcribe-flat-sidebar { --tr-sidebar-row-height: 36px; }
  .transcribe-flat-sidebar .transcribe-group-content > .transcribe-tool-toggle,
  .transcribe-flat-sidebar :is(#transcribe-section-sound,#transcribe-section-analysis) :is(input,select),
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry{
    height: 36px;
    min-height: 36px;
  }
  .transcribe-flat-sidebar #transcribe-eq-panel input { height: 32px; min-height: 32px; }
  .transcribe-flat-sidebar #transcribe-eq-panel { gap: 10px; }
}
@media (max-width: 720px), (max-height: 800px) {
  .transcribe-flat-sidebar .transcribe-controls-grid { row-gap: 4px; }
}
.transcribe-flat-sidebar #transcribe-eq-panel,
.transcribe-flat-sidebar #transcribe-eq-contents { min-height: min-content; }
@media (min-width: 721px) and (max-height: 800px) {
  .transcribe-flat-sidebar #transcribe-eq-graph { height: 60px; }
}
@media (min-width: 1101px) and (min-height: 850px) {
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input,
  .transcribe-flat-sidebar #transcribe-section-analysis select{
    height: 36px;
    min-height: 36px;
  }
}

@media (min-width: 721px) and (max-height: 800px) {
  .transcribe-flat-sidebar:has(.transcribe-stem-list:not([hidden])) #transcribe-eq-graph { height: 36px; }
}
@media (max-width: 720px) {
  .transcribe-flat-sidebar:has(.transcribe-stem-list:not([hidden])) .transcribe-controls-grid { row-gap: 2px; }
}
@media (max-width: 350px) {
  .transcribe-flat-sidebar:has(.transcribe-stem-list:not([hidden])) #transcribe-eq-graph { height: 32px; min-height: 32px; }
}

/* A consistent reading hierarchy for the current flat control surface. */
.transcribe-flat-sidebar {
  --tr-type-section: 0.9375rem;
  --tr-type-value: 0.875rem;
  --tr-type-command: 0.75rem;
  --tr-type-field-label: 0.6875rem;
}
.transcribe-flat-sidebar .transcribe-sidebar-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.transcribe-flat-sidebar #transcribe-analysis-contents > label > span,
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment > span:first-child,
.transcribe-flat-sidebar #transcribe-marks > fieldset label > span,
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-cuts label {
  font-size: var(--tr-type-field-label);
  font-weight: 500;
  line-height: 1.15;
  color: var(--tr-muted);
}
.transcribe-flat-sidebar #transcribe-eq-panel input,
.transcribe-flat-sidebar #transcribe-section-eq .transcribe-eq-cuts input,
.transcribe-flat-sidebar :is(#transcribe-section-sound,#transcribe-section-analysis) :is(input[type=number],select) {
  font-size: var(--tr-type-value);
  font-weight: 500;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.transcribe-flat-sidebar .transcribe-section-reset {
  font-size: var(--tr-type-field-label);
  font-weight: 500;
}
@media (max-width: 720px) {
  .transcribe-flat-sidebar {
    --tr-type-section: 0.875rem;
    --tr-type-value: 0.75rem;
    --tr-type-command: 0.6875rem;
    --tr-type-field-label: 0.6875rem;
  }
  .transcribe-flat-sidebar .transcribe-sidebar-header h2 { font-size: 1.0625rem; }
}

/* Sound and Analysis share three control baselines across their two columns. */
.transcribe-flat-sidebar {
  --tr-sidebar-label-height: calc(var(--tr-type-field-label) * 1.15);
  --tr-sidebar-labeled-height: calc(var(--tr-sidebar-row-height) + var(--tr-sidebar-label-height) + 2px);
}
.transcribe-flat-sidebar :is(#transcribe-sound-contents,#transcribe-analysis-contents) {
  grid-template-rows: var(--tr-sidebar-row-height) repeat(2,var(--tr-sidebar-labeled-height));
  align-content: start;
  align-items: end;
  row-gap: 0;
}
.transcribe-flat-sidebar #transcribe-section-sound :is(.transcribe-audio-pitch,.transcribe-pitch-controls) { display: contents; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment {
  grid-column: 1 / -1;
  align-self: end;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment:first-child { grid-row: 2; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment:last-child { grid-row: 3; }
.transcribe-flat-sidebar #transcribe-analysis-contents > #transcribe-analyze-selection { grid-row: 2; align-self: end; }
.transcribe-flat-sidebar #transcribe-analysis-contents > label { grid-row: 3; align-self: end; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input,
.transcribe-flat-sidebar #transcribe-analysis-contents select,
.transcribe-flat-sidebar #transcribe-analysis-contents > button {
  height: var(--tr-sidebar-row-height);
  min-height: var(--tr-sidebar-row-height);
}
.transcribe-flat-sidebar #transcribe-section-analysis #transcribe-analysis-contents select {
  height: var(--tr-sidebar-row-height);
  min-height: var(--tr-sidebar-row-height);
}
.transcribe-flat-sidebar #transcribe-section-analysis #transcribe-analysis-contents > label > span {
  font-size: var(--tr-type-field-label);
  line-height: 1.15;
}
@media (max-width: 350px) {
  .transcribe-flat-sidebar :is(#transcribe-sound-contents,#transcribe-analysis-contents) { row-gap: 0; }
}

/* Finishing details stay inside the controls rail. */
.transcribe-flat-sidebar .transcribe-section-reset {
  display: grid;
  place-items: center;
  min-width: 38px;
}
.transcribe-flat-sidebar #transcribe-eq-panel input { padding-inline: 4px; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type=number] { text-align: center; }
.transcribe-flat-sidebar .transcribe-controls-grid input::selection {
  background: var(--tr-accent);
  color: var(--tr-bg);
}
@media (hover: hover) and (pointer: fine) {
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table input:hover {
    border-color: var(--eq-band-color);
  }
}

/* Spare rail height belongs to the response graph, not gaps between control rows. */
.transcribe-flat-sidebar #transcribe-section-eq { display: flex !important; flex-direction: column; min-height: 0; }
.transcribe-flat-sidebar #transcribe-eq-contents { display: flex; flex: 1; min-height: 0; }
.transcribe-flat-sidebar #transcribe-eq-panel { flex: 1; min-height: 0; grid-template-rows: minmax(44px,1fr) auto auto; }
.transcribe-flat-sidebar #transcribe-eq-graph { height: 100%; min-height: 44px; }
.transcribe-flat-sidebar:has(.transcribe-stem-list:not([hidden])) #transcribe-eq-panel { grid-template-rows: minmax(32px,1fr) auto auto; }
.transcribe-flat-sidebar:has(.transcribe-stem-list:not([hidden])) #transcribe-eq-graph { height: 100%; min-height: 32px; }
@media (min-width: 1101px) {
  .transcribe-flat-sidebar .transcribe-stem-list li {
    grid-template-rows: auto auto;
    align-content: start;
    align-items: start;
  }
}

/* The controls rail has no Timing group; marker options live with measure navigation. */
.transcribe-flat-sidebar .transcribe-controls-grid { grid-template-rows: auto minmax(0,1fr) auto auto; overflow-y: auto; }
#transcribe-measure-panel #transcribe-marks > fieldset { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; border: 0; }
#transcribe-measure-panel #transcribe-marks label { display: grid; gap: 4px; }
#transcribe-measure-panel #transcribe-delete-measures { width: 100%; }
#transcribe-measure-panel #transcribe-marks > output:empty { display: none; }

/* Distill repeated labels and keep maintenance actions secondary. */
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table tbody tr:nth-child(n+3) td::before { display: none; }
.transcribe-flat-sidebar .transcribe-sidebar-section > h3 :is(.transcribe-section-reset,.transcribe-info-button) {
  border-color: transparent;
  background: transparent;
  color: var(--tr-muted);
  font-weight: 500;
}
.transcribe-flat-sidebar #transcribe-clear-saved {
  border-color: transparent;
  background: transparent;
  color: var(--tr-muted);
  text-align: right;
  font-weight: 500;
}
@media (hover: hover) and (pointer: fine) {
  .transcribe-flat-sidebar .transcribe-sidebar-section > h3 :is(.transcribe-section-reset,.transcribe-info-button):hover {
    border-color: var(--tr-border-hover);
    color: var(--tr-text);
  }
  .transcribe-flat-sidebar #transcribe-clear-saved:hover { color: var(--tr-text); text-decoration: underline; }
}

/* One row fits either a plain control or a compact label above its field. */
.transcribe-flat-sidebar { --tr-sidebar-row-height: max(34px, 2.125rem); --tr-sidebar-labeled-height: var(--tr-sidebar-row-height); }
.transcribe-flat-sidebar :is(#transcribe-sound-contents,#transcribe-analysis-contents) {
  grid-template-rows: repeat(3,var(--tr-sidebar-row-height));
  row-gap: 6px;
}
.transcribe-flat-sidebar #transcribe-section-sound #transcribe-channel,
.transcribe-flat-sidebar .transcribe-group-content > .transcribe-tool-toggle,
.transcribe-flat-sidebar #transcribe-analysis-contents > button {
  height: var(--tr-sidebar-row-height);
  min-height: var(--tr-sidebar-row-height);
}
.transcribe-flat-sidebar #transcribe-analysis-contents > label {
  height: var(--tr-sidebar-row-height);
  display: grid;
  grid-template-rows: var(--tr-sidebar-label-height) minmax(0,1fr);
  gap: 2px;
}
.transcribe-flat-sidebar #transcribe-section-analysis #transcribe-analysis-contents select {
  height: calc(var(--tr-sidebar-row-height) - var(--tr-sidebar-label-height) - 2px);
  min-height: 0;
  padding-block: 0;
  line-height: 1;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment {
  height: var(--tr-sidebar-row-height);
  grid-template-columns: minmax(0,1fr) 42px;
  grid-template-rows: var(--tr-sidebar-label-height) minmax(0,1fr);
  gap: 2px 4px;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry { display: contents; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type=range] {
  grid-column: 1;
  grid-row: 2;
  height: 100%;
  min-height: 0;
  align-self: center;
  margin: 0;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type=number] {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  height: var(--tr-sidebar-row-height);
  min-height: 0;
  padding-block: 0;
}
.transcribe-flat-sidebar #transcribe-section-eq .transcribe-eq-cuts input,
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table input {
  height: max(20px, 1.25rem);
  min-height: max(20px, 1.25rem);
  padding-block: 0;
  line-height: 1;
}

/* Text growth uses content space; the normal compact control sizes stay intact. */
.transcribe-navbar-row .transcribe-identity {
  flex-wrap: nowrap;
  height: auto;
  white-space: nowrap;
}
.transcribe-navbar-row .transcribe-identity-suffix { white-space: nowrap; }
.transcribe-navbar-row .transcribe-speed-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  min-width: 0;
}

.transcribe-navbar-row .transcribe-speed-buttons > button,
.transcribe-navbar-row .transcribe-custom-speed-slot {
  flex: 1 0 auto;
  min-width: max-content;
  width: auto;
}
@media (min-width: 721px) and (pointer: fine) {
  .transcribe-navbar-row .transcribe-speed-buttons > button,
  .transcribe-navbar-row .transcribe-custom-speed-slot,
  .transcribe-navbar-row .transcribe-custom-speed-slot :is(button, input),
  .transcribe-navbar-row .transcribe-panel-buttons :is(#transcribe-controls-toggle, #transcribe-shortcuts-toggle) {
    box-sizing: border-box;
    flex: 0 0 var(--tr-control-height);
    width: var(--tr-control-height);
    min-width: var(--tr-control-height);
    height: var(--tr-control-height);
    min-height: var(--tr-control-height);
    padding-inline: 0;
  }
}
.transcribe-flat-sidebar .transcribe-group-content > .transcribe-tool-toggle {
  gap: 0;
  white-space: normal;
  height: auto;
  min-height: var(--tr-sidebar-row-height);
}
.transcribe-flat-sidebar .transcribe-sidebar-section > h3 { min-height: max(20px, 1.375rem); height: auto; }
.transcribe-flat-sidebar .transcribe-controls-grid { align-content: start; }
.transcribe-flat-sidebar :is(#transcribe-sound-contents,#transcribe-analysis-contents) {
  grid-template-rows: repeat(3, minmax(var(--tr-sidebar-row-height), max-content));
}
.transcribe-flat-sidebar { grid-template-rows: auto minmax(0, 1fr); }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table tbody tr { height: auto; min-height: max(20px, 1.25rem); }
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table td::before { line-height: 1.2; height: auto; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-workspace.mobile-section-open .transcribe-navbar-row { grid-template-rows: auto auto auto; }
  .transcribe-workspace.mobile-section-open .transcribe-navbar-row .transcribe-identity { height: auto; }
  .transcribe-app .transcribe-transport-sliders > label { grid-template-rows: auto auto; }
  .transcribe-app .transcribe-transport-sliders span { line-height: 1.2; white-space: normal; }
  .transcribe-app .transcribe-transport-sliders input { height: max(11px, 0.6875rem); }
}
/* Dividers span the section, independent of its flexible content height. */
.transcribe-flat-sidebar :is(#transcribe-section-eq,#transcribe-section-stems) { position: relative; }
.transcribe-flat-sidebar :is(#transcribe-section-eq,#transcribe-section-stems)::before {
  content: '';
  position: absolute;
  top: -4px;
  inset-inline: 0;
  border-top: 1px solid var(--tr-border-soft);
}
@media (max-width: 720px), (max-height: 800px) {
  .transcribe-flat-sidebar :is(#transcribe-section-eq,#transcribe-section-stems)::before { top: -2px; }
}

/* A little breathing room inside the two aligned control columns. */
.transcribe-flat-sidebar :is(#transcribe-sound-contents,#transcribe-analysis-contents) > button,
.transcribe-flat-sidebar #transcribe-section-sound #transcribe-channel,
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type=number],
.transcribe-flat-sidebar #transcribe-section-analysis #transcribe-analysis-contents select { padding: 1px 6px; }

@media (hover: hover) {
  .transcribe-navbar-row .transcribe-panel-buttons :is(#transcribe-controls-toggle,#transcribe-shortcuts-toggle):hover:not(:disabled) {
    border-color: var(--tr-border-hover);
  }
}

.transcribe-flat-sidebar .transcribe-anchored-info[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(24rem,calc(100vw - 16px));
  max-width: min(24rem,calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow: auto;
  box-sizing: border-box;
}

.transcribe-flat-sidebar :is(#transcribe-eq-info,#transcribe-stems-info) p {
  margin: 0;
  color: var(--tr-muted);
  font-size: var(--tr-type-note);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.005em;
}

@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-navbar-row .transcribe-panel-buttons #transcribe-shortcuts-toggle {
    display: none;
  }
  .transcribe-navbar-row {
    padding: 0 16px 8px;
    gap: 8px 6px;
  }
  .transcribe-navbar-row .transcribe-identity {
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .transcribe-navbar-row .transcribe-file-control { gap: 6px; }
  .transcribe-navbar-row #transcribe-config-actions { flex: 0 0 96px; }
  .transcribe-navbar-row #transcribe-config-actions button { padding-inline: 8px; }
  .transcribe-navbar-row .transcribe-panel-buttons #transcribe-controls-toggle {
    width: var(--tr-control-height);
    min-width: var(--tr-control-height);
    padding: 8px;
  }
}

.transcribe-piano-help {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
:root[data-keyboard-navigation="on"] .transcribe-app #transcribe-keyboard:focus-visible {
  outline: 2px solid var(--tr-accent);
  outline-offset: -2px;
}

/* Font-relative container limits reflow enlarged text without changing phone defaults. */
.transcribe-navbar-row { container: transcribe-navbar / inline-size; }
.transcribe-flat-sidebar { container: transcribe-controls / inline-size; }
@container transcribe-navbar (max-width: 12.5rem) {
  .transcribe-navbar-row .transcribe-identity { flex-wrap: wrap; }
}
@container transcribe-controls (max-width: 12.5rem) {
  .transcribe-flat-sidebar .transcribe-controls-grid { display: block; }
  .transcribe-flat-sidebar .transcribe-controls-grid > * + * { margin-top: 8px; }
  .transcribe-flat-sidebar :is(#transcribe-section-sound,#transcribe-section-analysis) { grid-column: 1; grid-row: auto; }
  .transcribe-flat-sidebar #transcribe-section-analysis::before { display: none; }
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment { grid-template-columns: minmax(0, 1fr) max(42px, 2.625rem); }
  .transcribe-flat-sidebar #transcribe-eq-contents,
  .transcribe-flat-sidebar #transcribe-eq-panel { flex: none; }
  .transcribe-flat-sidebar #transcribe-eq-contents { display: block; }
  .transcribe-flat-sidebar #transcribe-eq-panel { width: 100%; min-width: 0; grid-template-rows: 5rem auto auto; }
  .transcribe-flat-sidebar #transcribe-eq-graph { height: 5rem; min-height: 5rem; }
}

/* Touch settings use real, separated hit areas; overflow stays in the controls rail. */
@media (any-pointer: coarse) {
  .transcribe-app[data-view-mode] .transcribe-workspace,
  .transcribe-app[data-view-mode] .transcribe-workspace:not(.has-markers) {
    --tr-timeline-min-height: calc(6rem + 44px);
    grid-template-rows: auto minmax(var(--tr-timeline-min-height), 1.2fr) minmax(44px, 0.8fr) auto;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .transcribe-app[data-view-mode] .transcribe-workspace:not(.has-markers) {
    --tr-timeline-min-height: calc(3.25rem + 44px);
  }
  .transcribe-app .transcribe-timeline { min-height: 0; overflow: visible; }
  .transcribe-app .transcribe-waveform-wrap { min-height: 44px; }
  .transcribe-app #transcribe-waveform { min-height: 44px; }
  .transcribe-app #transcribe-mark-ruler { touch-action: pan-y; }
  .transcribe-flat-sidebar {
    --tr-sidebar-row-height: max(60px, 3.75rem);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .transcribe-flat-sidebar .transcribe-controls-grid {
    grid-template-rows: auto minmax(min-content, 1fr) auto auto;
  }
  .transcribe-flat-sidebar #transcribe-section-eq { min-height: min-content; }
  .transcribe-flat-sidebar .transcribe-sidebar-header button,
  .transcribe-flat-sidebar .transcribe-section-reset,
  .transcribe-flat-sidebar .transcribe-info-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
  }
  .transcribe-flat-sidebar .transcribe-sidebar-section > h3 { min-height: 44px; }
  .transcribe-flat-sidebar .transcribe-section-reset {
    width: auto;
    flex: 0 0 auto;
    padding-inline: 6px;
  }
  .transcribe-flat-sidebar .transcribe-controls-grid { row-gap: 8px; }
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type=number] {
    height: max(44px, 2.75rem);
    min-height: 44px;
  }
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment {
    grid-template-columns: minmax(0, 1fr) max(44px, 2.75rem);
  }
  .transcribe-flat-sidebar #transcribe-section-eq .transcribe-eq-cuts input,
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table input {
    height: max(44px, 2.75rem);
    min-height: 44px;
  }
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table tbody tr {
    height: auto;
    min-height: 44px;
    grid-template-columns: minmax(44px, 1.4fr) repeat(2, minmax(44px, 1fr));
  }
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table tbody { gap: 6px; }
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-cuts { gap: 6px; }
  .transcribe-flat-sidebar #transcribe-clear-saved,
  .transcribe-flat-sidebar #transcribe-section-stems .transcribe-stems-actions #transcribe-stems-enabled,
  .transcribe-flat-sidebar .transcribe-stem-list button {
    height: auto;
    min-height: 44px;
  }
  .transcribe-app .transcribe-transport-sliders input {
    height: 44px;
    min-height: 44px;
  }
}

/* Reserve the measured footer even when text forces the signal workspace to scroll. */
@media (any-pointer: coarse) and (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
  .transcribe-app[data-view-mode] .transcribe-workspace {
    padding-bottom: var(--tr-footer-height, 163px) !important;
  }
  .transcribe-app .transcribe-workspace > .transcribe-transport {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    z-index: 31;
    visibility: visible;
  }
}
@media (any-pointer: coarse) and (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
  .transcribe-app .transcribe-transport {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: auto 44px auto;
  }
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport-sliders,
  .transcribe-app .transcribe-workspace.has-markers .transcribe-transport-sliders {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 8px;
    padding: 0;
  }
  .transcribe-app .transcribe-transport-sliders > label {
    grid-column: auto;
    grid-row: 1;
    grid-template-rows: auto 44px;
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  .transcribe-app .transcribe-empty { overflow: hidden; }
}

/* Wide, short touch screens use horizontal transport space for the signal panes. */
@media (pointer: coarse) and (min-width: 560px) and (max-height: 500px) {
  .transcribe-navbar-row,
  .transcribe-workspace.mobile-section-open .transcribe-navbar-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
  }
  .transcribe-navbar-row .transcribe-identity,
  .transcribe-workspace.mobile-section-open .transcribe-navbar-row .transcribe-identity {
    height: auto;
    min-height: 44px;
    padding-block: 0;
  }
  .transcribe-navbar-row .transcribe-file-control { grid-column: 1; }
  .transcribe-navbar-row .transcribe-playback-settings {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }
  .transcribe-navbar-row .transcribe-panel-buttons { grid-column: 3; }
  .transcribe-navbar-row .transcribe-speed-buttons > button,
  .transcribe-navbar-row .transcribe-custom-speed-slot { min-width: 44px; }
  .transcribe-navbar-row .transcribe-speed-buttons { max-width: 100%; }
  .transcribe-app .transcribe-timeline {
    grid-template-rows: 44px 44px minmax(44px, 1fr);
  }
  .transcribe-app .transcribe-timeline:not(.has-markers) {
    grid-template-rows: 44px minmax(44px, 1fr);
  }
  .transcribe-app[data-view-mode] .transcribe-workspace,
  .transcribe-app[data-view-mode] .transcribe-workspace:not(.has-markers) {
    --tr-timeline-min-height: 132px;
    grid-template-rows: auto minmax(var(--tr-timeline-min-height), 1fr) clamp(44px, 18dvh, 80px) auto;
  }
  .transcribe-app[data-view-mode] .transcribe-workspace:not(.has-markers) {
    --tr-timeline-min-height: 88px;
  }
  .transcribe-app #transcribe-mark-ruler { height: 44px; }
  .transcribe-app .transcribe-transport,
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport {
    grid-template-columns: repeat(7, 44px) minmax(44px, 1fr) minmax(104px, 0.65fr);
    grid-template-rows: auto;
    align-items: center;
    gap: 0;
  }
  .transcribe-app .transcribe-transport > button { grid-row: 1; }
  .transcribe-app .transcribe-transport .transcribe-playback-progress {
    grid-column: 8;
    grid-row: 1;
    padding-inline: 8px;
  }
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport {
    grid-template-columns: repeat(6, 44px) minmax(44px, 1fr) minmax(104px, 0.65fr);
  }
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-playback-progress {
    grid-column: 7;
  }
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport-sliders,
  .transcribe-app .transcribe-workspace.has-markers .transcribe-transport-sliders {
    grid-column: -2;
    grid-row: 1;
    padding-left: 8px;
  }
}

/* Band columns follow the graph from left to right; controls stack by parameter. */
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table tbody {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding-left: 24px;
}
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table tbody tr {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 4px;
}
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table tbody tr:nth-child(n) td::before {
  display: none;
}
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table tbody tr:first-child td {
  position: relative;
}
.transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table tbody tr:first-child td::before {
  display: block;
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-flat-sidebar #transcribe-eq-panel { grid-template-rows: 4rem auto auto; }
  .transcribe-flat-sidebar #transcribe-eq-graph { height: 4rem; min-height: 4rem; }
}

/* Sound and Analysis use their available width without obsolete empty rows. */
.transcribe-flat-sidebar .transcribe-controls-grid {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.transcribe-flat-sidebar :is(#transcribe-section-sound, #transcribe-section-analysis) {
  grid-column: 1 / -1;
  align-self: start;
}
.transcribe-flat-sidebar #transcribe-section-sound { grid-row: 1; }
.transcribe-flat-sidebar #transcribe-section-analysis { grid-row: 2; }
.transcribe-flat-sidebar #transcribe-section-eq { grid-row: 3; }
.transcribe-flat-sidebar #transcribe-section-stems { grid-row: 4; }
.transcribe-flat-sidebar #transcribe-section-analysis::before {
  inset: -4px 0 auto;
  border-left: 0;
  border-top: 1px solid var(--tr-border-soft);
}
.transcribe-flat-sidebar #transcribe-sound-contents {
  grid-template-rows: repeat(2, minmax(var(--tr-sidebar-row-height), max-content));
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment:is(:first-child, :last-child) {
  grid-column: auto;
  grid-row: 2;
}
.transcribe-flat-sidebar #transcribe-analysis-contents {
  flex: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  align-content: start;
}
.transcribe-flat-sidebar #transcribe-analysis-contents > button,
.transcribe-flat-sidebar #transcribe-analysis-contents > #transcribe-analyze-selection {
  grid-column: auto;
  grid-row: 1;
  min-width: 0;
  width: 100%;
}
.transcribe-flat-sidebar #transcribe-analysis-contents > button > span { white-space: normal; min-width: 0; }
.transcribe-flat-sidebar #transcribe-analysis-contents > .transcribe-detection-controls {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}
.transcribe-flat-sidebar #transcribe-section-analysis #transcribe-analysis-contents .transcribe-detection-controls > button {
  grid-column: 1 / -1;
}
.transcribe-flat-sidebar .transcribe-detection-controls :is(label, select) { min-width: 0; width: 100%; }
.transcribe-flat-sidebar .transcribe-detection-controls label { display: flex; flex-direction: column; gap: 2px; }
.transcribe-flat-sidebar .transcribe-detection-controls label > span { font-size: var(--tr-type-field-label); line-height: 1.15; }
.transcribe-flat-sidebar .transcribe-detection-controls button { height: var(--tr-sidebar-row-height); min-height: var(--tr-sidebar-row-height); padding: 2px 4px; font-size: var(--tr-type-label); }
@container transcribe-controls (max-width: 12.5rem) {
  .transcribe-flat-sidebar #transcribe-sound-contents {
    grid-template-rows: none;
    grid-auto-rows: auto;
  }
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment:is(:first-child, :last-child) {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .transcribe-flat-sidebar #transcribe-analysis-contents {
    grid-template-columns: minmax(0, 1fr);
  }
  .transcribe-flat-sidebar #transcribe-analysis-contents > button,
  .transcribe-flat-sidebar #transcribe-analysis-contents > #transcribe-analyze-selection { grid-row: auto; }
  .transcribe-flat-sidebar #transcribe-analysis-contents > .transcribe-detection-controls {
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .transcribe-flat-sidebar .transcribe-detection-controls > label:first-child { grid-column: 1 / -1; }
}

@media (any-pointer: coarse) {
  .transcribe-flat-sidebar .transcribe-controls-grid { display: block; }
  .transcribe-flat-sidebar .transcribe-controls-grid > * + * { margin-top: 8px; }
}

@media (any-pointer: coarse) {
  .transcribe-flat-sidebar #transcribe-section-eq { display: block !important; }
  .transcribe-flat-sidebar #transcribe-eq-contents { display: block; flex: none; }
  .transcribe-flat-sidebar #transcribe-eq-panel { flex: none; height: auto; }
}

/* All mobile transports use sliders, timeline, then playback buttons. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-app .transcribe-transport,
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: auto auto 44px;
    gap: 4px 0;
  }
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .transcribe-app .transcribe-transport > button { grid-row: 3; }
  .transcribe-app .transcribe-transport .transcribe-playback-progress,
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-playback-progress {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 0;
  }
  .transcribe-app .transcribe-transport-sliders,
  .transcribe-app .transcribe-workspace:not(.has-markers) .transcribe-transport-sliders,
  .transcribe-app .transcribe-workspace.has-markers .transcribe-transport-sliders {
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 8px;
    padding: 0;
  }
  .transcribe-app .transcribe-transport-sliders > label {
    grid-column: auto;
    grid-row: 1;
  }
}

/* Joined speed buttons, with one compact interval between navbar controls. */
.transcribe-navbar-row {
  --tr-navbar-gap: 8px;
  gap: var(--tr-navbar-gap);
}
.transcribe-navbar-row :is(.transcribe-navbar-controls, .transcribe-file-control, .transcribe-playback-settings, .transcribe-panel-buttons) {
  gap: var(--tr-navbar-gap);
}

/* Mobile Controls scroll in content order; EQ never borrows height from Stems. */
@media (max-width: 720px), (any-pointer: coarse) {
  .transcribe-flat-sidebar {
    --tr-sidebar-row-height: 34px;
    --tr-type-label: 0.875rem;
    --tr-type-field-label: 0.75rem;
  }
  .transcribe-flat-sidebar .transcribe-controls-grid {
    display: block;
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .transcribe-flat-sidebar .transcribe-controls-grid > * + * { margin-top: 10px; }
  .transcribe-flat-sidebar .transcribe-sidebar-section > h3 {
    min-height: 34px;
    margin-bottom: 4px;
    font-size: 0.875rem;
  }
  .transcribe-flat-sidebar :is(#transcribe-section-analysis, #transcribe-section-eq, #transcribe-section-stems)::before {
    inset: -5px 0 auto;
    border-left: 0;
    border-top: 1px solid var(--tr-border-soft);
  }
  .transcribe-flat-sidebar #transcribe-section-eq { display: block !important; }
  .transcribe-flat-sidebar #transcribe-eq-contents,
  .transcribe-flat-sidebar #transcribe-eq-panel {
    display: block;
    flex: none;
    height: auto;
    min-height: 0;
  }
  .transcribe-flat-sidebar #transcribe-eq-graph,
  .transcribe-flat-sidebar:has(.transcribe-stem-list:not([hidden])) #transcribe-eq-graph {
    display: block;
    width: 100%;
    height: clamp(144px, 40vw, 180px);
    min-height: 144px;
  }
  .transcribe-flat-sidebar #transcribe-eq-panel > .transcribe-eq-cuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-block: 8px;
  }
  .transcribe-flat-sidebar #transcribe-section-eq .transcribe-eq-cuts input,
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table input,
  .transcribe-flat-sidebar #transcribe-section-sound :is(select, input[type="number"]),
  .transcribe-flat-sidebar #transcribe-section-analysis #transcribe-analysis-contents select {
    height: 34px;
    min-height: 34px;
    padding: 4px;
    font-size: 1rem;
  }
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table input { appearance: textfield; }
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table input::-webkit-inner-spin-button,
  .transcribe-flat-sidebar #transcribe-eq-panel .transcribe-eq-table input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
  }
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type="number"] {
    height: 44px;
    min-height: 34px;
  }
  .transcribe-flat-sidebar .transcribe-section-reset,
  .transcribe-flat-sidebar .transcribe-info-button,
  .transcribe-flat-sidebar .transcribe-sidebar-header button {
    min-width: 34px;
    width: auto;
    min-height: 34px;
    height: 34px;
  }
  .transcribe-flat-sidebar #transcribe-section-stems > h3 { min-height: 34px; }
  .transcribe-flat-sidebar #transcribe-section-stems .transcribe-stem-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .transcribe-flat-sidebar #transcribe-section-stems .transcribe-stem-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
  }
  .transcribe-flat-sidebar #transcribe-section-stems .transcribe-stem-list button {
    min-width: 34px;
    min-height: 34px;
  }
  .transcribe-flat-sidebar .transcribe-sidebar-footer button { min-height: 34px; }
}

/* Short touch screens lend the navbar area to Controls until it is closed. */
@media (max-height: 500px) and (pointer: coarse) {
  .transcribe-workspace.mobile-section-open > .transcribe-flat-sidebar {
    grid-row: 1 / 4;
    z-index: 31;
  }
  .transcribe-flat-sidebar #transcribe-eq-graph,
  .transcribe-flat-sidebar:has(.transcribe-stem-list:not([hidden])) #transcribe-eq-graph {
    height: 144px;
  }
}

/* Reveal the controls from their edge without resizing the signal workspace. */
.transcribe-flat-sidebar:not([hidden]) {
  animation: transcribe-rail-reveal 220ms var(--tr-motion-ease);
}
@keyframes transcribe-rail-reveal {
  from { clip-path: inset(0 0 0 calc(100% - 40px)); opacity: 0.8; }
  to { clip-path: inset(0); opacity: 1; }
}
@keyframes transcribe-mobile-reveal {
  from { clip-path: inset(0 0 calc(100% - 44px) 0); opacity: 0.8; }
  to { clip-path: inset(0); opacity: 1; }
}
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .transcribe-flat-sidebar:not([hidden]) { animation-name: transcribe-mobile-reveal; }
}
.transcribe-flat-sidebar .transcribe-anchored-info:popover-open {
  animation: transcribe-help-reveal 160ms var(--tr-motion-ease);
}
@keyframes transcribe-help-reveal {
  from { clip-path: inset(0 0 25% 0); opacity: 0.65; }
  to { clip-path: inset(0); opacity: 1; }
}
.transcribe-app .transcribe-transport > button > svg {
  transition: transform var(--tr-motion-fast) var(--tr-motion-ease);
  transform-origin: center;
}
.transcribe-app .transcribe-transport > button:active:not(:disabled) > svg {
  transform: scale(0.9);
}
@media (prefers-reduced-motion: reduce) {
  .transcribe-app { --tr-motion-fast: 60ms; }
  .transcribe-flat-sidebar:not([hidden]),
  .transcribe-flat-sidebar .transcribe-anchored-info:popover-open { animation: none; }
  .transcribe-app .transcribe-transport > button > svg { transition: none; }
  .transcribe-app .transcribe-transport > button:active:not(:disabled) > svg { transform: none; }
}

/* An indeterminate signal while the selected recording is decoded locally. */
.transcribe-loading {
  position: absolute;
  z-index: 15;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--tr-bg);
  color: var(--tr-text);
  text-align: center;
  pointer-events: auto;
}
.transcribe-app[data-loading] .transcribe-waveform-wrap > :not(.transcribe-loading) { visibility: hidden; }
.transcribe-loading[hidden] { display: none; }
.transcribe-loading strong { font-size: 1rem; line-height: 1.25; }
.transcribe-loading > span {
  max-width: min(100%, 24rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}
.transcribe-loading small { color: var(--tr-muted); font-size: 0.75rem; }
.transcribe-loading-signal {
  --signal-unit: 6px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--signal-unit);
  width: calc(var(--signal-unit) * 20);
  height: calc(var(--signal-unit) * 12);
  margin-bottom: 4px;
  border-bottom: 1px solid var(--tr-border);
}
.transcribe-loading-signal i {
  width: calc(var(--signal-unit) * 2);
  height: calc(var(--signal-unit) * 10);
  background: var(--tr-text);
  opacity: 0.65;
  transform: scaleY(0.5);
  transform-origin: bottom;
}
.transcribe-loading-signal i:nth-child(2n) { transform: scaleY(0.75); }
.transcribe-loading-signal i:nth-child(3n) { transform: scaleY(1); }
/* A discrete scan echoes the timeline playhead over blocky spectrum energy. */
.transcribe-loading-signal::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 calc(var(--signal-unit) * 2 / 3);
  width: calc(var(--signal-unit) * 2 / 3);
  background: var(--tr-accent);
}
.transcribe-loading:not([hidden]) .transcribe-loading-signal i {
  animation: transcribe-loading-signal 1400ms steps(1, end) var(--signal-delay, 0ms) infinite;
}
.transcribe-loading:not([hidden]) .transcribe-loading-signal::after {
  animation: transcribe-loading-scan 1400ms steps(7, end) infinite;
}
.transcribe-loading-signal i:nth-child(2n) { --signal-delay: -560ms; }
.transcribe-loading-signal i:nth-child(3n) { --signal-delay: -1120ms; }
.transcribe-loading-signal i:nth-child(5) { --signal-delay: -840ms; }
.transcribe-loading-signal i:nth-child(7) { --signal-delay: -280ms; }
@keyframes transcribe-loading-signal {
  0%, 100% { transform: scaleY(0.25); }
  20% { transform: scaleY(0.75); }
  40% { transform: scaleY(0.5); }
  60% { transform: scaleY(1); }
  80% { transform: scaleY(0.375); }
}
@keyframes transcribe-loading-scan {
  from { transform: translateX(0); }
  to { transform: translateX(calc(var(--signal-unit) * 21)); }
}
@media (max-height: 500px) {
  .transcribe-loading {
    grid-template-columns: 60px minmax(0, 22rem);
    justify-content: center;
    justify-items: start;
    gap: 0 12px;
    padding: 4px 12px;
  }
  .transcribe-loading-signal { --signal-unit: 3px; grid-column: 1; grid-row: 1 / 3; height: 28px; margin: 0; align-self: center; }
  .transcribe-loading-signal i { height: 24px; }
  .transcribe-loading strong, .transcribe-loading > span { grid-column: 2; line-height: 1.2; }
  .transcribe-loading small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .transcribe-loading:not([hidden]) .transcribe-loading-signal i,
  .transcribe-loading:not([hidden]) .transcribe-loading-signal::after { animation: none; }
  .transcribe-loading-signal::after { transform: translateX(calc(var(--signal-unit) * 9)); }
}

/* Labels sit above matched slider/value rows, with a shared field inset. */
.transcribe-flat-sidebar #transcribe-sound-contents { grid-template-rows: var(--tr-sidebar-row-height) auto; }
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  height: auto;
  gap: 4px;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-adjustment > span:first-child {
  grid-column: 1;
  grid-row: 1;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr) 3.25rem;
  align-items: center;
  height: auto;
  gap: 8px;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type="range"] {
  grid-column: 1;
  grid-row: 1;
  height: 34px;
  margin: 0;
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type="number"],
.transcribe-flat-sidebar #transcribe-section-analysis #transcribe-analysis-contents .transcribe-detection-controls select,
.transcribe-flat-sidebar #transcribe-section-analysis .transcribe-detection-controls input[type="text"] {
  box-sizing: border-box;
  height: 34px;
  min-height: 34px;
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  font-size: var(--tr-type-label);
  border: 1px solid var(--tr-border);
  background: var(--tr-surface);
  color: var(--tr-text);
}
.transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type="number"] {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  appearance: textfield;
}
.transcribe-flat-sidebar .transcribe-pitch-entry input[type="number"]::-webkit-inner-spin-button,
.transcribe-flat-sidebar .transcribe-pitch-entry input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
@media (max-width: 720px), (any-pointer: coarse) {
  .transcribe-flat-sidebar #transcribe-section-sound .transcribe-pitch-entry input[type="number"],
  .transcribe-flat-sidebar #transcribe-section-analysis #transcribe-analysis-contents .transcribe-detection-controls select,
  .transcribe-flat-sidebar #transcribe-section-analysis .transcribe-detection-controls input[type="text"] { font-size: 1rem; }
}
