/* Diktat — bewusst dunkel und knopflastig: die Seite wird im Stehen mit einer Hand
   bedient, spaeter auch als TWA. Alles Wichtige liegt im Daumenbereich. */

:root {
  --bg: #151519;
  --card: #1e1e24;
  --line: #2e2e37;
  --fg: #ecedf1;
  --dim: #9a9aa8;
  --accent: #e5484d;
  --ok: #46a758;
  --wait: #f2a33c;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2 { font-weight: 600; letter-spacing: -0.01em; }
button { font: inherit; }

/* ---------- Anmelde-Gate ---------- */
.gate {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px;
}
.gate[hidden] { display: none; }
.gate-icon { font-size: 54px; }
.gate h1 { margin: 0; font-size: 27px; }
.gate-sub { margin: 0 0 14px; color: var(--dim); max-width: 30ch; }
.gate-hint { color: var(--accent); min-height: 1.4em; font-size: 14px; }

/* ---------- Rahmen ---------- */
.app { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; }
.top {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px;
}
.brand { font-weight: 600; }
.spacer { flex: 1; }
.who { color: var(--dim); font-size: 13px; }
.linkbtn {
  background: none; border: 0; color: var(--dim); cursor: pointer;
  font-size: 13px; text-decoration: underline; padding: 4px;
}
.linkbtn:hover { color: var(--fg); }

/* ---------- Aufnehmer ---------- */
.recorder { text-align: center; padding: 12px 0 26px; }
.level {
  height: 5px; background: var(--line); border-radius: 3px;
  overflow: hidden; margin: 0 auto 18px; max-width: 320px;
}
.level span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--ok), var(--wait), var(--accent));
  transition: width 90ms linear;
}
.timer {
  font: 600 34px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums; margin-bottom: 20px;
}
.controls { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.rec {
  width: 84px; height: 84px; border-radius: 50%;
  border: 3px solid var(--accent); background: transparent;
  display: grid; place-items: center; cursor: pointer;
  transition: transform 120ms ease, background 160ms ease;
}
.rec:active { transform: scale(0.94); }
.rec:disabled { opacity: 0.45; cursor: default; }
.rec-dot {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); transition: all 180ms ease;
}
body.recording .rec { background: rgba(229, 72, 77, 0.14); animation: pulse 1.6s ease-in-out infinite; }
body.recording .rec-dot { border-radius: 6px; width: 26px; height: 26px; }
body.paused .rec { animation: none; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.35); }
  50% { box-shadow: 0 0 0 14px rgba(229, 72, 77, 0); }
}
@media (prefers-reduced-motion: reduce) { body.recording .rec { animation: none; } }
.ctl {
  padding: 11px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
}
.ctl.stop { border-color: var(--accent); }
.ctl.ghost { background: transparent; color: var(--dim); }
.ctl:hover { border-color: #45454f; }
.hint { color: var(--dim); font-size: 14px; margin: 18px 0 0; min-height: 1.4em; }

/* ---------- Liste ---------- */
.jobs-head {
  display: flex; align-items: baseline; gap: 10px;
  border-top: 1px solid var(--line); padding-top: 20px;
}
.jobs h2 { margin: 0; font-size: 15px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.07em; }
.worker { margin-left: auto; font-size: 12px; color: var(--dim); }
.worker.bad { color: var(--accent); }
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.job {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px;
}
.job-top { display: flex; align-items: center; gap: 9px; }
.job-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  margin-left: auto; flex: none; font-size: 11px; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim);
}
.badge.QUEUED { color: var(--wait); border-color: rgba(242, 163, 60, 0.4); }
.badge.PROCESSING { color: var(--wait); border-color: rgba(242, 163, 60, 0.4); }
.badge.DONE { color: var(--ok); border-color: rgba(70, 167, 88, 0.4); }
.badge.FAILED { color: var(--accent); border-color: rgba(229, 72, 77, 0.4); }
.job-meta { color: var(--dim); font-size: 12.5px; margin-top: 4px; }
.job-text {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  white-space: pre-wrap; font-size: 15px; line-height: 1.65;
}
.job-actions { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; }
.job-actions a, .job-actions button {
  color: var(--dim); text-decoration: underline; background: none; border: 0;
  cursor: pointer; padding: 0; font-size: 13px;
}
.job-actions a:hover, .job-actions button:hover { color: var(--fg); }
.empty { color: var(--dim); font-size: 14px; padding: 8px 2px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  z-index: 20;
}
.toast[hidden] { display: none; }
