.proof-explorer {
  --proof-inset: clamp(1.15rem, 2.8vw, 2.5rem);
  position: relative;
  min-width: 0;
  margin-top: 2.5rem;
  border: 1px solid var(--color-rule, #282c36);
  border-radius: 1rem;
  background: #07080b;
  color: var(--color-paper, #f4f6fb);
}

.proof-explorer [hidden] { display: none; }

.proof-explorer__tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.45rem;
  gap: 0.35rem;
  border-bottom: 1px solid var(--color-rule, #282c36);
}

.proof-explorer__tabs button {
  display: flex;
  min-width: 0;
  min-height: 3.75rem;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--color-paper-dim, #a8abb7);
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.proof-explorer__tabs button span {
  color: var(--color-paper-faint, #727786);
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
}

.proof-explorer__tabs button[aria-selected="true"] {
  border-color: rgb(102 132 255 / 0.35);
  background: rgb(40 81 255 / 0.14);
  color: var(--color-paper, #f4f6fb);
}

.proof-explorer__tabs button[aria-selected="true"] span { color: var(--color-signal, #ff604d); }
.proof-explorer__tabs button:hover { color: var(--color-paper, #f4f6fb); }

.proof-explorer :is(button, select, a, summary, [role="tabpanel"]):focus-visible {
  outline: 2px solid var(--color-signal, #ff604d);
  outline-offset: 4px;
}

.proof-explorer__project { min-width: 0; }
.proof-explorer:not([data-proof-enhanced]) .proof-explorer__project + .proof-explorer__project { border-top: 1px solid var(--color-rule, #282c36); }

.proof-explorer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem var(--proof-inset);
}

.proof-explorer__eyebrow {
  margin: 0 0 0.5rem;
  color: var(--color-cobalt-text, #6684ff);
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  line-height: 1.55;
  text-transform: uppercase;
}

.proof-explorer__toolbar h3 {
  margin: 0;
  font-size: clamp(1.6rem, 2.3vw, 2.15rem);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.proof-explorer__screen-control {
  display: grid;
  gap: 0.45rem;
  width: min(100%, 17rem);
}

.proof-explorer__screen-control label {
  color: var(--color-paper-dim, #a8abb7);
  font-size: 0.75rem;
}

.proof-explorer__screen-control select {
  width: 100%;
  min-width: 0;
  min-height: 2.9rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-rule, #282c36);
  border-radius: 0.35rem;
  background: #10131c;
  color: var(--color-paper, #f4f6fb);
  color-scheme: dark;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.proof-explorer__scene {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  align-items: start;
  border-bottom: 1px solid var(--color-rule, #282c36);
}

.proof-explorer__screens { min-width: 0; }
.proof-explorer__figure { margin: 0; }

.proof-explorer__image-link {
  display: flex;
  height: clamp(22rem, 34vw, 29rem);
  align-items: center;
  justify-content: center;
  margin: 0 0.8rem;
  padding: clamp(0.65rem, 1.4vw, 1.25rem);
  border: 1px solid rgb(102 132 255 / 0.18);
  border-radius: 0.55rem;
  background: radial-gradient(ellipse at 50% 70%, #151c37, #0b0d14 80%);
}

.proof-explorer__image-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.proof-explorer__figure figcaption {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-height: 9.75rem;
  padding: 1.1rem var(--proof-inset);
}

.proof-explorer__figure figcaption > div > p:last-child {
  max-width: 46rem;
  margin: 0;
  color: var(--color-paper-dim, #a8abb7);
  font-size: 0.94rem;
  line-height: 1.6;
}

.proof-explorer__figure figcaption > a,
.proof-explorer__record {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.7rem;
  color: var(--color-paper, #f4f6fb);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.proof-explorer a:hover { color: var(--color-cobalt-text, #6684ff); }
.proof-explorer a > span[aria-hidden] { color: var(--color-signal, #ff604d); }

.proof-explorer__inspector {
  min-width: 0;
  margin: 0 0 1.5rem;
  padding: 0.5rem var(--proof-inset) 0 1.4rem;
}

.proof-explorer summary {
  width: fit-content;
  color: var(--color-paper, #f4f6fb);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.5;
  cursor: pointer;
}

.proof-explorer summary::marker { color: var(--color-cobalt-text, #6684ff); }
.proof-explorer__inspector > summary { padding-block: 0.5rem; }

.proof-explorer__story {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding-top: 1.25rem;
}

.proof-explorer h4 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.5;
}

.proof-explorer__story p,
.proof-explorer__story li {
  margin: 0;
  color: var(--color-paper-dim, #a8abb7);
  font-size: 0.88rem;
  line-height: 1.7;
}

.proof-explorer__story ul,
.proof-explorer__limits ul {
  margin: 0;
  padding-left: 1.1rem;
}

.proof-explorer__story li + li { margin-top: 0.5rem; }
.proof-explorer__story li::marker { color: var(--color-cobalt-text, #6684ff); }

.proof-explorer__limits {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "boundary record" "limits record";
  gap: 0.8rem 2rem;
  margin: 0 var(--proof-inset);
  padding: 1.3rem 0;
}

.proof-explorer__boundary {
  grid-area: boundary;
  max-width: 62rem;
  margin: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--color-signal, #ff604d);
  color: var(--color-paper, #f4f6fb);
  font-size: 0.84rem;
  line-height: 1.65;
}

.proof-explorer__not-established { grid-area: limits; }
.proof-explorer__not-established summary { color: var(--color-paper-dim, #a8abb7); font-size: 0.78rem; }
.proof-explorer__not-established > p { margin: 1rem 0 0.6rem; color: var(--color-paper-dim, #a8abb7); font-size: 0.76rem; }

.proof-explorer__not-established ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem 2rem;
  color: var(--color-paper-dim, #a8abb7);
  font-size: 0.76rem;
  line-height: 1.6;
}

.proof-explorer__record { grid-area: record; align-self: center; }
.proof-explorer:not([data-proof-enhanced]) .proof-explorer__figure + .proof-explorer__figure { margin-top: 1.5rem; }

.proof-explorer__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 920px) {
  .proof-explorer__scene { grid-template-columns: minmax(0, 1fr); }
  .proof-explorer__inspector { margin: 0; padding: 1rem var(--proof-inset); border-top: 1px solid var(--color-rule, #282c36); }
  .proof-explorer__story { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 0.5rem; }
  .proof-explorer__limits { grid-template-columns: minmax(0, 1fr); grid-template-areas: "boundary" "limits" "record"; gap: 1rem; }
  .proof-explorer__record { justify-self: start; }
}

@media (max-width: 700px) {
  .proof-explorer__tabs { gap: 0.2rem; padding: 0.35rem; }
  .proof-explorer__tabs button { min-height: 3.4rem; justify-content: center; gap: 0.4rem; padding: 0.75rem 0.25rem; font-size: 0.82rem; }
  .proof-explorer__tabs button span { display: none; }
  .proof-explorer__toolbar { display: grid; gap: 1.2rem; padding-block: 1.3rem; }
  .proof-explorer__screen-control { width: 100%; }
  .proof-explorer__image-link { height: 20rem; margin-inline: 0.5rem; padding: 0.55rem; }
  .proof-explorer__figure figcaption { min-height: 11rem; padding-block: 1rem; }
  .proof-explorer__figure figcaption > a { justify-self: start; }
  .proof-explorer__story { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .proof-explorer__not-established ul { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .proof-explorer__tabs button { transition: none; }
}

@media print {
  .proof-explorer { border: 0; background: white; color: black; }
  .proof-explorer__tabs,
  .proof-explorer__screen-control { display: none !important; }
  .proof-explorer .proof-explorer__project[hidden],
  .proof-explorer .proof-explorer__figure[hidden] { display: block !important; }
  .proof-explorer__project { margin-bottom: 2rem; }
  .proof-explorer__scene { display: block; }
  .proof-explorer__figure { break-inside: avoid; margin-bottom: 1rem; }
  .proof-explorer__image-link { height: 20rem; background: white; border-color: #aaa; }
  .proof-explorer__figure figcaption { min-height: 0; }
  .proof-explorer__story { grid-template-columns: 1fr 1fr; }
  .proof-explorer details::details-content { display: contents; content-visibility: visible; }
  .proof-explorer details > :not(summary) { display: block; }
  .proof-explorer__limits { display: block; }
  .proof-explorer :is(p, li, h3, h4, a, summary) { color: #111 !important; }
  .proof-explorer__record { text-decoration: underline; }
}
