/* High-legibility layer: stronger contrast, clearer hierarchy, and easier form reading. */
:root { --read-text: #1d2d43; --read-muted: #465b72; --read-line: #bdcad8; --read-surface: #ffffff; --read-accent: #066f7c; }

body { color: var(--read-text); font-size: 16px; line-height: 1.58; }
body:not(:has(.assistant-medflow-shell)) { background: #f4f7fa; }
h1, h2, h3, h4, h5, h6 { color: #17273e; }
p, .text-secondary, .form-text { color: var(--read-muted) !important; }
.site-page-content small { color: #4b6076; }

.site-app-header { border-bottom-color: #bfccd9; background: rgba(255, 255, 255, .98); }
.site-header-row { min-height: 88px; }
.site-brand-word { color: #122844; font-size: 1.2rem; }
.site-header-action { padding: .7rem 1rem; background: #122a48; font-size: .88rem; }
.site-header-action:hover { background: #063f4d; }
.site-workflow-tabs { justify-content: flex-start; gap: .3rem; width: min(100% - 2rem, 1440px); padding: .9rem .2rem 1.05rem; scroll-padding-inline: .2rem; }
.site-workflow-tabs > a:first-child { margin-inline-start: auto; }
.site-workflow-tabs > a:last-child { margin-inline-end: auto; }
.site-workflow-tabs a { border-color: #b5c5d4; color: #263c56; font-size: .91rem; font-weight: 760; line-height: 1.2; }
.site-workflow-tabs a:hover { border-color: #287f8b; background: #e4f4f6; color: #075d68; }
.site-hcp-disclaimer { border-bottom-color: #b8d3d7; background: #e6f5f6; color: #284f58; }
.site-hcp-disclaimer > div { min-height: 40px; font-size: .78rem; font-weight: 560; }
.site-hcp-disclaimer strong { color: #153f48; }

.site-page-content .card, .site-page-content .placeholder-panel, .site-page-content .ai-form-card, .site-page-content .ai-safety-card, .site-page-content .ai-result-card, .guest-tool-card { border-color: var(--read-line); box-shadow: 0 10px 25px rgba(30, 53, 79, .08); }
.site-page-content .form-control, .site-page-content .form-select { min-height: 44px; border-color: #91a7bb; background: #fff; color: #172a40; font-size: .96rem; }
.site-page-content textarea.form-control { min-height: 220px; line-height: 1.58; }
.site-page-content .form-control::placeholder { color: #64778c; opacity: 1; }
.site-page-content .form-control:focus, .site-page-content .form-select:focus { border-color: #087b8b; box-shadow: 0 0 0 .22rem rgba(8, 123, 139, .16); }
.site-page-content .form-label { color: #223953; font-size: .9rem; font-weight: 760; }
.site-page-content .form-check-label { color: #3d526a; font-size: .85rem; line-height: 1.5; }
.site-page-content .btn { font-size: .91rem; font-weight: 760; }
.site-page-content .btn-primary { background: #0a6372; border-color: #0a6372; }
.site-page-content .btn-primary:hover { background: #064d59; border-color: #064d59; }

.ai-form-card, .guest-tool-card { color: var(--read-text); }
.ai-form-card > p, .guest-tool-card > p, .ai-result, .guest-preview-result { color: #385068 !important; font-size: .97rem; line-height: 1.7; }
.ai-form-card > a.small { display: none; }
.ai-form-card > .d-flex.gap-3.mt-4 { display: grid !important; grid-template-columns: 42px minmax(0, 1fr); gap: .8rem !important; align-items: center; margin-top: 0 !important; padding: .8rem .9rem; border: 1px solid #bdd3dc; border-radius: .9rem; background: linear-gradient(120deg, #edf8f9, #fbfdfe); }
.ai-form-card > .d-flex.gap-3.mt-4 .ai-tool-icon { width: 42px; height: 42px; border-radius: .72rem; background: #d7f0f2; color: #076d7b; font-size: 1.12rem; }
.ai-form-card > .d-flex.gap-3.mt-4 > div { display: block; }
.ai-form-card > .d-flex.gap-3.mt-4 .eyebrow { display: none; }
.ai-form-card > .d-flex.gap-3.mt-4 h1 { margin: 0 !important; color: #1a344f; font-size: 1.3rem; line-height: 1.16; }
.ai-form-card > .d-flex.gap-3.mt-4 p { margin: .18rem 0 0 !important; color: #4c667d !important; font-size: .85rem; line-height: 1.38; }
.ai-form-card > form.mt-4 { margin-top: 1rem !important; }
.guest-tool-heading { margin-bottom: 1rem; padding: .8rem .9rem; border: 1px solid #bdd3dc; border-radius: .9rem; background: linear-gradient(120deg, #edf8f9, #fbfdfe); }
.guest-tool-heading__content { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: .8rem; align-items: center; }
.guest-tool-heading__content .ai-tool-icon { width: 42px; height: 42px; border-radius: .72rem; background: #d7f0f2; color: #076d7b; font-size: 1.12rem; }
.guest-tool-heading__content h1 { margin: 0; color: #1a344f; font-size: 1.3rem; line-height: 1.16; }
.guest-tool-heading__content p { max-width: none; margin: .18rem 0 0; color: #4c667d !important; font-size: .85rem; line-height: 1.38; }
.guest-tool-card .guest-preview-form { margin-top: 1rem; }
.guest-report-upload { margin-top: .9rem; padding: .85rem; border: 1px dashed #9db9c8; border-radius: .78rem; background: #f7fbfc; }
.guest-report-upload .form-label { margin-bottom: .45rem; color: #24516b; font-size: .85rem; }
.guest-report-upload .form-text { margin-top: .45rem; color: #4e667c !important; font-size: .78rem; line-height: 1.45; }
.ai-safety-card { background: #eaf6f8; color: #243e56; }
.ai-safety-card h2 { color: #193b55; font-size: 1rem; }
.ai-safety-card li { color: #40566c; font-size: .88rem; line-height: 1.55; }
.ai-result-card { background: #fff; border-color: #8fbac1 !important; }
.ai-result { font-size: 1rem; }
.eyebrow { color: #066a77; font-size: .76rem; font-weight: 800; }

.ai-quick-prompts, .ai-chat-history { border-color: #b9cad8; background: #fdfefe; }
.ai-quick-prompts h2, .ai-chat-history h2 { color: #1d3854; font-size: 1.02rem; }
.ai-quick-prompts > p, .ai-chat-history > p { color: #485e74 !important; font-size: .84rem; }
.ai-quick-prompt { border-color: #b9c9d7; color: #25425d; font-size: .84rem; }
.ai-quick-prompt:hover { border-color: #227f8c; background: #e7f6f7; }
.ai-chat-history__item { border-color: #c0ceda; background: #f8fafc; }
.ai-chat-history__item strong { color: #29445d; font-size: .8rem; }
.ai-chat-history__item span, .ai-chat-history small, .ai-quick-prompts small { color: #50677e; font-size: .73rem; }

.guest-back { color: #065f6d; font-size: .88rem; }
.guest-tool-list { border-top-color: #c7d3df; color: #3e586e; font-size: .9rem; }
.guest-preview-limit, .guest-preview-finish { color: #4c6678; font-size: .82rem; }
.guest-tool-error, .ai-async-error { font-size: .88rem; }
.assistant-auth-shell .form-label { color: #29415b; font-size: .87rem; }
.assistant-auth-heading p, .assistant-auth-footer, .assistant-auth-shell .form-check-label { color: #4c6178 !important; font-size: .86rem; }
.assistant-auth-notice { color: #355b64; font-size: .86rem; }

.assistant-medflow-shell, .assistant-medflow-shell .assistant-app { color: var(--read-text); }
.assistant-medflow-shell .assistant-intro p, .assistant-medflow-shell .assistant-feature-card p, .assistant-medflow-shell .assistant-feature-card > span:last-child { color: #3f536b !important; }
.assistant-medflow-shell .assistant-tools-scroll a { color: #30475e; font-size: .84rem; }
.assistant-medflow-shell .assistant-tools-scroll a:hover { color: #075f6c; }

footer { border-top-color: #c2ceda !important; color: #435a70 !important; }
footer .text-secondary { color: #435a70 !important; }

@media (max-width: 650px) {
  .site-header-row { min-height: 72px; }
  .site-workflow-tabs a { font-size: .83rem; }
  .site-hcp-disclaimer > div { font-size: .72rem; }
  .ai-form-card > .d-flex.gap-3.mt-4, .guest-tool-heading__content { align-items: start; }
}

/* Final reading-first override: compact hierarchy and conventional typography. */
html { font-size: 16px; }
body, button, input, textarea, select { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important; }
body { color: #263b50; font-size: 1.05rem; line-height: 1.68; }
h1, h2, h3, h4, h5, h6 { color: #14283d !important; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important; font-weight: 700 !important; letter-spacing: 0 !important; line-height: 1.24 !important; }
h1 { font-size: clamp(1.8rem, 2.25vw, 2.25rem) !important; }
h2 { font-size: clamp(1.38rem, 1.8vw, 1.7rem) !important; }
h3 { font-size: 1.1rem !important; }
p, li, td, th, label, .form-text { color: #334f68 !important; font-size: 1rem !important; font-weight: 400; line-height: 1.68 !important; }
small, .small, .site-page-content small { color: #46617a !important; font-size: .88rem !important; }

.assistant-medflow-shell .assistant-intro h1, .ai-landing-hero h1, .medflow-hero h1 { font-size: clamp(2rem, 2.7vw, 2.65rem) !important; letter-spacing: -.02em !important; }
.story-grid h2, .flow-heading h2, .clinical-verify h2, .med-tools-heading h2, .medflow-section-heading h2, .medflow-hcp h2, .landing-section-title, .landing-cta h2 { font-size: clamp(1.5rem, 2vw, 1.9rem) !important; }
.site-main-navigation a, .site-tools-menu summary, .site-workflow-tabs a { font-size: .92rem !important; letter-spacing: 0 !important; }
.assistant-feature-card p, .landing-tool-card p, .med-tool-tile p, .medflow-tool p, .flow-grid p, .medflow-steps p, .dashboard-clinical__tool p, .medical-feed-card__summary { font-size: .94rem !important; color: #39546c !important; }
.ai-conversation__message, .ai-result, .guest-preview-result, .medical-reader__preview { font-size: 1.02rem !important; color: #263f56 !important; }

/* Unified type scale: calm headings, high-contrast body text, and usable controls. */
:root { --type-ink: #172b43; --type-body: #344d65; --type-muted: #526b82; }
html { font-size: 17px; }
body, button, input, textarea, select { font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important; }
body { color: var(--type-body); font-size: 1rem; line-height: 1.65; }
h1, h2, h3, h4, h5, h6 { color: var(--type-ink); font-weight: 720; letter-spacing: -.025em; line-height: 1.18; }
h1 { font-size: clamp(2rem, 3.2vw, 2.85rem); }
h2 { font-size: clamp(1.45rem, 2.15vw, 2rem); }
h3 { font-size: 1.15rem; }
p, li, td, th, label, .form-text { color: var(--type-body) !important; font-size: 1rem; line-height: 1.65; }
small, .small, .site-page-content small { color: var(--type-muted) !important; font-size: .84rem; line-height: 1.5; }
.eyebrow, .story-label, .landing-kicker, .medflow-kicker { font-size: .78rem; font-weight: 780; }
.site-main-navigation a, .site-tools-menu summary, .site-workflow-tabs a { font-size: .94rem; font-weight: 720; }
.site-hcp-disclaimer > div { font-size: .85rem; line-height: 1.45; }
.site-page-content .btn, .site-header-action { font-size: .92rem; font-weight: 740; }
.site-page-content .form-control, .site-page-content .form-select { font-size: 1rem; }
.site-page-content .form-label { font-size: .94rem; }

/* Landing and workspace headings previously used an oversized display scale. */
.assistant-medflow-shell .assistant-intro h1, .ai-landing-hero h1, .medflow-hero h1 { font-size: clamp(2.25rem, 4vw, 3.35rem); line-height: 1.1; letter-spacing: -.045em; }
.assistant-medflow-shell .assistant-intro p, .landing-lead, .medflow-hero p { color: var(--type-body) !important; font-size: 1.05rem; line-height: 1.65; }
.assistant-professional-cta .assistant-eyebrow { color: #d7ffff !important; }
.assistant-professional-cta h2 { color: #ffffff !important; }
.assistant-professional-cta p { color: #ffffff !important; }
.story-grid h2, .flow-heading h2, .clinical-verify h2, .med-tools-heading h2, .medflow-section-heading h2, .medflow-hcp h2, .landing-section-title, .landing-cta h2 { font-size: clamp(1.65rem, 2.8vw, 2.45rem); line-height: 1.18; letter-spacing: -.035em; }
.assistant-feature-card h2, .landing-tool-card h3, .med-tool-tile h3, .medflow-tool h3, .flow-grid h3, .medflow-steps h3 { font-size: 1.05rem; }
.assistant-feature-card p, .landing-tool-card p, .med-tool-tile p, .medflow-tool p, .flow-grid p, .medflow-steps p, .dashboard-clinical__tool p { color: var(--type-body) !important; font-size: .9rem; line-height: 1.58; }

/* Clinical workspaces and feed readers need sustained reading contrast. */
.ai-conversation__message, .ai-result, .guest-preview-result, .medical-reader__preview, .medical-feed-card__summary { color: #263f56 !important; font-size: 1rem; line-height: 1.72; }
.ai-quick-prompt, .ai-chat-history__item strong, .medical-feed-card__date, .medical-reader__date { font-size: .88rem; }
.ai-quick-prompts > p, .ai-chat-history > p, .medical-feed-card p, .medical-reader p { color: var(--type-body) !important; }

@media (max-width: 650px) {
  html { font-size: 16px; }
  h1, .assistant-medflow-shell .assistant-intro h1, .ai-landing-hero h1, .medflow-hero h1 { font-size: 2.1rem; }
  h2, .story-grid h2, .flow-heading h2, .clinical-verify h2, .med-tools-heading h2, .medflow-section-heading h2, .medflow-hcp h2, .landing-section-title, .landing-cta h2 { font-size: 1.55rem; }
  p, li, td, th, label, .form-text { font-size: .98rem; }
}

/* AI Tools entry card: preserve clear type on the dark clinical-workspace surface. */
.guest-workspace-hero h1,
.ai-hero h1 {
  color: #fff !important;
  font-size: clamp(1.8rem, 2.7vw, 2.35rem) !important;
  font-weight: 740 !important;
  line-height: 1.16 !important;
  letter-spacing: -.025em !important;
}
.guest-workspace-hero p,
.ai-hero p {
  color: #d9f0f2 !important;
  font-size: 1rem !important;
  line-height: 1.62 !important;
}
.guest-workspace-hero .eyebrow,
.ai-hero .eyebrow {
  color: #bdebed !important;
  font-size: .8rem !important;
  font-weight: 750 !important;
}
.guest-workspace-hero .btn-light,
.ai-hero .btn-light {
  color: #15314a !important;
  background: #fff !important;
}
.guest-workspace-hero .btn-outline-light,
.ai-hero .btn-outline-light {
  color: #fff !important;
  border-color: rgba(255, 255, 255, .82) !important;
}
@media (max-width: 650px) {
  .guest-workspace-hero h1,
  .ai-hero h1 { font-size: 1.82rem !important; }
  .guest-workspace-hero p,
  .ai-hero p { font-size: .97rem !important; }
}

/* Homepage trust points: make each promise easy to scan. */
.assistant-trust-note { max-width: 760px; gap: .7rem; }
.assistant-trust-note > span { grid-template-columns: 36px minmax(0, 1fr); column-gap: .65rem; padding: .78rem .82rem; }
.assistant-trust-note i { width: 36px; height: 36px; border-radius: .65rem; font-size: .95rem; }
.assistant-trust-note b { color: #19364f; font-size: .86rem !important; font-weight: 780; line-height: 1.2; }
.assistant-trust-note small { margin-top: .18rem; color: #4d6479 !important; font-size: .74rem !important; line-height: 1.3; }
@media (max-width: 650px) {
  .assistant-trust-note { gap: .55rem; }
  .assistant-trust-note > span { padding: .72rem .78rem; }
}

/* Keep individual tool screens compact, so the useful chat area starts higher. */
.guest-tool-heading__content h1,
.ai-form-card > .d-flex.gap-3.mt-4 h1 { font-size: 1.18rem !important; line-height: 1.18 !important; }
.ai-quick-prompts h2,
.ai-chat-history h2 { font-size: .98rem !important; line-height: 1.25 !important; }
.ai-quick-prompts .eyebrow,
.ai-chat-history .eyebrow { font-size: .7rem !important; }
@media (max-width: 650px) {
  .guest-tool-heading__content h1,
  .ai-form-card > .d-flex.gap-3.mt-4 h1 { font-size: 1.12rem !important; }
}
