:root {
  --paper: #eef1f4;
  --panel: #ffffff;
  --ink: #1c2530;
  --muted: #5b6775;
  --line: #c9d1da;
  --signal: #c8102e;
  --go: #1f7a4d;
  --caution: #a55d00;
  --focus: #1f5fbf;
  --radius: 6px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; }
.bar-info { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
.lead { max-width: 62ch; }
.hint { color: var(--muted); font-size: 0.9rem; max-width: 70ch; }
.small { font-size: 0.8rem; }
.error { color: var(--signal); min-height: 1.4em; }

button {
  font: inherit;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 0.6rem 1rem;
  cursor: pointer;
  background: var(--panel);
  color: var(--ink);
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.secondary { background: var(--panel); }

input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 4.5rem; resize: vertical; }

/* Vorbereitung */
.setup { max-width: 760px; margin: 2rem auto; padding: 0 1.25rem 3rem; }
.field { display: block; margin: 1rem 0; max-width: 420px; }
.field > span { display: block; font-weight: 600; margin-bottom: 0.25rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin: 1.25rem 0; padding: 0.75rem 1rem 1rem; }
legend { font-weight: 600; padding: 0 0.3rem; }
.mic-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.mic-row select { max-width: 360px; }
.meter { height: 8px; background: var(--paper); border-radius: 4px; margin-top: 0.75rem; overflow: hidden; }
#meter-fill { height: 100%; width: 0; background: var(--go); transition: width 60ms linear; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.5rem 0; }
.check input { width: auto; margin-top: 0.3rem; }

/* Anruf */
.call {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
}
.line {
  position: sticky;
  top: 1rem;
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 8px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.line.ringing { border-top-color: var(--signal); }
.line.active { border-top-color: var(--go); }
.line-state { font-weight: 650; font-size: 1.1rem; }
.line.ringing .line-state { color: var(--signal); }
.timer {
  font-size: 3.5rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0.5rem 0;
}
.line-status { color: var(--muted); font-size: 0.85rem; min-height: 1.3em; }
.line-buttons { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.accept { background: var(--go); border-color: var(--go); color: #fff; font-weight: 600; padding: 0.9rem; }
.hangup { background: var(--signal); border-color: var(--signal); color: #fff; font-weight: 600; padding: 0.9rem; }
.actions { display: flex; flex-direction: column; gap: 0.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.actions button { text-align: left; }
.actions button.danger { border-color: var(--signal); color: var(--signal); font-weight: 600; }
.actions button.done { background: var(--paper); color: var(--ink); border-color: var(--line); }
.actions .check { margin: 0; }

.mask { display: flex; flex-direction: column; gap: 1.25rem; }
.mask section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.mask h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.75rem 1rem; }
.grid label { grid-column: span 3; display: block; }
.grid label.narrow { grid-column: span 1; }
.grid label.wide { grid-column: span 6; }
.grid label > span { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.2rem; }
.mask.locked { opacity: 0.55; pointer-events: none; }

/* Auswertung */
.result { max-width: 980px; margin: 2rem auto; padding: 0 1.25rem 3rem; }
.result h2 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-ok, .s-erfasst, .s-ja { color: var(--go); font-weight: 600; }
.s-teilweise, .s-nicht_erfragt { color: var(--caution); font-weight: 600; }
.s-falsch, .s-fehlt, .s-ausgelassen, .s-unbelegt, .s-nein { color: var(--signal); font-weight: 600; }
.s-nicht_genannt { color: var(--muted); }
.transcript { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; max-height: 22rem; overflow-y: auto; }
.transcript p { margin: 0.3rem 0; }
.transcript .who { display: inline-block; min-width: 7.5rem; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .call { grid-template-columns: 1fr; }
  .line { position: static; }
  .grid label, .grid label.narrow { grid-column: span 6; }
}

@media (prefers-reduced-motion: reduce) {
  #meter-fill { transition: none; }
}

.trace { margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); }
.trace pre { white-space: pre-wrap; word-break: break-word; background: var(--paper); padding: 0.5rem; border-radius: var(--radius); margin: 0.4rem 0 0; font-size: 0.75rem; }
