/*
  PORQUE EXISTE: visual do card de diff = Cursor (header + faixa + gutter + código).
  Preview SEMPRE visível (min-height) — sem mask que engolia o corpo.
*/
.chat-conversa .tool-card,
.chat-conversa .ui-tool-call-card {
  box-sizing: border-box;
  width: 100%;
  flex: 0 0 auto;
  margin: 6px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #252020;
  overflow: hidden;
  font-size: 12px;
  color: #d4d4d4;
}

.chat-conversa .tool-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #2e2424;
  cursor: pointer;
}

.chat-conversa .file-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fonte-mono, Consolas, monospace);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  background: #dcdcaa;
  color: #1e1e1e;
}
.chat-conversa .file-icon.js,
.chat-conversa .file-icon.ts { background: #dcdcaa; }
.chat-conversa .file-icon.css { background: #563d7c; color: #fff; }
.chat-conversa .file-icon.html { background: #ce9178; color: #1e1e1e; }
.chat-conversa .file-icon.py { background: #3572a5; color: #ffd43b; }

.chat-conversa .file-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 13px;
  color: #ece8e4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-conversa .diff-stats { display: flex; gap: 7px; font-weight: 700; }
.chat-conversa .diff-stats .add { color: #89d185; }
.chat-conversa .diff-stats .del { color: #f14c4c; }

/* Preview obrigatório — nunca “só header” */
.chat-conversa .tool-card-body {
  display: block;
  background: #141010;
  min-height: 100px;
  max-height: 140px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}
.chat-conversa .tool-card-body::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 28px;
  pointer-events: none;
  background: linear-gradient(transparent, #141010);
}
.chat-conversa .tool-card.aberto .tool-card-body {
  min-height: 0;
  max-height: 520px;
  overflow: auto;
}
.chat-conversa .tool-card.aberto .tool-card-body::after { display: none; }

.chat-conversa .tool-card.sem-corpo .tool-card-body { display: none; }

.chat-conversa .ui-default-diff { width: 100%; display: block; }

.chat-conversa .diff-line {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 20px;
  min-height: 20px;
  box-sizing: border-box;
  font-family: var(--fonte-mono, Consolas, "Courier New", monospace);
  font-size: 12px;
  line-height: 20px;
}

.chat-conversa .diff-strip {
  width: 3px;
  flex: 0 0 3px;
  background: transparent;
}
.chat-conversa .diff-line.mais .diff-strip,
.chat-conversa .diff-line[data-type="added"] .diff-strip {
  background: #2ea043;
}
.chat-conversa .diff-line.menos .diff-strip,
.chat-conversa .diff-line[data-type="removed"] .diff-strip {
  background: #da3633;
}

.chat-conversa .diff-gutter {
  display: flex;
  flex: 0 0 calc(4ch + 16px);
  width: calc(4ch + 16px);
  user-select: none;
}
.chat-conversa .diff-ln {
  width: 4ch;
  text-align: right;
  padding-right: 2px;
  color: rgba(255, 255, 255, 0.32);
  font-size: 11px;
  line-height: 20px;
}
.chat-conversa .diff-sign {
  width: 16px;
  text-align: center;
  font-weight: 700;
  color: transparent;
  line-height: 20px;
}
.chat-conversa .diff-line.mais .diff-sign { color: #89d185; }
.chat-conversa .diff-line.menos .diff-sign { color: #f14c4c; }

.chat-conversa .diff-code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 10px;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #d4d4d4;
  line-height: 20px;
}

.chat-conversa .diff-line.mais,
.chat-conversa .diff-line[data-type="added"] {
  background: rgba(46, 160, 67, 0.32);
}
.chat-conversa .diff-line.menos,
.chat-conversa .diff-line[data-type="removed"] {
  background: rgba(248, 81, 73, 0.32);
}
.chat-conversa .diff-line.igual .diff-code {
  color: rgba(212, 212, 212, 0.55);
}

.chat-conversa .tok-kw { color: #c586c0; }
.chat-conversa .tok-fn { color: #dcdcaa; }
.chat-conversa .tok-str { color: #ce9178; }
.chat-conversa .tok-comment { color: #6a9955; font-style: italic; }

.chat-conversa .tool-card-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 22px;
  border: 0;
  cursor: pointer;
  background: #252020;
  color: rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.chat-conversa .tool-card-expand:hover {
  color: #fff;
  background: #2e2424;
}
.chat-conversa .tool-card.aberto .tool-card-expand svg {
  transform: rotate(180deg);
}
.chat-conversa .tool-card.sem-corpo .tool-card-expand { display: none; }
