:global(.assistant-el-overlay) {
  --assistant-viewport-inset: clamp(10px, 1.25vmin, 18px);
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%),
    rgba(241, 245, 249, 0.98);
}

:global(.assistant-el-overlay .el-overlay-dialog) {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: var(--assistant-viewport-inset);
  box-sizing: border-box;
  overflow: hidden;
}

:global(.assistant-el-dialog.el-dialog.is-fullscreen) {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

:global(.assistant-el-dialog .el-dialog__header) {
  display: none;
}

:global(.assistant-el-dialog .assistant-el-dialog-body) {
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  display: flex;
  padding: 0;
  overflow: hidden;
}

:global(.assistant-dialog-zoom-enter-active),
:global(.assistant-dialog-zoom-leave-active) {
  transition: opacity 180ms cubic-bezier(0.2, 0, 0, 1);
  transition-duration: 180ms !important;
}

:global(.assistant-dialog-zoom-leave-active) {
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  transition-duration: 260ms !important;
}

:global(.assistant-dialog-zoom-enter-active .assistant-modal-stage),
:global(.assistant-dialog-zoom-leave-active .assistant-modal-stage) {
  transform-origin: center center;
  will-change: transform, opacity;
}

:global(.assistant-dialog-zoom-enter-active .assistant-modal-stage) {
  animation: assistantWorkbenchScaleIn 260ms cubic-bezier(0.2, 0, 0, 1) both;
  animation-duration: 260ms !important;
}

:global(.assistant-dialog-zoom-leave-active .assistant-modal-stage) {
  animation: assistantWorkbenchScaleOut 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-duration: 260ms !important;
}

:global(.assistant-dialog-zoom-enter-from),
:global(.assistant-dialog-zoom-leave-to) {
  opacity: 0;
}

@keyframes assistantWorkbenchScaleIn {
  0% {
    opacity: 0;
    transform: scale3d(0.82, 0.82, 1);
  }

  72% {
    opacity: 1;
    transform: scale3d(1.012, 1.012, 1);
  }

  100% {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes assistantWorkbenchScaleOut {
  0% {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }

  62% {
    opacity: 0.72;
    transform: scale3d(0.972, 0.972, 1);
  }

  100% {
    opacity: 0;
    transform: scale3d(0.94, 0.94, 1);
  }
}

.assistant-overlay {
  /* 距屏幕边缘 10-18px，随视口微调；高度使用 dvh 适配浏览器工具栏 */
  --assistant-viewport-inset: clamp(10px, 1.25vmin, 18px);
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 9999;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: var(--assistant-viewport-inset);
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%),
    rgba(241, 245, 249, 0.98);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.assistant-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
  border-radius: 4px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: hidden;
  isolation: isolate;
}

.assistant-modal-stage {
  /* 工作台字号令牌：笔记本断点见后续 media */
  --wb-fs-title: 22px;
  --wb-fs-desc: 13px;
  --wb-fs-badge: 12px;
  --wb-fs-bubble: 13px;
  --wb-fs-bubble-meta: 12px;
  --wb-fs-bubble-time: 11px;
  --wb-fs-chip: 12px;
  --wb-fs-composer: 14px;
  --wb-fs-tool-icon: 18px;
  --wb-fs-md-h1: 13px;
  --wb-fs-md-h2: 13px;
  --wb-fs-md-h3: 13px;
  --wb-fs-insight-title: 19px;
  --wb-fs-insight-num: 19px;
  --wb-fs-insight-body: 12px;
  --wb-fs-insight-h4: 15px;
  --wb-fs-metric: 13px;
  --wb-fs-metric-strong: 13px;
  --wb-fs-welcome: 18px;
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  transform: none;
  border-radius: 4px;
  background: #f6f9fc;
  box-shadow:
    0 28px 72px rgba(15, 23, 42, 0.22),
    0 10px 28px rgba(15, 23, 42, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(191, 219, 254, 0.88);
  background-clip: padding-box;
  overflow: hidden;
  isolation: isolate;
  will-change: transform, opacity;
}

.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: clamp(14px, 2vh, 22px) clamp(148px, 11vw, 172px) clamp(12px, 1.6vh, 18px) clamp(18px, 2vw, 26px);
  border-bottom: none;
  background: #fff;
}

.assistant-header-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.assistant-badge {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-active));
  color: #fff;
  font-size: var(--wb-fs-badge);
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.14);
  white-space: nowrap;
}

.assistant-badge.warning {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

.assistant-title {
  color: #0f172a;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.25;
  margin: 0;
  cursor: default;
  text-decoration: none;
  user-select: text;
  border: 0;
  outline: 0;
  background: transparent;
}

.assistant-title + p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: clamp(11px, 0.85vw, var(--wb-fs-desc));
  line-height: 1.55;
}

.assistant-subtitle {
  margin: 4px 0 0;
  color: #64748b;
  font-size: clamp(11px, 0.85vw, var(--wb-fs-desc));
  line-height: 1.55;
  cursor: default;
}

.assistant-header p {
  color: #64748b;
  font-size: clamp(11px, 0.85vw, var(--wb-fs-desc));
  line-height: 1.55;
}

.assistant-header-main {
  cursor: default;
}

.assistant-header-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.assistant-toggle-btn,
.session-trash-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 4px;
  flex: none;
}

.assistant-toggle-btn {
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.18);
  background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.08);
  color: var(--theme-primary-active);
  font-size: 16px;
  box-shadow: 0 8px 18px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.1);
}

.assistant-toggle-btn:hover:not(:disabled) {
  background: var(--theme-primary-soft);
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.28);
}

.assistant-toggle-btn:disabled,
.assistant-toggle-btn.disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.session-trash-btn {
  background: rgba(254, 242, 242, 0.96);
  color: #dc2626;
  font-size: 16px;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.12);
}

.session-trash-btn:hover:not(:disabled) {
  background: rgba(254, 226, 226, 0.98);
  border-color: rgba(239, 68, 68, 0.34);
}

.session-trash-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.assistant-close-btn,
.close-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  flex: none;
  border: 1px solid rgba(193, 204, 216, 0.92);
  border-radius: 4px;
  background: rgba(248, 251, 251, 0.94);
  color: #475569;
  font-size: 16px;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.18);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.assistant-close-btn {
  z-index: 61;
  pointer-events: auto;
}

.assistant-close-btn i {
  pointer-events: none;
}

.assistant-close-btn:hover,
.close-btn:hover {
  background: rgba(241, 245, 249, 0.98);
  border-color: rgba(148, 163, 184, 0.34);
  color: #0f172a;
}

.flow-status-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.flow-status-chip.running {
  background: #eff6ff;
  color: #2563eb;
}

.flow-status-chip.completed {
  background: var(--success-soft);
  color: var(--success);
}

.flow-status-chip.failed {
  background: #fef2f2;
  color: #dc2626;
}

.flow-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  font-size: 16px;
  box-shadow: 0 6px 14px rgba(148, 163, 184, 0.12);
}

.flow-icon-btn:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
}

.flow-icon-btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  box-shadow: none;
}

.flow-step-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
}

.flow-step-item:last-child {
  padding-bottom: 0;
}

.flow-step-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.flow-step-rail::after {
  content: "";
  position: absolute;
  top: 34px;
  bottom: -12px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: #e2e8f0;
}

.flow-step-item:last-child .flow-step-rail::after {
  display: none;
}

.flow-step-rail span {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.flow-step-item.completed .flow-step-rail span {
  background: var(--success);
  color: #fff;
}

.flow-step-item.running .flow-step-rail span {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
}

.flow-step-item.failed .flow-step-rail span {
  background: #ef4444;
  color: #fff;
}

.flow-step-card {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid #e5edf5;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(226, 232, 240, 0.34);
}

.flow-step-item.running .flow-step-card {
  border-color: rgba(37, 99, 235, 0.42);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.flow-step-card header,
.flow-step-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-step-card header {
  justify-content: space-between;
}

.flow-step-card strong {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.flow-step-side {
  flex: none;
  gap: 8px;
}

.flow-step-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.flow-step-status.completed {
  background: var(--success-soft);
  color: var(--success);
}

.flow-step-status.running {
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.flow-step-status.failed {
  background: #fef2f2;
  color: #dc2626;
}

.flow-step-side time {
  min-width: 36px;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.flow-step-detail,
.flow-step-error {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.flow-step-detail {
  color: #475569;
}

.flow-step-error {
  color: #dc2626;
}

.flow-empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 30px;
  color: #64748b;
  text-align: center;
}

.flow-empty-state i {
  font-size: 34px;
  color: #94a3b8;
}

.flow-empty-state strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.flow-empty-state p {
  max-width: 260px;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

@keyframes flowPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

.assistant-layout {
  min-height: 0;
  flex: 1;
  height: 100%;
  max-height: 100%;
  display: flex;
  padding: clamp(12px, 1.5vw, 16px);
  align-items: stretch;
  gap: clamp(12px, 1.5vw, 16px);
  overflow: hidden;
}

.dialog-panel,
.insight-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(189, 201, 214, 0.74);
  border-radius: 4px;
  background: #ffffff;
  box-shadow:
    0 14px 32px rgba(148, 163, 184, 0.16),
    0 2px 6px rgba(15, 23, 42, 0.05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dialog-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.insight-panel-shell {
  flex: none;
  display: flex;
  width: clamp(300px, 28vw, 420px);
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  margin-left: 0;
  overflow: hidden;
  transition:
    width 360ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-left 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.insight-panel-shell.collapsed {
  width: 0;
  margin-left: 0;
}

.dialog-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(238, 242, 247, 0.9);
  background: #ffffff;
}

.dialog-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  margin-right: 4px;
}

.dialog-toolbar-label i {
  color: #475569;
  opacity: 0.85;
  font-size: 14px;
  line-height: 1;
}

.shortcut-chip {
  margin-right: 0;
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid rgba(219, 230, 240, 0.9);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
  white-space: nowrap;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.shortcut-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.shortcut-chip:hover:not(:disabled) {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(239, 246, 255, 0.95);
  color: var(--theme-primary-active, #1d4ed8);
}

.shortcut-chip i {
  color: var(--theme-primary);
  font-size: 14px;
}

.shortcut-chip.active {
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.55);
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18);
}

.shortcut-chip.active i {
  color: var(--theme-primary-active);
}

.shortcut-chip:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.shortcut-chip:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

.message-list {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message-row.user .message-avatar {
  order: 2;
  background: transparent;
}

.message-row.user .message-bubble {
  order: 1;
  justify-self: end;
  background: linear-gradient(135deg, rgba(226, 238, 255, 0.98), rgba(242, 247, 255, 0.9));
  border-color: rgba(96, 165, 250, 0.24);
  box-shadow: 0 14px 30px rgba(59, 130, 246, 0.08);
}

.message-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 10px 20px rgba(148, 163, 184, 0.24);
}

.message-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.message-bubble {
  max-width: min(100%, 720px);
  padding: 12px 14px;
  border: 1px solid rgba(210, 220, 230, 0.94);
  border-radius: 4px;
  background: rgba(253, 254, 254, 0.94);
  color: #24324a;
  font-size: var(--wb-fs-bubble);
  line-height: 1.58;
  box-shadow: 0 10px 22px rgba(226, 232, 240, 0.48);
}

.message-bubble-application-preview {
  max-width: min(100%, 980px);
}

.message-bubble-review-risk-low {
  border-color: rgba(37, 99, 235, 0.72);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.72), rgba(255, 255, 255, 0.96));
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.12),
    0 12px 24px rgba(37, 99, 235, 0.1);
}

.message-bubble-review-risk-medium {
  border-color: rgba(217, 119, 6, 0.78);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.76), rgba(255, 255, 255, 0.96));
  box-shadow:
    0 0 0 2px rgba(217, 119, 6, 0.14),
    0 12px 24px rgba(217, 119, 6, 0.11);
}

.message-bubble-review-risk-high {
  border-color: rgba(220, 38, 38, 0.78);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.78), rgba(255, 255, 255, 0.96));
  box-shadow:
    0 0 0 2px rgba(220, 38, 38, 0.14),
    0 12px 24px rgba(220, 38, 38, 0.11);
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.message-meta strong {
  color: #0f172a;
  font-size: var(--wb-fs-bubble-meta);
  font-weight: 850;
}

.message-meta time {
  color: #94a3b8;
  font-size: var(--wb-fs-bubble-time);
}

.message-bubble p {
  margin: 0;
  color: #334155;
  font-size: inherit;
}

.message-answer-content {
  display: grid;
  gap: 9px;
}

.message-answer-content p,
.message-answer-content ul,
.message-answer-content ol,
.message-answer-content blockquote,
.message-answer-content pre {
  margin: 0;
}

.message-answer-markdown :deep(h1),
.message-answer-markdown :deep(h2),
.message-answer-markdown :deep(h3),
.message-answer-markdown :deep(h4) {
  margin: 12px 0 4px;
  color: #0f172a;
  font-size: max(13px, calc(var(--wb-fs-bubble) + 1px));
  font-weight: 820;
  line-height: 1.42;
  letter-spacing: 0;
}

.message-answer-markdown :deep(h1:first-child),
.message-answer-markdown :deep(h2:first-child),
.message-answer-markdown :deep(h3:first-child),
.message-answer-markdown :deep(h4:first-child) {
  margin-top: 0;
}

.message-answer-markdown :deep(h3) {
  padding-left: 8px;
  border-left: 3px solid #2563eb;
}

.message-answer-markdown :deep(h3 + p),
.message-answer-markdown :deep(h3 + .markdown-table-wrap) {
  margin-top: 6px;
}

.message-answer-markdown {
  overflow-x: auto;
  font-size: var(--wb-fs-bubble);
  color: #334155;
  line-height: 1.58;
}

.message-answer-markdown :deep(p),
.message-answer-markdown :deep(li),
.message-answer-markdown :deep(td),
.message-answer-markdown :deep(th),
.message-answer-markdown :deep(blockquote) {
  font-size: inherit;
  color: inherit;
  line-height: 1.58;
}

.message-answer-markdown :deep(p) {
  margin: 0;
}

.application-preview-table {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #d7e4f2;
  border-radius: 4px;
  background: #ffffff;
  color: #334155;
  font-size: var(--wb-fs-bubble);
}

.application-preview-footer {
  margin-top: 12px;
  color: #334155;
  font-size: var(--wb-fs-bubble);
  line-height: 1.58;
}

.application-preview-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  min-height: 38px;
  border-top: 1px solid #e6edf5;
}

.application-preview-row.editable {
  cursor: pointer;
}

.application-preview-row.editable:hover {
  background: #f8fbff;
}

.application-preview-row.editable:hover .application-preview-label,
.application-preview-row.editable:hover .application-preview-value {
  background: #f8fbff;
}

.application-preview-row.editable.missing:hover .application-preview-value {
  background: #fff4e6;
}

.application-preview-row.editable:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: -2px;
}

.application-preview-row:first-child {
  border-top: 0;
}

.application-preview-row.head {
  min-height: 34px;
  background: #f8fafc;
  color: #475569;
  font-size: var(--wb-fs-caption);
  font-weight: 850;
}

.application-preview-row > span {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 8px 12px;
}

.application-preview-label {
  border-right: 1px solid #e6edf5;
  background: #fbfdff;
  color: #64748b;
  font-weight: 760;
}

.application-preview-value {
  position: relative;
  gap: 8px;
  color: #0f172a;
  font-weight: 650;
}

  .application-preview-row.missing .application-preview-value {
    background: #fff7ed;
    color: #b45309;
  }

  .application-preview-row.highlight .application-preview-label {
    background: var(--theme-primary-soft);
    color: var(--theme-primary-active);
  }

  .application-preview-row.highlight .application-preview-value {
    background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.08);
    color: var(--theme-primary-active);
    font-weight: 780;
  }

  .application-preview-row.highlight.missing .application-preview-value {
    background: #fff7ed;
    color: #b45309;
  }

.application-preview-text {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.application-preview-edit-btn {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.application-preview-edit-btn i {
  font-size: 14px;
}

.application-preview-row:hover .application-preview-edit-btn,
.application-preview-edit-btn:focus-visible {
  opacity: 1;
}

.application-preview-edit-btn:hover:not(:disabled),
.application-preview-edit-btn:focus-visible {
  border-color: #bfdbfe;
  background: #dbeafe;
}

.application-preview-edit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.application-preview-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  padding: 0 9px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.application-preview-select {
  cursor: pointer;
  appearance: auto;
}

.message-answer-markdown :deep(ul),
.message-answer-markdown :deep(ol) {
  margin: 0;
  padding-left: 20px;
}

.message-answer-markdown :deep(strong) {
  color: #0f172a;
}

.message-answer-markdown :deep(blockquote) {
  padding: 8px 10px;
  border-left: 3px solid #cbd5e1;
  border-radius: 0 4px 4px 0;
  background: rgba(248, 250, 252, 0.84);
  color: #475569;
}

.message-answer-markdown :deep(.markdown-attachment-card) {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid #dbe4ee;
  border-left: 4px solid #2563eb;
  border-radius: 4px;
  background: #f8fafc;
  color: #334155;
}

.message-answer-markdown :deep(.markdown-attachment-card + .markdown-attachment-card) {
  margin-top: 12px;
}

.message-answer-markdown :deep(.markdown-attachment-card p) {
  margin: 0;
}

.message-answer-markdown :deep(.markdown-attachment-card p:first-child) {
  color: #0f172a;
  font-weight: 820;
}

.message-answer-markdown :deep(.markdown-attachment-card ul) {
  margin-top: 8px;
  padding-left: 18px;
}

.message-answer-markdown :deep(.markdown-attachment-card li + li) {
  margin-top: 4px;
}

.message-answer-markdown :deep(code) {
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  font-size: 12px;
}

.message-answer-markdown :deep(pre) {
  overflow-x: auto;
  padding: 12px;
  border-radius: 4px;
  background: #0f172a;
  color: #e2e8f0;
}

.message-answer-markdown :deep(pre code) {
  padding: 0;
  background: transparent;
  color: inherit;
}

.message-answer-markdown :deep(a) {
  color: #2563eb;
  text-decoration: underline;
}

.message-answer-markdown :deep(.markdown-action-paragraph) {
  margin-top: 34px;
  color: #475569;
}

.message-answer-markdown :deep(.markdown-action-link) {
  color: #2563eb;
  font-weight: 850;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.message-answer-markdown :deep(.markdown-action-link:hover) {
  color: #1d4ed8;
}

.message-answer-markdown :deep(.markdown-action-link-next),
.message-answer-markdown :deep(.markdown-action-link-edit) {
  color: #1d4ed8;
}

.message-answer-markdown :deep(.markdown-risk-text-low) {
  color: #2563eb;
  font-weight: 850;
}

.message-answer-markdown :deep(.markdown-risk-text-medium) {
  color: #d97706;
  font-weight: 850;
}

.message-answer-markdown :deep(.markdown-risk-text-high) {
  color: #dc2626;
  font-weight: 850;
}

.message-answer-markdown :deep(.markdown-table-wrap) {
  width: 100%;
  max-width: 100%;
  margin: 8px 0 10px;
  overflow-x: auto;
  border: 1px solid #dbe4ee;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.message-answer-markdown :deep(table) {
  width: 100%;
  min-width: 460px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: inherit;
}

.message-answer-markdown :deep(th),
.message-answer-markdown :deep(td) {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.message-answer-markdown :deep(th) {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 760;
  border-bottom-color: #cbd5e1;
}

.message-answer-markdown :deep(td) {
  color: #334155;
  font-weight: 520;
}

.message-answer-markdown :deep(tbody tr:nth-child(even) td) {
  background: #fbfdff;
}

.message-answer-markdown :deep(tbody tr:last-child td) {
  border-bottom: 0;
}

.message-suggested-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.message-suggested-action-btn {
  position: relative;
  min-height: 70px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 12px 11px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.message-suggested-action-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--theme-primary-active);
  font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(var(--theme-primary-rgb), 0.08);
}

.message-suggested-action-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.message-suggested-action-title {
  color: #0f172a;
  font-size: var(--wb-fs-body);
  font-weight: 850;
  line-height: 1.25;
}

.message-suggested-action-btn small {
  color: #64748b;
  font-size: var(--wb-fs-caption);
  font-weight: 650;
  line-height: 1.35;
}

.message-suggested-action-arrow {
  color: #94a3b8;
  font-size: 15px;
  justify-self: end;
  transition: color 0.16s ease, transform 0.16s ease;
}

.message-suggested-action-btn:hover:not(:disabled) {
  border-color: rgba(var(--theme-primary-rgb), 0.42);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
  transform: translateY(-1px);
}

.message-suggested-action-btn:hover:not(:disabled) .message-suggested-action-icon,
.message-suggested-action-btn:focus-visible .message-suggested-action-icon {
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.message-suggested-action-btn:hover:not(:disabled) .message-suggested-action-arrow,
.message-suggested-action-btn:focus-visible .message-suggested-action-arrow {
  color: var(--theme-primary-active);
  transform: translateX(2px);
}

.message-suggested-action-btn:focus-visible {
  outline: 3px solid var(--theme-focus-ring);
  outline-offset: 2px;
  border-color: var(--theme-primary);
}

.message-suggested-action-btn.selected {
  border-color: rgba(var(--theme-primary-rgb), 0.52);
  background: var(--theme-primary-light-9);
  box-shadow: inset 0 0 0 1px var(--theme-primary-shadow);
}

.message-suggested-action-btn.selected .message-suggested-action-icon {
  background: var(--theme-primary-soft-strong);
  color: var(--theme-primary-active);
}

.message-suggested-action-btn.selected .message-suggested-action-arrow {
  color: var(--theme-primary-active);
}

.message-suggested-action-btn.locked:not(.selected) {
  background: #f8fafc;
}

.message-suggested-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.message-suggested-action-btn.selected:disabled {
  opacity: 1;
}

.capability-chip,
.risk-chip,
.message-risk-chip,
.message-action-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 4px;
  font-size: var(--wb-fs-chip);
  font-weight: 800;
}

.capability-chip {
  background: #eef6ff;
  color: #1d4ed8;
}

.risk-chip,
.message-risk-chip {
  background: #fff1f2;
  color: #be123c;
}

.message-action-chip {
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.message-detail-block {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.message-detail-block > strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 850;
}

.message-citation-disclosure {
  overflow: hidden;
  border: 1px solid #dbe4ee;
  border-radius: 4px;
  background: #fbfdff;
}

.message-citation-disclosure summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
}

.message-citation-disclosure summary::-webkit-details-marker {
  display: none;
}

.message-citation-disclosure summary strong {
  font-size: 12px;
  font-weight: 850;
}

.message-citation-disclosure summary span {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.message-citation-disclosure summary i {
  margin-left: auto;
  color: #64748b;
  font-size: 16px;
  transition: transform 0.18s ease;
}

.message-citation-disclosure[open] summary {
  border-bottom: 1px solid #e2e8f0;
}

.message-citation-disclosure[open] summary i {
  transform: rotate(180deg);
}

.message-citation-disclosure .message-citation-list {
  padding: 12px;
}

.expense-query-block {
  gap: 10px;
}

.expense-query-window-label {
  margin: -4px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.expense-query-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.expense-query-summary-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  background: #eef2ff;
  color: #3730a3;
}

.expense-query-summary-chip.draft {
  background: #fef3c7;
  color: #b45309;
}

.expense-query-summary-chip.in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.expense-query-summary-chip.completed {
  background: var(--success-soft);
  color: var(--success);
}

.expense-query-summary-chip.other {
  background: #f1f5f9;
  color: #475569;
}

.expense-query-record-list {
  display: grid;
  gap: 8px;
}

.expense-query-record-list.compact .expense-query-record-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe4ee;
  border-radius: 4px;
  background: #fbfdff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.expense-query-record-list.compact .expense-query-record-card:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
}

.expense-query-record-list.compact .expense-query-record-card.selectable {
  border-color: rgba(20, 184, 166, 0.35);
  background: #ffffff;
}

.expense-query-record-list.compact .expense-query-record-card.selected {
  border-color: rgba(13, 148, 136, 0.82);
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.18);
}

.expense-query-record-list.compact .expense-query-record-card.locked:not(.selected) {
  background: #f8fafc;
  opacity: 0.58;
}

.expense-query-record-list.compact .expense-query-record-card:disabled {
  cursor: not-allowed;
  transform: none;
}

.expense-query-record-card > i {
  color: #94a3b8;
  font-size: 16px;
}

.expense-query-record-main {
  min-width: 0;
  display: grid;
  gap: 5px;
  flex: 1;
}

.expense-query-record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.expense-query-record-top strong {
  min-width: 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 850;
}

.expense-query-record-top strong,
.expense-query-record-card p,
.expense-query-record-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-query-record-status {
  flex-shrink: 0;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  background: #f1f5f9;
  color: #475569;
}

.expense-query-record-status.draft {
  background: #fef3c7;
  color: #b45309;
}

.expense-query-record-status.in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.expense-query-record-status.completed {
  background: var(--success-soft);
  color: var(--success);
}

.expense-query-record-card p {
  margin: 0;
  color: #334155;
  font-size: 12px;
}

.expense-query-record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.expense-query-risk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.expense-query-risk-chip {
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid #fecaca;
  border-radius: 4px;
  background: #fff7ed;
  color: #9a3412;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.expense-query-risk-chip span,
.expense-query-risk-chip em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-query-risk-chip span {
  max-width: 86px;
  color: #7c2d12;
}

.expense-query-risk-chip strong {
  flex-shrink: 0;
  font-weight: 850;
}

.expense-query-risk-chip em {
  max-width: 120px;
  font-style: normal;
}

.expense-query-risk-chip.high {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.expense-query-risk-chip.medium,
.expense-query-risk-chip.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.expense-query-risk-chip.low,
.expense-query-risk-chip.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.expense-query-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.expense-query-pager-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe4ee;
  border-radius: 4px;
  background: #fff;
  color: #475569;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.expense-query-pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.expense-query-pager-btn:not(:disabled):hover {
  border-color: #bfdbfe;
  color: #2563eb;
  background: #f8fbff;
}

.expense-query-pager-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.expense-query-pager-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: transform 0.2s ease, background 0.2s ease;
}

.expense-query-pager-dot.active {
  background: #2563eb;
  transform: scale(1.15);
}

.expense-query-empty {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px dashed #dbe4ee;
  border-radius: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.expense-query-empty i {
  font-size: 18px;
  color: #94a3b8;
}

.expense-query-hint {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
}

.message-detail-chip-row,
.capability-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-citation-list,
.citation-stack,
.action-list {
  display: grid;
  gap: 10px;
}

.message-citation-card,
.citation-card,
.action-card {
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fbff;
}

.message-citation-card header,
.citation-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.message-citation-card header span,
.citation-card header strong,
.action-card strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}

.message-citation-card header small,
.citation-card header span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.message-citation-card p,
.citation-card p,
.action-card p,
.draft-preview pre {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.65;
}

.draft-preview {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #dbe3ec;
  border-radius: 4px;
  background: #ffffff;
}

.draft-preview header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.draft-preview header strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}

.draft-preview header span {
  color: #b45309;
  font-size: 12px;
  font-weight: 800;
}

.draft-preview pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.message-files {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.file-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  max-width: 100%;
}

.file-chip.active {
  background: #eef6ff;
  color: #2563eb;
}

.composer {
  padding: 0 18px 18px;
  display: grid;
  gap: 12px;
  position: sticky;
  bottom: 0;
  z-index: 20;
  flex: 0 0 auto;
  flex-shrink: 0;
  background: #ffffff;
  box-shadow: 0 -10px 22px rgba(248, 250, 252, 0.92);
}

.hidden-file-input {
  display: none;
}

.composer-row {
  --composer-control-size: 44px;
}

.composer-leading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.composer-date-anchor {
  position: relative;
}

.travel-calculator-anchor {
  position: relative;
}

.tool-btn.composer-side-btn.active {
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.42);
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
  box-shadow: 0 6px 14px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.14);
}

.composer-date-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 30;
  width: min(320px, calc(100vw - 48px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.16),
    0 4px 12px rgba(15, 23, 42, 0.06);
}

.travel-calculator-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 30;
  width: min(300px, calc(100vw - 48px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.16),
    0 4px 12px rgba(15, 23, 42, 0.06);
}

.travel-calculator-mini-head {
  display: grid;
  gap: 3px;
}

.travel-calculator-mini-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.message-row-reveal-enter-active {
  transition: opacity 300ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 350ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.message-row-reveal-enter-from {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
}

.message-row-reveal-enter-to {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.message-row-reveal-leave-active {
  transition: opacity 200ms ease, transform 200ms ease;
  position: absolute;
  width: 100%;
}

.message-row-reveal-leave-from {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.message-row-reveal-leave-to {
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
}

.message-row-reveal-move {
  transition: transform 350ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
