/* engage module: greetings & offers, loyalty points */
.eng-sm { font-size: 12px; }
.eng-gap { gap: 8px; }
.eng-pos { color: var(--success); }
.eng-note .row { align-items: flex-start; }
.eng-note .row > svg { flex: none; color: var(--success); margin-top: 2px; }
.eng-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.eng-grid > .card { display: grid; gap: 4px; }

/* template tiles */
.eng-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.eng-tpls-sm { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.eng-tpl { border: 0; border-radius: 12px; min-height: 64px; padding: 10px; cursor: pointer; font: inherit; font-weight: 700; color: #fff; text-align: left; display: flex; align-items: flex-end;
  background: linear-gradient(135deg, var(--eng-a), var(--eng-b)); box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: transform .12s ease; }
.eng-tpls-sm .eng-tpl { min-height: 48px; font-size: 13px; }
.eng-tpl span { text-shadow: 0 1px 3px rgba(0,0,0,.35); line-height: 1.2; }
.eng-tpl:hover { transform: translateY(-1px); }
.eng-tpl.on { outline: 3px solid var(--brand); outline-offset: 2px; }

/* WhatsApp style preview */
.eng-bubble { white-space: pre-wrap; word-break: break-word; background: color-mix(in srgb, var(--success) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
  color: var(--text); border-radius: 12px 12px 12px 2px; padding: 10px 12px; font-size: 14px; line-height: 1.45; margin-top: 4px; }

/* recipients */
.eng-search { width: 100%; margin-top: 8px; }
.eng-list { display: grid; gap: 0; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.eng-list-tall { max-height: 640px; }
.eng-li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-top: 1px solid var(--border); cursor: pointer; min-width: 0; }
.eng-li:first-child { border-top: 0; }
.eng-li input { width: auto; flex: none; }
.eng-li.off { opacity: .55; cursor: default; }
.eng-li-t { display: grid; flex: 1; min-width: 0; }
.eng-li-t b, .eng-li-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eng-li .btn { flex: none; }
.eng-li.done .eng-li-t b { color: var(--muted); }
.eng-tick { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); color: #fff; }
.eng-li.done .eng-tick { background: var(--success); border-color: var(--success); }
.eng-tick svg { width: 14px; height: 14px; }
.eng-go { width: 100%; justify-content: center; margin-top: 12px; }
.eng-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.eng-bar i { display: block; height: 100%; background: var(--success); border-radius: 99px; transition: width .3s ease; }

/* greeting image */
.eng-card-wrap { max-width: 360px; }
.eng-canvas { width: 100%; height: auto; border-radius: 12px; display: block; box-shadow: 0 2px 10px rgba(0,0,0,.15); }

/* loyalty */
.eng-loy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.eng-loy-amt { flex: 1 1 160px; max-width: 240px; margin: 0; }
.eng-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.eng-rules > div { display: grid; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.eng-acts { white-space: nowrap; }
.eng-acts .btn + .btn { margin-left: 6px; }
.eng-adjli { padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.eng-adjli:first-of-type { border-top: 0; }
.eng-hist { max-height: 60vh; overflow-y: auto; }
.eng-up { display: flex; gap: 16px; align-items: flex-start; }
.eng-up-ic, .eng-dash-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--brand); flex: none; }
.eng-dash .row { align-items: center; }
.eng-dash-ic { width: 40px; height: 40px; }
.eng-dash-sep { height: 1px; background: var(--border); margin: 12px 0; }

@media (max-width: 900px) {
  .eng-grid { grid-template-columns: minmax(0, 1fr); }
  .eng-card-wrap { max-width: 100%; }
}
@media (max-width: 600px) {
  .eng-loy-amt { max-width: none; }
  .eng-up { flex-direction: column; }
  .eng-acts .btn + .btn { margin-left: 4px; }
}
@media (max-width: 600px) { .eng-hide-sm { display: none; } }
/* Greeting image editor */
.eng-img-ctl { display: grid; gap: 6px; }
.eng-img-ctl .f { margin: 0; }
.eng-seg { flex-wrap: wrap; }
.eng-seg button { white-space: normal; text-align: left; }
.eng-photo-box { display: grid; gap: 10px; padding: 12px; margin-top: 8px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border); }
.eng-ai { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.eng-ai textarea { min-height: 60px; }
.eng-ai .btn:disabled { opacity: .75; }
.eng-soon { opacity: .7; }
/* Ready messages as simple buttons (one colour), selected one in the brand colour */
.eng-tpls { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.eng-tpls-sm { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.eng-tpl, .eng-tpls-sm .eng-tpl { background: var(--surface-2) !important; color: var(--text); border: 1px solid var(--border); min-height: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; align-items: center; justify-content: center; text-align: center; box-shadow: none; transition: background .15s, color .15s, border-color .15s; }
.eng-tpl span { text-shadow: none; }
.eng-tpl:hover { background: var(--brand-soft) !important; color: var(--brand); border-color: var(--brand); transform: none; }
.eng-tpl.on { background: var(--brand) !important; color: #fff; border-color: var(--brand); outline: none; }
