/* RheumaScore shared clinical shell — aligned with the approved home surface. */
:root {
  --rs-canvas: #f4f6f4;
  --rs-surface: #fffefb;
  --rs-surface-strong: #ffffff;
  --rs-ink: #18212a;
  --rs-ink-soft: #536273;
  --rs-ink-faint: #788596;
  --rs-line: #dce3e1;
  --rs-line-strong: #cbd6d3;
  --rs-accent: #0f7a70;
  --rs-accent-strong: #075f58;
  --rs-accent-soft: #e1f0ed;
  --rs-sage: #718d7c;
  --rs-violet: #8557ee;
  --rs-danger: #b84242;
  --rs-warning: #a86800;
  --rs-sidebar-width: 280px;
  --rs-display: "Source Serif 4", Georgia, serif;
  --rs-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rs-shadow: 0 18px 48px rgba(24, 33, 42, 0.06);
  --rs-radius: 18px;

  /* Bridge legacy variables without changing clinical behavior. */
  --bg: var(--rs-canvas) !important;
  --bg2: #edf1ef !important;
  --card: rgba(255, 255, 255, 0.9) !important;
  --card-hover: #ffffff !important;
  --card-active: #f0f7f5 !important;
  --border: var(--rs-line) !important;
  --border-light: var(--rs-line-strong) !important;
  --accent: var(--rs-accent) !important;
  --accent-soft: rgba(15, 122, 112, 0.09) !important;
  --accent-glow: rgba(15, 122, 112, 0.16) !important;
  --teal: var(--rs-accent) !important;
  --teal-soft: rgba(15, 122, 112, 0.08) !important;
  --green: #177761 !important;
  --yellow: #a86800 !important;
  --orange: #ad5d22 !important;
  --red: #b84242 !important;
  --pink: var(--rs-violet) !important;
  --text: var(--rs-ink) !important;
  --text-secondary: var(--rs-ink-soft) !important;
  --text-dim: var(--rs-ink-faint) !important;
  --glass: rgba(255, 254, 251, 0.94) !important;
  --sans: var(--rs-sans) !important;
  --serif: var(--rs-display) !important;
}

[data-theme="dark"] {
  --rs-canvas: #101717;
  --rs-surface: #151f1f;
  --rs-surface-strong: #1a2525;
  --rs-ink: #edf4f1;
  --rs-ink-soft: #b5c3bd;
  --rs-ink-faint: #879892;
  --rs-line: #2a3936;
  --rs-line-strong: #3b4e49;
  --rs-accent: #58c4b6;
  --rs-accent-strong: #7ad7cc;
  --rs-accent-soft: rgba(88, 196, 182, 0.12);
  --rs-sage: #9ab4a4;
  --rs-shadow: 0 22px 58px rgba(0, 0, 0, 0.2);
  --bg2: #131d1c !important;
  --card: rgba(21, 31, 31, 0.94) !important;
  --card-hover: #1a2725 !important;
  --card-active: #20302d !important;
  --accent-soft: rgba(88, 196, 182, 0.12) !important;
  --teal-soft: rgba(88, 196, 182, 0.1) !important;
  --glass: rgba(16, 23, 23, 0.95) !important;
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body.rs-shell-active {
  --bg: var(--rs-canvas);
  --bg2: var(--rs-surface);
  --card: var(--rs-surface-strong);
  --text: var(--rs-ink);
  --text2: #536477;
  --muted: #536477;
  --border: var(--rs-line);
  margin: 0 !important;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--rs-canvas) !important;
  color: var(--rs-ink) !important;
  font-family: var(--rs-sans) !important;
  -webkit-font-smoothing: antialiased;
}
body.rs-shell-active::before,
body.rs-shell-active::after { display: none !important; }
body.rs-shell-active a { color: var(--rs-accent); }
body.rs-shell-active h1,
body.rs-shell-active h2 { color: var(--rs-ink); }
body.rs-shell-active h1 { font-family: var(--rs-display) !important; letter-spacing: -0.035em !important; }
body.rs-shell-active h2 { font-family: var(--rs-display); letter-spacing: -0.02em; }
body.rs-shell-active h3,
body.rs-shell-active h4 { font-family: var(--rs-sans); color: var(--rs-ink); }

.rs-shell-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10000;
  display: flex;
  width: var(--rs-sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  background: var(--rs-surface-strong);
  border-right: 1px solid var(--rs-line);
  color: var(--rs-ink);
  transition: transform .25s ease, width .25s ease;
}
.rs-shell-sidebar.collapsed { width: 76px; }
.rs-shell-sidebar.collapsed .rs-shell-wordmark,
.rs-shell-sidebar.collapsed .rs-shell-nav-label,
.rs-shell-sidebar.collapsed .rs-shell-badge,
.rs-shell-sidebar.collapsed .rs-shell-footer { display: none; }
.rs-shell-sidebar.collapsed .rs-shell-brand { justify-content: center; padding-inline: 12px; }
.rs-shell-sidebar.collapsed .rs-shell-nav { padding-inline: 10px; }
.rs-shell-sidebar.collapsed .rs-shell-nav a { justify-content: center; padding-inline: 10px; }
.rs-shell-main.sidebar-collapsed { margin-left: 76px; }
.rs-shell-brand {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  color: var(--rs-ink) !important;
  text-decoration: none;
  border-bottom: 1px solid var(--rs-line);
}
.rs-shell-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--rs-accent);
  color: #fff;
}
.rs-shell-mark svg { width: 25px; height: 25px; }
.rs-shell-wordmark { font-weight: 850; font-size: 1.16rem; letter-spacing: -.035em; }
.rs-shell-nav { display: flex; flex: 1; flex-direction: column; gap: 3px; padding: 20px 12px; }
.rs-shell-nav a {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 14px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--rs-sage) !important;
  font-weight: 680;
  font-size: .91rem;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.rs-shell-nav a:hover { background: #f4f8f6; color: var(--rs-accent-strong) !important; }
[data-theme="dark"] .rs-shell-nav a:hover { background: #1b2926; }
.rs-shell-nav a.active {
  color: var(--rs-accent-strong) !important;
  background: var(--rs-accent-soft);
  border-color: rgba(15, 122, 112, .08);
}
.rs-shell-nav svg { width: 21px; height: 21px; flex: 0 0 21px; }
.rs-shell-nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-shell-badge {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  color: #1d103c;
  background: #9b70ff;
  font-size: .7rem;
  font-weight: 850;
}
.rs-shell-footer { padding: 14px 12px 18px; border-top: 1px solid var(--rs-line); }
.rs-shell-ecosystem {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  border: 1px solid var(--rs-line);
  border-radius: 12px;
  background: var(--rs-surface);
  color: var(--rs-ink-soft);
  font: 750 .72rem/1 var(--rs-sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
}
.rs-shell-ecosystem-panel { display: none; padding: 8px 4px 0; }
.rs-shell-ecosystem-panel.open { display: grid; }
.rs-shell-ecosystem-panel a { padding: 8px 10px; border-radius: 8px; color: var(--rs-ink-soft) !important; font-size: .79rem; text-decoration: none; }
.rs-shell-ecosystem-panel a:hover { background: var(--rs-accent-soft); color: var(--rs-accent-strong) !important; }

.rs-shell-main {
  min-height: 100vh;
  margin-left: var(--rs-sidebar-width);
  transition: margin-left .25s ease;
}
.rs-shell-topbar {
  position: sticky;
  top: 0;
  z-index: 9000;
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 3.3vw, 48px);
  background: color-mix(in srgb, var(--rs-surface) 92%, transparent);
  border-bottom: 1px solid var(--rs-line);
  backdrop-filter: blur(18px);
}
.rs-shell-context { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--rs-ink-soft); }
.rs-shell-context-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--rs-accent); }
.rs-shell-context-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 740 .74rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
.rs-shell-actions { display: flex; gap: 10px; }
.rs-shell-icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--rs-line);
  border-radius: 14px;
  background: var(--rs-surface-strong);
  color: var(--rs-ink-soft);
  cursor: pointer;
}
.rs-shell-icon-button:hover { border-color: var(--rs-line-strong); color: var(--rs-accent-strong); }
.rs-shell-icon-button svg { width: 21px; height: 21px; }
.rs-shell-content { min-width: 0; padding: 0 clamp(18px, 3vw, 44px) 72px; }
.rs-shell-content > .header,
.rs-shell-content > .nav-bar,
.rs-shell-content > .top-nav,
.rs-shell-content > .blog-header { display: none !important; }
.rs-shell-overlay { display: none; position: fixed; inset: 0; z-index: 9998; background: rgba(15, 24, 24, .46); }

/* Shared content language from the approved home page. */
body.rs-shell-active .main,
body.rs-shell-active .container,
body.rs-shell-active .article-container { width: min(100%, 1180px); max-width: 1180px; margin-inline: auto; }
body.rs-shell-active .rs-shell-content > main,
body.rs-shell-active .rs-shell-content > .main,
body.rs-shell-active .rs-shell-content > .container,
body.rs-shell-active .rs-shell-content > .article-container {
  background-color: transparent !important;
  color: var(--rs-ink) !important;
}
body.rs-shell-active .main { padding-top: 40px; }
body.rs-shell-active .hero,
body.rs-shell-active .directory-hero,
body.rs-shell-active .blog-hero {
  background: var(--rs-surface) !important;
  color: var(--rs-ink) !important;
  border: 1px solid var(--rs-line) !important;
  border-radius: 0 !important;
  box-shadow: var(--rs-shadow) !important;
}
body.rs-shell-active .directory-hero { padding: clamp(30px, 5vw, 58px) !important; }
body.rs-shell-active .page-title,
body.rs-shell-active .hero h1,
body.rs-shell-active .blog-hero h1,
body.rs-shell-active .container > h1 {
  color: var(--rs-ink) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  font-family: var(--rs-display) !important;
}
body.rs-shell-active .hero-kicker,
body.rs-shell-active .section-label,
body.rs-shell-active .results-eyebrow { color: var(--rs-accent) !important; letter-spacing: .16em; text-transform: uppercase; }
body.rs-shell-active .directory-hero::after { background: radial-gradient(circle, rgba(15,122,112,.11), transparent 68%) !important; }
body.rs-shell-active .directory-provenance,
body.rs-shell-active .directory-controls,
body.rs-shell-active .doc-card,
body.rs-shell-active .model-card,
body.rs-shell-active .blog-card,
body.rs-shell-active .list-block,
body.rs-shell-active .card,
body.rs-shell-active .panel,
body.rs-shell-active .score-card,
body.rs-shell-active .fhe-step,
body.rs-shell-active .compliance-item,
body.rs-shell-active .tech-item {
  background: var(--rs-surface-strong) !important;
  color: var(--rs-ink) !important;
  border-color: var(--rs-line) !important;
  box-shadow: none !important;
}
body.rs-shell-active .doc-card:hover,
body.rs-shell-active .model-card:hover,
body.rs-shell-active .blog-card:hover,
body.rs-shell-active .card:hover { border-color: var(--rs-accent) !important; box-shadow: 0 16px 34px rgba(24,33,42,.07) !important; }
body.rs-shell-active .doc-card::before,
body.rs-shell-active .model-card::before { background: linear-gradient(90deg, var(--rs-accent), transparent 78%) !important; }
body.rs-shell-active .directory-controls .filter-input,
body.rs-shell-active .directory-controls .filter-select,
body.rs-shell-active input,
body.rs-shell-active select,
body.rs-shell-active textarea { background: var(--rs-surface-strong) !important; color: var(--rs-ink) !important; border-color: var(--rs-line-strong) !important; }
body.rs-shell-active .stat-pill,
body.rs-shell-active .chip,
body.rs-shell-active .badge-method,
body.rs-shell-active .badge-source { background: var(--rs-accent-soft) !important; color: var(--rs-accent-strong) !important; border-color: rgba(15,122,112,.17) !important; }
body.rs-shell-active .disclaimer-banner { background: #fff8e8 !important; color: #745014 !important; border-color: #e9d39c !important; }
[data-theme="dark"] body.rs-shell-active .disclaimer-banner { background: #2a2417 !important; color: #e5c77f !important; border-color: #66552e !important; }
body.rs-shell-active .card-icon,
body.rs-shell-active .logo-mark { background: var(--rs-accent) !important; }
body.rs-shell-active .btn-open,
body.rs-shell-active .btn-primary,
body.rs-shell-active .cta-btn,
body.rs-shell-active .compute-btn { background: var(--rs-accent) !important; color: #fff !important; box-shadow: none !important; }
body.rs-shell-active .btn-open:hover,
body.rs-shell-active .btn-primary:hover,
body.rs-shell-active .cta-btn:hover,
body.rs-shell-active .compute-btn:hover { background: var(--rs-accent-strong) !important; }
body.rs-shell-active table { background: var(--rs-surface-strong); color: var(--rs-ink); }
body.rs-shell-active th,
body.rs-shell-active td { border-color: var(--rs-line) !important; }
body.rs-shell-active .footer,
body.rs-shell-active .blog-footer,
body.rs-shell-active footer { color: var(--rs-ink-faint) !important; border-color: var(--rs-line) !important; }

@media (max-width: 900px) {
  :root { --rs-sidebar-width: 280px; }
  .rs-shell-sidebar {
    transform: translateX(-102%);
    visibility: hidden;
    pointer-events: none;
    box-shadow: 20px 0 50px rgba(17,31,27,.18);
  }
  .rs-shell-sidebar.mobile-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .rs-shell-main { margin-left: 0; }
  .rs-shell-main.sidebar-collapsed { margin-left: 0; }
  .rs-shell-overlay.visible { display: block; }
  .rs-shell-topbar { min-height: 72px; padding: 10px 14px; }
  .rs-shell-content { padding-inline: 14px; }
  .rs-shell-context-text { max-width: 52vw; }
  body.rs-shell-active .main { padding-top: 22px !important; }
}

@media (max-width: 600px) {
  .rs-shell-wordmark { font-size: 1.02rem; }
  .rs-shell-context-text { font-size: .61rem; letter-spacing: .08em; }
  .rs-shell-icon-button { width: 44px; height: 44px; }
  body.rs-shell-active .directory-hero { padding: 24px 20px !important; }
  body.rs-shell-active .page-title,
  body.rs-shell-active .hero h1,
  body.rs-shell-active .blog-hero h1 { font-size: clamp(2rem, 11vw, 3rem) !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
