:root {
  --akzent: #1f2937;
  --akzent-hell: #374151;
  --rot: #dc2626;
  --bg: #f9fafb;
  --karte: #ffffff;
  --grau: #6b7280;
  --hellgrau: #e5e7eb;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--akzent);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

header { padding: 24px 20px 8px; text-align: center; }
header.mit-zurueck {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
header h1 { font-size: 20px; margin: 0; }

main { flex: 1; padding: 16px 20px; display: flex; flex-direction: column; }
footer { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); text-align: center; }

/* --- Login --- */
.login-box { margin: auto; width: 100%; max-width: 320px; text-align: center; }
.login-box h1 { font-size: 28px; margin-bottom: 8px; }

/* --- Standortzeile --- */
.ort-zeile {
  font-size: 14px;
  color: var(--akzent-hell);
  text-align: center;
  margin-bottom: 24px;
  min-height: 20px;
  cursor: pointer;
  padding: 8px 12px;
  background: var(--karte);
  border: 1px solid var(--hellgrau);
  border-radius: 10px;
}

/* --- Aufnahme --- */
.aufnahme-bereich {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.timer {
  font-size: 44px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}
.record-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: var(--rot);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, background 0.2s;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.35);
}
.record-btn:active { transform: scale(0.94); }
.record-btn.aktiv {
  background: var(--akzent);
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.35);
  animation: puls 1.4s ease-in-out infinite;
}
@keyframes puls {
  0%, 100% { box-shadow: 0 8px 24px rgba(31, 41, 55, 0.35); }
  50% { box-shadow: 0 8px 36px rgba(31, 41, 55, 0.6); }
}
.mic-icon { width: 30px; height: 46px; position: relative; display: block; }
.mic-icon::before {
  content: "";
  position: absolute;
  top: 0; left: 5px;
  width: 20px; height: 30px;
  background: #fff;
  border-radius: 10px;
}
.mic-icon::after {
  content: "";
  position: absolute;
  bottom: 0; left: 13px;
  width: 4px; height: 10px;
  background: #fff;
}
.record-btn.aktiv .mic-icon { width: 34px; height: 34px; }
.record-btn.aktiv .mic-icon::before {
  top: 0; left: 0;
  width: 34px; height: 34px;
  border-radius: 6px;
}
.record-btn.aktiv .mic-icon::after { display: none; }
.record-label { font-size: 15px; color: var(--grau); }

/* --- Verarbeitung --- */
.verarbeitung {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  color: var(--grau);
}
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--hellgrau);
  border-top-color: var(--akzent);
  border-radius: 50%;
  animation: dreh 0.9s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

/* --- Ergebnis --- */
.ergebnis { display: flex; flex-direction: column; gap: 16px; }
.ergebnis-meta {
  background: var(--karte);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--hellgrau);
}
.ergebnis-text {
  background: var(--karte);
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  border: 1px solid var(--hellgrau);
  max-height: 45vh;
  overflow-y: auto;
}
.ergebnis-aktionen { display: flex; gap: 12px; }
.ergebnis-aktionen .btn { flex: 1; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--hellgrau);
  background: var(--karte);
  color: var(--akzent);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}
.btn.primary { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.btn:active { opacity: 0.85; }
.link-btn {
  background: none;
  border: none;
  color: var(--akzent-hell);
  font-size: 15px;
  cursor: pointer;
  padding: 8px;
}

input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid var(--hellgrau);
  border-radius: 12px;
  margin: 12px 0;
  background: var(--karte);
}

.hinweis { color: var(--grau); font-size: 14px; }
.fehler { color: var(--rot); font-size: 14px; text-align: center; }

/* --- Liste --- */
.notiz-liste { list-style: none; padding: 0; margin: 0; }
.notiz-liste li { margin-bottom: 10px; }
.notiz-liste a {
  display: block;
  background: var(--karte);
  border: 1px solid var(--hellgrau);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--akzent);
  font-size: 15px;
}
