/* Isolated chat surfaces: identical semantic colours in member and operator views. */
.agency-chat{--chat-bg:#fffdf8;--chat-panel:#f4f0e8;--chat-bubble:#fff;--chat-out:#e9f0eb;--chat-text:#202b26;--chat-muted:#5b665e;--chat-line:#d6ddd6;--chat-active:#dce8de;color:var(--chat-text);margin:24px auto;max-width:1400px}
html[data-theme=dark] .agency-chat{--chat-bg:#131d19;--chat-panel:#1a2721;--chat-bubble:#25382d;--chat-out:#35452b;--chat-text:#f4f5ef;--chat-muted:#c1cbbf;--chat-line:#47584a;--chat-active:#344b39}
.chat-page-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.chat-page-heading h1,.chat-page-heading h2{margin:0}
.chat-workspace{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);border:1px solid var(--chat-line);border-radius:20px;overflow:hidden;background:var(--chat-bg);min-height:540px}
.chat-sidebar{background:var(--chat-panel);border-right:1px solid var(--chat-line);max-height:850px;overflow:auto;padding:16px 10px}.chat-sidebar h3{padding:0 10px;margin:0 0 16px;font:600 17px/1.4 var(--sans)}.chat-sidebar h3 span{color:var(--chat-muted);font-size:14px}
.chat-thread{margin-bottom:5px;border-radius:12px}.chat-thread.is-selected{background:var(--chat-active)}.agency-chat a{color:var(--chat-text)}
.chat-thread-link,.chat-thread-unavailable{display:flex;align-items:center;gap:11px;padding:12px 10px;text-decoration:none!important;min-height:80px}.chat-thread-link:hover{background:var(--chat-active);border-radius:12px}.chat-thread-link:focus-visible,.agency-chat summary:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}.chat-thread-copy{display:block;min-width:0;flex:1}.chat-thread-copy strong{display:block;font-size:15px;line-height:1.4}.chat-thread-meta,.chat-thread-preview{display:block;color:var(--chat-muted);font-size:13px;line-height:1.5}.chat-thread-preview{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}.chat-avatar{width:42px;height:42px;flex:0 0 42px;border-radius:50%;overflow:hidden;background:var(--chat-active);display:flex;align-items:center;justify-content:center;font-weight:600}.chat-avatar img{width:100%;height:100%;object-fit:cover}.chat-unread{background:#2d6146;color:#fff;border-radius:20px;min-width:24px;padding:2px 7px;font-size:12px;text-align:center}.chat-thread-unavailable{flex-wrap:wrap;opacity:.8}.chat-thread-unavailable p{margin:0;font-size:13px}
.chat-conversation,.chat-empty{min-width:0;padding:24px;color:var(--chat-text)}.chat-empty{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.chat-empty p{max-width:45ch}.chat-conversation-heading{border-bottom:1px solid var(--chat-line);padding-bottom:12px}.chat-conversation-heading h3{margin:0 0 4px}.chat-conversation-heading p,.chat-conversation-heading>span{font-size:14px;color:var(--chat-muted);margin:5px 0}.chat-member-workspace{max-width:900px;margin:auto;background:var(--chat-bg);border:1px solid var(--chat-line);border-radius:20px}
.chat-history{display:flex;flex-direction:column;gap:14px;max-height:560px;overflow:auto;padding:20px 4px;scrollbar-width:thin}.chat-bubble{background:var(--chat-bubble);border:1px solid var(--chat-line);border-radius:16px 16px 16px 4px;padding:14px 16px;max-width:88%;align-self:flex-start;color:var(--chat-text);min-width:160px}.chat-bubble--outgoing{background:var(--chat-out);align-self:flex-end;border-radius:16px 16px 4px 16px}.chat-bubble header{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center}.chat-bubble strong{font-size:13px}.chat-bubble time,.chat-bubble small{color:var(--chat-muted);font-size:12px}.agency-chat .chat-body{color:var(--chat-text);white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;font-size:16px;margin:8px 0}.chat-file{display:flex;flex-direction:column;align-items:flex-start;gap:5px;margin:10px 0}.chat-file a{text-decoration:underline;overflow-wrap:anywhere}.chat-photo{display:block;width:130px;height:100px;object-fit:cover;border-radius:10px;border:1px solid var(--chat-line)}.chat-empty-note{color:var(--chat-muted)}
.agency-chat .message-composer{border-top:1px solid var(--chat-line);padding-top:8px}.agency-chat .message-composer summary{color:var(--chat-text);border-color:var(--chat-line);background:var(--chat-panel)}.agency-chat .message-composer label,.agency-chat .message-composer p{color:var(--chat-text)}.agency-chat .message-composer textarea{background:var(--chat-bg);color:var(--chat-text);border:1px solid var(--chat-line);width:100%;font:16px/1.5 var(--sans)}.agency-chat .chat-file-help{font-size:13px;color:var(--chat-muted)}.agency-chat [data-attachment-names]{color:var(--chat-text)}.agency-chat .pagination{display:flex;flex-wrap:wrap;padding:0;gap:8px;list-style:none}.agency-chat .pagination a{display:block;padding:5px 10px;border:1px solid var(--chat-line);border-radius:7px;background:var(--chat-panel)}
@media(max-width:760px){.chat-workspace{grid-template-columns:minmax(0,1fr)}.chat-sidebar{border-right:0;border-bottom:1px solid var(--chat-line);max-height:250px}.chat-sidebar h3{font-size:16px}.chat-conversation,.chat-empty{padding:16px}.chat-bubble{max-width:95%}.chat-history{max-height:55vh}.chat-page-heading{align-items:flex-start}.chat-page-heading h1{font-size:28px}.chat-page-heading .button{font-size:13px;padding:10px 12px}.chat-thread-preview{max-width:70vw}}
.optional-answer{margin:10px 0 16px}.optional-answer>summary{cursor:pointer;color:var(--ink-soft);font-size:14px;line-height:1.5;padding:8px 0;width:fit-content}.optional-answer[open]>summary{margin-bottom:8px}.optional-answer>label{font-size:14px}
