/* Design tokens (SPEC §7.1). Light by default; dark follows the system
   setting unless <html data-theme> holds the user's choice (light or dark). */
:root {
    --sidebar-bg: #3d3d3d;
    --sidebar-text: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, .08);
    --sidebar-active: rgba(255, 255, 255, .14);
    --accent: #e03a3e;
    /* WCAG AA (§4.4, §23 #96): the brand red behind white text, and as text. */
    --accent-fill: #d63235;
    --accent-text: #c92f33;
    --list-bg: #ffffff;
    --list-selected: #ececec;
    --editor-bg: #ffffff;
    --text: #222222;
    --text-muted: #696969;
    --border: #e3e3e3;
    --radius: 6px;
    --radius-pill: 999px;
    --font-ui: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-size-base: 14px;
    --sidebar-muted: rgba(255, 255, 255, .8); /* 4.5:1 or more on the selected row (WCAG AA) */
    --shadow-menu: 0 8px 24px rgba(0, 0, 0, .22);
    --mark-bg: #fff0a8;
    --mark-text: #222222;
    /* Code highlighting (§8.4): at least 4.5:1 on a code block (--list-selected). */
    --code-keyword: #8f1f8d;
    --code-string: #2f6b1f;
    --code-number: #8a5100;
    --code-title: #2559a8;
    --code-variable: #a8352d;
    --code-comment: #666666;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --sidebar-bg: #1f1f1f;
        --sidebar-text: #e8e8e8;
        --sidebar-hover: rgba(255, 255, 255, .06);
        --sidebar-active: rgba(255, 255, 255, .12);
        --list-bg: #262626;
        --list-selected: #333333;
        --editor-bg: #1b1b1b;
        --text: #e6e6e6;
        --text-muted: #a0a0a0;
        --accent-text: #ff6b6e;
        --border: #333333;
        --mark-bg: #6b5a12;
        --mark-text: #fff6d6;
        --code-keyword: #d79bea;
        --code-string: #9ad18b;
        --code-number: #e8b36b;
        --code-title: #8fb8f5;
        --code-variable: #f2918a;
        --code-comment: #a8a8a8;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --sidebar-bg: #1f1f1f;
    --sidebar-text: #e8e8e8;
    --sidebar-hover: rgba(255, 255, 255, .06);
    --sidebar-active: rgba(255, 255, 255, .12);
    --list-bg: #262626;
    --list-selected: #333333;
    --editor-bg: #1b1b1b;
    --text: #e6e6e6;
    --text-muted: #a0a0a0;
    --accent-text: #ff6b6e;
    --border: #333333;
    --mark-bg: #6b5a12;
    --mark-text: #fff6d6;
    --code-keyword: #d79bea;
    --code-string: #9ad18b;
    --code-number: #e8b36b;
    --code-title: #8fb8f5;
    --code-variable: #f2918a;
    --code-comment: #a8a8a8;
    color-scheme: dark;
}
