.diff-result {
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.6),
    rgba(10, 12, 15, 0.6)
  );
  border: 1px solid rgba(148, 163, 184, 0.06);
  padding: 0.75rem;
  border-radius: 0.75rem;
  color: #e6edf3;
}
.diff-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  align-items: start;
}
.diff-row + .diff-row {
  border-top: 1px dashed rgba(148, 163, 184, 0.04);
}
.line-num {
  width: 2rem;
  color: #94a3b8;
  font-size: 12px;
  text-align: right;
  padding-right: 0.5rem;
}
.same {
  background: transparent;
}
.diff-left {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.06), transparent);
}
.diff-right {
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.06));
}
.diff-cell {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0.15rem 0.5rem;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size: 13px;
}
.diff-legend {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.diff-legend .legend-item {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 13px;
  color: #94a3b8;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.legend-swatch.added {
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.15));
}
.token {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 2px;
}
.token.same {
  background: transparent;
  color: inherit;
}
.token.added {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.14);
  color: #9ef0c9;
}
.token.removed {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.12);
  color: #ffd4d4;
}
.merged-view {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4), transparent);
  padding: 0.6rem;
  border-radius: 0.6rem;
}
.merged-line {
  padding: 0.25rem 0;
}
.placeholder {
  opacity: 0.25;
  font-style: italic;
}
.legend-swatch.removed {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.15), transparent);
}

/* Light mode overrides */
.light .diff-result {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}
.light .merged-view {
  background: #f8fafc;
}
.light .diff-row + .diff-row {
  border-top-color: rgba(15, 23, 42, 0.06);
}
.light .line-num {
  color: #475569;
}
.light .diff-legend .legend-item {
  color: #475569;
}
.light .token.added {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.14);
  color: #065f46;
}
.light .token.removed {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.12);
  color: #7f1d1d;
}
.light .placeholder {
  color: rgba(15, 23, 42, 0.45);
}

/* Mobile adjustments for Diff Checker UI */
@media (max-width: 640px) {
  body[data-tool-slug="diff-checker"] .diff-inputs {
    grid-template-columns: 1fr !important;
  }
  body[data-tool-slug="diff-checker"] .diff-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  body[data-tool-slug="diff-checker"] .diff-controls .chip-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.7rem;
    border-radius: 0.6rem;
  }
  body[data-tool-slug="diff-checker"] .diff-controls .chip-btn:last-child {
    margin-bottom: 0;
  }
  body[data-tool-slug="diff-checker"] .diff-controls > div[style] {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  body[data-tool-slug="diff-checker"] .diff-result {
    font-size: 0.95rem;
  }
  body[data-tool-slug="diff-checker"] textarea.more-tools__search {
    min-height: 140px;
  }
  /* Actions row layout */
  .actions-row { display:flex; gap:0.6rem; flex-wrap:wrap; align-items:center; }
  .actions-row .chip-btn { padding:0.5rem 1rem; font-size:0.85rem; }
  .actions-row .back-home { border-radius:0.6rem; }
}

@media (max-width:640px) {
  .actions-row .chip-btn { flex: 1 1 45%; }
  .actions-row .back-home { flex: 1 1 100%; }
}

  /* Center Back to Home content like other buttons */
  .actions-row .back-home {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  @media (max-width:640px) {
    .actions-row .back-home { padding-left: 1rem; padding-right: 1rem; }
  }

