.qubit-figure:is(.cn-light, .cn-dark) {
  --signal: var(--cn-coral);
  --study: var(--cn-stone);
  --surface: var(--cn-panel);
  --type: var(--cn-fg);
  --axis: var(--cn-muted);
  --grid: var(--cn-rule);
  --gutter: 2.25rem;
  min-width: 0;
  margin: 0;
  padding: clamp(1rem, 1.8vw, 1.75rem);
  border: 1px solid var(--grid);
  background: var(--surface);
  color: var(--type);
  font-family: var(--cn-sans);
  font-variant-numeric: tabular-nums;
}
.qubit-figure.cn-light {
  --surface: #fffdfa;
  --signal: #ad5042;
  --study: #326864;
  --grid: #c7cfca;
  margin-block: var(--cn-space-5);
  border-radius: .75rem;
}
.qubit-figure figcaption {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: var(--cn-space-1) var(--cn-space-3); padding-bottom: var(--cn-space-3);
  border-bottom: 1px solid var(--grid);
}
.qubit-figure figcaption strong { font: 690 clamp(1.18rem, 1.6vw, 1.5rem)/1.15 var(--cn-sans); letter-spacing: -.035em; }
.qubit-figure figcaption a { color: var(--axis); font-size: .84rem; line-height: 1.5; text-decoration: underline; text-underline-offset: .2em; white-space: nowrap; }
.qubit-figure figcaption a:hover { color: var(--type); }
.qubit-legend { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0 var(--cn-space-3); margin-top: var(--cn-space-3); }
.qubit-axis-unit { color: var(--axis); font-size: .8rem; }
.qubit-stage, .qubit-dates { position: relative; margin-inline: var(--gutter) .4rem; }
.qubit-stage { height: clamp(9rem, 12.5vw, 12rem); }
.step-plot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.qubit-line { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.qubit-guide { position: absolute; inset-inline: 0; border-top: 1px dashed var(--grid); }
.qubit-guide:first-child { border-top-style: solid; }
.qubit-guide > span { position: absolute; right: calc(100% + .65rem); transform: translateY(-50%); color: var(--axis); font-size: .76rem; line-height: 1; }
.qubit-dates { display: flex; justify-content: space-between; container-type: inline-size; color: var(--axis); font-size: .78rem; line-height: 1.25; }
.axis-mid { position: absolute; transform: translateX(-50%); }
@container (max-width: 260px) {
  .axis-mid { transform: translateX(-65%); }
  .qubit-dates > span:last-child:not(:only-child) { transform: translateX(.45rem); }
}
.qubit-mark { position: absolute; }
.mark-dot { position: absolute; top: -22px; left: -22px; display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; color: var(--type); }
.mark-dot::before {
  content: ""; width: 10px; height: 10px; box-sizing: content-box; border-radius: 50%;
  border: 3px solid var(--surface); background: var(--signal); box-shadow: 0 0 0 1.5px var(--signal);
  transition: box-shadow .15s ease, transform .15s ease;
}
.mark-dot:is(:hover, :focus-visible, [aria-expanded="true"])::before { transform: scale(1.12); box-shadow: 0 0 0 2px var(--signal), 0 0 0 6px var(--grid); }
.mark-value { position: absolute; bottom: 34px; left: 26px; color: var(--type); font-size: clamp(1.24rem, 1.75vw, 1.65rem); font-weight: 700; letter-spacing: -.045em; line-height: 1; white-space: nowrap; }
.align-end .mark-value { left: auto; right: 26px; }
.qubit-figure [hidden] { display: none; }
.qubit-figure .empty { margin-top: 1rem; color: var(--axis); }

.estimate-key { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .8rem; color: var(--axis); font-size: .8rem; line-height: 1.4; }
.headline-key, .milestone-method > summary { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.headline-key::before { content: ""; width: 1rem; height: 2px; background: var(--signal); }
.milestone-method > summary { min-height: 2rem; color: var(--study); text-decoration: underline dotted; text-underline-offset: .25em; cursor: pointer; }
.milestone-method > summary::-webkit-details-marker { display: none; }
.milestone-method > summary::before { content: ""; width: 7px; height: 7px; border: 2px solid var(--study); transform: rotate(45deg); }
.milestone-method > p { max-width: 60ch; margin: var(--cn-space-1) 0 var(--cn-space-3); color: var(--axis); }
.qubit-legend:has(.estimate-key) + .qubit-stage { height: clamp(12rem, 16.5vw, 15rem); }
.paper-mark .mark-dot::before {
  width: 11px; height: 11px; box-sizing: border-box; border: 2px solid var(--study); border-radius: 1px;
  background: var(--surface); transform: rotate(45deg); box-shadow: 0 0 0 3px var(--surface);
}
.paper-mark .mark-dot:is(:hover, :focus-visible, [aria-expanded="true"])::before {
  background: var(--study); box-shadow: 0 0 0 3px var(--surface); transform: rotate(45deg) scale(1.15);
}
.paper-year { color: var(--study); font-size: .76rem; font-weight: 650; }
.paper-plot .paper-year {
  position: absolute; bottom: calc(50% + .85rem); left: 50%;
  transform: translateX(-50%); padding-inline: 2px; background: var(--surface); line-height: 1;
}
.research-dated { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--cn-space-3); margin-top: var(--cn-space-4); padding-top: var(--cn-space-2); border-top: 1px solid var(--grid); }
.research-dated > span { color: var(--axis); font-size: .8rem; }
.paper-date { position: relative; min-width: 0; flex: 1 1 14rem; }
.paper-date .mark-dot {
  position: static; width: 100%; height: auto; min-height: 44px; border-radius: 0;
  display: flex; gap: .5rem; align-items: baseline; text-decoration: none; padding-block: .5rem;
}
.paper-date .mark-dot::before { flex: none; align-self: baseline; }
.paper-quantity { color: var(--type); font-size: .85rem; line-height: 1.45; }
.qubit-figure.paper-open .qubit-stage::after {
  content: ""; position: absolute; left: var(--paper-date); top: 12%; bottom: 8%;
  border-left: 1px dashed var(--study); pointer-events: none;
}
.paper-result { margin-top: .75rem; font-weight: 650; }
.paper-status, .paper-history { margin-top: .6rem; font-size: .79rem; }

.mark-detail:not([hidden]) { display: flex; }
.mark-detail.cn-light {
  position: fixed; z-index: 30; width: min(23rem, calc(100vw - 24px));
  flex-direction: column; overflow: hidden;
  background: var(--cn-bg); color: var(--cn-fg);
  border: 1px solid var(--cn-rule); border-top: 3px solid var(--cn-coral);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--cn-ink) 26%, transparent);
  text-align: left; font: 400 .94rem/1.5 var(--cn-sans); overflow-wrap: anywhere;
}
.mark-head, .mark-evidence { flex: none; padding: var(--cn-space-3) var(--cn-space-4); }
.mark-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-bottom: 1px solid var(--cn-rule); color: var(--cn-muted); font-size: .82rem; font-weight: 600; }
.mark-head button { display: grid; flex: none; place-items: center; width: 44px; height: 44px; margin: -.5rem -.5rem -.5rem 0; border: 0; background: transparent; color: var(--cn-fg); font-size: 1.35rem; }
.mark-head button:hover { background: var(--cn-panel); }
.mark-body { overflow-y: auto; padding: var(--cn-space-4); scrollbar-width: thin; overscroll-behavior: contain; }
.mark-source { line-height: 1.4; }
.mark-source a, .mark-detail .mark-evidence { color: var(--cn-fg); font-weight: 650; text-underline-offset: .16em; }
.mark-source span:not([data-source-title]) { color: var(--cn-muted); font-size: .82rem; }
.mark-source + .mark-source { margin-top: .5rem; }
.mark-metric { margin-top: .8rem; font-size: 1.15rem; font-weight: 700; line-height: 1.15; letter-spacing: -.035em; }
.mark-runtime { margin-top: .2rem; }
.mark-body .qualifications { margin-top: .75rem; color: var(--cn-fg); font-size: .86rem; line-height: 1.5; }
.mark-body .qualifications > div { display: block; margin-top: .55rem; }
.mark-body .qualifications dt { color: var(--cn-muted); }
.mark-evidence { border-top: 1px solid var(--cn-rule); font-size: .88rem; }
.mark-detail :focus-visible { outline-color: var(--cn-focus); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .mark-dot::before { transition: none; } }
