* { margin:0; padding:0; box-sizing:border-box; }
body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color:#1a1a1a; 
  line-height:1.5;
  overflow-x:hidden; 
  background:#fff;
}

/* Gov banner - exact NLM style */
.gov-banner { 
  background:#f0f0f0; 
  color:#5b616b; 
  font-size:13px; 
  padding:8px 40px;
  border-bottom:1px solid #dcdee0;
  font-weight:400;
}

/* Header - exact NLM navy blue */
.nlm-header { 
  background:#205493;
  padding:0 40px; 
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  min-height:70px;
  box-shadow:0 2px 4px rgba(0,0,0,.1);
}
.nlm-logo { display:flex; align-items:center; gap:16px; }
.nlm-logo-text { 
  color:white; 
  font-size:24px; 
  font-weight:700; 
  letter-spacing:1px;
  font-family:Georgia,serif;
}
.nlm-logo-sub { 
  color:#c5d9f2; 
  font-size:12px; 
  font-weight:400; 
  letter-spacing:0.5px;
  margin-top:2px;
}
.nlm-nav { display:flex; gap:32px; }
.nlm-nav a { 
  color:#fff;
  text-decoration:none; 
  font-size:15px; 
  font-weight:400;
  padding:8px 0;
  border-bottom:3px solid transparent;
  transition:border-color .2s;
}
.nlm-nav a:hover { 
  border-bottom-color:#fff;
}

/* Tools bar - lighter blue */
.tools-bar { 
  background:#e7f4f9;
  border-bottom:1px solid #adc7d6;
  padding:0 40px; 
  display:flex;
  gap:0;
  overflow-x:auto;
}
.tool-item { 
  display:flex; 
  align-items:center; 
  gap:8px; 
  padding:16px 24px;
  text-decoration:none; 
  color:#046b99;
  font-size:14px; 
  font-weight:600;
  border-bottom:3px solid transparent;
  white-space:nowrap;
  transition:all .2s;
}
.tool-item:hover { 
  background:#d6ecf5;
  border-bottom-color:#046b99;
}

/* Hero - NLM blue gradient */
.hero { 
  background:#205493;
  padding:60px 40px;
  color:white;
  position:relative;
  text-align:center;
}
.hero-center {
  max-width:760px;
  margin:0 auto;
}
.hero-badge { 
  display:inline-block; 
  background:rgba(255,255,255,0.2);
  border:1px solid rgba(255,255,255,0.3);
  border-radius:4px;
  padding:6px 16px;
  font-size:13px; 
  font-weight:600;
  letter-spacing:0.5px;
  text-transform:uppercase;
  margin-bottom:24px;
  color:#fff;
}
.hero h1 { 
  font-size:38px; 
  font-weight:700; 
  line-height:1.2; 
  margin:0 0 16px;
  font-family:Georgia,serif;
}
.hero p { 
  font-size:18px; 
  font-weight:300;
  line-height:1.6; 
  margin:0 0 32px;
  opacity:0.9;
}

/* Hero centered search box */
.hero-search-box {
  background:rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.2);
  border-radius:12px;
  padding:24px;
  margin-bottom:40px;
}
.hero-chips {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
  margin-bottom:16px;
}
.hero-chips .chip {
  background:rgba(255,255,255,0.15);
  color:#fff;
  border-color:rgba(255,255,255,0.3);
  font-size:12px;
}
.hero-chips .chip:hover {
  background:rgba(255,255,255,0.3);
  border-color:#fff;
}
.hero-input-row {
  display:flex;
  gap:0;
  border-radius:8px;
  overflow:hidden;
  box-shadow:0 4px 20px rgba(0,0,0,0.2);
}
.hero-input-row input {
  flex:1;
  padding:16px 20px;
  font-size:16px;
  border:none;
  outline:none;
  background:#fff;
  color:#1a1a1a;
}
.hero-input-row input::placeholder {
  color:#999;
}
.hero-input-row button {
  padding:16px 32px;
  background:#046b99;
  color:#fff;
  border:none;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
  transition:background .2s;
  white-space:nowrap;
}
.hero-input-row button#hero-mic {
  padding:16px 16px;
  background:#fff;
  color:#205493;
  border:none;
  border-left:1px solid #e0e0e0;
  font-size:18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .2s, color .2s;
}
.hero-input-row button#hero-mic:hover { background:#f0f4ff; color:#046b99; }
.hero-input-row button#hero-mic.listening {
  background:#fff0f0;
  color:#e31c3d;
  animation:pulse 1s infinite;
}
.hero-input-row button#hero-mic.listening svg {
  stroke:#e31c3d;
}
.hero-input-row button:hover { background:#024668; }
.hero-input-row button:disabled { opacity:0.6; cursor:not-allowed; }

/* Answer box inside hero */
.hero-answer-box {
  margin-top:16px;
  background:rgba(255,255,255,0.1);
  border-radius:8px;
  padding:20px;
  text-align:left;
  color:#fff;
  font-size:15px;
  line-height:1.7;
}
.hero-answer-sources {
  margin-top:12px;
  font-size:12px;
  opacity:0.8;
  border-top:1px solid rgba(255,255,255,0.2);
  padding-top:12px;
}
.hero-answer-sources a {
  color:#c5d9f2;
  text-decoration:none;
  font-weight:600;
  margin-right:8px;
}
.hero-answer-sources a:hover { text-decoration:underline; }

.hero-meta {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-top:12px;
  font-size:12px;
  opacity:0.7;
}
.model-badge-hero {
  background:rgba(255,255,255,0.2);
  border-radius:12px;
  padding:3px 10px;
  font-size:11px;
  font-weight:600;
}

.hero-stats { 
  display:flex;
  gap:48px;
  justify-content:center;
  margin-top:0;
}
.hero-stat-num { 
  font-size:32px; 
  font-weight:700;
  font-family:Georgia,serif;
}
.hero-stat-lbl { 
  font-size:12px;
  opacity:0.8;
  text-transform:uppercase; 
  letter-spacing:0.5px;
  margin-top:4px;
}

/* Sections */
.section-wrap { 
  padding:64px 80px;
  background:#fff;
}
.gray-section { 
  background:#f9f9f9;
  padding:64px 80px;
}
.section-title { 
  font-size:14px; 
  font-weight:700; 
  letter-spacing:2px; 
  text-transform:uppercase;
  color:#205493;
  margin-bottom:40px;
  padding-bottom:12px;
  border-bottom:3px solid #205493;
  display:inline-block;
}

/* Cards - cleaner NLM style */
.cards-grid { 
  display:grid; 
  grid-template-columns:repeat(3,1fr); 
  gap:32px;
}
.card { 
  border:1px solid #ddd;
  border-radius:0;
  padding:32px;
  background:#fff;
  transition:box-shadow .3s,border-color .3s;
  box-shadow:0 1px 3px rgba(0,0,0,.05);
}
.card:hover { 
  box-shadow:0 4px 12px rgba(0,0,0,.1);
  border-color:#046b99;
}
.card-icon { 
  font-size:40px; 
  margin-bottom:16px;
}
.card h3 { 
  font-size:20px; 
  font-weight:700;
  color:#205493;
  margin:0 0 12px;
  font-family:Georgia,serif;
}
.card p { 
  font-size:15px;
  color:#5b616b;
  line-height:1.6;
}
.card-tag { 
  display:inline-block; 
  background:#e7f4f9;
  color:#046b99;
  border-radius:3px;
  font-size:12px; 
  font-weight:700;
  padding:4px 12px;
  margin-top:16px;
  letter-spacing:0.5px;
  text-transform:uppercase;
}

/* CTA band */
.highlight-band { 
  background:#046b99;
  color:white; 
  padding:48px 80px;
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  gap:48px;
}
.highlight-band h2 { 
  font-size:32px; 
  font-weight:700; 
  margin:0 0 12px;
  font-family:Georgia,serif;
}
.highlight-band p { 
  font-size:16px;
  opacity:0.95;
  max-width:700px; 
  line-height:1.7;
}

/* Info cards */
.two-col { 
  display:grid; 
  grid-template-columns:1fr 1fr; 
  gap:40px;
}
.info-card { 
  background:white; 
  border:1px solid #ddd;
  padding:40px;
  box-shadow:0 1px 3px rgba(0,0,0,.05);
}
.info-card h3 { 
  color:#205493;
  font-size:24px; 
  font-weight:700; 
  margin:0 0 16px;
  font-family:Georgia,serif;
}
.info-card p { 
  color:#5b616b;
  font-size:16px; 
  line-height:1.7; 
  margin:0 0 20px;
}
.info-card pre { 
  background:#f5f5f5;
  padding:20px;
  border-left:4px solid #205493;
  font-size:13px;
  color:#1a1a1a;
  overflow-x:auto; 
  margin:0 0 20px;
  font-family:'Courier New',monospace;
}
.link-btn { 
  display:inline-block; 
  color:#046b99;
  font-size:14px; 
  font-weight:700;
  text-transform:uppercase; 
  letter-spacing:0.5px;
  text-decoration:none;
  padding:12px 24px;
  border:2px solid #046b99;
  transition:all .2s;
}
.link-btn:hover {
  background:#046b99;
  color:#fff;
}

/* Footer */
.nlm-footer { 
  background:#323a45;
  color:#adb3bc;
  padding:48px 80px;
  font-size:14px;
}
.footer-top { 
  display:flex; 
  justify-content:space-between; 
  margin-bottom:32px;
}
.footer-brand { 
  color:white; 
  font-size:20px; 
  font-weight:700;
  font-family:Georgia,serif;
}
.footer-links { 
  display:flex; 
  gap:32px; 
  flex-wrap:wrap;
}
.footer-links a { 
  color:#adb3bc;
  text-decoration:none; 
  font-size:14px;
  transition:color .2s;
}
.footer-links a:hover { 
  color:white;
}
.footer-divider { 
  border:none; 
  border-top:1px solid #4a5260;
  margin:24px 0;
}
.footer-bottom { 
  font-size:13px;
  color:#8891a0;
  display:flex; 
  gap:32px; 
  flex-wrap:wrap;
}

/* Floating chat button */
.fab { 
  position:fixed; 
  bottom:32px; 
  right:32px;
  width:68px; 
  height:68px;
  background:#046b99;
  border-radius:50%;
  border:none;
  color:white;
  font-size:30px;
  cursor:pointer;
  box-shadow:0 4px 20px rgba(4,107,153,.4);
  z-index:9999;
  transition:transform .2s,box-shadow .2s;
}
.fab:hover { 
  transform:scale(1.08);
  box-shadow:0 6px 28px rgba(4,107,153,.5);
}
.fab-dot { 
  position:absolute; 
  top:4px; 
  right:4px;
  width:18px; 
  height:18px;
  background:#e31c3d;
  border-radius:50%;
  border:3px solid white;
  animation:pulse 2s infinite;
}
@keyframes pulse { 
  0%,100% { transform:scale(1); opacity:1; } 
  50% { transform:scale(1.2); opacity:0.8; } 
}

/* Chat panel - NLM styled */
.chat-panel { 
  position:fixed; 
  bottom:116px; 
  right:32px;
  width:520px; 
  height:82vh;
  max-height:780px;
  min-height:500px;
  background:white; 
  border-radius:8px;
  box-shadow:0 8px 32px rgba(0,0,0,.2);
  z-index:9998;
  display:none; 
  flex-direction:column;
  border:1px solid #ccc;
}
.chat-panel.open { display:flex; }
.chat-header { 
  background:#205493;
  color:white; 
  padding:20px 24px;
  display:flex; 
  align-items:center; 
  gap:16px;
  border-radius:8px 8px 0 0;
}
.chat-avatar { font-size:28px; }
.chat-header-text h4 { 
  margin:0; 
  font-size:18px; 
  font-weight:700;
  font-family:Georgia,serif;
}
.chat-header-text span { 
  font-size:12px;
  opacity:0.9;
}
.chat-close { 
  margin-left:auto; 
  background:none; 
  border:none; 
  color:white; 
  font-size:32px; 
  cursor:pointer; 
  line-height:1;
  padding:0;
  width:28px; 
  height:28px;
  opacity:0.9;
  transition:opacity .2s;
}
.chat-close:hover { opacity:1; }
.chat-suggestions { 
  padding:12px 16px;
  display:flex; 
  gap:8px; 
  overflow-x:auto;
  background:#f9f9f9;
  border-bottom:1px solid #ddd;
}
.chip { 
  background:#e7f4f9;
  color:#046b99;
  border-radius:20px;
  padding:6px 14px;
  font-size:12px; 
  font-weight:600;
  white-space:nowrap; 
  cursor:pointer;
  border:1px solid #adc7d6;
  transition:all .2s;
}
.chip:hover { 
  background:#046b99;
  color:white;
  border-color:#046b99;
}
.chat-messages { 
  flex:1; 
  overflow-y:auto;
  padding:20px;
  display:flex; 
  flex-direction:column; 
  gap:16px;
  background:#fafafa;
}
.msg-bot, .msg-user { 
  max-width:80%;
  padding:14px 18px;
  border-radius:8px;
  font-size:14px; 
  line-height:1.6;
}
.msg-bot { 
  background:white;
  border:1px solid #ddd;
  color:#1a1a1a;
  align-self:flex-start;
  box-shadow:0 1px 3px rgba(0,0,0,.08);
}
.msg-user { 
  background:#046b99;
  color:white;
  align-self:flex-end;
}
.msg-sources { 
  font-size:12px;
  color:#5b616b;
  margin-top:8px;
  padding:12px 16px;
  background:#f5f5f5;
  border-radius:6px;
  border-left:4px solid #046b99;
  max-width:80%;
  align-self:flex-start;
}
.msg-sources a { 
  color:#046b99;
  text-decoration:none; 
  font-weight:600;
}
.msg-sources a:hover { text-decoration:underline; }
.chat-settings { 
  padding:12px 16px;
  display:flex; 
  gap:12px;
  align-items:center;
  background:#f9f9f9;
  border-top:1px solid #ddd;
}
.model-badge {
  display:inline-block;
  padding:6px 14px;
  background:#205493;
  color:white;
  border-radius:20px;
  font-size:13px;
  font-weight:600;
  letter-spacing:0.3px;
}
.chat-settings input { 
  flex:1; 
  padding:8px 12px;
  border:1px solid #ccc;
  border-radius:4px;
  font-size:13px;
}
.chat-input-bar { 
  padding:16px 20px;
  border-top:1px solid #ddd;
  background:white; 
  display:flex; 
  gap:12px;
  border-radius:0 0 8px 8px;
}
.chat-input-bar input { 
  flex:1; 
  padding:12px 16px;
  border:1px solid #ccc;
  border-radius:4px;
  font-size:14px;
}
.chat-input-bar input:focus {
  outline:none;
  border-color:#046b99;
}
.chat-input-bar button { 
  padding:12px 28px;
  background:#046b99;
  color:white; 
  border:none; 
  border-radius:4px;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  transition:background .2s;
}
.chat-input-bar button:hover { 
  background:#024668;
}
.chat-input-bar button:disabled { 
  opacity:0.5; 
  cursor:not-allowed;
}

/* Answer row — avatar + text side by side */
.answer-row {
  display:flex;
  gap:14px;
  align-items:flex-start;
}
.answer-body {
  flex:1;
  min-width:0;
}
.answer-avatar {
  flex-shrink:0;
  width:60px;
  height:60px;
  background:linear-gradient(135deg, #0f3460 0%, #205493 50%, #046b99 100%);
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 4px 18px rgba(4,107,153,0.45), 0 0 0 3px rgba(255,255,255,0.12);
  position:sticky;
  top:8px;
}

/* DNA strands subtle sway at rest — removed, using simpler icon */
.med-icon .pulse-line { stroke-dasharray: 100; stroke-dashoffset: 100; }

/* Streaming: avatar floats up and down, pulse line draws itself */
.answer-avatar.streaming {
  animation: avatarFloat 1.8s ease-in-out infinite;
}
.answer-avatar.streaming .pulse-line {
  animation: drawPulse 1.6s ease-in-out infinite;
}

@keyframes avatarFloat {
  0%,100% { transform: translateY(0)   scale(1);    box-shadow: 0 4px 18px rgba(4,107,153,0.45), 0 0 0 3px rgba(255,255,255,0.12); }
  25%      { transform: translateY(-5px) scale(1.04); box-shadow: 0 10px 28px rgba(4,107,153,0.65), 0 0 0 4px rgba(255,255,255,0.2); }
  75%      { transform: translateY(3px)  scale(0.97); box-shadow: 0 2px 10px rgba(4,107,153,0.3),  0 0 0 2px rgba(255,255,255,0.08); }
}
@keyframes drawPulse {
  0%   { stroke-dashoffset: 100; opacity:1; }
  80%  { stroke-dashoffset: 0;   opacity:1; }
  100% { stroke-dashoffset: 0;   opacity:0; }
}
@keyframes dnaSway {
  0%,100% { transform: scaleX(1);    }
  50%     { transform: scaleX(1.18); }
}

/* Agent step log — like ChatGPT's "Searching..." panel */
.agent-steps {
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:14px;
}
.agent-step {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:rgba(255,255,255,0.75);
  font-style:italic;
  opacity:0;
  transform:translateY(4px);
  animation:stepIn 0.3s ease forwards;
}
.agent-step.done {
  color:rgba(255,255,255,0.5);
  font-style:normal;
}
.agent-step.done::before { content:'✓ '; color:#7dffb3; font-style:normal; }
.agent-step.active::after { content:' ...'; animation:blink 1s infinite; }
@keyframes stepIn {
  to { opacity:1; transform:translateY(0); }
}
.agent-divider {
  border:none;
  border-top:1px solid rgba(255,255,255,0.15);
  margin:10px 0 14px;
}

.answer-actions {
  display:flex;
  gap:8px;
  margin:8px 0 4px;
}
.action-btn {
  background:rgba(255,255,255,0.15);
  border:1px solid rgba(255,255,255,0.3);
  color:white;
  padding:4px 12px;
  border-radius:20px;
  font-size:12px;
  cursor:pointer;
  transition:background .2s;
}
.action-btn:hover { background:rgba(255,255,255,0.28); }

.hero-followup-row {
  display:flex;
  gap:0;
  margin-top:14px;
  border-radius:6px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.3);
}
.hero-followup-row input {
  flex:1;
  padding:12px 16px;
  font-size:15px;
  border:none;
  outline:none;
  background:rgba(255,255,255,0.15);
  color:#fff;
}
.hero-followup-row input::placeholder { color:rgba(255,255,255,0.6); }
.hero-followup-row button {
  padding:12px 20px;
  background:rgba(255,255,255,0.2);
  color:#fff;
  border:none;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
  transition:background .2s;
}
.hero-followup-row button:hover { background:rgba(255,255,255,0.35); }
.hero-followup-row button:disabled { opacity:0.5; cursor:not-allowed; }

.typing { 
  font-style:italic; 
  color:#fff;
  font-size:15px;
  opacity:1;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity:1; }
  50% { opacity:0.5; }
}

/* =============================================
   RESPONSIVE / MOBILE STYLES
   ============================================= */

/* Tablet (max 1024px) */
@media (max-width: 1024px) {
  .nlm-header { padding:0 24px; }
  .tools-bar { padding:0 24px; }
  .hero { padding:40px 40px; }
  .hero h1 { font-size:36px; }
  .hero p { font-size:17px; }
  .hero-stats { gap:32px; }
  .section-wrap { padding:48px 40px; }
  .gray-section { padding:48px 40px; }
  .cards-grid { grid-template-columns:repeat(2,1fr); gap:24px; }
  .highlight-band { padding:40px 40px; flex-direction:column; gap:24px; }
  .two-col { grid-template-columns:1fr; gap:24px; }
  .nlm-footer { padding:40px 40px; }
  .chat-panel { width:460px; }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {

  /* Header */
  .nlm-header {
    padding:0 16px;
    min-height:56px;
    flex-wrap:wrap;
  }
  .nlm-logo-text { font-size:20px; }
  .nlm-logo-sub { font-size:11px; }
  .nlm-nav { display:none; }   /* hide nav links on mobile */

  /* Tools bar - horizontal scroll */
  .tools-bar { padding:0 8px; }
  .tool-item { padding:12px 14px; font-size:13px; }

  /* Hero */
  .hero { padding:32px 16px; }
  .hero h1 { font-size:24px; line-height:1.3; }
  .hero p { font-size:15px; margin-bottom:20px; }
  .hero-badge { font-size:11px; padding:4px 12px; }
  .hero-search-box { padding:16px; }
  .hero-chips { gap:6px; }
  .hero-chips .chip { font-size:11px; padding:5px 10px; }
  .hero-input-row input { font-size:16px; padding:14px 14px; }
  .hero-input-row button { padding:14px 20px; font-size:15px; }
  .hero-stats {
    gap:24px;
    flex-wrap:wrap;
    justify-content:center;
  }
  .hero-stat-num { font-size:22px; }
  .hero-stat-lbl { font-size:10px; }

  /* Sections */
  .section-wrap { padding:32px 16px; }
  .gray-section { padding:32px 16px; }
  .section-title { font-size:13px; margin-bottom:24px; }

  /* Cards - single column */
  .cards-grid { grid-template-columns:1fr; gap:16px; }
  .card { padding:24px; }
  .card h3 { font-size:18px; }
  .card-icon { font-size:32px; margin-bottom:12px; }

  /* Highlight band */
  .highlight-band { 
    padding:32px 20px; 
    flex-direction:column; 
    gap:20px;
    text-align:center;
  }
  .highlight-band h2 { font-size:24px; }
  .highlight-band p { font-size:15px; }

  /* Two-col → single col */
  .two-col { grid-template-columns:1fr; gap:16px; }
  .info-card { padding:24px; }
  .info-card h3 { font-size:20px; }

  /* Footer */
  .nlm-footer { padding:32px 16px; }
  .footer-top { flex-direction:column; gap:24px; }
  .footer-links { gap:16px; }
  .footer-bottom { flex-direction:column; gap:8px; }

  /* FAB button - slightly smaller */
  .fab { 
    width:56px; 
    height:56px; 
    font-size:24px;
    bottom:20px; 
    right:16px;
  }
  .fab-dot { width:14px; height:14px; }

  /* Chat panel — full screen on mobile */
  .chat-panel {
    position:fixed;
    bottom:0;
    right:0;
    left:0;
    width:100%;
    height:92vh;
    max-height:100vh;
    min-height:unset;
    border-radius:16px 16px 0 0;
    border:none;
    border-top:1px solid #ccc;
  }
  .chat-header {
    border-radius:16px 16px 0 0;
    padding:16px 20px;
  }
  .chat-header-text h4 { font-size:16px; }
  .chat-messages { padding:14px; }
  .msg-bot, .msg-user { font-size:14px; padding:12px 14px; max-width:90%; }
  .chat-input-bar { padding:12px 14px; gap:8px; }
  .chat-input-bar input { font-size:16px; } /* 16px prevents iOS zoom */
  .chat-input-bar button { padding:12px 18px; font-size:14px; }
  .chip { font-size:11px; padding:5px 12px; }
}
