.research-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.research-toolbar .breadcrumb {
  margin: 0;
}

.color-mode-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(6, 19, 31, 0.4);
  background: var(--paper, #ffffff);
  color: var(--ink, #06131f);
  font-family: var(--font-mono, "SF Mono", Menlo, Consolas, monospace);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.color-mode-toggle:hover,
.color-mode-toggle:focus-visible {
  border-color: var(--signal, #0b63ce);
  color: var(--signal, #0b63ce);
  outline: 2px solid var(--signal, #0b63ce);
  outline-offset: 2px;
}

.color-mode-toggle-icon {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.color-mode-toggle-icon::after {
  position: absolute;
  inset: 2px 2px 2px 5px;
  border-radius: 0 999px 999px 0;
  background: currentColor;
  content: "";
}

html[data-color-mode="light"] {
  color-scheme: light;
}

html[data-color-mode="dark"] {
  color-scheme: dark;
  --ink: #edf4fa;
  --paper: #0d1b28;
  --line: #2b4154;
  --muted: #afbdc9;
  --signal: #7cbcff;
  background: #07121c;
}

html[data-color-mode="dark"] body {
  background: #07121c;
  color: var(--ink);
}

html[data-color-mode="dark"] .site-header {
  background: #091722;
  box-shadow: inset 0 -1px 0 rgba(237, 244, 250, 0.16);
}

html[data-color-mode="dark"] .site-header .brand-lockup,
html[data-color-mode="dark"] .site-header .brand-symbol,
html[data-color-mode="dark"] .site-header .brand-wordmark {
  filter: brightness(0) invert(1);
}

html[data-color-mode="dark"] .site-header .nav-menu {
  border-color: rgba(237, 244, 250, 0.42);
  background: var(--paper);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
}

html[data-color-mode="dark"] .site-header .nav-group:hover .nav-trigger,
html[data-color-mode="dark"] .site-header .nav-group:focus-within .nav-trigger,
html[data-color-mode="dark"] .site-header .nav-group.is-open .nav-trigger,
html[data-color-mode="dark"] .site-header .nav-direct:hover,
html[data-color-mode="dark"] .site-header .nav-direct:focus-visible {
  border-color: rgba(124, 188, 255, 0.52);
}

html[data-color-mode="dark"] .site-header .translate-slot select {
  border-color: rgba(237, 244, 250, 0.3);
  background-color: rgba(13, 27, 40, 0.92);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='4' viewBox='0 0 6 4'%3E%3Cpath d='M0 0h6L3 4z' fill='%23edf4fa'/%3E%3C/svg%3E");
}

html[data-color-mode="dark"] .site-header .translate-slot select:hover,
html[data-color-mode="dark"] .site-header .translate-slot select:focus-visible,
html[data-color-mode="dark"] .site-header .translate-slot option {
  background-color: var(--paper);
}

html[data-color-mode="dark"] .color-mode-toggle {
  border-color: rgba(237, 244, 250, 0.4);
}

html[data-color-mode="dark"] .article-thumb,
html[data-color-mode="dark"] .article-body figure {
  border-color: rgba(237, 244, 250, 0.18);
  background: rgba(237, 244, 250, 0.05);
}

html[data-color-mode="dark"] .slide-deck-track {
  border-color: rgba(237, 244, 250, 0.2);
  background: #10202e;
}

html[data-color-mode="dark"] .slide-deck-slide figcaption,
html[data-color-mode="dark"] .slide-deck-controls button,
html[data-color-mode="dark"] .slide-deck-actions a {
  border-color: rgba(237, 244, 250, 0.2);
  background: var(--paper);
}

html[data-color-mode="dark"] .article-markdown-table th,
html[data-color-mode="dark"] .comparison-table thead th,
html[data-color-mode="dark"] .comparison-table tbody th {
  background: #162a3b;
}

html[data-color-mode="dark"] .article-cta {
  background: linear-gradient(180deg, rgba(124, 188, 255, 0.09), rgba(124, 188, 255, 0.025));
}

html[data-color-mode="dark"] .article-cta-button.primary {
  border-color: #7cbcff;
  background: #0b63ce;
  color: #ffffff;
}

html[data-color-mode="dark"] .article-body pre {
  background: #10202e;
}

.article-note {
  margin: 22px 0;
  padding: 18px 20px;
  scroll-margin-top: 24px;
  border: 1px solid #d8c78f;
  border-left: 4px solid #a57713;
  border-radius: 10px;
  background: #fffaf0;
  box-shadow: 0 8px 24px rgba(63, 45, 8, 0.06);
}

.article-note:target {
  outline: 3px solid rgba(165, 119, 19, 0.28);
  outline-offset: 3px;
}

.article-note-label,
.qa-kind {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.05em;
}

.article-note-label {
  margin: 0 8px 8px 0;
  background: #f2e2b8;
  color: #674807;
}

.article-note-title {
  display: inline;
  color: #332407;
}

.article-note-body {
  margin-top: 4px;
  color: #51462f;
  font-size: 0.94em;
  line-height: 1.8;
}

.article-note-ref {
  white-space: nowrap;
  color: #8a5f08;
  font-size: 0.82em;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-notes {
  margin: 34px 0;
}

.article-notes > h3 {
  margin-bottom: 14px;
}

.article-faq {
  margin: 48px 0 28px;
}

.article-faq > h2 {
  margin-bottom: 22px;
}

.faq-list {
  display: grid;
  gap: 18px;
}

.faq-item {
  overflow: hidden;
  border: 1px solid #b9d3ec;
  border-radius: 12px;
  background: #f8fbfe;
  box-shadow: 0 10px 28px rgba(6, 19, 31, 0.06);
}

.faq-question {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #cbddec;
  background: #edf6fd;
}

.faq-question h3 {
  flex: 1;
  margin: 1px 0 0;
  font-size: 1.02em;
  line-height: 1.6;
}

.faq-answer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 16px 18px 18px;
}

.faq-answer-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d8efe2;
  color: #185c38;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.05em;
}

.faq-answer-content {
  min-width: 0;
}

.faq-answer-content > :first-child {
  margin-top: 0;
}

.faq-answer-content > :last-child {
  margin-bottom: 0;
}

.transcript-qa {
  margin: 48px 0 28px;
}

.transcript-qa > h2 {
  margin-bottom: 22px;
}

.qa-turns {
  display: grid;
  gap: 18px;
}

.qa-turn {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(6, 19, 31, 0.06);
}

.qa-turn.qa-question {
  border-color: #b9d3ec;
  background: #f3f8fd;
}

.qa-turn.qa-answer {
  border-color: #b8d9ca;
  background: #f3faf6;
}

.qa-turn.qa-moderator {
  background: #f6f7f8;
}

.qa-speaker {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-bottom: 1px solid currentColor;
  border-color: rgba(6, 19, 31, 0.1);
}

.qa-kind {
  background: #dbeaf7;
  color: #174f7f;
}

.qa-answer .qa-kind {
  background: #d8efe2;
  color: #185c38;
}

.qa-moderator .qa-kind {
  background: #e4e7ea;
  color: #48535c;
}

.qa-content {
  padding: 16px 18px 18px;
}

.qa-content > :first-child {
  margin-top: 0;
}

.qa-content > :last-child {
  margin-bottom: 0;
}

.qa-content .article-note {
  background: rgba(255, 250, 240, 0.78);
}

html[data-color-mode="dark"] .article-note {
  border-color: #8b7035;
  border-left-color: #d7aa49;
  background: #2a2418;
  box-shadow: none;
}

html[data-color-mode="dark"] .article-note-label {
  background: #59491f;
  color: #f2d892;
}

html[data-color-mode="dark"] .article-note-title {
  color: #f7e8bd;
}

html[data-color-mode="dark"] .article-note-body {
  color: #dfd4b8;
}

html[data-color-mode="dark"] .article-note-ref {
  color: #f0c768;
}

html[data-color-mode="dark"] .faq-item {
  border-color: #315f82;
  background: #132433;
  box-shadow: none;
}

html[data-color-mode="dark"] .faq-question {
  border-color: #315f82;
  background: #12283a;
}

html[data-color-mode="dark"] .faq-answer-label {
  background: #24523a;
  color: #ccefd9;
}

html[data-color-mode="dark"] .qa-turn,
html[data-color-mode="dark"] .qa-turn.qa-moderator {
  border-color: rgba(237, 244, 250, 0.22);
  background: #132433;
  box-shadow: none;
}

html[data-color-mode="dark"] .qa-turn.qa-question {
  border-color: #315f82;
  background: #12283a;
}

html[data-color-mode="dark"] .qa-turn.qa-answer {
  border-color: #32664b;
  background: #132c22;
}

html[data-color-mode="dark"] .qa-speaker {
  border-color: rgba(237, 244, 250, 0.14);
}

html[data-color-mode="dark"] .qa-kind {
  background: #234b6a;
  color: #cce7fb;
}

html[data-color-mode="dark"] .qa-answer .qa-kind {
  background: #24523a;
  color: #ccefd9;
}

html[data-color-mode="dark"] .qa-moderator .qa-kind {
  background: #334553;
  color: #e1e9ef;
}

html[data-color-mode="dark"] .qa-content .article-note {
  background: rgba(42, 36, 24, 0.7);
}

html[data-color-mode="dark"] .argument-flow-card,
html[data-color-mode="dark"] .visual-card {
  background: #102536;
}

html[data-color-mode="dark"] .site-footer {
  background: linear-gradient(180deg, #0d1b28 0%, #07121c 62%);
  box-shadow: inset 0 1px 0 rgba(237, 244, 250, 0.12);
}

@media (max-width: 420px) {
  .research-toolbar {
    align-items: flex-start;
  }

  .article-note {
    padding: 15px 16px;
  }

  .faq-question {
    padding: 12px 14px;
  }

  .faq-answer {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .faq-answer-label {
    justify-self: start;
  }

  .qa-speaker {
    padding: 11px 14px;
  }

  .qa-content {
    padding: 14px;
  }
}
