.guide{max-width:1080px;padding:12px 32px 32px}
.guide header{grid-template-columns:1fr auto;margin:0;padding-bottom:8px}
.guide header a{display:inline-flex;align-items:center;min-height:44px;color:inherit;font-size:14px}
.guide header .brand{font-size:24px;font-weight:750;letter-spacing:-1px;text-decoration:none}
.guide a{color:inherit;text-underline-offset:3px}
.guide h1{font-size:clamp(32px,5vw,44px);letter-spacing:-1.4px;line-height:1.1;margin:0 0 14px}
.guide h2{font-size:24px;letter-spacing:-.6px;line-height:1.25;margin:8px 0}
.guide h3{font-size:20px;letter-spacing:-.4px;line-height:1.3;margin:8px 0}
.guide p,.guide li{font-size:15px;line-height:1.6;margin:10px 0}
.guide li{margin-bottom:8px}
.guide-intro{padding:32px 0 24px;border-bottom:1px solid #dce2e4;margin-bottom:24px}
.guide .lead{font-size:18px;line-height:1.5;max-width:50ch;margin:0}
.guide nav{display:flex;flex-wrap:wrap;gap:0 24px;margin-top:8px}
.guide nav a{display:inline-flex;align-items:center;min-height:44px;font-size:14px}
.guide .eyebrow{font-size:11px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:#60777b;margin:0}
.lesson-heading{margin-bottom:16px}
.guide .trial-note{color:#60777b;font-size:13px;margin:6px 0 0}
.guide .player-note{font-size:12px;color:#60777b;margin:0}
.guide #move-context #move-chapter{font-size:11px;margin:6px 0 2px}
.guide details{justify-self:stretch;width:100%}
.guide summary{display:list-item;list-style:disclosure-closed inside;min-height:44px;padding:11px 0;font-size:13px;line-height:22px;text-align:left}
.guide details[open]>summary{list-style-type:disclosure-open}
.example-about{max-width:70ch}
.example-about p{overflow-wrap:anywhere}
.walkthrough{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:36px;align-items:start}
.visual{position:sticky;top:16px;height:calc(100svh - 32px);display:grid;grid-template-rows:minmax(0,1fr) auto auto;gap:8px;min-width:0}
.visual figure{margin:0;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;justify-items:center}
.guide-board-frame{container-type:size;display:grid;place-items:start center;width:100%;height:100%;min-height:0}
.visual #guide-board{width:min(100cqw,100cqh);height:auto;aspect-ratio:1}
.guide svg{display:block;width:100%;height:auto;background:#e8ecee;border-radius:10px}
.guide svg rect{fill:#fff;stroke:#d3dcdf;stroke-width:1}
.guide svg .given rect{fill:#f6f8f8}
.guide svg text{font:500 28px system-ui;text-anchor:middle;dominant-baseline:middle;fill:#172e36}
.guide svg .given [data-number]{font-weight:750}
.guide svg .given-lock{color:#718287;pointer-events:none}
.guide svg .tile-mark{font-size:16px;text-anchor:start;font-weight:700;fill:#b56942}
.guide svg .unused,.guide svg .automatic{opacity:.65}
.guide svg .unused rect,.guide svg .automatic rect{fill:#ffffff4a}
.guide svg .unused text,.guide svg .automatic text{fill:#819296}
.guide svg .gap rect{fill:#fafbf9;stroke:#82969b}
.guide svg .gap text{font-size:16px;font-weight:700}
.guide svg .box{fill:none;stroke:#9caaae;stroke-width:1.5}
.guide svg .coordinate{font-size:12px;fill:#647679}
.guide svg .current rect{stroke:#b56942;stroke-width:3;fill:#fff0d4}
.guide figcaption{font-size:13px;line-height:1.6;color:#60777b}
.visual figcaption{width:100%;margin:0}
.guide .visual figcaption p{font-size:12px;margin:0}
#board-key>summary,#move-reason>summary{display:none}
#move-controls:not([hidden]){display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 12px;align-items:center}
#move-controls label{font-size:12px;font-weight:700;white-space:nowrap}
#move-range{width:100%;min-width:0;min-height:44px;margin:0;accent-color:#b56942}
.move-buttons{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.move-buttons button{min-width:0;font-size:13px;padding-inline:6px}
.move-buttons #next{background:#172e36;border-color:#172e36;color:#fff}
.move-buttons #restart-guide{background:transparent}
.move-buttons button:disabled{opacity:.4}
#move-context{min-height:0;max-height:24svh;overflow:auto;overscroll-behavior:contain}
.guide #move-context p{margin:4px 0}
.guide #move-text{font-weight:650}
.guide .equation{font-size:23px;font-weight:700;letter-spacing:-.3px;line-height:1.3}
.guide #move-why{font-size:13px}
#return-to-lesson:not([hidden]){display:inline-flex;align-items:center;min-height:44px;font-size:13px}
.lesson{position:relative;border-top:1px solid #dce2e4;padding:20px 0;scroll-margin-top:16px}
.lesson:first-child{border-top:0;padding-top:0}
.lesson-text :is(h3,p,summary,button){scroll-margin-top:16px}
.lesson .eyebrow{font-size:10px}
.lesson .equation{margin:10px 0}
.lesson>p:not(.eyebrow):not(.equation){color:#435c62}
.on-board:not([hidden]){display:inline-block;font-size:11px;color:#1b6d66;font-weight:700;margin-top:6px}
.lesson[data-active] .equation{color:#1b6d66}
.move-details{margin-top:8px}
.move-details ol{padding-left:26px}
.show-move{font-size:13px;font-weight:650;background:transparent;padding-inline:12px}
.final-board{margin-top:12px}
#chains-and-tiles{border-top:1px solid #dce2e4;padding-top:24px;margin-top:24px;scroll-margin-top:16px}
.reference-group{margin-top:24px}
.guide .reference-group>h3{font-size:12px;color:#60777b;font-weight:700;margin:0 0 8px}
.concept-card{border-top:1px solid #dce2e4;scroll-margin-top:16px}
.guide .concept-card>summary{display:block;text-align:left;justify-items:start;padding:16px 24px 16px 0;position:relative;list-style:none}
.concept-card>summary:after{content:'+';position:absolute;right:2px;top:16px;font-size:22px;font-weight:400}
.concept-card[open]>summary:after{content:'−'}
.concept-card>summary::-webkit-details-marker{display:none}
.concept-card>summary span{display:block;font-size:16px;font-weight:650}
.concept-card>summary small{display:block;font-size:13px;color:#60777b;font-weight:400;line-height:1.5;margin-top:4px}
.concept-body{max-width:520px;margin:0 auto 20px}
.concept-card figure{margin:0;display:grid;gap:12px}
.concept-controls:not([hidden]){grid-row:1;display:flex;flex-wrap:wrap;gap:6px}
.concept-controls button{font-size:13px;flex:1 1 130px;min-height:44px}
.concept-controls [aria-pressed="true"]{background:#172e36;color:#fff;border-color:#172e36}
.concept-card figure>svg{grid-row:2}
.concept-card figcaption{margin:0}
.guide .concept-card svg text{font-size:32px}
.guide .concept-card svg .coordinate,.guide .concept-card svg .gap text{font-size:20px}
.guide .concept-card svg .tile-mark{font-size:16px}
#concept-chain-board [data-key="number:0:5"] rect{stroke:#1b6d66;stroke-width:5;fill:#e0efeb}
.guide svg g.concept-focus{opacity:1}
.guide svg g.concept-focus rect{stroke:#b56942;stroke-width:3}
.guide svg g.concept-error rect{stroke:#985d66;stroke-width:3;fill:#faf0f2}
.guide svg g.concept-error text{fill:#985d66}
.guide svg g.concept-suggestion rect{stroke:#a65b19;stroke-width:3;stroke-dasharray:4 3;fill:#fff0d4}
.next-lesson{border-top:1px solid #dce2e4;margin-top:24px;padding-top:24px}
.next-lesson>a{display:inline-flex;align-items:center;min-height:44px;font-size:15px;font-weight:650}
.guide :is(a,input,button,summary,#move-context):focus-visible{outline:2px solid #b56942;outline-offset:3px}
.guide svg .animate-move text{transform-box:fill-box;transform-origin:center;animation:guide-entry 220ms cubic-bezier(.23,1,.32,1)}
@keyframes guide-entry{from{opacity:.25;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.guide svg .animate-move text{animation:none}}
@media(max-width:799px),(max-height:699px){
  .guide{max-width:720px;padding:8px 20px 24px}
  .guide-intro{padding:24px 0 16px;margin-bottom:20px}
  .guide h2{font-size:21px}
  .guide h3{font-size:19px}
  .guide .lead{font-size:17px}
  .walkthrough{display:block}
  .visual{position:static;display:block;height:auto;padding:8px;border:1px solid #d3dcdf;border-radius:12px;margin-bottom:24px;scroll-margin-top:12px}
  .visual figure{display:block;max-width:568px;margin-inline:auto}
  .guide-board-frame{container-type:normal;display:block;height:auto}
  .visual #guide-board{width:100%;height:auto}
  .visual #guide-board text{font-size:32px}
  .visual #guide-board .gap text,.visual #guide-board .coordinate{font-size:20px}
  #move-context:not([hidden]){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:0 8px;max-height:none;overflow:visible;margin-top:4px}
  .guide #move-context p{grid-column:1/-1}
  #move-reason[open]{grid-column:1/-1}
  #return-to-lesson:not([hidden]){grid-column:2;justify-self:end}
  .guide :is(#move-reason,#board-key)>summary{display:list-item;font-size:13px}
  .lesson{padding-block:18px}
}
@media(min-width:600px) and (max-height:699px){
  .guide{max-width:1080px}
  .visual{display:grid;grid-template-columns:minmax(0,280px) minmax(0,1fr);grid-template-rows:auto 1fr;gap:0 20px;align-items:start}
  .visual figure{grid-column:1;grid-row:1/3;width:100%;margin:0}
  #move-controls{grid-column:2;grid-row:1}
  #move-context{grid-column:2;grid-row:2}
}
