/* Shared light/dark theme. theme.js sets data-theme on <html>. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #555555;
  --muted-2: #666666;
  --border: #e2e2e2;
  --code-bg: #f2f2f2;
  --subtle-bg: #f7f7f7;
  --note-bg: #fff8e1;
  --note-border: #f0b429;
  --link: #1565c0;
  --button-bg: #1565c0;
  --button-bg-hover: #0d47a1;
  --button-secondary-hover: #f0f6fc;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16181d;
  --text: #e4e4e7;
  --muted: #a8a8b0;
  --muted-2: #9a9aa3;
  --border: #33363e;
  --code-bg: #24272e;
  --subtle-bg: #1e2026;
  --note-bg: #2d2615;
  --note-border: #f0b429;
  --link: #6aaef5;
  --button-bg: #1e6fd0;
  --button-bg-hover: #2b80e6;
  --button-secondary-hover: #1c2634;
}

body {
  background: var(--bg);
  color: var(--text);
}

:root[data-theme="dark"] .only-light,
:root:not([data-theme="dark"]) .only-dark {
  display: none !important;
}

.theme-toggle {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  z-index: 10;
}
.theme-toggle:hover { background: var(--subtle-bg); }
.theme-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.theme-toggle svg { width: 1.2rem; height: 1.2rem; }
