/* Diff Checker — tool-specific styles */
body.page-diff { height: auto; min-height: 100vh; overflow: auto; }

.diff-wrap {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Input panels */
.diff-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.diff-panel-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 5px;
}

.diff-textarea {
  width: 100%;
  height: 220px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: 'Fira Code','Cascadia Code','JetBrains Mono',monospace;
  font-size: 12px;
  line-height: 1.65;
  color: #1e293b;
  background: #fff;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.diff-textarea:focus { border-color: #2563eb; }

/* Toolbar */
.diff-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.diff-stats {
  margin-left: auto;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #64748b;
}
.stat-add { color: #16a34a; font-weight: 600; }
.stat-del { color: #dc2626; font-weight: 600; }

.view-toggle { display: flex; }
.view-btn {
  padding: 5px 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.view-btn:first-child { border-radius: 6px 0 0 6px; }
.view-btn:last-child  { border-radius: 0 6px 6px 0; border-left: none; }
.view-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Output */
.diff-output {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: auto;
  background: #fff;
  min-height: 80px;
}

.diff-placeholder {
  padding: 40px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* Common line structure */
.diff-line {
  display: flex;
  align-items: stretch;
  min-height: 1.65em;
  font-family: 'Fira Code','Cascadia Code','JetBrains Mono',monospace;
  font-size: 12px;
  line-height: 1.65;
}

.diff-lnum {
  min-width: 44px;
  padding: 0 8px;
  text-align: right;
  color: #94a3b8;
  background: #f8fafc;
  border-right: 1px solid #e8eef4;
  user-select: none;
  flex-shrink: 0;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.diff-sign {
  width: 18px;
  padding: 0 2px 0 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  font-weight: 700;
  user-select: none;
}

.diff-text {
  padding: 0 10px;
  word-break: break-all;
  white-space: pre-wrap;
  flex: 1;
  display: flex;
  align-items: center;
}

/* Unified view colours */
.diff-line.diff-ins { background: #f0fdf4; }
.diff-line.diff-del { background: #fef2f2; }
.diff-line.diff-ins .diff-sign { color: #16a34a; }
.diff-line.diff-del .diff-sign { color: #dc2626; }
.diff-line.diff-ins .diff-text { color: #15803d; }
.diff-line.diff-del .diff-text { color: #b91c1c; }
.diff-line.diff-eq  .diff-text { color: #1e293b; }

/* Split view */
.diff-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.diff-col { border-right: 2px solid #e2e8f0; min-width: 0; overflow: hidden; }
.diff-col:last-child { border-right: none; }
.diff-col-head {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.diff-line.diff-empty { background: #f8fafc; }
.diff-line.diff-empty .diff-lnum { background: #f1f5f9; }

@media (max-width: 640px) {
  .diff-inputs { grid-template-columns: 1fr; }
  .diff-split  { grid-template-columns: 1fr; }
  .diff-col    { border-right: none; border-bottom: 2px solid #e2e8f0; }
  .diff-col:last-child { border-bottom: none; }
  .diff-stats  { margin-left: 0; flex-wrap: wrap; }
}
