/*
 * Phase 9E — Duplicate Analysis UX.
 * Additive styling only.
 */

.phase9e-button {
  appearance: none;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 12px;
}

.phase9e-button:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
}

.phase9e-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.phase9e-button-primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.phase9e-button-primary:hover:not(:disabled) {
  background: #1e293b;
  border-color: #1e293b;
}

.phase9e-button-secondary {
  background: #fff;
}

.phase9e-button:focus-visible,
.phase9e-icon-button:focus-visible,
.phase9e-field input:focus-visible,
.phase9e-field select:focus-visible {
  outline: 3px solid #2d6cdf;
  outline-offset: 3px;
}

.phase9e-overlay {
  align-items: center;
  background: rgba(15, 23, 42, 0.52);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 10020;
}

.phase9e-dialog {
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.28);
  max-height:
    min(720px, calc(100vh - 48px));
  max-width: 560px;
  overflow: auto;
  width: 100%;
}

.phase9e-dialog-header {
  align-items: flex-start;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 22px 24px 18px;
}

.phase9e-dialog-header h3 {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.phase9e-dialog-header p {
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

.phase9e-icon-button {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 25px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.phase9e-dialog-body {
  display: grid;
  gap: 18px;
  padding: 22px 24px;
}

.phase9e-field {
  display: grid;
  gap: 8px;
}

.phase9e-field > span {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.phase9e-field input,
.phase9e-field select {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #0f172a;
  font: inherit;
  min-height: 43px;
  padding: 9px 11px;
  width: 100%;
}

.phase9e-tracking-note {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 14px;
}

.phase9e-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  color: #9f1239;
  font-size: 13px;
  line-height: 1.45;
  padding: 11px 13px;
}

.phase9e-dialog-actions {
  align-items: center;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 22px;
}

.phase9e-notice {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #166534;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 16px;
  padding: 11px 13px;
}

.phase9e-notice-error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

@media (max-width: 640px) {
  .phase9e-overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .phase9e-dialog {
    border-radius:
      16px 16px 10px 10px;
    max-height:
      calc(100vh - 24px);
  }

  .phase9e-dialog-header,
  .phase9e-dialog-body,
  .phase9e-dialog-actions {
    padding-left: 18px;
    padding-right: 18px;
  }

  .phase9e-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .phase9e-dialog-actions
  .phase9e-button {
    width: 100%;
  }
}
