:root { color-scheme: dark; font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif; background: #232323; color: #f1f1f1; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; min-height: 100%; }
body { margin: 0; min-width: 320px; overflow: auto; background: linear-gradient(145deg, #2e2e2e, #202020); }
html.preview-is-open, html.preview-is-open body { overflow: hidden; }
button, input { font: inherit; }
button { -webkit-user-select: none; user-select: none; }
.app-shell { display: flex; flex-direction: column; min-height: 0; padding: 14px 18px 10px; }
#cartonPackaging { display:flex; flex-direction:column; flex:0 0 auto; }
.packaging-tabs { display:flex; align-items:center; gap:0; padding:8px 0 2px; }
.packaging-tabs { flex-wrap:wrap; }
.packaging-tabs .barcode-enable { margin:0 0 6px auto; display:flex; flex-direction:row; align-items:center; gap:6px; padding:4px 2px; color:#c1cbd1; font-size:12px; cursor:pointer; white-space:nowrap; }
.barcode-enable input { width:16px; height:16px; margin:0; accent-color:#c9a45c; }
.opening-notch-choice { display:flex; align-items:center; gap:8px; min-height:36px; color:#c1cbd1; }
#openingNotchField input[type="checkbox"] { width:16px; min-width:16px; height:16px; min-height:16px; margin:0; padding:0; accent-color:#c9a45c; }
.barcode-options { padding:10px 0 14px; border-bottom:1px solid #3a4248; }
.barcode-fields { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; }
.barcode-fields label { display:flex; flex:1 1 160px; min-width:130px; flex-direction:column; gap:5px; color:#aebbc4; font-size:12px; }
.barcode-fields input { width:100%; min-width:0; height:36px; border:1px solid #48535c; border-radius:3px; padding:6px 9px; background:#282c30; color:#f1f1f1; font-size:14px; }
.barcode-fields button { height:36px; padding:6px 12px; }
.barcode-options small { display:block; margin-top:7px; color:#aebbc4; }
.barcode-options small.error { color:#ff9292; }
@media(max-width:600px) { .packaging-tabs .barcode-enable { margin-left:0; } }
#cupDieline { display:block; width:100%; height:260px; background:#eef1f3; border-radius:5px; margin:14px 0; }
#containerPackaging input { width:100%; box-sizing:border-box; }
.is-panel-resizing .app-shell *, .is-panel-size-drag .app-shell * { transition:none !important; }
.is-panel-size-drag, .is-panel-size-drag * { user-select:none !important; -webkit-user-select:none !important; }
.panel-resize-edge,.panel-resize-edge:hover,.panel-resize-edge:focus,.panel-resize-edge:active { position:fixed; z-index:10001; top:0; width:12px; height:12px; min-width:0; min-height:0; padding:0; border:0; outline:0; border-radius:0; background:transparent; box-shadow:none; touch-action:none; }
.preview-window { position:relative; }
.preview-window .preview-resize-edge { position:absolute; }
.panel-resize-edge::before,.panel-resize-edge::after { display:none; content:none; }
.panel-resize-nw { left:0; cursor:nwse-resize; }
.panel-resize-ne { right:0; cursor:nesw-resize; }
.is-panel-size-drag[data-panel-resize-edge="nw"],.is-panel-size-drag[data-panel-resize-edge="nw"] * { cursor:nwse-resize !important; }
.is-panel-size-drag[data-panel-resize-edge="ne"],.is-panel-size-drag[data-panel-resize-edge="ne"] * { cursor:nesw-resize !important; }
#containerPackaging { padding:14px; border:1px solid #444; border-radius:8px; }
#containerPackaging label { display:flex; flex-direction:column; gap:6px; color:#bbb; font-size:12px; }
#containerPackaging input, #containerPackaging select { min-width:0; padding:9px; border:1px solid #555; border-radius:4px; background:#252525; color:#eee; }
#containerPackaging .field-hint { line-height:1.7; font-size:11px; white-space:normal; overflow:visible; }
#containerPackaging .cup-dimensions { grid-template-columns:repeat(4,minmax(0,1fr)); }
#containerPackaging .soft-fields label > span { min-height:2.8em; line-height:1.4; }
@media(max-width:600px) { #containerPackaging .cup-dimensions { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.packaging-tabs button { flex:0 0 auto; min-width:0; height:32px; margin:0 6px 6px 0; border:1px solid #555; border-radius:3px; padding:0 12px; color:#bbb; background:#2b2b2b; font-size:13px; line-height:18px; white-space:nowrap; cursor:pointer; }
.packaging-tabs button[aria-pressed="true"] { border-color:#c9a45c; color:#e7cf9a; background:#3a332e; }
#softPackaging { padding:14px; border:1px solid #444; border-radius:8px; }
#softPackaging h2 { margin-bottom:14px; }
.soft-type-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:8px; margin-bottom:16px; }
.soft-type-card { display:flex; align-items:center; gap:8px; min-width:0; padding:10px 6px; text-align:left; color:#aebbc4; border:0; border-bottom:2px solid #39444d; background:transparent; cursor:pointer; }
.soft-type-card svg { flex:0 0 38px; width:38px; height:44px; fill:none; stroke:currentColor; stroke-width:1.2; stroke-linejoin:round; }
.soft-type-card span { font-size:11px; }
.soft-type-card[aria-pressed="true"] { color:#f1f1f1; border-color:#a5b4bf; background:#30363c; }
.soft-type-card:disabled { opacity:.45; cursor:not-allowed; }
.soft-type-card:focus-visible { outline:1px solid #c9a45c; outline-offset:2px; }
#softPackaging label { display:flex; flex-direction:column; gap:6px; color:#bbb; font-size:12px; }
.soft-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:16px 0; }
#softPackaging input, #softPackaging select { min-width:0; width:100%; padding:9px; border:1px solid #555; border-radius:4px; background:#252525; color:#eee; }
#softPackaging .field-hint { line-height:1.7; }
#softDieline { display:block; width:100%; height:230px; background:#eff2f3; border-radius:5px; margin:14px 0; }
#softRefreshList { margin-top:0; }
@media(max-width:600px) { .soft-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.brand-lockup { display: flex; min-width: 0; align-items: center; gap: 8px; }
.plugin-logo { display: block; flex: 0 0 50px; width: 50px; height: 50px; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(201,164,92,.24)); }
.brand-lockup-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; }
header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 11px; border-bottom: 1px solid #444; }
.eyebrow { margin: 0 0 4px; color: #c9a45c; font-size: 10px; letter-spacing: 1.6px; }
h1 { margin: 0; font-size: 20px; font-weight: 650; }
h2 { margin: 0; font-size: 13px; font-weight: 600; }
.version { color: #aaa; font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.language-control { display: block; margin: 0; }
.language-select { min-width: 84px; height: 27px; padding: 0 24px 0 8px; border: 1px solid #555; border-radius: 4px; color: #ddd; background: #303030; font-size: 11px; }
.language-select:focus { outline: 1px solid #e7cf9a; border-color: #e7cf9a; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
section { margin-top: 14px; }
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 10px; }
.type-card { min-width: 0; padding: 0 2px 4px; overflow: hidden; border: 0; border-radius: 7px; background: transparent; color: #ddd; cursor: pointer; text-align: left; transition: .16s ease; }
.type-card:hover, .type-card.selected { background: transparent; }
.type-card-visual { display: block; position: relative; height: 78px; overflow: hidden; border: 1px solid #4a4a4a; border-radius: 7px; background: #303030; transition: .16s ease; }
.type-card:hover .type-card-visual { border-color: #777; background: #383838; }
.type-card.selected .type-card-visual { border-color: #c9a45c; box-shadow: inset 0 0 0 1px #c9a45c; background: #3a332e; }
.type-card.selected .type-card-visual::after,
.opening-shape-card.selected::after { content: "\2713"; position: absolute; z-index: 3; top: 6px; right: 6px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #c9a45c; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,.38); }
.type-card-copy { display: block; min-width: 0; padding: 7px 3px 0; }
.type-card strong, .type-card small { display: block; min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.type-card strong { font-size: 12px; line-height: 1.2; }
.type-card.selected strong { color: #f6a15e; }
.type-card small { margin-top: 3px; color: #999; font-size: 9px; line-height: 1.2; }
.box-icon { display: block; position: absolute; top: 18px; left: 50%; width: 39px; height: 30px; margin: 0 0 0 -20px; border: 1px solid #aaa; transform: scale(1.5) skewY(-9deg); transform-origin: center top; }
.box-icon::before, .box-icon::after { content: ""; position: absolute; border: 1px solid #888; }
.box-icon::before { width: 22px; height: 8px; left: 5px; top: -9px; transform: skewY(9deg); }
.box-icon::after { width: 14px; height: 8px; left: 9px; bottom: -9px; }
.lock::after { clip-path: polygon(0 0,100% 0,74% 100%,50% 45%,26% 100%); background: #444; }
.mailer { top: 30px; width: 39px; height: 20px; transform: scale(1.5); }
.mailer::before { width: 37px; height: 16px; left: -1px; top: -17px; transform: perspective(35px) rotateX(34deg); transform-origin: bottom; }
.mailer::after { display: none; }
.hang { top: 30px; width: 31px; height: 23px; margin-left: -16px; transform: scale(1.5); }
.hang::before { width: 27px; height: 10px; left: 1px; top: -11px; border-radius: 5px 5px 1px 1px; transform: none; }
.hang::after { width: 9px; height: 3px; left: 10px; top: -7px; bottom: auto; border-radius: 4px; }
.section-title { display: flex; justify-content: space-between; align-items: center; }
.section-title span { color: #999; font-size: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 8px; }
.parameter-preset-bar { position: relative; display: grid; grid-template-columns: minmax(210px, 1fr) auto auto; align-items: end; gap: 7px; margin-top: 8px; padding: 7px 9px; border: 1px solid #414141; border-radius: 7px; background: rgba(255,255,255,.022); }
.parameter-preset-select { display: grid; min-width: 0; gap: 4px; color: #aaa; font-size: 9px; }
.parameter-preset-select select { width: 100%; height: 31px; min-width: 0; padding: 0 28px 0 9px; border: 1px solid #4d4d4d; border-radius: 5px; outline: none; background: #252525; color: #e6e6e6; }
.parameter-preset-select select:focus { border-color: #c9a45c; }
.parameter-preset-bar > .mini-button { height: 31px; }
.parameter-preset-save { position: absolute; z-index: 12; right: 8px; bottom: -44px; left: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; padding: 6px; border: 1px solid #565656; border-radius: 6px; background: #292929; box-shadow: 0 8px 18px rgba(0,0,0,.38); }
.parameter-preset-save[hidden] { display: none; }
.parameter-preset-save input { min-width: 0; height: 30px; margin: 0; }
.number-field { position: relative; display: block; }
.number-field input { padding-right: 34px; }
.input-unit { position: absolute; top: 5px; right: 10px; display: flex; align-items: center; height: 36px; color: #737373; font-size: 9px; pointer-events: none; }
.input-error { display: block; max-height: 0; margin-top: 0; overflow: hidden; color: #ff8989; font-size: 8px; line-height: 1.35; opacity: 0; transition: max-height .16s ease, margin-top .16s ease, opacity .16s ease; }
.form-grid label.has-error .input-error { max-height: 30px; margin-top: 4px; opacity: 1; }
.form-grid label.has-error input { border-color: #d96868; box-shadow: 0 0 0 1px rgba(217,104,104,.22); }
.form-grid label.has-error .input-unit { color: #ff8989; }
.structure-row { display: grid; grid-template-columns: minmax(390px, 1.2fr) minmax(250px, .8fr); gap: 12px; align-items: stretch; margin-top: 12px; }
.form-grid select { width: 100%; height: 36px; margin-top: 5px; padding: 0 30px 0 10px; border: 1px solid #505050; border-radius: 5px; outline: none; background: #252525; color: #eee; }
.material-type-field select { margin-top: 5px; }
.material-type-field .field-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.other-box-card.selected { border-color: var(--ui-accent, #91a9b8); background: #383f46; box-shadow: inset 0 0 0 1px var(--ui-accent, #91a9b8); }
.form-grid select:focus { border-color: #c9a45c; }
.form-grid .field-hint { display: block; margin-top: 5px; line-height: 1.35; color: #888; }
.opening-shape-picker { min-width: 0; margin: 0; padding: 8px 10px 10px; border: 0; border-radius: 8px; background: rgba(255,255,255,.025); box-shadow: inset 0 1px rgba(255,255,255,.035); }
.opening-shape-picker legend { padding: 0 4px; color: #ddd; font-size: 10px; }
.opening-shape-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.opening-shape-card { position: relative; display: grid; grid-template-columns: 116px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 8px; align-items: center; min-width: 0; min-height: 88px; padding: 6px 8px; border: 1px solid #505050; border-radius: 6px; background: #292929; color: #ddd; text-align: left; cursor: pointer; }
.opening-shape-card:hover { border-color: #8b633f; background: #302d2a; }
.opening-shape-card.selected { border-color: #c9a45c; box-shadow: inset 0 0 0 1px #c9a45c; background: #3a332e; }
.opening-shape-card strong { align-self: end; min-width: 0; color: #fff; font-size: 12px; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; }
.opening-shape-card small { align-self: start; min-width: 0; color: #999; font-size: 9px; line-height: 1.18; white-space: normal; overflow-wrap: anywhere; }
.hang-shape-card small { font-size: 8px; }
.opening-shape-card.mailer-shape-card { grid-column: 1 / -1; grid-template-columns: 104px minmax(92px, 1fr); min-height: 114px; cursor: default; }
.opening-shape-card.mailer-shape-card:hover { border-color: #505050; background: #292929; }
.mailer-shape-card .opening-shape-preview { width: 104px; height: 104px; }
.opening-shape-preview { grid-row: 1 / 3; display: block; width: 116px; height: 76px; overflow: hidden; border-radius: 4px; background: #f7f7f7; }
.opening-shape-preview svg { display: block; width: 100%; height: 100%; }
.opening-shape-preview .shape-bleed { fill: none; stroke: #ee4545; stroke-width: .6; stroke-linejoin: round; opacity: .95; }
.opening-shape-preview .shape-cut { fill: none; stroke: #1452c4; stroke-width: .85; stroke-linejoin: round; }
.opening-shape-preview .shape-crease { fill: none; stroke: #ee4545; stroke-width: .6; stroke-dasharray: 3 2; }
.shape-preview-error { display: grid; place-items: center; height: 100%; color: #b34b4b; font-size: 9px; }
.opening-shape-preview[data-preview-stale] { position: relative; }
.opening-shape-preview[data-preview-stale]::after { content: attr(data-preview-stale); position: absolute; left: 0; right: 0; bottom: 0; padding: 2px; background: #fff0df; color: #964719; font-size: 9px; text-align: center; }
.label-profile { min-width: 0; margin: 10px 0 0; padding: 8px 0; border: 0; border-top: 1px solid #3b444b; }
.label-profile legend { color: #b9c9d4; padding-right: 8px; }
.label-profile select { width: 100%; height: 34px; background: #252a2e; color: #eee; border: 1px solid #50575d; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini-link { min-width: 38px; padding: 3px 8px; border: 0; border-radius: 999px; background: #403329; color: #e7cf9a; font-size: 9px; cursor: pointer; }
.mini-link:hover { color: #ffc197; }
.field-hint { display: block; margin-top: 4px; color: #737373; font-size: 8px; }
.structure-controls { display: grid; grid-template-columns: 1fr; gap: 9px; min-width: 0; align-content: start; padding: 9px 10px 10px; border: 0; border-radius: 8px; background: rgba(255,255,255,.025); box-shadow: inset 0 1px rgba(255,255,255,.035); }
.structure-controls-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 2px; color: #ddd; }
.structure-controls-heading strong { font-size: 10px; font-weight: 600; }
.structure-controls-heading small { color: #777; font-size: 8px; }
.flap-control { display: grid; grid-template-columns: minmax(90px, 1fr) 62px; gap: 8px; align-items: center; }
.flap-control input[type="range"] { height: 28px; margin-top: 5px; padding: 0; border: 0; box-shadow: none; accent-color: #c9a45c; }
#dustFlapHeight, #tuckFlapHeight, #glueFlapWidth, #hangerHeight { min-width: 0; }
#dustFlapHeightField.is-disabled, #tuckFlapHeightField.is-disabled, #glueFlapWidthField.is-disabled, #tuckCornerRadiusField.is-disabled, #hangerHeightField.is-disabled { display: none; }
label { color: #aaa; font-size: 10px; }
input { width: 100%; height: 36px; margin-top: 5px; padding: 0 10px; border: 1px solid #4d4d4d; border-radius: 5px; outline: none; background: #252525; color: #fff; }
input:focus { border-color: #c9a45c; box-shadow: 0 0 0 1px #c9a45c; }
.summary { display: flex; justify-content: space-between; margin-top: 7px; padding: 7px 10px; border-radius: 5px; background: #292929; color: #aaa; font-size: 10px; }
.summary strong { color: #eee; }
.legend { display: flex; gap: 14px; padding: 8px 0 4px; border-top: 1px solid #3d3d3d; }
.legend div { display: flex; align-items: center; gap: 5px; color: #aaa; font-size: 10px; }
.line { display: block; width: 19px; height: 0; border-top: 2px solid #ee4545; }
.line.cut { border-color: #1452c4; }
.line.crease { border-top-style: dashed; }
.line.bleed { border-color: #ee4545; }
.status { min-height: 32px; margin-top: 8px; padding: 7px 10px; border-radius: 5px; background: #292929; color: #aaa; font-size: 9px; line-height: 1.5; }
.status::before { content: "•"; display: inline-block; width: 13px; color: #777; font-weight: 700; }
.status.success::before { content: "✓"; color: #8fd7a7; }
.status.error::before { content: "!"; color: #ff9a9a; }
.status.working::before { content: "↻"; color: #f6bd87; }
.status.success { color: #8fd7a7; background: #243329; }
.status.error { color: #ff9a9a; background: #3a2727; }
.status.working { color: #f6bd87; }
.status.is-fading { opacity: .28; transition: opacity .55s ease; }
.primary { width: 100%; height: 42px; margin-top: 12px; border: 0; border-radius: 6px; background: #c9a45c; color: white; font-weight: 650; cursor: pointer; }
.primary:hover { background: #d8b675; }
.primary:disabled { opacity: .55; cursor: wait; }
.action-grid { display: grid; grid-template-columns: .82fr 1fr 1.18fr; gap: 9px; margin-top: 8px; }
.action-grid .primary { margin-top: 0; }
.secondary { height: 42px; border: 1px solid #c9a45c; border-radius: 6px; background: #332b26; color: #e7cf9a; font-weight: 600; cursor: pointer; }
.secondary:hover { background: #44342a; color: #fff; }
.secondary:disabled { opacity: .38; filter: saturate(.45); cursor: not-allowed; }
.dieline-picker { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin-top: 7px; }
.current-dieline-control { display: grid; gap: 5px; min-width: 0; }
.current-dieline-heading { display: flex; align-items: center; gap: 7px; min-width: 0; }
.current-dieline-label { color: #aaa; font-size: 11px; }
.current-dieline-badge { min-width: 0; max-width: min(55%, 280px); padding: 2px 7px; overflow: hidden; border: 1px solid rgba(244,123,32,.38); border-radius: 999px; background: rgba(244,123,32,.12); color: #e7cf9a; font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.dieline-picker select { min-width: 0; height: 34px; padding: 0 9px; border: 1px solid #505050; border-radius: 5px; background: #252525; color: #eee; }
.dieline-empty-state { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 7px 10px; border-radius: 5px; background: #292929; color: #909090; font-size: 10px; line-height: 1.35; }
.empty-state-icon { position: relative; flex: 0 0 17px; width: 17px; height: 15px; border: 1px solid #626262; border-radius: 3px; }
.empty-state-icon::before, .empty-state-icon::after { content: ""; position: absolute; top: 50%; left: 50%; background: #c9a45c; transform: translate(-50%, -50%); }
.empty-state-icon::before { width: 7px; height: 1px; }
.empty-state-icon::after { width: 1px; height: 7px; }
.dieline-picker.is-empty select { display: none; }
.dieline-picker.is-empty #renameCurrent { opacity: .38; pointer-events: none; }
.picker-actions { display: flex; gap: 6px; }
.rename-panel { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; gap: 6px; align-items: end; }
.rename-panel input { height: 34px; margin-top: 0; }
.rename-save { border-color: #c9a45c !important; color: #e7cf9a !important; }
.mini-button { height: 34px; padding: 0 11px; border: 1px solid #5a5a5a; border-radius: 5px; background: #333; color: #ddd; cursor: pointer; }
.mini-button:hover { border-color: #c9a45c; color: #fff; }
.picker-tool-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 72px; padding: 0 10px; white-space: nowrap; }
.picker-tool-label { color: inherit; font-size: 10px; line-height: 1; }
.button-icon { position: relative; display: block; width: 14px; height: 14px; }
.refresh-icon { border: 1.5px solid currentColor; border-left-color: transparent; border-radius: 50%; }
.refresh-icon::after { content: ""; position: absolute; right: -2px; top: -2px; width: 4px; height: 4px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(12deg); }
.rename-icon { border-bottom: 2px solid currentColor; transform: rotate(-42deg); }
.rename-icon::after { content: ""; position: absolute; right: -2px; bottom: -3px; width: 4px; height: 4px; border: 1.5px solid currentColor; border-radius: 1px; }
.picker-hint { display: block; margin-top: 5px; color: #777; font-size: 10px; }
.configuration-lower.is-mailer { display: grid; grid-template-columns: minmax(250px, 300px) minmax(330px, 1fr); grid-template-areas: "shape picker" "summary summary" "hint hint"; gap: 7px 12px; align-items: end; margin-top: 8px; }
.configuration-lower.is-mailer .structure-row { grid-area: shape; display: block; margin-top: 0; }
.configuration-lower.is-mailer .opening-shape-grid { grid-template-columns: 1fr; }
.configuration-lower.is-mailer .mailer-shape-card { min-height: 114px; }
.configuration-lower.is-mailer .summary { grid-area: summary; margin-top: 0; }
.configuration-lower.is-mailer .dieline-picker { grid-area: picker; margin-top: 0; }
.configuration-lower.is-mailer .picker-hint { grid-area: hint; margin-top: -2px; }
.bottom-action-dock { position: sticky; z-index: 30; bottom: 0; margin: auto -6px -4px; padding: 8px 6px 4px; background: linear-gradient(180deg, rgba(35,35,35,0), #232323 16px, #232323 100%); box-shadow: 0 -12px 22px rgba(20,20,20,.16); }
.bottom-action-dock .status { margin-top: 0; }
.footnote { margin: 5px 4px 0; color: #777; font-size: 8px; line-height: 1.35; text-align: center; }
@media (max-width: 720px) {
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .structure-row { grid-template-columns: 1fr; }
  .configuration-lower.is-mailer { grid-template-columns: 1fr; grid-template-areas: "shape" "summary" "picker" "hint"; }
}
@media (max-width: 520px) {
  .picker-tool-button { width: 36px; min-width: 36px; padding: 0; }
  .picker-tool-label { display: none; }
}

[hidden] { display: none !important; }
.preview-modal { position: fixed; z-index: 9999; top: 0; right: 0; bottom: 0; left: 0; display: flex; padding: 10px; overflow: hidden; background: rgba(12, 13, 16, .93); }
.preview-window { display: flex; flex: 1 1 auto; flex-direction: column; width: 100%; height: 100%; min-width: 0; min-height: 0; border: 1px solid #4b4b4b; border-radius: 10px; background: #242629; box-shadow: 0 18px 60px rgba(0,0,0,.48); overflow: hidden; }
.preview-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 14px 15px 12px; border-bottom: 1px solid #454545; background: #2c2e31; cursor: zoom-in; -webkit-user-select: none; user-select: none; }
.preview-modal.preview-fit-all { padding: 0; }
.preview-modal.preview-fit-all .preview-window { height: 100%; border-radius: 0; }
.preview-modal.preview-fit-all .preview-header { cursor: zoom-out; }
.preview-header h2 { font-size: 16px; }
.icon-button { width: 31px; height: 31px; border: 1px solid #555; border-radius: 50%; background: #36383c; color: #ddd; font-size: 21px; line-height: 25px; cursor: pointer; }
.icon-button:hover { border-color: #c9a45c; color: #fff; }
.preview-workspace { --preview-sidebar-width: 272px; display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) 7px var(--preview-sidebar-width); grid-template-rows: minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; }
.preview-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: #202225; }
.preview-sidebar-resize { position: relative; z-index: 9; min-width: 7px; background: #242629; cursor: col-resize; outline: none; touch-action: none; -webkit-user-select: none; user-select: none; }
.preview-sidebar-resize::before { position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: #45474b; content: ""; transition: background .12s, box-shadow .12s; }
.preview-sidebar-resize:hover::before, .preview-sidebar-resize:focus::before, .preview-sidebar-resize.active::before { background: #c9a45c; box-shadow: 0 0 0 1px rgba(244,123,32,.18); }
.preview-sidebar-resizing, .preview-sidebar-resizing * { cursor: col-resize !important; -webkit-user-select: none; user-select: none; }
.preview-sidebar { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #292b2e; overflow-x: hidden; overflow-y: auto; }
.preview-sidebar-content { display: flex; flex: 0 0 auto; flex-direction: column; min-width: 0; }
.preview-toolbar { display: flex; flex: 0 0 auto; flex-direction: column; align-items: stretch; gap: 9px; padding: 13px 12px; border-bottom: 1px solid #3d3f42; background: #292b2e; }
.preview-toolbar > * { width: 100%; margin: 0; }
.preview-primary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preview-appearance-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preview-tonebar { display: grid; flex: 0 0 auto; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid #3d3f42; background: #27292c; }
.tone-control { display: grid; grid-template-columns: 50px minmax(70px, 1fr) 44px; align-items: center; gap: 6px; color: #b6bac1; font-size: 9px; }
.tone-number-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-width: 44px; height: 24px; padding: 0 4px 0 2px; border: 1px solid #4d5158; border-radius: 4px; background: #222428; color: #e7cf9a; font-variant-numeric: tabular-nums; }
.tone-number { width: 100%; min-width: 0; height: 20px; padding: 0 1px; border: 0; outline: 0; background: transparent; color: #e7cf9a; font: inherit; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.tone-number::-webkit-inner-spin-button, .tone-number::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; appearance: none; }
.tone-number:focus { color: #fff; }
.tone-number-wrap:focus-within { border-color: #c9a45c; box-shadow: 0 0 0 1px rgba(244,123,32,.16); }
.tone-number-wrap.disabled, .tone-control input:disabled { opacity: .42; }
.tone-control input[type="range"] { width: 100%; height: 16px; margin: 0; background: transparent; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.tone-control input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: #59616d; }
.tone-control input[type="range"]::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -5px; border: 2px solid #fff; border-radius: 50%; background: #c9a45c; box-shadow: 0 1px 4px rgba(0,0,0,.4); -webkit-appearance: none; appearance: none; }
.preview-sidebar.is-compact .tone-control { grid-template-columns: minmax(0, 1fr) auto; gap: 3px 7px; }
.preview-sidebar.is-compact .tone-control input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
.preview-sidebar.is-compact .tone-number-wrap { grid-column: 2; grid-row: 1; min-width: 44px; }
.preview-sidebar-content > .tone-reset { flex: 0 0 auto; width: calc(100% - 24px); margin: 12px; white-space: nowrap; }
.hdr-environment-heading { display: flex; grid-column: 1; align-items: center; justify-content: flex-start; min-height: 18px; padding-bottom: 3px; border-bottom: 1px solid #3b3d40; }
.hdr-toggle, .hdr-rotation { grid-column: 1; }
.hdr-toggle { display: inline-flex; align-items: center; gap: 5px; color: #d8dadd; }
.hdr-toggle strong { color: #f0f1f2; font-size: 10px; font-weight: 600; }
.preview-select-control, .preview-dieline-control { display: grid; grid-template-columns: 1fr; align-items: center; gap: 5px; color: #b6bac1; font-size: 9px; }
.preview-select-control .toolbar-select, .preview-dieline-control .toolbar-select { width: 100%; min-width: 0; }
.preview-refresh-button { border-color: #d96e20; color: #e7cf9a; font-weight: 600; }
.preview-export-button { border-color: #52705c; color: #9fe0b1; font-weight: 600; }
.preview-export-button:hover { border-color: #65a678; background: #263b2c; color: #c3f4cf; }
.preview-export-button:disabled { opacity: .45; cursor: wait; }
.fold-slider-row { display: grid; flex: 0 0 42px; grid-template-columns: auto minmax(120px, 1fr) minmax(132px, 155px) auto; align-items: center; gap: 8px; height: 42px; min-height: 42px; max-height: 42px; margin: 0 10px 7px; padding: 8px 10px; overflow: hidden; border: 1px solid #3d3f42; border-radius: 6px; background: #25272a; color: #aaa; font-size: 9px; }
.fold-slider-row strong { min-width: 0; overflow: hidden; color: #e7cf9a; font-size: 10px; line-height: 18px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
#preview3dFoldSlider { width: 100%; height: 18px; margin: 0; padding: 0; border: 0; background: transparent; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
#preview3dFoldSlider::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: linear-gradient(90deg, #59616d, #c9a45c); }
#preview3dFoldSlider::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6px; border: 2px solid #fff; border-radius: 50%; background: #c9a45c; box-shadow: 0 1px 5px rgba(0,0,0,.45); -webkit-appearance: none; appearance: none; }
.toolbar-button { height: 30px; padding: 0 10px; border: 1px solid #555; border-radius: 5px; background: #34363a; color: #ddd; font-size: 10px; cursor: pointer; }
.toolbar-button:hover, .toolbar-button.active { border-color: #c9a45c; background: #473326; color: #e7cf9a; }
.toolbar-select { height: 30px; min-width: 92px; padding: 0 26px 0 10px; border: 1px solid #555; border-radius: 5px; outline: none; background: #34363a; color: #ddd; font-size: 10px; cursor: pointer; }
.toolbar-select:focus, .toolbar-select:hover { border-color: #c9a45c; color: #fff; }
.color-control, .check-control { display: flex; align-items: center; gap: 6px; color: #aaa; font-size: 9px; }
.color-control input { width: 30px; height: 25px; margin: 0; padding: 1px; border-radius: 4px; cursor: pointer; }
.check-control input { width: auto; height: auto; margin: 0; }
.preview-stage { position: relative; flex: 1 1 auto; align-self: stretch; width: auto; max-width: calc(100% - 17px); min-width: 0; min-height: 140px; margin: 10px 7px 8px 10px; border: 1px solid #d7d9dc; border-radius: 8px; background: radial-gradient(circle at 48% 35%, #fff 0, #f1f2f4 47%, #dfe2e6 100%); overflow: hidden; }
.preview-disabled-notice { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 3; display: grid; place-items: center; padding: 24px; color: #70757b; font-size: 13px; text-align: center; pointer-events: none; }
.preview-disabled-notice[hidden] { display: none !important; }
.preview-stage[data-background="white"] { background: #fff; }
.preview-stage[data-background="gray"] { background: radial-gradient(circle at 48% 38%, #d8dadd 0, #b8bbc0 58%, #989ca2 100%); }
.preview-stage[data-background="dark"] { border-color: #45494e; background: radial-gradient(circle at 48% 34%, #45494f 0, #2d3035 54%, #1d1f23 100%); }
.preview-stage[data-background="checker"] { background-color: #f1f1f1; background-image: linear-gradient(45deg, #d8d8d8 25%, transparent 25%), linear-gradient(-45deg, #d8d8d8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d8d8d8 75%), linear-gradient(-45deg, transparent 75%, #d8d8d8 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
.preview-resize-handle { display: none !important; }
.preview-resize-handle.resize-n, .preview-resize-handle.resize-s { right: 10px; left: 10px; height: 9px; cursor: ns-resize; }
.preview-resize-handle.resize-n { top: 0; }
.preview-resize-handle.resize-s { bottom: 0; }
.preview-resize-handle.resize-e, .preview-resize-handle.resize-w { top: 10px; bottom: 10px; width: 9px; cursor: ew-resize; }
.preview-resize-handle.resize-e { right: 0; }
.preview-resize-handle.resize-w { left: 0; }
.preview-resize-handle.resize-ne, .preview-resize-handle.resize-nw, .preview-resize-handle.resize-se, .preview-resize-handle.resize-sw { width: 15px; height: 15px; }
.preview-resize-handle.resize-ne { top: 0; right: 0; cursor: nesw-resize; }
.preview-resize-handle.resize-nw { top: 0; left: 0; cursor: nwse-resize; }
.preview-resize-handle.resize-se { right: 0; bottom: 0; cursor: nwse-resize; }
.preview-resize-handle.resize-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.preview-stage-resizing, .preview-stage-resizing * { cursor: inherit !important; -webkit-user-select: none; user-select: none; }
#preview3dCanvas { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; cursor: grab; touch-action: none; }
#preview3dCanvas.dragging { cursor: grabbing; }
#preview3dCanvas.panning { cursor: move; }
#preview3dCanvas.pan-tool-active { cursor: move; }
.preview-exact-flat { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 2; width: 100%; height: 100%; background: #f1f2f4; pointer-events: none; }
.preview-exact-flat[hidden] { display: none !important; }
.preview-exact-flat .exact-paper { fill: #ffffff; stroke: #a6aaae; stroke-width: .35; }
.preview-exact-flat .exact-cut { fill: none; stroke: #8e9399; stroke-width: .42; }
.preview-exact-flat .exact-crease { fill: none; stroke: #c9a3a3; stroke-width: .32; stroke-dasharray: 2 1.4; }
.preview-badge { position: absolute; top: 10px; left: 11px; display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: 6px; background: rgba(255,255,255,.84); color: #333; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.preview-badge strong { font-size: 10px; }
.preview-badge span { color: #777; font-size: 8px; }
.preview-rotate-tool { position: absolute; top: 15px; right: 16px; z-index: 9; display: grid; width: 42px; height: 42px; padding: 4px; place-items: center; border: 1px solid rgba(62,66,72,.72); border-radius: 4px; outline: none; background: rgba(39,41,44,.82); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.preview-rotate-tool svg { width: 31px; height: 31px; overflow: visible; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.preview-pan-tool { right:66px; color:#d4dce2; }
.preview-pan-tool svg { stroke:currentColor; }
.preview-rotate-tool .rotate-cube { fill: rgba(219,227,233,.13); stroke: #d4dce2; stroke-width: 1.35; }
.preview-rotate-tool .rotate-mini-axes { stroke-width: 2.2; }
.preview-rotate-tool .axis-x { stroke: #ef5b5b; }
.preview-rotate-tool .axis-y { stroke: #47c96b; }
.preview-rotate-tool .axis-z { stroke: #4e79f2; }
.preview-rotate-tool .rotate-orbit { stroke: #f3a15f; stroke-width: 1.7; }
.preview-rotate-tool .rotate-orbit-arrow { fill: #f3a15f; stroke: #f3a15f; stroke-width: 1; }
.preview-rotate-tool:hover, .preview-rotate-tool.active { border-color: #c9a45c; background: rgba(62,74,84,.94); }
.preview-rotate-tool:focus-visible { box-shadow: 0 0 0 2px rgba(242,138,55,.36); }
.preview-auto-rotate-controls { position:absolute; bottom:10px; right:10px; z-index:9; display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; max-width:calc(100% - 20px); gap:2px; }
.preview-auto-rotate-controls > .preview-rotate-tool { position:static; flex:0 0 20px; width:20px; height:20px; min-width:0; min-height:0; padding:2px; border-radius:3px; color:#d4dce2; background:rgba(39,41,44,.68); box-shadow:none; }
.preview-auto-rotate-controls > .preview-rotate-tool:hover { background:rgba(62,74,84,.94); }
.preview-auto-rotate svg { width:14px; height:14px; fill:currentColor; stroke:none; }
.preview-auto-rotate-direction svg { width:14px; height:14px; stroke:currentColor; }
.preview-auto-rotate-direction[data-direction="-1"] svg { transform:scaleX(-1); }
.preview-auto-rotate .auto-rotate-pause { display:none; }
.preview-auto-rotate[aria-pressed="true"] .auto-rotate-play { display:none; }
.preview-auto-rotate[aria-pressed="true"] .auto-rotate-pause { display:block; }
.preview-auto-rotate-speeds { display:flex; gap:1px; padding:0; background:rgba(39,41,44,.68); border:1px solid rgba(62,66,72,.72); border-radius:3px; }
.preview-auto-rotate-speeds button { width:18px; height:18px; min-width:0; min-height:0; padding:0; border:1px solid transparent; border-radius:2px; background:transparent; color:#d4dce2; font-size:10px; line-height:16px; cursor:pointer; }
.preview-auto-rotate-speeds button:hover, .preview-auto-rotate-speeds button[aria-pressed="true"] { border-color:#c9a45c; background:rgba(62,74,84,.94); color:#fff; }
.preview-auto-rotate-speeds button:focus-visible { outline:2px solid #c9a45c; outline-offset:1px; }
.preview-rotation-gizmo { position: absolute; z-index: 8; width: 154px; height: 154px; margin: -77px 0 0 -77px; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.26)); }
.preview-rotation-gizmo[hidden] { display: none !important; }
.preview-rotation-gizmo svg { width: 100%; height: 100%; overflow: visible; }
.preview-rotation-gizmo .rotation-axis { pointer-events: none; }
.preview-rotation-gizmo .axis-front, .preview-rotation-gizmo .axis-back { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.preview-rotation-gizmo .axis-back { opacity: .28; stroke-dasharray: 3 3; }
.preview-rotation-gizmo .axis-hit { fill: none; stroke: transparent; stroke-width: 10; pointer-events: stroke; cursor: grab; vector-effect: non-scaling-stroke; }
.preview-rotation-gizmo .axis-hit:active { cursor: grabbing; }
.preview-rotation-gizmo .rotation-axis-x .axis-front, .preview-rotation-gizmo .rotation-axis-x .axis-back { stroke: #ef5350; }
.preview-rotation-gizmo .rotation-axis-y .axis-front, .preview-rotation-gizmo .rotation-axis-y .axis-back { stroke: #2fc85b; }
.preview-rotation-gizmo .rotation-axis-z .axis-front, .preview-rotation-gizmo .rotation-axis-z .axis-back { stroke: #4267e8; }
.preview-rotation-gizmo .rotation-axis:hover .axis-front, .preview-rotation-gizmo .rotation-axis.active .axis-front { stroke-width: 5; }
.preview-rotation-gizmo text { font: 700 12px "Segoe UI", sans-serif; text-anchor: middle; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 3px; stroke-linejoin: round; }
.preview-rotation-gizmo .rotation-axis-x text { fill: #d93535; }
.preview-rotation-gizmo .rotation-axis-y text { fill: #15923a; }
.preview-rotation-gizmo .rotation-axis-z text { fill: #244bd3; }
.preview-rotation-gizmo .rotation-gizmo-center { fill: rgba(255,255,255,.88); stroke: #60656c; stroke-width: 2; pointer-events: none; }
.rotation-gizmo-dragging, .rotation-gizmo-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.preview-hd-button { position: absolute; bottom: 11px; left: 11px; z-index: 7; min-width: 48px; height: 28px; padding: 0 11px; border: 1px solid rgba(62,66,72,.72); border-radius: 5px; outline: none; background: rgba(39,41,44,.86); color: #e1e3e6; font-size: 10px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.preview-hd-button:hover { border-color: #c9a45c; color: #fff; }
.preview-hd-button.active { border-color: #d5efdc; background: #b9e8c7; color: #23402c; }
.preview-hd-button:disabled { opacity: .72; cursor: wait; }
.preview-sidebar-notes { margin-top: auto; padding: 4px 0 10px; }
.preview-help { flex: 0 0 auto; margin: 7px 12px 0; color: #8f949c; font-size: 8px; line-height: 1.45; text-align: left; }
.preview-sync { flex: 0 0 auto; margin: 0 12px; color: #8fcfa7; font-size: 8px; line-height: 1.45; text-align: left; }
.preview-sync.working { color: #f6bd87; }
.preview-sync.error { color: #ff9a9a; }

@media (min-width: 600px) {
  .preview-modal { padding: 18px; }
  .preview-window { width: 100%; max-width: none; height: 100%; margin: auto; }
  .preview-modal.preview-fit-all { padding: 0; }
  .preview-modal.preview-fit-all .preview-window { height: 100%; }
}
@media (max-height: 720px) {
  .preview-header { padding: 8px 12px; }
  .preview-header .eyebrow { display: none; }
  .preview-workspace { --preview-sidebar-width: 248px; }
  .preview-toolbar { gap: 6px; padding: 8px; }
  .preview-tonebar { gap: 5px; padding: 8px; }
  .preview-stage { min-height: 100px; margin: 6px 8px; }
  .fold-slider-row { margin: 0 8px 4px; padding: 5px 8px; }
  .preview-sidebar-content > .tone-reset { width: calc(100% - 16px); margin: 8px; }
  .preview-help { display: none; }
}
@media (max-width: 720px) {
  .preview-workspace { --preview-sidebar-width: 228px; }
  .tone-control { grid-template-columns: 46px minmax(55px, 1fr) 38px; }
  .preview-appearance-controls { grid-template-columns: 1fr; }
}

/* Submission review pass: restrained Adobe-style surface.  The dieline
   preview colors remain meaningful (cut/crease/bleed); product chrome uses a
   single muted steel accent instead of saturated orange and repeated cards. */
:root {
  color-scheme: dark;
  --ui-bg: #222427;
  --ui-surface: #292c30;
  --ui-surface-raised: #30343a;
  --ui-rule: #484e55;
  --ui-rule-soft: #383d43;
  --ui-text: #e4e7ea;
  --ui-muted: #9ba2aa;
  --ui-subtle: #737b84;
  --ui-accent: #c9a45c;
  --ui-accent-strong: #e7cf9a;
  --ui-focus: #c9a45c;
}
:root { background: var(--ui-bg); }
body { background: var(--ui-bg); color: var(--ui-text); }
.app-shell { padding: 16px 18px 10px; }
header { border-bottom-color: var(--ui-rule-soft); }
.eyebrow { color: var(--ui-muted); letter-spacing: 1.2px; }
.version { color: var(--ui-subtle); }
h1 { font-weight: 600; }
.language-select { border-color: var(--ui-rule); border-radius: 2px; background: var(--ui-surface); color: var(--ui-text); }
.language-select:focus { outline: 1px solid var(--ui-focus); border-color: var(--ui-focus); }
section { margin-top: 16px; }
.type-grid { gap: 8px; }
.type-card-visual { border-color: transparent; border-radius: 2px; background: #2b2e32; }
.type-card:hover .type-card-visual { border-color: var(--ui-rule); background: #32363b; }
.type-card.selected .type-card-visual { border-color: var(--ui-accent); box-shadow: none; background: #343a40; }
.type-card.selected .type-card-visual::after,
.opening-shape-card.selected::after { display: none; }
.type-card strong, .type-card.selected strong { color: var(--ui-text); font-weight: 600; }
.type-card small { color: var(--ui-subtle); }
.box-icon { border-color: #a7afb7; }
.box-icon::before, .box-icon::after { border-color: #858e97; }
.lock::after { background: #555d65; }
.parameter-preset-bar { border: 0; border-top: 1px solid var(--ui-rule-soft); border-bottom: 1px solid var(--ui-rule-soft); border-radius: 0; background: transparent; }
.parameter-preset-select select, .form-grid select, .dieline-picker select, .toolbar-select { border-color: var(--ui-rule); border-radius: 2px; background: var(--ui-surface); }
.parameter-preset-select select:focus, .form-grid select:focus, input:focus, .toolbar-select:focus { border-color: var(--ui-focus); box-shadow: 0 0 0 1px rgba(130,151,168,.18); }
.opening-shape-picker, .structure-controls { border: 0; border-radius: 0; background: #272a2e; box-shadow: inset 0 1px var(--ui-rule-soft); }
.opening-shape-card { border: 0; border-radius: 2px; background: #30343a; }
.opening-shape-card:hover { border-color: transparent; background: #373c42; }
.opening-shape-card.selected { border: 0; border-left: 2px solid var(--ui-accent); box-shadow: none; background: #383f46; }
.opening-shape-card.mailer-shape-card:hover { border-color: transparent; background: #30343a; }
.opening-shape-preview { border-radius: 0; }
.mini-link { border-radius: 2px; background: transparent; color: var(--ui-accent-strong); }
.mini-link:hover { color: #d6e0e7; }
label, .section-title span, .current-dieline-label { color: var(--ui-muted); }
input { border: 0; border-bottom: 1px solid var(--ui-rule); border-radius: 0; background: transparent; color: var(--ui-text); }
.input-error { color: #d7a6a6; }
.form-grid label.has-error input { border-color: #b87979; box-shadow: none; }
.summary, .dieline-empty-state, .status { border-radius: 0; background: var(--ui-surface); color: var(--ui-muted); }
.summary strong { color: var(--ui-text); }
.legend { border-top-color: var(--ui-rule-soft); }
.legend div { color: var(--ui-muted); }
.status.success { color: #b5c9bb; background: #29332f; }
.status.error { color: #d7aaaa; background: #382d2f; }
.status.working { color: var(--ui-accent-strong); }
.primary, .secondary, .mini-button, .toolbar-button { border-radius: 2px; }
.primary { background: #536675; color: #f4f6f8; }
.primary:hover { background: #637988; }
.secondary, .mini-button, .toolbar-button { border-color: var(--ui-rule); background: var(--ui-surface); color: var(--ui-text); }
.secondary:hover, .mini-button:hover, .toolbar-button:hover, .toolbar-button.active { border-color: var(--ui-accent); background: var(--ui-surface-raised); color: #f0f3f5; }
.rename-save { border-color: var(--ui-accent) !important; color: var(--ui-accent-strong) !important; }
.current-dieline-badge { border: 0; border-radius: 2px; background: #394149; color: var(--ui-accent-strong); }
.empty-state-icon { border-color: var(--ui-rule); border-radius: 1px; }
.empty-state-icon::before, .empty-state-icon::after { background: var(--ui-accent); }
.bottom-action-dock { background: linear-gradient(180deg, rgba(34,36,39,0), var(--ui-bg) 16px, var(--ui-bg) 100%); box-shadow: 0 -8px 16px rgba(15,16,18,.18); }

/* Preview chrome follows the same neutral system; only paper artwork and
   production line legend retain their source colors. */
.preview-modal { background: rgba(18,20,22,.94); }
.preview-window { border-color: var(--ui-rule); border-radius: 3px; background: var(--ui-surface); box-shadow: 0 16px 40px rgba(0,0,0,.34); }
.preview-header, .preview-sidebar, .preview-toolbar, .preview-tonebar { background: var(--ui-surface); border-color: var(--ui-rule-soft); }
.preview-header { border-radius: 0; }
.icon-button { border-color: var(--ui-rule); border-radius: 2px; background: var(--ui-surface-raised); }
.icon-button:hover { border-color: var(--ui-accent); color: #fff; }
.preview-sidebar-resize::before { background: var(--ui-rule); }
.preview-sidebar-resize:hover::before, .preview-sidebar-resize:focus::before, .preview-sidebar-resize.active::before { background: var(--ui-accent); box-shadow: none; }
.preview-stage { border-color: var(--ui-rule); border-radius: 2px; }
.preview-badge { border-radius: 2px; box-shadow: none; }
.preview-hd-button { border-radius: 2px; box-shadow: none; }
.preview-hd-button:hover { border-color: var(--ui-accent); background: rgba(62,74,84,.94); color: #edf2f5; }
.preview-hd-button.active,
.preview-hd-button.active:hover { border-color: #d5efdc; background: #b9e8c7; color: #23402c; box-shadow: 0 0 0 2px rgba(137,205,155,.34), 0 2px 10px rgba(0,0,0,.32); }
.preview-hd-button.active::after { content: " ✓"; font-weight: 800; }
.fold-slider-row { border: 0; border-top: 1px solid var(--ui-rule-soft); border-radius: 0; background: transparent; }
.fold-slider-row strong, .tone-number-wrap, .tone-number { color: var(--ui-accent-strong); }
.tone-number-wrap { border-color: var(--ui-rule); border-radius: 2px; background: transparent; }
.tone-number-wrap:focus-within { border-color: var(--ui-focus); box-shadow: none; }

/* Product refresh: the box family selector uses an editorial index and a
   compact two-column rail. This gives the four structures a new visual
   language while keeping the existing button and data selectors intact. */
.type-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  border-top: 1px solid var(--ui-rule);
  border-left: 1px solid var(--ui-rule);
  background: var(--ui-rule);
}
.type-card {
  display: grid;
  grid-template-columns: 28px 64px minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: center;
  gap: 11px;
  min-height: 92px;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid var(--ui-rule);
  border-bottom: 1px solid var(--ui-rule);
  border-radius: 0;
  background: var(--ui-bg);
}
.type-card:hover { background: #2b3035; }
.type-card.selected {
  background: #353d44;
  box-shadow: inset 3px 0 var(--ui-accent);
}
.type-card-index {
  align-self: start;
  padding-top: 1px;
  color: var(--ui-subtle);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}
.type-card.selected .type-card-index { color: var(--ui-accent-strong); }
.type-card-visual {
  width: 64px;
  height: 58px;
  border: 0;
  border-left: 1px solid var(--ui-rule);
  border-radius: 0;
  background: transparent;
}
.type-card:hover .type-card-visual,
.type-card.selected .type-card-visual { border-color: var(--ui-accent); background: transparent; }
.type-card-copy { padding: 0; }
.type-card strong,
.type-card small { white-space: normal; }
.type-card strong { font-size: 13px; line-height: 1.25; }
.type-card small { margin-top: 4px; font-size: 10px; line-height: 1.35; }
.type-card-code {
  display: block;
  margin-top: 7px;
  color: var(--ui-subtle);
  font-size: 8px;
  font-style: normal;
  letter-spacing: .1em;
  line-height: 1;
}
.type-card.selected .type-card-code { color: var(--ui-accent); }
.type-card .box-icon { top: 19px; transform: scale(1.18) skewY(-9deg); }
.type-card .mailer { top: 28px; transform: scale(1.18); }
.type-card .hang { top: 28px; transform: scale(1.18); }

/* Give the parameter area a calmer rule-based structure after the selector. */
.configuration-lower { margin-top: 16px; }
.opening-shape-picker,
.structure-controls { background: transparent; box-shadow: inset 0 1px var(--ui-rule-soft); }
.opening-shape-picker { padding: 10px 0 0; }
.structure-controls { padding: 10px 0 0; }
.opening-shape-picker legend { padding: 0 0 5px; color: var(--ui-muted); }
.opening-shape-grid { gap: 1px; background: var(--ui-rule-soft); }
.opening-shape-card { min-height: 84px; padding: 7px; }
.opening-shape-card.selected { box-shadow: inset 3px 0 var(--ui-accent); }
.flap-control input[type="range"] { accent-color: var(--ui-accent); }
.tone-control input[type="range"]::-webkit-slider-thumb { background: var(--ui-accent); }
.tone-control input[type="range"]::-webkit-slider-runnable-track { background: #59616d; }
#preview3dFoldSlider::-webkit-slider-runnable-track { background: linear-gradient(90deg, #59616d, #8fa1af); }
#preview3dFoldSlider::-webkit-slider-thumb { background: var(--ui-accent); }

/* Final de-AI pass: remove invented metadata and card chrome. The selector
   reads like a compact host-tool list, so visual weight comes from spacing,
   typography, and one clear selected rule. */
.type-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 18px;
  border: 0;
  background: transparent;
}
.type-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: 9px;
  min-height: 76px;
  padding: 8px 0 9px;
  border: 0;
  border-bottom: 1px solid var(--ui-rule-soft);
  background: transparent;
  box-shadow: none;
}
.type-card:hover { background: transparent; border-bottom-color: var(--ui-rule); }
.type-card.selected { background: transparent; box-shadow: inset 0 -2px var(--ui-accent); }
.type-card-visual {
  width: 58px;
  height: 58px;
  border: 0;
  border-right: 1px solid var(--ui-rule-soft);
  background: transparent;
}
.type-card:hover .type-card-visual,
.type-card.selected .type-card-visual { border-color: var(--ui-rule); background: transparent; }
.box-icon-image { display: block; width: 56px; height: 56px; object-fit: contain; opacity: .9; filter: brightness(1.12); }
.box-icon-vector { stroke: #858e97; stroke-width: .8; stroke-linecap: round; stroke-linejoin: round; }
.type-card:hover .box-icon-image { opacity: .9; }
.type-card.selected .box-icon-image { opacity: 1; }
.type-card .box-icon { top: 15px; transform: scale(.92) skewY(-9deg); }
.type-card .mailer, .type-card .hang { top: 24px; transform: scale(.92); }
.type-card-copy { align-self: center; padding: 0; }
.type-card strong { font-size: 12px; font-weight: 600; }
.type-card small { margin-top: 4px; color: var(--ui-subtle); font-size: 9px; line-height: 1.3; }
.type-card-index, .type-card-code { display: none; }

.other-box-types { margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--ui-rule-soft); }
.other-box-types-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.other-box-types-heading h3 { margin: 0; color: var(--ui-text); font-size: 11px; font-weight: 600; }
.other-box-types-heading small { color: var(--ui-subtle); font-size: 8px; }
.other-box-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.other-box-card { display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 8px 3px 6px; border: 1px solid var(--ui-rule-soft); border-radius: 3px; background: #272a2e; color: #8f969d; font: inherit; font-size: 9px; cursor: default; opacity: 1; }
.other-box-card:disabled { color: #8f969d; }
.other-box-card span:last-child { overflow: hidden; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; }
.other-box-icon { position: relative; display: block; width: 30px; height: 24px; box-sizing: border-box; border: 1px solid #69717a; border-radius: 1px; opacity: .82; }
.other-box-icon::before, .other-box-icon::after { content: ""; position: absolute; box-sizing: border-box; border: 1px solid #69717a; }
.icon-carton::before { left: 5px; top: -5px; width: 19px; height: 7px; transform: skewX(-28deg); }
.icon-lidBase::before { left: -3px; top: -5px; width: 34px; height: 7px; }
.icon-lidBase::after { left: 3px; bottom: -5px; width: 24px; height: 5px; }
.icon-drawer::before { left: 4px; top: 4px; width: 30px; height: 18px; background: #272a2e; }
.icon-book { border-left-width: 3px; }
.icon-book::before { right: -5px; top: 3px; width: 5px; height: 18px; }
.icon-handle::before { left: 8px; top: -8px; width: 13px; height: 9px; border-bottom: 0; border-radius: 7px 7px 0 0; }
.icon-standPouch { border-radius: 3px 3px 7px 7px; }
.icon-standPouch::before { left: 3px; right: 3px; bottom: 3px; height: 5px; border-width: 1px 0 0; border-radius: 50%; }
.icon-eightSeal::before { left: 3px; right: 3px; top: 3px; bottom: 3px; border-width: 0 1px; }
.icon-eightSeal::after { left: 0; right: 0; top: 5px; height: 1px; border-width: 1px 0 0; }
.icon-threeSeal::before { left: 3px; right: 3px; top: 4px; height: 1px; border-width: 1px 0 0; }
.icon-threeSeal::after { right: 3px; top: 3px; bottom: 3px; width: 1px; border-width: 0 0 0 1px; }
.icon-gusset::before { left: 6px; top: 0; bottom: 0; width: 17px; border-width: 0 1px; transform: skewX(-10deg); }

@media (max-width: 720px) {
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
  .other-box-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .type-card { grid-template-columns: 48px minmax(0, 1fr); gap: 7px; min-height: 68px; padding: 7px 0 8px; }
  .type-card-visual { width: 48px; height: 48px; }
  .box-icon-image { width: 46px; height: 46px; }
  .type-card .box-icon { top: 12px; transform: scale(.78) skewY(-9deg); }
  .type-card .mailer, .type-card .hang { top: 20px; transform: scale(.78); }
  .type-card strong { font-size: 11px; }
  .type-card small { font-size: 8px; }
  .other-box-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .type-card { grid-template-columns: 22px 52px minmax(0, 1fr); gap: 8px; min-height: 82px; padding: 10px 9px; }
  .type-card-visual { width: 52px; height: 52px; }
  .type-card .box-icon { transform: scale(1); }
  .type-card .mailer, .type-card .hang { transform: scale(1); }
  .type-card strong { font-size: 12px; }
  .type-card small { font-size: 9px; }
  .type-card-code { display: none; }
}
.tone-control input[type="range"]::-webkit-slider-thumb { background: var(--ui-accent); box-shadow: none; }
.tone-control input[type="range"]::-webkit-slider-runnable-track { background: #59616a; }
#preview3dFoldSlider::-webkit-slider-runnable-track { background: #59616a; }
#preview3dFoldSlider::-webkit-slider-thumb { background: var(--ui-accent); box-shadow: none; }
.preview-refresh-button { border-color: var(--ui-accent) !important; color: var(--ui-accent-strong); }
.preview-export-button { border-color: #718a7a; color: #b4c8ba; }

/* Structure parameters stay compact at both wide and narrow panel widths.
   Two controls per row keeps the panel usable without making the sliders
   compete with the opening-shape cards. */
.structure-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}
.structure-controls-heading { grid-column: 1 / -1; }
.structure-controls > label { min-width: 0; padding-top: 2px; border-top: 1px solid var(--ui-rule-soft); }
.flap-control { grid-template-columns: minmax(0, 1fr) 50px; gap: 6px; }
.flap-control input[type="range"] { height: 22px; margin-top: 3px; }
.flap-control input[type="text"] { min-width: 0; padding-right: 2px; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 460px) {
  .structure-controls { grid-template-columns: 1fr; }
  .structure-controls-heading { grid-column: auto; }
}

/* Compact parameter rail: shape names sit below their thumbnails, while the
   short structure sliders share one horizontal row. */
.opening-shape-grid { align-items: start; }
.opening-shape-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  justify-items: center;
  gap: 3px;
  min-height: 112px;
  padding: 6px 7px 7px;
  text-align: center;
}
.opening-shape-preview { grid-row: auto; width: 100%; max-width: 116px; height: 68px; }
.opening-shape-card strong,
.opening-shape-card small { align-self: auto; text-align: center; }
.opening-shape-card strong { font-size: 11px; }
.opening-shape-card small { font-size: 8px; }
.opening-shape-card.mailer-shape-card { grid-template-columns: minmax(0, 1fr); min-height: 130px; }
.mailer-shape-card .opening-shape-preview { width: 104px; height: 104px; }

.structure-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 10px;
}
.structure-controls-heading { grid-column: 1 / -1; }
.structure-controls > label { padding-top: 0; border-top: 0; }
.field-label { gap: 3px; white-space: nowrap; font-size: 9px; }
.mini-link { min-width: 26px; padding: 2px 3px; font-size: 8px; }
.flap-control { grid-template-columns: minmax(0, 1fr) 32px; gap: 4px; }
.flap-control input[type="range"] { height: 18px; margin-top: 2px; }
.flap-control input[type="text"] { height: 24px; margin-top: 2px; font-size: 10px; }
.field-hint { margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media (max-width: 460px) {
  .structure-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .structure-controls-heading { grid-column: 1 / -1; }
  .field-label { font-size: 8px; }
  .mini-link { min-width: 22px; padding-right: 1px; padding-left: 1px; }
}
@media (max-width: 340px) {
  .structure-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Final compact split: keep the two section rules level, give the shape
   cards only the width their thumbnail and labels need, and let the freed
   space widen the one-line parameter rail. */
.structure-row {
  grid-template-columns: minmax(280px, .8fr) minmax(390px, 1.2fr);
  gap: 12px;
}
.opening-shape-picker,
.structure-controls { padding-top: 0; }
.opening-shape-picker legend,
.structure-controls-heading { height: 22px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; line-height: 18px; }
.opening-shape-grid {
  grid-template-columns: repeat(2, minmax(132px, 168px));
  justify-content: start;
  gap: 8px;
  background: transparent;
}
.opening-shape-card { width: 100%; box-sizing: border-box; }

@media (max-width: 720px) {
  .structure-row { grid-template-columns: 1fr; }
  .opening-shape-grid { grid-template-columns: repeat(2, minmax(132px, 168px)); }
}
@media (max-width: 340px) {
  .opening-shape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Keep the two section rules on one baseline and give the opening-shape
   cards enough room for their previews.  The parameter rail remains compact;
   only the card column grows. */
.opening-shape-picker legend,
.structure-controls-heading {
  display: flex;
  align-items: center;
  width: 100%;
  height: 22px;
  box-sizing: border-box;
  padding: 0;
  line-height: 18px;
}
.opening-shape-picker legend > span,
.structure-controls-heading strong {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: max-content;
  gap: 10px;
}
.opening-shape-picker legend > span::after,
.structure-controls-heading strong::after {
  display: block;
  flex: 1 1 auto;
  min-width: 18px;
  height: 1px;
  background: var(--ui-rule-soft);
  content: "";
}
.structure-reset-button {
  flex: 0 0 auto;
  min-width: 56px;
  height: 20px;
  margin-left: 10px;
  padding: 0 8px;
  border: 1px solid var(--ui-rule);
  border-radius: 3px;
  background: transparent;
  color: #aeb8c0;
  font-size: 9px;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
}
.structure-reset-button:hover {
  border-color: var(--ui-focus);
  color: #e0e6eb;
  background: rgba(130, 151, 168, .10);
}
.structure-row {
  grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.05fr);
  align-items: start;
}
.structure-controls { box-shadow: none; }
.opening-shape-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.opening-shape-card {
  min-height: 136px;
  padding: 8px 9px 9px;
}
.opening-shape-preview {
  width: 100%;
  max-width: 148px;
  height: 86px;
}
.opening-shape-card strong { font-size: 12px; }
.opening-shape-card small { font-size: 9px; }

@media (max-width: 720px) {
  .structure-row { grid-template-columns: 1fr; }
  .opening-shape-grid { grid-template-columns: repeat(2, minmax(132px, 1fr)); }
}

/* Keep decimal parameter values readable inside the compact three-column rail.
   The previous 32px value track was narrower than values such as 10.667, so
   the browser clipped the leading digits while right-aligning the text. */
.flap-control { grid-template-columns: minmax(0, 1fr) 58px; }
.flap-control input[type="text"] {
  width: 58px;
  min-width: 58px;
  padding: 0 3px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* The corrugated family is already implemented, so keep it with the main
   box-family selector instead of making users open a second category. */
.type-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.box-carton { top: 15px; transform: scale(.92); border-radius: 1px; }
.box-carton::before { width: 29px; height: 8px; left: 4px; top: -9px; transform: skewX(-24deg); }
.box-carton::after { width: 21px; height: 7px; left: 8px; bottom: -8px; }
.box-tray-lid { top: 19px; width: 34px; height: 17px; border-radius: 1px; transform: scale(.92) skewY(-6deg); }
.box-tray-lid::before { width: 32px; height: 10px; left: 6px; top: -13px; transform: none; }
.box-tray-lid::after { width: 30px; height: 5px; left: 1px; bottom: -6px; }

/* Keep future styles available without forcing them into the working area. */
.other-box-types-heading { min-height: 20px; }
.other-box-types-heading { justify-content: flex-start; gap: 6px; }
.other-box-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  width: 20px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ui-accent-strong);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

/* Final visual alignment for the two collapsible rails.  Both headings use
   the same title → rule → arrow rhythm, so the controls no longer drift
   when a box family changes or the panel is narrowed. */
.opening-shape-picker legend::after { display: none; }
.opening-shape-picker legend > span,
.structure-controls-heading strong {
  flex: 0 0 auto;
  min-width: 0;
  gap: 0;
}
.opening-shape-picker legend > span::after,
.structure-controls-heading strong::after {
  display: block;
  flex: 1 1 auto;
  min-width: 22px;
  height: 1px;
  margin-left: 10px;
  background: var(--ui-rule-soft);
  content: "";
}
.opening-shape-picker legend > span,
.structure-controls-heading strong { width: 100%; }
.opening-shape-toggle,
.structure-parameters-toggle {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-left: 6px;
}

/* Neutral controls keep the sliders visually subordinate to the dieline. */
input[type="range"]::-webkit-slider-runnable-track,
.tone-control input[type="range"]::-webkit-slider-runnable-track,
#preview3dFoldSlider::-webkit-slider-runnable-track {
  background: #59616a;
}
input[type="range"]::-webkit-slider-thumb,
.tone-control input[type="range"]::-webkit-slider-thumb,
#preview3dFoldSlider::-webkit-slider-thumb {
  background: #a5afb7;
  border-color: #d1d7dc;
  box-shadow: none;
}
input[type="range"]:focus-visible::-webkit-slider-thumb,
.tone-control input[type="range"]:focus-visible::-webkit-slider-thumb,
#preview3dFoldSlider:focus-visible::-webkit-slider-thumb {
  background: #c1c9cf;
  border-color: #e2e7eb;
}

/* Keep the two lower sections side by side through the compact panel size
   shown in the reference.  Only a truly phone-sized pane falls back to a
   single column. */
@media (max-width: 720px) {
  .structure-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .structure-row { grid-template-columns: 1fr; }
}

/* License gate */
.license-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #56616b;
  border-radius: 6px;
  background: #222a31;
  color: #e4e9ed;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.license-button.is-licensed { border-color: #3f876a; color: #9fe0be; }
.license-modal {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 10, 13, .78);
}
.license-modal[hidden] { display: none; }
.license-dialog {
  width: 430px;
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
  border: 1px solid #45515b;
  border-radius: 12px;
  background: #1f272e;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .45);
}
.license-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid #39444d;
}
.license-dialog-header h2 { margin: 2px 0 0; color: #f3f6f8; font-size: 20px; }
.license-update-note { margin: 8px 0 0; color: #aebbc4; font-size: 11px; line-height: 1.4; }
.license-dialog-body { padding: 20px 22px 22px; color: #b5c0c8; font-size: 13px; line-height: 1.6; }
.license-dialog-body p { margin: 0 0 14px; }
.license-status-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #4b3b30;
  color: #f1bf91;
  font-size: 11px;
}
.license-status-badge.is-licensed { background: #284c3d; color: #9fe0be; }
.license-details { color: #d4dde2; font-size: 12px; }
.license-code-label { display: block; margin-bottom: 5px; color: #e8edf0; font-weight: 600; }
.license-code-input {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #56636d;
  border-radius: 6px;
  outline: none;
  background: #12171b;
  color: #f3f6f8;
  font: 13px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.license-code-input:focus { border-color: var(--ui-accent); box-shadow: 0 0 0 2px rgba(201, 164, 92, .18); }
.license-machine-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 11px;
  border: 1px solid #4b4434;
  border-radius: 6px;
  background: #151a1f;
}
.license-machine-label { flex: 0 0 auto; color: #9ba2aa; font-size: 11px; }
.license-machine-code { flex: 1 1 auto; min-width: 0; color: #e7cf9a; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .4px; word-break: break-all; }
.license-copy-button { flex: 0 0 auto; height: 26px; padding: 0 9px; border: 1px solid #6a5a3c; border-radius: 4px; background: #2a241a; color: #e7cf9a; font-size: 11px; cursor: pointer; }
.license-copy-button:hover { border-color: var(--ui-accent); color: #fff3d4; }
.license-message { min-height: 21px; margin-top: 10px !important; font-size: 12px; }
.license-message.error { color: #ff9c86; }
.license-message.success { color: #9fe0be; }
.license-message.working { color: #d7c18d; }
.license-activate-button { width: 100%; margin-top: 4px; }
.license-footnote { display: block; margin-top: 12px; color: #84919a; font-size: 11px; }
.brand-tagline { margin: 2px 0 0; color: var(--ui-accent); font-size: 9px; letter-spacing: 1.5px; line-height: 1.3; }
.xs-credit { margin: 7px 0 0; color: var(--ui-subtle); font-size: 9px; letter-spacing: .8px; text-align: right; }

/* Shared heading component: both rails deliberately use the same DOM order
   so their rule and collapse arrow cannot diverge across box families. */
.panel-section-heading {
  display: flex !important;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0 !important;
  line-height: 18px;
}
.panel-section-heading > span,
.panel-section-heading > strong {
  display: block;
  flex: 0 0 auto;
  min-width: max-content;
  margin: 0;
}
.panel-section-heading > span::after,
.panel-section-heading > strong::after,
.panel-section-heading::after {
  display: none !important;
}
.panel-section-heading .panel-heading-rule {
  display: block;
  flex: 1 1 auto;
  min-width: 18px;
  height: 1px;
  margin: 0 8px;
  background: var(--ui-rule-soft);
}
.panel-section-heading .opening-shape-toggle,
.panel-section-heading .structure-parameters-toggle {
  order: 0;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
}
.panel-section-heading .structure-reset-button {
  margin-left: 8px;
}
.other-box-toggle:hover { color: var(--ui-text); }
.collapse-chevron {
  display: block;
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease;
}
.other-box-toggle[aria-expanded="true"] .collapse-chevron { transform: rotate(225deg) translateY(-1px); }
.structure-parameters-toggle { flex: 0 0 20px; margin-left: 2px; }
.structure-controls.is-collapsed > label { display: none; }
.opening-shape-picker.is-collapsed .opening-shape-grid { display: none; }
.opening-shape-picker legend > span { flex: 0 0 auto; min-width: 0; gap: 0; }
.opening-shape-picker legend > span::after { display: none; }
.opening-shape-picker legend::after { display: block; flex: 1 1 auto; min-width: 18px; height: 1px; margin-left: 4px; background: var(--ui-rule-soft); content: ""; }
.opening-shape-toggle { order: 2; flex: 0 0 20px; margin-left: 4px; }
.structure-material-field { min-width: 0; }
.structure-material-field select {
  width: 100%;
  height: 24px;
  margin-top: 3px;
  padding: 0 22px 0 6px;
  border: 0;
  border-bottom: 1px solid var(--ui-rule);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ui-text);
  font-size: 9px;
}
.structure-material-field select:focus { border-color: var(--ui-focus); }
.structure-material-field .field-hint { margin-top: 2px; }

/* Corrugated cartons have three production masters; keep their thumbnails on
   one line so the parameter rail does not become unnecessarily tall. */
.configuration-lower.is-corrugated .opening-shape-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.configuration-lower.is-corrugated .opening-shape-card { min-width: 0; }
.configuration-lower.is-double-tuck .opening-shape-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.configuration-lower.is-tray-lid .opening-shape-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.configuration-lower.is-tray-lid .opening-shape-card { min-width: 0; }
.configuration-lower.is-tray-lid:not(.is-shoulder) .structure-controls > label:not(#bleedWidthField) { display: none; }
.configuration-lower.is-tray-lid .structure-reset-button { display: none; }

/* Native CEP select popups use a light menu on Windows. Explicit option
   colors keep every flute choice readable instead of pale gray on white. */
.structure-material-field option { color: #20252a; background: #fff; }

@media (max-width: 720px) {
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .configuration-lower.is-corrugated .opening-shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .configuration-lower.is-tray-lid .opening-shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .configuration-lower.is-corrugated .opening-shape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .configuration-lower.is-tray-lid .opening-shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
}

/* Brand/support rail in the main header. Keep it quiet enough for daily use,
   but make the creator-support action easy to find. */
.header-brand-meta { display: flex; flex: 1 1 auto; align-items: center; justify-content: center; min-width: 0; gap: 14px; margin: 0 18px; color: var(--ui-muted); font-size: 9px; line-height: 1.2; }
.brand-social { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-button { display: inline-grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 0; border: 1px solid var(--ui-rule); border-radius: 3px; background: transparent; color: var(--ui-accent); cursor: pointer; }
.email-button:hover, .email-button:focus-visible { border-color: var(--ui-focus); background: rgba(130,151,168,.12); color: var(--ui-text); outline: none; }
.email-icon, .email-dialog-icon { font-size: 16px; line-height: 1; }
.email-dialog-icon { display: block; margin-bottom: 10px; color: var(--ui-accent); font-size: 28px; }
.email-address { display: block; user-select: text; color: var(--ui-text); font-size: 15px; letter-spacing: .2px; }
.encourage-button { flex: 0 0 auto; height: 28px; padding: 0 11px; border: 1px solid #24b66d; border-radius: 2px; background: #168b52; color: #fff; font-size: 10px; font-weight: 600; cursor: pointer; }
.encourage-button:hover, .encourage-button:focus-visible { border-color: #56d28f; background: #1ca761; color: #fff; outline: none; }
.encourage-modal { position: fixed; z-index: 10001; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(12,14,16,.82); }
.encourage-dialog { width: 420px; max-width: 100%; max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--ui-rule); border-radius: 3px; background: var(--ui-surface); box-shadow: 0 18px 50px rgba(0,0,0,.48); }
.encourage-dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 11px; border-bottom: 1px solid var(--ui-rule-soft); }
.encourage-dialog-header .eyebrow { margin-bottom: 3px; color: var(--ui-muted); }
.encourage-dialog-header .icon-button { flex: 0 0 auto; }
.encourage-dialog-body { padding: 14px 18px 18px; color: var(--ui-muted); font-size: 10px; line-height: 1.5; text-align: center; }
.encourage-dialog-body p { margin: 0 0 10px; }
.encourage-dialog-body img { display: block; width: 320px; max-width: 100%; max-height: calc(100vh - 180px); margin: 0 auto 12px; object-fit: contain; border-radius: 4px; background: #fff; }
.encourage-dialog-body strong { color: var(--ui-text); font-size: 11px; font-weight: 600; }
@media (max-width: 760px) {
  .header-brand-meta { justify-content: flex-end; gap: 8px; margin: 0 10px; }
  .brand-social { display: none; }
}
@media (max-width: 560px) {
  .header-brand-meta { display: none; }
}

/* Narrow CEP panels need a real compact mode. Keep the three-column family
   picker readable, prevent the sticky action dock from covering the shape
   controls, and allow every label to shrink without colliding with icons. */
@media (max-width: 520px) {
  html, body { min-width: 0; }
  .app-shell { min-width: 0; padding: 10px 12px 8px; }
  header { gap: 8px; padding-bottom: 8px; }
  header > div:first-child { min-width: 0; flex: 1 1 auto; }
  .plugin-logo { flex-basis: 40px; width: 40px; height: 40px; }
  .brand-lockup { gap: 6px; }
  h1 { font-size: 18px; white-space: nowrap; }
  .eyebrow { font-size: 9px; letter-spacing: 1px; }
  .header-actions { flex: 0 0 auto; gap: 5px; }
  .version { display: none; }
  .language-select { min-width: 74px; height: 27px; font-size: 10px; }
  section { margin-top: 10px; }

  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; margin-top: 7px; }
  .type-card {
    grid-template-columns: 50px minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 7px;
    min-height: 58px;
    padding: 5px 0;
    overflow: visible;
  }
  .type-card-visual { width: 44px; height: 44px; }
  .box-icon-image { width: 42px; height: 42px; }
  .type-card .box-icon { top: 10px; transform: scale(.72) skewY(-9deg); }
  .type-card .mailer, .type-card .hang { top: 17px; transform: scale(.72); }
  .type-card-copy { align-self: center; min-width: 0; }
  .type-card strong { font-size: 11px; line-height: 1.2; white-space: nowrap; }
  .type-card small {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.2;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .other-box-types { margin-top: 8px; padding-top: 7px; }

  .form-grid { gap: 6px 10px; margin-top: 6px; }
  .form-grid label { font-size: 9px; }
  input { height: 32px; margin-top: 3px; padding-left: 7px; }
  .input-unit { top: 3px; right: 7px; height: 32px; font-size: 8px; }
  .parameter-preset-bar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; margin-top: 7px; padding: 6px 0; }
  .parameter-preset-select { gap: 3px; font-size: 8px; }
  .parameter-preset-select select { height: 30px; padding-left: 7px; font-size: 9px; }
  .parameter-preset-bar > .mini-button { min-width: 0; height: 30px; padding: 0 7px; font-size: 9px; }

  .configuration-lower { margin-top: 9px; }
  .structure-row { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 8px; }
  .opening-shape-picker { padding-top: 0; }
  .opening-shape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .opening-shape-card { min-height: 108px; padding: 6px; }
  .opening-shape-preview { height: 62px; }
  .opening-shape-card strong { font-size: 10px; }
  .opening-shape-card small { font-size: 8px; }
  .structure-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .structure-controls { min-width: 0; overflow: hidden; }
  .structure-controls-heading { grid-column: 1 / -1; }
  .structure-controls > label { min-width: 0; overflow: hidden; }
  .field-label { gap: 2px; min-width: 0; overflow: hidden; font-size: 8px; text-overflow: ellipsis; }
  .flap-control { grid-template-columns: minmax(0, 1fr) 42px; gap: 3px; }
  .flap-control input[type="range"] { width: 100%; min-width: 0; }
  .flap-control input[type="text"] { width: 42px; min-width: 42px; padding: 0 2px; font-size: 9px; }
  .structure-controls-heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .structure-controls-heading strong::after { min-width: 8px; }

  /* A sticky dock is useful on a tall panel, but overlays the shape picker on
     a short narrow panel.  Let it participate in normal flow at this size. */
  .bottom-action-dock { position: relative; bottom: auto; margin-top: 10px; padding: 6px 6px 0; }
  .action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .action-grid button { min-width: 0; height: 38px; padding: 0 4px; font-size: 9px; line-height: 1.15; white-space: normal; }
  .status { min-height: 28px; margin-top: 0; padding: 6px 7px; font-size: 8px; }
  .footnote { margin-top: 4px; font-size: 7px; }
}

/* Final compact refinements: keep the five developed families in one row on
   narrow panels, keep the collapse arrow beside its heading, and quiet the
   structural sliders so they do not compete with the controls themselves. */
.structure-controls-heading { justify-content: flex-start; border-bottom: 1px solid var(--ui-rule-soft); }
.structure-controls-heading strong { flex: 0 0 auto; min-width: 0; gap: 0; }
.structure-controls-heading strong::after { display: none; }
.structure-parameters-toggle { order: 2; flex: 0 0 20px; margin-left: 4px; }
.structure-reset-button { order: 4; margin-left: auto; }
.structure-controls input[type="range"] {
  accent-color: #737d86;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.structure-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 3px;
  background: #4d555d;
}
.structure-controls input[type="range"]::-webkit-slider-thumb {
  background: #8d989f;
  border: 1px solid #b6bec5;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.structure-controls .field-hint,
.summary,
.picker-hint { display: none; }
@media (max-width: 520px) {
  .type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; }
  .type-card { grid-template-columns: 36px minmax(0, 1fr); gap: 5px; min-height: 58px; padding: 5px 0; }
  .type-card-visual { width: 36px; height: 40px; }
  .box-icon-image { width: 36px; height: 36px; }
  .type-card .box-icon { top: 9px; transform: scale(.62) skewY(-9deg); }
  .type-card .mailer, .type-card .hang { top: 15px; transform: scale(.62); }
  .type-card strong { font-size: 10px; }
  .type-card small { font-size: 7px; line-height: 1.15; }
}

/* Final cascade: keep both collapsible section headings identical even after
   the compact-panel rules above. */
.structure-controls-heading.panel-section-heading { border-bottom:0; }
.opening-shape-picker legend.panel-section-heading > span,
.structure-controls-heading.panel-section-heading > strong { flex:0 0 auto; width:auto; min-width:0; }
.opening-shape-picker legend::after { display: none; }
.opening-shape-picker legend > span,
.structure-controls-heading strong {
  display: flex;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  gap: 0;
}
.opening-shape-picker legend > span::after,
.structure-controls-heading strong::after {
  display: block;
  flex: 1 1 auto;
  min-width: 22px;
  height: 1px;
  margin-left: 10px;
  background: var(--ui-rule-soft);
  content: "";
}
.opening-shape-toggle,
.structure-parameters-toggle {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-left: 6px;
}
input[type="range"]::-webkit-slider-runnable-track { background: #59616a; }
input[type="range"]::-webkit-slider-thumb {
  background: #a5afb7;
  border-color: #d1d7dc;
  box-shadow: none;
}
input[type="range"]:focus-visible::-webkit-slider-thumb {
  background: #c1c9cf;
  border-color: #e2e7eb;
}
@media (max-width: 720px) {
  .structure-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .structure-row { grid-template-columns: 1fr; }
}

/* Shared stacked parameter layout: shape, structure, then family-specific fields. */
.configuration-lower,
.configuration-lower.is-mailer {
  display: block;
}
.configuration-lower .structure-row,
.configuration-lower.is-mailer .structure-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}
.configuration-lower .opening-shape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: transparent; }
.configuration-lower.is-double-tuck .opening-shape-grid,
.configuration-lower.is-corrugated .opening-shape-grid,
.configuration-lower.is-tray-lid .opening-shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.configuration-lower.is-mailer .opening-shape-grid { grid-template-columns: minmax(0, 1fr); }
.configuration-lower .opening-shape-card,
.configuration-lower .opening-shape-card.mailer-shape-card {
  grid-template-columns: 116px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-height: 88px;
  padding: 8px;
  gap: 4px 10px;
  text-align: left;
}
.configuration-lower .opening-shape-preview { grid-column: 1; grid-row: 1 / 3; width: 116px; max-width: 100%; height: 76px; margin: 0; }
.configuration-lower .opening-shape-card strong,
.configuration-lower .opening-shape-card small { grid-column: 2; text-align: left; }
.configuration-lower .opening-shape-card strong { align-self: end; }
.configuration-lower .opening-shape-card small { align-self: start; }
.structure-controls {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-content: stretch;
  grid-gap: 10px 18px;
  column-gap: 14px;
  row-gap: 10px;
  overflow: visible;
  padding: 12px 0;
  border-top: 1px solid var(--ui-rule-soft);
  border-bottom: 1px solid var(--ui-rule-soft);
}
.structure-controls-heading {
  grid-column: 1 / -1;
}
.structure-controls > label:not(.structure-material-field) {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: stretch;
  min-width: 0;
  padding: 0;
  overflow: visible;
  border: 0;
}
.structure-controls > label:not(.structure-material-field) > .field-label {
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  overflow: visible;
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 18px;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
}
.structure-controls .mini-link {
  display: none;
}
.structure-controls .flap-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 34px;
  justify-items: stretch;
  gap: 6px;
  grid-gap: 6px;
  width: 100%;
  max-width: 140px;
}
.structure-controls .flap-control input[type="range"] {
  grid-row: 2;
  align-self: center;
  justify-self: center;
  width: 100%;
  min-width: 0;
  height: 20px;
  margin: 0;
  padding: 0;
  transform: none;
}
.structure-controls .flap-control input[type="text"] {
  grid-row: 1;
  width: 100%;
  min-width: 0;
  height: 34px;
  margin: 0;
  padding: 0 25px 0 8px;
  border: 1px solid var(--ui-rule);
  border-radius: 3px;
  background: var(--ui-surface);
  text-align: left;
}
.structure-number-steps { position: absolute; top: 1px; right: 1px; display: grid; grid-template-rows: 1fr 1fr; width: 19px; height: 32px; border-left: 1px solid var(--ui-rule); }
.structure-number-step { min-width: 0; width: 100%; height: 16px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ui-muted); font-size: 8px; line-height: 16px; cursor: pointer; }
.structure-number-step + .structure-number-step { border-top: 1px solid var(--ui-rule); }
.structure-number-step:hover, .structure-number-step:focus { color: var(--ui-accent); background: #3a4147; outline: 1px solid var(--ui-focus); outline-offset: -1px; }
.structure-controls .structure-material-field {
  grid-column: 1 / -1;
}
.structure-controls.is-collapsed > label {
  display: none;
}
.structure-controls.is-hang-box {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-column-gap: 18px;
  column-gap: 14px;
}
.structure-controls.is-hang-box .structure-controls-heading,
.structure-controls.is-hang-box .structure-material-field {
  grid-column: 1 / -1;
}
#hangerHoleField {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  grid-gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 8px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--ui-rule-soft);
}
#hangerHoleField[hidden] { display: none; }
#hangerHoleTitle { grid-column: 1 / -1; margin: 0; font-size: 11px; }
#hangerHoleField > label { position: relative; display: grid; grid-template-rows: 18px 34px; grid-gap: 4px; min-width: 0; }
#hangerHoleField > label > span { font-size: 10px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hangerHoleField input { min-width: 0; width: 100%; height: 34px; margin: 0; padding-right: 25px; }
#hangerHoleField .structure-number-steps { top: 23px; }
#hangerHoleField .field-hint { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .structure-controls, .structure-controls.is-hang-box { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-column-gap: 14px; column-gap: 14px; }
  .configuration-lower .opening-shape-card,
  .configuration-lower .opening-shape-card.mailer-shape-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 76px auto auto;
    gap: 4px;
    text-align: center;
  }
  .configuration-lower .opening-shape-preview { grid-row: 1; justify-self: center; }
  .configuration-lower .opening-shape-card strong,
  .configuration-lower .opening-shape-card small { grid-column: 1; text-align: center; }
}
@media (max-width: 460px) {
  .structure-controls, .structure-controls.is-hang-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .configuration-lower .opening-shape-grid { gap: 6px; }
  .configuration-lower .opening-shape-card { padding: 6px; }
  .configuration-lower .opening-shape-preview { height: 76px; }
}
.configuration-lower.is-drawer .opening-shape-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.configuration-lower.is-drawer .structure-controls > label:not(#dustFlapHeightField):not(#glueFlapWidthField):not(#bleedWidthField) { display:none; }
@media (min-width: 900px) { .type-grid { grid-template-columns:repeat(7,minmax(0,1fr)); } }

.configuration-lower:not(.is-shoulder) .shoulder-field { display:none; }
.configuration-lower.is-shoulder .structure-controls > label:not(.shoulder-field):not(#bleedWidthField) { display:none; }
.configuration-lower.is-shoulder .structure-controls:not(.is-collapsed) > label.shoulder-field { display:flex; }
.configuration-lower.is-shoulder .shoulder-field .flap-control { display:block; }
.configuration-lower.is-shoulder .structure-controls > label.shoulder-field { flex-direction:column; gap:4px; }
.configuration-lower.is-shoulder .opening-shape-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.configuration-lower.is-shoulder .structure-reset-button { display:inline-block; }
.configuration-lower.is-shoulder-card .structure-controls:not(.is-collapsed) > #shoulderPaperField { display:none; }
.configuration-lower.is-flip .structure-controls > label:not(#dustFlapHeightField):not(#tuckFlapHeightField):not(#bleedWidthField) { display:none; }
.configuration-lower.is-flip .structure-controls { grid-template-columns:repeat(3,minmax(0,1fr)); }
.configuration-lower.is-book .structure-controls > label:not(#dustFlapHeightField):not(#tuckFlapHeightField):not(#glueFlapWidthField):not(#tuckCornerRadiusField):not(#hangerHeightField):not(#bleedWidthField) { display:none; }
.configuration-lower.is-book .structure-controls > #hangerHeightField { display:flex; }
.configuration-lower.is-book-plain .structure-controls > #tuckFlapHeightField,
.configuration-lower.is-book-plain .structure-controls > #hangerHeightField { display:none; }
.configuration-lower .opening-shape-picker { min-width: 0; }
.configuration-lower .opening-shape-picker:not(.is-collapsed) .opening-shape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 132px);
  grid-auto-flow: row;
  grid-auto-columns: auto;
  grid-template-rows: none;
  grid-auto-rows: 98px;
  justify-content: start;
  grid-gap: 8px;
  max-width: 100%;
  overflow: visible;
  box-sizing: border-box;
  padding: 2px;
}
.configuration-lower .opening-shape-picker .opening-shape-card {
  display: grid;
  grid-column: auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 64px 18px;
  width: 132px;
  min-height: 98px;
  height: 98px;
  padding: 6px;
  grid-gap: 4px;
  text-align: center;
}
.configuration-lower .opening-shape-picker .opening-shape-preview { grid-row: 1; grid-column: 1; width: 116px; height: 64px; justify-self: center; }
.configuration-lower .opening-shape-picker .opening-shape-card strong { grid-row: 2; grid-column: 1; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; line-height: 18px; }
.configuration-lower .opening-shape-picker .opening-shape-card small { display: none; }
.configuration-lower.is-corrugated .structure-controls { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.configuration-lower.is-corrugated .structure-material-field { grid-column: auto; max-width: 280px; }
.configuration-lower.is-corrugated .structure-material-field > span { display: block; line-height: 18px; }
.configuration-lower.is-corrugated .structure-material-field select { height: 34px; margin-top: 2px; }
#softPackaging .dieline-picker select, #containerPackaging .dieline-picker select { width: 100%; height: 34px; padding: 0 9px; }
#renameDielineStatus { grid-column: 1 / -1; color: var(--ui-muted); overflow-wrap: break-word; }
#renameDielineStatus:empty { display: none; }
#renameDielineStatus.error { color: #ff8989; }
/* The same stacked parameter hierarchy for cartons, film and paper containers. */
#softPackaging.parameter-module, #containerPackaging.parameter-module { padding:0; border:0; border-radius:0; }
.parameter-module .panel-section-heading { margin:14px 0 8px; font-size:11px; }
.parameter-module .module-dimensions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-gap:12px 18px; gap:12px 18px; margin:0 0 8px; }
#softPackaging.parameter-module label, #containerPackaging.parameter-module label { min-width:0; font-size:10px; }
.parameter-module .module-dimensions label > span { min-height:28px; line-height:1.4; }
#softPackaging.parameter-module input, #containerPackaging.parameter-module input { height:34px; padding:0 8px; border-color:var(--ui-rule); border-radius:2px; background:var(--ui-surface); font-size:11px; }
.parameter-module input::-webkit-inner-spin-button { opacity:1; cursor:pointer; }
.parameter-module .parameter-preset-bar { grid-template-columns:minmax(0,1fr) auto auto; padding:7px 0; }
#softPackaging.parameter-module .parameter-preset-select, #containerPackaging.parameter-module .parameter-preset-select { display:grid; }
#softPackaging.parameter-module .parameter-preset-select select, #containerPackaging.parameter-module .parameter-preset-select select { height:31px; padding:0 8px; border-radius:2px; background:var(--ui-surface); font-size:11px; }
.parameter-module fieldset { min-width:0; padding:0; }
.parameter-module .module-structure { border-top:1px solid var(--ui-rule-soft); border-bottom:1px solid var(--ui-rule-soft); padding-bottom:12px; }
.module-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,140px)); grid-gap:12px 18px; gap:12px 18px; margin-top:10px; }
.module-fields[hidden] { display:none; }
#softStructureFields { display:flex; flex-wrap:wrap; }
#softStructureFields > .module-fields { width:298px; max-width:100%; margin-right:18px; }
#softStructureFields > .module-fields:last-child { margin-right:0; }
#softStructureFields > #softSpoutFields, #softStructureFields.has-rounded-corners > .module-fields { width:456px; }
.module-fields label { min-width:0; }
.module-fields label > span { min-height:28px; line-height:1.4; }
#softDieline, #softRoundedDieline, #cupDieline { width:116px; height:64px; margin:0; border-radius:0; background:#eff2f3; }
.parameter-module .module-notes { margin:10px 0; color:var(--ui-muted); font-size:10px; }
.module-notes summary { cursor:pointer; }
.parameter-module .field-hint { white-space:normal; overflow:visible; line-height:1.6; font-size:10px; }
.parameter-module .dieline-picker { margin-top:12px; }
@media(max-width:600px) { .parameter-module .module-dimensions { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.configuration-lower.is-drawer .opening-shape-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.configuration-lower.is-drawer .structure-controls > label:not(#dustFlapHeightField):not(#glueFlapWidthField):not(#bleedWidthField) { display:none; }
@media (min-width: 900px) { .type-grid { grid-template-columns:repeat(7,minmax(0,1fr)); } }

/* Compact shared layout. Column count follows the visible fields, not the family. */
.app-shell { min-width:0; }
.type-grid { grid-template-columns:repeat(auto-fit,minmax(148px,1fr)); gap:8px 12px; }
.type-card { grid-template-columns:48px minmax(0,1fr); gap:8px; min-width:0; min-height:70px; }
.type-card-visual { width:48px; height:48px; }
.type-card .box-icon-image { width:46px; height:46px; filter:none; }
.type-card .box-icon-vector { stroke:#929ea7; stroke-width:.85; }
.type-card-copy { min-width:0; overflow:hidden; }
.type-card strong { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; }
.type-card small { display:block; line-height:1.4; font-size:10px; overflow:hidden; }
#containerPackaging .soft-type-grid { grid-template-columns:repeat(auto-fill,minmax(140px,180px)); }
.soft-type-card { min-height:64px; }
.structure-controls, .structure-controls.is-hang-box,
.configuration-lower.is-flip .structure-controls, .configuration-lower.is-corrugated .structure-controls,
.module-fields, #softStructureFields { display:grid; gap:8px; justify-content:start; padding:8px 0; }
.structure-controls > label:not(.structure-material-field), .module-fields > label { min-width:0; gap:3px; }
.structure-controls > label:not(.structure-material-field) > .field-label,
.module-fields label > span { min-height:18px; line-height:18px; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.structure-controls .structure-material-field { grid-column:auto; }
.structure-controls .flap-control { max-width:140px; grid-template-rows:30px; }
.structure-controls .flap-control input[type="text"] { height:30px; font-size:11px; }
.structure-number-steps { height:28px; width:17px; }
.structure-number-step { height:14px; line-height:14px; }
.structure-controls .flap-control input[type="range"] { display:none; }
#softStructureFields > .module-fields:not([hidden]) { display:contents; width:auto; margin:0; }
#softStructureFields > .module-fields[hidden] { display:none; }
#softPackaging.parameter-module input, #containerPackaging.parameter-module input { height:30px; }
.parameter-module .module-structure { padding-bottom:4px; }
.parameter-module .module-dimensions { gap:8px; }
.parameter-module .module-dimensions label > span { min-height:18px; }
.parameter-module .panel-section-heading { margin:10px 0 6px; }
#hangerHoleField { gap:8px; padding:6px 0; }
.structure-controls.is-collapsed > label { display:none; }
.compact-field-marker { display:none !important; }
.structure-controls > .compact-hole-field { position:relative; grid-template-rows:18px 30px; gap:3px; }
.structure-controls > .compact-hole-field[hidden] { display:none; }
.structure-controls .compact-hole-field > span { font-size:10px; line-height:18px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.structure-controls .compact-hole-field input { width:100%; min-width:0; height:30px; padding-right:25px; }
.structure-controls .compact-hole-field .structure-number-steps { top:22px; height:28px; }
@media(max-width:600px) {
  .type-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .type-card { grid-template-columns:34px minmax(0,1fr); gap:5px; }
  .type-card-visual { width:34px; height:38px; }
  .type-card .box-icon-image { width:33px; height:36px; }
  .type-card strong { font-size:11px; }
  .type-card small { font-size:9px; }
  .app-shell { padding:10px; }
}

.structure-controls > label:not(.structure-material-field) { grid-template-columns:minmax(0,1fr); }
.structure-controls .field-label > span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.structure-controls .flap-control { min-width:0; }

/* Shared compact rows and accessible numeric steppers (including CEP61). */
.shape-parameter-layout { display:block !important; min-width:0; }
.shape-parameter-layout.is-side-by-side { display:grid !important; grid-template-columns:max-content minmax(0,1fr); grid-gap:16px; align-items:start; }
.shape-parameter-layout.is-side-by-side > .opening-shape-picker { width:calc(var(--shape-count) * 140px); }
.shape-parameter-layout > .module-structure { min-width:0; margin-top:12px; }
.shape-parameter-layout.is-side-by-side > .module-structure,
.shape-parameter-layout.is-side-by-side > .structure-controls { margin-top:0; }
.app-shell input[type=number] { -moz-appearance:textfield; }
.app-shell input::-webkit-inner-spin-button,.app-shell input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.app-shell .numeric-control,.app-shell .number-field { display:block; position:relative; width:100%; min-width:0; height:48px; }
.app-shell .numeric-control input,.app-shell .number-field input { height:48px; margin:0; padding-right:39px; }
.app-shell .number-field input { padding-right:68px; }
.app-shell .number-field .input-unit { top:0; right:38px; height:48px; }
.app-shell .form-grid .number-field,.app-shell .form-grid .numeric-control { margin-top:5px; }
.app-shell .structure-controls > label { grid-template-rows:auto 48px; }
.app-shell .structure-controls input,
.app-shell .module-structure input,
.app-shell #hangerHoleField input { height:48px; min-height:48px; margin:0; padding-right:39px; }
.app-shell .flap-control,.app-shell #hangerHoleField > label { position:relative; }
.app-shell .structure-number-steps { position:absolute; top:auto; bottom:1px; right:1px; width:32px; height:46px; min-height:0; display:flex; flex-direction:column; border-left:1px solid var(--ui-rule); }
.app-shell .form-grid .structure-number-steps,.app-shell .module-structure .structure-number-steps { height:46px; }
.app-shell .structure-number-step { flex:1 1 50%; width:100%; min-width:0; height:50%; min-height:0; padding:0; border:0; border-radius:0; background:transparent; color:var(--ui-accent); font-size:10px; line-height:1; cursor:pointer; }
.app-shell .structure-number-step + .structure-number-step { border-top:1px solid var(--ui-rule-soft); }
.app-shell .structure-number-step:hover,.app-shell .structure-number-step:focus { background:var(--ui-surface-raised); outline:1px solid var(--ui-focus); outline-offset:-1px; }
.app-shell #hangerHoleField { display:grid; grid-template-columns:repeat(4,minmax(0,140px)); gap:8px; padding:8px 0; }
.app-shell #hangerHoleField[hidden] { display:none; }
.app-shell #hangerHoleField > h3,.app-shell #hangerHoleField > small { grid-column:1 / -1; }
.app-shell #hangerHoleField > label { min-width:0; display:grid; grid-template-rows:18px 48px; gap:4px; }
.app-shell #hangerHoleField > label > span:first-child { font-size:10px; white-space:nowrap; }
.shape-parameter-layout > #hangerHoleField { grid-column:1 / -1; }
.configuration-lower .shape-parameter-layout.is-side-by-side > .opening-shape-picker { grid-area:auto; grid-column:1; grid-row:1; align-self:start; }
.configuration-lower .shape-parameter-layout.is-side-by-side > .structure-controls { grid-area:auto; grid-column:2; grid-row:1; align-self:start; margin:0; }
#bottlePackaging { min-width:0; }
#bottlePackaging .configuration-lower,#bottlePackaging .opening-shape-picker { min-width:0; max-width:100%; }
#bottlePackaging .opening-shape-preview svg { display:block; width:100%; height:100%; }
#bottlePackaging .dieline-picker { grid-template-columns:minmax(0,1fr) auto; }
#bottlePackaging .current-dieline-control { min-width:0; }
#bottlePackaging select { width:100%; max-width:100%; min-width:0; }
#bottleTypeCards .soft-type-card span { min-width:0; white-space:normal; overflow-wrap:break-word; overflow:hidden; }
.app-shell .soft-type-card { min-width:0; }
.app-shell .soft-type-card > span { min-width:0; white-space:normal; word-wrap:break-word; overflow-wrap:break-word; overflow:hidden; }
.app-shell #cartonPackaging .form-grid,.app-shell .parameter-module .form-grid { grid-column-gap:24px; column-gap:24px; grid-row-gap:14px; row-gap:14px; }
.app-shell .form-grid > label { min-width:0; }
.app-shell .form-grid > label > span[data-i18n] { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.app-shell .module-fields > label,.app-shell #softStructureFields > label { display:flex; flex-direction:column; min-width:0; }
.app-shell .module-fields > label > span:first-child,.app-shell #softStructureFields > label > span:first-child { display:block; width:100%; max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.app-shell .structure-controls .flap-control { display:block; height:48px; padding:0; }
/* One numeric field style across all packaging categories; arrows sit inside its border. */
.app-shell #cartonPackaging input[data-min],
.app-shell #softPackaging input[type=number],
.app-shell #containerPackaging input[type=number],
.app-shell #bottlePackaging input[type=number] {
  display:block; width:100%; min-width:0; height:36px; min-height:36px; margin:0;
  padding:0 39px 0 10px; border:1px solid var(--ui-rule); border-radius:2px;
  background:var(--ui-surface); color:var(--ui-text); font-size:14px; line-height:normal;
  text-align:left; font-variant-numeric:tabular-nums;
}
.app-shell #cartonPackaging .number-field input { padding-right:68px; }
.app-shell input[data-min]:focus,.app-shell input[type=number]:focus { border-color:var(--ui-focus); }
.app-shell .form-grid label.has-error input { border-color:#b87979; }
.shape-perforation { fill:none; stroke:#a052c5; stroke-width:.9; }
.shape-adhesive { fill:none; stroke:#45966c; stroke-width:.7; stroke-dasharray:2 2; }
.line.tear { border-top:2px dashed #a052c5; }
.legend { flex-wrap:wrap; }
.configuration-lower.is-mailer .opening-shape-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }

/* Compact dimensions and structure fields share the same in-frame steppers. */
.app-shell .numeric-control,.app-shell .number-field,
.app-shell .numeric-control input,.app-shell .number-field input,
.app-shell .structure-controls .flap-control { height:36px; min-height:36px; }
.app-shell .number-field .input-unit { height:36px; }
.app-shell .form-grid .structure-number-steps,.app-shell .module-structure .structure-number-steps,
.app-shell .structure-number-steps { top:1px; bottom:1px; height:34px; }
.app-shell .structure-controls > label { grid-template-rows:auto 36px; }
.app-shell #hangerHoleField > label { grid-template-rows:18px 36px; }
.app-shell #hangerHoleField input { height:36px; min-height:36px; }
.app-shell #cartonPackaging .form-grid,.app-shell .parameter-module .form-grid { column-gap:12px; grid-column-gap:12px; row-gap:10px; }
