﻿/* Pythagorean theorem topic-specific styles moved out of math/styles.css. */
.py-deep-dive {
  display: grid;
  gap: 22px;
}

.py-lesson-head {
  padding: 22px 0 4px;
  border-top: 1px solid var(--line);
}

.py-lesson-head p {
  max-width: 920px;
  margin-bottom: 12px;
}

.py-lesson-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.py-lesson-nav button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: #31423c;
  font-weight: 800;
}

.py-lesson-nav button:hover {
  border-color: rgba(29, 95, 209, 0.45);
  background: var(--surface-soft);
}

.py-band {
  scroll-margin-top: 96px;
}

.py-app-grid,
.py-proof-grid,
.py-game-grid {
  display: grid;
  gap: 12px;
}

.py-app-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.py-proof-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.py-game-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.py-app-card,
.py-zhao-card,
.py-proof-note,
.py-step-card,
.py-game-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(18, 32, 29, 0.05);
}

.py-app-card,
.py-zhao-card,
.py-proof-note,
.py-step-card,
.py-game-board {
  padding: 16px;
}

.py-app-card {
  display: grid;
  gap: 10px;
  min-height: 360px;
}

.py-app-card p,
.py-proof-note p,
.py-step-card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.py-mini-figure,
.py-proof-figure,
.py-game-figure {
  display: block;
  width: 100%;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.py-map-figure {
  cursor: crosshair;
}

.py-range {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.py-range output {
  float: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.py-range input {
  width: 100%;
  accent-color: var(--teal);
}

.py-result {
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: #41534d;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.5;
}

.py-proof-note {
  display: grid;
  align-content: start;
  gap: 10px;
}

.py-stepper {
  display: grid;
  gap: 12px;
}

.py-step-card {
  display: grid;
  gap: 10px;
}

.py-step-card pre {
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius);
  background: #17201d;
  color: #b8f2df;
  font: 700 0.88rem/1.55 Consolas, "Cascadia Mono", monospace;
  white-space: pre-wrap;
}

.py-game-grid {
  align-items: start;
}

.py-game-board {
  grid-column: span 1;
}

.py-score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.py-score-row div {
  min-height: 64px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.py-score-row span,
.py-score-row strong {
  display: block;
}

.py-score-row span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.py-score-row strong {
  margin-top: 4px;
  color: var(--teal);
  font-size: 1.35rem;
}

.py-choice-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}


/* Pythagorean lesson workspace */
.py-topic-layout {
  gap: 18px;
}

.py-topic-head {
  min-height: 220px;
  align-content: end;
  background:
    linear-gradient(120deg, rgba(10, 132, 255, 0.16), rgba(88, 86, 214, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 250, 255, 0.68));
}

.py-topic-head h1 {
  font-size: 2.55rem;
}

.py-topic-head .topic-lede {
  max-width: 780px;
  font-size: 1.02rem;
}

.py-main-lab {
  scroll-margin-top: 96px;
  padding: 0;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 249, 255, 0.68));
}

.py-main-lab .visual-top {
  padding: 18px 18px 0;
}

.py-main-lab .control-grid {
  padding: 0 18px;
}

.py-main-lab .visual-canvas-wrap {
  margin-top: 4px;
  border-width: 1px 0 0;
  border-radius: 0;
  overflow: hidden;
}

.py-main-lab .visual-canvas {
  height: min(72vh, 780px);
  min-height: 620px;
}

.py-main-lab #visualActions {
  align-items: center;
  justify-content: flex-end;
}

.py-module-lab {
  scroll-margin-top: 96px;
  padding: 0;
  overflow: hidden;
}

.py-lab-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid rgba(120, 144, 180, 0.22);
}

.py-lab-top p {
  margin-bottom: 0;
  color: var(--muted);
}

.py-lab-modebar,
.py-lab-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.py-lab-modebar button,
.py-lab-presets button {
  border: 1px solid rgba(72, 128, 236, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  padding: 9px 12px;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.py-lab-modebar button.is-active,
.py-lab-presets button:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 12px 22px rgba(72, 128, 236, 0.22);
}

.py-lab-shell {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(520px, 2.1fr) minmax(210px, 0.78fr);
  min-height: min(72vh, 760px);
}

.py-lab-controls,
.py-lab-ledger {
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 18px;
  background: rgba(248, 251, 255, 0.72);
}

.py-lab-controls {
  border-right: 1px solid rgba(120, 144, 180, 0.18);
}

.py-lab-ledger {
  border-left: 1px solid rgba(120, 144, 180, 0.18);
}

.py-lab-stage {
  min-width: 0;
  background:
    linear-gradient(rgba(255,255,255,.76), rgba(255,255,255,.76)),
    linear-gradient(90deg, rgba(72, 128, 236, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(72, 128, 236, 0.08) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}

.py-lab-figure {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 620px;
  touch-action: none;
}

.py-lab-figure [data-py-lab-handle] {
  cursor: grab;
}

.py-lab-equation {
  padding: 14px;
  border-radius: 16px;
  background: rgba(72, 128, 236, 0.1);
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 950;
  text-align: center;
}

.py-lab-ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid rgba(120, 144, 180, 0.18);
  font-weight: 900;
}

.py-lab-result,
.py-lab-target {
  padding: 12px;
  border-radius: 14px;
  background: rgba(231, 246, 242, 0.78);
  color: #30423e;
  font-weight: 800;
  line-height: 1.5;
}

.py-lab-target {
  background: rgba(255, 240, 237, 0.82);
}

.py-module-lab:not(.is-area-mode) .py-lab-puzzle-control,
.py-module-lab:not(.is-proof-mode) .py-lab-proof-control {
  opacity: 0.62;
}

.py-deep-dive {
  gap: 16px;
}

.py-topic-layout > .topic-head {
  order: 1;
}

.py-topic-layout > .content-grid {
  order: 2;
}

.py-topic-layout > .py-main-lab {
  order: 3;
}

.py-topic-layout > .quiz-shell {
  order: 4;
}

.py-topic-layout > .py-deep-dive {
  order: 5;
}

.py-deep-dive > .py-lesson-head {
  order: 1;
}

.py-deep-dive > .py-lesson-nav {
  order: 2;
}

.py-deep-dive > .py-progress-rail {
  order: 3;
}

.py-deep-dive > #py-route {
  order: 4;
}

.py-deep-dive > #py-prerequisite {
  order: 5;
}

.py-deep-dive > #py-diagnostic {
  order: 6;
}

.py-deep-dive > .py-state-panel {
  order: 7;
}

.py-deep-dive > #py-area-lens {
  order: 8;
}

.py-deep-dive > #py-templates {
  order: 9;
}

.py-deep-dive > #py-hypotenuse-trainer {
  order: 10;
}

.py-deep-dive > .py-worked-example {
  order: 11;
}

.py-deep-dive > .py-lesson-map {
  order: 12;
}

.py-deep-dive > #py-applications {
  order: 13;
}

.py-deep-dive > #py-modeling-flow {
  order: 14;
}

.py-deep-dive > #py-misconceptions {
  order: 15;
}

.py-deep-dive > #py-zhao-proof {
  order: 16;
}

.py-deep-dive > .py-bridge-summary {
  order: 17;
}

.py-deep-dive > #py-proof-layers {
  order: 18;
}

.py-deep-dive > #py-formal-proof {
  order: 19;
}

.py-deep-dive > #py-edge-game {
  order: 20;
}

.py-deep-dive > .py-mastery-card {
  order: 21;
}

.py-deep-dive > #py-final-test {
  order: 22;
}

.py-deep-dive > #py-transfer-map {
  order: 23;
}

.py-deep-dive > #py-advanced {
  order: 24;
}

.py-deep-dive > .py-adventure-callout {
  order: 25;
}

.py-lesson-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 253, 0.66));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 16px 38px rgba(36, 54, 84, 0.08);
}

.py-lesson-head h2 {
  margin-bottom: 8px;
  font-size: 1.45rem;
}

.py-lesson-head p {
  max-width: 860px;
  margin-bottom: 0;
}

.py-formula-strip {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 260px;
  min-height: 76px;
  padding: 14px 18px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.1), rgba(88, 86, 214, 0.08)),
    rgba(255, 255, 255, 0.68);
  color: #0a64c7;
  font-size: 1.42rem;
  font-weight: 780;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.py-formula-strip strong {
  color: #5856d6;
}

.py-lesson-nav {
  position: sticky;
  top: 84px;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(120, 139, 168, 0.18);
  border-radius: 8px;
  background: rgba(248, 250, 253, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 28px rgba(36, 54, 84, 0.08);
  backdrop-filter: saturate(180%) blur(20px);
}

.py-lesson-nav button,
.py-lesson-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #4b5565;
  font-size: 0.82rem;
  font-weight: 680;
}

.py-lesson-nav button:hover,
.py-lesson-nav a:hover {
  background: rgba(10, 132, 255, 0.1);
  color: #0a64c7;
  transform: none;
}

.py-lesson-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.py-progress-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(120, 139, 168, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.py-progress-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
  border-radius: 7px;
  color: #667085;
}

.py-progress-item span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(120, 139, 168, 0.14);
  font-size: 0.72rem;
  font-weight: 780;
}

.py-progress-item strong {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.py-progress-item.is-complete {
  color: #0a64c7;
  background: rgba(10, 132, 255, 0.09);
}

.py-progress-item.is-complete span {
  color: #fff;
  background: #0a84ff;
}

.py-state-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.py-state-panel > div {
  min-height: 78px;
  padding: 13px;
  border: 1px solid rgba(120, 139, 168, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(247, 250, 255, 0.58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.py-state-panel span {
  display: block;
  color: #7b8494;
  font-size: 0.72rem;
  font-weight: 720;
}

.py-state-panel strong {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-size: 1.35rem;
  font-weight: 780;
}

.py-state-equation {
  grid-column: span 2;
}

.py-state-equation strong {
  color: #0a64c7;
}

.py-diagnostic-grid,
.py-template-grid,
.py-final-questions {
  display: grid;
  gap: 12px;
}

.py-diagnostic-grid,
.py-template-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.py-diagnostic-grid article,
.py-template-grid article,
.py-final-questions article,
.py-mastery-card {
  padding: 15px;
  border: 1px solid rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.py-mini-options {
  display: grid;
  gap: 8px;
}

.py-mini-options button {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(120, 139, 168, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: #344054;
  font-weight: 680;
  text-align: left;
}

.py-mini-options button:hover,
.py-mini-options button.is-selected {
  border-color: rgba(10, 132, 255, 0.34);
  background: rgba(10, 132, 255, 0.09);
}

.py-mini-options button.is-correct {
  border-color: rgba(48, 209, 88, 0.45);
  background: rgba(48, 209, 88, 0.12);
}

.py-mini-options button.is-wrong {
  border-color: rgba(255, 69, 58, 0.45);
  background: rgba(255, 69, 58, 0.1);
}

.py-template-grid .formula-box {
  margin-top: 10px;
}

.py-route-steps,
.py-area-grid,
.py-hyp-grid,
.py-model-grid,
.py-transfer-grid {
  display: grid;
  gap: 12px;
}

.py-route-steps {
  grid-template-columns: repeat(9, minmax(90px, 1fr));
}

.py-route-steps button,
.py-transfer-grid button,
.py-model-steps button {
  min-width: 0;
  border: 1px solid rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: #344054;
  font-weight: 760;
}

.py-route-steps button {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 74px;
  padding: 10px 8px;
}

.py-route-steps span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #0a84ff, #5856d6);
  font-size: 0.78rem;
}

.py-area-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.py-area-grid article {
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.py-area-grid strong {
  display: block;
  margin-bottom: 8px;
  color: #0a64c7;
  font-size: 1.25rem;
}

.py-area-grid span,
.py-model-steps span,
.py-transfer-grid span {
  display: block;
  color: #667085;
  font-size: 0.84rem;
  line-height: 1.55;
}

.py-area-sum {
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.12), rgba(88, 86, 214, 0.08)),
    rgba(255, 255, 255, 0.72) !important;
}

.py-hyp-grid,
.py-model-grid {
  grid-template-columns: minmax(320px, 0.86fr) minmax(0, 1.14fr);
  align-items: start;
}

.py-hyp-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.py-model-steps {
  display: grid;
  gap: 8px;
}

.py-model-steps button {
  display: grid;
  gap: 4px;
  padding: 11px;
  text-align: left;
}

.py-model-steps button.is-active,
.py-transfer-grid button.is-selected {
  border-color: rgba(10, 132, 255, 0.38);
  background: rgba(10, 132, 255, 0.1);
  color: #0a64c7;
}

.py-proof-layer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.py-proof-layer-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(120, 139, 168, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62);
  color: #344054;
  font-weight: 720;
}

.py-proof-layer-tabs button.is-selected {
  border-color: rgba(10, 132, 255, 0.38);
  background: rgba(10, 132, 255, 0.12);
  color: #0a64c7;
}

.py-transfer-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.py-transfer-grid button {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  text-align: left;
}

.py-transfer-grid strong {
  color: #111827;
}

.py-mastery-note,
.py-error-list {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.06);
  color: #435268;
  font-size: 0.88rem;
  font-weight: 680;
  line-height: 1.65;
}

.py-error-list {
  display: grid;
  gap: 7px;
  border-color: rgba(255, 69, 58, 0.18);
  background: rgba(255, 69, 58, 0.06);
}

.py-worked-example .py-example-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr);
  gap: 14px;
  align-items: start;
}

.py-worked-example .py-step-card {
  min-height: 210px;
}

.py-bridge-summary {
  display: grid;
  gap: 8px;
  background:
    linear-gradient(120deg, rgba(10, 132, 255, 0.1), rgba(88, 86, 214, 0.07)),
    rgba(255, 255, 255, 0.56);
}

.py-bridge-summary p {
  max-width: 980px;
  margin-bottom: 0;
  font-size: 0.96rem;
}

.py-mastery-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.py-mastery-card p {
  margin-bottom: 0;
}

.py-mastery-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.py-mastery-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid rgba(120, 139, 168, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  color: #344054;
  font-size: 0.86rem;
  font-weight: 680;
}

.py-mastery-list input {
  accent-color: #0a84ff;
}

.py-advanced-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.py-advanced-card {
  display: grid;
  align-content: start;
  gap: 11px;
  min-height: 330px;
  padding: 15px;
  border: 1px solid rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 253, 0.6));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 12px 28px rgba(36, 54, 84, 0.06);
}

.py-advanced-card h3,
.py-advanced-card p {
  margin-bottom: 0;
}

.py-distance-card,
.py-proof-library,
.py-variant-card {
  grid-column: span 1;
}

.py-control-pair {
  display: grid;
  gap: 8px;
}

.py-proof-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.py-proof-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(120, 139, 168, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62);
  color: #344054;
  font-weight: 680;
}

.py-proof-tabs button.is-selected {
  border-color: rgba(10, 132, 255, 0.35);
  background: rgba(10, 132, 255, 0.12);
  color: #0a64c7;
}

.py-variant-list {
  display: grid;
  gap: 8px;
}

.py-variant-list article {
  padding: 10px;
  border: 1px solid rgba(120, 139, 168, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.py-variant-list strong {
  display: block;
  margin-bottom: 4px;
  color: #111827;
}

.py-variant-list p {
  color: #667085;
  font-size: 0.84rem;
}

.py-lesson-map article {
  display: grid;
  gap: 8px;
  min-height: 170px;
  padding: 16px;
  border: 1px solid rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 26px rgba(36, 54, 84, 0.07);
}

.py-lesson-map article > span {
  width: max-content;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.1);
  color: #0a64c7;
  font-size: 0.7rem;
  font-weight: 780;
}

.py-lesson-map h3,
.py-lesson-map p {
  margin-bottom: 0;
}

.py-lesson-map button {
  align-self: end;
  justify-self: start;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(120, 139, 168, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62);
  color: #0a64c7;
  font-weight: 700;
}

.py-task {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(120, 139, 168, 0.16);
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.05);
}

.py-task strong {
  color: #0a64c7;
  font-size: 0.78rem;
}

.py-task p {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.py-real-examples {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(120, 139, 168, 0.18);
}

.py-real-example-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.py-real-example-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 178px;
  padding: 14px;
  border: 1px solid rgba(120, 139, 168, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 253, 0.58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.py-real-example-grid span {
  width: max-content;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.1);
  color: #0a64c7;
  font-size: 0.7rem;
  font-weight: 780;
}

.py-real-example-grid strong {
  color: #111827;
  font-size: 0.96rem;
}

.py-real-example-grid p {
  margin-bottom: 0;
  color: #667085;
  font-size: 0.84rem;
  line-height: 1.62;
}

.py-adventure-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 170px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(10, 25, 50, 0.84), rgba(10, 25, 50, 0.28)),
    url("adventure-pythagorean-shrine/assets/forest-shrine-hero.png") center / cover;
  box-shadow: 0 22px 54px rgba(16, 24, 40, 0.16);
}

.py-adventure-callout .eyebrow,
.py-adventure-callout h2,
.py-adventure-callout p {
  color: #fff;
}

.py-adventure-callout p {
  max-width: 680px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
}

.py-adventure-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.py-adventure-actions .ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.py-band {
  padding: 18px;
  border: 1px solid rgba(120, 139, 168, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.py-misconception-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.py-mis-card,
.py-mis-list article,
.py-proof-anim-card {
  border: 1px solid rgba(120, 139, 168, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.py-mis-card,
.py-proof-anim-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.py-mis-card .py-mini-figure {
  min-height: 280px;
  max-height: 360px;
}

.py-mis-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.py-mis-list article {
  padding: 13px;
}

.py-mis-list strong {
  display: block;
  margin-bottom: 6px;
  color: #111827;
}

.py-mis-list p {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.py-band .stage-title-row {
  align-items: center;
}

.py-app-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.py-app-card {
  min-height: 420px;
  align-content: start;
}

.py-app-card .small-button {
  align-self: end;
}

.py-proof-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(260px, 0.72fr);
}

.py-stepper {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr) auto;
  align-items: start;
}

.py-proof-anim {
  display: block;
  width: 100%;
  min-height: 250px;
}

.py-step-card {
  min-height: 210px;
}

.py-step-card pre {
  background: rgba(17, 24, 39, 0.94);
  color: #d1e9ff;
}

.py-game-grid {
  grid-template-columns: minmax(360px, 0.88fr) minmax(0, 1.12fr);
  gap: 16px;
}

.py-game-board {
  min-height: 420px;
}

.py-game-figure {
  min-height: 360px;
}

.py-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.py-game-history {
  display: grid;
  gap: 6px;
  min-height: 92px;
  margin: 12px 0;
}

.py-game-history div {
  padding: 8px 10px;
  border: 1px solid rgba(120, 139, 168, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.55);
  color: #526071;
  font-size: 0.82rem;
  font-weight: 650;
}

#py-game-unlock a {
  color: #0a64c7;
  font-weight: 800;
}

@media (max-width: 1440px) {
  .py-app-grid,
  .py-lesson-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .py-route-steps,
  .py-transfer-grid,
  .py-real-example-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .py-area-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .py-progress-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .py-state-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .py-state-equation {
    grid-column: span 2;
  }

  .py-advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .py-lesson-head,
  .py-adventure-callout,
  .py-stepper,
  .py-game-grid,
  .py-hyp-grid,
  .py-model-grid,
  .py-proof-grid,
  .py-misconception-grid,
  .py-worked-example .py-example-grid,
  .py-mastery-card,
  .py-advanced-grid {
    grid-template-columns: 1fr;
  }

  .py-lab-top,
  .py-lab-shell {
    grid-template-columns: 1fr;
  }

  .py-lab-top {
    display: grid;
  }

  .py-lab-controls,
  .py-lab-ledger {
    border: 0;
  }

  .py-lab-figure {
    min-height: 520px;
  }

  .py-progress-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .py-state-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .py-formula-strip {
    min-width: 0;
  }

  .py-main-lab .visual-canvas {
    min-height: 520px;
    height: 560px;
  }
}

@media (max-width: 640px) {
  .py-topic-head h1 {
    font-size: 1.8rem;
  }

  .py-main-lab .visual-canvas {
    min-height: 500px;
    height: 520px;
  }

  .py-lesson-map,
  .py-app-grid,
  .py-route-steps,
  .py-area-grid,
  .py-transfer-grid,
  .py-real-example-grid,
  .py-choice-grid,
  .py-mis-list,
  .py-state-panel,
  .py-diagnostic-grid,
  .py-template-grid,
  .py-progress-rail,
  .py-mastery-list {
    grid-template-columns: 1fr;
  }

  .py-state-equation {
    grid-column: auto;
  }

  .py-adventure-actions {
    justify-content: stretch;
  }

  .py-adventure-actions a {
    width: 100%;
  }
}

