:root{color-scheme:light}
.theme-toggle{flex-shrink:0;gap:7px;min-height:40px;white-space:nowrap}
.theme-toggle svg{flex-shrink:0}
.theme-toggle .theme-sun{display:none}
:root[data-theme="dark"] .theme-toggle .theme-moon{display:none}
:root[data-theme="dark"] .theme-toggle .theme-sun{display:block}
.theme-toggle:focus-visible{outline:2px solid #7f9b69;outline-offset:2px}
@media(max-width:950px){
 .topbar{height:auto;min-height:74px}
 .topbar-content{flex-wrap:wrap;padding-top:12px;padding-bottom:12px}
 .topbar-content .brand{flex:1 1 calc(100% - 165px)}
 .theme-toggle{order:1}
 .tutorial-trigger{order:2;margin-left:auto}
 .topbar-content .coffee-button{order:3}
}
@media(max-width:540px){
 .topbar-content .brand{flex:1 1 calc(100% - 54px)}
 .theme-toggle{width:40px;padding:0}
 .theme-toggle span{display:none}
 .tutorial-trigger{margin-left:0}
 .topbar-content .coffee-button{margin-left:auto}
}
@media screen{
 :root[data-theme="dark"]{
  color-scheme:dark;color:#e1e9e1;background:#111913;
  --ink:#e1e9e1;--green:#a7cfa8;--line:#354138;--muted:#b0bcb2;--soft:#26342a;
  --surface:#1b251e;--input-bg:#152018;--canvas:#17221a;
 }
 :root[data-theme="dark"] :is(.topbar,.controls,.preview-panel,.cut-panel,.cost-summary,.piece-peek,.share-link-panel,.load-plan-dialog,.tutorial-card,.mobile-section-nav){background:var(--surface);color:var(--ink);border-color:var(--line)}
 :root[data-theme="dark"] .expanded-preview{background:#111913;color:var(--ink)}
 :root[data-theme="dark"] :is(.number-field,.plan-name,.share-link-panel input,select,.shape,.orientation,.quiet,.layer-step,.more){background:var(--input-bg);color:var(--ink);border-color:var(--line)}
 :root[data-theme="dark"] .number-field input{color:var(--ink)}
 :root[data-theme="dark"] input::placeholder{color:#96a79a}
 :root[data-theme="dark"] :is(.number-field span,.eyebrow,.step,.stats span,.plan-note strong,.plan-note>span,.footer-brand,.text-button,.piece-label-help){color:var(--muted)}
 :root[data-theme="dark"] .step{border-color:var(--line)}
 :root[data-theme="dark"] :is(.quiet:hover,.layer-step:hover:not(:disabled),.more:hover,.shape:hover){background:var(--soft)}
 :root[data-theme="dark"] .save-primary{background:#a7cfa8;border-color:#a7cfa8;color:#132218}
 :root[data-theme="dark"] .save-primary:hover{background:#bddcbc}
 :root[data-theme="dark"] :is(.shape.active,.orientation.active){background:#2b3f2f;border-color:#85b58c;color:var(--ink)}
 :root[data-theme="dark"] .shape svg{stroke:#aabdad}
 :root[data-theme="dark"] .shape.active svg{fill:#3e5745;stroke:#bddbba}
 :root[data-theme="dark"] :is(.units-toggle,.view-toggle){background:var(--soft);border-color:var(--line)}
 :root[data-theme="dark"] :is(.units-toggle button.active,.view-toggle button.active){background:#364939;color:var(--ink);box-shadow:none}
 :root[data-theme="dark"] .preview{background:radial-gradient(ellipse at 50% 65%,#293d2e 0,var(--surface) 70%)}
 :root[data-theme="dark"] .preview-footer{border-color:var(--line)}
 :root[data-theme="dark"] .dim-text{fill:#c2d3c0}
 :root[data-theme="dark"] .dim-text[paint-order]{stroke:var(--canvas)}
 :root[data-theme="dark"] .dimension{stroke:#a3b49a}
 :root[data-theme="dark"] .focus-dimension-halo,:root[data-theme="dark"] .focus-dimension-text{stroke:var(--canvas)}
 :root[data-theme="dark"] .internal-dimension-text{fill:#b0d8c1}
 :root[data-theme="dark"] :is(.internal-dimension-line,.internal-dimension-ticks){stroke:#88bf9f}
 :root[data-theme="dark"] .stats{background:var(--soft)}
 :root[data-theme="dark"] .stats>div{border-color:var(--line)}
 :root[data-theme="dark"] :is(.print-button,.cut-tabs span,th){background:var(--soft)}
 :root[data-theme="dark"] :is(td,th){border-color:var(--line)}
 :root[data-theme="dark"] .stock-bar{background:repeating-linear-gradient(135deg,#26362c,#26362c 5px,#34473a 5px,#34473a 6px);border-color:var(--green)}
 :root[data-theme="dark"] .cut-marks span{background:var(--soft);border-color:#4c6650}
 :root[data-theme="dark"] .grid-cell{background:var(--input-bg);border-color:#415847}
 :root[data-theme="dark"] .grid-cell.selected{background:#3f6243;border-color:#97ba82}
 :root[data-theme="dark"] .draft-recovery{background:var(--soft);border-color:#416148}
 :root[data-theme="dark"] .workspace-identity .is-unsaved{color:#edcb8d}
 :root[data-theme="dark"] :is(.cost-error,.save-error,.number-field input[aria-invalid="true"]){color:#f0b6a7}
 :root[data-theme="dark"] #error{background:#37271e;border-color:var(--green);color:#f4cdb3}
 :root[data-theme="dark"] .saved-plan-choice{background:#223126;color:var(--ink);border-color:var(--line)}
 :root[data-theme="dark"] .saved-plan-choice:hover{background:#2a3e30;border-color:#749276}
 :root[data-theme="dark"] .saved-plan-delete{color:#f2aba7}
 :root[data-theme="dark"] .saved-plan-delete.is-confirming{background:#472a2a;border-color:#996866}
 :root[data-theme="dark"] :is(.piece-detail,.piece-peek p){background:var(--soft);border-color:var(--green);color:var(--ink)}
 :root[data-theme="dark"] .tutorial-card h2{color:var(--ink)}
 :root[data-theme="dark"] :is(.tutorial-card p,.tutorial-close,.tutorial-count,.tutorial-actions .tutorial-skip){color:var(--muted)}
 :root[data-theme="dark"] .tutorial-actions button{border-color:var(--line)}
 :root[data-theme="dark"] .tutorial-actions .tutorial-next{background:#a7cfa8;color:#132218;border-color:#a7cfa8}
 :root[data-theme="dark"] .tutorial-progress span{background:var(--line)}
 :root[data-theme="dark"] .tutorial-progress .complete{background:#a7cfa8}
}
@media print{
 :root{color-scheme:light}
 .theme-toggle{display:none!important}
}
