.lbl-editor {
    --lbl-accent: var(--rz-primary, #1976d2);
    --lbl-accent-soft: color-mix(in srgb, var(--lbl-accent) 10%, #fff);
    --lbl-accent-ring: color-mix(in srgb, var(--lbl-accent) 22%, transparent);
    --lbl-bg: #f3f4f8;
    --lbl-bg-2: #e9ebf1;
    --lbl-panel: #fff;
    --lbl-border: #e6e8ef;
    --lbl-text: #1b1f27;
    --lbl-muted: #6f7686;
    --lbl-radius: 14px;
    --lbl-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
    display: flex; flex-direction: column; gap: 14px; width: 100%; color: var(--lbl-text); font-size: 13px;
    padding: 16px; background: var(--lbl-bg); border-radius: 18px; box-sizing: border-box;
}

.lbl-ico { display: inline-flex; width: 18px; height: 18px; flex: 0 0 18px; }
.lbl-ico svg { width: 100%; height: 100%; fill: currentColor; }
.lbl-c-text { --c: #2f6fed; }
.lbl-c-field { --c: #7c4dff; }
.lbl-c-qr { --c: #12a150; }
.lbl-c-barcode { --c: #ef7d12; }
.lbl-c-line { --c: #5b6577; }
.lbl-c-box { --c: #0e9aa7; }
.lbl-c-label { --c: #d6336c; }

/* toolbar */
.lbl-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; background: var(--lbl-panel); border-radius: var(--lbl-radius); box-shadow: var(--lbl-shadow); }
.lbl-toolbar > .lbl-btn-icon { border: 0; background: var(--lbl-bg); border-radius: 9px; color: var(--lbl-text); }
.lbl-toolbar > .lbl-btn-icon:hover { background: var(--lbl-bg-2); }
.lbl-sep { width: 1px; height: 22px; background: var(--lbl-border); margin: 0 6px; }
.lbl-size { color: var(--lbl-muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.lbl-zoom { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--lbl-muted); }
.lbl-zoom .lbl-btn-icon { width: 30px; height: 30px; border: 0; background: transparent; font-size: 17px; }
.lbl-zoom .lbl-btn-icon:hover { background: var(--lbl-bg); }
.lbl-zoom-value { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; color: var(--lbl-text); font-weight: 500; }

/* breadcrumbs */
.lbl-crumbs { display: inline-flex; align-items: center; gap: 6px; }
.lbl-crumbs:empty { display: none; }
.lbl-crumb { height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 500; color: var(--lbl-muted); cursor: pointer; }
.lbl-crumb:hover { background: var(--lbl-bg); color: var(--lbl-text); }
.lbl-crumb-on { color: var(--lbl-text); font-weight: 600; cursor: default; }
.lbl-crumb-sep { color: var(--lbl-muted); }
.lbl-crumbs .lbl-btn { margin-left: 6px; height: 30px; }

/* buttons */
.lbl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--lbl-border); background: #fff; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 500; color: var(--lbl-text); line-height: 1; transition: background .12s, border-color .12s, box-shadow .12s, transform .08s; }
.lbl-btn:hover { background: #f7f8fb; border-color: #d5d9e3; }
.lbl-btn:active { transform: translateY(1px); }
.lbl-btn:disabled { opacity: .4; cursor: default; background: #fff; transform: none; }
.lbl-btn-icon { width: 34px; padding: 0; font-size: 16px; }
.lbl-btn-danger { color: #c62828; }
.lbl-btn-danger:hover { background: #fdeeee; border-color: #f2b8b8; }
.lbl-btn-wide { width: 100%; }
.lbl-btn-primary, .lbl-btn-primary:hover { background: var(--lbl-accent); border-color: var(--lbl-accent); color: #fff; }
.lbl-hint { color: var(--lbl-muted); font-size: 12px; line-height: 1.5; }

/* layout */
.lbl-body { display: flex; gap: 14px; align-items: stretch; min-height: 440px; }
.lbl-panel { background: var(--lbl-panel); border-radius: var(--lbl-radius); box-shadow: var(--lbl-shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.lbl-panel-title { font-weight: 600; font-size: 13.5px; }
.lbl-panel-head { display: flex; align-items: center; justify-content: space-between; }
.lbl-count { background: var(--lbl-accent-soft); color: var(--lbl-accent); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 600; }

.lbl-side { width: 252px; flex: 0 0 252px; display: flex; flex-direction: column; gap: 14px; max-height: 74vh; }
.lbl-layers { flex: 1 1 auto; min-height: 0; }

/* palette */
.lbl-palette-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.lbl-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 4px 9px; border: 1px solid transparent; border-radius: 12px; background: var(--lbl-bg); cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 500; color: var(--lbl-muted); transition: background .12s, border-color .12s, color .12s, transform .08s, box-shadow .12s; }
.lbl-tile .lbl-ico { width: 34px; height: 34px; flex-basis: 34px; padding: 8px; box-sizing: border-box; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.lbl-tile:hover { background: #fff; color: var(--lbl-text); border-color: var(--lbl-border); transform: translateY(-1px); box-shadow: var(--lbl-shadow); }
.lbl-tile:hover .lbl-ico { background: color-mix(in srgb, var(--c) 18%, #fff); color: var(--c); }
.lbl-tile:active { transform: none; }
.lbl-tile:disabled { opacity: .45; cursor: default; transform: none; }

/* label sizes palette (sheet mode) */
.lbl-sizes { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.lbl-size-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border: 1px dashed transparent; border-radius: 9px; background: var(--lbl-bg); cursor: grab; font: inherit; text-align: left; color: var(--lbl-text); }
.lbl-size-item:hover { border-color: var(--lbl-accent); background: var(--lbl-accent-soft); }
.lbl-size-item:active { cursor: grabbing; }
.lbl-size-item .lbl-ico { width: 24px; height: 24px; flex-basis: 24px; padding: 4px; box-sizing: border-box; border-radius: 7px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.lbl-source { display: flex; flex-direction: column; gap: 5px; }
.lbl-source-row { display: flex; gap: 6px; }
.lbl-source-row .lbl-input { flex: 1; min-width: 0; }
.lbl-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -50%); border: 2px dashed var(--lbl-accent); background: color-mix(in srgb, var(--lbl-accent) 10%, #fff); border-radius: 2px; }

/* layers */
.lbl-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 36px; border: 1px solid transparent; border-radius: 10px; background: var(--lbl-bg); color: var(--lbl-muted); transition: border-color .12s, background .12s, box-shadow .12s; }
.lbl-search:focus-within { border-color: var(--lbl-accent); background: #fff; box-shadow: 0 0 0 3px var(--lbl-accent-ring); }
.lbl-search .lbl-ico { width: 16px; height: 16px; flex-basis: 16px; }
.lbl-search-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; color: var(--lbl-text); }
.lbl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lbl-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px solid transparent; border-radius: 999px; background: var(--lbl-bg); cursor: pointer; font: inherit; font-size: 12px; font-weight: 500; color: var(--lbl-muted); transition: background .12s, color .12s; }
.lbl-chip:hover { background: var(--lbl-bg-2); color: var(--lbl-text); }
.lbl-chip-on, .lbl-chip-on:hover { background: var(--lbl-accent); color: #fff; }
.lbl-chip-n { font-size: 11px; opacity: .65; font-weight: 600; }
.lbl-layer-list { display: flex; flex-direction: column; gap: 2px; overflow: auto; min-height: 0; margin: 0 -8px; padding: 0 8px; }
.lbl-group { display: flex; align-items: center; gap: 6px; padding: 12px 8px 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--lbl-muted); }
.lbl-group:first-child { padding-top: 2px; }
.lbl-group .lbl-ico { width: 13px; height: 13px; flex-basis: 13px; color: var(--c); }
.lbl-group-n { margin-left: auto; font-weight: 500; }
.lbl-layer { position: relative; display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font: inherit; text-align: left; color: var(--lbl-text); transition: background .1s; }
.lbl-layer .lbl-ico { width: 24px; height: 24px; flex-basis: 24px; padding: 4px; box-sizing: border-box; border-radius: 7px; background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--c); }
.lbl-layer:hover { background: var(--lbl-bg); }
.lbl-layer-on, .lbl-layer-on:hover { background: var(--lbl-accent-soft); color: var(--lbl-accent); font-weight: 600; }
.lbl-layer-on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--lbl-accent); }
.lbl-layer-on .lbl-ico { background: var(--c); color: #fff; }
.lbl-layer-text { display: flex; flex-direction: column; min-width: 0; }
.lbl-layer-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-layer-sub { font-size: 11px; font-weight: 400; color: var(--lbl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-empty { padding: 20px 8px; text-align: center; color: var(--lbl-muted); font-size: 12px; }

/* canvas */
.lbl-canvas-wrap { overflow: auto; max-height: 74vh; min-height: 440px; padding: 28px; border-radius: var(--lbl-radius); flex: 1 1 auto; display: flex;
    background-color: var(--lbl-bg-2); background-image: radial-gradient(#cfd3dd 1px, transparent 1px); background-size: 18px 18px; box-shadow: inset 0 1px 3px rgba(16,24,40,.06); }
.lbl-canvas { flex: 0 0 auto; margin: auto; position: relative; background: #fff; box-shadow: 0 0 0 1px #999; outline: none;
    background-image: linear-gradient(to right, #f0f0f0 1px, transparent 1px), linear-gradient(to bottom, #f0f0f0 1px, transparent 1px); }
.lbl-canvas-page { background-image: none; box-shadow: 0 0 0 1px #999, 0 10px 30px rgba(16,24,40,.12); }
.lbl-el { position: absolute; box-sizing: border-box; cursor: move; user-select: none; overflow: hidden; outline: 1px dashed #9aa; }
.lbl-el-label { outline: 1px solid #c9ced8; background: #fff; }
.lbl-el-label:hover { outline-color: #1976d2; }
.lbl-label-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.lbl-label-inner .lbl-el { outline: none; cursor: default; pointer-events: none; }
.lbl-el:hover { outline-color: #1976d2; }
.lbl-selected { outline: 2px solid #1976d2 !important; z-index: 2; }
.lbl-text { font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif; line-height: 1.0; white-space: pre-wrap; word-break: break-word; width: 100%; height: auto; max-height: 100%; color: #000; }
.lbl-inverse { background: #000; }
.lbl-inverse .lbl-text { color: #fff; }
.lbl-qr { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; white-space: pre; font-size: 11px;
    background: repeating-linear-gradient(45deg, #ddd 0 4px, #fff 4px 8px); color: #333; }
.lbl-barcode { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; font-size: 11px; color: #333;
    background: repeating-linear-gradient(90deg, #333 0 2px, #fff 2px 5px, #333 5px 6px, #fff 6px 10px); background-size: 100% 70%; background-repeat: no-repeat; }
.lbl-hollow { pointer-events: none; overflow: visible; }
.lbl-edge { position: absolute; pointer-events: auto; cursor: move; }
.lbl-edge-top { left: 0; right: 0; }
.lbl-edge-bottom { left: 0; right: 0; }
.lbl-edge-left { top: 0; bottom: 0; }
.lbl-edge-right { top: 0; bottom: 0; }
.lbl-hollow .lbl-handle { pointer-events: auto; }
.lbl-handle { display: none; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: #1976d2; cursor: nwse-resize; }
.lbl-el:hover .lbl-handle, .lbl-selected .lbl-handle { display: block; }
.lbl-marquee { position: absolute; border: 1px dashed #1976d2; background: rgba(25, 118, 210, .08); pointer-events: none; z-index: 3; }
.lbl-guide { position: absolute; background: #e91e63; pointer-events: none; z-index: 4; }
.lbl-guide-v { width: 1px; top: 0; bottom: 0; }
.lbl-guide-h { height: 1px; left: 0; right: 0; }

/* properties */
.lbl-props { width: 316px; flex: 0 0 316px; max-height: 74vh; overflow: auto; gap: 18px; }
.lbl-props-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lbl-props-lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lbl-props-ico { width: 36px; height: 36px; flex-basis: 36px; padding: 8px; box-sizing: border-box; border-radius: 10px; background: var(--c); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--c) 30%, transparent); }
.lbl-props-heading { min-width: 0; }
.lbl-props-title { font-weight: 600; font-size: 15px; }
.lbl-props-sub { color: var(--lbl-muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-props-head .lbl-btn-icon { width: 30px; height: 30px; border: 0; background: var(--lbl-bg); border-radius: 999px; color: var(--lbl-muted); }
.lbl-props-head .lbl-btn-icon:hover { background: var(--lbl-bg-2); color: var(--lbl-text); }
.lbl-props-empty { display: flex; flex-direction: column; gap: 14px; }
.lbl-keys { display: flex; flex-direction: column; gap: 7px; padding: 14px; background: var(--lbl-bg); border-radius: 12px; }
.lbl-key { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; font-size: 12px; color: var(--lbl-muted); }
.lbl-key kbd { font: inherit; font-size: 11px; font-weight: 500; color: var(--lbl-text); background: #fff; border: 1px solid var(--lbl-border); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; white-space: nowrap; justify-self: start; }
.lbl-section { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--lbl-border); }
.lbl-section-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--lbl-muted); }
.lbl-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lbl-field-label { font-size: 12px; color: var(--lbl-muted); }
.lbl-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lbl-input { width: 100%; box-sizing: border-box; height: 36px; border: 1px solid transparent; border-radius: 10px; padding: 0 11px; font: inherit; color: var(--lbl-text); background: var(--lbl-bg); transition: border-color .12s, background .12s, box-shadow .12s; }
select.lbl-input { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236f7686'><path d='M7.4 9.6 12 14.2l4.6-4.6L18 11l-6 6-6-6z'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; background-size: 18px; }
textarea.lbl-input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.4; }
.lbl-input:hover { background: var(--lbl-bg-2); }
.lbl-input:focus { outline: none; border-color: var(--lbl-accent); background: #fff; box-shadow: 0 0 0 3px var(--lbl-accent-ring); }
.lbl-input:disabled { opacity: .6; }
.lbl-seg { display: inline-flex; width: 100%; padding: 3px; border-radius: 10px; background: var(--lbl-bg); gap: 2px; }
.lbl-seg-btn { flex: 1; height: 30px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font: inherit; font-size: 12px; font-weight: 500; color: var(--lbl-muted); transition: background .12s, color .12s, box-shadow .12s; }
.lbl-seg-btn:hover { color: var(--lbl-text); }
.lbl-seg-on, .lbl-seg-on:hover { background: #fff; color: var(--lbl-text); box-shadow: 0 1px 2px rgba(16,24,40,.1), 0 0 0 1px rgba(16,24,40,.04); }
.lbl-toggle { display: flex; align-items: center; gap: 9px; height: 36px; cursor: pointer; }
.lbl-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--lbl-accent); }
.lbl-actions { display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--lbl-border); margin-top: auto; }
.lbl-actions .lbl-btn { flex: 1; }

.lbl-preview { max-width: 100%; border: 1px solid #999; background: #fff; }
