/* Design-Tokens aus digitalhandwerk.rocks:
   Grund #0C0D10, Flaechen #141518/#15161B, Akzent-Amber #F59E0B,
   Text #F3F4F6, gedaempft #9A9AA3, Rahmen rgba(255,255,255,.07),
   Inter Tight fuer Text, DM Mono fuer Zahlen und Labels. */
:root {
  --bg: #0c0d10;
  --surface: #141518;
  --surface-2: #15161b;
  --input: #1a1b1e;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f4f6;
  --muted: #9a9aa3;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.15);
  --accent-line: rgba(245, 158, 11, 0.25);
  --ok: #22c55e;
  --danger: #ef4444;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", "Menlo", monospace;
}

* { box-sizing: border-box; }

/* Muss nach dem Box-Sizing und vor allen Komponenten stehen: mehrere Elemente
   setzen ein eigenes display (flex, grid, inline-flex) und wuerden das
   [hidden]-Attribut sonst ueberstimmen. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* Dezenter Amber-Schimmer oben, wie auf der Hauptseite. */
  content: "";
  position: fixed;
  inset: -20vh 0 auto 0;
  height: 60vh;
  background: radial-gradient(60% 60% at 50% 0%, rgba(245, 158, 11, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.4; }

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

.shell {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

/* ---------- Kopfzeile: nur Wortmarke und Abmelden, keine Navigation ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.wordmark {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.wordmark b { color: var(--text); font-weight: 500; }
.wordmark .dot { color: var(--accent); }

.linkish {
  background: none;
  border: 0;
  padding: 6px 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}
.linkish:hover { color: var(--accent); }

/* ---------- Karten ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.step {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.6;
}

h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13.5px;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
}
.login h1 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.login p { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }

input[type="password"] {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  margin-bottom: 12px;
}
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  color: var(--text);
  text-decoration: none;
  max-width: 100%;
  overflow-wrap: anywhere;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover:not(:disabled) { border-color: var(--border-strong); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0c0d10;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #fbbf24; border-color: #fbbf24; }

.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.btn-wide { width: 100%; }

/* ---------- Dropzone ---------- */
.drop {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 40px 24px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop.is-over { border-color: var(--accent); background: rgba(245, 158, 11, 0.06); }
.drop strong { display: block; margin-bottom: 6px; font-weight: 600; }
.drop span { color: var(--muted); font-size: 13px; }

.file-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.file-line .name { font-weight: 600; word-break: break-all; }
.file-line .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.file-line .spacer { flex: 1 1 auto; }

.progress {
  height: 3px;
  border-radius: 999px;
  background: var(--input);
  overflow: hidden;
  margin-top: 14px;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.15s linear;
}

/* ---------- Preset-Kacheln ---------- */
.presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.preset {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.preset:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.preset[aria-pressed="true"] {
  border-color: var(--accent-line);
  background: rgba(245, 158, 11, 0.10);
}
.preset .n { display: block; font-weight: 600; font-size: 14.5px; }
.preset .t { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.preset .l {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 10px;
  letter-spacing: 0.02em;
}
.preset[aria-pressed="true"] .l { color: var(--accent); }

.preset-desc {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  margin: -8px 0 20px;
}

/* ---------- Segmente / Regler ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 78px;
}

.seg {
  display: inline-flex;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 3px;
}
.seg button {
  background: none;
  border: 0;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: #0c0d10; font-weight: 600; }
.seg button:hover[aria-pressed="false"] { color: var(--text); }

.eq {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.eq-band { display: flex; flex-direction: column; gap: 6px; }
.eq-band header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.eq-band header b { color: var(--accent); font-weight: 500; font-size: 12px; text-transform: none; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: var(--input);
}
input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: var(--input);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
}

.beta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
}

/* ---------- Vorhoeren ---------- */
.audition {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px 16px;
  margin-top: 16px;
}

.audition-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.audition-head .label { min-width: 0; }
.audition-head .spacer { flex: 1 1 auto; }
.muted-line { font-size: 11px; color: var(--muted); }

.ab-compact { margin-bottom: 12px; padding: 3px; }
.ab-compact button {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 7px;
}
.ab-compact button[aria-pressed="true"] { font-weight: 600; }

.play.play-sm { width: 34px; height: 34px; }

/* ---------- A/B-Player ---------- */
.ab {
  display: flex;
  gap: 4px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 18px;
}
.ab button {
  flex: 1;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  padding: 14px 10px;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.ab button .k {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
.ab button .v { display: block; font-size: 15px; font-weight: 600; margin-top: 3px; }
.ab button[aria-pressed="true"] { background: var(--accent); color: #0c0d10; }

.transport { display: flex; align-items: center; gap: 14px; }
.play {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  display: grid;
  place-items: center;
}
.play svg { fill: #0c0d10; }
.time { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 88px; text-align: right; }
.transport input[type="range"] { flex: 1 1 auto; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 11px 13px;
}
.stat .k {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat .v {
  display: block;
  font-family: var(--mono);
  font-size: 16px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat .v.good { color: var(--ok); }

/* ---------- Export ---------- */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 15px;
  margin: 16px 0;
  font-size: 13.5px;
}
.check input { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; }
.check span { color: var(--muted); display: block; font-size: 12.5px; margin-top: 2px; }

.footer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.footer-row p { margin: 0; color: var(--muted); font-size: 12px; flex: 1 1 220px; }

/* ---------- Status ---------- */
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
  min-height: 20px;
}
.status.err { color: #fca5a5; }
.status.ok { color: var(--ok); }

.spin {
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent-line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 720px) {
  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eq { grid-template-columns: 1fr; }
  .label { min-width: 0; }
}
