/* Row & Record — Key-Based CSV Compare & Blank-Overwrite Guard */
.ccmp-card {
  border: 1px solid var(--line, #d8d2c5);
  border-radius: 14px;
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(20, 28, 36, 0.05);
}

.ccmp-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.ccmp-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
  padding: 0.68rem 0.82rem;
  border-radius: 10px;
  border: 1px solid #d5cfc2;
  background: #faf8f3;
  color: #17212b;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.ccmp-preset-btn small {
  font-size: 0.74rem;
  font-weight: 500;
  color: #556270;
}

.ccmp-preset-btn[aria-pressed="true"] {
  background: #142230;
  border-color: #142230;
  color: #fff;
}

.ccmp-preset-btn[aria-pressed="true"] small {
  color: #cbd5e1;
}

.ccmp-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ccmp-drop-box {
  border: 1.5px dashed #b9b1a0;
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  background: #fcfbf8;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ccmp-drop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.ccmp-drop-head strong {
  font-size: 0.86rem;
  color: #142230;
}

.ccmp-file-meta {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #4d5b68;
}

.ccmp-file-input {
  font-size: 0.8rem;
  max-width: 100%;
}

.ccmp-paste-drawer {
  border: 1px solid #e3ddd0;
  border-radius: 9px;
  background: #faf8f3;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.9rem;
}

.ccmp-paste-drawer summary {
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 700;
  color: #1e2d3d;
}

.ccmp-paste-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.65rem;
}

.ccmp-paste-col label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #3d4b59;
  margin-bottom: 0.28rem;
}

.ccmp-textarea {
  width: 100%;
  min-height: 112px;
  padding: 0.55rem 0.65rem;
  border-radius: 7px;
  border: 1px solid #cbc4b5;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  resize: vertical;
}

.ccmp-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #f5f2ea;
  border: 1px solid #e2dccf;
  margin-bottom: 0.85rem;
}

.ccmp-key-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ccmp-key-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #17212b;
}

.ccmp-select,
.ccmp-search {
  padding: 0.42rem 0.65rem;
  border-radius: 7px;
  border: 1px solid #c6bfb0;
  background: #fff;
  color: #142230;
  font: inherit;
  font-size: 0.82rem;
}

.ccmp-search {
  min-width: 210px;
}

.ccmp-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.ccmp-filter-pill {
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid #cfc8b9;
  background: #fff;
  color: #243240;
  font: inherit;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
}

.ccmp-filter-pill[aria-pressed="true"] {
  background: #142230;
  border-color: #142230;
  color: #fff;
}

.ccmp-filter-pill.is-hazard {
  border-color: #d97706;
  color: #92400e;
}

.ccmp-filter-pill.is-hazard[aria-pressed="true"] {
  background: #b45309;
  border-color: #b45309;
  color: #fff;
}

.ccmp-unchanged-note {
  margin-left: auto;
  align-self: center;
  font-size: 0.78rem;
  color: #556270;
}

.ccmp-alert {
  padding: 0.65rem 0.85rem;
  border-radius: 9px;
  border: 1px solid #d4e4d8;
  background: #f2f8f4;
  color: #173b27;
  font-size: 0.83rem;
  line-height: 1.45;
  margin-bottom: 0.8rem;
}

.ccmp-alert.is-warn {
  border-color: #f3d098;
  background: #fff9ee;
  color: #7c3a06;
}

.ccmp-table-frame {
  border: 1px solid #dcd6c8;
  border-radius: 10px;
  overflow-x: auto;
  background: #fff;
  margin-bottom: 0.85rem;
}

.ccmp-table {
  width: 100%;
  min-width: 680px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.79rem;
}

.ccmp-table th:nth-child(1) { width: 17%; }
.ccmp-table th:nth-child(2) { width: 13%; }
.ccmp-table th:nth-child(3) { width: 15%; }
.ccmp-table th:nth-child(4) { width: 20%; }
.ccmp-table th:nth-child(5) { width: 20%; }
.ccmp-table th:nth-child(6) { width: 15%; }

.ccmp-table th {
  background: #f6f3eb;
  color: #22303e;
  font-weight: 800;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.52rem 0.55rem;
  border-bottom: 1px solid #dcd6c8;
  text-align: left;
}

.ccmp-table td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid #ece7dc;
  vertical-align: top;
  word-break: break-word;
}

.ccmp-badge {
  display: inline-block;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ccmp-badge.mod { background: #e0f2fe; color: #075985; }
.ccmp-badge.add { background: #dcfce7; color: #166534; }
.ccmp-badge.rem { background: #fee2e2; color: #991b1b; }
.ccmp-badge.haz { background: #fef3c7; color: #92400e; }

.ccmp-val-old {
  color: #991b1b;
  background: #fef2f2;
  padding: 0.08rem 0.28rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
}

.ccmp-val-new {
  color: #166534;
  background: #f0fdf4;
  padding: 0.08rem 0.28rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
}

.ccmp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.ccmp-btn-primary,
.ccmp-btn-secondary {
  padding: 0.62rem 1rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.ccmp-btn-primary {
  background: #142230;
  border: 1px solid #142230;
  color: #fff;
}

.ccmp-btn-secondary {
  background: #fff;
  border: 1px solid #c8c1b2;
  color: #142230;
}

.ccmp-status {
  font-size: 0.8rem;
  color: #1c5d3a;
  font-weight: 600;
}

@media (max-width: 780px) {
  .ccmp-presets,
  .ccmp-upload-grid,
  .ccmp-paste-grid {
    grid-template-columns: 1fr;
  }
  .ccmp-unchanged-note {
    margin-left: 0;
  }
}
