/* view styles: email (builder, broadcasts, templates) */
.em-builder { grid-template-columns: 180px minmax(0, 1fr) 300px; }
.em-palette-items { display: flex; flex-direction: column; }
.em-settings { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; }
.em-heading { font-weight: 700; line-height: 1.25; color: #0f172a; padding: 8px 0; word-break: break-word; }
.em-text { font-size: 16px; line-height: 1.6; color: #1e293b; padding: 8px 0; word-break: break-word; }
.em-text p { margin: 0 0 12px; }
.em-text a { color: #2b59ff; }
.em-btn { display: inline-block; color: #fff; font-weight: 600; padding: 12px 24px; border-radius: 6px; }
.em-img-empty { display: flex; align-items: center; justify-content: center; gap: 8px; height: 100px; background: var(--surface-2); color: var(--faint); border: 1px dashed var(--border-strong); margin: 8px 0; }
.em-spacer { background: repeating-linear-gradient(45deg, transparent 0 6px, #f1f5f9 6px 12px); }
.em-html { width: 100%; height: 90px; border: 1px dashed var(--border-strong); pointer-events: none; background: #fff; }
.em-empty { padding: 60px 24px; text-align: center; color: var(--faint); }
.blk .blk-tools { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px; z-index: 2; }
.blk .blk-tools .btn { height: 26px; width: 26px; padding: 0; }
.blk .blk-tools .btn.off { opacity: .35; pointer-events: none; }
.blk .blk-tools .btn svg { width: 14px; height: 14px; }
.blk .blk-tools .em-up svg { transform: rotate(180deg); }
.em-grip { display: inline-flex; align-items: center; justify-content: center; cursor: grab; }
.em-editor { min-height: 140px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; background: #fff; outline: none; line-height: 1.5; }
.em-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.em-editor p { margin: 0 0 8px; }
.em-toolbar .btn { height: 28px; padding: 0 10px; }
.em-b { font-weight: 800; } .em-i { font-style: italic; }
.em-color { width: 60px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
.em-frame-wrap { margin: 0 auto; width: 100%; }
.em-frame { height: 65vh; border: 1px solid var(--border); }
.em-plain { white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); max-height: 65vh; overflow: auto; font-family: var(--mono); font-size: 12.5px; }

.em-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.em-name { font-size: 22px; font-weight: 650; border: 1px solid transparent; background: transparent; padding: 2px 6px; margin-left: -6px; border-radius: 6px; width: 100%; max-width: 520px; font-family: inherit; color: inherit; }
.em-name:hover, .em-name:focus { border-color: var(--border-strong); background: var(--surface); outline: none; }
.em-save { font-size: 12.5px; color: var(--muted); }
.em-input-row { display: flex; gap: 6px; }
.em-input-row .input { flex: 1; }
.em-tagbox { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.em-count { font-size: 24px; font-weight: 700; }
.tpl-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tpl-card { cursor: pointer; }
.tpl-card:hover { border-color: var(--border-strong); }
.pick-list { display: grid; gap: 8px; }
.pick-item { text-align: left; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font: inherit; cursor: pointer; }
.pick-item:hover { background: var(--surface-2); }
.pick-item.active { border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 1100px) {
  .em-builder { grid-template-columns: 1fr; }
  .em-palette-items { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .em-palette-items .p-item { margin-bottom: 0; }
  .em-settings { position: static; max-height: none; }
  .em-edit { grid-template-columns: 1fr; }
  .blk { padding: 4px 16px; }
  .canvas { padding: 12px 6px; }
  .em-frame-wrap { max-width: 100%; }
}
