:root {
  color-scheme: light;
  --page: #f4f6fa;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --line: #e4e9f1;
  --line-strong: #c9d3df;
  --text: #1f2937;
  --muted: #7b8794;
  --faint: #aeb7c2;
  --accent: #4f7bf0;
  --accent-strong: #3b63d4;
  --accent-soft: #eef3ff;
  --accent-ring: rgb(79 123 240 / 18%);
  --mint: #d9f2fb;
  --green: #16a34a;
  --shadow: 0 18px 45px rgb(30 41 59 / 6%);
  /* rounded-corner scale */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;
  /* soft elevation */
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 4%);
  --shadow-card: 0 8px 20px rgb(30 41 59 / 6%);
  --chat-gutter: 30px;
  --chat-topbar-height: 64px;
  --brand-width: 250px;
  --task-width: 300px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  margin: 0;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--page);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  min-width: 0;
  grid-template-columns: var(--brand-width) var(--task-width) minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  background: var(--panel);
  transition: grid-template-columns 220ms ease;
}

.app-shell[hidden] {
  display: none;
}

.app-shell.view-knowledge {
  grid-template-columns: var(--brand-width) minmax(0, 1fr);
}

.app-shell.view-catalog {
  grid-template-columns: var(--brand-width) minmax(0, 1fr);
}

.app-shell.view-knowledge .task-panel,
.app-shell.view-knowledge .chat-panel {
  display: none;
}

.app-shell.view-catalog .task-panel,
.app-shell.view-catalog .chat-panel,
.app-shell.view-catalog .knowledge-panel {
  display: none;
}

.knowledge-panel[hidden] {
  display: none;
}

.catalog-panel[hidden] {
  display: none;
}

.catalog-panel {
  display: grid;
  min-width: 0;
  height: 100vh;
  grid-template-columns: 320px minmax(0, 1fr);
  background: #ffffff;
}

.catalog-browser {
  min-width: 0;
  height: 100%;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  overflow: hidden;
}

.catalog-browser-header {
  display: flex;
  height: 74px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.catalog-browser-header h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0;
}

.catalog-refresh {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
}

.catalog-refresh:hover {
  background: #eef2f7;
  color: #334155;
}

.catalog-refresh svg,
.catalog-tree-search svg,
.catalog-detail-search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.catalog-tree-search {
  display: flex;
  height: 38px;
  margin: 14px 12px 8px;
  padding: 0 10px;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8e0ea;
  border-radius: 6px;
  background: #ffffff;
  color: #64748b;
}

.catalog-tree-search:focus-within,
.catalog-detail-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.catalog-tree-search input,
.catalog-detail-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.catalog-tree {
  height: calc(100vh - 134px);
  padding: 4px 8px 22px;
  overflow: auto;
}

.catalog-tree-root {
  margin: 10px 7px 7px;
  color: #273449;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.catalog-tree-root::before {
  margin-right: 7px;
  color: #64748b;
  content: "⌂";
}

.catalog-tree-node {
  display: grid;
  width: 100%;
  min-height: 36px;
  padding: 5px 8px;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  align-items: center;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  font-size: 12px;
  text-align: left;
}

.catalog-tree-node.depth-1 {
  padding-left: 24px;
}

.catalog-tree-node.depth-2 {
  padding-left: 45px;
}

.catalog-tree-node:hover {
  background: #f0f3f8;
  color: #1f2937;
}

.catalog-tree-node.active {
  background: #e9eef6;
  color: #172033;
  font-weight: 750;
}

.catalog-tree-node-icon {
  display: inline-grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: #526276;
  font-size: 10px;
  font-weight: 800;
}

.catalog-tree-node > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-tree-node small {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
  text-align: right;
}

.catalog-state {
  margin: 30px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.catalog-state.is-error,
.catalog-detail-empty.is-error {
  color: #dc2626;
}

.catalog-detail {
  min-width: 0;
  height: 100%;
  overflow: auto;
  background: #ffffff;
}

.catalog-detail-header {
  display: flex;
  min-height: 88px;
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.catalog-detail-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.catalog-detail-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  background: #f2f6fb;
  color: #3f5f8f;
  font-size: 11px;
  font-weight: 800;
}

.catalog-detail-header h2,
.catalog-detail-header p {
  margin: 0;
}

.catalog-detail-header h2 {
  overflow: hidden;
  color: #172033;
  font-size: 18px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-detail-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.catalog-detail-search {
  display: flex;
  width: min(260px, 32vw);
  height: 38px;
  padding: 0 11px;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8e0ea;
  border-radius: 19px;
  background: #f8fafc;
  color: #64748b;
}

.catalog-tabs {
  display: flex;
  height: 48px;
  padding: 0 20px;
  align-items: end;
  gap: 26px;
  border-bottom: 1px solid var(--line);
}

.catalog-tabs button {
  height: 48px;
  padding: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 13px;
}

.catalog-tabs button.active {
  border-bottom-color: #29b7c7;
  color: #1f2937;
  font-weight: 700;
}

.catalog-detail-body {
  min-width: 0;
  padding: 24px 20px 42px;
}

.catalog-content-table {
  min-width: 720px;
  border: 1px solid #e1e7ef;
  border-radius: 4px;
  overflow: hidden;
}

.catalog-content-row {
  display: grid;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  grid-template-columns: repeat(var(--catalog-columns), minmax(120px, 1fr));
  align-items: center;
  border-bottom: 1px solid #e6ebf1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  text-align: left;
}

.catalog-content-row:last-child {
  border-bottom: 0;
}

.catalog-content-row.header {
  min-height: 46px;
  background: #f6f8fb;
  color: #475569;
  font-weight: 650;
}

.catalog-content-row:not(.header):hover {
  background: #fafcff;
}

.catalog-content-row:not(.header) > span:first-child {
  color: #2563eb;
  font-weight: 650;
}

.catalog-content-row span {
  min-width: 0;
  padding-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-sql-row {
  display: grid;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  grid-template-columns: minmax(240px, 1.2fr) minmax(90px, .45fr) minmax(150px, .75fr) minmax(170px, .8fr) minmax(130px, .55fr);
  align-items: center;
  border-bottom: 1px solid #e6ebf1;
  color: #334155;
  font-size: 12px;
}

.catalog-sql-row:last-child {
  border-bottom: 0;
}

.catalog-sql-row.header {
  min-height: 46px;
  background: #f6f8fb;
  color: #475569;
  font-weight: 650;
}

.catalog-sql-row > span,
.catalog-sql-name {
  min-width: 0;
  padding-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-sql-name {
  width: fit-content;
  max-width: 100%;
  padding-left: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 650;
  text-align: left;
}

.catalog-sql-name:hover {
  text-decoration: underline;
}

.catalog-sql-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.catalog-sql-actions button {
  padding: 5px 0;
  background: transparent;
  color: #526276;
  font-size: 12px;
}

.catalog-sql-actions button:hover {
  color: #1f2937;
}

.catalog-sql-actions button:last-child:hover {
  color: #dc2626;
}

.catalog-summary {
  display: grid;
  margin: 0 0 20px;
  padding: 14px 16px;
  grid-template-columns: 130px minmax(0, 1fr);
  row-gap: 10px;
  border-top: 1px solid #e1e7ef;
  border-bottom: 1px solid #e1e7ef;
  font-size: 12px;
}

.catalog-summary dt {
  color: #718096;
}

.catalog-summary dd {
  min-width: 0;
  margin: 0;
  color: #273449;
  overflow-wrap: anywhere;
}

.catalog-detail-empty {
  display: flex;
  min-height: 340px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  color: #94a3b8;
  text-align: center;
}

.catalog-detail-empty > span {
  font-size: 34px;
}

.catalog-detail-empty p {
  max-width: 440px;
  margin: 12px 0 0;
  font-size: 13px;
}

.catalog-sql-code {
  margin: 0;
  padding: 18px;
  border: 1px solid #dfe6ef;
  border-radius: 5px;
  background: #f8fafc;
  color: #243047;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.7;
  overflow: auto;
  white-space: pre;
}

.catalog-sql-workspace {
  min-width: 0;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.catalog-sql-toolbar {
  display: flex;
  min-height: 48px;
  padding: 6px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e7ed;
  background: #ffffff;
}

.catalog-sql-toolbar-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.catalog-sql-toolbar-actions button {
  display: inline-flex;
  min-height: 34px;
  padding: 0 9px;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  background: transparent;
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

.catalog-sql-toolbar-actions button:hover,
.catalog-sql-toolbar-actions button[aria-expanded="true"],
.catalog-sql-toolbar-actions button.is-active {
  background: #eef3f8;
  color: #1d4ed8;
}

.catalog-sql-toolbar-actions button.is-placeholder {
  color: #7b8798;
}

.catalog-sql-toolbar-actions button.is-primary {
  color: #1e3a5f;
  font-weight: 700;
}

.catalog-sql-toolbar-actions button:disabled {
  cursor: wait;
  opacity: .55;
}

.catalog-sql-toolbar-actions button > span {
  display: inline-grid;
  min-width: 16px;
  place-items: center;
  color: currentColor;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.catalog-sql-save-state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.catalog-sql-save-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.catalog-sql-save-state.is-dirty i,
.catalog-sql-save-state.is-running i {
  background: #f59e0b;
}

.catalog-sql-save-state.is-error {
  color: #b91c1c;
}

.catalog-sql-save-state.is-error i {
  background: #ef4444;
}

.catalog-sql-save-state.is-published i {
  background: #2563eb;
}

.catalog-sql-save-state.is-placeholder i {
  background: #94a3b8;
}

.catalog-sql-parameters {
  padding: 12px 14px;
  border-bottom: 1px solid #dfe5ec;
  background: #f8fafc;
}

.catalog-sql-parameters[hidden] {
  display: none;
}

.catalog-sql-parameters > header,
.catalog-sql-parameters > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-sql-parameters > header > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.catalog-sql-parameters > header strong {
  color: #253044;
  font-size: 12px;
}

.catalog-sql-parameters > header span {
  color: #7b8798;
  font-size: 11px;
}

.catalog-sql-parameters > header button,
.catalog-sql-parameter-row button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  font-size: 18px;
}

.catalog-sql-parameter-rows {
  display: grid;
  max-width: 720px;
  margin-top: 10px;
  gap: 7px;
}

.catalog-sql-parameter-row {
  display: grid;
  grid-template-columns: minmax(140px, .7fr) minmax(200px, 1fr) 28px;
  gap: 8px;
}

.catalog-sql-parameter-row input {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #d6dee8;
  border-radius: 4px;
  outline: 0;
  background: #ffffff;
  color: #273449;
  font-size: 12px;
}

.catalog-sql-parameter-row input:focus {
  border-color: #8ab4ee;
  box-shadow: 0 0 0 2px rgb(59 130 246 / 10%);
}

.catalog-sql-parameters > footer {
  max-width: 720px;
  margin-top: 9px;
}

.catalog-sql-parameters > footer button {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 4px;
  background: transparent;
  color: #526276;
  font-size: 11px;
}

.catalog-sql-parameters > footer button.is-confirm {
  padding: 0 13px;
  background: #2563eb;
  color: #ffffff;
}

.catalog-sql-editor-shell {
  position: relative;
  display: grid;
  height: clamp(320px, 42vh, 520px);
  min-width: 0;
  grid-template-columns: 54px minmax(0, 1fr);
  overflow: hidden;
  background: linear-gradient(to right, #f6f8fb 54px, #ffffff 54px);
}

.catalog-sql-editor-shell::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 53px;
  width: 1px;
  background: #e4e9ef;
  content: "";
  pointer-events: none;
}

.catalog-sql-line-numbers,
.catalog-sql-highlight,
.catalog-sql-editor-surface textarea {
  margin: 0;
  border: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
}

.catalog-sql-line-numbers {
  min-height: max-content;
  padding: 16px 12px 24px 0;
  color: #8a96a8;
  text-align: right;
  user-select: none;
}

.catalog-sql-editor-surface {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.catalog-sql-highlight,
.catalog-sql-editor-surface textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 16px 18px 24px;
}

.catalog-sql-highlight {
  width: max-content;
  min-width: 100%;
  height: max-content;
  min-height: 100%;
  overflow: visible;
  background: transparent;
  color: #172033;
  pointer-events: none;
}

.catalog-sql-highlight code,
.catalog-sql-highlight code > span {
  font: inherit;
}

.catalog-sql-highlight code > span {
  display: block;
  min-height: 1.7em;
}

.catalog-sql-editor-surface textarea {
  z-index: 1;
  resize: none;
  outline: 0;
  overflow: auto;
  background: transparent;
  color: transparent;
  caret-color: #111827;
  -webkit-text-fill-color: transparent;
}

.catalog-sql-editor-surface textarea::selection {
  background: rgb(37 99 235 / 20%);
  color: transparent;
}

.catalog-sql-editor-surface.is-composing .catalog-sql-highlight {
  visibility: hidden;
}

.catalog-sql-editor-surface.is-composing textarea {
  color: #172033;
  -webkit-text-fill-color: #172033;
}

.catalog-sql-editor-surface:focus-within {
  box-shadow: inset 0 0 0 1px rgb(59 130 246 / 24%);
}

.catalog-sql-editor-footer {
  display: flex;
  min-height: 28px;
  padding: 0 12px;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  border-top: 1px solid #e5eaf0;
  background: #f8fafc;
  color: #718096;
  font-size: 10px;
}

.catalog-sql-execution {
  display: grid;
  min-height: 220px;
  grid-template-columns: 190px minmax(0, 1fr);
  border-top: 1px solid #dbe2ea;
  background: #ffffff;
}

.catalog-sql-execution[hidden] {
  display: none;
}

.catalog-sql-run-history {
  border-right: 1px solid #e1e6ed;
  background: #f8fafc;
}

.catalog-sql-run-history > header {
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid #e5eaf0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  line-height: 40px;
}

.catalog-sql-run-history > div {
  max-height: 210px;
  padding: 6px;
  overflow: auto;
}

.catalog-sql-run-history button {
  display: grid;
  width: 100%;
  min-height: 42px;
  padding: 5px 8px;
  grid-template-columns: 8px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  border-radius: 4px;
  background: transparent;
  color: #3c485a;
  text-align: left;
}

.catalog-sql-run-history button:hover,
.catalog-sql-run-history button.active {
  background: #e9eef5;
}

.catalog-sql-run-history button i {
  width: 7px;
  height: 7px;
  grid-row: 1 / span 2;
  border-radius: 50%;
  background: #f59e0b;
}

.catalog-sql-run-history button.is-success i {
  background: #22c55e;
}

.catalog-sql-run-history button.is-failed i {
  background: #ef4444;
}

.catalog-sql-run-history button span {
  font-size: 11px;
}

.catalog-sql-run-history button small {
  color: #8793a4;
  font-size: 10px;
}

.catalog-sql-run-detail {
  min-width: 0;
}

.catalog-sql-run-detail > nav {
  display: flex;
  height: 40px;
  padding: 0 14px;
  align-items: end;
  gap: 20px;
  border-bottom: 1px solid #e5eaf0;
}

.catalog-sql-run-detail > nav button {
  height: 40px;
  padding: 0 2px;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 11px;
}

.catalog-sql-run-detail > nav button.active {
  border-bottom-color: #2563eb;
  color: #1f2937;
  font-weight: 700;
}

.catalog-sql-run-output {
  min-height: 178px;
  padding: 18px;
  overflow: auto;
}

.catalog-sql-run-output > pre {
  margin: 0;
  color: #334155;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre;
}

.catalog-sql-validation-result {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #334155;
}

.catalog-sql-validation-result strong {
  display: block;
  font-size: 13px;
}

.catalog-sql-validation-result p {
  margin: 5px 0 0;
  color: #718096;
  font-size: 11px;
}

.catalog-sql-result-mark {
  width: 22px;
  height: 22px;
  border: 2px solid #22c55e;
  border-radius: 50%;
}

.catalog-sql-result-mark::after {
  display: block;
  width: 5px;
  height: 9px;
  margin: 3px 0 0 7px;
  border: solid #16a34a;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.catalog-sql-validation-result.is-failed .catalog-sql-result-mark {
  border-color: #ef4444;
}

.catalog-sql-validation-result.is-failed .catalog-sql-result-mark::after {
  width: 8px;
  height: 8px;
  margin: 5px 0 0 5px;
  border: 0;
  background: linear-gradient(45deg, transparent 42%, #ef4444 42%, #ef4444 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, #ef4444 42%, #ef4444 58%, transparent 58%);
  transform: none;
}

.catalog-sql-validation-result.is-running {
  display: block;
  padding-top: 30px;
  text-align: center;
}

.catalog-sql-progress {
  display: grid;
  max-width: 700px;
  margin: 0 auto;
  grid-template-columns: 18px auto minmax(24px, 1fr) 18px auto minmax(24px, 1fr) 18px auto minmax(24px, 1fr) 18px auto;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 10px;
}

.catalog-sql-progress i {
  width: 18px;
  height: 18px;
  border: 2px solid #60a5fa;
  border-radius: 50%;
  animation: catalog-sql-pulse 900ms ease-in-out infinite alternate;
}

.catalog-sql-progress b {
  height: 1px;
  background: #cbd5e1;
}

@keyframes catalog-sql-pulse {
  from { opacity: .35; }
  to { opacity: 1; }
}

.catalog-sql-edit-dialog,
.catalog-sql-delete-dialog {
  width: min(680px, calc(100vw - 48px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgb(15 23 42 / 22%);
}

.catalog-sql-delete-dialog {
  width: min(440px, calc(100vw - 48px));
}

.catalog-sql-edit-dialog::backdrop,
.catalog-sql-delete-dialog::backdrop {
  background: rgb(15 23 42 / 34%);
}

.catalog-sql-edit-panel > header,
.catalog-sql-delete-panel > header {
  display: flex;
  padding: 18px 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.catalog-sql-edit-panel h2,
.catalog-sql-delete-panel h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.catalog-sql-edit-close,
.catalog-sql-delete-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 22px;
}

.catalog-sql-edit-content {
  display: flex;
  padding: 20px;
  flex-direction: column;
  gap: 16px;
}

.catalog-sql-edit-content label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 12px;
}

.catalog-sql-edit-name,
.catalog-sql-edit-content-input {
  width: 100%;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  outline: 0;
  color: #253044;
}

.catalog-sql-edit-name {
  height: 40px;
  padding: 0 11px;
}

.catalog-sql-edit-content-input {
  min-height: 270px;
  padding: 11px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.catalog-sql-edit-name:focus,
.catalog-sql-edit-content-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.catalog-sql-edit-error {
  margin: 0;
  color: #dc2626;
  font-size: 12px;
}

.catalog-sql-delete-panel > p {
  margin: 0;
  padding: 24px 20px;
  color: #475569;
  font-size: 14px;
}

.catalog-sql-edit-panel > footer,
.catalog-sql-delete-panel > footer {
  display: flex;
  padding: 14px 20px;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.catalog-sql-edit-panel > footer button,
.catalog-sql-delete-panel > footer button {
  min-width: 72px;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  background: #eef2f7;
  color: #475569;
}

.catalog-sql-edit-confirm {
  background: var(--accent) !important;
  color: #ffffff !important;
}

.catalog-sql-delete-confirm {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.brand-panel,
.task-panel,
.chat-panel {
  min-height: 0;
  height: 100vh;
}

.brand-panel {
  position: relative;
  z-index: 40;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fcfdff 0%, #eef2f9 100%);
  transition: width 220ms ease;
}

.brand-panel.is-collapsed {
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 0;
  transition: padding 220ms ease, opacity 180ms ease, transform 220ms ease;
}

.brand-panel.is-collapsed .brand {
  justify-content: center;
  padding: 20px 0 0;
}

.brand-icon {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid #cbe9f4;
  background: linear-gradient(160deg, #e3f7fe 0%, #c7effc 100%);
  color: #1f2b3d;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 14px rgb(59 130 246 / 8%), inset 0 1px 0 rgb(255 255 255 / 70%);
  transition: transform 220ms ease, opacity 180ms ease;
}

.brand-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand h1 {
  min-width: 0;
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 760;
  letter-spacing: 0;
  white-space: nowrap;
}

.workspace-switcher {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 20;
}

.space-switcher-trigger {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  background: rgb(255 255 255 / 88%);
  color: #263244;
  text-align: left;
  box-shadow: 0 4px 12px rgb(30 41 59 / 6%);
}

.space-switcher-trigger:hover,
.workspace-switcher.is-open .space-switcher-trigger {
  border-color: #bdcadb;
  background: #ffffff;
}

.active-space-icon,
.space-option-icon,
.login-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgb(100 116 139 / 14%);
  border-radius: 8px;
  color: #253044;
  font-size: 12px;
  font-weight: 800;
}

.space-trigger-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.space-trigger-copy strong,
.space-trigger-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-trigger-copy strong {
  font-size: 14px;
  letter-spacing: 0;
}

.space-trigger-copy small {
  color: var(--muted);
  font-size: 11px;
}

.space-trigger-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #748094;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.workspace-switcher.is-open .space-trigger-chevron {
  transform: rotate(180deg);
}

.space-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 286px;
  padding: 10px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgb(15 23 42 / 16%);
}

.space-menu[hidden] {
  display: none;
}

.space-menu-current > span,
.login-info > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.space-menu-current strong {
  font-size: 14px;
}

.space-menu-current small,
.login-info small {
  color: var(--muted);
  font-size: 11px;
}

.space-menu-current {
  display: flex;
  min-height: 48px;
  padding: 2px 4px 9px;
  align-items: center;
  justify-content: space-between;
}

.space-flyout-trigger {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #475569;
}

.space-flyout-trigger:hover,
.space-flyout-trigger[aria-expanded="true"] {
  background: #eef2f7;
  color: #1f2937;
}

.space-flyout-trigger svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.space-picker-flyout {
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  width: 286px;
  padding: 10px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgb(15 23 42 / 16%);
}

.space-picker-flyout[hidden] {
  display: none;
}

.space-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  background: #f8fafc;
}

.space-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.space-search svg,
.space-list-open svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.space-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.space-options {
  display: flex;
  max-height: 190px;
  margin-top: 8px;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
}

.space-options button,
.space-list-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 5px 8px;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  text-align: left;
}

.space-options button:hover,
.space-options button[aria-selected="true"],
.space-list-row:hover,
.space-list-row[aria-selected="true"] {
  background: #f0f4f9;
}

.space-option-icon {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 6px;
}

.space-options strong,
.space-list-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-option-check {
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.space-options-empty {
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.space-menu-divider {
  height: 1px;
  margin: 8px 0;
  background: var(--line);
}

.login-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 9px;
}

.login-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 50%;
  background: #eef2f7;
}

.login-info strong {
  font-size: 13px;
}

.space-list-open,
.account-home-open {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  text-align: left;
}

.space-list-open:hover,
.account-home-open:hover {
  background: #f0f4f9;
  color: #1f2937;
}

.account-home-open svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-home-open > span:last-child {
  margin-left: auto;
  color: #94a3b8;
  font-size: 18px;
}

.brand-panel.is-collapsed .workspace-switcher {
  right: 11px;
  bottom: 12px;
  left: 11px;
}

.brand-panel.is-collapsed .space-switcher-trigger {
  display: grid;
  width: 50px;
  min-height: 50px;
  padding: 5px;
  grid-template-columns: 38px;
  place-content: center;
}

.brand-panel.is-collapsed .space-trigger-copy,
.brand-panel.is-collapsed .space-trigger-chevron {
  display: none;
}

.space-list-dialog {
  width: min(520px, calc(100vw - 48px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 22px 60px rgb(15 23 42 / 22%);
}

.space-list-dialog::backdrop {
  background: rgb(15 23 42 / 34%);
}

.space-list-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.space-list-panel h2,
.space-list-panel p {
  margin: 0;
}

.space-list-panel h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.space-list-panel p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.space-list-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 23px;
}

.space-list-close:hover {
  background: #f1f5f9;
}

.space-list-content {
  display: flex;
  padding: 14px;
  flex-direction: column;
  gap: 4px;
}

.space-list-row {
  min-height: 54px;
  padding: 8px 10px;
}

.account-page {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-width: 1180px;
  height: 100vh;
  background: #ffffff;
}

.account-page[hidden] {
  display: none;
}

.account-sidebar {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid #e5eaf1;
  background: #f3f6fa;
}

.account-logo {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 12px auto 18px;
  place-items: center;
  border: 1px solid #cbe9f4;
  border-radius: 8px;
  background: #d9f2fb;
  color: #1f2937;
  font-size: 12px;
  font-weight: 850;
}

.account-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 5px;
}

.account-nav-item {
  display: flex;
  width: 62px;
  min-height: 57px;
  padding: 6px 2px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border-radius: 7px;
  background: transparent;
  color: #344054;
  font-size: 10px;
}

.account-nav-item svg,
.account-footer-trigger svg,
.account-space-search svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-nav-item.active {
  background: #dfe6ef;
  color: #111827;
  font-weight: 700;
}

.account-nav-item.placeholder {
  opacity: 0.72;
}

.account-footer {
  position: absolute;
  right: 0;
  bottom: 12px;
  left: 0;
}

.account-footer-trigger {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e9eef5;
  color: #334155;
}

.account-footer-menu {
  position: absolute;
  bottom: 50px;
  left: 4px;
  width: 278px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 15px 40px rgb(15 23 42 / 15%);
}

.account-footer-menu[hidden] {
  display: none;
}

.account-footer-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  font-size: 13px;
}

.account-footer-menu button:hover {
  background: #f1f5f9;
}

.account-content {
  min-width: 0;
  padding: 0 28px;
  overflow: auto;
}

.account-content-header {
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
}

.account-content-header h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.account-content-header > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-space-search {
  display: flex;
  width: 230px;
  height: 42px;
  padding: 0 14px;
  align-items: center;
  gap: 8px;
  border: 1px solid #dfe5ed;
  border-radius: 21px;
  background: #f8fafc;
  color: #64748b;
}

.account-space-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.account-space-create {
  display: flex;
  height: 42px;
  padding: 0 20px;
  align-items: center;
  gap: 7px;
  border-radius: 7px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.account-space-create:hover {
  background: var(--accent-strong);
}

.account-space-table {
  min-width: 900px;
  border-top: 1px solid #edf0f4;
}

.account-space-table-head,
.account-space-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(120px, .65fr) minmax(150px, .7fr) minmax(180px, .8fr) minmax(300px, 1fr);
  align-items: center;
}

.account-space-table-head {
  min-height: 48px;
  padding: 0 16px;
  background: #f6f8fb;
  color: #475569;
  font-size: 12px;
}

.account-space-row {
  min-height: 62px;
  padding: 0 16px;
  border-bottom: 1px solid #e8edf3;
  color: #334155;
  font-size: 13px;
}

.account-space-name {
  width: fit-content;
  padding: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 650;
}

.account-space-name:hover {
  text-decoration: underline;
}

.account-space-status::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #22b573;
  content: "";
  vertical-align: middle;
}

.account-space-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-space-actions button {
  padding: 5px 0;
  background: transparent;
  color: #475569;
  font-size: 12px;
}

.account-space-actions button:first-child {
  color: #1f2937;
  font-weight: 650;
}

.account-space-actions button:disabled {
  cursor: not-allowed;
  color: #c0c7d1;
}

.account-space-empty {
  margin: 80px 0;
  color: var(--muted);
  text-align: center;
}

.space-form-dialog,
.space-delete-dialog {
  width: min(440px, calc(100vw - 48px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgb(15 23 42 / 22%);
}

.space-form-dialog::backdrop,
.space-delete-dialog::backdrop {
  background: rgb(15 23 42 / 34%);
}

.space-form-panel > header,
.space-delete-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.space-form-panel h2,
.space-delete-panel h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.space-form-close,
.space-delete-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 22px;
}

.space-form-panel > label {
  display: flex;
  padding: 24px 20px 10px;
  flex-direction: column;
  gap: 8px;
  color: #374151;
  font-size: 13px;
}

.space-form-name {
  height: 40px;
  padding: 0 11px;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  outline: 0;
}

.space-form-name:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.space-form-error,
.space-delete-error {
  margin: 0;
  padding: 0 20px 10px;
  color: #dc2626;
  font-size: 12px;
}

.space-delete-panel > p:first-of-type {
  margin: 0;
  padding: 24px 20px;
  color: #475569;
  font-size: 14px;
}

.space-form-panel > footer,
.space-delete-panel > footer {
  display: flex;
  padding: 14px 20px;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.space-form-panel > footer button,
.space-delete-panel > footer button {
  min-width: 72px;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  background: #eef2f7;
  color: #475569;
}

.space-form-confirm,
.space-delete-confirm {
  background: var(--accent) !important;
  color: #ffffff !important;
}

.space-delete-confirm {
  background: #dc2626 !important;
}

.agent-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 28px;
  padding: 0 20px;
  transition: padding 220ms ease, opacity 180ms ease, transform 220ms ease;
}

.brand-panel.is-collapsed .agent-nav {
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 0;
}

.brand-panel.is-collapsed .brand h1,
.brand-panel.is-collapsed .agent-tab > span:last-child {
  display: none;
}

.brand-panel.is-collapsed .agent-tab {
  justify-content: center;
  gap: 0;
  width: 50px;
  min-width: 50px;
  height: 50px;
  margin: 0;
  padding: 0;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
}

.brand-panel.is-collapsed .agent-tab:hover {
  background: #eef2f8;
}

.brand-panel.is-collapsed .agent-tab.active {
  border-color: #dbe4f2;
  background: #ffffff;
  box-shadow: 0 4px 12px rgb(79 123 240 / 8%);
}

.brand-panel.is-collapsed .agent-dot {
  width: 50px;
  height: 50px;
  border-radius: var(--r-md);
  background: transparent;
  box-shadow: none;
}

.brand-panel.is-collapsed .agent-tab.active .agent-dot {
  background: transparent;
}

.brand-collapse {
  position: absolute;
  left: 14px;
  bottom: 80px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--r-sm);
  background: rgb(255 255 255 / 70%);
  color: #6c7685;
  box-shadow: inset 0 0 0 1px #e0e7f0;
  transition: transform 220ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease, opacity 180ms ease;
}

.brand-panel.is-collapsed .brand-collapse {
  left: 11px;
  bottom: 76px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: #eef2f7;
  box-shadow: inset 0 0 0 1px #d8e1ea;
}

.brand-collapse:hover {
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px #cdd9ec;
}

.brand-collapse svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-panel.is-collapsed .brand-collapse svg {
  width: 22px;
  height: 22px;
}

.agent-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-width: 128px;
  height: 46px;
  padding: 0 18px 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: #5a6577;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.agent-tab:hover {
  background: #eef2f8;
  color: #2b3647;
}

.agent-tab.active {
  border-color: #dbe4f2;
  background: #ffffff;
  color: #1f2b3d;
  box-shadow: 0 4px 12px rgb(79 123 240 / 8%), inset 0 1px 0 rgb(255 255 255 / 90%);
}

.agent-dot {
  display: grid;
  width: 32px;
  height: 32px;
  margin-left: 0;
  place-items: center;
  border-radius: var(--r-pill);
  background: #e6ebf3;
  transition: background 160ms ease;
}

.agent-tab.active .agent-dot {
  background: var(--accent-soft);
}

.agent-dot svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #64748b;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 160ms ease;
}

.agent-tab.active .agent-dot svg {
  stroke: var(--accent-strong);
}

.task-panel {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
  transition: width 220ms ease, opacity 180ms ease;
}

.knowledge-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 28px 22px 24px;
  background: #ffffff;
  overflow: auto;
}

.knowledge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.knowledge-header h2 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.knowledge-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.knowledge-search {
  display: flex;
  width: 126px;
  height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0 12px;
  background: #fafafa;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%);
}

.knowledge-search svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #6b7280;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.knowledge-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #374151;
  font-size: 12px;
}

.knowledge-search input::placeholder {
  color: #9ca3af;
}

.knowledge-create {
  display: inline-flex;
  height: 36px;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #4b4b4b;
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
  padding: 0 16px;
  box-shadow: 0 8px 18px rgb(17 24 39 / 12%);
}

.knowledge-create span {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / 14%);
  font-size: 14px;
  line-height: 1;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(318px, 1fr));
  gap: 14px;
  align-content: start;
  padding-bottom: 8px;
}

.knowledge-detail[hidden] {
  display: none;
}

.knowledge-header[hidden],
.knowledge-grid[hidden] {
  display: none;
}

.knowledge-detail {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 14px 0 0;
  color: #272c35;
}

.knowledge-detail-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.knowledge-detail-title-wrap {
  display: flex;
  min-width: 220px;
  align-items: flex-start;
  gap: 14px;
}

.knowledge-detail-back {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #f3f5f8;
  color: #1f2937;
}

.knowledge-detail-back:hover {
  background: #e9edf3;
}

.knowledge-detail-back svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.knowledge-detail-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.knowledge-detail-title {
  overflow: hidden;
  max-width: 320px;
  margin: 0;
  color: #1b2430;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-detail-title-menu {
  width: 22px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  color: #737b86;
  font-size: 16px;
}

.knowledge-detail-title-menu:hover {
  background: #f0f2f5;
}

.knowledge-detail-description {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 0;
  color: #59616d;
  font-size: 13px;
}

.knowledge-detail-description button {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 15px;
  transform: rotate(-35deg);
}

.knowledge-detail-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.knowledge-detail-search {
  display: flex;
  width: 162px;
  height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid #e1e5ea;
  border-radius: 999px;
  background: #fafbfc;
  padding: 0 15px;
  box-shadow: 0 4px 12px rgb(15 23 42 / 4%);
}

.knowledge-detail-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: #202833;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.knowledge-detail-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #374151;
  font-size: 12px;
}

.knowledge-detail-search input::placeholder {
  color: #8f97a2;
}

.knowledge-detail-action-group {
  display: flex;
  height: 42px;
  align-items: center;
  border: 1px solid #e1e5ea;
  border-radius: 999px;
  background: #fafbfc;
  padding: 0 4px;
}

.knowledge-detail-action {
  display: inline-flex;
  height: 28px;
  align-items: center;
  gap: 7px;
  border-right: 1px solid #e1e5ea;
  background: transparent;
  color: #202833;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 650;
}

.knowledge-detail-action:last-child {
  border-right: 0;
}

.knowledge-detail-action:hover:not(:disabled) {
  color: #1d4ed8;
}

.knowledge-detail-action:disabled {
  cursor: not-allowed;
  color: #9ca3af;
}

.knowledge-detail-add {
  display: inline-flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #4b4b4b;
  color: #ffffff;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgb(17 24 39 / 12%);
}

.knowledge-detail-add:hover {
  background: #343434;
}

.knowledge-detail-add span {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.knowledge-detail-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 18px 0 0 48px;
  color: #69727e;
  font-size: 12px;
}

.knowledge-detail-meta b {
  font-weight: 450;
}

.knowledge-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 28px 0 24px;
}

.knowledge-detail-stats > div {
  display: flex;
  min-height: 52px;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.knowledge-detail-stats span {
  color: #525b68;
  font-size: 13px;
}

.knowledge-detail-stats strong {
  color: #171d27;
  font-size: 23px;
  font-weight: 650;
  line-height: 1;
}

.knowledge-detail-stats small {
  color: #303743;
  font-size: 13px;
  font-weight: 450;
}

.knowledge-document-table {
  min-width: 1180px;
  border-top: 1px solid #edf0f3;
}

.knowledge-document-row {
  display: grid;
  grid-template-columns: 48px minmax(160px, 1.15fr) 105px 78px 100px 108px minmax(180px, 1.35fr) minmax(130px, 1fr) 150px 210px;
  min-height: 48px;
  align-items: center;
  border-bottom: 1px solid #e5e8ec;
  color: #26303b;
  font-size: 12px;
}

.knowledge-document-row > span {
  min-width: 0;
  overflow: hidden;
  padding: 0 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-document-header {
  min-height: 48px;
  border-bottom: 0;
  background: #f6f7f9;
  color: #606a76;
  font-size: 12px;
}

.knowledge-document-header small {
  color: #4b5563;
  font-size: 12px;
}

.knowledge-document-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.knowledge-document-name {
  font-weight: 500;
}

.knowledge-learning-status {
  color: #59636f;
}

.knowledge-learning-status.is-learned {
  color: #18794e;
}

.knowledge-learning-status.is-processing {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1d4ed8;
}

.knowledge-executing-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid currentcolor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: knowledge-executing-spin 700ms linear infinite;
}

@keyframes knowledge-executing-spin {
  to {
    transform: rotate(360deg);
  }
}

.knowledge-description-processing,
.knowledge-document-tag-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.knowledge-description-processing,
.knowledge-document-tag-cell:has(.knowledge-executing-icon) {
  color: #2563eb;
}

.knowledge-document-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.knowledge-document-tag:hover {
  filter: brightness(0.97);
  box-shadow: 0 0 0 2px rgb(37 99 235 / 9%);
}

.knowledge-document-tag-select {
  width: 100%;
  height: 28px;
  border: 1px solid #9eb9df;
  border-radius: 4px;
  outline: 0;
  background: #ffffff;
  color: #273240;
  padding: 0 4px;
  font-size: 11px;
}

.knowledge-document-tag.is-metric {
  border-color: #a8d8bd;
  background: #edf8f2;
  color: #18794e;
}

.knowledge-document-tag.is-standard {
  border-color: #b8cff5;
  background: #eff5ff;
  color: #245da8;
}

.knowledge-document-tag.is-etl {
  border-color: #d2c1e8;
  background: #f6f1fb;
  color: #70469a;
}

.knowledge-document-tag.is-source {
  border-color: #a9d7df;
  background: #edf8fa;
  color: #176b78;
}

.knowledge-document-tag.is-quality {
  border-color: #efb4ae;
  background: #fff1ef;
  color: #a63a31;
}

.knowledge-document-tag.is-other {
  border-color: #d2d7dd;
  background: #f5f6f7;
  color: #5f6975;
}

.knowledge-learning-status.is-failed,
.knowledge-document-empty.is-error,
.knowledge-library-state.is-error {
  color: #b91c1c;
}

.knowledge-document-row > span:last-child {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

.knowledge-document-relearn {
  background: transparent;
  color: #3b4654;
  padding: 0;
  font-size: 12px;
  white-space: nowrap;
}

.knowledge-document-relearn:hover {
  color: #2563eb;
}

.knowledge-document-detail {
  background: transparent;
  color: #2563eb;
  padding: 0;
  font-size: 12px;
  white-space: nowrap;
}

.knowledge-document-detail:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.knowledge-document-remove {
  background: transparent;
  color: #3b4654;
  padding: 0;
  font-size: 12px;
}

.knowledge-document-remove:hover {
  color: #dc2626;
}

.knowledge-document-empty {
  grid-column: 1 / -1;
  min-height: 100px;
  color: #9aa2ad;
  padding-top: 34px;
  text-align: center;
}

.knowledge-library-state {
  grid-column: 1 / -1;
  padding: 72px 24px;
  color: #8a94a2;
  text-align: center;
}

.knowledge-detail-footer {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #69727e;
  font-size: 12px;
}

.knowledge-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}

.knowledge-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #69727e;
}

.knowledge-pagination select,
.knowledge-pagination input {
  height: 24px;
  border: 1px solid #dfe3e8;
  border-radius: 4px;
  background: #ffffff;
  color: #4b5563;
  font-size: 12px;
}

.knowledge-pagination select {
  width: 24px;
  border: 0;
  outline: 0;
}

.knowledge-pagination input {
  width: 44px;
  text-align: center;
}

.knowledge-pagination > button {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: transparent;
  color: #7b8490;
  font-size: 20px;
  line-height: 1;
}

.knowledge-pagination > button:disabled {
  color: #aeb5be;
}

.knowledge-pagination > strong {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 4px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
}

.knowledge-card {
  position: relative;
  min-height: 108px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  padding: 16px 16px 14px;
  box-shadow: 0 1px 0 rgb(15 23 42 / 2%), 0 5px 14px rgb(15 23 42 / 4%);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.knowledge-card:hover {
  border-color: #d8e1eb;
  box-shadow: 0 6px 16px rgb(15 23 42 / 6%);
}

.knowledge-card.is-drag-placeholder {
  border-style: dashed;
  border-color: #aeb8c5;
  background: #f4f6f8;
  box-shadow: none;
  opacity: 0.35;
}

.knowledge-card-drag-ghost {
  position: fixed;
  z-index: 120;
  margin: 0;
  pointer-events: none;
  box-sizing: border-box;
  cursor: grabbing;
  box-shadow: 0 18px 42px rgb(15 23 42 / 20%);
  opacity: 0.96;
}

.knowledge-card-dragging,
.knowledge-card-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

.knowledge-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.knowledge-card h3 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
}

.knowledge-card p {
  margin: 10px 0 18px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}

.knowledge-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #9ca3af;
  font-size: 12px;
  line-height: 1;
}

.knowledge-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.knowledge-card-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.knowledge-card-menu-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
}

.knowledge-card-menu-button:hover {
  background: #f3f4f6;
}

.knowledge-card-menu {
  position: absolute;
  right: -4px;
  top: 30px;
  z-index: 5;
  width: 72px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgb(15 23 42 / 10%);
}

.knowledge-card-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: #374151;
  font-size: 12px;
  text-align: left;
}

.knowledge-card-menu button:hover {
  background: #f9fafb;
}

.knowledge-dialog {
  width: min(780px, calc(100vw - 48px));
  max-width: none;
  height: min(680px, calc(100vh - 48px));
  max-height: none;
  margin: auto;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  padding: 0;
  box-shadow: 0 24px 70px rgb(15 23 42 / 20%);
}

.knowledge-dialog::backdrop,
.knowledge-edit-dialog::backdrop,
.knowledge-delete-dialog::backdrop {
  background: rgb(0 0 0 / 42%);
  backdrop-filter: blur(1px);
}

.knowledge-dialog[open] {
  animation: knowledge-dialog-in 160ms ease-out;
}

@keyframes knowledge-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.knowledge-dialog-form {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.knowledge-dialog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px 12px;
}

.knowledge-dialog-header h2 {
  margin: 0;
  color: #161b24;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.knowledge-dialog-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 21px;
  line-height: 1;
}

.knowledge-dialog-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.knowledge-dialog-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 14px 0;
}

.knowledge-dialog.is-detail-upload .knowledge-form-divider,
.knowledge-dialog.is-detail-upload .knowledge-form-fields {
  display: none;
}

.knowledge-dialog.is-detail-upload .knowledge-dialog-content {
  padding-bottom: 18px;
}

.knowledge-source-tabs {
  display: flex;
  width: max-content;
  margin: 0 0 12px;
  border-radius: 999px;
  background: #f2f3f6;
  padding: 2px;
}

.knowledge-source-tab {
  height: 30px;
  border-radius: 999px;
  background: transparent;
  color: #8b9099;
  padding: 0 16px;
  font-size: 14px;
}

.knowledge-source-tab.active {
  background: #ffffff;
  color: #252a33;
  box-shadow: 0 2px 8px rgb(15 23 42 / 10%);
  font-weight: 700;
}

.knowledge-source-tab:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.knowledge-upload-section {
  display: flex;
  flex-direction: column;
}

.knowledge-file-button {
  display: inline-flex;
  width: max-content;
  height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8dce2;
  border-radius: 4px;
  background: #ffffff;
  color: #272c35;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 650;
}

.knowledge-file-button:hover {
  border-color: #b9c0ca;
  background: #fafafa;
}

.knowledge-file-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.knowledge-file-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.knowledge-drop-zone {
  display: flex;
  height: 290px;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: 8px;
  border: 2px dashed #d9dce1;
  outline: 0;
  background: #ffffff;
  color: #a3a7ae;
  transition: border-color 150ms ease, background 150ms ease;
}

.knowledge-drop-zone:hover,
.knowledge-drop-zone:focus-visible,
.knowledge-drop-zone.is-dragging {
  border-color: #9aa4b2;
  background: #fafbfc;
}

.knowledge-drop-zone.has-files {
  display: none;
}

.knowledge-upload-illustration {
  position: relative;
  width: 58px;
  height: 48px;
  margin-bottom: 16px;
}

.knowledge-upload-illustration span {
  position: absolute;
  width: 30px;
  height: 38px;
  border-radius: 3px;
  background: #e9ecf3;
}

.knowledge-upload-illustration span:first-child {
  left: 8px;
  top: 2px;
  transform: rotate(-13deg);
}

.knowledge-upload-illustration span:first-child::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 9px;
  width: 15px;
  height: 2px;
  background: #d3d9e4;
  box-shadow: 0 6px 0 #d3d9e4;
}

.knowledge-upload-illustration span:last-child {
  right: 5px;
  bottom: 1px;
  width: 28px;
  height: 30px;
  background: #dfe4ee;
  transform: rotate(12deg);
}

.knowledge-drop-zone p {
  margin: 0;
  font-size: 12px;
}

.knowledge-selected-files {
  display: block;
  margin-top: 8px;
}

.knowledge-selected-files:empty {
  display: none;
}

.knowledge-file-table {
  overflow: hidden;
  border: 1px solid #d9dce2;
  background: #ffffff;
  color: #242933;
  font-size: 13px;
}

.knowledge-file-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(110px, 1fr) minmax(86px, 0.7fr);
  min-height: 44px;
  align-items: center;
  border-top: 1px solid #e1e4e8;
}

.knowledge-file-table-row:first-child {
  border-top: 0;
}

.knowledge-file-table-row > span {
  min-width: 0;
  padding: 0 20px;
}

.knowledge-file-table-header {
  min-height: 46px;
  background: #ffffff;
  color: #999fa8;
}

.knowledge-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-file-remove {
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  padding: 0;
}

.knowledge-file-remove:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.knowledge-form-divider {
  display: none;
}

.knowledge-form-fields {
  padding-top: 18px;
  padding-bottom: 4px;
}

.knowledge-form-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.knowledge-form-row + .knowledge-form-row,
.knowledge-field-error + .knowledge-form-row {
  margin-top: 16px;
}

.knowledge-field-label {
  color: #8c929a;
  font-size: 13px;
}

.knowledge-field-label em {
  color: #ef4444;
  font-style: normal;
}

.knowledge-field-control {
  position: relative;
  display: block;
}

.knowledge-field-control input {
  width: 100%;
  height: 34px;
  border: 1px solid #d9dce2;
  border-radius: 3px;
  outline: 0;
  background: #ffffff;
  color: #272c35;
  padding: 0 58px 0 10px;
  font-size: 13px;
}

.knowledge-field-control input::placeholder {
  color: #b2b6bd;
}

.knowledge-field-control input:focus {
  border-color: #7d8794;
  box-shadow: 0 0 0 2px rgb(125 135 148 / 10%);
}

.knowledge-field-control input[aria-invalid="true"] {
  border-color: #ef4444;
}

.knowledge-character-count {
  position: absolute;
  top: 50%;
  right: 8px;
  color: #a3a7ae;
  font-size: 11px;
  transform: translateY(-50%);
}

.knowledge-character-count b {
  font-weight: 400;
}

.knowledge-field-error {
  margin: 5px 0 0 108px;
  color: #dc2626;
  font-size: 12px;
}

.knowledge-dialog-footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 16px 14px;
}

.knowledge-dialog-footer button {
  min-width: 92px;
  height: 44px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 750;
}

.knowledge-dialog-cancel {
  border: 1px solid #dfe3e8;
  background: #f8fafc;
  color: #20252d;
  box-shadow: 0 4px 12px rgb(15 23 42 / 5%);
}

.knowledge-dialog-cancel:hover {
  background: #f2f4f7;
}

.knowledge-dialog-confirm {
  background: #4b4b4b;
  color: #ffffff;
  box-shadow: 0 8px 18px rgb(17 24 39 / 14%);
}

.knowledge-dialog-confirm:hover:not(:disabled) {
  background: #343434;
}

.knowledge-dialog-confirm:disabled {
  cursor: not-allowed;
  background: #d8dadd;
  color: #ffffff;
  box-shadow: none;
}

.knowledge-dialog-error {
  margin: 10px 16px 0;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
}

.knowledge-edit-dialog,
.knowledge-delete-dialog {
  max-width: calc(100vw - 32px);
  margin: auto;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  padding: 0;
  box-shadow: 0 24px 70px rgb(15 23 42 / 24%);
}

.knowledge-edit-dialog {
  width: 520px;
}

.knowledge-delete-dialog {
  width: 440px;
}

.knowledge-edit-dialog[open],
.knowledge-delete-dialog[open] {
  animation: knowledge-dialog-in 160ms ease-out;
}

.knowledge-edit-form,
.knowledge-delete-panel {
  display: flex;
  flex-direction: column;
}

.knowledge-edit-header,
.knowledge-delete-header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e8ebef;
  padding: 12px 16px 12px 20px;
}

.knowledge-edit-header h2,
.knowledge-delete-header h2 {
  margin: 0;
  color: #18202b;
  font-size: 16px;
  font-weight: 750;
}

.knowledge-edit-close,
.knowledge-delete-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #697482;
  font-size: 22px;
}

.knowledge-edit-close:hover,
.knowledge-delete-close:hover {
  background: #f3f5f7;
  color: #1f2937;
}

.knowledge-edit-content {
  display: grid;
  gap: 18px;
  padding: 22px 20px 12px;
}

.knowledge-edit-content label {
  display: grid;
  gap: 8px;
  color: #56616f;
  font-size: 13px;
}

.knowledge-edit-content label span {
  font-weight: 650;
}

.knowledge-edit-content em {
  color: #dc2626;
  font-style: normal;
}

.knowledge-edit-content input,
.knowledge-edit-content textarea {
  width: 100%;
  border: 1px solid #d8dde4;
  border-radius: 5px;
  outline: 0;
  background: #ffffff;
  color: #1f2937;
  padding: 9px 11px;
  font: inherit;
}

.knowledge-edit-content input {
  height: 38px;
}

.knowledge-edit-content textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.knowledge-edit-content input:focus,
.knowledge-edit-content textarea:focus {
  border-color: #7d8794;
  box-shadow: 0 0 0 2px rgb(125 135 148 / 12%);
}

.knowledge-edit-error {
  margin: -8px 0 0;
  color: #b91c1c;
  font-size: 12px;
}

.knowledge-delete-panel > p {
  margin: 0;
  padding: 24px 20px 8px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.7;
}

.knowledge-delete-panel > p strong {
  color: #202936;
  font-weight: 700;
}

.knowledge-delete-panel > .knowledge-delete-error {
  padding: 6px 20px 0;
  color: #b91c1c;
  font-size: 12px;
}

.knowledge-edit-footer,
.knowledge-delete-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 20px 20px;
}

.knowledge-edit-footer button,
.knowledge-delete-footer button {
  height: 38px;
  border-radius: 5px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 650;
}

.knowledge-edit-cancel,
.knowledge-delete-cancel {
  border: 1px solid #d9dee5;
  background: #ffffff;
  color: #344050;
}

.knowledge-edit-confirm {
  background: #33383f;
  color: #ffffff;
}

.knowledge-delete-confirm {
  background: #c93636;
  color: #ffffff;
}

.knowledge-edit-confirm:disabled,
.knowledge-delete-confirm:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.knowledge-learning-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.knowledge-learning-drawer[hidden] {
  display: none;
}

.knowledge-learning-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: rgb(15 23 42 / 24%);
  cursor: default;
}

.knowledge-learning-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: min(680px, 92vw);
  height: 100%;
  flex-direction: column;
  background: #ffffff;
  box-shadow: -18px 0 46px rgb(15 23 42 / 16%);
  animation: knowledge-learning-slide-in 180ms ease-out;
}

@keyframes knowledge-learning-slide-in {
  from {
    transform: translateX(32px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.knowledge-learning-header {
  display: flex;
  min-height: 82px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px 24px;
}

.knowledge-learning-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #7b8490;
  font-size: 12px;
}

.knowledge-learning-header h2 {
  margin: 0;
  color: #18202b;
  font-size: 18px;
  font-weight: 750;
}

.knowledge-learning-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.knowledge-learning-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #66717f;
  font-size: 24px;
}

.knowledge-learning-close:hover {
  background: #f3f5f7;
  color: #1f2937;
}

.knowledge-learning-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 20px 24px 32px;
}

.knowledge-learning-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  color: #7b8490;
  font-size: 13px;
  text-align: center;
}

.knowledge-learning-state.is-error {
  color: #b91c1c;
}

.knowledge-learning-summary {
  display: block;
  padding-bottom: 18px;
}

.knowledge-learning-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: #6f7986;
  font-size: 12px;
}

.knowledge-learning-status {
  color: #18794e;
  font-weight: 650;
}

.knowledge-learning-status.is-running {
  color: #2563eb;
}

.knowledge-learning-status.is-failed {
  color: #b42318;
}

.knowledge-learning-pipeline-wrap {
  margin-top: 16px;
}

.knowledge-learning-pipeline-wrap h3 {
  margin: 0 0 14px;
  color: #273240;
  font-size: 13px;
  font-weight: 700;
}

.knowledge-learning-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.knowledge-learning-stage {
  position: relative;
  min-width: 0;
  color: #8a939e;
  text-align: center;
}

.knowledge-learning-stage > button {
  display: block;
  width: 100%;
  min-height: 82px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  padding: 0 6px 8px;
  text-align: inherit;
}

.knowledge-learning-stage > button:hover {
  background: #f7f9fa;
}

.knowledge-learning-stage.is-selected > button {
  border-color: #b8ddca;
  background: #f2faf6;
}

.knowledge-learning-stage > button:focus-visible {
  outline: 2px solid #367bea;
  outline-offset: 2px;
}

.knowledge-learning-stage::before {
  display: none;
}

.knowledge-learning-stage:first-child::before {
  display: none;
}

.knowledge-learning-stage.is-completed::before,
.knowledge-learning-stage.is-running::before {
  background: #83c9a6;
}

.knowledge-learning-stage-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  place-items: center;
  border: 2px solid #d7dce2;
  border-radius: 50%;
  background: #ffffff;
  color: #ffffff;
  font-size: 14px;
  font-weight: 750;
}

.knowledge-learning-stage.is-completed .knowledge-learning-stage-marker {
  border-color: #249663;
  background: #249663;
}

.knowledge-learning-stage.is-running .knowledge-learning-stage-marker {
  border-color: #367bea;
  background: #367bea;
}

.knowledge-learning-stage.is-failed .knowledge-learning-stage-marker {
  border-color: #d23a32;
  background: #d23a32;
}

.knowledge-learning-stage strong,
.knowledge-learning-stage small {
  display: block;
  overflow-wrap: anywhere;
}

.knowledge-learning-stage strong {
  color: #424d5a;
  font-size: 12px;
  font-weight: 650;
}

.knowledge-learning-pipeline-legacy {
  margin: 0;
  border: 1px solid #e2e6eb;
  border-radius: 5px;
  background: #f8fafb;
  color: #697482;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
}

.knowledge-learning-copy {
  height: 32px;
  border: 1px solid #d9dee5;
  border-radius: 5px;
  background: #ffffff;
  color: #344050;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}

.knowledge-learning-copy:hover {
  border-color: #b7c0ca;
  background: #f8fafb;
}

.knowledge-learning-copy:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.knowledge-learning-chunks {
  margin-top: 18px;
}

.knowledge-stage-output {
  margin-top: 18px;
}

.knowledge-stage-output-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 16px;
  align-items: start;
  margin-bottom: 12px;
  border-bottom: 1px solid #e7eaee;
  padding: 0 0 12px;
}

.knowledge-stage-output-summary > div {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.knowledge-stage-output-summary h3 {
  margin: 0;
  color: #273240;
  font-size: 15px;
  font-weight: 700;
}

.knowledge-stage-output-summary span {
  color: #687482;
  font-size: 12px;
  font-weight: 650;
}

.knowledge-stage-output-summary.is-completed span {
  color: #18794e;
}

.knowledge-stage-output-summary.is-running span {
  color: #2563eb;
}

.knowledge-stage-output-summary.is-failed span,
.knowledge-stage-output-summary.is-failed p {
  color: #b42318;
}

.knowledge-stage-output-summary p {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: #53606f;
  font-size: 13px;
  line-height: 1.55;
}

.knowledge-stage-output-summary small {
  display: block;
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0;
  color: #8a939e;
  font-size: 11px;
}

.knowledge-learning-chunk {
  border-bottom: 1px solid #eaedf1;
  padding: 0 0 20px;
}

.knowledge-learning-chunk + .knowledge-learning-chunk {
  padding-top: 20px;
}

.knowledge-learning-chunk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #2f3a48;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-learning-chunk-header span:last-child {
  color: #89929e;
  font-weight: 450;
}

.knowledge-learning-chunk pre {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: #374151;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.75;
}

@media (max-width: 720px) {
  .knowledge-learning-panel {
    width: 100%;
  }

  .knowledge-learning-summary {
    display: block;
  }

  .knowledge-learning-pipeline {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .knowledge-learning-stage {
    display: block;
    min-height: 66px;
    text-align: left;
  }

  .knowledge-learning-stage > button {
    display: grid;
    min-height: 58px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    padding: 5px;
  }

  .knowledge-learning-stage::before {
    top: -38px;
    bottom: auto;
    left: 13px;
    width: 2px;
    height: 38px;
  }

  .knowledge-learning-stage-marker {
    margin: 0;
  }

  .knowledge-learning-stage small {
    padding: 0;
  }

  .knowledge-learning-copy {
    width: max-content;
  }
}

.task-top {
  display: flex;
  height: 104px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
}

.new-task {
  display: inline-flex;
  width: 100%;
  height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--r-pill);
  border: 1px solid #dbe3ee;
  background: linear-gradient(180deg, #ffffff 0%, #f1f4f9 100%);
  color: #1f2937;
  font-size: 15px;
  font-weight: 750;
  box-shadow: var(--shadow-card);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.new-task span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease;
}

.new-task:hover {
  border-color: #cbd8ee;
  background: linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
  box-shadow: 0 10px 22px rgb(79 123 240 / 10%);
}

.new-task:hover span {
  background: var(--accent);
  color: #fff;
}

.new-task:active {
  transform: translateY(1px);
}

.recent-section {
  padding: 26px 24px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 0;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.section-title button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--r-sm);
  background: transparent;
  color: #9aa6b6;
  font-size: 17px;
  transition: background 160ms ease, color 160ms ease;
}

.section-title button:hover {
  background: #eef2f8;
  color: var(--accent-strong);
}

.task-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list li {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 70px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 13px 15px;
  color: #334155;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.task-list li.selected {
  border-color: #d3e0f6;
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.task-list li.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.task-list li:hover {
  background: #f4f7fd;
}

.empty-tasks {
  display: none;
  margin: 6px 2px 0;
  border: 1px dashed #dde4ee;
  border-radius: var(--r-md);
  padding: 22px 16px;
  color: #a2adbd;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.task-list:empty + .empty-tasks {
  display: block;
}

.task-list li.selected:hover {
  background: var(--accent-soft);
}

.task-list strong,
.task-list span {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-list strong {
  color: #1e293b;
  font-size: 14px;
  font-weight: 750;
}

.task-list span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.chat-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 0;
  padding: 32px 0 24px;
  background: #fbfcfe;
}

.chat-panel.drawer-open {
  --artifact-drawer-width: min(620px, calc(100% - 32px));
  position: relative;
  padding-right: var(--artifact-drawer-width);
}

.chat-panel.drawer-open.artifact-detail-open {
  --artifact-drawer-width: min(960px, calc(100% - 32px));
}

.chat-panel.drawer-open.drawer-overlay {
  padding-right: 0;
}

.chat-panel.drawer-overlay .artifact-drawer {
  width: 100%;
  padding: 0;
}

.chat-panel.drawer-overlay .artifact-drawer-panel {
  border-left: 0;
}

.chat-panel:not(.has-chat-title) .chat-topbar {
  display: none;
}

.chat-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 14px;
  height: var(--chat-topbar-height);
  flex: 0 0 auto;
  padding: 0 var(--chat-gutter);
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  background: rgb(251 252 254 / 96%);
  backdrop-filter: blur(10px);
}

.drawer-toggle {
  width: 40px;
  height: 40px;
}

.drawer-toggle {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.drawer-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-title {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 18px;
  font-weight: 750;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-box {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0 var(--chat-gutter);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.artifact-drawer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 30;
  width: var(--artifact-drawer-width, min(620px, calc(100% - 32px)));
  height: 100%;
  padding: 12px 12px 12px 0;
  background: transparent;
}

.artifact-drawer-panel {
  display: flex;
  height: 100%;
  flex-direction: column;
  border-left: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: -18px 0 36px rgb(15 23 42 / 8%);
}

.artifact-drawer-panel.is-detail .artifact-body {
  grid-template-columns: minmax(0, 1fr);
}

.artifact-drawer-panel.is-detail .artifact-list {
  display: none;
}

.artifact-drawer-panel.is-detail .artifact-viewer {
  display: flex;
  border-left: 0;
}

.artifact-drawer-panel.is-detail .artifact-drawer-header {
  display: none;
}

.artifact-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 18px;
  border-bottom: 1px solid #eef2f7;
}

.artifact-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.artifact-back,
.artifact-open,
.artifact-go-catalog,
.artifact-close {
  display: grid;
  place-items: center;
}

.artifact-back {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: transparent;
  color: #475569;
}

.artifact-back:hover,
.artifact-close:hover {
  background: #f1f3f6;
}

.artifact-back svg,
.artifact-open svg,
.artifact-go-catalog svg,
.artifact-file-title svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.artifact-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 7px;
  background: #f1f2f4;
}

.artifact-tab {
  height: 34px;
  padding: 0 18px;
  border-radius: 5px;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
}

.artifact-tab.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgb(15 23 42 / 10%);
}

.artifact-tab:disabled {
  cursor: default;
}

.artifact-close {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: transparent;
  color: #111827;
  font-size: 24px;
  line-height: 1;
}

.artifact-body {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
}

.artifact-list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding: 12px 16px 18px;
}

.artifact-item {
  display: flex;
  width: 100%;
  align-items: center;
  min-height: 54px;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  background: #f5f6f8;
  text-align: left;
}

.artifact-item:hover {
  background: #eceff3;
}

.artifact-item.selected {
  background: #f5f6f8;
}

.artifact-enter {
  display: grid;
  width: 28px;
  height: 28px;
  margin-left: auto;
  place-items: center;
  color: #94a3b8;
}

.artifact-enter svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.artifact-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 5px;
  background: #eeeafd;
  color: #7668d8;
}

.artifact-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.artifact-item-body {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
}

.artifact-item-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
}

.artifact-created-at {
  flex: 0 0 auto;
  color: #7c8798;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .artifact-created-at {
    display: none;
  }
}

.artifact-empty {
  padding: 18px 8px;
  color: #94a3b8;
  font-size: 14px;
}

.artifact-viewer {
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border-left: 0;
  background: #f4f5f8;
}

.artifact-viewer[hidden] {
  display: none;
}

.artifact-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
}

.artifact-viewer-title {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 6px;
}

.artifact-file-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: #111827;
  font-size: 14px;
  font-weight: 650;
}

.artifact-file-name {
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.artifact-file-title svg {
  width: 14px;
  height: 14px;
  stroke: #6b7280;
}

.artifact-viewer-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.artifact-open,
.artifact-go-catalog {
  display: inline-flex;
  width: auto;
  height: 34px;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #111827;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 600;
}

.artifact-go-catalog[hidden] {
  display: none;
}

.artifact-open:hover,
.artifact-go-catalog:hover {
  background: #e8ebef;
}

.artifact-open svg,
.artifact-go-catalog svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.artifact-close.artifact-detail-close {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: transparent;
  font-size: 22px;
}

.sql-editor {
  display: flex;
  min-height: 0;
  flex: 1;
  background: #f4f5f8;
}

.sql-gutter {
  display: none;
}

.artifact-viewer-code {
  width: 100%;
  margin: 0;
  padding: 14px 18px 18px;
  overflow: auto;
  background: #f4f5f8;
  color: #0f172a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.doc-editor {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: #eef1f5;
}

.doc-editor[hidden] {
  display: none;
}

.doc-editor-toolbar {
  display: flex;
  min-height: 46px;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 6px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.doc-editor-toolbar button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 5px;
  background: transparent;
  color: #334155;
  font-size: 15px;
}

.doc-editor-toolbar button:hover,
.doc-editor-toolbar button:focus-visible {
  background: #eef2f7;
  outline: 0;
}

.doc-toolbar-divider {
  width: 1px;
  height: 22px;
  margin: 0 5px;
  background: #e2e8f0;
}

.doc-block-style select {
  height: 32px;
  border: 1px solid #dbe3ee;
  border-radius: 5px;
  padding: 0 28px 0 9px;
  background: #fff;
  color: #334155;
  font-size: 13px;
}

.doc-save-state {
  margin-left: auto;
  color: #7b8794;
  font-size: 12px;
  white-space: nowrap;
}

.artifact-solution-view {
  width: min(920px, calc(100% - 48px));
  height: 0;
  min-height: 0;
  margin: 20px auto 36px;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 42px 54px 64px;
  background: #fff;
  color: #172033;
  box-shadow: 0 2px 12px rgb(15 23 42 / 8%);
  outline: 0;
}

.artifact-solution-view[hidden],
.sql-editor[hidden] {
  display: none;
}

.artifact-solution-view:focus {
  box-shadow: 0 0 0 2px rgb(79 123 240 / 18%), 0 2px 12px rgb(15 23 42 / 8%);
}

.artifact-solution-view > * {
  max-width: 100%;
}

.artifact-solution-view .reply-table-wrap {
  overflow-x: auto;
}

.artifact-solution-view .reply-table,
.artifact-solution-view > table {
  min-width: 0;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: var(--brand-width) minmax(0, 1fr);
  }

  .task-panel {
    display: none;
  }

  .doc-editor-toolbar {
    overflow-x: auto;
    padding-inline: 10px;
  }

  .artifact-solution-view {
    width: 100%;
    margin: 0;
    padding: 28px 22px 44px;
    box-shadow: none;
  }
}

.sql-line {
  display: grid;
  width: max-content;
  min-width: 100%;
  grid-template-columns: 50px max-content;
}

.sql-line-no {
  padding-right: 12px;
  color: #64748b;
  text-align: right;
  user-select: none;
  border-right: 1px solid #e1e4e8;
}

.sql-line-code {
  min-width: max-content;
  padding-left: 14px;
  white-space: pre;
  word-break: normal;
}

@media (max-width: 900px) {
  .chat-panel.drawer-open,
  .chat-panel.drawer-open.artifact-detail-open {
    --artifact-drawer-width: 100%;
    padding-right: 0;
  }

  .artifact-drawer {
    padding: 0;
  }

  .artifact-drawer-panel {
    border-left: 0;
  }

  .artifact-open span,
  .artifact-go-catalog span {
    display: none;
  }

  .artifact-open,
  .artifact-go-catalog {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
}

.sql-keyword {
  color: #1d4ed8;
}

.sql-func {
  color: #d946ef;
}

.sql-string {
  color: #dc2626;
}

.chat-box.has-messages {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0 var(--chat-gutter) 24px;
}

.message-list {
  display: flex;
  width: 100%;
  min-height: 100%;
  flex-direction: column;
  gap: 18px;
  padding: 18px 0 32px;
}

.message-row {
  display: flex;
  width: 100%;
  gap: 10px;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
  align-items: flex-start;
}

.technical-plan-card {
  width: min(500px, 100%);
  margin-right: auto;
  margin-left: 0;
  overflow: hidden;
  border: 1px solid #b9cdfb;
  border-radius: 8px;
  background: #f7f9ff;
  box-shadow: 0 8px 22px rgb(45 91 190 / 8%);
}

.technical-plan-card.is-running {
  border-color: #7ba2f7;
}

.technical-plan-card.is-approved {
  border-color: #a7d8bd;
  background: #f7fcf9;
}

.technical-plan-card.is-error {
  border-color: #efb3b3;
}

.requirement-document-card {
  border-color: #b8d7c4;
  background: #f8fcfa;
}

.technical-plan-icon.requirement-document-icon {
  background: #e4f5ea;
  color: #15803d;
}

.technical-plan-card:not(:first-child) {
  margin-top: 16px;
}

.requirement-approval-progress {
  margin-top: 18px;
}

.requirement-approval-running-stage {
  color: #64748b;
}

.technical-plan-execution {
  margin-top: 18px;
}

.technical-plan-running-stage {
  color: #64748b;
}

.sql-artifact-card {
  width: min(500px, 100%);
  margin-top: 18px;
  margin-right: auto;
  margin-left: 0;
  overflow: hidden;
  border: 1px solid #cbdcfb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(37 99 235 / 8%);
}

.sql-artifact-open {
  display: grid;
  width: 100%;
  min-height: 92px;
  grid-template-columns: 48px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 16px;
  border: 0;
  padding: 16px 20px;
  background: transparent;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.sql-artifact-open:hover {
  background: #f5f8ff;
}

.sql-artifact-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #e8efff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 850;
}

.sql-artifact-body {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.sql-artifact-body strong {
  font-size: 17px;
  line-height: 1.35;
}

.sql-artifact-body > span {
  overflow: hidden;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sql-artifact-arrow {
  color: #6b8fc9;
  font-size: 32px;
  line-height: 1;
}

.catalog-document-content {
  max-width: 900px;
  margin-top: 20px;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.75;
}

.catalog-document-content table {
  width: 100%;
  border-collapse: collapse;
}

.catalog-document-content th,
.catalog-document-content td {
  border: 1px solid #dbe3ef;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.technical-plan-execution > .reply-subheading:first-child {
  display: none;
}

.technical-plan-open {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
  background: transparent;
  text-align: left;
}

.technical-plan-open:hover {
  background: #f0f4ff;
}

.technical-plan-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: #e3ebff;
  color: #356de8;
}

.technical-plan-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.technical-plan-body {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.technical-plan-body strong {
  color: #172033;
  font-size: 15px;
  font-weight: 750;
}

.technical-plan-body > span {
  overflow: hidden;
  color: #637083;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technical-plan-arrow {
  color: #6884bc;
  font-size: 24px;
}

.technical-plan-summary {
  display: none;
}

.technical-plan-card > footer {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 14px 9px 18px;
  border-top: 1px solid #dce5f8;
  background: rgb(255 255 255 / 72%);
}

.technical-plan-status {
  color: #748096;
  font-size: 12px;
}

.technical-plan-confirm {
  height: 36px;
  border-radius: 6px;
  background: #4378ed;
  color: #fff;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
}

.technical-plan-confirm:hover:not(:disabled) {
  background: #3268dd;
}

.technical-plan-confirm:disabled {
  cursor: default;
  background: #aebbd3;
}

.assistant-content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  gap: 8px;
  padding-left: 42px;
}

.assistant-content {
  min-width: 0;
}

.execution-status {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.execution-status-mark {
  position: relative;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
}

.execution-status.is-running .execution-status-mark {
  border-radius: 4px;
  animation: execution-work 1s ease-in-out infinite;
}

.execution-computer-screen {
  display: block;
  width: 18px;
  height: 12px;
  border: 2px solid #2563eb;
  border-radius: 3px;
  background: #eff6ff;
}

.execution-computer-stand {
  display: block;
  width: 12px;
  height: 4px;
  margin-top: -1px;
  border-bottom: 2px solid #2563eb;
}

.execution-status.is-running .execution-computer-screen::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  margin: 2px auto 0;
  border-radius: 999px;
  background: #2563eb;
  animation: execution-pulse 0.7s ease-in-out infinite alternate;
}

.execution-status.is-done .execution-status-mark {
  border-radius: 4px;
  background: transparent;
}

.execution-status.is-done .execution-computer-screen {
  position: relative;
  display: block;
  border-color: #16a34a;
  background: #f0fdf4;
}

.execution-status.is-done .execution-computer-stand {
  display: block;
  border-color: #16a34a;
}

.execution-status.is-done .execution-computer-screen::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  width: 4px;
  height: 7px;
  border: solid #16a34a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@keyframes execution-work {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes execution-pulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

.message-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  margin-top: 0;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.message-bubble {
  max-width: min(680px, 72%);
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  box-shadow: 0 10px 24px rgb(30 41 59 / 5%);
}

.message-row.user .message-bubble {
  border-color: #2f65e8;
  background: var(--accent);
  color: #fff;
}

.message-row.assistant .message-bubble {
  width: min(1120px, 100%);
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  white-space: normal;
  box-shadow: none;
}

.reply-text {
  white-space: pre-wrap;
}

.reply-lead {
  margin-bottom: 14px;
}

.reply-paragraph {
  margin: 0;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.75;
  white-space: normal;
}

.reply-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.45;
}

.reply-heading::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #2563eb;
}

.reply-subheading {
  margin: 0;
  border-top: 1px solid #edf2f7;
  padding-top: 13px;
  color: #1e293b;
  font-size: 16px;
  font-weight: 820;
  line-height: 1.5;
}

.reply-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.7;
  list-style: none;
  white-space: normal;
}

.reply-list li + li {
  margin-top: 0;
}

.reply-list li {
  position: relative;
  padding-left: 24px;
}

.reply-list li::before {
  content: "";
  position: absolute;
  top: 0.78em;
  left: 6px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #334155;
}

.reply-list strong,
.reply-paragraph strong,
.reply-table strong {
  color: #111827;
  font-weight: 820;
}

.reply-inline-code {
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #df3f2f;
  padding: 2px 7px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
}

.reply-divider {
  height: 1px;
  border: 0;
  background: #e2e8f0;
  margin: 2px 0;
}

.reply-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.reply-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.55;
}

.reply-table th,
.reply-table td {
  border-bottom: 1px solid #edf2f7;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.reply-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 820;
}

.reply-table tr:last-child td {
  border-bottom: 0;
}

.validation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.validation-prompt {
  color: #1f2937;
  font-size: 15px;
  font-weight: 700;
}

.validation-confirm-button {
  min-height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 760;
}

.validation-confirm-button:hover {
  background: #1d4ed8;
}

.validation-confirm-button:disabled {
  background: #cbd5e1;
  color: #64748b;
}

.reply-text + .reply-text,
.reply-paragraph + .reply-paragraph,
.reply-paragraph + .reply-heading,
.reply-paragraph + .reply-subheading,
.reply-heading + .reply-paragraph,
.reply-heading + .reply-list,
.reply-subheading + .reply-paragraph,
.reply-subheading + .reply-list,
.reply-list + .reply-heading,
.reply-list + .reply-subheading,
.reply-list + .reply-paragraph,
.reply-table-wrap + .reply-paragraph,
.reply-paragraph + .reply-table-wrap,
.reply-divider + .reply-paragraph,
.reply-paragraph + .reply-divider,
.reply-text + .code-block-wrap,
.code-block-wrap + .reply-text,
.code-block-wrap + .reply-paragraph,
.reply-paragraph + .code-block-wrap,
.code-block-wrap + .steps-panel,
.reply-table-wrap + .validation-actions {
  margin-top: 14px;
}

.reply-heading + .databuddy-summary,
.reply-subheading + .databuddy-kv,
.databuddy-kv + .reply-table-wrap,
.databuddy-summary + .reply-subheading,
.reply-table-wrap + .reply-subheading,
.steps-panel + .reply-heading,
.invocation-panel + .steps-panel {
  margin-top: 12px;
}

.invocation-panel {
  margin-top: 14px;
  margin-bottom: 16px;
  padding: 0;
  color: #8a94a3;
  font-size: 13px;
  line-height: 1.65;
}

.tool-invocation,
.skill-invocation,
.tool-invocation-detail {
  margin: 0;
}

.tool-invocation-summary,
.skill-invocation-summary,
.tool-invocation-detail-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: #8a94a3;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.65;
  list-style: none;
  user-select: none;
}

.tool-invocation-summary::-webkit-details-marker,
.skill-invocation-summary::-webkit-details-marker,
.tool-invocation-detail-summary::-webkit-details-marker {
  display: none;
}

.tool-invocation-summary::after,
.skill-invocation-summary::before,
.tool-invocation-detail-summary::before {
  color: #9aa4b2;
  font-size: 12px;
}

.tool-invocation-summary::after {
  content: "⌄";
}

.skill-invocation-summary::before {
  content: "▸";
}

.tool-invocation[open] > .tool-invocation-summary::after {
  content: "⌃";
}

.skill-invocation[open] > .skill-invocation-summary::before {
  content: "▾";
}

.skill-invocation {
  margin-top: 8px;
}

.skill-inline-header {
  color: #8a94a3;
  font-size: 13px;
  font-weight: 400;
}

.skill-invocation-content {
  margin-top: 8px;
  border-radius: 8px;
  background: #f3f5f8;
  color: #111827;
  padding: 12px 14px;
}

.skill-invocation-content p {
  margin: 0;
  white-space: pre-wrap;
}

.skill-invocation-content p + p {
  margin-top: 12px;
}

.skill-invocation-content strong {
  color: #111827;
  font-weight: 800;
}

.skill-action-list {
  margin: 8px 0 0;
  padding-left: 22px;
  color: #111827;
}

.skill-action-list li + li {
  margin-top: 4px;
}

.tool-invocation-calls {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.tool-invocation-detail-summary::before {
  content: "▸";
}

.tool-invocation-detail[open] > .tool-invocation-detail-summary::before {
  content: "▾";
}

.tool-call-meta {
  padding: 10px 12px 0;
  color: #111827;
  font-size: 12px;
  font-weight: 650;
}

.tool-invocation-detail-content {
  overflow: hidden;
  border-radius: 8px;
  background: #f3f5f8;
}

.tool-invocation-detail-summary:not([hidden]) + .tool-invocation-detail-content {
  margin-top: 8px;
}

.call-loop-item {
  border-left: 3px solid #dbeafe;
  padding-left: 12px;
}

.call-loop-item + .call-loop-item {
  margin-top: 12px;
}

.call-loop-title {
  margin: 0 0 6px;
  color: #111827;
  font-size: 15px;
  font-weight: 820;
  line-height: 1.5;
}

.call-loop-next {
  margin-top: 4px;
  color: #64748b;
}

.code-block-wrap {
  overflow: hidden;
  border: 1px solid #1e293b;
  border-radius: 8px;
  background: #0f172a;
}

.code-block-label {
  border-bottom: 1px solid #1e293b;
  background: #111827;
  color: #bfdbfe;
  padding: 8px 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
}

.sql-code {
  margin: 0;
  overflow-x: auto;
  background: #0f172a;
  color: #dbeafe;
  padding: 14px 16px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
}

.sql-code code {
  font: inherit;
}

.steps-panel {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.live-steps {
  margin-top: 14px;
  border-top: 0;
  padding-top: 0;
}

.live-intro {
  color: #1f2937;
}

.step-narration {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.step-narration-item {
  border-left: 3px solid #dbeafe;
  padding-left: 10px;
  color: #475569;
}

.step-narration-list {
  margin-left: 13px;
  color: #475569;
}

.steps-title {
  margin-bottom: 16px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
}

.step-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.step-item + .step-item {
  margin-top: 18px;
}

.step-fade-in {
  animation: stepFadeIn 180ms ease-out both;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-badge {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 13px;
  font-weight: 850;
}

.step-body {
  min-width: 0;
}

.step-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.step-body strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
}

.step-status,
.step-tool-count {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 750;
}

.step-status.done {
  background: #dcfce7;
  color: #15803d;
}

.step-status.running {
  background: #fef3c7;
  color: #b45309;
}

.step-status.skipped {
  background: #f1f5f9;
  color: #64748b;
}

.step-tool-count {
  background: #eff6ff;
  color: #1d4ed8;
}

.step-detail {
  margin-top: 8px;
  color: #5f6b7a;
  font-size: 14px;
  line-height: 1.65;
}

.step-body .code-block-wrap {
  margin-top: 10px;
}

.inline-message {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #1f2937;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.tool-calls {
  margin-top: 12px;
}

.tool-call-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tool-toggle {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.tool-toggle:hover {
  background: #eef2ff;
  color: #1d4ed8;
}

.tool-call-content {
  margin-top: 10px;
}

.tool-call-card {
  max-height: 200px;
  border: 1px solid #1e293b;
  border-radius: 10px;
  overflow: auto;
  background: #0f172a;
  scrollbar-color: #64748b #0f172a;
}

.tool-call-card + .tool-call-card {
  margin-top: 10px;
}

.tool-call-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #1e293b;
  background: #111827;
  color: #bfdbfe;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 850;
}

.tool-call-copy {
  flex: 0 0 auto;
  min-height: 26px;
  border: 1px solid rgb(147 197 253 / 44%);
  border-radius: 7px;
  background: rgb(30 64 175 / 28%);
  color: #dbeafe;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.tool-call-copy:hover {
  border-color: #93c5fd;
  background: rgb(37 99 235 / 42%);
}

.tool-call-copy.is-copied {
  border-color: rgb(134 239 172 / 70%);
  background: rgb(22 101 52 / 45%);
  color: #dcfce7;
}

.tool-call-label {
  background: #172033;
  color: #93c5fd;
  padding: 7px 12px 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.tool-call-code {
  margin: 0;
  overflow: auto;
  background: #172033;
  color: #e5e7eb;
  padding: 8px 12px 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.tool-call-result-code {
  border-top: 1px solid rgb(148 163 184 / 16%);
  color: #dbeafe;
  white-space: pre;
}

.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100% - 80px));
  max-width: 520px;
  transform: translate(-50%, -50%);
  text-align: center;
}

.empty-icon {
  position: relative;
  display: inline-grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #f2f6ff 0%, #e6eeff 100%);
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 26px rgb(79 123 240 / 14%), inset 0 1px 0 rgb(255 255 255 / 80%);
}

.empty-icon::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  border-radius: 26px;
  background: radial-gradient(closest-side, rgb(79 123 240 / 12%), transparent);
}

.empty-icon.fresh {
  background: #ecfdf5;
  color: var(--green);
  font-size: 28px;
}

.empty-state h2 {
  margin: 24px 0 12px;
  color: #111827;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.2px;
}

.empty-state p {
  margin: 0 auto;
  max-width: 420px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.starter-grid button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  padding: 0 12px;
}

.starter-grid button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--accent);
}

.input-box {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 14px;
  min-height: 70px;
  align-items: center;
  margin: 16px var(--chat-gutter) 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  padding: 10px 12px 10px 22px;
  box-shadow: 0 16px 34px rgb(30 41 59 / 7%);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer-entry {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: center;
}

.chat-waiting-queue {
  display: grid;
  max-height: 116px;
  margin: 0 0 5px;
  padding: 7px 9px;
  gap: 5px;
  overflow: hidden;
  border-bottom: 1px solid #edf0f4;
  color: #7b8798;
}

.chat-waiting-queue[hidden] {
  display: none;
}

.chat-waiting-queue > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8994a4;
  font-size: 10px;
}

.chat-waiting-queue > header span {
  font-weight: 700;
}

.chat-waiting-queue > header small {
  font-size: 10px;
}

.chat-waiting-list {
  display: grid;
  max-height: 78px;
  gap: 3px;
  overflow-y: auto;
}

.chat-waiting-item {
  display: grid;
  min-height: 22px;
  grid-template-columns: 18px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 5px;
}

.chat-waiting-item > span {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: #eef1f5;
  color: #778395;
  font-size: 9px;
}

.chat-waiting-item small {
  min-width: 0;
  overflow: hidden;
  color: #8a95a5;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-waiting-item button {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 4px;
  background: transparent;
  color: #9aa4b2;
  font-size: 15px;
}

.chat-waiting-item button:hover {
  background: #eef1f5;
  color: #526276;
}

.knowledge-reference-list {
  display: flex;
  min-height: 26px;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.knowledge-reference-list[hidden] {
  display: none;
}

.knowledge-reference-chip {
  display: inline-flex;
  max-width: min(280px, 100%);
  height: 26px;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0 6px 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-reference-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-reference-chip button {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  color: #64748b;
  font-size: 15px;
  line-height: 1;
}

.knowledge-reference-chip button:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.knowledge-mention-menu {
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 14px);
  left: -12px;
  display: grid;
  width: min(520px, calc(100vw - 72px));
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 18px 42px rgb(15 23 42 / 16%);
}

.knowledge-mention-menu[hidden] {
  display: none;
}

.knowledge-mention-option,
.knowledge-mention-empty {
  width: 100%;
  min-height: 52px;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
}

.knowledge-mention-option {
  display: grid;
  gap: 3px;
  color: #172033;
}

.knowledge-mention-option:hover,
.knowledge-mention-option.is-active {
  background: #f1f5f9;
}

.knowledge-mention-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.knowledge-mention-option span,
.knowledge-mention-empty {
  color: #64748b;
  font-size: 12px;
}

.input-box:focus-within {
  border-color: #c2d2f7;
  box-shadow: 0 16px 34px rgb(30 41 59 / 7%), 0 0 0 4px var(--accent-ring);
}

.input-box textarea {
  width: 100%;
  height: 48px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 12px 0 0;
  color: #111827;
  font-size: 15px;
}

.input-box textarea::placeholder {
  color: #aeb7c2;
}

.send-button {
  width: 96px;
  height: 48px;
  border-radius: var(--r-sm);
  background: #e8edf4;
  color: #8b97a7;
  font-size: 15px;
  font-weight: 750;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 120ms ease;
}

.send-button.ready {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgb(79 123 240 / 22%);
}

.send-button.ready:hover {
  background: var(--accent-strong);
}

.send-button.ready:active {
  transform: translateY(1px);
}
