#clearance-panel .panel-top{min-height:68px;height:auto;gap:12px;flex-wrap:wrap;padding:12px 20px}
.clearance-tabs{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.clearance-tabs button{padding:8px 0;color:#637d8c;border-bottom:2px solid transparent;font-weight:600}
.clearance-tabs button.active{color:var(--teal);border-color:var(--teal)}
.clearance-tabs small{background:#edf4f5;padding:2px 5px;border-radius:3px;margin-left:5px;font-weight:400}
.clearance-actions{margin-left:auto;display:flex;gap:8px}
.clearance-filters{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 20px;border-bottom:1px solid var(--line)}
.clearance-filters input{border:1px solid #dce6eb;border-radius:8px;padding:8px 12px;width:min(400px,100%)}
#clearance-status-filter{padding:8px;border:1px solid #dce6eb;border-radius:7px;background:white;color:#486575}
.clearance-table-wrap{overflow:auto;flex:1;min-height:120px}
.clearance-table{width:100%;border-collapse:collapse;min-width:920px;text-align:left}
.clearance-table th,.clearance-table td{padding:10px 14px;border-bottom:1px solid var(--line);vertical-align:top}
.clearance-table th{background:#f5f9fa;color:#63818d;font-weight:500;white-space:nowrap}
.clearance-table .clearance-group td{background:#f0f8f6;font-weight:600;border-top:1px solid #dcebe7}
.clearance-group-info{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.clearance-group-info span{font-size:12px;color:#63818d;font-weight:400}
.clearance-toggle td{padding:6px 14px}
#clearance-dialog{width:min(810px,calc(100vw - 32px));height:min(665px,calc(100dvh - 32px));max-height:calc(100dvh - 32px)}
#clearance-dialog form{display:flex;flex-direction:column;height:100%;max-height:none}
#clearance-dialog .modal-header,#clearance-dialog .modal-footer{flex-shrink:0;padding:12px 26px}
#clearance-dialog .modal-body{display:flex;flex-direction:column;flex:1;overflow:auto;min-height:0;max-height:none;padding:12px 26px}
#clearance-child-scroll,.clearance-set-child-scroll{flex:0 1 auto;min-height:0;max-height:300px;overflow:auto;scrollbar-gutter:stable;padding:0 0 4px}
#clearance-children,.clearance-set-children{display:flex;flex-direction:column;gap:6px}
#clearance-add-child,[data-clearance-add-child]{margin-top:8px}
#clearance-registration-sets{display:flex;flex-direction:column;gap:16px;flex-shrink:0;min-width:0}.clearance-registration-set{padding-bottom:14px;border-bottom:1px solid var(--line);min-width:0}.clearance-set-heading{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:8px;min-height:24px}.clearance-set-heading strong{font-size:13px;color:var(--navy)}.clearance-set-summary{font-size:12px;color:#718898}.clearance-set-heading [data-clearance-toggle-children]{margin-left:auto}.clearance-set-child-scroll[hidden],[data-clearance-remove-set][hidden],#clearance-add-set[hidden]{display:none!important}#clearance-add-set{align-self:flex-start;flex-shrink:0;margin-top:12px}
#clearance-history:empty,#clearance-form-error:empty{display:none}
/* Keep the existing desktop input widths when narrowing the dialog. */
.clearance-main-field{display:grid;grid-template-columns:100px 164px 63.5px 80px 66.5px 205px;gap:6px 14px;align-items:start;margin-bottom:8px;flex-shrink:0}
.clearance-main-field>span{grid-column:1/-1}
#clearance-dialog-stage,.clearance-stage{display:none}
.clearance-main-field label{display:flex;flex-direction:column;gap:6px;min-width:0}
.clearance-people-fields{display:flex;flex-wrap:wrap;gap:12px 18px;margin-bottom:14px;flex-shrink:0}.clearance-registrant-field,.clearance-reviewer-field,.clearance-person-field{display:flex;flex-direction:column;gap:6px;min-width:0}#clearance-dialog .clearance-people-fields input{width:164px;max-width:100%}.clearance-reviewer-field[hidden],.clearance-person-field[hidden]{display:none!important}
#clearance-dialog input{border:1px solid #dce6eb;border-radius:7px;height:30px;padding:4px 8px;line-height:20px;min-width:0;width:100%;background:white;color:var(--ink)}
#clearance-dialog input:focus{border-color:#50c2b7;outline:2px solid #50c2b7;outline-offset:-2px}
#clearance-dialog input:disabled,#clearance-dialog input[readonly]{background:#f5f8fa}
.clearance-child{position:relative;padding:0;border:0;flex-shrink:0}
.clearance-child-remove{position:absolute;right:0;top:2px}
.clearance-child-fields{display:grid;grid-template-columns:165px 168px 57px minmax(0,1fr);gap:8px 18px;padding-right:40px}
.clearance-child-fields label{display:flex;flex-direction:column;gap:5px;min-width:0;color:#486575;font-size:12px}
.clearance-child-columns{position:sticky;top:0;z-index:1;background:white;padding:4px 40px 5px 0;color:#486575;font-size:12px}
.clearance-field-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0}
.clearance-error{color:#bd3434;white-space:pre-wrap;margin:10px 0 0}
.clearance-history{margin-top:22px;border-top:1px solid var(--line);padding-top:12px}
.clearance-history details{padding:8px 0;border-bottom:1px solid var(--line)}
.clearance-history summary{cursor:pointer;color:#486575}
.clearance-history .clearance-table{min-width:700px}
.clearance-sku-link{color:var(--teal);text-align:left;overflow-wrap:anywhere;font:inherit}.clearance-sku-link:hover{text-decoration:underline}.clearance-sku-link:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
@media(max-width:560px){.clearance-main-field{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.clearance-main-field>span{grid-column:span 2}#clearance-panel .panel-top{padding:12px}.clearance-tabs{gap:8px 14px}.clearance-filters{padding:12px}.clearance-actions{margin-left:0}.clearance-child-fields{grid-template-columns:minmax(0,1.2fr) minmax(0,1.5fr) minmax(0,.8fr)}#clearance-dialog{width:calc(100vw - 16px)}#clearance-dialog .modal-footer{justify-content:flex-end}.clearance-group-info{gap:10px}}

@media(min-width:561px) and (max-width:900px){.clearance-main-field{grid-template-columns:repeat(2,minmax(0,1fr))}.clearance-people-fields{display:grid;grid-template-columns:repeat(2,minmax(0,164px))}}
@media(max-width:900px){#clearance-dialog [data-clearance-field="clearance-main-sku"]{width:calc(100% * 4/9)}#clearance-dialog .clearance-child-fields input[name="sku"]{width:calc(100% * 2/3)}#clearance-dialog [data-clearance-field="clearance-main-product-name"],#clearance-dialog .clearance-child-fields input[name="productName"]{width:40%}#clearance-dialog [data-clearance-field="clearance-main-sales30"],#clearance-dialog .clearance-child-fields input[name="quantity"]{width:50%}#clearance-dialog [data-clearance-field="clearance-main-location"]{width:calc(100% / 3)}}

@media(max-width:560px){#clearance-dialog .clearance-child-fields input[name]{width:100%}.clearance-child-fields{padding-right:30px}.clearance-child-columns{padding-right:30px}.clearance-remark-field{grid-column:1/-1}.clearance-remark-field .clearance-field-label{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto;clip-path:none;white-space:normal}.clearance-remark-column{display:none}}
@media(max-width:560px){.clearance-people-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}#clearance-dialog .clearance-people-fields input{width:100%}}

#clearance-reject[hidden]{display:none!important}.clearance-remark{max-width:260px;overflow-wrap:anywhere;white-space:pre-wrap}

#clearance-dialog[data-clearance-stage="warehouse"] .clearance-remark-field,#clearance-dialog[data-clearance-stage="warehouse"] .clearance-remark-column{display:none}
#clearance-dialog[data-clearance-stage="warehouse"] .clearance-child-fields{grid-template-columns:165px 168px 57px 90px}
@media(max-width:560px){#clearance-dialog[data-clearance-stage="warehouse"] .clearance-child-fields{grid-template-columns:minmax(0,1.1fr) minmax(0,1.2fr) minmax(0,.65fr) minmax(0,.9fr);column-gap:6px}}

#clearance-dialog [data-clearance-field="clearance-main-listed-at"]{cursor:pointer;padding-right:30px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2363818d' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='4' y='5' width='16' height='16' rx='3'/%3E%3Cpath d='M8 3v4m8-4v4M4 10h16'/%3E%3C/svg%3E");background-position:right 9px center;background-repeat:no-repeat}
#clearance-dialog [data-clearance-field="clearance-main-listed-at"]::-webkit-calendar-picker-indicator{display:none}
#clearance-dialog [data-clearance-field="clearance-main-listed-at"]:disabled{cursor:default}
.clearance-calendar{display:none;position:fixed;inset:auto;margin:0;width:286px;max-width:calc(100vw - 24px);padding:14px;border:1px solid #dcebe7;border-radius:14px;background:white;color:var(--ink);box-shadow:0 12px 40px #18384624;font-size:13px;z-index:100}
.clearance-calendar.is-open{display:block}.clearance-calendar::backdrop{background:transparent}
.clearance-calendar-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.clearance-calendar-heading>div{display:flex;align-items:center;gap:4px}.clearance-calendar-heading>button{width:30px;height:30px;display:grid;place-items:center;border-radius:7px;color:#63818d}.clearance-calendar-heading svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.clearance-calendar-heading select{border:0;border-radius:6px;padding:4px 2px;color:var(--ink);background:white;font:inherit;cursor:pointer}
.clearance-calendar-week,.clearance-calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}.clearance-calendar-week{margin-bottom:6px;color:#84979d;text-align:center;font-size:11px}.clearance-calendar-days button{height:32px;padding:0;border-radius:8px;font-variant-numeric:tabular-nums}.clearance-calendar-days .outside-month{color:#b6c2c6}.clearance-calendar-days .today{box-shadow:inset 0 0 0 1px #90cfc5;color:var(--teal)}.clearance-calendar button:hover:not(:disabled){background:#edf7f4;color:var(--teal)}.clearance-calendar-days .selected,.clearance-calendar-days .selected:hover{background:var(--teal);color:white;box-shadow:none}.clearance-calendar button:focus-visible{outline:2px solid #50c2b7;outline-offset:1px}
.clearance-calendar-footer{display:flex;justify-content:space-between;border-top:1px solid #edf2f3;margin-top:12px;padding-top:9px}.clearance-calendar-footer button{border-radius:6px;padding:3px 7px;color:#63818d;font-size:12px}.clearance-calendar-footer [data-calendar-today]{color:var(--teal)}

.clearance-counted-field,.clearance-counted-column{display:none!important}#clearance-dialog[data-clearance-stage="warehouse"] .clearance-counted-field{display:flex!important}#clearance-dialog[data-clearance-stage="warehouse"] .clearance-counted-column{display:block!important}


#clearance-delete-dialog{width:min(440px,calc(100vw - 32px))}#clearance-delete-dialog .modal-body{padding:20px 26px;max-height:calc(100dvh - 160px);overflow:auto}#clearance-delete-error:empty{display:none}.button.clearance-delete-danger{background:#bd3434;color:white}.button.clearance-delete-danger:hover:not(:disabled){background:#a52929}.button.clearance-delete-button{color:#bd3434;white-space:nowrap}

#clearance-delete-open{margin-right:auto}#clearance-delete-open[hidden]{display:none!important}

#clearance-dialog .modal-footer{align-items:flex-end;flex-wrap:nowrap}.clearance-dialog-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;min-width:0;margin-left:auto}#clearance-delete-open{flex-shrink:0}

#clearance-dialog[data-clearance-stage="purchase"] .clearance-remark-field,#clearance-dialog[data-clearance-stage="purchase"] .clearance-remark-column{display:none}.clearance-manufacturer-reply-field{display:flex;flex-direction:column;gap:8px;margin-top:16px;flex-shrink:0}.clearance-manufacturer-reply-field[hidden]{display:none!important}#clearance-manufacturer-reply{width:100%;min-height:112px;max-height:260px;resize:vertical;border:1px solid #dce6eb;border-radius:8px;padding:10px 12px;font:inherit;line-height:1.7;background:white;color:var(--ink)}#clearance-manufacturer-reply:focus{border-color:#50c2b7;outline:2px solid #50c2b7;outline-offset:-2px}#clearance-manufacturer-reply:disabled{background:#f5f8fa}.clearance-manufacturer-reply-text{white-space:pre-wrap;overflow-wrap:anywhere}
#clearance-manufacturer-reply{white-space:pre-wrap;overflow-wrap:anywhere}

#clearance-dialog[data-clearance-stage="register"] .clearance-remark-field,#clearance-dialog[data-clearance-stage="register"] .clearance-remark-column{display:none}.clearance-reason-field{display:flex;flex-direction:column;gap:8px;margin-top:16px}.clearance-reason-field[hidden]{display:none!important}#clearance-dialog [data-clearance-field="clearance-reason"]{width:100%;min-height:112px;max-height:260px;resize:vertical;border:1px solid #dce6eb;border-radius:8px;padding:10px 12px;font:inherit;line-height:1.7;background:white;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere}#clearance-dialog [data-clearance-field="clearance-reason"]:focus{border-color:#50c2b7;outline:2px solid #50c2b7;outline-offset:-2px}#clearance-dialog [data-clearance-field="clearance-reason"]:disabled{background:#f5f8fa}.clearance-reason-text{white-space:pre-wrap;overflow-wrap:anywhere}

@media(min-width:701px){#clearance-dialog[data-clearance-stage="register"] .clearance-registration-details{display:grid;grid-template-columns:426px minmax(0,1fr) 40px;column-gap:18px;align-items:start}#clearance-dialog[data-clearance-stage="register"] .clearance-set-child-scroll{grid-column:1/-1;grid-row:1}#clearance-dialog[data-clearance-stage="register"] .clearance-reason-field{grid-column:2;grid-row:1;margin-top:0;padding-top:4px;gap:5px;font-size:12px;color:#486575;position:relative;z-index:2;background:white}#clearance-dialog[data-clearance-stage="register"] .clearance-registration-details:has([data-clearance-child-scroll][hidden]) .clearance-reason-field{grid-column:1/-1}}

#clearance-import-dialog{width:min(920px,calc(100vw - 24px));max-height:calc(100dvh - 24px)}#clearance-import-form{display:flex;flex-direction:column;max-height:calc(100dvh - 26px)}#clearance-import-dialog .modal-header,#clearance-import-dialog .modal-footer{flex-shrink:0}#clearance-import-dialog .modal-body{overflow:auto;min-height:0;max-height:none}.clearance-import-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:12px 0}.clearance-import-tools span{overflow-wrap:anywhere}.clearance-import-settings,.clearance-import-mapping{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.clearance-import-settings label,.clearance-import-mapping label{display:flex;flex-direction:column;gap:6px;min-width:0;font-size:12px}#clearance-import-dialog input,#clearance-import-dialog select{width:100%;min-width:0;padding:7px 8px;border:1px solid #dce6eb;border-radius:7px;background:white;color:var(--ink)}.clearance-import-paste summary{cursor:pointer;color:var(--teal)}#clearance-import-paste{min-height:90px;max-height:180px;margin:8px 0;white-space:pre-wrap;overflow-wrap:anywhere}.clearance-import-preview{margin-top:14px}.clearance-import-preview .clearance-table-wrap{max-height:260px;overflow:auto}.clearance-import-preview .clearance-table{min-width:620px}.clearance-import-preview ul{max-height:180px;overflow:auto;padding-left:20px;color:#bd3434}#clearance-import-error:empty{display:none}@media(max-width:560px){.clearance-import-settings,.clearance-import-mapping{grid-template-columns:repeat(2,minmax(0,1fr))}#clearance-import-dialog .modal-header,#clearance-import-dialog .modal-body,#clearance-import-dialog .modal-footer{padding:14px}}

/* One shared review note replaces the individual child inputs. */
#clearance-dialog .clearance-remark-field,#clearance-dialog .clearance-remark-column{display:none}
.clearance-review-remark-field{display:flex;flex-direction:column;gap:8px;margin-top:16px;min-width:0}.clearance-review-remark-field[hidden]{display:none!important}
#clearance-dialog [data-clearance-field="clearance-review-remark"]{width:100%;min-height:112px;max-height:260px;resize:vertical;border:1px solid #dce6eb;border-radius:8px;padding:10px 12px;font:inherit;line-height:1.7;background:white;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere}
#clearance-dialog [data-clearance-field="clearance-review-remark"]:focus{border-color:#50c2b7;outline:2px solid #50c2b7;outline-offset:-2px}#clearance-dialog [data-clearance-field="clearance-review-remark"]:disabled{background:#f5f8fa}.clearance-review-remark-text{white-space:pre-wrap;overflow-wrap:anywhere}
@media(min-width:701px){#clearance-dialog:is([data-clearance-stage="review"],[data-clearance-stage="completed"],[data-clearance-stage="stopped"]) .clearance-registration-details{display:grid;grid-template-columns:426px minmax(0,1fr) 40px;column-gap:18px;align-items:start}#clearance-dialog:is([data-clearance-stage="review"],[data-clearance-stage="completed"],[data-clearance-stage="stopped"]) .clearance-set-child-scroll{grid-column:1/-1;grid-row:1}#clearance-dialog .clearance-review-remark-field{grid-column:2;grid-row:1;margin-top:0;padding-top:4px;gap:5px;font-size:12px;color:#486575;position:relative;z-index:2;background:white}#clearance-dialog:is([data-clearance-stage="review"],[data-clearance-stage="completed"],[data-clearance-stage="stopped"]) .clearance-reason-field{grid-column:1/-1;grid-row:2}#clearance-dialog .clearance-registration-details:has([data-clearance-child-scroll][hidden]) .clearance-review-remark-field{grid-column:1/-1}}

/* Independent warehouse observations; legacy review remarks stay separate. */
.clearance-counted-note-field,.clearance-counted-note-column{display:none!important}
#clearance-dialog[data-clearance-stage="warehouse"] .clearance-counted-note-field{display:flex!important}
#clearance-dialog[data-clearance-stage="warehouse"] .clearance-counted-note-column{display:block!important}
#clearance-dialog[data-clearance-stage="warehouse"] .clearance-child-fields{grid-template-columns:165px 168px 57px 90px minmax(0,1fr);column-gap:14px}
.clearance-counted-summary{margin:4px 0 10px;color:var(--teal);font-weight:600}.clearance-counted-summary[hidden]{display:none}
.clearance-counted-note{max-width:260px;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:560px){#clearance-dialog[data-clearance-stage="warehouse"] .clearance-child-fields{grid-template-columns:minmax(0,1.1fr) minmax(0,1.2fr) minmax(0,.65fr) minmax(0,.9fr);column-gap:6px}#clearance-dialog[data-clearance-stage="warehouse"] .clearance-counted-note-field{grid-column:1/-1}#clearance-dialog[data-clearance-stage="warehouse"] .clearance-counted-note-column{display:none!important}.clearance-counted-note-field .clearance-field-label{position:static;width:auto;height:auto;margin:0;clip:auto;clip-path:none;overflow:visible}}

/* Registration identity: department choices followed by a compact registrant. */
#clearance-dialog .clearance-people-fields{display:flex;align-items:flex-start;flex-wrap:wrap}
#clearance-dialog .clearance-people-fields #clearance-registrant{width:82px}
#clearance-dialog .clearance-department-field{display:flex;flex-direction:column;gap:6px;min-width:0}
#clearance-dialog #clearance-department{width:109.33px;max-width:100%;height:30px;padding:0 8px;border:1px solid var(--line,#dbe6ee);border-radius:6px;background-color:#fff;color:inherit;font:inherit}


.clearance-confirm-action{display:flex;align-items:center;gap:6px;font-size:12px}.clearance-confirm-action[hidden],#clearance-submit-destination[hidden]{display:none!important}

#clearance-transfer-confirm{position:fixed;inset:0;margin:auto;width:360px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);padding:24px;border:1px solid var(--line,#dbe6ee);border-radius:14px;background:#fff;color:var(--ink,#19384a);font:inherit;box-shadow:0 16px 60px #19384a30}
#clearance-transfer-confirm::backdrop{background:rgba(30,50,65,.18)}
#clearance-transfer-confirm h3{margin:0 0 12px;font-size:18px;font-weight:600}#clearance-transfer-message{margin:0;font-size:14px;line-height:1.7;overflow-wrap:anywhere}
.clearance-transfer-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}.clearance-transfer-actions .button{min-width:72px;height:36px;padding:0 16px}

.clearance-registration-top{display:flex;align-items:flex-start;gap:12px;margin-bottom:14px;flex-shrink:0;min-width:0}.clearance-registration-top .clearance-people-fields{flex:1;min-width:0;margin-bottom:0}#clearance-registration-save{flex:none;margin-left:auto}#clearance-registration-save:empty,#clearance-registration-save:has(>.hidden){display:none}#clearance-registration-save .button{white-space:nowrap}

.clearance-registration-table{min-width:1200px;table-layout:auto}.clearance-registration-table td{overflow-wrap:anywhere;max-width:220px}
.clearance-registration-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 14px;margin:12px 40px 12px 0;padding-bottom:12px;border-bottom:1px solid var(--line)}
.clearance-registration-fields label{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:12px;color:#486575}
#clearance-dialog .clearance-registration-fields select{width:100%;height:30px;padding:4px 8px;border:1px solid #dce6eb;border-radius:7px;background:white;color:var(--ink);font:inherit}
#clearance-dialog .clearance-registration-fields select:disabled{background:#f5f8fa}
#clearance-dialog .clearance-with-registration-fields .clearance-registration-details{display:block}
#clearance-dialog .clearance-with-registration-fields .clearance-reason-field{margin-top:12px}
#clearance-dialog[data-clearance-stage="register"] .clearance-child-columns{display:none}
#clearance-dialog[data-clearance-stage="register"] .clearance-child-fields{grid-template-columns:repeat(3,minmax(0,1fr));padding-right:40px}
#clearance-dialog[data-clearance-stage="register"] .clearance-field-label{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto;clip-path:none;white-space:normal}
#clearance-dialog[data-clearance-stage="register"] .clearance-child-fields input[name]{width:100%}
.clearance-registration-history{white-space:normal;overflow-wrap:anywhere;color:#486575}
@media(max-width:560px){.clearance-registration-fields{grid-template-columns:repeat(2,minmax(0,1fr));margin-right:30px}#clearance-dialog[data-clearance-stage="register"] .clearance-child-fields{grid-template-columns:repeat(2,minmax(0,1fr));padding-right:30px}}

/* Missing required values remain visible until the field is completed. */
:is(#clearance-dialog,#clearance-import-dialog) :is(input,select,textarea)[required]:invalid:not(:disabled):not([readonly]){background-color:#fff1f0;border-color:#e9aaa6}
:is(#clearance-dialog,#clearance-import-dialog) :is(input,select,textarea)[required]:invalid:not(:disabled):not([readonly]):focus{border-color:#d87870;box-shadow:0 0 0 2px #e9aaa630}

/* One quiet, consistently sized row and form per main SKU. */
#clearance-panel .clearance-main-row td{font-size:12px;font-weight:400;line-height:1.65;background:#fff}
#clearance-panel .clearance-main-sku-cell{font-family:inherit;font-size:12px;font-weight:400}
.clearance-row-actions{white-space:nowrap}
#clearance-dialog .clearance-main-field{grid-template-columns:minmax(0,2fr) minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.2fr);gap:12px 14px}
#clearance-dialog .clearance-main-field label,#clearance-dialog .clearance-main-field input{font-size:12px;font-weight:400}
#clearance-dialog .clearance-main-only .clearance-registration-details{display:block}
#clearance-dialog .clearance-registration-fields{margin:4px 0 12px;padding-bottom:12px}
#clearance-dialog .clearance-set-child-scroll{max-height:none;overflow:visible;scrollbar-gutter:auto}
@media(max-width:560px){#clearance-dialog .clearance-main-field{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Keep customer confirmation fields together on the second metadata row. */
#clearance-dialog .clearance-registration-fields .clearance-customer-start{grid-column:1}
#clearance-dialog .clearance-customer-field :is(input,select).clearance-customer-empty:not(:disabled){background-color:#fff1f0;border-color:#e9aaa6}
#clearance-dialog .clearance-customer-field :is(input,select).clearance-customer-empty:not(:disabled):focus{border-color:#d87870;outline:2px solid #d87870;outline-offset:-2px}

.clearance-warehouse-result-field{display:flex;flex-direction:column;gap:8px;margin-top:16px;flex-shrink:0}.clearance-warehouse-result-field[hidden]{display:none!important}#clearance-warehouse-result{width:100%;min-height:112px;max-height:260px;resize:vertical;border:1px solid #dce6eb;border-radius:8px;padding:10px 12px;font:inherit;line-height:1.7;background:white;color:var(--ink)}#clearance-warehouse-result:focus{border-color:#50c2b7;outline:2px solid #50c2b7;outline-offset:-2px}#clearance-warehouse-result:disabled{background:#f5f8fa}.clearance-warehouse-result-text{white-space:pre-wrap;overflow-wrap:anywhere}
#clearance-panel .clearance-feedback-cell{white-space:pre-wrap;overflow-wrap:anywhere;min-width:150px}

/* Compact second row shares the full width of the main identity row. */
#clearance-dialog .clearance-main-field input{width:100%}
#clearance-dialog .clearance-main-secondary{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.5fr) minmax(0,5.5fr);gap:14px;align-items:start;min-width:0}
#clearance-dialog .clearance-main-secondary .clearance-reason-field{grid-column:4;grid-row:1;margin:0;padding:0;gap:6px;font-size:12px;color:inherit}
#clearance-dialog .clearance-main-secondary .clearance-date-field{grid-column:3;grid-row:1}
#clearance-dialog .clearance-main-secondary [data-clearance-field="clearance-reason"]{height:30px;min-height:30px;max-height:30px;padding:4px 8px;line-height:20px;border-radius:7px;resize:none;overflow:auto}
#clearance-dialog .clearance-main-secondary [data-clearance-field="clearance-main-listed-at"]{padding:4px;font-size:11px;background-image:none}
@media(max-width:560px){#clearance-dialog .clearance-main-secondary{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}#clearance-dialog .clearance-main-secondary .clearance-reason-field{grid-column:1/-1;grid-row:2}#clearance-dialog .clearance-main-secondary .clearance-date-field{grid-column:3;grid-row:1}}

#clearance-dialog .clearance-set-title{display:none}
#clearance-dialog .clearance-set-heading:not(:has(.clearance-set-summary:not(:empty),[data-clearance-remove-set]:not([hidden]))){display:none}
#clearance-dialog .clearance-people-fields :is(#clearance-purchase-handler,#clearance-warehouse-handler,#clearance-department-handler,#clearance-stop-owner){width:82px}

/* Compare purchase feedback and warehouse handling side by side. */
#clearance-dialog .clearance-feedback-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px;flex-shrink:0}
#clearance-dialog .clearance-feedback-fields>label{min-width:0;margin:0}
#clearance-dialog .clearance-feedback-fields:not(:has(>label:not([hidden]))){display:none}
#clearance-dialog .clearance-feedback-fields:not(:has(>label:not([hidden])~label:not([hidden])))>label:not([hidden]){grid-column:1/-1}
@media(max-width:560px){#clearance-dialog .clearance-feedback-fields{grid-template-columns:minmax(0,1fr)}}

.clearance-department-result-field{display:flex;flex-direction:column;gap:8px;margin-top:16px;flex-shrink:0}.clearance-department-result-field[hidden]{display:none!important}#clearance-department-result{width:100%;min-height:112px;max-height:260px;resize:vertical;border:1px solid #dce6eb;border-radius:8px;padding:10px 12px;font:inherit;line-height:1.7;background:white;color:var(--ink)}#clearance-department-result:focus{border-color:#50c2b7;outline:2px solid #50c2b7;outline-offset:-2px}#clearance-department-result:disabled{background:#f5f8fa}.clearance-department-result-text{white-space:pre-wrap;overflow-wrap:anywhere}

#clearance-warehouse-target{height:40px;max-width:150px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font:inherit}#clearance-warehouse-target[hidden]{display:none!important}

#clearance-dialog .clearance-feedback-fields:has(>#clearance-manufacturer-actions:not([hidden]))>#clearance-manufacturer-reply-field{grid-column:1;grid-row:1}
.clearance-manufacturer-actions{grid-column:2;grid-row:1;display:flex;flex-direction:column;gap:12px;min-width:0}
.clearance-manufacturer-actions[hidden]{display:none!important}
.clearance-manufacturer-actions>div{display:flex;flex-wrap:wrap;gap:10px;padding-top:10px}
.clearance-manufacturer-actions small{color:var(--muted);line-height:1.7}
@media(max-width:560px){.clearance-manufacturer-actions{grid-column:1;grid-row:2}}

@supports (appearance:base-select){
  #clearance-department,#clearance-department::picker(select){appearance:base-select}
  #clearance-dialog #clearance-department{display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer;transition:border-color .15s,box-shadow .15s}
  #clearance-dialog #clearance-department:not(:disabled):hover{border-color:#a8cec5}
  #clearance-dialog #clearance-department:focus-visible{outline:none;border-color:var(--teal);box-shadow:0 0 0 2px #12887e1a}
  #clearance-department::picker-icon{color:#718793;font-size:11px}
  #clearance-department::picker(select){min-width:144px;margin:6px 0;padding:5px;border:1px solid #dce8e8;border-radius:8px;background:#fff;color:#45616e;box-shadow:0 6px 20px #234c5a1a;font:400 13px/1.5 "Microsoft YaHei",sans-serif}
  #clearance-department option{display:flex;align-items:center;gap:14px;min-height:34px;padding:7px 10px;border-radius:5px;cursor:pointer}
  #clearance-department option[hidden]{display:none}
  #clearance-department option:hover,#clearance-department option:focus-visible{background:#f1f7f6;outline:none}
  #clearance-department option:checked{background:#e6f4ef;color:var(--teal);font-weight:600}
  #clearance-department option::checkmark{order:1;margin-left:auto;color:var(--teal)}
}
.clearance-fallback{margin:14px 0;padding:12px 0;border:0;border-top:1px solid var(--line);display:flex;flex-wrap:wrap;gap:12px 24px}.clearance-fallback legend{font-size:13px;padding:0 8px 0 0}.clearance-fallback label{display:inline-flex!important;align-items:center;gap:7px;font-size:13px;cursor:pointer}.clearance-fallback input[type=radio]{width:15px!important;height:15px;margin:0;accent-color:var(--teal)}
#clearance-dialog .clearance-fallback label{padding:7px 10px;border-radius:6px;transition:background-color .15s,color .15s}#clearance-dialog .clearance-fallback label:has(input:checked){background:#e6f4ef;color:#167e73}#clearance-dialog .clearance-fallback input[type=radio]{padding:0;flex:none;outline:none;box-shadow:none}#clearance-dialog .clearance-fallback label:has(input:focus-visible){outline:2px solid #9acfc0;outline-offset:2px}
#clearance-dialog.clearance-operations-confirm .clearance-customer-field{display:none!important}
#clearance-dialog .clearance-registration-fields .clearance-fallback{grid-column:3;grid-row:1;margin:0;padding:0;border:0;min-width:0;gap:4px;align-content:start}#clearance-dialog .clearance-registration-fields .clearance-fallback legend{font-size:12px;margin-bottom:5px;padding:0;color:#486575}#clearance-dialog .clearance-registration-fields .clearance-fallback label{flex-direction:row;font-size:12px;padding:6px 4px;gap:4px}@media(max-width:560px){#clearance-dialog .clearance-registration-fields .clearance-fallback{grid-column:1/-1;grid-row:auto}}
#clearance-dialog .clearance-registration-fields input:is([name="productCode"],[name="productCategory"]){width:66.6667%}
@media(min-width:561px){#clearance-dialog .clearance-registration-fields>label:has(input[name="productCategory"]){position:relative;left:calc(-100% / 3 + 98px / 9)}}
@media(min-width:561px){#clearance-dialog .clearance-registration-fields .clearance-fallback{margin-left:calc(-200% / 3 + 188px / 9);gap:8px 16px}}#clearance-dialog .clearance-registration-fields .clearance-fallback label{padding:6px 8px;gap:6px}
#clearance-dialog[data-clearance-stage="purchase"] .clearance-registration-set:last-child{border-bottom:0;padding-bottom:0}#clearance-dialog[data-clearance-stage="purchase"] .clearance-registration-set:last-child .clearance-registration-fields{margin-bottom:0}
#clearance-dialog .clearance-registration-fields .clearance-fallback{position:relative;z-index:1}
#clearance-dialog .clearance-registration-fields .clearance-fallback .clearance-promotion-platform{flex-basis:100%;display:flex!important;flex-direction:column;align-items:stretch;padding:4px 0 0;gap:5px;cursor:default}#clearance-dialog .clearance-promotion-platform[hidden]{display:none!important}#clearance-dialog .clearance-promotion-platform input{width:100%;max-width:260px;height:30px}
#clearance-dialog .clearance-registration-fields .clearance-fallback .clearance-promotion-platform[hidden]{display:none!important}
#clearance-dialog #clearance-confirmer{width:100px}
#clearance-dialog .clearance-registration-fields .clearance-fallback[hidden]{display:none!important}
#clearance-dialog .clearance-registration-fields>label:has(>input:is([name="productCode"],[name="productCategory"])){display:none}#clearance-dialog .clearance-registration-fields .clearance-fallback{grid-column:1/-1;margin-left:0}
#clearance-dialog.clearance-intake .clearance-customer-field{display:none!important}
#clearance-dialog .clearance-main-field>label[hidden]{display:none!important}
#clearance-dialog .clearance-main-secondary .clearance-reason-field{grid-column:1/-1;grid-row:2;width:calc((100% - 42px) * 5.5 / 9)}#clearance-dialog .clearance-main-secondary [data-clearance-field="clearance-reason"]{height:70px;min-height:70px;max-height:70px;line-height:20px;overflow:auto}#clearance-dialog.clearance-intake .clearance-registration-set{border-bottom:0;padding-bottom:0}#clearance-dialog.clearance-intake .clearance-history{border-top:0;margin-top:12px;padding-top:0}@media(max-width:560px){#clearance-dialog .clearance-main-secondary .clearance-reason-field{width:100%}}

/* Operations confirmation: compact product fields and one-row inventory details. */
#clearance-dialog.clearance-operations-confirm .clearance-main-field{grid-template-columns:minmax(0,1.2fr) minmax(0,1.65fr) minmax(0,.9fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.5fr)}
#clearance-dialog.clearance-operations-confirm .clearance-main-secondary{display:contents}
#clearance-dialog.clearance-operations-confirm .clearance-main-secondary .clearance-date-field{grid-column:6;grid-row:1}
@media(max-width:700px){#clearance-dialog.clearance-operations-confirm .clearance-main-field{grid-template-columns:repeat(3,minmax(0,1fr))}#clearance-dialog.clearance-operations-confirm .clearance-main-secondary .clearance-date-field{grid-column:3;grid-row:2}#clearance-dialog.clearance-operations-confirm .clearance-main-secondary .clearance-reason-field{grid-row:3;width:100%}}

.clearance-reason-row{display:contents}.clearance-platforms[hidden]{display:none!important}
#clearance-dialog.clearance-operations-confirm .clearance-reason-row{display:flex;grid-column:1/-1;grid-row:2;gap:14px;align-items:flex-start}
#clearance-dialog.clearance-operations-confirm .clearance-main-secondary .clearance-reason-field{width:calc((100% - 42px) * 5.5 / 9 * 5 / 6);flex-shrink:0}
#clearance-dialog.clearance-operations-confirm [data-clearance-field="clearance-reason"]{height:87px;min-height:87px;max-height:87px}
.clearance-platforms{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;flex:1;min-width:0}.clearance-platforms fieldset{margin:0;padding:7px;border:1px solid #dce8e4;border-radius:7px;min-width:0}.clearance-platforms legend{font-size:12px;padding:0 4px}.platform-choices{display:flex;flex-wrap:wrap;gap:5px}.clearance-platforms .platform-choices label{display:flex!important;flex-direction:row!important;align-items:center;gap:3px!important;cursor:pointer;font-size:11px!important;padding:3px;border-radius:4px}.platform-choices label:has(:checked){background:#e5f4ef;color:#0c847b}#clearance-dialog .platform-choices input{width:13px;height:13px;margin:0;box-shadow:none}.clearance-platforms textarea{width:100%;margin-top:6px;min-height:48px;font:inherit}.clearance-platforms textarea[hidden]{display:none}
@media(max-width:700px){#clearance-dialog.clearance-operations-confirm .clearance-reason-row{grid-row:3;flex-direction:column}#clearance-dialog.clearance-operations-confirm .clearance-main-secondary .clearance-reason-field{width:100%}.clearance-platforms{width:100%}}

#clearance-dialog.clearance-operations-confirm .clearance-registration-set{border-bottom:0;padding-bottom:0}
#clearance-dialog.clearance-operations-confirm .clearance-history{border-top:0;margin-top:12px;padding-top:0}

.clearance-platform-section{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}.clearance-platform-section[hidden]{display:none!important}.clearance-platform-title{font-size:12px;line-height:19.2px}.clearance-platform-section .clearance-platforms{height:130px;min-height:130px;flex:none;grid-template-rows:repeat(2,minmax(0,1fr));gap:8px 12px;overflow:auto}.clearance-platform-section .clearance-platforms fieldset{overflow:auto}.clearance-platform-section:has(textarea:not([hidden])) .clearance-platforms{grid-template-rows:repeat(2,minmax(110px,auto))}@media(max-width:700px){.clearance-platform-section{width:100%}}

.clearance-platform-summary{display:grid;grid-template-rows:repeat(2,auto);grid-auto-flow:column;grid-template-columns:repeat(2,minmax(100px,1fr));gap:4px 16px;white-space:normal}.clearance-platform-summary span{overflow-wrap:anywhere}

#clearance-dialog.clearance-operations-confirm .clearance-platform-section{display:none}#clearance-dialog.clearance-operations-confirm .clearance-reason-field{max-width:100%}.clearance-inline-platforms{min-width:360px;white-space:normal}.clearance-inline-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px}.clearance-inline-platform>span{font-size:11px;color:#65808b}.clearance-inline-choices{display:flex;gap:4px}.clearance-inline-choices button{font-size:11px;border-radius:5px;padding:3px 7px;background:#f3f7f8;color:#536f7b}.clearance-inline-choices button[aria-pressed=true]{background:#e1f3ec;color:#09867c}.clearance-inline-platform input,.clearance-inline-footer input,.clearance-inline-footer select{font:inherit;border:1px solid #d8e5e9;border-radius:5px;padding:4px 6px;min-width:0;background:#fff;color:inherit}.clearance-inline-platform input{width:100%;margin-top:4px}.clearance-inline-platform input[hidden]{display:none}.clearance-inline-footer{display:flex;gap:6px;margin-top:8px;align-items:center}.clearance-inline-footer input{width:72px}.clearance-inline-footer select{width:125px}.clearance-inline-footer button{white-space:nowrap}.clearance-inline-note{display:block;color:#758b98;font-size:11px;margin-top:3px}

#clearance-panel .clearance-operations-table{table-layout:fixed;min-width:1500px}#clearance-panel .clearance-operations-table td{max-width:none;min-width:0;overflow-wrap:anywhere}#clearance-panel .clearance-operations-table th:nth-child(1){width:6.3%}#clearance-panel .clearance-operations-table th:nth-child(2){width:8.6%}#clearance-panel .clearance-operations-table th:nth-child(3){width:6.2%}#clearance-panel .clearance-operations-table th:nth-child(4){width:15.2%}#clearance-panel .clearance-operations-table th:nth-child(5){width:4.9%}#clearance-panel .clearance-operations-table th:nth-child(6){width:5.2%}#clearance-panel .clearance-operations-table th:nth-child(7){width:33.6%}#clearance-panel .clearance-operations-table th:nth-child(8){width:8.2%}#clearance-panel .clearance-operations-table th:nth-child(9){width:11.8%}#clearance-panel .clearance-operations-table .clearance-inline-platforms{min-width:0}#clearance-panel .clearance-operations-table .clearance-inline-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}#clearance-panel .clearance-operations-table .clearance-inline-choices{gap:3px;white-space:nowrap}#clearance-panel .clearance-operations-table .clearance-inline-choices button{padding:3px 5px}

#clearance-panel .clearance-operations-table .clearance-inline-platforms{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:start}#clearance-panel .clearance-operations-table .clearance-inline-footer{margin-top:20px;grid-column:2;grid-row:1}#clearance-panel .clearance-operations-table .clearance-inline-note{grid-column:1/-1;margin-top:0}#clearance-panel .clearance-operations-table .clearance-inline-grid{gap:6px}#clearance-panel .clearance-operations-table .clearance-inline-choices{flex-wrap:wrap}#clearance-panel .clearance-operations-table .clearance-inline-footer button{white-space:normal;max-width:70px}

.clearance-main-pages{display:flex;gap:8px;padding:12px 18px;border-bottom:1px solid var(--line);flex-shrink:0;background:#fafcfc;border-radius:14px 14px 0 0}.clearance-main-pages button{padding:8px 18px;border-radius:7px;color:#62808d;font-weight:500}.clearance-main-pages button:hover{background:#f0f6f5}.clearance-main-pages button.active{background:#e6f4ef;color:#07867c;font-weight:600}

#clearance-query{display:none!important}#clearance-panel th{position:relative}#clearance-panel th .column-filter-button{position:absolute;right:3px;top:50%;transform:translateY(-50%)}#clearance-panel th:has(.column-filter-button){padding-right:24px;white-space:normal}#clearance-filter-search{width:100%;height:38px;margin:8px 0 10px;padding:8px 10px;border:1px solid #d8e5e9;border-radius:7px;background:#f8fbfb;color:inherit;resize:none;font:inherit}#clearance-filter-search:focus{outline:none;border-color:#60b7ac;box-shadow:0 0 0 2px #e4f3ef}#clearance-filter-more[hidden]{display:none}#clearance-column-filter .column-option-label{white-space:pre-wrap;overflow-wrap:anywhere}

#clearance-panel .clearance-filters{display:none}#clearance-panel .clearance-filters:has(#clearance-message:not(:empty)){display:block}#clearance-status-filter,#clearance-description{display:none!important}

#clearance-panel .clearance-operations-table{min-width:0;width:100%}#clearance-panel .clearance-operations-table th,#clearance-panel .clearance-operations-table td{padding-left:8px;padding-right:8px}#clearance-panel .clearance-operations-table th:has(.column-filter-button){white-space:nowrap;padding-right:22px}#clearance-panel .clearance-operations-table th:nth-child(1){width:6%}#clearance-panel .clearance-operations-table th:nth-child(2){width:9%}#clearance-panel .clearance-operations-table th:nth-child(3){width:6%}#clearance-panel .clearance-operations-table th:nth-child(4){width:14%}#clearance-panel .clearance-operations-table th:nth-child(5){width:6%}#clearance-panel .clearance-operations-table th:nth-child(6){width:6.5%}#clearance-panel .clearance-operations-table th:nth-child(7){width:36%}#clearance-panel .clearance-operations-table th:nth-child(8){width:8%}#clearance-panel .clearance-operations-table th:nth-child(9){width:8.5%}#clearance-panel .clearance-operations-table .clearance-row-actions{white-space:normal}#clearance-panel .clearance-operations-table .clearance-row-actions button{padding:5px 8px}#clearance-panel .clearance-operations-table .clearance-inline-grid{gap:4px}#clearance-panel .clearance-operations-table .clearance-inline-platforms{gap:4px}#clearance-panel .clearance-operations-table .clearance-inline-choices button{padding:3px 4px}

@media(max-width:1700px){#clearance-panel .clearance-operations-table th:nth-child(4){width:13%}#clearance-panel .clearance-operations-table th:nth-child(5){width:7%}#clearance-panel .clearance-operations-table th:nth-child(6){width:7.5%}#clearance-panel .clearance-operations-table th:nth-child(7){width:35%}}

#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department) .clearance-customer-field{display:none!important}
@media(min-width:701px){
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-main-field{--compact-unit:calc((100% - 56px) / 7.2);--compact-spare:calc((100% - 98px - (100% - 56px) / 7.2 * 3.7) / 3.5);grid-template-columns:calc(var(--compact-unit) * .8) calc(var(--compact-unit) * 4 / 3) calc(var(--compact-unit) * 2 / 3) calc(var(--compact-unit) * .5 + var(--compact-spare) * .1875) calc(var(--compact-unit) * .4 + var(--compact-spare) * .1875) var(--compact-spare) var(--compact-spare) calc(var(--compact-spare) * 1.125)}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-main-secondary{display:contents}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-main-secondary .clearance-date-field{grid-column:8;grid-row:1}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-main-secondary .clearance-reason-field{grid-column:1/-1;grid-row:2}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-main-field input{padding-left:4px;padding-right:4px;min-width:0}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-main-field input[type=number]::-webkit-inner-spin-button{appearance:none;margin:0}
}

#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-reason-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-column:1/-1;grid-row:2;gap:14px;align-items:start}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-main-secondary .clearance-reason-field{grid-column:1;grid-row:1;width:100%}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) #clearance-manufacturer-reply-field{grid-column:2;grid-row:1;display:flex;flex-direction:column;min-width:0;margin:0;padding:0;gap:6px;font-size:12px}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-reason-row textarea{width:100%;height:70px;min-height:70px;max-height:70px;padding:4px 8px;line-height:20px;resize:none;overflow:auto}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department) .clearance-feedback-fields:has(>#clearance-manufacturer-actions:not([hidden])){display:grid}
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department) .clearance-manufacturer-actions{grid-column:1/-1}
@media(max-width:560px){#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) .clearance-reason-row{grid-template-columns:minmax(0,1fr)}#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department,.clearance-operations-warehouse) #clearance-manufacturer-reply-field{grid-column:1;grid-row:2}}

#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department) .clearance-registration-fields,
#clearance-dialog:is(.clearance-operations-purchase,.clearance-operations-department) .clearance-feedback-fields:has(>#clearance-manufacturer-actions){display:none!important}

#clearance-dialog .clearance-purchase-choice{display:flex;gap:12px;align-items:center}#clearance-dialog .clearance-purchase-choice[hidden]{display:none}#clearance-dialog .clearance-purchase-choice label{display:flex;align-items:center;gap:4px;white-space:nowrap;font-size:12px}#clearance-dialog .clearance-purchase-choice input{width:14px;height:14px;margin:0;accent-color:#0d8a7e}

#clearance-dialog.clearance-operations-department .clearance-registration-fields,
#clearance-dialog.clearance-operations-department .clearance-feedback-fields{display:none!important}

.clearance-discount{min-width:260px}.clearance-discount label{display:flex;align-items:center;gap:5px}.clearance-discount input[type=checkbox]{width:14px;height:14px;accent-color:#0d8a7e}.clearance-discount-save{display:flex;gap:8px;margin-top:8px}.clearance-discount-save input{width:95px;min-width:0;border:1px solid #dce6eb;border-radius:5px;padding:4px;font:inherit}.clearance-discount [data-discount-message]{font-size:12px;color:#b43434}

.clearance-discount .clearance-platform-summary{grid-template-columns:repeat(4,max-content);grid-template-rows:auto;grid-auto-flow:row;gap:12px}

#clearance-dialog.clearance-operations-warehouse .clearance-registration-fields{display:none!important}
#clearance-dialog.clearance-operations-warehouse #clearance-warehouse-result-field{grid-column:1;grid-row:2;display:flex;flex-direction:column;min-width:0;margin:0;padding:0;gap:6px;font-size:12px}
@media(max-width:560px){#clearance-dialog.clearance-operations-warehouse #clearance-warehouse-result-field{grid-row:3}}

#clearance-dialog.clearance-operations-warehouse #clearance-department-result-field,
#clearance-dialog.clearance-operations-warehouse .clearance-feedback-fields{display:none!important}

#clearance-panel .clearance-purchase-fit{table-layout:fixed;min-width:0;width:100%}
#clearance-panel .clearance-purchase-fit th,#clearance-panel .clearance-purchase-fit td{min-width:0;max-width:none;white-space:normal;overflow-wrap:anywhere;padding-left:10px;padding-right:10px}
#clearance-panel .clearance-purchase-fit .clearance-platform-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px;min-width:0}
#clearance-panel .clearance-purchase-fit .clearance-row-actions{white-space:normal}
#clearance-panel .clearance-purchase-fit th:nth-child(1){width:8%}
#clearance-panel .clearance-purchase-fit th:nth-child(2){width:12%}
#clearance-panel .clearance-purchase-fit th:nth-child(3){width:8%}
#clearance-panel .clearance-purchase-fit th:nth-child(4){width:27%}
#clearance-panel .clearance-purchase-fit th:nth-child(5){width:7%}
#clearance-panel .clearance-purchase-fit th:nth-child(6){width:7%}
#clearance-panel .clearance-purchase-fit th:nth-child(7){width:23%}
#clearance-panel .clearance-purchase-fit th:nth-child(8){width:8%}

/* Business dialogs share the same compact product row in every stage. */
@media(min-width:701px){
#clearance-dialog.clearance-business .clearance-main-field{grid-template-columns:minmax(0,1fr) minmax(0,1.333fr) minmax(0,.544fr) minmax(0,.544fr) minmax(0,.75fr) minmax(0,.5fr) minmax(0,.6fr) minmax(0,.816fr)}
#clearance-dialog.clearance-business .clearance-main-secondary{display:contents}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-sku"]){grid-column:1;grid-row:1}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-sku-name"]){grid-column:2;grid-row:1}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-total-quantity"]){grid-column:3;grid-row:1}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-sales30"]){grid-column:4;grid-row:1}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-location"]){grid-column:5;grid-row:1}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-price"]){grid-column:6;grid-row:1}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-total-price"]){grid-column:7;grid-row:1}
#clearance-dialog.clearance-business .clearance-main-secondary .clearance-date-field{grid-column:8;grid-row:1}
#clearance-dialog.clearance-business .clearance-main-field label{white-space:nowrap}
#clearance-dialog.clearance-business .clearance-main-field input{padding-left:4px;padding-right:4px;min-width:0}
#clearance-dialog.clearance-business .clearance-main-field input[type=number]::-webkit-inner-spin-button{appearance:none;margin:0}
}

#clearance-dialog.clearance-business .clearance-registration-fields{grid-template-columns:repeat(3,minmax(0,calc((100% - 28px) * 2 / 9)));border-bottom:0;padding-bottom:0;margin-bottom:0}
#clearance-dialog.clearance-business .clearance-registration-set{border-bottom:0;padding-bottom:0}
#clearance-dialog.clearance-business .clearance-history{border-top:0;margin-top:12px;padding-top:0}
#clearance-dialog.clearance-business .clearance-main-secondary .clearance-reason-field{width:calc((100% - 42px) * 5.5 / 9 * 2 / 3)}

@media(min-width:701px){
#clearance-dialog.clearance-business .clearance-main-field{column-gap:10px;grid-template-columns:minmax(0,.95fr) minmax(0,1.25fr) minmax(0,calc((100% - 80px) * .6375 / 7.11)) minmax(0,.58fr) minmax(0,.58fr) minmax(0,.8fr) minmax(0,.55fr) minmax(0,.6fr) minmax(0,.95fr)}
#clearance-dialog.clearance-business .clearance-main-field .clearance-main-category{grid-column:3;grid-row:1}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-total-quantity"]){grid-column:4}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-sales30"]){grid-column:5}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-location"]){grid-column:6}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-price"]){grid-column:7}
#clearance-dialog.clearance-business .clearance-main-field label:has([data-clearance-field="clearance-main-total-price"]){grid-column:8}
#clearance-dialog.clearance-business .clearance-main-secondary .clearance-date-field{grid-column:9}
}

#clearance-dialog.clearance-business .clearance-registration-fields:has(.clearance-clear-inventory){grid-template-columns:100px 120px repeat(2,minmax(0,calc((100% - 28px) / 9)));align-items:start}
#clearance-dialog.clearance-business .clearance-customer-field[hidden]{display:none!important}
#clearance-dialog.clearance-business .clearance-registration-fields:has(.clearance-clear-inventory) .clearance-customer-start{grid-column:auto}
#clearance-dialog.clearance-business .clearance-registration-fields:has(.clearance-clear-inventory)>label>span{white-space:nowrap}

#clearance-dialog .clearance-clear-inventory{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:12px;color:#486575}
#clearance-dialog .clearance-clear-inventory select[hidden]{display:none!important}
#clearance-dialog .clearance-select-trigger{height:32px;width:100%;padding:5px 28px 5px 10px;border:1px solid #cddfdf;border-radius:7px;background:#f8fbfb;color:var(--ink);font:inherit;text-align:left;cursor:pointer;position:relative;transition:border-color .15s,box-shadow .15s}
#clearance-dialog .clearance-select-trigger::after{content:"";position:absolute;right:12px;top:12px;width:5px;height:5px;border-right:1.5px solid #5f7c83;border-bottom:1.5px solid #5f7c83;transform:rotate(45deg)}
#clearance-dialog .clearance-select-trigger:hover:not(:disabled){border-color:#76b8b1}
#clearance-dialog .clearance-select-trigger:focus-visible,#clearance-dialog .clearance-select-trigger[aria-expanded=true]{outline:none;border-color:#10877e;box-shadow:0 0 0 2px #10877e20}
#clearance-dialog .clearance-select-trigger:disabled{cursor:default;background:#f5f8fa;color:#607985}
#clearance-dialog .clearance-select-menu{position:fixed;inset:auto;margin:0;box-sizing:border-box;padding:4px;border:1px solid #dce8e6;border-radius:9px;background:#fff;box-shadow:0 6px 20px #173b4720;color:var(--ink)}
#clearance-dialog .clearance-select-menu::backdrop{background:transparent}
#clearance-dialog .clearance-select-menu [role=option]{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:32px;padding:6px 10px;border:0;border-radius:5px;background:#fff;color:var(--ink);font:inherit;font-size:12px;text-align:left;cursor:pointer}
#clearance-dialog .clearance-select-menu [role=option] span{visibility:hidden;color:#10877e}
#clearance-dialog .clearance-select-menu [aria-selected=true]{background:#e6f4ef;color:#10877e}
#clearance-dialog .clearance-select-menu [aria-selected=true] span{visibility:visible}
#clearance-dialog .clearance-select-menu [role=option]:hover,#clearance-dialog .clearance-select-menu [role=option]:focus-visible{outline:none;background:#edf6f3;color:#10877e}

#clearance-dialog.clearance-business-purchase .clearance-purchase-decisions{display:flex;gap:14px;grid-column:1/-1;grid-row:2;align-items:start}
#clearance-dialog.clearance-business-purchase .clearance-reason-row{display:grid;grid-column:1/-1;grid-row:3;grid-template-columns:repeat(2,minmax(0,calc((100% - 42px) * 5.5 / 9 * 2 / 3)));gap:14px;align-items:start}
#clearance-dialog.clearance-business-purchase .clearance-main-secondary .clearance-reason-field{grid-column:1;grid-row:1;width:100%}
#clearance-dialog.clearance-business-purchase #clearance-manufacturer-reply-field{grid-column:2;grid-row:1;display:flex;flex-direction:column;min-width:0;margin:0;padding:0;gap:6px;font-size:12px}
#clearance-dialog.clearance-business-purchase #clearance-manufacturer-reply{height:70px;min-height:70px;max-height:70px;line-height:20px;resize:none;overflow:auto}
@media(max-width:700px){#clearance-dialog.clearance-business-purchase .clearance-purchase-decisions{grid-row:auto}#clearance-dialog.clearance-business-purchase .clearance-reason-row{grid-row:auto;grid-template-columns:repeat(2,minmax(0,1fr))}}

#clearance-dialog .clearance-purchase-decisions>.clearance-clear-inventory{width:100px}
#clearance-dialog .clearance-product-return{display:flex;flex-direction:column;gap:5px;width:110px;font-size:12px;color:#486575}
#clearance-dialog .clearance-product-return select[hidden]{display:none!important}
