/* A private notebook uses neutral squares, independent of the playing theme. */
#study-sheet .screen-content{max-width:1100px}
.study-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.study-title-row .eyebrow{margin:0 0 6px!important;font-size:9px!important}
.study-title-row h1{margin:0!important;font-size:clamp(21px,3vw,30px)!important;letter-spacing:-.8px!important}
.study-title-row>button{font-size:12px!important;min-height:44px!important;white-space:nowrap;margin:0!important}
.study-intro{font-size:12px;line-height:1.6;color:var(--muted);margin:0 0 20px;max-width:650px}
.study-workspace{display:grid;grid-template-columns:minmax(0,620px) minmax(260px,1fr);gap:32px;align-items:start}
.study-board-area{min-width:0;width:100%;max-width:620px;margin:0 auto}
.study-position-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;min-height:28px;margin:0 0 10px;font-size:12px}
.study-position-heading span{font-size:10px;color:var(--muted)}
#study-sheet .study-board-wrap{position:relative;width:100%;max-width:none;aspect-ratio:1;margin:0;overflow:hidden;isolation:isolate;border-radius:12px;outline:1px solid var(--line)}
#study-sheet .board{width:100%;height:100%;aspect-ratio:1;display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr)}
#study-sheet .square{background:#e2e3e8!important;background-image:none!important;min-width:0;min-height:0;aspect-ratio:1;padding:0}
#study-sheet .square.dark{background:#969ba6!important}
html[data-theme="dark"] #study-sheet .square{background:#c4c7cf!important}
html[data-theme="dark"] #study-sheet .square.dark{background:#737b88!important}
#study-sheet .square.last{box-shadow:inset 0 0 0 100px #fff2!important}
#study-sheet .square.selected{box-shadow:inset 0 0 0 3px #7656b8!important}
#study-sheet .coord{color:#313744!important;opacity:.85}
#study-sheet .square.dark .coord{color:#f9f9fc!important}
.study-marks{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:5;color:#6c40bbb8}
.study-board-controls{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px}
.study-board-controls button,.study-mode button,.study-move-list button,.study-variations button{min-height:44px;border:1px solid var(--line);background:var(--rush-card);color:var(--ink);border-radius:10px;cursor:pointer;font:inherit}
.study-board-controls button{font-size:21px}
.study-board-controls button:disabled{opacity:.35}
.study-position-status{font-size:11px;line-height:1.6;color:var(--muted);margin:8px 0 0;min-height:20px}
.study-tools{min-width:0}
.study-mode{display:flex;gap:6px}
.study-mode button{font-size:12px;padding:8px 12px}
.study-mode button[aria-pressed="true"]{background:color-mix(in srgb,var(--accent) 16%,transparent);border-color:var(--accent);font-weight:600}
.study-mode #study-clear-marks{margin-left:auto;font-size:11px;padding:8px}
.study-tool-help{font-size:11px;line-height:1.7;color:var(--muted);margin:10px 0 12px}
.study-move-list{display:flex;gap:6px;flex-wrap:wrap;max-height:150px;overflow:auto;padding:2px}
.study-move-list button{font-size:12px;min-height:36px;padding:8px 10px}
.study-move-list button[aria-current]{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 15%,transparent)}
.study-variations{display:flex;flex-direction:column;gap:7px;margin-top:10px;max-height:160px;overflow:auto}
.study-variations button{width:100%;text-align:left;padding:9px 10px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:36px}
#study-sheet .study-tools label{display:block;font-size:12px!important;margin:18px 0 8px!important;font-weight:600}
.study-tools textarea{display:block;width:100%;min-height:78px;resize:vertical;padding:12px;font-size:16px;line-height:1.6;font-family:inherit;background:var(--rush-input);color:var(--ink);border:1px solid var(--line);border-radius:12px}
.study-tools textarea:focus{outline:2px solid color-mix(in srgb,var(--accent) 50%,transparent);outline-offset:2px}
.study-save-actions{display:flex;flex-direction:column;gap:8px;margin-top:18px}
#study-sheet .study-save-actions .solid-button{min-height:48px;width:100%;font-size:14px}
.study-save-status{font-size:11px;line-height:1.7;min-height:20px;color:var(--muted);margin:8px 0}
.saved-study{min-height:40px;padding:8px 0;background:none;border:0;color:var(--accent);font:inherit;font-size:12px;cursor:pointer;display:block}
@media(max-width:999px), (hover:none), (pointer:coarse){
 #study-sheet .study-workspace{display:flex;flex-direction:column;gap:20px;align-items:center}
 #study-sheet .study-board-area,#study-sheet .study-tools{width:100%;max-width:var(--play-width,min(100%,520px))}
 #study-sheet .study-title-row{align-items:center}
 #study-sheet .study-title-row .eyebrow{display:none}
 #study-sheet .study-title-row h1{font-size:21px!important}
 #study-sheet .study-title-row>button{font-size:11px!important}
 #study-sheet .study-intro{font-size:11px;margin-bottom:14px}
 #study-sheet .study-save-actions{margin-top:16px}
}
@media(min-width:950px) and (min-height:600px) and (orientation:landscape){
 #study-sheet .study-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,.85fr);gap:28px;align-items:start}
 #study-sheet .study-board-area{max-width:min(620px,calc(var(--app-height) - 300px))}
 #study-sheet .study-tools{max-width:none}
}
@media(min-width:1000px) and (min-height:580px) and (hover:hover) and (pointer:fine){
 html body #study-sheet{padding-top:24px;padding-bottom:24px;display:flex;flex-direction:column}
 html body #study-sheet[hidden]{display:none}
 #study-sheet .screen-content{margin:auto;width:100%}
 #study-sheet .study-workspace{grid-template-columns:minmax(0,min(620px,calc(var(--app-height) - 245px))) minmax(280px,1fr)}
}
@media(orientation:landscape) and (max-height:580px){
 #study-sheet .study-workspace{display:grid;grid-template-columns:minmax(160px,35%) minmax(220px,1fr);gap:22px;align-items:start}
 #study-sheet .study-board-area,#study-sheet .study-tools{max-width:none}
}

/* The notebook scrolls, so short phones retain a readable full-width board. */
@media(orientation:portrait) and (max-width:699px){
 #study-sheet .study-board-area,#study-sheet .study-tools{max-width:100%}
}
@media(max-width:999px), (hover:none), (pointer:coarse){
 #study-sheet .study-move-list button,#study-sheet .study-variations button{min-height:44px}
}
