* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1a1d21;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

h1 { font-size: 1.6rem; margin-bottom: 4px; }
.subtitle { color: #5a6069; margin-top: 0; margin-bottom: 32px; }

.check-box label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.check-row { display: flex; gap: 8px; }

#keyword {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #d3d6db;
  border-radius: 8px;
  font-size: 1rem;
}

#btn-check {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: #1a56db;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

#btn-check:disabled { opacity: 0.6; cursor: default; }

.results { margin-top: 32px; }
.hidden { display: none !important; }

.result-card {
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.result-card.duplicate { background: #fff3ea; border: 1px solid #f4b678; }
.result-card.no-duplicate { background: #eaf7ec; border: 1px solid #86d59b; }
.result-card.error { background: #fde8e8; border: 1px solid #f19999; }

.result-card h3 { margin-top: 0; }

.match-list { list-style: none; padding: 0; margin: 12px 0; }

.match-item {
  padding: 10px 12px;
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.match-item .kw { font-weight: 600; }
.match-item .intent { color: #5a6069; font-size: 0.9rem; }

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.alta { background: #d33; color: white; }
.badge.media { background: #e0a326; color: white; }
.badge.baja { background: #9aa1ab; color: white; }

.actions { display: flex; gap: 10px; margin-top: 12px; }

button.secondary {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #c7cad0;
  background: white;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #1a56db;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
}

.modal h2 { margin-top: 0; }

.modal label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.modal input, .modal select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #d3d6db;
  border-radius: 8px;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #d3d6db;
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  background: none;
  font-weight: 600;
  color: #5a6069;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: #1a56db;
  border-bottom-color: #1a56db;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.hint {
  font-size: 0.85rem;
  color: #5a6069;
  margin: 0 0 10px;
}

/* Bulk status / report */
.bulk-status, .bulk-report {
  margin-top: 24px;
}

.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #f4f5f7;
  border-radius: 8px;
  font-size: 0.9rem;
}

.section-title {
  font-size: 1.05rem;
  margin: 28px 0 12px;
}

.cluster-grid {
  display: grid;
  gap: 12px;
}

.cluster-card {
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid #e3e5e9;
  background: #fafbfc;
}

.cluster-card.exact { border-left: 4px solid #d33; }
.cluster-card.semantic { border-left: 4px solid #e0a326; }

.cluster-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cluster-header h4 { margin: 0; font-size: 1rem; }

.cluster-meta, .cluster-sub {
  color: #5a6069;
  font-size: 0.85rem;
  margin: 6px 0 0;
}

.cluster-card details {
  margin-top: 8px;
  font-size: 0.85rem;
}

.cluster-card code {
  display: block;
  margin-top: 6px;
  word-break: break-all;
  color: #444;
}
