/* Only what the comparison needs on top of tool_page.css: the two editors, the
   option bar and the result table. */
.tc-tool {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
}

.tc-tool [hidden] {
  display: none !important;
}

.tc-panel {
  padding: 20px;
  border-radius: 24px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 2, 18, 0.6);
}

.tc-panes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tc-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.tc-pane.is-dragging {
  border-color: #6e00ff;
}

.tc-pane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tc-pane-title {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.tc-pane-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.tc-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
}

.tc-file:hover {
  color: #fff;
}

.tc-file input {
  display: none;
}

.tc-input {
  width: 100%;
  min-height: 260px;
  padding: 14px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 14px;
  line-height: 22px;
  resize: vertical;
  white-space: pre;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.tc-input::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.tc-input::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
}

.tc-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.tc-input:focus {
  outline: none;
  border-color: #6e00ff;
}

.tc-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.tc-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tc-field-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.tc-segment {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.tc-segment-item {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  cursor: pointer;
}

.tc-segment-item.is-active {
  background: #6e00ff;
  color: #fff;
}

.tc-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.tc-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  cursor: pointer;
}

.tc-check input {
  width: 16px;
  height: 16px;
  accent-color: #6e00ff;
}

.tc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}

.tc-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.tc-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.tc-metric-value {
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tc-metric-label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.tc-metric--added .tc-metric-value {
  color: #4ed6a8;
}

.tc-metric--removed .tc-metric-value {
  color: #ff8f8f;
}

.tc-metric--modified .tc-metric-value {
  color: #f5c86b;
}

.tc-result {
  padding: 0;
  overflow: hidden;
}

.tc-viewport {
  max-height: 640px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.tc-viewport::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.tc-viewport::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.24);
}

.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 21px;
}

.tc-table td {
  padding: 1px 10px;
  vertical-align: top;
  border: 0;
}

.tc-num {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  color: rgba(255, 255, 255, 0.3);
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
}

.tc-sign {
  width: 1%;
  padding-right: 0;
  color: rgba(255, 255, 255, 0.45);
  user-select: none;
}

.tc-text {
  color: rgba(255, 255, 255, 0.85);
  white-space: pre;
  tab-size: 2;
}

.tc-text--left {
  border-right: 0.5px solid rgba(255, 255, 255, 0.1);
}

.is-wrap .tc-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tc-row--delete .tc-text--left,
.tc-row--delete .tc-text,
.tc-row--modify .tc-text--left {
  background: rgba(255, 143, 143, 0.1);
}

.tc-row--insert .tc-text--right,
.tc-row--insert .tc-text,
.tc-row--modify .tc-text--right {
  background: rgba(78, 214, 168, 0.1);
}

.tc-row--delete .tc-text--right,
.tc-row--insert .tc-text--left {
  background: rgba(255, 255, 255, 0.02);
}

.tc-ink {
  border-radius: 3px;
  padding: 0 1px;
}

.tc-ink--out {
  background: rgba(255, 143, 143, 0.3);
  color: #ffd7d7;
}

.tc-ink--in {
  background: rgba(78, 214, 168, 0.3);
  color: #cdfced;
}

.tc-row--skip td {
  padding: 6px 12px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}

.tc-status {
  margin: 0;
  padding: 18px 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  text-align: center;
}

.tc-hint {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

.tc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.tc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tc-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.tc-swatch--in {
  background: rgba(78, 214, 168, 0.5);
}

.tc-swatch--out {
  background: rgba(255, 143, 143, 0.5);
}

@media (max-width: 900px) {
  .tc-panes {
    grid-template-columns: 1fr;
  }

  .tc-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-actions {
    margin-left: 0;
  }

  .tc-controls {
    gap: 14px;
  }
}
