/* Conversation area (chosen layout: conversation + fixed sources column). */
[data-view="welcome"] .src-panel { display: none !important; }
.follow-arrow { color: var(--accent); }

/* ── Three panes: conversation + fixed sources column ───────────────── */
[data-view="chat"] { grid-template-columns: auto minmax(0, 1fr) 344px; }
[data-view="chat"] > [data-slot="notice"] { grid-column: 2 / 4; }

/* Conversation */
.thread { display: block; width: min(760px, 100% - 48px); padding: 26px 0 14px; }
.msg.user { width: fit-content; max-width: 78%; margin: 30px 0 0 auto; }
.msg.user:first-child { margin-top: 0; }
.bubble { padding: 11px 16px; border: 0; border-radius: var(--radius-lg); background: var(--primary); color: var(--text-inverse); font-size: 15px; line-height: 23px; font-weight: 500; box-shadow: 3px 3px 0 var(--v-ink); }
.msg.bot { display: block; position: relative; margin: 14px 3px 0 0; padding: 12px 18px 14px; border: 1.5px solid var(--tdtu-blue-200); border-radius: var(--radius-md); background: var(--paper); cursor: pointer; transition: border-color var(--duration-fast); }
.msg.bot:hover { border-color: var(--v-ink); }
.msg.bot.is-active { padding: 11.5px 17.5px 13.5px; border: 2px solid var(--v-ink); box-shadow: 3px 3px 0 var(--primary); }
.msg.bot > .bot-mark { display: flex; align-items: center; width: auto; height: 26px; margin-bottom: 6px; padding-left: 44px; border-radius: 0; background: url('/static/assets/brand/tdtu-logo-mark.png') 0 center / 36px auto no-repeat; box-shadow: none; color: var(--heading); font-size: 13.5px; font-weight: 700; }
.msg.bot > .bot-mark::after { content: var(--bot-name, 'Trợ lý Sinh viên FIT'); }
.msg.bot .answer { font-size: 15.5px; line-height: 27px; color: var(--gray-800); }
.answer ul { gap: 6px; }
.answer li::marker { color: var(--accent); }
.cite { min-width: 20px; height: 20px; margin-left: 4px; border-radius: var(--radius-xs); background: var(--v-yellow); color: var(--tdtu-blue-800); transition: background var(--duration-fast), color var(--duration-fast); }
.cite:hover, .cite.is-on { background: var(--v-ink); color: var(--text-inverse); }
.msg.bot .sources { display: none; }
.actions { position: absolute; top: 6px; right: 8px; margin: 0; }
.followups { margin-top: 10px; }
.follow { border: 1.5px solid var(--tdtu-blue-200); background: var(--primary-soft); font-size: 13.5px; transition: transform var(--duration-fast), box-shadow var(--duration-fast), border-color var(--duration-fast), background var(--duration-fast); }
.follow:hover { border-color: var(--v-ink); background: var(--v-cream); box-shadow: 2px 2px 0 var(--v-ink); transform: translate(-1px, -1px); }

/* Sources column: same language as the history column */
.src-panel { grid-column: 3; grid-row: 2 / 4; display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 16px 14px; overflow-y: auto; background: var(--paper); border-left: 1.5px solid var(--tdtu-blue-200); }
.src-head h2 { display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-size: 17px; line-height: 24px; font-weight: 800; color: var(--heading); }
.src-head h2::before { content: ''; flex: none; width: 5px; height: 16px; border-radius: 2px; background: var(--tdtu-red-500); }
.src-count { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-xs); background: var(--v-yellow); color: var(--tdtu-blue-800); font-family: var(--font-sans); font-size: 12.5px; font-weight: 700; }
.src-head p { margin-top: 1px; padding-left: 13px; font-size: 12.5px; line-height: 18px; color: var(--muted); }
.sc { display: flex; align-items: flex-start; flex: none; gap: 10px; padding: 11px 12px; border: 1.5px solid var(--tdtu-blue-200); border-radius: var(--radius-md); background: var(--primary-soft); cursor: pointer; transition: background var(--duration-fast), border-color var(--duration-fast); }
.sc:hover { border-color: var(--v-ink); background: var(--v-cream); }
.sc:focus { outline: none; }
.sc.is-on, .sc.is-on:hover { padding: 10.5px 11.5px; border: 2px solid var(--v-ink); background: var(--v-cream); box-shadow: 3px 3px 0 var(--primary); }
.sc-n { display: grid; place-items: center; flex: none; width: 26px; height: 26px; margin: 1px 2px 2px 0; box-sizing: border-box; border: 2px solid var(--v-ink); border-radius: var(--radius-xs); background: var(--primary); color: var(--text-inverse); font-family: var(--font-heading); font-size: 12.5px; font-weight: 800; box-shadow: 1.5px 1.5px 0 var(--v-ink); }
.sc-main { flex: 1; min-width: 0; }
.sc-line { display: flex; align-items: flex-start; gap: 8px; }
.sc-name { flex: 1; min-width: 0; font-family: var(--font-heading); font-size: 13.5px; line-height: 19px; font-weight: 700; color: var(--heading); }
.sc-tag { flex: none; padding: 1px 6px; border-radius: var(--radius-xs); background: var(--paper); color: var(--text-2); font-size: 10.5px; line-height: 15px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.sc-meta { display: block; margin-top: 2px; font-size: 12.5px; line-height: 18px; color: var(--muted); }
.sc-meta b { font-weight: 600; color: var(--primary); }
.sc-link { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--primary); font-size: 12.5px; line-height: 18px; font-weight: 500; text-decoration: none; }
.sc-link span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-link:hover span { text-decoration: underline; text-underline-offset: 2px; }
.sc-link .ic { flex: none; width: 13px; height: 13px; }
.src-none { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-md); background: var(--primary-soft); font-size: 13.5px; line-height: 20px; color: var(--text-2); }
.src-none .ic { flex: none; width: 18px; height: 18px; color: var(--v-ink); }
.dock-chat .composer { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }

/* The history column stays on both screens and only hides with the menu button. */
[data-view="welcome"] { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; }
[data-view="welcome"] > .top { grid-column: 1 / -1; grid-row: 1; }
[data-view="welcome"] > aside.drawer { grid-column: 1; grid-row: 2 / 5; position: static; width: 296px; min-height: 0; padding: 16px 12px 12px; transform: none; visibility: visible; background: var(--paper); border-right: 1.5px solid var(--tdtu-blue-200); z-index: auto; }
[data-view="welcome"] .drawer-head { display: none; }
[data-view="welcome"] > .scroll { grid-column: 2; grid-row: 2; }
[data-view="welcome"] > [data-slot="notice"] { grid-column: 2; grid-row: 4; }
[data-view="welcome"][data-side="closed"] > aside.drawer { margin-left: -296px; visibility: hidden; }
[data-side-ready][data-view="welcome"] > aside.drawer { transition: margin-left var(--duration-slow) var(--ease-out), visibility var(--duration-slow); }
[data-side="open"] .lead h2 { font-size: clamp(34px, 3.2vw, 48px); }
.stage { gap: 48px; }
