/* Agent history uses a quiet, two-pane messenger within the workspace shell. */
.agent-messages-view #content { padding: 0; min-height: 0; overflow: hidden; background: #fff; }
.agent-messages-view .topbar { padding: 15px 26px; }
.agent-messages-view .topbar h1 { font-size: 19px; }
.agent-dm-history-label { padding: 5px 10px; border-radius: 20px; color: #596473; background: #f0f2f5; font-size: 11px; }
.agent-messages-layout { display: grid; grid-template-columns: minmax(245px, 300px) minmax(0, 1fr); height: 100%; min-height: 0; color: #1c2330; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.agent-messages-layout button:focus-visible { outline: 2px solid #006dde; outline-offset: -2px; }
.agent-dm-sidebar { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #f7f8fa; border-right: 1px solid #e4e7ec; }
.agent-dm-controls { padding: 24px 18px 14px; flex: none; }
.agent-dm-controls h2 { font-size: 21px; font-weight: 700; letter-spacing: -.5px; margin: 0 0 4px; }
.agent-dm-controls > p { margin: 0 0 18px; font-size: 12px; color: #667181; }
.agent-dm-search { display: flex; gap: 7px; align-items: center; padding: 0 9px; background: #e9ecf0; border-radius: 9px; color: #687485; }
.agent-dm-search input { padding: 9px 0; border: 0; background: transparent; border-radius: 6px; font-size: 13px; min-width: 0; width: 100%; box-shadow: none; }
.agent-dm-search:focus-within { outline: 2px solid #006dde; outline-offset: 1px; }
.agent-dm-search .chat-icon { width: 15px; height: 15px; }
.agent-dm-controls select { margin-top: 10px; width: 100%; padding: 7px 9px; background: transparent; border-color: #dce1e7; font-size: 12px; color: #4f5a6a; }
.agent-dm-conversations { flex: 1; min-height: 0; overflow: auto; padding: 0 9px 12px; }
.agent-dm-conversation { display: flex; align-items: center; gap: 11px; padding: 15px 10px; border: 0; border-radius: 11px; background: transparent; width: 100%; text-align: left; min-width: 0; margin: 2px 0; }
.agent-dm-conversation:hover { background: #eaedf2; }
.agent-dm-conversation[aria-current=true] { background: #e1ecfc; color: #182c4e; }
.agent-dm-avatars { display: flex; align-items: center; flex: none; padding-right: 1px; width: 49px; }
.agent-dm-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; font-size: 10px; font-weight: 650; color: #fff; border: 2px solid #f7f8fa; }
.agent-dm-avatar + .agent-dm-avatar { margin-left: -15px; margin-top: 17px; }
.agent-dm-avatar.tone-0 { background: #477196; }.agent-dm-avatar.tone-1 { background: #856aad; }.agent-dm-avatar.tone-2 { background: #387b70; }.agent-dm-avatar.tone-3 { background: #a96b57; }.agent-dm-avatar.tone-4 { background: #6a718b; }
.agent-dm-preview { min-width: 0; flex: 1; }
.agent-dm-preview-heading { display: flex; align-items: baseline; gap: 6px; margin-bottom: 5px; }
.agent-dm-preview-heading strong { font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-dm-preview-heading time { font-size: 10px; color: #677282; white-space: nowrap; }
.agent-dm-preview p { font-size: 12px; line-height: 1.5; color: #667181; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.agent-dm-list-status { padding: 8px 22px; font-size: 12px; line-height: 1.7; color: #667181; }
.agent-dm-more { margin: 8px 18px 16px; font-size: 12px; color: #0067d3; border-color: #dde3ec; flex: none; }
.agent-dm-detail { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.agent-dm-header { min-height: 86px; display: flex; align-items: center; gap: 12px; padding: 16px 25px; border-bottom: 1px solid #edf0f3; background: #ffffffeb; }
.agent-dm-identity { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.agent-dm-identity > div:last-child { min-width: 0; }
.agent-dm-identity h2 { margin: 0 0 5px; font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.agent-dm-identity p { margin: 0; font-size: 11px; color: #6d7684; }
.agent-dm-identity .agent-dm-avatar { border-color: white; }
.agent-dm-back { display: none; }
.agent-dm-reading { position: relative; flex: 1; min-height: 0; display: flex; }
.agent-dm-timeline { flex: 1; min-height: 0; min-width: 0; padding: 16px 32px 30px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; overflow-anchor: none; }
.agent-dm-timeline:focus-visible { outline: 2px solid #7cabe5; outline-offset: -2px; }
.agent-dm-message { display: flex; flex-direction: column; align-items: flex-start; margin: 16px 0 5px; min-width: 0; }
.agent-dm-message.outgoing { align-items: flex-end; }
.agent-dm-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; color: #667181; padding: 0 12px 5px; font-size: 11px; }
.agent-dm-meta strong { font-weight: 500; }.agent-dm-meta time { font-size: 10px; }
.agent-dm-bubble { max-width: min(85%, 660px); padding: 11px 15px; border-radius: 19px 19px 19px 5px; background: #eff0f3; min-width: 0; }
.agent-dm-bubble .message-text { color: #222b39; font-size: 14px; line-height: 1.6; }
.agent-dm-bubble .message-text p { margin: 0; white-space: pre-wrap; }.agent-dm-bubble .message-text p + p { margin-top: 10px; }
.agent-dm-message.outgoing .agent-dm-bubble { background: #096bd8; border-radius: 19px 19px 5px 19px; }
.agent-dm-message.outgoing .message-text { color: #fff; }
.agent-dm-message.outgoing .message-text a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.agent-dm-message.outgoing .message-text blockquote { color: #eef5ff; border-color: #a2caff; }
.agent-dm-message.outgoing .message-text code { background: #ffffff20; color: #fff; border-color: #ffffff35; }
.agent-dm-message.outgoing .message-text .message-code { background: #0759b9; border-color: #ffffff35; }
.agent-dm-message.outgoing .message-text .message-code code { background: transparent; }
.agent-dm-message.grouped { margin-top: 5px; }
.agent-dm-message.grouped .agent-dm-meta { padding-top: 1px; padding-bottom: 4px; }
.agent-dm-reply { border-left: 3px solid #8c9cb4; padding: 7px 10px; margin: 0 0 10px; border-radius: 3px; background: #00000006; color: #566171; font-size: 11px; }
.agent-dm-reply strong { display: block; margin-bottom: 3px; font-weight: 600; }.agent-dm-reply p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.outgoing .agent-dm-reply { color: #fff; border-color: #b0d3ff; background: #00000012; }
.agent-dm-references { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 9px; font-size: 11px; overflow-wrap: anywhere; }
.agent-dm-references a, .agent-dm-references button { color: #0057b5; background: #fff; border: 1px solid #dde2e9; border-radius: 7px; padding: 5px 8px; font-size: 11px; max-width: 100%; overflow-wrap: anywhere; }
.outgoing .agent-dm-references code { color: #fff; }
.agent-dm-date { text-align: center; color: #687181; font-size: 11px; font-weight: 500; margin: 16px 0 23px; }
.agent-dm-page { display: block; margin: 12px auto 20px; border: 0; background: #f2f5fa; color: #0963c6; font-size: 12px; border-radius: 20px; }
.agent-dm-jump { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid #dce3ef; border-radius: 20px; padding: 9px 16px; font-size: 12px; color: #0963c6; box-shadow: 0 3px 18px #1936541c; white-space: nowrap; }
.agent-dm-footer { border-top: 1px solid #f0f2f5; padding: 12px 22px; text-align: center; color: #747d8a; font-size: 11px; }
.agent-dm-notice { padding: 10px 20px; background: #fff4e1; color: #7a531e; font-size: 12px; line-height: 1.6; }
.agent-dm-notice button { font-size: 11px; margin-left: 10px; }
.agent-dm-empty { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 75%; text-align: center; padding: 25px; color: #778293; }
.agent-dm-empty .chat-icon { width: 45px; height: 45px; margin-bottom: 8px; color: #8daacd; stroke-width: 1; }
.agent-dm-empty h2 { color: #43516a; font-size: 18px; font-weight: 500; line-height: 1.4; margin-bottom: 4px; }.agent-dm-empty p { font-size: 12px; line-height: 1.6; }
@media(max-width:1100px) { .agent-messages-layout { grid-template-columns: 250px minmax(0, 1fr); }.agent-dm-timeline { padding: 12px 18px 24px; }.agent-dm-bubble { max-width: 94%; }.agent-dm-header { padding: 15px 18px; } }
@media(max-width:900px) {
 .agent-messages-layout { display: flex; }.agent-dm-sidebar { width: 100%; border: 0; }.agent-dm-detail { display: none; width: 100%; }
 .agent-messages-layout.show-detail .agent-dm-sidebar { display: none; }.agent-messages-layout.show-detail .agent-dm-detail { display: flex; }
 .agent-dm-back { display: block; padding: 5px 0; border: 0; background: transparent; color: #0067d3; font-size: 12px; text-align: left; grid-column: 1 / -1; }
 .agent-dm-header { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; padding: 12px 16px; }.agent-dm-header .agent-dm-avatars { width: 44px; }
 .agent-dm-identity h2 { font-size: 14px; }.agent-dm-header .agent-dm-avatar { width: 29px; height: 29px; font-size: 9px; }
 .agent-dm-timeline { padding: 8px 13px 22px; }.agent-dm-bubble { max-width: 94%; padding: 10px 13px; }.agent-dm-bubble .message-text { font-size: 13px; }
 .agent-messages-view .topbar { padding: 12px 17px; }.agent-messages-view .topbar h1 { font-size: 17px; }.agent-dm-controls { padding: 20px 18px 14px; }
 .agent-dm-preview-heading strong { font-size: 14px; }.agent-dm-conversation { padding: 16px 12px; }.agent-dm-preview p { font-size: 13px; }
}
