/* Alpha Drive AI Answers widget. Tokens follow the alphadriveai.com design system. */
:root {
  --red: #E30613;
  --red-dark: #AA0310;
  --radius: 18px;

  --bg: #050505;
  --bg-1: #0a0a0c;
  --bg-2: #111114;
  --bg-3: #17171c;
  --card-border: rgba(255,255,255,0.08);
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.68);
  --text-dim: rgba(255,255,255,0.55);
  --input-bg: #111114;
  --user-bubble: #17171c;
  --surface-1: rgba(255,255,255,0.03);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-1: #f7f7f9;
  --bg-2: #f1f1f4;
  --bg-3: #ebebef;
  --card-border: rgba(0,0,0,0.08);
  --line: rgba(0,0,0,0.07);
  --line-strong: rgba(0,0,0,0.15);
  --text: #0a0a0a;
  --text-muted: rgba(10,10,10,0.66);
  --text-dim: rgba(10,10,10,0.55);
  --input-bg: #ffffff;
  --user-bubble: #f1f1f4;
  --surface-1: rgba(0,0,0,0.02);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app { display: flex; flex-direction: column; height: 100%; min-height: 0; }
body.page .app { max-width: 820px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

/* Header with the authentic website lockup */
.bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
.alpha-logo { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.alpha-logo-symbol { width: 28px; height: 28px; object-fit: contain; flex: none; }
.alpha-logo-wordmark { width: 120px; height: 16px; object-fit: contain; flex: none; }
.bar .label {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 999px; white-space: nowrap;
}
.bar .spacer { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: transparent; cursor: pointer;
}
.icon-btn:hover { border-color: var(--text-muted); }
.icon-btn svg { width: 16px; height: 16px; }
.text-btn {
  min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; cursor: pointer; font-weight: 600; font-size: 13px;
}
.text-btn:hover { border-color: var(--text-muted); }

/* Conversation */
.log { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.intro { padding: 4px 2px 8px; }
.intro h1 {
  margin: 0 0 6px; font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 24px; line-height: 1.1; letter-spacing: -0.5px;
}
.intro h1 .accent { color: var(--red); }
.intro p { margin: 0; color: var(--text-muted); }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  min-height: 36px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface-1); cursor: pointer; font-size: 13px; text-align: left;
}
.chip:hover { border-color: var(--red); }

.msg { max-width: 88%; min-width: 0; overflow-wrap: anywhere; }
.msg p { margin: 0 0 8px; }
.msg p:last-child { margin-bottom: 0; }
.msg ul { margin: 0 0 8px; padding-left: 20px; }
.msg.user {
  align-self: flex-end; background: var(--user-bubble); border: 1px solid var(--card-border);
  padding: 10px 14px; border-radius: 18px 18px 6px 18px;
}
.msg.assistant {
  align-self: flex-start; background: var(--bg-1); border: 1px solid var(--card-border);
  padding: 12px 16px; border-radius: 18px 18px 18px 6px;
}
.msg.assistant.unanswered { border-color: var(--line-strong); color: var(--text-muted); }
.msg.error { border-color: var(--red); }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Composer */
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 8px;
  border-top: 1px solid var(--line); background: var(--bg);
}
.composer textarea {
  flex: 1; min-width: 0; resize: none; max-height: 140px; min-height: 44px;
  padding: 11px 14px; border-radius: 18px; border: 1px solid var(--line-strong);
  background: var(--input-bg); line-height: 1.45;
}
.composer textarea::placeholder { color: var(--text-dim); }
.composer textarea:focus { outline: none; border-color: var(--text-muted); }
.send {
  flex: none; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--red);
  background: var(--red); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.send:hover { background: var(--red-dark); border-color: var(--red-dark); }
.send:disabled { opacity: .5; cursor: not-allowed; }
.send svg { width: 18px; height: 18px; }
.fine { margin: 0; padding: 0 16px 12px; font-size: 11px; color: var(--text-dim); background: var(--bg); }

/* Staff sign-in */
.signin { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.signin-card {
  max-width: 420px; width: 100%; border: 1px solid var(--card-border); border-radius: 26px;
  background: var(--bg-1); padding: 32px 28px; text-align: left;
}
.signin-card h1 { margin: 0 0 10px; font: 700 28px/1.05 'Space Grotesk', sans-serif; letter-spacing: -0.6px; }
.signin-card h1 .accent { color: var(--red); }
.signin-card p { margin: 0 0 22px; color: var(--text-muted); }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 20px; border-radius: 999px; border: 1px solid var(--red);
  background: var(--red); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.signin-error { margin-top: 14px; color: var(--red); font-size: 13px; }
.who { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
/* Staff page: embed code */
.embed-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 24px 40px; }
.embed-panel h2 { margin: 0 0 10px; font: 700 28px/1.05 'Space Grotesk', sans-serif; letter-spacing: -0.6px; }
.embed-panel h3 { margin: 28px 0 10px; font: 600 18px 'Space Grotesk', sans-serif; letter-spacing: -0.3px; }
.embed-panel p { color: var(--text-muted); margin: 0 0 12px; }
.embed-panel code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; color: var(--text); }
.snippet { display: flex; gap: 10px; align-items: stretch; margin-top: 16px; }
.snippet pre {
  flex: 1; min-width: 0; margin: 0; padding: 14px 16px; overflow-x: auto;
  background: var(--bg-2); border: 1px solid var(--card-border); border-radius: 18px;
  font: 13px/1.5 'JetBrains Mono', ui-monospace, monospace; color: var(--text);
}
.snippet .copy { flex: none; }
.copy-status { min-height: 1.5em; font-size: 13px; }
.embed-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.embed-table th, .embed-table td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.embed-table th { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); font-weight: 500; }
.embed-table td:first-child { color: var(--text); white-space: nowrap; }
.embed-table td { color: var(--text-muted); }
@media (max-width: 640px) {
  .snippet { flex-direction: column; }
  .embed-table td:first-child { white-space: normal; }
}

[hidden] { display: none !important; }

@media (max-width: 480px) {
  .who { display: none; }
}
@media (max-width: 320px) {
  .alpha-logo-wordmark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
