/* Banban window layout; character rendering and evidence primitives live in banban.css. */
.banban-root { --bb-ink: #24384e; --bb-blue: #076bc6; right: 20px; bottom: 18px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; font-size: 15px; }
.banban-root *, .banban-root *::before, .banban-root *::after { box-sizing: border-box; }
.banban-root button, .banban-root input, .banban-root select, .banban-root textarea { font-family: inherit; }
.banban-root button:focus-visible, .banban-root summary:focus-visible { outline: 3px solid #4796dc; outline-offset: 3px; }
.banban-root button:disabled { cursor: default; opacity: .48; }
.bb-icon { display: block; width: 19px; height: 19px; flex: none; pointer-events: none; }
.bb-launcher { gap: 0; padding: 4px 8px 5px; cursor: grab; }
.bb-launcher:hover { background: #eaf4ffb3; }
.bb-launcher .bb-mascot { width: 104px; }
.bb-launcher-name { border-color: #e0e9f2; box-shadow: 0 2px 8px #274b7110; font-size: 15px; line-height: 28px; padding: 0 14px; }
.bb-compact .bb-launcher { min-width: 88px; padding: 4px 6px 6px; }
.bb-compact .bb-launcher .bb-mascot { width: 80px; }
.bb-compact .bb-launcher-name { font-size: 14px; line-height: 26px; padding: 0 12px; }
/* Keep focus scrolling inside the content panes, never on the window shell. */
.bb-panel { width: 456px; height: min(660px, calc(100dvh - 40px)); border-color: #dae4ee; box-shadow: 0 20px 64px #243e5a20, 0 3px 12px #243e5a0b; isolation: isolate; overflow: clip; }
.bb-panel.bb-expanded { width: min(800px, calc(100vw - 40px)); height: min(780px, calc(100dvh - 40px)); }
.bb-header { gap: 10px; min-height: 64px; padding: 5px 16px 5px 22px; background: #fff; border-bottom: 0; }
.bb-avatar { width: 48px; height: 54px; margin: 0; }
.bb-avatar .bb-mascot { width: 48px; }
.bb-heading { flex-direction: column; justify-content: center; align-items: flex-start; gap: 1px; line-height: 1.5; }
.bb-heading strong { font-size: 18px; font-weight: 600; }
.bb-mode-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #536c82; background: transparent; padding: 0; }
.bb-mode-note::before { content: ''; width: 5px; height: 5px; background: #4e9bce; border-radius: 50%; }
.bb-mode-note[data-state=error] { color: #865c35; background: transparent; }
.bb-mode-note[data-state=error]::before { background: #b18148; }
.bb-window-tools { display: flex; gap: 0; flex: none; }
.bb-tool { border-radius: 11px; color: #4b6277; padding: 10px 12px; font-size: 14px; line-height: 24px; min-height: 44px; cursor: pointer; }
.bb-tool:hover { background: #edf4fb; color: #075fae; }
.bb-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: 0; }
.bb-icon-button .bb-icon { opacity: .6; }
.bb-icon-button:hover .bb-icon { opacity: .9; }
.bb-options { top: 64px; z-index: 5; width: 218px; max-height: calc(100% - 80px); overflow: auto; border-color: #e0e7ef; border-radius: 16px; }
.bb-options .bb-tool { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px; }
.bb-options .bb-tool[aria-pressed=true] { color: #1264ab; background: transparent; }
.bb-options .bb-new { color: var(--bb-blue); border-bottom: 1px solid #edf1f6; border-radius: 10px 10px 0 0; margin-bottom: 3px; }
.bb-menu-note { padding: 9px 12px 4px; margin: 0; font-size: 12px; color: #5c6e80; }
.bb-scope-bar { display: block; padding: 0 20px 12px; border-bottom-color: #edf1f5; }
.bb-scope-trigger { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 10px; background: #f3f7fb; color: #3a5670; font-size: 13px; text-align: left; cursor: pointer; }
.bb-scope-trigger:hover, .bb-scope-trigger[aria-expanded=true] { background: #e9f2fc; }
.bb-scope-kicker { flex: none; color: #586e82; }
.bb-scope-label { font-weight: 550; }
.bb-scope-trigger .bb-icon { width: 15px; height: 15px; opacity: .55; }
.bb-scope-trigger[aria-expanded=true] .bb-icon { transform: rotate(180deg); }
.bb-scope-editor { position: absolute; top: 128px; left: 16px; right: 16px; z-index: 4; max-height: calc(100% - 144px); overflow: auto; padding: 16px; border: 1px solid #dbe6f0; border-radius: 16px; background: #fff; box-shadow: 0 12px 36px #23496e22; }
.bb-scope-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -4px 8px 0; }
.bb-scope-head > strong { font-size: 16px; }
.bb-scope-editor label, .bb-settings label { font-size: 14px; font-weight: 550; margin-bottom: 6px; }
.bb-date-row { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
.bb-date-row > div { min-width: 0; }
.bb-panel input:not([type=checkbox]), .bb-panel select { padding: 9px 10px; min-height: 44px; border-color: #cfdae5; border-radius: 10px; color: var(--bb-ink); line-height: 24px; }
.bb-grade-picks { gap: 6px; margin: 8px 0 0; }
.bb-grade-picks button { min-height: 44px; padding: 8px 11px; background: #f5f8fb; border: 1px solid transparent; border-radius: 10px; font-size: 13px; color: #4d647a; cursor: pointer; }
.bb-grade-picks button[aria-pressed=true] { background: #e5f1ff; color: #075fae; border-color: #bdd7ee; }
.bb-scope-field { margin: 0 0 18px; }
.bb-scope-field-heading { display: flex; align-items: baseline; gap: 8px; color: #354e65; font-size: 14px; font-weight: 550; }
.bb-scope-field-heading small { color: #607589; font-size: 12px; font-weight: 400; }
.bb-scope-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid #e9eef4; }
.bb-scope-actions .bb-send { width: auto; padding-inline: 16px; }
.bb-scope-editor .form-error:empty { display: none; }
/* Contain positioned accessibility feedback in the conversation's scroll area. */
.bb-scroll { position: relative; scrollbar-color: #cfdae5 transparent; scrollbar-gutter: stable; overflow-x: hidden; }
@supports not (scrollbar-gutter: stable) {
  .bb-scroll { overflow-y: scroll; }
}
.bb-conversation { display: flex; flex-direction: column; min-height: 100%; }
.bb-welcome { width: 100%; max-width: 560px; margin: auto; padding: 24px 26px; background: #fff; }
.bb-welcome-intro { gap: 16px; margin-bottom: 28px; }
.bb-welcome .bb-mascot { width: 96px; }
.bb-say-hello { cursor: pointer; }
.bb-welcome h2 { font-size: 20px; font-weight: 600; letter-spacing: -.2px; line-height: 1.5; margin-bottom: 6px; color: #22384d; }
.bb-welcome p { font-size: 14px; color: #5b7084; line-height: 1.75; }
.bb-welcome-intro p { text-wrap: balance; }
.bb-welcome .bb-prompt-heading { font-size: 13px; color: #64778a; margin: 0 0 10px; }
.bb-prompts { gap: 8px; }
.bb-prompt { gap: 14px; min-height: 68px; border: 1px solid #e4ecf4; border-radius: 13px; background: #f8fbff; color: #29455f; padding: 12px 14px; font-size: 14px; line-height: 22px; cursor: pointer; }
.bb-prompt:hover { border-color: #c1d8ee; background: #eef6ff; }
.bb-prompt-copy { display: grid; gap: 3px; min-width: 0; }
.bb-prompt strong { font-weight: 500; }
.bb-prompt small { color: #60758a; font-size: 12px; line-height: 20px; }
.bb-messages { gap: 24px; width: 100%; max-width: none; margin: 0; padding: 22px 20px 18px; }
.bb-message { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; align-items: start; }
.bb-message > :not(.bb-message-avatar) { grid-column: 2; min-width: 0; }
.bb-message-avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; grid-column: 1; grid-row: 1 / span 2; border-radius: 12px; overflow: hidden; flex: none; user-select: none; }
.bb-message-avatar-assistant { background: #f1f7fd; border: 1px solid #e2ecf5; }
.bb-message-avatar-assistant img { width: 100%; height: 100%; object-fit: contain; padding: 1px; }
.bb-message-avatar-user { color: #0969c2; background: #e8f2ff; border: 1px solid #d7e8fa; font-size: 13px; font-weight: 650; border-radius: 50%; }
.bb-message-content { font-size: 15px; line-height: 1.8; color: var(--bb-ink); }
.bb-message-body { justify-self: start; max-width: 100%; padding: 10px 14px; border-radius: 5px 16px 16px 16px; background: #f3f7fc; }
.bb-message-body:has(.bb-operation, .bb-results) { width: 100%; }
.bb-message-body > .bb-message-content:empty { display: none; }
.bb-message-body .bb-answer-extra > summary { min-height: 44px; padding-block: 9px; }
.bb-message-body .bb-answer-extra { margin-bottom: 0; }
.bb-answer-lead { font-weight: 500; color: #20364d; }
.bb-answer-body { margin-top: 8px; }
.bb-message-user { grid-template-columns: minmax(0, 1fr) 36px; padding: 0; border-radius: 0; background: transparent; }
.bb-message-user > .bb-message-avatar { grid-column: 2; grid-row: 1; }
.bb-message-user > .bb-message-content { grid-column: 1; grid-row: 1; color: #204f79; background: #eaf3ff; padding: 10px 15px; border-radius: 16px 16px 5px 16px; }
.bb-answer-mode { font-size: 12px; border: 0; border-radius: 6px; padding: 1px 6px; color: #536f87; background: #f0f5fa; }
.bb-presence { align-items: center; gap: 9px; min-height: 27px; width: auto; max-width: none; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; color: #3c5871; font-size: 15px; line-height: 1.8; }
.bb-message-body:has(> .bb-message-content:not(:empty), > .bb-operation, > .bb-results) .bb-presence:not([hidden]) { margin-top: 10px; }
.bb-thinking-mark { display: flex; align-items: center; gap: 3px; flex: none; }
.bb-thinking-mark i { width: 4px; height: 4px; border-radius: 50%; background: #579bd1; animation: bb-thinking 1.4s ease-in-out infinite; }
.bb-thinking-mark i:nth-child(2) { animation-delay: .16s; }
.bb-thinking-mark i:nth-child(3) { animation-delay: .32s; }
@keyframes bb-thinking { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .bb-thinking-mark i { animation: none; } }
.bb-nudge p { font-size: 14px; color: #294b68; }
.bb-nudge .bb-tool { min-height: 44px; }
.bb-source { min-height: 44px; padding: 9px 12px; border-color: #dce7f1; border-radius: 10px; color: #1665aa; font-size: 13px; cursor: pointer; }
.bb-answer-time, .bb-result-range, .bb-result-note, .bb-metric-change, .bb-result-tag { color: #5c7185; font-size: 12px; }
.bb-evidence-toggle { display: flex; align-items: center; gap: 7px; width: fit-content; max-width: 100%; min-height: 44px; padding: 7px 9px; margin-left: -9px; border-radius: 9px; list-style: none; color: #216aa7; font-size: 13px; line-height: 24px; }
.bb-evidence-toggle::-webkit-details-marker { display: none; }
.bb-evidence-toggle .bb-icon { width: 15px; height: 15px; opacity: .6; transition: transform .15s; }
.bb-evidence-toggle strong { font-weight: 550; }
.bb-evidence-toggle > span { color: #5e7488; font-size: 12px; margin: 0 0 0 3px; }
.bb-evidence-toggle:hover { background: #f0f6fc; }
.bb-results[open] > .bb-evidence-toggle .bb-icon { transform: rotate(180deg); }
.bb-answer-extra > summary { color: #216aa7; font-size: 13px; }
.bb-result { padding: 14px; border-color: #e0e9f3; background: #f8fbff; border-radius: 13px; }
.bb-result-head { flex-wrap: wrap; gap: 4px 10px; }
.bb-result-head > strong { font-size: 14px; }
.bb-result-metrics { grid-template-columns: repeat(auto-fit, minmax(95px, 1fr)); gap: 12px; }
.bb-result-metrics strong { font-size: 18px; }
.bb-result-metrics span, .bb-class-line strong { color: #526f88; font-size: 12px; }
.bb-class-line, .bb-finding strong, .bb-finding > span:first-child > span, .bb-result-details p, .bb-result-details summary { font-size: 13px; }
.bb-result-class, .bb-result-details summary, .bb-result-footer .bb-source { min-height: 44px; }
.bb-result-footer { flex-wrap: wrap; }
.bb-followups { gap: 8px; width: 100%; max-width: none; padding: 0 20px 18px 66px; margin: 0; }
.bb-followup { border-color: #e0e9f2; background: #f8fbfe; color: #316a9d; font-size: 13px; padding: 9px 12px; border-radius: 12px; min-height: 44px; cursor: pointer; }
.bb-followup:hover { background: #edf5fd; border-color: #bfd7ed; }
.bb-live-status { max-width: none; margin: 0 20px 16px 66px; font-size: 13px; }
.bb-incomplete { font-size: 13px; }
.bb-error { font-size: 14px; }
.bb-message-body .bb-error { margin: 0; padding: 0; border: 0; background: transparent; color: #8b3733; }
.bb-message-body .bb-error .bb-source { display: block; min-height: 44px; margin: 4px 0 -4px; }
.bb-message-body > .bb-message-content:not(:empty) ~ .bb-error { margin-top: 8px; }
.bb-message-body .bb-incomplete { display: block; margin-top: 8px; }
.bb-compose { padding: 8px 20px 6px; border-top-color: #edf1f5; }
.bb-input-box { display: flex; align-items: flex-end; gap: 6px; max-width: none; margin: 0; border-color: #dce5ef; border-radius: 14px; padding: 2px; background: #f7f9fc; }
.bb-input-box:focus-within { border-color: #78afe0; box-shadow: 0 0 0 3px #eaf3fc; background: #fff; }
.bb-input-box textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 120px; padding: 9px 10px; font-size: 16px; color: var(--bb-ink); line-height: 26px; overflow-y: auto; }
.bb-input-box textarea::placeholder { color: #6e8092; }
.bb-send { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none; border-radius: 11px; background: #086cc9; font-size: 14px; line-height: 24px; min-height: 44px; padding: 10px 14px; cursor: pointer; }
.bb-send:disabled { background: #e4ecf5; color: #5c7590; opacity: 1; }
.bb-compose-footer { max-width: none; margin: 4px 0 0; min-height: 20px; font-size: 12px; color: #627689; }
.bb-compose-footer small, .bb-privacy { color: #627689; font-size: 12px; }
.bb-compose-footer:has(#bbInputCount:not([hidden])) .bb-key-hint { display: none; }
.bb-settings p { font-size: 14px; color: #5b7185; line-height: 1.75; }
.bb-options { width: 180px; }
.bb-options .bb-new { margin-bottom: 0; }
.bb-options #bbSettingsOpen { border-top: 0; margin-top: 0; }
.bb-options .bb-icon { width: 17px; height: 17px; opacity: .65; }
.bb-scroll:has(> .bb-settings:not([hidden])) { display: flex; overflow: hidden; scrollbar-gutter: auto; }
.bb-settings { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; padding: 0; }
.bb-settings-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cfdae5 transparent; scrollbar-gutter: stable; padding: 0 22px 12px; }
.bb-settings .bb-settings-back { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin: 0 0 0 -8px; padding: 7px 8px; font-size: 13px; }
.bb-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bb-settings-heading h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 28px; color: var(--bb-ink); }
.bb-connection-badge { flex: none; border-radius: 20px; padding: 3px 9px; font-size: 12px; font-weight: 550; color: #24618f; background: #edf5fc; }
.bb-connection-badge[data-state=success] { color: #28734e; background: #edf7f1; }
.bb-connection-badge[data-state=error] { color: #a34236; background: #fff1ee; }
.bb-settings .bb-settings-intro { margin: 5px 0 20px; font-size: 13px; color: #607589; }
.bb-connection-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.bb-settings .bb-connection-choice { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 68px; padding: 12px; margin: 0; border: 1px solid #dee8f1; border-radius: 13px; background: #fff; cursor: pointer; }
.bb-settings .bb-connection-choice:has(input:checked) { border-color: #74b5e9; background: #f0f7ff; }
.bb-settings .bb-connection-choice:has(input:focus-visible) { outline: 3px solid #4796dc; outline-offset: 2px; }
.bb-settings .bb-connection-choice input { appearance: auto; width: 16px; min-width: 16px; height: 16px; min-height: 16px; padding: 0; margin: 0; accent-color: #0874d1; box-shadow: none; }
.bb-connection-choice strong { display: block; color: #244562; font-size: 14px; line-height: 22px; font-weight: 600; }
.bb-connection-choice small { display: block; color: #61778b; font-size: 12px; line-height: 20px; font-weight: 400; }
.bb-school-summary { padding: 18px; margin: 0 0 18px; border: 1px solid #e2ebf4; border-radius: 14px; background: #f7faff; }
.bb-school-summary strong { font-size: 14px; font-weight: 550; color: #2a4f6f; }
.bb-school-summary p { margin: 6px 0 0; font-size: 13px; }
.bb-settings .bb-school-manage { padding: 8px 0; min-height: 44px; color: #296891; font-size: 13px; }
.bb-field-translation { color: #718294; font-size: 12px; font-weight: 400; margin-left: 4px; }
.bb-settings .bb-provider-heading { align-items: center; margin-bottom: 7px; }
.bb-settings .bb-provider-heading label { margin: 0; }
.bb-settings .bb-provider-heading .bb-settings-link { min-height: 22px; }
.bb-settings #bbProvider { display: block; width: 100%; max-width: 100%; min-height: 44px; margin: 0; padding: 10px 36px 10px 12px; border: 1px solid #cfdae6; border-radius: 11px; background-color: #fff; color: #294d6d; font: inherit; font-size: 14px; line-height: 22px; }
.bb-settings #bbProvider:focus-visible { outline: 3px solid #e2f0ff; outline-offset: 0; border-color: #70a9e4; }
@media (max-width: 380px) {
  .bb-settings .bb-connection-choice { gap: 7px; padding: 12px 7px; }
  .bb-connection-choice strong { white-space: nowrap; }
}
.bb-settings .bb-enable-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 72px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid #e5edf4; border-radius: 14px; background: #f6f9fc; cursor: pointer; }
.bb-enable-row > span { min-width: 0; }
.bb-enable-row strong { display: block; font-size: 14px; line-height: 22px; font-weight: 550; }
.bb-enable-row small { display: block; margin-top: 2px; color: #61768a; font-size: 12px; line-height: 1.6; font-weight: 400; }
.bb-settings input.bb-toggle { appearance: none; position: relative; flex: none; width: 44px; min-width: 44px; height: 26px; min-height: 26px; padding: 0; margin: 0; border: 1px solid #a8b7c6; border-radius: 20px; background: #b8c5d1; cursor: pointer; transition: background .16s, border-color .16s; }
.bb-settings input.bb-toggle::after { content: ''; display: block; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #193b5d26; transition: transform .16s; }
.bb-settings input.bb-toggle:checked { border-color: #0874d1; background: #0874d1; }
.bb-settings input.bb-toggle:checked::after { transform: translateX(18px); }
.bb-settings input.bb-toggle:focus-visible { outline: 3px solid #4796dc; outline-offset: 4px; box-shadow: none; }
.bb-settings input:disabled, .bb-settings select:disabled { opacity: .6; cursor: default; }
.bb-settings .bb-field { margin: 0 0 14px; }
.bb-settings .bb-field > label, .bb-field-heading label { margin: 0 0 7px; font-size: 14px; color: #354e65; line-height: 22px; }
.bb-field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bb-field-heading label > span { margin-left: 4px; color: #718294; font-size: 12px; font-weight: 400; }
.bb-key-state { flex: none; color: #607b90; font-size: 12px; }
.bb-settings .bb-field p { font-size: 12px; line-height: 1.65; margin: 7px 0 0; color: #607589; text-wrap: pretty; }
.bb-settings-link { display: inline-flex; flex: none; align-items: center; gap: 3px; min-height: 44px; color: #146ab3; text-decoration: none; font-size: 12px; }
.bb-settings-link:hover { text-decoration: underline; }
.bb-settings input[aria-invalid=true] { border-color: #b76053; }
.bb-settings-privacy { border-top: 1px solid #e9eef4; margin-top: 2px; }
.bb-settings-privacy > summary { display: list-item; min-height: 44px; padding: 12px 0; font-size: 12px; color: #607589; cursor: pointer; }
.bb-settings-privacy p { margin: 0 0 8px; font-size: 12px; line-height: 1.75; }
.bb-settings-footer { flex: none; padding: 8px 22px; border-top: 1px solid #e9eef4; background: #fff; }
.bb-settings-result { min-width: 0; }
.bb-settings-result #bbSettingsStatus { margin: 0 0 10px; max-height: 100px; overflow: auto; overflow-wrap: anywhere; font-size: 12px; line-height: 1.7; color: #5a7288; }
.bb-settings-result #bbSettingsStatus[data-state=success] { color: #28734e; }
.bb-settings-result #bbSettingsStatus[data-state=error] { color: #a34236; }
.bb-settings-result #bbSettingsStatus:empty { display: none; }
.bb-settings-result .bb-tool { margin: -3px 0 8px; padding: 8px 0; color: #1269b6; }
.bb-settings-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
.bb-settings-actions .bb-send { width: auto; min-height: 44px; padding: 9px 12px; }
.bb-settings-actions .bb-tool { min-height: 44px; border: 1px solid #dce5ef; background: #fff; color: #376080; padding: 9px 12px; font-size: 14px; }
.bb-settings-actions .bb-tool:hover { background: #f2f7fc; }
@media (max-width: 600px) {
  .banban-root { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .bb-launcher .bb-mascot { width: 88px; }
  .bb-compact .bb-launcher .bb-mascot { width: 68px; }
  .bb-panel, .bb-panel.bb-expanded { --bb-mobile-gap: 20px; --bb-mobile-bottom: max(16px, env(safe-area-inset-bottom)); left: 0; right: 0; margin-inline: auto; bottom: var(--bb-mobile-bottom); width: min(384px, calc(100% - 2 * var(--bb-mobile-gap))); height: min(640px, calc(100dvh - var(--bb-mobile-bottom) - max(16px, env(safe-area-inset-top)))); }
  .bb-header { min-height: 64px; padding: 5px 10px 5px 14px; gap: 7px; }
  .bb-avatar, .bb-avatar .bb-mascot { width: 42px; }
  .bb-heading strong { font-size: 18px; }
  .bb-scope-bar { padding-left: 16px; padding-right: 16px; }
  .bb-welcome { padding: 20px; }
  .bb-welcome .bb-mascot { width: 84px; }
  .bb-welcome-intro { gap: 14px; margin-bottom: 18px; }
  .bb-welcome h2 { font-size: 20px; }
  .bb-expand { display: none; }
  .bb-messages { padding-left: 14px; padding-right: 14px; }
  .bb-message { grid-template-columns: 32px minmax(0, 1fr); column-gap: 8px; }
  .bb-message-avatar { width: 32px; height: 32px; border-radius: 10px; }
  .bb-message-avatar-user { border-radius: 50%; font-size: 12px; }
  .bb-message-user { grid-template-columns: minmax(0, 1fr) 32px; max-width: 96%; }
  .bb-message-user > .bb-message-content { padding: 9px 12px; }
  .bb-followups { padding-left: 54px; padding-right: 14px; }
  .bb-live-status { margin-left: 54px; margin-right: 14px; }
  .bb-message-body { padding: 9px 12px; }
  .bb-panel input:not([type=checkbox]), .bb-panel select { font-size: 16px; }
  .bb-settings #bbProvider { font-size: 16px; line-height: 24px; padding-block: 9px; }
  .bb-compose { padding-left: 12px; padding-right: 12px; }
  .bb-send { min-width: 56px; padding: 10px 12px; }
  .bb-key-hint { display: none; }
  .bb-result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-scope-editor { left: 10px; right: 10px; }
  .bb-settings-body { padding-left: 18px; padding-right: 18px; }
  .bb-settings-footer { padding-left: 18px; padding-right: 18px; }
  .bb-settings-actions .bb-send { width: auto; padding: 9px 12px; }
  .bb-settings-link { min-height: 44px; }
  .bb-grade-picks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bb-grade-picks button { padding-inline: 4px; }
}
@media (max-height: 650px) {
  .bb-welcome { padding-top: 14px; padding-bottom: 14px; }
  .bb-welcome .bb-mascot { width: 68px; }
  .bb-welcome-intro { margin-bottom: 12px; gap: 12px; }
  .bb-welcome h2 { font-size: 20px; }
  .bb-prompt { min-height: 58px; padding-block: 8px; }
  .bb-panel:has(#bbScopeEditor:not([hidden])) .bb-compose { display: block; }
}
@media (max-width: 380px) {
  .bb-panel, .bb-panel.bb-expanded { --bb-mobile-gap: 12px; }
  .bb-date-row { grid-template-columns: minmax(0, 1fr); }
  .bb-grade-picks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* A lightly raised history drawer keeps the current conversation visible. */
.bb-workspace { position: relative; display: flex; flex: 1; min-height: 0; min-width: 0; }
.bb-chat-pane { position: relative; display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.bb-chat-pane .bb-scope-editor { top: 56px; max-height: calc(100% - 72px); }
.bb-history-toggle { font-size: 13px; font-weight: 550; }
.bb-history-toggle[aria-expanded=true] { color: #076bc6; background: #eaf3fc; }
.bb-history-scrim { position: absolute; inset: 0; z-index: 6; display: block; border: 0; padding: 0; background: #24384e08; cursor: pointer; }
.bb-history { --bb-history-muted: #526b83; position: absolute; inset: 8px auto 8px 8px; z-index: 7; display: flex; flex-direction: column; width: min(296px, calc(100% - 76px)); min-width: 0; min-height: 0; padding: 18px 16px 14px; border: 1px solid #e1e9f2; border-radius: 14px; background: #f8fbff; box-shadow: 0 4px 16px #243e5a0d; }
.bb-history-overview { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.bb-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.bb-history-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--bb-ink); line-height: 24px; }
.bb-history-head p { margin: 4px 0 0; font-size: 12px; color: var(--bb-history-muted); line-height: 20px; }
.bb-history-back { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 8px; font-size: 13px; color: #52718c; }
.bb-history-head .bb-history-back { margin: -7px -8px 0 0; }
.bb-history-new { display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; margin: 0 0 16px; border: 0; background: #eff6fd; color: var(--bb-blue); font-size: 14px; font-weight: 500; }
.bb-history-new:hover { background: #e4f0fc; color: #075fae; }
.bb-history-new:active { background: #dceafb; color: #075fae; }
.bb-history-new .bb-icon { width: 17px; height: 17px; filter: none; opacity: .65; }
.bb-history-records { flex: 1; min-height: 44px; margin: 0 -6px; padding: 0 6px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ccd9e6 transparent; }
.bb-history-list { display: flex; flex-direction: column; gap: 6px; }
.bb-thread-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; padding: 2px 4px; border-radius: 11px; }
.bb-thread-row:hover { background: #f5f8fb; }
.bb-thread-row:has([aria-current=true]) { background: #edf4fc; box-shadow: none; }
.bb-history-day { margin: 0 12px 6px; font-size: 12px; font-weight: 500; color: var(--bb-history-muted); line-height: 20px; }
.bb-history-day:not(:first-child) { margin-top: 12px; }
.bb-thread { display: flex; flex-direction: column; align-items: stretch; flex: none; gap: 6px; width: 100%; min-width: 0; min-height: 72px; padding: 10px 8px; border: 0; border-radius: 9px; background: transparent; color: #304f6b; text-align: left; cursor: pointer; }
.bb-thread-heading { display: block; min-width: 0; min-height: 22px; }
.bb-thread strong { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14px; font-weight: 400; line-height: 22px; }
.bb-thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.bb-thread-current { flex: none; padding: 0 5px; border-radius: 5px; background: #deebfa; font-size: 12px; font-weight: 500; color: #2c679c; line-height: 20px; white-space: nowrap; }
.bb-thread small { font-size: 12px; color: var(--bb-history-muted); line-height: 20px; white-space: nowrap; }
.bb-thread:hover { background: transparent; }
.bb-thread[aria-current=true] { background: transparent; color: #244d72; }
.bb-thread-delete { width: 44px; min-height: 44px; color: #526b83; }
.bb-thread:focus-visible, .bb-thread-delete:focus-visible { outline-offset: -3px; }
.bb-thread-delete .bb-icon { width: 16px; height: 16px; }
.bb-thread-delete:hover { background: #fff0ee; color: #ae493e; }
.bb-history-empty { padding: 24px 10px; font-size: 14px; line-height: 1.9; color: var(--bb-history-muted); }
.bb-history-more { width: 100%; margin-top: 8px; font-size: 13px; color: #0868b6; }
.bb-history-status { margin: 8px; font-size: 13px; line-height: 1.7; color: var(--bb-history-muted); }
.bb-history-status:empty { display: none; }
.bb-history-footer { flex: none; margin-top: 12px; padding-top: 8px; border-top: 1px solid #e9eef4; }
.bb-history-footer > div { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 32px; }
.bb-history-footer strong { color: #536d85; font-size: 12px; font-weight: 500; line-height: 20px; }
.bb-history-footer #bbHistoryAdmin { display: inline-flex; align-items: center; gap: 5px; margin: 0 -8px 0 0; padding: 8px; font-size: 12px; color: #366b9d; }
.bb-history-footer .bb-icon { width: 14px; height: 14px; opacity: .6; }
.bb-history-footer > small { display: flex; flex-wrap: wrap; gap: 0 6px; margin-top: 1px; font-size: 12px; color: var(--bb-history-muted); line-height: 20px; }
.bb-history-footer > small > span { white-space: nowrap; }
.bb-history-policy-editor, .bb-history-delete-editor { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.bb-history-policy-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ccd9e6 transparent; padding: 0 2px 20px; }
.bb-history-policy-body > .bb-history-back { margin: 0 0 10px; outline-offset: -3px; }
.bb-history-policy-body h2 { margin: 0; font-size: 18px; line-height: 28px; color: var(--bb-ink); font-weight: 600; }
.bb-history-policy-intro { margin: 6px 0 28px; color: var(--bb-history-muted); font-size: 13px; line-height: 22px; }
.bb-history-policy-body label { display: block; margin-bottom: 9px; color: #3f5b74; font-size: 14px; font-weight: 550; }
.bb-history-policy-body select { min-height: 48px; background-color: #fff; }
.bb-history-policy-plan { color: var(--bb-history-muted); font-size: 12px; line-height: 21px; margin: 10px 0 0; }
.bb-history-policy-help { border-top: 1px solid #e9eef4; padding-top: 18px; margin-top: 24px; }
.bb-history-policy-help p { margin: 0 0 8px; color: var(--bb-history-muted); font-size: 13px; line-height: 22px; }
.bb-history-policy-actions { flex: none; padding-top: 12px; border-top: 1px solid #e9eef4; }
.bb-history-policy-actions p { margin: 0 0 10px; color: #a34236; font-size: 13px; line-height: 21px; }
.bb-history-policy-actions p:empty { display: none; }
.bb-history-policy-actions .bb-send { width: 100%; }
.bb-history-delete-title { margin: 22px 0 12px; padding: 14px; border: 1px solid #e2eaf4; border-radius: 12px; background: #fff; color: #304f6b; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.bb-history-delete-note { margin: 0; color: var(--bb-history-muted); font-size: 13px; line-height: 1.8; }
.bb-history-delete-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bb-history-delete-actions .bb-tool { border: 1px solid #dae4ee; background: #fff; }
.bb-history-delete-actions .bb-send { background: #b84b40; }
.bb-history-delete-actions .bb-send:hover { background: #a23e35; }
.bb-older { align-self: center; flex: none; margin: 8px 12px 0; color: #146bb3; font-size: 13px; }
@media (min-width: 901px) {
  .bb-expanded.bb-history-open .bb-history { position: static; width: 264px; flex: none; margin: 8px 0 8px 8px; padding: 18px 14px 14px; }
  .bb-expanded.bb-history-open .bb-history-scrim { display: none; }
  .bb-expanded .bb-history-head .bb-history-back { gap: 2px; padding: 8px 5px; }
}
@media (max-width: 380px) {
  .bb-history { padding: 16px 12px 12px; }
  .bb-history-footer > div { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .bb-history-policy-body { padding-bottom: 8px; }
  .bb-history-policy-body > .bb-history-back { margin-bottom: 2px; }
  .bb-history-policy-intro { margin-bottom: 20px; }
  .bb-history-policy-help { margin-top: 16px; padding-top: 12px; }
  .bb-history-policy-help p { margin-bottom: 6px; }
}
@media (max-height: 540px) {
  .bb-history-head { margin-bottom: 8px; }
  .bb-history-new { margin-bottom: 12px; }
  .bb-history-footer { margin-top: 8px; padding-top: 8px; }
  .bb-history-policy-intro { margin-bottom: 16px; }
  .bb-history-policy-help { margin-top: 16px; padding-top: 12px; }
}
