/* Chat screen: history panel, answers and scrollbars shared by the chosen layout. */

/* ── History panel, shared ─────────────────────────────────────────────── */
.drawer { gap: 12px; padding: 16px 14px 14px; }
.drawer-head strong { font-size: 18px; font-weight: 800; }
.drawer-new { display: none; }
.hist-head { display: none; }
.hist-search { display: flex; align-items: center; flex: none; gap: 8px; height: 38px; padding: 0 12px; border: 1.5px solid transparent; border-radius: var(--radius-md); background: var(--gray-100); color: var(--text-2); transition: border-color var(--duration-fast), background var(--duration-fast); }
.hist-search:focus-within { border-color: var(--v-ink); background: var(--paper); }
.hist-search .ic { width: 16px; height: 16px; }
.hist-search input { flex: 1; min-width: 0; border: 0; background: none; font-size: 14px; color: var(--text); }
.hist-search input:focus-visible { outline: none; }
.hist-search input::placeholder { color: var(--muted); opacity: 1; }
.drawer [data-slot="history"] { flex: 1; min-height: 0; overflow-y: auto; }
.hist-group + .hist-group { margin-top: 18px; }
.hist-group h3 { padding: 0 10px 6px; font-family: var(--font-heading); font-size: 13px; line-height: 18px; font-weight: 700; color: var(--heading); }
.hist-row { position: relative; border-radius: var(--radius-md); }
.hist-row + .hist-row { margin-top: 2px; }
.hist-item { display: block; width: 100%; padding: 9px 10px; border-radius: var(--radius-md); box-shadow: none !important; text-align: left; white-space: normal; color: var(--text); transition: background var(--duration-fast); }
.hist-title { display: block; font-size: 14.5px; line-height: 20px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { display: none; }
.hist-item:hover { background: var(--v-cream); color: var(--tdtu-blue-800); }
.hist-item[aria-current], .hist-item[aria-current]:hover { background: var(--v-yellow); color: var(--tdtu-blue-800); }
.hist-item[aria-current] .hist-title { font-weight: 700; }
.hist-acts { position: absolute; right: 4px; top: 50%; display: none; gap: 2px; transform: translateY(-50%); }
.hist-row:hover .hist-acts, .hist-row:focus-within .hist-acts { display: flex; }
.hist-row:hover .hist-title, .hist-row:focus-within .hist-title { padding-right: 60px; }
.hist-act { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm); color: var(--v-ink); }
.hist-act:hover { background: rgb(14 50 111 / .12); }
.hist-act .ic { width: 14px; height: 14px; }
.hist-none { padding: 12px 10px; font-size: 14px; color: var(--muted); }
.hist-scope { display: flex; align-items: center; flex: none; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--v-cream); font-size: 13px; line-height: 18px; color: var(--gray-700); }
.hist-scope span { flex: 1; }
.hist-scope .link { flex: none; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--primary); color: var(--text-inverse); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.hist-scope .link:hover { background: var(--v-yellow); color: var(--tdtu-blue-800); }
.contact { --link-c: var(--text-2); display: flex; flex-wrap: wrap; flex: none; gap: 2px 14px; padding: 2px 10px 0; font-size: 12.5px; line-height: 20px; }
.contact h2, .contact .ic { display: none; }
.contact .link { font-size: 12.5px; font-weight: 400; text-decoration: none; }
.contact a:hover, .contact .link:hover { color: var(--v-ink); text-decoration: underline; }

/* ── Answers, shared ───────────────────────────────────────────────────── */
.followups { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.follow-label { flex-basis: 100%; font-size: 13.5px; font-weight: 700; color: var(--heading); }
.follow { padding: 7px 13px; border: 2px solid var(--v-ink); border-radius: var(--radius-full); background: var(--paper); color: var(--v-ink); font-size: 14px; line-height: 20px; font-weight: 500; text-align: left; transition: background var(--duration-fast); }
.follow:hover { background: var(--v-yellow); }
.bot-logo { background: var(--paper) url('/static/assets/brand/tdtu-logo-badge-534.png') center / 128% no-repeat; }
.answer strong { color: var(--tdtu-blue-800); }
.act:hover { background: var(--v-yellow); color: var(--tdtu-blue-800); }

/* ── Permanent history column, flat answers ──────────────────────────── */
[data-view="chat"] { display: grid; grid-template-columns: 296px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; }
[data-view="chat"] > .top { grid-column: 1 / -1; grid-row: 1; }
[data-view="chat"] .top [data-action="drawer"] { display: none; }
[data-view="chat"] > aside.drawer { grid-column: 1; grid-row: 2 / 5; position: static; width: auto; min-height: 0; transform: none; visibility: visible; background: var(--paper); border-right: 1.5px solid var(--tdtu-blue-200); padding: 16px 12px 12px; z-index: auto; }
[data-view="chat"] .drawer-head { display: none; }
[data-view="chat"] > .scroll { grid-column: 2; grid-row: 2; }
[data-view="chat"] > .dock-chat { grid-column: 2; grid-row: 3; padding: 4px 24px 12px; border-top: 0; background: none; }
[data-view="chat"] > [data-slot="notice"] { grid-column: 2; grid-row: 4; }
.dock-chat .composer { width: min(800px, 100%); box-shadow: 4px 4px 0 var(--primary); }
.thread { width: min(800px, 100% - 48px); gap: 26px; }
.msg.user { max-width: 78%; }
.bubble { border: 0; border-radius: var(--radius-lg); background: var(--primary-soft); color: var(--tdtu-blue-800); box-shadow: none; }
.msg.bot { grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; }
.msg.bot > * { grid-column: 2; }
.msg.bot > .bot-mark { display: block; grid-column: 1; grid-row: 1 / span 4; width: 36px; height: 36px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1.5px var(--rule); }
.sources { grid-column: 2; grid-row: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; border: 0; box-shadow: none; }
.sources-title { grid-column: 1 / -1; }
.source { margin: 0; padding: 10px 12px; border: 1.5px solid var(--rule); border-radius: var(--radius-md); background: var(--paper); }

/* ── Scrollbars: slim rounded thumb, no arrows ─────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: var(--radius-full); background: var(--tdtu-blue-200) padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--tdtu-blue-400) padding-box; }
::-webkit-scrollbar-button { display: none; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--tdtu-blue-200) transparent; } }
