/* Color tokens shared by the website and the Worker-rendered privacy, terms and support pages. */
:root {
  color-scheme: light;
  --page-bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --text: #111113;
  --muted: #5f5f68;
  --subtle: #8b8b94;
  --line: #e7e7ea;
  --line-strong: #d4d4d8;
  --hover: #0000000a;
  --accent: #584cff;
  --accent-soft: #584cff14;
  --selection: #584cff2e;
  --pudding-accent: #584cff;
  --pudding-bg: #efeeff;
  --buzz-accent: #3f7a19;
  --button-bg: #111113;
  --button-text: #ffffff;
  --button-hover: #2a2a2e;
  --glass: #ffffffb3;
  --grid-dot: #0000001a;
  --glow-a: #584cff33;
  --glow-b: #2563eb24;
  --glow-c: #22c55e29;
  --window-bg: #ffffff;
  --window-side: #f7f7f8;
  --window-line: #e7e7ea;
  --bubble: #f0f0f2;
  --add-bg: #22c55e1a;
  --add-text: #166534;
  --del-bg: #ef44441a;
  --del-text: #b42318;
  --ok: #16a34a;
  --warn: #c2410c;
  --shadow: 0 1px 2px #0000000d, 0 24px 60px -12px #11111326;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #09090b;
  --surface: #111114;
  --surface-2: #18181c;
  --text: #ededf0;
  --muted: #a1a1aa;
  --subtle: #71717a;
  --line: #ffffff14;
  --line-strong: #ffffff24;
  --hover: #ffffff0f;
  --accent: #a39bff;
  --accent-soft: #a39bff1f;
  --selection: #a39bff40;
  --pudding-accent: #a39bff;
  --pudding-bg: #1b1930;
  --buzz-accent: #b9e08e;
  --button-bg: #ededf0;
  --button-text: #09090b;
  --button-hover: #ffffff;
  --glass: #11111499;
  --grid-dot: #ffffff17;
  --glow-a: #584cff70;
  --glow-b: #2563eb4d;
  --glow-c: #22c55e40;
  --window-bg: #0e0e11;
  --window-side: #0b0b0d;
  --window-line: #ffffff12;
  --bubble: #1d1d22;
  --add-bg: #22c55e1f;
  --add-text: #86efac;
  --del-bg: #ef44441f;
  --del-text: #fca5a5;
  --ok: #4ade80;
  --warn: #fb923c;
  --shadow: 0 0 0 1px #ffffff0a, 0 30px 80px -20px #000000cc;
}
.theme-control { position: relative; flex-shrink: 0; }
:root:not([data-theme-preference]) .theme-control { display: none; }
.theme-trigger {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.theme-trigger:hover, .theme-trigger[aria-expanded="true"] { color: var(--text); border-color: var(--subtle); }
.theme-trigger:focus-visible, .theme-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-trigger .theme-icon { display: none; }
[data-theme-preference="system"] .theme-icon-system,
[data-theme-preference="light"] .theme-icon-light,
[data-theme-preference="dark"] .theme-icon-dark { display: block; }
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 156px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 2px 6px #0000001a, 0 16px 40px -12px #00000059;
  transform-origin: top right;
  animation: theme-menu-in .16s cubic-bezier(.2,.7,.2,1);
}
.theme-menu[hidden] { display: none; }
.theme-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.theme-menu button:hover, .theme-menu button:focus-visible { background: var(--hover); color: var(--text); }
.theme-menu [aria-checked="true"] { color: var(--text); }
.theme-check { margin-left: auto; color: var(--accent); opacity: 0; }
.theme-menu [aria-checked="true"] .theme-check { opacity: 1; }
@keyframes theme-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
@media (prefers-reduced-motion: reduce) {
  .theme-menu { animation: none; }
}
