.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink);
  background: var(--white);
}
.theme-toggle:hover { background: var(--mist); }
.theme-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -8px 0 -3px, 0 8px 0 -3px, -8px 0 0 -3px, 8px 0 0 -3px,
    -6px -6px 0 -3px, 6px -6px 0 -3px, -6px 6px 0 -3px, 6px 6px 0 -3px;
}
.theme-toggle[aria-pressed=true] { color: var(--blue); background: var(--mist); }
.theme-toggle[aria-pressed=true] .theme-icon {
  width: 16px;
  height: 16px;
  box-shadow: none;
  mask-image: radial-gradient(circle at 77% 23%, transparent 0 7px, #000 7.5px);
}
:root[data-theme=dark] {
  color-scheme: dark;
  --paper: #101929;
  --white: #17243a;
  --ink: #edf4ff;
  --muted: #b4c4da;
  --rule: #354761;
  --blue: #9bc8ff;
  --dark: #09172b;
  --mist: #223856;
  --accent: #174fb4;
  --theme-red: #ffabb0;
  --theme-red-bg: #402530;
  --map-surface: #13233b;
  --map-none: #304765;
  --map-low: #406492;
  --map-medium: #5787c1;
  --map-high: #79a8e3;
  --map-very-high: #abd3ff;
  --map-selected: #c0dfff;
  --map-border: #172a46;
}
[data-theme=dark] :focus-visible { outline-color: var(--sky); }
[data-theme=dark] :is(.btn-primary, .brand-mark) { background: var(--accent); }
[data-theme=dark] .btn-primary { color: #fff; }
[data-theme=dark] .btn-primary:hover { background: #245caf; }
[data-theme=dark] :is(.hero, .hero-report, .published-metric strong) { color: #f5f9ff; }
[data-theme=dark] .published-list .published-card,
[data-theme=dark] :is(.map-controls, .department-picker select, .map-caption, .flow-dialog, .flow-dialog input, .flow-dialog select, .flow-dialog textarea) {
  background: var(--white);
}
[data-theme=dark] :is(.steps li, .step-art, .search-input, .filters button[aria-pressed=true], .flow-dialog input, .flow-dialog select, .flow-dialog textarea, .legal-form input, .legal-form select, .legal-form textarea) {
  border-color: var(--rule);
}
[data-theme=dark] .search-input:focus-within { border-color: var(--blue); }
[data-theme=dark] :is(.hero-privacy, .results-note, .step-art) { background: var(--mist); color: var(--muted); border-color: var(--rule); }
[data-theme=dark] .step-art { color: var(--blue); }
[data-theme=dark] .how-section { background: linear-gradient(150deg, #182c47, var(--paper) 75%); }
[data-theme=dark] .resources a,
[data-theme=dark] :is(.flow-status, .flow-notice) { color: var(--blue); }
[data-theme=dark] .chart-track { background: var(--rule); }
[data-theme=dark] .chart-track span { background: var(--blue); }
[data-theme=dark] .listing-amount strong { color: var(--theme-red); }
[data-theme=dark] :is(.listing-company-status[data-status=liquidation], .listing-company-status[data-status=closed], .listing-company-status[data-status=liquidated], .flow-error) {
  background: var(--theme-red-bg);
  color: var(--theme-red);
}

@media (min-width: 621px) and (max-width: 1050px) {
  .header-inner:has(.site-nav) { flex-wrap: wrap; row-gap: 0; padding-block: 7px; }
  .header-inner .site-nav { order: 3; flex-basis: 100%; flex-wrap: wrap; gap: 6px 16px; padding-block: 5px; }
}
