:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --ink: #1f252d;
  --muted: #617080;
  --line: #d8e0e8;
  --blue: #2166c2;
  --teal: #087f7a;
  --green: #218044;
  --amber: #a65f00;
  --red: #bb3030;
  --violet: #6d45b8;
  --shadow: 0 16px 40px rgba(31, 37, 45, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border: 2px solid var(--teal);
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 44%, var(--teal) 44%, var(--teal) 56%, transparent 56%),
    linear-gradient(0deg, transparent 44%, var(--blue) 44%, var(--blue) 56%, transparent 56%);
}

.nav-links,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a,
.site-footer a {
  text-decoration: none;
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--blue);
}

.workspace-band {
  padding: 34px clamp(16px, 4vw, 48px) 26px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.workspace,
.content-shell,
.support-shell,
.report-layout,
.tests-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.scan-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.scan-title-block {
  max-width: 720px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin: 22px 0 8px;
  font-size: 1rem;
}

.lede,
.status-copy,
.guide-card p,
.support-shell p,
.article-copy p,
.article-copy li {
  color: var(--muted);
  line-height: 1.55;
}

.lede {
  margin: 12px 0 0;
  max-width: 650px;
}

.run-actions,
.support-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.button:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.button.primary:hover:not(:disabled) {
  background: #174f99;
  color: #ffffff;
}

.button.compact {
  width: fit-content;
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.92rem;
}

.summary-grid,
.tests-grid,
.report-layout,
.guide-grid,
.analysis-grid {
  display: grid;
  gap: 16px;
}

.summary-grid {
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.9fr);
}

.tests-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 22px clamp(16px, 4vw, 48px);
}

.report-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.analysis-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.score-panel,
.quick-panel,
.test-panel,
.report-panel {
  padding: 20px;
}

.score-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 18px;
}

.score-wrap {
  position: relative;
  width: 180px;
  height: 180px;
}

.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-weight: 840;
  font-size: 2.15rem;
}

.score-number small {
  align-self: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 760;
}

.fact-list,
.metric-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.fact-list div,
.metric-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 24px;
  border-bottom: 1px solid var(--surface-2);
  padding-bottom: 8px;
}

.fact-list dt,
.metric-list dt {
  color: var(--muted);
}

.fact-list dd,
.metric-list dd {
  margin: 0;
  font-weight: 760;
  text-align: right;
}

.test-panel {
  min-height: 330px;
}

.browser-panel {
  grid-column: span 2;
}

.test-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.test-state {
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 780;
  text-align: center;
}

.test-state.running {
  border-color: rgba(33, 102, 194, 0.35);
  color: var(--blue);
  background: rgba(33, 102, 194, 0.08);
}

.test-state.good {
  border-color: rgba(33, 128, 68, 0.35);
  color: var(--green);
  background: rgba(33, 128, 68, 0.08);
}

.test-state.warn {
  border-color: rgba(166, 95, 0, 0.35);
  color: var(--amber);
  background: rgba(166, 95, 0, 0.09);
}

.test-state.bad {
  border-color: rgba(187, 48, 48, 0.35);
  color: var(--red);
  background: rgba(187, 48, 48, 0.08);
}

.progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms ease;
}

.gpu-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121821;
}

.report-band {
  padding: 28px clamp(16px, 4vw, 48px);
  background: var(--surface-2);
  border-block: 1px solid var(--line);
}

.balance-band {
  padding: 28px clamp(16px, 4vw, 48px);
  background: #fbfcfd;
  border-top: 1px solid var(--line);
}

.balance-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.balance-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.balance-head p {
  max-width: 760px;
  margin-bottom: 0;
}

.balance-pill {
  min-width: 142px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.balance-pill.good {
  border-color: rgba(33, 128, 68, 0.35);
  color: var(--green);
  background: rgba(33, 128, 68, 0.08);
}

.balance-pill.warn {
  border-color: rgba(166, 95, 0, 0.35);
  color: var(--amber);
  background: rgba(166, 95, 0, 0.09);
}

.balance-pill.bad {
  border-color: rgba(187, 48, 48, 0.35);
  color: var(--red);
  background: rgba(187, 48, 48, 0.08);
}

.balance-meter {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.balance-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 760;
}

.balance-scale span:nth-child(2) {
  text-align: center;
}

.balance-scale span:nth-child(3) {
  text-align: right;
}

.balance-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red) 0%, #f5b33a 25%, var(--green) 50%, #f5b33a 75%, var(--red) 100%);
}

.balance-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  border: 4px solid #34445d;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(31, 37, 45, 0.18);
  transform: translate(-50%, -50%);
  transition: left 220ms ease;
}

.analysis-grid {
  margin-top: 16px;
}

.analysis-card {
  padding: 20px;
}

.analysis-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.findings-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.findings-list li {
  border-left: 4px solid var(--blue);
  padding: 2px 0 2px 12px;
  color: var(--muted);
  line-height: 1.45;
}

.findings-list li.good {
  border-color: var(--green);
}

.findings-list li.warn {
  border-color: var(--amber);
}

.findings-list li.bad {
  border-color: var(--red);
}

.report-output {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
  color: var(--ink);
  line-height: 1.45;
}

.guides-band,
.support-band {
  padding: 34px clamp(16px, 4vw, 48px);
}

.guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.guide-card {
  display: block;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.guide-card:hover {
  border-color: var(--blue);
}

.guide-card span {
  color: var(--violet);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.guide-card strong {
  display: block;
  margin-top: 12px;
  font-size: 1.06rem;
  line-height: 1.3;
}

.guide-card p {
  margin: 10px 0 0;
}

.support-band {
  background: #fbfcfd;
  border-top: 1px solid var(--line);
}

.support-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.support-shell p {
  max-width: 680px;
  margin: 10px 0 0;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(16px, 4vw, 48px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.article-shell {
  width: min(860px, calc(100% - 32px));
  margin: 32px auto;
}

.article-copy {
  padding: 28px;
}

.article-copy h1 {
  font-size: 2rem;
}

.article-copy p,
.article-copy li {
  font-size: 1rem;
}

.article-copy ul,
.article-copy ol {
  padding-left: 22px;
}

.article-copy a {
  color: var(--blue);
}

@media (max-width: 920px) {
  .scan-head,
  .support-shell,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-grid,
  .tests-grid,
  .report-layout,
  .guide-grid,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .browser-panel {
    grid-column: auto;
  }

  .score-panel {
    grid-template-columns: 1fr;
  }

  .score-wrap {
    margin: 0 auto;
  }

  .balance-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.9rem;
  }

  h1 {
    font-size: 1.9rem;
  }

  .run-actions,
  .support-actions {
    width: 100%;
  }

  .button {
    width: 100%;
  }

  .score-wrap {
    width: 160px;
    height: 160px;
  }

  .score-wrap canvas {
    width: 160px;
    height: 160px;
  }

  .fact-list div,
  .metric-list div {
    flex-direction: column;
    gap: 2px;
  }

  .fact-list dd,
  .metric-list dd {
    text-align: left;
  }
}
