.history-pager { gap:8px; align-items:center; flex-wrap:wrap; padding:12px 0; border-top:1px solid #26354a; }
.history-refresh { display:inline-flex; align-items:center; flex-wrap:wrap; gap:6px 10px; max-width:100%; color:#b4c3d7; font-size:12px; }
.history-refresh label { display:inline-flex; align-items:center; gap:6px; margin:0; font:inherit; }
.history-refresh select, .history-refresh input[type=number] { box-sizing:border-box; width:auto !important; min-width:0; max-width:110px; margin:0; padding:4px 8px !important; border:1px solid #405777; border-radius:6px; background:#101c2c; color:#edf3fc; font:inherit !important; color-scheme:dark; }
.history-refresh input[type=number] { width:86px !important; }
.history-refresh select:focus-visible, .history-refresh input:focus-visible { outline:2px solid #85bdff; outline-offset:2px; }
.history-refresh [hidden] { display:none; }
.history-refresh-status { flex-basis:100%; color:#f3cb8c; font-size:11.5px; }
.history-refresh-status:empty { display:none; }
.history-refresh input[aria-invalid=true] { border-color:#f3cb8c; }
.history-pager button { width:auto; padding:6px 10px; border:1px solid #405777; border-radius:7px; background:#101c2c; color:#d9e6f8; font:inherit; font-size:12px; cursor:pointer; }
.history-page-size { display:inline-flex; align-items:center; gap:8px; margin-right:auto; color:#b4c3d7; font-size:12px; }
.history-page-size select { width:auto; min-width:65px; padding:6px 9px; margin:0; border:1px solid #405777; border-radius:7px; background:#101c2c; color:#edf3fc; font:inherit; }
.history-pager button:focus-visible, .history-page-size select:focus-visible,
.history-reply:focus-visible, .history-view:focus-visible, .history-ticket:focus-visible { outline:2px solid #85bdff; outline-offset:3px; }
.history-list { display:flex; flex-direction:column; gap:10px; max-height:560px !important; padding:10px 4px 10px 0; overflow:auto; white-space:normal !important; scrollbar-width:thin; scrollbar-color:#405777 #0b1320; }
.history-message { display:flex; align-items:flex-start; gap:12px; padding:16px; border:1px solid #2b3d55; border-left:3px solid #64b5ce; border-radius:10px; background:#101b29; color:#dbe6f2; font-size:13px; text-align:left; }
.history-message--out { border-left-color:#889def; background:#121b2d; }
.history-message--note { border-color:#796437; border-left-color:#e6b65b; background:#251f13; }
.history-avatar { flex:none; display:grid; place-items:center; width:32px; height:32px; border-radius:9px; background:#213a4d; color:#ccedff; font-weight:700; }
.history-message--out .history-avatar { background:#2c3152; color:#e3e4ff; }
.history-message--note .history-avatar { background:#4c3e21; color:#ffe3a7; }
.history-content { min-width:0; flex:1; }
.history-header { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 10px; margin-bottom:5px; overflow-wrap:anywhere; }
.history-header strong { font-size:13px; font-weight:650; color:#f0f5ff; }
.history-direction { border:1px solid #42536a; border-radius:5px; padding:1px 6px; color:#c2d0e6; font-size:10px; line-height:1.6; font-weight:500; }
.history-time { margin-left:auto; color:#9dadc3; font-size:11px; line-height:1.6; }
.history-context { color:#9dadc3; font-size:11px; margin-bottom:8px; overflow-wrap:anywhere; }
.history-body { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.65; }
.history-reply, .history-view, .history-attachment { display:inline-block; width:auto; margin:10px 8px 0 0; padding:5px 10px; border:1px solid #405777; border-radius:6px; background:#162439; color:#c9e2ff; font:inherit; font-size:11px; text-decoration:none; cursor:pointer; overflow-wrap:anywhere; }
.history-ticket { display:block; width:100%; padding:14px 16px; margin-bottom:8px; border:1px solid #2b3d55; border-radius:10px; background:#101b29; color:#e6edf7; text-align:left; cursor:pointer; white-space:normal; }
.history-ticket:hover { background:#17263a; border-color:#58749a; }
.history-ticket-meta { display:block; color:#a4b4ca; font-size:12px; line-height:1.6; margin-top:6px; overflow-wrap:anywhere; }
.history-email-header { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 10px; }
.history-email-header .ecm-sender { color:#edf3fc; font-size:13px; overflow-wrap:anywhere; }
.history-email-address { color:#9dadc3; font-size:11px; overflow-wrap:anywhere; }
#emailChatCard .ecm-row.history-email, #ownerEmailCard .ecm-row.history-email { padding:16px; margin-bottom:10px; border-left:3px solid #64b5ce; }
#emailChatCard .history-email[data-direction=out], #ownerEmailCard .history-email[data-direction=out] { border-left-color:#889def; }
#emailChatCard .history-email .ecm-snip, #ownerEmailCard .history-email .ecm-snip { font-size:13px; line-height:1.65; color:#c1cede; margin-top:8px; overflow-wrap:anywhere; }
#emailChatCard .history-email .ecm-subject, #ownerEmailCard .history-email .ecm-subject { white-space:normal !important; overflow-wrap:anywhere; line-height:1.5; margin-top:7px !important; }
#emailChatCard .history-email .ecm-acts, #ownerEmailCard .history-email .ecm-acts { opacity:1; border-top:1px solid #283950; padding-top:10px; }
@media(max-width:600px) {
  .history-message { padding:12px; gap:8px; }
  .history-avatar { width:26px; height:26px; font-size:11px; }
  .history-time { width:100%; margin-left:0; }
  .history-page-size { width:100%; }
  .history-pager [role=status] { order:2; width:100%; }
  #emailChatCard .ecm-row.history-email, #ownerEmailCard .ecm-row.history-email { padding:12px; gap:7px; }
  .history-email .ecm-av { display:none; }
}
.history-filters{display:flex;flex-wrap:wrap;align-items:end;gap:10px;padding:14px;margin:10px 0 14px;border:1px solid #29384d;border-radius:10px;background:#101a29}
.history-filters[hidden]{display:none}
.history-filters label,.history-participant{display:flex;flex:1 1 160px;flex-direction:column;gap:5px;min-width:0;color:#aebed1;font-size:12px}
.history-participant>label{display:block;flex:none}
.history-filters input,.history-filters select{box-sizing:border-box;width:100%;min-width:0;padding:8px 10px;border:1px solid #3a4a62;border-radius:7px;background:#0b1421;color:#e0e9f5;font:inherit;color-scheme:dark}
.history-filters input[hidden]{display:none}
.history-filters button{width:auto;padding:8px 12px;border:1px solid #456186;border-radius:7px;background:#1a304b;color:#e0e9f5;font:inherit;cursor:pointer}
.history-filters input:focus-visible,.history-filters select:focus-visible,.history-filters button:focus-visible{outline:2px solid #81b5ff;outline-offset:2px}
.history-filter-hint,.history-filter-status,.history-participant-hint{flex-basis:100%;font-size:11.5px;color:#9eafc6}
.history-filter-status:empty,.history-participant-hint:empty{display:none}
.history-filter-status{color:#f3cb8c}
@media(max-width:600px){.history-filters{padding:10px;gap:8px}.history-filters>label{flex-basis:calc(50% - 8px)}.history-filters>label:first-child,.history-participant{flex-basis:100%}}

/* Website and Telegram conversation history, matching the owner chat bubbles. */
.history-list--bubbles { box-sizing:border-box; padding:16px 20px; border:1px solid #30363d; border-radius:6px; background:#010409; }
.history-message--bubble { flex:none; align-self:flex-end; box-sizing:border-box; min-width:0; max-width:75%; padding:10px 14px; border:0; border-radius:16px 16px 4px 16px; background:#1f6feb; color:#fff; font-size:14px; }
.history-message--bubble.history-message--out { align-self:flex-start; border:1px solid #30363d; border-radius:16px 16px 16px 4px; background:#161b22; color:#e6edf3; }
.history-message--bubble.history-message--note { align-self:flex-start; border:1px solid #796437; border-radius:16px; background:#251f13; color:#ffe3a7; }
.history-message--bubble .history-body { line-height:1.5; }
.history-message--bubble .history-header { justify-content:flex-end; gap:4px 6px; margin:5px 0 0; color:#d3e2ff; font-size:11px; }
.history-message--bubble .history-header strong, .history-message--bubble .history-direction, .history-message--bubble .history-time { width:auto; margin:0; padding:0; border:0; color:inherit; font-size:inherit; font-weight:400; }
.history-message--bubble .history-context { margin:4px 0 0; color:#d3e2ff; text-align:right; }
.history-message--bubble.history-message--out .history-header, .history-message--bubble.history-message--note .history-header { justify-content:flex-start; color:#9ba5b0; }
.history-message--bubble.history-message--out .history-context, .history-message--bubble.history-message--note .history-context { color:#9ba5b0; text-align:left; }
.history-bubble-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; margin-top:6px; }
.history-message--out .history-bubble-actions, .history-message--note .history-bubble-actions { justify-content:flex-start; }
.history-bubble-actions .history-reply, .history-bubble-actions .history-view, .history-bubble-actions .history-attachment { margin:0; border-color:#ffffff40; background:#ffffff0a; color:inherit; }
@media(max-width:600px) {
  .history-list--bubbles { padding:10px 8px; }
  .history-message--bubble { max-width:92%; padding:10px 12px; }
}
