/* Settings, Email templates (js/emailtpl.js). Same look as Settings, Email signatures. The email preview stays on white paper in dark mode. */
.et-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.et-top > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.et-topacts { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.et-group { margin-bottom: 12px; overflow: hidden; }
.et-ghd { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 16px 10px; border-bottom: 1px solid var(--divider); }
.et-ghd h2 { margin: 0; font-size: 1rem; }

.et-item + .et-item { border-top: 1px solid var(--divider); }
.et-item.sel { background: var(--row-sel); }
.et-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 60px; }
.et-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.et-who b { font-size: 0.9375rem; font-weight: 600; }
.et-who span { font-size: 0.8125rem; color: var(--muted); }
.et-st { flex: none; width: 170px; display: flex; flex-direction: column; gap: 2px; }
.et-st small { font-size: 0.75rem; }
.et-acts { flex: none; display: flex; gap: 6px; }
.et-acts .btn[aria-expanded="true"] { background: var(--blue-tint); border-color: var(--blue-btn); color: var(--blue-ink); }
.et-panel { padding: 4px 16px 20px; }

.et-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); gap: 24px; align-items: start; }
.et-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.et-form .formact { margin-top: 0; flex-wrap: wrap; }
.et-reset { margin-left: auto; }
.et-fld textarea { resize: vertical; line-height: 1.45; }
.et-meta { display: flex; justify-content: space-between; gap: 8px; min-height: 0; }
.et-meta:has(.et-val:empty):has(.et-n:empty) { display: none; }
.et-n { flex: none; }
.et-val { display: flex; flex-direction: column; gap: 2px; }
.et-msg { font-size: 0.8125rem; line-height: 1.35; padding-left: 14px; position: relative; }
.et-msg::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 7px; height: 7px; border-radius: 50%; }
.et-msg.err { color: var(--red); } .et-msg.err::before { background: var(--red); }
.et-msg.warn { color: var(--amber); } .et-msg.warn::before { background: var(--amber-bar); }
.et-sum:empty { display: none; }
.et-sum { margin: 0; }

.et-chips { position: sticky; top: 0; z-index: 2; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.et-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.et-chip { min-height: 32px; padding: 0 10px; border: 1px solid var(--input); border-radius: 16px; background: var(--chip-bg); color: var(--ink); font: inherit; font-size: 0.8125rem; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; cursor: pointer; }
.et-chip:hover { border-color: var(--blue-btn); background: var(--blue-tint); color: var(--blue-ink); }
.et-chip:focus-visible { outline: 2px solid var(--blue-btn); outline-offset: 1px; }

.et-prevwrap { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.et-prevwrap .minihead { margin: 0; }
.et-samp { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0; font-size: 0.8125rem; color: var(--muted); }
.et-paper { min-width: 0; }
.et-paper .bmail { max-width: 600px; }
.et-paper .bsubj { margin-bottom: 8px; }
.et-prevwrap .formact { margin-top: 0; flex-wrap: wrap; }

/* Print: only the sample */
#et-print { display: none; }
@media print {
  html.et-printing body > *:not(#et-print) { display: none !important; }
  html.et-printing, html.et-printing body { background: #FFFFFF !important; color: #212121 !important; }
  html.et-printing #et-print { display: block; }
  .et-sheet { max-width: 640px; margin: 0 auto; color: #212121; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .et-sheet .bmail { border-color: #E6E6E6; break-inside: auto; }
  .et-sheet .bsubj { margin: 0 0 8px; }
  .et-sheet .bsubj .muted { color: #666666; }
  .et-sh-name { margin: 0 0 6px; font-weight: 700; font-size: 14pt; }
  .et-sh-name span { display: block; font-weight: 400; font-size: 9pt; color: #666666; }
  .et-sh-foot { margin: 14px 0 0; text-align: center; font-size: 8pt; color: #666666; }
}

@media (max-width: 1240px) { .et-edit { grid-template-columns: minmax(0, 1fr); } .et-chips { position: static; } }
@media (max-width: 900px) {
  .et-row { flex-wrap: wrap; }
  .et-who { flex-basis: 100%; }
  .et-st { width: auto; flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .et-acts { flex-basis: 100%; }
  .et-acts .btn { flex: 1 1 0; min-width: 0; justify-content: center; }
  .et-panel { padding: 4px 12px 16px; }
  .et-row { padding: 8px 12px; }
  .et-topacts, .et-topacts .btn { width: 100%; }
  .et-topacts .btn { justify-content: center; }
  .et-reset { margin-left: 0; }
}

/* Design pass: the whole row opens the editor; PDF and Print sit in the "…" menu */
.et-row { position: relative; }
button.et-who { border: 0; background: none; padding: 6px 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.et-who::after { content: ""; position: absolute; inset: 0; }
button.et-who:focus-visible { outline: none; }
button.et-who:focus-visible::after { outline: 2px solid var(--blue-btn); outline-offset: -2px; border-radius: 8px; }
.et-row:hover { background: var(--row-hover); }
.et-who span:empty { display: none; }
.et-st:empty { display: none; }
.et-acts { align-items: center; gap: 4px; position: relative; z-index: 1; pointer-events: none; }
.et-acts .et-more { pointer-events: auto; }
.et-edlbl { display: inline-flex; align-items: center; gap: 4px; font-size: 0.875rem; font-weight: 600; color: var(--link); pointer-events: none; }
.et-edlbl .ic { width: 16px; height: 16px; }
.et-more .kmenu { left: auto; right: 0; }
@media (max-width: 900px) { .et-who { flex-basis: auto; flex: 1 1 0; } }
@media (max-width: 640px) { .et-acts { flex-basis: auto; } .et-edlbl { display: none; } }
.et-group { overflow: visible; }
.et-group .et-item:last-child .et-row:hover { border-radius: 0 0 var(--r-card, 14px) var(--r-card, 14px); }
