/* WhySlow design system: light, on a very subtle off-white, with one purple accent.
 *
 * Colour rule: purple is for actions and selection (buttons, links, focus, the selected
 * device). Red, amber, green and grey are only for data (impact and ratings). Never mix them.
 * Type: Geist for interface and headings, JetBrains Mono for technical values, and
 * Newsreader italic for one accent phrase per page at most.
 * Spacing uses a 4px scale; cards use --radius, controls --radius-md.
 */

/* ---------- Fonts (self-hosted, SIL OFL 1.1; see fonts/LICENSE-*) ---------- */
@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Surfaces: a very subtle cool off-white page, white cards. */
  --paper: #f9f9fb;          /* page background */
  --surface: #ffffff;        /* cards and panels */
  --surface-2: #f4f4f8;      /* inputs and raised elements */
  --surface-3: #ececf2;      /* hover on raised elements */
  --line: #e6e6ee;           /* borders and dividers */
  --line-2: #d6d7e1;         /* stronger borders, input outlines */

  /* Text */
  --ink: #0e1018;
  --ink-2: #3b3f4c;
  --ink-3: #5f6475;

  /* Accent: actions and selection only. */
  --brand: #6e5bff;          /* accent marks, focus, selection */
  --brand-text: #5543e8;     /* links and accent text (AA on white) */
  --brand-btn: #6e5bff;      /* primary button fill (white text passes AA) */
  --brand-btn-hover: #5b48f0;
  --on-brand: #ffffff;
  --brand-tint: rgba(110, 91, 255, 0.07);
  --brand-ring: rgba(110, 91, 255, 0.25);

  /* Data colours */
  --high: #d93a3f;
  --medium: #e8a23a;
  --good: #30a46c;
  --info: #8b8fa0;
  --high-text: #c62a2f;
  --medium-text: #a35d00;
  --good-text: #18794e;
  --info-text: #5f6475;

  /* Shape and depth */
  --radius: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 18, 27, 0.04), 0 8px 24px -12px rgba(16, 18, 27, 0.1);
  --shadow-lg: 0 1px 2px rgba(16, 18, 27, 0.05), 0 24px 60px -24px rgba(16, 18, 27, 0.2);
  --ease: 160ms cubic-bezier(0.2, 0, 0, 1);

  /* Type */
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --heading: var(--sans);
  /* Display headlines: neo-grotesque, regular weight, tight tracking. */
  --display: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display-tracking: -0.04em;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Newsreader", ui-serif, Georgia, serif;

  --content: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  font: 400 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; transition: color var(--ease), text-decoration-color var(--ease); }
a:hover { color: var(--ink); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-ring); color: var(--ink); }
code { font-family: var(--mono); font-size: 0.82em; background: var(--surface-2); border: 1px solid var(--line); padding: 0.1em 0.4em; border-radius: var(--radius-sm); color: var(--ink-2); }
h1, h2, h3, h4 { margin: 0; font-family: var(--heading); font-weight: 650; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); }
h2 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; }
.break { word-break: break-all; }
.pad { padding: 16px; }
.label { font: 500 0.75rem/1.3 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow { font: 500 0.75rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 12px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--brand-btn); color: var(--on-brand); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 650 1.1rem/1 var(--sans); letter-spacing: -0.02em; }
.brand:hover { color: var(--ink); }
.logo { width: 24px; height: 24px; flex: none; }
.logo-frame { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.logo-dot { fill: var(--brand); }
.brand-small { font-size: 1rem; }
.brand-small .logo { width: 20px; height: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-md);
  font: 550 0.9rem/1 var(--sans); letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.btn-primary { background: var(--brand-btn); color: var(--on-brand); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 6px 16px -8px rgba(110, 91, 255, 0.6); }
.btn-primary:hover { background: var(--brand-btn-hover); color: var(--on-brand); }
.btn-primary:active { transform: translateY(1px); }
.btn-quiet { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { background: var(--surface-3); border-color: var(--line-2); color: var(--ink); }
.btn[disabled] { opacity: 0.7; cursor: progress; transform: none; }

/* ---------- Header and footer ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 70px; padding: 0 var(--gutter);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { width: 100%; max-width: var(--content); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.foot { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.875rem; }
.foot-inner { max-width: var(--content); margin: 0 auto; padding: 32px var(--gutter) 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.foot p { max-width: 620px; }

.wrap { max-width: var(--content); margin: 0 auto; padding: 32px var(--gutter) 72px; }
.wrap.narrow { max-width: 820px; padding-top: 72px; }

/* ---------- Report bar ---------- */
.is-report .topbar { position: static; }
.reportbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.reportbar-inner { max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter); height: 56px; display: flex; align-items: center; gap: 12px; }
.reportbar-host { font: 600 0.95rem/1 var(--sans); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reportbar-actions { margin-left: auto; display: flex; gap: 8px; }
.reportbar .btn { height: 34px; padding: 0 12px; font-size: 0.85rem; }
.score-pill {
  display: inline-grid; place-items: center; min-width: 40px; height: 28px; padding: 0 8px; border-radius: 999px;
  font: 600 0.85rem/1 var(--mono); color: var(--on-rc); background: var(--rc);
}

/* Rating colour sets: --rc for marks, --rt for text, --on-rc for text on a --rc fill. */
.rating-good { --rc: var(--good); --rt: var(--good-text); --on-rc: #08130e; }
.rating-average { --rc: var(--medium); --rt: var(--medium-text); --on-rc: #1a1206; }
.rating-poor { --rc: var(--high); --rt: var(--high-text); --on-rc: #fff; }
.rating-na { --rc: var(--info); --rt: var(--info-text); --on-rc: #fff; }

/* ---------- Summary ---------- */
.summary { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin: 16px 0 28px; padding: 28px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-id h1 { font: 400 clamp(2.2rem, 5vw, 3.4rem)/1.1 var(--display); letter-spacing: var(--display-tracking); word-break: break-all; }
.page-id h1 a { color: var(--ink); text-decoration: none; }
.page-id h1 a:hover { color: var(--brand-text); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; }
.chips li { font: 500 0.75rem/1 var(--mono); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
.verdict { margin-top: 16px; font-size: 1.05rem; color: var(--ink-2); }
.verdict strong { font-weight: 600; }
.t-high { color: var(--high-text); }
.t-medium { color: var(--medium-text); }

.score { position: relative; width: 148px; height: 148px; flex: none; }
.score svg { width: 100%; height: 100%; }
.score circle { fill: none; stroke-width: 9; }
.score .track { stroke: var(--surface-2); }
.score .arc { stroke: var(--rc); stroke-linecap: round; }
.score-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-num span { font: 600 3.1rem/1 var(--mono); letter-spacing: -0.04em; color: var(--rt); }
.score-num small { font: 500 0.66rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }

/* ---------- Metrics ---------- */
.metrics { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 40px; }
.metric { position: relative; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--rc); opacity: 0.9; }
.metric-key { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-key abbr { text-decoration: none; font: 600 0.78rem/1 var(--mono); letter-spacing: 0.04em; color: var(--ink); }
.rating-pill { font: 500 0.68rem/1 var(--sans); color: var(--rt); background: color-mix(in srgb, var(--rc) 14%, transparent); border-radius: 999px; padding: 4px 8px; white-space: nowrap; }
.metric-name { font-size: 0.82rem; color: var(--ink-3); margin-top: 6px; }
.metric-value { font: 600 2rem/1.1 var(--mono); letter-spacing: -0.04em; margin-top: 10px; }
.metric.rating-na .metric-value { font: 500 1.05rem/1.3 var(--sans); color: var(--ink-2); letter-spacing: 0; }
.metric-note { font-size: 0.8rem; color: var(--ink-3); line-height: 1.5; margin-top: 8px; }
.scale { display: block; width: 100%; height: 10px; margin-top: 14px; overflow: visible; }
.scale .seg-good { fill: var(--good); }
.scale .seg-average { fill: var(--medium); }
.scale .seg-poor { fill: var(--high); }
.scale .marker { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.scale-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font: 0.68rem/1.2 var(--mono); color: var(--ink-3); white-space: nowrap; }
.scale-legend span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.lg-good::before { background: var(--good); }
.lg-poor::before { background: var(--high); }

.warnings { background: color-mix(in srgb, var(--medium) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--medium) 35%, var(--line)); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 28px; }
.warnings ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }

/* ---------- Lens: screenshot + findings ---------- */
.lens { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) {
  .lens { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
  .shot-col { position: sticky; top: 72px; }
  .shot-scroll { max-height: calc(100vh - 170px); }
}
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; font: 500 0.75rem/1.3 var(--sans); color: var(--ink-3); margin: 0; }
.key::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--c); vertical-align: 1px; }

.impact-high { --c: var(--high); --ct: var(--high-text); --on-c: #fff; }
.impact-medium { --c: var(--medium); --ct: var(--medium-text); --on-c: #1a1206; }
.impact-info { --c: var(--info); --ct: var(--info-text); --on-c: #fff; }

.shot-scroll {
  overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center;
  background-color: var(--surface);
  background-color: var(--surface-2);
  background-image: radial-gradient(circle, rgba(16, 18, 27, 0.08) 1px, transparent 1.2px);
  background-size: 16px 16px;
}
.shot-col > .muted { margin-top: 10px; }
.shot { position: relative; display: inline-block; margin: 0; max-width: 100%; vertical-align: top; border-radius: var(--radius-md); overflow: hidden; box-shadow: 0 0 0 1px var(--line-2), var(--shadow); background: #fff; }
.shot img { display: block; max-width: 100%; height: auto; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* Highlight outlines: a solid outline with a soft fill. Hovered or selected boxes get stronger;
   the rest fade back so the selected element is clear. */
.box { cursor: pointer; outline: none; }
.box-rect { fill: var(--c); fill-opacity: 0.1; stroke: var(--c); stroke-opacity: 0.95; stroke-width: 2; vector-effect: non-scaling-stroke; transition: fill-opacity var(--ease), stroke-width var(--ease), opacity var(--ease); }
.box-badge { fill: var(--c); stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: opacity var(--ease); }
.box-num { fill: var(--on-c); font-family: var(--mono); font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.box:hover .box-rect, .box:focus-visible .box-rect, .box.is-active .box-rect, .box:target .box-rect { fill-opacity: 0.24; stroke-width: 3.5; }
.overlay:has(.box.is-active) .box:not(.is-active) .box-rect { opacity: 0.3; }
.overlay:has(.box.is-active) .box-tag:not(.is-active) .box-badge { opacity: 0.45; }
.box.is-flash .box-rect { animation: flash 0.9s ease-out 2; }
@keyframes flash { 0% { fill-opacity: 0.55; } 100% { fill-opacity: 0.1; } }

/* ---------- Findings ---------- */
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.finding {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color var(--ease), box-shadow var(--ease), background-color var(--ease);
  scroll-margin-top: 80px;
}
.finding:hover { border-color: var(--line-2); }
.finding.is-active, .finding:target { border-color: color-mix(in srgb, var(--c) 70%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.finding:focus { outline: none; }
.finding > details > summary { list-style: none; }
.finding > details > summary::-webkit-details-marker { display: none; }
.finding-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; border-radius: var(--radius); }
.num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--c); color: var(--on-c); font: 700 0.85rem/1 var(--mono); }
.finding-title { min-width: 0; }
.finding-head h3 { display: block; font: 600 1.02rem/1.35 var(--sans); letter-spacing: -0.01em; }
.finding-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }
.impact-tag { font: 500 0.75rem/1.3 var(--sans); color: var(--ct); }
.impact-tag::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.savings { font: 0.75rem/1.3 var(--mono); color: var(--ink-3); }
.chev { width: 8px; height: 8px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); transition: transform var(--ease); margin-right: 6px; }
details[open] > .finding-head .chev { transform: rotate(-135deg) translateY(-2px); }
.finding-body { padding: 4px 20px 20px 60px; border-top: 1px solid var(--line); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 16px 0 12px; }
.facts dt { font: 500 0.7rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.facts dd { margin: 4px 0 0; font: 500 0.85rem/1.3 var(--mono); color: var(--ink); }
.explain { color: var(--ink-2); margin-bottom: 14px; }
.fix { background: var(--brand-tint); border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent); border-radius: var(--radius-md); padding: 12px 16px; color: var(--ink); }
.fix h4 { font: 600 0.72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-text); margin-bottom: 6px; }
.no-pos-note { font-size: 0.875rem; color: var(--ink-3); margin-top: 12px; }
.targets { margin-top: 16px; }
.targets > summary { cursor: pointer; font: 500 0.85rem/1.4 var(--sans); color: var(--ink-2); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font: 600 0.7rem/1 var(--mono); vertical-align: 1px; }
.elements { list-style: none; margin: 8px 0 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.elements li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.locate { font: 500 0.8rem/1.4 var(--sans); white-space: nowrap; }
.no-pos { font: 500 0.7rem/1.6 var(--mono); color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 0 6px; white-space: nowrap; }
.el-label { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.snippet { display: block; width: 100%; font-size: 0.74rem; color: var(--ink-3); overflow-wrap: anywhere; white-space: normal; }
.finding-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-top: 16px; }
.doc-link { font: 500 0.85rem/1.4 var(--sans); }
.doc-link::after { content: " →"; }
.audit-id { color: var(--ink-3); font-size: 0.82rem; }
.all-clear { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--ink-2); }

/* ---------- Others and conditions ---------- */
.others { margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.others summary { cursor: pointer; font: 600 1rem/1.3 var(--sans); }
.others ul { margin: 12px 0 2px; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); }
.others code.audit-id { font-size: 0.72rem; }

.conditions { margin-top: 48px; }
.conditions > p.muted { margin: 6px 0 16px; }
.conditions-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 0.92rem; }
.conditions-table th, .conditions-table td { text-align: left; padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.conditions-table tr:last-child th, .conditions-table tr:last-child td { border-bottom: 0; }
.conditions-table th { width: 30%; font: 500 0.75rem/1.6 var(--mono); letter-spacing: 0.03em; color: var(--ink-3); }
.conditions-table td { color: var(--ink-2); }
.share { margin-top: 16px; font-size: 0.875rem; color: var(--ink-3); word-break: break-all; }
.share a { margin-left: 6px; font-family: var(--mono); font-size: 0.82rem; }

/* ---------- Status pages and the scanner ---------- */
.status-card { display: flex; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.status-card > div { min-width: 0; }
.status-card.is-failed { border-color: color-mix(in srgb, var(--high) 45%, var(--line)); }
.status-card.is-refused { border-color: color-mix(in srgb, var(--medium) 45%, var(--line)); }
.status-card.is-failed .eyebrow { color: var(--high-text); }
.status-card.is-refused .eyebrow { color: var(--medium-text); }
.status-card .page-id h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.status-title { font: 400 clamp(2.2rem, 5vw, 3rem)/1.1 var(--display); letter-spacing: var(--display-tracking); margin-bottom: 12px; }
.status-text { margin: 20px 0 6px; font-size: 1.05rem; }
.reason { margin: 20px 0 8px; font-size: 1.1rem; color: var(--ink); }
.status-help { margin-top: 10px; color: var(--ink-2); }
.status-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.status-card .btn { height: 44px; }

.scanner { width: 140px; flex: none; }
.sc-page { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 2; }
.sc-block { fill: var(--surface-3); }
.sc-line { fill: var(--line-2); }
.sc-find { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; animation: find 4.8s ease-in-out infinite; }
.sc-find-1 { stroke: var(--high); animation-delay: 0.9s; }
.sc-find-2 { stroke: var(--medium); animation-delay: 2s; }
.sc-find-3 { stroke: var(--info); animation-delay: 2.8s; }
.sc-sweep { fill: var(--brand); filter: drop-shadow(0 0 6px var(--brand)); animation: sweep 2.4s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: translateY(4px); } to { transform: translateY(293px); } }
@keyframes find { 0%, 8% { opacity: 0; } 18%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { height: 60px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 14px; }
  .metric-value { font-size: 1.6rem; }
  .summary { flex-direction: column-reverse; align-items: flex-start; gap: 18px; padding: 22px; }
  .score { width: 112px; height: 112px; }
  .score-num span { font-size: 2.4rem; }
  .finding-body { padding-left: 18px; padding-right: 18px; }
  .conditions-table th { width: 40%; }
  .status-card { flex-direction: column; align-items: flex-start; padding: 24px; }
  .scanner { width: 100px; }
  .reportbar-actions .btn:last-child { display: none; }
}

/* Page transitions: moving between the front page and a report cross-fades instead of
   flashing white. Browsers without cross-document view transitions just navigate. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .topbar { view-transition-name: topbar; }
  ::view-transition-old(root) { animation: 180ms cubic-bezier(0.4, 0, 1, 1) both vt-out; }
  ::view-transition-new(root) { animation: 360ms cubic-bezier(0.22, 1, 0.36, 1) 60ms both vt-in; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .sc-find { opacity: 1; }
}
