:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --line: #e0e0e4;
  --accent: #0b6bcb;
  --danger: #c62828;
  --ok: #1b7f4d;
  --warn: #a86400;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --surface: #1c1c1e;
    --text: #f2f2f4;
    --muted: #9a9aa0;
    --line: #33333a;
    --accent: #4d9fe8;
    --danger: #ef6c6c;
    --ok: #5cc98d;
    --warn: #e0a33a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 env(safe-area-inset-bottom);
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 { font-size: 17px; font-weight: 600; margin: 0; }

.icon-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
}

main { padding: 16px; max-width: 640px; margin: 0 auto; display: grid; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field em { font-style: normal; opacity: .65; }
.field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 40px;
  font-weight: 300;
  text-align: center;
  padding: 8px 0 16px;
  color: var(--muted);
}
.timer.active { color: var(--text); }

.record-btn {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: var(--danger);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.record-btn:disabled { opacity: .5; cursor: not-allowed; }
.record-btn.recording { background: var(--text); color: var(--bg); }
.record-btn .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
}
.record-btn.recording .dot {
  border-radius: 3px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.guide ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.guide li { margin-bottom: 6px; }

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

.badge {
  background: var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  letter-spacing: 0;
}

.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.queue li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 4px;
}
.queue .title { font-weight: 600; font-size: 15px; }
.queue .meta { color: var(--muted); font-size: 13px; }
.queue .status { font-size: 13px; font-weight: 600; }
.queue .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.s-wartet   { color: var(--warn); }
.s-laeuft   { color: var(--accent); }
.s-fertig   { color: var(--ok); }
.s-fehler   { color: var(--danger); }

.queue button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.queue .actions { display: flex; gap: 8px; margin-top: 6px; }

dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 20px;
  width: min(420px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog h2 { margin: 0 0 16px; font-size: 17px; }
dialog menu { display: flex; gap: 10px; justify-content: flex-end; margin: 20px 0 0; padding: 0; }
dialog button {
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
dialog button.secondary { background: var(--line); color: var(--text); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  max-width: calc(100vw - 32px);
  z-index: 100;
}

/* --- Art der Notiz ------------------------------------------------------- */

.typen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.typen button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.typen button[aria-pressed="true"] {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

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

.dialog-text {
  margin: -6px 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* Die Markenwahl steht über der Notizart und hat deshalb etwas Abstand nach
   unten. Beide Leisten teilen sich die Knopfgestaltung — am Stand wird mit
   Handschuhen und in Eile getippt, da hilft Gleichförmigkeit mehr als
   Unterscheidung. */
.marken { margin-bottom: 10px; }

/* Herkunftshinweis. Bewusst unten, klein und in der gedaempften Farbe: Er
   soll zu finden sein, wenn jemand wissen will wer das gebaut hat - und
   nicht mit dem Aufnahmeknopf um Aufmerksamkeit ringen. */
.fuss {
  text-align: center;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  font-size: 13px;
}
.fuss a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}
.fuss a:hover,
.fuss a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Einbauhinweis ---------------------------------------------------------
   Drei Faelle, drei Botschaften. Der wichtigste ist der dritte: Chrome auf
   iOS kann die App nicht installieren und bricht Uploads ab - am 2026-10-02
   kamen 22 Statusabfragen genau von dort. Ohne Hinweis merkt das niemand,
   bis eine Aufnahme verlorengeht. */
.einbau {
  display: flex; align-items: flex-start; gap: 12px;
  /* Bündig mit den Karten darunter: main hat 640px Breite bei 16px
     Innenabstand, macht 608px Inhalt. Auf dem Handy bleiben so dieselben
     16px Rand wie bei den Karten. */
  max-width: 608px;
  width: calc(100% - 32px);
  margin: 0 auto 14px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.einbau.warnung { border-left-color: var(--danger); }
.einbau-text { flex: 1; font-size: 14px; line-height: 1.5; }
.einbau-text strong { display: block; margin-bottom: 2px; }
.einbau-text span { color: var(--muted); }
.einbau-knoepfe { display: flex; align-items: center; gap: 4px; }
.einbau-knoepfe button:not(.icon-btn) {
  font: inherit; font-size: 14px; white-space: nowrap;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
