/* Keep the editor's canvas and geometry separate from the shared signed-in styling. */
html[data-theme] .project-editor-page {
    --editor-surface: color-mix(in srgb, var(--signed-surface) 93%, var(--ui-hover));
    --editor-control-shadow: 0 3px 7px var(--signed-clay-shadow),
        inset 0 1px 1px var(--signed-clay-rim);
    --editor-card-shadow: 0 5px 12px var(--signed-clay-shadow),
        inset 0 1px 1px var(--signed-clay-rim), inset 0 -3px 5px var(--signed-clay-depth);
}

html[data-theme][data-accent] .project-editor-page
:is(.topbar, .left-panel, .right-panel, .cm-side-panel, .statusbar) {
    background: var(--editor-surface);
    border-color: var(--ui-border);
    color: var(--ui-text);
}
html[data-theme] .project-editor-page .topbar {
    box-shadow: inset 0 1px 1px var(--signed-clay-rim);
}
html[data-theme] .project-editor-page
:is(.project-name, .panel-title, .section-label, .properties-title, .cm-panel-title,
    .cm-section-label, .tool-group-title, .ai-chat-hint) {
    color: var(--ui-muted);
}

html[data-theme] .project-editor-page
:is(.tool-group, .file-menu-dropdown, .ai-chat-menu, .project-loading-card, .rename-modal,
    .chat-rename-dialog, .keyboard-tools-dialog, .workspace-commands, .cm-upload-box, .cm-card) {
    background-color: var(--signed-surface);
    border-color: var(--ui-border);
    border-radius: 12px;
    box-shadow: var(--editor-card-shadow);
}
html[data-theme] .project-editor-page
:is(.cm-upload-box, .cm-card) {
    background-image: linear-gradient(145deg, var(--signed-surface), var(--editor-surface));
}
html[data-theme] .project-editor-page .tool-group {
    background: color-mix(in srgb, var(--signed-surface) 94%, transparent);
}
html[data-theme] .project-editor-page
:is(.canvas-tool, .component-icon, .credits-placeholder, .account-name,
    .account-plan-badge, .cm-result-row, .cm-file-details, .info-box, .cm-info-box) {
    background: var(--ui-card);
    border-color: var(--ui-border);
    border-radius: 8px;
    box-shadow: var(--editor-control-shadow);
}
html[data-theme] .project-editor-page
:is(.credits-placeholder, .account-name, .account-plan-badge, .canvas-tool):hover:not(:disabled) {
    background: var(--ui-accent-hover);
    border-color: var(--ui-border);
}
html[data-theme] .project-editor-page .left-panel .component {
    border-radius: 9px;
    color: var(--ui-text);
}
html[data-theme] .project-editor-page .left-panel .component:hover:not(:disabled) {
    background: var(--ui-accent-hover);
}
html[data-theme] .project-editor-page
:is(.search-box, #aiChatInput, .ai-model-select, .property-input, .property-textarea,
    .cm-form-field :is(input, textarea), .cm-ai-options select) {
    background: var(--ui-card);
    color: var(--ui-text);
    border-color: var(--ui-border);
    border-radius: 9px;
}
html[data-theme] .project-editor-page
:is(.right-panel-tabs, .ai-chat-header, .ai-chat-tabs, #aiChatForm, .ai-compact-footer) {
    border-color: var(--ui-border);
}
html[data-theme] .project-editor-page #aiChatMessages .ai-chat-message {
    border-radius: 10px;
    border-color: var(--ui-border);
}
html[data-theme] .project-editor-page #aiChatMessages .ai-chat-message.user {
    background: var(--ui-hover);
    color: var(--ui-text);
    box-shadow: inset 0 1px 1px var(--signed-clay-rim);
}
html[data-theme] .project-editor-page #aiChatSend {
    min-width: var(--send-size);
    background: var(--signed-action);
    border-color: transparent;
    color: var(--signed-on-action);
    box-shadow: var(--editor-control-shadow);
}
html[data-theme] .project-editor-page #aiChatSend:hover:not(:disabled) {
    background: var(--signed-action-hover);
}
@media (pointer: coarse) {
    html[data-theme] .project-editor-page #aiChatSend,
    html[data-theme] .project-editor-page #aiChatSend:hover:not(:disabled) {
        background: transparent;
        box-shadow: none;
    }
    html[data-theme] .project-editor-page #aiChatSend::before {
        box-shadow: var(--editor-control-shadow);
    }
}

.project-editor-page .workspace-settings-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}
#workspaceCommandsButton {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 2px;
    line-height: 1.1;
}
#workspaceCommandsButton kbd {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0;
    font-size: 9px;
    line-height: 1;
    direction: ltr;
    white-space: nowrap;
}
.commands-windows-icon, .commands-mac-key,
#workspaceCommandsButton[data-platform="mac"] .commands-control-key { display: none; }
#workspaceCommandsButton[data-platform="mac"] .commands-mac-key { display: inline; }
#workspaceCommandsButton[data-platform="windows"] .commands-windows-icon {
    display: block;
    width: 9px;
    height: 9px;
    fill: currentColor;
}
.connection-check-help {
    margin-top: 6px;
    color: var(--ui-muted);
    font-size: 11px;
    line-height: 1.45;
    text-align: end;
}

.project-editor-page > .topbar > .top-right {
    margin: 0;
    margin-inline-start: auto;
    justify-content: flex-end;
}
.project-editor-page .top-right > .sx-help-launcher {
    order: 0;
    margin: 0;
}
