:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #F7F6F2;
  --border: #D9D9D9;
  --text: #141410;
  --muted: #595959;
  --accent: #C81D2D;
  --accent-2: #A31824;
  --danger: #C81D2D;
  --success: #1E8449;
  --radius: 0px;
  --ink: #141410;
  --note: #ECEAE3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

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

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

header.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

header.top h1 {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.5px;
  margin: 0;
  color: var(--ink);
  line-height: 1.05;
}

header.top .brand {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex-direction: column;
  line-height: 1;
}

/* The "dot" element from the original markup is repurposed as the
   small monospace "VOICE AI" sub-label beneath the wordmark, so the
   product name reads clearly as separate from the IPO Wallet logo
   rather than being appended inline to it. */
header.top .dot {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  font-family: 'Courier New', Courier, monospace;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  order: 2;
  margin-top: 3px;
}

header.top .dot::before {
  content: "VOICE AI";
}

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

.card h2 {
  margin-top: 0;
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -.3px;
}

.card h3 {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid #8C8C8C;
  background: #fff;
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 14.5px;
}

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

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

.row .field { flex: 1; }

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: bold;
  font-family: Arial, sans-serif;
}

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

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

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

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

button.secondary {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
}

button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

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

.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: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 14px 0;
}

.pin-display .pin {
  font-family: 'Courier New', monospace;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--accent);
}

.pin-display .label {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  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: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
}

.badge {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: .5px;
  padding: 2px 8px;
  border-radius: var(--radius);
  background: rgba(30, 132, 73, 0.12);
  color: var(--success);
}

.badge.pending {
  background: rgba(200, 29, 45, 0.1);
  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-2);
  border: 1px solid var(--border);
  border-radius: 0;
}

.bubble {
  max-width: 80%;
  padding: 12px 15px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.bubble.eve {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  align-self: flex-start;
  margin-right: auto;
}

.bubble.user {
  background: var(--ink);
  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: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0;
}

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

.chat-input-bar input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

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

.chat-input-bar button:hover { background: var(--accent-2); }

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

.hidden { display: none !important; }

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

.logout-link:hover { color: var(--accent); }

.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);
}

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

.mic-btn {
  background: #fff;
  border: 2px solid var(--ink);
  color: var(--ink);
  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 {
  border-color: var(--accent);
}

.mic-btn.recording {
  background: var(--accent);
  border-color: var(--accent);
  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(200, 29, 45, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(200, 29, 45, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 29, 45, 0); }
}

.voice-status {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  letter-spacing: .5px;
  color: var(--muted);
  padding: 4px 0;
}

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

.phone-callout-label {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #B9B7AE;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.phone-callout-number {
  font-family: 'Courier New', monospace;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.5px;
}

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

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--danger);
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 0.85em;
  letter-spacing: .5px;
  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: var(--radius);
  padding: 12px;
  margin: 10px 0;
}

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

.live-transcript-role {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: var(--accent);
  letter-spacing: .5px;
  margin-right: 0.4em;
}

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