/* Dark and light appearance · Done by Pravin Yadav */
.theme-toggle{height:32px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 10px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);font-size:11px;white-space:nowrap}
.theme-toggle:hover{background:var(--raised);border-color:var(--secondary)}
.theme-toggle .icon{width:15px;height:15px}
.theme-toggle .theme-moon{display:none}
[data-theme=light] .theme-toggle .theme-sun{display:none}
[data-theme=light] .theme-toggle .theme-moon{display:block}
.appearance-card{margin-bottom:24px;padding:24px;border:1px solid var(--border);border-radius:10px;background:var(--surface)}
.appearance-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.appearance-heading h2{font-size:15px;font-weight:400}
.appearance-heading p{margin-top:6px;font-size:12px;color:var(--secondary)}
.appearance-options{display:grid;grid-template-columns:1fr 1fr;gap:16px;max-width:560px}
.theme-choice{display:flex;flex-direction:column;align-items:stretch;gap:12px;border:1px solid var(--border);border-radius:8px;background:var(--bg);padding:12px;text-align:left}
.theme-choice[aria-pressed=true]{border-color:var(--accent);outline:1px solid var(--accent);outline-offset:0}
.theme-choice-caption{display:flex;align-items:center;justify-content:space-between;font-size:12px}
.theme-choice-caption .icon{width:14px;height:14px;opacity:0}
.theme-choice[aria-pressed=true] .theme-choice-caption .icon{opacity:1;color:var(--accent)}
.theme-swatch{height:88px;border-radius:4px;border:1px solid var(--swatch-border);background:var(--swatch-page);display:grid;grid-template-columns:26% 1fr;overflow:hidden}
.theme-swatch:before{content:'';background:var(--swatch-rail);border-right:1px solid var(--swatch-border)}
.theme-swatch>span{margin:12px;border-radius:3px;border:1px solid var(--swatch-border);background:var(--swatch-card);position:relative}
.theme-swatch>span:before,.theme-swatch>span:after{content:'';position:absolute;left:8px;height:4px;border-radius:2px;background:var(--swatch-ink)}
.theme-swatch>span:before{top:10px;width:50%}
.theme-swatch>span:after{top:22px;width:70%;opacity:.45}
.swatch-dark{--swatch-page:#171b19;--swatch-rail:#111613;--swatch-border:#3c4c40;--swatch-card:#202c23;--swatch-ink:#b9ebc6}
.swatch-light{--swatch-page:#f4f6f3;--swatch-rail:#fff;--swatch-border:#cbd6cd;--swatch-card:#e5eee7;--swatch-ink:#216245}
.theme-system{margin-top:18px;border:0;padding:0;background:none;color:var(--secondary);font-size:11px;text-decoration:underline;text-underline-offset:3px}
.theme-system[aria-pressed=true]{color:var(--text)}
/* These tokens also reach the retained model workspace, forms and chart labels. */
:root[data-theme=light]{color-scheme:light;--bg:#f4f6f3;--surface:#fff;--raised:#eaf0eb;--border:#d2dcd4;--text:#1e2a22;--secondary:#4e6154;--muted:#596c5f;--accent:#216245;--accent-ink:#fff;--rule-soft:#e1e7e1;--plotter-deep:#184d35;--plotter-wash:#e3eee6;--viewer:#eef2ed;--ok:#216245;--clash-a:#b63d31;--clash-b:#895d11}
[data-theme=light] .rail{background:#fff;border-right-color:var(--border)}
[data-theme=light] .brand-small,[data-theme=light] .rail-workspace,[data-theme=light] .rail-link,[data-theme=light] .rail-link .icon,[data-theme=light] .creator small,[data-theme=light] .creator,[data-theme=light] .subtle-tag{color:var(--secondary)}
[data-theme=light] .rail-workspace,[data-theme=light] .nav-key,[data-theme=light] .creator{border-color:var(--border)}
[data-theme=light] .rail-link:hover{background:var(--raised);color:var(--text)}
[data-theme=light] .rail-link.is-current{background:#e1ede4;color:#215639}
[data-theme=light] .rail-link.is-current .icon{color:var(--accent)}
[data-theme=light] .nav-key{color:#45614d}
[data-theme=light] .avatar,[data-theme=light] .header-avatar{background:#e8f0e8;border-color:#c1d0c3;color:#355c40}
[data-theme=light] .status-dot{background:#8c6b30}
[data-theme=light] .status-dot.configured{background:var(--accent)}
[data-theme=light] .breadcrumb b{color:var(--text)}
[data-theme=light] .breadcrumb span{color:var(--muted)}
[data-theme=light] .command-trigger kbd{border-color:#c4d0c6}
[data-theme=light] .button-primary:hover{background:var(--plotter-deep);border-color:var(--plotter-deep)}
[data-theme=light] .button-secondary{background:var(--surface);border-color:#bdccbf;color:var(--text)}
[data-theme=light] .button-secondary:hover{background:var(--raised)}
[data-theme=light] .overview-hero{background:#e3ede4;border-color:#c0d0c3}
[data-theme=light] .hero-index,[data-theme=light] .overview-copy p,[data-theme=light] .format-line,[data-theme=light] .study-header,[data-theme=light] .study-header>span:last-child{color:#4f6757}
[data-theme=light] .overview-copy h2{color:#233d2c}
[data-theme=light] .tiny-line{border-color:#809e86}
[data-theme=light] .button-light{background:#255c3d;color:#fff}
[data-theme=light] .button-light:hover{background:#18472d}
[data-theme=light] .layer-toggle{background:#e5eee7;color:#3d5c47}
[data-theme=light] .layer-toggle:hover{background:#d5e3d7}
[data-theme=light] .study-explode{background:#d7e6da;border-color:#94b29d;color:#315b3f}
[data-theme=light] .study-explode[aria-pressed=true]{background:#b9d7c1}
[data-theme=light] .layer-dot.structure{background:#697f70}
[data-theme=light] .layer-dot.mep{background:#927034}
[data-theme=light] .building-model>g:first-child{stroke:#a7bbaa}
[data-theme=light] .building-model>g:last-child{fill:#4e6956}
[data-theme=light] .building-model>g:nth-last-child(2){stroke:#8aa18e}
[data-theme=light] .metrics strong{color:var(--text)}
[data-theme=light] .tool-card{background:var(--surface)}
[data-theme=light] .tool-card:hover{background:#edf3ee;border-color:#91ab98}
[data-theme=light] .tool-card-top,[data-theme=light] .tool-card-top span,[data-theme=light] .files-empty>.icon,[data-theme=light] .tool-card-foot{color:#476a53}
[data-theme=light] .tool-card h3{color:var(--text)}
[data-theme=light] .text-button,[data-theme=light] .connection-value{color:#2c6542}
[data-theme=light] .text-button:hover{color:#164329}
[data-theme=light] .floating-hud{background:#fff;border-color:#bccdc0}
[data-theme=light] .hud-btn{border-color:var(--border)}
[data-theme=light] .hud-btn:hover{background:var(--raised)}
[data-theme=light] .viewer-empty-overlay:after{background:linear-gradient(0deg,var(--viewer),rgba(238,242,237,.65) 50%,rgba(238,242,237,.04))}
[data-theme=light] .drop-veil{background:rgba(238,242,237,.93)}
.hero-actions .btn-primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.hero-actions .btn-primary:hover{background:var(--plotter-deep);border-color:var(--plotter-deep)}
[data-theme=light] .readout-clash.has-clashes{color:var(--clash-a)}
[data-theme=light] .toast{background:#203c2b;color:#f3f8f4}
[data-theme=light] .toast:before{background:#acd4b6}
[data-theme=light] .toast.error:before{background:#f1a59a}
[data-theme=light] .form-input::placeholder,[data-theme=light] .chat-input-bar input::placeholder{color:#627967}
[data-theme=light] .converter-card{border-color:#bacdbf}
[data-theme=light] .stepper b{border-color:#aebfb2}
[data-theme=light] .stepper .step-current b,[data-theme=light] .stepper .step-done b{border-color:var(--accent)}
[data-theme=light] .revit-drop{background:#f5f8f4;border-color:#99b6a1}
[data-theme=light] .revit-drop:hover,[data-theme=light] .revit-drop.is-dragging{background:#e1eee3;border-color:var(--accent)}
[data-theme=light] .privacy-line .icon{color:#3c6a48}
[data-theme=light] .target-visual{background:#e1ede3;border-color:#b6cfbd;color:#45664e}
[data-theme=light] .target-visual strong{color:#26553a}
[data-theme=light] .target-rule{border-color:#a1bfa8}
[data-theme=light] .honest-note a,[data-theme=light] .fallback-steps li>span{color:#2d6441}
[data-theme=light] .inspect-spinner{border-color:#a7c4af;border-top-color:var(--accent)}
[data-theme=light] .inline-error{color:#a0342b}
[data-theme=light] .compatibility-result{background:#e7f1e9;border-color:#a9c8b1;color:#254d32}
[data-theme=light] .settings-card pre{color:#355a40}
[data-theme=light] .settings-card code{color:#31573b}
[data-theme=light] .command-dialog{background:#fff;border-color:#b5c9bb;box-shadow:0 24px 80px #17351d26}
[data-theme=light] .command-dialog::backdrop{background:#203a2859}
[data-theme=light] .command-result:hover,[data-theme=light] .command-result:focus{background:#e2efe5;color:var(--text)}
/* Apply a quick color fade only after first paint and only when motion is allowed. */
@media(prefers-reduced-motion:no-preference){html.theme-ready body,html.theme-ready .rail,html.theme-ready .app-header,html.theme-ready .overview-hero,html.theme-ready .tool-card,html.theme-ready .left-panel,html.theme-ready .converter-card,html.theme-ready .settings-card,html.theme-ready .appearance-card,html.theme-ready .viewer-stage,html.theme-ready .viewer-empty-overlay{transition:background-color .18s ease-out,color .18s ease-out,border-color .18s ease-out}}
@media(max-width:1000px){.theme-toggle{padding:0 8px}.theme-toggle>span{display:none}}
@media(max-width:760px){.theme-toggle{width:32px;padding:0}.appearance-card{padding:20px}.appearance-heading{align-items:flex-start}.appearance-options{gap:12px}.theme-swatch{height:76px}.theme-choice{padding:8px}.theme-choice-caption{font-size:11px}}
