@import "./travel-reimbursement-message-application.css";

.message-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.message-row.user {
  grid-template-columns: minmax(0, 1fr) 38px;
}

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

.message-row.user .message-bubble {
  order: 1;
  justify-self: end;
  background: linear-gradient(135deg, #eaf3ff, #f7fbff);
  border-color: rgba(96, 165, 250, 0.3);
}

.message-stack {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 8px;
}

.message-row.has-steward-plan .message-stack {
  width: min(100%, 760px);
}

.message-row.user .message-stack {
  order: 1;
  justify-items: end;
}

.message-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  overflow: hidden;
  background: #eff6ff;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.22);
}

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

.message-bubble-compact-guidance {
  max-width: min(100%, 640px);
  padding: 10px 12px;
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
}

.message-bubble-compact-guidance .message-meta {
  margin-bottom: 6px;
}

.message-bubble-compact-guidance .message-meta strong {
  font-size: 12px;
}

.message-bubble-compact-guidance .message-answer-content {
  font-size: 12px;
}

.message-bubble-compact-guidance .message-answer-markdown {
  display: grid;
  gap: 6px;
}

.message-bubble-compact-guidance .message-answer-markdown :deep(h3) {
  margin: 0;
  padding-left: 8px;
  border-left: 3px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.42);
  color: #17324a;
  font-size: 12px;
  font-weight: 860;
  line-height: 1.4;
}

.message-bubble-compact-guidance .message-answer-markdown :deep(ul),
.message-bubble-compact-guidance .message-answer-markdown :deep(ol) {
  gap: 4px;
}

.message-bubble-compact-guidance .message-answer-markdown :deep(li) {
  line-height: 1.55;
}

.message-bubble-compact-guidance .message-suggested-actions {
  margin-top: 8px;
}

.message-row.has-steward-plan .message-bubble {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.steward-intent-bubble {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c9ddea;
  border-radius: 4px;
  background: #eef6fb;
  color: #1f3f5b;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
}

.steward-intent-bubble[open] {
  background: #f3f9fd;
}

.steward-intent-bubble summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}

.steward-intent-bubble summary::-webkit-details-marker {
  display: none;
}

.steward-intent-bubble summary > span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #234a68;
  font-size: 12px;
  font-weight: 820;
}

.steward-intent-bubble summary > span i {
  color: #3a7ca5;
  font-size: 14px;
}

.steward-intent-bubble summary small {
  margin-left: auto;
  color: #6f8295;
  font-size: 12px;
  font-weight: 720;
}

.steward-intent-bubble summary > i {
  color: #64748b;
  transition: transform 180ms ease;
}

.steward-intent-bubble[open] summary > i {
  transform: rotate(180deg);
}

.steward-intent-event-list {
  margin: 0;
  padding: 0 12px 12px 44px;
  display: grid;
  gap: 7px;
}

.steward-intent-event-list li strong {
  display: block;
  color: #274b68;
  font-size: 12px;
  font-weight: 820;
}

.steward-intent-event-list li span {
  display: block;
  margin-top: 2px;
  color: #5c7185;
  font-size: 12px;
  line-height: 1.55;
}

.steward-intent-event-list li span.typing::after {
  content: "";
  width: 5px;
  height: 12px;
  display: inline-block;
  margin-left: 3px;
  vertical-align: -2px;
  background: #3a7ca5;
  animation: steward-plan-caret 900ms steps(1, end) infinite;
}

.steward-intent-empty {
  margin: 0;
  padding: 0 12px 12px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

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

.message-bubble-budget-report {
  max-width: min(100%, 1080px);
}

.message-action-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: -2px;
  color: #728197;
}

.message-action-btn {
  width: 30px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.message-action-btn i {
  font-size: 18px;
  line-height: 1;
}

.message-action-btn:hover,
.message-action-btn:focus-visible {
  color: #245f90;
  background: #eef6fb;
  border-color: #c9ddea;
  outline: none;
}

.message-action-btn.active {
  color: #1d6f9f;
  background: #e8f4fb;
  border-color: #bcd8e8;
}

.message-action-btn:disabled {
  cursor: not-allowed;
  color: #b7c2cf;
  background: transparent;
  border-color: transparent;
}

.message-bubble-review-risk-low,
.message-bubble-review-risk-medium,
.message-bubble-review-risk-high {
  background: #ffffff;
}

.message-bubble-review-risk-low {
  border-color: rgba(37, 99, 235, 0.56);
}

.message-bubble-review-risk-medium {
  border-color: rgba(217, 119, 6, 0.58);
}

.message-bubble-review-risk-high {
  border-color: rgba(220, 38, 38, 0.58);
}

.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, 12px);
  font-weight: 800;
}

.message-meta time {
  color: #64748b;
  font-size: var(--wb-fs-bubble-time, 11px);
  font-weight: 700;
}

.message-answer-content {
  color: #24324a;
}

.message-answer-markdown {
  display: grid;
  gap: 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.message-answer-markdown :deep(h1),
.message-answer-markdown :deep(h2),
.message-answer-markdown :deep(h3),
.message-answer-markdown :deep(h4) {
  margin: 0;
  color: #0f172a;
  line-height: 1.35;
}

.message-answer-markdown :deep(h1) {
  font-size: 15px;
  font-weight: 860;
}

.message-answer-markdown :deep(h2) {
  font-size: 14px;
  font-weight: 850;
}

.message-answer-markdown :deep(h3) {
  font-size: 13px;
  font-weight: 840;
}

.message-answer-markdown :deep(h4) {
  font-size: 12px;
  font-weight: 820;
}

.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) {
  margin: 0;
  color: inherit;
  line-height: 1.6;
}

.message-answer-markdown :deep(p + p),
.message-answer-markdown :deep(p + ul),
.message-answer-markdown :deep(p + ol),
.message-answer-markdown :deep(ul + p),
.message-answer-markdown :deep(ol + p),
.message-answer-markdown :deep(blockquote + p) {
  margin-top: 8px;
}

.message-answer-markdown :deep(ul),
.message-answer-markdown :deep(ol) {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 6px;
}

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

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

.message-answer-markdown :deep(blockquote) {
  padding: 8px 10px;
  border-left: 3px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.38);
  border-radius: 4px;
  background: #f8fbff;
  color: #475569;
}

.message-answer-markdown :deep(code) {
  padding: 0 5px;
  border-radius: 4px;
  background: #eef6fb;
  color: #1d4ed8;
  font-size: 0.95em;
}

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

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

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

.steward-plan-markdown {
  display: block;
}

.steward-plan-markdown :deep(h2) {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe4ee;
  color: #0f172a;
  font-size: 15px;
  font-weight: 860;
  line-height: 1.42;
}

.steward-plan-markdown :deep(hr) {
  margin: 10px 0 14px;
  border: 0;
  border-top: 1px solid #e2e8f0;
}

.steward-plan-markdown :deep(h3) {
  margin: 16px 0 8px;
  padding-left: 8px;
  border-left: 3px solid var(--theme-primary, #3a7ca5);
  color: #183247;
  font-size: 13px;
  font-weight: 840;
  line-height: 1.45;
}

.steward-plan-markdown :deep(h3:first-child) {
  margin-top: 0;
}

.steward-plan-markdown :deep(p) {
  margin: 0 0 10px;
  color: #334155;
  line-height: 1.72;
}

.steward-plan-markdown :deep(ul) {
  margin: 0 0 12px;
  padding-left: 18px;
  display: grid;
  gap: 7px;
}

.steward-plan-markdown :deep(li) {
  margin: 0;
  color: #334155;
  line-height: 1.65;
}

.steward-plan-typing::after {
  content: "";
  width: 6px;
  height: 15px;
  display: inline-block;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--theme-primary, #3a7ca5);
  animation: steward-plan-caret 900ms steps(1, end) infinite;
}

@keyframes steward-plan-caret {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

.steward-plan-block {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.steward-task-list,
.steward-attachment-list {
  display: grid;
  gap: 10px;
}

.steward-task-card,
.steward-attachment-card {
  padding: 12px;
  border: 1px solid #dbe7f2;
  border-radius: 4px;
  background: #f8fbfe;
}

.steward-task-header,
.steward-attachment-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.steward-task-type,
.steward-attachment-card header span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #c7deef;
  border-radius: 4px;
  background: #eef7fc;
  color: #24618a;
  font-size: 12px;
  font-weight: 780;
}

.steward-task-agent,
.steward-attachment-card header small {
  color: #64748b;
  font-size: 12px;
  font-weight: 720;
}

.steward-task-body {
  display: grid;
  gap: 5px;
}

.steward-task-title {
  display: block;
  color: #172a3a;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.steward-task-summary,
.steward-attachment-card p {
  margin: 0;
  color: #5c7185;
  font-size: 12px;
  line-height: 1.62;
}

.steward-task-meta,
.steward-attachment-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.steward-task-meta span,
.steward-attachment-chip {
  border: 1px solid #d5e2ee;
  border-radius: 4px;
  background: #ffffff;
  color: #49677f;
  font-size: 12px;
  line-height: 1.4;
  padding: 3px 7px;
}

.steward-task-missing {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d5e2ee;
  display: grid;
  gap: 8px;
}

.steward-task-missing-label {
  color: #425c72;
  font-size: 12px;
  font-weight: 820;
}

.steward-task-missing-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steward-task-missing-list li {
  display: grid;
  grid-template-columns: minmax(86px, 120px) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e1e8f0;
  border-radius: 4px;
  background: #ffffff;
}

.steward-task-missing-list strong {
  color: #1f3448;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.45;
}

.steward-task-missing-list small {
  color: #6b7f92;
  font-size: 12px;
  line-height: 1.45;
}

.steward-attachment-chip.include {
  border-color: #c7deef;
  background: #eef7fc;
  color: #24618a;
}

.steward-attachment-chip.exclude {
  border-color: #ecd6c4;
  background: #fff8f2;
  color: #8a5a24;
}

.message-answer-markdown :deep(.markdown-table-wrap) {
  width: 100%;
  max-width: 100%;
  margin: 10px 0 12px;
  overflow-x: auto;
  border: 1px solid #dbe4ee;
  border-radius: 4px;
  background: #ffffff;
  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: #ffffff;
  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;
}

.welcome-quick-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.welcome-quick-actions-title {
  margin: 0 0 12px;
  color: #64748b;
  font-size: var(--wb-fs-chip, 12px);
  font-weight: 750;
}

.welcome-quick-action-grid,
.message-suggested-actions,
.message-detail-chip-row,
.message-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.welcome-quick-action-btn,
.message-suggested-action-btn,
.review-footer-btn,
.expense-query-record-card,
.expense-query-risk-chip {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font: inherit;
}

.welcome-quick-action-btn,
.review-footer-btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: var(--wb-fs-chip, 12px);
  font-weight: 750;
}

.welcome-quick-action-btn i {
  color: var(--theme-primary, #3a7ca5);
  font-size: 15px;
}

.welcome-quick-action-btn:hover:not(:disabled),
.message-suggested-action-btn:hover:not(:disabled),
.review-footer-btn:hover:not(:disabled) {
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.55);
  background: var(--theme-primary-soft, #eaf4fa);
  color: var(--theme-primary-active, #2f6d95);
}

.message-risk-chip,
.file-chip {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 750;
}

.message-suggested-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  grid-auto-rows: 1fr;
  gap: 8px;
}

.message-bubble-compact-guidance .message-suggested-actions.compact-guidance-actions {
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 6px;
}

.message-bubble-compact-guidance .message-suggested-actions.compact-guidance-actions .message-suggested-action-btn {
  min-height: 40px;
  padding: 8px 10px;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.18);
  background: #ffffff;
}

.message-bubble-compact-guidance .message-suggested-actions.compact-guidance-actions .message-suggested-action-icon {
  width: 22px;
  height: 22px;
  font-size: 13px;
}

.message-bubble-compact-guidance .message-suggested-actions.compact-guidance-actions .message-suggested-action-copy {
  gap: 0;
}

.message-bubble-compact-guidance .message-suggested-actions.compact-guidance-actions .message-suggested-action-title {
  font-size: 12px;
  line-height: 1.35;
}

.message-bubble-compact-guidance .message-suggested-actions.compact-guidance-actions .message-suggested-action-btn small,
.message-bubble-compact-guidance .message-suggested-actions.compact-guidance-actions .message-suggested-action-arrow {
  display: none;
}

.structured-card-reveal-enter-active {
  transition:
    opacity 220ms cubic-bezier(0.2, 0, 0, 1),
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    clip-path 240ms cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top left;
  will-change: opacity, transform, clip-path;
}

.structured-card-reveal-leave-active {
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  transform-origin: top left;
}

.structured-card-reveal-enter-from {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  clip-path: inset(0 0 14px 0);
}

.structured-card-reveal-enter-to {
  opacity: 1;
  transform: translateY(0) scale(1);
  clip-path: inset(0 0 0 0);
}

.structured-card-reveal-leave-from {
  opacity: 1;
  transform: translateY(0);
}

.structured-card-reveal-leave-to {
  opacity: 0;
  transform: translateY(4px);
}

.message-suggested-action-btn {
  height: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 4px;
  text-align: left;
}

.structured-card-reveal-enter-active .message-suggested-action-btn {
  animation: structured-card-item-reveal 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.structured-card-reveal-enter-active .message-suggested-action-btn:nth-child(2) {
  animation-delay: 45ms;
}

.structured-card-reveal-enter-active .message-suggested-action-btn:nth-child(3) {
  animation-delay: 90ms;
}

.structured-card-reveal-enter-active .message-suggested-action-btn:nth-child(n + 4) {
  animation-delay: 120ms;
}

.message-suggested-action-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #eff6ff;
  color: var(--theme-primary, #3a7ca5);
}

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

.message-suggested-action-title {
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.message-suggested-action-btn small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.message-detail-block,
.draft-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fbff;
}

.message-detail-block > strong,
.expense-query-block > strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 850;
}

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

.application-preview-shell {
  min-width: 0;
  display: grid;
}

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

.structured-card-reveal-enter-active .application-preview-row {
  animation: structured-card-item-reveal 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.structured-card-reveal-enter-active .application-preview-row:nth-child(2) {
  animation-delay: 35ms;
}

.structured-card-reveal-enter-active .application-preview-row:nth-child(3) {
  animation-delay: 70ms;
}

.structured-card-reveal-enter-active .application-preview-row:nth-child(4) {
  animation-delay: 105ms;
}

.structured-card-reveal-enter-active .application-preview-row:nth-child(5) {
  animation-delay: 140ms;
}

.structured-card-reveal-enter-active .application-preview-row:nth-child(n + 6) {
  animation-delay: 165ms;
}

.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-label {
  background: color-mix(in srgb, var(--theme-primary-soft, #eaf4fa) 82%, #ffffff);
}

.application-preview-row.editable.missing:hover .application-preview-value {
  background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.09);
}

.application-preview-row.editable:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 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, 12px);
  font-weight: 850;
}

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

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

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

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

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

.application-preview-row.missing {
  background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.035);
  box-shadow: inset 3px 0 0 rgba(var(--theme-primary-rgb, 58, 124, 165), 0.42);
}

.application-preview-row.missing .application-preview-label {
  background: color-mix(in srgb, var(--theme-primary-soft, #eaf4fa) 76%, #ffffff);
  color: var(--theme-primary-active, #255b7d);
  font-weight: 880;
}

.application-preview-row.missing .application-preview-value {
  background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.07);
  color: #0f172a;
  font-weight: 850;
}

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

.application-preview-input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.48);
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.12);
}

.application-preview-select {
  min-width: 0;
  width: 100%;
  cursor: pointer;
}

.application-preview-edit-btn {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--theme-primary-soft, #eaf4fa);
  color: var(--theme-primary-active, #255b7d);
  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: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.35);
  background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.14);
}

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

.application-preview-footer {
  margin-top: 48px;
  color: #334155;
  font-size: var(--wb-fs-bubble, 13px);
  font-weight: 760;
  line-height: 1.7;
}

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

.application-preview-decision-status {
  margin-top: 28px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.6;
}

.application-preview-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.application-preview-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.3);
  border-radius: 8px;
  background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.08);
  color: var(--theme-primary-active, #255b7d);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.application-preview-secondary-btn:hover:not(:disabled),
.application-preview-secondary-btn:focus-visible {
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.52);
  background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.14);
}

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

.message-answer-markdown :deep(a) {
  color: var(--theme-primary-active, #255b7d);
  font-weight: 850;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.message-answer-markdown :deep(a:hover) {
  color: var(--theme-primary, #3a7ca5);
}

.message-answer-markdown :deep(.markdown-action-link) {
  color: var(--theme-primary-active, #255b7d);
  font-weight: 880;
  text-decoration: underline;
  text-decoration-thickness: 1.6px;
  text-underline-offset: 3px;
}

.application-preview-footer-missing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 6px;
  margin-top: 48px;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.7;
}

.application-preview-missing-prefix,
.application-preview-missing-suffix {
  color: #334155;
  font-weight: 850;
}

.application-preview-missing-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.application-preview-missing-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.1);
  color: var(--theme-primary-active, #255b7d);
  font-weight: 880;
}

.application-preview-missing-separator {
  color: var(--theme-primary-active, #255b7d);
  font-weight: 820;
}

@keyframes structured-card-item-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.expense-query-record-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border-radius: 4px;
  text-align: left;
}

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

.expense-query-record-top,
.expense-query-record-meta,
.expense-query-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.expense-query-record-card p,
.expense-query-record-meta span,
.expense-query-window-label,
.expense-query-hint {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.expense-query-record-status,
.expense-query-summary-chip {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
}

.expense-query-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.review-plain-followup,
.draft-preview {
  display: grid;
  gap: 8px;
}

.review-plain-lead {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
}

.review-plain-summary,
.review-plain-note {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.review-plain-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #334155;
  font-size: 12px;
}

.review-footer-actions {
  margin-top: 10px;
}

.review-footer-btn.primary {
  border-color: var(--theme-primary, #3a7ca5);
  background: var(--theme-primary, #3a7ca5);
  color: #ffffff;
}

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

.draft-preview pre {
  margin: 0;
  overflow: auto;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .message-row,
  .message-row.user {
    grid-template-columns: 1fr;
  }

  .message-avatar {
    display: none;
  }

  .message-row.user .message-bubble {
    justify-self: stretch;
  }

  .message-bubble {
    max-width: 100%;
    border-radius: 4px;
  }

  .steward-task-missing-list li {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .structured-card-reveal-enter-active,
  .structured-card-reveal-leave-active {
    transition: none;
  }

  .structured-card-reveal-enter-active .application-preview-row,
  .structured-card-reveal-enter-active .message-suggested-action-btn {
    animation: none;
  }
}
