.history-intro{margin:0 0 20px;color:var(--muted);font-size:13px}
.history-card{background:white;border:1px solid var(--line);border-radius:12px;margin:0 0 18px;min-width:0;overflow:hidden}
.history-card>summary{list-style:none;display:flex;align-items:center;gap:16px;padding:23px 24px;color:#273747;min-width:0}
.history-card>summary::-webkit-details-marker{display:none}
.history-card>summary:hover{background:#fafbfc}
.history-card>summary:focus-visible{outline:2px solid var(--accent);outline-offset:-3px;border-radius:11px}
.history-icon{display:grid;place-items:center;width:42px;height:42px;background:#f9eee8;color:#b44a24;border-radius:10px;flex-shrink:0}
.history-icon.access{background:#edf3fd;color:#4b77b6}
.history-icon.admin{background:#f0edfa;color:#7760a4}
.history-heading{flex:1;min-width:0}
.history-heading h2{font-size:16px;margin:0 0 6px}
.history-heading p{margin:0;color:var(--muted);font-size:12px;line-height:1.6}
.history-count{background:#f1f4f6;border-radius:6px;padding:5px 9px;font-size:12px;color:#627385;white-space:nowrap}
.history-toggle{font-size:12px;display:flex;align-items:center;gap:8px;white-space:nowrap;color:#63717e}
.history-toggle::after{content:'';width:7px;height:7px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg);margin-top:-4px}
.history-card[open]>.history-summary .history-toggle::after{transform:rotate(225deg);margin-top:4px}
.history-card[open]>.history-summary .when-closed,.history-card:not([open])>.history-summary .when-open{display:none}
.history-body{border-top:1px solid #edf0f3;padding:18px 24px 22px;min-width:0}
.history-body>.hint{margin:0 0 14px}
.history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px}
.history-search{display:flex;align-items:center;gap:8px;flex:1 1 440px;max-width:620px;margin:0}
.history-search input{min-width:180px;margin:0;padding:9px 12px;font-size:12px}
.history-search button,.history-batch-actions button{font-size:12px;padding:8px 13px;white-space:nowrap}
.history-batch-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex:0 0 auto}
.history-selection-count{font-size:12px;color:#63717e;white-space:nowrap}
.history-batch-actions .history-select-matching{border-color:#bfd0e2;background:#f5f8fc;color:#315d86}
.history-batch-actions .history-select-matching:hover{background:#eaf2fa;border-color:#9fb9d1}
.history-batch-actions .history-bulk-delete{background:#b43e32;border-color:#b43e32;color:#fff}
.history-batch-actions .history-bulk-delete:hover{background:#9f342a;border-color:#9f342a}
.history-batch-actions .history-bulk-delete:disabled{background:#e5c4bf;border-color:#e5c4bf;color:#fff}
.history-body .table-wrap{border-radius:7px;min-width:0;max-width:100%;outline-offset:-2px}
.history-body table{min-width:840px}
.history-body td{white-space:pre-line}
.history-body td:first-child{min-width:150px}
.history-body td:last-child{min-width:66px}
.history-body th:last-child,.history-body td:last-child{position:sticky;right:0;background:#fff;box-shadow:-5px 0 7px #24313d08;z-index:1}
.history-body th:last-child{background:#f7f9fa}
.history-select-column{width:46px!important;min-width:46px!important;max-width:46px!important;text-align:center;position:sticky;left:0;background:#fff;z-index:2}
th.history-select-column{background:#f7f9fa;z-index:3}
.history-row-select,.history-select-all{width:16px;height:16px;margin:0;accent-color:var(--accent);cursor:pointer}
.history-row-select:disabled,.history-select-all:disabled{cursor:not-allowed;opacity:.4}
.history-card.batch-mode .history-delete,.notification-history.batch-mode .history-delete{display:none}
.history-row-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}
.history-row-actions>button{margin:0;min-height:32px;flex-shrink:0}
.history-row-actions .history-delete{display:grid;place-items:center;width:32px;height:32px;padding:0;border:1px solid transparent;background:transparent;color:#7a8791;border-radius:6px}
.history-row-actions .history-delete:hover{color:#b23b31;background:#fff0ee;border-color:#f0d9d5}
.history-row-actions .history-delete:focus-visible{outline:2px solid #b44a24;outline-offset:1px}
.history-row-actions .history-delete:disabled{color:#aab1b8;cursor:not-allowed;background:transparent;border-color:transparent}
#confirmMessage{white-space:pre-wrap;overflow-wrap:anywhere}
#confirmDialog{max-height:calc(100dvh - 32px);overflow:auto}
#historyTable td:nth-child(2){min-width:245px;max-width:440px}
#researchHistory.batch-mode #historyTable td:nth-child(2){min-width:150px;max-width:none}
#researchHistory.batch-mode #historyTable td:nth-child(3){min-width:245px;max-width:440px}
.history-question{margin:0 0 5px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.history-record-id{color:#7b8793;font-size:11px;display:block;overflow-wrap:anywhere}
.history-state{font-size:12px;margin:0 0 12px;color:var(--muted)}
.history-error{display:flex;align-items:center;gap:12px;margin:10px 0 16px;color:#a13b32;overflow-wrap:anywhere}
.history-error button{white-space:nowrap;font-size:12px}
.history-pagination{display:flex;gap:12px 18px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-top:18px}
.history-range{font-size:12px;color:#6a7885}
.history-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.history-controls button{font-size:12px;padding:7px 10px}
.history-controls button:disabled{cursor:default}
.history-controls label{display:flex;flex-direction:row;align-items:center;gap:6px;margin:0;font-size:12px;font-weight:400;color:#64727f}
.history-controls select{width:84px;font-size:12px;padding:7px}
.history-jump{display:flex;align-items:center;gap:6px;margin:0}
.history-jump input{width:60px;padding:6px;font-size:12px}
.history-page-total{font-size:12px;color:#64727f;white-space:nowrap}
.history-cutoff{font-size:11px;color:#7b8894;margin:12px 0 0}
.history-filter{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:0 0 16px}
.history-filter label{flex:1 1 145px;min-width:0;font-size:12px;margin:0}
.history-filter input{padding:8px 10px;font-size:12px}
.history-filter-actions{display:flex;gap:8px}
.history-filter button{font-size:12px;padding:8px 12px}
.notification-history{border:1px solid var(--line);border-radius:9px;margin:24px 0 0;overflow:hidden}
.notification-history>summary{padding:15px 16px;background:#f9fafc;color:#526473;font-size:13px}
.notification-history>summary .history-count{margin-left:8px;font-size:11px;padding:3px 7px}
.notification-history>.history-body{padding:16px}
.notification-history table{min-width:700px}
@media(max-width:760px){
 .history-card>summary{padding:18px 16px;gap:11px;flex-wrap:wrap}
 .history-heading{flex-basis:calc(100% - 60px)}
 .history-heading h2{font-size:15px}
 .history-count{margin-left:53px}
 .history-toggle{margin-left:auto}
 .history-body{padding:16px}
 .history-toolbar{align-items:stretch;flex-direction:column}
 .history-search{max-width:none;flex-basis:auto;width:100%}
 .history-search input{width:100%}
 .history-batch-actions{justify-content:flex-end;flex-wrap:wrap}
 .history-pagination{gap:12px}
 .history-controls{width:100%;gap:10px}
 .history-controls>label{flex-basis:100%}
 .history-jump{flex-wrap:wrap}
 .history-filter-actions{width:100%}
 .notification-history>summary .history-count{margin-left:6px}
 .notification-history>.history-body{padding:12px}
}
