:root {
  --bg: #0b0d12;
  --panel: #161922;
  --panel-2: #1e2230;
  --border: #2a2f3d;
  --text: #e8eaf0;
  --muted: #8b90a3;
  --accent: #6b8afd;
  --accent-2: #4c6ef5;
  --danger: #f26d6d;
  --success: #4fd1a5;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.wrap.wide {
  max-width: 720px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

header.top h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.2px;
}

header.top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

header.top .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.card h2 {
  margin-top: 0;
  font-size: 17px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}

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

.row {
  display: flex;
  gap: 10px;
}

.row .field { flex: 1; }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
}

button.primary {
  background: var(--accent-2);
  color: white;
  width: 100%;
}

button.primary:hover { background: var(--accent); }

button.primary:disabled {
  opacity: 0.5;
  cursor: default;
}

button.link {
  background: none;
  color: var(--accent);
  padding: 4px 0;
}

button.secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.msg {
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

.msg.error { color: var(--danger); }
.msg.success { color: var(--success); }

.switcher {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.pin-display {
  text-align: center;
  padding: 20px;
  background: var(--panel-2);
  border-radius: 10px;
  margin: 14px 0;
}

.pin-display .pin {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--accent);
}

.pin-display .label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.phone-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(79, 209, 165, 0.15);
  color: var(--success);
}

.badge.pending {
  background: rgba(242, 109, 109, 0.15);
  color: var(--danger);
}

/* Chat */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 70vh;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.bubble.eve {
  background: var(--panel-2);
  align-self: flex-start;
  margin-right: auto;
}

.bubble.user {
  background: var(--accent-2);
  color: white;
  margin-left: auto;
}

.bubble-row {
  display: flex;
}

.bubble-row.user { justify-content: flex-end; }

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.chat-input-bar input {
  flex: 1;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.chat-input-bar button {
  background: var(--accent-2);
  color: white;
  padding: 0 18px;
}

.muted { color: var(--muted); font-size: 13px; }

.hidden { display: none !important; }

.logout-link {
  background: none;
  color: var(--muted);
  font-size: 13px;
}

.consent-field {
  margin-bottom: 16px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.consent-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent-2);
}

.consent-label a {
  color: var(--accent);
}

.mic-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 18px;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}

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

.mic-btn.recording {
  background: var(--danger);
  color: white;
  animation: pulse 1.2s infinite;
}

.mic-btn.processing {
  opacity: 0.6;
  cursor: default;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 109, 109, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(242, 109, 109, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 109, 109, 0); }
}

.voice-status {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.phone-callout {
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.phone-callout-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.phone-callout-number {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.phone-callout-number:hover {
  text-decoration: underline;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.85em;
  margin-left: 0.6em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.live-transcript-scroll {
  max-height: 260px;
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}

.live-transcript-line {
  margin-bottom: 0.5rem;
  font-size: 0.92em;
}

.live-transcript-role {
  font-weight: 600;
  margin-right: 0.4em;
}

#liveNotesArea {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
