.content.views { height:100%; }
.view[data-view="widget-history"] { min-width:0; min-height:0; height:100%; overflow:hidden; }
.view[data-view="widget-history"].active { display:flex; }
.widget-history-shell { display:grid; grid-template-rows:auto auto minmax(0,1fr); gap:14px; min-height:0; min-width:0; width:100%; height:100%; overflow:hidden; }
.widget-history-grid { display:grid; grid-template-columns:minmax(0,1fr); min-height:0; min-width:0; }
.history-tabs { display:flex; gap:4px; min-width:0; min-height:54px; overflow-x:auto; padding:4px; border-bottom:1px solid var(--border); }
.history-tabs__item { display:flex; flex:0 0 auto; align-items:center; border:1px solid transparent; border-radius:12px 12px 0 0; background:var(--panel); }
.history-tabs__item.is-active { background:var(--panel-strong); border-color:var(--border); }
.history-tabs__item [role="tab"] { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.widget-history-shell button { min-height:44px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--text); padding:8px 12px; cursor:pointer; font:inherit; font-size:13px; }
.widget-history-shell button:hover:not(:disabled) { background:var(--panel-strong); }
.widget-history-shell button:disabled { opacity:.45; cursor:default; }
.history-tabs__item button[data-history-close] { min-width:44px; font-size:20px; color:var(--muted); }
.history-tabs__item [aria-selected="true"] { font-weight:600; }
.history-library { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto minmax(100px,1fr) auto; min-height:0; gap:10px; }
.history-toolbar { display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,210px) auto auto; align-items:end; gap:12px; }
.history-toolbar label { display:grid; gap:6px; min-width:0; font-size:12px; color:var(--muted); }
.history-toolbar input,.history-toolbar select,.history-rename-dialog input { width:100%; min-width:0; min-height:44px; font-size:16px; }
.history-toolbar input::placeholder { color:var(--muted); }
.history-layout { display:flex; gap:4px; padding:4px; border-radius:12px; background:var(--panel); }
.history-layout button[aria-pressed="true"] { background:var(--panel-strong); border-color:var(--border); }
.history-preference-note { margin:0; color:var(--muted); font-size:12px; }
.widget-history-list { display:grid; grid-template-columns:minmax(0,1fr); align-content:start; grid-auto-rows:max-content; min-height:0; min-width:0; overflow:auto; overscroll-behavior:contain; padding-right:4px; }
.widget-history-list[data-layout="grid"] { grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr)); gap:12px; }
.history-session { display:flex; align-items:center; gap:12px; min-width:0; border-bottom:1px solid var(--border); padding:12px 0; }
.widget-history-shell .widget-history-session { display:grid; gap:6px; flex:1; text-align:left; min-width:0; }
.widget-history-session__title { display:flex; gap:8px; align-items:baseline; min-width:0; }
.widget-history-session__id { font-size:15px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.history-session.is-unread .widget-history-session__id { font-weight:700; }
.history-session__badge { color:#b7d3ff; font-size:11px; flex-shrink:0; }
.history-session__preview { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; overflow-wrap:anywhere; color:var(--muted); font-size:13px; }
.widget-history-session__meta,.widget-history-empty { color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.history-session__actions { display:flex; flex-wrap:wrap; gap:4px; }
.widget-history-list[data-layout="grid"] .history-session { flex-direction:column; align-items:stretch; padding:12px; border:1px solid var(--border); border-radius:16px; background:var(--panel); }
.history-pagination { display:flex; flex-wrap:wrap; gap:8px; justify-content:space-between; align-items:center; font-size:12px; color:var(--muted); }
.history-pagination nav { display:flex; gap:4px; align-items:center; }
.history-pagination [data-history-page-label] { min-width:42px; text-align:center; }
.history-pagination button { border-color:var(--border); }
.widget-history-conversation { display:grid; grid-template-rows:auto minmax(0,1fr); gap:12px; min-height:0; min-width:0; overflow:hidden; }
.widget-history-panel__head { display:flex; justify-content:space-between; flex-wrap:wrap; align-items:start; gap:12px; }
.widget-history-panel__head > div:first-child { min-width:0; flex:1; }
.widget-history-panel__head h2 { font-size:20px; overflow-wrap:anywhere; }
.widget-history-panel__head .section-sub { font-size:12px; overflow-wrap:anywhere; }
.history-conversation-actions { display:flex; flex-wrap:wrap; gap:4px; }
.history-conversation-actions .btn { border-color:var(--border); }
.chatgpt--widget-history { min-height:0; height:100%; overflow:hidden; border-color:var(--border); box-shadow:none; background:var(--panel); }
.chatgpt--widget-history .chatgpt__messages { min-height:0; max-height:100%; display:flex; flex-direction:column; gap:10px; justify-content:flex-start; align-items:stretch; overflow-y:auto; overscroll-behavior:contain; }
.widget-history-empty { grid-column:1/-1; padding:24px; text-align:center; }
.history-rename-dialog { width:min(440px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto; padding:24px; border:1px solid var(--border); border-radius:20px; background:#16181b; color:var(--text); }
.history-rename-dialog::backdrop { background:#000a; }
.history-rename-dialog form { display:grid; gap:14px; }
.history-rename-dialog h2 { margin:0; font-size:20px; }
.history-rename-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px; }
.history-rename-actions .primary { background:var(--text); color:var(--bg); }
@media(max-width:700px) {
.history-toolbar { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.history-toolbar label:first-child { grid-column:1/-1; }
.history-toolbar > .btn { grid-column:2; justify-self:end; }
.history-session { flex-direction:column; align-items:stretch; gap:0; }
.history-tabs__item [role="tab"] { max-width:170px; }
.widget-history-panel__head > div:first-child { flex-basis:100%; }
.widget-history-shell > .consumer-chat-head .sub { font-size:12px; }
}
@media(max-height:650px) { .widget-history-shell { grid-template-rows:auto auto minmax(360px,1fr); overflow-y:auto; } }
