.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"] .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;
}

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;
  }
}
