/* Theme controls and palette, shared across the Factory Toolbox projects. */
:root{color-scheme:light}
.theme-toggle{--theme-travel:28px;position:relative;isolation:isolate;display:inline-flex;align-items:center;justify-content:space-around;flex:0 0 auto;direction:ltr;width:62px;height:36px;padding:3px;border:1px solid #cbd9df;border-radius:20px;background:#e9f0f3;color:#738791;cursor:pointer;vertical-align:middle}
.theme-toggle .theme-thumb{position:absolute;z-index:-1;top:4px;left:4px;width:26px;height:26px;background:#fff;border-radius:50%;box-shadow:0 1px 4px #172f3d22;transition:transform .2s ease,background .2s ease;pointer-events:none}
.theme-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.theme-toggle .theme-sun{color:#b77b19}.theme-toggle:focus-visible{outline:3px solid #e49b58;outline-offset:3px}.theme-toggle:hover{border-color:#0b9a90}
@media screen{
 html[data-theme=dark]{color-scheme:dark;--ink:#e0ebf1;--muted:#a4bac7;--line:#324957;--surface:#192b37;--panel:#192b37;--bg:#101c26;--canvas:#111f2a;--teal:#42c4b8;--teal-dark:#6ad8cb;--teal-soft:#173b3b;--orange:#ff9a63;--orange-dark:#e48852;--blue:#83b6e2;--danger:#ff9a91;--shadow:0 8px 24px #0004}
 html[data-theme=dark] .theme-toggle{background:#1c3545;border-color:#3b5b6c;color:#819aa9}
 html[data-theme=dark] .theme-toggle .theme-thumb{transform:translateX(var(--theme-travel));background:#355c71;box-shadow:none}
 html[data-theme=dark] .theme-toggle .theme-sun{color:#819aa9}html[data-theme=dark] .theme-toggle .theme-moon{color:#a5e7ef}
}
@media(max-width:760px){.theme-toggle{--theme-travel:20px;width:48px;height:30px;padding:2px}.theme-toggle .theme-thumb{top:3px;left:3px;width:22px;height:22px}.theme-toggle svg{width:16px;height:16px}}
@media(prefers-reduced-motion:reduce){.theme-toggle .theme-thumb{transition:none}}
@media print{.theme-toggle{display:none!important}}

/* Screen-only overrides: paper, result geometry and printed output retain their colors. */
@media screen{
html[data-theme=dark] body{background-color:#152530;color:#8cc3d9}
html[data-theme=dark] a:focus-visible,html[data-theme=dark] button:focus-visible{outline-color:#375360}
html[data-theme=dark] .topbar{background-color:#192b37;border-bottom-color:#375360}
html[data-theme=dark] .brand strong{color:#79ece8}
html[data-theme=dark] .local-badge{color:#a9bfcc}
html[data-theme=dark] #languageButton{border-top-color:#375360;border-right-color:#375360;border-bottom-color:#375360;border-left-color:#375360;background-color:#192b37;color:#95c2d0}
html[data-theme=dark] #languageMenu{background-color:#192b37;border-top-color:#375360;border-right-color:#375360;border-bottom-color:#375360;border-left-color:#375360}
html[data-theme=dark] #languageMenu button{background-color:#192b37;color:#95c2d0}
html[data-theme=dark] #languageMenu button:hover,html[data-theme=dark] #languageMenu button[aria-selected="true"]{background-color:#193c3b;color:#79ece6}
html[data-theme=dark] .eyebrow{color:#a9bfcc}
html[data-theme=dark] h1 em{color:#79ece8}
html[data-theme=dark] .intro{color:#a9bfcc}
html[data-theme=dark] .drawing-stamp{color:#a9bfcc}
html[data-theme=dark] .section-heading > span{color:#a9bfcc}
html[data-theme=dark] .tool-card{background-color:#192b37;border-top-color:#375360;border-right-color:#375360;border-bottom-color:#375360;border-left-color:#375360}
html[data-theme=dark] .card-number{color:#a9bfcc}
html[data-theme=dark] .description{color:#a9bfcc}
html[data-theme=dark] .formats{color:#a9bfcc}
html[data-theme=dark] footer{color:#a9bfcc}
html[data-theme=dark] .footer-mark{color:#a9bfcc}
html[data-theme=dark] .footer-links a:hover{color:#79ece8}
@media (max-width: 700px){html[data-theme=dark] .footer-links{border-top-color:#375360}}
html[data-theme=dark] body{background:#101c26;color:#e0ebf1}
html[data-theme=dark] .primary-button,html[data-theme=dark] .primary,html[data-theme=dark] .drawing-tools button[aria-pressed=true],html[data-theme=dark] .axis-buttons button.active{background:#197c76;color:#fff}
html[data-theme=dark] .primary-button:hover,html[data-theme=dark] .primary:hover{background:#226e69}
html[data-theme=dark] .language-menu button[aria-selected=true]{background:#226e69;color:#fff}
html[data-theme=dark] .brand-mark,html[data-theme=dark] .section-heading>span,html[data-theme=dark] .empty-state>b{background:#244553;color:#fff}
html[data-theme=dark] .loading{background:rgba(17,31,42,.96)}
html[data-theme=dark] .orientation-axes text{stroke:#111f2a}
html[data-theme=dark] .drawing-paper-wrap>svg{background:#fff;color:#172e3a;color-scheme:light}
html[data-theme=dark] .empty-graphic i,html[data-theme=dark] .empty-graphic span{background:rgba(33,60,72,.75)}

html[data-theme=dark] .tool-card{--accent:#59cfbf;--tint:#203f3d}
html[data-theme=dark] .tool-card.pipe{--accent:#85bce8;--tint:#253b50}
html[data-theme=dark] .tool-card.section{--accent:#edbb70;--tint:#433a2a}
html[data-theme=dark] .tool-card.nesting{--accent:#b7a5e7;--tint:#38334f}
html[data-theme=dark] .hero-art pattern path{stroke:#3a5666}html[data-theme=dark] .hero-art g{stroke:#8eb5be}
html[data-theme=dark] .card-category,html[data-theme=dark] .card-action{color:var(--accent)}

}

@media(max-width:760px){.header-actions,.topbar-actions,.top-actions{gap:8px}}
@media(max-width:370px){.header-inner{padding-inline:12px;gap:8px}.brand{font-size:16px;gap:6px}.brand-icon{width:30px;height:30px}.brand-icon svg{width:24px}#languageButton{padding:6px;gap:4px}}

@media screen{
 html[data-theme=dark] .sidebar{background:#13232e}
 html[data-theme=dark] .workspace{background:#101c26}
 html[data-theme=dark] .drop-zone{background:#152d38}
 html[data-theme=dark] .drop-zone:hover{background:#1b3d43}
 html[data-theme=dark] .brand-mark i{border-color:#e9f3f6}
 html[data-theme=dark] .canvas-wrap{background-color:#111f2a;background-image:radial-gradient(#304959 1px,transparent 1px)}
}
@media screen{html[data-theme=dark] .section-heading>span{background:transparent;color:#a9bfcc}}

@media screen{html[data-theme="dark"] .tool-card.layman{--accent:#efa28b;--tint:#45332e}}

@media screen{html[data-theme="dark"] .tool-card.quality{--accent:#adc0ff;--tint:#293955}}

@media screen{html[data-theme="dark"] .quality-links a{border-color:#324957}}

html[data-theme="dark"] .tool-card.bolt{--accent:#81c9be;--tint:#203f46}

@media screen{html[data-theme=dark] .tool-card.gear{--accent:#81cdb0;--tint:#203f35}}

@media screen{html[data-theme=dark] .tool-card.unit{--accent:#78cce4;--tint:#1d3c48}}

@media screen{html[data-theme=dark] .tool-card.material{--accent:#8bd2bd;--tint:#203b39}}

@media screen{html[data-theme=dark] .tool-card.spring{--accent:#70d7b7}html[data-theme=dark] .spring .card-art{stroke:#70d7b7}}

@media screen{html[data-theme=dark] .tool-card.fit{--accent:#7bc8e1;--tint:#203e50}}
