*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: transform .15s ease, background .15s ease, color .15s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
#theme-toggle:hover { transform: scale(1.08); background: var(--gold-dim); color: var(--gold-light); }
#theme-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Fallback: if not inside a <nav>, keep the floating top-right position. */
body > #theme-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9999;
}

/* Inside a <nav>: sit at the right edge (mirrors the old fixed ~14px offset) */
nav #theme-toggle { margin-left: 0.75rem; margin-right: -1.2rem; }
@media (max-width: 600px) {
  nav #theme-toggle { margin-right: -0.5rem; }
}

@media (max-width: 600px) {
  #theme-toggle { width: 34px; height: 34px; font-size: 14px; }
  body > #theme-toggle { top: 10px; right: 10px; }
}
