/* Shared three-state control: automatic, light, dark. */
.theme-switch {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  flex-shrink:0; min-width:40px; height:40px; padding:0 10px;
  border:1px solid var(--brand-line); border-radius:9px;
  background:var(--brand-surface); color:var(--brand-copy);
  font-size:11px; line-height:1; cursor:pointer;
}
.theme-switch svg { width:18px; height:18px; display:block; flex-shrink:0; }
.theme-switch:hover { background:var(--brand-hover); color:var(--brand-accent); }
.theme-switch:focus-visible { outline:2px solid var(--brand-focus); outline-offset:3px; }
.theme-switch [data-theme-icon] { display:none; }
html:not([data-theme-mode]) .theme-switch [data-theme-icon="auto"],
html[data-theme-mode="auto"] .theme-switch [data-theme-icon="auto"],
html[data-theme-mode="light"] .theme-switch [data-theme-icon="light"],
html[data-theme-mode="dark"] .theme-switch [data-theme-icon="dark"] { display:initial; }
.nav-shell { gap:24px; }
@media(max-width:1000px) { .theme-switch [data-theme-label] { display:none; } .theme-switch { padding:0; } }
@media(max-width:760px) {
  .nav-shell { gap:10px; }
  .nav-shell .brand { order:1; min-width:0; }
  .nav-shell .theme-switch { order:2; margin-left:auto; }
  .nav-shell .mobile-menu { order:3; margin-left:0; }
  .nav-shell .mobile-menu summary { padding:11px 10px; }
}
@media(max-width:350px) { .personal-home .brand { font-size:15px; gap:8px; } }
/* Native controls, selection and media stay readable in both themes. */
::selection { background:var(--brand-hover); color:var(--brand-ink); }
html[data-theme='dark'] .language-scroll { scrollbar-color:var(--brand-line-strong) var(--brand-soft); }
html[data-theme='dark'] .personal-platform .platform-icon:not(.wide-logo),
html[data-theme='dark'] .profile-logo:not(.is-oshwhub),
html[data-theme='dark'] .language-row img { background:#f7f8f3; border-radius:4px; }
@media print { .theme-switch { display:none; } }
