/* Official label editor, with styles scoped to its independent dialog. */
.tev2-dialog {
    --tev2-border: var(--line, #e5e6ee);
    --tev2-muted: var(--ink-soft, #55586b);
    --tev2-accent: var(--primary, #6754e9);
    --tev2-accent-soft: var(--primary-soft, #eeebff);
    --tev2-danger: var(--danger, #c43a4b);
    --tev2-variable-badge: #cde5e8;
    --tev2-variable-badge-hover: #bddde1;
    width: min(1440px, calc(100vw - 32px));
    max-width: none;
    height: calc(100dvh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    inset: 0;
    overflow: hidden;
    color: var(--ink, #161724);
    background: var(--surface, #fff);
    border: 1px solid var(--tev2-border);
    border-radius: 16px;
    box-shadow: 0 28px 100px #17132f40;
    font-size: .82rem;
    line-height: 1.45;
}
.tev2-dialog::backdrop { background: #17152699; backdrop-filter: blur(4px); }
.tev2-dialog *, .tev2-dialog *::before, .tev2-dialog *::after { box-sizing: border-box; }
.tev2-dialog [hidden] { display: none !important; }
.tev2-dialog button, .tev2-dialog input, .tev2-dialog select, .tev2-dialog textarea { font: inherit; }
.tev2-dialog button { cursor: pointer; }
.tev2-dialog button:disabled { cursor: not-allowed; opacity: .48; }
.tev2-dialog :is(button, input, select, textarea, a):focus-visible {
    outline: 3px solid var(--tev2-accent);
    outline-offset: 3px;
}
.tev2-dialog .button {
    min-height: 36px;
    padding: .52rem .78rem;
    border-radius: 7px;
    font-size: .78rem;
    line-height: 1.15;
    font-weight: 650;
}
.tev2-dialog .button:not(:disabled):hover { transform: none; }
.tev2-dialog .icon-button { width: 36px; height: 36px; flex-shrink: 0; border-radius: 7px; }
.tev2-dialog svg:not(.tev2-paper-svg) { flex-shrink: 0; }
.tev2-shell { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100%; min-height: 0; }
.tev2-navigation { display: flex; align-items: center; min-width: 0; padding: .6rem 1.1rem; border-bottom: 1px solid var(--tev2-border); background: #fff; }
.tev2-history-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.tev2-history-actions .button { min-width: 34px; min-height: 31px; padding: .3rem .55rem; }
.tev2-tab-content { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; overflow: hidden; }
.tev2-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--tev2-border);
    background: #fff;
    z-index: 4;
}
.tev2-heading { flex-shrink: 0; min-width: 0; }
.tev2-heading h2 { margin: 0; font-size: 1rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.4; }
.tev2-name { display: flex; flex-direction: column; gap: .18rem; flex: 1; min-width: 140px; max-width: 420px; margin: 0 auto 0 0; color: var(--tev2-muted); font-size: .68rem; font-weight: 600; }
.tev2-name > span, .tev2-name > small { color: var(--tev2-muted); font-size: .68rem; font-weight: 600; }
.tev2-header-actions { display: flex; align-items: center; gap: .45rem; flex-shrink: 0; }
.tev2-dialog .tev2-delete-model { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid transparent; color: var(--tev2-danger); background: transparent; box-shadow: none; }
.tev2-dialog .tev2-delete-model:hover:not(:disabled) { background: #fff1f2; border-color: #f0d5da; }
.tev2-delete-model svg { width: 16px; height: 16px; }
.tev2-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 270px; min-height: 0; min-width: 0; overflow: hidden; }
.tev2-layout.is-paper { grid-template-columns: minmax(0, 1fr) 270px; }
.tev2-sidebar, .tev2-inspector { min-width: 0; min-height: 0; overflow: auto; background: #fff; scrollbar-width: thin; scrollbar-color: #c8c9d5 transparent; }
.tev2-sidebar { border-right: 1px solid var(--tev2-border); }
.tev2-sidebar-content { padding: 1rem .85rem; }
.tev2-sidebar-content > .tev2-field-group:first-child { margin-top: 0; }
.tev2-section h3, .tev2-inspector-content h3 { margin: 0 0 .6rem; font-size: .79rem; font-weight: 700; }
.tev2-section h3 small { margin-left: .25rem; color: var(--tev2-muted); font-size: .68rem; font-weight: 400; }
.tev2-field-group { margin-top: .85rem; }
.tev2-field-group h4 { margin: 0 0 .45rem; color: var(--tev2-muted); font-size: .7rem; font-weight: 600; }
.tev2-field-group-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .25rem .5rem; margin-bottom: .45rem; }
.tev2-field-group-heading h4 { margin: 0; }
.tev2-manage-fields { border: 0; padding: .2rem 0; background: none; color: #16656d; font-size: .67rem !important; text-decoration: underline; text-underline-offset: 3px; }
.tev2-insert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.tev2-insert {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .18rem;
    min-width: 0;
    min-height: 80px;
    padding: .65rem;
    color: var(--ink, #161724);
    background: #fff;
    border: 1px solid var(--tev2-border);
    border-radius: 9px;
    text-align: left;
    transition: border-color .15s, background .15s;
}
.tev2-insert:hover:not(:disabled) { border-color: #b0a5f5; background: #f8f6ff; }
.tev2-insert.is-placement-active { border-color: var(--tev2-accent); background: #eeeafd; box-shadow: 0 0 0 2px #6754e926; }
.tev2-insert > svg, .tev2-insert > .tev2-insert-icon { width: 19px; height: 19px; margin-bottom: .15rem; color: var(--tev2-accent); font-size: 1rem; }
.tev2-insert strong { font-size: .76rem; font-weight: 650; overflow-wrap: anywhere; }
.tev2-insert small { font-size: .64rem; line-height: 1.35; color: var(--tev2-muted); font-weight: 400; }
.tev2-insert-variable { color: #165d64; border-color: #bedade; background: #f1f9fa; }
.tev2-insert-variable > svg { color: #147780; }
.tev2-insert-variable small { color: #4c7075; }
.tev2-insert-variable:hover:not(:disabled) { border-color: #4e9da6; background: #e4f3f5; }
.tev2-insert-variable.is-placement-active { border-color: #147780; background: #dceff1; box-shadow: 0 0 0 2px #14778024; }
.tev2-create-field { display: flex; align-items: center; justify-content: center; gap: .35rem; width: 100%; min-height: 38px; margin-top: .5rem; padding: .45rem; border: 1px dashed #65a5ac; border-radius: 7px; color: #16656d; background: transparent; font-size: .72rem !important; font-weight: 600 !important; }
.tev2-create-field:hover { background: #f1f9fa; border-color: #147780; }
.tev2-create-field svg { width: 17px; height: 17px; }
.tev2-workspace { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: #f3f4f8; overflow: hidden; }
.tev2-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
    min-height: 58px;
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--tev2-border);
    background: #fafafd;
    z-index: 2;
}
.tev2-view-tabs { display: inline-flex; align-items: center; padding: 3px; gap: 2px; border: 1px solid #e0e1ea; border-radius: 8px; background: #f0f1f6; }
.tev2-view-tabs button { min-height: 29px; padding: .35rem .7rem; border: 0; border-radius: 5px; background: transparent; color: var(--tev2-muted); font-size: .73rem; font-weight: 600; white-space: nowrap; }
.tev2-view-tabs button:is([aria-pressed="true"], [aria-selected="true"]) { color: var(--ink, #161724); background: #fff; box-shadow: 0 1px 4px #17132f16; }
.tev2-zoom { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.tev2-zoom label { display: inline-flex; align-items: center; gap: .35rem; color: var(--tev2-muted); font-size: .68rem; white-space: nowrap; }
.tev2-zoom select { display: inline-block; width: auto; min-width: 72px; min-height: 29px; margin: 0; padding: .25rem .3rem; border: 1px solid #dddfe9; border-radius: 5px; background: #fff; color: var(--tev2-muted); font-size: .71rem; font-weight: 400; }
.tev2-zoom output, .tev2-zoom > span { display: inline-block; min-width: 37px; color: var(--tev2-muted); font-size: .67rem; text-align: center; font-variant-numeric: tabular-nums; }
.tev2-viewport {
    display: grid;
    align-items: center;
    justify-items: center;
    min-width: 0;
    min-height: 0;
    padding: 32px;
    overflow: auto;
    background-color: #f1f2f7;
    scrollbar-width: thin;
    scrollbar-color: #c2c5d0 transparent;
}
.tev2-artboard {
    position: relative;
    flex-shrink: 0;
    margin: auto;
    background: #fff;
    box-shadow: 0 3px 6px #1917310b, 0 12px 28px #1917311a;
    outline: 1px solid #c9ccd8;
    touch-action: none;
    isolation: isolate;
}
.tev2-artboard.is-paper { background: transparent; outline: none; box-shadow: none; }
.tev2-artboard.is-placing, .tev2-artboard.is-placing .tev2-overlay, .tev2-artboard.is-placing .tev2-object { cursor: crosshair; }
.tev2-artboard.is-placing .tev2-object { pointer-events: none; }
.tev2-preview-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: fill; pointer-events: none; user-select: none; }
.tev2-overlay { position: absolute; inset: 0; }
.tev2-placement-box { position: absolute; z-index: 5; min-width: 1px; min-height: 1px; border: 1px solid var(--tev2-accent); background: #6754e926; box-shadow: 0 0 0 1px #fff8 inset; pointer-events: none; }
.tev2-placement-box.is-empty { visibility: hidden; }
.tev2-placement-box.is-invalid { border-color: var(--tev2-danger); background: #c43a4b2b; }
.tev2-placement-size { position: absolute; left: 50%; bottom: calc(100% + 5px); translate: -50% 0; width: max-content; max-width: 180px; padding: 2px 5px; border-radius: 4px; color: #fff; background: #41358f; box-shadow: 0 1px 4px #17132f2b; font-size: .65rem; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tev2-placement-box.is-invalid .tev2-placement-size { background: var(--tev2-danger); }
.tev2-object {
    position: absolute;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px dashed #8f97b1;
    border-radius: 0;
    background: transparent;
    color: #626c82;
    cursor: move;
    touch-action: none;
    user-select: none;
}
.tev2-object:hover { border-color: var(--tev2-accent); background: #6754e909; }
.tev2-object.is-selected { z-index: 2; border: 1px solid var(--tev2-accent); box-shadow: 0 0 0 1px var(--tev2-accent); background: #6754e908; }
.tev2-object-content { position: absolute; inset: 0; overflow: hidden; pointer-events: none; container-type: size; }
.tev2-variable-badge-label { display: block; box-sizing: border-box; flex: 0 1 auto; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; padding: min(1px, 25cqh) min(2px, 25cqw); border-radius: 4px; color: var(--ink, #161724); background: var(--tev2-variable-badge); line-height: 1.1; overflow: hidden; }
.tev2-object:hover .tev2-variable-badge-label { background: var(--tev2-variable-badge-hover); }
.tev2-object.is-selected .tev2-variable-badge-label { background: var(--tev2-variable-badge); }
.tev2-object.is-pointer-focused:focus-visible { outline: none; }
.tev2-object.is-invalid { border-color: var(--tev2-danger); background: #c43a4b0d; }
.tev2-object.is-invalid.is-selected { box-shadow: 0 0 0 1px var(--tev2-danger); }
.tev2-object-placeholder { display: block; box-sizing: border-box; width: 100%; height: 100%; min-width: 0; padding: min(2px, 25cqh) min(2px, 25cqw); overflow: hidden; pointer-events: none; font-family: Helvetica, Arial, sans-serif; font-size: inherit; font-weight: 400; line-height: 1.1; overflow-wrap: anywhere; }
.tev2-object.is-variable .tev2-object-placeholder { display: flex; align-items: flex-start; justify-content: flex-start; min-height: 0; }
.tev2-object.is-variable[data-tev2-align="center"] .tev2-object-placeholder { justify-content: center; }
.tev2-object.is-variable[data-tev2-align="right"] .tev2-object-placeholder { justify-content: flex-end; }
.tev2-artboard.has-preview .tev2-object-placeholder { visibility: hidden; }
.tev2-resize-handle {
    position: absolute;
    z-index: 3;
    width: 10px;
    height: 10px;
    padding: 0;
    border: 1px solid var(--tev2-accent);
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 1px 3px #24203b20;
    touch-action: none;
}
.tev2-resize-handle::before { content: ""; position: absolute; inset: -7px; }
.tev2-resize-handle[data-tev2-handle="nw"] { top: -5px; left: -5px; cursor: nwse-resize; }
.tev2-resize-handle[data-tev2-handle="ne"] { top: -5px; right: -5px; cursor: nesw-resize; }
.tev2-resize-handle[data-tev2-handle="sw"] { bottom: -5px; left: -5px; cursor: nesw-resize; }
.tev2-resize-handle[data-tev2-handle="se"] { bottom: -5px; right: -5px; cursor: nwse-resize; }
.tev2-paper-svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: none; stroke-width: 0; }
.tev2-canvas-caption { margin: 0; padding: .65rem .9rem; background: #fafafd; border-top: 1px solid var(--tev2-border); color: var(--tev2-muted); font-size: .68rem; line-height: 1.5; text-align: center; }
.tev2-canvas-caption.is-error { background: #fff4f6; color: #a03243; }
.tev2-inspector { border-left: 1px solid var(--tev2-border); }
.tev2-sidebar-header, .tev2-inspector-tabs { position: sticky; top: 0; z-index: 3; display: flex; align-items: stretch; min-height: 58px; padding: 0 .5rem; border-bottom: 1px solid var(--tev2-border); background: #fff; }
.tev2-sidebar-header h3, .tev2-inspector-tabs button { flex: 1; min-width: 0; padding: .7rem .3rem; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--tev2-muted); font-size: .74rem; font-weight: 600; }
.tev2-sidebar-header h3 { display: flex; align-items: center; justify-content: center; margin: 0; border-bottom-color: var(--tev2-accent); color: var(--primary-dark, #5140cc); text-align: center; }
.tev2-inspector-tabs button:hover:not(:disabled) { background: #faf9ff; color: var(--primary-dark, #5140cc); }
.tev2-inspector-tabs button[aria-selected="true"] { border-bottom-color: var(--tev2-accent); color: var(--primary-dark, #5140cc); }
.tev2-inspector-content { padding: .95rem .9rem 1.1rem; }
.tev2-inspector-content > .tev2-field { margin-bottom: .75rem; }
.tev2-inspector-content > h3:not(:first-child) { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--tev2-border); }
.tev2-inspector-content > .tev2-fields + .tev2-field { margin-top: .8rem; }
.tev2-inspector-content > .tev2-help + .tev2-fields { margin-top: .75rem; }
.tev2-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .55rem; }
.tev2-fields + .tev2-fields { margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--tev2-border); }
.tev2-field { display: flex; flex-direction: column; gap: .28rem; min-width: 0; margin: 0; }
.tev2-field-readonly dt { color: var(--tev2-muted); font-size: .69rem; font-weight: 600; }
.tev2-field-readonly dd { margin: 0; padding: .5rem .6rem; border-radius: 6px; background: #f4f5f9; color: var(--ink, #161724); font-size: .78rem; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.tev2-field > span, .tev2-field > small, .tev2-field > label, label.tev2-field { color: var(--tev2-muted); font-size: .69rem; font-weight: 600; }
.tev2-fields .span-2, .tev2-fields > h3, .tev2-fields > .tev2-help { grid-column: 1 / -1; }
.tev2-dialog :is(.tev2-field, .tev2-name) :is(input:not([type="checkbox"]):not([type="file"]), select, textarea) {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 35px;
    margin: 0;
    padding: .44rem .55rem;
    border: 1px solid #d9dbe6;
    border-radius: 6px;
    background: #fff;
    color: var(--ink, #161724);
    font-size: .78rem;
    font-weight: 400;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}
.tev2-dialog :is(.tev2-field, .tev2-name) input:focus, .tev2-dialog .tev2-field select:focus, .tev2-dialog .tev2-field textarea:focus { border-color: var(--tev2-accent); }
.tev2-field textarea { min-height: 82px !important; resize: vertical; }
.tev2-field input[type="file"] { max-width: 100%; padding: .35rem 0; font-size: .73rem; font-weight: 400; }
.tev2-field input[type="file"]::file-selector-button { margin-right: .4rem; padding: .4rem .5rem; border: 1px solid #d9dbe6; border-radius: 5px; background: #f8f8fb; color: var(--ink, #161724); font: inherit; }
.tev2-field :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--tev2-danger); background: #fff8f8; }
.tev2-field :is(input, select):disabled { background: #f4f5f9; color: #81869a; }
.tev2-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--tev2-accent); }
.tev2-help { margin: .55rem 0 0; color: var(--tev2-muted); font-size: .69rem; font-weight: 400; line-height: 1.55; overflow-wrap: anywhere; }
.tev2-help strong { color: var(--ink, #161724); font-weight: 600; }
.tev2-inspector-content > .button { margin-top: .75rem; }
.tev2-inspector-content .tev2-field + .tev2-fields { margin-top: .8rem; }
.tev2-inspector-actions, .tev2-element-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .95rem; padding-top: .85rem; border-top: 1px solid var(--tev2-border); }
.tev2-inspector-actions .button, .tev2-element-actions .button { flex: 1; padding-inline: .5rem; }
.tev2-problems { padding: 0 .9rem 1rem; }
.tev2-problems:empty { display: none; }
.tev2-problems h3 { margin: 0 0 .55rem; color: #a03243; font-size: .77rem; font-weight: 650; }
.tev2-problems .tev2-error-list { margin-top: 0; }
.tev2-error-list { display: flex; flex-direction: column; gap: .3rem; margin: .75rem 0 0; padding: .65rem; border: 1px solid #f0ccd1; border-radius: 7px; color: #983240; background: #fff5f6; list-style: none; font-size: .7rem; line-height: 1.45; }
.tev2-error-list:empty { display: none; }
.tev2-error-list button { display: block; width: 100%; padding: .25rem 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; overflow-wrap: anywhere; }
.tev2-error-list button:hover { text-decoration: underline; text-underline-offset: 2px; }
.tev2-error-list strong { font-weight: 650; }
.tev2-metrics { margin: .9rem 0 0; padding: .7rem; border-radius: 7px; background: #f6f7fb; color: var(--tev2-muted); font-size: .69rem; }
dl.tev2-metrics, .tev2-metrics dl { display: grid; grid-template-columns: 1fr auto; gap: .3rem .7rem; }
.tev2-metrics dl { margin: 0; }
.tev2-metrics dt { margin: 0; font-weight: 400; }
.tev2-metrics dd { margin: 0; color: var(--ink, #161724); text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tev2-metrics dd.is-error { color: #a03243; }
.tev2-empty { padding: 1.05rem .65rem; border: 1px dashed #d6d9e5; border-radius: 7px; background: #fafbfe; color: var(--tev2-muted); font-size: .74rem; line-height: 1.6; text-align: center; }
.tev2-empty p { margin: .35rem 0; }
.tev2-empty strong { display: block; margin-bottom: .3rem; color: var(--ink, #161724); font-size: .79rem; }
.tev2-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .45rem 1rem; min-height: 43px; padding: .6rem 1.1rem; border-top: 1px solid var(--tev2-border); background: #fff; z-index: 4; }
.tev2-footer > small { color: var(--tev2-muted); font-size: .66rem; }
.tev2-status { flex: 1 1 240px; min-width: 0; margin: 0; color: var(--tev2-muted); font-size: .73rem; line-height: 1.4; overflow-wrap: anywhere; }
.tev2-save-state { color: var(--ink-faint, #7a7e91); font-size: .68rem; white-space: nowrap; }
.tev2-status.is-error { color: #a03243; }
.tev2-status.is-success { color: #217347; }
.tev2-notice { padding: .65rem .8rem; margin: .75rem .9rem 0; border: 1px solid #d9d2f9; border-radius: 7px; background: #f5f2ff; color: #564785; font-size: .74rem; line-height: 1.5; }
.tev2-notice.is-error { color: #a03243; border-color: #edc6ce; background: #fff4f6; }
.tev2-notice.is-success { color: #217347; border-color: #c3e6d0; background: #f0faf3; }
.tev2-image-preview { display: flex; align-items: center; justify-content: center; min-height: 85px; margin-top: .6rem; padding: .5rem; border: 1px solid var(--tev2-border); border-radius: 6px; background: #f6f7fa; }
.tev2-image-preview img { display: block; max-width: 100%; max-height: 125px; object-fit: contain; }
.tev2-example { display: block; width: 100%; max-width: 100%; margin: .7rem 0 0; padding: .65rem; border: 1px solid #dadce7; border-radius: 6px; background: #f5f6fa; color: #41465e; font-family: ui-monospace, Consolas, monospace !important; font-size: .66rem !important; line-height: 1.65; font-weight: 400; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; resize: vertical; }
.tev2-integration-dialog {
    width: min(740px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    inset: 0;
    overflow: hidden;
    border: 1px solid var(--line, #e5e6ee);
    border-radius: 14px;
    background: #fff;
    color: var(--ink, #161724);
    box-shadow: 0 24px 90px #17132f40;
    font-size: .85rem;
    line-height: 1.5;
}
.tev2-integration-dialog::backdrop { background: #17152680; }
.tev2-integration-dialog *, .tev2-integration-dialog *::before { box-sizing: border-box; }
.tev2-integration-dialog [hidden] { display: none !important; }
.tev2-integration-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 34px); min-width: 0; }
.tev2-integration-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line, #e5e6ee); }
.tev2-integration-header h2 { margin: 0; font-size: 1.05rem; line-height: 1.35; font-weight: 700; }
.tev2-integration-header .icon-button { width: 36px; height: 36px; flex-shrink: 0; border-radius: 7px; font-size: 1.2rem; cursor: pointer; }
.tev2-integration-body { min-height: 0; min-width: 0; overflow: auto; padding: 1rem 1.1rem; scrollbar-width: thin; }
.tev2-integration-body > p { margin: 0; color: var(--ink-soft, #55586b); }
.tev2-integration-body h3, .tev2-integration-body label { display: block; margin: .9rem 0 .4rem; font-size: .82rem; font-weight: 650; }
.tev2-integration-endpoint, .tev2-integration-dialog [data-tev2-json] { width: 100%; min-width: 0; margin: 0; padding: .75rem; border: 1px solid #dadce7; border-radius: 7px; background: #f6f7fb; color: #353a51; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.tev2-integration-dialog [data-tev2-json] { display: block; height: min(36dvh, 320px); min-height: 150px; resize: none; }
.tev2-integration-body .tev2-integration-status { margin-top: .8rem; padding: .65rem .75rem; border: 1px solid #ded9f7; border-radius: 7px; background: #f8f6ff; color: #51447f; overflow-wrap: anywhere; }
.tev2-integration-status:empty { display: none; }
.tev2-integration-body .tev2-integration-status.is-error { border-color: #edc6ce; background: #fff4f6; color: #a03243; }
.tev2-integration-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; padding: .8rem 1.1rem; border-top: 1px solid var(--line, #e5e6ee); }
.tev2-integration-actions .button { min-height: 36px; padding: .5rem .8rem; border-radius: 7px; font-size: .8rem; }
.tev2-integration-dialog :is(button, textarea):focus-visible { outline: 3px solid var(--primary, #6754e9); outline-offset: 2px; }
.tev2-fields-dialog { width: min(480px, calc(100vw - 32px)); }
.tev2-fields-dialog form p { margin: 0; color: var(--ink-soft, #55586b); }
.tev2-fields-dialog input { display: block; width: 100%; min-width: 0; min-height: 40px; padding: .55rem .65rem; border: 1px solid #d9dbe6; border-radius: 6px; background: #fff; color: var(--ink, #161724); font: inherit; }
.tev2-fields-dialog input:focus-visible { outline: 3px solid var(--primary, #6754e9); outline-offset: 2px; }
.tev2-managed-fields { margin: .85rem 0 0; padding: 0; list-style: none; }
.tev2-managed-fields li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line, #e5e6ee); }
.tev2-managed-fields li:last-child { border-bottom: 0; }
.tev2-managed-fields li > span { min-width: 0; overflow-wrap: anywhere; }
.tev2-managed-fields small { display: block; margin-top: .15rem; color: var(--ink-soft, #55586b); font-size: .73rem; }
.tev2-delete-field { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; padding: 0; border: 1px solid #ecd5da; border-radius: 7px; color: #a03243; background: #fff; cursor: pointer; }
.tev2-delete-field:hover { background: #fff4f6; border-color: #d6a2ad; }
.tev2-managed-empty { color: var(--ink-soft, #55586b); }
@media (max-width: 540px) {
    .tev2-integration-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 10px; }
    .tev2-integration-shell { max-height: calc(100dvh - 22px); }
    .tev2-integration-header, .tev2-integration-body, .tev2-integration-actions { padding: .8rem; }
    .tev2-integration-header h2 { font-size: 1rem; }
    .tev2-integration-actions .button { flex: 1; }
}
@media (max-width: 1100px) {
    .tev2-layout { grid-template-columns: 200px minmax(0, 1fr) 240px; }
    .tev2-layout.is-paper { grid-template-columns: minmax(0, 1fr) 240px; }
    .tev2-header { gap: .75rem; }
    .tev2-sidebar-content { padding: .8rem .65rem; }
    .tev2-insert { padding: .5rem; }
    .tev2-toolbar { padding: .6rem; }
    .tev2-view-tabs button { padding-inline: .5rem; }
    .tev2-inspector-content { padding: .8rem .7rem; }
    .tev2-viewport { padding: 24px; }
}
@media (max-width: 850px) {
    .tev2-dialog { width: calc(100vw - 20px); height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); border-radius: 12px; }
    .tev2-header { flex-wrap: wrap; gap: .6rem .8rem; padding: .7rem .9rem; }
    .tev2-heading { flex: 1; }
    .tev2-heading h2 { display: inline; }
    .tev2-heading small, .tev2-heading .tev2-badge { margin: 0 .35rem 0 0; vertical-align: middle; }
    .tev2-name { order: 3; flex: 1 1 100%; max-width: none; }
    .tev2-name > span, .tev2-name > small { display: none; }
    .tev2-navigation { padding: .6rem .9rem; }
    .tev2-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(360px, 48vh) auto; align-content: start; overflow: auto; }
    .tev2-layout.is-paper { grid-template-columns: minmax(0, 1fr); }
    .tev2-workspace { grid-column: 1 / -1; grid-row: 1; min-height: 360px; border-bottom: 1px solid var(--tev2-border); }
    .tev2-sidebar { grid-column: 1; grid-row: 2; overflow: visible; border-right: 0; }
    .tev2-sidebar-content { padding: 1rem .85rem; }
    .tev2-inspector { grid-column: 2; grid-row: 2; overflow: visible; }
    .tev2-layout.is-paper .tev2-inspector { grid-column: 1 / -1; border-left: 0; }
    .tev2-inspector-tabs { position: static; min-height: 47px; }
    .tev2-sidebar-header { min-height: 47px; }
    .tev2-inspector-content { padding: .85rem; }
    .tev2-insert { min-height: 82px; padding: .65rem; }
    .tev2-footer { padding: .55rem .9rem; }
    .tev2-footer > small { display: none; }
}
@media (max-width: 540px) {
    .tev2-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .tev2-header { gap: .6rem; padding: .65rem .75rem; }
    .tev2-heading { flex-basis: 100%; }
    .tev2-heading h2 { font-size: .95rem; }
    .tev2-header-actions { order: 2; flex: 1 1 100%; justify-content: flex-end; flex-wrap: wrap; gap: .35rem; }
    .tev2-header-actions .button { min-height: 35px; padding-inline: .65rem; }
    .tev2-name { order: 1; flex: 1 1 100%; min-width: 0; }
    .tev2-navigation { padding: .5rem .75rem; }
    .tev2-layout { display: flex; flex-direction: column; }
    .tev2-workspace { order: -1; flex: 0 0 365px; min-height: 365px; width: 100%; }
    .tev2-sidebar { flex: 0 0 auto; width: 100%; border-bottom: 1px solid var(--tev2-border); }
    .tev2-sidebar-content { padding: .9rem .75rem; }
    .tev2-inspector { flex: 0 0 auto; width: 100%; border-left: 0; }
    .tev2-insert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tev2-insert { min-height: 69px; position: relative; padding-left: 2.25rem; }
    .tev2-insert > svg, .tev2-insert > .tev2-insert-icon { position: absolute; left: .65rem; top: .75rem; }
    .tev2-toolbar { min-height: 51px; gap: .35rem; padding: .45rem .55rem; }
    .tev2-view-tabs button { font-size: .7rem; padding-inline: .5rem; }
    .tev2-zoom { gap: .18rem; }
    .tev2-zoom label { gap: .2rem; font-size: .63rem; }
    .tev2-zoom select { min-width: 63px; font-size: .68rem; }
    .tev2-zoom button { min-width: 27px; padding-inline: .3rem; }
    .tev2-viewport { padding: 22px; }
    .tev2-canvas-caption { padding: .5rem .75rem; font-size: .65rem; }
    .tev2-inspector-content { padding: .9rem .75rem; }
    .tev2-footer { min-height: 40px; padding: .55rem .75rem; }
    .tev2-status { font-size: .7rem; }
    .tev2-save-state { font-size: .64rem; }
}
@media (pointer: coarse) {
    .tev2-resize-handle { width: 13px; height: 13px; }
    .tev2-resize-handle::before { inset: -10px; }
    .tev2-dialog :is(input, select, textarea) { scroll-margin-block: 80px; }
}
@media (prefers-reduced-motion: reduce) {
    .tev2-dialog, .tev2-dialog *, .tev2-dialog *::before, .tev2-dialog *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.tev2-field-rename { flex-shrink: 0; margin-left: auto; }
.tev2-field-rename-dialog { width: min(400px, calc(100vw - 20px)); }
.tev2-field-rename-dialog label { margin-top: 0; }
.tev2-managed-fields > li { flex-wrap: wrap; gap: .65rem; }
@media (max-width: 600px) {
    .tev2-managed-fields > li > span { width: 100%; }
}
