.conflict-card {
  border: 1px solid #333;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 8px;
}

.conflict-header {
  display: flex;
  justify-content: space-between;
}

.conflict-meta {
  color: #aaa;
  font-size: 0.9em;
  margin: 4px 0;
}

.candidate {
  padding: 4px 0;
}
.conflict-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.conflict-actions button {
  padding: 6px 10px;
  cursor: pointer;
}
body {
  background: #0e1117;
  color: #e6edf3;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

#conflictList {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.conflict-card {
  background: #161b22;
  border: 1px solid #262c36;
  border-radius: 10px;
  padding: 14px 16px;
}
.conflict-candidates {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.candidate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  background: #0d1117;
  border: 1px solid #202636;
}

.candidate.none {
  opacity: 0.6;
  font-style: italic;
}
.conflict-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.conflict-actions button {
  background: #1f6feb;
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.conflict-actions button:hover {
  background: #388bfd;
}
.conflict-actions button[data-action="rename-existing"] {
  background: #a371f7;
}

.conflict-actions button[data-action="create-new"] {
  background: #238636;
}

.conflict-actions button[data-action="ignore"] {
  background: #8b949e;
}
.conflict-actions button[data-action="rename-existing"] {
  background: #a371f7;
}

.conflict-actions button[data-action="create-new"] {
  background: #238636;
}

.conflict-actions button[data-action="ignore"] {
  background: #8b949e;
}
select {
  background: #0d1117;
  color: #e6edf3;
  border: 1px solid #30363d;
  padding: 6px 8px;
  border-radius: 6px;
}
.conflict-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 10px;
}
.badge.reason {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge.reason.NAME_MISMATCH {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.4);
}
.badge.reason.AMBIGUOUS {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.4);
}
.conflict-header .meta {
  font-size: 13px;
  opacity: 0.85;
}
.conflict-header .upload {
  font-size: 12px;
  opacity: 0.65;
  margin-left: auto;
}
@media (max-width: 600px) {
  .conflict-header .upload {
    width: 100%;
    margin-left: 0;
  }
}
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0e1117;
  border-bottom: 1px solid #262c36;
  padding: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
  background: #0d1117;
  color: #e6edf3;
  border: 1px solid #30363d;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}
@media (max-width: 600px) {
  .filter-bar {
    flex-direction: column;
  }
}
.conflict-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.conflict-number {
  font-weight: 700;
  opacity: 0.7;
}

.chevron {
  margin-left: auto;
  font-size: 16px;
  opacity: 0.7;
}

.conflict-body.hidden {
  display: none;
}

.conflict-body {
  margin-top: 12px;
}
.badge.upload {
  background: #1f2937;
  color: #93c5fd;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
}

.badge.upload:not(:contains("legacy")) {
  background: #0f766e;
  color: #99f6e4;
}
.conflict-guide {
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #0f1115;
  color: #e6e6e6;
}

.guide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.guide-header button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
}

.guide-body {
  margin-top: 10px;
}

.guide-body ul {
  padding-left: 18px;
}

.guide-body li {
  margin-bottom: 10px;
}

.guide-tip {
  margin-top: 10px;
  font-size: 13px;
  color: #9bdcff;
}
.conflict-meta {
  font-size: 13px;
  line-height: 1.3;
}

.excel-row {
  font-weight: 500;
  color: #f5f5f5;
}

.excel-name {
  color: #9bdcff;
}

.excel-power {
  color: #ffd479;
}

.context-row {
  color: #aaa;
  font-size: 12px;
}
.upload-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.upload-time {
  font-size: 12px;
  color: #9aa0a6;
}
.delta {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
}

.delta-ok {
  color: #22c55e; /* green */
}

.delta-border {
  color: #f59e0b; /* amber */
}

.delta-drop {
  color: #ef4444; /* red */
}
.best-match {
  border: 1px solid #22c55e;
  background: rgba(34, 197, 94, 0.06);
}
.manual-select {
  margin: 8px 0;
}

.manual-toggle {
  font-size: 12px;
  opacity: 0.85;
  cursor: pointer;
  background: none;
  border: none;
  color: #93c5fd;
}

.manual-panel {
  margin-top: 6px;
}

.manual-search {
  width: 100%;
  padding: 6px;
  font-size: 12px;
  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

.manual-results {
  margin-top: 6px;
  max-height: 160px;
  overflow-y: auto;
}
.manual-row {
  padding: 6px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid #1e293b;
}

.manual-row:hover {
  background: #020617;
}

.manual-row.selected {
  background: #1e3a8a;
}

.manual-row .meta {
  float: right;
  opacity: 0.7;
}

.manual-empty {
  padding: 6px;
  font-size: 12px;
  opacity: 0.6;
}
.manual-panel {
  border: 1px solid #333;
  padding: 12px;
  margin-bottom: 16px;
  background: #0f0f0f;
}

.manual-panel h2 {
  margin: 0 0 6px;
}

.manual-form {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.manual-form input {
  padding: 6px;
}

.manual-form button {
  grid-column: span 5;
}

.manual-rules .rule {
  display: grid;
  grid-template-columns: 1fr 2fr 2fr auto auto;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid #222;
}

.manual-rules .rule input {
  padding: 4px;
}

.muted {
  opacity: 0.7;
  font-size: 0.9em;
}
