body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.chat-index .chat-list-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-index .chat-list-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.08);
}

.conversation-card {
  min-height: 60vh;
}

.conversation-card .tab-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.chat-pane {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  background-color: var(--bs-body-bg);
  padding-right: 0.25rem;
}

.chat-message {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1rem;
}

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

.chat-bubble {
  max-width: min(75%, 520px);
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background-color: #f8f9fa;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.chat-message.assistant .chat-bubble {
  background-color: #eef4ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.btn.btn-loading {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn.btn-loading::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 0.15em solid currentColor;
  border-top-color: transparent;
  animation: btn-loading-spin 0.75s linear infinite;
}

@keyframes btn-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-message.assistant.pending .chat-bubble {
  background-color: #dde7ff;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
  opacity: 0.95;
}

.chat-message.assistant.pending .chat-message-body {
  font-style: italic;
}

.chat-message.system .chat-bubble {
  background-color: #f5f5f5;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.chat-message.user .chat-bubble {
  background-color: var(--bs-primary);
  color: #fff;
  box-shadow: none;
}

.chat-message.user .chat-message-body {
  color: inherit;
}

.chat-message.user .chat-message-header time {
  color: rgba(255, 255, 255, 0.8);
}

.chat-message.user .chat-message-header .badge {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.chat-message-body {
  white-space: pre-wrap;
}

.chat-message-header .badge {
  text-transform: uppercase;
}

.diff-pane {
  background-color: #0f172a;
  color: #e5e7eb;
  font-family: "Fira Code", "Courier New", Courier, monospace;
  font-size: 0.85rem;
  overflow-y: auto;
  max-height: 45vh;
  padding: 1.5rem;
  border-radius: 0.75rem;
}

.diff-entry + .diff-entry {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1rem;
  padding-top: 1rem;
}

.diff-output {
  background: transparent;
  color: inherit;
  margin: 0;
}

.register-pane,
.audit-pane {
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.register-feed,
.audit-timeline {
  max-height: 45vh;
  overflow-y: auto;
}

.register-feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.register-log-list {
  display: flex;
  flex-direction: column;
}

.register-pane .log-entry,
.audit-pane .log-entry {
  background-color: var(--bs-body-bg);
}

.audit-pane .log-entry--message,
.register-pane .log-entry--message {
  background-color: #f8f9ff;
  border-left: 4px solid var(--bs-primary);
}

.audit-pane .log-entry--message .log-section-title,
.register-pane .log-entry--message .log-section-title {
  letter-spacing: 0.08em;
}

.audit-pane .log-entry--message .log-plan-list,
.register-pane .log-entry--message .log-plan-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.audit-pane .log-entry--message .log-plan-args,
.register-pane .log-entry--message .log-plan-args {
  margin: 0.5rem 0 0;
  padding: 0.5rem;
  font-size: 0.75rem;
  background-color: rgba(13, 110, 253, 0.08);
  border-radius: 0.5rem;
}

.audit-pane .log-entry--console,
.register-pane .log-entry--console {
  background-color: #0d1117;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.25);
}

.audit-pane .log-entry--console .badge,
.register-pane .log-entry--console .badge {
  background-color: rgba(96, 165, 250, 0.3);
  color: #e2e8f0;
}

.audit-pane .log-entry--console .log-console-meta,
.register-pane .log-entry--console .log-console-meta {
  color: #94a3b8 !important;
}

.console-chunk {
  margin-bottom: 1rem;
}

.console-chunk:last-of-type {
  margin-bottom: 0;
}

.console-chunk-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.console-snippet {
  background-color: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin: 0;
  font-family: "Fira Code", "Courier New", Courier, monospace;
  font-size: 0.85rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 20rem;
}

.console-chunk--aggregate .console-snippet {
  background-color: rgba(30, 41, 59, 0.85);
}

.console-command-details .console-chunk {
  margin-bottom: 1rem;
}

.console-command-details .console-chunk:last-of-type {
  margin-bottom: 0;
}

.audit-pane .log-entry--console pre,
.register-pane .log-entry--console pre {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: inherit;
}

.register-pane .log-args summary,
.audit-pane .log-args summary {
  cursor: pointer;
}

.register-pane .log-args pre,
.audit-pane .log-args pre {
  max-height: 12rem;
  overflow: auto;
}

.register-pane .log-extra summary,
.audit-pane .log-extra summary {
  cursor: pointer;
}

.composer textarea {
  resize: vertical;
  min-height: 110px;
}

.composer form.assistant-waiting textarea {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.1);
}

.composer form.assistant-waiting [data-role="send-button"] {
  opacity: 0.9;
}

.diff-metrics span {
  line-height: 1;
}


.chat-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-list-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 992px) {
  .conversation-card {
    min-height: auto;
  }

  .chat-body {
    max-height: 45vh;
  }
}
