:root {
  /* Emergency red is a safety signal, not a brand color - never change this to match the logo palette. */
  --color-emergency: #b3261e;
  /* Brand palette, matched to the Triagely logo (black/white monogram). */
  --color-primary: #0a0a0a;
  --color-primary-dark: #000000;
  --color-bg: #fafafa;
  --color-card: #ffffff;
  --color-text: #14141a;
  --color-muted: #6b6b73;
  --color-subtle: #8b8b93;
  --color-border: #ececee;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(20, 20, 26, 0.04), 0 20px 40px -18px rgba(20, 20, 26, 0.14);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.emergency-banner {
  background: var(--color-emergency);
  color: white;
  text-align: center;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.site-header {
  padding: 48px 24px 20px;
  text-align: center;
}
.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #000000;
  padding: 12px 26px;
  border-radius: 999px;
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.4);
}
.logo-mark { display: block; flex-shrink: 0; }
.logo-word {
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #ffffff;
}
.tagline { color: var(--color-muted); font-size: 1rem; margin-top: 16px; font-weight: 400; }

main#app {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 20px 64px;
}

.screen { width: 100%; max-width: 600px; }
.screen.hidden { display: none; }

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  padding: 40px 36px;
}

h1 { font-size: 1.6rem; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 6px; }

p { line-height: 1.6; }

.disclaimer-list {
  list-style: none;
  padding: 0;
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.disclaimer-list li {
  position: relative;
  padding-left: 26px;
  line-height: 1.55;
  color: var(--color-text);
}
.disclaimer-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  background: #000000;
  border-radius: 2px;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 8px 0 28px;
  padding: 16px 18px;
  background: #fafafa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.5;
  cursor: pointer;
}
.consent-check input { margin-top: 3px; accent-color: #000000; width: 16px; height: 16px; }

.btn-primary {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 15px 26px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover:not(:disabled) {
  background: #222222;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -8px rgba(0, 0, 0, 0.45);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { background: #d8d8db; color: #9c9ca3; box-shadow: none; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-secondary:hover { border-color: #000000; background: #fafafa; }

.chat-card { display: flex; flex-direction: column; height: 64vh; min-height: 460px; }

.chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 4px 16px;
}

.msg {
  max-width: 78%;
  padding: 13px 17px;
  border-radius: 20px;
  line-height: 1.5;
  white-space: pre-wrap;
  font-size: 0.96rem;
}
.msg.assistant {
  align-self: flex-start;
  background: #f4f4f5;
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 6px;
}
.msg.user {
  align-self: flex-end;
  background: #000000;
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.45);
}
.msg.typing { align-self: flex-start; color: var(--color-subtle); font-style: italic; background: none; border: none; padding-left: 4px; }

.chat-form { display: flex; gap: 10px; margin-top: 12px; }
.chat-form input {
  flex: 1;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-size: 0.96rem;
  background: #fafafa;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.chat-form input:focus { outline: none; border-color: #000000; background: #ffffff; }
.chat-form .btn-primary { padding: 14px 24px; }

.input-help { font-size: 0.78rem; color: var(--color-subtle); margin: 12px 2px 0; }

.result-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.result-badge.emergency { background: #fbe1df; color: var(--color-emergency); }
.result-badge.telehealth { background: #e3e6ea; color: #33414f; }
.result-badge.pharmacy { background: #e5f0d9; color: #3d5c1f; }
.result-badge.specialist { background: #ece3f7; color: #5b34a3; }
.result-badge.urgent { background: #fdeccb; color: #8a5a00; }
.result-badge.info { background: #ededed; color: var(--color-muted); }

.result-summary { font-size: 1.08rem; line-height: 1.55; margin: 6px 0 4px; }
.result-reasoning { color: var(--color-muted); line-height: 1.55; }

.safety-net {
  margin-top: 24px;
  padding: 16px 18px;
  background: #fafafa;
  border: 1px solid var(--color-border);
  border-left: 3px solid #000000;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.5;
}

.cta-list { display: flex; flex-direction: column; gap: 12px; margin: 24px 0 4px; }
.cta-list a.btn-primary,
.cta-list a.btn-secondary { text-decoration: none; text-align: center; display: block; margin-top: 0; }

.site-footer {
  text-align: center;
  font-size: 0.76rem;
  color: var(--color-subtle);
  padding: 24px 24px 36px;
  line-height: 1.5;
}
