.gw-page {
  --composer-height: 0px;
  --gw-purple: #7757aa;
  background: #f5f7f5;
}

.gw-page [hidden] { display: none !important; }
.gw-page button, .gw-page a, .gw-page summary { -webkit-tap-highlight-color: transparent; }
.gw-page button:focus-visible, .gw-page a:focus-visible, .gw-page summary:focus-visible {
  outline: 3px solid #07847d;
  outline-offset: 4px;
}
.gw-page button { cursor: pointer; }
.gw-page button:disabled { cursor: default; opacity: .48; }
.gw-topbar {
  max-width: 1480px;
  margin: auto;
  padding: 15px 30px;
  display: flex;
  gap: 18px;
  align-items: center;
}
.gw-topbar > a:last-child { margin-left: auto; color: #476a63; font-size: 13px; }
.gw-demo-label { color: #526e64; font-size: 13px; }
.gw-workspace { width: min(1480px, 100%); padding: 30px; margin: auto; }
.gw-intro { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gw-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.gw-lesson { min-width: 0; container-type: inline-size; }
.gw-lesson .problem-card { margin: 0 0 18px; padding: 24px; }
.gw-lesson .problem-card > h2 { margin: 0 0 12px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; }
.gw-lesson .meaning-panel { margin-top: 16px; }
.gw-lesson .meaning-row dd { font-size: 16px; }
#gw-problem { margin: 0; font-size: 18px; line-height: 1.95; }
.gw-actor-panel { margin: 0 0 22px; }
.gw-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gw-toolbar button, .gw-history-controls button, .gw-error button, .gw-graph-controls button {
  background: #fff;
  color: #315b52;
  border: 1px solid #ccddd7;
  border-radius: 9px;
  padding: 9px 13px;
  font: inherit;
  font-size: 13px;
}
.gw-toolbar button[aria-pressed="true"] { border-color: #087f79; color: #075f5a; background: #eaf5f1; font-weight: 650; }
#gw-reset { margin-left: auto; color: #647a74; background: transparent; }
.gw-ai-status { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; padding: 13px 16px; border: 1px dashed #d4cde3; border-radius: 14px; background: #f7f5fb; color: #665283; font-size: 13px; line-height: 1.6; }
.gw-ai-status button { margin-left: auto; padding: 6px 11px; border: 1px solid #cfc5df; border-radius: 8px; background: #fff; color: #665283; font: inherit; font-size: 12px; }
.gw-ai-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gw-purple); opacity: .45; }
.gw-ai-status.is-thinking .gw-ai-dot { animation: gw-ai-pulse 1.1s ease-in-out infinite; }
@keyframes gw-ai-pulse { 50% { opacity: 1; transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .gw-ai-status.is-thinking .gw-ai-dot { animation: none; opacity: 1; } }
.gw-completed { margin: 0 0 10px; border: 1px solid #e1e9e5; border-radius: 16px; background: #fff; transition: border-color .2s; }
.gw-completed[open] { border-color: #cfe2da; }
.gw-completed > summary.step-heading { margin: 0; padding: 13px 16px; gap: 11px; list-style: none; cursor: pointer; }
.gw-completed > summary::-webkit-details-marker { display: none; }
.gw-completed > summary::after { content: '+'; flex: 0 0 auto; width: 14px; color: #6c847b; text-align: center; }
.gw-completed[open] > summary::after { content: '−'; }
.gw-completed .step-number { width: 26px; height: 26px; font-size: 12px; }
.gw-step-title { min-width: 0; color: #24403a; font-size: 15px; font-weight: 650; }
.gw-completed .status { padding: 0; background: none; color: var(--muted); }
.gw-completed-body { min-width: 0; padding: 0 18px 18px 53px; }
.gw-answer { margin: 0; font-size: 14px; line-height: 1.8; color: #375d53; }
.gw-answer-rows { margin: 0; overflow: hidden; border: 1px solid #e3ede8; border-radius: 12px; background: #f6faf8; }
.gw-answer-rows > div { display: grid; gap: 2px; padding: 10px 14px; }
.gw-answer-rows > div + div { border-top: 1px dashed #d9e6e0; }
.gw-answer-rows dt { color: #70847d; font-size: 13px; line-height: 1.7; }
.gw-answer-rows dd { position: relative; margin: 0; padding-left: 20px; color: #1f4a40; font-size: 15px; font-weight: 600; line-height: 1.7; }
.gw-answer-rows dd::before { content: '→'; position: absolute; left: 0; color: #087f79; font-weight: 400; }
.gw-result { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid #6fb3a5; border-radius: 0 10px 10px 0; background: #eaf5f0; color: #1f5a4c; font-size: 14px; font-weight: 550; line-height: 1.75; }
.gw-stream-context { margin: 12px 0 18px; }
.gw-stream-retained { margin-top: 16px; }
.gw-stream-context .stage-three-before { margin: 8px 0; overflow-x: auto; }
.stage-three-math-step.is-embedded { padding: 0; border: 0; border-radius: 0; background: transparent; }
.gw-completed-body .stage-three-math-step + .stage-three-math-step { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e1e9e5; }
.gw-completed-body .stage-three-math-step h3 { margin: 12px 0; font-size: 15px; }
.gw-case-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 4px 0 14px; }
.gw-case-figures .gw-figure { margin: 0; }
.gw-completion-group { margin: 0 0 20px; }
.gw-completion-group + .gw-completion-group { padding-top: 16px; border-top: 1px solid #e1e9e5; }
.gw-completion-group > h3 { margin: 0 0 12px; color: #1f4a40; font-size: 15px; font-weight: 650; }
.gw-folded { margin-top: 16px; border: 1px solid #e1e9e5; border-radius: 10px; background: #fbfdfc; }
.gw-folded > summary { padding: 9px 14px; color: #4b6e65; font-size: 13px; cursor: pointer; }
.gw-folded > .stage-three-math-step { margin: 0; padding: 4px 14px 14px; }
.gw-folded > .stage-three-math-step + .stage-three-math-step { border-top: 1px dashed #d9e6e0; }
.stage-three-highlight .function-conversion .math { font-size: 18px; white-space: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.stage-three-conclusion .stage-three-after { margin: 8px 0; color: #1f5a4c; font-size: 18px; overflow-x: auto; overflow-y: hidden; }
.stage-three-derivation .stage-three-before { margin: 10px 0; overflow-x: auto; overflow-y: hidden; }
.gw-stream-routes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.gw-stream-routes button { padding: 8px 13px; border: 1px solid #ccddd7; border-radius: 9px; background: #fff; color: #315b52; font: inherit; font-size: 13px; }
.gw-stream-routes button[aria-pressed="true"] { border-color: #087f79; background: #eaf5f1; color: #075f5a; font-weight: 650; }
.gw-problem-dock { position: sticky; z-index: 6; top: 0; height: 0; }
.gw-problem-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: baseline; gap: 10px; padding: 9px 14px; border: 1px solid #d5e4dd; border-radius: 12px; background: #fff; box-shadow: 0 10px 24px rgba(16, 40, 32, .1); color: #24403a; font-size: 14px; line-height: 1.65; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.gw-problem-dock.is-shown .gw-problem-bar { opacity: 1; transform: none; }
.gw-problem-bar-label { flex: 0 0 auto; padding: 0 7px; border-radius: 999px; background: #e9f2ee; color: #5d7a70; font-size: 11px; font-weight: 600; }
.gw-problem-bar-text { min-width: 0; }
.gw-carry { margin: 0 0 14px; padding: 9px 13px; border-left: 3px solid #6fb3a5; border-radius: 0 10px 10px 0; background: #f1f8f5; }
.gw-carry p { margin: 0; color: #1f5a4c; font-size: 14px; font-weight: 550; line-height: 1.7; }
.gw-carry .gw-carry-label { margin-bottom: 2px; color: #6f8a81; font-size: 11px; font-weight: 600; }
.gw-merge-premises dl { margin: 0; }
.gw-merge-premise { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 5px 0; }
.gw-merge-premise + .gw-merge-premise { border-top: 1px dashed #d6e7e1; }
.gw-merge-premise dt { color: #6f8a81; font-size: 13px; }
.gw-merge-premise dd { margin: 0; }
.gw-part-stepper { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; padding: 0; list-style: none; color: #8a9c95; font-size: 13px; }
.gw-part-stepper li { display: inline-flex; align-items: center; gap: 6px; }
.gw-part-stepper li > span { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid #cfdcd6; border-radius: 50%; font-size: 11px; font-weight: 650; }
.gw-part-stepper li[data-state="done"] { color: #3f6f62; }
.gw-part-stepper li[data-state="done"] > span { border-color: #9fcabd; background: #eaf5f0; color: #087f79; }
.gw-part-stepper li[data-state="current"] { color: #1f4a40; font-weight: 650; }
.gw-part-stepper li[data-state="current"] > span { border-color: var(--teal); background: var(--teal); color: #fff; }
.gw-part-done { display: grid; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: #f6faf8; }
.gw-part-row { display: grid; gap: 4px; min-width: 0; }
.gw-part-row + .gw-part-row { padding-top: 10px; border-top: 1px dashed #d9e6e0; }
.gw-part-label { display: flex; gap: 6px; margin: 0; color: #70847d; font-size: 12px; font-weight: 600; }
.gw-part-label > span { color: #087f79; }
.gw-part-row .gw-answer-rows { background: #fff; }
.gw-part-current { margin: 0 0 6px; color: #087f79; font-size: 13px; font-weight: 650; outline: none; }
.gw-active { background: #fff; border: 1.5px solid #85bdb0; box-shadow: 0 5px 18px #173d2e08; border-radius: 16px; padding: 22px 24px 24px; margin-top: 18px; }
.gw-active, .gw-completed, .gw-completion, .gw-part-stepper { scroll-margin-top: calc(76px + var(--gw-bar-h, 0px)); }
.gw-active .step-heading { margin-bottom: 16px; }
.gw-active .step-number { background: var(--teal); color: #fff; }
.gw-active h2 { margin: 0; font-size: 19px; line-height: 1.4; }
.gw-active .question { margin: 0 0 18px; font-size: 17px; font-weight: 600; line-height: 1.75; }
.gw-interaction { min-width: 0; }
.gw-interaction .method-choice { width: 100%; text-align: left; }
.gw-interaction .method-choice > [data-math-text] { min-width: 0; overflow-wrap: anywhere; }
.gw-multi { display: grid; gap: 10px; }
.gw-multi button { display: flex; align-items: flex-start; gap: 11px; border: 1px solid #d4e2dc; border-radius: 11px; background: #f9fbf9; color: #294e43; padding: 15px; text-align: left; font: inherit; font-size: 14px; line-height: 1.75; }
.gw-multi button[aria-pressed="true"] { background: #eaf6f0; border-color: #6cae9c; }
.gw-graph-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gw-page .gw-graph-options button { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 0; padding: 8px 6px 10px; border: 1.5px solid #d4e2dc; border-radius: 12px; background: #fbfdfc; color: #294e43; font: inherit; transition: border-color .2s, background .2s, box-shadow .2s; }
.gw-page .gw-graph-options button:hover { border-color: #8fbfb2; }
.gw-page .gw-graph-options button[aria-pressed="true"] { border-color: #087f79; background: #eaf6f1; box-shadow: 0 6px 16px rgba(8, 127, 121, .12); }
.gw-graph-options .gw-checkbox { position: absolute; top: 8px; left: 8px; margin: 0; background: #fff; }
.gw-graph-option-figure { display: block; width: 100%; }
.gw-graph-option-figure svg { display: block; width: 100%; height: auto; }
.gw-graph-option-figure .quadratic-curve { stroke-width: 7px; }
.gw-graph-option-figure svg > path:not(.quadratic-curve) { stroke-width: 3px; }
.gw-graph-option-figure .quadratic-point { r: 10px; fill: #294e43; }
.gw-graph-option-figure .quadratic-solution { stroke-width: 14px; }
.gw-graph-option-figure .quadratic-endpoint { r: 13px; stroke-width: 5px; }
.gw-graph-option-figure text { font-size: 30px; }
.gw-graph-option-name { font-size: 14px; font-weight: 650; }
.gw-graph-options[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gw-graph-options[data-kind] { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.gw-graph-options[data-kind="number_line"] { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.gw-graph-figure { display: block; width: 100%; padding-top: 14px; }
.gw-graph-figure svg { display: block; width: 100%; height: auto; }
.gw-figure { display: grid; justify-items: center; gap: 4px; margin: 10px 0 14px; }
.gw-figure-plot { display: block; width: min(100%, 380px); }
.gw-figure-plot svg { display: block; width: 100%; height: auto; }
.gw-figure figcaption { color: #5b7069; font-size: 13px; text-align: center; }
.gw-figure-plot .axis-explorer { display: grid; gap: 6px; }
.gw-figure-plot .axis-explorer svg { cursor: ew-resize; touch-action: pan-y; user-select: none; }
.gw-figure-plot .axis-slider { justify-self: center; width: min(100%, 320px); accent-color: #b6782c; }
.gw-checkbox { flex: 0 0 18px; width: 18px; height: 18px; border: 1px solid #85ab9e; border-radius: 4px; margin-top: 3px; display: grid; place-items: center; color: #087f79; font-size: 13px; line-height: 1; }
.gw-plane { display: grid; gap: 6px; }
.gw-plane [data-method="discriminant"], .gw-plane-methods [data-method="discriminant"] { --m: #b7791f; }
.gw-plane [data-method="interval"], .gw-plane-methods [data-method="interval"] { --m: #3d74ad; }
.gw-plane [data-method="separation"], .gw-plane-methods [data-method="separation"] { --m: #0d8576; }
.gw-plane [data-method="swap"], .gw-plane-methods [data-method="swap"] { --m: var(--gw-purple); }
.gw-plane-top { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.gw-plane-bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 8px; }
.gw-plane-ylabel, .gw-plane-xlabel { margin: 0; color: #2c4f45; font-size: 13px; font-weight: 650; line-height: 1.6; }
.gw-plane-xlabel { justify-self: end; text-align: right; }
.gw-plane-ylabel::before, .gw-plane-xlabel::before { margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: #e9f2ee; color: #5d7a70; font-size: 11px; font-weight: 600; }
.gw-plane-ylabel::before { content: '纵轴'; }
.gw-plane-xlabel::before { content: '横轴'; }
.gw-plane-end { display: inline-flex; align-items: baseline; gap: 5px; color: #24403a; white-space: nowrap; line-height: 1.5; }
.gw-plane-end b { font-size: 13px; }
.gw-plane-end small { color: #7a8f87; font-size: 11px; }
.gw-plane-field { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 40px 30px; padding: 12px; }
.gw-plane-axis { position: absolute; background: #6b877e; pointer-events: none; }
.gw-plane-axis[data-axis="x"] { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; }
.gw-plane-axis[data-axis="y"] { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; }
.gw-plane-axis::after { content: ''; position: absolute; width: 0; height: 0; border: 6px solid transparent; }
.gw-plane-axis[data-axis="x"]::after { right: -3px; top: -5px; border-left: 10px solid #6b877e; border-right-width: 0; }
.gw-plane-axis[data-axis="y"]::after { left: -5px; top: -3px; border-bottom: 10px solid #6b877e; border-top-width: 0; }
.gw-plane-field > .gw-plane-end { position: absolute; z-index: 1; top: 50%; padding: 0 6px; background: #fff; transform: translateY(-50%); }
.gw-plane-field > [data-end="left"] { left: 0; padding-left: 0; }
.gw-plane-field > [data-end="right"] { right: 14px; }
.gw-page .gw-plane-cell { position: relative; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 5px; min-width: 0; min-height: 84px; padding: 12px 8px; border: 1.5px dashed #cfdfd8; border-radius: 12px; background: #fbfdfc; font: inherit; transition: border-color .2s, background .2s, opacity .2s, box-shadow .2s; }
.gw-page button.gw-plane-cell:hover { border-color: #8fbfb2; background: #f3faf7; }
.gw-plane-cell[data-selected="true"] { border: 2px solid #087f79; background: #eaf6f1; box-shadow: 0 8px 20px rgba(8, 127, 121, .12); }
.gw-plane-field:has([data-selected="true"]) .gw-plane-cell:not([data-selected="true"]) { opacity: .5; }
.gw-plane-tag { padding: 2px 9px; border: 1px solid color-mix(in srgb, var(--m) 32%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--m) 11%, #fff); color: var(--m); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.gw-plane-tag[data-chosen] { border-color: var(--m); background: var(--m); color: #fff; }
.gw-plane-tag[data-chosen]::before { content: '✓ '; }
.gw-plane-pin { position: absolute; top: -10px; right: 10px; padding: 1px 9px; border-radius: 999px; background: #087f79; color: #fff; font-size: 11px; font-weight: 650; line-height: 1.6; box-shadow: 0 4px 10px rgba(8, 127, 121, .3); animation: gw-pin .28s cubic-bezier(.2, .7, .2, 1.4); }
@keyframes gw-pin { from { opacity: 0; transform: translateY(6px) scale(.7); } }
.gw-plane.is-static .gw-plane-field { gap: 36px 26px; padding: 10px; }
.gw-plane.is-static .gw-plane-cell { min-height: 58px; padding: 9px 6px; }
.gw-plane.is-static .gw-plane-pin { animation: none; }
.gw-plane [data-zone="direct"] { --m: #0d8576; }
.gw-plane [data-zone="flip"] { --m: #b7791f; }
.gw-plane [data-zone="unfit"] { --m: #8a9590; }
.gw-plane.is-static + details { margin-top: 12px; }
.gw-plane-hint { margin: 14px 0 0; color: #70847d; font-size: 13px; }
.gw-plane-methods { margin-top: 16px; padding: 13px 14px 14px; border: 1px solid #e3ede8; border-radius: 12px; background: #f6faf8; }
.gw-plane-methods > p { margin: 0 0 10px; color: #486e60; font-size: 13px; }
.gw-plane-methods > div { display: flex; flex-wrap: wrap; gap: 8px; }
.gw-page .gw-plane-methods button { display: inline-flex; align-items: baseline; gap: 6px; padding: 9px 14px; border: 1.5px solid color-mix(in srgb, var(--m) 38%, transparent); border-radius: 10px; background: #fff; color: var(--m); font: inherit; font-size: 14px; font-weight: 650; }
.gw-page .gw-plane-methods button:hover { background: color-mix(in srgb, var(--m) 8%, #fff); }
.gw-page .gw-plane-methods button[aria-pressed="true"] { border-color: var(--m); background: var(--m); color: #fff; }
.gw-plane-methods small { font-size: 11px; font-weight: 500; opacity: .75; }
.gw-submit-row { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.gw-submit-row .primary { white-space: normal; height: auto; min-height: 43px; padding: 11px 17px; font-size: 14px; text-align: left; }
.gw-submit-row > span { color: #706581; font-size: 12px; }
.gw-feedback { margin-top: 17px; padding: 14px 16px; border-radius: 11px; background: #fff6e7; border: 1px solid #edddc0; color: #84602c; font-size: 13px; }
.gw-feedback strong { font-size: 13px; }
.gw-feedback p { margin: 7px 0 0; line-height: 1.8; }
.gw-feedback[data-status="uncovered"] { background: #f0edf7; border-color: #d9cee8; color: #705989; }
.gw-feedback[data-status="passed"] { background: #eaf6ed; border-color: #c5e0ca; color: #3c7048; }
.gw-feedback a { display: inline-block; margin-top: 9px; color: inherit; }
.gw-token-panel { border: 1px solid #bdd7ce; border-radius: 12px; background: #f2f8f5; margin-top: 13px; padding: 14px; }
.gw-token-panel > p { margin: 0 0 10px; font-size: 13px; color: #486e60; }
.gw-token-panel > div { display: flex; flex-wrap: wrap; gap: 8px; }
.gw-token-panel [data-token] { min-width: 48px; padding: 10px 14px; font: inherit; border: 1px solid #bdd2c9; border-radius: 8px; background: #fff; color: #215746; }
.gw-token-panel [aria-pressed="true"] { background: #dcefe4; border-color: #538772; }
.gw-token-close { margin-top: 12px; border: none; background: none; padding: 2px; color: #537c6e; font-size: 12px; }
.gw-history-controls { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
#gw-progress { color: #6e8279; font-size: 12px; }
.gw-completion { margin-top: 19px; border-radius: 15px; padding: 18px 20px; background: #eaf4ec; border: 1px solid #c5dbc8; }
.gw-completion h2 { font-size: 13px; font-weight: 650; letter-spacing: .04em; color: #2f7a55; margin: 0 0 10px; }
.gw-completion-answer { padding: 12px; border-radius: 11px; background: #fff; text-align: center; font-size: 20px; }
.gw-completion p { margin: 10px 0 14px; font-size: 14px; line-height: 1.7; color: #406852; }
.gw-completion-takeaways { margin: 10px 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; line-height: 1.7; color: #406852; }
.gw-completion-takeaways b { color: #2f7a55; font-weight: 650; }
.gw-completion-back { margin-left: auto; font-size: 13px; color: #2f7a55; text-decoration: none; }
.gw-completion-back:hover { text-decoration: underline; }
.gw-graph-panel { position: sticky; top: 20px; min-width: 0; border: 1px solid #d0dfd8; background: #fff; border-radius: 18px; padding: 21px; box-shadow: 0 4px 16px #214b3705; }
.gw-graph-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.gw-graph-heading .eyebrow { font-size: 10px; color: #7b9287; margin: 0 0 7px; }
.gw-graph-heading h2 { font-size: 18px; margin: 0; line-height: 1.45; }
#gw-close-graph { display: none; }
.gw-graph-controls { display: flex; align-items: center; gap: 6px; margin: 16px 0 10px; }
.gw-graph-controls button { padding: 7px 10px; font-size: 12px; }
.gw-graph-controls > :nth-child(3) { margin-left: auto; }
.gw-mode-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #d6e3dd; border-radius: 10px; background: #eef3f0; }
.gw-graph-controls .gw-mode-switch button { padding: 5px 11px; border: 0; border-radius: 8px; background: transparent; color: #5d7770; }
.gw-graph-controls .gw-mode-switch button:hover:not([aria-pressed="true"]) { background: rgba(255, 255, 255, .65); color: #075f5a; }
.gw-graph-controls .gw-mode-switch button[aria-pressed="true"] { background: #fff; color: #075f5a; font-weight: 650; box-shadow: 0 1px 3px rgba(16, 40, 32, .16); cursor: default; }
.gw-graph-controls .gw-mode-switch button:focus-visible { outline: 2px solid #6cafa0; outline-offset: 1px; }
.gw-svg { display: block; width: 100%; height: min(48vh, 510px); min-height: 340px; background: #f6f9f6; border: 1px solid #e1e9e2; border-radius: 12px; touch-action: none; user-select: none; }
.gw-svg:focus-visible { outline: 3px solid #6cafa0; outline-offset: 3px; }
.gw-lane-title { fill: #708579; font-size: 13px; font-weight: 650; }
.gw-lane-rule { stroke: #dfe8e2; stroke-width: 1px; stroke-dasharray: 4 5; }
.gw-node { --node-accent: #3b8171; cursor: pointer; outline: none; }
.gw-node[data-kind="skill"] { --node-accent: #4576a7; }
.gw-node[data-kind="method"] { --node-accent: #a47836; }
.gw-node[data-kind="problem_type"] { --node-accent: #ba6059; }
.gw-node[data-kind="judgment_rule"] { --node-accent: #8a65a6; }
.gw-node rect { fill: #fff; stroke: #cbd9ce; stroke-width: 1.3px; }
.gw-node-label { fill: #375446; font-size: 13px; font-weight: 550; }
.gw-node-status { fill: var(--node-accent); font-size: 10px; font-weight: 650; }
.gw-node-steps { fill: #087f79; font-size: 10px; font-weight: 650; }
.gw-graph-controls [data-graph-action="idle"][aria-pressed="true"] { border-color: #087f79; color: #075f5a; background: #eaf5f1; }
.gw-node[data-state="idle"] { opacity: .46; }
.gw-node[data-state="candidate"] rect { stroke: var(--node-accent); stroke-dasharray: 5 3; }
.gw-node[data-state="active"] rect { fill: #eaf5ee; stroke: var(--node-accent); stroke-width: 3px; }
.gw-node[data-state="confirmed"] rect { fill: #edf5ed; stroke: var(--node-accent); stroke-width: 2px; }
.gw-node[data-state="rejected"], .gw-node[data-state="skipped"] { opacity: .55; }
.gw-node[data-state="skipped"] rect { stroke-dasharray: 3 3; }
.gw-node.is-selected rect, .gw-node:focus-visible rect { stroke: #152f25; stroke-width: 3px; }
.gw-edge path { fill: none; stroke: #aabcb2; stroke-width: 1.2px; }
.gw-edge text { font-size: 10px; fill: #728578; paint-order: stroke; stroke: #f6f9f6; stroke-width: 4px; stroke-linejoin: round; }
.gw-edge[data-state="idle"] { opacity: .13; }
.gw-edge[data-state="candidate"] path { stroke: #8b77a4; stroke-dasharray: 5 5; }
.gw-edge[data-state="chosen"] path { stroke: #138b73; stroke-width: 2.5px; }
.gw-edge[data-state="chosen"] text { fill: #2d7662; }
.gw-edge.is-archived[data-state="idle"] { opacity: .65; }
.gw-edge.is-archived[data-state="idle"] path { stroke: var(--gw-purple); stroke-width: 2px; stroke-dasharray: 6 4; }
.gw3-stage { position: relative; height: min(52vh, 540px); min-height: 360px; overflow: hidden; border: 1px solid #1d3242; border-radius: 12px; background: radial-gradient(120% 90% at 50% 32%, #15283a 0%, #0b1622 58%, #070f17 100%); touch-action: none; user-select: none; }
.gw3-stage:focus-visible { outline: 3px solid #6cafa0; outline-offset: 3px; }
.gw3-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.gw3-labels { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.gw3-anchor { pointer-events: none; }
.gw3-node { --accent: #2dd4bf; --s: 1; display: block; max-width: 168px; margin-bottom: 4px; padding: 5px 9px 6px; transform: scale(var(--s)); transform-origin: 50% 100%; border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent); border-radius: 9px; background: rgba(9, 20, 30, .76); color: #dce9f2; font: inherit; font-size: 12px; font-weight: 550; line-height: 1.4; text-align: center; backdrop-filter: blur(3px); pointer-events: auto; transition: opacity .3s, border-color .3s, box-shadow .3s, background .3s; }
.gw3-node[data-kind="skill"] { --accent: #7cb8ff; }
.gw3-node[data-kind="method"] { --accent: #f5b54a; }
.gw3-node[data-kind="problem_type"] { --accent: #ff8f7a; }
.gw3-node[data-kind="judgment_rule"] { --accent: #c4a1ff; }
.gw3-status { display: block; margin-bottom: 1px; color: var(--accent); font-size: 10px; font-weight: 650; }
.gw3-status:empty { display: none; }
.gw3-node[data-state="idle"] { opacity: .52; }
.gw3-node[data-state="candidate"] { border-style: dashed; border-color: var(--accent); }
.gw3-node[data-state="active"] { border: 1.5px solid var(--accent); background: rgba(13, 33, 44, .92); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent); }
.gw3-node[data-state="confirmed"] { border-color: color-mix(in srgb, var(--accent) 80%, transparent); color: #f2f8fb; }
.gw3-node[data-state="rejected"], .gw3-node[data-state="skipped"] { opacity: .55; }
.gw3-node:hover { border-color: var(--accent); opacity: 1; }
.gw3-node[data-far] { opacity: 0; pointer-events: none; }
.gw3-node[data-far]:focus-visible { opacity: 1; }
.gw-page .gw3-node.is-selected, .gw-page .gw3-node:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gw3-band { --s: 1; padding: 3px 10px; transform: scale(var(--s)); border: 1px solid rgba(143, 176, 196, .28); border-radius: 999px; background: rgba(9, 20, 30, .5); color: #8fb0c4; font-size: 12px; font-weight: 650; letter-spacing: .08em; white-space: nowrap; pointer-events: none; }
.gw3-edge { padding: 1px 6px; border-radius: 6px; background: rgba(7, 15, 23, .72); color: #a7f3d0; font-size: 10px; white-space: nowrap; pointer-events: none; }
.gw3-edge[data-state="candidate"] { color: #ddd6fe; }
.gw3-edge[data-state="idle"] { color: #b6c6d3; }
.gw3-hint { position: absolute; z-index: 1; right: 14px; top: 12px; margin: 0; color: rgba(190, 210, 224, .5); font-size: 11px; pointer-events: none; }
.gw3-legend { position: absolute; z-index: 1; left: 10px; top: 8px; display: flex; flex-wrap: wrap; gap: 4px 13px; max-width: 62%; margin: 0; padding: 4px 11px; border: 1px solid rgba(143, 176, 196, .12); border-radius: 12px; background: rgba(8, 18, 27, .88); backdrop-filter: blur(6px); color: rgba(205, 222, 233, .78); font-size: 11px; pointer-events: none; }
.gw3-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gw3-legend span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 7px var(--c); }
.gw3-hub { display: grid; justify-items: center; gap: 1px; padding: 4px 11px 5px; border: 1px solid rgba(94, 234, 212, .55); border-radius: 999px; background: rgba(6, 30, 32, .78); box-shadow: 0 0 18px rgba(45, 212, 191, .35); pointer-events: none; white-space: nowrap; }
.gw3-hub strong { color: #ecfeff; font-size: 13px; letter-spacing: .12em; }
.gw3-hub span { color: #7dd3c8; font-size: 10px; }
.gw-caption { padding: 12px 2px 2px; }
.gw-caption-kicker { margin: 0 0 4px; color: #087f79; font-size: 11px; font-weight: 650; letter-spacing: .05em; }
.gw-caption-text { margin: 0; color: #1f3a31; font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", STSong, serif; font-size: 17px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; }
.gw-caption-next { margin: 5px 0 0; color: #6b8379; font-size: 12px; }
.gw-caption-next:empty, .gw-caption-kicker:empty { display: none; }
.gw-caption[data-status="wrong"] .gw-caption-kicker { color: #b45309; }
.gw3-stage .gw-caption { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 46px 24px 15px; text-align: center; pointer-events: none; background: linear-gradient(to top, rgba(4, 10, 16, .92) 0%, rgba(4, 10, 16, .66) 52%, rgba(4, 10, 16, 0)); }
.gw3-stage .gw-caption-kicker { color: #5eead4; }
.gw3-stage .gw-caption-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: #f4f8fb; font-size: clamp(16px, 1.55vw, 21px); text-shadow: 0 2px 14px rgba(0, 0, 0, .65); }
.gw3-stage .gw-caption-next { color: rgba(190, 210, 224, .78); }
.gw3-stage .gw-caption[data-status="wrong"] .gw-caption-kicker { color: #fbbf24; }
.gw-timeline { display: flex; align-items: stretch; gap: 8px; margin-top: 10px; }
.gw-page .gw-timeline-play { flex: 0 0 38px; border: 1px solid #ccddd7; border-radius: 9px; background: #fff; color: #315b52; font-size: 12px; }
.gw-timeline ol { position: relative; display: flex; flex: 1; gap: 6px; min-width: 0; margin: 0; padding: 0 0 5px; list-style: none; overflow-x: auto; scrollbar-width: thin; }
.gw-timeline li { flex: 0 0 auto; }
.gw-timeline [data-time] { display: grid; gap: 2px; min-width: 74px; max-width: 124px; padding: 6px 9px 7px; border: 1px solid #d7e3de; border-radius: 9px; background: #fff; color: #315b52; font: inherit; text-align: left; }
.gw-timeline [data-time] b { display: flex; align-items: center; gap: 5px; color: #7b9287; font-size: 10px; }
.gw-timeline [data-time] b::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #9fb7c9; }
.gw-timeline [data-status="passed"] b::before { background: #10b981; }
.gw-timeline [data-status="wrong"] b::before { background: #f59e0b; }
.gw-timeline [data-status="uncovered"] b::before { background: #a78bfa; }
.gw-timeline [data-time] span { overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.gw-timeline [aria-current="step"] { border-color: #087f79; background: #eaf5f1; box-shadow: 0 0 0 2px rgba(8, 127, 121, .14); }
.gw-timeline [aria-current="step"] b { color: #087f79; }
.gw-timeline .is-future { opacity: .55; }
.gw-page .gw-timeline [data-time]:disabled { border-style: dashed; opacity: .6; }
.gw-legend { display: flex; gap: 9px; flex-wrap: wrap; font-size: 10px; color: #687f70; padding: 11px 0; }
.gw-archive-key { color: var(--gw-purple); }
.gw-selection { position: relative; padding: 12px 38px 12px 14px; border: 1px solid #cddfd5; border-radius: 12px; margin: 10px 0 0; background: #f6faf7; }
.gw-selection h3 { font-size: 13px; margin: 0; }
.gw-page .gw-selection-close { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #6b8379; font-size: 18px; line-height: 1; }
.gw-page .gw-selection-close:hover { background: rgba(8, 127, 121, .1); }
.gw-selection p, .gw-selection a { font-size: 12px; line-height: 1.7; color: #5a7866; }
.gw-selection p { margin: 7px 0; }
.gw-log-panel { border-top: 1px solid #e3eae4; padding-top: 14px; }
.gw-log-panel h3 { margin: 0 0 8px; font-size: 13px; }
.gw-log-panel ol { padding: 0 0 0 19px; margin: 0; color: #5a7767; font-size: 12px; line-height: 1.85; }
.gw-log-panel li { margin-bottom: 5px; overflow-wrap: anywhere; }
.gw-log-panel summary, .gw-used summary { cursor: pointer; color: #48765c; font-size: 12px; padding: 8px 0; }
.gw-used { border-top: 1px solid #e5ece6; margin-top: 10px; }
.gw-used ul, .gw-used ol { padding-left: 19px; margin: 2px 0 7px; font-size: 12px; line-height: 1.9; }
.gw-used a { color: #3a765d; }
#gw-used-count { margin-left: 5px; color: #78917d; }
#gw-calls li { margin-bottom: 8px; }
#gw-calls span, #gw-calls strong { display: block; }
#gw-calls span { color: #738876; font-size: 11px; }
#gw-calls strong { color: #486753; font-weight: 550; }

.gw-panel-dock { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.gw-panel-dock .gw-log-panel { display: contents; }
.gw-panel-dock .gw-log-panel > h3, .gw-panel-dock #gw-logs { display: none; }
.gw-panel-dock .gw-used { margin: 0; border: 0; }
.gw-panel-dock summary { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid #d7e3de; border-radius: 999px; background: #fff; color: #48765c; font-size: 12px; line-height: 1.6; list-style: none; user-select: none; }
.gw-panel-dock summary::-webkit-details-marker { display: none; }
.gw-panel-dock summary::after { content: '▴'; font-size: 9px; opacity: .6; }
.gw-panel-dock details[open] > summary { border-color: #087f79; color: #075f5a; background: #eaf5f1; }
.gw-panel-dock summary > span { margin: 0; color: #087f79; font-weight: 650; font-variant-numeric: tabular-nums; }
.gw-panel-dock details[open] > :not(summary) { position: absolute; z-index: 8; left: 0; right: 0; bottom: calc(100% + 8px); max-height: min(46vh, 420px); overflow: auto; margin: 0; padding: 14px 18px 12px 36px; border: 1px solid #d7e3de; border-radius: 14px; background: #fff; box-shadow: 0 18px 44px rgba(16, 40, 32, .2); }

.gw-actor-panel > .gw-toolbar { gap: 0; }
.gw-page #gw-student { border-radius: 10px 0 0 10px; }
.gw-page #gw-ai { position: relative; margin-left: -1px; border-radius: 0 10px 10px 0; }
.gw-page #gw-student[aria-pressed="true"], .gw-page #gw-ai[aria-pressed="true"] { position: relative; z-index: 1; }
.gw-active { border-color: #6fb3a5; box-shadow: 0 14px 34px rgba(8, 127, 121, .09); }

.gw-graph-panel[data-mode="3d"] { border-color: #13263a; background: linear-gradient(180deg, #0e1c29 0%, #08121b 100%); box-shadow: 0 22px 50px rgba(7, 18, 28, .24); color: #d4e3ec; }
.gw-graph-panel[data-mode="3d"] .gw-graph-heading .eyebrow { color: #5eead4; opacity: .75; }
.gw-graph-panel[data-mode="3d"] .gw-graph-heading h2 { color: #f1f7fa; }
.gw-graph-panel[data-mode="3d"] .gw-graph-controls button, .gw-graph-panel[data-mode="3d"] .gw-timeline-play, .gw-graph-panel[data-mode="3d"] #gw-close-graph { border-color: rgba(143, 176, 196, .22); background: rgba(255, 255, 255, .05); color: #cfe0ea; }
.gw-graph-panel[data-mode="3d"] .gw-graph-controls button:hover, .gw-graph-panel[data-mode="3d"] .gw-timeline-play:hover:not(:disabled) { background: rgba(255, 255, 255, .11); }
.gw-graph-panel[data-mode="3d"] .gw-mode-switch { border-color: rgba(143, 176, 196, .22); background: rgba(255, 255, 255, .05); }
.gw-graph-panel[data-mode="3d"] .gw-graph-controls .gw-mode-switch button { background: transparent; color: #9fb7c9; }
.gw-graph-panel[data-mode="3d"] .gw-graph-controls .gw-mode-switch button:hover:not([aria-pressed="true"]) { background: rgba(255, 255, 255, .08); color: #e6f1f7; }
.gw-graph-panel[data-mode="3d"] .gw-graph-controls .gw-mode-switch button[aria-pressed="true"] { background: rgba(45, 212, 191, .2); color: #e6fffa; box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .45); }
.gw-graph-panel[data-mode="3d"] .gw3-stage { border-color: rgba(143, 176, 196, .14); }
.gw-graph-panel[data-mode="3d"] .gw-legend { display: none; }
.gw-graph-panel[data-mode="3d"] .gw-timeline [data-time] { border-color: rgba(143, 176, 196, .18); background: rgba(255, 255, 255, .035); color: #cfe0ea; }
.gw-graph-panel[data-mode="3d"] .gw-timeline [data-time] b { color: #7f98aa; }
.gw-graph-panel[data-mode="3d"] .gw-timeline [data-time]:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }
.gw-graph-panel[data-mode="3d"] .gw-timeline [aria-current="step"] { border-color: #2dd4bf; background: rgba(45, 212, 191, .13); box-shadow: 0 0 0 2px rgba(45, 212, 191, .18); }
.gw-graph-panel[data-mode="3d"] .gw-timeline [aria-current="step"] b { color: #5eead4; }
.gw-graph-panel[data-mode="3d"] .gw-timeline ol { scrollbar-color: rgba(143, 176, 196, .3) transparent; }
.gw-graph-panel[data-mode="3d"] .gw-panel-dock summary { border-color: rgba(143, 176, 196, .2); background: rgba(255, 255, 255, .04); color: #b9cdd9; }
.gw-graph-panel[data-mode="3d"] .gw-panel-dock details[open] > summary { border-color: rgba(45, 212, 191, .7); background: rgba(45, 212, 191, .13); color: #e6fffa; }
.gw-graph-panel[data-mode="3d"] .gw-panel-dock summary > span { color: #5eead4; }
.gw-graph-panel[data-mode="3d"] .gw-panel-dock details[open] > :not(summary) { border-color: rgba(143, 176, 196, .22); background: rgba(10, 22, 33, .97); color: #c3d6e2; box-shadow: 0 22px 50px rgba(0, 0, 0, .45); }
.gw-graph-panel[data-mode="3d"] .gw-panel-dock a { color: #7dd3c8; }
.gw-graph-panel[data-mode="3d"] #gw-calls span { color: #87a0b1; }
.gw-graph-panel[data-mode="3d"] #gw-calls strong { color: #dbe8f0; }
.gw-graph-panel[data-mode="3d"] .gw-selection { border-color: rgba(143, 176, 196, .26); background: rgba(10, 22, 33, .9); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); backdrop-filter: blur(8px); }
.gw-graph-panel[data-mode="3d"] .gw-selection h3 { color: #f1f7fa; }
.gw-graph-panel[data-mode="3d"] .gw-selection p { color: #a9bfcd; }
.gw-graph-panel[data-mode="3d"] .gw-selection a { color: #7dd3c8; }
.gw-graph-panel[data-mode="3d"] .gw-selection-close { color: #9fb7c9; }
.gw-graph-panel[data-mode="3d"] .gw-selection-close:hover { background: rgba(255, 255, 255, .08); }
.gw-path-toggle { display: none; }
.gw-player-problem, #gw-player-exit, #gw-open-steps, .gw-sheet-head { display: none; }
.gw-error { padding: 20px; border: 1px solid #e3c8b5; border-radius: 13px; background: #fff8ed; color: #856039; font-size: 14px; }
.gw-footer { border-top: 1px solid #dce6de; margin: 35px 0 0; padding: 19px 0; color: #798d80; font-size: 12px; line-height: 1.8; }
.gw-footer p { margin: 0 0 4px; }
#gw-version { overflow-wrap: anywhere; font-size: 10px; }

@media (min-width: 960px) {
  .gw-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  .gw-page > .topbar { flex: 0 0 auto; height: 52px; }
  .gw-topbar { max-width: none; height: 100%; padding: 0 24px; }
  .gw-workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 1840px; padding: 14px 22px 8px; }
  #gw-ready { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .gw-layout { flex: 1; min-height: 0; grid-template-columns: clamp(380px, 31vw, 540px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 18px; align-items: stretch; }
  .gw-lesson { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 32px 4px; scrollbar-width: thin; scrollbar-color: #cbd9d3 transparent; scrollbar-gutter: stable; }
  .gw-lesson .problem-card { margin-bottom: 14px; padding: 18px 20px; }
  #gw-problem { font-size: 17px; line-height: 1.85; }
  .gw-actor-panel { margin-bottom: 16px; }
  .gw-active { margin-top: 14px; padding: 22px; }
  .gw-active, .gw-completed, .gw-completion, .gw-part-stepper { scroll-margin-top: calc(10px + var(--gw-bar-h, 0px)); }
  .gw-lesson::after { content: ''; display: block; height: 60%; }
  .gw-problem-dock { top: -4px; }
  .gw-problem-bar { border-top: 0; border-radius: 0 0 12px 12px; }
  .gw-graph-panel { position: relative; top: auto; display: flex; flex-direction: column; min-height: 0; padding: 14px 16px 12px; border-radius: 20px; }
  .gw-graph-heading { flex: 0 0 auto; align-items: center; min-height: 32px; margin-bottom: 10px; }
  .gw-graph-heading > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
  .gw-graph-heading .eyebrow { margin: 0; font-size: 11px; white-space: nowrap; }
  .gw-graph-heading h2 { font-size: 15px; white-space: nowrap; }
  .gw-graph-controls { position: absolute; z-index: 3; top: 14px; right: 16px; margin: 0; }
  .gw-graph-controls > :nth-child(3) { margin-left: 8px; }
  #gw-graph { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .gw3-stage, .gw-svg { flex: 1 1 0; height: auto; min-height: 300px; }
  .gw-timeline, .gw-panel-dock, .gw-legend { flex: 0 0 auto; }
  .gw-graph-panel > .gw-caption { flex: 0 0 auto; }
  .gw-selection { position: absolute; z-index: 7; left: 30px; top: 98px; width: min(300px, 40%); margin: 0; box-shadow: 0 14px 34px rgba(16, 40, 32, .14); }
  .gw-footer { flex: 0 0 auto; display: flex; align-items: baseline; gap: 16px; margin: 8px 0 0; padding: 0 4px; border: 0; font-size: 11px; line-height: 1.5; }
  .gw-footer p { margin: 0; }
  #gw-version { margin-left: auto; max-width: 40%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

@media (min-width: 960px) and (max-width: 1279px) {
  .gw-graph-heading .eyebrow { display: none; }
  .gw3-hint { display: none; }
}

@media (min-width: 960px) and (max-height: 700px) {
  .gw-page { height: auto; overflow: visible; }
  .gw-layout { min-height: 640px; }
}

@container (max-width: 600px) {
  .gw-lesson .vertex-reasoning, .gw-lesson .function-conversion { grid-template-columns: minmax(0, 1fr); }
  .gw-lesson .vertex-reasoning > .reasoning { border-top: 1px solid #e1e8e1; padding-top: 12px; }
  .gw-lesson .graph-cases { grid-template-columns: minmax(0, 1fr); }
  .gw-lesson .graph-case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .55fr); align-items: center; gap: 8px; }
  .gw-lesson .formula { font-size: 19px; }
  .gw-lesson .case-merge { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 959px) {
  .gw-workspace { max-width: 780px; padding: 23px 18px; }
  .gw-topbar { padding: 13px 18px; gap: 12px; }
  .gw-demo-label { font-size: 11px; }
  .gw-topbar > a:last-child { font-size: 11px; }
  .gw-layout { display: block; }
  .gw-lesson::after { content: ''; display: block; height: 45vh; }
  .gw-problem-dock { top: 40px; }
  .gw-path-toggle { display: flex; position: sticky; z-index: 10; top: 0; align-items: center; justify-content: space-between; gap: 15px; width: 100%; text-align: left; border: 1px solid #bfd7ca; padding: 12px 14px; margin-bottom: 17px; border-radius: 10px; background: #eef7f0; color: #2e6449; font: inherit; font-size: 12px; }
  .gw-path-toggle > span:last-child { flex-shrink: 0; font-size: 11px; }
  .gw-graph-panel { display: none; }
  .gw-graph-panel.is-open { display: block; position: fixed; inset: 0; z-index: 100; border: none; border-radius: 0; padding: max(20px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); overflow: auto; }
  #gw-close-graph { display: block; width: 36px; height: 36px; font-size: 25px; line-height: 1; background: #f1f5f0; border: 1px solid #d7e1d5; border-radius: 9px; color: #496b51; }
  .gw-svg { height: 51dvh; min-height: 300px; }
  .gw3-stage { height: max(320px, calc(100dvh - 290px)); }
  .gw3-hint { display: none; }
  .gw3-legend { max-width: calc(100% - 20px); gap: 2px 9px; padding: 3px 9px; font-size: 10px; }
  .gw3-stage .gw-caption { padding: 30px 14px 10px; }
  .gw3-stage .gw-caption-text { -webkit-line-clamp: 2; font-size: 15px; }
  .gw3-stage .gw-caption-kicker, .gw3-stage .gw-caption-next { font-size: 10px; }
  .gw-modal-open { overflow: hidden; }

  /* Doing it yourself: a small live graph pinned under the path bar; a tap opens the full graph. */
  .gw-page[data-actor="student"] { --gw-mini-h: max(150px, 24dvh); }
  .gw-page[data-actor="student"] .gw-path-toggle { margin-bottom: 0; border-radius: 10px 10px 0 0; }
  .gw-page[data-actor="student"] .gw-layout { display: flex; flex-direction: column; align-items: stretch; }
  .gw-page[data-actor="student"] .gw-graph-panel:not(.is-open) { display: block; order: -1; position: sticky; z-index: 9; top: 44px; margin: 0 0 14px; padding: 0; overflow: hidden; border-radius: 0 0 12px 12px; border-top: 0; cursor: zoom-in; }
  .gw-page[data-actor="student"] .gw-graph-panel:not(.is-open) > :not(#gw-graph),
  .gw-page[data-actor="student"] .gw-graph-panel:not(.is-open) :is(.gw-graph-controls, .gw-caption, .gw3-legend, .gw3-hint) { display: none; }
  .gw-page[data-actor="student"] .gw-graph-panel:not(.is-open) :is(#gw-graph, #gw-graph *) { pointer-events: none; }
  .gw-page[data-actor="student"] .gw-graph-panel:not(.is-open) :is(.gw3-stage, .gw-svg) { height: var(--gw-mini-h); min-height: 0; border: 0; border-radius: 0; }
  .gw-page[data-actor="student"] .gw-problem-dock { top: calc(52px + var(--gw-mini-h)); }
  .gw-page[data-actor="student"] :is(.gw-active, .gw-completed, .gw-completion, .gw-part-stepper) { scroll-margin-top: calc(70px + var(--gw-mini-h) + var(--gw-bar-h, 0px)); }

  /* Watching the AI: the graph fills the screen like a player; the step cards wait in a bottom sheet. */
  .gw-page[data-actor="replay"] { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
  .gw-page[data-actor="replay"] > .topbar { flex: 0 0 auto; }
  .gw-page[data-actor="replay"] .gw-workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); }
  .gw-page[data-actor="replay"] :is(.gw-intro, .gw-footer, .gw-path-toggle, #gw-close-graph) { display: none; }
  .gw-page[data-actor="replay"] #gw-ready:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .gw-page[data-actor="replay"] .gw-layout { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: stretch; }
  .gw-page[data-actor="replay"] .gw-graph-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 10px 10px 8px; border-radius: 16px; }
  .gw-page[data-actor="replay"] .gw-graph-heading { flex: 0 0 auto; align-items: center; }
  .gw-page[data-actor="replay"] .gw-graph-heading .eyebrow { display: none; }
  .gw-page[data-actor="replay"] .gw-graph-heading h2 { font-size: 15px; }
  .gw-page[data-actor="replay"] #gw-player-exit { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 6px 13px 6px 11px; border: 1px solid #087f79; border-radius: 999px; background: #fff; color: #087f79; font: inherit; font-size: 12px; font-weight: 650; box-shadow: 0 2px 8px rgba(8, 127, 121, .12); }
  .gw-page[data-actor="replay"] #gw-player-exit::before { content: '✎'; font-size: 13px; line-height: 1; }
  .gw-page[data-actor="replay"] #gw-player-exit:active { transform: scale(.96); }
  .gw-page[data-actor="replay"] .gw-player-problem { display: -webkit-box; flex: 0 0 auto; margin: 6px 0 0; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #24403a; font-size: 13px; line-height: 1.7; }
  .gw-page[data-actor="replay"] .gw-graph-panel[data-mode="3d"] .gw-player-problem { color: #dce9f2; }
  .gw-page[data-actor="replay"] .gw-graph-controls { flex: 0 0 auto; margin: 6px 0; }
  .gw-page[data-actor="replay"] #gw-graph { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .gw-page[data-actor="replay"] :is(.gw3-stage, .gw-svg) { flex: 1 1 0; height: auto; min-height: 0; }
  .gw-page[data-actor="replay"] :is(.gw-timeline, .gw-panel-dock, .gw-legend, .gw-graph-panel > .gw-caption) { flex: 0 0 auto; }
  .gw-page[data-actor="replay"] .gw-legend { display: none; }
  .gw-page[data-actor="replay"] .gw-timeline { margin-top: 8px; }
  .gw-page[data-actor="replay"] .gw-panel-dock { flex-wrap: nowrap; gap: 4px; margin-top: 8px; }
  .gw-page[data-actor="replay"] .gw-panel-dock summary { gap: 4px; padding: 4px 7px; font-size: 11px; white-space: nowrap; }
  .gw-page[data-actor="replay"] .gw-graph-panel[data-mode="3d"] #gw-player-exit { border-color: rgba(45, 212, 191, .6); background: rgba(45, 212, 191, .1); color: #5eead4; box-shadow: 0 0 0 3px rgba(45, 212, 191, .07); }
  .gw-page[data-actor="replay"] #gw-open-steps { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; margin-right: auto; padding: 5px 11px; white-space: nowrap; border: 1px solid #087f79; border-radius: 999px; background: #087f79; color: #fff; font-size: 12px; font-weight: 600; }
  .gw-page[data-actor="replay"] #gw-open-steps::after { content: '▴'; font-size: 9px; }
  .gw-page[data-actor="replay"] .gw-graph-panel[data-mode="3d"] #gw-open-steps { border-color: #2dd4bf; background: rgba(45, 212, 191, .16); color: #e6fffa; }
  .gw-page[data-actor="replay"] .gw-lesson { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain; padding: 0 14px max(18px, env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: #f5f7f5; box-shadow: 0 -18px 44px rgba(16, 40, 32, .24); visibility: hidden; transform: translateY(calc(100% + 30px)); transition: transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s .28s; }
  .gw-page[data-actor="replay"].gw-sheet-open .gw-lesson { visibility: visible; transform: none; transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
  .gw-page[data-actor="replay"] .gw-lesson::after { display: none; }
  .gw-page[data-actor="replay"] .gw-lesson :is(.problem-card, .gw-actor-panel, .gw-problem-dock) { display: none; }
  .gw-page[data-actor="replay"] .gw-sheet-head { display: flex; position: sticky; z-index: 3; top: 0; align-items: center; justify-content: space-between; margin: 0 -14px 4px; padding: 16px 14px 10px; background: #f5f7f5; }
  .gw-page[data-actor="replay"] .gw-sheet-head::before { content: ''; position: absolute; top: 6px; left: calc(50% - 18px); width: 36px; height: 4px; border-radius: 2px; background: #c9d6d0; }
  .gw-page[data-actor="replay"] .gw-sheet-head strong { color: #24403a; font-size: 15px; }
  .gw-page[data-actor="replay"] .gw-sheet-head button { padding: 6px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
  .gw-topbar { padding: 12px 14px; }
  .gw-topbar .brand { font-size: 17px; gap: 7px; }
  .gw-demo-label { max-width: 115px; }
  .gw-workspace { padding: 23px 13px; }
  .gw-lesson .problem-card { padding: 19px; }
  #gw-problem { font-size: 16px; }
  .gw-active { padding: 19px 16px; }
  .gw-active h2 { font-size: 18px; }
  .gw-active .question { font-size: 15px; }
  .gw-multi button { padding: 12px; font-size: 13px; }
  .gw-plane-field { gap: 40px 22px; padding: 10px 6px; }
  .gw-plane-bottom { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; }
  .gw-plane-bottom > span:first-child { display: none; }
  .gw-page .gw-plane-cell { min-height: 72px; padding: 10px 4px; }
  .gw-plane-tag { padding: 1px 7px; font-size: 11px; }
  .gw-completed > summary.step-heading { padding: 12px; gap: 9px; }
  .gw-step-title { font-size: 14px; }
  .gw-completed-body { padding: 0 12px 14px; }
  .gw-history-controls { gap: 9px; }
  #gw-progress { font-size: 11px; }
  .gw-path-toggle { padding: 11px; gap: 8px; font-size: 11px; }
  .gw-lesson .katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
  .gw-lesson .details { font-size: 13px; overflow-wrap: anywhere; }
  .gw-submit-row .primary { font-size: 13px; }
  .gw-toolbar button { padding: 9px 10px; font-size: 12px; }
  .gw-graph-heading h2 { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .gw-page *, .gw-page *::before, .gw-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
