:root {
  --bg: #f9fafb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --muted2: #9ca3af;
  --primary: #164aba;
  --danger: #dc2626;
  --success: #16a34a;
  --start: #13a047;
  --start-hover: #068032;
  --stop: #b40101;
  --stop-hover: #770404;
  --line: #e5e7eb;
  --wavebg: #f3f4f6;
  --wave: #2563eb;
  --level: #22c55e;
  --final: #f1f5e2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Ubuntu, Cantarell, Noto Sans, sans-serif;
}

/* Branding-Logo links oben */
#brandingLogo {
  position: absolute;
  top: 30px;
  /* Abstand vom oberen Rand */
  left: 10px;
  /* Abstand vom linken Rand */
  width: 120px;
  /* Breite des Logos, anpassen nach Bedarf */
  height: auto;
  /* Höhe proportional zur Breite */
  z-index: 0;
  /* sicherstellen, dass es über allem liegt */
}


.container {
  position: relative;
  margin: 0.5rem auto;
  padding: 0.5rem;
  width: 80%;
  max-width: 1200px;
  z-index: 0;
  /* Container über dem Logo */
}

.card {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
}

/* ===== Header ===== */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.status {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  /* Abstand zwischen Icon und Text */
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 2.25rem;
  color: var(--primary);
  font-style: italic;
  /* Überschrift kursiv */
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  transition: background 0.3s, color 0.3s;
}

.header-row h1 {
  margin: 0;
  font-size: 2.25rem;
  color: var(--primary);
}

/* .header-row .status {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
} */

/* --- Verschiedene Status-Zustände --- */
.status-init {
  background: #e0e7ff;
  color: #1e40af;
}

.status-ready {
  background: #dcfce7;
  color: #166534;
}

.status-recording {
  background: #fee2e2;
  color: #b91c1c;
}

.status-error {
  background: #fef2f2;
  color: #b91c1c;
}

.status-done {
  background: #fef9c3;
  color: #854d0e;
}

.status-icon {
  font-size: 1.2rem;
}

.status-info {
  background: #e0f2fe;
  color: #0369a1;
}


/* ===== Top Row: Buttons + Visualisierung ===== */
.top-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.controls {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.visual {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 2px solid #111827;
  /* neuer Rahmen */
  border-radius: 6px;
  padding: 6px;
  /* Innenabstand für Canvas & Bar */
  background-color: #f9fafb;
  /* leichtes Panel */
}

.canvas {
  width: 100%;
  height: 45px;
  background: var(--wavebg);
  border-radius: 4px;
}

.bar {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  margin-top: 6px;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--level);
  border-radius: 4px;
  transition: width 80ms linear;
}

/* ===== Buttons ===== */
button {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-start {
  background: var(--start);
}

.btn-start:hover {
  background: var(--start-hover);
}

.btn-stop {
  background: var(--stop);
}

.btn-stop:hover {
  background: var(--stop-hover);
}

.btn-copy {
  background: var(--wave);
}

.btn-copy:hover {
  background: #032c87;
}

/* ===== Transkripte ===== */
.live {
  font-size: 1.15rem;
  color: #374151;
  min-height: 2.5rem;
  white-space: pre-wrap;
}

.final {
  display: block;
  overflow-wrap: break-word;
  resize: vertical;
  font-size: 1.35rem;
  /* etwas größer */
  font-weight: 400;
  /* normal */
  line-height: 1.5;
  color: var(--text);
  min-height: 5rem;
  height: 20rem;
  margin-bottom: 10px;
  padding: 10px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #444242;
  border-radius: 6px;
  background-color: var(--final);
}

.final:focus {
  outline: 2px solid #4f46e5;
  background: var(--final);
}

/* ===== Bottom Buttons (sticky) ===== */
.bottom-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  position: sticky;
  bottom: 0;
  background: var(--panel);
  padding: 0.5rem 0;
  z-index: 5;
}

/* ===== Consent Section ===== */
.consent-section {
  background: #f9fafb;
  border: 2px solid #111827;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
}

.consent-title {
  margin: 0 0 8px 0;
  font-size: 1rem;
  font-weight: 700;
}

.consent-text {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.consent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.consent-row input[type="checkbox"] {
  transform: scale(1.2);
  cursor: pointer;
}

.consent-note {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #374151;
}

/* ===== Tooltip ===== */
.tooltip {
  opacity: 0;
  transition: opacity 0.2s ease;
  position: fixed;
  top: 12px;
  right: 12px;
  background: #222;
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 10;
}

.tooltip.show {
  opacity: 1;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .controls {
    justify-content: center;
  }

  .visual {
    width: 100%;
  }

  .canvas {
    height: 40px;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

.hidden {
  display: none;
}

/* Kreis-Oszilloskop rechts */
.osc {
  width: 160px;
  min-width: 160px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid #111827;
  border-radius: 8px;
  padding: 6px;
  background: #f9fafb;
}

.osc canvas {
  display: block;
}

.osc-label {
  font-size: 0.8rem;
  color: var(--muted2);
  margin-top: 4px;
}

.disclaimer {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #555;
  text-align: center;
  line-height: 1.3;
}
