.newgen-post {
  --newgen-border: #d7d7d7;
  --newgen-muted: #666;
  --newgen-panel: #f7f7f7;
}

.newgen-post :where(p, li) {
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  line-height: 1.7;
}

.newgen-summary {
  max-width: 44rem;
  margin: .6rem 0 1.5rem !important;
}

.newgen-hero {
  box-sizing: border-box;
  margin-bottom: 2rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border: 1px solid var(--newgen-border);
  background: var(--newgen-panel);
}

.newgen-eyebrow {
  margin: 0 0 .6rem !important;
  color: var(--newgen-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem !important;
  letter-spacing: .14em;
}

.newgen-hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -.055em;
}

.newgen-hero .post-subtitle {
  max-width: 38rem;
  margin: 1rem 0 1.3rem;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
}

.newgen-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
}

.newgen-demo-jump {
  color: #222;
  font: .72rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-underline-offset: .2rem;
}

.newgen-code-button {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  padding: .72rem .9rem;
  border: 1px solid #222;
  color: #fff;
  background: #222;
  text-decoration: none;
}

.newgen-code-button:hover {
  color: #222;
  background: transparent;
  text-decoration: none;
}

.newgen-code-button code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: .77rem;
}

.newgen-thesis {
  margin: 1.6rem auto !important;
  max-width: 38ch;
  padding-left: 1rem;
  border-left: 3px solid #222;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem) !important;
  font-weight: 600;
}

.aag-demo {
  box-sizing: border-box;
  width: 100%;
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid var(--newgen-border);
  background: #fbfbfb;
}

.aag-demo-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--newgen-border);
}

.aag-demo-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.aag-demo-head .newgen-eyebrow {
  margin-bottom: .25rem !important;
}

.aag-mode-tabs {
  display: flex;
  gap: .35rem;
}

.aag-mode-tabs button,
.aag-condition-controls button {
  padding: .46rem .7rem;
  border: 1px solid #aaa;
  color: #333;
  background: #fff;
  font: .68rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}

.aag-mode-tabs button.is-active,
.aag-condition-controls button.is-active {
  border-color: #222;
  color: #fff;
  background: #222;
}

.aag-mode-tabs button:disabled,
.aag-condition-controls button:disabled {
  color: #aaa;
  cursor: not-allowed;
}

.aag-demo-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem;
}

.aag-demo-controls button {
  padding: .42rem .62rem;
  border: 1px solid #bbb;
  color: #333;
  background: transparent;
  font: .68rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}

.aag-demo-controls button:hover,
.aag-demo-controls button:focus-visible {
  border-color: #333;
}

.aag-demo-controls button.is-active {
  border-color: #222;
  color: #fff;
  background: #222;
}

.aag-demo-controls .aag-resample {
  margin-left: .35rem;
  border-color: #5b458f;
  color: #5b458f;
}

.aag-demo-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1fr) 2.5rem minmax(0, 1fr);
  align-items: center;
  gap: .25rem;
  padding: 1rem 0 .5rem;
}

.aag-demo-stage {
  min-width: 0;
  margin: 0;
}

.aag-demo-stage figcaption {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  min-height: 2.4rem;
  color: var(--newgen-muted);
  font: .65rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.aag-demo-stage figcaption b {
  color: #222;
  font-size: .7rem;
  text-transform: uppercase;
}

.aag-demo-stage figcaption span {
  text-align: right;
}

.aag-demo-stage svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  border: 1px solid #dedede;
  background: #fff;
}

.aag-flow-arrow {
  display: grid;
  justify-items: center;
  gap: .15rem;
  color: #777;
  text-align: center;
}

.aag-flow-arrow span {
  font: .6rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.3;
  text-transform: uppercase;
}

.aag-flow-arrow b {
  color: #333;
  font-size: 1.25rem;
  font-weight: 400;
}

.aag-demo-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  margin: .55rem 0 0 !important;
  color: var(--newgen-muted);
  font: .65rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  text-align: center;
}

.aag-dot {
  display: inline-block;
  width: .52rem;
  aspect-ratio: 1;
  border-radius: 50%;
}

.aag-dot.solid { background: #5b458f; }
.aag-dot.ring { box-sizing: border-box; border: 2px solid #5b458f; background: #fff; }

.aag-demo .plot-guide {
  fill: none;
  stroke: #dedede;
  stroke-width: 1;
}

.aag-demo .plot-axis {
  stroke: #eeeeee;
  stroke-width: 1;
}

.aag-demo .plot-point {
  cursor: crosshair;
  transition: opacity .12s;
}

.aag-demo .plot-fresh {
  fill: #fff;
  stroke-width: 1.35;
}

.aag-demo[data-highlight] .plot-point:not(.is-highlighted) {
  opacity: .13;
}

.aag-demo .plot-point.is-highlighted {
  stroke: #111;
  stroke-width: 2;
  opacity: 1;
}

/* Step-through AAG theory demo */
.aag-demo-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .85rem;
  padding: .55rem 0;
  border-top: 1px solid var(--newgen-border);
  border-bottom: 1px solid var(--newgen-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.aag-demo-status strong {
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.aag-demo-status span {
  color: var(--newgen-muted);
  font-size: .68rem;
  text-align: right;
}

#aag-theory-plot {
  display: block;
  width: 100%;
  height: auto;
  margin: .65rem 0;
  background: #fff;
}

.aag-demo .aag-demo-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
  padding-top: .75rem;
  border-top: 1px solid var(--newgen-border);
}

.aag-demo .aag-demo-controls button {
  margin: 0;
  padding: .52rem .72rem;
  border: 1px solid #aaa;
  color: #333;
  background: #fff;
}

.aag-demo .aag-demo-controls button:hover:not(:disabled),
.aag-demo .aag-demo-controls button:focus-visible:not(:disabled) {
  border-color: #333;
  background: #f1f1f1;
}

.aag-demo .aag-demo-controls button:disabled {
  color: #aaa;
  background: #f6f6f6;
  cursor: not-allowed;
}

.aag-demo .aag-demo-controls button[data-current="true"] {
  border-color: #222;
  color: #fff;
  background: #222;
}

.aag-condition-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding-top: .65rem;
  color: var(--newgen-muted);
  font: .65rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.aag-condition-controls[hidden] {
  display: none;
}

.aag-demo .plot-frame {
  fill: none;
  stroke: #dedede;
  stroke-width: 1;
}

.aag-demo .plot-projection {
  stroke: #8d3150;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.aag-demo .plot-projection-shadow {
  stroke: #8d3150;
  stroke-width: .65;
  opacity: .2;
}

.aag-demo .plot-conditional-projection {
  stroke: #16706b;
  stroke-width: 2;
  stroke-dasharray: 3 3;
}

.aag-demo .plot-conditional-shadow {
  stroke: #16706b;
  stroke-width: .75;
  opacity: .28;
}

.aag-demo .plot-condition-point {
  fill: none;
  stroke-width: 1.25;
}

.aag-demo .plot-condition-0 {
  stroke: #5b458f;
}

.aag-demo .plot-condition-1 {
  stroke: #9b4b64;
}

.aag-demo .plot-slab {
  stroke: #b26a2c;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.aag-demo .plot-slab-point {
  fill: none;
  stroke: #b26a2c;
  stroke-width: 1.2;
}

.aag-demo .plot-radial-shadow {
  stroke: #245d78;
  stroke-width: .8;
  opacity: .35;
}

.aag-demo .plot-g-target {
  stroke: #aaa;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.aag-demo .plot-g-line,
.aag-demo .plot-i-line,
.aag-demo .plot-loss-line {
  fill: none;
  stroke: #5b458f;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aag-demo .plot-loss-line {
  stroke: #245d78;
}

.aag-demo .plot-i-line {
  stroke: #16706b;
}

.aag-demo .plot-g-current,
.aag-demo .plot-i-current,
.aag-demo .plot-loss-current {
  fill: #fff;
  stroke: #5b458f;
  stroke-width: 2;
}

.aag-demo .plot-loss-current {
  stroke: #245d78;
}

.aag-demo .plot-i-current {
  stroke: #16706b;
}

.aag-demo .plot-target {
  fill: none;
  stroke: #aaa;
  stroke-width: 1;
  opacity: .35;
}

.aag-demo .plot-sample {
  fill: #fff;
  stroke-width: 1.5;
}

.aag-demo .plot-label {
  fill: #666;
  font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.aag-demo .plot-model {
  fill: #f5f2fa;
  stroke: #5b458f;
  stroke-width: 1;
}

.aag-demo .plot-model-text {
  fill: #5b458f;
  font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-anchor: middle;
}

.newgen-algorithm {
  width: min(100%, 42rem);
  margin: 1.7rem auto;
  border: 1px solid #cfcfcf;
  background: #fafafa;
  box-shadow: 4px 4px 0 #e7e7e7;
}

.newgen-algorithm figcaption {
  display: flex;
  gap: .65rem;
  padding: .65rem .9rem;
  border-bottom: 1px solid #d9d9d9;
  color: var(--newgen-muted);
  font: .7rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .03em;
}

.newgen-algorithm figcaption strong {
  color: #222;
  text-transform: uppercase;
}

.newgen-pseudocode {
  overflow-x: auto;
  margin: 0;
  padding: 1rem 1.15rem 1.15rem;
  border: 0;
  border-radius: 0;
  color: #252525;
  background: transparent;
  white-space: pre;
}

.newgen-pseudocode code {
  display: block;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  line-height: 1.75;
  white-space: inherit;
}

.newgen-pseudocode .pc-comment { color: #888; font-style: italic; }
.newgen-pseudocode .pc-keyword { color: #8d3150; font-weight: 700; }
.newgen-pseudocode .pc-fn { color: #245d78; font-weight: 600; }
.newgen-pseudocode .pc-var { color: #5b458f; }

.newgen-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.5rem 0;
  border: 1px solid var(--newgen-border);
}

.newgen-details {
  margin: 1.7rem 0;
  border-top: 1px solid var(--newgen-border);
  border-bottom: 1px solid var(--newgen-border);
}

.newgen-details summary {
  padding: .8rem .15rem;
  font: 600 .78rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}

.newgen-details summary:hover {
  color: #5b458f;
}

.newgen-details-body {
  padding: 0 .15rem .8rem;
}

.newgen-details-body > p:first-child {
  margin-top: .25rem;
}

.newgen-metrics article {
  padding: 1rem;
  border-right: 1px solid var(--newgen-border);
}

.newgen-metrics article:last-child {
  border-right: 0;
}

.newgen-metrics strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.newgen-metrics span {
  display: block;
  margin: .35rem 0 .5rem;
  color: var(--newgen-muted);
  font: .72rem ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.newgen-metrics p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.5;
}

.newgen-post > hr {
  margin: 2.25rem 0;
  border: 0;
  border-top: 1px solid var(--newgen-border);
}

.newgen-scaling-law {
  margin: 1.1rem 0 1.4rem !important;
  text-align: center;
}

.newgen-scaling-summary {
  margin: 1.8rem 0 1.2rem;
}

.newgen-scaling-summary > p:first-child {
  max-width: 48rem;
  margin: 0 auto 1.35rem;
  font-size: clamp(1.05rem, 2.1vw, 1.25rem);
  line-height: 1.65;
}

.newgen-scaling-summary .newgen-scaling-law {
  margin: .7rem 0 !important;
}

.newgen-figure {
  width: min(100%, 760px);
  margin: 1.5rem auto;
}

.newgen-placeholder {
  display: grid;
  box-sizing: border-box;
  min-height: 18rem;
  place-items: center;
  padding: 2rem;
  border: 1px dashed #aaa;
  color: var(--newgen-muted);
  background: var(--newgen-panel);
  text-align: center;
}

.newgen-figure figcaption {
  margin-top: .55rem;
  color: var(--newgen-muted);
  font-size: .78rem;
  line-height: 1.55;
  text-align: center;
}

.newgen-code-bottom {
  margin: 2rem 0;
  text-align: center;
}

.newgen-results-group {
  margin: 2rem 0;
}

.newgen-results-group h3 {
  margin-bottom: .8rem;
}

.newgen-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: .75rem;
}

.newgen-results-grid--two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.newgen-baselines-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.newgen-result-card {
  min-width: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

.newgen-result-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: .7rem;
  background: transparent;
  cursor: zoom-in;
}

.newgen-post .newgen-result-open img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.newgen-result-open--cifar-crop {
  aspect-ratio: 8 / 5;
}

.newgen-post .newgen-result-open--cifar-crop img {
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.newgen-result-open span {
  position: absolute;
  right: .45rem;
  bottom: .45rem;
  padding: .25rem .38rem;
  color: #fff;
  background: rgb(0 0 0 / 72%);
  font: .62rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: 0;
  transition: opacity 150ms ease;
}

.newgen-result-open:hover span,
.newgen-result-open:focus-visible span {
  opacity: 1;
}

.newgen-result-card figcaption {
  padding: .55rem .15rem .3rem;
}

.newgen-result-card figcaption strong,
.newgen-result-card figcaption span {
  display: block;
}

.newgen-result-card figcaption strong {
  font-size: .88rem;
}

.newgen-result-card figcaption span {
  margin-top: .18rem;
  color: var(--newgen-muted);
  font-size: .72rem;
}

.newgen-results-details {
  margin-top: 1.25rem;
}

.newgen-training-curve {
  margin: .35rem 0 0;
}

.newgen-training-curve figcaption {
  color: var(--newgen-muted);
  font-size: .84rem;
  line-height: 1.55;
}

.aag-doom-demo {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(18rem, 1.1fr);
  gap: clamp(1rem, 4vw, 2.4rem);
  box-sizing: border-box;
  margin: 2.5rem 0 3rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid var(--newgen-border);
  background: var(--newgen-panel);
}

.aag-model-switcher {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: .55rem;
  margin-top: 1rem;
}

.aag-model-tabs {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.aag-model-tabs button {
  padding: .65rem .4rem;
  border: 1px solid #aaa;
  color: #333;
  background: #fff;
  font: .68rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}

.aag-model-tabs button[aria-selected="true"] {
  border-color: #222;
  color: #fff;
  background: #222;
}

.aag-model-panels {
  min-width: 0;
}

.aag-model-switcher .aag-doom-demo {
  margin: 0;
}

.aag-model-pane[hidden] {
  display: none;
}

.aag-model-pane {
  height: 36rem;
}

.aag-celeba-demo {
  grid-template-columns: minmax(20rem, 1.4fr) minmax(11rem, .6fr);
  align-items: start;
}

.aag-celeba-copy {
  min-width: 0;
}

.aag-celeba-copy h3 {
  margin: 0 0 .7rem;
}

.aag-celeba-copy > p:not(.newgen-eyebrow, .aag-doom-status) {
  margin-top: 0;
}

.aag-celeba-screen {
  display: grid;
  width: min(100%, 28rem);
  aspect-ratio: 2 / 1;
  margin-top: 1rem;
  overflow: hidden;
  border: 1px solid #aaa;
  border-radius: .7rem;
  background: #e9e9e9;
}

.newgen-post .aag-celeba-screen img {
  z-index: 1;
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}

.newgen-post .aag-celeba-screen img[hidden] {
  display: none;
}

.aag-celeba-screen canvas {
  z-index: 0;
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
}

.aag-celeba-conditions {
  display: flex;
  align-self: stretch;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  padding: .75rem;
  border: 1px solid #aaa;
  background: #fff;
}

.aag-celeba-conditions legend {
  padding: 0 .3rem;
  font: .72rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.aag-celeba-checkboxes {
  display: grid;
  flex: 1;
  grid-template-columns: 1fr;
  align-content: space-evenly;
  gap: .35rem .55rem;
}

.aag-celeba-checkboxes label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: .28rem;
  min-width: 0;
  color: #333;
  font: .7rem/1.25 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.aag-celeba-checkboxes input {
  flex: 0 0 auto;
  margin: .05rem 0 0;
  accent-color: #222;
}

.aag-doom-copy {
  align-self: center;
}

.aag-doom-copy h3 {
  margin: 0 0 .7rem;
}

.aag-doom-copy p {
  margin-top: 0;
}

.aag-doom-note {
  color: var(--newgen-muted);
  font-size: .76rem !important;
  line-height: 1.55 !important;
}

.aag-doom-model-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1rem;
}

.aag-doom-model-controls button,
.aag-doom-actions button {
  border: 1px solid #aaa;
  color: #222;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}

.aag-doom-model-controls button {
  padding: .62rem .75rem;
  font-size: .7rem;
}

.aag-doom-model-controls button:first-child {
  border-color: #222;
  color: #fff;
  background: #222;
}

.aag-doom-model-controls button:disabled,
.aag-doom-actions button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.aag-doom-player {
  min-width: 0;
}

.aag-doom-screen {
  position: relative;
  overflow: hidden;
  border: 1px solid #111;
  border-radius: .7rem;
  background: #111;
}

.aag-doom-screen canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  image-rendering: pixelated;
}

.aag-doom-screen > span {
  position: absolute;
  top: .45rem;
  left: .45rem;
  padding: .24rem .36rem;
  color: #fff;
  background: rgb(0 0 0 / 68%);
  font: .62rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.aag-doom-status {
  min-height: 1.25rem;
  margin: .5rem 0 .7rem !important;
  color: var(--newgen-muted);
  font: .68rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
}

.aag-doom-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
}

.aag-doom-actions button {
  min-height: 3.1rem;
  padding: .35rem .25rem;
  font-size: .58rem;
  line-height: 1.25;
  touch-action: manipulation;
  user-select: none;
}

.aag-doom-actions button.is-held:not(:disabled) {
  border-color: #222;
  color: #fff;
  background: #222;
}

.aag-doom-actions button span {
  display: block;
  margin-bottom: .15rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
}

.aag-doom-actions button:hover:not(:disabled),
.aag-doom-actions button:focus-visible,
.aag-doom-model-controls button:hover:not(:disabled),
.aag-doom-model-controls button:focus-visible {
  border-color: #222;
  color: #fff;
  background: #222;
}

/* A small handheld-console control deck for the Doom demo. */
.aag-doom-actions {
  gap: .7rem;
  padding: .72rem .8rem .62rem;
  border: 1px solid #aaada6;
  border-radius: 1rem 1rem 1.35rem 1.35rem;
  background: linear-gradient(145deg, #dedfd9, #bfc1ba);
  box-shadow:
    inset 1px 1px 0 rgb(255 255 255 / 72%),
    inset -1px -2px 0 rgb(69 71 69 / 18%);
}

.aag-doom-actions button,
.aag-doom-actions button:hover:not(:disabled),
.aag-doom-actions button:focus-visible,
.aag-doom-actions button.is-held:not(:disabled) {
  min-height: 3.8rem;
  padding: 0;
  border: 0;
  outline: 0;
  color: #33333d;
  background: transparent;
  box-shadow: none;
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.aag-doom-actions button span {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  margin: 0 auto .34rem;
  border: 1px solid #54223f;
  border-radius: 50%;
  color: #eadde5;
  background: radial-gradient(circle at 35% 28%, #a6537c, #743252 68%);
  box-shadow:
    inset 1px 1px 0 rgb(255 255 255 / 24%),
    0 3px 0 #4b263b,
    0 4px 5px rgb(35 29 34 / 30%);
  font-size: 1.12rem;
  transition: transform 80ms ease, box-shadow 80ms ease, filter 80ms ease;
}

.aag-doom-actions button:hover:not(:disabled) span {
  filter: brightness(1.08);
}

.aag-doom-actions button:focus-visible span {
  outline: 2px solid #313744;
  outline-offset: 3px;
}

.aag-doom-actions button.is-held:not(:disabled) span,
.aag-doom-actions button:active:not(:disabled) span {
  transform: translateY(3px);
  box-shadow:
    inset 1px 2px 3px rgb(43 14 32 / 38%),
    0 1px 0 #4b263b;
}

/* Keep the model controls consistent across both browser demos. */
.aag-doom-model-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 28rem);
  gap: .5rem;
}

.aag-doom-model-controls button {
  min-width: 0;
  padding: .68rem .8rem;
  border: 1px solid #a9a9a9;
  border-radius: .45rem;
  color: #333;
  background: #fff;
  box-shadow: 0 1px 1px rgb(0 0 0 / 5%);
  font-size: .68rem;
  font-weight: 600;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.aag-doom-model-controls button:first-child {
  border-color: #292929;
  color: #fff;
  background: #292929;
}

.aag-doom-model-controls button:hover:not(:disabled),
.aag-doom-model-controls button:focus-visible {
  border-color: #292929;
  color: #292929;
  background: #f1f1f1;
}

.aag-doom-model-controls button:first-child:hover:not(:disabled),
.aag-doom-model-controls button:first-child:focus-visible {
  color: #fff;
  background: #444;
}

.aag-doom-model-controls button:focus-visible {
  outline: 2px solid #777;
  outline-offset: 2px;
}

.aag-celeba-conditions {
  border-color: #c4c4c4;
  border-radius: .7rem;
  background: #f8f8f8;
}

.aag-celeba-checkboxes label {
  align-items: center;
  padding: .42rem .48rem;
  border: 1px solid transparent;
  border-radius: .4rem;
  white-space: nowrap;
  transition: border-color 120ms ease, background 120ms ease;
}

.aag-celeba-checkboxes label:hover,
.aag-celeba-checkboxes label:has(input:focus-visible) {
  border-color: #c7c7c7;
  background: #fff;
}

.aag-celeba-checkboxes label:has(input:checked) {
  border-color: #b5b5b5;
  color: #171717;
  background: #e9e9e9;
}

.aag-celeba-checkboxes input {
  appearance: none;
  display: grid;
  place-content: center;
  width: .9rem;
  height: .9rem;
  margin: 0;
  border: 1px solid #888;
  border-radius: .2rem;
  background: #fff;
}

.aag-celeba-checkboxes input::before {
  width: .42rem;
  height: .42rem;
  background: #292929;
  content: "";
  transform: scale(0);
  transition: transform 90ms ease;
}

.aag-celeba-checkboxes input:checked::before {
  transform: scale(1);
}

.newgen-results-lightbox {
  box-sizing: border-box;
  width: min(94vw, 1200px);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  border: 1px solid #777;
  border-radius: .7rem;
  overflow: hidden;
  background: #fff;
}

.newgen-results-lightbox::backdrop {
  background: rgb(0 0 0 / 76%);
}

.newgen-lightbox-shell {
  display: flex;
  max-height: calc(92vh - 2px);
  flex-direction: column;
}

.newgen-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--newgen-border);
}

.newgen-lightbox-head strong {
  font-size: .82rem;
}

.newgen-lightbox-head button {
  padding: .35rem .55rem;
  border: 1px solid #aaa;
  background: transparent;
  cursor: pointer;
}

.newgen-post .newgen-results-lightbox img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(92vh - 3.2rem);
  margin: auto;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}

@media (max-width: 760px) {
  .aag-demo {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
    padding: .85rem;
    transform: none;
  }

  .aag-demo-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .aag-demo-status {
    align-items: flex-start;
    flex-direction: column;
    gap: .25rem;
  }

  .aag-demo-status span {
    text-align: left;
  }

  .aag-demo-controls {
    justify-content: flex-start;
  }

  .aag-demo-flow {
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  .aag-flow-arrow {
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
  }

  .aag-flow-arrow span br {
    display: none;
  }

  .aag-flow-arrow b {
    transform: rotate(90deg);
  }

  .aag-demo-stage {
    width: min(100%, 20rem);
    margin: 0 auto;
  }

  .newgen-metrics {
    grid-template-columns: 1fr;
  }

  .newgen-results-grid {
    grid-template-columns: 1fr;
  }

  .aag-doom-demo {
    grid-template-columns: 1fr;
  }

  .aag-model-pane {
    height: auto;
  }

  .aag-model-switcher {
    grid-template-columns: 1fr;
  }

  .aag-model-tabs {
    flex-direction: row;
  }

  .aag-model-tabs button {
    flex: 1;
  }

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

  .aag-doom-player {
    width: min(100%, 28rem);
    margin: 0 auto;
  }

  .newgen-baselines-grid {
    grid-template-columns: 1fr;
  }

  .newgen-metrics article {
    border-right: 0;
    border-bottom: 1px solid var(--newgen-border);
  }

  .newgen-metrics article:last-child {
    border-bottom: 0;
  }

  .newgen-placeholder {
    min-height: 12rem;
  }
}
