/* v1.9 · MSG-POP-01 – bảng thao tác tin nhắn kiểu Zalo (nhấn giữ / chuột phải): hàng cảm xúc + lưới thao tác */
.pop19-layer{position:fixed;inset:0;z-index:5190;-webkit-tap-highlight-color:transparent;font-size:14px}
.pop19-backdrop{position:absolute;inset:0;background:transparent}
.pop19-phone .pop19-backdrop{touch-action:none}
/* phone: everything but the pressed message is dimmed, like Zalo; the message itself stays where it is */
.pop19-hole{position:fixed;pointer-events:none;border-radius:12px;box-shadow:0 0 0 200vmax rgba(15,23,42,.46)}
.pop19-bar,.pop19-card{position:fixed;background:#fff;color:#0f172a;box-shadow:0 12px 34px rgba(15,23,42,.24);animation:pop19-in .12s ease-out}
.pop19-bar{display:flex;gap:2px;padding:5px 7px;border-radius:999px}
.pop19-rx{width:40px;height:40px;padding:0;border:0;border-radius:50%;background:none;font-size:24px;line-height:1;cursor:pointer;transition:transform .12s ease-out,background .12s}
.pop19-rx:hover,.pop19-rx:focus-visible{transform:scale(1.2);background:#f1f5f9;outline:none}
.pop19-rx.mine{background:#dbeafe;box-shadow:inset 0 0 0 2px #60a5fa}
/* MSG-POP-02 – Zalo's "+" (grey round button) and the panel of the other reactions in place of the actions card */
.pop19-plus{color:#64748b;font-size:22px;font-weight:300;background:#f1f5f9}
.pop19-plus.on{background:#e2e8f0;color:#0f172a}
.pop19-card.pop19-more{grid-template-columns:repeat(8,minmax(0,1fr));gap:2px;padding:10px 8px;max-height:min(60vh,330px);overflow-y:auto;overscroll-behavior:contain}
.pop19-rx-sm{width:auto;height:38px;font-size:23px;border-radius:10px}
.pop19-phone .pop19-card.pop19-more{padding:12px 8px}
.pop19-phone .pop19-rx-sm{height:42px;font-size:26px}
@media (max-width:360px){.pop19-card.pop19-more{grid-template-columns:repeat(7,minmax(0,1fr))}}
.pop19-card{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;width:312px;padding:10px 6px;border-radius:14px}
.pop19-item{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;min-width:0;min-height:70px;padding:9px 2px 7px;border:0;border-radius:10px;background:none;color:#1e293b;font:inherit;font-size:12.5px;line-height:1.25;text-align:center;cursor:pointer}
.pop19-item:hover,.pop19-item:focus-visible{background:#f1f5f9;outline:none}
.pop19-item:focus-visible{box-shadow:inset 0 0 0 2px #93c5fd}
.pop19-ico{display:inline-flex;color:var(--pop19-tone,#475569)}
.pop19-ico svg{width:24px;height:24px}
.pop19-lbl{overflow-wrap:anywhere}
/* the colours of Zalo's own grid (Vietrad's screenshot) */
.pop19-t-reply{--pop19-tone:#7c4dff}.pop19-t-forward{--pop19-tone:#2f7cf6}.pop19-t-download{--pop19-tone:#21a04f}.pop19-t-recall{--pop19-tone:#f57c1f}
.pop19-t-copy{--pop19-tone:#1f6fe5}.pop19-t-pin{--pop19-tone:#f4733a}.pop19-t-ticket{--pop19-tone:#0068ff}.pop19-t-select{--pop19-tone:#2f7cf6}
.pop19-t-quick{--pop19-tone:#2f7cf6}.pop19-t-details{--pop19-tone:#4b5563}.pop19-t-original{--pop19-tone:#64748b}.pop19-t-react{--pop19-tone:#db2777}
.pop19-item.danger .pop19-lbl{color:#c2410c}
/* phone: Zalo's proportions – a wide feelings row with big emoji, a card of large icons with the label under each */
.pop19-phone .pop19-bar{justify-content:space-around;padding:8px 10px;border-radius:20px}
.pop19-phone .pop19-bar .pop19-rx{flex:0 1 48px;min-width:36px;width:auto;height:48px;font-size:31px}
.pop19-phone .pop19-bar .pop19-plus{font-size:24px}
.pop19-phone .pop19-card{padding:16px 6px 12px;border-radius:18px;row-gap:6px}
.pop19-phone .pop19-item{min-height:84px;gap:8px;font-size:13.5px;color:#262b33}
.pop19-phone .pop19-ico svg{width:29px;height:29px}
@keyframes pop19-in{from{transform:scale(.94)}to{transform:none}}   /* no fading: a paused animation must never leave it see-through */
@media (prefers-reduced-motion:reduce){.pop19-bar,.pop19-card{animation:none}.pop19-rx{transition:none}}
/* a long press is for the actions, not for selecting text or the phone's own image menu */
@media (hover:none){html.pop19-on .ma18-host{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}}

/* dialogs: Chuyển tiếp, Chi tiết, Tạo câu mẫu */
.pop19-dlg-back{position:fixed;inset:0;z-index:5350;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(15,23,42,.45)}
.pop19-dlg{display:flex;flex-direction:column;width:min(440px,100%);max-height:min(640px,calc(100vh - 32px));padding:16px 18px;background:#fff;color:#0f172a;border-radius:14px;box-shadow:0 20px 48px rgba(15,23,42,.3);font-size:14px}
.pop19-dlg-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.pop19-dlg-head h3{margin:0;font-size:17px}
.pop19-dlg-x{width:34px;height:34px;padding:0;border:0;border-radius:50%;background:none;color:#475569;font-size:22px;line-height:1;cursor:pointer}
.pop19-dlg-x:hover,.pop19-dlg-x:focus-visible{background:#f1f5f9;outline:none}
.pop19-dlg-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.pop19-dlg-actions button{min-height:38px;padding:7px 16px;border-radius:9px;font:inherit;cursor:pointer}
.pop19-dlg-actions button:disabled{opacity:.55;cursor:default}
.pop19-muted{margin:4px 0;color:#64748b;font-size:13px}
.pop19-error{margin:6px 0 0;color:#b91c1c;font-size:13px}
.pop19-details{display:grid;gap:9px;margin:0;overflow:auto}
.pop19-row{display:grid;grid-template-columns:118px minmax(0,1fr);gap:10px}
.pop19-row dt{color:#64748b}
.pop19-row dd{margin:0;overflow-wrap:anywhere}
.pop19-form{display:grid;gap:10px;overflow:auto}
.pop19-form label{display:grid;gap:4px;color:#475569;font-size:13px}
.pop19-form input,.pop19-form textarea{width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#0f172a;font:inherit;font-size:14px}
.pop19-form textarea{resize:vertical;min-height:96px}
.pop19-fw{display:flex;flex-direction:column;gap:10px;min-height:0}
.pop19-fw-preview{display:flex;flex-wrap:wrap;gap:4px 6px;padding:9px 11px;border-radius:10px;background:#f1f5f9;font-size:13px;line-height:1.4}
.pop19-fw-preview span{color:#334155;overflow-wrap:anywhere}
.pop19-fw-preview small{flex-basis:100%}
.pop19-fw-search{width:100%;box-sizing:border-box;padding:9px 11px;border:1px solid #cbd5e1;border-radius:10px;font:inherit;font-size:14px}
.pop19-fw-list{display:flex;flex-direction:column;gap:2px;height:min(300px,42vh);overflow:auto;overscroll-behavior:contain}   /* fixed: the box does not jump while typing */
.pop19-fw-row{display:flex;align-items:center;gap:10px;width:100%;min-height:46px;padding:6px 8px;border:0;border-radius:9px;background:none;color:#0f172a;font:inherit;text-align:left;cursor:pointer}
.pop19-fw-row:hover,.pop19-fw-row:focus-visible{background:#f1f5f9;outline:none}
.pop19-fw-row.on{background:#eff6ff}
.pop19-fw-check{flex:none;width:20px;height:20px;box-sizing:border-box;border:2px solid #94a3b8;border-radius:50%}
.pop19-fw-row.on .pop19-fw-check{border-color:#0068ff;background:#0068ff radial-gradient(circle,#fff 0 3px,transparent 3.5px)}
.pop19-fw-av{flex:none;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:#dbeafe;color:#1d4ed8;font-weight:700}
.pop19-fw-copy{display:flex;flex-direction:column;min-width:0}
.pop19-fw-copy b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.pop19-fw-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#64748b}
.pop19-fw-status{margin:0;min-height:18px;color:#475569;font-size:13px}
.pop19-fw-status.bad{color:#b91c1c}

/* Chọn nhiều: a ring on each message that can be picked, a check on the picked ones, a bar with the actions */
html.pop19-picking .ma18-more{display:none!important}
.pop19-pickable{cursor:pointer}
.pop19-pickable::after{content:'';position:absolute;top:-7px;left:-7px;width:20px;height:20px;box-sizing:border-box;border:2px solid #94a3b8;border-radius:50%;background:#fff;pointer-events:none}
.mine.pop19-pickable::after{left:auto;right:-7px}
.pop19-picked{box-shadow:0 0 0 2px #0068ff!important}
.pop19-picked::after{border-color:#0068ff;background:#0068ff radial-gradient(circle,#fff 0 3px,transparent 3.5px)}
.pop19-pick{position:fixed;z-index:5100;display:flex;align-items:center;gap:8px;padding:8px 10px;background:#fff;color:#0f172a;border-radius:14px;box-shadow:0 10px 30px rgba(15,23,42,.25)}
.pop19-pick-x{width:34px;height:34px;padding:0;border:0;border-radius:50%;background:none;color:#475569;font-size:22px;line-height:1;cursor:pointer}
.pop19-pick-x:hover,.pop19-pick-x:focus-visible{background:#f1f5f9;outline:none}
.pop19-pick-count{flex:1;min-width:0;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pop19-pick button[data-pick]{min-height:36px;padding:6px 14px;border-radius:9px;font:inherit;cursor:pointer}
.pop19-pick button[data-pick]:disabled{opacity:.5;cursor:default}

@media (max-width:640px){
  .pop19-dlg-back{align-items:flex-end;padding:0}
  .pop19-dlg{width:100%;max-height:calc(100vh - 40px);padding:16px 16px calc(14px + env(safe-area-inset-bottom,0px));border-radius:18px 18px 0 0}
  .pop19-form input,.pop19-form textarea,.pop19-fw-search{font-size:16px}                    /* iPhone: no zoom on focus */
  .pop19-dlg-actions button{flex:1;min-height:46px}
  .pop19-fw-list{height:min(48vh,420px)}
  .pop19-row{grid-template-columns:104px minmax(0,1fr)}
  .pop19-pick{left:8px!important;right:8px;top:auto!important;bottom:calc(8px + env(safe-area-inset-bottom,0px));width:auto!important}
  .pop19-pick{gap:6px;padding:7px 8px}
  .pop19-pick button[data-pick]{min-height:42px;padding:6px 11px}
}

/* dark scheme */
html[data-zsc-scheme="dark"] :is(.pop19-bar,.pop19-card,.pop19-dlg,.pop19-pick){background:var(--scheme-panel,#1e293b);color:var(--scheme-text,#e2e8f0);box-shadow:0 0 0 1px var(--scheme-line,#334155),0 18px 44px rgba(0,0,0,.5)}
html[data-zsc-scheme="dark"] :is(.pop19-item,.pop19-phone .pop19-item,.pop19-fw-row,.pop19-dlg-head h3){color:var(--scheme-text,#e2e8f0)}
html[data-zsc-scheme="dark"] :is(.pop19-item:hover,.pop19-item:focus-visible,.pop19-rx:hover,.pop19-rx:focus-visible,.pop19-fw-row:hover,.pop19-fw-row:focus-visible,.pop19-dlg-x:hover,.pop19-pick-x:hover){background:var(--scheme-hover,#334155)}
html[data-zsc-scheme="dark"] .pop19-rx.mine,html[data-zsc-scheme="dark"] .pop19-fw-row.on{background:var(--zsc-accent-soft,#1e3a5f)}
html[data-zsc-scheme="dark"] .pop19-plus{background:var(--scheme-raised,#273449);color:var(--scheme-secondary,#94a3b8)}
html[data-zsc-scheme="dark"] .pop19-plus.on{background:var(--scheme-hover,#334155);color:var(--scheme-text,#e2e8f0)}
html[data-zsc-scheme="dark"] :is(.pop19-muted,.pop19-row dt,.pop19-fw-copy small,.pop19-fw-status,.pop19-form label,.pop19-dlg-x,.pop19-pick-x){color:var(--scheme-secondary,#94a3b8)}
html[data-zsc-scheme="dark"] :is(.pop19-fw-preview){background:var(--scheme-raised,#273449)}
html[data-zsc-scheme="dark"] .pop19-fw-preview span{color:var(--scheme-text,#e2e8f0)}
html[data-zsc-scheme="dark"] :is(.pop19-form input,.pop19-form textarea,.pop19-fw-search){background:var(--scheme-raised,#273449);border-color:var(--scheme-line,#334155);color:var(--scheme-text,#e2e8f0)}
html[data-zsc-scheme="dark"] .pop19-pickable::after{background:var(--scheme-panel,#1e293b)}
html[data-zsc-scheme="dark"] .pop19-t-reply{--pop19-tone:#a78bfa}html[data-zsc-scheme="dark"] .pop19-t-forward{--pop19-tone:#60a5fa}
html[data-zsc-scheme="dark"] .pop19-t-download{--pop19-tone:#34d399}html[data-zsc-scheme="dark"] .pop19-t-recall{--pop19-tone:#fb923c}
html[data-zsc-scheme="dark"] .pop19-t-copy{--pop19-tone:#38bdf8}html[data-zsc-scheme="dark"] .pop19-t-pin{--pop19-tone:#fbbf24}
html[data-zsc-scheme="dark"] .pop19-t-ticket{--pop19-tone:#60a5fa}html[data-zsc-scheme="dark"] .pop19-t-select{--pop19-tone:#22d3ee}
html[data-zsc-scheme="dark"] .pop19-t-quick{--pop19-tone:#c084fc}html[data-zsc-scheme="dark"] :is(.pop19-t-details,.pop19-t-original){--pop19-tone:#cbd5e1}
html[data-zsc-scheme="dark"] .pop19-item.danger .pop19-lbl{color:#fdba74}
