/* Audio – Reel-Editor
   Papier, Tinte, ein Rot für Aufnahme und Abspielkopf. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations'),
       url(../fonts/archivo-latin-wdth-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2-variations'),
       url(../fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2');
}

:root {
  --paper: #efe8da;
  --paper-hi: #f8f3e9;
  --paper-lo: #e3dac7;
  --ink: #221e19;
  --ink-soft: #5b5348;
  --ink-faint: #998e7d;
  --rule: #cdbfa6;
  --accent: #c2441b;
  --accent-dark: #9c3412;
  --ok: #3f6a4e;

  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius: 3px;
  --gap: 12px;
  --fader-h: 220px;
  --channel-w: 52px;
  --tap: 44px;

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Grundbausteine ---------- */

.wordmark {
  margin: 0;
  font-weight: 800;
  font-stretch: 125%;
  font-size: 21px;
  letter-spacing: -0.01em;
  line-height: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-hi);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--ink);
  transition: transform 60ms, box-shadow 60ms;
}
a.btn { text-decoration: none; color: inherit; }
a.btn.btn-primary { color: var(--paper-hi); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--ink); color: var(--paper-hi); }
.btn-quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding: 0 10px;
  color: var(--ink-soft);
  font-weight: 500;
}
.btn-quiet:active:not(:disabled) { transform: none; color: var(--ink); }
.btn.busy { cursor: progress; }

.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field-label, .label {
  font-size: 11px;
  font-weight: 600;
  font-stretch: 80%;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

select, input[type=text], input[type=password] {
  min-height: var(--tap);
  width: 100%;
  padding: 0 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-hi);
  font-size: 16px; /* verhindert Zoom auf iOS */
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23221e19' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  text-overflow: ellipsis;
}

.seg {
  display: inline-flex;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-hi);
  flex: none;
}
.seg button, .ab button {
  min-height: calc(var(--tap) - 3px);
  padding: 0 14px;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.seg button + button, .ab button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-checked=true] { background: var(--ink); color: var(--paper-hi); }

.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }

.msg { margin: 0; padding: 10px 12px; border-left: 3px solid var(--ink); background: var(--paper-hi); font-size: 15px; }
.msg.bad { border-color: var(--accent); }
.msg.ok { border-color: var(--ok); }

/* ---------- Login und Einrichtung ---------- */

.page-plain { min-height: 100vh; min-height: 100dvh; display: flex; }
.plain {
  width: 100%;
  max-width: 380px;
  margin: auto;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
}
.plain .wordmark { font-size: 40px; margin-bottom: 28px; }
.login .wordmark::after {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 14px;
  background: var(--accent);
}
.checks { list-style: none; padding: 0; margin: 0 0 20px; font-size: 14px; }
.checks li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.checks span { display: inline-block; width: 44px; font-family: var(--mono); font-size: 12px; }
.checks .ok span { color: var(--ok); }
.checks .bad span { color: var(--accent); }

/* ---------- App-Rahmen ---------- */

.app { min-height: 100vh; min-height: 100dvh; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(54px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
}
.top .wordmark { margin-right: auto; padding-left: 4px; }
.lib-toggle { order: 2; }
.logout { order: 3; margin: 0; }
/* Umschalter Audio | Reels (nur auf dem eigenen Server mit Reel-Dienst) */
.switch { order: 1; display: flex; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.switch a { padding: 7px 12px; font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; }
.switch a[aria-current=page] { background: var(--ink); color: var(--paper-hi); }

.layout {
  max-width: 1480px;
  margin: 0 auto;
}

.desk {
  display: grid;
  gap: var(--gap);
  padding: var(--gap) max(var(--gap), env(safe-area-inset-right)) calc(var(--gap) * 2 + env(safe-area-inset-bottom)) max(var(--gap), env(safe-area-inset-left));
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "source" "tape" "mixer" "actions";
}
.source { grid-area: source; }
.tape { grid-area: tape; }
.mixer { grid-area: mixer; }
.actions { grid-area: actions; }

.panel {
  background: var(--paper-hi);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0;
}

/* ---------- Quelle ---------- */

.source { display: flex; gap: 16px; align-items: center; }
.source-side { display: flex; gap: 10px; align-items: flex-end; flex: 1; min-width: 0; }
.source-side .field { flex: 1; }
.source-side { flex-wrap: wrap; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  flex-basis: 100%;
  order: 3;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper-hi);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.check input:checked { background: var(--ink); }
.check input:checked::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--paper-hi);
  border-bottom: 2px solid var(--paper-hi);
  transform: translateY(-1px) rotate(-45deg);
}
#btnFile { flex: none; }

.rec {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.rec-knob {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper-hi);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 60ms, box-shadow 60ms;
}
.rec-knob::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--accent);
  transition: inset 120ms, border-radius 120ms;
}
.rec:active .rec-knob { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.rec[aria-pressed=true] .rec-knob::after { inset: 20px; border-radius: 3px; }
.rec[aria-pressed=true] .rec-label { color: var(--accent); }
.rec-label { font-size: 11px; font-weight: 700; font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; }
.rec:disabled { opacity: .4; cursor: default; }

/* ---------- Band mit Wellenform ---------- */

.tape-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.title-input {
  flex: 1;
  min-width: 0;
  min-height: 36px !important;
  padding: 0 !important;
  border: 0 !important;
  border-bottom: 1.5px dashed transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-weight: 700;
  font-size: 19px !important;
  font-stretch: 92%;
}
.title-input:hover:not(:disabled), .title-input:focus { border-bottom-color: var(--rule) !important; outline: none; }
.title-input::placeholder { color: var(--ink-faint); }
.save-state { flex: none; font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.save-state.bad { color: var(--accent); }

.wave {
  position: relative;
  height: 132px;
  border-radius: 2px;
  background: var(--paper-lo);
  touch-action: pan-y;
  cursor: pointer;
  overflow: hidden;
}
.wave canvas { display: block; width: 100%; height: 100%; }
.wave-cue {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(227, 218, 199, .82);
  pointer-events: none;
  text-align: center;
}
.wave-cue .big { font-family: var(--mono); font-size: 46px; font-weight: 500; line-height: 1; }
.wave-cue .small { font-size: 12px; font-weight: 700; font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.wave-cue.go { background: transparent; }
.wave-cue.go .big { font-family: var(--font); font-size: 30px; font-weight: 800; font-stretch: 110%; color: var(--accent); background: var(--paper-hi); padding: 4px 14px; border: 1.5px solid var(--accent); border-radius: var(--radius); }

.transport {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.btn-round {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper-hi);
  box-shadow: 0 2px 0 var(--ink);
  cursor: pointer;
}
.btn-round:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.btn-round:disabled { opacity: .4; cursor: default; }
.btn-round svg { width: 20px; height: 20px; fill: var(--ink); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.btn-play { width: 56px; height: 56px; background: var(--ink); }
.btn-play svg { fill: var(--paper-hi); stroke: var(--paper-hi); width: 22px; height: 22px; }
.btn-play .i-pause, .btn-play.playing .i-play { display: none; }
.btn-play.playing .i-pause { display: block; }

.time {
  font-family: var(--mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  min-width: 9ch;
}
.time .total { color: var(--ink-faint); }
.time.rec-time { color: var(--accent); }

.ab {
  display: inline-flex;
  margin-left: auto;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.ab button[aria-checked=true] { background: var(--ink); color: var(--paper-hi); }
.ab button[data-mode=original][aria-checked=true] { background: var(--ink-soft); }

/* ---------- Mischpult ---------- */

.mixer-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 16px;
  align-items: end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.hslider output { font-family: var(--mono); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); margin-left: 6px; }
/* waagerechter Regler im Stil der Fader: dunkle Schiene, rechteckige Kappe */
.hslider input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--tap);
  margin: 0;
  background: transparent;
  touch-action: pan-y;
  cursor: pointer;
}
.hslider input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--ink); }
.hslider input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--ink); }
.hslider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 36px;
  margin-top: -15px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--paper-hi) linear-gradient(var(--ink), var(--ink)) center / 2px 60% no-repeat;
  box-shadow: 0 2px 0 var(--ink);
}
.hslider input[type=range]::-moz-range-thumb {
  width: 24px;
  height: 34px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--paper-hi) linear-gradient(var(--ink), var(--ink)) center / 2px 60% no-repeat;
  box-shadow: 0 2px 0 var(--ink);
}
@media (max-width: 420px) {
  .mixer-foot { grid-template-columns: minmax(0, 1fr); }
}
.mixer-head { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

.strip {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding: 10px 4px 2px;
  border-top: 1px solid var(--rule);
}

.channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--channel-w);
  flex: 0 1 var(--channel-w);
  min-width: 0;
}
.readout {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  height: 20px;
  white-space: nowrap;
}
.readout small { font-size: 10px; color: var(--ink-faint); margin-left: 1px; }
.channel-label {
  margin-top: 8px;
  font-size: 10.5px;
  font-weight: 700;
  font-stretch: 72%;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.15;
  hyphens: manual;
  -webkit-hyphens: manual;
}

.fader {
  position: relative;
  width: 100%;
  height: var(--fader-h);
  touch-action: pan-y;
  outline: none;
}
.fader-slot {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 6px;
  margin-left: -3px;
  border-radius: 3px;
  background: var(--ink);
}
.fader-tick {
  position: absolute;
  left: 50%;
  height: 1px;
  width: 26px;
  margin-left: -13px;
  background: var(--ink-faint);
}
.fader-tick.zero { width: 34px; margin-left: -17px; height: 1.5px; background: var(--ink); }
.fader-tick.zero span { right: 35px; color: var(--ink-soft); }
.fader-tick span {
  display: none;
  position: absolute;
  right: 31px;
  top: -6px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 12px;
  color: var(--ink-faint);
}
.fader-cap {
  position: absolute;
  left: 50%;
  width: 40px;
  height: 28px;
  margin: -14px 0 0 -20px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--paper-hi);
  box-shadow: 0 2px 0 var(--ink);
  touch-action: none;
  cursor: grab;
  transition: top 0ms;
}
.fader.animate .fader-cap { transition: top 380ms cubic-bezier(.3, .7, .2, 1); }
.fader-cap::before {
  /* größere Greiffläche für den Daumen */
  content: '';
  position: absolute;
  inset: -10px -8px;
}
.fader-cap::after {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--ink);
  box-shadow: 0 -6px 0 -0.5px var(--rule), 0 6px 0 -0.5px var(--rule);
}
.fader.dragging .fader-cap { cursor: grabbing; background: #fffaf0; }
.fader:focus-visible .fader-cap { outline: 2px solid var(--accent); outline-offset: 2px; }

.meter-ch .channel-label { color: var(--ink-soft); }
.meter {
  position: relative;
  width: 10px;
  height: var(--fader-h);
  padding: 14px 0;
}
.meter-bar {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  right: 0;
  background: var(--paper-lo);
  border: 1px solid var(--ink);
  overflow: hidden;
}
.meter-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: var(--ink);
}
.meter-fill.hot { background: var(--accent); }
.meter-hold { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); bottom: 0; }

/* ---------- Presets und Export ---------- */

.actions { display: flex; flex-direction: column; gap: 14px; }
.presets .field { min-width: 140px; }
.export .field { width: 170px; flex: 1 1 140px; }
.export-result {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}
.export-result .name { font-weight: 600; overflow-wrap: anywhere; }
.export-result .meta { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); margin-right: auto; }

/* ---------- Aufnahmen-Liste ---------- */

.library {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(340px, 88vw);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--paper);
  border-right: 1.5px solid var(--ink);
  transform: translateX(-102%);
  transition: transform 180ms ease-out;
  display: flex;
  flex-direction: column;
}
.library.open { transform: none; }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(34, 30, 25, .28); }

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 8px 0 16px;
  border-bottom: 1.5px solid var(--ink);
  flex: none;
}
.library-head h2 { margin: 0; font-size: 15px; font-weight: 700; font-stretch: 85%; letter-spacing: .04em; text-transform: uppercase; }

.rec-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.rec-item { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); }
.rec-item button.open-rec {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 8px 12px 16px;
  border: 0;
  border-left: 4px solid transparent;
  background: none;
  text-align: left;
  cursor: pointer;
}
.rec-item.active button.open-rec { border-left-color: var(--accent); background: var(--paper-hi); }
.rec-item .t { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-item .m { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.rec-item .del { flex: none; align-self: center; font-size: 13px; padding: 0 7px; }
.rec-item .del + .del { padding-right: 10px; }
.rec-empty { padding: 16px; color: var(--ink-soft); font-size: 14px; }

/* ---------- Dialog und Meldungen ---------- */

.dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 20px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-hi);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.dialog::backdrop { background: rgba(34, 30, 25, .3); }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper-hi);
  font-size: 14px;
  font-weight: 500;
}
.toast.bad { background: var(--accent-dark); }

/* ---------- Größere Bildschirme ---------- */

@media (max-width: 559px) {
  .mixer-head #btnAuto { flex: 1; }
  /* schmale Kanäle: Beschriftung enger, damit nichts ineinanderläuft */
  .channel-label { font-size: 9.5px; font-stretch: 62%; letter-spacing: .03em; max-width: 100%; }
  .channel { padding: 0 2px; }
  .fader-cap { width: 36px; margin-left: -18px; }
}
.top .wordmark { white-space: nowrap; }
.switch { flex-shrink: 0; }
/* Abmelden steht am Handy unten in der Liste (Kopfzeile ist zu schmal) */
.logout-small { display: none; margin: 16px 0 0; }
@media (max-width: 520px) {
  .top .wordmark { font-size: 16px; font-stretch: 100%; }
  .top .logout { display: none; }
  .logout-small { display: block; }
  .switch a { padding: 7px 10px; font-size: 13px; }
}
@media (max-width: 399px) {
  /* Einheit weglassen, sie steht ja an der Skala */
  .readout small { display: none; }
  .readout { font-size: 12px; }
}

@media (min-width: 560px) {
  :root { --channel-w: 64px; --fader-h: 240px; }
  .channel-label { font-size: 11.5px; }
}

@media (min-width: 760px) {
  .fader-tick span { display: block; }
  :root { --gap: 16px; --fader-h: 260px; --channel-w: 76px; }
  .panel { padding: 18px; }
  .wave { height: 168px; }
  .rec-knob { width: 72px; height: 72px; }
  .rec-knob::after { inset: 12px; }
  .rec[aria-pressed=true] .rec-knob::after { inset: 23px; }
}

/* Laptop: Regler neben der Wellenform */
@media (min-width: 1060px) {
  :root { --fader-h: 330px; --channel-w: 70px; }
  .desk {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "source mixer"
      "tape   mixer"
      "actions mixer";
    align-items: start;
  }
  .tape { align-self: stretch; display: flex; flex-direction: column; }
  .tape .wave { flex: 1; min-height: 190px; }
  .mixer { align-self: stretch; display: flex; flex-direction: column; }
  .mixer .strip { flex: 1; align-items: stretch; }
  .mixer .channel { height: auto; }
  .mixer .fader, .mixer .meter { flex: 1; height: auto; min-height: var(--fader-h); }
}

/* Breit: Aufnahmen-Liste fest links */
@media (min-width: 1380px) {
  .layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); }
  .library {
    position: sticky;
    top: 54px;
    height: calc(100vh - 54px);
    height: calc(100dvh - 54px);
    width: auto;
    transform: none;
    transition: none;
    z-index: 1;
    padding: 0;
  }
  .library-head { height: 48px; }
  .lib-toggle, .lib-close, .scrim { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (hover: hover) {
  .btn:hover:not(:disabled) { background: var(--paper); }
  .btn-primary:hover:not(:disabled) { background: #3a332b; }
  .btn-quiet:hover:not(:disabled) { background: transparent; color: var(--ink); }
  .rec-item button.open-rec:hover { background: var(--paper-hi); }
  .seg button:hover:not([aria-checked=true]), .ab button:hover:not([aria-checked=true]) { background: var(--paper); }
}
