/* Tiny suite theme: use the system appearance until the user chooses a theme. */
:root {
  color-scheme:light;
  --theme-bg:#ffffff; --theme-panel:#fafbf7; --theme-raised:#f1f4ec;
  --theme-text:#30372b; --theme-muted:#65725b; --theme-border:#dce2d4;
  --theme-accent:#557438; --theme-selected:#e7f2d7;
}
:root[data-theme='dark'] {
  color-scheme:dark;
  --green:#c5ee89; --line:#333b43; --muted:#a4afba; --panel:#1b2027; --ink:#e4e9ef;
  --theme-bg:#1b2027; --theme-panel:#20262e; --theme-raised:#2b333d;
  --theme-text:#e4e9ef; --theme-muted:#abb6c2; --theme-border:#414c58;
  --theme-accent:#c5ee89; --theme-selected:#34462d;
  background:var(--theme-bg); color:var(--theme-text);
}
:root[data-theme='dark'] body { background:var(--theme-bg); color:var(--theme-text); }
:root[data-theme='dark'] :is(.editor,.editor-top,.right-panel,.tools-panel,.panel-footer) { background:var(--theme-bg); color:var(--theme-text); border-color:var(--line); }
:root[data-theme='dark'] :is(.canvas-panel,.options-bar,.document-tab,.canvas-footer,.mesh-edit-bar,.materials-panel) { background:var(--theme-panel); border-color:var(--line); }
:root[data-theme='dark'] .project-info input { color:var(--theme-text)!important; }
:root[data-theme='dark'] .project-info input:hover { border-color:var(--theme-border)!important; }
:root[data-theme='dark'] :is(.section-heading h2,.material-library-heading h2,.material-channel h3,.mesh-properties strong,.help-grid strong,.material-card-name) { color:var(--theme-text); }
:root[data-theme='dark'] :is(label,.local-label,.icon-button,.text-button,.tool-button,.tool-name,.tool-options,.tools-bottom,.document-tab,.canvas-footer,.panel-footer,.panel-tabs>button,.section-heading>span,.hint,.eyebrow,.selection-type,.transform-title,.range-label,.range-label output,.object-row .select-object svg,.material-library-heading p,.material-card small,.material-users,.material-parameter>label,.material-parameter-inputs>span,.mesh-properties>span,.mesh-properties p,.component-modes button,.mesh-xray,.mesh-tool-options label,.inline-tool-controls,.mesh-tool-hint,.modeling-modes button,.context-menu-heading strong,.context-menu-heading>span,.context-menu-item>svg,.context-menu-item-text small,.context-menu-item kbd,.export-option>span,.shortcut-list>span) { color:var(--theme-muted); }
:root[data-theme='dark'] :is(#toolHint,#selectedInfo,#selectionSummary) { color:var(--theme-muted); }
:root[data-theme='dark'] :is(.button,.export-option,.material-card,.view-gizmo-home) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
:root[data-theme='dark'] button:hover:not(:disabled) { background:#35404b; }
:root[data-theme='dark'] .text-button:hover:not(:disabled) { background:transparent; color:var(--theme-accent); }
:root[data-theme='dark'] .button.primary { background:var(--green); color:#25321b; border-color:var(--green); }
:root[data-theme='dark'] .button.primary:hover:not(:disabled) { background:#b5e371; }
:root[data-theme='dark'] .brand-icon { color:#25321b; }
:root[data-theme='dark'] .brand-dot { color:#a4cd75; }
:root[data-theme='dark'] :is(input:not([type='range']):not([type='checkbox']):not([type='color']),select,textarea,.axis-field,.input-unit) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
:root[data-theme='dark'] :is(input,textarea)::placeholder { color:#95a2af; }
:root[data-theme='dark'] :is(input[type='range'],input[type='checkbox']) { accent-color:#a4cd75; }
:root[data-theme='dark'] :is(.modeling-modes,.mesh-tool-options,.mesh-selection-tools,.tab-badge,.mesh-properties,.context-menu-heading,kbd) { border-color:var(--theme-border); }
:root[data-theme='dark'] :is(.tool-button.active,.tool-button[aria-pressed='true'],.modeling-modes button.active,.component-modes button.active,.mesh-selection-tools button.active,.selection-toolbar .text-button[aria-pressed='true'],.material-card.active,.object-row.selected,.context-menu-item.checked,.context-menu-item[aria-expanded='true'],.context-menu-item:focus-visible) { background:var(--theme-selected); color:var(--theme-accent); border-color:#66834b; }
:root[data-theme='dark'] .panel-tabs>button.active { color:var(--theme-accent); border-bottom-color:#a4cd75; }
:root[data-theme='dark'] :is(.count,.document-badges span,kbd) { background:var(--theme-raised); color:var(--theme-muted); }
:root[data-theme='dark'] .tab-badge { color:var(--theme-muted); }
:root[data-theme='dark'] .mesh-properties { background:#263222; }
:root[data-theme='dark'] .material-preview { background:radial-gradient(ellipse at center,#35404b,#20262e); }
:root[data-theme='dark'] .swatches button { border-color:var(--theme-panel); box-shadow:0 0 0 1px var(--theme-border); }
:root[data-theme='dark'] .material-card:hover:not(:disabled) { border-color:#66834b; }
:root[data-theme='dark'] :is(.scene-context-menu,.scene-context-submenu,.mesh-tool-cursor-hint,.webgl-error) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); box-shadow:0 12px 40px #0005,0 2px 8px #0003; }
:root[data-theme='dark'] .context-menu-separator { background:var(--line); }
:root[data-theme='dark'] :is(.context-menu-item.danger,.material-delete .danger,.danger:hover:not(:disabled),.mesh-tool-cursor-hint.invalid) { color:#efac97; }
:root[data-theme='dark'] .mesh-tool-cursor-hint.invalid { border-color:#ac7561; }
:root[data-theme='dark'] .view-axis-button:hover { background:#ffffff20!important; box-shadow:0 0 0 2px #20262e99; }
:root[data-theme='dark'] dialog { background:var(--theme-bg); color:var(--theme-text); border-color:var(--theme-border); box-shadow:0 20px 80px #0007; }
:root[data-theme='dark'] dialog::backdrop { background:#10151bba; }
:root[data-theme='dark'] dialog p { color:var(--theme-muted); }
:root[data-theme='dark'] .toast { background:#d8edbb; color:#213019; border-color:#a4cd75; }
:root[data-theme='dark'] :is(.properties-scroll,.objects-list,.materials-list,.material-editor,.scene-context-menu,.scene-context-submenu) { scrollbar-color:#53616c transparent; }
.theme-toggle { flex:0 0 auto; width:32px; height:32px; color:var(--theme-muted); }
.theme-toggle:hover { background:var(--theme-raised); color:var(--theme-accent); }
@media(max-width:520px){.theme-toggle { width:26px; min-width:26px; }}
:root[data-theme='dark'] .theme-toggle:hover { color:var(--theme-accent); }
@media(max-width:380px){.header-actions #exportButton { font-size:0; gap:0; padding:8px 10px; }}
:root[data-theme='dark'] :is(.material-dialog-header,.material-dialog-tabs,.material-dialog .material-channel,.material-map-slot){border-color:var(--theme-border)}
:root[data-theme='dark'] .material-dialog-header h2,:root[data-theme='dark'] .material-map-head strong{color:var(--theme-text)}
:root[data-theme='dark'] .material-map-slot{background:var(--theme-panel)}
:root[data-theme='dark'] .material-map-slot.has-map{background:#263322;border-color:#66834b}
:root[data-theme='dark'] .material-dialog-tabs button{color:var(--theme-muted)}
:root[data-theme='dark'] .material-dialog-tabs button.active{background:var(--theme-selected);border-color:#66834b;color:var(--theme-accent)}
:root[data-theme='dark'] .material-preview-column{background:#20262e;border-color:var(--theme-border)}
:root[data-theme='dark'] .boolean-modifier-panel{background:var(--theme-panel);border-color:var(--theme-border)}
:root[data-theme='dark'] .material-map-settings label{color:var(--theme-muted)}
:root[data-theme='dark'] .material-preset-button{background:var(--theme-panel);border-color:var(--theme-border)}
:root[data-theme='dark'] .material-preset-button:hover{background:var(--theme-selected);border-color:#66834b}
:root[data-theme='dark'] .material-preset-text strong{color:var(--theme-text)}
:root[data-theme='dark'] .material-preset-text small{color:var(--theme-muted)}
:root[data-theme='dark'] .help-dialog{background:var(--theme-bg);color:var(--theme-text);border-color:var(--theme-border)}
:root[data-theme='dark'] .help-dialog-header,:root[data-theme='dark'] .help-sidebar{border-color:var(--theme-border)}
:root[data-theme='dark'] .help-sidebar{background:#20262e}
:root[data-theme='dark'] .help-sidebar nav button{color:var(--theme-muted)}
:root[data-theme='dark'] .help-sidebar nav button:hover{background:var(--theme-raised)}
:root[data-theme='dark'] .help-sidebar nav button.active{background:var(--theme-selected);color:var(--theme-accent)}
:root[data-theme='dark'] .help-article{color:var(--theme-text)}
:root[data-theme='dark'] .help-article p{color:var(--theme-text)}
:root[data-theme='dark'] .help-article h2,:root[data-theme='dark'] .help-article h3,:root[data-theme='dark'] .help-article strong{color:var(--theme-text)}
:root[data-theme='dark'] .help-article .help-lead{color:var(--theme-muted)}
:root[data-theme='dark'] .help-article code,:root[data-theme='dark'] .help-article kbd{background:var(--theme-raised);border-color:var(--theme-border);color:var(--theme-accent)}
:root[data-theme='dark'] .help-article .help-callout{background:#293b2a;color:var(--theme-text)}
:root[data-theme='dark'] .help-shortcuts,:root[data-theme='dark'] .help-shortcuts>span,:root[data-theme='dark'] .help-shortcuts>kbd{border-color:var(--theme-border)}
