/* Shared, browser-local conversation history controls for individual chatbot pages. */
.history-toolbar { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:9px; margin:0 0 14px; }
.history-action { min-height:42px; padding:8px 14px; border:1px solid #d8cbbb; border-radius:8px; background:#fff; color:#5a3e2b; font-family:inherit; font-size:14px; font-weight:600; cursor:pointer; }
.history-action.primary { background:#8a5a36; border-color:#8a5a36; color:#fff; }
.history-action:hover { filter:brightness(.96); }
.history-action:focus-visible,.history-close:focus-visible { outline:3px solid #d7b98d; outline-offset:2px; }
.history-count { display:inline-flex; min-width:22px; height:22px; align-items:center; justify-content:center; margin-left:4px; padding:0 5px; border-radius:12px; background:#eee7de; font-size:12px; }
.history-notice { flex:1 0 100%; margin:0; color:#8a4b39; font-size:13px; text-align:right; }
.history-backdrop[hidden] { display:none; }
.history-backdrop { position:fixed; inset:0; z-index:1000; display:flex; justify-content:flex-end; background:rgba(32,28,24,.42); }
.history-drawer { width:min(430px,100vw); height:100%; overflow:auto; padding:20px; background:#fffdf9; box-shadow:-8px 0 28px rgba(0,0,0,.18); }
.history-drawer-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:12px; border-bottom:1px solid #e8dfd4; }
.history-drawer-head h2 { margin:0; color:#4a3324; font-size:21px; }
.history-close { width:42px; height:42px; border:0; border-radius:50%; background:#eee7de; color:#4a3324; font-size:28px; cursor:pointer; }
.history-local-note,.history-meta { color:#75695f; font-size:13px; }
.history-meta { overflow-wrap:anywhere; }
.history-drawer-actions { display:flex; gap:8px; margin:13px 0; }
.history-entry { margin:10px 0; padding:12px; border:1px solid #e6ddd1; border-radius:9px; background:#fff; }
.history-entry h3 { margin:0 0 4px; color:#4a3324; font-size:16px; }
.history-entry-actions { display:flex; flex-wrap:wrap; gap:7px; }
.history-entry-actions button { min-height:38px; padding:6px 10px; border:1px solid #d8cbbb; border-radius:7px; background:#f8f4ee; color:#5a3e2b; font:inherit; cursor:pointer; }
.history-entry-actions .history-delete { color:#8a3d32; }
.history-empty { padding:18px 8px; color:#75695f; text-align:center; }
.history-turn { margin:12px 0; padding:12px; border-radius:8px; background:#f7f3ed; }
.history-turn-question { margin:0 0 8px; color:#4a3324; font-weight:700; }
.history-turn-answer { padding:10px; border:1px solid #e7dfd5; border-radius:7px; background:white; overflow-wrap:anywhere; }
.history-turn-answer .source-item { padding:10px; }
body.history-drawer-open { overflow:hidden; }
@media(max-width:600px) { .history-toolbar { justify-content:space-between; gap:7px; margin-bottom:11px; } .history-action { min-height:40px; padding:7px 10px; font-size:13px; } .history-backdrop { align-items:flex-end; } .history-drawer { width:100%; height:min(82vh,680px); max-height:calc(100dvh - 12px); padding:16px 14px calc(18px + env(safe-area-inset-bottom)); border-radius:18px 18px 0 0; box-shadow:0 -8px 28px rgba(0,0,0,.2); } .history-drawer-actions { flex-wrap:wrap; } }
