/* Atlas Orator — Voice First UI (ATLAS-ORATOR-VOICE-FIRST-UI-1)
   Mobile-first, dunkel, drei Ansichten: Sprechen · Verlauf · Gespräch */
:root {
  --bg: #0b1220;
  --panel: #121c2e;
  --panel-2: #17233a;
  --line: rgba(148, 163, 184, 0.16);
  --text: #e8eef7;
  --muted: #93a4bb;
  --accent: #22d3ee;
  --accent-2: #0ea5e9;
  --coach: #14263d;
  --user: #155e75;
  --amber: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --violet: #a78bfa;
  --radius: 16px;
  --tap: 48px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.hidden { display: none !important; }

/* ── Kopfzeile ─────────────────────────────────────────────────────────── */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(11, 18, 32, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-badge {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
}
.brand b { display: block; font-size: 15.5px; letter-spacing: 0.2px; }
.brand span { display: block; font-size: 11.5px; color: var(--muted); }
.net-pill {
  font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 999px;
}
.net-pill.offline { color: var(--red); border-color: rgba(248, 113, 113, 0.4); }

/* ── Ansichten ─────────────────────────────────────────────────────────── */
.view {
  padding: calc(66px + env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom));
  max-width: 680px; margin: 0 auto;
}
.view h2 { font-size: 21px; margin: 10px 0 14px; }
.sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }

/* ── Karten / Pillen / Chips ───────────────────────────────────────────── */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px;
}
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--green); border-color: rgba(52, 211, 153, 0.35); }
.pill.warn { color: var(--amber); border-color: rgba(251, 191, 36, 0.35); }
.pill.info { color: var(--accent); border-color: rgba(34, 211, 238, 0.35); }
.chip { display: inline-block; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; margin: 2px 4px 2px 0; }

/* ── Sprechen ──────────────────────────────────────────────────────────── */
.resume-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(14, 165, 199, 0.08));
  border: 1px solid rgba(34, 211, 238, 0.35); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px; width: 100%; text-align: left;
}
.resume-banner b { display: block; font-size: 14px; }
.resume-banner span { display: block; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state-line { display: flex; align-items: center; gap: 8px; min-height: 26px;
  font-size: 13.5px; color: var(--amber); margin-bottom: 10px; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.state-line.busy .state-dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.live-log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px;
  font-size: 15px; line-height: 1.5; word-break: break-word; }
.bubble small { display: block; font-size: 10.5px; opacity: 0.65; margin-bottom: 3px; }
.bubble.coach { background: var(--coach); border: 1px solid rgba(34, 211, 238, 0.18);
  align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.user { background: var(--user); align-self: flex-end;
  border-bottom-right-radius: 6px; }
.bubble.note { align-self: center; background: none; border: 1px dashed var(--line);
  color: var(--muted); font-size: 12.5px; text-align: center; max-width: 94%; }

.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mic-btn {
  width: 108px; height: 108px; border-radius: 50%; flex: none;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 36px rgba(14, 165, 199, 0.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.16s cubic-bezier(0.23, 1, 0.32, 1);
}
.mic-btn:active { transform: scale(0.93); transition-duration: 0.1s; }
.mic-btn.recording {
  background: linear-gradient(145deg, #ef4444, #b91c1c);
  box-shadow: 0 12px 36px rgba(239, 68, 68, 0.45);
  animation: pulse 1.4s infinite;
}
.mic-btn:disabled { opacity: 0.45; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 12px 36px rgba(239, 68, 68, 0.45); }
  50% { box-shadow: 0 12px 52px rgba(239, 68, 68, 0.8); }
}
.mic-hint { color: var(--muted); font-size: 12.5px; text-align: center; }

.ratings { display: none; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }
.ratings button {
  min-width: 96px; padding: 13px 18px; border-radius: 14px; font-size: 15px;
  border: 1px solid rgba(125, 211, 252, 0.4); background: rgba(14, 165, 199, 0.12);
}
.ratings button:active { background: rgba(14, 165, 199, 0.32); }

/* ── Verlauf ───────────────────────────────────────────────────────────── */
.session-card { display: block; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
  transition: transform 0.16s ease-out; }
.session-card:active { transform: scale(0.985); background: var(--panel-2); }
.session-card b { display: block; font-size: 15.5px; margin-bottom: 4px; }
.session-card .meta { color: var(--muted); font-size: 12px; }
.session-card .row { display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-top: 8px; }
.empty { color: var(--muted); text-align: center; padding: 32px 12px; font-size: 14px; }

/* ── Gespräch ──────────────────────────────────────────────────────────── */
.conv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.back-btn { width: var(--tap); height: var(--tap); border-radius: 14px;
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.conv-meta { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.score-chips { margin-top: 8px; }
.score-chips .chip b { color: var(--text); font-weight: 600; }
.capture-note {
  border: 1px dashed rgba(251, 191, 36, 0.45); color: var(--amber);
  background: rgba(251, 191, 36, 0.06); border-radius: var(--radius);
  padding: 11px 14px; font-size: 12.5px; line-height: 1.5; margin-bottom: 14px;
}
.timeline { display: flex; flex-direction: column; gap: 10px; }

/* ── Untere Leiste ─────────────────────────────────────────────────────── */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: flex; background: rgba(11, 18, 32, 0.94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabs button {
  flex: 1; min-height: 58px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px;
}
.tabs button.active { color: var(--accent); background: rgba(34, 211, 238, 0.1); }
.tabs button:active { transform: scale(0.96); }

/* ── Ladezustände / Netz ───────────────────────────────────────────────── */
.skeleton { border-radius: var(--radius); background: linear-gradient(
  90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; height: 74px; margin-bottom: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.net-banner {
  position: fixed; left: 12px; right: 12px; z-index: 50;
  bottom: calc(96px + env(safe-area-inset-bottom));
  background: rgba(127, 29, 29, 0.92); color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 14px; padding: 11px 14px; font-size: 13px; text-align: center;
}

@media (min-width: 720px) {
  body { font-size: 16px; }
  .view { padding-top: calc(78px + env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
