.diagnostic-page { min-height: 100svh; }
.diagnostic-hero { position: relative; min-height: 100svh; overflow: hidden; isolation: isolate; }
.diagnostic-field {
  position: absolute;
  inset: calc(var(--header-h) - 3%) -4% -3%;
  width: 108%;
  height: calc(100% - var(--header-h) + 6%);
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
  opacity: .62;
  transform: scale(1.06);
  animation: diagnostic-field-settle 6s linear both;
}
@keyframes diagnostic-field-settle { to { transform: scale(1); } }
.diagnostic-inner {
  position: relative;
  z-index: 1;
  width: min(var(--content-max), calc(100% - (var(--gutter) * 2)));
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(var(--header-h) + 56px) 0 74px;
  display: grid;
  grid-template-columns: minmax(390px, .9fr) minmax(500px, 1.1fr);
  align-items: center;
  gap: clamp(54px, 8vw, 128px);
}
.diagnostic-copy { max-width: 610px; }
.diagnostic-copy h1 {
  max-width: 10em;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 5.2vw, 76px);
  font-weight: 650;
  line-height: 1.34;
  letter-spacing: 0;
  word-break: keep-all;
}
.resume-line {
  width: 100%;
  min-height: 48px;
  margin-top: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 570;
  text-align: left;
  transition: border-color 180ms ease;
}
.resume-line:hover { border-color: var(--line); }
.resume-line span:last-child { color: var(--muted); font-size: 12px; }
.diagnostic-visual { margin: 0; transform: translate3d(var(--motion-x, 0), var(--motion-y, 0), 0); }
.diagnostic-visual .math-svg { width: 100%; aspect-ratio: 1.32 / 1; overflow: visible; }
.diagnostic-route { stroke-dasharray: 8 7; }
.route-node { transform-box: fill-box; transform-origin: center; animation: node-pulse 3.2s ease-in-out infinite; }
.node-2 { animation-delay: .35s; }.node-3 { animation-delay: .7s; }.node-4 { animation-delay: 1.05s; }
@keyframes node-pulse { 0%, 72%, 100% { transform: scale(1); } 82% { transform: scale(1.28); } }
.diagnostic-visual figcaption {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.diagnostic-visual figcaption span { max-width: 36ch; color: var(--muted); text-align: right; }
.diagnostic-progress { position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: 22px; height: 2px; background: var(--border); overflow: hidden; }
.diagnostic-progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; animation: diagnostic-progress 7s linear forwards; }
@keyframes diagnostic-progress { to { transform: scaleX(1); } }

.tool-index {
  width: min(1120px, calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
  padding: 112px 0 140px;
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(440px, 1.2fr);
  gap: clamp(48px, 8vw, 120px);
}
.tool-index-heading h2 { max-width: 12em; margin: 0; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.34; word-break: keep-all; }
.tool-list { border-top: 1px solid var(--fg); }
.tool-list a {
  width: 100%;
  min-height: 108px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 4px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, transform 180ms var(--ease);
}
.tool-list a:hover { background: var(--wash); transform: translateX(10px); }
.tool-number { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.tool-list strong { display: block; font-size: 18px; font-weight: 650; }
.tool-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }

.assessment-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100svh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 28px 90px oklch(20% 0.03 250 / .2);
}
.assessment-dialog::backdrop { background: oklch(20% 0.025 250 / .35); }
.assessment-shell { min-height: 590px; display: grid; grid-template-rows: auto 2px 1fr auto; }
.assessment-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.assessment-header > div { display: flex; gap: 14px; align-items: center; }
.assessment-kicker { font-size: 13px; font-weight: 650; }.assessment-header strong { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.dialog-close { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; }
.dialog-close:hover { background: var(--wash); }.dialog-close svg { width: 18px; height: 18px; }
.assessment-track { background: var(--border); }.assessment-track span { display: block; width: 33.333%; height: 100%; background: var(--accent); }
.assessment-body, .assessment-result { padding: 48px 46px 32px; }
.question-number { margin: 0 0 12px; color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.assessment-body h2, .assessment-result h2 { max-width: 15em; margin: 0; font-size: clamp(28px, 4vw, 38px); line-height: 1.4; word-break: keep-all; }
.assessment-options { margin-top: 34px; display: grid; gap: 10px; }
.assessment-option { min-height: 54px; display: flex; align-items: center; gap: 13px; padding: 0 16px; border: 1px solid var(--border); cursor: pointer; transition: border-color 180ms ease, background 180ms ease; }
.assessment-option:hover { border-color: var(--line); background: var(--wash); }
.assessment-option:has(input:checked) { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 7%, var(--surface)); }
.assessment-option input { width: 18px; height: 18px; accent-color: var(--accent); }
.assessment-error { min-height: 24px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }
.assessment-footer { min-height: 84px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 28px; border-top: 1px solid var(--border); }
.assessment-result > p:not(.question-number) { max-width: 48ch; color: var(--muted); }
.assessment-result dl { margin: 28px 0 0; border-top: 1px solid var(--border); }
.assessment-result dl div { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.assessment-result dt { font-weight: 600; }.assessment-result dd { margin: 0; font-family: var(--font-mono); }

@media (max-width: 900px) {
  .diagnostic-inner { grid-template-columns: 1fr; align-content: center; gap: 20px; padding-top: calc(var(--header-h) + 34px); padding-bottom: 68px; }
  .diagnostic-copy h1 { font-size: clamp(40px, 7vw, 58px); }
  .diagnostic-visual { width: min(620px, 100%); justify-self: center; }
  .diagnostic-visual .math-svg { height: min(34svh, 310px); aspect-ratio: auto; }
}
@media (max-width: 620px) {
  .diagnostic-inner { width: calc(100% - 32px); align-content: start; gap: 12px; padding-top: calc(var(--header-h) + 24px); padding-bottom: 54px; }
  .diagnostic-copy .eyebrow { margin-bottom: 10px; }
  .diagnostic-copy h1 { font-size: clamp(34px, 9.4vw, 42px); }.diagnostic-copy h1 br { display: none; }
  .diagnostic-copy .lede { margin-top: 12px; font-size: 14px; line-height: 1.7; }
  .diagnostic-copy .hero-actions { margin-top: 18px; }
  .resume-line { margin-top: 20px; }
  .diagnostic-visual .math-svg { height: 248px; }
  .diagnostic-visual figcaption { padding-top: 8px; font-size: 11px; }.diagnostic-visual figcaption span { max-width: 24ch; }
  .diagnostic-progress { left: 16px; right: 16px; bottom: 10px; }
  .tool-index { width: calc(100% - 32px); grid-template-columns: 1fr; gap: 38px; padding: 88px 0 110px; }
  .tool-list a { min-height: 98px; grid-template-columns: 36px 1fr auto; }
  .assessment-dialog { width: calc(100% - 20px); max-height: calc(100svh - 20px); }
  .assessment-shell { min-height: min(680px, calc(100svh - 20px)); }
  .assessment-header { padding: 0 18px; }.assessment-body, .assessment-result { padding: 32px 20px 24px; }
  .assessment-footer { padding: 14px 18px; }
}
@media (max-height: 740px) and (max-width: 900px) {
  .diagnostic-copy .lede, .resume-line { display: none; }
  .diagnostic-visual .math-svg { height: 210px; }
}
@media (prefers-reduced-motion: reduce) {
  .diagnostic-field, .diagnostic-copy, .diagnostic-visual, .route-node, .diagnostic-progress span { animation: none !important; transform: none !important; }
  .draw-path { stroke-dashoffset: 0 !important; }
}
