/* ══════ Result Modal ══════ */
.result-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.result-modal.hidden { display: none; }

.result-modal-dialog {
  background: #fff;
  border-radius: 18px;
  width: 92%;
  max-width: 1180px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 30px 24px;
  box-shadow: 0 28px 60px rgba(15,23,42,0.3);
  position: relative;
}

.modal-close {
  position: absolute;
  right: 16px; top: 10px;
  border: none; background: none;
  font-size: 28px; cursor: pointer;
  color: #6b7280; z-index: 2; line-height: 1;
}
.modal-close:hover { color: #111; }

.export-pdf-report {
  background: linear-gradient(135deg, #cc8016, #fcb813);
  color: #fff;
  border: none;
  padding: 12px 26px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(204,128,22,0.35);
  transition: all 0.25s ease;
  font-family: 'Inter', sans-serif;
  position: absolute;
  right: 50px;
  top: 10px;
}
.export-pdf-report:hover {
  box-shadow: 0 6px 18px rgba(252,184,19,0.45);
  transform: translateY(-2px);
}

/* ── Modal content styles ── */
.result-header-url { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.result-header-url-value { font-size: 14px; word-break: break-all; margin: 0 0 12px; }

.score-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.45);
  font-size: 13px;
  margin-bottom: 16px;
  color: #166534;
}
.score-pill span {
  margin-left: 6px;
  font-weight: 700;
  color: #14532d;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0,1.7fr) minmax(0,1fr);
  gap: 24px;
}

#result-summary {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.metric-card {
  border-radius: 12px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
}
.metric-score {
  font-size: 18px;
  font-weight: 700;
  color: #ca8d34;
}
.metric-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.metric-text {
  font-size: 13px;
  color: #6b7280;
}

.priority-box {
  background: #fffaf5;
  border-radius: 12px;
  border: 1px dashed rgba(204,128,22,0.55);
  padding: 14px;
  margin-bottom: 18px;
}
.priority-box h3 { margin: 0 0 8px; font-size: 14px; color: #111; }
.priority-box ul,
.priority-box ol {
  margin: 0; padding-left: 20px; font-size: 13px; color: #6b7280;
}

.raw-json-toggle summary { font-size: 13px; cursor: pointer; margin-bottom: 4px; }
.raw-json-box {
  background: #f9fafb; border-radius: 10px; border: 1px solid #e5e7eb;
  padding: 8px; font-size: 11px; max-height: 200px; overflow: auto; white-space: pre;
}

.result-sidebar { display: flex; flex-direction: column; gap: 14px; }
.sidebar-card {
  background: #fff; border-radius: 12px; border: 1px solid #e5e7eb;
  padding: 14px 16px 12px; font-size: 13px; color: #6b7280;
}
.sidebar-card h3 { margin: 0 0 6px; font-size: 14px; color: #111; }
.sidebar-card.secondary { background: #fffdf7; }

@media (max-width: 820px) {
  .result-layout { grid-template-columns: 1fr; }
  .export-pdf-report { position: static; margin-bottom: 16px; }
}
