: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;
  /* The landing page's hero/vision panels intentionally break out to full
     viewport width (100vw) to look like a normal web page rather than a
     boxed app screen - this prevents that trick from causing a horizontal
     scrollbar. */
  overflow-x: hidden;
}

.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; }
/* The landing screen is the one exception to the boxed max-width layout -
   it should read as a normal full-width web page, not a compact app card. */
#screen-landing { max-width: none; }

/* ---- Landing page (deliberately majority-black, distinct from the light
   clinical app it leads into - bold marketing front door vs. calm clinical
   tool). The hero and vision sections break out to full viewport width
   (the 100vw + translateX(-50%) trick) regardless of main#app's own padding,
   so they render edge-to-edge like a normal marketing site; an "-inner"
   wrapper inside each keeps the actual text/cards at a readable width. ---- */
.hero,
.vision-section {
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

.hero {
  text-align: center;
  padding: 72px 24px;
  background: #0a0a0a;
}
.hero-inner { max-width: 720px; margin: 0 auto; }

.vision-section {
  padding: 64px 24px 72px;
  background: #101012;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.vision-inner { max-width: 1080px; margin: 0 auto; }

.hero-eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 22px;
}
.hero-title {
  font-size: 2.6rem;
  line-height: 1.16;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.hero-sub {
  color: rgba(255, 255, 255, 0.66);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 580px;
  margin: 0 auto 32px;
}
.btn-hero { padding: 17px 34px; font-size: 1.02rem; }

.btn-invert {
  background: #ffffff;
  color: #0a0a0a;
  border: none;
  padding: 15px 26px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6);
}
.btn-invert:hover { background: #ececee; transform: translateY(-1px); }
.btn-invert:active { transform: translateY(0); }

.trust-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  padding: 0;
  margin: 26px 0 0;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.5);
}
.trust-strip li { position: relative; padding-left: 16px; }
.trust-strip li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.vision-inner h2 { text-align: center; margin-bottom: 8px; color: #ffffff; font-size: 1.7rem; }
.vision-intro {
  text-align: center;
  color: rgba(255, 255, 255, 0.56);
  max-width: 560px;
  margin: 0 auto 36px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.service-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 22px 22px 24px;
  background: #1a1a1d;
}
.service-item h3 { font-size: 1.02rem; margin: 4px 0 6px; color: #ffffff; }
.service-item p { font-size: 0.88rem; color: rgba(255, 255, 255, 0.55); margin: 0; line-height: 1.5; }
.service-status {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.service-status.live { background: rgba(122, 196, 74, 0.18); color: #9bdc6c; }
.service-status.soon { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.45); }
.vision-footnote {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.82rem;
  margin: 28px 0 0;
}

.link-back {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 18px;
  display: block;
}
.link-back:hover { color: #000000; }

@media (min-width: 900px) {
  .hero { padding: 100px 48px; }
  .hero-inner { max-width: 780px; }
  .vision-section { padding: 84px 48px 96px; }
  .service-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
  .hero-title { font-size: 1.7rem; }
  .service-grid { grid-template-columns: 1fr; }
}

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