/* AfghanZone Messaging M3 — Investor Portal canonical MySQL messaging only.
   Scope-isolated under m3-* plus one legacy support hide class. */
.m3-legacy-support-retired{display:none!important}
.m3-nav-unread{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;margin-inline-start:5px;border-radius:999px;background:#f97316;color:#fff;font-size:8px;font-weight:900}
.m3-nav-unread.hidden{display:none!important}
.m3-shell{display:flex;flex-direction:column;gap:14px}
.m3-hero{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px;border:1px solid #e5eaf1;border-radius:22px;background:linear-gradient(135deg,#fff,#fffaf6);box-shadow:0 12px 34px rgba(15,23,42,.045)}
.m3-kicker{display:inline-flex;align-items:center;gap:7px;padding:5px 9px;border-radius:999px;background:#fff0e4;color:#d9610b;font-size:9px;font-weight:900;letter-spacing:.06em}
.m3-hero h1{margin:8px 0 2px;font-size:24px;font-weight:900;color:#172033}.m3-hero p{margin:0;max-width:760px;color:#7a8797;font-size:11px;line-height:1.8}
.m3-hero-actions{display:flex;align-items:center;gap:12px}.m3-metrics{display:flex;gap:7px}.m3-metrics span{min-width:78px;padding:8px 10px;border:1px solid #edf0f4;border-radius:14px;background:#fff;text-align:center}.m3-metrics small{display:block;color:#8b97a7;font-size:8px;font-weight:800}.m3-metrics b{display:block;margin-top:2px;color:#1e293b;font-size:16px}
.m3-primary{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:13px;background:#f97316;color:#fff;padding:10px 14px;font:inherit;font-size:10px;font-weight:900;cursor:pointer;box-shadow:0 8px 18px rgba(249,115,22,.18)}
.m3-primary:disabled{opacity:.55;cursor:wait}
.m3-legacy,.m3-preview{display:flex;align-items:center;gap:9px;padding:10px 13px;border-radius:14px;font-size:9px;font-weight:700}
.m3-legacy{border:1px solid #f2dfc8;background:#fffaf4;color:#7c6047}.m3-preview{border:1px solid #dce5ef;background:#f7f9fc;color:#566579}
.m3-app{min-height:610px;display:grid;grid-template-columns:minmax(285px,32%) 1fr;border:1px solid #e5eaf1;border-radius:22px;background:#fff;overflow:hidden;box-shadow:0 12px 34px rgba(15,23,42,.04)}
.m3-sidebar{min-width:0;border-inline-end:1px solid #edf1f5;background:#fbfcfe;display:flex;flex-direction:column}.m3-side-head{padding:16px;border-bottom:1px solid #edf1f5}.m3-side-title{display:flex;justify-content:space-between;align-items:center;gap:10px}.m3-side-title small{display:block;color:#a0aaba;font-size:8px;font-weight:900}.m3-side-title h2{margin:2px 0 0;display:flex;align-items:center;gap:7px;color:#1f2b3e;font-size:14px}.m3-count{display:grid;place-items:center;min-width:26px;height:26px;border-radius:999px;background:#172033;color:#fff;font-size:9px}
.m3-search{position:relative;margin-top:12px}.m3-search i{position:absolute;inset-inline-start:11px;top:50%;transform:translateY(-50%);color:#9aa6b6;font-size:10px}.m3-search input{width:100%;height:39px;border:1px solid #e4e9ef;border-radius:12px;background:#fff;padding:0 32px 0 11px;font:inherit;font-size:10px;outline:none}.m3-search input:focus{border-color:#f9a463;box-shadow:0 0 0 3px rgba(249,115,22,.08)}
.m3-filters{display:flex;gap:6px;margin-top:10px}.m3-filters button{border:1px solid #e6eaf0;border-radius:999px;background:#fff;color:#748195;padding:6px 10px;font:inherit;font-size:8px;font-weight:900;cursor:pointer}.m3-filters button.active{border-color:#fed0ad;background:#fff4eb;color:#d9610b}
.m3-thread-list{flex:1;min-height:0;overflow:auto;padding:9px}.m3-thread{width:100%;display:flex;align-items:center;gap:10px;border:1px solid transparent;border-radius:15px;background:transparent;padding:10px;text-align:inherit;font:inherit;cursor:pointer;color:#2d3a4f}.m3-thread:hover{background:#fff}.m3-thread.active{border-color:#fed7b7;background:#fff8f2;box-shadow:0 7px 20px rgba(249,115,22,.07)}
.m3-avatar{position:relative;flex:0 0 42px;width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(135deg,#172033,#274e72);color:#fff;font-size:10px;font-weight:900}.m3-avatar i{position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border:2px solid #fff;border-radius:999px;background:#18b58a}
.m3-thread-main{min-width:0;flex:1}.m3-thread-top,.m3-thread-sub{display:flex;align-items:center;justify-content:space-between;gap:7px}.m3-thread-top b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}.m3-thread-top time{flex:0 0 auto;color:#9aa6b6;font-size:7px}.m3-thread-sub{justify-content:flex-start;margin-top:2px;color:#8794a4;font-size:7px}.m3-thread-sub em{font-style:normal;margin-inline-start:auto;padding:3px 6px;border-radius:999px;font-weight:900}.m3-thread-sub em.open{background:#e9f9f3;color:#0c8e70}.m3-thread-sub em.closed{background:#f1f3f6;color:#7b8796}.m3-preview-text{display:block;margin-top:4px;color:#748195;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.m3-unread{flex:0 0 auto;display:grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:#f97316;color:#fff;font-size:8px}
.m3-empty-list,.m3-empty-chat,.m3-loading,.m3-error{margin:auto;padding:28px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:#8290a0}.m3-empty-list i,.m3-empty-chat i,.m3-error i{font-size:28px;color:#f97316}.m3-empty-list b,.m3-empty-chat h3,.m3-error b{color:#344257;font-size:12px}.m3-empty-list small,.m3-empty-chat p,.m3-error small{font-size:9px;line-height:1.7}
.m3-chat{min-width:0;display:flex;flex-direction:column;background:#fff}.m3-chat-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 16px;border-bottom:1px solid #edf1f5}.m3-person{display:flex;align-items:center;gap:10px}.m3-person>button{display:none;border:0;background:#f4f6f9;width:38px;height:38px;border-radius:11px;color:#58677a;cursor:pointer}.m3-person h3{margin:0;color:#233047;font-size:12px}.m3-presence{display:flex;align-items:center;gap:6px;margin:2px 0 0;color:#8b97a7;font-size:8px}.m3-presence>i{width:7px;height:7px;border-radius:999px;background:#a4afbd;box-shadow:0 0 0 3px rgba(148,163,184,.12)}.m3-presence.online{color:#0c8e70}.m3-presence.online>i{background:#18b58a}.m3-presence.typing{color:#d9610b;font-weight:900}.m3-presence.typing>i{background:#f97316;animation:m3pulse 1s infinite}@keyframes m3pulse{50%{opacity:.35}}
.m3-status{padding:5px 9px;border-radius:999px;font-size:8px;font-weight:900}.m3-status.open{background:#e9f9f3;color:#0c8e70}.m3-status.closed{background:#f1f3f6;color:#7b8796}
.m3-reference{display:flex;align-items:center;gap:10px;padding:10px 16px;border-bottom:1px solid #edf1f5;background:#fbfcfe}.m3-reference>i{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:#fff0e4;color:#e86b13}.m3-reference small,.m3-reference b,.m3-reference span{display:block}.m3-reference small{color:#98a4b3;font-size:7px}.m3-reference b{color:#354257;font-size:10px}.m3-reference span{color:#6e7b8d;font-size:8px}
.m3-secure{display:flex;align-items:center;justify-content:center;gap:6px;padding:7px 12px;background:#fffaf5;border-bottom:1px solid #fff0e4;color:#8a674d;font-size:7px;font-weight:800}
.m3-records{flex:1;min-height:0;overflow:auto;padding:18px;background:linear-gradient(#f8fafc,#fff)}.m3-day{width:max-content;margin:10px auto;padding:4px 8px;border-radius:999px;background:#edf1f5;color:#8894a4;font-size:7px;font-weight:900}.m3-row{display:flex;margin:8px 0}.m3-row.mine{justify-content:flex-start}.m3-row.theirs{justify-content:flex-end}.m3-bubble{max-width:min(72%,680px);padding:9px 11px;border-radius:14px;background:#172033;color:#fff;box-shadow:0 6px 18px rgba(15,23,42,.06)}.m3-row.theirs .m3-bubble{background:#f1f4f8;color:#263449}.m3-author{display:block;margin-bottom:2px;font-size:7px;font-weight:900;opacity:.72}.m3-bubble p{margin:0;white-space:pre-wrap;word-break:break-word;font-size:10px;line-height:1.75}.m3-meta{display:flex;align-items:center;justify-content:flex-end;gap:6px;margin-top:3px;font-size:7px;opacity:.76}
.m3-checks{display:inline-flex;align-items:center;letter-spacing:-3px}.m3-checks i{font-size:8px}.m3-checks.sent{letter-spacing:0;color:#dbe3ed}.m3-checks.delivered{color:#e7edf4}.m3-checks.read{color:#6ef0b3;text-shadow:0 0 6px rgba(110,240,179,.22)}
.m3-quick{display:flex;gap:6px;overflow-x:auto;padding:8px 12px;border-top:1px solid #edf1f5;background:#fff}.m3-quick button{flex:0 0 auto;border:1px solid #e8edf3;border-radius:999px;background:#fff;color:#677487;padding:6px 9px;font:inherit;font-size:7px;font-weight:800;cursor:pointer}.m3-quick button:hover{border-color:#ffc99f;color:#d9610b}
.m3-compose-wrap{position:relative;padding:10px 12px 8px;border-top:1px solid #edf1f5;background:#fff}.m3-compose{display:grid;grid-template-columns:42px 1fr 44px;gap:7px;align-items:end}.m3-compose button{height:42px;border:0;border-radius:12px;background:#f3f5f8;color:#617084;cursor:pointer}.m3-compose button:last-child{background:#f97316;color:#fff}.m3-compose textarea{width:100%;min-height:42px;max-height:120px;resize:none;border:1px solid #e1e7ee;border-radius:13px;padding:10px 12px;font:inherit;font-size:10px;outline:none}.m3-compose textarea:focus{border-color:#f9a463}.m3-compose-wrap>small{display:block;margin-top:4px;color:#9aa5b4;font-size:7px}
.m3-emoji{display:none;position:absolute;bottom:66px;inset-inline-start:12px;padding:7px;border:1px solid #e5eaf0;border-radius:13px;background:#fff;box-shadow:0 12px 30px rgba(15,23,42,.13);grid-template-columns:repeat(6,34px);gap:3px}.m3-emoji.open{display:grid}.m3-emoji button{border:0;background:transparent;width:34px;height:34px;border-radius:9px;cursor:pointer;font-size:17px}.m3-emoji button:hover{background:#f4f6f8}
.m3-dialog{width:min(560px,calc(100vw - 28px));border:0;border-radius:20px;padding:0;box-shadow:0 24px 70px rgba(15,23,42,.28)}.m3-dialog::backdrop{background:rgba(15,23,42,.52);backdrop-filter:blur(3px)}.m3-dialog form{margin:0}.m3-dialog header,.m3-dialog footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid #edf1f5}.m3-dialog footer{border-top:1px solid #edf1f5;border-bottom:0;justify-content:flex-end}.m3-dialog header small{display:block;color:#f97316;font-size:8px;font-weight:900}.m3-dialog header h2{margin:2px 0 0;color:#243147;font-size:15px}.m3-dialog header button,.m3-dialog footer>button:not(.m3-primary){border:0;border-radius:11px;background:#f3f5f8;color:#617084;padding:9px 12px;font:inherit;font-size:9px;font-weight:800;cursor:pointer}.m3-dialog-body{display:grid;gap:12px;padding:16px}.m3-dialog-body label span{display:block;margin-bottom:5px;color:#667487;font-size:8px;font-weight:900}.m3-dialog-body input,.m3-dialog-body select,.m3-dialog-body textarea{width:100%;border:1px solid #e1e7ee;border-radius:12px;background:#fff;padding:10px 11px;font:inherit;font-size:10px;outline:none}.m3-dialog-body textarea{resize:vertical;min-height:110px}.m3-dialog-body input:focus,.m3-dialog-body select:focus,.m3-dialog-body textarea:focus{border-color:#f9a463;box-shadow:0 0 0 3px rgba(249,115,22,.07)}
.m3-investor-toast{position:fixed;z-index:99999;left:50%;bottom:28px;transform:translate(-50%,20px);opacity:0;pointer-events:none;max-width:min(520px,calc(100vw - 24px));padding:10px 14px;border-radius:12px;background:#172033;color:#fff;font-size:9px;font-weight:800;box-shadow:0 14px 35px rgba(15,23,42,.2);transition:.2s}.m3-investor-toast.show{opacity:1;transform:translate(-50%,0)}.m3-investor-toast.error{background:#b42318}.m3-error button{border:0;border-radius:10px;background:#172033;color:#fff;padding:8px 11px;font:inherit;font-size:8px;font-weight:900;cursor:pointer}
@media(max-width:900px){.m3-hero{align-items:flex-start;flex-direction:column}.m3-hero-actions{width:100%;justify-content:space-between}.m3-app{grid-template-columns:320px 1fr}}
@media(max-width:720px){
 .m3-hero{padding:16px}.m3-hero h1{font-size:20px}.m3-hero-actions{flex-direction:column;align-items:stretch}.m3-metrics{display:grid;grid-template-columns:repeat(3,1fr)}.m3-metrics span{min-width:0}.m3-primary{min-height:44px}
 .m3-app{display:block;min-height:calc(100vh - 230px);border-radius:17px}.m3-sidebar{height:calc(100vh - 230px);border-inline-end:0}.m3-chat{display:none;height:calc(100vh - 230px)}.m3-app.chat-open .m3-sidebar{display:none}.m3-app.chat-open .m3-chat{display:flex}.m3-person>button{display:grid;place-items:center;min-width:44px;min-height:44px}
 .m3-thread{min-height:68px}.m3-search input,.m3-compose textarea,.m3-dialog-body input,.m3-dialog-body select,.m3-dialog-body textarea{font-size:16px}.m3-compose{grid-template-columns:44px 1fr 48px}.m3-compose button{min-width:44px;min-height:44px}
 .m3-dialog{width:100%;max-width:none;margin:0;position:fixed;left:0;right:0;bottom:0;top:auto;border-radius:20px 20px 0 0;max-height:92dvh}.m3-dialog-body{max-height:68dvh;overflow:auto;padding-bottom:calc(16px + env(safe-area-inset-bottom))}.m3-dialog footer{padding-bottom:calc(14px + env(safe-area-inset-bottom))}
 .m3-bubble{max-width:86%}.m3-records{padding:12px}.m3-compose-wrap{padding-bottom:calc(8px + env(safe-area-inset-bottom))}
}
@media(max-width:430px){.m3-metrics span{padding:7px 6px}.m3-hero p{font-size:10px}.m3-thread-list{padding:6px}.m3-thread{padding:9px 7px}.m3-avatar{width:40px;height:40px;flex-basis:40px}.m3-quick{padding:7px 8px}.m3-chat-head{padding:10px}.m3-reference{padding:9px 10px}}
