/* Palette only. Page geometry and motion belong to the existing stylesheets. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171819;
  --surface: #1d1f20;
  --surface-soft: #222526;
  --surface-hover: #292c2d;
  --ink: #ecece8;
  --muted: #a3a7a6;
  --faint: #949998;
  --line: #303334;
  --line-strong: #484d4e;
  --green: #81d4ac;
  --green-soft: #20392e;
  --red: #f29aab;
  --red-soft: #3b262d;
  --blue: #9abafe;
  --blue-soft: #253348;
  --attempt-accepted: #81d4c7;
  --attempt-error: #f29aab;
  --attempt-official: #9abafe;
  --attempt-running: #b7b9b3;
  --attempt-card-line: #303334;
  --attempt-node-ring: #484d4e;
  --code: #1d1f20;
  --code-line: #484d4e;
  --theme-white: #1d1f20;
  --theme-strong: #ecece8;
  --theme-neutral: #a3a7a6;
  --theme-soft: #222526;
  --theme-line: #303334;
  --theme-line-strong: #484d4e;
  --theme-green: #81d4c7;
  --theme-green-soft: #20392e;
  --theme-red: #f29aab;
  --theme-red-soft: #3b262d;
  --theme-blue: #9abafe;
  --theme-blue-soft: #253348;
  --theme-amber: #e8bd8b;
  --theme-amber-soft: #3a3023;
  --theme-violet: #c4acf0;
  --theme-selection: #355b59;
  --theme-active-line: #222526;
  --theme-keyword: #c4acf0;
  --theme-string: #b8cd95;
  --theme-number: #e8bd8b;
  --theme-comment: #929995;
}
:root[data-theme="dark"] ::selection { background: var(--theme-selection); color: var(--ink); }
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select { color: var(--ink); }
:root[data-theme="dark"] .button--primary { color: var(--paper); }
:root[data-theme="dark"] .submit-panel,
:root[data-theme="dark"] .code-input,
:root[data-theme="dark"] .source-view,
:root[data-theme="dark"] .code-view pre { color: var(--ink); caret-color: var(--ink); }
:root[data-theme="dark"] .prose pre,
:root[data-theme="dark"] .admin-submission-source pre { color: var(--ink); }
:root[data-theme="dark"] .submit-panel .button--primary { background: var(--ink); color: var(--paper); }
:root[data-theme="dark"] .submit-panel .language-badge,
:root[data-theme="dark"] kbd { color: var(--muted); border-color: var(--line-strong); }
:root[data-theme="dark"] .submit-panel .button:focus-visible { outline-color: var(--attempt-accepted); }
:root[data-theme="dark"] .cm-editor { color: var(--ink); }
:root[data-theme="dark"] .cm-editor .cm-selectionBackground { background: var(--theme-selection) !important; }
:root[data-theme="dark"] .cm-editor .cm-cursor { border-left-color: var(--ink); }
:root[data-theme="dark"] .cm-tooltip,
:root[data-theme="dark"] .cm-panels { background: var(--surface-soft); color: var(--ink); border-color: var(--line-strong); }
:root[data-theme="dark"] .cm-panels button,
:root[data-theme="dark"] .cm-panels input { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
:root[data-theme="dark"] .cm-searchMatch { background: var(--blue-soft); outline-color: var(--blue); }
:root[data-theme="dark"] .cm-selectionMatch,
:root[data-theme="dark"] .cm-matchingBracket { background: var(--theme-selection); }
:root[data-theme="dark"] .cm-remoteCursor { --live-remote-text: #171819; }
:root[data-theme="dark"] .cm-remoteSelection.is-blue { background: rgb(154 186 254 / 25%); }
:root[data-theme="dark"] .cm-remoteSelection.is-green { background: rgb(129 212 199 / 25%); }
:root[data-theme="dark"] .cm-remoteSelection.is-amber { background: rgb(232 189 139 / 25%); }
:root[data-theme="dark"] .cm-remoteSelection.is-violet { background: rgb(196 172 240 / 25%); }
:root[data-theme="dark"] .cm-remoteSelection.is-rose { background: rgb(242 154 171 / 25%); }
@media (prefers-contrast: more) {
  :root[data-theme="dark"] { --line: #737979; --line-strong: #939999; --muted: #c2c6c3; --theme-line: #737979; --theme-line-strong: #939999; --theme-neutral: #c2c6c3; }
}
