.template-assistant-mini-flow { display: flex; align-items: center; gap: 7px; margin: 16px 0 18px; }
.template-assistant-mini-flow span { padding: 7px 10px; color: #273b59; background: #edf3fb; border-radius: 4px; font-size: 11px; font-weight: 750; }
.template-assistant-mini-flow i { flex: 1 1 10px; height: 1px; background: #e81683; }
.template-assistant-checklist { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: assistant-checklist; }
.template-assistant-checklist li { position: relative; min-height: 29px; padding: 4px 0 4px 35px; color: #68758a; font-size: 12px; counter-increment: assistant-checklist; }
.template-assistant-checklist li::before { content: counter(assistant-checklist); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 25px; height: 25px; color: #b50e67; background: #fff1f8; border-radius: 50%; font-size: 10px; font-weight: 800; }

.template-assistant { --assistant-pink: #e81683; --assistant-ink: #16243a; --assistant-muted: #68758a; --assistant-line: #dce3ed; position: absolute; z-index: 80; top: 0; right: 0; bottom: 0; box-sizing: border-box; min-width: 0; max-width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; width: clamp(390px, 43%, 540px); overflow: hidden; color: var(--assistant-ink); background: #fff; border: 1px solid #d8e0ea; border-top: 3px solid var(--assistant-pink); border-radius: 6px 0 0 6px; box-shadow: -20px 0 48px rgba(18, 34, 57, .22); transform: translateX(calc(100% + 40px)); visibility: hidden; transition: transform .34s cubic-bezier(.2, .82, .2, 1), visibility 0s linear .34s; }
.template-assistant.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.editor-stage.template-assistant-canvas-docked #mainCanvas { overflow: clip; }
.merge-block-overlay { position: absolute; z-index: 2147483000; inset: 0; overflow: visible; pointer-events: none; }
.merge-block-guide { position: absolute; width: 18px; min-height: 12px; color: var(--merge-block-accent); border-left: 2px solid currentColor; filter: drop-shadow(0 1px 1px rgba(22, 36, 58, .12)); }
.merge-block-guide::before,
.merge-block-guide::after { position: absolute; left: -2px; width: 10px; height: 2px; background: currentColor; border-radius: 2px; content: ""; }
.merge-block-guide::before { top: 0; }
.merge-block-guide::after { bottom: 0; }
.merge-block-guide__name { position: absolute; top: 50%; left: 50%; display: block; overflow: hidden; padding: 3px 5px; color: currentColor; background: rgba(255, 255, 255, .9); border-radius: 3px; font-size: 8px; font-weight: 800; line-height: 1; text-overflow: ellipsis; white-space: nowrap; transform: translate(-50%, -50%) rotate(-90deg); transform-origin: center; }
.template-assistant__header { min-height: 74px; padding: 15px 18px 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--assistant-line); }
.template-assistant__header span { display: block; color: var(--assistant-pink); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.template-assistant__header h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: 0; }
.template-assistant__close { position: relative; width: 34px; height: 34px; padding: 0; background: transparent; border: 0; border-radius: 50%; }
.template-assistant__close:hover { background: #f3f6fa; }
.template-assistant__close span::before, .template-assistant__close span::after { content: ""; position: absolute; top: 16px; left: 9px; width: 16px; height: 2px; background: #52627a; transform: rotate(45deg); }
.template-assistant__close span::after { transform: rotate(-45deg); }
.template-assistant__nav { padding: 0 12px; display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--assistant-line); }
.template-assistant__nav button { position: relative; min-width: 0; padding: 11px 3px 10px; display: flex; align-items: center; justify-content: center; gap: 5px; color: #7a8799; background: transparent; border: 0; font-size: 10px; font-weight: 750; }
.template-assistant__nav button::after { content: ""; position: absolute; right: 6px; bottom: -1px; left: 6px; height: 2px; background: transparent; }
.template-assistant__nav button span { display: grid; place-items: center; width: 18px; height: 18px; background: #edf2f8; border-radius: 50%; font-size: 9px; }
.template-assistant__nav button.is-active { color: #b50e67; }
.template-assistant__nav button.is-active::after { background: var(--assistant-pink); }
.template-assistant__nav button.is-active span { color: #fff; background: var(--assistant-pink); }
.template-assistant__body { min-width: 0; min-height: 0; grid-column: 1; grid-row: 3; overflow: auto; padding: 18px; scrollbar-width: thin; }
.assistant-field-editor { z-index: 3; width: 100%; min-width: 0; min-height: 0; grid-column: 1; grid-row: 3; overflow: auto; background: #fff; scrollbar-width: thin; }
.assistant-field-editor__header { position: sticky; z-index: 2; top: 0; min-height: 99px; padding: 13px 16px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--assistant-line); }
.assistant-field-editor__header > div { min-width: 0; }
.assistant-field-editor__header > div > span { display: block; color: var(--assistant-pink); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.assistant-field-editor__header h3 { margin: 3px 0 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-field-editor__back { position: relative; width: 32px; height: 32px; padding: 0; color: #34445b; background: transparent; border: 0; border-radius: 4px; }
.assistant-field-editor__back:hover { color: #34445b; background: #f1f4f8; }
.assistant-field-editor__back span::before { position: absolute; top: 11px; left: 12px; width: 9px; height: 9px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; content: ""; transform: rotate(45deg); }
.assistant-field-editor__type { padding: 5px 7px; color: #8c1a61; background: #fff0f8; border-radius: 4px; font-size: 8px; font-weight: 800; }
.assistant-field-editor__form { width: 100%; min-width: 0; padding: 16px; }
.assistant-field-editor__controls { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 10px; }
.assistant-field-editor__control { min-width: 0; margin: 0; display: grid; gap: 5px; color: #526178; font-size: 9px; font-weight: 750; }
.assistant-field-editor__control.is-wide { grid-column: 1 / -1; }
.assistant-field-editor__control small { color: #8a96a8; font-size: 8px; font-weight: 500; }
.assistant-field-editor__control .form-control,
.assistant-field-editor__control .form-select { min-width: 0; min-height: 38px; font-size: 10px; }
.assistant-field-editor__format { gap: 5px; }
.assistant-field-editor__format > label { margin: 0; }
.assistant-field-editor__format-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(145px, .9fr); gap: 7px; }
.assistant-field-editor__format-example { color: #344b68; font-weight: 700; }
.assistant-field-editor__format-tokens { color: #8290a3; font-weight: 500; }
.assistant-field-editor__toggle { grid-column: 1 / -1; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #34445b; background: #f7f9fc; border: 1px solid #dce3ed; border-radius: 5px; font-size: 10px; font-weight: 750; }
.assistant-field-editor__toggle input { width: 17px; height: 17px; margin: 0; accent-color: var(--assistant-pink); }
.template-assistant__footer { grid-column: 1; grid-row: 4; }
.assistant-section-heading { margin-bottom: 17px; }
.assistant-section-heading > span { color: var(--assistant-pink); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.assistant-section-heading h3 { margin: 5px 0 5px; font-size: 19px; letter-spacing: 0; }
.assistant-section-heading p { margin: 0; color: var(--assistant-muted); font-size: 12px; line-height: 1.55; }
.assistant-action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.assistant-action-row .btn { flex: 1 1 150px; }
.assistant-source-card { margin-top: 13px; padding: 14px; background: #f5f8fc; border: 1px solid var(--assistant-line); border-radius: 5px; }
.assistant-source-card > span { color: #7b889a; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.assistant-source-card > strong { display: block; margin: 4px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.assistant-source-card > div { display: flex; gap: 8px; }
.assistant-source-card > div span { padding: 5px 7px; color: #45617f; background: #e7eff9; border-radius: 3px; font-size: 9px; font-weight: 700; }
.assistant-schema-map { margin-top: 14px; display: grid; gap: 7px; }
.assistant-schema-node { --schema-depth: 0; margin-left: calc(var(--schema-depth) * 14px); padding: 9px 10px; display: flex; align-items: center; gap: 9px; border-left: 2px solid #e81683; background: #fafbfd; }
.assistant-schema-node i { width: 18px; height: 18px; display: grid; place-items: center; color: #4f739b; background: #eaf2fb; border-radius: 3px; font-style: normal; font-size: 8px; font-weight: 800; }
.assistant-schema-node strong, .assistant-schema-node small { display: block; }
.assistant-schema-node strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.assistant-schema-node small { color: #8290a3; font-size: 9px; }
.assistant-search { height: 40px; padding: 0 11px; display: flex; align-items: center; gap: 9px; background: #f7f9fc; border: 1px solid var(--assistant-line); border-radius: 5px; }
.assistant-search span { width: 13px; height: 13px; border: 2px solid #718198; border-radius: 50%; }
.assistant-search span::after { content: ""; display: block; width: 5px; height: 2px; margin: 9px 0 0 9px; background: #718198; transform: rotate(45deg); }
.assistant-search input { min-width: 0; flex: 1; background: transparent; border: 0; outline: 0; font-size: 12px; }
.assistant-field-context { margin-bottom: 10px; padding: 11px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 3px 9px; background: #f4f7fb; border: 1px solid var(--assistant-line); border-left: 3px solid #7897b8; border-radius: 5px; }
.assistant-field-context > span { grid-column: 1 / -1; color: #718096; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.assistant-field-context strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.assistant-field-context small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7d8a9e; font-size: 9px; }
.assistant-field-context__children { grid-column: 1 / -1; margin-top: 5px; padding-top: 7px; display: grid; gap: 4px; border-top: 1px solid #dfe6ef; }
.assistant-field-context__children > strong { color: #718096; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.assistant-field-context__table { min-width: 0; padding: 4px 6px; display: flex; align-items: baseline; justify-content: space-between; gap: 7px; background: rgba(255, 255, 255, .58); border-radius: 3px; }
.assistant-field-context__table span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #344b68; font-size: 9px; font-weight: 700; }
.assistant-field-context__table small { flex: 0 0 auto; color: #8290a3; font-size: 8px; }
.assistant-field-context__empty { color: #8290a3; font-size: 8px; }
.assistant-field-context.is-block { background: #fff5fa; border-color: #efacd0; border-left-color: var(--assistant-pink); }
.assistant-insert-composer { margin: 12px 0; padding: 12px; background: #fff7fb; border: 1px solid #efacd0; border-radius: 5px; }
.assistant-insert-composer > summary { cursor: pointer; list-style: none; }
.assistant-insert-composer > summary::-webkit-details-marker { display: none; }
.assistant-insert-composer > summary::after { content: "+"; display: grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; color: #b50e67; border: 1px solid #efacd0; border-radius: 50%; font-size: 12px; line-height: 1; }
.assistant-insert-composer[open] > summary::after { content: "−"; }
.assistant-insert-composer__heading { margin-bottom: 9px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.assistant-insert-composer__heading span, .assistant-insert-composer__heading small { display: block; color: #8793a5; font-size: 8px; }
.assistant-insert-composer__heading strong { display: block; margin-top: 2px; color: #b50e67; font-size: 12px; }
.assistant-insert-composer__heading small { max-width: 52%; text-align: right; line-height: 1.4; }
.assistant-independent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.assistant-independent-card { min-width: 0; padding: 9px; display: flex; flex-direction: column; gap: 7px; background: #fff; border: 1px solid #ead6e1; border-radius: 5px; }
.assistant-independent-card__intro { min-height: 42px; }
.assistant-independent-card strong, .assistant-independent-card small { display: block; }
.assistant-independent-card strong { font-size: 10px; }
.assistant-independent-card small { margin-top: 3px; color: #8290a3; font-size: 8px; line-height: 1.35; }
.assistant-independent-settings { margin: 0; border-top: 1px solid #f0dce7; border-bottom: 1px solid #f0dce7; }
.assistant-independent-settings summary { padding: 6px 0; color: #b50e67; cursor: pointer; font-size: 9px; font-weight: 700; list-style-position: inside; }
.assistant-independent-settings summary::marker { color: #b50e67; }
.assistant-independent-settings[open] { padding-bottom: 7px; }
.assistant-independent-card .assistant-label { margin: 0; font-size: 9px; }
.assistant-independent-card .assistant-label.is-disabled { color: #a7b0bd; }
.assistant-independent-card .assistant-label em { color: #b50e67; font-size: 8px; font-style: normal; font-weight: 650; }
.assistant-independent-card .assistant-label.is-disabled em { color: #a7b0bd; }
.assistant-independent-card .form-control { min-height: 32px; margin-top: 3px; font-size: 9px; }
.assistant-independent-card .form-control:disabled { color: #a7b0bd; background: #f4f6f9; }
.assistant-independent-card .btn { width: 100%; margin-top: auto; padding: 7px 6px; display: inline-flex; align-items: center; justify-content: center; text-align: center; font-size: 9px; white-space: nowrap; }
@media (max-width: 575.98px) { .assistant-independent-grid { grid-template-columns: 1fr; } }
.assistant-field-list, .assistant-block-list { margin-top: 12px; display: grid; gap: 7px; }
.assistant-field-list { gap: 13px; }
.assistant-field-group { min-width: 0; width: calc(100% - (var(--field-depth, 0) * 12px)); margin-left: calc(var(--field-depth, 0) * 12px); }
.assistant-field-group > header { margin-bottom: 6px; padding: 0; }
.assistant-field-group__toggle { width: 100%; padding: 0 2px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: inherit; background: transparent; border: 0; text-align: left; }
.assistant-field-group__toggle > span { min-width: 0; flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.assistant-field-group__toggle > i { width: 7px; height: 7px; flex: 0 0 auto; border-right: 1.5px solid #8290a3; border-bottom: 1.5px solid #8290a3; transform: rotate(45deg) translateY(-2px); transition: transform .16s ease; }
.assistant-field-group__toggle[aria-expanded="true"] > i { transform: rotate(225deg) translate(-1px, -1px); }
.assistant-field-group > header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #344b68; font-size: 10px; }
.assistant-field-group > header small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8a96a8; font-size: 8px; }
.assistant-field-group__items { display: grid; gap: 6px; }
.assistant-field-item, .assistant-block-item { width: 100%; min-width: 0; padding: 10px 11px; display: flex; align-items: center; gap: 10px; text-align: left; background: #fff; border: 1px solid var(--assistant-line); border-radius: 5px; }
.assistant-field-item:hover { border-color: #ee8fc0; background: #fff8fc; }
.assistant-field-item__icon { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 auto; color: #b50e67; background: #fff0f8; border-radius: 4px; font-size: 15px; }
.assistant-field-item > span:nth-child(2), .assistant-block-item > div { min-width: 0; flex: 1; }
.assistant-field-item strong, .assistant-field-item small, .assistant-block-item strong, .assistant-block-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-field-item strong, .assistant-block-item strong { font-size: 11px; }
.assistant-field-item small, .assistant-block-item small { margin-top: 2px; color: #8491a3; font-size: 9px; }
.assistant-field-item__add { color: #b50e67; font-size: 18px; line-height: 1; }
.assistant-field-item__actions { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.assistant-field-item__actions button, .assistant-field-item__actions select { width: 27px; height: 27px; padding: 0; display: grid; place-items: center; color: #b50e67; background: #fff; border: 1px solid #eaa2c8; border-radius: 4px; font-size: 9px; font-weight: 800; }
.assistant-field-item__actions button:hover, .assistant-field-item__actions select:hover { color: #fff; background: #b50e67; }
.assistant-field-item__icon { font-size: 10px; letter-spacing: 0; }
.assistant-field-item__actions .assistant-qr-icon { color: #b50e67; background: #fff; line-height: 1; }
.assistant-field-item__actions .assistant-qr-icon:hover { color: #b50e67; background: #fff; }
.assistant-field-item__actions .assistant-qr-icon svg { width: 20px; height: 20px; display: block; overflow: visible; fill: currentColor; }
.assistant-field-item__actions .assistant-qr-icon svg rect { fill: none; stroke: currentColor; stroke-width: 2; }
.assistant-field-item__barcode { display: flex; align-items: center; }
.assistant-field-item__barcode button { border-radius: 4px 0 0 4px; border-right: 0; }
.assistant-field-item__barcode select { width: 16px; padding: 0; border-radius: 0 4px 4px 0; appearance: auto; color: #b50e67; }
.assistant-block-item { border-left: 3px solid #e81683; }
.assistant-block-item.is-locatable { cursor: pointer; }
.assistant-block-item.is-locatable:hover { border-color: #b90e6a; box-shadow: 0 2px 8px rgba(34, 53, 78, .08); }
.assistant-block-item[data-level="2"] { margin-left: 12px; width: calc(100% - 12px); border-left-color: #4e87bd; }
.assistant-block-item[data-level="3"] { margin-left: 24px; width: calc(100% - 24px); border-left-color: #39a579; }
.assistant-block-item[data-level="4"] { margin-left: 36px; width: calc(100% - 36px); border-left-color: #8a63b8; }
.assistant-block-item button { padding: 5px 8px; color: #a70f62; background: #fff; border: 1px solid #eaa2c8; border-radius: 999px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.assistant-block-item.is-root { flex-wrap: wrap; }
.assistant-block-item__actions { display: flex; flex: 0 0 auto; gap: 6px; }
.assistant-block-style { flex: 1 0 100%; padding-top: 9px; display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 6px 7px; border-top: 1px solid #e6ebf1; }
.assistant-block-style > span { grid-column: 1; grid-row: 1; color: #6c788a; font-size: 9px; font-weight: 750; }
.assistant-block-style .form-select { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: 9px; }
.assistant-block-item button.assistant-style-edit { grid-column: 2; grid-row: 1; width: 34px; height: 28px; padding: 0; display: grid; place-items: center; color: #a70f62; background: #fff; border: 1px solid #d9e1eb; border-radius: 4px; }
.assistant-block-item button.assistant-style-edit:hover { color: #fff; background: #b90e6a; border-color: #b90e6a; }
.assistant-style-edit__icon { position: relative; width: 16px; height: 14px; display: block; background: linear-gradient(currentColor, currentColor) 0 2px / 16px 1px no-repeat, linear-gradient(currentColor, currentColor) 0 7px / 16px 1px no-repeat, linear-gradient(currentColor, currentColor) 0 12px / 16px 1px no-repeat; }
.assistant-style-edit__icon::after { content: ""; position: absolute; top: 0; left: 3px; width: 4px; height: 4px; background: currentColor; border: 1px solid #fff; border-radius: 50%; box-shadow: 7px 5px 0 -1px currentColor, 2px 10px 0 -1px currentColor; }
.assistant-label { display: block; margin: 0 0 6px; color: #5a687d; font-size: 10px; font-weight: 750; }
.assistant-rule-stack { margin: 12px 0; display: grid; gap: 9px; }
.assistant-rule-card { padding: 12px; background: #f8fafc; border: 1px solid var(--assistant-line); border-radius: 5px; }
.assistant-rule-card > div:first-child { display: flex; align-items: center; gap: 10px; }
.assistant-rule-card strong, .assistant-rule-card small { display: block; }
.assistant-rule-card strong { font-size: 11px; }
.assistant-rule-card small { margin-top: 2px; color: #8290a3; font-size: 9px; }
.assistant-rule-icon { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: #4f7faf; border-radius: 4px; font-weight: 800; }
.assistant-rule-grid { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.assistant-rule-grid > :last-child:nth-child(3) { grid-column: 1 / -1; }
.assistant-rule-grid .form-select, .assistant-rule-grid .form-control, .template-assistant .form-select { min-width: 0; min-height: 36px; font-size: 10px; }
.assistant-switch { position: relative; width: 32px; height: 19px; flex: 0 0 auto; }
.assistant-switch input { position: absolute; opacity: 0; }
.assistant-switch span { position: absolute; inset: 0; background: #cbd4df; border-radius: 999px; transition: background .18s ease; }
.assistant-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; background: #fff; border-radius: 50%; transition: transform .18s ease; }
.assistant-switch input:checked + span { background: var(--assistant-pink); }
.assistant-switch input:checked + span::after { transform: translateX(13px); }
.assistant-rule-note { margin: 8px 0 0; color: #7a8799; font-size: 9px; line-height: 1.5; }
.assistant-rule-card.is-disabled { opacity: .55; }
.assistant-outline-summary { margin: 13px 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--assistant-line); border-radius: 5px; overflow: hidden; }
.assistant-outline-summary div { padding: 10px; text-align: center; background: #f8fafc; border-right: 1px solid var(--assistant-line); }
.assistant-outline-summary div:last-child { border-right: 0; }
.assistant-outline-summary strong, .assistant-outline-summary span { display: block; }
.assistant-outline-summary strong { color: #b50e67; font-size: 17px; }
.assistant-outline-summary span { margin-top: 2px; color: #7d899b; font-size: 8px; text-transform: uppercase; }
.assistant-outline { display: grid; gap: 6px; }
.assistant-document-overview { margin-top: 14px; overflow: hidden; background: #fff; border: 1px solid #cbd7e5; border-radius: 7px; box-shadow: 0 12px 26px rgba(35, 53, 76, .12); }
.assistant-document-overview__header { padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #fff; background: #263a55; }
.assistant-document-overview__header strong { font-size: 12px; }
.assistant-document-overview__header span { color: #cbd5e2; font-size: 9px; }
.assistant-document-overview__body { padding: 13px; background: linear-gradient(135deg, #fff 0%, #f7f9fc 100%); }
.assistant-document-root { padding-bottom: 12px; }
.assistant-document-root > span { display: block; margin-bottom: 7px; color: #66758a; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.assistant-document-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.assistant-document-field { max-width: 100%; padding: 6px 8px; overflow: hidden; color: #2e6396; background: #edf5fd; border: 1px solid #b8d5ef; border-radius: 4px; font-family: Consolas, "Courier New", monospace; font-size: 8px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.assistant-document-field:hover, .assistant-document-field:focus-visible { color: #fff; background: #4f83b5; border-color: #4f83b5; }
.assistant-document-blocks { display: grid; gap: 9px; padding-top: 12px; border-top: 1px dashed #d6dee8; }
.assistant-document-block { margin-left: calc(var(--document-depth) * 8px); overflow: hidden; border: 1px solid color-mix(in srgb, var(--document-accent) 55%, #dbe3ed); border-left: 3px solid var(--document-accent); border-radius: 5px; background: #fff; }
.assistant-document-block__header { width: 100%; padding: 9px 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #fff; background: var(--document-accent); border: 0; text-align: left; }
.assistant-document-block__header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.assistant-document-block__header small { flex: 0 0 auto; font-family: Consolas, "Courier New", monospace; font-size: 7px; opacity: .85; }
.assistant-document-block > .assistant-document-fields { padding: 10px; background: #fffafd; }
.assistant-document-block__children { display: grid; gap: 7px; padding: 0 8px 8px; background: #f7f9fc; }
.assistant-document-block__children .assistant-document-block { margin-left: 0; }
.template-assistant__footer { min-height: 67px; padding: 10px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; background: #f6f8fb; border-top: 1px solid var(--assistant-line); }
.template-assistant__footer > div:first-child { min-width: 0; overflow: hidden; }
.template-assistant__footer span, .template-assistant__footer small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-assistant__footer span { font-size: 10px; font-weight: 750; }
.template-assistant__footer small { margin-top: 2px; color: #8591a2; font-size: 8px; }
.template-assistant__footer > div:last-child { min-width: max-content; display: flex; flex: 0 0 auto; gap: 10px; }
.template-assistant__footer .btn { padding: 7px 11px; font-size: 10px; white-space: nowrap; }
.template-assistant__preview { color: #fff; background: linear-gradient(135deg, #e81683, #822ab5); border-color: transparent; box-shadow: 0 7px 16px rgba(181, 14, 103, .2); font-weight: 750; }
.template-assistant__preview[aria-pressed="true"] { background: linear-gradient(135deg, #b50e67, #64208d); box-shadow: inset 0 2px 5px rgba(35, 18, 58, .28), 0 4px 10px rgba(181, 14, 103, .18); }
.template-assistant__preview:hover, .template-assistant__preview:focus-visible { color: #fff; background: linear-gradient(135deg, #d90f78, #7422a4); border-color: transparent; box-shadow: 0 7px 16px rgba(181, 14, 103, .28); }
.template-assistant__preview[aria-pressed="true"]:hover, .template-assistant__preview[aria-pressed="true"]:focus-visible { background: linear-gradient(135deg, #a70b5e, #571b7a); box-shadow: inset 0 2px 5px rgba(35, 18, 58, .34), 0 4px 10px rgba(181, 14, 103, .24); }

.template-assistant-ribbon-icon { width: 32px; height: 32px; display: block; margin: 0 auto; object-fit: contain; }
.template-assistant-ribbon-button { border-radius: 3px; transition: background-color .16s ease, box-shadow .16s ease; }
.template-assistant-ribbon-button.is-active { background: rgba(78, 132, 185, .16); box-shadow: inset 0 0 0 1px rgba(78, 132, 185, .55); }
.ribbon-group.is-template-assistant-disabled { opacity: .38; filter: grayscale(.55); pointer-events: none; transition: opacity .18s ease, filter .18s ease; }

.assistant-block-modal { z-index: 12050; }
.assistant-block-modal + .modal-backdrop { z-index: 12040; }
.assistant-block-modal .modal-content { max-height: min(860px, calc(100vh - 40px)); overflow: hidden; border: 0; border-top: 4px solid #e81683; border-radius: 6px; box-shadow: 0 28px 80px rgba(18, 34, 57, .3); }
.assistant-block-modal .modal-header { align-items: flex-start; padding: 19px 22px 15px; }
.assistant-block-modal .modal-header h2 { margin-top: 4px; font-size: 23px; }
.assistant-block-modal .modal-header p { margin: 4px 0 0; color: #748197; font-size: 12px; }
.assistant-block-modal .modal-body { padding: 0; overflow: hidden; }
.assistant-designer-grid { min-height: 470px; height: min(62vh, 650px); display: grid; grid-template-columns: minmax(230px, .8fr) minmax(280px, 1fr) minmax(340px, 1.3fr); }
.assistant-designer-grid > section { min-width: 0; overflow: auto; padding: 20px; border-right: 1px solid #dce3ed; }
.assistant-designer-grid > section:last-child { border-right: 0; }
.assistant-designer-grid h3 { margin: 5px 0 15px; font-size: 17px; }
.assistant-designer-grid label { margin-bottom: 6px; color: #627086; font-size: 10px; font-weight: 750; }
.assistant-designer-step { width: 23px; height: 23px; display: grid; place-items: center; color: #fff; background: #e81683; border-radius: 50%; font-size: 9px; font-weight: 800; }
.assistant-designer-child { --designer-depth: 0; margin: 10px 0 0 calc(var(--designer-depth) * 13px); padding: 9px; display: flex; gap: 8px; align-items: flex-start; background: #f6f8fb; border-radius: 4px; }
.assistant-designer-child strong, .assistant-designer-child small { display: block; }
.assistant-designer-child strong { font-size: 10px; }
.assistant-designer-child small { margin-top: 2px; color: #8390a3; font-size: 8px; }
.assistant-designer-fieldset { --designer-depth: 0; margin: 0 0 12px calc(var(--designer-depth) * 12px); padding: 10px; border: 1px solid #dce3ed; border-left: 3px solid #4f83b5; border-radius: 4px; }
.assistant-designer-fieldset legend { float: none; width: auto; margin: 0 0 7px; padding: 0 3px; font-size: 10px; font-weight: 800; }
.assistant-designer-field-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.assistant-designer-field { min-width: 0; padding: 6px; display: flex; align-items: center; gap: 6px; background: #f8fafc; border-radius: 3px; }
.assistant-designer-field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.assistant-designer-related-fields { margin-top: 10px; padding-top: 9px; border-top: 1px solid #dce3ed; }
.assistant-designer-related-fields summary { cursor: pointer; list-style: none; }
.assistant-designer-related-fields summary::-webkit-details-marker { display: none; }
.assistant-designer-related-fields summary::before { content: "+"; display: inline-grid; width: 15px; height: 15px; margin-right: 5px; place-items: center; color: #e81683; border: 1px solid #e81683; border-radius: 50%; font-size: 10px; line-height: 1; }
.assistant-designer-related-fields[open] summary::before { content: "−"; }
.assistant-designer-related-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.assistant-designer-related-heading strong { color: #344b68; font-size: 9px; }
.assistant-designer-related-heading small { color: #8390a3; font-size: 8px; text-align: right; }
.assistant-designer-related-fields .assistant-designer-field-list { grid-template-columns: 1fr; }
.assistant-designer-field--related { align-items: flex-start; background: #f3f7fc; border-left: 2px solid #8eacd0; }
.assistant-designer-field--related > span { min-width: 0; display: grid; gap: 2px; white-space: normal; }
.assistant-designer-field--related strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #243b5a; font-size: 9px; }
.assistant-designer-field--related small { color: #8390a3; font-size: 8px; }
.assistant-designer-preview { background: #f5f7fa; }
.assistant-designer-preview > div:first-child { display: flex; align-items: center; gap: 8px; }
.assistant-designer-preview > div:first-child h3 { margin: 0; }
.assistant-style-picker { margin: 16px 0 13px; }
.assistant-style-picker h4 { margin: 0; font-size: 11px; }
.assistant-style-picker > p { margin: 3px 0 9px; color: #7c899b; font-size: 9px; }
.assistant-style-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.assistant-style-choice { min-width: 0; margin: 0; padding: 7px; display: grid; grid-template-columns: auto 31px minmax(0, 1fr); align-items: center; gap: 7px; background: #fff; border: 1px solid #d6dee9; border-radius: 4px; cursor: pointer; }
.assistant-style-choice:has(input:checked) { border-color: #e81683; box-shadow: inset 0 0 0 1px #e81683; }
.assistant-style-choice input { margin: 0; accent-color: #e81683; }
.assistant-style-choice__swatch { position: relative; width: 31px; height: 25px; overflow: hidden; background: linear-gradient(to bottom, var(--style-header) 0 42%, var(--style-body) 42% 100%); border: 1px solid var(--style-border); border-radius: 2px; }
.assistant-style-choice__swatch::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 10px; height: 7px; background: var(--style-nested); border: 1px solid var(--style-border); }
.assistant-style-choice strong, .assistant-style-choice small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-style-choice strong { font-size: 9px; }
.assistant-style-choice small { margin-top: 1px; color: #8793a4; font-size: 7px; }
.assistant-style-create { width: 100%; min-height: 31px; margin-top: 7px; color: #a70f62; background: transparent; border: 1px dashed #dc78ae; border-radius: 4px; font-size: 9px; font-weight: 750; }
.assistant-style-create:hover { color: #fff; background: #b90e6a; border-color: #b90e6a; }
.assistant-preview-block { margin: 10px 0; overflow: hidden; background: #fff; border: 1px solid #cad5e2; border-radius: 4px; }
.assistant-preview-block__label { padding: 7px 9px; display: flex; justify-content: space-between; color: #fff; background: #273b59; font-size: 9px; font-weight: 750; }
.assistant-preview-block__label span { opacity: .7; font-weight: 500; }
.assistant-preview-block .assistant-preview-block .assistant-preview-block__label { background: #4c7fac; }
.assistant-preview-block table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.assistant-preview-block th, .assistant-preview-block td { padding: var(--preview-cell-padding, 7px); overflow-wrap: anywhere; border-right: var(--preview-border-width, 1px) solid var(--preview-border); border-bottom: var(--preview-border-width, 1px) solid var(--preview-border); font-size: 8px; }
.assistant-preview-block th { color: var(--preview-header-text); background: var(--preview-header); }
.assistant-preview-block td { color: var(--preview-body-text); background: var(--preview-body); font-family: Consolas, monospace; }
.assistant-preview-children { padding: 5px 9px; background: #f5f7fa; }
.assistant-block-modal .modal-footer > span { margin-right: auto; color: #718095; font-size: 10px; }
.assistant-block-modal .modal-footer .btn-primary { padding: 9px 18px; background: #e81683; border-color: #e81683; border-radius: 999px; }

.assistant-style-modal { width: min(860px, calc(100vw - 32px)); max-width: none; padding: 0; color: #142239; background: #fff; border: 0; border-top: 4px solid #e81683; border-radius: 6px; box-shadow: 0 28px 90px rgba(18, 34, 57, .34); }
.assistant-style-modal::backdrop { background: rgba(12, 20, 34, .62); backdrop-filter: blur(2px); }
.assistant-style-modal form { display: flex; flex-direction: column; max-height: min(760px, calc(100vh - 36px)); }
.assistant-style-modal header { padding: 19px 22px 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid #dce3ed; }
.assistant-style-modal header h2 { margin: 4px 0 0; font-size: 23px; }
.assistant-style-modal header p { margin: 4px 0 0; color: #748197; font-size: 12px; }
.assistant-style-modal__body { min-height: 0; display: grid; grid-template-columns: minmax(330px, 1fr) minmax(300px, .9fr); overflow: auto; }
.assistant-style-editor, .assistant-style-live-preview { min-width: 0; padding: 22px; }
.assistant-style-editor { border-right: 1px solid #dce3ed; }
.assistant-style-name { display: grid; gap: 6px; color: #59677c; font-size: 10px; font-weight: 750; }
.assistant-style-name input { min-height: 40px; font-size: 12px; }
.assistant-style-color-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.assistant-style-color-grid label { min-height: 44px; margin: 0; padding: 7px 8px 7px 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #59677c; background: #f6f8fb; border: 1px solid #dce3ed; border-radius: 4px; font-size: 9px; font-weight: 750; }
.assistant-style-color-grid input { width: 34px; height: 28px; padding: 0; background: none; border: 0; cursor: pointer; }
.assistant-style-color-grid input::-webkit-color-swatch-wrapper { padding: 0; }
.assistant-style-color-grid input::-webkit-color-swatch { border: 1px solid #c8d2df; border-radius: 3px; }
.assistant-style-measure-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.assistant-style-measure-grid label { display: grid; gap: 5px; color: #59677c; font-size: 9px; font-weight: 750; }
.assistant-style-measure-grid .form-select { min-height: 38px; font-size: 10px; }
.assistant-style-live-preview { --custom-header: #1f314a; --custom-nested: #4a7097; --custom-body: #f6f8fb; --custom-border: #55708f; --custom-headerText: #fff; --custom-bodyText: #1c2b3f; --custom-border-width: 2px; --custom-padding: 9px; background: #f5f7fa; }
.assistant-style-live-preview > span { color: #e81683; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.assistant-style-live-preview > p { margin: 14px 0 0; color: #748197; font-size: 10px; line-height: 1.55; }
.assistant-style-preview-table { margin-top: 13px; overflow: hidden; background: var(--custom-body); border: var(--custom-border-width) solid var(--custom-border); border-radius: 4px; box-shadow: 0 12px 30px rgba(35, 53, 76, .1); }
.assistant-style-preview-table__header, .assistant-style-preview-table__row { display: grid; grid-template-columns: 1.4fr .6fr; }
.assistant-style-preview-table__header { color: var(--custom-headerText); background: var(--custom-header); font-weight: 800; }
.assistant-style-preview-table__row { color: var(--custom-bodyText); background: var(--custom-body); font-family: Consolas, monospace; }
.assistant-style-preview-table__header span, .assistant-style-preview-table__row span { padding: var(--custom-padding); border-right: var(--custom-border-width) solid var(--custom-border); }
.assistant-style-preview-table__header span:last-child, .assistant-style-preview-table__row span:last-child { border-right: 0; }
.assistant-style-preview-table__row { border-top: var(--custom-border-width) solid var(--custom-border); }
.assistant-style-preview-table__nested { margin: 12px; display: grid; grid-template-columns: 1fr 1fr; color: var(--custom-headerText); background: var(--custom-nested); border: var(--custom-border-width) solid var(--custom-border); }
.assistant-style-preview-table__nested strong, .assistant-style-preview-table__nested span { padding: var(--custom-padding); font-size: 9px; }
.assistant-style-preview-table__nested span { color: var(--custom-bodyText); background: var(--custom-body); border-left: var(--custom-border-width) solid var(--custom-border); font-family: Consolas, monospace; }
.assistant-style-modal footer { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid #dce3ed; }
.assistant-style-modal footer .btn { min-width: 116px; }
.assistant-style-modal footer .btn-primary { background: #e81683; border-color: #e81683; border-radius: 999px; }

@media (max-width: 1100px) {
    .template-assistant { width: min(500px, calc(100% - 24px)); }
    .assistant-designer-grid { grid-template-columns: 1fr; height: 68vh; overflow: auto; }
    .assistant-designer-grid > section { overflow: visible; border-right: 0; border-bottom: 1px solid #dce3ed; }
}

@media (max-width: 720px) {
    .assistant-style-modal__body { grid-template-columns: 1fr; }
    .assistant-style-editor { border-right: 0; border-bottom: 1px solid #dce3ed; }
}

@media (max-width: 575.98px) {
    .template-assistant { inset: 0 0 0 8px; width: auto; }
    .template-assistant__nav button { font-size: 0; }
    .template-assistant__nav button span { font-size: 9px; }
    .template-assistant__footer { align-items: flex-start; grid-template-columns: minmax(0, 1fr) auto; }
    .template-assistant__footer > div:last-child { width: 100%; }
    .template-assistant__footer .btn { flex: 1; }
    .assistant-rule-grid { grid-template-columns: 1fr; }
    .assistant-rule-grid > * { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .template-assistant { transition: none; }
}
