/* File: static/theme.css
 * Shared page, CodeMirror and Agda color tokens (issue 17).
 * The dark surfaces and Agda hues follow agda-algebras' Aurora palette.
 * Text and UI contrast are checked from these declarations by vitest.
 */

:root {
  color-scheme: light;
  --canvas: #e8ebe5;
  --surface: #f8f9f5;
  --surface-soft: #e7eae3;
  --line: #747c70;
  --line-strong: #6f776d;
  --text: #171a16;
  --muted: #565d54;
  --faint: #596156;
  --accent: #156b52;
  --accent-strong: #0e503c;
  --accent-soft: #dcebe3;
  --warning: #81510f;
  --warning-soft: #f4e9cd;
  --error: #9c2925;
  --error-soft: #f2dfdc;
  --editor-surface: #fff;
  --editor-text: #242a23;
  --editor-gutter-surface: #fafbf9;
  --editor-gutter-text: #5a6157;
  --editor-line: var(--line);
  --editor-active-line: #f3f7f3;
  --editor-cursor: #20765b;
  --goal-surface: #dff3e8;
  --goal-line: var(--accent);
  --tooltip-line: var(--line);
  --error-banner-line: var(--line);
  --activity-surface: #dfe3dc;
  --activity-text: #596157;
  --explorer-surface: #ebeee8;
  --explorer-heading: #4d554b;
  --explorer-text: #596057;
  --explorer-active-surface: #d7ddd4;
  --explorer-line: var(--line);
  --explorer-hover-surface: #e2e6df;
  --chapter-active-surface: #d9e4dc;
  --chapter-icon: var(--muted);
  --saved-indicator: var(--accent);
  --tab-surface: #e9ece6;
  --reader-line: var(--line);
  --reader-heading: #454d43;
  --status-surface: #e4e8e1;
  --status-text: #586256;
  --reader-text: #252a24;
  --reader-heading-line: var(--line);
  --reader-inline-surface: #e8ece5;
  --reader-code-line: var(--line);
  --reader-code-surface: #f0f2ed;
  --reader-code-accent: var(--accent);
  --reader-code-hover-surface: #e6eee8;
  --reader-quote-line: var(--line);
  --reader-quote-text: #4f574d;
  --reader-quote-surface: #eef1eb;
  --reader-table-line: var(--line);
  --command-line: var(--line);
  --command-text: #535c51;
  --command-hover-line: var(--accent);
  --input-line: var(--line);
  --input-label-surface: #d9ded6;
  --input-divider: var(--line);
  --input-label-text: #2e342d;
  --input-badge-text: #f4f7f1;
  --input-text: #1d211c;
  --input-surface: #fafbf7;
  --input-button-line: var(--line);
  --input-button-text: #293029;
  --input-button-hover-surface: #f5f6f2;
  --resize-surface: #dce0d9;
  --resize-hover-surface: #9bcab4;
  --inspector-surface: #f2f4ef;
  --abort-line: var(--error);
  --card-surface: #f9faf6;
  --card-hover-line: var(--line);
  --card-active-line: var(--accent);
  --goal-text: #28322b;
  --inspector-heading: #515950;
  --context-text: #3f4840;
  --error-card-line: var(--line);
  --warning-card-line: var(--line);
  --problem-text: #4f554e;
  --error-action-line: var(--line);
  --goal-marker-text: #fff;
  --selection-surface: #c8e5d9;
  --editor-dark-active-line: var(--editor-active-line);
  --editor-selection-match-line: var(--accent);
  --editor-dark-selection-match-line: var(--accent);
  --editor-dark-cursor: var(--editor-cursor);
  --editor-fold-surface: var(--surface-soft);
  --editor-fold-line: var(--line);
  --editor-tooltip-section-line: var(--line);
  --editor-tooltip-hover-line: var(--line);
  --editor-hover-line: var(--accent);
  --editor-dark-hover-line: var(--accent);
  --editor-tooltip-line: var(--line);
  --symbol-input-surface: #e7eae3;
  --symbol-input-text: #333333;
  --symbol-no-match-surface: #f2dfdc;
  --symbol-no-match-text: #9c2925;
  --symbol-match-surface: #f4e9cd;
  --symbol-muted-text: #5f5f5f;
  --symbol-cell-surface: #e7eae3;
  --symbol-selected-text: #fff;
  --symbol-selected-surface: #000;
  --symbol-tooltip-surface: var(--surface);
  --symbol-tooltip-text: #111111;
  --symbol-disabled-text: var(--muted);
  --symbol-disabled-surface: var(--surface-soft);
  --symbol-exact-line: var(--line);
  --browser-chrome-surface: #f7f8f5;
  --agda-hole-surface: var(--goal-surface);
  --agda-comment: #5f5f5f;
  --agda-keyword: #a53e00;
  --agda-string: #b22222;
  --agda-number: #8e0ede;
  --agda-symbol: #404040;
  --agda-primitivetype: #0000cd;
  --agda-inductiveconstructor: #006f00;
  --agda-coinductiveconstructor: #735d00;
  --agda-datatype: #0000cd;
  --agda-field: #bc0057;
  --agda-function: #0000cd;
  --agda-module: #8e0ede;
  --agda-postulate: #0000cd;
  --agda-primitive: #0000cd;
  --agda-record: #0000cd;
  --agda-macro: #246a53;
  --agda-error: #c20000;
  --agda-errorwarning-surface: #f7e9e7;
  --agda-unsolvedmeta-surface: #f4edda;
  --agda-unsolvedconstraint-surface: #f4edda;
  --agda-terminationproblem-surface: #f5e9e3;
  --agda-positivityproblem-surface: #f3ebe3;
  --agda-deadcode-surface: #ecefeb;
  --agda-shadowingintelescope-surface: #ecefeb;
  --agda-coverageproblem-surface: #f3eee1;
  --agda-typechecks: var(--editor-text);
  --agda-typechecks-surface: #e6f0f4;
  --agda-missingdefinition-surface: #f4ebdf;
  --agda-instanceproblem-surface: #f3eee1;
  --agda-cosmeticproblem-surface: #f1f4ed;
  --agda-catchallclause-surface: #f1f4ed;
  --agda-confluenceproblem-surface: #f3e8ee;
  --accent-fill: #176d54;
  --accent-fill-hover: #0e503c;
  --error-fill: #9c2925;
  --symbol-match-text: #171a16;
  --focus-ring: var(--accent);
  color: var(--text);
  background: var(--canvas);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0c0e1d;
    --surface: #15172e;
    --surface-soft: #1c203a;
    --line: #737b9c;
    --line-strong: #9197b6;
    --text: #d7dcff;
    --muted: #b3bad8;
    --faint: #a7b0d0;
    --accent: #5eead4;
    --accent-strong: #9af3e5;
    --accent-soft: #1b353b;
    --warning: #ffb86c;
    --warning-soft: #382d25;
    --error: #ff9da9;
    --error-soft: #352332;
    --editor-surface: #0f1230;
    --editor-text: #d7dcff;
    --editor-gutter-surface: #12152e;
    --editor-gutter-text: #a7b0d0;
    --editor-active-line: #191d3a;
    --editor-cursor: var(--accent);
    --goal-surface: #1b3037;
    --activity-surface: #0c0d1f;
    --activity-text: var(--muted);
    --explorer-surface: #15172e;
    --explorer-heading: var(--text);
    --explorer-text: var(--muted);
    --explorer-active-surface: #262c47;
    --explorer-hover-surface: #20243c;
    --chapter-active-surface: #1b353b;
    --chapter-icon: var(--muted);
    --saved-indicator: var(--accent);
    --tab-surface: #1c203a;
    --reader-heading: var(--text);
    --status-surface: #1c203a;
    --status-text: var(--muted);
    --reader-text: var(--text);
    --reader-inline-surface: #20243c;
    --reader-code-surface: #191d3a;
    --reader-code-hover-surface: #1b3037;
    --reader-quote-text: var(--muted);
    --reader-quote-surface: #20243c;
    --command-text: var(--muted);
    --input-label-surface: #20243c;
    --input-label-text: var(--text);
    --input-badge-text: #d7dcff;
    --input-text: var(--text);
    --input-surface: #0f1230;
    --input-button-text: var(--text);
    --input-button-hover-surface: #262c47;
    --resize-surface: #1c203a;
    --resize-hover-surface: var(--accent);
    --inspector-surface: #15172e;
    --card-surface: #191d3a;
    --goal-text: var(--text);
    --inspector-heading: var(--muted);
    --context-text: var(--text);
    --problem-text: var(--text);
    --goal-marker-text: #0c0e1d;
    --selection-surface: #282d4c;
    --symbol-input-surface: #20243c;
    --symbol-input-text: var(--text);
    --symbol-no-match-surface: var(--error-soft);
    --symbol-no-match-text: var(--error);
    --symbol-match-surface: #3a3022;
    --symbol-muted-text: var(--muted);
    --symbol-cell-surface: #20243c;
    --symbol-selected-text: #d7dcff;
    --symbol-selected-surface: #343b63;
    --symbol-tooltip-text: var(--text);
    --browser-chrome-surface: var(--canvas);
    --agda-comment: #a7b0d0;
    --agda-keyword: #ff8a3d;
    --agda-string: #c3a0ff;
    --agda-number: #ffb86c;
    --agda-symbol: #b8c0ff;
    --agda-primitivetype: #6cc5ff;
    --agda-inductiveconstructor: #5eead4;
    --agda-coinductiveconstructor: #5eead4;
    --agda-datatype: #6cc5ff;
    --agda-field: #ff9ed6;
    --agda-function: #9693ff;
    --agda-module: #c3a0ff;
    --agda-postulate: #9693ff;
    --agda-primitive: #6cc5ff;
    --agda-record: #6cc5ff;
    --agda-macro: #9693ff;
    --agda-error: var(--error);
    --agda-errorwarning-surface: #302233;
    --agda-unsolvedmeta-surface: #302b24;
    --agda-unsolvedconstraint-surface: #302b24;
    --agda-terminationproblem-surface: #302533;
    --agda-positivityproblem-surface: #302824;
    --agda-deadcode-surface: #23273b;
    --agda-shadowingintelescope-surface: #23273b;
    --agda-coverageproblem-surface: #302b24;
    --agda-typechecks-surface: #1d2b3b;
    --agda-missingdefinition-surface: #302824;
    --agda-instanceproblem-surface: #302b24;
    --agda-cosmeticproblem-surface: #1d243d;
    --agda-catchallclause-surface: #1d243d;
    --agda-confluenceproblem-surface: #302233;
    --accent-fill: #275847;
    --accent-fill-hover: #1d4739;
    --error-fill: #8b3446;
    --symbol-match-text: var(--text);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0c0e1d;
  --surface: #15172e;
  --surface-soft: #1c203a;
  --line: #737b9c;
  --line-strong: #9197b6;
  --text: #d7dcff;
  --muted: #b3bad8;
  --faint: #a7b0d0;
  --accent: #5eead4;
  --accent-strong: #9af3e5;
  --accent-soft: #1b353b;
  --warning: #ffb86c;
  --warning-soft: #382d25;
  --error: #ff9da9;
  --error-soft: #352332;
  --editor-surface: #0f1230;
  --editor-text: #d7dcff;
  --editor-gutter-surface: #12152e;
  --editor-gutter-text: #a7b0d0;
  --editor-active-line: #191d3a;
  --editor-cursor: var(--accent);
  --goal-surface: #1b3037;
  --activity-surface: #0c0d1f;
  --activity-text: var(--muted);
  --explorer-surface: #15172e;
  --explorer-heading: var(--text);
  --explorer-text: var(--muted);
  --explorer-active-surface: #262c47;
  --explorer-hover-surface: #20243c;
  --chapter-active-surface: #1b353b;
  --chapter-icon: var(--muted);
  --saved-indicator: var(--accent);
  --tab-surface: #1c203a;
  --reader-heading: var(--text);
  --status-surface: #1c203a;
  --status-text: var(--muted);
  --reader-text: var(--text);
  --reader-inline-surface: #20243c;
  --reader-code-surface: #191d3a;
  --reader-code-hover-surface: #1b3037;
  --reader-quote-text: var(--muted);
  --reader-quote-surface: #20243c;
  --command-text: var(--muted);
  --input-label-surface: #20243c;
  --input-label-text: var(--text);
  --input-badge-text: #d7dcff;
  --input-text: var(--text);
  --input-surface: #0f1230;
  --input-button-text: var(--text);
  --input-button-hover-surface: #262c47;
  --resize-surface: #1c203a;
  --resize-hover-surface: var(--accent);
  --inspector-surface: #15172e;
  --card-surface: #191d3a;
  --goal-text: var(--text);
  --inspector-heading: var(--muted);
  --context-text: var(--text);
  --problem-text: var(--text);
  --goal-marker-text: #0c0e1d;
  --selection-surface: #282d4c;
  --symbol-input-surface: #20243c;
  --symbol-input-text: var(--text);
  --symbol-no-match-surface: var(--error-soft);
  --symbol-no-match-text: var(--error);
  --symbol-match-surface: #3a3022;
  --symbol-muted-text: var(--muted);
  --symbol-cell-surface: #20243c;
  --symbol-selected-text: #d7dcff;
  --symbol-selected-surface: #343b63;
  --symbol-tooltip-text: var(--text);
  --browser-chrome-surface: var(--canvas);
  --agda-comment: #a7b0d0;
  --agda-keyword: #ff8a3d;
  --agda-string: #c3a0ff;
  --agda-number: #ffb86c;
  --agda-symbol: #b8c0ff;
  --agda-primitivetype: #6cc5ff;
  --agda-inductiveconstructor: #5eead4;
  --agda-coinductiveconstructor: #5eead4;
  --agda-datatype: #6cc5ff;
  --agda-field: #ff9ed6;
  --agda-function: #9693ff;
  --agda-module: #c3a0ff;
  --agda-postulate: #9693ff;
  --agda-primitive: #6cc5ff;
  --agda-record: #6cc5ff;
  --agda-macro: #9693ff;
  --agda-error: var(--error);
  --agda-errorwarning-surface: #302233;
  --agda-unsolvedmeta-surface: #302b24;
  --agda-unsolvedconstraint-surface: #302b24;
  --agda-terminationproblem-surface: #302533;
  --agda-positivityproblem-surface: #302824;
  --agda-deadcode-surface: #23273b;
  --agda-shadowingintelescope-surface: #23273b;
  --agda-coverageproblem-surface: #302b24;
  --agda-typechecks-surface: #1d2b3b;
  --agda-missingdefinition-surface: #302824;
  --agda-instanceproblem-surface: #302b24;
  --agda-cosmeticproblem-surface: #1d243d;
  --agda-catchallclause-surface: #1d243d;
  --agda-confluenceproblem-surface: #302233;
  --accent-fill: #275847;
  --accent-fill-hover: #1d4739;
  --error-fill: #8b3446;
  --symbol-match-text: var(--text);
}

:root[data-theme="light"] {
  color-scheme: light;
}
