/* Outbound messages, interactive content, tours and tooltips, WhatsApp relay.
   Intercom-style area overrides. Loaded after every other desk stylesheet. */

/* ---------- Area tokens: soft type tints (light + dark) ---------- */
:root {
  --outbound-violet: #6b46d6;
  --outbound-violet-soft: #f1edfd;
}
:root[data-desk-theme="dark"] {
  --outbound-violet: #b8a4ff;
  --outbound-violet-soft: #2a2342;
}

/* ---------- Area icons (CSS-drawn; the CSP blocks data: images) ---------- */
:is(#outbound-area, #outbound-format-dialog, #engagement-preview) .icon:is(.i-mail, .i-banner, .i-post) { position: relative; background: none; -webkit-mask: none; mask: none; }
:is(#outbound-area, #outbound-format-dialog, #engagement-preview) .icon:is(.i-mail, .i-banner, .i-post)::before { content: ''; position: absolute; inset: 3.5px 1.5px; border: 1.7px solid currentColor; border-radius: 3px; }
:is(#outbound-area, #outbound-format-dialog, #engagement-preview) .icon.i-mail::after { content: ''; position: absolute; left: 5px; top: .9px; width: 8px; height: 8px; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; border-bottom-right-radius: 1px; transform: rotate(45deg); }
:is(#outbound-area, #outbound-format-dialog, #engagement-preview) .icon.i-banner::after { content: ''; position: absolute; inset: 3.5px 1.5px auto; height: 5.5px; border-radius: 3px 3px 0 0; background: currentColor; }
:is(#outbound-area, #outbound-format-dialog, #engagement-preview) .icon.i-post::before { inset: 2px 3px; }
:is(#outbound-area, #outbound-format-dialog, #engagement-preview) .icon.i-post::after { content: ''; position: absolute; left: 6px; right: 6px; top: 6.5px; height: 1.7px; border-radius: 1px; background: currentColor; box-shadow: 0 3px currentColor, -1px 6px currentColor; }

/* Type icon wells (messages, interactive content, tours). */
:is(#outbound-area, #outbound-format-dialog) .outbound-row-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--hover);
  color: var(--muted);
}
:is(#outbound-area, #outbound-format-dialog) .outbound-row-icon:is([data-kind="email"], [data-kind="checklist"], [data-kind="tour"]) { background: var(--accent-soft); color: var(--accent); }
:is(#outbound-area, #outbound-format-dialog) .outbound-row-icon:is([data-kind="chat"], [data-kind="news"]) { background: var(--outbound-violet-soft); color: var(--outbound-violet); }
:is(#outbound-area, #outbound-format-dialog) .outbound-row-icon:is([data-kind="banner"], [data-kind="post"], [data-kind="tooltip"]) { background: var(--warning-soft); color: var(--warning-ink); }
:is(#outbound-area, #outbound-format-dialog) .outbound-row-icon[data-kind="survey"] { background: var(--success-soft); color: var(--success-ink); }
:is(#outbound-area, #outbound-format-dialog) .outbound-row-icon:empty { display: none; }

/* State pills: Draft gray, Live green, Scheduled/Sending blue, Paused yellow, Finished neutral outline. */
:is(#outbound-area, #outbound-versions-dialog) .sequence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  padding: 2px 8px;
  border: 0;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}
:is(#outbound-area, #outbound-versions-dialog) .sequence-badge::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
:is(#outbound-area, #outbound-versions-dialog) .sequence-badge[data-state="live"] { background: var(--success-soft); color: var(--success-ink); }
:is(#outbound-area, #outbound-versions-dialog) .sequence-badge:is([data-state="scheduled"], [data-state="sending"]) { background: var(--accent-soft); color: var(--accent); }
:is(#outbound-area, #outbound-versions-dialog) .sequence-badge[data-state="paused"] { background: var(--warning-soft); color: var(--warning-ink); }
:is(#outbound-area, #outbound-versions-dialog) .sequence-badge:is([data-state="sent"], [data-state="finished"]) { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
:is(#outbound-area, #outbound-versions-dialog) .sequence-badge[data-state="completed_with_errors"] { background: var(--danger-soft); color: var(--danger-ink); }

/* Back links in the Interactive content / Tours headers: the sub-nav already covers them. */
#outbound-area .outbound-back { display: none; }

/* ---------- Messages list ---------- */
#outbound-view { background: var(--page); }
#outbound-library { max-width: 1200px; margin-inline: auto; padding: 0; }
#outbound-library .outbound-library-header { align-items: center; margin-bottom: 16px; }
#outbound-library .outbound-library-header h2 { font-size: var(--desk-heading, 20px); line-height: 1.25; letter-spacing: -.01em; }
#outbound-library .outbound-library-header p { margin-top: 4px; font-size: 14px; }
#outbound-library .outbound-header-actions .button { min-height: 32px; padding-inline: 12px; }
#outbound-area .outbound-plus, #outbound-area .outbound-plus-icon { display: inline-block; flex: none; width: 14px; height: 14px; margin-inline-start: -2px;
  background: linear-gradient(currentColor 0 0) center / 12px 1.7px no-repeat, linear-gradient(currentColor 0 0) center / 1.7px 12px no-repeat; }

#outbound-library .outbound-library-panel { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#outbound-library .outbound-status-bar { min-height: 0; padding: 0; border-bottom: 1px solid var(--line); }
#outbound-library .outbound-statuses { gap: 0 20px; border-bottom: 0; }
#outbound-library .outbound-statuses button { min-height: 40px; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; }
#outbound-library .outbound-statuses button:hover { background: none; color: var(--ink); }
#outbound-library .outbound-statuses button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
#outbound-library .outbound-statuses button:focus-visible { outline-offset: -2px; }
.outbound-status-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.outbound-status-count:empty { display: none; }
#outbound-library .outbound-statuses button[aria-pressed="true"] .outbound-status-count { background: var(--selected); color: var(--ink); }
#outbound-library #outbound-result-count { padding: 0; color: var(--quiet); font-size: 13px; }

#outbound-library .outbound-library-toolbar { gap: 8px 12px; padding: 12px 0; border-bottom: 0; }
#outbound-library .outbound-search-actions { gap: 8px; }
#outbound-library .outbound-search-actions .search-field { flex: 0 1 280px; height: 32px; padding-inline: 8px; }
#outbound-library .outbound-search-actions .search-field input { font-size: 13px; }
#outbound-library .outbound-library-toolbar .button { min-height: 32px; }
#outbound-library .outbound-view-actions select { min-height: 32px; max-width: min(200px, 100%); }
#outbound-library #toggle-outbound-filters[aria-expanded="true"] { border-color: var(--control-line-hover, var(--control-line)); background: var(--selected); }
#outbound-library .outbound-filter-icon { color: currentColor; }
#outbound-library .outbound-filter-count { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: var(--surface); font-size: 11px; font-weight: 600; line-height: 16px; }
#outbound-library .outbound-text-action { min-height: 32px; padding: 0 8px; border-radius: var(--radius-md); color: var(--muted); font-size: 13px; }
#outbound-library .outbound-text-action:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
#outbound-library .outbound-filter-fields { gap: 12px 16px; margin-bottom: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#outbound-library .outbound-filter-fields label { gap: 6px; color: var(--ink); font-size: 13px; }
#outbound-library .outbound-selection { gap: 8px; margin-bottom: 8px; padding: 6px 8px 6px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
#outbound-library .outbound-selection .button { min-height: 28px; padding-inline: 10px; font-size: 13px; }
#outbound-library #outbound-library-error { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--danger-line, var(--line)); border-radius: var(--radius-md); background: var(--danger-soft); }

#outbound-library #outbound-results { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#outbound-results .outbound-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#outbound-results .outbound-table thead th { height: 40px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--inset); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
#outbound-results .outbound-table tbody :is(th, td) { height: 56px; padding: 8px 12px; border-bottom: 1px solid var(--soft-line); vertical-align: middle; }
#outbound-results .outbound-table tbody tr { position: relative; }
#outbound-results .outbound-table tbody tr:last-child > * { border-bottom: 0; }
#outbound-results .outbound-table tbody tr:is(:hover, :focus-within) { background: var(--hover); }
#outbound-results .outbound-table tbody tr:has(input:checked) { background: var(--accent-soft); }
#outbound-results .outbound-table .outbound-row-select { position: relative; z-index: 1; width: 44px; padding-inline: 16px 4px; }
#outbound-results .outbound-row-select input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
#outbound-results .outbound-table td { max-width: 220px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#outbound-results .outbound-table td[data-column="status"] { overflow: visible; }
#outbound-results .outbound-table :is(td, th)[data-column="sent"] { text-align: end; }
#outbound-results .outbound-table td:is([data-column="sent"], [data-column="updated"]) { font-variant-numeric: tabular-nums; }
#outbound-results .outbound-table td[data-column="sender"] { min-width: 0; max-width: 200px; }
#outbound-results .outbound-table .outbound-cell-clip { max-width: 180px; }
#outbound-results .outbound-table th[scope="row"] { width: 40%; min-width: 280px; }
#outbound-results .outbound-row-link { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; max-width: 520px; min-height: 40px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink); text-align: start; white-space: normal; overflow-wrap: normal; text-decoration: none; }
#outbound-results .outbound-row-link:hover { color: var(--ink); text-decoration: none; }
#outbound-results .outbound-row-link::after { content: ''; position: absolute; inset: 0; }
#outbound-results .outbound-row-link:focus-visible { outline: none; }
#outbound-results .outbound-row-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
.outbound-row-text { display: grid; gap: 2px; min-width: 0; }
.outbound-row-name { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.outbound-row-meta { overflow: hidden; color: var(--quiet); font-size: 12px; font-weight: 400; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
#outbound-results .outbound-table .outbound-row-open { width: 40px; padding-inline: 4px 12px; color: var(--quiet); }
#outbound-results .outbound-row-open .icon { opacity: 0; transition: opacity 120ms ease; }
#outbound-results tr:is(:hover, :focus-within) .outbound-row-open .icon { opacity: 1; }

/* Empty / loading states */
#outbound-results .outbound-empty { min-height: 320px; gap: 6px; padding: 48px 24px; }
#outbound-results .outbound-empty-mark { width: 40px; height: 40px; margin-bottom: 8px; border: 0; border-radius: 50%; background: var(--hover); color: var(--muted); box-shadow: none; }
#outbound-results .outbound-empty-mark .icon { transform: none; }
#outbound-results .outbound-empty h3 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
#outbound-results .outbound-empty p { max-width: 360px; font-size: 13px; line-height: 1.5; }
#outbound-library .outbound-empty .button { min-height: 32px; margin-top: 10px; }

/* ---------- Message builder ---------- */
/* The editor is a focused full-width surface: hide the Outbound sub-nav while it is open. */
#outbound-area:has(> #outbound-view:not([hidden]) > #outbound-editor:not([hidden])) { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#outbound-area:has(> #outbound-view:not([hidden]) > #outbound-editor:not([hidden])) > #outbound-navigation { display: none; }
#outbound-view:has(> #outbound-editor:not([hidden])) { padding: 0; scroll-padding-top: 80px; }
#outbound-view #outbound-editor { max-width: none; margin: 0; }

#outbound-editor .outbound-editor-header { position: sticky; top: 0; z-index: 6; gap: 0; padding: 0 var(--desk-space, 24px); border-bottom: 1px solid var(--line); background: var(--surface); }
#outbound-editor .outbound-editor-heading { flex-wrap: nowrap; gap: 12px; min-height: 56px; padding-block: 8px; }
#outbound-editor .outbound-title { flex: 1 1 auto; gap: 8px; min-width: 0; }
#outbound-editor #back-outbound { width: 32px; min-height: 32px; margin-inline-start: -6px; border: 0; background: transparent; color: var(--muted); }
#outbound-editor #back-outbound:hover { background: var(--hover); color: var(--ink); }
#outbound-editor .outbound-title .outbound-row-icon { width: 28px; height: 28px; }
#outbound-editor .outbound-title h2 { min-width: 0; overflow: hidden; font-size: 16px; line-height: 1.3; letter-spacing: -.005em; text-overflow: ellipsis; white-space: nowrap; }
#outbound-editor .outbound-title .desk-title-field { flex: 0 1 auto; min-width: 10ch; max-width: min(520px, 100%); height: 32px; padding: 0 8px; font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
#outbound-editor .outbound-top-actions { flex: none; flex-wrap: nowrap; gap: 8px; }
#outbound-editor .sequence-top-actions .button { min-height: 32px; }
#outbound-editor .outbound-top-actions .icon-button { width: 32px; padding: 0; }
#outbound-editor #review-outbound .icon { margin-inline-end: -4px; }
#outbound-editor .outbound-more-menu:not(:has(.desk-actions-items > :not([hidden]))) { display: none; }
#outbound-editor .outbound-more-menu .action-ellipsis { font-size: 20px; font-weight: 600; line-height: .5; letter-spacing: -1px; }
#outbound-editor .outbound-more-menu .desk-actions-items { inset: calc(100% + 6px) 0 auto auto; }
#outbound-editor #outbound-error { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger-ink); font-size: 13px; }

#outbound-editor .outbound-editor-form { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); align-items: start; gap: 20px; margin: 0; padding: 20px var(--desk-space, 24px) 32px; }
#outbound-editor .outbound-steps { display: grid; gap: 12px; min-width: 0; }

/* Step cards: numbered, collapsible, summary line when collapsed. */
#outbound-editor .outbound-step { display: block; min-width: 0; padding: 0; overflow: visible; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#outbound-editor .outbound-step:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#outbound-editor .outbound-step-card > .outbound-step-header { display: flex; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 12px; min-height: 60px; margin: 0; padding: 12px 16px; border: 0; border-radius: var(--radius-lg); cursor: pointer; list-style: none; }
#outbound-editor .outbound-step-card[open] > .outbound-step-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
#outbound-editor .outbound-step-card > .outbound-step-header::-webkit-details-marker { display: none; }
#outbound-editor .outbound-step-card > .outbound-step-header:hover { background: var(--hover); }
#outbound-editor .outbound-step-card > .outbound-step-header:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
#outbound-editor .outbound-step-card > .outbound-step-header::after { content: ''; flex: none; width: 7px; height: 7px; margin: -4px 4px 0 auto; border-right: 1.5px solid var(--quiet); border-bottom: 1.5px solid var(--quiet); transform: rotate(45deg); transition: transform 140ms ease; }
#outbound-editor .outbound-step-card[open] > .outbound-step-header::after { margin-top: 4px; transform: rotate(-135deg); }
.outbound-step-number { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
#outbound-editor .outbound-step-card[open] .outbound-step-number { background: var(--primary-fill); color: var(--primary-text); }
.outbound-step-title { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
#outbound-editor .outbound-step-title h3 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.outbound-step-line { overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.outbound-step-line:empty { display: none; }
#outbound-editor #outbound-preview-format { padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 400; }
#outbound-preview-format:not(:empty) + [data-outbound-summary]:not(:empty)::before { content: '·'; margin-inline: 6px; color: var(--quiet); }
#outbound-editor .outbound-step-card[open] [data-outbound-summary] { display: none; }
#outbound-editor .outbound-step-body { display: grid; gap: 14px; min-width: 0; padding: 4px 16px 16px; }
#outbound-editor .outbound-studio-layout.outbound-step-body { grid-template-columns: minmax(0, 1fr); }
#outbound-editor .outbound-studio-settings { gap: 14px; padding: 0; border: 0; }
#outbound-editor .outbound-primary-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#outbound-editor .outbound-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Fields inside the builder: 13px/500 ink labels, 6px gap. */
#outbound-form label:not(.outbound-check, .outbound-device, .outbound-insert-variable, .outbound-canvas-subject, #outbound-write-message, .desk-choice-group label) { gap: 6px; color: var(--ink); font-size: 13px; font-weight: 500; }
#outbound-form .desk-choice-group legend { margin-bottom: 6px; color: var(--ink); font-size: 13px; font-weight: 500; }
#outbound-form .outbound-check { gap: 8px; color: var(--ink); font-size: 13px; font-weight: 400; line-height: 1.4; }
#outbound-form .outbound-check input { accent-color: var(--accent); }
#outbound-form .sequence-trigger-note { color: var(--muted); font-size: 13px; line-height: 1.45; }
#outbound-editor .outbound-disclosure { border-top: 1px solid var(--soft-line); }
#outbound-editor .outbound-disclosure > summary { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 0 0; color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; list-style: none; }
#outbound-editor .outbound-disclosure > summary::-webkit-details-marker { display: none; }
#outbound-editor .outbound-disclosure > summary::before { content: ''; flex: none; width: 6px; height: 6px; margin-inline: 2px 2px; border-right: 1.5px solid var(--quiet); border-bottom: 1.5px solid var(--quiet); transform: rotate(-45deg); transition: transform 140ms ease; }
#outbound-editor .outbound-disclosure[open] > summary::before { transform: rotate(45deg); }
#outbound-editor .outbound-details-content { gap: 12px; margin-top: 10px; }
#outbound-editor .outbound-editor-tools { gap: 8px; }
#outbound-editor .outbound-editor-tools .button { min-height: 28px; }
#outbound-form .outbound-studio-settings input[type="file"] { padding: 6px 8px; font-size: 12px; }

/* "Display as": three style tiles instead of a boxed radio list. */
#outbound-form #outbound-presentation-label { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; border: 0; background: none; }
#outbound-form #outbound-presentation-label legend { float: left; grid-column: 1 / -1; width: 100%; margin-bottom: 6px; }
#outbound-form #outbound-presentation-label label { flex-direction: column; justify-content: center; gap: 6px; min-height: 68px; padding: 10px 6px; border: 1px solid var(--control-line); border-radius: var(--radius-md); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.25; text-align: center; }
#outbound-form #outbound-presentation-label label:has(> input:enabled):hover { border-color: var(--control-line-hover, var(--control-line)); background: var(--hover); }
#outbound-form #outbound-presentation-label label:has(> input:checked) { border-color: var(--ink); background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
#outbound-form #outbound-presentation-label input { position: absolute; opacity: 0; pointer-events: none; }
#outbound-form #outbound-presentation-label .icon { color: currentColor; }

/* Audience summary */
#outbound-editor #outbound-audience-summary:empty { display: none; }
#outbound-editor #outbound-audience-summary { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--soft-line); border-radius: var(--radius-md); background: var(--inset); }
#outbound-editor .outbound-recipient-count { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
#outbound-editor #outbound-audience-summary > p { margin: 0; }
#outbound-editor :is(.outbound-audience-sample, .outbound-exclusions) { margin-top: 6px; color: var(--muted); font-size: 13px; }
#outbound-editor :is(.outbound-audience-sample, .outbound-exclusions) > summary { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; cursor: pointer; list-style: none; }
#outbound-editor :is(.outbound-audience-sample, .outbound-exclusions) > summary::-webkit-details-marker { display: none; }
#outbound-editor :is(.outbound-audience-sample, .outbound-exclusions) > summary::before { content: ''; flex: none; width: 6px; height: 6px; margin-inline: 2px; border-right: 1.5px solid var(--quiet); border-bottom: 1.5px solid var(--quiet); transform: rotate(-45deg); transition: transform 140ms ease; }
#outbound-editor :is(.outbound-audience-sample, .outbound-exclusions)[open] > summary::before { transform: rotate(45deg); }
#outbound-editor .outbound-sample li { padding: 8px 0; border-top: 1px solid var(--soft-line); font-size: 13px; }
#outbound-editor .outbound-sample small { color: var(--quiet); font-size: 12px; }
#outbound-editor .outbound-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 6px; }
#outbound-editor .outbound-totals div { padding: 8px 10px; border: 1px solid var(--soft-line); border-radius: var(--radius-md); background: var(--surface); }
#outbound-editor .outbound-totals dt { color: var(--muted); font-size: 12px; }
#outbound-editor .outbound-totals dd { margin: 2px 0 0; color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
#outbound-editor .outbound-issues { margin: 4px 0 0; color: var(--danger-ink); font-size: 13px; }
#outbound-editor #outbound-recipient-selection { align-items: center; justify-content: space-between; }
#outbound-editor #outbound-recipient-count { margin: 0; color: var(--ink); font-size: 13px; font-weight: 500; }

/* Experiment results */
#outbound-experiment-results h4 { margin: 4px 0 8px; font-size: 13px; font-weight: 600; }
#outbound-experiment-results table { width: 100%; border-collapse: collapse; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); font-size: 13px; }
#outbound-experiment-results :is(th, td) { height: 36px; padding: 0 10px; border-bottom: 1px solid var(--soft-line); text-align: start; }
#outbound-experiment-results thead th { background: var(--inset); color: var(--muted); font-size: 12px; font-weight: 500; }
#outbound-experiment-results td { font-variant-numeric: tabular-nums; }
#outbound-experiment-results p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

/* Canvas: sticky preview column. */
#outbound-editor .outbound-canvas { position: sticky; top: 77px; display: flex; flex-direction: column; min-width: 0; height: calc(100dvh - 48px - 57px - 40px); min-height: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--inset); }
#outbound-editor .outbound-canvas-toolbar { flex: none; gap: 8px; min-height: 48px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
#outbound-editor .outbound-device { margin-inline-start: auto; }
#outbound-editor .outbound-device select { min-height: 28px; }
/* Compose / Preview segmented control */
#outbound-editor .outbound-canvas-modes { gap: 2px; padding: 2px; border: 0; border-radius: var(--radius-md); background: var(--hover); }
#outbound-editor .outbound-canvas-modes button { min-height: 28px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
#outbound-editor .outbound-canvas-modes button:hover { color: var(--ink); }
#outbound-editor .outbound-canvas-modes [aria-pressed="true"] { border: 0; background: var(--elevated, var(--surface)); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
#outbound-editor .outbound-canvas-scene { flex: 1 1 auto; min-height: 0; overflow: auto; padding: clamp(16px, 3vw, 40px); background: var(--inset); }
#outbound-editor .outbound-canvas-window { min-height: 100%; grid-template-rows: minmax(24px, 1fr) auto auto auto; gap: 8px 0; }

/* In-app message: Messenger card above a launcher. */
#outbound-editor .outbound-message-surface { border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-pop); }
#outbound-editor .outbound-message-surface:focus-within { border-color: var(--control-line-hover, var(--control-line)); }
#outbound-editor .outbound-canvas-sender { gap: 10px; padding: 14px 16px 4px; border-bottom: 0; background: transparent; font-size: 13px; }
#outbound-editor .outbound-canvas-sender strong { font-weight: 600; }
#outbound-editor .outbound-canvas-sender small { color: var(--quiet); font-size: 12px; }
#outbound-editor .outbound-canvas-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--selected); color: var(--ink); font-size: 12px; font-weight: 600; }
#outbound-form #outbound-write-message textarea { min-height: 120px; padding: 10px 16px 12px; font-size: 14px; line-height: 1.55; }
#outbound-form #outbound-write-message textarea:focus { box-shadow: none; }
#outbound-editor #outbound-preview-copy { padding: 10px 16px 14px; font-size: 14px; line-height: 1.55; }
#outbound-editor .outbound-message-inserts { gap: 6px; padding: 8px 10px; border-top: 1px solid var(--soft-line); background: transparent; }
#outbound-editor .outbound-message-inserts select { min-height: 28px; }
#outbound-editor .outbound-message-inserts .button { min-height: 28px; padding: 0 10px; font-size: 13px; }
#outbound-editor .outbound-canvas-reply { min-height: 40px; padding: 0 12px 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--quiet); font-size: 13px; box-shadow: var(--shadow-sm); }
#outbound-editor .outbound-canvas-scene:is([data-presentation="message"], [data-presentation="teaser"]) .outbound-canvas-window::after { content: ''; grid-area: 4 / 2 / 5 / 3; justify-self: end; width: 48px; height: 48px; margin-top: 8px; border-radius: 50%; background: var(--primary-fill); box-shadow: var(--shadow-pop); }
#outbound-editor [data-presentation="teaser"] .outbound-message-surface { border-inline-start: 1px solid var(--line); border-radius: var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-xl); }
#outbound-editor .outbound-preview-action { padding: 8px 14px; border-radius: var(--radius-md); font-size: 13px; }
#outbound-editor .outbound-preview-image { border-radius: var(--radius-md); }

/* Email: white paper inside the light gray frame. */
#outbound-editor [data-presentation="email"] .outbound-canvas-window { grid-template-rows: auto 1fr; }
#outbound-editor [data-presentation="email"] .outbound-message-surface { width: min(100%, 640px); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
#outbound-editor [data-presentation="email"] .outbound-canvas-sender { padding: 16px 20px 14px; border-bottom: 1px solid var(--soft-line); }
#outbound-form [data-presentation="email"] .outbound-canvas-subject { min-height: 44px; padding-inline: 20px; color: var(--muted); font-size: 13px; font-weight: 500; }
#outbound-form [data-presentation="email"] .outbound-canvas-subject input { min-height: 40px; color: var(--ink); font-size: 14px; font-weight: 500; }
#outbound-form [data-presentation="email"] .outbound-canvas-subject input:focus { box-shadow: none; }
#outbound-editor [data-presentation="email"] .outbound-preview-subject { padding: 18px 20px 0; font-size: 18px; font-weight: 600; line-height: 1.3; }
#outbound-form [data-presentation="email"] #outbound-write-message textarea { min-height: 220px; padding: 16px 20px; }
#outbound-editor [data-presentation="email"] #outbound-preview-copy { padding: 12px 20px 18px; }
#outbound-editor [data-presentation="email"] .outbound-preview-image { margin: 16px 20px 0; width: calc(100% - 40px); }
#outbound-editor [data-presentation="email"] #outbound-canvas-action { padding: 0 20px 20px; }

/* Website banner: a strip across a faux page. */
#outbound-editor [data-presentation="banner"] .outbound-canvas-window { min-height: 360px; grid-template-rows: auto auto auto 1fr; align-content: start; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
#outbound-editor [data-presentation="banner"] .outbound-canvas-window::after { content: ''; grid-row: 4; grid-column: 1 / -1; align-self: stretch; min-height: 180px; margin: 28px 32px; background: linear-gradient(var(--inset), var(--inset)) 0 0 / 38% 18px no-repeat, linear-gradient(var(--inset), var(--inset)) 0 40px / 72% 10px no-repeat, linear-gradient(var(--inset), var(--inset)) 0 60px / 64% 10px no-repeat, linear-gradient(var(--inset), var(--inset)) 0 100px / 30% 96px no-repeat, linear-gradient(var(--inset), var(--inset)) 50% 100px / 30% 96px no-repeat, linear-gradient(var(--inset), var(--inset)) 100% 100px / 30% 96px no-repeat; }
#outbound-editor [data-presentation="banner"] .outbound-message-surface { border: 0; border-radius: 0; background: var(--primary-fill); color: var(--primary-text); box-shadow: none; }
#outbound-form [data-presentation="banner"] #outbound-write-message textarea { min-height: 56px; color: var(--primary-text); text-align: center; }
#outbound-form [data-presentation="banner"] #outbound-write-message textarea::placeholder { color: color-mix(in srgb, var(--primary-text) 60%, transparent); }
#outbound-editor [data-presentation="banner"] #outbound-preview-copy { color: var(--primary-text); text-align: center; font-weight: 500; }
#outbound-editor [data-presentation="banner"] .outbound-message-inserts { justify-content: center; border-top-color: var(--soft-line); background: var(--surface); color: var(--ink); }
#outbound-editor [data-preview-width="mobile"] .outbound-canvas-window { max-width: 360px; }

/* ---------- Interactive content + Tours and tooltips ---------- */
#outbound-area :is(#engagement-view, #site-guides-view) { background: var(--page); }
#outbound-area :is(#engagement-view, #site-guides-view) > * { max-width: 1200px; margin-inline: auto; }
#engagement-view #engagement-content, #engagement-view #engagement-feedback { margin: 0 auto; max-width: 1200px; }
#engagement-view #engagement-feedback:not([hidden]), #site-guides-view #site-guides-error:not([hidden]) { margin-bottom: 16px; padding: 10px 14px; border: 1px solid var(--danger-line, var(--line)); border-radius: var(--radius-md); background: var(--danger-soft); }
#outbound-area .outbound-page-header { align-items: center; margin-bottom: 20px; }
#outbound-area .outbound-page-header h2 { font-size: var(--desk-heading, 20px); }
.engagement-loading { padding: 48px 0; color: var(--muted); font-size: 13px; text-align: center; }

/* "New" split menus in page headers */
#outbound-area .outbound-new-menu > summary.button.primary { gap: 6px; padding-inline: 12px 10px; }
#outbound-area .outbound-new-menu > summary .down-caret { margin-inline-start: 2px; border-color: currentColor; opacity: .8; }
#outbound-area .outbound-new-menu[open] > summary.button.primary { border-color: var(--primary-hover); background: var(--primary-hover); color: var(--primary-text); }
#outbound-area .outbound-new-menu .desk-actions-items { min-width: 300px; }
.workspace #outbound-area .outbound-new-menu .desk-actions-items .button { align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; }
#outbound-area .outbound-new-menu .desk-actions-items .outbound-row-icon { width: 30px; height: 30px; }
#outbound-area .outbound-new-menu .desk-actions-items strong { display: block; color: var(--ink); font-size: 13px; font-weight: 500; }
#outbound-area .outbound-new-menu .desk-actions-items small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; font-weight: 400; }
#outbound-area .outbound-row-icon .icon { color: inherit; }

/* List tables */
#outbound-area .engagement-table-wrap { border-radius: var(--radius-lg); }
#outbound-area .outbound-list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#outbound-area .outbound-list-table thead th { height: 40px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--inset); color: var(--muted); font-size: 12px; font-weight: 500; text-align: start; white-space: nowrap; }
#outbound-area .outbound-list-table thead th:first-child { padding-inline-start: 16px; }
#outbound-area .outbound-list-table tbody tr { position: relative; }
#outbound-area .outbound-list-table tbody :is(th, td) { height: 56px; padding: 8px 12px; border-bottom: 1px solid var(--soft-line); color: var(--muted); text-align: start; vertical-align: middle; white-space: nowrap; }
#outbound-area .outbound-list-table tbody th { width: 45%; padding-inline-start: 16px; }
#outbound-area .outbound-list-table tbody tr:last-child > * { border-bottom: 0; }
#outbound-area .outbound-list-table tbody tr:is(:hover, :focus-within) { background: var(--hover); }
#outbound-area .outbound-list-table .outbound-row-link { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 260px; max-width: 560px; min-height: 40px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink); text-align: start; white-space: normal; overflow-wrap: normal; }
#outbound-area .outbound-list-table .outbound-row-link:hover { background: none; color: var(--ink); }
#outbound-area .outbound-list-table .outbound-row-link::after { content: ''; position: absolute; inset: 0; }
#outbound-area .outbound-list-table .outbound-row-link:focus-visible { outline: none; }
#outbound-area .outbound-list-table .outbound-row-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
#outbound-area .outbound-list-table .outbound-row-name { color: var(--ink); font-size: 14px; font-weight: 500; }
#outbound-area .outbound-list-table .outbound-row-meta { color: var(--quiet); font-size: 12px; }
#outbound-area .outbound-list-table td time { font-variant-numeric: tabular-nums; }
#outbound-area .outbound-row-count { color: var(--quiet); }
#outbound-area .outbound-list-table .outbound-row-open { width: 40px; padding-inline: 4px 12px; color: var(--quiet); }
#outbound-area .outbound-list-table .outbound-row-open .icon { opacity: 0; transition: opacity 120ms ease; }
#outbound-area .outbound-list-table tr:is(:hover, :focus-within) .outbound-row-open .icon { opacity: 1; }

/* Empty state with type cards */
#outbound-area .engagement-start { display: grid; justify-items: center; gap: 4px; padding: 40px 24px 48px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#outbound-area .engagement-start .desk-empty { padding: 0 0 20px; }
#outbound-area :is(.engagement-start, #outbound-results) .desk-empty p { text-wrap: balance; }
.engagement-type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: min(100%, 880px); }
.engagement-type-grid.site-guide-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 520px); }
.engagement-type-card { display: grid; justify-items: start; align-content: start; gap: 4px; min-height: 128px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); text-align: start; transition: border-color 120ms ease, box-shadow 120ms ease; }
.engagement-type-card:hover { border-color: var(--control-line-hover, var(--control-line)); box-shadow: var(--shadow-sm); }
.engagement-type-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.engagement-type-card .outbound-row-icon { margin-bottom: 10px; }
.engagement-type-card strong { font-size: 14px; font-weight: 600; }
.engagement-type-card small { color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Editors: header bar, settings + steps on the left, live preview on the right. */
#outbound-area :is(#engagement-view, #site-guides-view) .desk-content-editor-header { top: -24px; z-index: 4; min-height: 64px; margin: 0 0 20px; padding: 12px 0; border-bottom: 1px solid var(--line); background: var(--page); }
#outbound-area .desk-content-editor-header :is(.engagement-editor-header, .site-guide-heading) { gap: 8px; }
#outbound-area .desk-content-editor-header h3 { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
#outbound-area .desk-content-editor-header .outbound-row-icon { width: 28px; height: 28px; }
#outbound-area .engagement-back { width: 32px; min-height: 32px; margin-inline-start: -6px; border: 0; background: transparent; color: var(--muted); }
#outbound-area .engagement-back:hover { background: var(--hover); color: var(--ink); }
#outbound-area .desk-content-editor-header :is(.engagement-actions, .site-guide-actions) { gap: 8px; }
#outbound-area .desk-content-editor-grid.engagement-editor-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); align-items: start; gap: 20px; border: 0; border-radius: 0; background: none; }
#outbound-area .engagement-editor-column { display: grid; gap: 20px; min-width: 0; }
#outbound-area .engagement-editor-grid .desk-content-editor-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#outbound-area .engagement-editor-grid .desk-content-editor-settings > :is(h4, label:has(textarea), .engagement-fields, label:has([data-field="title"], [data-guide-field="title"])) { grid-column: 1 / -1; }
#outbound-area .engagement-editor-grid .desk-content-editor-settings h4 { margin: 0 0 2px; color: var(--ink); font-size: 15px; font-weight: 600; }
#outbound-area .engagement-editor-grid .desk-content-editor-settings .engagement-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
#outbound-area .engagement-editor-grid .desk-content-editor-main { display: grid; gap: 12px; padding: 0; border-radius: 0; background: none; }
#outbound-area .engagement-steps-heading { display: flex; align-items: center; gap: 8px; }
#outbound-area .engagement-steps-heading h4 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; }
#outbound-area #engagement-content label, #outbound-area #site-guides-content label { gap: 6px; color: var(--ink); font-size: 13px; font-weight: 500; }
#outbound-area #engagement-content .engagement-check { font-weight: 400; }
#outbound-area #engagement-content .engagement-check input { accent-color: var(--accent); }

/* Question / task / step cards with a drag-handle look and type badge */
#outbound-area .engagement-edit-steps, #outbound-area .site-guide-steps { gap: 12px; margin: 0; }
#outbound-area .engagement-step { position: relative; display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#outbound-area .engagement-step > legend { float: left; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; margin: 0; padding: 8px 120px 8px 0; border-bottom: 1px solid var(--soft-line); color: var(--ink); font-size: 14px; font-weight: 600; }
#outbound-area .engagement-step-name { white-space: nowrap; }
.engagement-step-handle { flex: none; width: 10px; height: 15px; margin-inline-end: 2px; background: radial-gradient(circle, var(--quiet) 1.25px, transparent 1.6px) 0 0 / 5px 5px; opacity: .8; }
#outbound-area .engagement-step > legend .badge { font-weight: 500; }
#outbound-area .engagement-step > [data-engagement-action="remove-step"] { position: absolute; top: 10px; right: 12px; min-height: 28px; padding: 0 10px; border-color: transparent; background: transparent; color: var(--muted); font-size: 13px; }
#outbound-area .engagement-step > [data-engagement-action="remove-step"]:hover { background: var(--danger-soft); color: var(--danger-ink); }
#outbound-area .site-guide-step > legend { padding-inline-end: 0; }
#outbound-area .site-guide-step-actions { padding-top: 12px; border-top: 1px solid var(--soft-line); }
#outbound-area .site-guide-step-actions .button { min-height: 28px; padding-inline: 10px; font-size: 13px; }
#outbound-area .site-guide-step-actions [data-guide-action="remove-step"] { margin-inline-start: auto; color: var(--danger-ink); }
#outbound-area .site-guide-step-actions [data-guide-action="remove-step"]:hover { background: var(--danger-soft); }
#outbound-area .site-guide-step > [data-guide-action="pick"] { min-height: 28px; font-size: 13px; }
#outbound-area .engagement-branch { padding: 12px 0 0; border-top: 1px solid var(--soft-line); }
#outbound-area .engagement-branch > summary { color: var(--ink); font-size: 13px; font-weight: 500; }
#outbound-area .engagement-branch p { margin: 0; color: var(--muted); font-size: 13px; }
#outbound-area .engagement-rule { padding: 12px; border: 1px solid var(--soft-line); border-radius: var(--radius-md); background: var(--inset); }
#outbound-area .engagement-edit-steps .button, #outbound-area .engagement-rule .button { min-height: 28px; font-size: 13px; }
#outbound-area .desk-content-editor-main > .engagement-actions { margin: 0; }
#outbound-area :is(.engagement-share, .site-guide-share) { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }

/* Live preview column */
#outbound-area .engagement-live-preview { position: sticky; top: 84px; display: grid; min-width: 0; max-height: calc(100dvh - 48px - 88px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--inset); }
#outbound-area .engagement-live-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
#outbound-area .engagement-live-preview-head span { color: var(--ink); font-size: 13px; font-weight: 600; }
#outbound-area .engagement-live-preview-head small { color: var(--quiet); font-size: 12px; }
#outbound-area .engagement-live-preview-frame { min-height: 280px; overflow: auto; padding: 20px; }
#outbound-area .engagement-live-preview-card { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-pop); color: var(--ink); font-size: 14px; }
:is(#outbound-area .engagement-live-preview-card, #engagement-preview [data-preview-content]) > h3 { margin: 0; font-size: 16px; font-weight: 600; }
:is(#outbound-area .engagement-live-preview-card, #engagement-preview [data-preview-content]) > p { margin: 0; color: var(--muted); font-size: 13px; }
:is(#outbound-area .engagement-live-preview-card, #engagement-preview [data-preview-content]) > p:empty { display: none; }
:is(#outbound-area .engagement-live-preview-card, #engagement-preview [data-preview-content]) .widget-task-list > li { padding: 10px 0; border-bottom: 1px solid var(--soft-line); font-size: 14px; }
:is(#outbound-area .engagement-live-preview-card, #engagement-preview [data-preview-content]) .widget-task-list > li::before { content: ''; flex: none; width: 16px; height: 16px; border: 1.5px solid var(--control-line); border-radius: 50%; }
:is(#outbound-area .engagement-live-preview-card, #engagement-preview [data-preview-content]) .widget-task-list { margin: 0; }
:is(#outbound-area .engagement-live-preview-card, #engagement-preview [data-preview-content]) .action-button { justify-self: start; min-height: 32px; padding: 0 14px; border: 0; border-radius: var(--radius-md); background: var(--primary-fill); color: var(--primary-text); font: inherit; font-size: 13px; font-weight: 500; }
:is(#outbound-area .engagement-live-preview-card, #engagement-preview [data-preview-content]) .post-preview-paper { margin: 0; padding: 0; border: 0; }
:is(#outbound-area .engagement-live-preview-card, #engagement-preview [data-preview-content]) article h3 { margin: 0 0 6px; font-size: 15px; }
#engagement-preview [data-preview-content] { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); }

/* Tour preview: tooltip cards per step */
#outbound-area .site-guide-preview-frame { display: grid; align-content: start; gap: 16px; }
.site-guide-preview-step { display: grid; gap: 6px; }
.site-guide-preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.site-guide-preview-meta code { overflow: hidden; max-width: 60%; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--hover); color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.site-guide-preview-card { position: relative; display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-pop); }
.site-guide-preview-card::before { content: ''; position: absolute; width: 10px; height: 10px; border: 1px solid var(--line); border-width: 1px 0 0 1px; background: var(--surface); }
.site-guide-preview-card[data-placement="bottom"]::before { top: -6px; left: 24px; transform: rotate(45deg); }
.site-guide-preview-card[data-placement="top"]::before { bottom: -6px; left: 24px; transform: rotate(225deg); }
.site-guide-preview-card[data-placement="right"]::before { top: 18px; left: -6px; transform: rotate(-45deg); }
.site-guide-preview-card[data-placement="left"]::before { top: 18px; right: -6px; transform: rotate(135deg); }
.site-guide-preview-card[data-placement="center"]::before { display: none; }
.site-guide-preview-card strong { color: var(--ink); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.site-guide-preview-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.site-guide-preview-video { display: flex; align-items: center; gap: 6px; padding: 18px 12px; border-radius: var(--radius-md); background: var(--ink); color: var(--surface); font-size: 12px; overflow-wrap: anywhere; }
.site-guide-preview-footer { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.site-guide-preview-link { color: var(--accent); font-size: 13px; font-weight: 500; }
.site-guide-preview-progress { margin-inline-start: auto; color: var(--quiet); font-size: 12px; font-variant-numeric: tabular-nums; }
.site-guide-preview-next { padding: 4px 12px; border-radius: var(--radius-md); background: var(--primary-fill); color: var(--primary-text); font-size: 12px; font-weight: 500; }

/* Results views */
#outbound-area .engagement-report { display: grid; gap: 16px; }
#outbound-area .engagement-report .desk-content-editor-header { margin-bottom: 4px; }
#outbound-area .engagement-report-filters { display: flex; flex-wrap: wrap; gap: 12px; }
#outbound-area .engagement-report-filters label { width: min(220px, 100%); }
#outbound-area .engagement-report-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
#outbound-area .engagement-report-stats div { min-width: 160px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#outbound-area .engagement-report-stats dt { color: var(--muted); font-size: 13px; }
#outbound-area .engagement-report-stats dd { margin: 4px 0 0; color: var(--ink); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
#outbound-area .engagement-report h4 { margin: 8px 0 0; font-size: 15px; font-weight: 600; }
#outbound-area .engagement-results { width: 100%; border-collapse: collapse; font-size: 13px; }
#outbound-area .engagement-results thead th { height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--inset); color: var(--muted); font-size: 12px; font-weight: 500; text-align: start; white-space: nowrap; }
#outbound-area .engagement-results tbody :is(th, td) { height: 44px; padding: 8px 14px; border-bottom: 1px solid var(--soft-line); text-align: start; }
#outbound-area .engagement-results tbody th { color: var(--ink); font-weight: 500; }
#outbound-area .engagement-results tbody td { color: var(--muted); font-variant-numeric: tabular-nums; }
#outbound-area .engagement-results tbody tr:last-child > * { border-bottom: 0; }
#outbound-area .engagement-results code { padding: 1px 5px; border-radius: var(--radius-sm); background: var(--hover); font-size: 12px; }
#outbound-area .site-guide-metadata { margin: 0; color: var(--muted); font-size: 13px; }
#outbound-area .site-guide-report-tabs { margin: 0; }
#outbound-area .post-results-reactions { margin: 0; padding: 0; }
#outbound-area .post-results-reactions li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; }

/* ---------- Dialogs ---------- */
/* New message: a grid of type cards. */
#outbound-format-dialog { width: min(720px, calc(100% - 32px)); }
#outbound-format-dialog > p { margin: 0 0 16px; font-size: 14px; }
#outbound-format-dialog .outbound-formats { gap: 12px; }
#outbound-format-dialog .outbound-formats button { grid-template-columns: minmax(0, 1fr) 16px; align-content: start; gap: 14px 8px; min-height: 140px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); transition: border-color 120ms ease, box-shadow 120ms ease; }
#outbound-format-dialog .outbound-formats button:hover { border-color: var(--control-line-hover, var(--control-line)); background: var(--surface); box-shadow: var(--shadow-sm); }
#outbound-format-dialog .outbound-formats button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#outbound-format-dialog .outbound-formats .outbound-format-icon { grid-column: 1; width: 36px; height: 36px; border-radius: var(--radius-md); }
#outbound-format-dialog .outbound-formats button > .i-right { grid-area: 1 / 2; align-self: center; color: var(--quiet); }
#outbound-format-dialog .outbound-formats button > span:not(.icon, .outbound-format-icon) { grid-column: 1 / -1; }
#outbound-format-dialog .outbound-formats strong { font-size: 14px; font-weight: 600; }
#outbound-format-dialog .outbound-formats small { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Save view / template / bulk manage */
#outbound-library-dialog #outbound-library-columns { padding: 12px 14px; }
#outbound-library-dialog #outbound-library-columns > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
#outbound-library-dialog #outbound-library-columns label { min-height: 28px; align-items: center; font-weight: 400; }
#outbound-library-dialog #outbound-delete-warning { margin: 0; padding: 10px 12px; border: 1px solid var(--danger-line, var(--line)); border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger-ink); }

/* Send test email */
#outbound-test-dialog > p:not(:empty) { margin: 0; }
#outbound-test-dialog #outbound-test-feedback:not(:empty) { margin-top: 12px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--inset); color: var(--muted); }
#outbound-test-dialog #outbound-test-download { margin-top: 12px; }

/* Version history: a timeline. */
#outbound-versions-dialog { width: min(600px, calc(100% - 32px)); }
#outbound-versions-results { border: 0; background: none; color: var(--muted); font-size: 13px; }
.outbound-version-timeline { display: grid; margin: 4px 0 0; padding: 0; list-style: none; }
.outbound-version-timeline > li { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding-bottom: 20px; }
.outbound-version-timeline > li:last-child { padding-bottom: 0; }
.outbound-version-timeline > li:not(:last-child)::before { content: ''; position: absolute; top: 22px; bottom: 2px; left: 9px; width: 2px; border-radius: 1px; background: var(--line); }
.outbound-version-dot { width: 12px; height: 12px; margin: 5px 4px 0; border: 2px solid var(--control-line); border-radius: 50%; background: var(--surface); }
.outbound-version-timeline > li[aria-current] .outbound-version-dot { border-color: var(--ink); background: var(--ink); }
.outbound-version-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.outbound-version-head strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.outbound-version-head small { margin-inline-start: auto; color: var(--quiet); font-size: 12px; font-variant-numeric: tabular-nums; }
.outbound-version-current { padding: 2px 8px; border-radius: 999px; background: var(--selected); color: var(--ink); font-size: 12px; font-weight: 500; line-height: 16px; }
.outbound-version-entry p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.outbound-version-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.outbound-version-stats div { padding: 6px 10px; border: 1px solid var(--soft-line); border-radius: var(--radius-md); background: var(--inset); }
.outbound-version-stats dt { color: var(--muted); font-size: 12px; }
.outbound-version-stats dd { margin: 2px 0 0; color: var(--ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Email engagement: metric tiles + contact rows */
#outbound-engagement-dialog { width: min(600px, calc(100% - 32px)); }
#outbound-engagement-dialog > p { margin: 0 0 16px; }
#outbound-engagement-dialog [data-engagement-metrics] { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
#outbound-engagement-dialog [data-email-metric] { display: grid; justify-content: start; justify-items: start; align-content: center; gap: 2px; min-height: 64px; height: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 500; text-align: start; }
#outbound-engagement-dialog [data-email-metric] strong { color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
#outbound-engagement-dialog [data-email-metric]:hover { background: var(--hover); }
#outbound-engagement-dialog [data-email-metric][aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
#outbound-engagement-dialog [data-engagement-contacts] { display: grid; margin: 16px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); list-style: none; }
#outbound-engagement-dialog [data-engagement-contacts]:empty { display: none; }
#outbound-engagement-dialog [data-engagement-contacts] li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; min-height: 44px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--soft-line); font-size: 13px; }
#outbound-engagement-dialog [data-engagement-contacts] li:last-child { border-bottom: 0; }
#outbound-engagement-dialog [data-engagement-contacts] li strong { color: var(--ink); font-weight: 500; }
#outbound-engagement-dialog [data-engagement-contacts] li span { color: var(--muted); }
#outbound-engagement-dialog [data-engagement-more] { margin-top: 12px; }

/* Audience debugger result */
#outbound-debug-result:not(:empty) { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--inset); color: var(--ink); font-size: 13px; line-height: 1.5; }
#outbound-debug-result p { margin: 0 0 6px; color: var(--ink); }
#outbound-debug-result ul { margin: 6px 0 0; padding-inline-start: 18px; color: var(--muted); }
#outbound-debug-result li { margin: 2px 0; }

/* Smart links: result rows */
#outbound-smart-links { width: min(560px, calc(100% - 32px)); }
#outbound-smart-links > .search-field { height: 36px; }
#outbound-smart-links #outbound-smart-links-status:not(:empty) { margin: 12px 0 0; }
#outbound-smart-links #outbound-smart-links-results { gap: 6px; margin-top: 12px; }
#outbound-smart-links #outbound-smart-links-results button { gap: 2px 12px; width: 100%; min-height: 52px; height: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); text-align: start; white-space: normal; }
#outbound-smart-links #outbound-smart-links-results button:hover { border-color: var(--control-line-hover, var(--control-line)); background: var(--hover); }
#outbound-smart-links #outbound-smart-links-results strong { color: var(--ink); font-size: 14px; font-weight: 500; }
#outbound-smart-links #outbound-smart-links-results span { justify-self: end; color: var(--muted); font-size: 12px; }
#outbound-smart-links #outbound-smart-links-results small { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* Confirm send */
#outbound-confirm .outbound-confirm-actions { margin-top: 24px; }
#outbound-confirm #outbound-confirm-summary { margin: 0; color: var(--muted); font-size: 14px; }
#outbound-confirm #outbound-confirm-error:not([hidden]) { margin: 12px 0 0; }

/* Survey test email + tour preview launcher */
#survey-email-dialog > p { margin: 0; }
#survey-email-dialog #survey-email-results { justify-content: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
#site-guide-launch-dialog #site-guide-launch-status { margin: 0; }
#site-guide-launch-dialog .dialog-actions { margin-top: 20px; }
#site-guide-launch-dialog #site-guide-launch-link { margin-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  #outbound-area .desk-content-editor-grid.engagement-editor-grid { grid-template-columns: minmax(0, 1fr); }
  #outbound-area .engagement-live-preview { position: static; max-height: none; }
  .engagement-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #outbound-editor .outbound-editor-form { grid-template-columns: minmax(0, 1fr); }
  #outbound-editor .outbound-canvas { position: static; order: -1; height: auto; min-height: 440px; }
}
@media (max-width: 760px) {
  #outbound-editor .outbound-editor-heading { flex-wrap: wrap; }
  #outbound-editor .outbound-top-actions { flex-wrap: wrap; }
  #outbound-editor .outbound-editor-header { position: static; }
  #outbound-editor .outbound-primary-settings, #outbound-editor .outbound-field-grid { grid-template-columns: minmax(0, 1fr); }
  #outbound-area .engagement-editor-grid .desk-content-editor-settings, #outbound-area .engagement-editor-grid .desk-content-editor-settings .engagement-fields { grid-template-columns: minmax(0, 1fr); }
  #outbound-area :is(#engagement-view, #site-guides-view) .desk-content-editor-header { position: static; margin-top: 0; }
  .engagement-type-grid, .engagement-type-grid.site-guide-type-grid { grid-template-columns: minmax(0, 1fr); }
}
