.diff-tool {
  display: grid;
  gap: 18px;
}

.diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.diff-panel {
  display: grid;
  gap: 8px;
}

.diff-panel textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.diff-panel textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgb(22 119 255 / 14%);
  outline: none;
}

.utility-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.diff-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.diff-stats div {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.diff-stats dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.diff-stats dd {
  margin: 4px 0 0;
  font-weight: 850;
}

.diff-output {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.diff-cell {
  padding: 2px 10px;
  white-space: pre-wrap;
  word-break: break-word;
  border-bottom: 1px solid var(--border);
}

.diff-output .diff-cell:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.diff-cell.diff-removed {
  background: rgb(179 38 30 / 12%);
  color: var(--danger);
}

.diff-cell.diff-added {
  background: rgb(17 122 84 / 12%);
  color: var(--success);
}

.diff-cell.diff-empty {
  background: var(--surface-soft);
}

@media (max-width: 860px) {
  .diff-grid,
  .diff-stats {
    grid-template-columns: 1fr;
  }

  .utility-row .primary-button,
  .utility-row .action-button {
    width: 100%;
  }
}
