/* Side-by-side product entry and artwork, always tied to an explicit line. */
#order-workspace #order-editor{overflow:visible}
#order-editor .custom-design-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;border-top:1px solid var(--line)}
#order-editor .custom-design-layout .sheet-items{border-top:0;min-width:0}
#order-editor .custom-design-layout .sheet-section-bar{padding:13px 14px;gap:8px;flex-wrap:wrap}
#order-editor .custom-design-layout .sheet-section-bar .sheet-tip{display:none}
#order-editor .custom-design-layout .line-defaults{padding:0 14px 12px;gap:9px 12px}
#order-editor .custom-design-layout .default-hint{display:none}
#order-editor .custom-design-layout .line-defaults .field{gap:5px}
#order-editor .custom-design-layout .line-defaults input{width:126px}
#order-editor .custom-design-layout .line-defaults select{width:102px}
#order-workspace #order-editor .custom-design-layout .entry-primary-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 12px}
#order-editor .custom-design-layout .entry-craft-field{grid-column:1/-1;grid-row:2}
#order-editor .custom-design-layout .entry-primary-row>.field:nth-child(3){grid-column:2;grid-row:1}
#order-editor .custom-design-layout .entry-craft-options{gap:5px}
#order-editor .custom-design-layout .entry-craft-options label{font-size:10px;padding:6px}
#order-editor .custom-design-layout .entry-secondary-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 12px}
#order-editor .custom-design-layout .entry-secondary-row .field{display:flex;flex-direction:column;align-items:stretch;gap:4px;min-width:0}
#order-editor .custom-design-layout .entry-secondary-row input,#order-editor .custom-design-layout .entry-secondary-row select{width:100%;min-width:0;min-height:32px}
#order-editor .custom-design-layout .entry-secondary-row .field:last-child{grid-column:auto;min-width:0}
#order-editor .custom-design-layout .entry-secondary-row .field:last-child input{width:100%;flex:auto}
#order-editor .custom-design-layout .entry-inherited span{display:none}
#order-editor .custom-design-layout .entry-line-caption{gap:6px;flex-wrap:wrap}
#order-editor .custom-design-layout .entry-line-caption>b{max-width:calc(100% - 40px);overflow-wrap:anywhere}
#order-editor .custom-design-layout .entry-line-caption>span:not(.line-index){width:calc(100% - 32px);margin-left:32px}
#order-editor .custom-design-layout .entry-line-caption .text-btn:first-of-type{margin-left:32px}
#order-editor .custom-design-layout .entry-line-caption .text-btn:last-child{margin-left:auto}
#order-editor .custom-design-layout .entry-flat-line.artwork-active{border-color:#adc3db;box-shadow:0 0 0 1px #cad9e933}
#order-editor .custom-design-layout .entry-flat-line.artwork-active .line-index{background:#dce9f7;color:#4a76a4}
#order-editor .custom-design-layout .entry-flat-lines{padding:0 10px 10px}
#order-editor .custom-design-layout .entry-product-prompt{padding:25px 16px;flex-direction:column;align-items:flex-start;gap:15px}
#order-editor .artwork-panel{position:sticky;top:135px;align-self:start;padding:15px;border-left:1px solid var(--line);min-width:0;max-height:calc(100dvh - 205px);overflow:auto;background:#fff;scrollbar-width:thin;overscroll-behavior:contain}
.artwork-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.artwork-panel-head h3{font-size:13px}.artwork-panel-head h3 small{font-weight:400;color:#96a5b7;margin-left:6px;font-size:10px}
.artwork-panel-head p{font-size:11px;color:#7b91aa;margin-top:4px;overflow-wrap:anywhere}.artwork-panel-head .text-btn{white-space:nowrap;font-size:11px}
.artwork-view-select{display:flex;align-items:center;gap:9px;font-size:10px;color:#91a0b4;margin:12px 0}
.artwork-view-select>span{white-space:nowrap}.artwork-view-select select{flex:1;min-width:0}
.artwork-large-preview{position:relative;display:grid;place-items:center;width:100%;height:clamp(190px,30vh,350px);background:#f5f7fa;border:1px solid #e2e9f1;border-radius:7px;overflow:hidden;padding:10px;cursor:zoom-in}
.artwork-large-preview>img,.artwork-large-preview>svg{width:100%;height:100%;min-height:0;object-fit:contain}
.artwork-large-preview>span{position:absolute;right:9px;bottom:8px;background:#fffdf0e8;color:#8292a5;border-radius:4px;padding:2px 7px;font-size:9px}
.artwork-current-caption{margin:9px 0;font-size:11px}.artwork-current-caption strong{display:block;font-weight:500;overflow-wrap:anywhere}.artwork-current-caption strong small{font-size:10px;color:#96a5b5;font-weight:400}.artwork-current-caption>span{display:block;color:#8c785e;font-size:10px;margin-top:3px;overflow-wrap:anywhere}
.artwork-thumbnails{display:flex;gap:7px;overflow-x:auto;padding:3px 1px 8px}
.artwork-thumbnails button{width:62px;height:48px;position:relative;flex-shrink:0;padding:3px;background:#f7f9fb;border:1px solid #e1e7ef;border-radius:5px;overflow:hidden}
.artwork-thumbnails button[aria-pressed=true]{border-color:#d59261;box-shadow:0 0 0 1px #e6be9f}
.artwork-thumbnails img,.artwork-thumbnails svg{width:100%;height:100%;object-fit:contain}.artwork-thumbnails span{position:absolute;bottom:1px;right:3px;font-size:9px;background:white;color:#8ca0b6}
.artwork-assign-row{display:flex;align-items:end;gap:12px;margin:3px 0 12px}.artwork-assign-row label{flex:1;min-width:0;font-size:10px;color:#899ab1}.artwork-assign-row label>span{display:block;margin-bottom:4px}.artwork-assign-row>.text-btn{font-size:10px;white-space:nowrap;color:#9aa6b6}
#order-editor .artwork-paste{min-height:62px;padding:8px;font-size:11px}.artwork-paste small{line-height:1.6;margin-top:0}
#order-editor .artwork-confirm{font-size:10px;align-items:flex-start;line-height:1.8;margin-top:10px;color:#7c8fa6}
#order-editor .artwork-confirm input{flex-shrink:0;margin-top:3px;width:13px;min-height:0}
.artwork-empty{height:230px;background:#f8fafc;border:1px dashed #d5e0ed;border-radius:7px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:20px;margin-bottom:12px;gap:8px}.artwork-empty>span{font-size:34px;color:#b0c0d4}.artwork-empty strong{font-size:12px;font-weight:400;color:#7c91ab}.artwork-empty p{font-size:10px;color:#95a4b7}
.artwork-locked-note{font-size:10px;color:#99a8b8;margin-top:12px}
#order-editor .design-notes{display:block!important;padding:14px 18px}
#order-editor .design-notes .sheet-notes{display:grid;grid-template-columns:1fr 1fr;gap:18px}
#order-editor .design-notes .sheet-notes .field{grid-column:auto}
#modal.artwork-lightbox{width:min(1120px,calc(100vw - 80px));max-width:none}
#modal.artwork-lightbox .original-image,#modal.artwork-lightbox .artboard{height:65vh;max-height:65vh;overflow:auto;display:flex;align-items:center;justify-content:center}
#modal.artwork-lightbox .original-image img,#modal.artwork-lightbox .artboard svg{width:100%;height:100%;object-fit:contain}
#modal.artwork-lightbox.artwork-zoomed .original-image,#modal.artwork-lightbox.artwork-zoomed .artboard{display:block}
#modal.artwork-lightbox.artwork-zoomed .original-image img,#modal.artwork-lightbox.artwork-zoomed .artboard svg{width:180%;height:auto;max-width:none;max-height:none}



/* Shared requirements span both columns; optional line requirements stay out of the filling path. */
#order-editor .order-defaults-block{padding:13px 16px;border-top:1px solid var(--line);background:#fbfcfe}
.order-defaults-heading{display:flex;align-items:center;gap:10px;margin-bottom:10px;font-size:11px}
.order-defaults-heading>b{color:#445770}.order-defaults-heading>span{color:#92a0b3;font-size:10px}
.order-defaults-heading>small{margin-left:auto;color:#749386;font-size:10px}
#order-workspace #order-editor .order-global-defaults{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;padding:0;margin:0;border:0;min-width:0}
#order-editor .order-global-defaults .field{display:flex;flex-direction:column;align-items:stretch;min-width:0;gap:5px}
#order-editor .order-global-defaults .field>span{font-size:10px;color:#75889f}
#order-editor .field-label{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;min-height:16px}
#order-editor .field-label>span{font-size:10px;color:#75889f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#order-editor .first-piece-check{display:inline-flex;align-items:center;gap:4px;min-width:0;color:#71859a;font-size:10px;line-height:16px;white-space:nowrap;cursor:pointer}
#order-editor .first-piece-check input{width:13px;min-width:13px;height:13px;min-height:13px;margin:0;accent-color:#c9783f}
#order-editor .first-piece-check:has(input:checked){color:#b66c3b}
#order-editor .patch-field .craft-selected{display:flex;gap:4px;align-items:center;overflow:hidden;min-width:0}
#order-editor .patch-field .craft-chip{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#order-editor .order-global-defaults .packaging-field,#order-editor .order-global-defaults .patch-field{min-width:0}
#order-editor .order-global-defaults input,#order-editor .order-global-defaults select{width:100%;min-width:0;height:34px;font-size:11px;padding:5px 7px;background:#fff}
#order-editor .custom-design-layout .entry-primary-row>.field:nth-child(4){grid-column:2;grid-row:3}
#order-editor .custom-design-layout .entry-primary-row>.field:nth-child(3){grid-column:1;grid-row:3}
#order-editor .custom-design-layout .entry-primary-row>.field:first-child{grid-column:1;grid-row:1}
#order-editor .custom-design-layout .entry-craft-field{grid-column:1/-1;grid-row:2}
#order-editor .line-extra{margin:12px 0 0;border-top:1px dashed #e8edf3}
#order-editor .line-extra>summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;padding:10px 14px;color:#7c90a8;border-radius:0 0 6px 6px;transition:background 140ms ease}
#order-editor .line-extra>summary::-webkit-details-marker{display:none}
#order-editor .line-extra>summary:hover{background:#f4f7fb}
#order-editor .line-extra>summary:focus-visible{outline:2px solid #9eb8d4;outline-offset:-2px}
#order-editor .line-extra>summary strong{font-size:10px;font-weight:500;white-space:nowrap}
#order-editor .line-extra>summary span{font-size:10px;color:#9aa8b9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
#order-editor .line-extra>summary i{width:6px;height:6px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(45deg);flex-shrink:0;margin-left:auto;transition:transform 140ms ease}
#order-editor .line-extra[open]>summary i{transform:rotate(225deg)}
#order-editor .line-extra .entry-flat-grid{padding-top:0}
#order-editor .line-extra .entry-secondary-row{margin-top:0;padding-top:0;border-top:0}
#order-editor .line-extra[open]>.entry-flat-grid{animation:line-reveal 150ms ease}
@keyframes line-reveal{from{opacity:.35;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){#order-editor .line-extra[open]>.entry-flat-grid{animation:none}#order-editor .line-extra>summary,#order-editor .line-extra>summary i{transition:none}}

#order-workspace #order-editor .custom-design-layout .entry-primary-row{grid-template-columns:repeat(6,minmax(0,1fr))}
#order-editor .custom-design-layout .entry-primary-row>.field:first-child{grid-column:1/3;grid-row:1}
#order-editor .custom-design-layout .entry-craft-field{grid-column:3/7;grid-row:1}
#order-editor .custom-design-layout .entry-primary-row>.field:nth-child(3){grid-column:1/5;grid-row:2}
#order-editor .custom-design-layout .entry-primary-row>.field:nth-child(4){grid-column:5/7;grid-row:2}

/* The complete product row toggles selection; preview remains synchronized. */
.product-picker-wide .product-choice{cursor:pointer}
.product-picker-wide .product-choice:hover{background:#f3f6fa}
.product-picker-wide .product-choice.is-selected{background:#fff7ef;border-color:#e5bd9a}
.product-picker-wide .product-choice.is-selected .preview-arrow{color:#c68653}
.product-picker-wide .product-choice.is-added{cursor:default}
.product-picker-wide .product-choice:focus-within{outline:2px solid #abc1d9;outline-offset:1px}

/* A single order-level gallery, with no per-product mapping controls. */
#order-editor .artwork-panel{padding:16px}
.artwork-panel-head{margin-bottom:13px}
.artwork-panel-head h3{font-size:13px}
.artwork-panel-head p{margin-top:5px;font-size:10px;color:#9aa8b8}
.artwork-large-preview{height:clamp(220px,34vh,380px);background:#f7f9fb;border-color:#e5ebf1;border-radius:8px}
.artwork-current-caption{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0}
.artwork-current-caption strong{font-size:10px;color:#8696ab;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;font-weight:400}
.artwork-current-caption>small{font-size:10px;color:#9caabb;white-space:nowrap;font-variant-numeric:tabular-nums}
.artwork-thumbnails{gap:9px;padding:2px 1px 7px}
.artwork-thumbnails button{width:72px;height:55px;border-radius:6px;transition:border-color 140ms,background-color 140ms}
.artwork-thumbnails button[aria-pressed=true]{background:#fff8f0;border-color:#d69b6e;box-shadow:0 0 0 1px #ebd1b9}
.artwork-image-actions{display:flex;align-items:center;justify-content:space-between;margin:2px 0 13px;gap:10px}
.artwork-image-actions>span{color:#a2aebd;font-size:9px}
.artwork-image-actions .text-btn{font-size:10px;color:#95a2b3}
#order-editor .artwork-paste{min-height:72px;border-radius:7px;gap:3px}
#order-editor .artwork-confirm{padding-top:11px;margin-top:11px;border-top:1px solid #edf1f5}
.artwork-history-note{font-size:10px;color:#b08b62;margin:0 0 10px}

/* Customer selection uses one full-width native button per row. */
#customer-choices .customer-choice{width:100%;text-align:left;padding:16px 12px;border:1px solid transparent;border-bottom-color:var(--line);border-radius:6px;margin:3px 0;background:transparent;cursor:pointer;transition:background-color 140ms,border-color 140ms}
#customer-choices .customer-choice:hover,#customer-choices .customer-choice:focus-visible{background:#fff7ef;border-color:#e5bd9a}
#customer-choices .customer-choice:focus-visible{outline:2px solid #abc1d9;outline-offset:2px}
#customer-choices .customer-choice.is-current{background:#f2f6fa;border-color:#dce5ef}
.customer-choice .avatar{flex-shrink:0}.customer-choice-info{flex:1;min-width:0}
.customer-choice-info strong{display:block;overflow-wrap:anywhere;color:#34455b}
.customer-choice-info>span{display:block;color:#8b9aae;font-size:10px;margin-top:4px;overflow-wrap:anywhere}
.customer-choice-action{font-size:11px;color:#8b9aae;white-space:nowrap;flex-shrink:0}
.customer-choice:hover .customer-choice-action{color:#c68653}

/* Primary production requirements are shared above the product / artwork columns. */
#order-editor .order-production-defaults{display:grid;grid-template-columns:minmax(270px,2.5fr) minmax(135px,1.4fr) minmax(85px,.8fr);gap:12px;border:0;border-top:1px dashed #e3eaf2;margin:13px 0 0;padding:13px 0 0;min-width:0}
#order-editor .order-production-defaults .field{min-width:0;display:flex;flex-direction:column;gap:5px}
#order-editor .order-production-defaults .field>span{font-size:10px;color:#75889f}
#order-editor .order-production-defaults input:not([type=checkbox]){width:100%;min-width:0;height:34px;font-size:11px}
#order-editor .order-production-defaults .entry-craft-options{display:flex;flex-wrap:wrap;gap:5px;min-height:34px;align-items:center}
#order-editor .order-production-defaults .entry-craft-options label{padding:6px;font-size:10px}
#order-editor .global-production-help{margin-top:9px;font-size:10px;color:#96a4b6;line-height:1.8}
#order-editor .order-production-defaults{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
#order-editor .shipping-confirm-inline{display:inline-flex;align-items:center;align-self:end;gap:6px;min-height:34px;margin:0 0 1px 2px;color:#596b7e;font-size:11px;line-height:1.4;white-space:nowrap}
#order-editor .shipping-confirm-inline input{width:14px;min-width:14px;height:14px;min-height:14px;margin:0;accent-color:#c9783f}
#order-editor .shipping-help-dot{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:1px solid #b9c3ce;border-radius:50%;color:#8a98a7;font-size:10px;line-height:1;cursor:help}
@media(max-width:760px){#order-editor .order-production-defaults{grid-template-columns:minmax(0,1fr) minmax(125px,1fr)}#order-editor .shipping-confirm-inline{grid-column:2;grid-row:2}}
#global-production-differences{color:#b48b63;margin-left:8px}
#order-editor .line-extra .entry-primary-row{padding:8px 0 12px}
#order-editor .line-extra{margin-top:0}
#order-editor .line-extra>summary{padding-top:13px;padding-bottom:13px}
#order-editor .line-extra>summary span{white-space:normal;line-height:1.8}

#order-editor .line-quantity-row{border:0;margin:0;padding:10px 14px;min-width:0}
#order-editor .line-quantity-row .field{display:flex;align-items:center;gap:12px;font-size:10px;color:#75889f}
#order-editor .line-quantity-row input{width:150px;height:34px;font-size:11px}
#order-editor .line-extra .entry-primary-row{grid-template-columns:minmax(0,1fr) minmax(90px,.55fr)}
#order-editor .line-extra .entry-craft-field{grid-column:1/-1}

#order-editor input:is([name="defaultDue"],[data-line-field][name="due"]){cursor:pointer}
/* WebKit's date picker may ignore showPicker(); let the native trigger cover the input. */
#order-editor input:is([name="defaultDue"],[data-line-field][name="due"]){position:relative;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23758a9f' stroke-width='1.8'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M7 3v4M17 3v4M3 11h18'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}
#order-editor input:is([name="defaultDue"],[data-line-field][name="due"])::-webkit-calendar-picker-indicator{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer}
