/* theme.css: Prov Diff, "patch-panel bench sheet". Written by the designer (DESIGN.md); loaded after
   styles.css so these rules win. The builder keeps it linked and does not edit it.
   Signature: the cable tag (.src), the source of every value, filled teal on the winner. */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light dark;

  /* Palette, light. Ratios are text-on-background, WCAG 2.x. */
  --bg: #f4f5f2;            /* page */
  --surface: #ffffff;       /* cards */
  --raised: #eceeea;        /* wells, tags, table head */
  --text: #1b2226;          /* 15.9:1 on surface, 14.6:1 on bg */
  --muted: #4f5a60;         /* 7.0:1 on surface, 6.4:1 on bg, 5.9:1 on raised */
  --border: #d5d8d2;        /* hairlines only, never text */
  --border-strong: #8a9397; /* control edges, 3.2:1 on surface */
  --accent: #0f5f6b;        /* white on it 7.3:1 */
  --accent-hover: #0b4d57;
  --accent-active: #083d45;
  --accent-text: #0f5f6b;   /* 7.3:1 on surface, 6.3:1 on accent-tint */
  --accent-tint: #e1eff0;
  --on-accent: #ffffff;
  --success: #2b6a2e;       /* 6.6:1 on surface, 5.8:1 on its tint */
  --success-tint: #e6f2e3;
  --warning: #8a4b00;       /* 6.8:1 on surface, 5.9:1 on its tint */
  --warning-tint: #fbf0dc;
  --danger: #a8261d;        /* 7.0:1 on surface, 6.0:1 on its tint */
  --danger-tint: #fbe9e6;
  --focus-halo: #0f5f6b33;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-label: 13px;
  --fs-small: 15px;
  --fs-body: 17px;
  --fs-lede: 21px;
  --fs-report: 28px;
  --fs-title: clamp(30px, 5vw, 42px);

  /* Space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* Shape */
  --r1: 4px; --r2: 10px; --r3: 16px;
  --shadow-1: 0 1px 2px #1b22260f, 0 2px 8px #1b22260a;
  --shadow-2: 0 8px 28px #1b22261f;

  --t: 160ms cubic-bezier(.2, .7, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111517;
    --surface: #181d20;
    --raised: #20272b;
    --text: #e7eae8;          /* 14.1:1 on surface */
    --muted: #a9b3b7;         /* 8.0:1 on surface, 7.1:1 on raised */
    --border: #2c3539;
    --border-strong: #5f6c72; /* 3.2:1 on surface */
    --accent: #6cc3cc;        /* on-accent on it 8.7:1 */
    --accent-hover: #86d0d8;
    --accent-active: #a0dbe1;
    --accent-text: #7fcdd5;   /* 9.3:1 on surface, 7.4:1 on accent-tint */
    --accent-tint: #15353a;
    --on-accent: #0b1a1d;
    --success: #8fd18a;       /* 9.6:1 on surface, 8.1:1 on its tint */
    --success-tint: #1a2d1c;
    --warning: #f0b45a;       /* 9.3:1 on surface, 7.9:1 on its tint */
    --warning-tint: #33270f;
    --danger: #ff9b8f;        /* 8.5:1 on surface, 7.0:1 on its tint */
    --danger-tint: #3a1d1a;
    --focus-halo: #6cc3cc40;
    --shadow-1: 0 1px 2px #0006;
    --shadow-2: 0 10px 30px #0009;
  }
}

/* ------------------------------------------------------------------ base */
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
header, main, footer { max-width: 72rem; padding-left: var(--s5); padding-right: var(--s5); }
header { border-bottom: 1px solid var(--border); padding-top: var(--s2); padding-bottom: var(--s2); }
.brand {
  display: inline-flex; align-items: center; gap: var(--s3);
  min-height: 44px; line-height: 1.2; font-weight: 700; font-size: var(--fs-body); letter-spacing: -0.01em;
  color: var(--text);
}
.brand::before {
  content: ""; width: 28px; height: 28px; flex: none;
  background: url("icons/favicon.svg") center / contain no-repeat;
}
header nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  border-radius: var(--r1); color: var(--muted); font-weight: 550; text-decoration: none;
  transition: color var(--t), background-color var(--t);
}
header nav a:hover { color: var(--text); background: var(--raised); }

main { padding-top: var(--s6); padding-bottom: var(--s7); }
main > p, main > ul, main > ol, main > h3 { max-width: 68ch; }
h1 {
  font-size: var(--fs-title); line-height: 1.1; letter-spacing: -0.025em; font-weight: 750;
  margin: 0 0 var(--s3); color: var(--text);
}
.lede { font-size: var(--fs-lede); line-height: 1.45; color: var(--muted); max-width: 52ch; margin: 0 0 var(--s6); }
h2 { font-size: var(--fs-lede); line-height: 1.3; letter-spacing: -0.01em; margin: var(--s7) 0 var(--s3); }
h3 { font-size: var(--fs-body); margin: var(--s5) 0 var(--s1); }
main li { margin-bottom: var(--s2); }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--raised); padding: 1px 5px; border-radius: var(--r1); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ buttons */
button { font: inherit; }
.actions button, button.secondary, button.quiet, button.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s4); border-radius: var(--r2);
  font-size: var(--fs-small); font-weight: 600; cursor: pointer;
  transition: background-color var(--t), border-color var(--t), color var(--t), transform var(--t);
}
button.primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:active { background: var(--accent-active); transform: translateY(1px); }
.actions button, button.secondary {
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
}
.actions button:hover, button.secondary:hover { background: var(--raised); border-color: var(--text); }
.actions button:active, button.secondary:active { transform: translateY(1px); }
button.quiet { background: transparent; color: var(--accent-text); border: 1px solid transparent; }
button.quiet:hover { background: var(--accent-tint); }
button.quiet:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* checkboxes, selects, plain inputs (kept consistent if the builder needs one) */
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
label:has(> input[type="checkbox"]) {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; cursor: pointer; font-size: var(--fs-small);
}
select, input[type="text"] {
  min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--border-strong); border-radius: var(--r2);
  background: var(--surface); color: var(--text); font: inherit;
}

/* ------------------------------------------------------------------ slots panel */
.tool { margin: 0; }
.slots {
  display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); column-gap: var(--s4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r3);
  box-shadow: var(--shadow-1); padding: var(--s5);
}
.slot { min-width: 0; display: flex; flex-direction: column; }
.slot-title {
  display: flex; align-items: center; gap: var(--s2);
  margin: 0; font-size: var(--fs-body); line-height: 1.3; letter-spacing: 0; font-weight: 700;
}
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none;
  border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-size: var(--fs-label); font-weight: 700; font-variant-numeric: tabular-nums;
}
.slot-hint { margin: var(--s1) 0 var(--s3); font-size: var(--fs-small); line-height: 1.45; color: var(--muted); min-height: 2.9em; }
.order {
  grid-column: 2; grid-row: 1; align-self: center; justify-self: center;
  display: grid; place-items: center; width: 36px; height: 36px; margin-top: var(--s6);
  border-radius: 50%; background: var(--raised); color: var(--muted); border: 1px solid var(--border);
}
.order svg { width: 18px; height: 18px; }
#slot-common { grid-column: 1; grid-row: 1; }
#slot-phone { grid-column: 3; grid-row: 1; }

/* the drop zone: a real file input stretched over it */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s1); min-height: 9rem; margin: 0; padding: var(--s4);
  text-align: center; border: 2px dashed var(--accent); border-radius: var(--r2);
  background: var(--bg); color: var(--text); cursor: pointer;
  transition: background-color var(--t), border-color var(--t), transform var(--t);
}
.drop:hover { background: var(--accent-tint); }
.drop:active { transform: scale(.995); }
.drop.over { background: var(--accent-tint); border-style: solid; transform: scale(1.01); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); }
.drop-input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0;
}
.drop-input:focus-visible { outline: none; box-shadow: none; }
.drop-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--accent-text); pointer-events: none; }
.drop-icon svg { width: 28px; height: 28px; }
.drop-main { font-weight: 650; font-size: var(--fs-body); line-height: 1.3; pointer-events: none; overflow-wrap: anywhere; max-width: 100%; }
.drop-main.file-name { font-family: var(--mono); font-size: var(--fs-small); }
.drop-sub { font-size: var(--fs-small); color: var(--muted); pointer-events: none; font-variant-numeric: tabular-nums; }

.slot[data-state="ready"] .drop { border-style: solid; border-color: var(--border-strong); background: var(--surface); }
.slot[data-state="ready"] .drop:hover { background: var(--raised); }
.slot[data-state="ready"] .drop-icon { color: var(--success); }
.slot[data-state="reading"] .drop { border-style: solid; border-color: var(--border-strong); cursor: progress; }
.slot[data-state="error"] .drop { border-color: var(--danger); background: var(--danger-tint); }
.slot[data-state="error"] .drop-icon { color: var(--danger); }

.spinner {
  display: block; width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.slot-error {
  display: flex; gap: var(--s2); align-items: flex-start;
  min-height: 3em; margin: var(--s2) 0 0; font-size: var(--fs-small); line-height: 1.45;
  color: var(--danger); font-weight: 550; overflow-wrap: anywhere;
}
.slot-error:empty { visibility: hidden; }
.slot-error svg { flex: none; width: 16px; height: 16px; margin-top: 3px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.slot-error code, #status.error code { color: var(--text); }

.slots-foot {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  flex-wrap: wrap; margin-top: var(--s3); padding-top: var(--s4); border-top: 1px solid var(--border);
}
.local-note { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; font-size: var(--fs-small); color: var(--muted); }
.local-note svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

/* ------------------------------------------------------------------ status */
#status {
  min-height: 1.6em; margin: var(--s4) 0 var(--s3); font-size: var(--fs-small); font-weight: 600;
  color: var(--muted); font-variant-numeric: tabular-nums; max-width: none;
}
#status.ok { color: var(--text); }
#status.error { color: var(--danger); }

/* ------------------------------------------------------------------ output: empty state */
#output { min-height: 8rem; }
.empty-state {
  display: flex; gap: var(--s4); align-items: flex-start;
  padding: var(--s5); border: 1px dashed var(--border-strong); border-radius: var(--r3); color: var(--muted);
}
.empty-state svg { width: 40px; height: 40px; flex: none; color: var(--accent-text); }
.empty-state strong { display: block; color: var(--text); font-size: var(--fs-body); margin-bottom: var(--s1); }
.empty-state p { margin: 0; font-size: var(--fs-small); max-width: 62ch; }

/* ------------------------------------------------------------------ report */
.report {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r3);
  box-shadow: var(--shadow-1); padding: var(--s5); animation: rise 180ms ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.report-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s3) var(--s5); }
.report h2 {
  margin: 0; font-size: var(--fs-report); line-height: 1.15; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.tally { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.tally li {
  margin: 0; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-small); font-weight: 600;
  font-variant-numeric: tabular-nums; border: 1px solid var(--border); background: var(--raised); color: var(--text);
}
.tally .conflict { background: var(--warning-tint); color: var(--warning); border-color: transparent; }
.tally .ambiguous { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.tally .same { background: var(--success-tint); color: var(--success); border-color: transparent; }

.precedence {
  display: flex; gap: var(--s2); align-items: center; margin: var(--s4) 0 var(--s4);
  font-size: var(--fs-small); color: var(--muted);
}
.precedence svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--accent-text); stroke-width: 1.6; }
.report-empty, .scope-note { font-size: var(--fs-small); color: var(--muted); max-width: 68ch; }
.report-empty { margin: var(--s4) 0 0; font-size: var(--fs-body); color: var(--text); }
.scope-note { margin: var(--s4) 0 0; }

/* the table */
table.diff, #output table.diff {
  width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--fs-small);
}
.diff col.c-key { width: 26%; }
.diff col.c-common, .diff col.c-phone { width: 24%; }
.diff col.c-result { width: 26%; }
.diff thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--raised); color: var(--muted); text-align: left; vertical-align: bottom;
  font-size: var(--fs-label); font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  padding: var(--s2) var(--s3); border-bottom: 0; box-shadow: inset 0 -1px 0 var(--border-strong);
}
.diff thead th:first-child { border-top-left-radius: var(--r1); }
.diff thead th:last-child { border-top-right-radius: var(--r1); }
.diff thead small {
  display: block; margin-top: 2px; font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--muted); overflow-wrap: anywhere;
}
.diff tbody th, .diff tbody td, #output .diff tbody td, #output .diff tbody th {
  text-align: left; vertical-align: top; padding: var(--s3); border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere; font-weight: 400;
}
.diff tbody tr { transition: background-color var(--t); }
.diff tbody tr:hover { background: var(--bg); }
.diff .key code {
  background: none; padding: 0; font-size: var(--fs-small); font-weight: 650; color: var(--text); overflow-wrap: anywhere;
}
.diff tr > .key { box-shadow: inset 3px 0 0 transparent; }
.diff tr.conflict > .key { box-shadow: inset 3px 0 0 var(--warning); }
.diff tr.ambiguous > .key { box-shadow: inset 3px 0 0 var(--danger); }

/* an assignment: value, then its cable tag */
.as, .result { line-height: 1.4; }
.val {
  display: block; font-family: var(--mono); font-size: var(--fs-small); color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.val.empty {
  display: inline-block; font-family: var(--font); font-size: var(--fs-label); font-weight: 650;
  letter-spacing: .04em; color: var(--danger); background: var(--danger-tint); padding: 1px 8px; border-radius: var(--r1);
}
.absent { font-size: var(--fs-small); color: var(--muted); font-style: italic; }
.as.overridden .val { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--border-strong); }
.as-note {
  display: inline-block; margin-top: var(--s1); font-size: var(--fs-label); font-weight: 650;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.as-list { margin: 0; padding: 0; list-style: none; }
.as-list li { margin: 0 0 var(--s2); }
.as-list li:last-child { margin-bottom: 0; }

/* Signature: the cable tag */
.src {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  margin-top: var(--s1); padding: 1px 8px 1px 6px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--muted);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
  background: var(--raised); border: 1px solid var(--border); border-radius: 2px var(--r1) var(--r1) 2px;
}
.src::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid currentColor; background: var(--surface);
}
.src.win {
  color: var(--accent-text); background: var(--accent-tint); border-color: var(--accent); font-weight: 600;
}

/* result cell */
.result > * { display: block; }
.badge {
  display: inline-flex !important; align-items: center; gap: 6px; padding: 2px 10px 2px 8px;
  border-radius: 999px; font-size: var(--fs-label); font-weight: 700; letter-spacing: .02em;
  border: 1px solid var(--border); background: var(--raised); color: var(--text);
}
.badge svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.badge.common svg circle, .badge.phone svg circle { fill: currentColor; stroke: none; }
.badge.conflict { background: var(--warning-tint); color: var(--warning); border-color: transparent; }
.badge.same { background: var(--success-tint); color: var(--success); border-color: transparent; }
.badge.common { color: var(--muted); }
.badge.phone { color: var(--accent-text); border-color: var(--accent); background: var(--surface); }
.badge.ambiguous { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.diff .key > .badge { display: none !important; }
.winner { margin-top: var(--s2); }
.winner-label {
  display: block; font-size: var(--fs-label); font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.winner .val { font-weight: 650; }
.reason { margin-top: var(--s2); font-size: var(--fs-small); color: var(--text); }

/* ------------------------------------------------------------------ reading section */
.example {
  margin: var(--s4) 0 var(--s5); padding: var(--s5); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r3); box-shadow: var(--shadow-1);
}
.files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.files figure { margin: 0; min-width: 0; }
.files figcaption {
  font-size: var(--fs-label); font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--s2);
}
.files figcaption code { text-transform: none; letter-spacing: 0; }
pre {
  margin: 0; padding: var(--s3) var(--s4); background: var(--raised); color: var(--text);
  border-radius: var(--r2); border: 1px solid var(--border);
  font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
pre .ln { display: inline-block; width: 2ch; margin-right: var(--s3); color: var(--muted); text-align: right; user-select: none; font-variant-numeric: tabular-nums; }
.callout {
  margin: var(--s5) 0 0; padding: var(--s3) var(--s4); border-left: 3px solid var(--accent);
  background: var(--accent-tint); border-radius: 0 var(--r2) var(--r2) 0; font-size: var(--fs-small); color: var(--text);
  max-width: none;
}
.callout strong { color: var(--text); }

/* ------------------------------------------------------------------ ad slot, house card, consent, footer */
.ad-slot { background: var(--raised); border: 1px solid var(--border); }
.ad-label { color: var(--muted); opacity: 1; font-size: var(--fs-label); letter-spacing: .07em; text-transform: uppercase; font-weight: 650; }
.house-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); color: var(--text);
  transition: border-color var(--t), transform var(--t);
}
.house-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.house-card strong { color: var(--accent-text); }
.house-card span { color: var(--muted); }
.consent {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r3); box-shadow: var(--shadow-2); font-size: var(--fs-small);
}
.consent button {
  border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); font-weight: 600;
  border-radius: var(--r2); transition: background-color var(--t), border-color var(--t);
}
.consent button:hover { background: var(--raised); border-color: var(--text); }
footer {
  opacity: 1; color: var(--muted); font-size: var(--fs-small);
  border-top: 1px solid var(--border); margin-top: var(--s7); padding-top: var(--s5); padding-bottom: var(--s6);
}
footer a { color: var(--accent-text); }

/* ------------------------------------------------------------------ phone */
@media (max-width: 46rem) {
  header, main, footer { padding-left: var(--s4); padding-right: var(--s4); }
  main { padding-top: var(--s5); }
  .lede { font-size: var(--fs-body); margin-bottom: var(--s5); }
  .slots { grid-template-columns: minmax(0, 1fr); padding: var(--s4); row-gap: var(--s3); }
  #slot-common { grid-column: 1; grid-row: 1; }
  #slot-phone { grid-column: 1; grid-row: 2; }
  .order { display: none; }
  .slot-hint { min-height: 0; }
  .drop { min-height: 7.5rem; }
  .slot-error { min-height: 1.5em; }
  .slots-foot { flex-direction: column; align-items: stretch; }
  .slots-foot button { width: 100%; }
  .report { padding: var(--s4); }
  .report h2 { font-size: 24px; }
  .files { grid-template-columns: minmax(0, 1fr); }
  .example { padding: var(--s4); }

  table.diff, .diff tbody, .diff tr, .diff tbody th, .diff tbody td { display: block; width: 100%; }
  .diff colgroup { display: none; }
  .diff thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .diff tbody tr { padding: var(--s3) 0 var(--s3) var(--s3); border-bottom: 1px solid var(--border-strong); box-shadow: inset 3px 0 0 var(--border); }
  .diff tbody tr.conflict { box-shadow: inset 3px 0 0 var(--warning); }
  .diff tbody tr.ambiguous { box-shadow: inset 3px 0 0 var(--danger); }
  .diff tr > .key, .diff tr.conflict > .key, .diff tr.ambiguous > .key { box-shadow: none; }
  .diff tbody th, .diff tbody td, #output .diff tbody td, #output .diff tbody th { border-bottom: 0; padding: var(--s1) 0 var(--s2); }
  .diff tbody td::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-family: var(--font); font-size: var(--fs-label); font-weight: 650; letter-spacing: .07em;
    text-transform: uppercase; color: var(--muted);
  }
  .diff .key { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s2); }
  .diff .key code { min-width: 0; }
  .diff .key > .badge { display: inline-flex !important; }
  .diff .result > .badge { display: none !important; }
  .diff .result > .winner { margin-top: 0; }
  .diff tbody tr:hover { background: transparent; }
}

/* ------------------------------------------------------------------ motion off */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .drop.over, .drop:active, .house-card:hover { transform: none; }
  .spinner { border-color: var(--accent); border-top-color: var(--accent); opacity: .7; }
}
