:root {
  --accent: #7c3aed;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #b79cff;
    --on-accent: #1b0a40;
  }
}

.diff-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 760px) {
  .diff-inputs {
    grid-template-columns: 1fr 1fr;
  }
}

.options {
  margin: 12px 0;
  padding: 2px 16px;
}

.diff-view {
  margin: 12px 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.diff-lines {
  min-width: 520px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 6px 0;
}

.diff-line {
  display: grid;
  grid-template-columns: 44px 44px 18px 1fr;
  align-items: start;
  gap: 4px;
  padding: 1px 10px 1px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.diff-num {
  color: var(--muted);
  text-align: end;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.diff-sign {
  text-align: center;
  user-select: none;
}

.diff-text {
  min-width: 0;
}

.diff-add {
  background: color-mix(in srgb, var(--success) 14%, transparent);
}
.diff-remove {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.diff-add .diff-sign {
  color: var(--success);
}
.diff-remove .diff-sign {
  color: var(--danger);
}

.diff-text ins,
.diff-inline ins {
  background: color-mix(in srgb, var(--success) 28%, transparent);
  text-decoration: none;
  border-radius: 3px;
}
.diff-text del,
.diff-inline del {
  background: color-mix(in srgb, var(--danger) 24%, transparent);
  text-decoration: line-through;
  border-radius: 3px;
}

.diff-inline {
  padding: 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* color-mix() is supported in current WebKit; keep a readable fallback. */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .diff-add {
    background: rgba(27, 127, 59, 0.14);
  }
  .diff-remove {
    background: rgba(198, 40, 40, 0.12);
  }
  .diff-text ins,
  .diff-inline ins {
    background: rgba(27, 127, 59, 0.28);
  }
  .diff-text del,
  .diff-inline del {
    background: rgba(198, 40, 40, 0.24);
  }
}
