/* The email design picker (assets/js/email-designs.js): /crm-email and the admin Send email pop-up. */
.ed-field { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; max-width: 100%; }
.ed-row { display: flex; gap: 12px; width: 100%; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.ed-wait { padding: 18px 4px; font-size: .84rem; color: #475569; }
.ed-card { flex: 0 0 136px; display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: #000; }
.ed-card b { margin-top: 8px; font-size: .84rem; font-weight: 700; color: #000; }
.ed-card small { font-size: .72rem; line-height: 1.3; color: #475569; }
.ed-thumb { position: relative; display: block; width: 136px; height: 170px; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px #e2e8f0, 0 4px 12px rgba(15, 23, 42, .07); transition: box-shadow .15s, transform .15s; }
.ed-thumb iframe { position: absolute; top: 0; left: 0; width: 640px; height: 800px; border: 0; transform: scale(.2125); transform-origin: 0 0; pointer-events: none; }
.ed-card:hover .ed-thumb { transform: translateY(-2px); box-shadow: 0 0 0 1px #cbd5e1, 0 8px 18px rgba(15, 23, 42, .12); }
.ed-card:focus-visible { outline: none; }
.ed-card:focus-visible .ed-thumb { box-shadow: 0 0 0 3px #0b8a55; }
.ed-card.is-on .ed-thumb { box-shadow: 0 0 0 2.5px #0b8a55, 0 6px 16px rgba(11, 138, 85, .2); }
.ed-tick { display: none; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: #0b8a55; color: #fff; font-size: .8rem; line-height: 24px; text-align: center; }
.ed-card.is-on .ed-tick { display: block; }

/* The preview sits over everything, the admin pop-up included. */
.ed-over { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, .55); }
.ed-panel { display: flex; flex-direction: column; width: 100%; max-width: 760px; height: 100%; max-height: 900px; overflow: hidden; border-radius: 20px; background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); }
.ed-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px 20px; }
.ed-head > b { flex: 1 1 auto; font-size: 1rem; font-weight: 700; color: #000; }
.ed-x { flex: none; width: 38px; height: 38px; border: 0; border-radius: 12px; background: #f1f5f9; color: #000; cursor: pointer; }
.ed-tabs { display: flex; gap: 6px; padding: 0 20px 12px; overflow-x: auto; scrollbar-width: none; }
.ed-tabs .pill-tab { flex: none; }
.ed-stage { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; padding: 14px; background: #eef1f5; overflow: hidden; }
.ed-stage iframe { width: 100%; max-width: 680px; height: 100%; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(15, 23, 42, .1); }
.ed-stage.is-phone iframe { max-width: 390px; }
.ed-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid #e2e8f0; }
.ed-desc { min-width: 0; font-size: .84rem; color: #475569; }
.ed-use { flex: none; }

@media (max-width: 640px) {
    .ed-over { padding: 0; }
    .ed-panel { max-width: none; max-height: none; border-radius: 0; }
    .ed-size { display: none; }
    .ed-stage { padding: 0; }
    .ed-stage iframe, .ed-stage.is-phone iframe { max-width: none; border-radius: 0; box-shadow: none; }
    .ed-desc { display: none; }
    .ed-use { width: 100%; }
}

/* /crm-email: four tabs fit their column by wrapping, and space around the top fields. */
.lp2-email .sms-tab-bar-sec { flex-wrap: wrap; gap: 4px; height: auto; }
.lp2-email .sms-tab-bar-sec .sms-tab { flex: 1 1 auto; white-space: nowrap; }
.lp2-email .em-subject { margin: 0 0 12px; }

/* The rich text box for writing an email (assets/js/rich-text.js). */
.rte { border: 1px solid var(--border); border-radius: 12px; background: var(--surface, #fff); overflow: hidden; }
.rte:focus-within { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); }
.lp2-sms .rte { margin-top: 12px; border-color: var(--lp2-line); }
.lp2-sms .rte:focus-within { border-color: var(--lp2-h3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lp2-h3) 18%, transparent); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 6px; background: #f8fafc; border-bottom: 1px solid #eef1f5; }
.rte .rte-btn { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; box-shadow: none; color: #000; font-size: 1.06rem; line-height: 1; cursor: pointer; }
.rte .rte-btn:hover { background: #e9eef3; }
.rte .rte-btn.is-on { background: #d9f3e6; color: #08704a; }
.rte-sep { flex: none; width: 1px; height: 20px; margin: 0 4px; background: #dbe2ea; }
.rte-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 8px; background: #f8fafc; border-bottom: 1px solid #eef1f5; }
.rte-link[hidden], .rte .rte-link input[hidden] { display: none; }
.rte .rte-link input { flex: 1 1 150px; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid #dbe2ea; border-radius: 9px; background: #fff; font-size: .88rem; }
.rte-link button { flex: none; height: 36px; min-height: 0; padding: 0 12px; border: 1px solid #dbe2ea; border-radius: 9px; background: #fff; color: #000; font-size: .84rem; font-weight: 600; cursor: pointer; }
.rte .rte-link .rte-link-go { border-color: #0b8a55; background: #0b8a55; color: #fff; }
.rte-link button[hidden] { display: none; }
.rte-area { position: relative; min-height: 170px; max-height: 440px; overflow-y: auto; padding: 12px 13px; font-size: .92rem; line-height: 1.55; color: #000; outline: 0; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.rte-area.is-empty::before { content: attr(data-placeholder); position: absolute; top: 12px; left: 13px; right: 13px; color: #64748b; pointer-events: none; }
.rte .rte-area p, .rte-show p { margin: 0 0 10px; }
.rte .rte-area h3, .rte-show h3 { margin: 12px 0 6px; font-size: 1.06rem; line-height: 1.35; font-weight: 700; color: #000; }
.rte .rte-area ul, .rte-show ul { margin: 0 0 10px; padding-left: 22px; list-style: disc; }
.rte .rte-area ol, .rte-show ol { margin: 0 0 10px; padding-left: 22px; list-style: decimal; }
.rte .rte-area li, .rte-show li { margin: 0 0 4px; }
.rte .rte-area a, .rte-show a { color: #08704a; text-decoration: underline; }
.rte .rte-area img, .rte-show img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.rte .rte-area img { cursor: pointer; }
.rte .rte-area img.is-on { outline: 3px solid #0b8a55; outline-offset: 2px; }
.rte.is-busy .rte-area { opacity: .5; pointer-events: none; }
.rte-file[hidden], .rte-pic[hidden] { display: none; }
.rte-pic { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 8px; background: #f8fafc; border-bottom: 1px solid #eef1f5; }
.rte .rte-pic input { flex: 1 1 150px; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid #dbe2ea; border-radius: 9px; background: #fff; font-size: .88rem; }
.rte-pic button { flex: none; height: 36px; min-height: 0; padding: 0 12px; border: 1px solid #dbe2ea; border-radius: 9px; background: #fff; color: #000; font-size: .84rem; font-weight: 600; cursor: pointer; }
.rte .rte-area a.button, .rte-show a.button { display: inline-block; padding: 9px 22px; border-radius: 999px; background: #0b8a55; color: #fff; font-weight: 600; text-decoration: none; }
.rte .rte-area > :last-child, .rte-show > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
    /* The tools on two even rows, big enough to tap. */
    .rte-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; }
    .rte-sep { display: none; }
    .rte .rte-btn { width: 100%; height: 40px; }
    /* Below 16px a phone zooms in when the box is tapped. */
    .rte-area, .rte .rte-link input, .rte .rte-pic input { font-size: 16px; }
}
