.swipe-btn:disabled,
.tool-open:disabled {
  opacity: .48;
  cursor: not-allowed;
}

@media (min-width: 701px) {
  .site-header .score-pill { margin-right: 160px; }
}

@media (max-width: 700px) {
  .site-header { height: 104px; align-items: flex-start; padding-top: 24px; }
  .site-header .score-pill { position: absolute; right: 20px; top: 58px; }
}

.popper-cameo {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr) auto;
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
  margin: 0 0 42px;
  padding: 18px 24px 18px 18px;
  border: 1px solid #22334b;
  border-radius: 8px;
  background: #dcefea;
  box-shadow: 6px 6px 0 #e5683b;
}

.popper-cameo-portrait {
  aspect-ratio: 1;
  border: 6px solid #fff9ed;
  box-shadow: 2px 3px 0 rgba(34, 51, 75, .2);
  transform: rotate(-3deg);
  overflow: hidden;
}

.popper-cameo-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.popper-cameo-copy .eyebrow { color: #8a3e31; margin-bottom: 8px; }
.popper-cameo-copy h3 {
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  line-height: 1.1;
  margin: 0 0 10px;
}

.popper-cameo-copy p:last-child {
  margin: 0;
  max-width: 58ch;
  line-height: 1.5;
}

.popper-cameo-stamp {
  align-self: start;
  white-space: nowrap;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #745b4a;
  transform: rotate(7deg);
}

@media (max-width: 700px) {
  .popper-cameo {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 15px;
    padding: 14px;
    margin-bottom: 34px;
  }

  .popper-cameo-copy .eyebrow { font-size: 8px; }
  .popper-cameo-copy h3 { font-size: 1.18rem; }
  .popper-cameo-copy p:last-child { font-size: .85rem; }
  .popper-cameo-stamp { display: none; }
}

.lab-feedback.system-error {
  border: 2px dashed #dd5b51;
  background: #fff0de;
  color: #81332d;
  font-family: 'Space Mono', monospace;
}

.method-diagram {
  margin: 0 0 26px;
  padding: clamp(18px, 4vw, 34px);
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff9e9;
  box-shadow: 6px 7px 0 rgba(24, 45, 59, .23);
}
.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #ad9b83;
  font: 700 11px var(--mono);
  letter-spacing: .07em;
}
.diagram-header strong { color: #a64b31; font-size: 13px; }
.diagram-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 25px 0 12px;
}
.diagram-point { text-align: center; min-width: 0; }
.diagram-when {
  display: block;
  margin: 0 0 13px;
  color: #795345;
  font: 700 11px var(--mono);
  text-transform: uppercase;
}
.diagram-circle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  width: min(100%, 206px);
  aspect-ratio: 1;
  margin: auto;
  padding: 23px;
  border: 3px solid var(--ink);
  border-radius: 49% 51% 48% 52%;
  background: #f5d889;
  box-shadow: 3px 4px 0 #dea969;
  transform: rotate(-3deg);
}
.diagram-circle.problem { background: #f5b293; transform: rotate(2deg); }
.diagram-circle.test { background: #b5ded0; transform: rotate(-2deg); }
.diagram-circle small {
  color: #694738;
  font: 700 10px var(--mono);
  letter-spacing: .08em;
}
.diagram-circle strong {
  font: 700 clamp(13px, 1.6vw, 16px)/1.25 var(--serif);
  overflow-wrap: anywhere;
}
.diagram-point p { margin: 14px auto 0; max-width: 25ch; font-size: 12px; }
.diagram-arrow { align-self: center; color: #b64c32; font: 34px var(--serif); text-align: center; }
.diagram-caption {
  margin: 25px 0 0;
  padding-top: 15px;
  border-top: 1px dashed #ad9b83;
  font-size: 13px;
  font-weight: 700;
}
.lab-action:disabled { cursor: default; opacity: .65; }
.lab-action.chosen:disabled { background: #d6e9dc; opacity: 1; border-color: #497f68; }
.lab-hint { font-size: 13px; margin: 7px 0 15px; }
.lab-next {
  display: inline-block;
  margin-top: 14px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--yellow);
  color: var(--ink);
  padding: 11px 17px;
  font: 700 13px var(--mono);
  cursor: pointer;
}
.lab-next:hover, .lab-next:focus-visible { background: #ffe890; outline: 2px solid var(--ink); outline-offset: 2px; }
.lab-next[hidden], .own-feedback[hidden] { display: none; }
.own-problem {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
  gap: clamp(20px, 4vw, 50px);
  margin-top: 30px;
  padding: clamp(20px, 4vw, 34px);
  background: #f8f0dc;
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.own-problem h3 { margin: 0 0 12px; font: 700 28px/1.1 var(--serif); }
.own-problem p:not(.eyebrow) { font-size: 14px; }
.own-problem form { display: grid; gap: 12px; }
.own-problem label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.own-problem input, .own-problem select {
  width: 100%;
  min-width: 0;
  border: 1px solid #8d8b82;
  border-radius: 3px;
  background: #fffdfa;
  color: var(--ink);
  padding: 10px 11px;
  font: 14px var(--body);
}
.own-problem input:focus-visible, .own-problem select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.own-problem form .lab-next { justify-self: start; }
.own-feedback {
  grid-column: 1 / -1;
  padding: 17px;
  border-left: 5px solid #497f68;
  background: #dceee1;
  font-size: 14px;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .diagram-track { grid-template-columns: 1fr; gap: 7px; }
  .diagram-arrow { line-height: 1; transform: rotate(90deg); }
  .diagram-circle { width: 172px; padding: 20px; }
  .diagram-circle strong { font-size: 14px; }
  .diagram-when { margin-bottom: 9px; }
  .diagram-point p { margin-top: 8px; }
  .own-problem { grid-template-columns: 1fr; }
}

.chapter-recap {
  max-width: 1160px;
  margin: 24px auto 0;
  padding: clamp(20px, 4vw, 32px);
  border: 2px solid #102946;
  border-radius: 14px;
  background: #fdf4da;
  box-shadow: 7px 7px 0 rgba(16, 41, 70, .14);
}

.chapter-recap h3 {
  font-size: clamp(1.3rem, 3vw, 2rem);
  margin: 0 0 6px;
}

.chapter-recap p {
  margin: 0 0 14px;
}

.chapter-recap .matrix-wrap { margin: 0; }
.chapter-recap table { font-size: .82rem; }

.chapter-summary {
  padding: 12px 16px;
  margin: 0 0 20px;
  border-radius: 9px;
  background: #fdf4da;
  color: #102946;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .chapter-recap { scroll-behavior: auto; }
}