/* ============================================================
   diff checker - layers on /assets/site.css tokens
   palette stays on-brand: additions = yellow highlight,
   deletions = struck-through gray. No off-palette red/green.
   ============================================================ */

/* ---------- toolbar ---------- */
.dc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* segmented view switch */
.dc-seg {
  display: inline-flex;
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: 2px 2px 0 var(--ink);
}
.dc-seg button {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 7px 12px;
  border: none;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.dc-seg button + button { border-left: 2px solid var(--ink); }
.dc-seg button.on { background: var(--yellow); }

/* toggle chips (ignore whitespace / case / format json) */
.dc-checks { display: flex; gap: 8px; flex-wrap: wrap; }
.dc-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.dc-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.dc-chip .box {
  width: 13px; height: 13px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--bg);
  display: inline-block;
  position: relative;
  flex: none;
}
.dc-chip input:checked + .box { background: var(--yellow); }
.dc-chip input:checked + .box::after {
  content: "";
  position: absolute;
  left: 3px; top: 0;
  width: 3px; height: 7px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.dc-chip input:focus-visible + .box { box-shadow: 0 0 0 2px var(--yellow-deep); }

.dc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.dc-actions .btn { font-size: 13px; padding: 8px 13px; }

/* ---------- input panes ---------- */
.dc-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.dc-pane { display: flex; flex-direction: column; gap: 6px; }
.dc-pane-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  font-weight: 700;
}
.dc-input {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 14px;
  box-sizing: border-box;
  white-space: pre;
  tab-size: 2;
}
.dc-input:focus { outline: none; box-shadow: 5px 5px 0 var(--yellow-deep); }

/* ---------- result header ---------- */
.dc-resulthead {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.dc-stats {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  gap: 12px;
  align-items: center;
}
.dc-stats .add { background: var(--yellow); padding: 2px 7px; border: 1.5px solid var(--ink); border-radius: 999px; }
.dc-stats .del { background: var(--bg-soft); padding: 2px 7px; border: 1.5px solid var(--ink); border-radius: 999px; text-decoration: line-through; color: var(--ink-mute); }
.dc-stats .same { color: var(--ink-dim); font-weight: 400; }

/* ---------- output ---------- */
.dc-output {
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--bg);
  overflow: auto;
  max-height: 640px;
}
.dc-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* shared diff typography */
.dc-diff {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  border-collapse: collapse;
  width: 100%;
}
.dc-diff td { vertical-align: top; padding: 0; }
.dc-ln {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding: 1px 10px 1px 12px;
  color: var(--ink-dim);
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.dc-sign {
  width: 1%;
  text-align: center;
  padding: 1px 6px;
  color: var(--ink-mute);
  user-select: none;
  font-weight: 700;
}
.dc-code {
  padding: 1px 12px 1px 8px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* cell backgrounds (on-palette). cell-level so a changed row can show
   "removed" on the left half and "added" on the right half at once. */
.dc-code.c-add { background: var(--yellow-wash); }
.dc-code.c-del { background: var(--bg-soft); color: var(--ink-mute); }
.dc-code.empty,
.dc-ln.empty { background: repeating-linear-gradient(45deg, #fbfbf8, #fbfbf8 6px, #f1f1ec 6px, #f1f1ec 12px); }

/* unified view colors the whole row by its single type */
.dc-uni tr.add td.dc-code, .dc-uni tr.add td.dc-sign { background: var(--yellow-wash); }
.dc-uni tr.add td.dc-sign { color: var(--ink); }
.dc-uni tr.del td.dc-code, .dc-uni tr.del td.dc-sign { background: var(--bg-soft); }
.dc-uni tr.del td.dc-code { color: var(--ink-mute); }

/* intra-line marks */
.dc-code ins { background: var(--yellow); text-decoration: none; border-radius: 2px; padding: 0 1px; }
.dc-code del { background: #ededea; text-decoration: line-through; color: var(--ink-dim); border-radius: 2px; padding: 0 1px; }

/* side-by-side has a divider between the two halves */
.dc-sbs td.dc-mid { border-left: 2px solid var(--ink); }

/* privacy / share note */
.dc-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  margin: 10px 0 0;
  max-width: 720px;
  line-height: 1.5;
}
.dc-note.warn { color: #8a5a00; font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .dc-panes { grid-template-columns: 1fr; }
  .dc-actions { margin-left: 0; width: 100%; }
  .dc-actions .btn { flex: 1; justify-content: center; }
  .dc-input { box-shadow: 3px 3px 0 var(--ink); }
  /* on narrow screens the side-by-side view is cramped; it still scrolls horizontally */
  .dc-diff { font-size: 12px; }
}
