/* BinCast — Diff Tool */

/* ── Workspace override ──────────────────────────────────────────── */

[data-tool-id="diff"] .tool-workspace {
  display: block;
  padding: 0;
}

[data-tool-id="diff"] .tool-controls { display: none; }

/* ── Two-input pane ──────────────────────────────────────────────── */

.diff-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.diff-input-pane {
  display: flex;
  flex-direction: column;
}

.diff-input-pane + .diff-input-pane {
  border-left: 1px solid var(--border);
}

.diff-textarea {
  flex: 1;
  min-height: 180px;
  max-height: 32vh;
  background: none;
  border: none;
  outline: none;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: .8125rem;
  line-height: 1.65;
  color: var(--text);
  padding: .875rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.diff-textarea::placeholder { color: var(--muted); opacity: .55; }

/* ── Output area ─────────────────────────────────────────────────── */

.diff-output {
  font-family: var(--font-mono);
  font-size: .8125rem;
  line-height: 1.65;
}

/* ── Split view ──────────────────────────────────────────────────── */

.diff-split {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  max-height: 52vh;
  overflow: hidden;
}

.diff-split-col {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.diff-split-divider {
  background-color: var(--border);
}

/* ── Unified view ────────────────────────────────────────────────── */

.diff-unified {
  max-height: 52vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Lines (shared) ──────────────────────────────────────────────── */

.diff-line {
  display: block;
  padding: .05em 1.25rem;
  white-space: pre;
  overflow-x: hidden;
  min-height: 1.65em;
}

.diff-line-add { background-color: rgba(163, 168, 50, 0.10); }
.diff-line-del { background-color: rgba(196, 98,  45, 0.10); }
.diff-line-pad { background-color: rgba(255, 255, 255, 0.02); }

.diff-sign {
  display: inline-block;
  width: 1.4em;
  color: var(--muted);
  user-select: none;
}

.diff-line-add .diff-sign { color: #a3a832; }
.diff-line-del .diff-sign { color: #c4622d; }

/* ── Char-level view ─────────────────────────────────────────────── */

.diff-chars {
  padding: 1rem 1.25rem;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.9;
  max-height: 52vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

ins.diff-char-add {
  background-color: rgba(163, 168, 50, 0.18);
  color: #b8be38;
  text-decoration: none;
  border-radius: 2px;
  padding: .05em .2em;
}

del.diff-char-del {
  background-color: rgba(196, 98, 45, 0.18);
  color: #c4622d;
  text-decoration: line-through;
  border-radius: 2px;
  padding: .05em .2em;
}

/* ── Meta states ─────────────────────────────────────────────────── */

.diff-meta {
  padding: 2.5rem 1.25rem;
  font-family: var(--font);
  font-size: .875rem;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 680px) {
  .diff-inputs {
    grid-template-columns: 1fr;
  }
  .diff-input-pane + .diff-input-pane {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .diff-textarea { max-height: 25vh; }
  .diff-split { grid-template-columns: 1fr; }
  .diff-split-divider { display: none; }
  .diff-split-col + .diff-split-col { border-top: 1px solid var(--border); }
  .diff-split, .diff-unified, .diff-chars { max-height: 45vh; }
}
