/* Shared theme tokens. Dark remains the default until a visitor chooses light. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #fafaf8;
  --surface: #f1f1ed;
  --surface-2: #e8e8e3;
  --text: #20201d;
  --muted: #65655f;
  --line: #d7d7d0;
  --line-strong: #b0b0a6;
  --urgent: #c62f23;
  --red: #c62f23;
  --good: #187442;
  --signal-ff4d3d: #c62f23;
  --signal-ff4b3e: #c62f23;
  --signal-8cffb4: #187442;
  --signal-7adf9b: #187442;
  --signal-82eaa4: #187442;
  --signal-ffb34d: #865308;
  --signal-e9ad67: #865308;
  --signal-e9ba65: #865308;
  --signal-ffab99: #9c3527;
  --signal-ff968a: #9c3527;
  --signal-ff6359: #b52d25;
  --signal-a6c6ad: #3e6547;
  --signal-8cab94: #3e6547;
  --signal-f1b3ad: #9c3527;
  --overlay-dark: 250, 250, 248;
  --overlay-light: 0, 0, 0;
  --tone-050505: #f6f6f6;
  --tone-080808: #f3f3f3;
  --tone-090909: #f2f2f2;
  --tone-0b0b0b: #f0f0f0;
  --tone-0c0c0c: #efefef;
  --tone-0d0d0d: #eeeeee;
  --tone-101010: #ececec;
  --tone-111111: #ebebeb;
  --tone-120d0b: #ededed;
  --tone-15100c: #ebebeb;
  --tone-151515: #e7e7e7;
  --tone-160e0d: #ebebeb;
  --tone-171717: #e5e5e5;
  --tone-181818: #e4e4e4;
  --tone-1b1b1b: #e2e2e2;
  --tone-222222: #dbdbdb;
  --tone-292929: #d5d5d5;
  --tone-333333: #cccccc;
  --tone-343434: #cbcbcb;
  --tone-3a3a3a: #c6c6c6;
  --tone-41413e: #c0c0c0;
  --tone-444444: #bdbdbd;
  --tone-4d4d49: #707070;
  --tone-555555: #707070;
  --tone-5f5f5b: #707070;
  --tone-666662: #707070;
  --tone-666666: #707070;
  --tone-686864: #707070;
  --tone-74746e: #707070;
  --tone-777772: #707070;
  --tone-777773: #707070;
  --tone-777777: #707070;
  --tone-8d8d88: #707070;
  --tone-8d8d89: #707070;
  --tone-a7a7a2: #656565;
  --tone-a9a9a4: #636363;
  --tone-aaa9a4: #636363;
  --tone-aaaaaa: #616161;
  --tone-b5b5af: #595959;
  --tone-b7b7b0: #575757;
  --tone-b8b8b3: #565656;
  --tone-bbbbbb: #525252;
  --tone-bdbcb7: #525252;
  --tone-bdbdb7: #525252;
  --tone-bebdb8: #515151;
  --tone-c1c1bc: #4e4e4e;
  --tone-c2c1bc: #4e4e4e;
  --tone-c4c3be: #4c4c4c;
  --tone-c4c4bf: #4b4b4b;
  --tone-c6c6c0: #4a4a4a;
  --tone-c7c7c2: #484848;
  --tone-c9c9c4: #474747;
  --tone-d0d0cc: #404040;
  --tone-d4d4cf: #3d3d3d;
  --tone-d5d5cf: #3c3c3c;
  --tone-d6ccc9: #404040;
  --tone-d8d8d2: #393939;
  --tone-d9d9d5: #383838;
  --tone-f4f4f1: #1f1f1f;
  --tone-ffffff: #141414;
}
html[data-theme="dark"] { color-scheme: dark; }
body > header button.theme-toggle {
  width: 44px; height: 44px; min-height: 44px; padding: 10px; flex: 0 0 44px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: transparent; border: 1px solid var(--line-strong);
  border-radius: 50%; cursor: pointer;
}
body > header button.theme-toggle:hover { background: var(--surface); border-color: var(--text); }
body > header button.theme-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-moon { display: none; }
html[data-theme="light"] .theme-toggle .theme-sun { display: none; }
html[data-theme="light"] .theme-toggle .theme-moon { display: block; }
/* Semantic status colors need a darker ink on light surfaces. */
html[data-theme="light"] .status-independently_supported { color: #187442; }
html[data-theme="light"] .status-developer_claim { color: #865308; }
html[data-theme="light"] .status-contested { color: #b52d25; }
@media(max-width:640px) {
  .topbar-actions, .feature-actions, .event-actions, .story-actions, .model-topbar>div { gap: 8px; }
  body > header button.theme-toggle { width: 44px; height: 44px; flex-basis: 44px; padding: 10px; }
}
.theme-actions { display: flex; align-items: center; justify-self: end; gap: 16px; }
