/* Store health check page. Uses the site's colour tokens (styles.css), so dark mode comes for free. */

.tool-hero { padding: 24px 0 32px; }
.tool-hero .wrap { max-width: 760px; }
.tool-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.tool-form label { display: block; font-size: .9rem; font-weight: 600; margin: 0 0 6px; }
.tool-form-row { display: flex; gap: 10px; }
.tool-form input[type="text"] {
  flex: 1; min-width: 0; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; min-height: 48px;
}
.tool-form input[type="text"]:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.tool-form .btn { width: auto; white-space: nowrap; }

.tool-status { margin: 16px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.tool-status[hidden], .tool-results[hidden], .tool-cta[hidden] { display: none; }
.tool-status.err { background: var(--bad-soft); border-color: var(--bad); }
.tool-status.err::before { content: "Couldn't run the check. "; font-weight: 700; color: var(--bad); }
.tool-status.busy { display: flex; align-items: center; gap: 12px; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Shared link (tool-early.js sets .hc-run): hold the space the status line and report will take, so nothing jumps */
.hc-run .tool-status[hidden] { display: block; visibility: hidden; min-height: 56px; }
.hc-run .tool-results[hidden] { display: block; visibility: hidden; min-height: 1400px; }

/* Results */
.tool-results { padding: 8px 0 24px; }
.tool-results .wrap { max-width: 860px; }
.summary { display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.grade { width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; text-align: center; border: 6px solid currentColor; margin: 0 auto; }
.grade b { font-size: 3rem; line-height: 1; display: block; }
.grade small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.grade.green { color: var(--ok); }
.grade.amber { color: var(--warn); }
.grade.red { color: var(--bad); }
.summary h2 { font-size: 1.35rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.summary p { margin: 0 0 8px; color: var(--muted); }
.summary .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.btn-ghost {
  font: inherit; font-size: .92rem; font-weight: 600; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; min-height: 40px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--brand); }

.overview { width: 100%; border-collapse: collapse; margin: 22px 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.overview th, .overview td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .95rem; }
.overview tr:last-child td { border-bottom: 0; }
.overview thead th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.overview a { font-weight: 600; }
.overview .counts { color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 3px 10px 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge::before { font-weight: 800; }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.green::before { content: "✓"; }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.amber::before { content: "!"; }
.badge.red { background: var(--bad-soft); color: var(--bad); }
.badge.red::before { content: "✕"; }
.badge.info { background: var(--surface-2); color: var(--muted); }
.badge.info::before { content: "i"; font-style: italic; }

.report-section { padding: 28px 0 0; }
.report-section h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 1.45rem; }
.finding { background: var(--surface); border: 1px solid var(--border); border-left-width: 6px; border-radius: 12px; padding: 16px 18px; margin: 0 0 12px; }
.finding.green { border-left-color: var(--ok); }
.finding.amber { border-left-color: var(--warn); }
.finding.red { border-left-color: var(--bad); }
.finding.info { border-left-color: var(--muted); }
.finding h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 1.05rem; margin: 0 0 8px; overflow-wrap: anywhere; }
.finding p { margin: 0 0 8px; font-size: .96rem; }
.finding p:last-child { margin-bottom: 0; }
.finding .label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.record { margin: 10px 0 0; }
.record pre { margin: 0 0 8px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: .86rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

.skipped { color: var(--muted); margin: 22px 0 0; }

/* After-results call to action */
.tool-cta { padding: 24px 0 40px; }
.tool-cta .wrap { max-width: 640px; }
.cta-card { background: var(--brand-soft); border-radius: var(--radius); padding: 28px 24px; }
.cta-card h2 { font-size: 1.5rem; }
.cta-card .section-lede { margin-bottom: 20px; color: var(--ink); }

/* Explanatory copy */
.tool-copy { padding: 24px 0 64px; }
.tool-copy .wrap { max-width: 720px; }
.tool-copy h2 { font-size: 1.6rem; margin: 40px 0 12px; }
.tool-copy h2:first-child { margin-top: 0; }
.tool-copy h3 { font-size: 1.15rem; margin: 26px 0 6px; }
.tool-copy p { margin: 0 0 14px; }
.tool-copy .faq { margin-top: 12px; }

@media (max-width: 640px) {
  .tool-form-row { flex-direction: column; }
  .tool-form .btn { width: 100%; }
  .summary { grid-template-columns: 1fr; text-align: center; }
  .summary .actions { justify-content: center; }
  .overview { display: block; overflow-x: auto; }
}
