/* RheumaScore patient portal, aligned with the approved Clinical Atlas. */
:root {
  --patient-paper: #f7f8f7;
  --patient-surface: #ffffff;
  --patient-ink: #17212b;
  --patient-muted: #617080;
  --patient-line: #dce2e5;
  --patient-teal: #0b7468;
  --patient-teal-deep: #075d55;
  --patient-teal-soft: #e2f1ed;
  --patient-amber: #8a5a14;
  --bg: var(--patient-paper);
  --bg2: #f0f4f3;
  --card: var(--patient-surface);
  --card-hover: #f2f9f8;
  --border: var(--patient-line);
  --border-light: #cbd5d9;
  --accent: var(--patient-teal);
  --accent-soft: var(--patient-teal-soft);
  --teal: var(--patient-teal);
  --text: var(--patient-ink);
  --text-secondary: var(--patient-muted);
  --text-dim: #73818e;
  --yellow: var(--patient-amber);
  --red: #a33c35;
}
body {
  background: var(--patient-paper) !important;
  color: var(--patient-ink) !important;
}
body::before { display: none !important; }
.sidebar {
  background: #ffffff !important;
  border-right: 1px solid var(--patient-line) !important;
  box-shadow: none !important;
}
.sidebar-brand,
.sidebar-brand-text { color: var(--patient-ink) !important; }
.sidebar-brand-text { background: none !important; -webkit-text-fill-color: initial !important; }
.nav-item { color: #43515e !important; }
.nav-item:hover { color: var(--patient-ink) !important; background: #f0f4f3 !important; }
.nav-item.active { color: var(--patient-teal-deep) !important; background: var(--patient-teal-soft) !important; }
.eco-btn,
.theme-toggle-btn,
.toggle-sidebar-btn {
  background: #ffffff !important;
  color: #43515e !important;
  border-color: var(--patient-line) !important;
}
.patient-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr);
  min-height: 330px;
  margin: 28px 0 18px;
  overflow: hidden;
  border: 1px solid var(--patient-line);
  border-radius: 22px;
  background: var(--patient-surface);
  box-shadow: 0 18px 48px rgba(23, 33, 43, .08);
}
.patient-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, rgba(226, 241, 237, .82), transparent 48%, rgba(247, 239, 222, .45));
  pointer-events: none;
}
.patient-hero-copy {
  align-self: center;
  padding: 44px 46px;
}
.patient-eyebrow,
.lesai-kicker,
.guide-kicker {
  margin: 0 0 10px;
  color: var(--patient-teal);
  font: 700 .68rem ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.patient-hero h1 {
  max-width: 570px;
  margin: 0;
  color: var(--patient-ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.15rem, 5vw, 4rem);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.045em;
}
.patient-hero .tagline {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--patient-muted);
  font-size: 1rem;
  line-height: 1.65;
}
.patient-hero-art {
  position: relative;
  min-height: 330px;
  background-image:
    linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, .72) 24%, rgba(255, 255, 255, .06) 62%),
    linear-gradient(180deg, rgba(23, 33, 43, .02), rgba(23, 33, 43, .42)),
    url('/assets/atlas-specialties-16.png');
  background-position: center, center, 0% 0%;
  background-size: 100% 100%, 100% 100%, 400% 400%;
}
.patient-hero-seal {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(4, 16, 29, .72);
  color: rgba(255, 255, 255, .82);
  font: 700 .6rem ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .1em;
}
.patient-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 0 20px;
}
.lesai-consult {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 150px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid #b9d9d2;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--patient-teal-soft), #ffffff);
  box-shadow: 0 12px 32px rgba(23, 33, 43, .06);
}
.lesai-consult::after {
  content: '';
  position: absolute;
  right: -70px;
  top: -100px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(11, 116, 104, .08);
  pointer-events: none;
}
.lesai-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--patient-teal);
  color: #ffffff;
  font: 900 1.4rem Georgia, serif;
  box-shadow: 0 8px 22px rgba(11, 116, 104, .16);
}
.lesai-consult h2 {
  margin: 0 0 6px;
  color: var(--patient-ink);
  font: 700 1.3rem/1.15 Georgia, 'Times New Roman', serif;
}
.lesai-consult p {
  max-width: 530px;
  margin: 0;
  color: var(--patient-muted);
  font-size: .86rem;
  line-height: 1.55;
}
.lesai-consult .lesai-safety {
  margin-top: 8px;
  color: #52616f;
  font-size: .74rem;
}
.lesai-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--patient-teal);
  border-radius: 12px;
  background: var(--patient-teal);
  color: #ffffff !important;
  font-size: .84rem;
  font-weight: 800;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.lesai-button:hover {
  transform: translateY(-2px);
  background: var(--patient-teal-deep);
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(11, 116, 104, .16);
}
.patient-actions .disclaimer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin: 0;
  padding: 22px;
  text-align: left;
  color: #6b4b1b;
  background: #fff9eb;
  border-color: #efd7a1;
}
.guide-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 2px 14px;
}
.guide-intro h2 {
  margin: 0;
  color: var(--patient-ink);
  font: 700 1.65rem/1.1 Georgia, 'Times New Roman', serif;
}
.guide-intro p:last-child {
  max-width: 440px;
  margin: 0;
  color: var(--text-secondary);
  font-size: .85rem;
}
.search-wrap {
  margin-bottom: 18px;
}
.search-wrap input {
  min-height: 54px;
  border-color: var(--patient-line);
  background: #ffffff;
}
.search-wrap input:focus {
  border-color: var(--patient-teal);
  box-shadow: 0 0 0 3px rgba(11, 116, 104, .1);
}
.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;
}
#diseaseList {
  display: grid;
  gap: 12px;
}
#diseaseList .disease-card {
  margin: 0;
  border-color: var(--patient-line);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(23, 33, 43, .05);
}
#diseaseList .disease-card:nth-child(3n + 2) { border-color: rgba(11, 116, 104, .28); }
#diseaseList .disease-card:nth-child(3n + 3) { border-color: rgba(138, 90, 20, .22); }
.disease-header {
  width: 100%;
  min-height: 82px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.faq-q {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.disease-header:focus-visible,
.faq-q:focus-visible {
  outline: 3px solid var(--patient-teal);
  outline-offset: -3px;
}
.disease-header .emoji {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(11, 116, 104, .14);
  border-radius: 12px;
  background: var(--patient-teal-soft);
}
.disease-header .title h3 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: -.01em;
}
.disclaimer-bottom {
  color: var(--patient-muted);
  background: var(--patient-teal-soft);
  border-color: #b9d9d2;
}
/* Override legacy global layers that still use dark card !important rules. */
.patient-health .container {
  background: transparent !important;
  color: var(--patient-ink) !important;
  border: 0 !important;
  box-shadow: none !important;
}
.patient-health .patient-hero { background: #ffffff !important; color: var(--patient-ink) !important; }
.patient-health .patient-hero-copy { color: var(--patient-ink) !important; }
.patient-health .patient-hero .tagline { color: var(--patient-muted) !important; }
.patient-health .lesai-consult { background: linear-gradient(135deg, var(--patient-teal-soft), #ffffff) !important; color: var(--patient-ink) !important; }
.patient-health .lesai-consult p { color: var(--patient-muted) !important; }
.patient-health .patient-actions .disclaimer { background: #fff9eb !important; color: #6b4b1b !important; }
.patient-health .guide-intro h2 { color: var(--patient-ink) !important; }
.patient-health .guide-intro p:last-child { color: var(--patient-muted) !important; }
.patient-health .search-wrap input { background: #ffffff !important; color: var(--patient-ink) !important; border-color: var(--patient-line) !important; }
.patient-health #diseaseList .disease-card { background: #ffffff !important; color: var(--patient-ink) !important; }
.patient-health .disease-header { background: transparent !important; color: var(--patient-ink) !important; }
.patient-health .disease-header:hover { background: #f7fbfa !important; }
.patient-health .disease-header .title h3 { color: var(--patient-ink) !important; }
.patient-health .disease-header .title .subtitle,
.patient-health .section-block p,
.patient-health .section-block li,
.patient-health .faq-a p { color: var(--patient-muted) !important; }
.patient-health .score-badge,
.patient-health .med-card { background: #f7f8f7 !important; border-color: var(--patient-line) !important; }
.patient-health .faq-q { color: var(--patient-ink) !important; }
.patient-health .disclaimer-bottom { background: var(--patient-teal-soft) !important; color: var(--patient-muted) !important; }
@media (max-width: 850px) {
  .patient-hero { grid-template-columns: 1fr minmax(210px, .55fr); }
  .patient-hero-copy { padding: 34px; }
  .patient-actions { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .container { padding-inline: 16px; }
  .patient-hero {
    display: flex;
    flex-direction: column-reverse;
    min-height: 0;
    margin-top: 12px;
    border-radius: 18px;
  }
  .patient-hero-art {
    min-height: 190px;
    background-image:
      linear-gradient(180deg, rgba(255, 255, 255, .02), #ffffff 100%),
      url('/assets/atlas-specialties-16.png');
    background-position: center, 0% 0%;
    background-size: 100% 100%, 400% 400%;
  }
  .patient-hero-copy { padding: 8px 22px 30px; }
  .patient-hero h1 { font-size: 2.3rem; }
  .patient-hero .tagline { margin-top: 14px; font-size: .92rem; }
  .lesai-consult {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 20px;
  }
  .lesai-mark { width: 48px; height: 48px; border-radius: 14px; }
  .lesai-button { grid-column: 1 / -1; width: 100%; }
  .patient-actions .disclaimer { padding: 18px; }
  .guide-intro { display: block; margin-top: 28px; }
  .guide-intro p:last-child { margin-top: 8px; }
  .disease-header { min-height: 96px; padding: 18px; }
  .disease-header .title h3 { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lesai-button { transition: none; }
}
