﻿#main-content:has(.window-sill-studio #order-list:not([hidden])) { min-width: 0; }

.window-sill-studio, pf-sill-preview {
  color-scheme:light;--bg:#f5f5f2;--surface:#fff;--ink:#232621;--muted:#686c64;--line:#e0e2da;--accent:#c95529;--orange:#ea7540;--mono:'Cascadia Mono',Consolas,'Liberation Mono',monospace;
  --control-line:#c4c9be;--subtle:#f1f2ee;--field:#fcfcfa;--hover:#efefe9;
  --on-primary:#fff;--primary-hover:#41443d;--accent-bg:#fcf3ed;--accent-line:#eed5c7;
  --accent-ink:#a84c27;--error:#ae371d;--switch-off:#bfc3ba;--swatch-edge:#0002;
  --diagram-bg:#f4f5ef;--diagram-dot:#bfc5b5;--diagram-ink:#484f46;
  --stage-bg:var(--diagram-bg);--stage-glow:#fff9;--stage-grid:#46574712;--stage-grid-major:#4657471c;
  --axis-x:#a84427;--axis-y:#477337;--axis-z:#356789;
  --gable-near:#51746d;--gable-far:#526b8b;
}
html[data-theme="dark"] :is(.window-sill-studio, pf-sill-preview) {
  color-scheme:dark;
  --bg:#171c19;--surface:#232924;--ink:#edf1e9;--muted:#b9c2b6;--line:#414b42;
  --accent:#f6a071;--orange:#f28c58;--control-line:#738071;--subtle:#303830;
  --field:#1c221e;--hover:#384139;--on-primary:#1b211c;--primary-hover:#d4ddce;
  --accent-bg:#3b2c23;--accent-line:#76543e;--accent-ink:#ffae7e;--error:#ff9a88;
  --switch-off:#6e796e;--swatch-edge:#ffffff4d;
  --diagram-bg:#1e241f;--diagram-dot:#3b453c;--diagram-ink:#d2dbcf;
  --stage-bg:#202626;--stage-glow:#45514e38;--stage-grid:#c1cfc90b;--stage-grid-major:#d1dcd808;
  --axis-x:#e38c6f;--axis-y:#a4c697;--axis-z:#88aec9;
  --gable-near:#94bcb1;--gable-far:#a2b9de;
}

.window-sill-studio {
&{font:16px/1.45 'Segoe UI Variable Text','Segoe UI',Arial,sans-serif;color:var(--ink);font-synthesis:none}
#theme-toggle[aria-pressed=true]{background:var(--accent-bg);color:var(--accent-ink);box-shadow:inset 0 0 0 1px var(--accent-line)}
@media(max-width:420px){.header-actions #export span{display:none}}
*{box-sizing:border-box}button,input:where(:not([type=number])){font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.4}button:focus-visible,input:not([type=number]):focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #f39b6c;outline-offset:3px}button:where(:not(.cart-btn--primary)){border:0;background:none}button,summary,.field input{transition:background-color .15s,border-color .15s}svg{display:block}i[data-i]{display:inline-flex;font-style:normal;flex-shrink:0}i[data-i] svg,.button-icon,button>svg,.spec-title>svg{width:18px;height:18px}button{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:600}[hidden]{display:none!important}
.mast{background:var(--surface);border-bottom:1px solid var(--line)}.mast-inner,.shell{width:min(1490px,100%);margin:auto;padding-inline:clamp(20px,4.1vw,70px)}.mast-inner{height:69px;display:flex;align-items:center;justify-content:space-between;gap:16px}.identity,.header-actions,.title-row,.card-head,.spec-title,.dialog-actions{display:flex;align-items:center}.identity{gap:11px}.identity strong{font-size:26px;letter-spacing:-1.7px;font-weight:750}.brand-rule{height:20px;width:1px;background:var(--line);margin:0 3px}.studio-name{font-size:15px;font-weight:500;color:var(--muted)}.header-actions,.dialog-actions{gap:12px}.dark-btn,.plain-btn{padding:10px 15px;border-radius:7px;font-size:14px;min-height:39px}.dark-btn{background:var(--ink);color:var(--on-primary);box-shadow:0 1px 2px #2222}.dark-btn:hover{background:var(--primary-hover)}.plain-btn{color:var(--muted)}.plain-btn:hover{background:var(--hover)}.shell{padding-top:clamp(24px,3.2vh,41px);padding-bottom:20px}.eyebrow,.code-tag,.unit-tag,.stage-label,.small-head,.diagram-label,footer span:first-child{font:600 12px var(--mono);letter-spacing:.095em}.eyebrow{display:flex;align-items:center;gap:9px;color:var(--accent);font-size:12px}.eyebrow>span{height:2px;width:22px;background:var(--orange)}.title-row{gap:15px;margin:7px 0 2px}h1,h2,h3,p,dl,dd{margin:0}h1{font-size:clamp(39px,3.75vw,60px);line-height:1.09;letter-spacing:-.055em;font-weight:665}.code-tag,.unit-tag{letter-spacing:.035em;border:1px solid var(--control-line);border-radius:5px;color:var(--muted);padding:4px 7px;font-weight:500}.intro{font-size:16px;color:var(--muted);margin:8px 0 24px}.pf-card{overflow:hidden}.card-head{height:61px;justify-content:space-between;gap:9px;padding:0 20px}.card-head h2,.spec-title h2{display:flex;align-items:center;gap:10px;font-size:17px;font-weight:650;letter-spacing:-.025em}.card-head h2 svg,.spec-title svg{width:20px;height:20px}
.view-switch {
  --switch-on-bg: #dae0e0;
  --switch-off-bg: var(--switch-on-bg);
  --switch-off-text: var(--ink);
}
html[data-theme="dark"] & .view-switch {
  --switch-on-bg: #1f2525;
}
.view-switch .pf-label-switch__on { color: var(--ink); }
.view-switch .pf-label-switch__track { min-width: 123px; }
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: clamp(355px,32vw,490px);
  background-color: var(--stage-bg);
  background-image: radial-gradient(ellipse at 50% 38%,var(--stage-glow),transparent 70%),
    linear-gradient(var(--stage-grid) 1px,transparent 1px), linear-gradient(90deg,var(--stage-grid) 1px,transparent 1px),
    linear-gradient(var(--stage-grid-major) 1px,transparent 1px), linear-gradient(90deg,var(--stage-grid-major) 1px,transparent 1px);
  background-size: auto,24px 24px,24px 24px,120px 120px,120px 120px;
  background-position: center;
}
.stage:after{content:'';position:absolute;inset:0;box-shadow:inset 0 0 95px #0d141610;pointer-events:none;z-index:-1}
#render-area,#overlay,#section-view{position:absolute;inset:0;width:100%;height:100%}#overlay{pointer-events:none}#render-area canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}#render-area canvas:active{cursor:grabbing}.stage-label,.stage-tool,.viewer-tools,.axis{position:absolute;z-index:2}.stage-label{left:19px;top:23px;color:var(--muted);display:flex;align-items:center;gap:8px;font:500 11px var(--mono);letter-spacing:.14em;pointer-events:none}.stage-label b{width:6px;height:6px;background:#f28a55}.stage-tool,.viewer-tools{color:var(--ink);background:var(--surface);border:1px solid var(--control-line);border-radius:6px}.stage-tool:hover,.viewer-tools button:hover{background:var(--hover)}.labels-btn{right:16px;top:16px;height:30px;padding:0 10px;font-size:13px}.labels-btn svg{width:15px}.labels-btn[aria-pressed=false]{color:var(--muted);background:transparent}.viewer-tools{bottom:17px;right:16px;display:flex;padding:2px}.viewer-tools button{width:32px;height:29px;border-radius:3px;color:var(--ink)}.viewer-tools button:last-child{border-left:1px solid var(--control-line);border-radius:0}.viewer-tools svg{width:16px;height:16px}.axis{bottom:10px;left:10px;width:112px;height:auto;pointer-events:none}.live{font-weight:550}.live b{width:7px;height:7px;border-radius:50%;background:#5b866b}.fallback{position:absolute;z-index:3;bottom:12px;left:10px;background:#302f29;color:white;padding:6px;font-size:12px;max-width:70%}
.settings .card-head{border-bottom:1px solid var(--line)}.unit-tag{border:0;background:var(--subtle);color:var(--muted);padding:4px 7px}#panel{padding:18px 20px 20px}.small-head{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--muted);margin-bottom:10px}.small-head svg{width:15px;height:15px}.length-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 8px;margin-bottom:15px}.length-row label{font-weight:600;font-size:15px}
.stepper, .number-box {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 6px;
}
.stepper {
  flex: 0 1 auto;
  min-width: 0;
  gap: 4px;
}
.stepper .short {
  width: 6.25em;
  min-width: 4em;
}
.stepper button, .stepper small, .field-row .letter {
  flex: none;
}
.number-box .short {
  min-width: 6.25em;
}
.stepper button{width:29px;height:32px;font:17px var(--mono);color:var(--muted)}.stepper button:hover{background:var(--hover)}.stepper small,.number-box small{font:12px var(--mono);color:var(--muted)}.diagram{position:relative;background-color:var(--diagram-bg);border:1px solid var(--line);border-radius:7px;overflow:hidden;background-image:radial-gradient(var(--diagram-dot) .8px,transparent .9px);background-size:9px 9px;margin:0 0 14px;height:89px}.diagram-label{position:absolute;left:9px;top:7px;font-size:9px;color:var(--muted);letter-spacing:.1em}.diagram svg{width:100%;height:100%}.field-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;margin-top:4px}.field-row label{display:flex;align-items:center;gap:9px;font-size:14px}.letter{display:inline-grid;place-items:center;width:22px;height:22px;border:1px solid var(--accent-line);background:var(--accent-bg);color:var(--accent-ink);border-radius:4px;font:600 12px var(--mono)}.field-row input:invalid,.stepper input:invalid{color:var(--error)}.dimmed{opacity:.55}.settings details{border-top:1px solid var(--line);margin-top:15px;padding-top:13px}.settings summary{display:flex;align-items:center;gap:8px;cursor:pointer;list-style:none;font-size:14px;font-weight:600}.settings summary::-webkit-details-marker{display:none}.settings summary svg{width:17px;height:17px}.settings summary svg:last-child{margin-left:auto}.settings details[open] summary svg:last-child{transform:rotate(180deg)}.settings details .field-row label{font-size:13px}.spec{padding:17px 20px 19px}.spec-title{gap:9px;margin-bottom:15px}.spec-title h2{font-size:15px}.spec-title svg{width:17px;height:17px}.spec dl{display:grid;grid-template-columns:repeat(4,1fr)}.spec dl>div{border-left:1px solid var(--line);padding-left:clamp(10px,2vw,28px)}.spec dl>div:first-child{border:0;padding:0}.spec dt{font:500 11px var(--mono);color:var(--muted);letter-spacing:.085em;text-transform:uppercase;margin-bottom:4px}.spec dd{font:600 16px var(--mono);display:flex;align-items:center;gap:6px;white-space:nowrap}.spec dd small{font-size:12px;font-weight:400;color:var(--muted)}.spec .color-value{font:600 15px 'Segoe UI',sans-serif}.color-chip{width:13px;height:13px;border:1px solid var(--swatch-edge);border-radius:3px}.subcopy{color:var(--muted);font-size:14px}.subcopy{margin:0 0 14px}.setting-block+.setting-block{margin-top:24px}.choices{display:flex;gap:6px}.choices button{flex:1;border:1px solid var(--line);border-radius:5px;font:14px var(--mono);padding:8px 0}.choices [aria-pressed=true],.swatches [aria-pressed=true]{border-color:var(--accent);background:var(--accent-bg)}.swatches{display:grid;grid-template-columns:1fr 1fr;gap:7px}.swatches button{justify-content:flex-start;border:1px solid var(--line);border-radius:6px;padding:8px;font-size:13px;gap:7px}.swatches button span{width:21px;height:21px;border:1px solid #0002;border-radius:4px}.swatches svg{width:14px;margin-left:auto;color:var(--accent)}.switch-row{display:flex;align-items:center;justify-content:space-between;width:100%;text-align:left;padding:0}.switch-row strong{font-size:15px}.switch-row small{display:block;color:var(--muted);font-size:13px;font-weight:400}.switch{width:35px;height:21px;border-radius:30px;background:var(--switch-off);padding:3px;flex:none}.switch:after{content:'';display:block;width:15px;height:15px;border-radius:100%;background:white;box-shadow:0 1px 2px #0002}.switch-row[aria-checked=true] .switch{background:var(--accent)}.switch-row[aria-checked=true] .switch:after{margin-left:auto}.option{padding:14px 0 0}.option:first-of-type{padding-top:4px}.option .field-row{margin-top:9px}.option .field-row label{color:var(--muted);font-size:13px}footer{display:flex;justify-content:space-between;align-items:center;margin-top:24px;border-top:1px solid var(--line);padding-top:13px;color:var(--muted);font-size:12px}footer span:first-child{font-size:10px;letter-spacing:.08em}footer em{font-style:normal;color:var(--accent);padding:0 4px}dialog{background:var(--surface);max-width:min(380px,92vw);border:1px solid var(--line);border-radius:12px;padding:24px;color:var(--ink)}dialog::backdrop{background:#17201977}dialog h2{margin-bottom:8px}dialog p{color:var(--muted);font-size:15px}.dialog-actions{margin-top:22px;justify-content:flex-end}#toast:not(:empty){position:fixed;z-index:5;bottom:20px;left:50%;transform:translateX(-50%);background:var(--ink);border-radius:8px;padding:10px 18px;color:var(--on-primary);box-shadow:0 2px 15px #0003}
@media(max-width:969px){.mast-inner,.shell{padding-inline:22px}.card-head{padding:0 14px}.stage{height:385px}#panel{padding:15px}.spec{padding:14px}.spec dd{font-size:14px}.spec .color-value{font-size:13px}}@media(max-width:740px){.mast-inner,.shell{padding-inline:16px}.mast-inner{height:60px}.shell{padding-top:22px}.stage{height:clamp(290px,67vw,400px)}.intro{font-size:15px;margin-bottom:18px}.identity strong{font-size:23px}.brand-rule,.studio-name{display:none}.identity{gap:8px}.identity img{width:31px;height:31px}.header-actions{gap:3px}.plain-btn,.dark-btn{padding:8px 10px}.header-actions .plain-btn span{display:none}.header-actions .plain-btn{width:37px}.card-head{height:53px}.diagram{height:101px}.spec dd{white-space:normal}.axis{width:100px}.viewer-tools{bottom:12px}.spec dl{grid-template-columns:1fr 1fr;row-gap:16px}.spec dl>div:nth-child(3){border:0;padding:0}footer{gap:10px;align-items:start}footer span:last-child{text-align:right}}
#panel [data-measure] { padding: 4px 8px; }
#panel .range-track { display: block; }
#panel .range {
  display: block;
  width: 100%;
  min-height: 28px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
@media (any-pointer: coarse) {
  #panel .range-track { touch-action: pan-y pinch-zoom; cursor: pointer; }
  #panel .range { min-height: 36px; pointer-events: none; }
  #panel .range-track:has(:disabled) { cursor: not-allowed; }
}
#panel .range:disabled{cursor:not-allowed}
#panel .range[data-pointer-focus] { outline: none; }
.profile-highlight {
  fill: none;
  stroke: #ff3838;
  stroke-width: 4px;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.mini-section .profile-highlight { stroke-width: 3px; }
.active-gable path.gable-contour { color: #ff3838; fill-opacity: .28; stroke-width: 2px; stroke-dasharray: none; }
.profile-highlight.hole-rims { stroke-width: 2.5px; }
.guide-dimension path { fill: none; stroke: #ff5555; stroke-width: 1.6px; }
.guide-dimension text, .guide-caption, .rear-guide > text {
  fill: var(--error); stroke: var(--stage-bg); stroke-width: 3px; paint-order: stroke;
  stroke-linejoin: round; font: 600 12px var(--mono);
}
.rear-guide > text { fill: var(--diagram-ink); }
.rear-outline { fill: none; stroke: var(--diagram-ink); stroke-width: 1.5px; }
.options-diagram { display: none; }
.options-diagram:has(.rear-guide) .diagram-label { display: none; }
.options-diagram .rear-guide > text { fill: var(--diagram-ink); stroke: var(--diagram-bg); }
.options-diagram .rear-outline { stroke: var(--diagram-ink); }
#panel .active-measure { background: var(--subtle); border-radius: 6px; }
#panel .length-row{margin-bottom:0}
#panel .diagram{margin:8px 0}
#panel .measure .field-row{margin-top:0}
#panel .measure[data-measure="F"] .letter { margin-inline-end: 9px; }
.radius-note{font-size:13px;color:var(--muted);margin:0 0 16px}
.radius-note:empty { display: none; }
.gable-option{margin:15px 0 20px;border:1px solid var(--line);border-radius:8px;padding:10px 12px;min-width:0}
.gable-option legend{padding:0 5px;font-size:15px;font-weight:650}
.gable-option legend:has(.gable-view-btn){width:100%}
.gable-option legend > span{display:flex;align-items:center;justify-content:space-between;gap:10px}
.gable-view-btn{min-height:27px;padding:0 10px;gap:5px;border-radius:6px;background:var(--subtle);color:var(--ink);font-size:13px}
.gable-view-btn > svg{width:14px;height:14px;flex:none}
.gable-view-btn:hover:enabled{background:var(--hover)}
.profile-kind,.gable-kind{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px;margin-bottom:9px}
.profile-kind select,.gable-kind select{font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:6px;max-width:70%}


#order-open{display:flex;align-items:center;justify-content:center;text-decoration:none;font-weight:600;width:100%;min-height:42px;gap:9px;border:1px solid var(--accent-line);border-radius:8px;background:var(--accent-bg);color:var(--accent-ink);font-size:14px}
#order-open:hover,#order-add:hover{border-color:var(--accent)}
#order-open:is(:hover,:active,:focus){transform:none}
#order-open:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#order-list{width:min(1840px,100%)}
.order-foot{padding:13px 17px}
.order-scroll{overflow-x:auto;overscroll-behavior-x:contain}
.order-table {
  --cell-focus: #25734d;
  --order-cell-tint: 13%;
  --order-header-tint: 20%;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
html[data-theme="dark"] & .order-table {
  --cell-focus: #89c7a1;
  --order-cell-tint: 20%;
  --order-header-tint: 26%;
}
.order-table [data-column-group=preview] { --order-group-color: #69757f; }
.order-table [data-column-group=profile] { --order-group-color: #816399; }
.order-table [data-column-group=dimensions] { --order-group-color: #298977; }
.order-table [data-column-group=angles] { --order-group-color: #bd7b2e; }
.order-table [data-column-group=left-gable] { --order-group-color: #517eb8; }
.order-table [data-column-group=right-gable] { --order-group-color: #ad597b; }
.order-table [data-column-group=holes] { --order-group-color: #788a3f; }
.order-table [data-column-group=material] { --order-group-color: #986d52; }
.order-table [data-column-group=actions] { --order-group-color: #7c818b; }
.order-table thead { position: sticky; top: 0; z-index: 2; }
.order-table :is(th, td) {
  white-space: nowrap;
  vertical-align: middle;
  border-inline-end: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.order-table tr > :last-child { border-inline-end: 0; }
.order-table thead th {
  text-align: center;
  padding: 5px 6px;
  background: color-mix(in srgb, var(--subtle), var(--order-group-color) var(--order-header-tint));
  color: var(--ink);
  font-weight: 600;
}
.order-table tbody :is(td, th) {
  background: color-mix(in srgb, var(--order-cell-surface, var(--surface)), var(--order-group-color) var(--order-cell-tint));
}
.order-table tbody td {
  position: relative;
  height: 1px;
  padding: 0;
  text-align: center;
}
.order-table td:has(input[type=number]) { min-width: 7ch; }
.order-table td:has([data-key=length], [data-key=holeOffset], input[readonly]) { min-width: 9ch; }
.order-table td:has(input:disabled, input[readonly]) { --order-cell-surface: var(--subtle); }
.order-table td:has([data-key]):focus-within {
  outline: 2px solid var(--cell-focus);
  outline-offset: -2px;
  z-index: 1;
}
.order-table td:has(input:invalid) { outline: 2px solid var(--error); outline-offset: -2px; }
.order-table td > :is(input[type=number], select) {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 7px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
/* The site theme sets important backgrounds on native form fields. */
.order-table td > :is(input[type=number], select) { background-color: transparent !important; }
.order-table td > input[type=number] {
  position: absolute;
  inset: 0;
  appearance: textfield;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.order-table input::-webkit-inner-spin-button { appearance: none; }
.order-table td > :is(input:disabled, input[readonly]) { color: var(--muted) !important; }
.order-table select option { background: var(--surface); color: var(--ink); }
.order-table input[type=checkbox] { width: 16px; height: 16px; min-height: 0; margin: 0; vertical-align: middle; accent-color: var(--cell-focus); }
.order-table .order-material { min-inline-size: 160px; margin: 5px 6px; }
.order-table .order-material .material-picker__option {
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  font-size: 14px;
  white-space: normal;
}
.order-table .order-material .material-picker__option::after { content: none; }
.order-table tbody .order-preview { padding: 5px 8px; text-align: left; }
.preview-heading, .row-views { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.preview-heading { flex-direction: column; margin-right: 6px; }
.order-name, .preview-actions { display: flex; align-items: center; gap: 4px; }
.order-name { width: 14ch; min-height: 22px; }
.order-number { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.order-name-input { width: 100%; min-width: 0; height: 24px; margin: 0; padding: 0 4px; color: var(--ink); font: inherit; }
.preview-actions button { width: 26px; height: 26px; border: 1px solid var(--control-line); border-radius: 3px; color: var(--accent-ink); background: var(--field); }
.order-name button { flex: none; width: 20px; height: 22px; padding: 0; color: var(--muted); }
.order-name button svg { width: 12px; height: 12px; }
.preview-heading button:hover { background: var(--accent-bg); }
.order-table tbody tr, .preview-actions [data-action=move] { cursor: grab; }
.preview-actions [data-action=move] { touch-action: none; }
.order-table tbody .order-row-dragging { --order-cell-surface: var(--subtle); }
.order-table tbody .order-row-dragging :is(th, td) { cursor: grabbing; }
.order-table tbody th { user-select: none; }
.order-name-input { user-select: text; }
.order-image, .order-section { width: 96px; height: 54px; overflow: hidden; }
.order-image { display: grid; place-items: center; background: var(--stage-bg); color: var(--muted); }
.order-image canvas, .order-section > .sheet-diagram { display: block; width: 100%; height: 100%; }
.order-section { background: var(--diagram-bg); }
.order-table .order-actions { padding-inline: 6px; }
.order-actions button{display:block;width:100%;padding:2px 5px;border-radius:3px;color:var(--ink);font-size:12px}
.order-actions button:hover,.order-actions button:focus-visible{background:var(--hover)}
.order-actions [data-action=remove]{color:var(--muted);font-weight:500}
.order-foot{border-top:1px solid var(--line);padding-block:10px}
.order-footer-actions { display:flex; gap:8px; }
.order-footer-actions :is(#order-add, .order-back) {
  display:flex; align-items:center; justify-content:center; gap:6px; min-height:42px;
  background:var(--accent-bg); color:var(--accent-ink); border:1px solid var(--accent-line); border-radius:6px;
}
.order-back { flex:0 0 42px; }
.order-back:hover { background:var(--hover); }
#order-add { flex:1; }
#list-purchase #form-submit2 { flex:.5 1 0px; min-inline-size:0; padding-inline:0; white-space:normal; }
@container (max-width: 360px) {
  #list-purchase .product-controls { height:auto; flex-wrap:wrap; }
  #list-purchase .quantity-wrapper, #list-purchase #form-submit2 { min-height:40px; }
  #list-purchase #form-submit2 { flex:0 0 50%; }
}
@media(min-width:741px){.order-table .order-actions{position:sticky;right:0;z-index:1}}
@media(min-width:1050px){.order-table .order-preview{position:sticky;left:0;z-index:1}}
@media(max-width:740px){
  .order-foot{padding:10px}
}

#order-detail {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 16px);
  max-width: 2000px;
  aspect-ratio: 2.52;
  max-height: calc(100dvh - 16px);
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: clamp(12px, 1vw, 20px);
  overflow: hidden;
}
#order-detail[open] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
}
#detail-stage, #detail-profile, #detail-profile > svg { width: 100%; height: 100%; min-height: 0; }
.detail-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: clamp(12px, 1.35vw, 27px) clamp(16px, 1.85vw, 38px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.detail-head h2 { margin: 0; font-size: clamp(21px, 1.8vw, 36px); line-height: 1.15; font-weight: 700; }
.detail-head h2:focus { outline: 0; }
#detail-material { display: flex; align-items: center; gap: .45em; margin: 3px 0 0; color: var(--ink); font-size: clamp(14px, 1.2vw, 24px); line-height: 1.25; }
#detail-material .color-chip { width: 1em; height: 1em; flex: none; }
.detail-close { margin: 0; }
#detail-profile { border-inline-start: 1px solid var(--line); }
#detail-stage {
  --grid-step: clamp(24px, 2.1vw, 42px);
  --grid-major: calc(5 * var(--grid-step));
  background-size: auto, var(--grid-step) var(--grid-step), var(--grid-step) var(--grid-step), var(--grid-major) var(--grid-major), var(--grid-major) var(--grid-major);
}
#detail-axis { width: clamp(100px, 16%, 132px); height: auto; left: 2%; bottom: 7%; }
.detail-panel{min-width:0;padding:0;overflow:hidden}
.detail-panel > :is(h3,h4){display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;margin:0;padding:9px 14px;border-bottom:1px solid var(--line);font-size:16px;font-weight:650}
.detail-panel h3 small{color:var(--muted);font-size:13px;font-weight:500}
.model-host,.model-overlay{position:absolute;inset:0;width:100%;height:100%}
.model-host canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}
.model-host canvas:active{cursor:grabbing}
.model-overlay{pointer-events:none}
.sheet-diagram{width:100%;background:var(--diagram-bg)}
.sheet-diagram path,.sheet-diagram circle{fill:none;stroke-linejoin:round}
.sheet-diagram .cut{stroke:var(--diagram-ink);stroke-width:2.4}
.sheet-diagram .dim{stroke:var(--accent-ink);stroke-width:1}
.sheet-diagram .extension,.sheet-diagram .centerline{stroke:var(--muted);stroke-width:.8}
.sheet-diagram .centerline{stroke-dasharray:5 2 1 2}
.sheet-diagram text{fill:var(--accent-ink);font:600 14px var(--mono);paint-order:stroke;stroke:var(--diagram-bg);stroke-width:3px;stroke-linejoin:round}
#stage:has(> #section-view:not([hidden])) {
  background-image: radial-gradient(ellipse at 50% 38%,var(--stage-glow),transparent 70%);
}
.gable-both,.gable-left{color:var(--gable-near)}
.gable-right{color:var(--gable-far)}
svg path.gable-contour{fill:currentColor;fill-opacity:.09;stroke:currentColor;stroke-width:1.3;vector-effect:non-scaling-stroke;stroke-linejoin:round}
svg path.gable-right{stroke-dasharray:5 3}
@media (max-width: 740px) and (orientation: portrait) {
  #order-detail { aspect-ratio: .72; }
  #order-detail[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto repeat(2, minmax(0, 1fr)); }
  #detail-profile { border-inline-start: 0; border-top: 1px solid var(--line); }
}

  .studio-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.5rem; }
  .profile-warning-filter { position: absolute; pointer-events: none; }
  .profile-limit-error { --diagram-ink: #e63939; --gable-near: #e63939; --gable-far: #e63939; }
  .profile-limit-error :is(#render-area, .order-image) canvas { filter: url(#sill-limit-red); }
  #toast.limit-warning:not(:empty) { width: max-content; max-width: calc(100% - 24px); background: #922525; color: white; }
  .shell { padding-inline:0; }
  #configuration { width: 100%; container: sill-editor / inline-size; }
  .workspace {
    --sill-sticky-top: var(--profile-preview-sticky-top, 56px);
    --sill-available-height: var(--profile-preview-available-height, calc(100dvh - var(--sill-sticky-top) - 12px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(350px, 31%, 404px);
    align-items: start;
    gap: clamp(14px, 1.4vw, 24px);
  }
  .preview-column {
    position: sticky;
    top: var(--sill-sticky-top);
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    max-height: var(--sill-available-height);
  }
  .preview-column > .viewer-card { display: flex; flex-direction: column; min-height: min-content; }
  .preview-column .viewer-card > :not(#stage), .preview-column > :not(.viewer-card) { flex: none; }
  #stage { min-height: 100px; }
  .settings-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }
  #panel {
    display: grid;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 20px;
    padding: 14px clamp(12px, 1.2vw, 16px);
    align-items: start;
  }
  .config-section { min-width: 0; margin: 0; padding: 0; overflow: visible; }
  .config-section + .config-section { border-top: 1px solid var(--line); padding-top: 16px; }
  .config-section h3 {
    display: flex;
    align-items: center;
    gap: .35em;
    margin: 0 0 12px;
    color: var(--ink);
    font: 650 clamp(22px, 1.4vw, 28px)/1.15 'Segoe UI', sans-serif;
    letter-spacing: -.025em;
  }
  .config-section h3 i[data-i] svg { width: .95em; height: .95em; color: var(--accent-ink); }
  .option-title { display: flex; align-items: center; gap: 7px; }
  #option-fields .small-head svg, .option-title svg { width: 16px; height: 16px; flex: none; color: var(--accent-ink); }
  @container sill-editor (min-width: 740px) {
    .preview-column > .viewer-card { flex-basis: clamp(400px, calc(32vw + 104px), 594px); }
    #stage { height: auto; flex: 1 1 auto; }
  }
  @container sill-editor (min-width: 1640px) {
    .workspace { grid-template-columns: minmax(0, 1fr) minmax(970px, 1.3fr); }
    #panel { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
    .config-section { padding-inline: 16px; }
    .config-section:first-child { padding-left: 0; }
    .config-section:last-child { padding-right: 0; }
    .config-section + .config-section { border-top: 0; border-left: 1px solid var(--line); padding-top: 0; }
  }
  @container sill-editor (max-width: 739px) {
    #dimension-fields > .diagram { display: none; }
    .options-diagram { display: block; }
    .workspace { display: flex; flex-direction: column; align-items: stretch; }
    .preview-column { display: contents; }
    .workspace .viewer-card { position: sticky; top: var(--sill-sticky-top); z-index: 3; }
    #stage { height: clamp(100px, calc(var(--sill-available-height) * .24), 210px); }
    .settings-column { order: 1; }
    .workspace .spec { order: 2; }
  }
  @media (max-width: 740px) {
    #configuration { padding-top: 0; }
    .workspace .viewer-card { width: 100vw; max-width: none; margin-inline: calc(50% - 50vw); }
    #single-purchase > .purchase { padding-inline: 16px; }
    .studio-actions, #annotations, #stage .viewer-tools, #axis, #detail-axis,
    #stage .stage-label { display: none; }
    #stage.gable-closeup .viewer-tools,
    #stage.gable-closeup:has(#section-view[hidden]) .stage-label { display: flex; }
    #stage.gable-closeup .viewer-tools button:not(#fit) { display: none; }
  }
  .purchase {
    margin: 0;
    padding: 6px 10px 10px;
    font-family: mainfont, Arial, Helvetica, sans-serif;
    container-type: inline-size;
  }
  #sill-prices { margin-bottom: 8px; }
  .purchase-price, .purchase-setup-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
  }
  .purchase-price { column-gap: 4px; font-size: large; }
  .purchase-setup-price { gap: 5px 8px; font-size: small; }
  .purchase-setup-price small { font-size: xx-small; }
  @container (max-width: 300px) {
    .purchase .product-controls { gap: 8px; }
    .purchase .quantity-wrapper { gap: 4px; }
    .purchase .quantity-label { font-size: 1rem; }
    .purchase #form-submit2 { padding-inline: 8px; font-size: .875rem; }
  }
  .order-foot .purchase { padding: 10px 0 0; }
  #sill-row-material { width:min(390px,calc(100% - 24px)); max-width:none; max-height:85dvh; padding:16px; overflow:auto; }
  #sill-row-material > form { float:right; }
  #sill-row-material .sill-material-picker { clear:both; }
  .spec dd.color-value { white-space:normal; }

  .model-loading {position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); color:var(--ink); pointer-events:none;}
  .viewer-card {padding:0; overflow:visible;}
  .card-head {margin:0;}
  .spec {padding:17px 20px;}
}

pf-sill-preview > :is(.sill-stage, canvas) { background-color: var(--stage-bg); }

pf-sill-cart-preview.window-sill-studio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-content: start;
  gap: 12px;
  min-width: 0;
}
pf-sill-cart-preview.window-sill-studio .stage,
pf-sill-cart-preview.window-sill-studio .sill-cart-profile {
  height: auto;
  aspect-ratio: 1.88;
}
pf-sill-cart-preview .sill-cart-profile > svg { display: block; width: 100%; height: 100%; }
pf-sill-cart-preview .sill-cart-model[hidden], pf-sill-cart-preview .axis text { display: none; }
pf-sill-cart-preview.window-sill-studio .axis {
  width: clamp(28px, 9%, 57px);
  height: auto;
  left: 2%;
  bottom: 2%;
}
