@font-face{font-family:FabricThai;src:url('/fabric-thai.ttf') format('truetype');font-weight:100 900;font-display:swap}
#view-fabric-orders{--fe-ink:#202b37;--fe-muted:#677383;--fe-line:#e3e7ed;--fe-accent:#4e46ba;--fe-soft:#f0eefb;font-family:FabricThai,system-ui,sans-serif;color:var(--fe-ink);font-size:14px;line-height:1.5}
#view-fabric-orders.active{position:fixed;inset:0;z-index:35;display:flex;flex-direction:column;background:#f6f7fa;height:100dvh;overflow:hidden}
#view-fabric-orders *{box-sizing:border-box}
#view-fabric-orders [hidden]{display:none!important}
#view-fabric-orders button,#view-fabric-orders input,#view-fabric-orders select,#view-fabric-orders textarea{font:inherit;color:inherit;letter-spacing:0}
#view-fabric-orders button,#view-fabric-orders a{touch-action:manipulation}
#view-fabric-orders button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:38px;border:1px solid var(--fe-line);border-radius:9px;background:white;padding:7px 11px;cursor:pointer;white-space:nowrap;font-weight:550}
#view-fabric-orders button:hover{background:#f4f3fa;border-color:#bebad8}
#view-fabric-orders button:focus-visible,#view-fabric-orders input:focus-visible,#view-fabric-orders select:focus-visible,#view-fabric-orders textarea:focus-visible{outline:3px solid #b8b1f2;outline-offset:2px}
#view-fabric-orders button:disabled{opacity:.45;cursor:default}
#view-fabric-orders button.active{color:var(--fe-accent);background:var(--fe-soft);border-color:#c9c2ec}
#view-fabric-orders button.primary{background:var(--fe-accent);color:white;border-color:var(--fe-accent)}
#view-fabric-orders svg.fe-icon{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.fe-header{height:64px;flex:none;display:flex;align-items:center;gap:14px;padding:10px 18px;background:white;border-bottom:1px solid var(--fe-line)}
.fe-back{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--fe-muted);font-size:13px;padding-right:14px;border-right:1px solid var(--fe-line)}
.fe-heading{min-width:0;margin-right:auto}.fe-heading strong{display:block;font-size:16px;font-weight:650}.fe-heading small{display:block;font-size:12px;color:var(--fe-muted);max-width:280px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fe-header-actions{display:flex;gap:7px;align-items:center}.fe-more{position:relative}.fe-more summary{list-style:none;cursor:pointer;padding:8px;border:1px solid var(--fe-line);border-radius:9px}.fe-more summary::-webkit-details-marker{display:none}.fe-more-menu{position:absolute;right:0;top:45px;background:white;padding:8px;border:1px solid var(--fe-line);box-shadow:0 8px 35px #202b3720;border-radius:12px;z-index:10;display:grid;gap:6px;min-width:175px}
.fe-body{display:flex;flex:1;min-height:0;min-width:0}.fe-rail{width:74px;background:white;border-right:1px solid var(--fe-line);display:flex;flex-direction:column;gap:8px;padding:12px 7px;flex:none;z-index:5}#view-fabric-orders .fe-rail button{border:0;padding:9px 3px;min-height:60px;flex-direction:column;gap:4px;font-size:12px;border-radius:10px}
.fe-panel{width:302px;flex:none;background:white;border-right:1px solid var(--fe-line);display:flex;flex-direction:column;min-height:0;z-index:4}.fe-panel-head{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;border-bottom:1px solid var(--fe-line);height:57px;flex:none}.fe-panel-head h2{font-size:16px;margin:0;font-weight:650}#view-fabric-orders .fe-close{border:0;padding:6px;min-height:32px}.fe-panel-content{overflow-y:auto;overflow-x:hidden;padding:16px;overscroll-behavior:contain;min-height:0;flex:1}.fe-fields{display:grid;gap:14px}.fe-fields label,.fe-label{display:grid;gap:6px;font-size:14px;font-weight:550}.fe-fields input,.fe-fields select,.fe-fields textarea,.fe-panel-content>input,.fe-panel-content>select,.fe-row input,.fe-row select,.fe-table-editor input,.fe-archive-tools input,.fe-archive-tools select{width:100%;min-width:0;height:40px;padding:8px 10px;border:1px solid #d7dde6;border-radius:8px;background:white;font-size:14px}.fe-fields textarea{height:88px;resize:vertical}.fe-row{display:flex;gap:8px;align-items:center}.fe-row>*{min-width:0;flex:1}.fe-help{font-size:12px;color:var(--fe-muted);line-height:1.65;margin:7px 0 0}.fe-divider{border:0;border-top:1px solid var(--fe-line);margin:18px 0}.fe-full{width:100%}.fe-qty{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.fe-qty label{display:flex;align-items:center;gap:7px;font-size:14px}.fe-qty span{width:33px;flex:none}.fe-qty input{width:100%;min-width:0;height:38px;border:1px solid var(--fe-line);border-radius:8px;padding:6px 8px}.fe-total{display:flex;justify-content:space-between;padding:12px;margin-top:12px;background:var(--fe-soft);border-radius:9px}.fe-total strong{color:var(--fe-accent);font-size:18px}
.fe-stage{position:relative;flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;background:#e9ecf1;background-image:radial-gradient(#cbd1dc 1px,transparent 1px);background-size:16px 16px}
.fe-tools{display:flex;align-items:center;gap:4px;padding:8px 10px;background:#f9fafcff;border-bottom:1px solid #dce1e8;flex:none;overflow-x:auto;scrollbar-width:thin;min-height:54px}#view-fabric-orders .fe-tools button{min-width:38px;padding:8px;border-color:transparent;background:transparent}#view-fabric-orders .fe-tools button.active{background:white;border-color:#c8c1e9;color:var(--fe-accent)}.fe-tool-sep{width:1px;height:22px;background:#d9dee6;margin:0 5px;flex:none}.fe-tool-label{font-size:12px}.fe-tools input[type=color]{padding:1px;width:30px;height:30px;flex:none;border:1px solid #ced4de;border-radius:7px;background:white}.fe-tools input[type=range]{width:65px;flex:none;accent-color:var(--fe-accent)}
.fe-viewport{flex:1;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;position:relative}.fe-paper-space{display:flex;align-items:center;justify-content:center;min-width:100%;min-height:100%;padding:22px;box-sizing:border-box!important;width:max-content;height:max-content}.fe-paper{flex:none;background:white;box-shadow:0 3px 20px #27334922;display:block;touch-action:none;width:0;height:0;max-width:none!important}.fe-stage-footer{height:43px;display:flex;align-items:center;gap:8px;justify-content:space-between;padding:5px 12px;background:#f9fafc;border-top:1px solid #dce1e8;flex:none}.fe-stage-footer>span{font-size:12px;color:var(--fe-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-zoom{display:flex;align-items:center;gap:4px;flex:none}#view-fabric-orders .fe-zoom button{min-height:30px;padding:3px 7px;background:transparent;border-color:transparent}.fe-zoom output{width:45px;text-align:center;font-size:12px}.fe-notice{position:absolute;bottom:53px;left:50%;transform:translateX(-50%);max-width:calc(100% - 30px);padding:10px 16px;background:#263548;color:white;border-radius:10px;box-shadow:0 3px 20px #0002;z-index:7;font-size:13px}.fe-notice.error{background:#a52d39}.fe-layer{display:flex;align-items:center;gap:6px;padding:7px;border:1px solid var(--fe-line);border-radius:9px;margin-bottom:6px}.fe-layer.selected{border-color:#9890d5;background:var(--fe-soft)}#view-fabric-orders .fe-layer button{border:0;min-height:32px;padding:4px;background:transparent}.fe-layer-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.fe-table-editor{display:grid;gap:6px;margin-top:12px}.fe-table-editor .fe-row input:first-child{max-width:70px}.fe-table-editor .fe-row button{flex:0;min-width:32px;padding:4px}.fe-warning{padding:10px;border-radius:8px;background:#fff4e4;color:#885a1e;font-size:13px}.fe-empty{font-size:14px;color:var(--fe-muted);padding:20px 0;line-height:1.8}.fe-image-drop{border:1.5px dashed #b5aecf;border-radius:12px;background:#f8f7fd;padding:23px 14px;text-align:center}.fe-image-drop strong{display:block;margin-bottom:10px;font-size:15px}.fe-image-drop p{font-size:12px;color:var(--fe-muted);margin:10px 0 0}.fe-archive{flex:1;min-height:0;overflow:auto;padding:22px;}.fe-archive-tools{display:flex;gap:10px;max-width:750px;margin-bottom:20px}.fe-archive-tools input{flex:1}.fe-archive-tools select{width:140px}.fe-archive-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}.fe-card{background:white;border:1px solid var(--fe-line);border-radius:12px;overflow:hidden}.fe-card-preview{height:225px;background:#e7eaf0;display:grid;place-items:center;color:var(--fe-muted);font-size:13px;position:relative;overflow:hidden}.fe-card-preview img{width:100%;height:100%;object-fit:contain}.fe-preview-label{position:absolute;top:8px;left:8px;z-index:1;padding:4px 8px;border-radius:999px;background:#ffffffdf;color:#423578;font-size:11px;font-weight:800;box-shadow:0 1px 4px #14233a22}.fe-card-body{padding:13px}.fe-card-body strong{display:block}.fe-card-body p{color:var(--fe-muted);font-size:12px;margin:5px 0 12px}.fe-export-list{display:grid;gap:6px;margin-top:15px}
@media(max-width:1000px){.fe-panel{width:272px}.fe-header{gap:8px;padding:8px 12px}.fe-back span{display:none}.fe-back{padding-right:8px}.fe-heading strong{font-size:15px}}
@media(max-width:760px){.fe-header{height:58px;padding:8px 10px}.fe-heading small{max-width:145px;font-size:11px}.fe-header-actions{gap:5px}.fe-header-actions .fe-desktop{display:none!important}#view-fabric-orders .fe-header button{padding:7px 9px;min-height:36px}.fe-body{flex-direction:column}.fe-stage{order:0}.fe-rail{order:1;flex-direction:row;width:100%;height:62px;gap:0;border-right:0;border-top:1px solid var(--fe-line);padding:3px 4px;padding-bottom:max(3px,env(safe-area-inset-bottom))}#view-fabric-orders .fe-rail button{flex:1;min-height:52px;padding:4px;font-size:11px;gap:2px}.fe-panel{position:absolute;bottom:62px;left:0;right:0;width:auto;max-height:49dvh;border:1px solid var(--fe-line);border-radius:16px 16px 0 0;box-shadow:0 -6px 25px #283c5420;z-index:6}.fe-panel-head{height:47px;padding:9px 16px}.fe-panel-content{padding:14px 16px}.fe-tools{padding:5px 7px;min-height:48px;gap:2px}.fe-tools .fe-tool-label{display:none}.fe-tools input[type=range]{width:50px}.fe-tools .fe-tool-sep{margin:0 2px}.fe-stage-footer{height:40px;padding:4px 7px}.fe-stage-footer>span{max-width:110px;font-size:11px}.fe-notice{bottom:49px}.fe-archive{padding:12px}.fe-archive-grid{grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:10px}.fe-card-preview{height:190px}.fe-card-body{padding:10px}.fe-archive-tools{gap:6px}.fe-archive-tools select{width:110px}.fe-archive-tools input{width:100px}.fe-paper-space{padding:14px}}
@media(max-width:380px){.fe-heading strong{font-size:14px}.fe-back{padding-right:4px}.fe-header-actions button .fe-icon{display:none}.fe-heading small{max-width:115px}.fe-header{gap:5px}}

#view-fabric-orders .fe-image-context-menu{position:absolute;z-index:90;min-width:220px;max-width:calc(100vw - 16px);padding:6px;border:1px solid #d9d7e8;border-radius:11px;background:#fff;box-shadow:0 12px 34px #1f293733}
#view-fabric-orders .fe-image-context-menu button{width:100%;justify-content:flex-start;min-height:42px;border:0;text-align:left;font-size:14px}
#view-fabric-orders .fe-context-translate-icon{width:27px;height:27px;display:grid;place-items:center;flex:none;border-radius:7px;background:#f0eefb;color:#4e46ba;font-weight:800}
#view-fabric-orders .fe-translation-panel{display:grid;gap:12px}
#view-fabric-orders .fe-translation-help{margin:0;color:var(--fe-muted);font-size:13px;line-height:1.6}
#view-fabric-orders .fe-translation-state{padding:11px 12px;border:1px solid #e5e3f0;border-radius:10px;background:#faf9fe;font-size:14px;line-height:1.55}
#view-fabric-orders .fe-translation-state.is-error{border-color:#efc8cc;background:#fff7f7;color:#a52d39}
#view-fabric-orders .fe-translation-items{display:grid;gap:8px;margin:0;padding:0;list-style:none}
#view-fabric-orders .fe-translation-item{padding:10px 12px;border:1px solid var(--fe-line);border-radius:10px;background:white}
#view-fabric-orders .fe-translation-item strong{display:block;color:#4e46ba;font-size:16px;line-height:1.45}
#view-fabric-orders .fe-translation-item span{display:block;margin-top:4px;font-size:14px;line-height:1.55}
#view-fabric-orders .fe-translation-caption{color:var(--fe-muted);font-size:12px}

#view-fabric-orders #feShapesToggle{display:none}.fe-shapes{position:absolute;top:58px;left:12px;z-index:9;display:flex;gap:4px;padding:8px;background:white;border:1px solid var(--fe-line);box-shadow:0 8px 24px #202b3725;border-radius:12px}#view-fabric-orders .fe-shapes button{display:flex;flex-direction:column;min-width:48px;padding:7px 5px;font-size:11px}
@media(max-width:760px){#view-fabric-orders .fe-tools .fe-shape-tool{display:none}#view-fabric-orders #feShapesToggle{display:inline-flex}.fe-tools #feStroke{display:none}.fe-shapes{top:51px}.fe-tools{justify-content:space-between}#view-fabric-orders .fe-tools button{min-width:32px;padding:6px}.fe-tools .fe-tool-sep{margin:0;width:1px}.fe-tools{gap:1px}}
#view-fabric-orders .fe-danger{color:#a92f3d;border-color:#e7b8be;background:#fff7f7}
#view-fabric-orders .fe-danger:hover{color:#87212e;border-color:#d98e98;background:#fff0f1}
#view-fabric-orders .fe-layer-list{margin-top:14px;border-top:1px solid var(--fe-line);padding-top:11px}
#view-fabric-orders .fe-layer-list summary{cursor:pointer;font-weight:600;padding:4px 0}
#view-fabric-orders .fe-selected-tools>strong{font-size:15px}
@media(max-width:760px){#view-fabric-orders .fe-zoom button[data-action="zoom-selected"]{font-size:0;min-width:30px;padding:3px}.fe-archive-tools input{flex:1;min-width:0}.fe-archive-tools select{flex:none}.fe-archive-tools button{flex:none}}
#view-fabric-orders .fe-card-body .fe-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#view-fabric-orders .fe-card-body .fe-row button{min-width:0;padding:6px;white-space:normal;line-height:1.3}
#view-fabric-orders .fe-card-body .fe-row .fe-danger{grid-column:1/-1}

/* Calm canvas controls with one consistent, labeled icon system. */
#view-fabric-orders .fe-tools{align-self:center;width:max-content;max-width:calc(100% - 28px);margin:10px 14px 0;padding:6px 8px;min-height:64px;gap:3px;border:1px solid #e2e0f0;border-radius:16px;background:rgba(255,255,255,.97);box-shadow:0 8px 24px rgba(41,43,78,.11),0 1px 2px rgba(41,43,78,.06);backdrop-filter:blur(12px);scrollbar-width:none}
#view-fabric-orders .fe-tools::-webkit-scrollbar{display:none}
#view-fabric-orders .fe-tools button[data-tool]{display:flex;flex-direction:column;gap:4px;min-width:56px;min-height:50px;padding:5px 7px;border:1px solid transparent;border-radius:12px;background:transparent;color:#667085;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease}
#view-fabric-orders .fe-tools button[data-tool]::after{content:attr(aria-label);font-size:10px;font-weight:650;line-height:1;white-space:nowrap}
#view-fabric-orders .fe-tools button[data-tool]:hover{background:#f6f5ff;border-color:#e8e5ff;color:#4e46ba}
#view-fabric-orders .fe-tools button[data-tool].active{background:linear-gradient(180deg,#fff 0%,#f1efff 100%);border-color:#d7d1ff;color:#4e46ba;box-shadow:0 2px 7px rgba(78,70,186,.12),inset 0 1px 0 white}
#view-fabric-orders .fe-tools button[data-tool].active .fe-tool-icon{transform:translateY(-1px)}
#view-fabric-orders svg.fe-tool-icon{width:21px;height:21px;stroke-width:1.9}
#view-fabric-orders .fe-tools .fe-tool-sep{height:28px;margin:0 5px;background:#e7e5f0}
#view-fabric-orders .fe-tools input[type=color]{width:30px;height:30px;padding:2px;border:2px solid white;border-radius:50%;background:white;box-shadow:0 0 0 1px #d9dce5,0 2px 5px #252b4017;cursor:pointer}
#view-fabric-orders .fe-tools input[type=range]{accent-color:#5b52c9}
#view-fabric-orders .fe-rail button{transition:background .16s ease,color .16s ease,transform .16s ease}
#view-fabric-orders .fe-rail button.active{background:#f0eeff;color:#4e46ba;box-shadow:inset 0 0 0 1px #dfdbff}
#view-fabric-orders .fe-back{min-height:38px;padding:4px 13px 4px 2px;border:0;border-right:1px solid var(--fe-line);border-radius:0;background:transparent;color:var(--fe-muted);font-size:13px;text-decoration:none}
#view-fabric-orders .fe-back:hover{background:transparent;border-color:var(--fe-line);color:var(--fe-accent)}
@media(max-width:760px){
 #view-fabric-orders .fe-tools{align-self:center;width:calc(100% - 12px);max-width:none;margin:6px 6px 0;padding:4px 5px;min-height:46px;justify-content:space-between;border-radius:13px}
 #view-fabric-orders .fe-tools button[data-tool]{min-width:34px;min-height:36px;padding:4px 3px;gap:1px}
 #view-fabric-orders .fe-tools button[data-tool]::after{display:none}
 #view-fabric-orders .fe-tools svg.fe-tool-icon{width:19px;height:19px}
 #view-fabric-orders .fe-tools .fe-tool-sep{height:20px;margin:0 1px}
 #view-fabric-orders .fe-tools input[type=color]{width:27px;height:27px}
 #view-fabric-orders .fe-back{padding-right:6px}
}

#view-fabric-orders .fe-qty{grid-template-columns:1fr;gap:7px}
#view-fabric-orders .fe-qty-row{display:grid;grid-template-columns:minmax(54px,.55fr) minmax(0,1fr) 34px;gap:6px;align-items:center;min-width:0}
#view-fabric-orders .fe-qty-row input{width:100%;min-width:0;height:36px;border:1px solid var(--fe-line);border-radius:8px;padding:5px 7px}
#view-fabric-orders .fe-qty-row button{min-width:30px;min-height:32px;padding:2px;color:#8991a0;font-size:18px}
#view-fabric-orders .fe-qty-row button:hover{color:#a92f3d;background:#fff4f5;border-color:#f0c7cc}
#view-fabric-orders .fe-add-qty-size{margin-top:8px}
#view-fabric-orders .fe-add-qty-size input{min-width:0;flex:1;height:38px;padding:7px 9px;border:1px solid #d7dde6;border-radius:8px}
#view-fabric-orders .fe-add-qty-size button{flex:none}


#view-fabric-orders .fe-lock-button{margin-top:10px;min-height:42px;font-weight:650}
#view-fabric-orders .fe-lock-button[aria-pressed="true"]{color:#4e46ba;background:#f1efff;border-color:#d7d1ff}
#view-fabric-orders .fe-crop-dialog[hidden]{display:none}
#view-fabric-orders .fe-crop-dialog{position:fixed;inset:0;z-index:80;display:grid;place-items:center;padding:16px;background:#202b37b8}
#view-fabric-orders .fe-crop-card{width:min(760px,100%);max-height:calc(100dvh - 32px);display:flex;flex-direction:column;gap:10px;padding:18px;background:white;border-radius:16px;box-shadow:0 20px 55px #10182055}
#view-fabric-orders .fe-crop-card h2{margin:0;font-size:20px}
#view-fabric-orders .fe-crop-card p{margin:0;color:var(--fe-muted)}
#view-fabric-orders .fe-crop-stage{display:grid;place-items:center;min-height:0;overflow:auto;background:#e9ebf0;border-radius:10px;padding:12px}
#view-fabric-orders .fe-crop-image{position:relative;display:inline-block;line-height:0;touch-action:none;cursor:crosshair;max-width:100%}
#view-fabric-orders .fe-crop-image img{display:block;max-width:100%;max-height:min(66dvh,620px);width:auto;height:auto;user-select:none}
#view-fabric-orders .fe-crop-selection{position:absolute;box-sizing:border-box;border:2px solid #fff;outline:1px solid #4e46ba;box-shadow:0 0 0 9999px #10182778;pointer-events:none}
#view-fabric-orders .fe-crop-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
@media(max-width:760px){#view-fabric-orders .fe-crop-card{padding:12px}#view-fabric-orders .fe-crop-actions button{flex:1}}
#view-fabric-orders .fe-image-slots{display:grid;gap:9px;margin-bottom:16px;padding:12px;border:1px solid #dcd8f5;border-radius:11px;background:#f8f7ff}
#view-fabric-orders .fe-image-slots>strong{font-size:14px}
#view-fabric-orders .fe-image-slots .fe-row button{min-width:0;white-space:normal;line-height:1.25;text-align:center}
#view-fabric-orders .fe-image-slots .fe-help{margin:0}
#view-fabric-orders .fe-image-drop button+button{margin-top:8px}
@media(min-width:761px){
 #view-fabric-orders .fe-rail{width:58px;gap:4px;padding:8px 5px}
 #view-fabric-orders .fe-rail button{min-height:49px;padding:5px 2px;gap:2px;font-size:11px;border-radius:8px}
 #view-fabric-orders .fe-rail .fe-icon{width:17px;height:17px}
 #view-fabric-orders .fe-panel{width:270px}
 #view-fabric-orders .fe-panel-content{padding:13px}
}
@media(min-width:761px) and (max-width:1000px){#view-fabric-orders .fe-panel{width:250px}}
/* Compact left tools while keeping the forms readable and evenly spaced. */
#view-fabric-orders .fe-panel-head{height:49px;padding:9px 12px}
#view-fabric-orders .fe-panel-head h2{font-size:15px}
#view-fabric-orders .fe-panel-content{font-size:13px;line-height:1.45;padding:12px}
#view-fabric-orders .fe-fields{gap:10px}
#view-fabric-orders .fe-fields label,#view-fabric-orders .fe-label{gap:5px;font-size:13px;line-height:1.4}
#view-fabric-orders .fe-fields input,#view-fabric-orders .fe-fields select,#view-fabric-orders .fe-panel-content .fe-row input,#view-fabric-orders .fe-panel-content .fe-row select,#view-fabric-orders .fe-table-editor input{height:35px;padding:6px 8px;font-size:13px}
#view-fabric-orders .fe-panel-content button{min-height:34px;padding:5px 8px;font-size:13px;white-space:normal;line-height:1.3}
#view-fabric-orders .fe-panel-content .fe-row{gap:8px;min-width:0}
#view-fabric-orders .fe-panel-content .fe-row>*{min-width:0}
#view-fabric-orders .fe-help{font-size:11.5px;line-height:1.5;margin-top:5px}
#view-fabric-orders .fe-divider{margin:14px 0}
#view-fabric-orders .fe-qty{gap:7px}
#view-fabric-orders .fe-qty-row{grid-template-columns:minmax(47px,.5fr) minmax(0,1fr) 32px;gap:7px}
#view-fabric-orders .fe-qty-row input{height:34px;font-size:13px}
#view-fabric-orders .fe-qty-row button{min-width:32px;min-height:34px}
#view-fabric-orders .fe-image-drop{padding:16px 12px}
#view-fabric-orders .fe-image-drop strong,#view-fabric-orders .fe-image-slots>strong{font-size:13px}
#view-fabric-orders .fe-image-slots{gap:7px;padding:10px;margin-bottom:12px}
@media(min-width:761px){
 #view-fabric-orders .fe-rail{width:54px;padding:7px 4px}
 #view-fabric-orders .fe-rail button{min-height:46px;font-size:10.5px}
 #view-fabric-orders .fe-panel{width:248px}
}
@media(min-width:761px) and (max-width:1000px){#view-fabric-orders .fe-panel{width:236px}}
.fe-fabric-tip{position:fixed;z-index:10000;max-width:min(330px,calc(100vw - 24px));padding:10px 12px;background:#202b37;color:white;border-radius:9px;box-shadow:0 8px 25px #0004;pointer-events:none;display:grid;gap:3px;font:14px/1.4 system-ui,sans-serif}.fe-fabric-tip[hidden]{display:none}.fe-fabric-tip strong{font-size:17px}.fe-fabric-tip small{color:#c8d4e3;font-size:12px}
#view-fabric-orders .fe-fabric-library{padding:20px;overflow:auto;height:calc(100vh - 80px);background:#f5f7fb}
#view-fabric-orders .fe-library-top{display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap}
#view-fabric-orders .fe-library-top h2{font-size:22px;margin:0 0 4px}
#view-fabric-orders .fe-library-top p{margin:0;color:#5b6575}
#view-fabric-orders .fe-library-top button,#view-fabric-orders .fe-library-card button{padding:8px 12px;border:1px solid #cbd3df;background:#fff;border-radius:8px;cursor:pointer}
#view-fabric-orders .fe-library-top button.primary{background:#282b63;color:white}
#view-fabric-orders .fe-library-drop{margin:18px 0;padding:18px;text-align:center;border:2px dashed #aeb9cc;border-radius:12px;color:#526073;background:#fff}
#view-fabric-orders #feLibrarySearch{width:min(460px,100%);padding:11px 13px;border:1px solid #cbd3df;border-radius:8px;margin-bottom:18px;font:inherit}
#view-fabric-orders .fe-library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:16px}
#view-fabric-orders .fe-library-card{background:#fff;border:1px solid #dae0e9;border-radius:12px;overflow:hidden;min-width:0}
#view-fabric-orders .fe-library-card.is-uploading{border-color:#8e9ce0;box-shadow:0 0 0 2px #5867c51a}
#view-fabric-orders .fe-library-card img{display:block;width:100%;height:230px;object-fit:contain;background:#eef1f5}
#view-fabric-orders .fe-library-upload-state{padding:9px 12px 0;color:#35428e;font-size:14px;font-weight:650}
#view-fabric-orders .fe-library-upload-state small{display:block;margin-top:5px;color:#637084;font-weight:400}
#view-fabric-orders .fe-library-progress{display:block;height:4px;overflow:hidden;background:#e7eaf4;border-radius:99px;margin-top:8px}
#view-fabric-orders .fe-library-progress i{display:block;width:38%;height:100%;border-radius:inherit;background:#5867c5;animation:fe-library-progress 1.1s ease-in-out infinite alternate}
@keyframes fe-library-progress{from{transform:translateX(-8%)}to{transform:translateX(175%)}}
#view-fabric-orders .fe-library-card-body{padding:12px}
#view-fabric-orders .fe-library-card-body strong{display:block;overflow-wrap:anywhere}
#view-fabric-orders .fe-library-title{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
#view-fabric-orders .fe-library-card .fe-favorite{padding:0 5px;border:0;background:transparent;color:#7a8494;font-size:25px;line-height:1;flex:none}
#view-fabric-orders .fe-library-card .fe-favorite.is-active{color:#dc9b18}
#view-fabric-orders .fe-library-card-body p{margin:5px 0;color:#5b6575}
#view-fabric-orders .fe-library-card .fe-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
@media(max-width:760px){#view-fabric-orders .fe-fabric-library{padding:12px}.fe-library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Color and line-width pickers for canvas annotations. */
#view-fabric-orders .fe-tools .fe-color-trigger{display:inline-flex;align-items:center;gap:5px;min-width:47px;min-height:42px;padding:5px 7px;border:1px solid #e6e7ee;border-radius:11px;background:#fff;box-shadow:0 2px 5px #202b3710}
#view-fabric-orders .fe-color-dot{display:block;width:23px;height:23px;flex:none;border-radius:50%;background:var(--fe-color,#dc394d);box-shadow:inset 0 0 0 1px #17202b20,0 1px 3px #17202b20}
#view-fabric-orders .fe-color-caret{font-size:12px;line-height:1;color:#778195}
#view-fabric-orders .fe-tools .fe-stroke-trigger{display:inline-flex;align-items:center;gap:5px;min-width:51px;min-height:42px;padding:5px 6px;border:1px solid #e6e7ee;border-radius:11px;background:#fff;color:#4b5563;box-shadow:0 2px 5px #202b3710}
#view-fabric-orders .fe-stroke-trigger svg{width:22px;height:22px;overflow:visible;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
#view-fabric-orders .fe-stroke-trigger span{font-size:12px;font-weight:700;font-variant-numeric:tabular-nums}
#view-fabric-orders .fe-tools .fe-color-trigger:hover,#view-fabric-orders .fe-tools .fe-stroke-trigger:hover{border-color:#c9c5e9;background:#fbfaff}
#view-fabric-orders .fe-color-picker,#view-fabric-orders .fe-stroke-picker{position:fixed;z-index:120;width:min(310px,calc(100vw - 24px));padding:14px;border:1px solid #e2e5ec;border-radius:17px;background:#fff;box-shadow:0 18px 55px #17243b30,0 3px 10px #17243b12;color:#202b37;overflow:auto;overscroll-behavior:contain;animation:fePickerIn .14s ease-out}
@keyframes fePickerIn{from{opacity:0;transform:translateY(4px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
#view-fabric-orders .fe-picker-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}
#view-fabric-orders .fe-picker-heading strong{display:block;font-size:14px;font-weight:750}
#view-fabric-orders .fe-picker-heading small{display:block;margin-top:1px;color:#7a8494;font-size:11px}
#view-fabric-orders .fe-picker-heading button{min-width:30px;min-height:30px;padding:2px;border:0;border-radius:8px;background:#f3f4f7;color:#687385;font-size:20px;line-height:1}
#view-fabric-orders .fe-picker-section{display:grid;gap:8px;margin-top:12px}
#view-fabric-orders .fe-picker-section>strong{font-size:11px;font-weight:700;color:#667085}
#view-fabric-orders .fe-color-swatches{display:grid;grid-template-columns:repeat(5,1fr);gap:9px 8px}
#view-fabric-orders .fe-color-swatches button{justify-self:center;width:31px;min-width:31px;height:31px;min-height:31px;padding:0;border:2px solid #fff;border-radius:50%;background:var(--swatch);box-shadow:0 0 0 1px #dce0e7,0 2px 4px #17243b18;transition:transform .12s ease,box-shadow .12s ease}
#view-fabric-orders .fe-color-swatches button:hover{transform:scale(1.1);background:var(--swatch);border-color:#fff;box-shadow:0 0 0 2px #aaa4d8,0 3px 7px #17243b22}
#view-fabric-orders .fe-color-swatches button.selected{box-shadow:0 0 0 2px #5c52c8,0 0 0 4px #e9e6ff}
#view-fabric-orders .fe-color-field{position:relative;width:100%;height:148px;border-radius:11px;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,hsl(350 100% 50%));cursor:crosshair;touch-action:none;overflow:hidden;box-shadow:inset 0 0 0 1px #171d2618}
#view-fabric-orders .fe-color-field:focus-visible{outline:3px solid #b8b1f2;outline-offset:2px}
#view-fabric-orders .fe-color-field>span{position:absolute;left:74%;top:14%;width:15px;height:15px;border:2px solid white;border-radius:50%;box-shadow:0 1px 5px #0009;transform:translate(-50%,-50%);pointer-events:none}
#view-fabric-orders .fe-hue-label{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:10px;color:#667085;font-size:11px}
#view-fabric-orders .fe-hue-label input{width:100%;height:18px;margin:0;accent-color:#ef4444;background:linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);border-radius:999px;cursor:pointer}
#view-fabric-orders .fe-hex-row{display:flex;align-items:center;gap:8px}
#view-fabric-orders .fe-hex-row label{font-size:11px;color:#667085}
#view-fabric-orders .fe-hex-row input{width:105px;height:34px;padding:5px 9px;border:1px solid #dfe3ea;border-radius:8px;background:#fafbfc;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:13px;font-weight:700;text-transform:uppercase}
#view-fabric-orders .fe-hex-row button{min-width:34px;min-height:34px;padding:4px;border:1px solid #dfe3ea;border-radius:8px;background:#fff;font-size:17px}
#view-fabric-orders .fe-stroke-picker{width:min(300px,calc(100vw - 24px))}
#view-fabric-orders .fe-stroke-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
#view-fabric-orders .fe-stroke-options button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:61px;padding:7px 3px;border:1px solid #e8eaf0;border-radius:10px;background:#fafbfc;color:#525d6e}
#view-fabric-orders .fe-stroke-options button:hover,#view-fabric-orders .fe-stroke-options button.selected{border-color:#bcb6e8;background:#f6f4ff;color:#5148b5}
#view-fabric-orders .fe-stroke-options i{display:block;width:28px;height:var(--line);min-height:2px;border-radius:999px;background:currentColor}
#view-fabric-orders .fe-stroke-options span{font-size:10px;line-height:1}
#view-fabric-orders .fe-stroke-slider-label{display:grid;grid-template-columns:1fr auto;align-items:center;gap:6px;margin-top:14px;font-size:12px;font-weight:650}
#view-fabric-orders .fe-stroke-slider-label output{color:#5b52c9;font-weight:750;font-variant-numeric:tabular-nums}
#view-fabric-orders .fe-stroke-slider-label input{grid-column:1/-1;width:100%;height:24px;margin:0;accent-color:#5b52c9;cursor:pointer}
@media(max-width:760px){#view-fabric-orders .fe-tools .fe-color-trigger{min-width:43px;min-height:36px;padding:4px 5px;gap:3px}#view-fabric-orders .fe-color-dot{width:22px;height:22px}#view-fabric-orders .fe-tools .fe-stroke-trigger{min-width:45px;min-height:36px;padding:4px 4px;gap:3px}#view-fabric-orders .fe-stroke-trigger svg{width:20px;height:20px}#view-fabric-orders .fe-color-picker,#view-fabric-orders .fe-stroke-picker{max-height:min(80dvh,620px)}}
#view-fabric-orders .fe-hex-row button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Keep the fabric library easy to open from the editor rail and dense enough for browsing. */
#view-fabric-orders .fe-fabric-library:not([hidden]){display:flex}
#view-fabric-orders .fe-rail .fe-library-nav{margin-top:6px;border-top:1px solid var(--fe-line);padding-top:11px}
#view-fabric-orders .fe-fabric-library{box-sizing:border-box;flex-direction:column;gap:12px;padding:16px clamp(16px,2vw,28px) 22px;height:calc(100dvh - 80px);min-height:0}
#view-fabric-orders .fe-library-top{flex:none}
#view-fabric-orders .fe-library-top h2{font-size:21px}
#view-fabric-orders .fe-library-drop{flex:none;margin:0;padding:11px 14px;border-radius:10px}
#view-fabric-orders #feLibrarySearch{flex:none;width:min(480px,100%);margin:0;padding:9px 12px}
#view-fabric-orders .fe-library-grid{flex:1;align-content:start;grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr));gap:12px;min-height:0}
#view-fabric-orders .fe-library-card img{height:190px}
#view-fabric-orders .fe-library-card-body{padding:10px}
#view-fabric-orders .fe-library-card .fe-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:10px}
#view-fabric-orders .fe-library-card button{min-width:0;padding:7px 5px;font-size:12px;line-height:1.3}
@media(max-width:760px){
 #view-fabric-orders .fe-fabric-library{height:calc(100dvh - 58px);padding:12px;gap:10px}
 #view-fabric-orders .fe-library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 #view-fabric-orders .fe-library-card img{height:155px}
 #view-fabric-orders .fe-library-card button{font-size:11px;padding:7px 4px}
}

/* Resizable fabric library beside the live garment-order canvas. */
#view-fabric-orders .fe-body.fe-library-open{--fe-library-width:420px}
#view-fabric-orders .fe-fabric-library:not([hidden]){display:flex;flex:0 0 var(--fe-library-width,420px);width:var(--fe-library-width,420px);height:100%;min-width:0;overflow:hidden;padding:12px;gap:9px;border-right:1px solid #e0e4ec;background:#fff}
#view-fabric-orders .fe-library-top{display:flex;align-items:center;gap:8px;justify-content:space-between;flex-wrap:nowrap}
#view-fabric-orders .fe-library-heading{display:grid;gap:1px;min-width:0}
#view-fabric-orders .fe-library-heading h2{font-size:15px;line-height:1.3;margin:0}
#view-fabric-orders .fe-library-heading span{font-size:11px;color:#778195;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#view-fabric-orders .fe-library-actions{display:flex;gap:4px;flex:none}
#view-fabric-orders .fe-library-actions button{min-height:29px;padding:3px 7px;font-size:11px;border-radius:7px}
#view-fabric-orders .fe-library-actions button[data-action="library-upload"]{font-size:18px;line-height:1}
#view-fabric-orders #feLibrarySearch{height:34px;min-height:34px;font-size:12px;padding:6px 9px;margin:0}
#view-fabric-orders .fe-library-folders{display:flex;gap:5px;flex:none;overflow:auto;padding:1px 1px 3px;scrollbar-width:thin}
#view-fabric-orders .fe-library-folder-item{display:flex;align-items:center;gap:2px;flex:none;padding:2px;border:1px solid #e2e5ec;border-radius:8px;background:#f8f9fb}
#view-fabric-orders .fe-library-folder-item.is-active{border-color:#c9c2ec;background:#f0eefb}
#view-fabric-orders .fe-library-folder{display:flex;align-items:center;gap:5px;min-width:0;min-height:24px;padding:2px 5px;border:0;background:transparent;border-radius:6px;font-size:11px}
#view-fabric-orders .fe-library-folder span{max-width:100px;overflow:hidden;text-overflow:ellipsis}
#view-fabric-orders .fe-library-folder small{font-size:10px;color:#758095}
#view-fabric-orders .fe-library-folder-delete{min-width:20px;min-height:22px;padding:0 3px;border:0;background:transparent;color:#8490a0;font-size:15px}
#view-fabric-orders .fe-library-drop{margin:0;padding:6px 8px;border-width:1px;border-radius:7px;font-size:11px;line-height:1.35}
#view-fabric-orders .fe-library-grid{display:grid;flex:1;align-content:start;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:8px;min-height:0;overflow:auto;padding:1px;scrollbar-width:thin}
#view-fabric-orders .fe-library-card{position:relative;min-width:0;border:1px solid #e1e5ed;border-radius:9px;overflow:hidden;background:#f2f4f7;cursor:grab;transition:border-color .14s,box-shadow .14s,opacity .14s}
#view-fabric-orders .fe-library-card:active{cursor:grabbing}
#view-fabric-orders .fe-library-card.is-selected{border-color:#655dc7;box-shadow:0 0 0 2px #655dc733}
#view-fabric-orders .fe-library-card.is-dragging{opacity:.42}
#view-fabric-orders .fe-library-card.is-drop-target{border-color:#4e46ba;box-shadow:0 0 0 3px #4e46ba44}
#view-fabric-orders .fe-library-card>img{display:block;width:100%;height:126px;object-fit:contain;background:#eef1f5}
#view-fabric-orders .fe-library-card button.fe-library-select,#view-fabric-orders .fe-library-card button.fe-favorite{position:absolute;top:5px;z-index:2;display:grid;place-items:center;min-width:24px;min-height:24px;width:24px;height:24px;padding:0;border:1px solid #ffffffdd;border-radius:50%;background:#ffffffed;color:#4c5564;font-size:13px;line-height:1;box-shadow:0 1px 4px #17243b25}
#view-fabric-orders .fe-library-card button.fe-library-select{left:5px}
#view-fabric-orders .fe-library-card button.fe-favorite{right:5px;font-size:17px}
#view-fabric-orders .fe-library-card button.fe-favorite.is-active{color:#c18a14}
#view-fabric-orders .fe-library-card-tools{position:absolute;left:5px;right:5px;bottom:5px;display:flex;justify-content:center;gap:4px;padding:3px;border-radius:7px;background:#ffffffed;box-shadow:0 1px 5px #17243b25}
#view-fabric-orders .fe-library-card-tools button{min-width:26px;min-height:25px;height:25px;padding:2px 5px;border:0;border-radius:5px;font-size:14px;line-height:1}
#view-fabric-orders .fe-library-card-tools button.fe-library-use{background:#4e46ba;color:#fff}
#view-fabric-orders .fe-library-note{display:block;overflow:hidden;padding:3px 6px 5px;background:#fff;color:#697586;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
#view-fabric-orders .fe-library-card.is-uploading{cursor:default}
#view-fabric-orders .fe-library-upload-state{position:absolute;left:0;right:0;bottom:0;padding:5px 7px;background:#ffffffed;font-size:10px}
#view-fabric-orders .fe-library-upload-state small{font-size:9px}
#view-fabric-orders .fe-library-resize:not([hidden]){display:block;flex:0 0 6px;width:6px;height:100%;cursor:col-resize;touch-action:none;background:transparent;z-index:2}
#view-fabric-orders .fe-library-resize:hover,#view-fabric-orders .fe-library-resize:focus-visible{background:#d9d5fa;outline:0}
#view-fabric-orders .fe-library-folder-item.is-drop-target{background:#eceaff;border-color:#655dc7;box-shadow:0 0 0 2px #655dc733}
@media(max-width:760px){
 #view-fabric-orders .fe-body.fe-library-open{display:grid;grid-template-columns:minmax(140px,var(--fe-library-width,46vw)) 6px minmax(135px,1fr);grid-template-rows:minmax(0,1fr) 62px;flex-direction:initial}
 #view-fabric-orders .fe-body.fe-library-open>.fe-rail{grid-column:1/-1;grid-row:2;order:initial;display:flex;flex-direction:row;width:100%;height:62px}
 #view-fabric-orders .fe-body.fe-library-open>.fe-fabric-library{grid-column:1;grid-row:1;width:auto;height:auto;min-width:0;padding:8px;gap:7px;border-right:0}
 #view-fabric-orders .fe-body.fe-library-open>.fe-library-resize{grid-column:2;grid-row:1;width:6px;height:100%}
 #view-fabric-orders .fe-body.fe-library-open>.fe-stage{grid-column:3;grid-row:1;order:initial;width:auto;min-width:0}
 #view-fabric-orders .fe-library-heading span{max-width:90px;font-size:9px}
 #view-fabric-orders .fe-library-actions{gap:2px}
 #view-fabric-orders .fe-library-actions button{min-height:27px;padding:2px 5px;font-size:10px}
 #view-fabric-orders .fe-library-folder span{max-width:70px}
 #view-fabric-orders .fe-library-grid{grid-template-columns:repeat(auto-fill,minmax(82px,1fr));gap:6px}
 #view-fabric-orders .fe-library-card>img{height:95px}
 #view-fabric-orders .fe-library-card-tools button{min-width:22px;min-height:22px;height:22px;padding:1px 4px;font-size:12px}
}

/* Give folder drop targets enough room for reliable pointer and touch placement. */
#view-fabric-orders .fe-library-folder-item{min-height:42px;padding:4px;gap:4px;border-radius:10px}
#view-fabric-orders .fe-library-folder{min-height:34px;padding:6px 8px;font-size:12px}
#view-fabric-orders .fe-library-folder span{max-width:120px}
#view-fabric-orders .fe-library-folder-delete{min-width:30px;min-height:30px;font-size:16px}
@media(max-width:760px){
 #view-fabric-orders .fe-library-folder-item{min-height:40px;padding:3px}
 #view-fabric-orders .fe-library-folder{min-height:34px;padding:6px 7px}
 #view-fabric-orders .fe-library-folder span{max-width:82px}
}
#view-fabric-orders .fe-fabric-name{display:grid;gap:7px}
#view-fabric-orders .fe-fabric-name-actions{display:flex;gap:7px}
#view-fabric-orders .fe-fabric-name-actions button{flex:1;min-width:0}
#view-fabric-orders .fe-fabric-name-actions button:disabled{opacity:.5;cursor:not-allowed}

/* Keep every tool and control inside the narrow left panel. */
#view-fabric-orders .fe-panel,#view-fabric-orders .fe-panel-head,#view-fabric-orders .fe-panel-content{min-width:0}
#view-fabric-orders .fe-panel-content{width:100%}
#view-fabric-orders .fe-panel-content>*,#view-fabric-orders .fe-panel-content .fe-fields,#view-fabric-orders .fe-panel-content .fe-fields>*,#view-fabric-orders .fe-panel-content .fe-row,#view-fabric-orders .fe-panel-content .fe-row>*{min-width:0;max-width:100%}
#view-fabric-orders .fe-panel-content button{box-sizing:border-box;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:center;line-height:1.3}
#view-fabric-orders .fe-panel-content strong,#view-fabric-orders .fe-panel-content summary,#view-fabric-orders .fe-panel-content p{max-width:100%;overflow-wrap:anywhere}
#view-fabric-orders .fe-selected-tools .fe-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
#view-fabric-orders .fe-image-context-menu{display:grid;gap:3px;max-width:min(260px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow-y:auto}
#view-fabric-orders .fe-image-context-menu hr{width:100%;margin:3px 0;border:0;border-top:1px solid var(--fe-line)}
#view-fabric-orders .fe-image-context-menu .fe-context-danger{color:#a92f3d;background:#fff7f7;border-color:#e7b8be}
.fe-archive-pagination{display:flex;align-items:center;justify-content:center;gap:16px;padding:14px}.fe-archive-pagination[hidden]{display:none}.fe-archive-pagination button,.fe-library-load-more{border:1px solid var(--fe-border,#d7dce2);border-radius:8px;background:var(--fe-surface,#fff);padding:9px 14px;color:inherit;cursor:pointer}.fe-archive-pagination button:disabled,.fe-library-load-more:disabled{opacity:.55;cursor:default}.fe-library-load-more{display:block;width:100%;grid-column:1/-1;margin:8px 0 16px}

/* Fixed thumbnail dimensions: narrowing the library changes column count only. */
#view-fabric-orders .fe-library-grid{grid-template-columns:repeat(auto-fill,128px);grid-auto-rows:minmax(128px,max-content);justify-content:start;align-items:start}
#view-fabric-orders .fe-library-card{width:128px;height:128px;min-height:128px;max-height:128px}
#view-fabric-orders .fe-library-card>img{width:126px;height:126px}
.fe-library-image-preview{position:fixed;z-index:10010;padding:8px;border:1px solid #d8deea;border-radius:12px;background:#fff;box-shadow:0 12px 40px #17243b40;pointer-events:none}
.fe-library-image-preview[hidden]{display:none}
.fe-library-image-preview>img{display:block;width:min(380px,calc(100vw - 42px));height:min(420px,calc(100vh - 42px));object-fit:contain;background:#f2f4f7;border-radius:6px}
@media(max-width:760px){#view-fabric-orders .fe-body.fe-library-open{grid-template-columns:minmax(154px,var(--fe-library-width,46vw)) 6px minmax(135px,1fr)}}
.legacy-order-dialog { width:min(1120px,94vw); max-height:94vh; border:0; border-radius:16px; padding:0; color:#173b39; box-shadow:0 20px 70px #0004; }
.legacy-order-dialog::backdrop,.lo-full::backdrop { background:#102524b3; }
.lo-form { display:flex; flex-direction:column; max-height:94vh; font:16px FabricThai,sans-serif; }
.lo-form header,.lo-form footer { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:16px 20px; background:#f4f7f7; flex-shrink:0; }
.lo-form header { justify-content:space-between; }.lo-form header strong { font-size:20px; }.lo-form header small { display:block; margin-top:4px; font-size:14px; }
.lo-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); overflow:auto; min-height:0; }
.lo-images,.lo-fields { padding:20px; min-width:0; }.lo-images { background:#e8eeee; }.lo-images figure { margin:12px 0; }.lo-images img { display:block; width:100%; max-height:420px; object-fit:contain; }.lo-images [data-full] { width:100%; padding:0; background:white; }.lo-images figcaption { display:flex; align-items:center; justify-content:space-between; font-size:14px; margin-top:6px; }
.lo-form button { border:1px solid #b7ccc9; border-radius:8px; padding:8px 12px; background:white; color:#173b39; font:inherit; font-size:14px; }.lo-form button.primary,.lo-form [data-match] { background:#245653; color:white; }.lo-form input,.lo-form select { box-sizing:border-box; min-width:0; width:100%; border:1px solid #b7ccc9; border-radius:8px; padding:8px; font:inherit; background:white; color:#173b39; }.lo-form label { display:grid; gap:5px; font-size:14px; }.lo-meta { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:14px; }.lo-item { display:grid; grid-template-columns:1.3fr .8fr auto; align-items:end; gap:8px; margin:12px 0; }.lo-items-heading { display:flex; justify-content:space-between; align-items:center; margin-top:22px; gap:8px; }.lo-form p { font-size:14px; }.lo-total { display:block; padding-top:12px; }.lo-error { color:#b42318; width:100%; margin:0; }.lo-error:empty { display:none; }.lo-form [data-success] { flex:1; font-size:14px; }.lo-full { max-width:96vw; max-height:96vh; border:0; padding:12px; }.lo-full img { display:block; max-width:90vw; max-height:85vh; object-fit:contain; }.lo-full button { display:block; margin-left:auto; }
@media(max-width:720px){.lo-layout { grid-template-columns:1fr; }.lo-item { grid-template-columns:1fr 1fr; }.lo-meta { grid-template-columns:1fr 1fr; }.legacy-order-dialog { width:96vw; }.lo-images img { max-height:280px; }}

.fe-archive-notice{padding:12px 16px;margin-bottom:16px;border:1px solid #b7ccc9;border-radius:10px;background:#eef5f4;color:#173b39;font-size:14px}.fe-archive-notice.error{border-color:#e2a6ad;background:#fff4f5;color:#a52d39}.fe-archive-notice button{margin-left:10px}

.fe-inline-text{position:fixed;z-index:1000;box-sizing:border-box;padding:0;border:0;outline:2px solid #7163ca;border-radius:0;background:#fff;resize:none;overflow:auto;font-family:FabricThai,sans-serif;line-height:1.35;transform-origin:center;white-space:pre;}

.fe-period-dialog{box-sizing:border-box;max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #dfe3ee;border-radius:20px;width:min(460px,calc(100vw - 32px));padding:26px;color:#203247;background:#fff;font-family:FabricThai,sans-serif;box-shadow:0 20px 70px #20324730}
.fe-period-dialog::backdrop{background:#15213d66}.fe-period-dialog h2{margin:0 0 18px;font-size:23px}.fe-period-fields{display:flex;gap:16px;margin:18px 0}.fe-period-fields label{display:grid;gap:7px;flex:1;min-width:0}.fe-period-dialog input,.fe-period-dialog select{box-sizing:border-box;width:100%;border:1px solid #d8deea;border-radius:10px;padding:10px;font:inherit;background:#fff;color:inherit}.fe-period-dialog [data-preview]{font-size:20px;font-weight:700;color:#5147a3}.fe-period-dialog [data-error]{color:#bf2445}.fe-period-dialog small{color:#67778e}.fe-period-dialog footer{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.fe-period-dialog button{font:inherit;border:1px solid #d8deea;border-radius:10px;padding:10px 18px;background:white;color:#203247;cursor:pointer}.fe-period-dialog button.primary{background:#5147a3;color:#fff;border-color:#5147a3}.fe-period-dialog button:disabled{opacity:.5;cursor:wait}
.fe-folder-dialog{width:min(420px,calc(100vw - 32px));border:1px solid #d8e3dd;border-radius:14px;background:#fff;color:#173c31;padding:22px;box-shadow:0 16px 55px #102d2440}.fe-folder-dialog::backdrop{background:#10271eb3}.fe-folder-dialog h2{font-size:19px;margin:0 0 18px}.fe-folder-dialog label{display:grid;gap:8px;font-weight:600}.fe-folder-dialog input{width:100%;box-sizing:border-box;border:1px solid #c6d5cb;border-radius:8px;padding:10px 12px;font:inherit}.fe-folder-dialog [data-error]{color:#ad2c2c;min-height:1.3em;font-size:13px}.fe-folder-dialog-actions{display:flex;justify-content:flex-end;gap:8px}.fe-folder-dialog-actions button{font:inherit;border:1px solid #c6d5cb;background:#fff;color:#24443a;padding:9px 14px;border-radius:8px;cursor:pointer}.fe-folder-dialog-actions [data-submit]{background:#1d4b3d;color:white;border-color:#1d4b3d}.fe-folder-dialog-actions button:disabled{opacity:.55;cursor:wait}
