/* stylelint-disable no-descending-specificity, rule-empty-line-before, at-rule-empty-line-before */
:root {
  --dw-bg: #f6f8fb;
  --dw-surface: #fff;
  --dw-surface-muted: #f0f0f2;
  --dw-border: #e7e8ec;
  --dw-border-strong: #d9dbe1;
  --dw-text-strong: #1a1b1f;
  --dw-text: #2c2e35;
  --dw-text-muted: #6f737c;
  --dw-text-soft: #a4a6ae;
  --dw-blue: #3f72c9;
  --dw-blue-bright: #6ba3fb;
  --dw-blue-tint: rgb(107 163 251 / 8%);
  --dw-blue-tint-strong: rgb(107 163 251 / 16%);
  --dw-code-bg: #1a1b1f;
  --dw-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', roboto, sans-serif;
  --dw-mono: ui-monospace, sfmono-regular, 'SF Mono', menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --dw-bg: #0f1117;
    --dw-surface: #181a22;
    --dw-surface-muted: #1f2130;
    --dw-border: #2a2d3a;
    --dw-border-strong: #343847;
    --dw-text-strong: #f0f1f5;
    --dw-text: #c8cad4;
    --dw-text-muted: #7b7f8e;
    --dw-text-soft: #555870;
    --dw-blue: #5d8fef;
    --dw-blue-bright: #7aa8f7;
  }
  body .dw-topbar {
    background: rgb(15 17 23 / 88%);
  }
}
* { box-sizing: border-box; }
html,
body {
  margin: 0;
  padding: 0;
}
body {
  overflow-x: hidden;
  font-family: var(--dw-font);
  color: var(--dw-text);
  background: var(--dw-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
}
a {
  color: var(--dw-blue);
}
.dw-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgb(255 255 255 / 86%);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--dw-border);
}
.dw-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--dw-text-strong);
  text-decoration: none;
  white-space: nowrap;
}
.dw-brand-mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(155deg, var(--dw-blue-bright), var(--dw-blue));
  box-shadow: 0 2px 6px rgb(63 114 201 / 35%);
}
.dw-topbar-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}
.dw-topbar-actions a {
  color: var(--dw-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.dw-topbar-actions a:hover {
  color: var(--dw-text-strong);
}
@media (width <= 480px) {
  /* The topbar is a flex row whose children cannot shrink (brand and links
     are nowrap so labels never break mid-word). Below the row's natural min
     width the only non-overflowing option is to wrap: the nav drops to a
     second row, so the document never scrolls horizontally regardless of
     which font (Inter or a wider fallback) is active. */
  .dw-topbar {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 12px 16px;
  }
  .dw-topbar-actions {
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 12px;
  }
  .dw-topbar-actions a {
    white-space: nowrap;
  }
}
.dw-shell {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 44px;
  align-items: start;
}
@media (width <= 980px) {
  .dw-shell {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
.dw-main { min-width: 0; }
.dw-report-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--dw-border);
}
.dw-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dw-blue);
  margin-bottom: 12px;
}
.dw-report-title {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--dw-text-strong);
  margin: 0 0 12px;
}
.dw-report-lead {
  font-size: 15px;
  line-height: 1.55;
  color: var(--dw-text-muted);
  margin: 0 0 18px;
  max-width: 62ch;
}
.dw-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 12.5px;
  color: var(--dw-text-muted);
}
.dw-meta-row .dw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--dw-surface);
  border: 1px solid var(--dw-border);
}
.dw-meta-row .dw-chip strong {
  color: var(--dw-text-strong);
  font-weight: 700;
}

/* "Sources" button: the only entry point to the full source list on drawer
   viewports. Emitted by renderReport with chip anatomy (class="dw-chip
   dw-sources-open") and only when the report has sources; hidden unless the
   drawer exists, i.e. JS is on and the viewport is <= 980px — that visibility
   rule lives in the drawer media block further down. Desktop and no-JS pages
   (sources in flow below the article) never show it. */
.dw-meta-row .dw-sources-open {
  display: none;
}

/* Download controls in the meta row. Token-based so dark mode inverts
   correctly; light mode matches the previous inline-styled look (28px pill,
   12px/600 label). */
.dw-pdf-btn,
.dw-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  margin-left: 8px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.dw-pdf-btn {
  border: none;
  color: var(--dw-bg);
  background: var(--dw-text-strong);
}
.dw-signin-btn {
  color: var(--dw-text-strong);
  border: 1px solid var(--dw-border-strong);
  background: var(--dw-surface);
}
.dw-signin-btn:hover {
  border-color: var(--dw-text-soft);
}
.dw-article {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.68;
  color: var(--dw-text);
  overflow-wrap: break-word;
}
.dw-article > :first-child {
  margin-top: 0;
}
.dw-article h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--dw-text-strong);
  margin: 8px 0 18px;
}
.dw-article h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--dw-text-strong);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--dw-border);
}
.dw-article h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--dw-text-strong);
  margin: 26px 0 12px;
}
.dw-article h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dw-text-strong);
  margin: 20px 0 8px;
}
.dw-article p {
  margin: 22px 0;
}
.dw-article a {
  font-weight: 600;
  color: var(--dw-blue);
  text-decoration: underline;
  text-decoration-color: rgb(63 114 201 / 35%);
  text-underline-offset: 2px;
}
.dw-article a:hover {
  color: var(--dw-blue-bright);
}
.dw-article strong {
  font-weight: 700;
  color: var(--dw-text-strong);
}
.dw-article ul,
.dw-article ol {
  margin: 16px 0;
  padding-left: 26px;
}
.dw-article ul {
  list-style: disc;
}
.dw-article ol {
  list-style: decimal;
}
.dw-article li {
  margin: 8px 0;
  padding-left: 4px;
}
.dw-article hr {
  border: none;
  border-top: 1px solid var(--dw-border);
  margin: 32px 0;
}
.dw-article blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border-left: 4px solid rgb(63 114 201 / 40%);
  background: var(--dw-surface);
  border-radius: 0 8px 8px 0;
  color: var(--dw-text-muted);
}
.dw-article blockquote p {
  margin: 6px 0;
}
.dw-article code {
  font-family: var(--dw-mono);
  font-size: 0.9em;
  font-weight: 600;
  background: var(--dw-surface-muted);
  color: var(--dw-text-strong);
  padding: 2px 6px;
  border-radius: 5px;
}
.dw-article pre {
  margin: 20px 0;
  padding: 16px 18px;
  background: var(--dw-code-bg);
  border-radius: 12px;
  overflow-x: auto;
}
.dw-article pre code {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.65;
  background: transparent;
  color: #f4f5f7;
  padding: 0;
}
.dw-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 13px;
  border: 1px solid var(--dw-border-strong);
  border-radius: 10px;
  display: block;
  overflow: auto hidden;
}
.dw-article th,
.dw-article td {
  border: 1px solid var(--dw-border-strong);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}
.dw-article th {
  background: var(--dw-surface-muted);
  font-weight: 700;
  color: var(--dw-text-strong);
}
.dw-article td {
  background: var(--dw-surface);
  color: var(--dw-text-muted);
}
.dw-article sup.cite {
  font-size: 10px;
  font-weight: 600;
  color: var(--dw-blue);
  margin-left: 1px;
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease;
}
.dw-article sup.cite:hover,
.dw-article sup.cite.is-active {
  color: var(--dw-blue-bright);
}
.dw-article sup.cite.is-pinned {
  color: #fff;
  background: var(--dw-blue);
  border-radius: 999px;
  padding: 0 4px;
  font-weight: 600;
}

/* Citations are the primary tap target on touch devices; 10px text with 1px
   margin is far below a usable hit area. Vertical padding on an inline element
   grows the hit box without growing the line box, so paragraph rhythm is
   untouched. Placed after the is-pinned rule (equal specificity on the
   compound selector) so the larger target also applies while pinned. */
@media (pointer: coarse) {
  .dw-article sup.cite,
  .dw-article sup.cite.is-pinned {
    font-size: 12px;
    padding: 3px 5px;
    margin-left: 2px;
    border-radius: 8px;
  }
}
.dw-article [id^='para-'] {
  transition: background 0.12s ease, box-shadow 0.12s ease;
  scroll-margin-top: 80px;
}
.dw-article p[id^='para-'],
.dw-article li[id^='para-'] {
  border-left: 2px solid transparent;
  margin-left: -14px;
  padding-left: 12px;
}
.dw-article p.is-active,
.dw-article li.is-active {
  border-left-color: var(--dw-blue-bright);
  background: var(--dw-blue-tint);
}
.dw-article p.is-pinned,
.dw-article li.is-pinned {
  border-left-color: var(--dw-blue);
  border-left-width: 3px;
  background: var(--dw-blue-tint-strong);
}
.dw-article td.is-active,
.dw-article th.is-active {
  background: var(--dw-blue-tint);
  box-shadow: inset 0 0 0 2px rgb(107 163 251 / 40%);
}
.dw-article td.is-pinned,
.dw-article th.is-pinned {
  background: var(--dw-blue-tint-strong);
  box-shadow: inset 0 0 0 3px rgb(63 114 201 / 55%);
}
.dw-sources {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}
.dw-sources-backdrop {
  display: none;
}

/* Scroll lock while the sources drawer is open: the drawer is position:fixed
   over a scrollable body, so without this the page underneath keeps scrolling.
   The class is toggled on <html> by research-report-client.js. */
html.dw-drawer-open,
html.dw-drawer-open body {
  overflow: hidden;
}
@media (width <= 980px) {
  .dw-sources {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
  .js .dw-sources {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1200;
    width: min(88vw, 360px);
    height: 100dvh;
    max-height: none;
    overflow-y: auto;
    background: var(--dw-surface);
    border-left: 1px solid var(--dw-border);
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .js .dw-sources.is-open {
    box-shadow: -18px 0 40px rgb(15 23 42 / 14%);
    transform: translateX(0);
  }
  .js .dw-sources-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgb(15 23 42 / 45%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .js .dw-sources-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Reveal the "Sources" drawer button (chip anatomy from .dw-chip; only the
     deltas live here: blue palette, tappable affordance, button font resets). */
  .js .dw-sources-open {
    display: inline-flex;
    border-color: var(--dw-blue);
    background: var(--dw-blue-tint);
    color: var(--dw-blue);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }
  .js .dw-sources-open strong {
    color: inherit;
  }
  .js .dw-sources-open:hover {
    background: var(--dw-blue-tint-strong);
  }
}
.dw-sources-card {
  background: var(--dw-surface);
  border: 1px solid var(--dw-border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgb(15 23 42 / 4%);
}
@media (width <= 980px) {
  .js .dw-sources-card {
    min-height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
}
.dw-sources-head {
  position: sticky;
  top: 0;
  padding: 16px 18px 12px;
  background: var(--dw-surface);
  border-bottom: 1px solid var(--dw-border);
}
.dw-sources-close {
  display: none;
}
@media (width <= 980px) {
  .js .dw-sources-head {
    padding-right: 58px;
  }
  .js .dw-sources-close {
    position: absolute;
    top: 12px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--dw-border);
    border-radius: 8px;
    background: var(--dw-surface-muted);
    color: var(--dw-text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }
  .js .dw-sources-close:hover {
    color: var(--dw-text-strong);
    border-color: var(--dw-border-strong);
  }
}
.dw-sources-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dw-text-strong);
}
.dw-sources-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--dw-text-soft);
}
.dw-sources-list {
  list-style: none;
  margin: 0;
  padding: 8px;
}
.dw-source {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.12s ease, box-shadow 0.12s ease;

  /* Spacing lives on the card itself, not the wrapping <li>: a hidden card
     (display:none) then contributes no margin, so the focused set collapses
     together while keeping a clean 12px gap between the cards that remain. */
  margin-bottom: 12px;
}
.dw-source:hover {
  background: var(--dw-blue-tint);
}
.dw-source.is-active {
  background: var(--dw-blue-tint);
  box-shadow: inset 0 0 0 1px rgb(107 163 251 / 45%);
}
.dw-source.is-pinned {
  background: var(--dw-blue-tint-strong);
  box-shadow: inset 0 0 0 1.5px rgb(63 114 201 / 55%);
}
.dw-source.is-dimmed {
  opacity: 0.3;
  transition: background 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease;
}
.dw-source.is-hidden {
  display: none;
}
.dw-source-index {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--dw-surface-muted);
  color: var(--dw-text-muted);
  font-size: 11px;
  font-weight: 700;
}
.dw-source.is-active .dw-source-index,
.dw-source.is-pinned .dw-source-index {
  background: var(--dw-blue);
  color: #fff;
}
.dw-source-body {
  min-width: 0;
}
.dw-source-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--dw-text-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dw-source-domain {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--dw-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dw-sources-empty {
  padding: 18px;
  font-size: 13px;
  color: var(--dw-text-soft);
}
.dw-sources-hint {
  font-size: 11.5px;
  color: var(--dw-text-soft);
  margin: 6px 4px 4px;
  display: block;
  line-height: 1.5;
}
.dw-sources-hint.is-hidden { display: none; }
.dw-footer {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  font-size: 12px;
  color: var(--dw-text-soft);
  border-top: 1px solid var(--dw-border);
  text-align: center;
}
@media (width <= 640px) {
  .dw-shell {
    padding: 28px 16px 64px;
  }
  .dw-footer {
    padding: 28px 16px 48px;
  }
}
.dw-footer a {
  color: var(--dw-text-muted);
  text-decoration: none;
  font-weight: 600;
}

/* PDF download modal (built by research-report-pdf.js for signed-in users).
   Token-based so the modal follows the page theme instead of flashing a
   light-theme box on a dark page. Confirm mirrors .dw-pdf-btn. */
.dw-pdf-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(15 23 42 / 45%);
}
.dw-pdf-modal {
  width: 90%;
  max-width: 340px;
  padding: 28px;
  border: 1px solid var(--dw-border);
  border-radius: 16px;
  background: var(--dw-surface);
  box-shadow: 0 8px 32px rgb(0 0 0 / 18%);
}
.dw-pdf-modal h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--dw-text-strong);
}
.dw-pdf-modal p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--dw-text-muted);
}
.dw-pdf-modal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--dw-text);
  cursor: pointer;
}
.dw-pdf-modal-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--dw-blue);
}
.dw-pdf-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.dw-pdf-modal-cancel,
.dw-pdf-modal-confirm {
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.dw-pdf-modal-cancel {
  border: 1px solid var(--dw-border-strong);
  background: var(--dw-surface);
  color: var(--dw-text);
}
.dw-pdf-modal-cancel:hover {
  border-color: var(--dw-text-soft);
}
.dw-pdf-modal-confirm {
  border: none;
  background: var(--dw-text-strong);
  color: var(--dw-bg);
}
@media (prefers-reduced-motion: reduce) {
  .dw-article [id^='para-'],
  .dw-source,
  .dw-source.is-dimmed,
  .dw-article sup.cite,
  .dw-sources,
  .dw-sources-backdrop,
  .dw-sources-hint {
    transition: none;
  }
}
