/* Slightly darkened UI palette from http://127.0.0.1:4173/color-tokens.css.
   SurfCAD turquoise and lime deliberately retain the requested values.
   Shared surface rules live in interface-theme.css; no source editor files are modified. */
html[data-surfcad-theme="animation-editor"] {
    --ui-bg: #090e13;
    --ui-sidebar: #0a0f13;
    --ui-card: #141d25;
    --ui-border: #25323c;
    --ui-text: #e9f1f3;
    --ui-muted: #a2b2bc;
    --site-border-strong: #2c3b46;
    --site-teal: #35d6d0;
    --site-lime: #d9ff60;
    --accent: #35d6d0;
}
html[data-surfcad-theme="animation-editor"] body {
    background: #090e13;
}
html[data-surfcad-theme="animation-editor"] :is(.topbar, .cad-header, .site-header, .public-footer) {
    background: #0e151c;
}
html[data-surfcad-theme="animation-editor"] :is(.viewport, .three-viewport) {
    background: #0b1218;
}
html[data-surfcad-theme="animation-editor"] :is(.diagram) {
    background-color: #0b1218;
}
html[data-surfcad-theme="animation-editor"] :is(.view-tabs, .three-visual-modes, .viewport-show-control>div) {
    background: #0a0f13;
}
html[data-surfcad-theme="animation-editor"] :is(.sidebar input:not([type="range"]):not([type="checkbox"]):not([type="color"]), .template-form input, .admin-user-filters input, .appearance-color-field .appearance-hex, .auth-card input) {
    color: #e9f1f3; background: #090f14;
}
html[data-surfcad-theme="animation-editor"] :is(.sidebar select, .viewport-show-control summary) {
    color: #e9f1f3; background: #18232c; border-color: #2c3b46;
}
html[data-surfcad-theme="animation-editor"] :is(.topbar button:not(:is(.brand-button, .new-project-button, .save-now-button, .projects-button, .available-export-button, .primary-button, .danger-button, .account-button, .autosave-button)), .theme-comparison-switch) {
    color: #e9f1f3; background: #18232c; border-color: #2c3b46;
}
html[data-surfcad-theme="animation-editor"] :is(.topbar button:not(:is(.brand-button, .new-project-button, .save-now-button, .projects-button, .available-export-button, .primary-button, .danger-button, .account-button, .autosave-button)):hover, .theme-comparison-switch:hover) {
    background: #23313c; border-color: #6a8990;
}
html[data-surfcad-theme="animation-editor"] :is(.view-tabs button.active, .three-visual-modes button.active) {
    color: #35d6d0; background: #1b2d29; border-color: #4f796a;
}
/* Colored action buttons retain their original styles and state colors. */

/* The remaining editor windows share the same neutral surfaces and controls. */
html[data-surfcad-theme="animation-editor"] :is(.projects-dialog, .auth-dialog, .exit-dialog, .stl-export-dialog, .target-volume-dialog, .pdf-preview-dialog, .new-project-dialog, .instagram-dialog, .production-access-dialog, .template-demo-panel) {
    color: var(--ui-text); background: var(--ui-sidebar); border-color: var(--ui-border);
}
html[data-surfcad-theme="animation-editor"] :is(.projects-dialog, .auth-dialog, .stl-export-dialog, .target-volume-dialog, .pdf-preview-dialog, .new-project-dialog, .instagram-dialog, .production-access-dialog)>:is(header, footer) {
    color: var(--ui-text); background: var(--ui-card); border-color: var(--ui-border);
}
html[data-surfcad-theme="animation-editor"] :is(.sidebar-footer, .board-dimension-summary, .stl-export-summary, .stl-export-summary div, .section-rail-menu, .section-compare-menu, .outline-point-menu, .three-lighting-menu, .appearance-color-palette, .spoon-point-details, .design-point-details, .design-rail-transition) {
    color: var(--ui-text); background: var(--ui-sidebar); border-color: var(--ui-border);
}
html[data-surfcad-theme="animation-editor"] :is(.hollow-parts-panel, .projects-dialog, .auth-dialog, .exit-dialog, .stl-export-dialog, .target-volume-dialog, .pdf-preview-dialog, .new-project-dialog, .instagram-dialog, .production-access-dialog, .outline-point-menu, .section-rail-menu, .three-lighting-menu) :is(input:not([type="range"]):not([type="checkbox"]):not([type="color"]):not([type="radio"]), select, textarea) {
    color: var(--ui-text); background-color: #090f14; border-color: var(--ui-border);
}
html[data-surfcad-theme="animation-editor"] :is(.outline-point-inspector, .section-rail, .section-rail-profile, .section-rail-flow, .section-rail-point, .three-lighting-control, .design-rail-transition, .spoon-point-details)>summary {
    color: #35d6d0; background: var(--ui-card); border-color: var(--ui-border);
}
html[data-surfcad-theme="animation-editor"] :is(.secondary-button:not(:is(.projects-button, .available-export-button, .danger-button)), .three-quality-control select, .viewport-show-control summary, .rocker-zoom-tools button, .outline-zoom-tools button:not(.delete-point), .section-zoom-tools button) {
    color: var(--ui-text); background: #18232c; border-color: #2c3b46;
}
html[data-surfcad-theme="animation-editor"] :is(.rocker-zoom-tools, .outline-zoom-tools, .section-zoom-tools) button.active {
    color: #35d6d0; background: #1b2d29; border-color: #4f796a;
}
html[data-surfcad-theme="animation-editor"] :is(.view-tabs button, .three-visual-modes button):not(.active) { color: var(--ui-muted); }
html[data-surfcad-theme="animation-editor"] :is(.appearance-toggle input, input[type="range"], input[type="checkbox"], input[type="radio"]) { accent-color: #35d6d0; }
html[data-surfcad-theme="animation-editor"] .dialog-backdrop { background: #05090dbf; }

/* Show, Compare and Quality share the same themed dropdown surface. */
html[data-surfcad-theme="animation-editor"] .viewport-show-control>summary{color:var(--ui-text);background:#18232c;border-color:#2c3b46}
html[data-surfcad-theme="animation-editor"] .viewport-show-control[open]>summary{border-color:#2c3b46}

/* Expanded menus, including portal menus and native dropdown options. */
html[data-surfcad-theme="animation-editor"] :is(.viewport-show-control>div, .section-compare-menu, .section-rail-menu, .outline-point-menu, .three-lighting-menu, .design-rail-transition>div, .spoon-point-fields) {
    color: var(--ui-text); background-color: #0a0f13; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] :is(.viewport-show-control>div, .section-compare-menu, .section-rail-menu, .outline-point-menu, .three-lighting-menu, .design-rail-transition>div) label {
    color: var(--ui-muted);
}
html[data-surfcad-theme="animation-editor"] :is(.viewport-show-control>div, .section-compare-menu) label:not(:has(input:disabled)):hover {
    color: var(--ui-text); background: #141d25; border-radius: 3px;
}
html[data-surfcad-theme="animation-editor"] :is(.viewport-show-control>div, .section-compare-menu) label:has(input:checked) {
    color: #35d6d0;
}
html[data-surfcad-theme="animation-editor"] :is(.design-rail-transition, .outline-point-inspector, .section-rail, .section-rail-profile, .section-rail-flow, .section-rail-point, .spoon-point-details)>summary {
    color: var(--ui-text); background: #141d25; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] :is(.design-rail-transition, .outline-point-inspector, .section-rail, .section-rail-profile, .section-rail-flow, .section-rail-point, .spoon-point-details)[open]>summary,
html[data-surfcad-theme="animation-editor"] :is(.design-rail-transition, .outline-point-inspector, .section-rail, .section-rail-profile, .section-rail-flow, .section-rail-point, .spoon-point-details)>summary:hover {
    color: #35d6d0; border-color: #30605e;
}
html[data-surfcad-theme="animation-editor"] .app-shell select option {
    color: var(--ui-text); background-color: #0a0f13;
}
html[data-surfcad-theme="animation-editor"] :is(.projects-tabs, .auth-tabs, .projects-list article, .dashboard-project-card, .export-hub-group, .production-access-option, .revision-purchase-confirmation, .template-demo-grid a) {
    color: var(--ui-text); background: #0a0f13; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] :is(.projects-list article.current, .production-access-option.is-selected) {
    background: #141d25; border-color: #35d6d0;
}
html[data-surfcad-theme="animation-editor"] :is(.projects-tabs button, .auth-tabs button) {
    color: var(--ui-muted); background: transparent; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] :is(.projects-tabs button.active, .auth-tabs button.active) {
    color: #35d6d0; background: #141d25;
}
html[data-surfcad-theme="animation-editor"] :is(.template-demo-grid a:hover, .production-access-option:hover) {
    background: #141d25; border-color: #30605e;
}

/* Flat active navigation: no separate fill or border tint. */
html[data-surfcad-theme="animation-editor"] .sidebar-mode-heading[aria-expanded="true"] {
    color: #35d6d0; background: transparent;
    box-shadow: inset 3px 0 0 #35d6d0;
}
html[data-surfcad-theme="animation-editor"] .sidebar-mode-heading[aria-expanded="true"]:hover {
    background: #111e27;
}
html[data-surfcad-theme="animation-editor"] .sidebar-mode-heading:not([aria-expanded="true"]):hover {
    background: #111e27;
}

/* Projects retain a soft cool spotlight, using the reference viewport blue-gray. */
html[data-surfcad-theme="animation-editor"] .projects-page .dashboard-main {
    background-image:
        radial-gradient(ellipse 900px 600px at 70% 240px, rgba(31, 48, 59, .65), transparent 75%),
        linear-gradient(rgba(53, 214, 208, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(53, 214, 208, .022) 1px, transparent 1px);
    background-size: auto, 42px 42px, 42px 42px;
    background-repeat: no-repeat, repeat, repeat;
}

/* Larger central modes and matching side controls in the design workspace. */
html[data-surfcad-theme="animation-editor"] .three-visual-modes button {
    height: 29px; padding: 0 11px; font-size: 11px;
}
html[data-surfcad-theme="animation-editor"] .appearance-finishes button {
    color: var(--ui-muted); background: #141d25; border-color: #2c3b46;
}
html[data-surfcad-theme="animation-editor"] .appearance-finishes button:hover {
    color: var(--ui-text); background: #1b2933; border-color: #456070;
}
html[data-surfcad-theme="animation-editor"] .appearance-finishes button.active {
    color: #d9ff60; background: #18232c; border-color: #d9ff60;
}
html[data-surfcad-theme="animation-editor"] .artwork-flat-svg {
    background: #0a0f13; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] #project-preview-mode {
    background: #0a0f13; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] :is(#project-preview-mode button, .warehouse-view-toolbar button) {
    color: var(--ui-muted); background: #141d25; border-color: #2c3b46;
}
html[data-surfcad-theme="animation-editor"] :is(#project-preview-mode button, .warehouse-view-toolbar button):hover {
    color: var(--ui-text); background: #1b2933; border-color: #456070;
}
html[data-surfcad-theme="animation-editor"] :is(#project-preview-mode button, .warehouse-view-toolbar button)[aria-pressed="true"] {
    color: #d9ff60; background: #18232c; border-color: #d9ff60;
}

/* Landing page: the same cool surfaces as the editor and project library. */
html[data-surfcad-theme="animation-editor"] .cad-home {
    color: var(--ui-text); background: #090e13;
}
html[data-surfcad-theme="animation-editor"] .cad-home .cad-hero {
    background: radial-gradient(ellipse at 77% 40%, rgba(31, 48, 59, .5), transparent 60%), #090e13;
}
html[data-surfcad-theme="animation-editor"] .cad-home :is(.cad-readouts, .cad-workflow, .cad-pricing) {
    background: #090e13;
}
html[data-surfcad-theme="animation-editor"] .cad-home :is(.cad-section, .cad-editor-intro, .cad-hollow-wood, .cad-ideas) {
    background: #0a0f13; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] .cad-home .cad-cloud-account {
    background: radial-gradient(ellipse at 82% 45%, rgba(31, 48, 59, .5), transparent 65%), #0a0f13;
    border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] .cad-home :is(.cad-hero-visual, .cad-cloud-library, .cad-editor-confirm) {
    color: var(--ui-text); background: #0b1218; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] .cad-home :is(.cad-readouts article, .cad-capability-grid article, .cad-pricing-grid article, .cad-cloud-board-card, .sample-format-guide article, .sample-file-card) {
    color: var(--ui-text); background: #141d25; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] .cad-home :is(.cad-capability-grid article:hover, .cad-cloud-board-card:hover, .sample-format-guide article:hover, .sample-file-card:hover) {
    background: #18232c; border-color: #456070;
}
html[data-surfcad-theme="animation-editor"] .cad-home .cad-cloud-board-grid .cad-cloud-board-card.is-featured-board {
    border-color: #d9ff60;
}
html[data-surfcad-theme="animation-editor"] .cad-home :is(.cad-cloud-board-visual, .cad-pricing-status) {
    background: #0a0f13; border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] .cad-home .cad-pricing-grid article.is-highlighted {
    background: #141f26; border-color: #35d6d0;
}
html[data-surfcad-theme="animation-editor"] .cad-home :is(h1, h2, h3, .cad-visual-head, .cad-model-metrics dd, .cad-readouts dd, .cad-cloud-board-meta strong) {
    color: var(--ui-text);
}
html[data-surfcad-theme="animation-editor"] .cad-home :is(.cad-hero-copy>p:not(.cad-hero-tagline):not(.cad-hero-wood-note), .cad-section-heading p, .cad-capability-grid p, .cad-pricing-grid p, .cad-pricing-grid li, .cad-hero-facts dt, .cad-model-metrics dt, .cad-readouts dt, .cad-cloud-board-meta span, .sample-format-guide p, .sample-file-card span) {
    color: var(--ui-muted);
}
html[data-surfcad-theme="animation-editor"] .cad-home :is(.cad-eyebrow, .cad-index, .cad-capability-grid article>span) { color: #35d6d0; }
html[data-surfcad-theme="animation-editor"] .cad-home .cad-hero-tagline { color: #d9ff60; }
html[data-surfcad-theme="animation-editor"] .cad-home .cad-hero-copy>.cad-hero-wood-note {
    background: #141f26; color: var(--ui-text); border-color: #30605e; border-left-color: #35d6d0;
}
html[data-surfcad-theme="animation-editor"] .cad-home .cad-model-metrics {
    background: rgba(10, 15, 19, .85); border-color: #25323c;
}
html[data-surfcad-theme="animation-editor"] .cad-home .cad-footer {
    color: var(--ui-muted); background: #0a0f13; border-color: #25323c;
}
@media(max-width:640px) {
    html[data-surfcad-theme="animation-editor"] .three-visual-modes button {
        padding: 0 7px; font-size: 10px;
    }
}
