* { box-sizing: border-box; }

.hidden { display: none !important; }

:root {
  --accent-a: #2563eb;
  --accent-b: #16a34a;
  --ink: #1b1b1f;
  --muted: #6b7280;
  --card-bg: #ffffff;
  --page-bg: #f4f5f7;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: #d9dbe0;
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 0;
}

.phone-frame {
  width: 100%;
}

.phone-screen {
  background: var(--page-bg);
  padding: 20px;
  min-height: 100vh;
}

/* Ab ca. Tablet-/Laptop-Breite: statt eines dekorativen Handy-Rahmens (der nur zum
   Desktop-Testen diente) echte Breite nutzen. Auf echten schmalen Handy-Bildschirmen
   (unterhalb dieser Breite, der eigentliche Zwei-Geräte-Anwendungsfall) greift das
   nicht - dort bleibt alles unveraendert wie bisher. Der Ein-Geräte-Modus ist explizit
   für Laptops gedacht und bekommt darum deutlich mehr Breite als der Zwei-Geräte-Modus.
   Der Modus wird per body-Klasse "mode-single" (siehe app.js/setDeviceMode) erkannt. */
@media (min-width: 500px) {
  body { padding: 32px 16px; }

  .phone-frame {
    max-width: 480px;
    margin: 0 auto;
  }

  .phone-screen {
    padding: 24px;
  }

  body.mode-single .phone-frame {
    max-width: 960px;
  }

  body.mode-single .phone-screen {
    padding: 32px 40px;
  }

  body.mode-single .ptt-btn {
    max-width: 380px;
    padding: 40px 16px;
    font-size: 1.25rem;
  }
}

header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.menu-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid #e2e4e9;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.menu-btn:hover { background: #f0f1f3; }

h1 {
  margin: 0 48px 4px 48px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.app-footer {
  text-align: center;
  padding: 16px 0 4px;
  font-size: 0.8rem;
}

.app-footer a {
  color: var(--muted);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

.reset-btn {
  margin-top: 8px;
  background: var(--card-bg);
  border: 1px solid #e2e4e9;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #444;
  transition: background 0.1s ease;
}
.reset-btn:hover { background: #f0f1f3; }

.account-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.account-panel h3 {
  margin-top: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.account-actions {
  display: flex;
  gap: 8px;
}

.sensitivity-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: #444;
}

.sensitivity-row input[type="range"] {
  width: 140px;
}

#sensitivityLabel {
  min-width: 60px;
  font-weight: 600;
}

.ptt-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 16px;
}

.ptt-btn {
  flex: 1;
  max-width: 280px;
  padding: 28px 16px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: white;
  user-select: none;
  transition: transform 0.05s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow);
}

.ptt-a { background: var(--accent-a); }
.ptt-b { background: var(--accent-b); }

.ptt-btn.recording {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.6);
}

.ptt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pause-btn {
  flex: 0 0 auto;
  width: 56px;
  font-size: 1.3rem;
  border: 1px solid #e2e4e9;
  border-radius: 12px;
  background: var(--card-bg);
  cursor: pointer;
  color: #555;
  box-shadow: var(--shadow);
}
.pause-btn:hover { background: #f0f1f3; }
.pause-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.mode-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.mode-btn {
  padding: 8px 16px;
  border: 1px solid #e2e4e9;
  border-radius: 999px;
  background: var(--card-bg);
  color: #444;
  cursor: pointer;
  font-size: 0.9rem;
}

.mode-btn.active {
  background: var(--accent-a);
  border-color: var(--accent-a);
  color: white;
  font-weight: 600;
}

.live-text {
  min-height: 1.5em;
  text-align: center;
  font-style: italic;
  color: #444;
  margin-bottom: 16px;
}

.summary {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  max-height: 60vh;
  overflow-y: auto;
}

.summary h2 {
  margin-top: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.summary h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-text {
  line-height: 1.5;
}

.core-anchor {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: #3730a3;
  margin: 0 0 10px 0;
}

.open-topics-list {
  list-style: disc;
  padding-left: 18px;
  margin: 0 0 16px 0;
  font-size: 0.9rem;
  color: #444;
}

.open-topics-list:empty::before {
  content: 'Keine offenen Themen.';
  list-style: none;
  color: #999;
  font-style: italic;
}

.transcript-details {
  margin-top: 8px;
  font-size: 0.85rem;
}

.transcript-details summary {
  cursor: pointer;
  color: #555;
}

.transcript-details ul {
  list-style: none;
  padding: 0;
  margin-top: 8px;
}

.transcript-details li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.speaker-A { color: var(--accent-a); font-weight: 600; }
.speaker-B { color: var(--accent-b); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 6px;
}

.badge-drift { background: #bfdbfe; color: #1e40af; }
.badge-avoidance { background: #fde68a; color: #92400e; }
.badge-escalation-1 { background: #fef08a; color: #854d0e; }
.badge-escalation-2 { background: #fdba74; color: #9a3412; }
.badge-escalation-3 { background: #fca5a5; color: #991b1b; }
.badge-need { background: #d1fae5; color: #065f46; }

.hint-banner {
  margin: 0 0 16px 0;
  padding: 10px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  line-height: 1.6;
}

.hint-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
}

.hint-banner h4 {
  margin: 0 0 4px 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
}

.hint-entry {
  padding: 4px 0;
}

.hint-entry + .hint-entry {
  border-top: 1px solid #fde68a;
}

.hint-columns {
  display: flex;
  gap: 16px;
}

.hint-column {
  flex: 1;
  min-width: 0;
}

.wrapup {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.wrapup h2 {
  margin-top: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.wrapup p {
  line-height: 1.6;
}

.start-screen {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 20px;
}

.start-card {
  flex: 1;
  min-width: 220px;
  max-width: 320px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.start-card h2 {
  font-size: 1rem;
  margin-top: 0;
}

.join-row {
  display: flex;
  gap: 8px;
}

.join-row input {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  text-transform: uppercase;
  text-align: center;
}

.join-row .ptt-btn {
  flex: 0 0 auto;
  max-width: none;
  padding: 8px 16px;
  font-size: 0.95rem;
}

.name-input {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
}

.start-error {
  width: 100%;
  text-align: center;
  color: #991b1b;
}

.room-info {
  text-align: center;
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 16px;
}

.cost-counter {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.join-request-banner {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 0.9rem;
  color: #3730a3;
}

.join-request-banner .account-actions {
  justify-content: center;
  margin-top: 8px;
}
