:root {
    color-scheme: light;

    /* Brand */
    --primary: #0959c8;
    --primary-hover: #074ba9;
    --primary-active: #063d89;
    --primary-soft: #edf5ff;
    --primary-subtle: #f6faff;
    --primary-border: #bfd8fb;
    --primary-contrast: #ffffff;

    /* Neutral surfaces */
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --surface-muted: #f8fafc;
    --surface-strong: #eef2f7;
    --surface-hover: #f1f5f9;
    --overlay: rgba(15, 23, 42, 0.54);

    /* Typography */
    --text: #142033;
    --text-soft: #40506a;
    --text-muted: #6f7d91;
    --text-disabled: #9aa6b5;
    --text-inverse: #ffffff;

    /* Borders */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-focus: #0959c8;

    /* Semantic */
    --danger: #c52a21;
    --danger-hover: #a9231c;
    --danger-soft: #fff1f0;
    --danger-border: #f2b8b4;
    --warning: #a85b00;
    --warning-soft: #fff7e8;
    --warning-border: #f0ce91;
    --success: #167648;
    --success-soft: #edf9f2;
    --success-border: #adddc2;
    --info: #175cd3;
    --info-soft: #eff6ff;
    --info-border: #bad2f7;

    /* Navigation */
    --sidebar: #071a36;
    --sidebar-deep: #041225;
    --sidebar-text: rgba(255, 255, 255, 0.9);
    --sidebar-strong: #ffffff;
    --sidebar-muted: rgba(225, 235, 248, 0.61);
    --sidebar-icon: rgba(235, 243, 255, 0.82);
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(9, 89, 200, 0.34);
    --sidebar-border: rgba(255, 255, 255, 0.09);

    /* Radius */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius: 10px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 999px;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.035);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.055);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.045), 0 4px 12px rgba(15, 23, 42, 0.025);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.075), 0 2px 6px rgba(15, 23, 42, 0.035);
    --shadow-lg: 0 22px 56px rgba(15, 23, 42, 0.15), 0 8px 20px rgba(15, 23, 42, 0.07);
    --focus-ring: 0 0 0 3px rgba(9, 89, 200, 0.18);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Type scale */
    --font: 'Poppins', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 15px;
    --font-size-lg: 17px;
    --font-size-xl: 21px;
    --font-size-2xl: 26px;
    --font-size-3xl: 32px;

    /* Layout */
    --control-height-sm: 34px;
    --control-height: 40px;
    --control-height-lg: 44px;
    --sidebar-width: 260px;
    --agent-width: 400px;
    --content-max: 1680px;
    --topbar-height: 82px;

    /* Motion */
    --ease-standard: cubic-bezier(.2, .8, .2, 1);
    --duration-fast: 140ms;
    --duration: 200ms;
    --duration-slow: 320ms;
}

[data-theme="dark"] {
    color-scheme: dark;
    --primary: #62a8ff;
    --primary-hover: #83baff;
    --primary-active: #a4ccff;
    --primary-soft: #102b4e;
    --primary-subtle: #0d223d;
    --primary-border: #244f82;
    --primary-contrast: #06162a;

    --bg: #0b111b;
    --surface: #111a27;
    --surface-elevated: #162131;
    --surface-muted: #172231;
    --surface-strong: #202d3e;
    --surface-hover: #223247;
    --overlay: rgba(0, 0, 0, 0.7);

    --text: #edf3fb;
    --text-soft: #c0ccda;
    --text-muted: #8f9daf;
    --text-disabled: #657285;

    --border: #263447;
    --border-strong: #3b4b60;
    --border-focus: #62a8ff;

    --danger: #ff7b74;
    --danger-hover: #ff9893;
    --danger-soft: #3a191b;
    --danger-border: #663036;
    --warning: #ffc168;
    --warning-soft: #362811;
    --warning-border: #644a1b;
    --success: #61d99a;
    --success-soft: #123322;
    --success-border: #245c3e;
    --info: #7ab4ff;
    --info-soft: #122c4e;
    --info-border: #2c5484;

    --sidebar: #06162d;
    --sidebar-deep: #030c1a;
    --sidebar-hover: rgba(255, 255, 255, 0.075);
    --sidebar-active: rgba(9, 89, 200, 0.42);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.28);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.34), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.34), 0 3px 10px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.52), 0 8px 24px rgba(0, 0, 0, 0.28);
    --focus-ring: 0 0 0 3px rgba(98, 168, 255, 0.22);
}

[data-theme="dark"] .button-primary,
[data-theme="dark"] .button-danger,
[data-theme="dark"] .button-success,
[data-theme="dark"] .agent-message.user .agent-bubble {
    color: #071527;
}
