/* v11.6 Stage 1 — mobile-first RTL communication */
.msg-shortcut{display:flex;align-items:center;gap:12px;text-align:right;width:100%;min-height:66px;border-radius:18px;margin:0 0 12px;padding:12px 15px;color:#174b39;background:#f0f8fa;border:1px solid #b9dbdc;font:inherit;cursor:pointer}
.msg-shortcut span{font-size:27px}.msg-shortcut strong{font-size:16px}.msg-shortcut small{font-size:11px;line-height:1.5;opacity:.8;margin-right:auto}
.msg-overlay{position:fixed;inset:0;z-index:20010;background:rgba(12,30,26,.70);display:flex;align-items:center;justify-content:center;padding:12px;padding-bottom:calc(12px + env(safe-area-inset-bottom));box-sizing:border-box}
.msg-overlay[hidden]{display:none!important}.msg-dialog{width:min(650px,100%);height:min(85dvh,840px);overflow:auto;border-radius:22px;background:var(--wh,#fff);color:var(--txt,#24352c);padding:18px;box-sizing:border-box;overscroll-behavior:contain}
.msg-modal-open{overflow:hidden}.msg-head,.msg-controls,.msg-item-head,.msg-list-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.msg-head h2{font-size:19px;margin:0}.msg-head button{font-size:23px;line-height:1;padding:9px 14px;background:transparent;border:1px solid #cddbd5;border-radius:12px;color:inherit;cursor:pointer}.msg-hint,.msg-status{font-size:12px;line-height:1.75;color:var(--mut,#627166)}.msg-controls{margin:14px 0}.msg-controls select,.msg-controls button,.msg-guardian-form select,.msg-guardian-form textarea,.msg-reply-form textarea{border:1px solid var(--bdr,#cbd8cf);border-radius:12px;background:var(--wh,#fff);color:var(--txt,#24352c);padding:12px;font:inherit;box-sizing:border-box;min-width:0}
.msg-controls select{flex:1}.msg-controls button,.msg-list-head button,.msg-reply-form button{border:1px solid #b2d1bf;border-radius:11px;padding:10px 13px;background:#edf7ef;color:#155339;font:inherit;font-weight:700;cursor:pointer;min-height:44px}
.msg-list{display:grid;gap:10px}.msg-item{border:1px solid var(--bdr,#d5e1d8);border-radius:16px;padding:13px;background:var(--wh,#fff);overflow-wrap:anywhere}.msg-item-head b{font-size:14px}.msg-item small{color:var(--mut,#687d70);font-size:11px}.msg-item>p,.msg-reply p{white-space:pre-wrap;font-size:14px;line-height:1.8;margin:8px 0}.msg-state{font-size:11px;border-radius:20px;padding:5px 8px;background:#e8f2ed;color:#195b42;white-space:nowrap}.msg-state.new{background:#fff0d1;color:#82510d}.msg-state.replied{background:#e6f5ee;color:#12643f}.msg-reply{background:#edf8f0;color:#194632;border-radius:12px;padding:10px;margin-top:8px}.msg-reply-form{display:grid;gap:10px;margin-top:10px}.msg-reply-form label{display:grid;gap:6px;font-size:13px}.msg-reply-form textarea{width:100%;min-height:75px;resize:vertical}.msg-reply-form button.msg-send,.msg-guardian-form>button{background:#145a3a;color:white;border-color:#145a3a;border-radius:12px;min-height:48px;font-weight:800;cursor:pointer}
.msg-empty{color:var(--mut,#687b6f);font-size:13px;padding:15px;text-align:center}.msg-guardian-form{display:grid;gap:9px;padding:14px;border:1px solid var(--bdr,#d5e1d8);border-radius:16px;margin:12px 0}.msg-guardian-form label{font-size:13px;font-weight:700}.msg-guardian-form textarea{width:100%;min-height:90px;resize:vertical}.msg-list-head{margin-top:15px}.msg-list-head b{font-size:15px}
html[data-theme="dark"] .msg-shortcut,html[data-theme="dark"] .msg-reply{background:#18362d;color:#f0fff3;border-color:#496855}html[data-theme="dark"] .msg-controls button,html[data-theme="dark"] .msg-reply-form button:not(.msg-send){background:#204e39;color:#e9fff0}
@media(max-width:480px){.msg-dialog{height:92dvh;padding:12px;border-radius:18px}.msg-head h2{font-size:16px}.msg-shortcut{flex-wrap:wrap}.msg-shortcut small{width:100%;margin:0}}
@media print{.msg-overlay,.msg-shortcut,.portal-message-card{display:none!important}}
