/* Assistant — chat view: conversation sidebar, messages, markdown, composer, Helper bubble. */
.chat-view { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.convs { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.convs-h { padding: 10px; }
.new-chat { width: 100%; }
.conv-list { flex: 1; overflow: auto; padding: 0 6px 10px; }
.conv { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 4px; padding: 7px 8px; border-radius: var(--radius-s); cursor: pointer; color: var(--dim); }
.conv:hover { background: var(--hover); color: var(--fg); }
.conv.on { background: var(--active); color: var(--fg); }
:root[data-theme="classic"] .conv.on { color: #fff; }
.conv-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-d { font-size: var(--fs-s); }
.conv-more { grid-row: 1 / 3; grid-column: 2; align-self: center; width: 26px; height: 26px; border: 0; border-radius: 4px; background: none; color: var(--faint); display: grid; place-items: center; opacity: 0; }
.conv:hover .conv-more, .conv.on .conv-more, .conv-more:focus-visible { opacity: 1; }
.conv-empty { padding: 10px; }

.chat-main, .build-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.chat-bar { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.conv-title { flex: 1; min-width: 0; border: 0; background: none; text-align: left; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 6px; border-radius: var(--radius-s); }
.conv-title:hover { background: var(--hover); }
.btn.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--fg); }

.msgs { flex: 1; min-height: 0; overflow: auto; padding: 18px 16px 10px; }
.msgs.drop { outline: 2px dashed var(--accent-line); outline-offset: -8px; }
.msg-list { max-width: 820px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.msg.user { justify-self: end; max-width: min(640px, 88%); display: grid; gap: 6px; justify-items: end; }
.msg.user .bubble { padding: 9px 13px; border-radius: 16px 16px 4px 16px; background: var(--panel-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; box-shadow: var(--bevel); }
.msg.bot { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.avatar .ic { width: 16px; height: 16px; }
.col { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--faint); font-size: var(--fs-s); }
.mini { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--faint); padding: 2px 4px; border-radius: 4px; font-size: var(--fs-s); }
.mini:hover { color: var(--fg); background: var(--hover); }
.mini .ic { width: 13px; height: 13px; }
.calls { display: flex; flex-wrap: wrap; gap: 6px; }
.call { display: inline-flex; align-items: center; gap: 5px; font: 11px var(--mono); padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--fg); }
.call .ic { width: 13px; height: 13px; }
.msg.tool { margin-left: 40px; font-size: var(--fs-s); color: var(--dim); border-left: 2px solid var(--accent-line); padding: 2px 10px; }
.msg.tool.bad { border-left-color: var(--danger); }
.msg.tool summary { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.msg.tool .ic { width: 14px; height: 14px; }
.msg.tool pre { margin: 6px 0 0; white-space: pre-wrap; font: 11px var(--mono); max-height: 200px; overflow: auto; }

.md { word-break: break-word; line-height: 1.55; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; }
.md h3, .md h4, .md h5, .md h6 { margin: 14px 0 6px; }
.md blockquote { padding-left: 10px; border-left: 3px solid var(--line-2); color: var(--dim); }
.md code { font: 12px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--panel-2); }
.md.err { color: var(--danger); }
.md-code { margin: 0 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--input); }
.md-code-h { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; background: var(--panel-2); border-bottom: 1px solid var(--line); font: 11px var(--mono); color: var(--faint); }
.md-code-h span { flex: 1; }
.md-code-h button { border: 1px solid var(--line-2); background: var(--panel); color: var(--fg); border-radius: 4px; padding: 2px 8px; font-size: 11px; }
.md-code-h button:hover { background: var(--hover); }
.md-code pre { margin: 0; padding: 10px 12px; overflow: auto; max-height: 460px; }
.md-code pre code { background: none; padding: 0; font-size: 12px; white-space: pre; }
.caret { display: inline-block; width: 8px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--accent-line); animation: blink 1s steps(2) infinite; }

.composer { padding: 8px 14px 10px; border-top: 1px solid var(--line); background: var(--panel); }
.comp-row { max-width: 820px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px; padding: 5px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--input); box-shadow: var(--bevel-in); }
:root[data-theme="classic"] .comp-row { border-radius: 0; }
.comp-row:focus-within { border-color: var(--accent-line); }
.input { flex: 1; min-width: 0; resize: none; border: 0; background: none; outline: none; padding: 7px 4px; max-height: 220px; line-height: 1.45; }
.send { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); flex: none; }
.send.stop { background: var(--danger); color: #fff; }
.composer.no-model .send:not(.stop) { opacity: .5; }
.comp-foot { max-width: 820px; margin: 5px auto 0; display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-s); }
.atts { display: flex; flex-wrap: wrap; gap: 6px; }
.atts.pending { max-width: 820px; margin: 0 auto; }
.atts.pending:not(:empty) { margin-bottom: 6px; }
.att { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: var(--fs-s); }
.att .ic { width: 13px; height: 13px; }
.att small { color: var(--faint); }
.att .x { border: 0; background: none; color: var(--faint); padding: 0 2px; font-size: 14px; }

.hello { padding-top: 6vh; }
.hello-helpbot { width: 96px; height: 96px; }
.hello p { margin: 0; max-width: 460px; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.helpbot.powered canvas { filter: drop-shadow(0 0 6px rgba(162, 255, 246, .6)); }
.helpbot-bubble { position: fixed; top: calc(var(--top-h) + 8px); right: 70px; z-index: 600; width: min(340px, calc(100vw - 32px)); padding: 14px 14px 10px; display: grid; gap: 10px; background: var(--panel); border: 2px solid var(--accent-line); border-radius: 18px 4px 18px 18px; box-shadow: var(--shadow); }
.helpbot-bubble .say { font-weight: 600; min-height: 1.4em; white-space: pre-wrap; }
.helpbot-bubble form { display: flex; } .helpbot-bubble .inp { flex: 1; }
.helpbot-bubble .x { position: absolute; top: 2px; right: 6px; border: 0; background: none; color: var(--faint); font-size: 18px; }
