.label-template-field{display:flex;flex-direction:column;gap:7px;min-width:0}.label-template-field-row{display:flex;align-items:stretch;gap:6px;min-width:0}.label-template-field-row>input{min-width:0;flex:1;width:0!important}.label-template-trigger{flex-shrink:0;border:1px solid #c9d7e7;border-radius:7px;background:#eef4fc;color:#27558b;font:inherit;font-size:11px;padding:6px 8px;cursor:pointer}.label-template-selected .label-image-card{margin:0;width:140px}.label-template-selected .label-image-media{height:84px}.label-template-unlink{align-self:flex-start;border:0;background:none;padding:0;color:#687c96;font:inherit;font-size:11px;cursor:pointer}.label-template-field [hidden]{display:none!important}.label-history-strip{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;margin-top:8px}.label-history-strip .label-image-card{margin:0}
.label-template-dialog{width:min(850px,calc(100vw - 28px));max-width:calc(100vw - 28px);max-height:90dvh;border:1px solid #cfdbea;border-radius:13px;padding:0;color:#253e5e;background:#fff}.label-template-dialog[open]{display:flex;flex-direction:column}.label-template-dialog::backdrop{background:#15294299;backdrop-filter:blur(2px)}.label-template-header{display:flex;justify-content:space-between;gap:15px;padding:21px 24px 14px;border-bottom:1px solid #e5ebf3;flex-shrink:0}.label-template-header span{color:#64809e;font-size:12px}.label-template-header h2{font-size:20px;margin:4px 0}.label-template-header p{color:#6b7c92;font-size:12px;margin:6px 0 0}.label-template-header>button{height:34px;width:34px;border:1px solid #dbe3ee;border-radius:7px;background:#fff;color:#607491;font-size:24px;cursor:pointer}.label-template-body{padding:18px 24px;overflow:auto;min-height:0}.label-template-upload{border:1px solid #cbdcf1;border-radius:9px;background:#f5f9fe;margin-bottom:17px}.label-template-upload summary{padding:12px 14px;font-size:13px;font-weight:600;cursor:pointer;color:#29598e}.label-template-upload>div{padding:0 14px 14px}.label-template-upload label{display:flex;flex-direction:column;gap:6px;font-size:12px;margin:10px 0;color:#405978}.label-template-upload input,.label-template-search input{font:inherit;font-size:13px;box-sizing:border-box;width:100%;padding:10px;border:1px solid #ced9e7;border-radius:7px;background:#fff;color:#203d60}.label-template-upload p{font-size:11px;color:#64778e;line-height:1.6;margin:8px 0}.label-template-upload-preview{display:flex;align-items:center;gap:10px;min-width:0}.label-template-upload-preview img{max-width:220px;max-height:140px;object-fit:contain;border:1px solid #d2dce9;border-radius:6px;background:white}.label-template-upload-preview span{font-size:11px;overflow-wrap:anywhere;color:#607690}.label-template-upload-actions{display:flex;gap:8px;margin-top:12px}.label-template-upload-actions button,.label-template-search button,.label-template-card-actions button{border:1px solid #cbd8e8;background:#fff;color:#28578d;font:inherit;font-size:12px;border-radius:6px;padding:8px 10px;cursor:pointer}.label-template-upload-actions button:first-child,.label-template-card-actions button:first-child{background:#2862a1;color:#fff;border-color:#2862a1}.label-template-dialog button:disabled{opacity:.5;cursor:not-allowed}.label-template-search{display:flex;gap:9px;align-items:center}.label-template-search input{flex:1;min-width:0}.label-template-search button{white-space:nowrap}.label-template-count{color:#607791;font-size:12px;margin:12px 0}.label-template-feedback{font-size:12px;color:#28745d;line-height:1.6;margin:8px 0}.label-template-feedback:empty{display:none}.label-template-feedback.is-error{color:#b5423c;background:#fff3f1;padding:8px 10px;border-radius:6px}.label-template-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:12px}.label-template-card{padding:11px;border:1px solid #dce5ef;border-radius:9px;min-width:0;background:#fff}.label-template-card .label-image-card{width:100%;margin:0}.label-template-card .label-image-media{height:125px}.label-template-card-actions{display:flex;gap:7px;justify-content:space-between;margin-top:9px}.label-template-card-actions button{padding:6px 9px;font-size:11px}.label-template-card-actions button:last-child{color:#8b6060}.label-template-empty{grid-column:1/-1;border:1px dashed #cedbe9;border-radius:8px;padding:22px;text-align:center;font-size:12px;color:#7a8ca2}.label-template-legacy{margin-top:16px}.label-template-legacy h3{font-size:13px;margin-bottom:6px}.label-template-legacy>p{font-size:11px;color:#77879b}.label-template-text-row{display:flex;gap:8px;border-bottom:1px solid #edf1f5;padding:7px 0}.label-template-text-row button{border:0;background:none;font:inherit;font-size:12px;padding:5px;color:#365e8d;text-align:left;cursor:pointer}.label-template-text-row button:first-child{flex:1;overflow-wrap:anywhere}.label-template-text-row button:last-child{flex-shrink:0;color:#8b6060}.label-template-footer{padding:12px 24px;border-top:1px solid #e3eaf2;font-size:11px;line-height:1.6;color:#6c8099;flex-shrink:0}@media(max-width:600px){.label-template-header{padding:16px}.label-template-body{padding:14px}.label-template-footer{padding:12px 14px}.label-template-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.label-template-card{padding:8px}.label-template-card .label-image-media{height:100px}.label-template-trigger{font-size:10px;padding:6px}.label-template-upload-preview{flex-direction:column;align-items:flex-start}}

/* Brand the library controls while preserving every uploaded label's true colors. */
.label-template-trigger{border-color:var(--brand-border);background:var(--brand-soft);color:var(--brand)}
.label-template-dialog{border-color:var(--brand-border);color:var(--brand-deep)}
.label-template-dialog::backdrop{background:#0f2a1a99}
.label-template-header,.label-template-header>button,.label-template-upload,
.label-template-upload input,.label-template-search input,
.label-template-upload-preview img,.label-template-card,.label-template-empty,
.label-template-text-row,.label-template-footer{border-color:var(--brand-border)}
.label-template-upload{background:var(--brand-soft)}
.label-template-upload summary,.label-template-text-row button{color:var(--brand)}
.label-template-upload label,.label-template-upload input,.label-template-search input{color:var(--brand-deep)}
.label-template-upload-actions button,.label-template-search button,
.label-template-card-actions button{border-color:var(--brand-border);color:var(--brand)}
.label-template-upload-actions button:first-child,.label-template-card-actions button:first-child{background:var(--brand);border-color:var(--brand);color:#fff}
.label-template-card-actions button:last-child,.label-template-text-row button:last-child{color:#8b6060}
.label-template-unlink,.label-template-header span,.label-template-header p,
.label-template-header>button,.label-template-upload p,
.label-template-upload-preview span,.label-template-count,
.label-template-empty,.label-template-legacy>p,.label-template-footer{color:var(--muted)}
