/* WebCheck, data-terminal dark. Tokens from the dealt app sheet,
 * ground/card/ink overridden to the SiteVigil palette.
 * Figures (score, counts, times) are set in JetBrains Mono on purpose:
 * this is a terminal audit tool, and tabular figures must stack.
 * The accent #00ff41 is used only as a 1px line, never as a fill. */
:root {
  --ground: #0d1117;
  --card: #161b22;
  --ink: #e6edf3;
  --muted: #8b949e;
  --border: #30363d;
  --accent: #00ff41;
  --critical: #f85149;
  --high: #f0883e;
  --medium: #d29922;
  --low: #8b949e;
  --info: #58a6ff;
  --score-good: #3fb950;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.wrap { max-width: 1088px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.meta { color: var(--muted); font-size: 14px; }

a { color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* Top bar: 48px, wordmark + scope + links, 1px rule below. */
.topbar { border-bottom: 1px solid var(--border); }
.topbar-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 48px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.logo-mark { display: block; }
.wordmark { font-weight: 700; font-size: 18px; }
.scope { color: var(--muted); font-size: 14px; }
.top-links { margin-left: auto; display: flex; gap: 16px; }
.top-links a { font-size: 14px; }

h1 { font-size: 40px; line-height: 1.05; letter-spacing: -0.02em; margin: 32px 0 8px; }
h2 { font-size: 20px; font-weight: 400; color: var(--muted); margin: 0 0 12px; }
.lede { font-size: 18px; margin: 0 0 24px; max-width: 60ch; }

/* Scan form. */
#scan-form label { display: block; margin-bottom: 8px; }
.scan-row { display: flex; gap: 12px; }
#url-input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--border); border-radius: 0;
  font-family: var(--mono); font-size: 15px;
}
#url-input:focus { border-color: var(--ink); outline: none; }
button {
  font-family: inherit; font-size: 15px; cursor: pointer;
  background: var(--ink); color: var(--ground);
  border: 1px solid var(--ink); border-radius: 0; padding: 0 20px; height: 44px;
}
button:hover { background: #fff; }
.actions button, .example-link {
  height: 36px; padding: 0 14px; font-size: 14px;
  background: transparent; color: var(--ink); border: 1px solid var(--border);
}
.actions button:hover, .example-link:hover { border-color: var(--ink); background: transparent; }
.actions button:disabled { color: var(--muted); border-color: var(--border); cursor: default; }
.example-link { font-family: var(--mono); }
#status { min-height: 24px; color: var(--muted); margin: 12px 0; }
#empty-state { color: var(--muted); margin: 24px 0; }

/* Scan mode: indeterminate progress bar, terminal log, skeleton panels. */
.scan-progress { height: 2px; background: var(--border); margin-bottom: 24px; overflow: hidden; }
.scan-progress span { display: block; height: 100%; width: 40%; background: var(--accent); animation: scan-slide 1.2s linear infinite; }
@keyframes scan-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.scan-log { background: var(--card); border: 1px solid var(--border); padding: 12px; font-size: 13px; line-height: 1.7; margin: 0 0 12px; overflow-wrap: anywhere; }
.log-line { white-space: pre-wrap; }
.log-cmd { color: var(--ink); }
.log-step { color: var(--muted); }
.log-ok { color: var(--score-good); }
.log-err { color: var(--critical); }
.log-cursor { display: inline-block; width: 8px; height: 14px; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.skel { height: 14px; background: var(--border); margin: 10px 0; animation: skel-pulse 1.2s ease-in-out infinite; }
.skel:nth-child(2) { width: 85%; }
.skel:nth-child(3) { width: 60%; }
@keyframes skel-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
#score-value.scanning { animation: skel-pulse 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .scan-progress span, .log-cursor, .skel, #score-value.scanning { animation: none; }
  .scan-progress span { width: 100%; }
}

/* Answer: the score is the largest figure on the page. */
#answer { border-bottom: 1px solid var(--accent); padding-bottom: 24px; margin-bottom: 24px; }
#target-url { font-size: 14px; color: var(--muted); margin: 0 0 8px; overflow-wrap: anywhere; }
#score-line { margin: 0 0 12px; }
#score-value { font-size: 72px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
#score-grade { font-size: 28px; margin-left: 16px; }
#unreachable { font-size: 18px; }
.counts {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin: 0 0 12px; padding: 0; font-family: var(--mono); font-size: 14px;
}
.counts li { white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* Panels. */
.panel {
  background: var(--card); border: 1px solid var(--border);
  padding: 20px 20px 8px; margin: 0 0 24px;
}
.facts { display: grid; grid-template-columns: 220px 1fr; gap: 4px 16px; margin: 0 0 12px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-family: var(--mono); overflow-wrap: anywhere; }
.findings { margin-bottom: 12px; }
.finding { border-top: 1px solid var(--border); padding: 12px 0; }
.finding:first-child { border-top: 0; }
.finding h3 { font-size: 15px; margin: 0 0 4px; }
.finding p { margin: 0 0 4px; font-size: 14px; }
.finding .fix { color: var(--muted); }
.sev {
  display: inline-block; font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  border: 1px solid; padding: 1px 6px; margin-right: 8px; vertical-align: 1px;
}
.sev-critical { color: var(--critical); border-color: var(--critical); }
.sev-high { color: var(--high); border-color: var(--high); }
.sev-medium { color: var(--medium); border-color: var(--medium); }
.sev-low { color: var(--low); border-color: var(--low); }
.sev-info { color: var(--info); border-color: var(--info); }
.kev { color: var(--critical); font-family: var(--mono); font-size: 12px; margin-left: 8px; }
.empty-panel { color: var(--muted); font-size: 14px; }
#fix-content {
  background: var(--ground); border: 1px solid var(--border);
  padding: 12px; overflow-x: auto; font-family: var(--mono); font-size: 13px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
footer { color: var(--muted); font-size: 14px; padding: 8px 24px 32px; }

@media (max-width: 640px) {
  #score-value { font-size: 56px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
  .scan-row { flex-direction: column; }
  .scan-row button { width: 100%; }
}
