/* Workbench adaptation of the assistant-ui Thread and Thread List Sidebar. */
:root { --chat-width: 44rem; --focus-color: var(--aui-ring); }
::selection { background: var(--ink); color: var(--canvas); }
:focus-visible { outline-color: var(--focus-color); outline-width: 2px; outline-offset: 2px; }
body { accent-color: var(--primary); }
.shell { padding: 8px 8px 8px 0; }
.workspace { border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 1px 2px #0000000a; }
.top { min-height: 49px; padding: 6px 15px; background: var(--canvas); }
.top-left { gap: 8px; }
.top h1 { font-size: .83rem; font-weight: 575; }
.top .context-name { color: var(--muted); border: 0; padding: 0; }
.top .context-name::before { content: '/'; color: var(--muted); margin-inline-end: 8px; }
.top [data-menu], .side-head .side-toggle, .side-head .side-close { min-width: 31px; min-height: 31px; padding: 5px; }
.top [data-menu] { margin: 0; }
.workspace:has(> .project-assistant:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) clamp(340px, 35%, 520px);
}
.workspace:has(> .project-assistant:not([hidden])) > .top { grid-area: 1 / 1; }
.workspace:has(> .project-assistant:not([hidden])) > .lab-host { grid-area: 2 / 1; }
.project-assistant {
  grid-area: 1 / 2 / 3;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border-inline-start: 1px solid var(--rule);
  background: var(--canvas);
  --chat-gutter: 14px;
}
.project-assistant-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 10px 5px 15px; border-bottom: 1px solid var(--rule); }
.project-assistant-head h2 { margin: 0; font-size: .85rem; }
.project-assistant-head .icon-button { min-width: 32px; min-height: 32px; }
#project-assistant-actions { display: flex; align-items: center; gap: 3px; }
#project-assistant-chat { min-width: 0; min-height: 0; }
.project-assistant .aui-composer .toolbar .button[data-panel=projects] { max-width: 110px; }
@media (max-width: 840px) {
  .workspace:has(> .project-assistant:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, .85fr) minmax(0, 1fr);
  }
  .project-assistant { grid-area: 3 / 1; border-inline-start: 0; border-top: 1px solid var(--rule); }
}
.side-head .side-close { margin-inline-start: auto; }
.side { padding: 4px 9px; }
.side-head { min-height: 48px; border-bottom: 1px solid var(--rule); padding: 4px 6px 9px; margin-bottom: 7px; }
.side-head .brand { padding: 2px; gap: 9px; font-size: .86rem; font-weight: 630; }
.side-head img { width: 29px; height: 29px; border-radius: 8px; }
.side-actions { display: grid; gap: 5px; margin-bottom: 10px; }
.side-scroll { margin-top: 0; }
.side-nav h2, .side .session-head { color: var(--muted); padding: 6px 8px 4px; font-size: .72rem; font-weight: 550; }
.side-nav { gap: 1px; }
.side .nav-item, .side-foot .account-trigger, .session-item { min-height: 33px; border-radius: 6px; }
.side .nav-item[aria-current=page], .side .session-item[aria-current=page] { background: var(--aui-sidebar-accent); color: var(--ink); }
.side .side-new { min-height: 34px; margin: 0; background: var(--canvas); border: 1px solid var(--rule); box-shadow: 0 1px 1px #00000008; }
.side .side-new:hover, .side .side-new[aria-current=page] { background: var(--aui-sidebar-accent); }
.side .side-search { color: var(--muted); }
.side-search kbd { flex: none; margin-inline-start: auto; color: var(--muted); background: var(--canvas); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 4px; font: .66rem ui-monospace, monospace; }
.side .side-foot { padding-top: 7px; border-top: 1px solid var(--rule); }
.side .account-avatar { width: 26px; height: 26px; border: 1px solid var(--rule); background: var(--soft); }
.account-popover, .account-submenu { border-radius: 9px; background: var(--raised); box-shadow: 0 6px 16px #0002; }
.session-list { margin-top: 12px; }
.session-list + .session-list { margin-top: 10px; }
@media(min-width:681px) {
  .side-collapsed .side-nav h2, .side-collapsed .side-search kbd { display: none; }
}

.button, .icon-button, .search, .candidate-form input, .candidate-form select, .account-form input, .account-form select { border-radius: 7px; }
.button { min-height: 34px; gap: 6px; font-weight: 540; border-color: var(--rule); background: var(--canvas); }
.button:hover:not(:disabled) { background: var(--soft); }
.button.primary:hover:not(:disabled) { background: var(--primary-hover); }
.button.plain { background: transparent; }
.button[aria-pressed=true] { background: var(--soft); }
dialog { border-color: var(--rule); border-radius: 12px; background: var(--raised); }
dialog::backdrop { background: #0007; }
.notice { color: var(--ink); background: var(--raised); border: 1px solid var(--rule); box-shadow: 0 3px 14px #0002; border-radius: 9px; }

.page, .account-wrap, .skills-library { width: min(100%,1072px); padding: 36px clamp(18px,3vw,42px) 50px; margin-inline: auto; }
.page.workbench-index { padding-top: clamp(16px, 2vw, 24px); }
.page-head { padding-bottom: 18px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.page-head h2 { font-size: 1.67rem; font-weight: 640; letter-spacing: -.035em; }
.page-head p { margin-top: 4px; line-height: 1.55; }
.collection-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.collection-header h2 { font-size: .91rem; }
.collection-header span { color: var(--muted); font-size: .76rem; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(225px,100%),1fr)); gap: 10px; }
.collection-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; align-content: start; min-width: 0; padding: 15px; gap: 5px; border: 1px solid var(--rule); border-radius: var(--bolab-radius); color: var(--ink); background: var(--canvas); text-decoration: none; }
.collection-card:hover { background: var(--surface); border-color: var(--strong-rule); }
.collection-icon { display: grid; width: 33px; height: 33px; place-items: center; background: var(--soft); border-radius: 7px; margin-bottom: 5px; }
.collection-icon .ico { width: 16px; height: 16px; }
.collection-arrow { width: 16px; color: var(--muted); margin: 2px 0 0 auto; }
.collection-card :is(h2, h3, p) { grid-column: 1/-1; overflow-wrap: anywhere; }
.collection-card :is(h2, h3) { font-size: .92rem; font-weight: 610; }
.collection-card p { color: var(--muted); font-size: .79rem; line-height: 1.6; }
.collection-card .tag { margin: 4px 0 0; width: fit-content; background: var(--soft); padding: 2px 6px; border-radius: 5px; }
.collection-grid > .empty-table { grid-column: 1/-1; padding: 24px 12px; border: 1px dashed var(--rule); border-radius: var(--aui-radius); }
.candidate-page .panel { margin-top: 18px; }
.candidate-back { margin-bottom: 12px; }
.candidate-page .table-scroll:has(.candidate-table) { border: 1px solid var(--rule); border-radius: var(--aui-radius); }
.candidate-table th { font-size: .77rem; font-weight: 560; color: var(--muted); background: var(--surface); }
.candidate-table tbody tr:hover { background: var(--surface); }
.candidate-table tr:last-child td { border-bottom: 0; }
.candidate-form { max-width: 560px; padding: 18px; border: 1px solid var(--rule); border-radius: var(--aui-radius); }
.candidate-form input, .candidate-form select { background: var(--canvas); border-color: var(--rule); }
.panel { border: 1px solid var(--rule); border-radius: var(--aui-radius); overflow: clip; }
.panel-head { min-height: 40px; background: var(--surface); }
.panel :focus-visible { outline-offset: -3px; }
.list-row { min-height: 57px; border-bottom-color: var(--rule); }
.list-row:hover { background: var(--surface); }
.list-row p { margin-top: 2px; }
.item-icon { color: var(--muted); }
.file-table th { background: var(--surface); font-weight: 550; }
.knowledge-tools .search { background: var(--canvas); }
.knowledge-tools .file-tools, .collection-header .file-tools, .skill-toolbar .skill-upload { margin-inline-start: auto; }
.knowledge-page .file-icon, .knowledge-page .file-icon.dir { color: var(--ink); background: var(--soft); border-radius: 5px; }
.skill-scopes { display: flex; width: fit-content; gap: 2px; padding: 3px; margin-bottom: 13px; border: 0; border-radius: 8px; background: var(--soft); }
.skill-scopes button { min-height: 27px; padding: 3px 9px; border: 1px solid transparent; border-radius: 5px; font-size: .8rem; font-weight: 540; }
.skill-scopes button[aria-pressed=true] { border-color: var(--rule); background: var(--canvas); box-shadow: 0 1px 2px #0001; }
.skill-toolbar .skill-search { max-width: 320px; min-height: 34px; background: var(--canvas); }
.skill-toolbar .skill-upload { min-height: 34px; }
.skill-categories button { min-height: 27px; font-size: .75rem; }
.skill-categories button[aria-pressed=true] { background: var(--soft); color: var(--ink); border-color: var(--rule); }
.skill-card { border-color: var(--rule); border-radius: var(--aui-radius); background: var(--canvas); }
.skill-card-detail { min-height: 102px; }
.skill-switch[aria-checked=true] > span { border-color: var(--primary); background: var(--primary); }
.skill-switch[aria-checked=true] > span::after { background: var(--primary-ink); }
.account-models .model-grid { grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 15px; }
.account-card { padding: 17px; border: 1px solid var(--rule); border-radius: var(--aui-radius); background: var(--canvas); }
.account-card h2 { margin-bottom: 10px; }
.account-form input, .account-form select { background: var(--canvas); border-color: var(--rule); }
.settings-nav { padding: 5px; background: var(--surface); }
.settings-nav .nav-item { border-radius: 6px; }

#inspector { position: fixed; inset: 0; margin: auto; width: min(570px,calc(100% - 28px)); max-height: min(710px, calc(100dvh - 44px)); border: 1px solid var(--rule); border-radius: 12px; color: var(--ink); background: var(--raised); box-shadow: 0 8px 30px #0003; overflow: hidden; }
#inspector:not([open]) { display: none; }
.inspector-head { min-height: 54px; padding: 8px 16px; }
.inspector-body { padding: 15px 16px; }
.inspector-body button.list-row,
.inspector-body a.list-row { padding-inline: 7px; border-radius: 5px; }
.inspector-body .list-row:hover { background: var(--soft); }
.inspector-body .skill-picker-search { max-width: none; width: 100%; margin-bottom: 8px; }
#dialog:has(.quick-search) { width: min(530px,calc(100% - 28px)); }
.quick-search header { display: flex; align-items: center; gap: 5px; padding: 7px; border-bottom: 1px solid var(--rule); }
.quick-search .search { border: 0; flex: 1; max-width: none; }
.quick-search .search:focus-within { border: 0; }
.quick-results { padding: 5px; max-height: min(340px,58dvh); overflow: auto; }
.quick-results .nav-item { border-radius: 6px; }
.quick-results small { color: var(--muted); font-size: .72rem; margin-inline-start: auto; }

.aui-chat { display: block; }
.aui-chat .transcript { height: 100%; scrollbar-color: var(--rule) transparent; }
.aui-thread-column { width: min(100%, calc(var(--chat-width) + 2 * var(--chat-gutter))); min-height: 100%; display: flex; flex-direction: column; margin-inline: auto; padding: 18px var(--chat-gutter) 0; }
.aui-start .aui-thread-column { justify-content: center; padding-block: 22px 8dvh; }
.aui-welcome { padding: 0 5px; margin-bottom: 18px; }
.aui-welcome h2 { font-size: 1.7rem; font-weight: 610; line-height: 1.35; letter-spacing: -.035em; }
.aui-icon { display: inline-flex; flex: none; align-items: center; }
.aui-messages { display: flex; flex-direction: column; gap: 25px; padding-block: 10px 40px; }
.aui-bottom { position: sticky; bottom: 0; margin-top: auto; background: var(--canvas); border-radius: 15px 15px 0 0; min-width: 0; }
.aui-start .aui-bottom { position: relative; margin: 0; }
.aui-chat .composer-wrap { width: 100%; padding: 0 0 max(16px, env(safe-area-inset-bottom)); }
.aui-start .composer-wrap { padding-bottom: 8px; }
.aui-chat .composer-shell { background: transparent; }
.aui-chat .aui-composer { background: color-mix(in srgb,var(--surface) 75%,var(--canvas)); border: 1px solid var(--rule); border-radius: 16px; padding: 7px 8px 6px; }
.aui-chat .aui-composer:focus-within { outline: none; border-color: var(--strong-rule); box-shadow: 0 0 0 2px color-mix(in srgb,var(--aui-ring) 18%,transparent); }
.aui-composer textarea { min-height: 49px; max-height: 192px; padding: 8px 7px; font-size: 1rem; }
.aui-composer .composer-foot, .aui-send-controls { display: flex; align-items: center; gap: 4px; min-width: 0; }
.aui-composer .composer-foot { min-height: 32px; padding: 0; }
.aui-composer .composer-foot .toolbar { flex-wrap: wrap; gap: 2px; }
.aui-composer .composer-foot .toolbar .button, .aui-composer .composer-foot .toolbar .icon-button { min-height: 30px; border-radius: 999px; }
.aui-send-controls { flex-shrink: 0; }
.aui-send-controls .composer-model { max-width: 222px; gap: 5px; color: var(--ink); background: var(--soft); border-radius: 999px; }
.composer-model-trigger-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.composer-model-trigger-strength { flex: none; white-space: nowrap; }
#composer-model-picker { position: fixed; inset: auto; margin: 0; width: min(224px, calc(100% - 16px)); padding: 0; overflow: visible; border: 0; background: transparent; color: var(--ink); }
.composer-model-menu-main, .composer-model-submenu { max-height: var(--model-menu-height, 360px); padding: 5px; overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--rule) transparent; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); box-shadow: 0 6px 20px #0002; }
.composer-model-submenu { position: absolute; inset-inline-start: calc(100% - 1px); top: 0; min-width: 128px; width: max-content; max-width: 248px; max-height: min(460px, calc(100dvh - 16px)); }
#composer-model-picker[data-section="models"] .composer-model-submenu { width: 248px; }
.composer-model-option, .composer-model-mode { width: 100%; min-width: 0; min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: start; padding: 6px 10px; font: inherit; font-size: .87rem; border: 0; border-radius: 9px; background: none; color: var(--ink); }
.composer-model-option { cursor: pointer; }
.composer-model-option:hover:not(:disabled, [aria-disabled="true"]), .composer-model-option[aria-expanded="true"] { background: var(--soft); }
.composer-model-option:is(:disabled, [aria-disabled="true"]) { opacity: .55; cursor: default; }
.composer-model-option:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.composer-model-option > span:first-child { overflow-wrap: anywhere; }
.composer-model-option svg, .composer-model-option small { flex: none; }
.composer-model-option small { color: var(--muted); font-size: .72rem; }
.composer-model-category > span:first-child { white-space: nowrap; }
.composer-model-value { min-width: 0; margin-inline-start: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.composer-model-mode { padding-inline-end: 32px; }
.composer-model-menu-actions { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--rule); }
.composer-model-menu-actions .composer-model-option { min-height: 32px; font-size: .79rem; }
.composer-model-back { display: none; }
@media (max-width: 599px) {
  #composer-model-picker[data-section] .composer-model-menu-main { display: none; }
  #composer-model-picker .composer-model-submenu, #composer-model-picker[data-section="models"] .composer-model-submenu { position: static; width: 100%; max-height: var(--model-menu-height, 360px); }
  .composer-model-back { display: flex; justify-content: flex-start; margin-bottom: 3px; border-bottom: 1px solid var(--rule); }
  .composer-model-option, .composer-model-mode { min-height: 40px; }
}
.composer-model-form { display: grid; gap: 10px; padding: 7px 8px 5px; }
.composer-model-form h2 { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.composer-model-form label { display: grid; gap: 4px; font-size: .78rem; }
.composer-model-form :is(input, select) { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid var(--strong-rule); border-radius: 7px; padding: 7px; color: var(--ink); background: var(--canvas); font: inherit; }
.composer-model-form .toolbar { justify-content: space-between; }
.composer-model-menu-status { margin: 4px 10px; font-size: .75rem; color: var(--muted); }
.composer-model-menu-status[role=alert] { color: var(--ink); }
.aui-composer .toolbar .button > span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.aui-composer .toolbar .button { max-width: 152px; }
.aui-composer .send { width: 30px; height: 30px; border-radius: 50%; }
.aui-composer .send:disabled { color: var(--muted); background: var(--soft); border-color: var(--soft); }
.aui-scroll { position: absolute; z-index: 2; bottom: calc(100% + 6px); left: 50%; translate: -50% 0; border-radius: 50%; padding: 0; width: 30px; min-height: 30px; }
.aui-scroll .ico { rotate: 180deg; }
.aui-scroll:disabled { display: none; }
.aui-start-suggestions { min-height: 100px; }
.aui-suggestions { display: grid; padding-top: 1px; }
.aui-suggestion { display: flex; align-items: baseline; gap: 7px; width: 100%; padding: 7px 8px; background: transparent; border: 0; border-radius: 6px; color: var(--ink); text-align: start; font-size: .82rem; }
.aui-suggestion:hover { background: var(--soft); }
.aui-suggestion-symbol { width: 11px; flex: none; color: var(--muted); }
.aui-suggestion-description { color: var(--muted); margin-inline-start: 4px; font-size: .79rem; }
.aui-chat .slash-menu { border: 1px solid var(--rule); border-radius: 9px; }
.aui-start .slash-menu { top: calc(100% + 4px); bottom: auto; }
.aui-user { display: flex; justify-content: end; }
.aui-user-bubble { max-width: min(87%,65ch); padding: 9px 13px; border-radius: 16px; background: var(--soft); color: var(--ink); }
.aui-user-bubble:has(> .aui-structure-figure) { min-width: 0; }
.aui-user-bubble > .aui-structure-figure {
  --structure-preview-height: 132px;
  inline-size: min(100%, 17rem);
}
.aui-user-bubble > .aui-structure-figure[data-reaction] {
  --structure-preview-height: 144px;
  inline-size: min(100%, 23rem);
}
.aui-user-bubble > .aui-structure-figure :is(img, .aui-structure-status) {
  block-size: var(--structure-preview-height);
}
.aui-user-bubble > .aui-structure-figure .aui-structure-status {
  display: grid;
  place-items: center;
}
.aui-structure-figure { display: grid; gap: 5px; min-width: 0; margin: 0; }
.aui-user-bubble > .aui-structure-figure:not(:first-child),
.aui-user-bubble > .aui-structure-figure + p { margin-block-start: 8px; }
.aui-structure-figure img { display: block; width: 100%; height: auto; max-height: 210px; object-fit: contain; border-radius: 8px; background: #fff; }
.aui-structure-caption { display: grid; gap: 2px; min-width: 0; font-size: .76rem; }
.aui-structure-caption code { overflow-wrap: anywhere; white-space: pre-wrap; }
.aui-structure-status { color: var(--muted); font-size: .76rem; }
.composer-structure-previews { display: flex; gap: 8px; margin: 2px 6px 4px; overflow-x: auto; }
.composer-structure-previews .aui-structure-figure { flex: 0 0 min(100%,16rem); align-content: center; }
.composer-structure-previews .aui-structure-figure img { height: 96px; }
.aui-user p, .aui-answer p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; line-height: 1.7; }
.aui-answer { --answer-avatar-size: 38px; display: grid; grid-template-columns: var(--answer-avatar-size) minmax(0,1fr); gap: 9px; }
.aui-answer-avatar { display: block; width: var(--answer-avatar-size); height: var(--answer-avatar-size); }
.aui-answer-avatar svg { display: block; width: 100%; height: 100%; }
.aui-answer .aui-turn-progress:only-child { min-height: var(--answer-avatar-size); }
.aui-answer-body { min-width: 0; }
.aui-answer-body ul { padding-inline-start: 1.25rem; font-size: .9rem; line-height: 1.64; }
.aui-turn-progress, .aui-workflow, .aui-tool-summary {
  display: flex; align-items: center; gap: 8px; min-height: 25px;
  color: var(--muted); font-size: .82rem; overflow-wrap: anywhere;
}
.aui-workflow { margin-bottom: 5px; }
.aui-workflow .ico, .aui-tool-group .ico { width: 15px; height: 15px; }
.aui-tool-group { width: min(100%, 29rem); margin: 0 0 8px; }
.aui-tool-summary {
  border-radius: 6px; padding: 4px 6px; margin-inline-start: -6px;
  cursor: pointer; list-style: none;
}
.aui-tool-summary::-webkit-details-marker { display: none; }
.aui-tool-summary:hover { background: var(--soft); color: var(--ink); }
.aui-tool-summary > .aui-icon:last-child { margin-inline-start: auto; }
.aui-tool-group[open] .aui-tool-summary > .aui-icon:last-child { rotate: 90deg; }
.aui-answer-body .aui-tool-list { list-style: none; padding: 0; margin: 2px 0 0; font-size: .8rem; }
.aui-tool-list li {
  display: grid; grid-template-columns: 15px minmax(0,1fr) auto; align-items: center;
  gap: 7px; padding: 6px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere;
}
.aui-tool-list li > .aui-icon, .aui-tool-state { color: var(--muted); }
.aui-tool-list li[data-tool-state=failed] .aui-tool-state { color: var(--bolab-danger); }
.aui-turn-failure { padding-inline-start: 10px; border-inline-start: 2px solid var(--rule); }
.aui-turn-failure .button { margin-top: 7px; }
.aui-loading-dots { display: inline-flex; flex: none; gap: 3px; align-items: center; }
.aui-loading-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.aui-answer .research-reply { display: grid; gap: .78em; line-height: 1.7; }
.reply-block { min-width: 0; }
.research-reply .reply-block > :first-child { margin-top: 0; }
.research-reply .reply-block > :last-child { margin-bottom: 0; }
.aui-answer .research-reply p { white-space: normal; }
.research-reply :is(h1,h2,h3,h4,h5,h6) { font-weight: 640; line-height: 1.35; letter-spacing: -.012em; }
.research-reply h1 { font-size: 1.32rem; }
.research-reply h2 { font-size: 1.16rem; }
.research-reply :is(h3,h4,h5,h6) { font-size: 1rem; }
.research-reply .reply-block + .reply-block > :is(h1,h2,h3,h4,h5,h6) { margin-top: .45em; }
.research-reply li + li { margin-top: .2em; }
.research-reply blockquote { margin-inline: 0; padding-inline-start: 12px; border-inline-start: 2px solid var(--strong-rule); color: var(--muted); }
.research-reply hr { height: 1px; background: var(--rule); border: 0; }
.research-reply code { font: .875em ui-monospace, SFMono-Regular, Consolas, monospace; }
.research-reply :not(pre) > code { padding: .11em .32em; border-radius: 4px; background: var(--soft); }
.research-reply pre { padding: 12px 14px; border: 1px solid var(--rule); line-height: 1.5; overflow-wrap: normal; white-space: pre; }
.research-reply img { max-width: 100%; height: auto; }
.reply-table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; }
.reply-table-scroll table { width: 100%; border-collapse: collapse; font-size: .875rem; line-height: 1.55; }
.reply-table-scroll :is(th,td) { padding: 8px 12px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--rule); }
.reply-table-scroll th { color: var(--ink); background: var(--surface); font-weight: 620; }
.reply-table-scroll .reply-align-left { text-align: left; }
.reply-table-scroll .reply-align-center { text-align: center; }
.reply-table-scroll .reply-align-right { text-align: right; }
.reply-table-scroll tr:last-child td { border-bottom: 0; }
.research-reply math { font-size: 1.08em; }
.research-reply .katex:has(> math[display=block]) {
  display: block; margin: .35em 0; overflow-x: auto; overflow-y: hidden; padding-block: 3px;
}
.research-reply[data-streaming] .reply-block:last-child > :is(p,h1,h2,h3,h4,h5,h6):last-child::after {
  content: ''; display: inline-block; width: 2px; height: 1em; margin-inline-start: 3px;
  vertical-align: -.1em; background: var(--muted);
}
@media (prefers-reduced-motion: no-preference) {
  .aui-message[data-live=true] { animation: aui-turn-in .2s ease-out both; }
  .aui-loading-dots i { animation: aui-progress 1.15s ease-in-out infinite; }
  .aui-loading-dots i:nth-child(2) { animation-delay: .13s; }
  .aui-loading-dots i:nth-child(3) { animation-delay: .26s; }
}
@keyframes aui-turn-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes aui-progress { 0%, 64%, 100% { opacity: .45; } 34% { opacity: 1; } }
.aui-message-actions { margin-top: 5px; }
.aui-message-actions .icon-button { min-width: 27px; min-height: 27px; padding: 4px; color: var(--muted); }
.aui-user .turn-files { margin: 6px 0 0; }
.composer-image, .turn-image {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--surface);
}
.composer-image { position: relative; width: 96px; height: 74px; }
.composer-image img, .turn-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.composer-image .icon-button {
  position: absolute;
  inset: 3px 3px auto auto;
  min-width: 26px;
  min-height: 26px;
  padding: 4px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
}
.composer-image .icon-button:hover { background: var(--soft); }
.composer-image .ico { width: 14px; height: 14px; }
.composer-image-hint { margin-top: 7px; color: var(--muted); font-size: .78rem; }
.turn-image { display: block; width: min(192px,100%); height: 118px; }
.turn-image:hover { border-color: var(--muted); }

.cdxml-attachment {
  display: grid;
  width: min(290px,100%);
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--surface);
}
.cdxml-preview { display: block; background: #fff; }
.cdxml-preview img { display: block; width: 100%; max-height: 170px; object-fit: contain; }
.cdxml-attachment figcaption {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 2px 8px;
  font-size: .78rem;
}
.cdxml-attachment figcaption > :first-child {
  overflow: hidden;
  flex: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cdxml-preview-status { padding: 7px 8px; color: var(--muted); font-size: .78rem; }

@media(max-width:780px) {
  .account-models .model-grid { grid-template-columns: minmax(0,1fr); }
}
@media(max-width:680px) {
  .aui-answer { --answer-avatar-size: 34px; }
  .shell { padding: 0; }
  .workspace { border: 0; border-radius: 0; }
  .side { padding: 8px; }
  .top { padding-inline: 10px; }
  .page, .account-wrap, .skills-library { padding: 22px 15px 33px; }
  .page-head { padding-bottom: 13px; margin-bottom: 15px; }
  .page-head h2 { font-size: 1.4rem; }
  .collection-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .collection-card { padding: 10px; }
  .collection-card .collection-icon { width:29px; height:29px; }
  .aui-welcome h2 { font-size: 1.46rem; }
  .aui-start .aui-thread-column { padding-bottom: 6dvh; }
  .aui-start .slash-menu { top: auto; bottom: calc(100% + 4px); max-height: 29dvh; }
  .aui-composer .composer-foot .toolbar { flex-wrap: nowrap; flex: 1; }
  .aui-composer .composer-foot .toolbar .button { max-width: 72px; }
  .aui-composer .composer-foot .toolbar .button[data-panel=projects] { width: 27px; min-width: 27px; padding-inline: 4px; }
  .aui-composer .toolbar .button[data-panel=projects] > span:last-child { position: absolute; clip-path: inset(50%); }
  .aui-send-controls .composer-model { max-width: 126px; min-width: 0; }
}
.account-avatar { display: grid; place-items: center; font-size: .71rem; font-weight: 600; color: var(--muted); }
.account-popover .account-avatar { background: var(--soft); border: 1px solid var(--rule); }

.reactio-plan-card {
  container-type: inline-size;
  margin: .8rem 0;
  max-width: 100%;
  padding: .85rem 1rem;
  border: 1px solid var(--rule);
  border-radius: .8rem;
}
.reactio-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem;
}
.reactio-plan-head h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.reactio-plan-sheet {
  margin: .75rem 0;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: .35rem;
  background: white;
}
.reactio-plan-sheet img { display: block; width: 100%; height: auto; }
@container (max-width: 575px) {
  .reactio-plan-sheet img { min-width: 620px; }
}
.reactio-plan-sheet:focus-visible { outline: 2px solid var(--aui-ring); outline-offset: 2px; }

.research-reply > .aui-structure-figure { width:min(100%,360px); margin-block:8px; }
.research-reply > .aui-structure-figure[data-reaction] { width:100%; }
.chat-artifact-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px; }
[title="双击编辑"]:focus-visible { outline:2px solid var(--aui-ring); outline-offset:2px; }
.chat-artifact-touch-edit.button { display:none; min-height:32px; justify-self:start; }
@media (pointer:coarse) {
  .chat-artifact-touch-edit.button { display:inline-flex; margin-block-start:4px; }
}
.chat-artifact-dialog { width:min(1020px,calc(100vw - 24px)); max-width:none; max-height:calc(100dvh - 24px); padding:0; }
.chat-artifact-dialog::backdrop { background:rgb(0 0 0 / 42%); }
.chat-artifact-dialog form { display:flex; flex-direction:column; max-height:calc(100dvh - 26px); }
.chat-artifact-dialog header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:10px 14px; border-bottom:1px solid var(--rule); }
.chat-artifact-dialog h2 { margin:0; font-size:1rem; }
.chat-artifact-message { margin:8px 14px; color:var(--muted); }
.chat-artifact-drawing { width:min(1360px,calc(100vw - 20px)); }
.chat-artifact-drawing iframe { display:block; width:100%; height:min(78dvh,940px); min-height:0; border:0; background:white; }
.chat-artifact-grid { min-height:0; overflow:auto; padding:10px 12px; }
.chat-artifact-grid table { min-width:100%; border-collapse:collapse; }
.chat-artifact-grid td { min-width:104px; padding:0; border:1px solid var(--rule); }
.chat-artifact-grid tr:first-child td { background:var(--soft); font-weight:600; }
.chat-artifact-grid textarea { display:block; box-sizing:border-box; width:100%; min-width:104px; resize:vertical; padding:6px 8px; font:inherit; color:var(--ink); background:transparent; border:0; }
.chat-artifact-grid textarea:focus-visible { outline:2px solid var(--aui-ring); outline-offset:-2px; }
