/*
 * Website Health Checker — page-specific styles.
 *
 * The design system (tokens, chrome, buttons, badges, FAQ, toast, print, and
 * the URL-form and state patterns shared with the analyzer) comes from
 * /tools/tools.css. Only what is unique to a health report lives here: the
 * score head, the priority list, category meters and check rows.
 */

/* ---------------------------------------------------------------- url form */

/* Shared with the analyzer page. Kept here rather than in tools.css because
   only these two tools take a URL, and a third might want a different shape. */
.url-form { margin-top: 26px; }

.url-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fog-500);
}

/* .url-row, .url-input, .url-hint and .url-error are shared primitives in
   tools.css — every tool that takes a URL uses the same control. */

/* ------------------------------------------------------------------ states */

.state { min-height: 120px; }

.empty {
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-800);
  padding: clamp(18px, 3.5vw, 26px);
}
.empty h3 { font-size: 17px; }
.empty p { margin-top: 8px; max-width: 76ch; font-size: 13.5px; color: var(--fog-300); }
.empty-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.empty-list li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fog-500);
  padding-left: 14px;
  border-left: 2px solid var(--ink-600);
}
.empty-list strong { color: var(--fog-100); font-weight: 600; }

.loading {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-800);
  padding: 20px 22px;
}
.spinner {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 2px solid var(--ink-500);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
.loading-title { font-size: 14.5px; font-weight: 600; color: var(--fog-50); }
.loading-note { margin-top: 3px; font-size: 12.5px; color: var(--fog-500); }

.error-card {
  border: 1px solid color-mix(in srgb, var(--fail-500) 35%, var(--ink-600));
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--fail-500) 6%, var(--ink-850));
  padding: clamp(18px, 3.5vw, 26px);
}
.error-kind { font-size: 16px; font-weight: 600; color: var(--fog-50); }
.error-message {
  margin-top: 8px;
  max-width: 76ch;
  font-size: 14px;
  color: var(--fog-100);
  overflow-wrap: anywhere;
}
.error-help { margin-top: 8px; max-width: 76ch; font-size: 13px; color: var(--fog-500); }
.error-card .actions { margin-top: 18px; }

.notice {
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--warn-500) 40%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn-500) 8%, transparent);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fog-100);
}
.notice[hidden] { display: none; }

/* ------------------------------------------------------------- score head */

.score-head {
  display: flex;
  align-items: center;
  gap: clamp(16px, 4vw, 28px);
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink-700);
}

/*
 * The dial.
 *
 * A conic-gradient ring rather than an SVG chart: one element, no library, and
 * the percentage is set from JS as a custom property. The number in the middle
 * is the real content — the ring only makes it glanceable, and the grade word
 * beside it carries the same meaning for anyone who cannot see the colour.
 */
.score-dial {
  position: relative;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  flex-shrink: 0;
  border-radius: 50%;
  background:
    conic-gradient(var(--score-color, var(--brand-500)) calc(var(--score, 0) * 1%), var(--ink-700) 0);
}
.score-dial::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--ink-900);
}
.score-value {
  position: relative;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  color: var(--fog-50);
}
.score-outof {
  position: relative;
  margin-top: 2px;
  font-size: 11px;
  color: var(--fog-500);
}

.score-body { flex: 1 1 260px; min-width: 0; }
.report-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-500);
}
.score-body h3 {
  margin-top: 4px;
  font-size: clamp(20px, 3.4vw, 28px);
  overflow-wrap: anywhere;
}
.report-url {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--fog-500);
  overflow-wrap: anywhere;
}
.score-grade {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
}
.score-counts { margin-top: 4px; font-size: 12.5px; color: var(--fog-500); }

.grade-excellent { color: var(--pass-500); }
.grade-good { color: var(--pass-500); }
.grade-needs-work { color: var(--warn-500); }
.grade-poor { color: var(--fail-500); }

.block-title {
  margin-top: 30px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--fog-500);
}

/* ------------------------------------------------------------- priorities */

.priorities {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: priority;
  display: grid;
  gap: 8px;
}
.priorities li {
  counter-increment: priority;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-850);
}
.priorities li::before {
  content: counter(priority);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--ink-700);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-500);
}
.priority-body { min-width: 0; flex: 1; }
.priority-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fog-50);
  overflow-wrap: anywhere;
}
.priority-what {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fog-300);
}
.priority-meta {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.priority-gain {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fog-500);
}

/* Severity carries a word as well as a colour. */
.sev {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sev-critical {
  color: var(--fail-500);
  border-color: color-mix(in srgb, var(--fail-500) 45%, transparent);
  background: color-mix(in srgb, var(--fail-500) 14%, transparent);
}
.sev-high {
  color: var(--fail-500);
  border-color: color-mix(in srgb, var(--fail-500) 30%, transparent);
  background: color-mix(in srgb, var(--fail-500) 8%, transparent);
}
.sev-medium {
  color: var(--warn-500);
  border-color: color-mix(in srgb, var(--warn-500) 40%, transparent);
  background: color-mix(in srgb, var(--warn-500) 12%, transparent);
}
.sev-low {
  color: var(--fog-300);
  border-color: var(--ink-500);
  background: var(--ink-800);
}

/* -------------------------------------------------------------- categories */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 9px;
}
.cat {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-850);
}
.cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.cat-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fog-100);
}
.cat-score {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--fog-50);
}
.cat-score.na {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
  color: var(--fog-500);
}
.cat-meter {
  margin-top: 8px;
  height: 5px;
  border-radius: 999px;
  background: var(--ink-700);
  overflow: hidden;
}
.cat-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.cat-note { margin-top: 6px; font-size: 11px; color: var(--fog-500); }

.bar-good { background: var(--pass-500); }
.bar-warn { background: var(--warn-500); }
.bar-bad { background: var(--fail-500); }

/* ----------------------------------------------------------------- checks */

.check-group + .check-group { margin-top: 18px; }
.check-group h5 {
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-500);
}

.check {
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-850);
  overflow: hidden;
}
.check + .check { margin-top: 6px; }

.check > summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}
.check > summary::-webkit-details-marker { display: none; }
.check > summary:hover { background: var(--ink-800); }

/* Glyph AND colour AND text — none of the three alone. */
.check-mark {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  flex-shrink: 0;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
}
.mark-pass {
  color: var(--pass-500);
  background: color-mix(in srgb, var(--pass-500) 14%, transparent);
  border-color: color-mix(in srgb, var(--pass-500) 35%, transparent);
}
.mark-warn {
  color: var(--warn-500);
  background: color-mix(in srgb, var(--warn-500) 14%, transparent);
  border-color: color-mix(in srgb, var(--warn-500) 35%, transparent);
}
.mark-fail {
  color: var(--fail-500);
  background: color-mix(in srgb, var(--fail-500) 12%, transparent);
  border-color: color-mix(in srgb, var(--fail-500) 30%, transparent);
}
.mark-na {
  color: var(--fog-500);
  background: var(--ink-800);
  border-color: var(--ink-600);
}

.check-summary-body { min-width: 0; flex: 1; }
.check-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fog-100);
  overflow-wrap: anywhere;
}
.check-value {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fog-500);
  overflow-wrap: anywhere;
}
.check-status {
  font-size: 11.5px;
  font-weight: 500;
}
.status-pass { color: var(--pass-500); }
.status-warn { color: var(--warn-500); }
.status-fail { color: var(--fail-500); }
.status-na { color: var(--fog-500); }

.check-toggle {
  flex-shrink: 0;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  color: var(--fog-500);
}
.check[open] .check-toggle::before { content: '−'; }
.check-toggle::before { content: '+'; }

.check-detail {
  padding: 2px 14px 14px 45px;
  display: grid;
  gap: 9px;
}
.check-detail dt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fog-500);
}
.check-detail dd {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--fog-300);
  overflow-wrap: anywhere;
}

/* ----------------------------------------------------------- technologies */

.tech-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--ink-700);
  border-radius: 999px;
  background: var(--ink-850);
  font-size: 12.5px;
  color: var(--fog-100);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.tech-chip .cat {
  padding: 0;
  border: 0;
  background: none;
  font-size: 10.5px;
  color: var(--fog-500);
}
.tech-empty { font-size: 13px; color: var(--fog-500); font-style: italic; }

#cta-analyzer, #cta-responsive { margin-top: 14px; }
