@charset "UTF-8";
:root{color-scheme:light;--paper:#f6f4ec;--ink:#203d35;--muted:#66746c;--line:#d8ded1;--green:#244f40;--light:#e9eadb;--dark:#789384;--gold:#d3aa56;--white:#fffef8;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-synthesis:none;color:var(--ink);background:var(--paper)}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,summary{-webkit-tap-highlight-color:transparent}button{cursor:pointer;min-height:44px;border:1px solid var(--line);border-radius:9px;background:transparent;color:var(--ink);font-size:13px;font-weight:650;padding:10px 15px;transition:background .15s,border-color .15s}button:hover:not(:disabled){background:#e8ecdf;border-color:#a3b39f}button:disabled{opacity:.38;cursor:default}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible{outline:3px solid #bd7626;outline-offset:3px}button.primary{background:var(--green);color:var(--white);border-color:var(--green)}button.primary:hover{background:#173e30}a{color:inherit}p,h1,h2,h3{margin:0}button[hidden],[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.masthead{max-width:1300px;margin:0 auto;padding:24px 42px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.wordmark{display:flex;align-items:center;gap:11px;text-decoration:none}.wordmark h1{font-family:Georgia,"Times New Roman",serif;font-size:22px;font-weight:500;letter-spacing:-.7px}.book-mark{font-size:31px;line-height:1}.masthead nav{position:relative;font-size:13px}.masthead nav summary{cursor:pointer;padding:10px 14px;border:1px solid var(--line);border-radius:9px;min-height:44px}.masthead nav details>div,.masthead nav details>ul{position:absolute;right:0;top:49px;z-index:30;background:var(--white);padding:10px;min-width:180px;border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 40px #183c3020}.masthead nav a{display:block;text-decoration:none;padding:10px 14px;border-radius:6px}.masthead nav a:hover,.masthead nav a[aria-current]{background:#e7ecdf}
main{max-width:1150px;margin:0 auto;padding:39px 42px 20px}.study-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:26px}.eyebrow{font-size:10px;font-weight:750;letter-spacing:1.7px;color:var(--muted);line-height:1.5}.study-heading h2{font:400 39px/1.2 Georgia,"Times New Roman",serif;letter-spacing:-1.1px;margin-top:7px}.line-name{margin-top:7px;font-size:13px;color:var(--muted)}.catalog-open{display:flex;align-items:center;gap:22px;background:#fffef86b;align-self:center}.catalog-open span{font-size:21px;font-weight:400}.study-layout{display:grid;grid-template-columns:minmax(340px,570px) minmax(265px,1fr);gap:40px;align-items:start}.board-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;min-height:22px}.turn{font-size:13px;font-weight:700;display:flex;align-items:center;gap:8px}.turn:before{content:"";width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:var(--green)}.progress{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums;text-align:right}/* A one-finger board gesture is not page navigation. The board keeps native
   pinch zoom; prose and history retain their own deliberate scrolling. */
.board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;width:100%;border:7px solid var(--green);border-radius:6px;box-shadow:0 13px 30px #213d3511;overflow:hidden;touch-action:pinch-zoom;position:relative}.square{border:0!important;border-radius:0;min-height:0;min-width:0;padding:0;aspect-ratio:1;position:relative;display:flex;align-items:center;justify-content:center;background:var(--light)!important;transition:box-shadow .1s}.square.dark{background:var(--dark)!important}.square:hover:not(:disabled){box-shadow:inset 0 0 0 3px #244f404d}.square:disabled{opacity:1}.square .piece{width:83%;height:83%;position:relative;z-index:2;pointer-events:none;filter:drop-shadow(0 1px 1px #173e3033)}.square.selected{box-shadow:inset 0 0 0 4px #e4b857!important;background:#ddcc7e!important}.square.expected{box-shadow:inset 0 0 0 3px #d2ac47}.square.destination:after{content:"";position:absolute;width:22%;height:22%;border-radius:50%;background:#244f4050;z-index:1}.square.destination.occupied:after{width:88%;height:88%;background:transparent;border:5px solid #244f4070}.square:focus-visible{outline:0;box-shadow:inset 0 0 0 4px #d99a33!important;z-index:3}.coordinate{position:absolute;z-index:4;font-size:10px;font-weight:750;line-height:1;color:#3d5b4b;pointer-events:none}.dark .coordinate{color:#f5f2df}.coordinate.rank{top:3px;left:4px}.coordinate.file{bottom:2px;right:4px}.board-bottom{display:flex;justify-content:space-between;gap:12px;margin:13px 0 17px;min-height:28px;font-size:11px;color:var(--muted);line-height:1.5}.board-bottom #board-message{font-size:12px;max-width:72%;color:#465f50}.orientation{text-align:right;white-space:nowrap;font-size:10px}.board-actions{display:flex;gap:8px;flex-wrap:wrap}.board-actions button{padding:10px 13px}.board-actions #hint{margin-left:auto}.error{padding:11px 13px;border:1px solid #d8b695;border-radius:8px;font-size:12px;line-height:1.55;color:#804626;background:#fbf0e5;margin:0 0 12px}.lesson{padding-top:1px}.preferences{display:grid;gap:20px;padding-bottom:23px;border-bottom:1px solid var(--line)}fieldset{padding:0;margin:0;border:0;min-width:0}legend{font-size:11px;font-weight:700;margin-bottom:8px;color:#52685b}.segmented{display:flex;border:1px solid var(--line);border-radius:9px;padding:3px;background:#eceee2;gap:2px}.segmented button{flex:1;border:0;border-radius:6px;padding:8px 7px;min-height:37px;font-size:12px;font-weight:550}.segmented button[aria-pressed=true]{background:var(--white);box-shadow:0 1px 4px #2844331a;font-weight:750}.side-switch span{font-size:17px;margin-right:4px}.mode-help{font-size:11px;color:var(--muted);margin-top:8px;line-height:1.5;min-height:17px}.guidance{padding:25px 0 22px}.answer{font:400 40px/1.1 Georgia,serif;letter-spacing:-.8px;margin:9px 0 12px}.answer:empty{display:none}.plan{font-size:13px;line-height:1.7;color:#526357}.branches-section{margin:0 0 24px}.branches-section h3{font-size:12px;font-weight:750;margin-bottom:10px}.branches{display:grid;gap:8px}.branch{padding:12px 13px;text-align:left;width:100%;display:grid;grid-template-columns:auto 1fr;column-gap:12px;row-gap:5px;background:#fffef859}.branch .san{font:22px Georgia,serif;grid-row:1/4;padding-top:1px;min-width:36px}.branch .branch-name{font-size:11px;font-weight:750;line-height:1.4}.branch .branch-note,.branch .tradeoff{font-size:11px;line-height:1.5;font-weight:400;color:#5a6a5f}.branch .tradeoff{color:#786d51}.branch.selected-line{border-color:#a4b7a5}.complete{padding:22px;border:1px solid #b8c9ad;border-radius:11px;background:#eaf0e2;margin-top:20px}.complete-icon{display:inline-flex;align-items:center;justify-content:center;width:31px;height:31px;border-radius:50%;background:#d8e6ce;color:#2b583d;margin-bottom:10px}.complete h3{font:25px Georgia,serif;margin-bottom:9px}.complete p{font-size:12px;line-height:1.65;color:#51624f;margin:8px 0}.complete .primary{margin-top:9px;width:100%}.moves-panel,.help{border-top:1px solid var(--line);padding:14px 0;font-size:12px}.moves-panel summary,.help summary{cursor:pointer;min-height:24px;padding:3px 0;line-height:1.5}.moves-panel summary span{float:right;color:var(--muted);font-variant-numeric:tabular-nums}.history{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:8px 0 0;list-style:none;gap:8px 12px;font-size:12px;line-height:1.5;font-variant-numeric:tabular-nums}.history li{display:flex;gap:6px;white-space:nowrap}.history .number{color:#788073}.history .played-move{font-weight:650}.help p{color:#637165;line-height:1.65;font-size:11px;margin:10px 0}.sources{margin-top:10px}.sources a{display:block;font-size:11px;line-height:1.6;margin:7px 0}.study-footer{border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:20px;color:#788072;font-size:10px;letter-spacing:.3px;margin-top:30px;padding:17px 0}.catalog-dialog{padding:28px;width:min(640px,calc(100% - 32px));max-height:85dvh;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:15px;box-shadow:0 25px 100px #173d303d;overscroll-behavior:contain}.catalog-dialog::backdrop{background:#17352ca3;backdrop-filter:blur(3px)}.catalog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.catalog-heading h2{font:30px Georgia,serif;margin-top:5px}.catalog-heading button{font-size:25px;padding:0;width:44px;height:44px}.search-label{font-size:11px;font-weight:700;display:block;margin-bottom:7px}input[type=search]{width:100%;border:1px solid #bcc9b7;border-radius:8px;background:var(--white);color:var(--ink);padding:13px 14px;font-size:14px;min-height:46px}.catalog-results{font-size:11px;color:var(--muted);padding:13px 0}.catalog-list{display:grid;gap:18px}.catalog-family h3{font:22px Georgia,serif}.family-heading{display:flex;align-items:baseline;justify-content:space-between;gap:15px;padding-bottom:8px}.eco{font-size:10px;font-weight:600;color:var(--muted)}.catalog-line{width:100%;display:flex;align-items:center;justify-content:space-between;gap:16px;text-align:left;border-radius:6px;background:#fffef866;margin-bottom:5px;font-size:12px;font-weight:550}.catalog-line[aria-current=true]{border-color:#6a8c72;background:#e6eddc}.catalog-line small{font-size:10px;white-space:nowrap;color:var(--muted)}.catalog-footnote{font-size:11px;line-height:1.5;color:var(--muted);margin-top:20px;padding-top:15px;border-top:1px solid var(--line)}.empty-results{padding:25px 5px;font:20px Georgia,serif;color:#526357}.noscript{padding:24px;text-align:center}
@media(min-width:1400px){main{padding-top:47px}.study-layout{gap:52px}.study-heading{margin-bottom:30px}}
@media(max-width:900px){.masthead{padding:20px 28px}main{padding:30px 28px 15px}.study-layout{gap:26px;grid-template-columns:minmax(310px,1.45fr) minmax(235px,1fr)}.study-heading h2{font-size:34px}.board{border-width:5px}.board-actions{gap:6px}.board-actions button{font-size:11px;padding:9px 10px}.orientation{display:none}.board-bottom #board-message{max-width:100%}.history{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){.masthead{padding:17px 20px}.wordmark h1{font-size:20px}.book-mark{font-size:28px}main{padding:23px 20px 12px}.study-heading{align-items:flex-start;margin-bottom:22px;gap:10px}.study-heading h2{font-size:31px}.eyebrow{font-size:9px;letter-spacing:1.3px}.line-name{font-size:11px;max-width:220px}.catalog-open{font-size:11px;gap:7px;padding:8px 10px;align-self:center}.catalog-open span{font-size:17px}.study-layout{display:flex;flex-direction:column;gap:25px}.play-area,.lesson{width:100%}.board-top{margin-bottom:10px}.turn{font-size:12px}.progress{font-size:10px}.board{border-width:5px;max-width:540px;margin:auto}.square .piece{width:84%;height:84%}.coordinate{font-size:9px}.board-bottom{margin:11px 0 14px;min-height:0}.board-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.board-actions button{font-size:10px;padding:8px 5px;min-height:44px}.board-actions #hint{margin:0}.preferences{grid-template-columns:1fr 1.35fr;gap:16px;padding-bottom:18px}.segmented button{font-size:11px;padding:7px 4px}.mode-help{font-size:10px;min-height:30px}.guidance{padding:19px 0}.answer{font-size:33px;margin:8px 0}.plan{font-size:12px}.branches{grid-template-columns:repeat(2,minmax(0,1fr))}.branch{display:block;padding:12px}.branch span{display:block}.branch .san{margin-bottom:8px}.branch .branch-name{margin-bottom:5px}.branch .tradeoff{margin-top:5px}.history{grid-template-columns:repeat(4,minmax(0,1fr))}.study-footer{margin-top:17px;font-size:9px}.catalog-dialog{padding:22px;max-height:88dvh}.catalog-heading h2{font-size:27px}}
@media(max-width:370px){main{padding-left:13px;padding-right:13px}.masthead{padding-left:15px;padding-right:15px}.study-heading h2{font-size:28px}.catalog-open{font-size:10px;gap:3px}.preferences{gap:10px}.history{grid-template-columns:repeat(3,minmax(0,1fr))}.branches{grid-template-columns:1fr}.progress{font-size:9px}}
@media(max-height:560px) and (min-width:681px){.masthead{padding-top:10px;padding-bottom:10px}main{padding-top:18px}.study-heading{margin-bottom:15px}.study-heading h2{font-size:28px}.study-layout{grid-template-columns:minmax(290px,430px) minmax(260px,1fr)}.board{max-width:390px}.study-heading .eyebrow{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}

/* Keep the complete board and its actions in a normal laptop viewport. */
.book-mark{width:28px;height:30px;flex:none}.arrow-icon{width:18px;height:18px;flex:none;vertical-align:middle}.primary .arrow-icon{margin-left:8px}
@media(max-height:850px) and (min-width:681px){.masthead{padding:12px 28px}.masthead .wordmark h1{font-size:20px}main{padding-top:22px}.study-heading{margin-bottom:18px}.study-heading h2{font-size:30px;margin-top:4px}.study-heading .line-name{margin-top:4px}.study-layout{grid-template-columns:minmax(300px,min(52vw,calc(100dvh - 300px))) minmax(265px,1fr);gap:34px}.board-top{margin-bottom:8px}.board-bottom{margin-top:9px;margin-bottom:11px;min-height:18px}.board-bottom #board-message{font-size:11px}.orientation{display:none}.board-bottom #board-message{max-width:100%}.board-actions button{font-size:11px;padding:8px 10px}.preferences{gap:14px;padding-bottom:17px}.guidance{padding:18px 0}.answer{font-size:34px}.study-footer{margin-top:22px}}

/* Last book reply is historical feedback; gold remains the next-move cue. */
.square.book-from{box-shadow:inset 0 0 0 2px #284461}.square.book-to{box-shadow:inset 0 0 0 2px #284461}.square.book-from:before,.square.book-to:before{content:"";position:absolute;inset:5px;border:1px solid #284461;pointer-events:none}.square.expected{box-shadow:inset 0 0 0 3px #d2ac47}.square.selected{box-shadow:inset 0 0 0 4px #e4b857!important}.board>.moving-piece{position:absolute;z-index:10;pointer-events:none;overflow:visible;padding:1%;filter:drop-shadow(0 2px 2px #173e3033)}.board-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;white-space:nowrap}.board-meta #last-reply{color:#3d6186}.sound-toggle{font-size:10px;font-weight:500;border:0;padding:0 5px;min-height:44px;white-space:nowrap}.board-bottom{align-items:center}.board-bottom #board-message{flex:1;max-width:none}.board-meta .orientation{display:none}@media(max-width:370px){.board-meta{gap:2px}.sound-toggle{padding:0 3px}}
/* Screen-owned presentation. Geometry is measured; content is paged, never clipped. */
html,body{width:100%;min-height:0;height:100%;margin:0}body{font-size:14px}.screen{position:absolute;left:var(--viewport-left,0px);top:var(--viewport-top,0px);width:var(--viewport-width,100%);height:var(--viewport-height,100dvh);padding:12px 18px;display:flex;flex-direction:column;gap:10px}.masthead{width:100%;max-width:1200px;padding:0 0 8px;flex:none}.wordmark h1{font-size:21px}.study{width:100%;max-width:1120px;min-height:0;margin:0 auto;padding:0;display:flex;flex-direction:column;gap:9px}.study-heading{margin:0;gap:12px;align-items:center}.study-heading h2{font-size:25px;line-height:1.1;margin:0;letter-spacing:-.6px}.line-name{margin:3px 0 0;font-size:12px;line-height:1.35}.study-heading>div{min-width:0}.study-heading button{flex:none;padding:8px 10px}.context-bar{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--muted)}.context-bar #progress{margin-left:auto}.context-bar button{min-height:40px;padding:6px 13px}.board-top{margin:0;min-height:20px;font-size:13px;line-height:1.4}.board-top #last-reply{font-size:12px}.study-layout{display:grid;gap:16px;align-items:start;justify-content:center;grid-template-columns:var(--board-size,320px) minmax(0,1fr);width:100%;min-height:0}.board{width:var(--board-size,320px);height:var(--board-size,320px);aspect-ratio:1;border-width:4px;max-width:none;box-shadow:0 8px 25px #213d3511}.play-area{min-width:0;justify-self:center}.lesson{padding:5px 0 0;min-width:0;max-width:440px;width:100%;justify-self:center}.answer{font-size:27px;margin:3px 0 7px;line-height:1.15}.plan{font-size:14px;line-height:1.45;margin:0}.complete{padding:0}.complete h3{font-size:20px}.complete p{margin:8px 0;font-size:14px}.board-bottom{margin:0;min-height:0;display:block;font-size:12px;line-height:1.4}.board-bottom #board-message{max-width:none;font-size:12px}.board-actions,.reading-actions{display:flex;gap:7px;flex-wrap:wrap;margin:0}.board-actions button,.reading-actions button{padding:8px 11px;min-height:42px;font-size:12px}.board-actions #hint{margin-left:0}.reading-actions button{font-size:12px;background:#eceee2}.error{margin:0;padding:7px 10px;font-size:12px;line-height:1.35}.screen[data-arrangement="stacked"] .study-layout{grid-template-columns:minmax(0,1fr);gap:12px}.screen[data-arrangement="stacked"] .lesson{max-width:none;padding:0}.screen[data-arrangement="focused"] .study-layout{grid-template-columns:minmax(0,1fr)}.screen[data-arrangement="focused"] .lesson{display:none}.screen[data-arrangement="focused"] #board-message{display:none}#minimum-recovery{font-size:15px;line-height:1.5;max-width:40em;margin:auto}.screen[data-minimum="true"] .study{display:none}
.screen-dialog,.catalog-dialog{position:fixed;inset:auto;left:var(--dialog-left,12px);top:var(--dialog-top,12px);width:var(--dialog-width,calc(100% - 24px));max-width:none;height:var(--dialog-height,calc(100dvh - 24px));max-height:none;margin:0;padding:18px;border:1px solid var(--line);border-radius:15px;background:var(--paper);color:var(--ink);box-shadow:0 20px 80px #102b2033;overflow:visible}.screen-dialog[open],.catalog-dialog[open]{display:flex;flex-direction:column;gap:12px}.screen-dialog::backdrop,.catalog-dialog::backdrop{background:#142c2560}.page-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;flex:none}.page-heading h2{flex:1 1 11ch;min-width:0;overflow-wrap:anywhere;font:400 25px/1.15 Georgia,serif;letter-spacing:-.5px}.page-heading button{flex:none;max-width:100%;white-space:normal}.page-body,.catalog-list{flex:1;min-height:0;overflow:visible;display:block;max-height:none;padding:0}.page-body>section,.page-body>ol{margin:0}.page-body section>p,.page-body section>a{font-size:15px;line-height:1.5;margin:0;display:block}.page-body section>button{display:block;width:100%;text-align:left}.page-body fieldset{margin:0}.page-body legend{font-size:13px;margin-bottom:6px}.page-body .segmented{flex-wrap:wrap}.page-body .segmented button{min-height:44px;font-size:13px}.page-body #mode-help{margin:8px 0;font-size:13px}.page-body #sound{width:auto}.page-navigation{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;font-size:12px}.page-navigation button{min-width:80px}.catalog-list{display:flex;flex-direction:column;gap:8px}.catalog-line{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;min-height:52px;text-align:left;border:1px solid var(--line);flex:none}.catalog-line span{font-size:13px;line-height:1.4}.catalog-line small{font-size:11px;white-space:normal;color:var(--muted);flex:0 0 76px}.catalog-line strong{display:block;font-size:11px;font-weight:550;color:var(--muted)}.catalog-dialog input{width:100%;min-height:44px;margin:0;border:1px solid var(--line);border-radius:8px;padding:8px 12px}.search-label{font-size:12px;margin:0}.catalog-footnote{margin:0;font-size:11px;line-height:1.4}.catalog-dialog #catalog-results{font-size:12px;line-height:1.4;margin:0}.branch{display:block;width:100%;margin:0;padding:12px;text-align:left}.branch .san{font-size:20px}.branch .branch-name,.branch .branch-note,.branch .tradeoff{display:block;margin:4px 0 0;font-size:13px;line-height:1.45}.history{display:block;padding:0;list-style:none}.history li{display:flex;gap:20px;padding:10px;border-bottom:1px solid var(--line);line-height:1.5}.empty-results{font-size:14px;line-height:1.5}.page-body [data-page-item]{margin-bottom:10px}.page-body a{overflow-wrap:anywhere}
@media(max-width:600px){.screen{padding:8px 10px;gap:7px}.masthead{padding-bottom:5px}.wordmark h1{font-size:19px}.study{gap:7px}.study-heading h2{font-size:23px}.study-heading button{font-size:12px;max-width:105px}.board{border-width:3px}.page-heading h2{font-size:23px}.screen-dialog,.catalog-dialog{padding:12px;gap:9px!important}.answer{font-size:25px;margin:2px 0 5px}.plan{font-size:13px;line-height:1.4}.board-actions button,.reading-actions button{padding:7px 9px;min-height:40px}.coordinate{font-size:9px}}
.board-bottom{display:none}.reading-actions:empty{display:none}.study-heading .line-name{max-width:42em}#reading-actions button{padding-left:8px;padding-right:8px}#branches-open{font-size:12px}.catalog-row-measure{font-size:13px;line-height:1.4}#menu-page>button{margin-bottom:10px}
.catalog-dialog .search-label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;clip-path:inset(50%);white-space:nowrap}.page-body #branches>p{font-size:14px;line-height:1.5;margin:0}.screen-dialog #branches-section{margin:0}.screen-dialog #branches-title{font-size:16px;line-height:1.3;margin-bottom:10px}.screen-dialog #branches{display:block}
.reading-copy{font-size:15px;line-height:1.5}.catalog-family-measure{font-size:11px;line-height:1.4}.masthead nav details>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:min(320px,calc(var(--viewport-width,100vw) - 24px));min-width:0}.masthead nav a{min-height:44px;padding:10px;display:flex;align-items:center}.masthead nav .journal-detail{grid-column:1/-1;font-size:11px;line-height:1.4}#settings-page button[aria-pressed="true"]{background:#dce5d8;border-color:#9eaf99}
/* Wide presentation spends vertical space on the board, not stacked controls. */
.screen[data-arrangement="wide"] .study{display:grid;grid-template-columns:var(--board-size) minmax(0,1fr);grid-template-rows:auto auto auto auto auto auto;column-gap:var(--wide-column-gap);row-gap:var(--wide-row-gap);align-items:start}.screen[data-arrangement="wide"] .study-heading{grid-column:2;grid-row:1}.screen[data-arrangement="wide"] .context-bar{grid-column:2;grid-row:2}.screen[data-arrangement="wide"] .board-top{grid-column:1;grid-row:1;align-self:end}.screen[data-arrangement="wide"] .study-layout{display:contents}.screen[data-arrangement="wide"] .play-area{grid-column:1;grid-row:2/7}.screen[data-arrangement="wide"] .lesson{grid-column:2;grid-row:3;padding:0;max-width:none}.screen[data-arrangement="wide"] .board-actions{grid-column:2;grid-row:4}.screen[data-arrangement="wide"] .reading-actions{grid-column:2;grid-row:5}.screen[data-arrangement="wide"] .error{grid-column:2;grid-row:6}.screen[data-arrangement="wide"] .study-heading h2{font-size:24px}.screen[data-arrangement="wide"] .study-heading button{padding:7px 9px;font-size:12px}.screen[data-arrangement="wide"] .board-actions button{padding:7px 9px}.screen[data-arrangement="wide"] .reading-actions button{min-height:40px}.screen[data-arrangement="wide"] .context-bar button{min-height:36px}
.compact-instruction{display:none;font-size:12px;line-height:1.4}.screen[data-compact="true"] #plan,.screen[data-compact="true"] #next-plan{display:none}.screen[data-compact="true"] .compact-instruction{display:block}.screen[data-compact="true"] .answer{font-size:25px;line-height:1.1;margin:3px 0}.screen[data-compact="true"] .study{row-gap:7px}
/* Deliberate in-panel reading scroll: the screen and its actions stay put. */
.lesson{height:var(--lesson-height,140px);min-height:0}.lesson #guidance,.lesson #complete{height:100%;min-height:0;display:flex;flex-direction:column;gap:5px}.lesson #guidance-label,.lesson #answer,.lesson h3,.lesson #next{flex:none}.lesson #plan,.lesson #next-plan{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:0 6px 3px 0;touch-action:pan-y}.lesson #answer{margin:0}.page-body,.catalog-list{overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;touch-action:pan-y;padding:2px 6px 3px 2px}.page-body>section>p,.page-body>section>a,.page-body #branches>p{margin-bottom:12px}.page-body #branches>button{margin-bottom:8px}.page-body:focus-visible,.catalog-list:focus-visible,.plan:focus-visible,#next-plan:focus-visible{outline:2px solid #bd7626;outline-offset:0}
.masthead nav details>div{max-height:calc(var(--viewport-height,100dvh) - 80px);overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
/* A compact move selector remains playable when enlarged text/zoom leaves no board room. */
.screen[data-selector="true"]{padding:6px 10px;gap:4px}.screen[data-selector="true"] .masthead{padding:0 0 3px}.screen[data-selector="true"] .wordmark h1{font-size:17px}.screen[data-selector="true"] .masthead nav summary{min-height:32px;padding:5px 10px}.screen[data-selector="true"] .study{display:flex;gap:4px}.screen[data-selector="true"] .study-heading,.screen[data-selector="true"] .study-layout,.screen[data-selector="true"] .board-actions{display:none}.screen[data-selector="true"] .context-bar{min-height:32px}.screen[data-selector="true"] .context-bar button{min-height:32px;padding:5px 10px}.screen[data-selector="true"] .board-top{font-size:12px;min-height:18px}.screen[data-selector="true"] .reading-actions button{min-height:40px}.screen[data-selector="true"] .reading-actions{flex-wrap:nowrap}.screen[data-selector="true"] .error{max-height:42px;overflow-y:auto;overscroll-behavior:contain}.screen[data-selector="true"] #last-reply{display:none}
.screen-dialog[data-compact="true"],.catalog-dialog[data-compact="true"]{padding:6px 8px;gap:5px!important}.screen-dialog[data-compact="true"] .page-heading h2,.catalog-dialog[data-compact="true"] .page-heading h2{font-size:17px}.screen-dialog[data-compact="true"] .page-heading button,.catalog-dialog[data-compact="true"] .page-heading button,.screen-dialog[data-compact="true"] .page-navigation button,.catalog-dialog[data-compact="true"] .page-navigation button{min-height:32px;padding:5px 8px;font-size:12px}.screen-dialog[data-compact="true"] .page-navigation,.catalog-dialog[data-compact="true"] .page-navigation{font-size:11px}.catalog-dialog[data-compact="true"] #catalog-footnote{display:none}.catalog-dialog[data-compact="true"] input{min-height:32px;padding:5px 8px}.catalog-dialog[data-compact="true"] #catalog-results{font-size:11px}
.catalog-dialog[data-compact="true"] #catalog-list #catalog-footnote{display:block;flex:none;font-size:11px;line-height:1.4;margin-top:8px}
.screen{--normal-padding-x:18;--normal-padding-y:12;--normal-root-gap:10;--normal-row-gap:9}@media(max-width:600px){.screen{--normal-padding-x:10;--normal-padding-y:8;--normal-root-gap:7;--normal-row-gap:7}}
/* Grow the chrome gradually from 600 to 800px: a wider screen must not lose
   a row of board space at the compact typography breakpoint. The measurement
   adapter reads these resolved padding/gap lengths from the neutral layout. */
.screen{--screen-row-gap:clamp(7px,calc(var(--viewport-width,100vw)/100 + 1px),9px);padding:clamp(8px,calc(var(--viewport-width,100vw)/50 - 4px),12px) clamp(10px,calc(var(--viewport-width,100vw)/25 - 14px),18px);gap:clamp(7px,calc(var(--viewport-width,100vw)*.015 - 2px),10px)}
.study{gap:var(--screen-row-gap)}
.screen[data-measuring="true"] .play-area,.screen[data-measuring="true"] .lesson{display:none}
/* Page visibility is presentation state; native hidden keeps its semantic meaning. */
[data-page-hidden="true"]{display:none!important}

.screen{--wide-column-gap:20px;--wide-row-gap:9px}

/* The selected continuation is an action, with its study identity in words. */
.branch .branch-action{display:block;font-size:15px;font-weight:750;line-height:1.4}.branch .current-line{display:inline-block;margin-top:7px;font-size:10px;font-weight:750;letter-spacing:.4px;text-transform:uppercase}.branch.primary .branch-name,.branch.primary .current-line{color:var(--white)}#branches-open.primary{background:var(--green);color:var(--white);border-color:var(--green)}
/* Reserve the board before falling back to named square selection. */
.screen[data-controls="compact"] .study-heading,.screen[data-controls="compact"] .board-actions{display:none}.screen[data-controls="compact"] .context-bar{align-items:center;gap:8px;min-height:40px}.screen[data-controls="compact"] #session-context,.compact-context-measure{font-size:11px;line-height:1.35;overflow-wrap:anywhere}.screen[data-controls="compact"] #session-context{flex:1;min-width:0}.screen[data-controls="compact"] #progress{display:none}.screen[data-controls="compact"] .context-bar button{flex:none}.screen[data-selector="true"] .masthead{margin:0 auto}.screen[data-selector="true"] .reading-actions{flex-wrap:wrap}
/* A surface pages fitted whole items OR scrolls its complete content. */
.catalog-line{margin:0;min-width:0}.catalog-line-name{flex:1;min-width:0;overflow-wrap:anywhere}.catalog-line small{line-height:1.4}.catalog-row-measure,.catalog-family-measure{font-weight:550;overflow-wrap:anywhere}.catalog-list{padding:2px}.catalog-dialog[data-paging="true"] .catalog-list,.screen-dialog[data-paging="true"] .page-body{overflow:visible;scrollbar-gutter:auto;touch-action:auto}.catalog-dialog[data-paging="false"] .catalog-list,.screen-dialog[data-paging="false"] .page-body{overflow-y:auto;scrollbar-gutter:stable;touch-action:pan-y}.screen-dialog[data-paging="true"] .page-body{padding:2px}.screen-dialog[data-paging="true"] #menu-page,.screen-dialog[data-paging="true"] #settings-page,.screen-dialog[data-paging="true"] #picker-page{display:flex;flex-direction:column;gap:10px}.screen-dialog[data-paging="true"] #page-body [data-page-item]{margin:0}.empty-results{padding:14px 2px;font:14px/1.5 Inter,ui-sans-serif,system-ui,sans-serif}.empty-results button{margin-top:12px}.catalog-dialog[data-compact="true"] #catalog-footnote{display:block;padding-top:4px;font-size:10px;line-height:1.25}.catalog-dialog[data-compact="true"] .catalog-line{padding:7px 10px}.catalog-dialog[data-compact="true"] .catalog-line small{flex-basis:64px}

/* Reply choices belong to the opponent. Arrows are noninteractive annotations;
   the full named square remains the pointer and keyboard target. Pieces and
   coordinates stay above the lines, and moving pieces retain the foreground. */
.board>.reply-arrows{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none;overflow:visible}
.reply-shaft{fill:none;stroke:#254d79;stroke-width:9;stroke-linecap:round;paint-order:stroke;filter:drop-shadow(0 1px 0 #fffdf1)}
.reply-head{fill:#254d79;stroke:#fffdf1;stroke-width:1.5;stroke-linejoin:round}
.reply-arrow.secondary{opacity:.6}.reply-arrow.inspected .reply-shaft{stroke-width:12}.reply-arrow.inspected .reply-head{stroke-width:3}
.square.reply-origin:before{content:"";position:absolute;inset:5px;border:1px dashed #254d79;pointer-events:none;z-index:1}
.square.reply-target{box-shadow:inset 0 0 0 2px #254d79}.square.reply-candidate:before{border:3px dashed #254d79}
.reply-marker{position:absolute;right:3px;top:3px;z-index:5;min-width:1.35em;padding:.12em .22em;border-radius:4px;font-size:clamp(9px,calc(var(--board-size)/40),14px);font-weight:800;line-height:1.1;background:#fffdf1;color:#173e6b;border:1px solid #254d79;pointer-events:none}
.reply-plans{white-space:pre-line}.branch-destination{display:block;font-size:12px;line-height:1.4;margin-top:7px}.branch.primary .branch-destination{color:var(--white)}

/* Stable presentation slots: state changes spend the reserved panel capacity,
   never the chessboard's width, height or top edge. Measurements use natural
   boxes, independent of the previous output, at each real viewport/text size. */
.study-heading{min-height:var(--heading-height,0px)}
.context-bar{min-height:var(--context-height,40px)}
.board-top{display:grid;grid-template-columns:minmax(0,1fr) 90px;min-height:var(--turn-height,20px);align-items:center}
.board-top #last-reply{min-width:0;overflow-wrap:anywhere;text-align:right}
.board-actions{min-height:var(--actions-height,44px);align-content:start}
.reading-actions{min-height:var(--reading-height,44px);align-content:start}
.error{max-height:var(--feedback-height,48px);overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;touch-action:pan-y}
.opening-title-measure{font:400 25px/1.1 Georgia,"Times New Roman",serif;letter-spacing:-.6px}
.turn-measure{font-size:13px;line-height:1.4}
.error-measure{font-size:12px;line-height:1.35}
.screen[data-arrangement="wide"] .opening-title-measure{font-size:24px}
.screen[data-measuring="true"] .study-heading,.screen[data-measuring="true"] .context-bar,.screen[data-measuring="true"] .board-top,.screen[data-measuring="true"] .board-actions,.screen[data-measuring="true"] .reading-actions{min-height:0}
.screen[data-selector="true"] .board-top{grid-template-columns:minmax(0,1fr);min-height:18px}
.screen[data-selector="true"] .context-bar{min-height:32px}
.screen[data-selector="true"] .reading-actions{min-height:40px}
@media(max-width:600px){.opening-title-measure{font-size:23px}}

/* Neutral measurements cannot be compressed by the screen they are planning. */
.screen[data-measuring="true"] .study{flex-shrink:0}

/* A short wide screen retains the board; complete prose opens in Explanation. */
.screen[data-lesson="dialog"] .lesson{display:none}

/* Essential controls use the side column before a short viewport loses its board. */
.screen[data-arrangement="wide"][data-compact-wide="true"] .study{grid-template-rows:minmax(var(--context-height,40px),auto) minmax(var(--turn-height,20px),auto) minmax(var(--reading-height,44px),auto) minmax(var(--feedback-height,48px),auto)}
.screen[data-arrangement="wide"][data-compact-wide="true"] .play-area{grid-column:1;grid-row:1/5}
.screen[data-arrangement="wide"][data-compact-wide="true"] .context-bar{grid-column:2;grid-row:1}
.screen[data-arrangement="wide"][data-compact-wide="true"] .board-top{grid-column:2;grid-row:2;align-self:start}
.screen[data-arrangement="wide"][data-compact-wide="true"] .reading-actions{grid-column:2;grid-row:3}
.screen[data-arrangement="wide"][data-compact-wide="true"] .error{grid-column:2;grid-row:4}
