:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e4eeeb;
  --muted: #a6b8ba;
  --green: #8ad6b4;
  --line: #2b4148;
  --paper: #0d191f;
  --soft: #15272e;
}
body { background: var(--paper); color: var(--ink); }
select, fieldset input, dialog { background: var(--paper); color: var(--ink); }
.theme-control { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: .75rem; color: var(--muted); }
.theme-control select { padding: 8px; font-size: .8rem; }
:is(button,a,input,select,summary):focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
[data-theme="dark"] :is(.topbar,.field-note,.coverage-strip,.hero-photo,.news-photo,.learning-photo) { background: #102a33; }
[data-theme="dark"] :is(.button.secondary,.learning-list button,.channel-card,.channel-library .search) { background: var(--paper); }
[data-theme="dark"] :is(.search,.ad-slot,.catalog-disclosure) { background: var(--soft); }
[data-theme="dark"] :is(.status,.calculation-result,.tabs button span) { background: #183d32; color: #a4e8cd; }
[data-theme="dark"] .status.caution { background: #403621; color: #f0d28f; }
[data-theme="dark"] .stock-label.unavailable { color: #f0d28f; }
[data-theme="dark"] .button.primary { background: #a4e8cd; border-color: #a4e8cd; color: #102a33; }
[data-theme="dark"] .button.primary:hover { background: #c4f3e0; }
[data-theme="dark"] .topic-card[aria-pressed="true"] { background: #235442; border-color: #8ad6b4; color: #fff; }
[data-theme="dark"] input::placeholder { color: #96abad; }
[data-theme="dark"] .skip-link { background: var(--paper); }
[data-theme="dark"] .noscript { background: #403621; color: #f0d28f; }
@media (min-width:721px) and (max-width:1150px) {
  .site-header { flex-wrap: wrap; gap: 12px; padding-top: 20px; }
  .site-header > nav { order: 3; width: 100%; }
  .site-header > nav a { padding-top: 10px; padding-bottom: 20px; }
  .site-header > nav a[aria-current="page"]::after { bottom: 10px; }
}
@media (max-width:720px) {
  .site-header { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px 10px; }
  .site-header > nav { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .theme-control { grid-column: 2; grid-row: 1; }
  .theme-control > span, .site-header .beta { display: none; }
}
[data-theme="dark"] .news-formats button[aria-pressed="true"] { background: #235442; border-color: #8ad6b4; color: #fff; }
