/* HTML email builder — tool-specific styles.
   Everything is scoped under .emb (or .emb-page) so nothing leaks into the
   site shell, and prefixed rules beat site.css's element defaults.
   Tokens (--navy, --red, --cream, --font-display, --font-serif, --font-sans,
   --card-shadow, --btn-shadow) come from assets/site.css.

   The *editor* follows the site brand. The *email it generates* is styled by
   the locked tokens at the top of tool.js (web-safe fonts only) — the two are
   deliberately independent. */

/* ---------- page ----------
   The page scrolls normally (setup screen, template editor); only the
   block-letter editor locks to viewport height for its three independently
   scrolling panes — tool.js toggles .emb-lock on <body> for that mode. */

.emb-page.emb-lock { height: 100vh; height: 100dvh; overflow: hidden; }
.emb-page .site-main.emb-main {
  max-width: none; padding: 0;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}
.emb-main > section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.emb-main > section[hidden], .emb-main [hidden] { display: none !important; }

.emb {
  --emb-line: rgba(44, 54, 89, 0.2);
  --emb-stage: #E9E6D8;           /* warm gray behind the preview frames */
  --emb-field: #fff;

  flex: 1; min-height: 0;
  display: flex;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--navy);
  background: var(--cream);
}

/* Display-face kicker, used for every small caps label in the tool. */
.emb-kicker {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
  margin: 0 0 10px;
  color: var(--on-navy-muted);
}
.emb-kicker--ink { color: var(--navy); margin: 0; }

/* ---------- left: palette (navy rail, like the landing page) ---------- */

.emb-palette {
  flex: 0 0 200px;
  background: var(--navy);
  color: var(--cream);
  padding: 20px 16px 28px;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.emb-palette .emb-kicker + .emb-kicker,
.emb-palette .emb-add + .emb-kicker { margin-top: 24px; }

.emb .emb-add {
  display: block; width: 100%; text-align: left;
  background: rgba(253, 251, 233, 0.06);
  color: var(--cream);
  border: 1.5px solid rgba(253, 251, 233, 0.25);
  border-radius: 0;
  padding: 9px 11px; margin: 0 0 6px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600; line-height: 1.3;
  min-height: 44px;
  cursor: pointer;
}
.emb .emb-add:hover { background: rgba(253, 251, 233, 0.14); border-color: var(--cream); color: var(--cream); }
.emb .emb-add:focus-visible { outline-color: var(--cream); }
.emb .emb-add small { display: block; color: var(--on-navy-muted); font-size: 11px; font-weight: 400; margin-top: 2px; }

.emb-palette__note {
  margin-top: auto; padding-top: 24px;
  font-family: var(--font-serif); font-size: 12.5px; line-height: 1.5;
  color: var(--on-navy-muted);
}

/* ---------- middle: editor canvas ---------- */

.emb-canvas {
  flex: 1 1 46%; min-width: 380px;
  overflow-y: auto;
  padding: 22px 24px 60px;
  border-right: 1px solid var(--emb-line);
}

.emb-settings {
  background: var(--cream);
  border: 2px solid var(--red);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  margin: 0 6px 22px 0;
}
.emb-settings .emb-kicker { color: var(--red); }

.emb .field { margin-bottom: 10px; }
.emb .field:last-child { margin-bottom: 0; }
.emb label, .emb legend {
  display: block; font-family: var(--font-sans);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); margin: 0 0 4px;
}
.emb input[type=text], .emb input[type=url], .emb textarea, .emb select {
  width: 100%; padding: 7px 9px;
  border: 1.5px solid var(--navy); border-radius: 0;
  font-family: var(--font-sans); font-size: 13px;
  background: var(--emb-field); color: var(--navy);
}
.emb textarea { min-height: 88px; resize: vertical; }
.emb .row2 { display: flex; gap: 10px; }
.emb .row2 > * { flex: 1; min-width: 0; }
.emb .field.check { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.emb .field.check input { width: auto; margin: 0; accent-color: var(--red); }
.emb .field.check label { margin: 0; }
.emb .hint { font-family: var(--font-sans); font-size: 11px; color: var(--muted); margin: 5px 0 0; line-height: 1.45; }

/* Rich-text editor */
.emb .rtbar { display: flex; gap: 3px; margin-bottom: 5px; flex-wrap: wrap; }
.emb .rtb {
  min-width: 30px; height: 30px; padding: 0 7px;
  border: 1.5px solid var(--navy); background: var(--emb-field); border-radius: 0;
  cursor: pointer; font-family: var(--font-sans); font-size: 12.5px; font-weight: 600;
  color: var(--navy); line-height: 1;
}
.emb .rtb:hover { background: var(--navy); color: var(--cream); }
.emb .rtb b { font-weight: 900; }
.emb .rtb i { font-family: var(--font-serif); font-style: italic; }
.emb .rtb u { text-decoration: underline; }
.emb .rt {
  border: 1.5px solid var(--navy);
  padding: 9px 11px; min-height: 96px; max-height: 360px; overflow-y: auto;
  background: var(--emb-field); color: var(--navy);
  font-family: var(--font-serif); font-size: 14px; line-height: 1.6;
}
.emb .rt:focus { outline: 3px solid var(--red); outline-offset: 1px; }
.emb .rt p { margin: 0 0 0.72em; }
.emb .rt p:last-child { margin-bottom: 0; }
.emb .rt a { color: var(--red); }
.emb .rt:empty::before { content: attr(data-ph); color: var(--muted); font-style: italic; }
/* List blocks: the editor shows the markers the email will carry (one paragraph = one item). */
.emb .rt.rt-list { counter-reset: item; }
.emb .rt.rt-list p { position: relative; padding-left: 1.6em; counter-increment: item; }
.emb .rt.rt-list p::before { position: absolute; left: 0.15em; color: var(--red); font-weight: 700; }
.emb .rt.rt-bullet p::before { content: "\2022"; }
.emb .rt.rt-check p::before { content: "\2713"; }
.emb .rt.rt-number p::before { content: counter(item) "."; font-size: 0.9em; }

/* Block card: the site's signature device — cream, red border, hard navy shadow. */
.emb .block {
  background: var(--cream);
  border: 2px solid var(--red);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  margin: 0 6px 20px 0;
  overflow: hidden;
  transition: box-shadow 120ms ease-out, opacity 120ms ease-out;
}
.emb .block.dragging { opacity: 0.35; }
.emb .block.over { box-shadow: var(--card-shadow-hover), 0 -3px 0 var(--red); }
.emb .bhead {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: rgba(44, 54, 89, 0.06);
  border-bottom: 1.5px solid var(--emb-line);
  cursor: pointer; user-select: none;
  min-height: 44px;
}
.emb .grip { cursor: grab; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.emb .btype {
  font-family: var(--font-display); font-stretch: 125%; font-weight: 700;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--navy); white-space: nowrap;
}
.emb .bsum {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-serif); font-style: italic;
}
.emb .bact {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-family: var(--font-sans); font-size: 14px; padding: 0; line-height: 1;
  width: 28px; height: 28px; border-radius: 0;
}
.emb .bact:hover { background: rgba(44, 54, 89, 0.1); color: var(--navy); }
.emb .bact.del:hover { background: rgba(159, 60, 57, 0.14); color: var(--red); }
.emb .bbody { padding: 14px 14px 16px; }
.emb .bbody.hidden { display: none; }
.emb .colgrid { display: flex; gap: 12px; }
.emb .colgrid fieldset {
  flex: 1; min-width: 0; border: 1.5px solid var(--emb-line);
  border-radius: 0; padding: 9px 10px 11px; margin: 0;
}
.emb .colgrid legend {
  font-family: var(--font-display); font-stretch: 125%; font-weight: 700;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--red); padding: 0 4px; margin: 0;
}
.emb .empty {
  border: 2px dashed var(--rule-strong); border-radius: var(--radius-card);
  padding: 34px 20px; text-align: center; margin-right: 6px;
  color: var(--muted); font-family: var(--font-serif); font-style: italic;
}

/* ---------- right: preview ---------- */

.emb-preview {
  flex: 1 1 54%; min-width: 400px;
  display: flex; flex-direction: column;
  background: var(--emb-stage);
}
.emb-tabs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  padding: 10px 14px;
  background: var(--cream);
  border-bottom: 1px solid var(--emb-line);
}
.emb .emb-tab {
  background: none; border: 1.5px solid transparent; border-radius: 999px;
  padding: 7px 14px; min-height: 36px; cursor: pointer;
  font-family: var(--font-serif); font-weight: 700;
  font-size: 14px; letter-spacing: 0;
  color: var(--muted); line-height: 1.3;
}
.emb .emb-tab:hover { color: var(--navy); border-color: var(--navy); }
.emb .emb-tab[aria-selected=true] { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.emb-grow { flex: 1; }
.emb-tabs .button { padding: 9px 14px; margin-right: 3px; }

/* Send panel under the tab bar, toggled by the Send to Action Network button. */
.emb-sendtop { background: var(--cream); border-bottom: 1px solid var(--emb-line); padding: 10px 14px 14px; }
.emb-sendtop .emb-send { margin: 0; max-width: 560px; }

.emb-pane { flex: 1; min-height: 0; overflow: auto; padding: 18px; display: none; }
.emb-pane.on { display: block; }

.emb-vw { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.emb-vw input[type=range] { flex: 1; accent-color: var(--red); min-height: 24px; }
.emb-vw output { min-width: 56px; text-align: right; }

.emb-frame {
  max-width: 100%; margin: 0 auto;
  background: #fff;
  border: 1.5px solid var(--navy);
  height: calc(100% - 40px); min-height: 560px;
}
#pane-desktop .emb-frame, #pane-mobile .emb-frame { height: 100%; min-height: 600px; }
.emb-frame iframe { display: block; border: 0; width: 100%; height: 100%; background: #fff; }

.emb-code {
  width: 100%; height: 100%; min-height: 420px; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.5; white-space: pre; overflow: auto;
  border: 1.5px solid var(--navy); background: #fff; color: var(--navy); padding: 12px;
}

/* ---------- send-success modal ---------- */

.emb-modal {
  border: 2px solid var(--navy); border-radius: var(--radius-card);
  background: var(--cream); color: var(--navy);
  padding: 22px 24px; max-width: 460px; width: calc(100% - 40px);
  box-shadow: 6px 6px 0 var(--red);
  font-family: var(--font-sans);
}
.emb-modal::backdrop { background: rgba(44, 54, 89, 0.55); }
.emb-modal__kicker {
  font-family: var(--font-display); font-stretch: 125%; font-weight: 800;
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #1f6b3a; margin: 0 0 10px;
}
.emb-modal__msg { font-size: 13.5px; line-height: 1.55; margin: 0 0 16px; }
.emb-modal__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.emb-modal [hidden] { display: none !important; }

/* ---------- toast ---------- */

.emb-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--navy); color: var(--cream);
  padding: 10px 20px; border-left: 4px solid var(--red);
  font-family: var(--font-sans); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity 120ms ease-out;
  z-index: 60;
}
.emb-toast.on { opacity: 1; }

/* ---------- small screens ---------- */

@media (max-width: 1100px) {
  .emb-page { height: auto; overflow: auto; }
  .emb { flex-wrap: wrap; }
  .emb-palette { flex: 1 1 100%; }
  .emb-palette__note { margin-top: 12px; padding-top: 0; }
  .emb-canvas { flex: 1 1 50%; min-width: 320px; border-right: 0; border-bottom: 1px solid var(--emb-line); }
  .emb-preview { flex: 1 1 50%; min-width: 320px; }
  .emb-pane { min-height: 70vh; }
}
@media (max-width: 760px) {
  .emb { display: block; }
  .emb-canvas, .emb-preview { min-width: 0; }
  .emb-canvas { padding: 18px 16px 28px; }
  .emb .colgrid { flex-direction: column; }
  .emb .row2 { flex-direction: column; gap: 0; }
  .emb-pane { padding: 12px; }
}

/* ============================================================
   SETUP SCREEN — chapter → email type → template
   ============================================================ */

.emb-setup { overflow-y: auto; background: var(--cream); }
.emb-setup__inner { max-width: 860px; margin: 0 auto; padding: 28px 20px 64px; width: 100%; }
.emb-setup__lede {
  font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.55;
  color: var(--navy); margin: 0 0 26px; max-width: 620px;
}
.emb-setup__h {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-stretch: 125%;
  font-weight: 800; font-size: 0.95rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--navy); margin: 30px 0 12px;
  padding-bottom: 6px; border-bottom: 2px solid var(--navy);
}
.emb-setup__n {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--red); color: var(--cream); font-size: 0.8rem;
}
.emb-setup__chapter { display: grid; grid-template-columns: minmax(240px, 520px); gap: 14px; align-items: start; }
/* Admin site: chapter search · "or" · CNL national button. */
.emb-setup__chapter.has-national { grid-template-columns: minmax(240px, 1fr) auto minmax(260px, 1fr); }
@media (max-width: 760px) { .emb-setup__chapter, .emb-setup__chapter.has-national { grid-template-columns: 1fr; } .emb-setup__or { display: none; } }
.emb-setup__or {
  align-self: center; font-family: var(--font-display); font-stretch: 125%; font-weight: 700;
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.emb-setup__search { position: relative; }
.emb-setup label {
  display: block; font-family: var(--font-sans); font-size: 11.5px; font-weight: 600;
  color: var(--muted); margin: 0 0 4px;
}
.emb-setup input[type=text], .emb-setup input[type=password] {
  width: 100%; padding: 10px 12px; min-height: 44px;
  border: 1.5px solid var(--navy); border-radius: 0;
  font-family: var(--font-sans); font-size: 14px; background: #fff; color: var(--navy);
}
.emb-suggestions {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  list-style: none; margin: 2px 0 0; padding: 0;
  background: #fff; border: 1.5px solid var(--navy);
  max-height: 260px; overflow-y: auto;
  box-shadow: 4px 4px 0 rgba(44, 54, 89, 0.25);
}
.emb-suggestion { padding: 9px 12px; cursor: pointer; font-size: 13.5px; color: var(--navy); }
.emb-suggestion:hover, .emb-suggestion.emb-active { background: var(--navy); color: var(--cream); }

.emb-national__btn {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--navy); color: var(--cream);
  border: 2px solid var(--navy); border-radius: var(--radius-card);
  padding: 10px 14px; min-height: 44px;
  font-family: var(--font-sans);
}
.emb-national__btn:hover { border-color: var(--red); }
.emb-national__btn[aria-pressed=true] { border-color: var(--red); box-shadow: 3px 3px 0 var(--red); }
.emb-national__name { display: block; font-weight: 700; font-size: 14px; }
.emb-national__sub { display: block; font-size: 11.5px; color: var(--on-navy-muted); margin-top: 2px; }
.emb-setup__event { margin-top: 14px; max-width: 560px; }
.emb-setup select {
  width: 100%; padding: 10px 12px; min-height: 44px;
  border: 1.5px solid var(--navy); border-radius: 0;
  font-family: var(--font-sans); font-size: 14px; background: #fff; color: var(--navy);
}
.emb-setup__err { color: var(--red); font-size: 13px; font-weight: 600; min-height: 1.2em; margin: 6px 0 0; }
.emb-setup__picked { font-family: var(--font-serif); font-style: italic; font-size: 0.9rem; color: var(--muted); margin: 10px 0 0; min-height: 1.2em; }

.emb-types, .emb-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.emb-card {
  display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start;
  padding: 10px 12px; text-align: left; cursor: pointer;
  background: #fff; color: var(--navy);
  border: 2px solid var(--navy); border-radius: var(--radius-card);
  font-family: var(--font-sans);
}
.emb-card[aria-pressed=true] { border-color: var(--red); box-shadow: 3px 3px 0 var(--red); }
.emb-card__dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--navy); margin-top: 4px; }
.emb-card[aria-pressed=true] .emb-card__dot { background: var(--red); border-color: var(--red); }
.emb-card__name { display: block; font-weight: 700; font-size: 13.5px; }
.emb-card__blurb { font-size: 11.5px; color: var(--muted); margin: 2px 0 0; line-height: 1.35; }
.emb-card--soon { border-style: dashed; cursor: default; opacity: 0.75; grid-template-columns: 1fr; }
.emb-setup__go { margin-top: 30px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ============================================================
   BUILDER CONTEXT BAR
   ============================================================ */

.emb-context {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--navy); color: var(--cream);
}
.emb-context__what {
  font-family: var(--font-display); font-stretch: 125%; font-weight: 700;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
/* Secondary buttons are navy-on-transparent — invisible on this navy bar. */
.emb-context .button--secondary { color: var(--cream); border-color: var(--cream); }
.emb-context .button--secondary:hover { background: var(--cream); color: var(--navy); box-shadow: none; }

/* ============================================================
   FIELD-TEMPLATE EDITOR (event templates) — .embt-*
   ============================================================ */

/* No overflow here on purpose: the fields editor scrolls with the page
   (emb-lock is blocks-only), and an overflow-y:auto ancestor would become
   the sticky preview's scrollport — one that never actually scrolls. */
#emb-fields { background: var(--cream); }
.embt-editor {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 22px; align-items: start;
  max-width: 1400px; margin: 0 auto; padding: 22px 20px 64px; width: 100%;
}
@media (max-width: 980px) { .embt-editor { grid-template-columns: 1fr; } }

/* The preview follows you down the (long) details column. Capped to the
   viewport: the iframe gives up height first (the email scrolls inside it),
   and if the pane still overflows — send panel open on a short screen — the
   pane scrolls internally rather than clipping. Two-column layouts only. */
@media (min-width: 981px) {
  .embt-pane--preview {
    position: sticky;
    top: 14px;
    display: flex; flex-direction: column;
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
  }
  .embt-pane--preview .embt-preview-frame { flex: 1 1 auto; min-height: 420px; }
}

.embt-pane {
  background: var(--cream);
  border: 2px solid var(--red);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 18px 18px 24px;
  margin-right: 5px; margin-bottom: 5px;
}
.embt-pane h2 {
  font-family: var(--font-display); font-stretch: 125%;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 0.92rem; color: var(--navy);
  margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--navy);
}
.embt-pane h2 + h2, .embt-pane .embt-group + h2, .embt-pane div + h2 { margin-top: 26px; }

.embt-group { display: grid; gap: 12px; }
.embt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .embt-row { grid-template-columns: 1fr; } }

.embt-field label, .embt-field .embt-label {
  display: block; font-family: var(--font-sans);
  font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px;
}
.embt-field input[type=text], .embt-field input[type=url], .embt-field input[type=email],
.embt-field input[type=date], .embt-field input[type=time], .embt-field textarea, .embt-field select {
  width: 100%; font-family: var(--font-sans); font-size: 13.5px;
  padding: 8px 10px; min-height: 40px;
  border: 1.5px solid var(--navy); border-radius: 0; background: #fff; color: var(--navy);
}
.embt-field textarea { min-height: 110px; resize: vertical; }
.embt-hint { font-size: 11px; color: var(--muted); margin: 4px 0 10px; line-height: 1.45; }

.embt-templates { display: grid; gap: 8px; }

.embt-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.embt-logo {
  display: grid; gap: 3px; padding: 3px; font-family: var(--font-sans); color: var(--navy); text-align: center;
  border: 2px solid var(--navy); border-radius: 6px; background: #fff; cursor: pointer;
}
.embt-logo[aria-pressed=true] { border-color: var(--red); box-shadow: 2px 2px 0 var(--red); }
.embt-logo__thumb { display: grid; place-items: center; height: 36px; border-radius: 3px; overflow: hidden; padding: 3px; }
.embt-logo__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.embt-logo__text { font-family: var(--font-display); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.1em; }
.embt-logo__label { font-size: 0.62rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.embt-socials { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.embt-social { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; min-height: 30px; color: var(--navy); }
.embt-social input { accent-color: var(--red); }

.embt-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.embt-color { display: grid; gap: 4px; }
.embt-color label { font-size: 10.5px; font-weight: 600; color: var(--muted); font-family: var(--font-sans); }
.embt-color__row { display: flex; align-items: center; gap: 6px; }
.embt-color input[type=color] { width: 42px; height: 34px; padding: 0; border: 1.5px solid var(--navy); border-radius: 4px; background: #fff; }
.embt-color code { font-size: 11px; color: var(--navy); }
.embt-swatches { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.embt-swatch { width: 24px; height: 24px; border-radius: 4px; border: 1.5px solid rgba(0,0,0,0.25); cursor: pointer; padding: 0; }
.embt-swatch:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.embt-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.embt-seg { display: inline-flex; border: 2px solid var(--navy); border-radius: 0; overflow: hidden; }
.embt-seg button {
  font-family: var(--font-sans); font-size: 12px; font-weight: 700;
  padding: 8px 14px; background: #fff; color: var(--navy); border: 0; cursor: pointer; min-height: 38px;
}
.embt-seg button[aria-pressed=true] { background: var(--navy); color: var(--cream); }
.embt-subject { font-size: 13px; margin: 0 0 10px; padding: 8px 12px; background: #fff; border: 1.5px solid var(--navy); color: var(--navy); }
.embt-subject strong {
  font-family: var(--font-display); font-stretch: 125%; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; margin-right: 8px;
}
.embt-subject .embt-pre { opacity: 0.6; }
.embt-preview-frame {
  display: block; width: 100%; height: 860px;
  border: 1.5px solid var(--navy); background: #EDF1F2; margin: 0 auto;
  transition: width 120ms;
}
.embt-preview-frame.is-mobile { width: 390px; max-width: 100%; }
.embt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }

/* ============================================================
   SEND TO ACTION NETWORK PANEL (both editors)
   ============================================================ */

.emb-send {
  margin: 20px 6px 0 0;
  background: var(--cream);
  border: 2px solid var(--navy);
  border-radius: var(--radius-card);
  padding: 14px 16px 16px;
}
.embt-pane .emb-send { margin: 22px 0 0; }
.emb-send__kicker {
  font-family: var(--font-display); font-stretch: 125%; font-weight: 700;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); margin: 0 0 8px;
}
.emb-send__hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.emb-send .field { margin-bottom: 10px; }
.emb-send label { display: block; font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.emb-send input[type=text] {
  width: 100%; padding: 8px 10px; min-height: 40px;
  border: 1.5px solid var(--navy); border-radius: 0;
  font-family: var(--font-sans); font-size: 13.5px; background: #fff; color: var(--navy);
}
.emb-send__status { font-size: 12.5px; line-height: 1.5; margin: 10px 0 0; min-height: 1.3em; color: var(--navy); }
.emb-send__status.is-ok { color: #1f6b3a; font-weight: 600; }
.emb-send__status.is-warn { color: var(--red); font-weight: 600; }
.emb-send__status a { color: #1f6b3a; }

/* Who sends it: the lead, or CNL staff on a picked day */
.emb-who { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.emb-who legend { font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; padding: 0; }
.emb-send label.emb-who__opt {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 6px; padding: 9px 10px;
  background: #fff; border: 1.5px solid var(--emb-line, #c9cdd8); cursor: pointer;
  font-weight: 400; color: var(--navy);
}
.emb-send label.emb-who__opt:has(input:checked) { border-color: var(--navy); box-shadow: inset 3px 0 0 var(--red); }
.emb-who__opt input { margin: 3px 0 0; accent-color: var(--navy); flex: none; }
.emb-who__text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.emb-who__text b { font-size: 13px; color: var(--navy); }
.emb-when[hidden] { display: none; }
.emb-send input[type=date] {
  width: 100%; max-width: 240px; padding: 7px 10px; min-height: 40px;
  border: 1.5px solid var(--navy); border-radius: 0;
  font-family: var(--font-sans); font-size: 13.5px; background: #fff; color: var(--navy);
}
.emb-when__note { font-size: 12px; line-height: 1.45; color: var(--muted); margin: 6px 0 0; }
.emb-when__note.is-warn { color: #8a4b00; background: #fff4e0; border-left: 3px solid #d98a1c; padding: 6px 8px; }

/* ============================================================
   IMAGE UPLOAD FIELD + LUMA EVENT CHECKLIST (2026-09-01)
   ============================================================ */

.emb .imgrow { display: flex; gap: 6px; }
.emb .imgrow input { flex: 1; min-width: 0; }
.emb .emb-upbtn {
  flex: 0 0 auto;
  padding: 7px 12px; min-height: 34px;
  border: 1.5px solid var(--navy); border-radius: 0;
  background: var(--emb-field, #fff); color: var(--navy);
  font-family: var(--font-sans); font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.emb .emb-upbtn:hover { background: var(--navy); color: var(--cream); }
.emb .emb-upbtn:disabled { opacity: 0.6; cursor: default; }

.emb .emb-evlist {
  margin: 10px 0 4px;
  border: 1.5px solid var(--emb-line);
  max-height: 240px; overflow-y: auto;
  background: #fff;
}
.emb .emb-evrow {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; margin: 0;
  font-family: var(--font-sans); font-size: 12.5px; color: var(--navy);
  border-bottom: 1px solid var(--emb-line);
  cursor: pointer;
}
.emb .emb-evrow:last-child { border-bottom: 0; }
.emb .emb-evrow:hover { background: rgba(44, 54, 89, 0.05); }
.emb .emb-evrow input { width: auto; margin: 0; accent-color: var(--red); flex: 0 0 auto; }
.emb .emb-evrow span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* settings-panel artwork grid reuses .embt-logos; keep thumbs compact there */
.emb-settings .embt-logos { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }

/* ============================================================
   THE PAGE IN THE TOOLS HOME'S LOOK (2026-10-09)
   The page wears the home's rail (assets/rail.js + home.js page mode): body.landing. Setup gets
   the home's header, a note pointing event emails to the event form, section heads and choice
   tiles; the rail's chapter replaces the Chapter step (staff on admin keep it, for CNL national).
   The editor gets a small cream bar (.tp-bar) and the rail folded to its icons; its panes'
   headings and fields in the home's/HQ's style. Embedded (no rail) none of this applies.
   ============================================================ */

body.landing.emb-page .content.emb-main { padding: 0; }
/* The letter editor locks the page to the window (emb-lock): the rail's column too. On a phone the
   rail sits above the page, so the page isn't locked there (it scrolls, the panes stacked). */
body.landing.emb-page.emb-lock .content.emb-main { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
@media (max-width: 900px) {
  body.landing.emb-page.emb-lock { height: auto; overflow: visible; }
  body.landing.emb-page.emb-lock .content.emb-main { height: auto; overflow: visible; }
}
.landing .emb-setup { background: transparent; }
.landing .emb-setup__inner { max-width: 1240px; margin: 0; padding: 34px 40px 40px; gap: 22px; }
/* The chapter is the rail's: its step goes (staff on admin keep it, for CNL national). */
body.landing[data-chapter]:not(.rail-chapter-missing) .emb-chapter-h,
body.landing[data-chapter]:not(.rail-chapter-missing) .emb-setup__chapter,
body.landing[data-chapter]:not(.rail-chapter-missing) #chapterPicked { display: none; }

/* Choice tiles. */
.landing .emb-types, .landing .emb-tpls { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.landing .emb-card {
  position: relative; background: #fff; border: 1.5px solid rgba(44, 54, 89, 0.2); border-radius: 12px;
  padding: 14px 40px 15px 16px; box-shadow: none; font-family: var(--font-serif); display: block; text-align: left;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.landing .emb-card:hover { border-color: var(--navy); }
.landing .emb-card[aria-pressed=true] { border: 2px solid var(--navy); box-shadow: 4px 4px 0 var(--b-rail, var(--red)); transform: translate(-1px, -1px); }
.landing .emb-card__dot { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; margin: 0; border: 1.5px solid rgba(44, 54, 89, 0.35); background: #fff; }
.landing .emb-card[aria-pressed=true] .emb-card__dot { background: #fff; border: 6px solid var(--navy); }
.landing .emb-card__name { font-size: 16px; font-weight: 700; color: var(--navy); }
.landing .emb-card__blurb { font-weight: 400; font-size: 13.5px; line-height: 1.45; color: var(--home-meta); margin-top: 4px; }
.landing .emb-card--soon { background: transparent; border: 1.5px dashed rgba(44, 54, 89, 0.4); padding-right: 16px; }
.landing .emb-setup label { font-family: var(--font-serif); font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--navy); }
.landing .emb-setup select, .landing .emb-setup input[type=text] { border-radius: 8px; border: 1.5px solid rgba(44, 54, 89, 0.55); font-family: var(--font-serif); }
.landing .emb-setup__go { margin-top: 4px; padding-top: 16px; border-top: 1.5px solid var(--home-rule); }

/* ---------- editor ---------- */

.landing .emb-context.tp-bar { padding: 12px 22px; color: var(--navy); background: var(--cream); justify-content: flex-start; }
.landing .emb-context__what { font: inherit; letter-spacing: 0; text-transform: none; }
.landing .tp-bar__title { font-family: var(--font-serif); font-weight: 700; }
.landing .embt-editor { max-width: 1400px; margin: 0; padding: 22px 22px 64px; }
.landing .embt-pane { border-radius: 14px; }
.landing .embt-pane h2 {
  font-family: var(--font-serif); font-size: 19px; font-weight: 700; text-transform: none; letter-spacing: 0;
  border-bottom: 1px solid var(--home-rule); padding-bottom: 10px;
}
.landing :is(.embt-field label, .embt-field .embt-label) { font-family: var(--font-serif); font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--navy); }
.landing .embt-pane :is(input[type=text], input[type=date], input[type=time], input[type=url], input[type=email], select, textarea) { border-radius: 8px; border: 1.5px solid rgba(44, 54, 89, 0.55); font-family: var(--font-serif); }
.landing .emb-foot { margin: 0; padding: 4px 22px; max-width: none; border-top: 1.5px solid var(--home-rule); flex: none; }
body:not(.landing) .emb-foot { display: none; }
/* Desktop / Mobile: the pill switch. */
.landing .embt-seg { border: 0; border-radius: 0; overflow: visible; }
.landing .embt-seg button { font: 700 13px/1.15 var(--font-serif); border: 1.5px solid var(--navy); margin-left: -1.5px; padding: 8px 14px; min-height: 34px; }
.landing .embt-seg button:first-child { border-radius: 999px 0 0 999px; margin-left: 0; }
.landing .embt-seg button:last-child { border-radius: 0 999px 999px 0; }
