/* EDA Connect 8.2 Agency Messages. All rules strictly scoped to dedicated Agency page. */
.eda82-agency-messages{display:grid;gap:16px;min-width:0;padding-bottom:24px;color:#253e52}
.eda82-agency-messages *{box-sizing:border-box}
.agency-msg-pagehead{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;flex-wrap:wrap}
.agency-msg-pagehead h2{font-size:clamp(24px,2.2vw,30px);margin:3px 0 7px;line-height:1.17}
.agency-msg-pagehead p:not(.eyebrow){font-size:13px;line-height:1.55;color:#627988;max-width:730px;margin:0}
.agency-msg-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.agency-msg-stats{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 16px;border:1px solid #dee9f1;border-radius:12px;background:#f8fbff;font-size:12px;color:#5b7282}
.agency-msg-stats strong{font-size:19px;color:#183f64;padding-right:5px;font-variant-numeric:tabular-nums}
.agency-msg-stats .agency-msg-sync{margin-left:auto;color:#557d76;font-weight:650}
.agency-msg-layout{display:grid;grid-template-columns:minmax(300px,35%) minmax(0,1fr);min-width:0;height:clamp(760px,84vh,1160px);overflow:hidden;border:1px solid #dbe7f0;border-radius:15px;background:#fff;box-shadow:0 6px 28px rgba(30,59,84,.05)}
.agency-msg-inbox{min-height:0;min-width:0;display:flex;flex-direction:column;border-right:1px solid #dde7ef;background:#fff}
.agency-msg-inbox-toolbar{display:grid;gap:9px;padding:14px;background:#f7fafc;border-bottom:1px solid #e3ecf3}
.agency-msg-inbox-toolbar input,.agency-msg-inbox-toolbar select{width:100%;min-width:0;font:inherit;font-size:12px;background:#fff;border:1px solid #d6e3ee;border-radius:9px;padding:10px 11px;color:#27445b}
.agency-msg-filters{display:flex;flex-wrap:wrap;gap:5px}
.agency-msg-filters button{border:1px solid #d7e5ee;background:#fff;color:#47697c;border-radius:8px;font-size:11px;font-weight:700;padding:7px 9px;min-height:32px;cursor:pointer}
.agency-msg-filters button.selected{background:#e8f3fa;border-color:#97c5dc;color:#14547c}
.agency-msg-filters button:focus-visible,.agency-msg-thread:focus-visible{outline:3px solid #61a4c5;outline-offset:1px}
.agency-msg-thread-list{min-width:0;min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}
.agency-msg-thread{display:flex;flex-direction:column;gap:6px;text-align:left;padding:14px 13px;width:100%;max-width:100%;border:0;border-bottom:1px solid #e8eff4;border-left:4px solid transparent;cursor:pointer;color:inherit;background:#fff}
.agency-msg-thread:hover{background:#f3f8fc}
.agency-msg-thread.selected{border-left-color:#277bb2;background:#edf6fc}
.agency-msg-thread.unread .agency-msg-thread-top strong{color:#113d5f}
.agency-msg-thread-top{display:flex;align-items:flex-start;gap:8px;justify-content:space-between;min-width:0}
.agency-msg-thread-top strong{font-size:13px;line-height:1.38;overflow-wrap:anywhere;min-width:0}
.agency-msg-unread{flex:0 0 auto;border-radius:999px;background:#1765a0;color:#fff;font-size:10px;padding:4px 7px;font-weight:800}
.agency-msg-person,.agency-msg-preview{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:100%;overflow-wrap:anywhere;color:#607988;font-size:11px;line-height:1.45}
.agency-msg-preview{font-size:12px;color:#415e72}
.agency-msg-thread-bottom{display:flex;gap:9px;justify-content:space-between;align-items:center;color:#7a8e9b;font-size:10px}
.agency-msg-thread-bottom small{font-size:10px;line-height:1.35;overflow-wrap:anywhere}
.agency-msg-thread-bottom time{white-space:nowrap;font-size:10px}
.agency-msg-detail{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#fcfdff}
.agency-msg-detail-head{display:flex;gap:16px;justify-content:space-between;padding:17px 19px;background:#fff;border-bottom:1px solid #e1eaf2;flex-wrap:wrap;flex:0 0 auto}
.agency-msg-detail-title{min-width:0;flex:1 1 300px}
.agency-msg-detail-title small{font-size:11px;color:#326b8d;font-weight:800;letter-spacing:.025em}
.agency-msg-detail-title h3{font-size:17px;line-height:1.35;margin:6px 0;overflow-wrap:anywhere}
.agency-msg-detail-title p{font-size:11px;color:#6b808e;margin:0;overflow-wrap:anywhere;line-height:1.45}
.agency-msg-detail-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:flex-start}
.agency-msg-detail-actions .btn{font-size:11px;min-height:32px}
.agency-msg-history{flex:1;min-height:365px;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;gap:12px;padding:19px;overscroll-behavior:contain}
.agency-msg-bubble{border:1px solid #dce8f0;background:#fff;border-radius:13px;max-width:min(90%,760px);min-width:0;align-self:flex-start;padding:12px 14px;overflow-wrap:anywhere;flex:0 0 auto}
.agency-msg-bubble.mine{align-self:flex-end;background:#eaf5fb;border-color:#bddcec}
.agency-msg-bubble-meta{display:flex;justify-content:space-between;flex-wrap:wrap;align-items:baseline;gap:8px;font-size:11px;margin-bottom:8px}
.agency-msg-bubble-meta strong{color:#1e506f;font-weight:800}
.agency-msg-bubble-meta time{color:#778a98;font-size:10px}
.agency-msg-bubble-body{color:#2d4352;font-size:13px;line-height:1.62}
.agency-msg-reply{display:grid;gap:7px;padding:12px 19px;background:#fff;border-top:1px solid #dce7ef;flex:0 0 auto}
.agency-msg-reply label{font-size:12px;color:#38566a;font-weight:750}
.agency-msg-reply textarea{width:100%;max-width:100%;min-height:66px;max-height:136px;resize:vertical;font-size:13px;padding:9px 10px;line-height:1.48;border:1px solid #cbdde9;border-radius:9px}
.agency-msg-send-row{display:flex;justify-content:flex-end}
.agency-msg-attachments{border:1px solid #e0eaf1;border-radius:9px;padding:7px 10px;background:#f9fbfd;font-size:12px;color:#4b7087}
.agency-msg-attachments summary{cursor:pointer;font-weight:750}
.agency-msg-attach-grid{display:grid;gap:9px;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:10px}
.agency-msg-attach-grid label{font-size:11px;display:grid;gap:5px;min-width:0}
.agency-msg-attach-grid input{min-width:0;max-width:100%;width:100%;font-size:12px;padding:7px;border:1px solid #cfdeea;border-radius:8px}
.agency-msg-resources{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.agency-msg-chip{font-size:11px;border:1px solid #b9d6ea;background:#f5fafc;color:#1b668f;padding:5px 8px;border-radius:8px;max-width:100%;overflow-wrap:anywhere;cursor:pointer}
.agency-msg-placeholder,.agency-msg-loading{margin:auto;padding:32px;max-width:360px;text-align:center;color:#688292}
.agency-msg-placeholder>span{font-size:35px}
.agency-msg-placeholder h3{color:#294f69;margin:11px 0}
.agency-msg-placeholder p{line-height:1.5;font-size:12px}
.agency-msg-empty-list,.agency-msg-error{padding:25px;color:#4f697b;font-size:12px;line-height:1.55}
.agency-msg-readonly{padding:14px 18px;color:#607b8a;background:#f7fafc;font-size:12px}
.agency-msg-compose{display:grid;gap:15px;max-width:900px}
.agency-msg-compose label{display:grid;gap:6px;font-size:12px;font-weight:700;color:#36566b;min-width:0}
.agency-msg-compose input,.agency-msg-compose textarea,.agency-msg-compose select{border:1px solid #c8dae6;border-radius:9px;padding:10px;font-size:13px;width:100%;min-width:0;box-sizing:border-box}
.agency-msg-compose-scope{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.agency-msg-recipient-box{border:1px solid #dce7ef;border-radius:12px;padding:11px;display:grid;gap:9px}
.agency-msg-recipient-head{display:flex;justify-content:space-between;gap:10px;font-size:12px}
.agency-msg-recipients{border:1px solid #e1eaf0;border-radius:9px;max-height:230px;overflow-y:auto}
.agency-msg-recipients .agency-msg-recipient{display:flex;gap:10px;align-items:center;padding:8px 10px;border-bottom:1px solid #eef3f6;cursor:pointer}
.agency-msg-recipients .agency-msg-recipient input{width:auto;flex:0 0 auto;accent-color:#2578a7}
.agency-msg-recipients .agency-msg-recipient span{display:grid;gap:2px;min-width:0}
.agency-msg-recipients .agency-msg-recipient strong{font-size:12px;overflow-wrap:anywhere}
.agency-msg-recipients .agency-msg-recipient small{font-size:10px;color:#6a8392;overflow-wrap:anywhere}
@media(max-width:1050px){.agency-msg-layout{grid-template-columns:minmax(255px,40%) minmax(0,1fr)}.agency-msg-detail-head{padding:13px}.agency-msg-history{padding:13px}}
@media(max-width:760px){.agency-msg-layout{height:auto;display:flex;flex-direction:column;overflow:visible}.agency-msg-inbox{border-right:0;border-bottom:1px solid #dde7ef;min-height:260px}.agency-msg-thread-list{max-height:300px;min-height:150px}.agency-msg-detail{height:auto;min-height:660px;overflow:visible}.agency-msg-history{min-height:350px;max-height:65vh}.agency-msg-stats .agency-msg-sync{margin-left:0}.agency-msg-pagehead{gap:10px}}
@media(max-width:480px){.agency-msg-pagehead .agency-msg-head-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.agency-msg-history{padding:10px}.agency-msg-bubble{max-width:98%}.agency-msg-reply{padding:10px}.agency-msg-detail-head{gap:8px}.agency-msg-compose-scope,.agency-msg-attach-grid{grid-template-columns:1fr}.agency-msg-detail-actions{gap:5px}}
