/* Pixel Obsidian Gold — shared visual tokens and cross-workspace finishing layer.
   Contextual behavior and animation ownership remain with the existing UI systems. */
:root {
    color-scheme: dark;

    /* Master design tokens. Legacy variables below resolve through this layer. */
    --bg-0: #080808;
    --bg-1: #0b0b0c;
    --bg-2: #0f1012;
    --surface-1: #141518;
    --surface-2: #18191c;
    --text-primary: #f5f5f5;
    --text-secondary: #a6a6a6;
    --text-tertiary: #6e7075;
    --text-disabled: #4f5156;
    --gold-primary: #d4af37;
    --gold-bright: #f3d76b;
    --gold-deep: #8f7420;
    --gold-08: rgba(212, 175, 55, .08);
    --gold-12: rgba(212, 175, 55, .12);
    --gold-16: rgba(212, 175, 55, .16);
    --border-subtle: rgba(255, 255, 255, .05);
    --border-default: rgba(255, 255, 255, .07);
    --border-strong-token: rgba(255, 255, 255, .10);

    --font-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Bitcount Single", "Inter", sans-serif;
    --font-code: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    --text-xs: 11px;
    --text-sm: 12px;
    --text-md: 13px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 20px;
    --text-3xl: 24px;
    --text-4xl: 28px;
    --text-5xl: 32px;
    --text-6xl: 40px;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --leading-tight: 1.15;
    --leading-snug: 1.3;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;
    --leading-code: 1.6;
    --tracking-tight: -.02em;
    --tracking-normal: 0;
    --tracking-wide: .02em;
    --tracking-label: .04em;

    /* Core surfaces */
    --bg: var(--bg-0);
    --surface: var(--bg-2);
    --surface-raised: var(--surface-1);
    --surface-hover: var(--surface-2);
    --surface-active: #202125;

    /* Pixel identity */
    --gold: var(--gold-primary);
    --gold-light: var(--gold-bright);
    --gold-glow: rgba(212, 175, 55, .16);
    --gold-subtle: rgba(212, 175, 55, .08);

    /* Information hierarchy */
    --text: var(--text-primary);
    --text-muted: var(--text-tertiary);
    --text-inverse: #080808;

    /* Edges and semantic feedback */
    --border: var(--border-default);
    --border-strong: var(--border-strong-token);
    --border-gold: rgba(212, 175, 55, .26);
    --border-gold-strong: rgba(212, 175, 55, .52);
    --danger: #e06b68;
    --danger-subtle: rgba(224, 107, 104, .12);
    --success: #66b989;
    --success-subtle: rgba(102, 185, 137, .12);

    /* Shared geometry */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 48px;
    --space-10: 64px;
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 8px;
    --radius-input: 10px;
    --radius-button: 8px;
    --radius-card: 12px;
    --radius-panel: 16px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Type and motion */
    --font-sans: var(--font-primary);
    --font-mono: var(--font-code);
    --text-display: clamp(32px, 3.2vw, 40px);
    --text-page-title: clamp(24px, 2.4vw, 30px);
    --text-section-title: 20px;
    --text-body: 14px;
    --text-label: 12px;
    --text-meta: 11px;
    --motion-fast: 150ms;
    --motion-normal: 200ms;
    --motion-medium: 250ms;
    --motion-slow: 350ms;
    --motion-base: var(--motion-normal);
    --ease: var(--motion-base) cubic-bezier(.2, .7, .2, 1);

    /* Restrained depth */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .18);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, .32);
    --shadow-lg: 0 22px 60px rgba(0, 0, 0, .5);
    --shadow-gold: 0 0 16px rgba(212, 175, 55, .12);
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 14%, transparent);
    --z-base: 1;
    --z-panel: 10;
    --z-context-menu: 30;
    --z-topbar: 40;
    --z-composer: 50;
    --z-dropdown: 90;
    --z-overlay: 100;
    --z-sidebar: 110;
    --z-modal: 200;
}

body.light-mode {
    color-scheme: light;
    --bg-0: #f6f6f4;
    --bg-1: #f9f9f7;
    --bg-2: #ffffff;
    --surface-1: #f2f2ef;
    --surface-2: #e9e9e5;
    --text-primary: #202126;
    --text-secondary: #55575d;
    --text-tertiary: #747680;
    --text-disabled: #9a9ba0;
    --border-subtle: rgba(24, 25, 28, .05);
    --border-default: rgba(24, 25, 28, .075);
    --border-strong-token: rgba(24, 25, 28, .12);
    --bg: #f6f6f4;
    --surface: #ffffff;
    --surface-raised: #f2f2ef;
    --surface-hover: #e9e9e5;
    --surface-active: #deded8;
    --gold: #8f7420;
    --gold-light: #755e18;
    --gold-deep: #6e5919;
    --gold-glow: rgba(143, 116, 32, .14);
    --gold-subtle: rgba(143, 116, 32, .08);
    --text: #202126;
    --text-secondary: #55575d;
    --text-muted: #747680;
    --text-disabled: #9a9ba0;
    --text-inverse: #ffffff;
    --border: rgba(24, 25, 28, .075);
    --border-strong: rgba(24, 25, 28, .12);
    --border-gold: rgba(143, 116, 32, .25);
    --border-gold-strong: rgba(143, 116, 32, .48);
    --shadow-sm: 0 2px 8px rgba(30, 30, 24, .05);
    --shadow-md: 0 12px 32px rgba(30, 30, 24, .08);
    --shadow-lg: 0 22px 60px rgba(30, 30, 24, .14);
    --shadow-gold: 0 0 16px rgba(143, 116, 32, .1);
}

body {
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Keep the standard and Firefox-prefixed selectors separate so browsers do not
   discard the standard rule when they don't recognize the vendor selector. */
*::selection,
input::selection,
textarea::selection {
    color: #0a0a0a !important;
    background-color: #d4af37 !important;
    -webkit-text-fill-color: #0a0a0a;
    text-shadow: none;
}

*::-moz-selection,
input::-moz-selection,
textarea::-moz-selection {
    color: #0a0a0a !important;
    background-color: #d4af37 !important;
    text-shadow: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

:is(.app, dialog, [role="dialog"]) {
    font-family: var(--font-primary);
    color: var(--text-primary);
}

:is(pre, code, kbd, samp, .CodeMirror, .code-editor-pane, .terminal-output) {
    font-family: var(--font-code);
    line-height: var(--leading-code);
}

button:not(:disabled) {
    transition-duration: var(--motion-normal);
}

button:disabled,
[role="button"][aria-disabled="true"] {
    cursor: not-allowed;
}

:is(.topbar-btn, .composer-btn, .settings-tab, .sidebar-footer-btn,
    .workspace-nav-btn, .workspace-new-btn, .projects-primary-btn,
    .projects-quiet-btn, .research-primary-btn, .research-quiet-btn,
    .canvas-primary-btn, .canvas-secondary-btn, .code-toolbar-btn,
    .code-primary-btn, .pixel-notification-quiet-btn, .pixel-notification-icon-btn,
    .nav-btn, .nav-chat-link) {
    border-radius: var(--radius-button);
    transition-property: color, background-color, border-color, box-shadow, transform;
    transition-duration: var(--motion-fast);
    transition-timing-function: cubic-bezier(.2, .7, .2, 1);
}

:is(.topbar-btn, .composer-btn, .workspace-nav-btn, .projects-quiet-btn,
    .research-quiet-btn, .canvas-secondary-btn, .code-toolbar-btn,
    .pixel-notification-quiet-btn, .nav-btn, .nav-chat-link):hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 24%, var(--border));
    background-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 6%, var(--surface-hover));
}

:is(.settings-input, .settings-select-inline, .user-chat-search-input,
    .command-palette input, .global-search-dialog input,
    .project-dialog input, .project-dialog select, .project-dialog textarea,
    .research-dialog input, .research-dialog select, .research-dialog textarea,
    .code-dialog input, .code-dialog select, .code-dialog textarea,
    .canvas-dialog input:not([type="checkbox"]):not([type="color"]),
    .canvas-dialog select, .canvas-dialog textarea) {
    border-color: var(--border-default);
    border-radius: var(--radius-input);
    color: var(--text-primary);
    background-color: var(--surface);
    font-family: var(--font-primary);
    transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

:is(.settings-input, .settings-select-inline, .user-chat-search-input,
    .command-palette input, .global-search-dialog input,
    .project-dialog input, .project-dialog select, .project-dialog textarea,
    .research-dialog input, .research-dialog select, .research-dialog textarea,
    .code-dialog input, .code-dialog select, .code-dialog textarea,
    .canvas-dialog input:not([type="checkbox"]):not([type="color"]),
    .canvas-dialog select, .canvas-dialog textarea):focus {
    border-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 72%, var(--border-strong));
    box-shadow: var(--focus-ring);
}

::placeholder {
    color: var(--text-tertiary);
    opacity: 1;
}

dialog::backdrop {
    background: rgba(0, 0, 0, .68);
}

:is(.settings-dialog, .command-palette, .global-search-dialog,
    .pixel-notification-dialog, .project-dialog, .research-dialog,
    .code-dialog, .canvas-dialog, .artwork-lightbox-dialog, .chat-modal-dialog) {
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-lg);
}

.command-palette[open] .command-palette-shell {
    box-shadow: var(--shadow-lg), 0 0 16px color-mix(in srgb, var(--pixel-ambient-glow, var(--gold-glow)) 36%, transparent);
}

dialog[open] {
    box-shadow: var(--shadow-lg), 0 0 18px color-mix(in srgb, var(--pixel-ambient-glow, var(--gold-glow)) 42%, transparent);
}

[role="tooltip"] {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--text-primary);
    font: var(--weight-medium) var(--text-sm)/var(--leading-snug) var(--font-primary);
    box-shadow: var(--shadow-md);
}

:is(.settings-dialog, .command-palette, .global-search-dialog,
    .pixel-notification-dialog, .project-dialog, .research-dialog,
    .code-dialog, .canvas-dialog, .artwork-lightbox-dialog, .chat-modal-dialog) h1,
:is(.settings-dialog, .command-palette, .global-search-dialog,
    .pixel-notification-dialog, .project-dialog, .research-dialog,
    .code-dialog, .canvas-dialog, .artwork-lightbox-dialog, .chat-modal-dialog) h2 {
    color: var(--text-primary);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-tight);
}

:is(.settings-dialog, .command-palette, .global-search-dialog,
    .pixel-notification-dialog, .project-dialog, .research-dialog,
    .code-dialog, .canvas-dialog, .artwork-lightbox-dialog, .chat-modal-dialog) small,
:is(.settings-dialog, .command-palette, .global-search-dialog,
    .pixel-notification-dialog, .project-dialog, .research-dialog,
    .code-dialog, .canvas-dialog, .artwork-lightbox-dialog, .chat-modal-dialog) .muted {
    color: var(--text-secondary);
}

:is(.app-view-panel, .workspace-view, .projects-view, .research-view,
    .canvas-view, .code-view, .notes-view) {
    min-width: 0;
}

:is(body, dialog, [role="dialog"]) :is(button, input, select, textarea, [role="button"]):focus-visible {
    outline: 2px solid color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 74%, white);
    outline-offset: 2px;
}

/* The composer surface owns its focus state; keep a second outline off the text field. */
.composer-input-row textarea:focus-visible,
.user-chat-composer-box textarea:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Keep native select intrinsic sizing from widening the custom model form. */
.custom-model-form {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
}

.custom-model-form .settings-input,
.custom-model-form .settings-select-inline {
    box-sizing: border-box;
    width: min(240px, 100%);
    min-width: 0;
    max-width: 100%;
}

.custom-model-form .settings-select-inline {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* AI's latest button is anchored to the visible chat viewport by chat.js. */
.ai-scroll-bottom-btn {
    position: fixed;
    right: auto;
    bottom: auto;
    left: 50%;
    top: calc(100dvh - 160px);
    transform: translateX(-50%);
    z-index: calc(var(--z-composer, 40) + 1);
}

.ai-scroll-bottom-btn:hover {
    transform: translateX(-50%) translateY(-2px) scale(1.05);
}

/* Subtle, consistent message surfaces preserve the existing message structure. */
.message.user .bubble {
    background: color-mix(in srgb, var(--surface-raised) 91%, var(--pixel-ambient-accent, var(--gold)) 9%);
    border-color: var(--border-strong);
}

.message.user:hover .bubble {
    border-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 28%, var(--border));
}

.message.ai .bubble {
    border-left-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 32%, transparent);
    border-radius: 2px var(--radius-sm) var(--radius-sm) 2px;
    padding-block: 10px;
}

:is(.topbar, .workspace-topbar, .projects-topbar, .research-topbar, .code-topbar, .canvas-topbar, .notes-topbar, .whiteboard-topbar) {
    border-color: var(--border);
    background-color: color-mix(in srgb, var(--surface) 94%, transparent);
    color: var(--text);
}

:is(.topbar-btn, .composer-btn, .modal-close, .settings-tab, .command-palette button, .global-search-dialog button) {
    font-family: var(--font-sans);
    transition: background-color var(--motion-fast) ease,
        color var(--motion-fast) ease,
        border-color var(--motion-fast) ease,
        box-shadow var(--motion-fast) ease;
}

:is(.topbar-btn, .composer-btn):hover {
    color: var(--pixel-ambient-accent, var(--gold));
}

:is(.settings-dialog, .command-palette, .global-search-dialog, .pixel-notification-dialog,
    .project-dialog, .research-dialog, .code-dialog, .artwork-lightbox-dialog, .chat-modal-dialog) {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-strong);
}

.settings-dialog {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 24px var(--pixel-ambient-glow, rgba(212, 175, 55, .14));
}

.settings-nav {
    background: color-mix(in srgb, var(--bg) 58%, var(--surface));
}

.settings-tab.active {
    background: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 10%, var(--surface-raised));
}

.settings-tab.active i {
    color: var(--pixel-ambient-accent, var(--gold));
}

.workspace-nav-btn.is-active {
    background: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 10%, var(--surface-raised));
}

.workspace-nav-btn.is-active i,
.workspace-tool-card:not(:disabled):hover .workspace-tool-icon,
.workspace-tool-card:focus-visible .workspace-tool-icon {
    color: var(--pixel-ambient-accent, var(--gold));
}

.workspace-tool-card:not(:disabled):hover,
.workspace-tool-card:focus-visible {
    border-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 32%, var(--border));
}

.command-row:hover,
.command-row.is-active,
.command-ask-row:hover,
.command-row:focus-visible,
.command-ask-row:focus-visible {
    border-color: rgba(246, 195, 62, .74);
    background: linear-gradient(105deg, rgba(209, 153, 26, .17), rgba(139, 96, 16, .095) 58%, rgba(255, 255, 255, .025));
    box-shadow: inset 0 0 0 1px rgba(255, 208, 82, .12), 0 0 22px rgba(230, 166, 24, .13);
}

.command-row.is-active {
    box-shadow: inset 3px 0 #f4c247, inset 0 0 0 1px rgba(255, 208, 82, .15), 0 0 24px rgba(230, 166, 24, .15);
}

.command-row.is-active .command-row-icon,
.command-pin.is-pinned {
    color: var(--pixel-ambient-accent, var(--gold));
}

.command-row.is-active {
    outline: 1px solid rgba(255, 204, 75, .34);
    outline-offset: -1px;
}

.command-pin:focus-visible,
.command-palette button:focus-visible {
    outline-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 76%, white);
}

.project-tab.is-active {
    color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 76%, white);
    background: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 9%, var(--surface-raised));
}

:is(.starter-card, .workspace-tool-card, .project-card, .project-overview-card,
    .project-resource-card, .artwork-card, .canvas-card, .notes-card,
    .research-answer, .pixel-notification-item) {
    border-color: var(--border-default);
    border-radius: var(--radius-card);
    transition: border-color var(--motion-fast) ease,
        background-color var(--motion-fast) ease,
        box-shadow var(--motion-fast) ease,
        transform var(--motion-fast) ease;
}

:is(.starter-card, .workspace-tool-card, .project-card, .project-overview-card,
    .project-resource-card, .artwork-card, .canvas-card, .notes-card,
    .research-answer):hover {
    border-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 24%, var(--border-default));
}

.pixel-notification-item.is-unread {
    border-inline-start: 2px solid var(--pixel-ambient-accent, var(--gold));
}

:is(.pixel-toast--success, .pixel-notification-item[data-type="success"]) {
    border-color: color-mix(in srgb, var(--success) 38%, var(--border-default));
}

:is(.pixel-toast--error, .pixel-notification-item[data-type="error"]) {
    border-color: color-mix(in srgb, var(--danger) 42%, var(--border-default));
}

:is(.settings-section-header h3, .workspace-view h1, .projects-view h1,
    .research-view h1, .canvas-view h1, .notes-view h1) {
    color: var(--text-primary);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-snug);
}

:is(.settings-section-header h3, .workspace-view h1, .projects-view h1,
    .research-view h1, .canvas-view h1, .notes-view h1):not(.display-heading) {
    font-family: var(--font-primary);
}

:is(.message-content, .user-text, .research-answer, .project-description) {
    line-height: var(--leading-relaxed);
}

:is(.message-content, .user-text) :is(p, ul, ol, blockquote, table, pre) + :is(p, ul, ol, blockquote, table, pre) {
    margin-top: var(--space-3);
}

:is(.message-content, .user-text) :is(code, .inline-code) {
    font-family: var(--font-code);
}

:is(.message-content, .user-text) :is(h1, h2, h3, h4) {
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-tight);
}

:is(.message-content, .user-text) a {
    color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 72%, white);
    text-underline-offset: 2px;
}

.message-content pre,
.user-text pre {
    border-color: var(--border-subtle);
    border-radius: var(--radius-card);
}

.settings-section-header h3,
:is(.workspace-view, .projects-view, .research-view, .canvas-view, .notes-view) h1 {
    color: var(--text);
    font-weight: 600;
    letter-spacing: -.025em;
}

.settings-section-header h3 {
    font-size: var(--text-section-title);
}

:is(.workspace-intro h1, .projects-intro h1, .project-workspace-title h1,
    .artworks-title-group h1, .canvas-library-heading h1, .code-projects-heading h2) {
    font-size: var(--text-page-title);
    font-weight: 600;
    letter-spacing: -.03em;
}

:is(.starter-card, .workspace-tool-card, .project-card, .project-overview-card,
    .project-resource-card, .artwork-card, .canvas-card, .research-answer) {
    border-radius: var(--radius-card);
}

:is(.settings-tab, .settings-row, .setting-row, .setting-row-select) {
    border-radius: var(--radius-sm);
}

/* Keep workspace-specific layouts while giving their surfaces shared tokens. */
.research-view {
    --research-bg: var(--bg);
    --research-surface: var(--surface);
    --research-raised: var(--surface-raised);
    --research-border: var(--border);
    --research-text: var(--text);
    --research-muted: var(--text-secondary);
    --research-gold: var(--gold);
}

.canvas-view,
.code-view {
    background: var(--bg);
    color: var(--text);
}

.canvas-topbar,
.canvas-toolrail,
.canvas-ai-panel,
.canvas-more-menu,
.canvas-library-controls > label,
.canvas-library-controls select,
.canvas-card,
.canvas-secondary-btn {
    border-color: var(--border);
    background-color: var(--surface);
    color: var(--text-secondary);
}

.canvas-tools-scroll button.is-active {
    border-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 28%, transparent);
    background: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 11%, var(--surface));
    color: var(--text);
}

.canvas-tools-scroll button.is-active i,
.canvas-card-pin {
    color: var(--pixel-ambient-accent, var(--gold));
}

.canvas-editor,
.canvas-stage-column,
.canvas-controls,
.code-editor-pane,
.CodeMirror,
.CodeMirror-gutters {
    background-color: var(--surface-raised);
}

.canvas-card:hover,
.code-project-card:hover {
    border-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 42%, var(--border));
}

.code-tab.is-active {
    border-top-color: var(--pixel-ambient-accent, var(--gold));
    background: var(--surface-raised);
}

.code-tab-dirty {
    color: var(--pixel-ambient-accent, var(--gold));
}

.code-bottom-tabs [data-bottom-tab].is-active::after {
    background: var(--pixel-ambient-accent, var(--gold));
}

/* Creator profile is a standalone Pixel surface and shares the same type and radius scale. */
.creator-nav {
    border-color: var(--border);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.creator-hero h1 {
    font-size: var(--text-display);
    font-weight: 600;
    letter-spacing: -.04em;
}

.section-heading h2 {
    font-size: var(--text-section-title);
    font-weight: 600;
    letter-spacing: -.02em;
}

:is(.nav-btn, .nav-chat-link) {
    border-radius: var(--radius-sm);
}

:is(.project-item, .social-profile) {
    border-radius: var(--radius-card);
    border-color: var(--border);
}

.project-item:hover,
.artwork-access:hover {
    border-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 30%, var(--border));
}

.about-content blockquote {
    border-left-color: var(--pixel-ambient-accent, var(--gold));
}

:is(.settings-content, .settings-nav, .command-palette-results, .global-search-results) {
    scrollbar-color: rgba(255, 255, 255, .16) transparent;
    scrollbar-width: thin;
}

:is(.starter-card, .workspace-card, .project-card, .artwork-card, .notes-card, .research-answer) {
    border-color: var(--border);
}

:is(.starter-card, .workspace-card, .project-card, .artwork-card, .notes-card):hover {
    border-color: color-mix(in srgb, var(--pixel-ambient-accent, var(--gold)) 22%, var(--border));
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --motion-fast: 1ms;
        --motion-base: 1ms;
        --motion-normal: 1ms;
        --motion-medium: 1ms;
        --motion-slow: 1ms;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Keep search controls clean and borderless across every workspace. */
:is(
    input[type="search"],
    .user-chat-search-input,
    .sidebar-search-box,
    .artworks-search-box input,
    .notes-global-search,
    .projects-search,
    .project-resources-header input[type="search"],
    .research-search,
    .whiteboard-search,
    .canvas-library-controls > label,
    .global-search-input-row,
    .command-palette-search-row,
    .search-field
) {
    border-color: transparent !important;
    box-shadow: none !important;
}

:is(input[type="search"], .user-chat-search-input, .artworks-search-box input) {
    border: 0 !important;
    outline: 0 !important;
}

:is(.sidebar-search-box, .artworks-search-box, .notes-global-search,
    .projects-search, .research-search, .whiteboard-search,
    .canvas-library-controls > label, .search-field):focus-within {
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Pixel premium chat refinement ------------------------------------------------
   This layer intentionally restyles the existing chat shell instead of introducing
   parallel components. */
:root {
    --sidebar-width: 252px;
    --content-width: 820px;
    --topbar-height: 62px;
}

body {
    background:
        radial-gradient(850px 560px at 83% 84%, rgba(157, 104, 13, .11), transparent 66%),
        radial-gradient(620px 440px at 50% 8%, rgba(255, 255, 255, .018), transparent 72%),
        #090a0b;
}

body::before,
body::after,
.main::before { opacity: .045; }

.sidebar {
    background: linear-gradient(180deg, rgba(13, 15, 17, .98), rgba(9, 10, 11, .99));
    border-right-color: rgba(255, 255, 255, .075);
    box-shadow: 16px 0 42px rgba(0, 0, 0, .14);
}

.sidebar-header {
    height: 62px;
    padding-inline: 18px;
    border-bottom-color: rgba(255, 255, 255, .065);
}

.sidebar-logo {
    width: 27px;
    height: 27px;
}

.sidebar-logo img,
.emblem-img,
.ai-avatar img,
.pixel-loader__brand img { filter: drop-shadow(0 0 7px rgba(255, 193, 58, .22)); }

/* Refined startup loader */
.pixel-loader {
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 48%, rgba(212, 175, 55, .075), transparent 31%),
        linear-gradient(145deg, #101113 0%, #090a0b 56%, #0d0d0e 100%);
}
.pixel-loader::before,
.pixel-loader::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.pixel-loader::before {
    z-index: -1;
    opacity: .22;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%);
}
.pixel-loader::after {
    z-index: -1;
    background: radial-gradient(ellipse at center, transparent 28%, rgba(0,0,0,.46) 100%);
}
.pixel-loader__ambient {
    position: absolute;
    z-index: -1;
    width: min(560px, 85vw);
    aspect-ratio: 1;
    border: 1px solid rgba(212,175,55,.055);
    border-radius: 50%;
    box-shadow: 0 0 0 42px rgba(212,175,55,.018), 0 0 0 96px rgba(212,175,55,.012), inset 0 0 90px rgba(212,175,55,.025);
    animation: pixel-loader-breathe 5s ease-in-out infinite;
}
.pixel-loader__content { position: relative; width: min(320px, calc(100vw - 48px)); }
.pixel-loader__eyebrow {
    margin-bottom: 22px;
    color: rgba(221, 203, 149, .63);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .22em;
    opacity: 0;
    animation: pixel-loader-status-in 420ms ease 80ms forwards;
}
.pixel-loader__brand { gap: 12px; font-size: 26px; font-weight: 580; letter-spacing: .11em; }
.pixel-loader__emblem {
    position: relative;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
}
.pixel-loader__emblem::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(221, 184, 76, .24);
    border-radius: 16px;
    transform: rotate(45deg);
    box-shadow: 0 0 24px rgba(212,175,55,.1), inset 0 0 16px rgba(212,175,55,.06);
}
.pixel-loader__emblem img { position: relative; width: 31px; height: 31px; filter: drop-shadow(0 0 10px rgba(255,193,58,.36)); }
.pixel-loader__orbit {
    position: absolute;
    inset: -3px;
    border: 1px solid transparent;
    border-top-color: rgba(246,213,126,.84);
    border-right-color: rgba(246,213,126,.18);
    border-radius: 50%;
    animation: pixel-loader-spin 4s linear infinite;
}
.pixel-loader__orbit::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #f2d27d;
    box-shadow: 0 0 9px rgba(242,210,125,.9);
}
.pixel-loader__line {
    width: 176px;
    height: 2px;
    margin-top: 30px;
    border-radius: 4px;
    background: rgba(255,255,255,.1);
    box-shadow: 0 0 18px rgba(212,175,55,.08);
}
.pixel-loader__line span {
    width: 52px;
    height: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, #f5d77f 48%, #d4af37 75%, transparent);
    box-shadow: 0 0 11px rgba(233,195,86,.65);
    animation: pixel-loader-travel 1.7s cubic-bezier(.45,0,.55,1) 220ms infinite;
}
.pixel-loader__status { margin-top: 17px; color: #9b9ba0; font-size: 11px; letter-spacing: .025em; }
@keyframes pixel-loader-spin { to { transform: rotate(360deg); } }
@keyframes pixel-loader-breathe { 0%, 100% { transform: scale(.97); opacity: .7; } 50% { transform: scale(1.025); opacity: 1; } }
@keyframes pixel-loader-travel {
    0% { transform: translateX(0); opacity: .45; }
    50% { opacity: 1; }
    100% { transform: translateX(124px); opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
    .pixel-loader__ambient, .pixel-loader__orbit { animation: none; }
    .pixel-loader__eyebrow { animation: none; opacity: 1; }
}

.sidebar-title { font-size: 21px; font-weight: 600; letter-spacing: -.035em; }
.sidebar-version {
    display: inline-flex;
    min-width: 31px;
    height: 18px;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-color: rgba(212, 175, 55, .12);
    border-radius: 999px;
    color: #e7bb45;
    background: rgba(174, 116, 18, .16);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
    line-height: 1;
}
.sidebar-title-group { align-items: center; gap: 7px; }

.sidebar-close-btn { width: 30px; height: 30px; border-radius: 7px; }

.sidebar-actions { gap: 2px; padding: 16px 12px 8px; }
.sidebar-section-label {
    margin: 16px 8px 4px;
    color: #737780;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.sidebar-actions .new-chat-btn {
    min-height: 38px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #b9bec7;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-actions #newChatBtn {
    margin-bottom: 2px;
    border-color: rgba(255, 255, 255, .07);
    color: #e8ebf0;
    background: rgba(255, 255, 255, .025);
}

.sidebar-actions .new-chat-btn i { color: #b5bbc4; font-size: 14px; }
.sidebar-actions #newChatBtn i { color: var(--gold-bright); }
.sidebar-actions .new-chat-btn:hover,
.sidebar-actions .new-chat-btn.is-active {
    border-color: transparent;
    color: #f4f5f7;
    background: rgba(255, 255, 255, .055);
    box-shadow: none;
    transform: none;
}
.sidebar-actions .new-chat-btn:hover i,
.sidebar-actions .new-chat-btn.is-active i { color: var(--gold-bright); }
.sidebar-actions .new-chat-btn.is-active::before {
    width: 3px;
    height: 21px;
    margin-left: -11px;
    margin-right: 8px;
    border-radius: 0 4px 4px 0;
    background: var(--gold-bright);
    box-shadow: 0 0 11px rgba(243, 215, 107, .35);
    content: "";
}
.sidebar-actions .creator-btn { color: #b9bec7; background: transparent; border-color: transparent; }
.sidebar-actions .creator-btn:hover { background: rgba(255, 255, 255, .055); border-color: transparent; }
.shortcut-key { display: none; }

.sidebar-search { display: none; padding: 6px 14px 10px; }
.sidebar-search-box {
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .06) !important;
    border-radius: 7px;
    background: rgba(255, 255, 255, .025);
}
.sidebar-search-box:focus-within { border-color: rgba(212, 175, 55, .36) !important; }
.sidebar-search-box input { font-size: 12px; }

.chat-history { padding: 6px 12px 14px; }
.history-group { margin-bottom: 11px; }
.history-title { padding: 8px 8px 5px; font-size: 10px; letter-spacing: .15em; color: #737780; }
.conversation-item { min-height: 33px; gap: 8px; padding: 7px 8px; border: 0; border-radius: 7px; font-size: 12px; }
.conversation-item:hover { background: rgba(255, 255, 255, .045); }
.conversation-item.active { border: 0; color: #ebeef3; background: rgba(212, 175, 55, .09); box-shadow: inset 2px 0 var(--gold); }
.conversation-item .item-icon { font-size: 12px; }
.item-menu-btn { width: 21px; height: 21px; }

.sidebar-footer { padding: 10px 12px; border-top-color: rgba(255, 255, 255, .07); background: transparent; }
.sidebar-footer-btn { min-height: 42px; padding: 8px 10px; font-size: 12px; }
.sidebar-footer-btn::after { margin-left: auto; color: #8a909a; content: "›"; font-size: 20px; line-height: 1; }
.workspace-nav-copy { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; text-align: left; }
.workspace-nav-copy small { color: #858c96; font-size: 10px; }
.profile-card { padding: 10px 12px 12px; border-top-color: rgba(255, 255, 255, .07); }
.profile-button { min-height: 42px; }

.main { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#aiChatView { background: radial-gradient(ellipse at 50% 55%, rgba(255, 255, 255, .012), transparent 52%); }

.topbar {
    height: 62px;
    padding: 0 28px;
    border-bottom-color: rgba(255, 255, 255, .065);
    background: rgba(10, 11, 12, .84);
    backdrop-filter: blur(18px);
}
.topbar-left { min-width: 0; gap: 11px; }
.topbar-btn { width: 32px; height: 32px; border-radius: 7px; color: #b5bbc4; }
.topbar-btn:hover { border-color: transparent; background: rgba(255, 255, 255, .055); }
.topbar-search {
    display: inline-flex;
    align-items: center;
    width: min(440px, 34vw);
    height: 36px;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    color: #9399a3;
    background: rgba(255, 255, 255, .025);
    font-size: 12px;
    text-align: left;
    transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}
.topbar-search:hover { border-color: rgba(212, 175, 55, .28); background: rgba(255, 255, 255, .04); }
.topbar-search kbd { margin-left: auto; padding: 2px 5px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 4px; color: #858b95; font: 10px var(--font-code); }
.current-chat-meta { display: none; }
.topbar-center { position: relative; margin-left: auto; margin-right: 16px; transform: none; }
.top-model-pill {
    gap: 7px;
    min-height: 34px;
    padding: 5px 10px;
    border-color: rgba(255, 255, 255, .08);
    border-radius: 9px;
    background: rgba(255, 255, 255, .025);
    color: #e7e9ed;
    font-size: 12px;
}
.top-model-pill:hover { border-color: rgba(212, 175, 55, .3); background: rgba(255, 255, 255, .045); box-shadow: none; }
.pill-dot { display: none; }
.pill-star { color: var(--gold-bright); font-size: 16px; line-height: 1; filter: drop-shadow(0 0 5px rgba(243, 215, 107, .32)); }
.pill-badge { padding: 2px 5px; border-radius: 4px; color: #e7bb45; background: rgba(174, 116, 18, .16); font-size: 9px; }
.pill-chevron { margin-left: 2px; font-size: 9px; }
.topbar-right { gap: 5px; }

.chat-container { padding: 24px 24px 172px; }
.chat-area { max-width: min(var(--content-width), 100%); gap: 25px; }
.selected-text-action { position: fixed; z-index: 9999; display: inline-flex; min-height: 36px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid rgba(212,175,55,.28); border-radius: 9px; color: #eee7d1; background: linear-gradient(145deg,#242321,#17181a); box-shadow: 0 8px 24px rgba(0,0,0,.38),inset 0 1px rgba(255,255,255,.05); cursor: pointer; font: 600 11px/1 Inter,sans-serif; white-space: nowrap; }
.selected-text-action[hidden] { display: none; }
.selected-text-action i { color: #e4c660; font-size: 12px; }
.selected-text-action:hover { border-color: rgba(212,175,55,.48); color: #fff5d1; background: linear-gradient(145deg,#302b1c,#1a1a1b); }
.selected-text-action:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.welcome { max-width: 760px; padding: 40px 0 165px; }
.welcome-emblem { width: 57px; height: 57px; margin-bottom: 19px; }
.welcome-title { max-width: 670px; margin: 0 0 11px; font-size: clamp(32px, 3vw, 43px); font-weight: 600; letter-spacing: -.045em; background: none; -webkit-text-fill-color: #eff1f5; }
.welcome-title span { color: var(--gold-bright); }
.welcome-subtitle { margin-bottom: 34px; color: #9ba2ad; font-size: 15px; }
.starter-cards-grid { max-width: 720px; gap: 12px; }
.starter-card {
    --pointer-x: 50%;
    --pointer-y: 50%;
    --card-rotate-x: 0deg;
    --card-rotate-y: 0deg;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 102px;
    padding: 16px;
    border-color: rgba(255, 255, 255, .09);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(22, 24, 28, .82), rgba(15, 17, 20, .86));
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12), inset 0 1px rgba(255, 255, 255, .025);
    transform: perspective(900px) rotateX(var(--card-rotate-x)) rotateY(var(--card-rotate-y));
    transform-style: preserve-3d;
    transition: transform 240ms cubic-bezier(.2, .8, .2, 1), border-color 200ms ease,
        background 220ms ease, box-shadow 240ms ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.starter-card::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(270px circle at var(--pointer-x) var(--pointer-y), rgba(255, 197, 47, .31), transparent 70%),
        linear-gradient(120deg, rgba(255, 222, 142, .045), transparent 44%, rgba(255, 190, 36, .045));
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}
.starter-card > * { position: relative; z-index: 1; }
.starter-card::after { position: absolute; z-index: 2; top: 50%; right: 16px; color: #bbc1ca; content: "→"; font-size: 18px; transform: translateY(-50%); transition: color 180ms ease, transform 220ms cubic-bezier(.2, .8, .2, 1); }
.starter-card:is(:hover, :focus-visible) {
    border-color: rgba(255, 207, 75, .86);
    background: linear-gradient(132deg, rgba(56, 41, 14, .96), rgba(29, 24, 15, .98) 48%, rgba(18, 19, 21, .98));
    box-shadow: 0 0 0 1px rgba(255, 195, 47, .16), 0 0 34px rgba(241, 174, 28, .25),
        0 18px 42px rgba(0, 0, 0, .42), inset 0 0 26px rgba(255, 192, 45, .075);
    transform: perspective(900px) translateY(-3px) rotateX(var(--card-rotate-x)) rotateY(var(--card-rotate-y));
}
.starter-card:is(:hover, :focus-visible)::before { opacity: 1; }
.starter-card:focus-visible { outline: 2px solid rgba(243, 195, 63, .72); outline-offset: 3px; }
.starter-card:active { transform: perspective(900px) translateY(-1px) scale(.985); transition-duration: 90ms; }
.starter-card:is(:hover, :focus-visible)::after { color: #ffe08a; filter: drop-shadow(0 0 7px rgba(255, 196, 45, .8)); transform: translate(4px, -50%); }
.starter-card-top strong { color: #f0f1f4; font-size: 13px; transition: color 180ms ease, transform 180ms ease; }
.starter-card:is(:hover, :focus-visible) .starter-card-top strong { color: #ffe7a6; text-shadow: 0 0 14px rgba(255, 204, 75, .28); transform: translateX(1px); }
.starter-icon { width: 32px; height: 32px; border: 1px solid rgba(212, 175, 55, .14); border-radius: 50%; background: rgba(166, 112, 18, .12); color: var(--gold-bright); box-shadow: inset 0 1px rgba(255, 255, 255, .06); transition: color 180ms ease, background 200ms ease, border-color 200ms ease, box-shadow 220ms ease, transform 220ms cubic-bezier(.2, .8, .2, 1); }
.starter-card:is(:hover, :focus-visible) .starter-icon { border-color: rgba(255, 211, 93, .72); background: rgba(224, 165, 31, .28); box-shadow: 0 0 8px rgba(255, 198, 52, .54), 0 0 24px rgba(242, 174, 25, .28), inset 0 1px rgba(255, 245, 204, .24); color: #ffe28c; transform: translateY(-1px) scale(1.1) rotate(-3deg); }
.starter-text { max-width: calc(100% - 30px); padding-left: 42px; color: #9da4ae; font-size: 12px; transition: color 180ms ease; }
.starter-card:is(:hover, :focus-visible) .starter-text { color: #e3d3a5; }

@media (hover: none) {
    .starter-card:hover {
        border-color: rgba(255, 255, 255, .09);
        background: linear-gradient(135deg, rgba(22, 24, 28, .82), rgba(15, 17, 20, .86));
        box-shadow: 0 4px 16px rgba(0, 0, 0, .12), inset 0 1px rgba(255, 255, 255, .025);
        transform: none;
    }
    .starter-card:hover::before { opacity: 0; }
    .starter-card:hover::after { color: #bbc1ca; filter: none; transform: translateY(-50%); }
    .starter-card:hover .starter-card-top strong { color: #f0f1f4; transform: none; }
    .starter-card:hover .starter-icon { border-color: rgba(212, 175, 55, .14); background: rgba(166, 112, 18, .12); box-shadow: inset 0 1px rgba(255, 255, 255, .06); transform: none; }
    .starter-card:hover .starter-text { color: #9da4ae; }
    .starter-card:active { border-color: rgba(243, 195, 63, .48); background: rgba(28, 26, 21, .96); box-shadow: 0 8px 20px rgba(0, 0, 0, .24), 0 0 20px rgba(212, 175, 55, .08); }
    .starter-card:active::before { opacity: .8; }
}

@media (prefers-reduced-motion: reduce) {
    .starter-card,
    .starter-card::before,
    .starter-card::after,
    .starter-card .starter-icon,
    .starter-card .starter-card-top strong,
    .starter-card .starter-text { transition: none !important; }
    .starter-card:is(:hover, :focus-visible),
    .starter-card:active { transform: none; }
}

/* The existing composer occupies one DOM position and smoothly changes its layout
   state as chat.js toggles is-landing / is-conversation. */
.composer-container {
    bottom: 18px;
    width: min(820px, calc(100% - 48px));
    gap: 7px;
    transition: bottom 420ms cubic-bezier(.2, .78, .2, 1), opacity 220ms ease;
}
#aiChatView.is-landing .composer-container { bottom: clamp(26px, 11vh, 112px); }
.composer-box { padding: 9px 12px; border: 1px solid rgba(226, 180, 66, .38); border-radius: 20px; background: radial-gradient(ellipse at 50% 0%, rgba(202, 153, 43, .055), transparent 68%), rgba(18, 20, 23, .96); box-shadow: 0 0 18px rgba(204, 154, 42, .055), 0 14px 38px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 226, 155, .045); transition: border-color 220ms ease, box-shadow 220ms ease, background-color 220ms ease; }
.composer-box:focus-within { border-color: rgba(255, 202, 83, .7); background-color: rgba(20, 21, 23, .98); box-shadow: 0 0 0 3px rgba(212, 175, 55, .075), 0 0 24px rgba(212, 175, 55, .11), 0 16px 42px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 226, 155, .07); }
.composer-box.is-file-dragover { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(212, 175, 55, .14), 0 0 30px rgba(212, 175, 55, .16); }
.thinking-msg .ai-message-body { width: auto; max-width: min(820px, 100%); flex-direction: row; align-items: center; gap: 9px; }
.thinking-msg .bubble { padding: 10px 13px; }
.thinking-indicator { display: grid; width: 20px; height: 20px; padding: 0; place-items: center; border: 0; background: transparent; }
.thinking-orbit { width: 15px; height: 15px; display: inline-grid; place-items: center; border: 1px solid rgba(236, 190, 75, .28); border-radius: 50%; animation: thinkingOrbit 2.1s linear infinite; }
.thinking-dot { width: 5px; height: 5px; background: #ffd365; box-shadow: 0 0 6px #f3bd4a, 0 0 13px rgba(255, 195, 59, .7); animation: thinkingPulse 1.25s ease-in-out infinite; }
.thinking-label { color: var(--text-muted, #a1a1aa); font-size: 13px; line-height: 1.4; }
.thinking-msg[data-status="generating"] .thinking-label { color: var(--text-secondary, #c4c7ce); }
.stream-cursor { display: inline-block; width: 7px; height: 7px; margin: 0 0 1px 3px; vertical-align: baseline; border-radius: 50%; background: #ffd365; box-shadow: 0 0 6px #f3bd4a, 0 0 14px rgba(255, 195, 59, .68); animation: streamDotPulse .95s ease-in-out infinite alternate; }
.pixel-signature-spark { position: absolute; z-index: 4; top: -13px; right: 16px; display: grid; width: 22px; height: 22px; place-items: center; opacity: 0; pointer-events: none; transform: scale(.35) rotate(-24deg); }
.pixel-signature-spark.is-global { position: fixed; top: 16px; right: auto; left: 50%; }
.pixel-signature-spark img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 7px rgba(255,198,63,.7)); }
.pixel-signature-spark.is-active { animation: pixelSignatureSpark 760ms cubic-bezier(.16,.82,.22,1) both; }
.pixel-signature-spark[data-type="create"] { width: 28px; height: 28px; }
@keyframes pixelSignatureSpark { 0% { opacity: 0; transform: scale(.25) rotate(-30deg); } 30% { opacity: 1; transform: scale(1.12) rotate(8deg); } 68% { opacity: .9; transform: scale(.92) rotate(-4deg); } 100% { opacity: 0; transform: scale(.55) rotate(12deg); } }
@keyframes thinkingOrbit { to { transform: rotate(360deg); } }
@keyframes thinkingPulse { 50% { transform: scale(.72); opacity: .72; } }
@keyframes streamDotPulse { to { opacity: .55; box-shadow: 0 0 3px #f3bd4a, 0 0 8px rgba(255, 195, 59, .45); } }
@media (prefers-reduced-motion: reduce) { .thinking-orbit, .thinking-dot, .stream-cursor, .pixel-signature-spark.is-active { animation: none !important; } .pixel-signature-spark.is-active { opacity: 1; transform: none; } }

/* Workspace hub: match the home screen's warm, premium Pixel surfaces. */
.workspace-view {
    background:
        radial-gradient(680px 440px at 82% 8%, rgba(193, 137, 27, .09), transparent 70%),
        radial-gradient(620px 420px at 4% 58%, rgba(193, 137, 27, .045), transparent 68%),
        #0a0b0d;
}
.workspace-topbar { border-bottom-color: rgba(255,255,255,.065); background: rgba(10,11,13,.83); backdrop-filter: blur(18px); }
.workspace-topbar-label { color: #c4c8d0; font-size: 12px; }
.workspace-new-btn { min-height: 35px; padding-inline: 12px; border-color: rgba(244,195,70,.32); border-radius: 9px; background: linear-gradient(135deg,#f0c450,#d5a42c); box-shadow: 0 4px 18px rgba(211,159,37,.12); }
.workspace-new-btn:hover, .workspace-new-btn[aria-expanded="true"] { background: linear-gradient(135deg,#ffda72,#e7b83e); box-shadow: 0 0 22px rgba(230,180,56,.22); }
.workspace-new-menu { border-color: rgba(255,255,255,.1); border-radius: 11px; background: rgba(17,18,21,.98); box-shadow: 0 20px 54px rgba(0,0,0,.52); backdrop-filter: blur(18px); }
.workspace-new-menu-item:hover { background: rgba(220,171,53,.1); color: #f4d478; }
.workspace-content { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 15px; width: min(100%,1120px); padding: clamp(24px,4.4vw,52px) clamp(16px,3.2vw,36px) 64px; }
.workspace-intro { position: relative; isolation: isolate; grid-column: 1 / -1; overflow: hidden; min-height: 196px; margin-bottom: 3px; padding: 29px 32px; border: 1px solid rgba(232,190,82,.19); border-radius: 18px; background: radial-gradient(ellipse at 84% 38%,rgba(215,165,43,.13),transparent 48%),linear-gradient(115deg,rgba(27,25,20,.96),rgba(17,18,20,.92) 55%,rgba(18,17,15,.92)); box-shadow: 0 14px 42px rgba(0,0,0,.2),inset 0 1px rgba(255,235,178,.045); }
.workspace-intro::after { position: absolute; z-index: -1; top: 50%; right: clamp(25px,9vw,116px); width: 108px; height: 108px; border-radius: 50%; background: url("../assets/pixel-star.svg") center / 44px no-repeat,radial-gradient(circle,rgba(235,181,54,.15),rgba(204,145,24,.04) 48%,transparent 72%); content: ""; transform: translateY(-50%); filter: drop-shadow(0 0 26px rgba(236,185,58,.18)); }
.workspace-eyebrow { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 12px; color: #d9b54c; font-size: 9px; letter-spacing: .17em; }
.workspace-eyebrow::before { width: 6px; height: 6px; border-radius: 50%; background: #f1c64e; box-shadow: 0 0 12px rgba(255,201,62,.7); content: ""; }
.workspace-intro h1 { font-size: clamp(30px,4vw,43px); font-weight: 590; letter-spacing: -.05em; }
.workspace-intro > p:last-child { max-width: 510px; margin-top: 10px; color: #a2a7b0; font-size: 13px; }
.workspace-category, .workspace-recent { min-width: 0; margin: 0; padding: 18px; border: 1px solid rgba(255,255,255,.075); border-radius: 14px; background: linear-gradient(145deg,rgba(21,23,26,.9),rgba(14,15,17,.86)); box-shadow: 0 8px 25px rgba(0,0,0,.13),inset 0 1px rgba(255,255,255,.025); }
.workspace-section-heading { margin-bottom: 13px; padding-bottom: 10px; border-bottom-color: rgba(255,255,255,.065); }
.workspace-section-heading h2 { color: #e7e9ed; font-size: 10px; font-weight: 650; letter-spacing: .15em; }
.workspace-section-heading > span { padding: 3px 6px; border: 1px solid rgba(255,255,255,.065); border-radius: 5px; color: #878d97; background: rgba(255,255,255,.025); font-size: 8px; letter-spacing: .08em; }
.workspace-tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.workspace-tool-card { position: relative; overflow: hidden; min-height: 75px; gap: 10px; padding: 11px; border-color: rgba(255,255,255,.075); border-radius: 10px; background: linear-gradient(135deg,rgba(27,29,32,.82),rgba(19,20,23,.88)); box-shadow: inset 0 1px rgba(255,255,255,.018); }
.workspace-tool-card::after { position: absolute; inset: auto 15px 0; height: 1px; background: linear-gradient(90deg,transparent,rgba(233,185,62,.45),transparent); content: ""; opacity: 0; transition: opacity 180ms ease; }
.workspace-tool-card:not(:disabled):hover { transform: translateY(-2px); border-color: rgba(233,190,76,.4); background: linear-gradient(135deg,rgba(44,37,22,.9),rgba(22,21,19,.96)); box-shadow: 0 8px 24px rgba(0,0,0,.23),0 0 20px rgba(220,166,44,.07),inset 0 1px rgba(255,229,164,.06); }
.workspace-tool-card:not(:disabled):hover::after { opacity: 1; }
.workspace-tool-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; background: color-mix(in srgb,var(--tool-bg,rgba(212,175,55,.1)) 90%,transparent); }
.workspace-tool-copy { gap: 4px; }
.workspace-tool-copy strong { font-size: 11px; }
.workspace-tool-copy small { font-size: 9px; }
.workspace-tool-state { color: #a38a4b; font-size: 8px; }
.workspace-tool-card:disabled { opacity: .74; }
.workspace-notes-category { grid-column: 2; }
.workspace-notes-category .workspace-note-grid .workspace-tool-card { min-height: 75px; }
.workspace-recent { grid-column: 1 / -1; }
.workspace-recent-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
.workspace-recent-empty { grid-column: 1 / -1; padding: 16px 10px; border: 1px dashed rgba(255,255,255,.085); border-radius: 9px; color: #878d96; text-align: center; }
.workspace-recent-item { min-height: 43px; gap: 9px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; background: rgba(255,255,255,.018); }
.workspace-recent-item:hover { border-color: rgba(225,181,64,.15); background: rgba(217,164,42,.055); }
.workspace-recent-copy strong { color: #dce0e6; font-size: 10px; }
.workspace-recent-copy small, .workspace-recent-time { font-size: 9px; }

/* Carry the same finish into the tools opened from the workspace hub. */
:is(.projects-view,.research-view,.notes-view,.code-view,.canvas-view) { background-color: #0a0b0d; }
:is(.projects-topbar,.research-topbar,.notes-topbar,.code-topbar,.canvas-topbar) { border-bottom-color: rgba(255,255,255,.07); background: rgba(12,13,15,.88); backdrop-filter: blur(16px); }
:is(.project-card,.project-overview-card,.research-answer,.notes-card,.notes-editor-panel) { border-color: rgba(255,255,255,.085); background-color: rgba(18,19,22,.92); box-shadow: 0 8px 24px rgba(0,0,0,.14),inset 0 1px rgba(255,255,255,.025); }
:is(.project-card,.research-answer,.notes-card):hover { border-color: rgba(226,183,67,.35); box-shadow: 0 12px 30px rgba(0,0,0,.24),0 0 20px rgba(216,165,42,.055); }
:is(.projects-primary-btn,.canvas-primary-btn) { border-color: rgba(245,201,85,.4); background: linear-gradient(135deg,#efc454,#d6a432); box-shadow: 0 5px 18px rgba(203,153,36,.1); }
:is(.projects-primary-btn,.canvas-primary-btn):hover { filter: brightness(1.08); box-shadow: 0 0 22px rgba(228,176,50,.2); }
:is(.projects-search,.projects-sort,.canvas-library-controls>label,.canvas-library-controls select) { border-color: rgba(255,255,255,.09); background: rgba(17,18,21,.86); }
:is(.project-tab:hover,.project-tab.is-active) { border-color: rgba(228,184,62,.17); }
:is(.research-view,.notes-view,.code-view,.canvas-view) { background-image: radial-gradient(ellipse at 78% 5%,rgba(183,131,27,.065),transparent 43%); }
@media (max-width: 760px) {
    .workspace-content { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .workspace-intro, .workspace-notes-category, .workspace-recent { grid-column: 1; }
    .workspace-intro { min-height: 168px; padding: 23px 20px; }
    .workspace-intro::after { right: 17px; width: 74px; height: 74px; background-size: 32px,auto; opacity: .75; }
    .workspace-category, .workspace-recent { padding: 14px; }
}
@media (max-width: 430px) {
    .workspace-tool-grid, .workspace-recent-list { grid-template-columns: minmax(0,1fr); }
    .workspace-intro h1 { max-width: 230px; font-size: 31px; }
    .workspace-intro > p:last-child { max-width: 250px; font-size: 11px; }
    .workspace-intro::after { right: 8px; width: 62px; height: 62px; opacity: .55; }
}

/* Project identity, resource activity, and quiet loading feedback. */
.project-workspace-header { grid-template-columns: auto 42px minmax(0,1fr) auto; align-items: center; gap: 13px; }
.project-workspace-mark { width: 40px; height: 40px; }
.project-workspace-title .projects-eyebrow { margin-bottom: 5px; }
.project-workspace-title h1 { font-size: clamp(23px,2.4vw,30px); }
.project-workspace-actions { flex-wrap: wrap; justify-content: flex-end; }
.project-workspace .project-tabs { gap: 4px; margin: 21px 0 17px; padding-bottom: 7px; scrollbar-width: thin; }
.project-workspace .project-tab { padding: 8px 10px; border: 1px solid transparent; border-radius: 7px; transition: color 160ms ease,background 160ms ease,border-color 160ms ease; }
.project-workspace .project-tab.is-active { border-color: rgba(231,190,78,.18); background: linear-gradient(135deg,rgba(207,157,41,.12),rgba(207,157,41,.045)); }
.project-card-mark { --project-mark-color: #e9bc49; --project-mark-bg: rgba(212,175,55,.095); --project-mark-border: rgba(212,175,55,.22); border-color: var(--project-mark-border); color: var(--project-mark-color); background: var(--project-mark-bg); }
.project-card-mark[data-accent="blue"] { --project-mark-color: #8bbbe0; --project-mark-bg: rgba(83,151,203,.11); --project-mark-border: rgba(83,151,203,.24); }
.project-card-mark[data-accent="sage"] { --project-mark-color: #9bc39e; --project-mark-bg: rgba(98,156,105,.11); --project-mark-border: rgba(98,156,105,.24); }
.project-card-mark[data-accent="rose"] { --project-mark-color: #e4a2a0; --project-mark-bg: rgba(199,105,112,.11); --project-mark-border: rgba(199,105,112,.24); }
.project-card-mark[data-accent="violet"] { --project-mark-color: #b5a2e7; --project-mark-bg: rgba(140,112,207,.12); --project-mark-border: rgba(140,112,207,.26); }
.project-card { overflow: hidden; border-radius: 13px; background: linear-gradient(145deg,rgba(23,24,27,.96),rgba(15,16,18,.97)); box-shadow: 0 7px 24px rgba(0,0,0,.17),inset 0 1px rgba(255,255,255,.025); }
.project-card:hover, .project-card:focus-within { border-color: rgba(229,185,67,.42); background: linear-gradient(145deg,rgba(31,29,23,.98),rgba(17,17,17,.98)); box-shadow: 0 13px 32px rgba(0,0,0,.28),0 0 20px rgba(219,165,40,.06); }
.project-card-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.project-card-name { margin-top: 14px; }
.project-card-meta { flex-wrap: wrap; row-gap: 5px; }
.project-card-meta span:first-child { color: #aaaeb6; }
.project-card-menu:focus-visible, .project-card-open:focus-visible { outline: 2px solid rgba(240,197,79,.82); outline-offset: 3px; }
.project-card-menu-wrap { position: relative; }
.project-card-menu { display: grid; place-items: center; border: 1px solid transparent; }
.project-card-menu:hover,.project-card-menu[aria-expanded="true"] { border-color: rgba(255,255,255,.08); color: #e5c45f; background: rgba(255,255,255,.04); }
.project-card-menu-panel { position: absolute; top: calc(100% + 5px); right: 0; z-index: 8; display: grid; width: 178px; gap: 2px; padding: 5px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(17,18,20,.98); box-shadow: 0 15px 36px rgba(0,0,0,.45); backdrop-filter: blur(14px); }
.project-card-menu-panel[hidden] { display: none; }
.project-card-menu-panel button { display: flex; min-height: 33px; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 6px; color: #bdc1c8; background: transparent; font: 10px Inter,sans-serif; text-align: left; cursor: pointer; }
.project-card-menu-panel button:hover,.project-card-menu-panel button:focus-visible { outline: 0; color: #f1d478; background: rgba(216,170,47,.09); }
.project-card-menu-panel button i { width: 13px; color: #c7a444; text-align: center; }
.project-card-menu-panel button[data-project-card-action="delete"] { color: #dc9692; }
.project-card-menu-panel button[data-project-card-action="delete"] i { color: #dc8581; }
.project-card-skeleton { min-height: 155px; overflow: hidden; border: 1px solid rgba(255,255,255,.055); border-radius: 13px; background: linear-gradient(105deg,rgba(21,22,25,.72) 25%,rgba(39,39,40,.58) 38%,rgba(21,22,25,.72) 62%); background-size: 380% 100%; animation: projectSkeleton 1.5s ease-in-out infinite; }
@keyframes projectSkeleton { to { background-position-x: -100%; } }
.project-activity-copy { display: grid; min-width: 0; gap: 3px; }
.project-activity-copy strong { overflow: hidden; color: #dce0e6; font-size: 11px; font-weight: 520; text-overflow: ellipsis; white-space: nowrap; }
.project-activity-copy small { color: #848a94; font-size: 9px; text-transform: capitalize; }
.project-recent-item > i:first-child { flex: 0 0 16px; color: #d6ae43; text-align: center; }
.project-appearance-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.project-appearance-fields label { margin-block: 8px; }
.project-appearance-fields select { min-height: 40px; }
.project-resource-card { transition: border-color 170ms ease,background 170ms ease,transform 170ms ease; }
.project-resource-card:hover { transform: translateY(-1px); border-color: rgba(220,178,65,.25); background: rgba(212,175,55,.025); }
.project-resource-actions button:hover { border-color: rgba(220,178,65,.35); color: #f0d47e; }
.project-search-wrap { position: relative; z-index: 4; width: min(100%,460px); margin: -3px 0 15px; }
.project-search { display: flex; height: 37px; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 9px; color: #8d939d; background: rgba(15,16,18,.86); transition: border-color 160ms ease,box-shadow 160ms ease; }
.project-search:focus-within { border-color: rgba(225,181,63,.4); box-shadow: 0 0 0 3px rgba(214,168,48,.055); }
.project-search input { width: 100%; border: 0; outline: 0; color: #eceef2; background: transparent; font: 11px Inter,sans-serif; }
.project-search input::placeholder { color: #737983; }
.project-search-results { position: absolute; top: calc(100% + 6px); right: 0; left: 0; display: grid; max-height: min(360px,50vh); gap: 2px; overflow: auto; padding: 5px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: rgba(17,18,20,.98); box-shadow: 0 18px 44px rgba(0,0,0,.48); backdrop-filter: blur(16px); }
.project-search-results[hidden] { display: none; }
.project-search-result { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid transparent; border-radius: 7px; color: #eceef2; background: transparent; text-align: left; cursor: pointer; }
.project-search-result:hover,.project-search-result:focus-visible { border-color: rgba(218,171,49,.18); outline: 0; background: rgba(207,157,40,.075); }
.project-search-result-copy { display: grid; min-width: 0; gap: 3px; }
.project-search-result-copy strong,.project-search-result-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-search-result-copy strong { font-size: 11px; font-weight: 520; }
.project-search-result-copy small { max-width: 350px; color: #858b95; font-size: 9px; }
.project-search-result-kind { flex: none; padding: 3px 6px; border: 1px solid rgba(255,255,255,.075); border-radius: 5px; color: #c3a34b; font-size: 8px; text-transform: uppercase; }
.project-search-empty { margin: 0; padding: 15px; color: #969ba4; font-size: 11px; text-align: center; }
.project-dialog { border-color: rgba(224,184,72,.18); background: linear-gradient(145deg,#191a1d,#121315); box-shadow: 0 28px 90px rgba(0,0,0,.64),0 0 36px rgba(196,143,24,.055); }
.project-dialog:modal { margin: auto; }
.project-delete-dialog #projectDeleteError { margin: 0 24px 12px; }
.project-dialog :is(input,textarea,select):focus-visible { border-color: rgba(239,194,69,.65); outline: 2px solid rgba(223,174,45,.12); outline-offset: 1px; }
.project-dialog [data-project-dialog-close]:hover { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.045); }
@media (max-width: 900px) { .project-workspace-header { grid-template-columns: auto 42px minmax(0,1fr) auto; gap: 10px; } }
@media (max-width: 600px) {
    .project-workspace-header { grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; }
    .project-back-btn { grid-column: 1 / -1; grid-row: 1; }
    .project-workspace-mark { grid-column: 1; grid-row: 2; width: 34px; height: 34px; }
    .project-workspace-title { grid-column: 2; grid-row: 2; }
    .project-workspace-actions { grid-column: 3; grid-row: 2; gap: 2px; }
    .project-workspace-actions .projects-quiet-btn { width: 34px; min-width: 34px; padding: 0; font-size: 0; }
    .project-workspace-actions .projects-quiet-btn i { margin: 0; font-size: 12px; }
    .project-appearance-fields { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { .project-card-skeleton { animation: none; } }
.composer-toolbar { padding: 0; gap: 8px; }
.composer-toolbar-left { padding-right: 2px; }
.composer-btn { width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%; color: #b5bbc4; }
.composer-input-row textarea { min-height: 34px; padding: 6px 0; font-size: 14px; line-height: 1.45; }
.composer-toolbar-right { gap: 5px; }
.model-button { min-height: 32px; padding: 4px 8px; border-radius: 8px; font-size: 12px; }
.model-btn-icon { color: var(--gold-bright); font-size: 14px; }
.model-menu { width: min(292px, calc(100vw - 32px)); max-height: min(350px, 54vh); padding: 7px; border-color: rgba(255, 255, 255, .11); border-radius: 11px; background: rgba(16, 18, 21, .98); box-shadow: 0 22px 44px rgba(0, 0, 0, .48); }
#modelMenu.topbar-open.show { position: absolute !important; top: calc(100% + 8px) !important; right: auto !important; bottom: auto !important; left: 0 !important; z-index: calc(var(--z-topbar) + 2) !important; }
.model-menu-header { padding: 4px 5px 7px; }
.model-menu-title { color: #a8afb9; font-size: 10px; }
.model-menu-badge { display: none; }
.model-menu-list { gap: 2px; }
.model-item { gap: 2px; padding: 8px 9px; border-radius: 7px; }
.model-item:hover { background: rgba(255, 255, 255, .06); border-color: transparent; }
.model-item.selected { border-color: rgba(212, 175, 55, .38); background: rgba(212, 175, 55, .08); }
.model-item-name { font-size: 12px; }
.model-item-badge { padding: 1px 4px; font-size: 9px; }
.model-item-desc { overflow: hidden; color: #8e96a0; font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.model-caps { display: none; }
.action-circle-btn.send-btn { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%; background: linear-gradient(135deg, #ffdb68, #d89a20); color: #171208; box-shadow: 0 2px 12px rgba(212, 175, 55, .2); }
.action-circle-btn.send-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212, 175, 55, .3); }
.composer-legal-hint { color: #6f7680; font-size: 10px; }

.welcome.hide { display: flex; position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-12px); transition: opacity 220ms ease, transform 260ms ease, visibility 0s linear 260ms; }
.welcome:not(.hide) { opacity: 1; transform: translateY(0); transition: opacity 220ms ease 70ms, transform 350ms cubic-bezier(.2, .78, .2, 1) 70ms; }

@media (max-width: 840px) {
    .topbar { padding-inline: 14px; }
    .topbar-search { width: min(260px, 51vw); }
    .topbar-center { display: none; }
    .composer-container { width: calc(100% - 24px); }
    #aiChatView.is-landing .composer-container { bottom: 26px; }
    .welcome { padding-inline: 4px; padding-bottom: 142px; }
    .chat-container { padding-inline: 12px; }
}

@media (max-width: 520px) {
    #modelMenu.topbar-open.show { top: calc(100% + 8px) !important; right: auto !important; left: 0 !important; }
    .topbar-search { width: auto; padding: 0 9px; }
    .topbar-search span, .topbar-search kbd { display: none; }
    .topbar-search i { margin: 0; }
    .topbar-right { margin-left: auto; }
    .topbar-right #pixelNotificationsBtn { display: none; }
    .welcome-title { font-size: 31px; }
    .starter-cards-grid { grid-template-columns: 1fr; }
    .model-btn-name { max-width: 62px; }
}

/* Pixel chat as an idea workspace: extend the shared Obsidian Gold layer. */
#aiChatView { --chat-copy-width: var(--content-width); }
#aiChatView .topbar { justify-content: space-between; }
#aiChatView .topbar-left { flex: 1 1 auto; }
#aiChatView .current-chat-meta { display: block; min-width: 0; }
#aiChatView .current-chat-title { max-width: min(36vw, 420px); overflow: hidden; color: #e6e8ec; font-size: 13px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
#aiChatView .topbar-search { width: 34px; min-width: 34px; justify-content: center; padding: 0; border-color: transparent; background: transparent; }
#aiChatView .topbar-search span, #aiChatView .topbar-search kbd { display: none; }
#aiChatView .topbar-search i { margin: 0; }
#aiChatView .topbar-center { display: none; }
#aiChatView .topbar-right { margin-left: auto; }
.chat-topbar-action { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid transparent; border-radius: var(--radius-button); color: #aeb4bd; background: transparent; cursor: pointer; font-size: 11px; }
.chat-topbar-action:hover, .chat-topbar-action[aria-expanded="true"] { border-color: var(--border); color: #f0d27b; background: rgba(255,255,255,.035); }
#pixelNotificationsBtn { width: auto; min-width: 34px; gap: 7px; padding-inline: 9px; }
.activity-label { font-size: 11px; }
.chat-project-action { color: #d4bb66; }
.chat-project-action[hidden] { display: none !important; }
.chat-project-action:hover { border-color: rgba(212,175,55,.18); color: #f0d884; background: rgba(212,175,55,.055); }

#aiChatView .chat-container { padding-top: 24px; }
#aiChatView .chat-area { width: min(var(--chat-copy-width), 100%); gap: 31px; padding-top: 24px; }

#aiChatView .welcome:not(.hide) { display: flex; inset: 0; width: min(760px, calc(100% - 48px)); max-width: 760px; flex-direction: column; align-items: center; justify-content: center; margin: auto; padding: 10px 0 160px; text-align: center; transform: none; }
.pixel-home-eyebrow { margin: 0 0 16px; color: #ad9140; font-size: 9px; font-weight: 650; letter-spacing: .17em; }
#aiChatView .welcome-title { max-width: 650px; margin-bottom: 12px; font-size: clamp(36px, 4.2vw, 52px); letter-spacing: -.055em; line-height: 1.08; }
#aiChatView .welcome-title span { color: #e0bd56; }
#aiChatView .welcome-subtitle { max-width: 530px; margin: 0 0 30px; color: #a3a8b1; font-size: 14px; line-height: 1.65; }
#aiChatView .starter-cards-grid { display: grid; width: 100%; max-width: 690px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; text-align: left; }
#aiChatView .starter-card { min-height: 124px; padding: 15px 14px; border-color: rgba(255,255,255,.075); border-radius: 10px; background: linear-gradient(145deg, rgba(22,24,27,.78), rgba(15,16,18,.7)); box-shadow: inset 0 1px rgba(255,255,255,.018); }
#aiChatView .starter-card { transform: none; }
#aiChatView .starter-card:is(:hover, :focus-visible) { transform: translateY(-2px); }
#aiChatView .starter-card::after { top: 15px; right: 13px; color: #818791; font-size: 15px; }
#aiChatView .starter-card-top { gap: 9px; }
#aiChatView .starter-icon { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }
#aiChatView .starter-card-top strong { font-size: 12px; font-weight: 600; }
#aiChatView .starter-text { max-width: 100%; padding: 10px 0 0; color: #9299a4; font-size: 11px; line-height: 1.5; }
.idea-path { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.8vw, 18px); margin-top: 24px; color: #7e838c; font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.idea-path i { width: clamp(12px, 2.2vw, 26px); height: 1px; background: linear-gradient(90deg, rgba(212,175,55,.4), rgba(255,255,255,.08)); }
.idea-path span:nth-of-type(3) { color: #d2b353; }

#aiChatView .composer-container { width: min(var(--chat-copy-width), calc(100% - 48px)); }
#aiChatView .composer-box { padding: 14px 15px 9px; border-color: rgba(255,255,255,.12); border-radius: 14px; background: rgba(18,19,21,.98); box-shadow: 0 14px 40px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.035); }
#aiChatView .composer-box:focus-within { border-color: rgba(212,175,55,.46); background: #141517; box-shadow: 0 0 0 2px rgba(212,175,55,.07), 0 16px 44px rgba(0,0,0,.4); }
#aiChatView .composer-input-row textarea { min-height: 46px; max-height: 200px; padding: 1px 1px 8px; color: #eceef1; font-size: 14px; line-height: 1.6; }
#aiChatView .composer-input-row textarea::placeholder { color: #858b95; }
#aiChatView .composer-toolbar { min-height: 36px; align-items: center; justify-content: space-between; padding-top: 7px; border-top: 1px solid rgba(255,255,255,.055); }
#aiChatView .composer-toolbar-left { display: flex; align-items: center; }
#aiChatView .composer-toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
#aiChatView .composer-btn { width: 31px; height: 31px; border-color: transparent; background: transparent; }
#aiChatView .composer-btn:hover { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.045); }
.composer-text-btn { display: inline-flex; min-height: 30px; align-items: center; gap: 6px; padding: 0 7px; border: 1px solid transparent; border-radius: 7px; color: #9da3ad; background: transparent; cursor: pointer; font-size: 10px; }
.composer-text-btn:hover { border-color: rgba(255,255,255,.07); color: #e2c76e; background: rgba(255,255,255,.035); }
.composer-text-btn:focus-visible, .dynamic-rail-action:focus-visible, .pixel-tool-option:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
#aiChatView .model-button { min-height: 30px; gap: 6px; padding-inline: 7px; border-color: transparent; color: #c3c7ce; background: rgba(255,255,255,.035); font-size: 10px; }
#aiChatView .model-btn-icon { display: none; }
#aiChatView .model-button[data-auto="true"]::after { color: #858b95; content: "· Adaptive"; font-size: 10px; }
#aiChatView .model-button[aria-expanded="true"] { border-color: rgba(212,175,55,.25); }
#aiChatView .send-btn { width: 33px; min-width: 33px; height: 33px; min-height: 33px; }
#aiChatView .composer-legal-hint { font-size: 9px; }
.dynamic-action-rail { display: flex; width: 100%; min-height: 28px; align-items: center; justify-content: center; gap: 9px; padding: 0 4px; }
.dynamic-action-rail[hidden] { display: none !important; }
.dynamic-rail-mark { color: #b99b43; font-size: 12px; }
.dynamic-rail-actions { display: flex; max-width: 100%; align-items: center; justify-content: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.dynamic-rail-actions::-webkit-scrollbar { display: none; }
.dynamic-rail-action { position: relative; display: inline-flex; min-height: 29px; flex: 0 0 auto; align-items: center; gap: 6px; padding: 0 9px; border: 0; border-radius: 6px; color: #999faa; background: transparent; cursor: pointer; font-size: 10px; white-space: nowrap; transition: color var(--motion-fast) ease, background var(--motion-fast) ease; }
.dynamic-rail-action i { color: #c3a64a; font-size: 10px; }
.dynamic-rail-action:hover { color: #ecd47f; background: rgba(212,175,55,.055); }
.dynamic-rail-action:hover::after { margin-left: 0; content: "→"; }
.pixel-tools-popover { position: absolute; right: 90px; bottom: calc(100% + 9px); z-index: calc(var(--z-dropdown) + 1); width: min(330px, calc(100vw - 32px)); max-height: min(430px, 62vh); overflow: auto; padding: 13px; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; background: #141517; box-shadow: 0 18px 48px rgba(0,0,0,.46); animation: pixel-tool-pop-in 160ms ease both; }
.pixel-tools-popover[hidden] { display: none !important; }
.pixel-tools-popover > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 3px 9px; border-bottom: 1px solid rgba(255,255,255,.065); }
.pixel-tools-popover > header p { margin: 0 0 4px; color: #a58e48; font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.pixel-tools-popover > header h2 { margin: 0; color: #eceef1; font-size: 15px; font-weight: 560; }
.pixel-tools-popover > header button { display: grid; width: 29px; height: 29px; place-items: center; border: 0; border-radius: 6px; color: #8d939c; background: transparent; cursor: pointer; }
.pixel-tools-popover > header button:hover { color: #f0d47a; background: rgba(255,255,255,.05); }
.pixel-tools-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pixel-tool-option { display: flex; min-width: 0; min-height: 51px; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid transparent; border-radius: 7px; color: #b7bdc6; background: transparent; cursor: pointer; text-align: left; }
.pixel-tool-option:hover { border-color: rgba(212,175,55,.13); color: #f0d984; background: rgba(212,175,55,.05); }
.pixel-tool-option > i { width: 17px; flex: 0 0 17px; color: #c7aa4c; font-size: 12px; text-align: center; }
.pixel-tool-option-copy { display: grid; min-width: 0; gap: 3px; }
.pixel-tool-option-copy strong { overflow: hidden; color: inherit; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pixel-tool-option-copy small { overflow: hidden; color: #828993; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pixel-tools-empty { grid-column: 1 / -1; margin: 8px 5px; color: #9298a2; font-size: 11px; }
.pixel-tools-auto { display: flex; width: 100%; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 8px; border: 1px solid rgba(212,175,55,.14); border-radius: 8px; color: #e6ce77; background: rgba(212,175,55,.045); cursor: pointer; text-align: left; }
.pixel-tools-auto > i { font-size: 13px; }
.pixel-tools-auto span { display: grid; gap: 3px; }
.pixel-tools-auto strong { font-size: 10px; font-weight: 650; }
.pixel-tools-auto small { color: #9a9277; font-size: 9px; }
@keyframes pixel-tool-pop-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.pixel-context-drawer { position: fixed; inset: 0 0 0 auto; width: min(390px, calc(100vw - 24px)); height: 100dvh; max-height: none; margin: 0; padding: 0; border: 1px solid rgba(255,255,255,.1); border-right: 0; border-radius: 0; color: var(--text-primary); background: #111214; box-shadow: -24px 0 70px rgba(0,0,0,.4); transform: translateX(18px); opacity: 0; transition: transform 220ms cubic-bezier(.2,.7,.2,1), opacity 180ms ease; }
.pixel-context-drawer[open] { display: flex; flex-direction: column; transform: translateX(0); opacity: 1; }
.pixel-context-drawer::backdrop { background: rgba(0,0,0,.44); backdrop-filter: blur(2px); }
.pixel-context-header { display: flex; min-height: 86px; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.pixel-context-header h2 { margin: 0; color: #eff0f2; font-size: 20px; font-weight: 550; letter-spacing: -.03em; }
.pixel-context-eyebrow, .pixel-context-section-label { margin: 0 0 6px; color: #ad9140; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.pixel-context-content { overflow: auto; flex: 1; padding: 4px 20px 18px; }
.pixel-context-current, .pixel-context-section { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 17px 0; border-bottom: 1px solid rgba(255,255,255,.065); }
.pixel-context-current strong, .pixel-context-value { color: #e5e7eb; font-size: 13px; font-weight: 550; }
.pixel-context-current > span, .pixel-context-detail { color: #8e949e; font-size: 11px; line-height: 1.5; }
.pixel-context-resources { border-bottom: 0; }
.pixel-context-resource-row { display: grid; width: 100%; grid-template-columns: 18px 1fr auto; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid rgba(255,255,255,.055); border-radius: 7px; color: #bec3cb; background: rgba(255,255,255,.02); font-size: 11px; }
.pixel-context-resource-row i { color: #d2b353; }
.pixel-context-resource-row small { color: #777e87; font-size: 9px; text-transform: capitalize; }
.pixel-context-footer { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.07); }
.pixel-context-footer > span { color: #7f858e; font-size: 10px; }
.pixel-context-footer button { display: inline-flex; align-items: center; gap: 6px; border: 0; color: #d7bb5f; background: transparent; cursor: pointer; font-size: 10px; white-space: nowrap; }

body.light-mode #aiChatView .current-chat-title { color: #282a30; }
body.light-mode #aiChatView .welcome-title { color: #24262b; -webkit-text-fill-color: #24262b; }
body.light-mode #aiChatView .welcome-subtitle { color: #666b74; }
body.light-mode #aiChatView .starter-card { border-color: rgba(40,42,48,.1); background: rgba(255,255,255,.76); }
body.light-mode #aiChatView .starter-card-top strong { color: #292b30; }
body.light-mode #aiChatView .composer-box { border-color: rgba(40,42,48,.14); background: rgba(255,255,255,.97); }
body.light-mode #aiChatView .composer-input-row textarea { color: #292b30; }
body.light-mode .pixel-context-drawer { border-color: rgba(40,42,48,.14); color: #25272c; background: #fafaf8; }
body.light-mode .pixel-context-header h2, body.light-mode .pixel-context-current strong, body.light-mode .pixel-context-value { color: #292b30; }
body.light-mode .pixel-context-current > span, body.light-mode .pixel-context-detail { color: #666c75; }
body.light-mode .pixel-context-resource-row { border-color: rgba(40,42,48,.08); color: #41454d; background: rgba(40,42,48,.025); }

@media (max-width: 840px) {
    #aiChatView .welcome:not(.hide) { width: min(690px, calc(100% - 36px)); padding-bottom: 150px; }
    #aiChatView .starter-cards-grid { grid-template-columns: 1fr; gap: 8px; }
    #aiChatView .starter-card { display: flex; min-height: 68px; flex-direction: column; justify-content: center; padding: 10px 12px; }
    #aiChatView .starter-text { padding-top: 3px; }
    #aiChatView .composer-container { width: min(var(--chat-copy-width), calc(100% - 24px)); }
}
@media (max-width: 520px) {
    #aiChatView .topbar { padding-inline: 10px; }
    #aiChatView .topbar-left { gap: 5px; }
    #aiChatView .current-chat-title { max-width: 34vw; font-size: 12px; }
    #aiChatView .topbar-right { gap: 0; }
    #aiChatView .chat-project-action { width: 32px; min-width: 32px; justify-content: center; padding: 0; }
    #aiChatView .chat-project-action span { display: none; }
    #aiChatView .chat-topbar-action { gap: 5px; padding-inline: 6px; font-size: 10px; }
    #aiChatView #pixelNotificationsBtn { gap: 5px; padding-inline: 6px; font-size: 10px; }
    #aiChatView .topbar-right #pixelNotificationsBtn { display: inline-flex; }
    #aiChatView #topbarNewChatBtn { display: none; }
    #aiChatView .welcome:not(.hide) { width: calc(100% - 32px); padding: 0 0 155px; }
    #aiChatView .welcome-title { font-size: clamp(34px, 9vw, 42px); }
    #aiChatView .welcome-subtitle { margin-bottom: 22px; font-size: 13px; }
    #aiChatView .starter-card { min-height: 62px; }
    .idea-path { width: 100%; justify-content: space-between; gap: 6px; margin-top: 18px; font-size: 8px; }
    .idea-path i { width: 10px; }
    #aiChatView .composer-container { bottom: max(12px, env(safe-area-inset-bottom)); }
    #aiChatView.is-landing .composer-container { bottom: max(12px, env(safe-area-inset-bottom)); }
    #aiChatView .composer-box { padding: 11px 10px 7px; border-radius: 13px; }
    #aiChatView .composer-toolbar-right { gap: 2px; }
    #aiChatView .composer-text-btn { gap: 4px; padding-inline: 5px; }
    #aiChatView .composer-text-btn span { font-size: 9px; }
    #aiChatView .model-button { padding-inline: 5px; }
    #aiChatView .model-chevron { display: none; }
    #aiChatView .composer-legal-hint { padding-inline: 4px; font-size: 8px; }
    #aiChatView .chat-area { padding-top: 8px; }
    .pixel-context-drawer { width: 100vw; }
    .pixel-tools-popover { right: 0; width: min(340px, calc(100vw - 24px)); }
    .dynamic-action-rail { justify-content: flex-start; overflow: hidden; }
    .dynamic-rail-actions { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .pixel-context-drawer, #aiChatView .welcome, #aiChatView .starter-card { transition: none !important; }
    .pixel-tools-popover { animation: none !important; }
}

/* Desktop icon rail; on touch sizes the same navigation remains an off-canvas drawer. */
@media (min-width: 841px) {
    #sidebar.sidebar.collapsed { width: 64px; transform: translateX(0); }
    #sidebar.sidebar.collapsed ~ .main { margin-left: 64px; transition: margin-left var(--ease); }
    #sidebar.sidebar.expanded { width: var(--sidebar-width); transform: translateX(0); }
    #sidebar.sidebar.expanded ~ .main { margin-left: var(--sidebar-width); }
    #sidebar.sidebar.collapsed .sidebar-header { height: 56px; justify-content: center; padding: 0 8px; }
    #sidebar.sidebar.collapsed .sidebar-brand { display: none; }
    #sidebar.sidebar.collapsed .sidebar-close-btn { display: flex; width: 42px; height: 42px; justify-content: center; border: 0; border-radius: 10px; color: #989da6; background: transparent; }
    #sidebar.sidebar.collapsed .sidebar-close-btn:hover { color: #f0d47a; background: rgba(255,255,255,.055); }
    #sidebar.sidebar.collapsed .sidebar-actions { display: flex; flex-direction: column; gap: 4px; padding: 8px 9px; }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn,
    #sidebar.sidebar.collapsed .sidebar-footer-btn { position: relative; display: flex; width: 44px; min-width: 44px; height: 44px; min-height: 44px; justify-content: center; gap: 0; margin: 0; padding: 0; border: 0; border-radius: 10px; color: #a8adb6; background: transparent; }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn:hover,
    #sidebar.sidebar.collapsed .sidebar-footer-btn:hover { color: #f1d36d; background: rgba(255,255,255,.055); }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn.is-active { color: #f4d675; background: rgba(255,255,255,.085); box-shadow: inset 0 0 0 1px rgba(255,255,255,.035); }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn > span,
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn > kbd,
    #sidebar.sidebar.collapsed .sidebar-footer-btn > span,
    #sidebar.sidebar.collapsed .sidebar-footer-btn::after,
    #sidebar.sidebar.collapsed .unread-badge-pill { display: none !important; }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn > i,
    #sidebar.sidebar.collapsed .sidebar-footer-btn > i { margin: 0; font-size: 15px; }
    #sidebar.sidebar.collapsed .sidebar-search { position: relative; width: 44px; height: 44px; flex: 0 0 44px; margin: 4px 9px 10px; padding: 0; border: 0; }
    #sidebar.sidebar.collapsed .sidebar-search-box { width: 44px; height: 44px; justify-content: center; gap: 0; padding: 0; border-color: transparent; border-radius: 10px; background: transparent; }
    #sidebar.sidebar.collapsed .sidebar-search-box:hover { background: rgba(255,255,255,.055); }
    #sidebar.sidebar.collapsed .sidebar-search-box > i { color: #a8adb6; }
    #sidebar.sidebar.collapsed .sidebar-search-box input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; }
    #sidebar.sidebar.collapsed .chat-history { display: none; }
    #sidebar.sidebar.collapsed .sidebar-footer { display: flex; justify-content: center; padding: 8px 9px; border-top: 0; }
    #sidebar.sidebar.collapsed .sidebar-project-current { display: none !important; }
    #sidebar.sidebar.collapsed .profile-card { display: flex; justify-content: center; padding: 8px 9px 12px; }
    #sidebar.sidebar.collapsed .profile-button { width: 44px; min-height: 44px; justify-content: center; padding: 4px; border: 0; border-radius: 10px; }
    #sidebar.sidebar.collapsed .profile-details, #sidebar.sidebar.collapsed .profile-menu-icon { display: none; }
    #sidebar.sidebar.collapsed .profile-avatar { width: 32px; height: 32px; }
}
@media (max-width: 840px) {
    #sidebar.sidebar { width: min(var(--sidebar-width), calc(100vw - 48px)); transform: translateX(-100%); }
    #sidebar.sidebar.expanded { transform: translateX(0); }
    #sidebar.sidebar.collapsed { transform: translateX(-100%); }
}
body.light-mode #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn.is-active { color: #725e22; background: rgba(40,42,48,.075); }

/* Messenger-style polish for person-to-person conversations. */
.user-chat-container { background: radial-gradient(ellipse at 72% 42%, rgba(212,175,55,.035), transparent 52%), #090a0c; }
.user-chat-sidebar { background: linear-gradient(180deg, rgba(18,19,22,.98), rgba(13,14,17,.98)); border-right-color: rgba(255,255,255,.075); }
.user-chat-sidebar-header { padding: 18px 16px 14px; }
.user-chat-brand h2 { letter-spacing: -.025em; }
.user-chat-list { padding: 8px 10px 16px; }
.chat-list-section-title { padding: 14px 10px 7px; color: #777e89; font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.chat-list-item { min-height: 66px; margin: 2px 0; padding: 10px 11px; border: 1px solid transparent; border-radius: 13px; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.chat-list-item:hover { background: rgba(255,255,255,.045); transform: translateX(2px); }
.chat-list-item.active { border-color: rgba(212,175,55,.2); background: linear-gradient(100deg, rgba(212,175,55,.105), rgba(255,255,255,.025)); box-shadow: inset 2px 0 #d4af37, 0 5px 18px rgba(0,0,0,.12); }
.chat-item-avatar { width: 42px; height: 42px; flex-basis: 42px; border-radius: 15px; background: linear-gradient(145deg, rgba(212,175,55,.17), rgba(255,255,255,.045)); border-color: rgba(212,175,55,.18); color: #f4d574; }
.chat-item-name { font-size: 13px; }
.chat-item-preview { color: #9299a4; line-height: 1.4; }
.chat-item-time { font-size: 10px; }
.chat-item-badge { min-width: 20px; text-align: center; box-shadow: 0 0 14px rgba(212,175,55,.2); }
.user-chat-main { background: radial-gradient(ellipse at 55% 40%, rgba(212,175,55,.028), transparent 60%), #0a0b0d; }
.user-chat-header { min-height: 70px; padding-inline: clamp(14px,2.5vw,30px); background: rgba(15,16,19,.88); border-bottom-color: rgba(255,255,255,.07); }
.user-chat-header-avatar { border-radius: 14px; }
.user-chat-messages-container { padding: clamp(18px,3vw,34px) clamp(14px,5vw,72px); gap: 11px; background-image: radial-gradient(rgba(255,255,255,.022) .7px, transparent .7px); background-size: 19px 19px; }
.chat-msg-row { width: fit-content; max-width: min(76%,760px); gap: 9px; align-items: flex-end; }
.chat-msg-avatar { width: 30px; height: 30px; flex-basis: 30px; margin-bottom: 18px; border-radius: 11px; color: #e7c55d; background: linear-gradient(145deg,#24252a,#17181c); border-color: rgba(255,255,255,.08); }
.chat-msg-row.mine .chat-msg-avatar { display: none; }
.chat-msg-content-wrap { max-width: 100%; gap: 5px; }
.chat-msg-sender { padding-inline: 4px; font-size: 11px; color: #a2a7b1; }
.chat-msg-bubble { max-width: 100%; padding: 10px 14px 7px; border-radius: 17px 17px 17px 5px; background: linear-gradient(145deg,#1b1d21,#151619); border-color: rgba(255,255,255,.07); box-shadow: 0 7px 22px rgba(0,0,0,.14); line-height: 1.58; }
.chat-msg-row.mine .chat-msg-bubble { border-radius: 17px 17px 5px 17px; background: linear-gradient(145deg,rgba(132,101,28,.5),rgba(82,64,22,.42)); border-color: rgba(212,175,55,.22); box-shadow: 0 7px 24px rgba(0,0,0,.2), 0 0 20px rgba(212,175,55,.035); }
.chat-msg-row:not(.mine) + .chat-msg-row:not(.mine), .chat-msg-row.mine + .chat-msg-row.mine { margin-top: -5px; }
.msg-inline-time { display: inline-flex; align-items: center; float: right; margin: 8px 0 -1px 14px; color: rgba(225,228,233,.52); font-size: 9px; line-height: 1; white-space: nowrap; }
.chat-msg-row.mine .msg-inline-time { color: rgba(255,244,208,.64); }
.chat-date-separator { margin: 14px 0 10px; }
.chat-date-separator span { padding: 6px 12px; border: 1px solid rgba(255,255,255,.07); border-radius: 999px; background: rgba(20,21,24,.88); color: #9299a4; font-size: 10px; letter-spacing: .02em; box-shadow: 0 5px 18px rgba(0,0,0,.18); }
.system-msg-row { background: rgba(25,26,29,.84); color: #a7adb7; }
.user-chat-composer-wrap { padding: 14px clamp(14px,4vw,54px) 18px; border-top-color: rgba(255,255,255,.06); background: linear-gradient(180deg,rgba(10,11,13,.82),#0a0b0d 40%); }
.user-chat-composer-box { max-width: 980px; margin: 0 auto; border-radius: 20px; padding: 8px 11px; background: #111316; border-color: rgba(255,255,255,.095); box-shadow: 0 8px 30px rgba(0,0,0,.22); }
.user-chat-composer-box:focus-within { border-color: rgba(212,175,55,.42); box-shadow: 0 0 0 3px rgba(212,175,55,.065), 0 8px 32px rgba(0,0,0,.26); }
.msg-hover-actions { border-color: rgba(212,175,55,.18); }
@media (max-width:700px) {
    .user-chat-messages-container { padding: 18px 13px 24px; }
    .chat-msg-row { max-width: 88%; }
    .chat-msg-avatar { width: 27px; height: 27px; flex-basis: 27px; }
    .user-chat-header { min-height: 62px; padding-inline: 12px; }
    .user-chat-composer-wrap { padding: 10px 10px max(12px,env(safe-area-inset-bottom)); }
    .user-chat-composer-box { gap: 7px; padding: 6px 8px; }
}
@media (prefers-reduced-motion:reduce) { .chat-list-item, .chat-msg-row { animation: none !important; transition: none !important; } }

/* Keep every modal dialog centered, including the command palette on mobile.
   The whiteboard is a full-screen workspace, with its own centered dialog layers. */
dialog[open]:not(.whiteboard-workspace) {
    position: fixed !important;
    inset: 0 !important;
    margin: auto !important;
}

@media (max-width: 560px) {
    dialog.command-palette[open] {
        width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
    }
}

/* Premium compact navigation rail and composer finish. */
@media (min-width: 841px) {
    #sidebar.sidebar.collapsed {
        overflow: visible;
        border-right-color: rgba(212,175,55,.12);
        background:
            radial-gradient(ellipse at 50% 8%, rgba(212,175,55,.075), transparent 42%),
            linear-gradient(180deg, #111214 0%, #0b0c0e 56%, #101113 100%);
        box-shadow: 10px 0 35px rgba(0,0,0,.28), inset -1px 0 rgba(255,255,255,.025);
    }
    #sidebar.sidebar.collapsed::after {
        position: absolute;
        top: 78px;
        right: -1px;
        bottom: 78px;
        width: 1px;
        background: linear-gradient(180deg, transparent, rgba(212,175,55,.22) 18%, rgba(212,175,55,.05) 78%, transparent);
        content: "";
        pointer-events: none;
    }
    #sidebar.sidebar.collapsed .sidebar-header {
        height: 58px;
        flex: 0 0 auto;
        justify-content: center;
        padding: 7px 9px;
        border-bottom: 1px solid rgba(255,255,255,.055);
    }
    #sidebar.sidebar.collapsed .sidebar-brand { display: none !important; }
    #sidebar.sidebar.collapsed .sidebar-close-btn {
        width: 42px;
        height: 42px;
        color: #818791;
        transition: color .18s ease, background .18s ease, transform .18s ease;
    }
    #sidebar.sidebar.collapsed .sidebar-close-btn i { transition: transform .2s ease; }
    #sidebar.sidebar.collapsed .sidebar-close-btn:hover { color: #f0d47a; background: rgba(212,175,55,.08); }
    #sidebar.sidebar.collapsed .sidebar-close-btn:hover i { transform: translateX(-2px); }
    #sidebar.sidebar.collapsed .sidebar-actions { gap: 5px; padding: 10px 9px 7px; }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn,
    #sidebar.sidebar.collapsed .sidebar-footer-btn {
        border: 1px solid transparent;
        border-radius: 12px;
        color: #9298a2;
        background: transparent;
        transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
    }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn:hover,
    #sidebar.sidebar.collapsed .sidebar-footer-btn:hover {
        transform: translateY(-1px);
        border-color: rgba(255,255,255,.065);
        color: #e8d286;
        background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
        box-shadow: inset 0 1px rgba(255,255,255,.045), 0 5px 14px rgba(0,0,0,.19);
    }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn.is-active {
        border-color: rgba(212,175,55,.17);
        color: #f1d471;
        background: linear-gradient(145deg, rgba(212,175,55,.16), rgba(212,175,55,.065));
        box-shadow: inset 0 1px rgba(255,255,255,.055), 0 5px 16px rgba(0,0,0,.2), 0 0 18px rgba(212,175,55,.035);
    }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn.is-active::before {
        left: -10px;
        width: 2px;
        height: 21px;
        border-radius: 0 2px 2px 0;
        background: linear-gradient(180deg, #f1d471, #b48b2c);
        box-shadow: 0 0 10px rgba(212,175,55,.5);
    }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn > i,
    #sidebar.sidebar.collapsed .sidebar-footer-btn > i { font-size: 16px; }
    #sidebar.sidebar.collapsed .sidebar-actions #newChatBtn { color: #f0d47a; background: rgba(212,175,55,.045); }
    #sidebar.sidebar.collapsed .sidebar-actions #userChatBtn { margin-top: 11px; }
    #sidebar.sidebar.collapsed .sidebar-search { margin-top: 1px; }
    #sidebar.sidebar.collapsed .sidebar-search-box { border-radius: 12px; }
    #sidebar.sidebar.collapsed .sidebar-search-box > i { transition: color .18s ease; }
    #sidebar.sidebar.collapsed .sidebar-search-box:hover > i { color: #e7cc70; }
    #sidebar.sidebar.collapsed .sidebar-footer { margin-top: auto; padding-bottom: 4px; }
    #sidebar.sidebar.collapsed .sidebar-footer-btn { position: relative; }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn[title]:hover::after,
    #sidebar.sidebar.collapsed .sidebar-footer-btn[title]:hover::after,
    #sidebar.sidebar.collapsed .sidebar-search[title]:hover::after {
        position: absolute;
        top: 50%;
        left: calc(100% + 13px);
        z-index: 1000;
        display: block !important;
        width: max-content;
        max-width: 190px;
        min-height: 28px;
        margin: 0;
        padding: 6px 9px;
        transform: translateY(-50%);
        border: 1px solid rgba(212,175,55,.17);
        border-radius: 8px;
        color: #e8e3d2;
        background: linear-gradient(145deg, #202124, #151618);
        box-shadow: 0 8px 25px rgba(0,0,0,.38);
        content: attr(title);
        font: 500 10px/1.4 Inter, sans-serif;
        letter-spacing: .01em;
        opacity: 1;
        pointer-events: none;
        white-space: nowrap;
    }
    #sidebar.sidebar.collapsed .sidebar-search { position: relative; }
    #sidebar.sidebar.collapsed .sidebar-search:hover::after { left: calc(100% + 8px); }
    #sidebar.sidebar.collapsed .sidebar-footer-btn::after { content: none; }
    #sidebar.sidebar.collapsed .profile-button { border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.025); }
}

/* A calmer, more useful workspace home. */
#aiChatView .welcome:not(.hide) {
    width: min(1040px, calc(100% - 88px));
    max-width: 1040px;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 16px 0 158px;
    text-align: center;
}
.welcome-overline { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.welcome-overline .pixel-home-eyebrow { display: flex; align-items: center; gap: 9px; margin: 0; color: #b7a56f; font-size: 9px; letter-spacing: .15em; }
.welcome-overline-mark { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid rgba(212,175,55,.18); border-radius: 8px; color: #e2c45c; background: linear-gradient(145deg,rgba(212,175,55,.13),rgba(255,255,255,.025)); font-size: 11px; }
.welcome-overline-separator { color: rgba(212,175,55,.48); }
.welcome-ready { display: inline-flex; align-items: center; gap: 8px; color: #899087; font-size: 8px; font-weight: 650; letter-spacing: .12em; white-space: nowrap; }
.welcome-ready i { width: 6px; height: 6px; border-radius: 50%; background: #9ab88d; box-shadow: 0 0 10px rgba(154,184,141,.38); }
.welcome-heading-row { display: flex; width: 100%; align-items: center; justify-content: center; gap: 24px; margin-bottom: 14px; }
.welcome-heading-copy { min-width: 0; }
#aiChatView .welcome-title { max-width: 690px; margin: 0 0 10px; font-size: clamp(39px, 4.5vw, 56px); letter-spacing: -.058em; line-height: 1.04; }
#aiChatView .welcome-subtitle { max-width: 600px; margin: 0 auto; color: #9da3ad; font-size: 14px; line-height: 1.65; }
.welcome-bottom-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; }
.welcome-command-btn { display: flex; min-width: 204px; align-items: center; gap: 10px; flex: 0 0 auto; padding: 10px 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 11px; color: #c9cdd3; background: linear-gradient(145deg,rgba(24,25,27,.94),rgba(16,17,19,.94)); box-shadow: inset 0 1px rgba(255,255,255,.045), 0 7px 22px rgba(0,0,0,.14); cursor: pointer; text-align: left; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.welcome-command-btn:hover { transform: translateY(-2px); border-color: rgba(212,175,55,.23); background: linear-gradient(145deg,rgba(212,175,55,.08),rgba(16,17,19,.96)); }
.welcome-command-icon { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border: 1px solid rgba(212,175,55,.17); border-radius: 8px; color: #d6bb60; background: rgba(212,175,55,.07); font-size: 12px; }
.welcome-command-btn > span:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.welcome-command-btn strong { color: #e4e6e9; font-size: 10px; font-weight: 600; white-space: nowrap; }
.welcome-command-btn small { color: #848b95; font-size: 9px; }
.welcome-command-btn kbd { margin-left: auto; padding: 3px 5px; border: 1px solid rgba(255,255,255,.08); border-radius: 5px; color: #a5aab2; background: rgba(255,255,255,.035); font: 9px/1.2 Inter,sans-serif; white-space: nowrap; }
#aiChatView .starter-cards-grid { max-width: none; gap: 13px; }
#aiChatView .starter-card { position: relative; min-height: 136px; padding: 17px 17px 16px; overflow: hidden; border-color: rgba(255,255,255,.085); border-radius: 12px; background: linear-gradient(145deg,rgba(25,26,29,.9),rgba(15,16,18,.9)); box-shadow: inset 0 1px rgba(255,255,255,.032), 0 8px 26px rgba(0,0,0,.12); transition: transform .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease; }
#aiChatView .starter-card::before { position: absolute; inset: 0 14px auto; height: 1px; background: linear-gradient(90deg,transparent,rgba(212,175,55,.16),transparent); content: ""; }
#aiChatView .starter-card:is(:hover,:focus-visible) { transform: translateY(-3px); border-color: rgba(212,175,55,.21); background: linear-gradient(145deg,rgba(32,30,25,.96),rgba(17,18,20,.94)); box-shadow: inset 0 1px rgba(255,255,255,.05),0 12px 30px rgba(0,0,0,.2),0 0 20px rgba(212,175,55,.025); }
#aiChatView .starter-icon { width: 30px; height: 30px; border: 1px solid rgba(212,175,55,.17); border-radius: 9px; background: linear-gradient(145deg,rgba(212,175,55,.15),rgba(212,175,55,.045)); box-shadow: inset 0 1px rgba(255,255,255,.06); }
#aiChatView .starter-card-top { gap: 11px; }
#aiChatView .starter-card-top strong { color: #e5e6e8; font-size: 12px; }
#aiChatView .starter-text { max-width: 260px; padding-top: 13px; color: #9ba1aa; font-size: 11px; line-height: 1.6; }
#aiChatView .starter-card::after { top: 17px; right: 17px; color: #9d916a; transition: color .18s ease,transform .18s ease; }
#aiChatView .starter-card:hover::after { transform: translate(2px,-2px); color: #e6c75f; }
.idea-path { display: flex; align-items: center; justify-content: flex-start; gap: 9px; margin-top: 0; }
.idea-path-label { margin-right: 5px; color: #707782; font-size: 8px; letter-spacing: .13em; }
.idea-path > span:not(.idea-path-label) { padding: 5px 8px; border: 1px solid rgba(255,255,255,.055); border-radius: 5px; color: #828892; background: rgba(255,255,255,.018); font-size: 8px; letter-spacing: .08em; }
.idea-path > span:nth-of-type(4) { border-color: rgba(212,175,55,.15); color: #d9bd5b; background: rgba(212,175,55,.055); }
.idea-path i { width: 12px; background: rgba(212,175,55,.18); }

/* Context now reads as a compact panel of live, scannable information. */
.pixel-context-drawer { inset: 0 !important; width: min(520px,calc(100vw - 28px)); height: min(700px,calc(100dvh - 48px)); max-height: calc(100dvh - 48px); border: 1px solid rgba(255,255,255,.105); border-radius: 20px; background: radial-gradient(ellipse at 100% 0%,rgba(212,175,55,.075),transparent 43%),linear-gradient(155deg,#17181a,#101113 72%); box-shadow: 0 26px 90px rgba(0,0,0,.56),inset 0 1px rgba(255,255,255,.045); }
.pixel-context-drawer::backdrop { background: rgba(4,5,6,.62); backdrop-filter: blur(8px) saturate(.8); }
.pixel-context-header { min-height: 94px; padding: 20px 22px; background: linear-gradient(180deg,rgba(255,255,255,.025),transparent); }
.pixel-context-header h2 { font-size: 22px; letter-spacing: -.04em; }
.pixel-context-header .pixel-context-eyebrow { margin-bottom: 8px; }
.pixel-context-header > button { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px; background: rgba(255,255,255,.035); }
.pixel-context-content { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 9px; padding: 17px; }
.pixel-context-current,
.pixel-context-section { min-width: 0; min-height: 105px; gap: 8px; padding: 14px; border: 1px solid rgba(255,255,255,.065); border-radius: 12px; background: linear-gradient(145deg,rgba(255,255,255,.04),rgba(255,255,255,.015)); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.pixel-context-current { position: relative; grid-column: 1 / -1; min-height: 113px; justify-content: center; overflow: hidden; border-color: rgba(212,175,55,.14); background: linear-gradient(110deg,rgba(212,175,55,.075),rgba(255,255,255,.025) 72%); }
.pixel-context-current::after { position: absolute; top: -31px; right: -10px; width: 100px; height: 100px; border: 1px solid rgba(212,175,55,.08); border-radius: 50%; box-shadow: 0 0 0 12px rgba(212,175,55,.018),0 0 0 26px rgba(212,175,55,.012); content: ""; pointer-events: none; }
.pixel-context-current strong { font-size: 15px; }
.pixel-context-current > span,.pixel-context-detail { font-size: 10px; }
.pixel-context-section-label { display: flex; align-items: center; gap: 7px; margin: 0 0 2px; color: #a99a69; font-size: 8px; letter-spacing: .12em; }
.pixel-context-section-label i { color: #cfb455; font-size: 10px; }
.pixel-context-value { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.pixel-context-section .pixel-context-detail { overflow-wrap: anywhere; }
.pixel-context-resources { grid-column: 1 / -1; min-height: auto; }
.pixel-context-resource-row { min-height: 39px; border-color: rgba(255,255,255,.065); border-radius: 8px; background: rgba(255,255,255,.025); }
.pixel-context-footer { min-height: 66px; padding-inline: 18px; background: rgba(0,0,0,.13); }
.pixel-context-footer > span { font-size: 9px; }
.pixel-context-footer button { padding: 8px 10px; border: 1px solid rgba(212,175,55,.15); border-radius: 8px; background: rgba(212,175,55,.045); }
body.light-mode .pixel-context-drawer { background: radial-gradient(ellipse at 100% 0%,rgba(212,175,55,.11),transparent 43%),linear-gradient(155deg,#fffefa,#f7f5ee 72%); box-shadow: -18px 20px 60px rgba(40,42,48,.18),inset 0 1px #fff; }
body.light-mode .pixel-context-current,body.light-mode .pixel-context-section { border-color: rgba(40,42,48,.08); background: linear-gradient(145deg,#fff,rgba(245,243,237,.9)); }
body.light-mode .pixel-context-current { border-color: rgba(145,115,35,.16); background: linear-gradient(110deg,rgba(212,175,55,.1),rgba(255,255,255,.7) 72%); }
body.light-mode .welcome-command-btn { border-color: rgba(40,42,48,.1); color: #4b5058; background: linear-gradient(145deg,#fff,#f5f3ed); }
body.light-mode .welcome-command-btn strong { color: #30343a; }
body.light-mode #aiChatView .starter-card { border-color: rgba(40,42,48,.095); background: linear-gradient(145deg,#fff,#f8f7f2); }
body.light-mode #aiChatView .starter-card-top strong { color: #30343a; }

@media (max-width: 840px) {
    #aiChatView .welcome:not(.hide) { width: min(720px,calc(100% - 36px)); padding: 12px 0 150px; }
    .welcome-heading-row { align-items: center; flex-direction: column; gap: 16px; margin-bottom: 14px; }
    .welcome-command-btn { min-width: 0; }
    .welcome-bottom-row { align-items: flex-start; flex-direction: column; gap: 12px; }
}
@media (max-width: 560px) {
    .welcome-overline { align-items: flex-start; }
    .welcome-overline .pixel-home-eyebrow { gap: 6px; font-size: 7px; letter-spacing: .1em; }
    .welcome-overline-mark { width: 22px; height: 22px; }
    .welcome-ready { font-size: 7px; }
    #aiChatView .welcome-title { font-size: clamp(34px,9vw,43px); }
    #aiChatView .welcome-subtitle { font-size: 12px; }
    #aiChatView .starter-cards-grid { grid-template-columns: 1fr; }
    #aiChatView .starter-card { min-height: 78px; }
    #aiChatView .starter-text { padding-top: 5px; }
    .idea-path { flex-wrap: wrap; gap: 5px; }
    .idea-path-label { width: 100%; margin-bottom: 2px; }
    .idea-path > span:not(.idea-path-label) { padding: 4px 6px; font-size: 7px; }
    .idea-path i { width: 7px; }
    .pixel-context-drawer { inset: 0 !important; width: min(520px,calc(100vw - 20px)); height: min(700px,calc(100dvh - 24px)); max-height: calc(100dvh - 24px); border-radius: 16px; }
    .pixel-context-content { grid-template-columns: 1fr; padding: 12px; }
    .pixel-context-current,.pixel-context-resources { grid-column: auto; }
    .pixel-context-current,.pixel-context-section { min-height: auto; padding: 13px; }
}

#aiChatView .composer-container { isolation: isolate; }
#aiChatView .composer-container::before {
    position: absolute;
    z-index: -1;
    inset: -24px -32px -12px;
    border-radius: 28px;
    background: radial-gradient(ellipse at 50% 55%, rgba(212,175,55,.075), transparent 68%);
    content: "";
    opacity: .65;
    pointer-events: none;
}
#aiChatView .composer-box {
    position: relative;
    overflow: visible;
    padding: 16px 17px 10px;
    border-color: rgba(255,255,255,.14);
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(23,24,26,.99), rgba(15,16,18,.99));
    box-shadow: 0 20px 58px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.06), inset 0 -1px rgba(0,0,0,.25);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
#aiChatView .composer-box::before {
    position: absolute;
    inset: 0 18px auto;
    height: 1px;
    border-radius: 50%;
    background: linear-gradient(90deg, transparent, rgba(241,213,113,.32), rgba(255,255,255,.11), transparent);
    content: "";
    pointer-events: none;
}
#aiChatView .composer-box:focus-within {
    transform: translateY(-1px);
    border-color: rgba(224,189,86,.48);
    box-shadow: 0 0 0 1px rgba(224,189,86,.08), 0 24px 64px rgba(0,0,0,.42), 0 0 38px rgba(212,175,55,.045), inset 0 1px rgba(255,255,255,.065);
}
#aiChatView .composer-toolbar { padding-top: 9px; }
#aiChatView .composer-text-btn,
#aiChatView .model-button {
    min-height: 31px;
    padding-inline: 10px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 9px;
    color: #aeb4be;
    background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
    box-shadow: inset 0 1px rgba(255,255,255,.035);
    transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
#aiChatView .composer-text-btn:hover,
#aiChatView .model-button:hover,
#aiChatView .model-button[aria-expanded="true"] {
    border-color: rgba(212,175,55,.2);
    color: #f0d984;
    background: linear-gradient(145deg, rgba(212,175,55,.095), rgba(212,175,55,.035));
    box-shadow: inset 0 1px rgba(255,255,255,.045), 0 3px 12px rgba(0,0,0,.13);
}
#aiChatView .composer-text-btn i { color: #c5a84d; }
#aiChatView .composer-toolbar-left .composer-btn {
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    color: #c6a94d;
    background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}
#aiChatView .composer-toolbar-left .composer-btn:hover { border-color: rgba(212,175,55,.2); background: rgba(212,175,55,.08); }
#aiChatView .send-btn { box-shadow: 0 4px 15px rgba(212,175,55,.22), inset 0 1px rgba(255,255,255,.28); }
.dynamic-action-rail { gap: 8px; min-height: 35px; }
.dynamic-rail-actions { gap: 7px; }
.dynamic-rail-action {
    min-height: 31px;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 9px;
    color: #aeb3bc;
    background: linear-gradient(145deg, rgba(29,30,32,.85), rgba(19,20,22,.86));
    box-shadow: inset 0 1px rgba(255,255,255,.035), 0 3px 11px rgba(0,0,0,.1);
    transition: transform .18s ease, color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.dynamic-rail-action i { color: #c5a84d; }
.dynamic-rail-action:hover,
.dynamic-rail-action.is-selected {
    transform: translateY(-1px);
    border-color: rgba(212,175,55,.22);
    color: #f0d984;
    background: linear-gradient(145deg, rgba(212,175,55,.13), rgba(212,175,55,.055));
    box-shadow: inset 0 1px rgba(255,255,255,.06), 0 5px 15px rgba(0,0,0,.17), 0 0 14px rgba(212,175,55,.035);
}
.dynamic-rail-action:hover::after { margin-left: 1px; color: #d6ba5f; }
body.light-mode #sidebar.sidebar.collapsed { background: linear-gradient(180deg, #fffefa, #f4f1e8); }
body.light-mode #sidebar.sidebar.collapsed .sidebar-brand { border-color: rgba(145,115,35,.19); background: linear-gradient(145deg, rgba(212,175,55,.12), rgba(40,42,48,.025)); }
body.light-mode #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn,
body.light-mode #sidebar.sidebar.collapsed .sidebar-footer-btn { color: #646a73; }
body.light-mode #aiChatView .composer-box { border-color: rgba(40,42,48,.13); background: linear-gradient(145deg, rgba(255,255,255,.99), rgba(248,247,243,.99)); box-shadow: 0 20px 50px rgba(40,42,48,.13), inset 0 1px #fff; }
body.light-mode #aiChatView .composer-text-btn,
body.light-mode #aiChatView .model-button,
body.light-mode .dynamic-rail-action { border-color: rgba(40,42,48,.09); color: #5b6069; background: linear-gradient(145deg, #fff, #f3f1ec); }

@media (max-width: 520px) {
    #aiChatView .composer-box { padding: 12px 12px 8px; border-radius: 15px; }
    #aiChatView .composer-text-btn { padding-inline: 7px; }
    .dynamic-rail-action { min-height: 30px; padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    #sidebar.sidebar.collapsed *, #aiChatView .composer-box, .dynamic-rail-action { transition: none !important; }
}

/* Warm pearl theme: consistent surfaces and clear interactive feedback across views. */
body.light-mode {
    --bg-0: #f2f1ed;
    --bg-1: #f8f7f3;
    --bg-2: #fffefa;
    --surface-1: #f5f4ef;
    --surface-2: #eceae3;
    --text-primary: #24251f;
    --text-secondary: #55574f;
    --text-tertiary: #777970;
    --text-disabled: #9b9c94;
    --gold-primary: #94700f;
    --gold-bright: #80600b;
    --gold-deep: #6d520a;
    --gold-08: rgba(148,112,15,.08);
    --gold-12: rgba(148,112,15,.12);
    --gold-16: rgba(148,112,15,.16);
    --bg: #f2f1ed;
    --surface: #fffefa;
    --surface-raised: #f8f7f3;
    --surface-hover: #efeee8;
    --surface-active: #e8e5da;
    --gold: #80600b;
    --gold-light: #6d520a;
    --gold-deep: #6d520a;
    --gold-glow: rgba(148,112,15,.12);
    --gold-subtle: rgba(148,112,15,.075);
    --text: #24251f;
    --text-muted: #777970;
    --text-inverse: #fffefa;
    --border-subtle: rgba(39,39,32,.07);
    --border-default: rgba(39,39,32,.10);
    --border-strong-token: rgba(39,39,32,.16);
    --border: rgba(39,39,32,.10);
    --border-strong: rgba(39,39,32,.16);
    --border-gold: rgba(148,112,15,.27);
    --border-gold-strong: rgba(148,112,15,.48);
    --shadow-sm: 0 2px 8px rgba(50,46,32,.055);
    --shadow-md: 0 12px 32px rgba(50,46,32,.09);
    --shadow-lg: 0 22px 60px rgba(50,46,32,.15);
    --shadow-gold: 0 0 18px rgba(148,112,15,.11);
    background: radial-gradient(ellipse at 79% 9%, rgba(212,175,55,.075), transparent 34%), #f2f1ed;
    color: #24251f;
}

body.light-mode .app,
body.light-mode .main,
body.light-mode .app-view-panel,
body.light-mode .workspace-view,
body.light-mode .projects-view,
body.light-mode .research-view,
body.light-mode .notes-view,
body.light-mode .canvas-view,
body.light-mode .code-view {
    color: var(--text-primary);
}

body.light-mode :is(.topbar,.workspace-topbar,.projects-topbar,.research-topbar,.code-topbar,.canvas-topbar,.notes-topbar,.whiteboard-topbar) {
    border-color: rgba(39,39,32,.09);
    background: color-mix(in srgb, #fffefa 91%, transparent);
    box-shadow: 0 1px 0 rgba(39,39,32,.035), 0 8px 22px rgba(50,46,32,.035);
    backdrop-filter: blur(18px) saturate(1.2);
}

body.light-mode :is(.topbar-btn,.chat-topbar-action,.workspace-nav-btn,.workspace-tool-card,.projects-quiet-btn,.canvas-secondary-btn,.dynamic-rail-action,.composer-text-btn,.model-button,.settings-tab,.settings-btn-secondary) {
    transition: transform .18s cubic-bezier(.2,.7,.2,1), color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

body.light-mode :is(.topbar-btn,.chat-topbar-action,.workspace-nav-btn,.workspace-tool-card,.projects-quiet-btn,.canvas-secondary-btn,.settings-tab,.settings-btn-secondary):hover,
body.light-mode :is(.topbar-btn,.chat-topbar-action,.workspace-nav-btn,.workspace-tool-card,.projects-quiet-btn,.canvas-secondary-btn,.settings-tab,.settings-btn-secondary):focus-visible {
    border-color: rgba(148,112,15,.26);
    color: #604a0e;
    background-color: rgba(148,112,15,.065);
}

body.light-mode :is(.workspace-tool-card,.project-card,.project-overview-card,.project-resource-card,.canvas-card,.notes-card,.research-answer,.starter-card,.artwork-card):hover,
body.light-mode :is(.workspace-tool-card,.project-card,.project-overview-card,.project-resource-card,.canvas-card,.notes-card,.research-answer,.starter-card,.artwork-card):focus-visible {
    transform: translateY(-2px);
    border-color: rgba(148,112,15,.25);
    background-color: #fffefa;
    box-shadow: 0 12px 28px rgba(50,46,32,.085), 0 0 0 1px rgba(148,112,15,.045);
}

body.light-mode :is(button,a,[role="button"],input,textarea,select):focus-visible {
    outline: 2px solid rgba(148,112,15,.48);
    outline-offset: 2px;
}

body.light-mode :is(input,textarea,select,.settings-input,.settings-select-inline,.sidebar-search-box,.projects-search,.projects-sort,.project-search,.research-search-input) {
    border-color: rgba(39,39,32,.13);
    color: #24251f;
    background-color: #fffefa;
    box-shadow: inset 0 1px 2px rgba(50,46,32,.025);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

body.light-mode :is(input,textarea,select,.settings-input,.settings-select-inline,.sidebar-search-box,.projects-search,.projects-sort,.project-search,.research-search-input):focus-within,
body.light-mode :is(input,textarea,select,.settings-input,.settings-select-inline,.sidebar-search-box,.projects-search,.projects-sort,.project-search,.research-search-input):focus {
    border-color: rgba(148,112,15,.48);
    box-shadow: 0 0 0 3px rgba(148,112,15,.09), inset 0 1px 2px rgba(50,46,32,.025);
}

body.light-mode #sidebar.sidebar.collapsed {
    border-right-color: rgba(39,39,32,.10);
    background: linear-gradient(180deg,#fffefa 0%,#f6f4ed 100%);
    box-shadow: 8px 0 28px rgba(50,46,32,.06), inset -1px 0 rgba(255,255,255,.8);
}
body.light-mode #sidebar.sidebar.collapsed::after { background: linear-gradient(180deg,transparent,rgba(148,112,15,.3) 22%,rgba(148,112,15,.07) 78%,transparent); }
body.light-mode #sidebar.sidebar.collapsed .sidebar-header { border-bottom-color: rgba(39,39,32,.075); }
body.light-mode #sidebar.sidebar.collapsed .sidebar-close-btn { color: #777970; }
body.light-mode #sidebar.sidebar.collapsed .sidebar-close-btn:hover { color: #71560c; background: rgba(148,112,15,.09); }
body.light-mode #sidebar.sidebar.collapsed .sidebar-actions :is(.new-chat-btn,.sidebar-footer-btn),
body.light-mode #sidebar.sidebar.collapsed .sidebar-footer-btn { color: #65675f; }
body.light-mode #sidebar.sidebar.collapsed .sidebar-actions :is(.new-chat-btn,.sidebar-footer-btn):hover,
body.light-mode #sidebar.sidebar.collapsed .sidebar-footer-btn:hover { border-color: rgba(39,39,32,.08); color: #604a0e; background: linear-gradient(145deg,#fffefa,#f0eee6); box-shadow: 0 4px 12px rgba(50,46,32,.08); }
body.light-mode #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn.is-active { color: #604a0e; background: rgba(148,112,15,.10); }

body.light-mode #aiChatView .composer-box {
    border-color: rgba(39,39,32,.14);
    background: linear-gradient(145deg,#fffefa,#faf9f5);
    box-shadow: 0 22px 52px rgba(50,46,32,.12), inset 0 1px #fff;
}
body.light-mode #aiChatView .composer-box::before { background: linear-gradient(90deg,transparent,rgba(148,112,15,.27),rgba(255,255,255,.95),transparent); }
body.light-mode #aiChatView .composer-box:focus-within { border-color: rgba(148,112,15,.48); box-shadow: 0 0 0 3px rgba(148,112,15,.075),0 25px 60px rgba(50,46,32,.13),inset 0 1px #fff; }
body.light-mode #aiChatView .composer-input-row textarea { color: #24251f; }
body.light-mode #aiChatView .composer-input-row textarea::placeholder { color: #85867e; }
body.light-mode #aiChatView .composer-toolbar { border-top-color: rgba(39,39,32,.09); }
body.light-mode #aiChatView :is(.composer-text-btn,.model-button,.dynamic-rail-action) { border-color: rgba(39,39,32,.11); color: #53554d; background: linear-gradient(145deg,#fffefa,#f2f0e9); box-shadow: 0 2px 7px rgba(50,46,32,.035),inset 0 1px #fff; }
body.light-mode #aiChatView :is(.composer-text-btn,.model-button,.dynamic-rail-action):hover,
body.light-mode #aiChatView .model-button[aria-expanded="true"],
body.light-mode #aiChatView .dynamic-rail-action.is-selected { transform: translateY(-1px); border-color: rgba(148,112,15,.32); color: #604a0e; background: linear-gradient(145deg,#fffefa,#f3edda); box-shadow: 0 6px 14px rgba(50,46,32,.085),inset 0 1px #fff; }
body.light-mode #aiChatView :is(.composer-text-btn,.model-button,.dynamic-rail-action) i { color: #8b6c12; }

body.light-mode .pixel-context-drawer {
    border-color: rgba(39,39,32,.12);
    background: radial-gradient(ellipse at 100% 0%,rgba(212,175,55,.13),transparent 43%),linear-gradient(155deg,#fffefa,#f5f3ec 72%);
    box-shadow: -18px 20px 60px rgba(50,46,32,.19),inset 0 1px #fff;
}
body.light-mode .pixel-context-current,
body.light-mode .pixel-context-section { border-color: rgba(39,39,32,.09); background: linear-gradient(145deg,#fffefa,#f5f3ec); }
body.light-mode .pixel-context-current { border-color: rgba(148,112,15,.2); background: linear-gradient(110deg,rgba(212,175,55,.12),rgba(255,254,250,.88) 72%); }

body.light-mode :is(.settings-dialog,.project-dialog,.research-dialog,.code-dialog,.chat-modal-dialog,.pixel-notification-dialog,.global-search-dialog,.command-palette) {
    border-color: rgba(39,39,32,.14);
    background: linear-gradient(150deg,#fffefa,#f6f4ee);
    box-shadow: 0 28px 80px rgba(50,46,32,.2),0 0 0 1px rgba(255,255,255,.72) inset;
}
body.light-mode :is(.settings-dialog,.project-dialog,.research-dialog,.code-dialog,.chat-modal-dialog,.pixel-notification-dialog,.global-search-dialog,.command-palette)::backdrop { background: rgba(30,29,24,.35); backdrop-filter: blur(5px); }
body.light-mode :is(.settings-nav,.settings-section,.settings-group,.settings-memory-row,.command-palette-search,.command-row,.command-ask-row,.model-menu,.chat-context-menu,.sidebar-more-menu) { border-color: rgba(39,39,32,.085); background-color: rgba(255,254,250,.82); color: #34352f; }
body.light-mode :is(.settings-tab:hover,.command-row:hover,.command-row.is-active,.command-ask-row:hover,.model-item:hover,.chat-context-menu button:hover,.sidebar-more-item:hover) { color: #604a0e; background: rgba(148,112,15,.075); }
body.light-mode :is(.pixel-tools-popover,.workspace-new-menu,.account-menu,.research-more-menu,.model-menu,.sidebar-more-menu,.user-chat-header-menu-panel,.pinned-panel) {
    border-color: rgba(39,39,32,.11);
    color: #34352f;
    background: linear-gradient(150deg,#fffefa,#f6f4ee);
    box-shadow: 0 18px 48px rgba(50,46,32,.16),inset 0 1px rgba(255,255,255,.9);
    backdrop-filter: blur(18px) saturate(1.15);
}
body.light-mode .pixel-tools-popover > header { border-bottom-color: rgba(39,39,32,.09); }
body.light-mode .pixel-tools-popover > header h2,
body.light-mode .account-menu-identity strong { color: #24251f; }
body.light-mode .pixel-tools-popover > header p { color: #80600b; }
body.light-mode :is(.pixel-tools-popover,.account-menu,.workspace-new-menu,.research-more-menu) :is(button,a):hover { color: #604a0e; background: rgba(148,112,15,.075); }
body.light-mode .model-item.selected { border-color: rgba(148,112,15,.3); color: #604a0e; background: rgba(148,112,15,.09); }
body.light-mode .model-item-desc,
body.light-mode .account-menu-identity small { color: #73756c; }
body.light-mode .account-menu-divider { background: rgba(39,39,32,.09); }
body.light-mode .workspace-new-menu-item { color: #41433c; }
body.light-mode :is(.settings-intro,.settings-info small,.settings-group-title,.workspace-tool-card p,.project-description,.research-empty-state,.canvas-empty-state,.notes-empty-state) { color: #686a62; }

/* Settings studio: a more spacious, branded control room while preserving the
   existing settings controls and page navigation. */
.settings-dialog {
    width: min(1120px, calc(100vw - 40px));
    height: min(790px, calc(100dvh - 40px));
    max-height: calc(100dvh - 40px);
    border: 1px solid rgba(230,190,87,.18);
    border-radius: 22px;
    background: radial-gradient(ellipse at 84% 0%,rgba(214,166,47,.075),transparent 31%),linear-gradient(145deg,#17181b,#101114 64%);
    box-shadow: 0 36px 110px rgba(0,0,0,.68),0 0 0 1px rgba(255,255,255,.025),inset 0 1px rgba(255,255,255,.045);
}
.settings-dialog::backdrop { background: rgba(4,5,7,.72); backdrop-filter: blur(12px) saturate(.82); }
.settings-dialog-header {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    flex: 0 0 88px;
    height: auto;
    padding: 0 24px;
    border-bottom-color: rgba(255,255,255,.07);
    background: rgba(16,17,19,.72);
}
.settings-dialog-brand { display: flex; align-items: center; gap: 12px; }
.settings-brand-icon { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(236,190,74,.22); border-radius: 13px; background: radial-gradient(circle at 50% 45%,rgba(234,185,57,.16),rgba(233,182,47,.035) 72%); box-shadow: 0 0 22px rgba(225,173,47,.065),inset 0 1px rgba(255,255,255,.04); }
.settings-brand-icon img { width: 22px; height: 22px; filter: drop-shadow(0 0 6px rgba(255,204,80,.25)); }
.settings-dialog-kicker { display: block; margin-bottom: 4px; color: #b99742; font-size: 9px; font-weight: 750; letter-spacing: .17em; }
.settings-dialog-header h2 { margin: 0; color: #f1f0eb; font-size: 20px; font-weight: 680; letter-spacing: -.035em; }
.settings-dialog-header h2 i { display: none; }
.settings-header-note { grid-column: 2; margin: 0; color: #92949b; font-size: 12px; }
.settings-dialog-header .modal-close { grid-column: 3; justify-self: end; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.035); color: #a8aab1; }
.settings-dialog-header .modal-close:hover { border-color: rgba(234,190,74,.34); background: rgba(226,177,52,.1); color: #f0d078; }
.settings-layout { flex: 1 1 auto; min-height: 0; max-height: none; overflow: hidden; }
.settings-nav { position: relative; width: 224px; min-height: 0; padding: 23px 13px 80px; gap: 5px; border-right: 1px solid rgba(255,255,255,.065); background: linear-gradient(180deg,rgba(255,255,255,.018),rgba(255,255,255,.006)); }
.settings-nav-caption { padding: 0 11px 12px; color: #777a82; font-size: 9px; font-weight: 750; letter-spacing: .16em; }
.settings-tab { position: relative; min-height: 44px; gap: 12px; padding: 9px 11px; border: 1px solid transparent; border-radius: 11px; color: #a1a3aa; font-size: 12px; font-weight: 560; }
.settings-tab i { width: 17px; color: #888a91; font-size: 13px; transition: color .18s ease,transform .18s ease; }
.settings-tab:hover { border-color: rgba(255,255,255,.045); background: rgba(255,255,255,.035); color: #ecebe7; }
.settings-tab:hover i { color: #e4bd5a; transform: translateY(-1px); }
.settings-tab.active { border-color: rgba(229,185,68,.15); background: linear-gradient(100deg,rgba(215,168,48,.13),rgba(215,168,48,.045)); color: #f0d486; box-shadow: inset 0 1px rgba(255,255,255,.025); }
.settings-tab.active::before { position: absolute; top: 9px; bottom: 9px; left: -14px; width: 2px; border-radius: 2px; background: linear-gradient(180deg,#ffe18a,#d7a52f); box-shadow: 0 0 12px rgba(241,190,60,.36); content: ""; }
.settings-tab.active i { color: #e5bd58; }
.settings-nav-footer { position: absolute; right: 13px; bottom: 18px; left: 13px; display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid rgba(255,255,255,.055); border-radius: 12px; background: rgba(255,255,255,.018); }
.settings-nav-footer-star { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 9px; background: rgba(219,174,55,.1); color: #e7bf56; font-size: 15px; }
.settings-nav-footer strong,.settings-nav-footer small { display: block; }
.settings-nav-footer strong { color: #d5d4d0; font-size: 10px; font-weight: 650; }
.settings-nav-footer small { margin-top: 3px; color: #7f8188; font-size: 9px; }
.settings-content { min-width: 0; min-height: 0; padding: 28px clamp(22px,4vw,48px) 40px; overscroll-behavior: contain; background: radial-gradient(ellipse at 100% 0%,rgba(219,172,51,.035),transparent 30%); }
.settings-page { gap: 22px; animation: settingsPageEnter .24s ease both; }
@keyframes settingsPageEnter { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.settings-section-header { padding: 0 0 14px; border-bottom-color: rgba(255,255,255,.08); }
.settings-section-header h3 { color: #f0efeb; font-size: 21px; font-weight: 670; letter-spacing: -.035em; }
.settings-intro { color: #96989f; font-size: 12px; line-height: 1.55; }
.settings-hero { position: relative; display: flex; min-height: 164px; align-items: center; justify-content: space-between; overflow: hidden; padding: 23px 27px; border: 1px solid rgba(232,190,81,.18); border-radius: 17px; background: radial-gradient(ellipse at 82% 54%,rgba(218,169,51,.12),transparent 34%),linear-gradient(115deg,rgba(37,32,22,.88),rgba(25,25,25,.96) 54%,rgba(20,21,22,.92)); box-shadow: 0 12px 36px rgba(0,0,0,.18),inset 0 1px rgba(255,239,193,.05); }
.settings-hero::after { position: absolute; right: 20%; bottom: 0; left: 20%; height: 1px; background: linear-gradient(90deg,transparent,rgba(241,196,76,.25),transparent); content: ""; }
.settings-hero-copy { position: relative; z-index: 1; max-width: 500px; }
.settings-hero-label { display: inline-flex; align-items: center; gap: 7px; color: #d5b04c; font-size: 9px; font-weight: 750; letter-spacing: .15em; }
.settings-hero-label i { font-size: 10px; }
.settings-hero h3 { margin: 10px 0 5px; color: #f5f2e9; font-size: clamp(22px,3vw,30px); font-weight: 660; letter-spacing: -.045em; }
.settings-hero p { max-width: 440px; margin: 0; color: #a3a29c; font-size: 12px; line-height: 1.6; }
.settings-hero-chips { display: flex; gap: 7px; margin-top: 14px; }
.settings-hero-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 7px; background: rgba(255,255,255,.035); color: #b9b6ad; font-size: 9px; }
.settings-hero-chips i { color: #e4bc57; font-size: 9px; }
.settings-hero-art { position: absolute; top: 50%; right: clamp(22px,7vw,82px); width: 118px; height: 118px; transform: translateY(-50%); }
.settings-hero-art img { position: absolute; inset: 50% auto auto 50%; z-index: 1; width: 37px; height: 37px; transform: translate(-50%,-50%); filter: drop-shadow(0 0 13px rgba(245,191,52,.58)); }
.settings-orbit { position: absolute; inset: 9px; border: 1px solid rgba(232,186,68,.22); border-radius: 50%; box-shadow: inset 0 0 22px rgba(231,184,57,.035),0 0 22px rgba(231,184,57,.04); }
.settings-orbit-one { transform: rotateX(65deg) rotate(-28deg); }
.settings-orbit-two { inset: 17px 1px; transform: rotateX(65deg) rotate(42deg); border-color: rgba(245,207,104,.13); }
.settings-group { gap: 4px; padding: 14px; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; background: linear-gradient(145deg,rgba(255,255,255,.027),rgba(255,255,255,.012)); box-shadow: 0 8px 24px rgba(0,0,0,.1),inset 0 1px rgba(255,255,255,.022); }
.settings-group-title { padding: 0 3px 8px; color: #b7a66f; font-size: 9px; font-weight: 760; letter-spacing: .14em; }
.setting-row,.setting-row-select { min-height: 60px; padding: 9px 7px; border: 1px solid transparent; border-radius: 10px !important; background: transparent; transition: border-color .18s ease,background .18s ease,transform .18s ease; }
.setting-row + .setting-row,.setting-row + .setting-row-select { margin-top: 0; }
.setting-row:hover,.setting-row-select:hover { border-color: rgba(255,255,255,.045); background: rgba(255,255,255,.028); }
.setting-info { gap: 11px; }
.setting-icon-wrap { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.055); border-radius: 10px; background: rgba(255,255,255,.035); color: #d6bb70; }
.setting-info strong { color: #e4e2dc; font-size: 12px; font-weight: 620; }
.setting-info small { display: block; margin-top: 3px; color: #91939a; font-size: 10px; line-height: 1.45; }
.settings-dialog input[type="checkbox"] { position: relative; width: 39px; height: 23px; flex: 0 0 39px; appearance: none; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: #2b2d31; cursor: pointer; transition: border-color .18s ease,background .18s ease,box-shadow .18s ease; }
.settings-dialog input[type="checkbox"]::before { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #a3a4a8; box-shadow: 0 1px 3px rgba(0,0,0,.35); content: ""; transition: transform .18s cubic-bezier(.2,.75,.25,1),background .18s ease; }
.settings-dialog input[type="checkbox"]:checked { border-color: rgba(237,192,65,.82); background: linear-gradient(110deg,#f2cf66,#c99424); box-shadow: 0 0 13px rgba(220,174,50,.18); }
.settings-dialog input[type="checkbox"]:checked::before { background: #fff9e7; transform: translateX(16px); }
.settings-dialog input[type="checkbox"]:focus-visible { outline: 2px solid rgba(240,195,68,.62); outline-offset: 3px; }
.settings-select-inline,.settings-input { min-height: 36px; border-color: rgba(255,255,255,.09); border-radius: 9px; background-color: rgba(11,12,14,.7); color: #e6e4de; font-size: 11px; }
.settings-field-label { color: #cbc8c0; font-size: 11px; font-weight: 560; }
.settings-btn-primary { border: 1px solid rgba(245,207,105,.6); border-radius: 9px; background: linear-gradient(135deg,#e9c35a,#c89528); color: #211a0b; font-weight: 680; box-shadow: 0 5px 16px rgba(198,148,34,.15); transition: transform .18s ease,filter .18s ease,box-shadow .18s ease; }
.settings-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 8px 23px rgba(198,148,34,.22); }
.settings-btn-secondary { border: 1px solid rgba(255,255,255,.09); border-radius: 9px; background: rgba(255,255,255,.035); color: #c9c7c1; }
.settings-tab:focus-visible,.settings-dialog button:focus-visible,.settings-dialog select:focus-visible,.settings-dialog input:focus-visible { outline-color: rgba(239,194,66,.72); outline-offset: 3px; }
.settings-dialog .shortcut-row { min-height: 45px; border-bottom: 1px solid rgba(255,255,255,.045); color: #d0cec8; }
.settings-dialog .shortcut-row:last-child { border-bottom: 0; }
.settings-dialog .shortcut-keys kbd { min-width: 26px; padding: 4px 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; background: rgba(255,255,255,.045); color: #dfd2a9; }
.settings-dialog .profile-card-pro { border: 1px solid rgba(230,190,87,.13); border-radius: 13px; background: radial-gradient(ellipse at 100% 0,rgba(223,177,55,.075),transparent 54%),rgba(255,255,255,.018); }
.settings-dialog .profile-avatar-large { border: 1px solid rgba(237,195,74,.42); box-shadow: 0 0 18px rgba(217,171,49,.13); }
.settings-dialog .about-card { border: 1px solid rgba(230,190,87,.14); border-radius: 14px; background: radial-gradient(ellipse at 85% 40%,rgba(226,177,50,.09),transparent 40%),rgba(255,255,255,.018); }
body.light-mode .settings-dialog { border-color: rgba(146,111,25,.2); background: radial-gradient(ellipse at 84% 0%,rgba(211,169,61,.11),transparent 32%),linear-gradient(145deg,#fffefa,#f5f2e9 70%); box-shadow: 0 32px 90px rgba(49,43,27,.25),0 0 0 1px rgba(255,255,255,.7),inset 0 1px #fff; }
body.light-mode .settings-dialog::backdrop { background: rgba(37,34,27,.42); backdrop-filter: blur(12px) saturate(.9); }
body.light-mode .settings-dialog-header { border-bottom-color: rgba(44,43,35,.085); background: rgba(255,254,250,.72); }
body.light-mode .settings-dialog-header h2 { color: #28271f; }
body.light-mode .settings-dialog-kicker,.light-mode .settings-hero-label { color: #8b691b; }
body.light-mode .settings-header-note { color: #77776e; }
body.light-mode .settings-brand-icon { border-color: rgba(149,113,22,.2); background: radial-gradient(circle,rgba(208,165,49,.16),rgba(208,165,49,.025) 72%); }
body.light-mode .settings-dialog-header .modal-close { border-color: rgba(45,44,37,.1); background: rgba(255,255,255,.72); color: #6f6c61; }
body.light-mode .settings-nav { border-right-color: rgba(45,44,37,.09); background: linear-gradient(180deg,rgba(248,246,237,.86),rgba(241,239,229,.72)); }
body.light-mode .settings-nav-caption { color: #77766d; }
body.light-mode .settings-tab { color: #5f6059; }
body.light-mode .settings-tab i { color: #8c8b81; }
body.light-mode .settings-tab:hover { border-color: rgba(148,112,15,.1); background: rgba(148,112,15,.055); color: #3e392b; }
body.light-mode .settings-tab.active { border-color: rgba(148,112,15,.17); background: linear-gradient(100deg,rgba(197,153,39,.15),rgba(197,153,39,.055)); color: #59440d; }
body.light-mode .settings-nav-footer { border-color: rgba(44,43,35,.09); background: rgba(255,255,255,.55); }
body.light-mode .settings-nav-footer strong { color: #414139; }
body.light-mode .settings-nav-footer small { color: #77766d; }
body.light-mode .settings-content { background: radial-gradient(ellipse at 100% 0,rgba(208,163,48,.06),transparent 31%); }
body.light-mode .settings-section-header { border-bottom-color: rgba(44,43,35,.1); }
body.light-mode .settings-section-header h3 { color: #292820; }
body.light-mode .settings-intro { color: #6f7068; }
body.light-mode .settings-hero { border-color: rgba(150,111,22,.19); background: radial-gradient(ellipse at 82% 54%,rgba(194,151,39,.14),transparent 35%),linear-gradient(115deg,#f1ead5,#fbfaf5 58%,#f3f0e7); box-shadow: 0 10px 28px rgba(52,46,31,.065),inset 0 1px #fff; }
body.light-mode .settings-hero::after { background: linear-gradient(90deg,transparent,rgba(153,113,23,.23),transparent); }
body.light-mode .settings-hero h3 { color: #302c21; }
body.light-mode .settings-hero p { color: #6c6a60; }
body.light-mode .settings-hero-chips span { border-color: rgba(60,54,38,.1); background: rgba(255,255,255,.56); color: #57564e; }
body.light-mode .settings-orbit { border-color: rgba(154,115,26,.25); box-shadow: inset 0 0 22px rgba(197,150,30,.045),0 0 22px rgba(197,150,30,.06); }
body.light-mode .settings-group { border-color: rgba(44,43,35,.085); background: linear-gradient(145deg,rgba(255,255,255,.82),rgba(250,249,244,.78)); box-shadow: 0 7px 20px rgba(48,43,30,.035),inset 0 1px #fff; }
body.light-mode .settings-group-title { color: #826318; }
body.light-mode .setting-row:hover,body.light-mode .setting-row-select:hover { border-color: rgba(148,112,15,.1); background: rgba(148,112,15,.035); }
body.light-mode .setting-icon-wrap { border-color: rgba(54,52,43,.07); background: rgba(148,112,15,.055); color: #81621a; }
body.light-mode .setting-info strong { color: #34342e; }
body.light-mode .setting-info small { color: #74756d; }
body.light-mode .settings-dialog input[type="checkbox"] { border-color: rgba(55,54,46,.16); background: #deddd5; }
body.light-mode .settings-dialog input[type="checkbox"]::before { background: #fff; }
body.light-mode .settings-dialog input[type="checkbox"]:checked { border-color: #bd902c; background: linear-gradient(110deg,#e9bf4f,#c2922a); }
body.light-mode .settings-select-inline,body.light-mode .settings-input { border-color: rgba(45,44,37,.14); background-color: #fffefa; color: #34342e; }
body.light-mode .settings-field-label { color: #48483f; }
body.light-mode .settings-btn-secondary { border-color: rgba(45,44,37,.12); background: rgba(255,255,255,.65); color: #48483f; }
body.light-mode .settings-dialog .shortcut-row { border-bottom-color: rgba(44,43,35,.075); color: #43433c; }
body.light-mode .settings-dialog .shortcut-keys kbd { border-color: rgba(45,44,37,.12); background: rgba(148,112,15,.055); color: #69551a; }
body.light-mode .settings-dialog .profile-card-pro,body.light-mode .settings-dialog .about-card { border-color: rgba(150,111,22,.14); background: radial-gradient(ellipse at 100% 0,rgba(206,160,43,.09),transparent 54%),rgba(255,255,255,.7); }
@media (max-width: 760px) {
    .settings-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); border-radius: 17px; }
    .settings-dialog-header { flex: 0 0 72px; grid-template-columns: 1fr auto; padding: 0 14px; }
    .settings-header-note { display: none; }
    .settings-dialog-header .modal-close { grid-column: 2; }
    .settings-brand-icon { width: 35px; height: 35px; border-radius: 11px; }
    .settings-dialog-header h2 { font-size: 17px; }
    .settings-layout { flex-direction: column; }
    .settings-nav { width: 100%; flex-direction: row; gap: 5px; padding: 9px 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.07); }
    .settings-nav-caption,.settings-nav-footer { display: none; }
    .settings-tab { min-width: max-content; min-height: 37px; justify-content: center; gap: 7px; padding: 7px 10px; font-size: 10px; }
    .settings-tab.active::before { top: auto; right: 10px; bottom: -10px; left: 10px; width: auto; height: 2px; }
    .settings-content { padding: 16px 14px 28px; }
    .settings-page { gap: 16px; }
    .settings-hero { min-height: 150px; padding: 18px; }
    .settings-hero-art { right: 7px; width: 82px; height: 82px; opacity: .64; }
    .settings-hero-art img { width: 29px; height: 29px; }
    .settings-hero-copy { max-width: 78%; }
    .settings-hero h3 { font-size: 23px; }
    .settings-group { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .settings-page.active { animation: none; } }

/* A mobile-only navigation affordance replaces the hidden desktop sidebar
   header control and gives the chat search control breathing room. */
.mobile-sidebar-open-btn { display: none; }
@media (max-width: 840px) {
    .mobile-sidebar-open-btn { position: fixed; z-index: 9000; top: max(8px,env(safe-area-inset-top)); left: max(8px,env(safe-area-inset-left)); display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(232,190,82,.2); border-radius: 11px; background: rgba(24,25,27,.88); color: #d8bc65; box-shadow: 0 5px 18px rgba(0,0,0,.2),inset 0 1px rgba(255,255,255,.045); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
    .mobile-sidebar-open-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-sidebar-open-btn:active { transform: scale(.96); }
    .mobile-sidebar-open-btn:focus-visible { outline: 2px solid #f0cf72; outline-offset: 3px; }
    body.sidebar-open .mobile-sidebar-open-btn { display: none; }
    #aiChatView .topbar-left { padding-left: 42px; }
    #artworksView .topbar-left,
    .workspace-topbar-start,
    .projects-topbar-start,
    .research-brand,
    .code-brand,
    .canvas-brand,
    .notes-topbar-brand { padding-left: 42px; }
    body.light-mode .mobile-sidebar-open-btn { border-color: rgba(105,82,22,.22); background: rgba(255,254,249,.94); color: #65500f; box-shadow: 0 5px 18px rgba(55,48,32,.12),inset 0 1px #fff; }
    body.light-mode .mobile-sidebar-open-btn:focus-visible { outline-color: #397260; }
}

/* Light settings theme: warm porcelain, dark ink, and a strong dual focus ring. */
body.light-mode .settings-dialog {
    border-color: rgba(92,77,37,.18);
    background: linear-gradient(145deg,#fffefa 0%,#faf8f0 58%,#f3f1e8 100%);
    color: #292b25;
    box-shadow: 0 34px 100px rgba(41,39,29,.28),0 0 0 1px rgba(255,255,255,.92),inset 0 1px #fff;
}
body.light-mode .settings-dialog-header { background: rgba(255,255,251,.92); }
body.light-mode .settings-dialog-kicker { color: #76580f; }
body.light-mode .settings-header-note { color: #595d54; }
body.light-mode .settings-nav { background: linear-gradient(180deg,#f8f6ee,#f1efe5); }
body.light-mode .settings-nav-caption { color: #5f645b; }
body.light-mode .settings-tab { color: #444840; }
body.light-mode .settings-tab i { color: #62685e; }
body.light-mode .settings-tab.active { border-color: rgba(113,84,14,.2); background: linear-gradient(100deg,#efe5c6,#f8f4e7); color: #3f351c; box-shadow: inset 3px 0 #bd902c,0 2px 7px rgba(76,62,26,.05); }
body.light-mode .settings-tab.active::before { display: none; }
body.light-mode .settings-nav-footer { border-color: rgba(53,56,47,.12); background: #fffefa; }
body.light-mode .settings-nav-footer-star { background: #f1e7c6; color: #76580f; }
body.light-mode .settings-nav-footer strong { color: #30332d; }
body.light-mode .settings-nav-footer small { color: #60645b; }
body.light-mode .settings-section-header h3 { color: #292d27; }
body.light-mode .settings-intro { color: #565c53; }
body.light-mode .settings-hero { border-color: rgba(115,88,24,.24); background: radial-gradient(ellipse at 82% 54%,rgba(215,175,74,.19),transparent 37%),linear-gradient(115deg,#f0e6c9,#fffdf6 57%,#eaf0e8); box-shadow: 0 12px 28px rgba(51,47,34,.08),inset 0 1px #fff; }
body.light-mode .settings-hero-label { color: #6f520c; }
body.light-mode .settings-hero h3 { color: #2c3029; }
body.light-mode .settings-hero p { color: #50584e; }
body.light-mode .settings-hero-chips span { border-color: rgba(65,66,53,.15); background: rgba(255,255,250,.8); color: #41463e; }
body.light-mode .settings-group { border-color: rgba(51,55,47,.13); background: rgba(255,255,252,.92); box-shadow: 0 8px 22px rgba(45,46,37,.045),inset 0 1px #fff; }
body.light-mode .settings-group-title { color: #66500f; }
body.light-mode .setting-row,body.light-mode .setting-row-select { color: #30342e; }
body.light-mode .setting-row:hover,body.light-mode .setting-row-select:hover { border-color: rgba(107,83,21,.15); background: #f8f4e7; transform: translateY(-1px); }
body.light-mode .setting-icon-wrap { border-color: rgba(58,61,52,.11); background: #f0eee5; color: #685211; }
body.light-mode .setting-info strong { color: #292e28; }
body.light-mode .setting-info small { color: #555d53; }
body.light-mode .settings-select-inline,body.light-mode .settings-input { border-color: rgba(46,52,44,.2); background: #fff; color: #292e28; }
body.light-mode .settings-select-inline:hover,body.light-mode .settings-input:hover { border-color: rgba(106,82,17,.42); }
body.light-mode .settings-field-label { color: #373c34; }
body.light-mode .settings-dialog input[type="checkbox"] { border: 1px solid #74796e; background: #dedfd8; }
body.light-mode .settings-dialog input[type="checkbox"]::before { background: #fff; box-shadow: 0 1px 4px rgba(25,30,23,.28); }
body.light-mode .settings-dialog input[type="checkbox"]:checked { border-color: #6f5413; background: linear-gradient(110deg,#e4b843,#b98519); }
body.light-mode .settings-btn-primary { border-color: #906a16; background: linear-gradient(135deg,#f0d26e,#d2a334); color: #29220f; }
body.light-mode .settings-btn-secondary { border-color: rgba(45,51,43,.18); background: #fffefa; color: #383d35; }
body.light-mode .settings-dialog .shortcut-row { color: #343a32; }
body.light-mode .settings-dialog .shortcut-keys kbd { border-color: rgba(47,52,43,.17); background: #f2f0e7; color: #403a27; }
body.light-mode .settings-dialog :is(button,a,select,input,textarea,[tabindex="0"]):focus-visible {
    outline: 3px solid #397260 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px rgba(203,160,50,.25) !important;
    position: relative;
    z-index: 2;
}
body.light-mode .settings-tab:focus-visible { border-color: #397260; background: #fffefa; color: #263c32; }
body.light-mode .settings-dialog input[type="checkbox"]:focus-visible { outline-offset: 4px !important; }
body.light-mode .settings-group:focus-within { border-color: rgba(57,114,96,.32); box-shadow: 0 0 0 1px rgba(57,114,96,.08),0 9px 25px rgba(45,46,37,.055); }
body.light-mode .settings-dialog .danger-btn:focus-visible,
body.light-mode .settings-dialog .settings-btn-secondary:focus-visible { outline-color: #8a3e31 !important; box-shadow: 0 0 0 6px rgba(176,76,55,.18) !important; }
@media (max-width: 760px) {
    body.light-mode .settings-nav { border-bottom-color: rgba(53,56,47,.12); }
    body.light-mode .settings-tab.active { box-shadow: inset 0 -2px #bd902c; }
}
body.light-mode :is(.canvas-topbar,.canvas-toolrail,.canvas-ai-panel,.canvas-more-menu,.canvas-library-controls > label,.canvas-library-controls select,.canvas-card,.canvas-secondary-btn,.canvas-stage-column,.canvas-controls,.code-editor-pane,.CodeMirror,.CodeMirror-gutters) { border-color: rgba(39,39,32,.10); background-color: #fffefa; color: #34352f; }
body.light-mode :is(.code-tab.is-active,.code-bottom-tabs [data-bottom-tab].is-active) { background: #fffefa; color: #24251f; }
body.light-mode :is(.research-source-card,.research-result-card,.notes-card,.workspace-recent-card,.project-activity-item) { border-color: rgba(39,39,32,.095); background: linear-gradient(145deg,#fffefa,#f7f6f1); color: #34352f; }

.sidebar-toggle-glyph { display: block; width: 17px; height: 17px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; transition: stroke .18s ease, transform .18s ease; }
.sidebar-toggle-btn:hover .sidebar-toggle-glyph { transform: scale(1.04); }

/* Refined desktop icon rail */
@media (min-width: 841px) {
    #sidebar.sidebar.collapsed {
        width: 64px;
        border-right-color: rgba(255,255,255,.075);
        background:
            radial-gradient(ellipse at 50% 0%, rgba(212,175,55,.065), transparent 34%),
            linear-gradient(180deg, #111214 0%, #0d0e10 58%, #111214 100%);
        box-shadow: 8px 0 28px rgba(0,0,0,.22), inset -1px 0 rgba(255,255,255,.025);
    }
    #sidebar.sidebar.collapsed ~ .main { margin-left: 64px; }
    #sidebar.sidebar.collapsed::after {
        top: 68px;
        bottom: 83px;
        background: linear-gradient(180deg,transparent,rgba(212,175,55,.15) 20%,rgba(255,255,255,.035) 76%,transparent);
    }
    #sidebar.sidebar.collapsed .sidebar-header {
        height: 56px;
        flex-direction: row;
        justify-content: center;
        gap: 0;
        padding: 0 8px;
        border-bottom-color: rgba(255,255,255,.055);
    }
    #sidebar.sidebar.collapsed .sidebar-brand { display: none !important; }
    #sidebar.sidebar.collapsed .sidebar-close-btn {
        width: 30px;
        height: 30px;
        min-height: 30px;
        padding: 4px;
        border: 0;
        border-radius: 7px;
        color: #777e88;
        background: transparent;
    }
    #sidebar.sidebar.collapsed .sidebar-close-btn .sidebar-toggle-glyph { width: 17px; height: 17px; }
    #sidebar.sidebar.collapsed .sidebar-actions { align-items: center; gap: 4px; padding: 10px 9px 7px; }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn,
    #sidebar.sidebar.collapsed .sidebar-footer-btn {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        border-radius: 10px;
    }
    #sidebar.sidebar.collapsed .sidebar-actions #newChatBtn {
        border: 1px solid rgba(212,175,55,.18);
        color: #e6c867;
        background: linear-gradient(145deg,rgba(212,175,55,.11),rgba(212,175,55,.045));
        box-shadow: inset 0 1px rgba(255,255,255,.045),0 3px 9px rgba(0,0,0,.12);
    }
    #sidebar.sidebar.collapsed .sidebar-actions #newChatBtn:hover {
        border-color: rgba(212,175,55,.3);
        color: #f4d982;
        background: linear-gradient(145deg,rgba(212,175,55,.18),rgba(212,175,55,.08));
    }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn.is-active { position: relative; }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn.is-active::before { display: none !important; content: none !important; }
    #sidebar.sidebar.collapsed #userChatBtn { margin-top: 8px; }
    #sidebar.sidebar.collapsed .sidebar-search {
        position: relative;
        width: 44px;
        height: 48px;
        margin: 3px auto 0;
        padding-top: 6px;
        border-top: 1px solid rgba(255,255,255,.07);
    }
    #sidebar.sidebar.collapsed .sidebar-search-box { border-radius: 11px; }
    #sidebar.sidebar.collapsed .sidebar-search-box > i { font-size: 13px; }
    #sidebar.sidebar.collapsed .sidebar-footer {
        position: relative;
        margin-top: auto;
        padding: 10px 9px 7px;
        border-top: 1px solid rgba(255,255,255,.065);
    }
    #sidebar.sidebar.collapsed .sidebar-footer-btn { position: relative; }
    #sidebar.sidebar.collapsed .profile-card { padding: 7px 9px 12px; }
    #sidebar.sidebar.collapsed .profile-button {
        width: 44px;
        min-height: 44px;
        border: 1px solid rgba(255,255,255,.075);
        border-radius: 13px;
        background: rgba(255,255,255,.025);
        transition: border-color .18s ease,background .18s ease,box-shadow .18s ease;
    }
    #sidebar.sidebar.collapsed .profile-button:hover,
    #sidebar.sidebar.collapsed .profile-button[aria-expanded="true"] {
        border-color: rgba(212,175,55,.2);
        background: rgba(212,175,55,.065);
        box-shadow: inset 0 1px rgba(255,255,255,.04),0 4px 12px rgba(0,0,0,.14);
    }
    #sidebar.sidebar.collapsed .profile-avatar { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.08); }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn > i,
    #sidebar.sidebar.collapsed .sidebar-footer-btn > i { width: 17px; margin: 0; font-size: 12px; }
    #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn[title]:is(:hover,:focus-visible)::after,
    #sidebar.sidebar.collapsed .sidebar-footer-btn[title]:is(:hover,:focus-visible)::after,
    #sidebar.sidebar.collapsed .sidebar-search[title]:is(:hover,:focus-within)::after {
        position: absolute;
        top: 50%;
        left: calc(100% + 11px);
        z-index: 1000;
        display: block !important;
        width: max-content;
        max-width: 200px;
        min-height: 28px;
        margin: 0;
        padding: 7px 10px;
        transform: translateY(-50%);
        border: 1px solid rgba(255,255,255,.1);
        border-radius: 8px;
        color: #ece8db;
        background: #1b1c1f;
        box-shadow: 0 9px 24px rgba(0,0,0,.32);
        content: attr(title);
        font: 500 10px/1.35 Inter,sans-serif;
        letter-spacing: .01em;
        pointer-events: none;
        white-space: nowrap;
    }
    #sidebar.sidebar.collapsed .sidebar-search:is(:hover,:focus-within)::after { left: calc(100% + 7px); }
    #sidebar.sidebar.collapsed #globalUnreadBadge[style*="inline-flex"] {
        top: 3px;
        right: 2px;
        min-width: 16px;
        height: 16px;
        border: 2px solid #101113;
        color: #18150c;
        background: #e2c35b;
        font-size: 8px;
    }
    #sidebar.sidebar.collapsed :is(.sidebar-close-btn,.sidebar-actions .new-chat-btn,.sidebar-search-box,.sidebar-footer-btn,.profile-button):focus-visible {
        outline: 2px solid rgba(226,195,91,.78);
        outline-offset: 2px;
    }
    body.light-mode #sidebar.sidebar.collapsed {
        border-right-color: rgba(39,39,32,.09);
        background: radial-gradient(ellipse at 50% 0%,rgba(212,175,55,.09),transparent 35%),linear-gradient(180deg,#fffefa 0%,#f7f5ef 58%,#fffefa 100%);
        box-shadow: 8px 0 28px rgba(50,46,32,.07),inset -1px 0 rgba(255,255,255,.9);
    }
    body.light-mode #sidebar.sidebar.collapsed .sidebar-header,
    body.light-mode #sidebar.sidebar.collapsed .sidebar-footer { border-color: rgba(39,39,32,.075); }
    body.light-mode #sidebar.sidebar.collapsed .sidebar-close-btn { color: #76766e; }
    body.light-mode #sidebar.sidebar.collapsed .sidebar-actions #newChatBtn {
        border-color: rgba(148,112,15,.2);
        color: #75590e;
        background: linear-gradient(145deg,rgba(212,175,55,.16),rgba(212,175,55,.07));
    }
    body.light-mode #sidebar.sidebar.collapsed .sidebar-actions #newChatBtn:hover { color: #604a0e; background: rgba(212,175,55,.19); }
    body.light-mode #sidebar.sidebar.collapsed .profile-button { border-color: rgba(39,39,32,.09); background: rgba(255,255,255,.58); }
    body.light-mode #sidebar.sidebar.collapsed .profile-avatar { border-color: rgba(39,39,32,.1); }
    body.light-mode #sidebar.sidebar.collapsed #globalUnreadBadge[style*="inline-flex"] { border-color: #fffefa; color: #282318; background: #d0ad43; }
    body.light-mode #sidebar.sidebar.collapsed .sidebar-actions .new-chat-btn[title]:is(:hover,:focus-visible)::after,
    body.light-mode #sidebar.sidebar.collapsed .sidebar-footer-btn[title]:is(:hover,:focus-visible)::after,
    body.light-mode #sidebar.sidebar.collapsed .sidebar-search[title]:is(:hover,:focus-within)::after {
        border-color: rgba(39,39,32,.1);
        color: #33342f;
        background: #fffefa;
        box-shadow: 0 9px 24px rgba(50,46,32,.13);
    }
}
