/* Research library, using the shared About page design tokens. */
.research-page .research-shell {
  --research-muted: #686156;
  color: var(--about-ink);
}

:is(:root[data-theme="dark"], html.dark) .research-page .research-shell {
  --research-muted: #d6cdd4;
}

.research-shell .research-hero {
  padding-bottom: clamp(36px, 5vw, 70px);
}

.research-shell .research-hero p {
  max-width: 65ch;
  margin-top: clamp(20px, 2.3vw, 32px);
  font-size: clamp(19px, 1.8vw, 25px);
  line-height: 1.5;
}

.research-shell .research-layout {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: clamp(30px, 4.5vw, 64px);
  margin: 0;
  padding: clamp(24px, 3vw, 42px) 0 0;
  border-top: 1px solid var(--about-line);
}

.research-shell .research-sidebar {
  position: sticky;
  top: calc(var(--header-offset) + 24px);
  max-height: calc(100dvh - var(--header-offset) - 48px);
  overflow-y: auto;
  border: 0;
  padding: 0 4px 6px 0;
}

.research-shell .side-nav { gap: 5px; }
.research-shell .side-section {
  margin: 24px 12px 7px;
  font: 700 12px/1.4 "Avenir Next", Inter, system-ui, sans-serif;
  letter-spacing: .08em;
  color: var(--research-muted);
}

.research-shell .side-link {
  display: block;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
}

.research-shell .side-link:hover { background: var(--about-line); }
.research-shell .side-link.active {
  background: var(--about-ink);
  color: var(--about-paper) !important;
}

.research-shell .research-main { min-width: 0; }
.research-shell .research-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  margin: 0 0 22px;
}

.research-shell .tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.research-shell .tab,
.research-shell .research-clear,
.research-shell .research-sort,
.research-shell .research-search {
  box-sizing: border-box;
  min-height: 46px;
  border: 1px solid var(--about-line);
  color: var(--about-ink);
  background-color: var(--about-card);
  font: 600 15px/1.4 "Avenir Next", Inter, system-ui, sans-serif;
  box-shadow: none;
}

.research-shell .tab {
  padding: 10px 18px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.research-shell .tab:hover { background: var(--about-line); }
.research-shell .tab.active {
  background: var(--about-ink);
  border-color: var(--about-ink);
  color: var(--about-paper) !important;
}

.research-shell :is(.tab, .research-clear, .research-search, .research-sort):focus-visible {
  outline: 3px solid var(--about-focus);
  outline-offset: 3px;
}

.research-shell .tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.research-shell .research-search {
  width: 100%;
  min-width: 0;
  padding: 12px 14px 12px 42px;
  border-radius: 12px;
  background-position: 14px center;
  background-size: 18px;
  font-weight: 500;
}

.research-shell .research-search::placeholder { color: var(--research-muted); opacity: 1; }
.research-shell .research-clear {
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
}
.research-shell .research-clear:hover { background: var(--about-line); }
.research-shell .research-sort { max-width: 100%; padding: 10px 12px; border-radius: 12px; }
.research-shell .result-count {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 600;
  color: var(--research-muted) !important;
}

.research-shell .research-list { display: block; margin: 0; }
.research-shell .research-item {
  position: relative;
  padding: clamp(24px, 2.7vw, 36px) 0;
  border-top: 1px solid var(--about-line);
  background: transparent;
}
.research-shell .research-item:hover { background: transparent; }
.research-shell .research-item .meta {
  margin: 0 0 10px;
  font: 600 13px/1.5 "Avenir Next", Inter, system-ui, sans-serif;
  color: var(--research-muted);
}
.research-shell .research-item h2 {
  margin: 0;
  max-width: 38ch;
  font-size: clamp(23px, 2vw, 29px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.025em;
  text-align: left;
}
.research-shell .research-item h2 a { text-decoration: none; }
.research-shell .research-item h2 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.research-shell .research-item p {
  margin-top: 12px;
  max-width: 65ch;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.55;
}
.research-shell .research-empty {
  padding: 28px 0;
  border-top: 1px solid var(--about-line);
}
.research-shell .research-empty[hidden] { display: none !important; }
.research-shell .research-disclaimer {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--about-line);
  font-size: 14px;
  line-height: 1.55;
  color: var(--research-muted) !important;
}

/* Owned evidence reviews and their source library. */
.research-shell .research-hero-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 24px; font-size: 17px; }
.research-shell .research-hero .research-update {
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--research-muted) !important;
}
.research-shell .research-update a { text-underline-offset: 3px; }
.research-shell .research-language-note { margin: 0 0 30px; padding-left: 16px; border-left: 3px solid var(--about-line); font-size: 16px; max-width: 70ch; }
.research-shell .research-read-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 16px; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; }
.research-shell [data-record][hidden] { display: none !important; }
.research-shell .research-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 32px; font-size: 14px; line-height: 1.5; }
.research-shell .research-breadcrumb a { text-underline-offset: 3px; }
.research-reader .research-hero h1 { max-width: 24ch; font-size: clamp(38px, 4.8vw, 68px); line-height: 1.07; }
.research-reader .research-hero p { max-width: 64ch; font-size: clamp(19px, 1.7vw, 23px); }
.research-reader .research-reading { min-width: 0; max-width: 76ch; }
.research-shell .research-section { margin-bottom: 40px; scroll-margin-top: calc(var(--header-offset) + 24px); }
.research-shell .research-section h2,
.research-shell .research-references > h2,
.research-shell .research-related > h2 {
  margin-bottom: 18px;
  font-size: clamp(27px, 2.5vw, 35px);
  line-height: 1.16;
  letter-spacing: -.025em;
  font-weight: 800;
}
.research-shell .research-section h3 { margin: 30px 0 12px; font-size: 23px; line-height: 1.2; font-weight: 750; }
.research-shell .research-reading p,
.research-shell .research-document p { font-size: 18px; line-height: 1.7; }
.research-shell .research-section p + p { margin-top: 18px; }
.research-shell .research-section .research-citations {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--research-muted) !important;
}
.research-shell .research-citations a { color: var(--about-focus) !important; text-underline-offset: 3px; }
.research-shell .research-references { padding-top: 32px; border-top: 1px solid var(--about-line); scroll-margin-top: calc(var(--header-offset) + 24px); }
.research-shell .research-reference { padding: 26px 0; border-top: 1px solid var(--about-line); scroll-margin-top: calc(var(--header-offset) + 24px); }
.research-shell .research-reference .meta { margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--research-muted) !important; }
.research-shell .research-reference .research-reference__citation { font-size: 16px; font-weight: 500; line-height: 1.65; overflow-wrap: anywhere; }
.research-shell .research-source-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 14px 0; }
.research-shell .research-source-links a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; text-underline-offset: 3px; }
.research-shell .research-source-links svg { flex: none; }
.research-shell .research-reference .research-source-access,
.research-shell .research-reference-note { font-size: 13px; line-height: 1.6; color: var(--research-muted) !important; }
.research-shell .research-context { margin-top: 16px; }
.research-shell .research-context summary { width: fit-content; cursor: pointer; font-size: 15px; font-weight: 650; text-underline-offset: 3px; }
.research-shell .research-context summary:focus-visible { outline: 3px solid var(--about-focus); outline-offset: 4px; }
.research-shell .research-context[open] summary { margin-bottom: 18px; }
.research-shell .research-context dl { margin: 0; font-size: 15px; line-height: 1.6; }
.research-shell .research-context dl > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--about-line); }
.research-shell .research-context dt { font-weight: 650; }
.research-shell .research-context dd { margin: 0; }
.research-shell .research-context p { margin-top: 18px; font-size: 15px; line-height: 1.6; }
.research-shell .research-related { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--about-line); }
.research-shell .research-related ul { list-style: none; padding: 0; }
.research-shell .research-related li + li { margin-top: 14px; }
.research-shell .research-related a { display: inline-flex; align-items: center; gap: 8px; text-underline-offset: 4px; }
.research-shell .research-document { max-width: 76ch; margin: 0 auto; padding-top: 32px; border-top: 1px solid var(--about-line); }
.research-shell .research-source-library { max-width: 1000px; }
.research-shell .research-glossary { margin: 0 0 40px; }
.research-shell .research-glossary > div { padding: 24px 0; border-bottom: 1px solid var(--about-line); }
.research-shell .research-glossary dt { font-size: 24px; font-weight: 800; line-height: 1.2; }
.research-shell .research-glossary dd { margin: 12px 0 0; font-size: 18px; line-height: 1.6; }

@media (max-width: 960px) {
  .research-shell .research-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .research-shell .research-sidebar { position: static; max-height: none; overflow: visible; padding: 0; }
  .research-shell .side-nav { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .research-shell .side-section { width: 100%; margin: 14px 0 2px; }
  .research-shell .side-link { padding: 9px 13px; border: 1px solid var(--about-line); border-radius: 999px; font-size: 14px; }
  .research-shell .research-item h2 { max-width: 42ch; }
}

@media (max-width: 540px) {
  .research-shell .research-hero p { font-size: 18px; }
  .research-shell .research-sidebar { min-width: 0; }
  .research-shell .side-nav {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding: 3px 3px 10px;
    scrollbar-width: thin;
  }
  .research-shell .side-section { display: none; }
  .research-shell .side-link { flex: none; white-space: nowrap; }
  .research-shell .tools { grid-template-columns: minmax(0, 1fr) auto; }
  .research-shell .research-sort { grid-column: 1 / -1; width: 100%; }
  .research-shell .tab { padding: 9px 13px; font-size: 14px; }
  .research-shell .research-item h2 { font-size: 24px; }
  .research-shell .research-breadcrumb { margin-bottom: 24px; }
  .research-reader .research-hero h1 { font-size: 38px; }
  .research-shell .research-reading p, .research-shell .research-document p { font-size: 17px; line-height: 1.65; }
  .research-shell .research-context dl > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

@media (max-width: 360px) {
  .research-page .ws-logo__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}
