.merge-professional { width: min(790px, calc(100vw - 32px)); max-height: 85dvh; overflow: auto; }
.merge-form { display: grid; gap: 11px; }
.merge-form label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.merge-form :is(input:not([type=checkbox]), select, textarea) { min-width: 135px; max-width: 100%; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); padding: 6px 8px; }
.merge-form textarea { width: 100%; }
.merge-form fieldset { display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid var(--line); }
.merge-form fieldset label { justify-content: flex-start; }
.merge-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.merge-feedback { color: var(--muted); font-size: .875rem; white-space: pre-wrap; }
.merge-recipient-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.merge-table-scroll { min-width: 0; max-height: 42dvh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.merge-table-scroll table { width: 100%; border-collapse: collapse; }
.merge-table-scroll th { position: sticky; top: 0; background: var(--panel); }
.merge-table-scroll :is(th, td) { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.merge-table-scroll td input:not([type=checkbox]) { width: 150px; }
.merge-form progress { width: 100%; accent-color: var(--accent); }
.merge-live-preview { position: fixed; inset: auto 14px 13px auto; margin: 0; width: min(475px, calc(100vw - 28px)); padding: 11px; z-index: 80; }
.merge-live-preview iframe { width: 100%; height: min(50dvh, 445px); border: 1px solid var(--line); border-radius: 4px; }
.merge-live-preview p { margin: 7px 0; font-size: .84rem; }
@media screen {
  .brasa-merge-highlight #editor [data-brasa-merge-field],
  .brasa-merge-highlight #editor [data-brasa-merge-rule],
  .brasa-merge-highlight #editor [data-brasa-merge-template] {
    outline: 1px solid #91b5fa; background: #e6efff; color: #194797; border-radius: 2px;
  }
}
@media print { .merge-live-preview, .merge-professional { display: none !important; } }
