:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b24;
  --line: #263141;
  --text: #e6edf3;
  --muted: #8b98a8;
  --accent: #6ee7b7;
  --accent-dark: #10b981;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, #1b2a3a 0%, var(--bg) 55%);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  padding: 24px;
}

.app {
  width: min(760px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 14px; }

.orb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  box-shadow: 0 0 24px rgba(110, 231, 183, .4);
}

h1 { margin: 0; font-size: 20px; letter-spacing: .5px; }
.subtitle { margin: 0; font-size: 12px; color: var(--muted); }

.status {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}

.status.ok { color: var(--accent); border-color: rgba(110, 231, 183, .35); }
.status.error { color: #fca5a5; border-color: rgba(252, 165, 165, .35); }

main { padding: 22px; }

.log {
  min-height: 340px;
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 6px;
}

.bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble.user {
  align-self: flex-end;
  background: #243447;
  border-bottom-right-radius: 4px;
}

.bubble.nova {
  align-self: flex-start;
  background: rgba(110, 231, 183, .10);
  border: 1px solid rgba(110, 231, 183, .22);
  border-bottom-left-radius: 4px;
}

.bubble.error {
  align-self: center;
  color: #fca5a5;
  font-size: 13px;
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.mic {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #1b2531;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.mic:hover { border-color: var(--accent-dark); }
.mic.recording {
  background: rgba(239, 68, 68, .18);
  border-color: #ef4444;
  color: #fecaca;
  animation: pulse 1.2s infinite;
}

@keyframes pulse { 50% { opacity: .55; } }

.input-row { display: flex; flex: 1; gap: 10px; }

input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0f1620;
  color: var(--text);
  font: inherit;
}

input:focus { outline: none; border-color: var(--accent-dark); }

button#send {
  padding: 0 20px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #062e22;
  font-weight: 600;
  cursor: pointer;
}

button#send:hover { background: var(--accent-dark); color: white; }
button:disabled { opacity: .5; cursor: not-allowed; }

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