.builder-page { --ink:#17211d; --paper:#fff; --green:#246c46; --line:#dce3e0; --muted:#58635f; height:100dvh; overflow:hidden; background:#f3f5f4; letter-spacing:0; }
.builder-page * { letter-spacing:0; }
.builder-header { height:66px; min-height:66px; padding:0 24px; border-bottom:1px solid #dce3e0; }
.builder-header .brand { font-size:20px; }
.builder-header .nav-links a { font-size:13px; }
.builder-header .header-action { font-size:13px; }
.builder-shell { height:calc(100dvh - 66px); min-height:0; grid-template-columns:280px minmax(0,1fr) 310px; background:#edf1ef; }
.builder-sidebar,.order-sidebar { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; background:#fff; }
.cad-workspace { position:relative; min-height:0; height:100%; grid-template-rows:auto minmax(0,1fr) 34px; background:#edf1ef; }
.cad-toolbar { padding:6px 10px; gap:4px; flex-wrap:wrap; overflow:visible; background:#fff; border-bottom:1px solid #dce3e0; }
.cad-toolbar button,.next-icon { width:36px; min-width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; padding:7px; border:1px solid transparent; border-radius:5px; background:transparent; color:#35483e; cursor:pointer; }
.cad-toolbar button svg,.next-icon svg,.next-command svg { width:19px; height:19px; flex:0 0 auto; }
.cad-toolbar button:hover,.next-icon:hover { background:#e6eee9; border-color:#c4d5ca; }
.cad-toolbar button.active,.next-icon[aria-pressed="true"] { background:#dcece2; color:#164f31; border-color:#a9c9b6; }
.cad-toolbar .unit-toggle button { width:34px; min-width:34px; padding:0; font-size:11px; }
.toolbar-separator { flex:0 0 1px; }
.canvas-wrap { min-width:0; min-height:0; padding:26px 14px; background:#edf1ef; }
.canvas-wrap::before { color:#70867a; }
.canvas-paper { width:100%; height:100%; min-height:0; max-height:100%; background:#fff; border:1px solid #d7e0db; box-shadow:0 5px 24px #17211d0a; }
.canvas-wrap { grid-template-rows:minmax(0,1fr); grid-template-columns:minmax(0,1fr); }
.shape-option::before { display:none; }
.cad-svg { touch-action:none; }
.cad-statusbar { gap:12px; font-size:10px; background:#fafcfb; color:#59695f; border-top:1px solid #dce3e0; white-space:nowrap; overflow:hidden; }
.panel-head { padding:18px; border-bottom:1px solid #dce3e0; }
.panel-head h1,.panel-head h2 { font-size:19px; line-height:1.3; }
.panel-head .eyebrow { font-size:10px; }
.panel-head>p:last-child { display:none; }
.control-section,.order-sidebar .control-section { padding:16px 18px; }
.control-section h2 { font-size:12px; line-height:1.4; color:#213d2d; }
.field { font-size:11px; }
.field input,.field select,.field textarea { min-width:0; min-height:38px; font-size:13px; background:#fcfdfc; border-color:#d6dfd9; border-radius:4px; }
.field-grid { gap:10px; }
.field input:focus,.field select:focus,.field textarea:focus { outline:2px solid #21734e; outline-offset:1px; }
.shape-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
.shape-option,.tool-button { min-width:0; min-height:38px; font-size:11px; border-radius:4px; }
.shape-option { display:flex; align-items:center; gap:8px; padding:8px; text-align:left; }
.shape-option svg { width:18px; height:18px; flex-shrink:0; }
.custom-shape-option { grid-column:1/-1; }
.section-help,.upload-note,.calibration-status,.path-tip,.path-help { font-size:11px; line-height:1.5; }
.price-box { background:#194c33; }
.price-box strong { font-size:30px; }
.price-box>span,.price-box small { color:#e0eee5; font-size:11px; line-height:1.4; }
.validation-list li,.summary-lines div,.terms-check,.builder-message,.cart-item p { font-size:11px; line-height:1.45; }
.cart-item strong { font-size:12px; }
.button { border-radius:4px; }
.equipment-section .section-help { display:none; }
.next-command { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; padding:8px 12px; border:1px solid #c9d7ce; border-radius:4px; color:#1d5838; background:#fff; cursor:pointer; font-family:inherit; font-weight:600; font-size:12px; }
.next-command.primary { background:#246c46; color:white; border-color:#246c46; }
.next-command:disabled,.next-icon:disabled { opacity:.45; cursor:not-allowed; }
.next-dialog { width:min(920px,calc(100vw - 24px)); max-height:calc(100dvh - 28px); padding:0; border:1px solid #ccd8cf; border-radius:7px; color:#17211d; background:#fff; box-shadow:0 24px 90px #11281c50; }
.next-dialog::backdrop { background:#11241aa6; }
.next-dialog header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-bottom:1px solid #dce3e0; }
.next-dialog h2 { font-size:18px; margin:0; }
.next-dialog h3 { font-size:12px; margin:4px 0 12px; }
.next-dialog-body { padding:16px; }
.next-dialog footer { display:flex; justify-content:flex-end; align-items:center; gap:10px; padding:12px 16px; border-top:1px solid #dce3e0; }
.next-dialog footer .next-feedback { flex:1; }
.next-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.next-fields label { display:flex; flex-direction:column; gap:5px; font-size:12px; color:#435c4c; }
.next-fields [hidden] { display:none; }
.next-fields input,.next-fields select { min-width:0; width:100%; height:39px; border:1px solid #ccd9d0; border-radius:4px; padding:7px; background:white; color:#17211d; font:inherit; }
.next-fields label.wide { grid-column:1/-1; }
.next-fields label.check { flex-direction:row; align-items:center; gap:8px; }
.next-fields input[type=checkbox] { width:17px; height:17px; }
.next-fields input[type=range] { padding:0; }
.next-feedback { font-size:12px; color:#53685c; line-height:1.45; margin:8px 0; overflow-wrap:anywhere; }
.next-feedback.error { color:#a82828; }
.next-pattern-grid,.next-photo-grid { display:grid; grid-template-columns:250px minmax(0,1fr); gap:18px; }
.next-pattern-preview { display:flex; align-items:center; justify-content:center; background:#f2f6f3; min-height:260px; border:1px solid #dce3e0; }
.next-pattern-preview svg { width:100%; height:100%; max-height:390px; }
.next-trace-frame { width:100%; height:450px; border:0; background:#eff3f0; }
.next-photo-settings { display:flex; flex-direction:column; gap:14px; }
.next-photo-settings button { width:100%; }
.next-photo-progress { position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:10px;min-height:44px;margin-bottom:12px;padding:8px 10px;border:1px solid #c9d7ce;background:#f2f6f3;color:#235d40;font-size:12px;line-height:1.4; }
.next-photo-progress progress { width:70px;min-width:70px;height:10px;accent-color:#246c46; }
.next-photo-progress progress[hidden] { display:none; }
.next-photo-progress span { min-width:0;overflow-wrap:anywhere; }
.next-photo-progress.error { color:#a82828;border-color:#dabbbb;background:#fff5f5; }
.next-photo-dialog.is-processing .next-trace-frame { pointer-events:none; }
.next-photo-dialog.is-processing .next-photo-grid { cursor:progress; }
.next-photo-dialog .next-photo-settings :disabled { opacity:.55;cursor:wait; }
.next-photo-measure { display:grid; gap:10px; padding-top:12px; border-top:1px solid #dce3e0; }
.next-node-panel { position:absolute; top:calc(var(--ux-toolbar-height,58px) + 6px); right:12px; z-index:5; width:224px; padding:12px; background:white; border:1px solid #c3d4c9; border-radius:6px; box-shadow:0 5px 22px #1c3f2626; }
.next-node-panel[hidden] { display:none; }
.next-node-panel header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; font-size:12px; }
.next-node-panel .next-fields { gap:8px; }
.next-node-panel .next-fields label { font-size:11px; }
.next-node-panel .next-fields input,.next-node-panel .next-fields select { height:34px; }
.next-local-row { display:flex; gap:8px; align-items:center; padding:12px 18px; border-bottom:1px solid #dce3e0; }
.next-local-row span { margin-left:auto; font-size:10px; color:#53685c; }
.next-saved-list { display:grid; gap:10px; margin-top:14px; }
.next-saved-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-top:1px solid #dce3e0; }
.next-saved-row strong { flex:1; font-size:13px; overflow-wrap:anywhere; }
.next-mobile-tabs { display:none; }
.next-more-tools { display:none!important; }
.next-tools-menu { position:absolute;right:8px;top:calc(var(--ux-toolbar-height,46px) + 4px);z-index:10;display:grid;grid-template-columns:repeat(4,40px);gap:6px;padding:10px;background:#fff;border:1px solid #bdcfc3;border-radius:5px;box-shadow:0 4px 14px #192a2030; }
.next-tools-menu[hidden] { display:none; }
.next-tools-menu button { display:grid;place-items:center;min-width:40px;width:40px;height:40px;border:1px solid #d1dcd5;border-radius:4px;background:#fff;color:#235d40;padding:8px; }
.next-tools-menu button svg { width:20px;height:20px; }
.next-tutorial { display:block; width:100%; max-height:60dvh; background:#18231d; }
.next-guide { font-size:13px; line-height:1.6; padding:12px 0; }
.next-guide p { margin:8px 0; }
.next-numeric { font-variant-numeric:tabular-nums; }
.next-photo-entry { display:flex; gap:8px; padding:0 18px 14px; align-items:center; }
.next-photo-entry .next-command { flex:1; min-height:44px; }
.next-photo-start { max-width:480px; }
.next-photo-upload { margin-top:16px; padding:22px 14px; border:1px dashed #88a895; background:#f4f8f5; }
.next-photo-upload input { max-width:100%; font:inherit; font-size:13px; }
.next-photo-upload input::file-selector-button { background:#246c46; color:#fff; border:0; border-radius:4px; min-height:44px; padding:8px 14px; margin-right:12px; font:inherit; cursor:pointer; }
.next-size-panel { position:absolute; top:calc(var(--ux-toolbar-height,52px) + 6px); left:10px; z-index:6; width:244px; max-width:calc(100% - 20px); max-height:calc(100% - var(--ux-toolbar-height,52px) - 44px); overflow:auto; padding:12px; border:1px solid #bfd0c4; border-radius:6px; background:#fff; box-shadow:0 4px 18px #1c3f2626; }
.next-size-panel[hidden] { display:none; }
.next-size-panel header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; font-size:13px; }
.next-size-panel [data-close] { display:grid; place-items:center; width:32px; height:32px; font-size:24px; background:transparent; border:0; color:#35483e; cursor:pointer; }
.next-size-target { display:flex; align-items:center; gap:8px; margin-bottom:10px; font-size:12px; }
.next-size-target select { min-width:0; width:100%; min-height:36px; background:#fff; border:1px solid #ccd9d0; border-radius:4px; color:#17211d; font:inherit; }
.next-size-dimension { cursor:pointer; }
.next-size-dimension:hover rect,.next-size-dimension:focus rect { fill:#e0efe5; stroke:#246c46; }
.next-resize-e { cursor:ew-resize; }.next-resize-s { cursor:ns-resize; }.next-resize-se { cursor:nwse-resize; }
.next-resize-handle:hover .next-handle-mark,.next-resize-handle:focus .next-handle-mark { fill:#d3eadc;stroke:#103f29; }
.next-resize-handle:focus { outline:none; }
.next-resizing #designLayer { opacity:.22; }
.next-resizing #referenceLayer { opacity:.2; }
#dimensionLayer { pointer-events:none; }
@media (max-width:1100px) and (min-width:981px) {
 .builder-shell { grid-template-columns:238px minmax(0,1fr) 270px; }
 .control-section,.order-sidebar .control-section { padding:14px; }
 .builder-header .header-action { display:none; }
}
@media (max-width:980px), (max-height:500px) and (max-width:960px) {
 .builder-header { padding:0 14px; height:54px; min-height:54px; }
 .builder-header .brand { font-size:17px; }
 .builder-header .nav-links { width:auto; margin:0 0 0 auto; padding:0; gap:14px; }
 .builder-header .nav-links a { display:none; }
 .builder-header .nav-links a[href="materials.html"],.builder-header .nav-links a[href="resources.html"] { display:block; font-size:11px; }
 .builder-shell { display:grid; height:calc(100dvh - 106px); min-height:0; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(220px,42%) minmax(0,1fr); }
 .cad-workspace { grid-row:1; grid-column:1; min-height:0; height:100%; grid-template-rows:auto minmax(0,1fr) 26px; border-bottom:1px solid #cbd8d0; }
 .cad-toolbar { padding:3px 6px; }
 .next-more-tools { display:inline-flex!important; }
 .cad-toolbar .toolbar-spacer,.cad-toolbar .toolbar-separator,.cad-toolbar #zoomReadout { display:none; }
 .cad-toolbar button { height:40px; min-width:40px; width:40px; }
 .canvas-wrap { padding:6px; }
 .cad-statusbar { font-size:9px; }
 .builder-sidebar,.order-sidebar { grid-row:2; grid-column:1; overflow:auto; display:block; border:0; background:#fff; padding-bottom:16px; }
 .order-sidebar { display:none; }
 .builder-page[data-mobile-panel="order"] .order-sidebar { display:block; }
 .builder-page[data-mobile-panel="order"] .builder-sidebar { display:none; }
 .panel-head { display:none; }
 .control-section,.order-sidebar .control-section { padding:14px 16px; }
 .control-section h2 { font-size:13px; }
 .field input,.field select,.field textarea { font-size:16px; min-height:42px; }
 .shape-options { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .shape-option { min-height:44px; font-size:11px; }
 .shape-option svg { width:16px; height:16px; }
 .next-mobile-tabs { position:fixed; inset:auto 0 0; height:52px; display:grid; grid-template-columns:1fr 1fr; z-index:10; background:#fff; border-top:1px solid #c2d3c8; padding-bottom:env(safe-area-inset-bottom,0px); }
 .next-mobile-tabs button { display:flex; align-items:center; justify-content:center; gap:10px; border:0; background:#fff; font-family:inherit; font-weight:600; font-size:13px; color:#55685d; cursor:pointer; }
 .next-mobile-tabs button[aria-pressed="true"] { color:#195637; background:#e5f0e9; box-shadow:inset 0 3px #257347; }
 .next-mobile-tabs svg { width:19px; height:19px; }
 .next-node-panel { top:49px; right:4px; width:200px; max-height:calc(100% - 52px); overflow:auto; padding:8px; }
 .next-size-panel { position:fixed; top:auto; left:8px; right:8px; bottom:60px; width:auto; max-width:none; max-height:calc(50dvh - 30px); padding:10px 12px; }
 .next-size-panel .next-fields { grid-template-columns:1fr 1fr; gap:8px; }
 .next-photo-entry { padding:0 16px 12px; }
 .next-dialog { width:calc(100vw - 12px); max-height:calc(100dvh - 12px); }
 .next-dialog-body { padding:12px; }
 .next-photo-grid,.next-pattern-grid { display:flex; flex-direction:column-reverse; gap:12px; }
 .next-trace-frame { height:36dvh; min-height:220px; }
 .next-pattern-preview { min-height:170px; max-height:210px; }
 .next-photo-settings { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
 .next-photo-settings .next-photo-measure { grid-column:1/-1; }
 .next-photo-settings .next-fields { grid-column:1/-1; }
 .next-dialog footer { flex-wrap:wrap; }
 .next-dialog footer .next-feedback { flex-basis:100%; }
 .next-fields input,.next-fields select { font-size:16px; min-height:42px; }
}
@media (max-height:500px) and (max-width:960px) and (orientation:landscape) {
 .builder-shell { height:calc(100dvh - 106px); grid-template-columns:280px minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
 .cad-workspace { grid-row:1; grid-column:2; }
 .builder-sidebar,.order-sidebar { grid-row:1; grid-column:1; }
 .next-dialog { max-height:calc(100dvh - 8px); }
 .next-photo-grid,.next-pattern-grid { display:grid; grid-template-columns:230px minmax(0,1fr); }
 .next-size-panel { top:108px; bottom:60px; left:8px; right:auto; width:264px; max-height:none; }
}
