/* Shared colour roles keep every workspace, dialog and voice control in sync. */
:root, [data-theme="white"] {
  color-scheme: light;
  --canvas: #ffffff;
  --chrome: #ffffff;
  --surface: #ffffff;
  --surface-soft: #ffffff;
  --surface-hover: #f5f7fb;
  --ink: #202938;
  --ink2: #465164;
  --muted: #626e7e;
  --line: #e4e8ee;
  --line-strong: #8996a9;
  --primary: #315fca;
  --primary-d: #254ca8;
  --primary-l: #ffffff;
  --on-primary: #ffffff;
  --primary-glass: #ffffff24;
  --accent-line: #557acb;
  --focus: #315fca;
  --focus-ring: #315fca26;
  --selection: #dce7ff;
  --shadow-color: #1b315713;
  --overlay: #17243d73;
  --auth-bg: #ffffff;
  --auth-ink: #202938;
  --auth-muted: #626e7e;
  --auth-accent: #315fca;
  --auth-line: #e4e8ee;
  --auth-pattern: #ffffff00;
  --auth-badge-bg: #315fca;
  --auth-badge-ink: #ffffff;
  --chat-user-bg: #ffffff;
  --chat-user-ink: #202938;
  --chat-user-line: #557acb;
  --toast-bg: #ffffff;
  --toast-ink: #202938;
  --toast-line: #bbc9e3;
  --success-bg: #edf7f1;
  --success-ink: #286b47;
  --success-line: #bedfc9;
  --warning-bg: #fff7e8;
  --warning-ink: #805b24;
  --warning-line: #e8d7b3;
  --danger-bg: #fff2f2;
  --danger-ink: #a23f42;
  --danger-line: #edc5c8;
  --danger-solid: #a23f42;
  --on-danger: #ffffff;
  --info-bg: #eef5ff;
  --info-ink: #355f99;
  --info-line: #c7d9f3;
  --pink-bg: #fbf1f6;
  --pink-ink: #88516b;
  --purple-bg: #f3effa;
  --purple-ink: #6d5596;
  --teal-bg: #edf7f8;
  --teal-ink: #346c77;
  --knob: #ffffff;
}

[data-theme="blue"] {
  --canvas: #f3f6fb;
  --chrome: #ffffff;
  --surface-soft: #f1f5fb;
  --surface-hover: #eaf0f9;
  --ink: #1d304b;
  --ink2: #435671;
  --muted: #5d6e85;
  --line: #dce4ef;
  --line-strong: #8596ad;
  --primary: #204c97;
  --primary-d: #173c7c;
  --primary-l: #edf3fd;
  --accent-line: #557cb9;
  --focus: #2c62b9;
  --focus-ring: #2c62b926;
  --selection: #d5e4fc;
  --shadow-color: #17365c14;
  --auth-bg: #1d3456;
  --auth-ink: #f5f8ff;
  --auth-muted: #c5d4e9;
  --auth-accent: #b7ceff;
  --auth-line: #b7ceff30;
  --auth-pattern: #b7ceff05;
  --auth-badge-bg: #d5e3ff;
  --auth-badge-ink: #204c97;
  --chat-user-bg: #204c97;
  --chat-user-ink: #ffffff;
  --chat-user-line: #204c97;
  --toast-bg: #1d3456;
  --toast-ink: #f5f8ff;
  --toast-line: #4c6b99;
}

[data-theme="sage"] {
  --canvas: #f6f7f2;
  --chrome: #fbfcf8;
  --surface-soft: #f0f4e9;
  --surface-hover: #e8efde;
  --ink: #233b34;
  --ink2: #40574e;
  --muted: #596b55;
  --line: #dfe6d7;
  --line-strong: #8a9b7e;
  --primary: #245c46;
  --primary-d: #194531;
  --primary-l: #eaf1e7;
  --accent-line: #7b9962;
  --focus: #527941;
  --focus-ring: #6a8d4426;
  --selection: #dce9bd;
  --shadow-color: #263e3212;
  --overlay: #1b352b80;
  --auth-bg: #244d3c;
  --auth-ink: #f7faef;
  --auth-muted: #d0dfc7;
  --auth-accent: #d5e4b9;
  --auth-line: #dce5ca30;
  --auth-pattern: #d8e8bc06;
  --auth-badge-bg: #d4e1be;
  --auth-badge-ink: #244d3c;
  --chat-user-bg: #2b604a;
  --chat-user-ink: #f5f8ee;
  --chat-user-line: #2b604a;
  --toast-bg: #345a41;
  --toast-ink: #f4f7ee;
  --toast-line: #7b9962;
}

[data-theme="yahoo-lavender"] {
  --canvas: #f5f0ff;
  --chrome: #ffffff;
  --surface-soft: #f5efff;
  --surface-hover: #eee5ff;
  --ink: #2c1944;
  --ink2: #514064;
  --muted: #6b5d7c;
  --line: #e3d6f5;
  --line-strong: #a18ab8;
  --primary: #6001d2;
  --primary-d: #4c00a8;
  --primary-l: #f0e5ff;
  --accent-line: #9162cc;
  --focus: #6001d2;
  --focus-ring: #6001d226;
  --selection: #e6d2ff;
  --shadow-color: #49147e14;
  --overlay: #26133f80;
  --auth-bg: #5000b0;
  --auth-ink: #ffffff;
  --auth-muted: #e5d3ff;
  --auth-accent: #ebdbff;
  --auth-line: #e5d3ff30;
  --auth-pattern: #e5d3ff06;
  --auth-badge-bg: #e6d2ff;
  --auth-badge-ink: #5000b0;
  --chat-user-bg: #6001d2;
  --chat-user-ink: #ffffff;
  --chat-user-line: #6001d2;
  --toast-bg: #5000b0;
  --toast-ink: #ffffff;
  --toast-line: #a47bdb;
}

[data-theme="lavender-mist"] {
  --canvas: #fcf8ff;
  --chrome: #fefcff;
  --surface-soft: #f6effb;
  --surface-hover: #efe5f7;
  --ink: #382740;
  --ink2: #574560;
  --muted: #6a5b75;
  --line: #e7d9ee;
  --line-strong: #a18ba9;
  --primary: #794b96;
  --primary-d: #603878;
  --primary-l: #f4eaf9;
  --accent-line: #a27bb7;
  --focus: #794b96;
  --focus-ring: #794b9626;
  --selection: #ecdaf5;
  --shadow-color: #60387810;
  --overlay: #38233e73;
  --auth-bg: #f4eaf9;
  --auth-ink: #382740;
  --auth-muted: #6a5b75;
  --auth-accent: #794b96;
  --auth-line: #dfcce9;
  --auth-pattern: #ffffff00;
  --auth-badge-bg: #794b96;
  --auth-badge-ink: #ffffff;
  --chat-user-bg: #f4eaf9;
  --chat-user-ink: #382740;
  --chat-user-line: #a27bb7;
  --toast-bg: #ffffff;
  --toast-ink: #382740;
  --toast-line: #cbb0d8;
}

[data-theme="french-lavender"] {
  --canvas: #eae3f5;
  --chrome: #f1ecf9;
  --surface: #fcfaff;
  --surface-soft: #f2ecfa;
  --surface-hover: #e7ddf4;
  --ink: #30263f;
  --ink2: #51405f;
  --muted: #61516f;
  --line: #d7c9e8;
  --line-strong: #9582ad;
  --primary: #624493;
  --primary-d: #4c3376;
  --primary-l: #e9def6;
  --accent-line: #8f6eb8;
  --focus: #624493;
  --focus-ring: #62449326;
  --selection: #dbc9ef;
  --shadow-color: #4e317619;
  --overlay: #2f1c4680;
  --auth-bg: #574078;
  --auth-ink: #fcf7ff;
  --auth-muted: #e2d5ef;
  --auth-accent: #eadbff;
  --auth-line: #e2d5ef30;
  --auth-pattern: #e2d5ef06;
  --auth-badge-bg: #e6d5fa;
  --auth-badge-ink: #4c3376;
  --chat-user-bg: #624493;
  --chat-user-ink: #ffffff;
  --chat-user-line: #624493;
  --toast-bg: #574078;
  --toast-ink: #fcf7ff;
  --toast-line: #aa8cc7;
}

[data-theme="midnight"] {
  color-scheme: dark;
  --canvas: #101722;
  --chrome: #151e2c;
  --surface: #182232;
  --surface-soft: #1d2a3c;
  --surface-hover: #25354b;
  --ink: #edf3ff;
  --ink2: #c9d6e8;
  --muted: #afbed1;
  --line: #34445a;
  --line-strong: #6c7e98;
  --primary: #a2bfff;
  --primary-d: #c3d4ff;
  --primary-l: #23344e;
  --on-primary: #142440;
  --primary-glass: #1424401c;
  --accent-line: #829fd8;
  --focus: #a2bfff;
  --focus-ring: #a2bfff30;
  --selection: #344f7b;
  --shadow-color: #00000030;
  --overlay: #060c18b3;
  --auth-bg: #151e2c;
  --auth-ink: #edf3ff;
  --auth-muted: #afbed1;
  --auth-accent: #a2bfff;
  --auth-line: #a2bfff24;
  --auth-pattern: #a2bfff04;
  --auth-badge-bg: #a2bfff;
  --auth-badge-ink: #142440;
  --chat-user-bg: #293e61;
  --chat-user-ink: #edf3ff;
  --chat-user-line: #6b89bc;
  --toast-bg: #23344e;
  --toast-ink: #edf3ff;
  --toast-line: #6b89bc;
}

[data-theme="lavender-dusk"] {
  color-scheme: dark;
  --canvas: #1c1626;
  --chrome: #241b30;
  --surface: #2b2138;
  --surface-soft: #342943;
  --surface-hover: #40314f;
  --ink: #f7f0ff;
  --ink2: #e1d1ed;
  --muted: #c3b2d3;
  --line: #514260;
  --line-strong: #8e7da0;
  --primary: #cfb0ff;
  --primary-d: #e1cdff;
  --primary-l: #3b2b50;
  --on-primary: #2c1744;
  --primary-glass: #2c17441c;
  --accent-line: #a48ac5;
  --focus: #cfb0ff;
  --focus-ring: #cfb0ff30;
  --selection: #573d77;
  --shadow-color: #100a1b40;
  --overlay: #100a1bb3;
  --auth-bg: #241b30;
  --auth-ink: #f7f0ff;
  --auth-muted: #c3b2d3;
  --auth-accent: #cfb0ff;
  --auth-line: #cfb0ff24;
  --auth-pattern: #cfb0ff04;
  --auth-badge-bg: #cfb0ff;
  --auth-badge-ink: #2c1744;
  --chat-user-bg: #49335f;
  --chat-user-ink: #f7f0ff;
  --chat-user-line: #9577b7;
  --toast-bg: #3b2b50;
  --toast-ink: #f7f0ff;
  --toast-line: #9577b7;
}

/* Keep feedback/status colours readable on either dark palette. */
[data-theme="midnight"], [data-theme="lavender-dusk"] {
  --success-bg: #18342c;
  --success-ink: #9addb3;
  --success-line: #35604a;
  --warning-bg: #352d21;
  --warning-ink: #f2cc85;
  --warning-line: #685637;
  --danger-bg: #38252e;
  --danger-ink: #ffb1b8;
  --danger-line: #75454f;
  --danger-solid: #a23f42;
  --info-bg: #203149;
  --info-ink: #adcaff;
  --info-line: #465f85;
  --pink-bg: #382c3e;
  --pink-ink: #e9b3cf;
  --purple-bg: #302b46;
  --purple-ink: #cbb5ee;
  --teal-bg: #223740;
  --teal-ink: #a1d5de;
}

/* Theme controls use the same palette as the rest of the app. */
body { background: var(--canvas); }
.auth-art { border-right: 1px solid var(--line); }
.btn-soft { border-color: var(--line); }
.appearance-button { display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:36px;padding:7px 11px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink2);font-size:0.75rem;font-weight:700;white-space:nowrap; }
.appearance-button:hover { background:var(--surface-hover);border-color:var(--line-strong); }
.appearance-button svg { width:16px;height:16px; }
.auth-form-wrap { position:relative;padding-top:80px; }
.auth-appearance { position:absolute;top:23px;right:25px; }
.appearance-panel { margin-bottom:22px; }
.appearance-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px; }
.appearance-heading h2 { font-size:1.4375rem;font-weight:800;line-height:1.3; }
.appearance-heading p { color:var(--muted);font-size:0.8125rem;margin-top:7px; }
.appearance-heading > svg { width:25px;height:25px;color:var(--primary); }
.appearance-current { color:var(--ink2);font-size:0.75rem;margin-top:8px; }
.appearance-current strong { color:var(--primary);font-weight:750; }
.theme-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px; }
.theme-choice { display:flex;flex-direction:column;min-width:0;padding:7px;border:1px solid var(--line);border-radius:12px;background:var(--surface);text-align:left;transition:border-color .18s,box-shadow .18s; }
.theme-choice:hover { border-color:var(--line-strong); }
.theme-choice.selected { border-color:var(--primary);box-shadow:0 0 0 1px var(--primary); }
.theme-choice-copy { display:block;padding:12px 5px 8px; }
.theme-choice strong { display:block;color:var(--ink);font-size:0.8125rem;font-weight:800;line-height:1.4; }
.theme-choice small { display:block;margin-top:5px;color:var(--muted);font-size:0.6875rem;line-height:1.6; }
.theme-status { color:var(--muted);font-size:0.6875rem;line-height:1.7;margin-top:16px; }
.theme-preview { display:flex;position:relative;overflow:hidden;width:100%;height:102px;border:1px solid var(--preview-line);border-radius:7px;background:var(--preview-canvas); }
.preview-white { --preview-canvas:#ffffff;--preview-surface:#ffffff;--preview-line:#dce2eb;--preview-ink:#202938;--preview-accent:#315fca; }
.preview-blue { --preview-canvas:#f3f6fb;--preview-surface:#ffffff;--preview-line:#d7e0ef;--preview-ink:#1d304b;--preview-accent:#204c97; }
.preview-sage { --preview-canvas:#f6f7f2;--preview-surface:#fbfcf8;--preview-line:#d5dfcb;--preview-ink:#233b34;--preview-accent:#245c46; }
.preview-midnight { --preview-canvas:#101722;--preview-surface:#182232;--preview-line:#34445a;--preview-ink:#edf3ff;--preview-accent:#a2bfff; }
.preview-yahoo-lavender { --preview-canvas:#f5f0ff;--preview-surface:#ffffff;--preview-line:#e3d6f5;--preview-ink:#2c1944;--preview-accent:#6001d2; }
.preview-lavender-mist { --preview-canvas:#fcf8ff;--preview-surface:#fefcff;--preview-line:#e7d9ee;--preview-ink:#382740;--preview-accent:#794b96; }
.preview-french-lavender { --preview-canvas:#eae3f5;--preview-surface:#fcfaff;--preview-line:#d7c9e8;--preview-ink:#30263f;--preview-accent:#624493; }
.preview-lavender-dusk { --preview-canvas:#1c1626;--preview-surface:#2b2138;--preview-line:#514260;--preview-ink:#f7f0ff;--preview-accent:#cfb0ff; }
.preview-sidebar { display:flex;flex-direction:column;gap:7px;width:25%;flex:none;padding:12px 6px;border-right:1px solid var(--preview-line);background:var(--preview-surface); }
.preview-sidebar i { height:3px;width:70%;border-radius:3px;background:var(--preview-line); }
.preview-sidebar i:first-child { height:9px;width:9px;margin-bottom:5px;background:var(--preview-accent); }
.preview-sidebar i:nth-child(2) { width:100%;height:5px;background:var(--preview-accent); }
.preview-workspace { flex:1;min-width:0;padding:14px 10px; }
.preview-heading { display:block;width:58%;height:4px;border-radius:3px;margin-bottom:11px;background:var(--preview-ink); }
.preview-metrics { display:flex;gap:4px;margin-bottom:7px; }
.preview-metrics i { flex:1;height:16px;border:1px solid var(--preview-line);border-radius:3px;background:var(--preview-surface); }
.preview-content { display:flex;gap:5px; }
.preview-content i { flex:1;height:26px;border:1px solid var(--preview-line);border-radius:3px;background:var(--preview-surface); }
.theme-check { display:grid;place-items:center;position:absolute;right:7px;bottom:7px;width:20px;height:20px;border-radius:50%;background:var(--preview-accent);color:var(--preview-canvas);opacity:0; }
.theme-choice.selected .theme-check { opacity:1; }
.appearance-dialog .theme-grid { grid-template-columns:repeat(2,minmax(0,1fr));margin-top:24px; }
.appearance-dialog h2 { margin-top:13px; }
.appearance-dialog > .secondary-text { font-size:0.8125rem; }
.appearance-dialog .theme-preview { height:110px; }
.appearance-done { display:flex;justify-content:flex-end;gap:12px;margin-top:23px;padding-top:20px;border-top:1px solid var(--line); }
.voice-settings-panel { margin-bottom:22px; }
@media(min-width:961px) { .modal-window:has(.appearance-dialog) { width:min(100%,900px); }.appearance-dialog .theme-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:1140px) { .theme-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.theme-preview { height:110px; } }
@media(max-width:760px) { .appearance-button { min-height:36px; }.topbar .appearance-button { width:36px;padding:0; }.topbar .appearance-button > span:last-child { display:none; }.top-actions { gap:10px; }.breadcrumb { min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }.mobile-menu,.top-actions { flex:none; } }
@media(max-width:520px) { .breadcrumb-root,.breadcrumb-slash { display:none; }.appearance-heading { gap:12px;margin-bottom:20px; }.appearance-heading h2 { font-size:1.375rem; }.theme-grid { gap:11px; }.theme-choice { padding:5px; }.theme-choice-copy { padding:10px 5px 7px; }.theme-choice strong { font-size:0.75rem; }.theme-choice small { font-size:0.625rem; }.theme-preview,.appearance-dialog .theme-preview { height:88px; }.preview-workspace { padding:12px 7px; }.preview-sidebar { padding-inline:5px; }.appearance-heading p { font-size:0.75rem; }.auth-appearance { top:20px;right:23px; } }
@media(forced-colors:active) { .theme-choice.selected { outline:2px solid Highlight;outline-offset:2px; }.theme-check { forced-color-adjust:none; } }
