/* Open Sans is self-hosted for offline use; license: fonts/LICENSE.txt. */
@font-face{font-family:'Pumpkin Sans';src:url('fonts/open-sans-regular.woff') format('woff');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Pumpkin Sans';src:url('fonts/open-sans-semibold.woff') format('woff');font-weight:500 600;font-style:normal;font-display:swap}
@font-face{font-family:'Pumpkin Sans';src:url('fonts/open-sans-bold.woff') format('woff');font-weight:700 800;font-style:normal;font-display:swap}
:root{--bg:#f5f6f3;--paper:#fff;--ink:#25352f;--muted:#79817b;--green:#365a47;--dark:#172c25;--line:#e5e9e2;--mint:#eaf0e5;--accent:#d7e7b4;--board-light:#eeeed9;--board-dark:#78957a}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:14px}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.4}button{color:inherit}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #91b166;outline-offset:3px}svg{display:block}button span[data-icon],span[data-icon]{display:inline-flex;align-items:center;justify-content:center}span[data-icon] svg{width:18px;height:18px}button{border:0}h1,h2,h3,p{margin:0}h1,h2,h3,.brand{font-family:var(--font)}h2{font-size:17px;font-weight:700;letter-spacing:-.5px}.app-shell{display:flex;min-height:100vh}.sidebar{width:226px;background:var(--dark);color:#e9eee6;position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;padding:34px 21px 21px;z-index:10}.brand{display:flex;align-items:center;gap:10px;font-size:31px;letter-spacing:-1.6px;font-weight:800;padding-left:10px}.brand-mark{background:#bcd7a2;color:#223b2b;width:37px;height:38px;border-radius:9px;font-family:Georgia,serif;font-size:33px;text-align:center;line-height:38px;font-weight:400;letter-spacing:0}.brand-dot{color:#bcd7a2}.workspace-label{font-size:8px;letter-spacing:1.5px;color:#82988b;margin:40px 10px 16px;white-space:nowrap}nav{display:flex;flex-direction:column;gap:7px}.nav-item{display:flex;gap:13px;align-items:center;background:transparent;text-align:left;padding:13px 14px;border-radius:7px;font-size:13px;color:#a7b8ad;font-weight:500}.nav-item.active{background:#2a4237;color:#e6f0db}.nav-arrow{margin-left:auto;color:#afc69b;font-size:17px}.nav-item:not(.active) .nav-arrow{display:none}.sidebar-note{margin-top:auto;padding:22px 13px 18px;border:1px solid #34493d;border-radius:9px;background:linear-gradient(135deg,#223b2f,#1a3027)}.tiny-stars{color:#d2e5b5;font-size:29px}.sidebar-note h3{font-size:13px;margin:10px 0;color:#edf3e4}.sidebar-note p{font-size:12px;color:#9caf9f;line-height:1.8}.note-line{display:block;background:#3c5143;height:1px;margin:18px 0 14px}.local-label{display:flex;align-items:center;gap:7px;font-size:9px;color:#9eb29f}.local-label svg{width:13px!important;height:13px!important}.sidebar-footer{font-size:9px;letter-spacing:1px;color:#81998a;display:flex;align-items:center;gap:7px;margin:25px 8px 0}.sidebar-footer>span:last-child{margin-left:auto;letter-spacing:0}.small-dot{width:6px;height:6px;border-radius:50%;background:#92ad7e;display:inline-block;flex-shrink:0}.main-shell{margin-left:226px;width:calc(100% - 226px)}.topbar{height:78px;border-bottom:1px solid var(--line);padding:0 38px;display:flex;align-items:center;justify-content:space-between;background:rgba(255,255,255,.55)}.breadcrumb{font-size:12px;color:var(--muted)}.breadcrumb span{margin:0 14px;color:#b4bbb3}.breadcrumb strong{color:#3e5145;font-weight:500}.topbar-right{display:flex;gap:22px;align-items:center}.save-state{display:flex;gap:7px;align-items:center;font-size:11px;color:#73816f}.avatar{width:33px;height:33px;background:#e5eadd;border:1px solid #dce3d6;border-radius:50%;display:grid;place-items:center;font-size:10px;font-weight:700;color:#486243}main{padding:32px 38px 0;max-width:1460px;margin:0 auto}.page{display:none}.active-page{display:block}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:29px}.eyebrow{font-size:9px;letter-spacing:1.7px;color:#899481;font-weight:600;margin-bottom:11px}h1{font-size:32px;line-height:1.2;font-weight:800;letter-spacing:-1.5px}h1>span{color:#78975c}.page-heading p{font-size:13px;color:var(--muted);margin-top:10px}.primary-button,.secondary-button{display:flex;justify-content:center;align-items:center;gap:10px;padding:13px 20px;border-radius:6px;font-weight:600;font-size:12px;white-space:nowrap}.primary-button{background:var(--green);color:#fff}.secondary-button{border:1px solid #dce3d6;background:#fff}.primary-button svg{width:15px!important;height:15px!important}.game-layout{display:grid;grid-template-columns:minmax(320px,650px) 330px;gap:25px;align-items:start}.board-column{min-width:0;max-width:650px}.board-surface{background:#fff;border:1px solid var(--line);border-radius:9px;padding:0 20px;box-shadow:0 5px 12px #18332403}.player-row{height:69px;display:flex;align-items:center;justify-content:space-between;padding:0 5px}.player-identity{display:flex;align-items:center;gap:11px}.player-identity strong{font-size:13px;font-weight:600}.player-detail{margin-top:4px;font-size:10px;color:var(--muted)}.player-avatar{width:36px;height:36px;border-radius:7px;display:grid;place-items:center}.engine-avatar{background:#eaf0e2;color:#466244;font-size:32px;font-family:Georgia,serif}.human-avatar{background:#f0f2ed;border:1px solid #e4e8de}.human-avatar svg{color:#73846b;width:18px!important;height:18px!important}.turn-pill{border:1px solid var(--line);border-radius:4px;font-size:10px;padding:6px 9px;color:#90988c}.your-turn{background:#eef3e4;border-color:#e1e9d6;color:#607745}.thinking-pill{background:#eef3e4;color:#607745;animation:pulse 1.4s infinite}.board-wrapper{position:relative;margin-left:17px;margin-right:0}.chessboard{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;width:100%;overflow:hidden;border-radius:3px;border:1px solid #71866d;touch-action:manipulation}.square{aspect-ratio:1;position:relative;background:var(--board-light);padding:2px;display:grid;place-items:center;min-width:0;border-radius:0}.square.dark{background:var(--board-dark)}.square.last:after{content:'';position:absolute;inset:0;background:#c6cd49;opacity:.32;pointer-events:none}.square.selected{background:#d0d876!important}.square.selected:after{content:'';position:absolute;inset:2px;border:2px solid #587133;pointer-events:none}.square.check{background:#c67968!important}.piece{width:85%;height:85%;position:relative;z-index:1;filter:drop-shadow(0 2px 1px #23342030);pointer-events:none}.legal-dot{position:absolute;width:22%;height:22%;background:#344e3980;border-radius:50%;z-index:2;pointer-events:none}.legal-capture{position:absolute;inset:4px;border:5px solid #334d3970;border-radius:50%;z-index:2;pointer-events:none}.square:hover{filter:brightness(1.035)}.square:focus-visible{outline-offset:-4px;z-index:3}.rank-labels{position:absolute;top:0;left:-22px;width:18px;height:100%;display:grid;grid-template-rows:repeat(8,1fr);align-items:center;text-align:center;font-size:9px;font-weight:500;color:#8c9684}.file-labels{position:absolute;left:0;right:0;bottom:-19px;height:17px;display:grid;grid-template-columns:repeat(8,1fr);text-align:center;align-items:center;font-size:9px;font-weight:500;color:#8c9684}.bottom-player{margin-top:20px;height:66px}.board-toolbar{display:flex;justify-content:space-between;align-items:center;padding:12px 2px 16px;gap:10px}.board-toolbar>div{display:flex;gap:4px;align-items:center}.game-mode{font-size:10px;color:#8b9686;display:flex;align-items:center;gap:7px}.game-mode .small-dot{width:4px;height:4px;background:#889f79}.icon-button{padding:7px;display:flex;align-items:center;justify-content:center;color:#819079;border-radius:5px;background:transparent;width:32px;height:32px}.text-button{display:flex;align-items:center;gap:6px;background:transparent;font-size:10px;color:#808c78;padding:7px}.text-button svg{width:13px!important;height:13px!important}.status-banner{display:flex;gap:11px;align-items:center;background:#edf1e6;border:1px solid #e0e7d7;border-radius:7px;padding:15px}.status-icon{color:#7d9464}.status-banner strong{font-size:11px;display:block;font-weight:600}.status-banner div>span{display:block;font-size:10px;color:#87917e;margin-top:4px;line-height:1.5}.keyboard-note{font-size:9px;color:#96a28b;margin-left:auto;white-space:nowrap}.game-panel{display:flex;flex-direction:column;gap:18px}.card{background:#fff;border:1px solid var(--line);border-radius:9px;overflow:hidden;box-shadow:0 4px 12px #18332402}.engine-card{padding:19px 21px 0}.card-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.section-label{font-size:9px;font-weight:600;letter-spacing:1.4px;color:#899380}.icon-button.small{width:20px;height:20px;padding:2px;color:#a2aa99}.icon-button.small svg{width:14px!important;height:14px!important}.engine-title{display:flex;align-items:center;gap:10px;margin-top:17px}.engine-logo{width:44px;height:44px;display:grid;place-items:center;border-radius:9px;background:#eff2e8;color:#456140;font-size:39px;font-family:Georgia,serif}.engine-title h2{font-size:16px}.version{font-size:9px;background:#f1f3ed;color:#92a182;border-radius:3px;padding:3px 5px;margin-left:3px;font-weight:500;letter-spacing:0}.engine-state{display:flex;align-items:center;gap:5px;font-size:9px;margin-top:5px;color:#839375}.engine-state .small-dot{width:4px;height:4px}.learning-badge{font-size:7px;letter-spacing:.7px;color:#7e9562;border:1px solid #dce7cc;background:#f4f8ed;padding:5px 6px;border-radius:4px;margin-left:auto;white-space:nowrap}.elo-section{display:flex;align-items:center;justify-content:space-between;margin-top:23px}.elo-label{font-size:10px;color:#87917f}.elo-value{display:flex;align-items:baseline;gap:8px;margin-top:4px}.elo-value>span:first-child{font-family:var(--font);font-size:46px;letter-spacing:-2.5px;font-weight:700;line-height:1.1}.elo-value>span:last-child{font-size:10px;letter-spacing:1px;color:#98a18b}.elo-change{align-self:flex-end;margin-bottom:6px;font-size:9px;color:#829070;background:#f0f4e9;border-radius:4px;padding:6px 7px}.elo-change.negative{color:#a96c60;background:#fbefea}.chart-container{height:68px;margin:16px -2px 10px;display:flex;align-items:center}.chart-empty{font-size:10px;color:#9ca492;text-align:center;width:100%;padding:16px;background:#fafbf8;border:1px dashed #e1e7d8;border-radius:5px;line-height:1.5}.engine-stats{display:flex;gap:0;border-top:1px solid #eef0e9;padding-top:16px}.engine-stats>div{width:50%}.engine-stats>div:last-child{border-left:1px solid #edf0e6;padding-left:20px}.engine-stats strong{display:block;font-size:19px;font-family:var(--font);font-weight:700}.engine-stats span{display:block;font-size:9px;color:#919b86;margin-top:5px}.learning-note{display:flex;align-items:start;gap:8px;background:#f5f7f0;border-radius:5px;padding:11px;margin-top:17px;font-size:9px;color:#839372;line-height:1.7}.learning-note svg{width:14px!important;height:14px!important;margin-top:1px}.panel-link{display:flex;justify-content:space-between;width:100%;background:transparent;color:#627951;font-weight:500;font-size:10px;padding:15px 0;border-top:1px solid #eff1e9;margin-top:14px}.panel-link>span{font-size:14px}.moves-card{padding:17px 0 0}.moves-header{display:flex;align-items:center;justify-content:space-between;padding:0 19px 17px}.moves-header h2{font-size:12px;font-family:var(--font);letter-spacing:0}.muted{font-size:9px;color:#9aa48f}.moves-table-head{display:grid;grid-template-columns:39px 1fr 1fr;padding:10px 19px;background:#f9faf7;border-top:1px solid #f0f1eb;border-bottom:1px solid #f0f1eb;font-size:8px;letter-spacing:.9px;color:#9aa58d}.moves-list{height:143px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#d5dfca transparent}.moves-empty{text-align:center;padding:16px;color:#909c86}.moves-empty>span{font-size:24px;line-height:1;display:block;color:#acb49e}.moves-empty strong{font-size:10px;font-weight:500;display:block;margin-top:7px}.moves-empty p{font-size:9px;margin-top:5px;color:#a7b19b}.move-row{display:grid;grid-template-columns:39px 1fr 1fr;align-items:center;padding:9px 19px;font-size:12px;border-bottom:1px solid #f4f5ef}.move-row:nth-child(even){background:#fcfcfa}.move-row>span:first-child{font-size:9px;color:#a1aa96}.move-row>span.latest{font-weight:600;color:#405b36}.analysis-footer{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:11px 19px;font-size:8px;color:#929d84}.analysis-footer>span:first-child{display:flex;align-items:center;gap:5px}.analysis-footer .small-dot{width:4px;height:4px}.analysis-footer>span:last-child{font-size:10px;font-weight:600;color:#6f7e5e}.elo-disclaimer{display:flex;gap:7px;font-size:9px;color:#98a18e;line-height:1.7;padding:0 3px}.elo-disclaimer svg{width:13px!important;height:13px!important;margin-top:2px}.page-footer{display:flex;justify-content:space-between;gap:10px;border-top:1px solid var(--line);margin-top:29px;padding:17px 0 22px;font-size:9px;color:#a2ab99}.progress-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:24px}.stat-card{padding:24px}.stat-card>span{font-size:11px;color:var(--muted)}.stat-card strong{display:block;font-size:31px;margin:10px 0 5px;font-family:var(--font);font-weight:700;letter-spacing:-1px}.stat-card small{font-size:10px;color:#92a083}.growth-card{padding:25px;margin-bottom:23px}.subtle-badge{color:#859374;font-size:9px;background:#f2f5ec;border-radius:4px;padding:6px 9px}.chart-caption{font-size:11px;line-height:1.8;color:#929b88;margin-top:15px}.large-chart-empty{height:210px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;border:1px dashed #e0e6d8;border-radius:7px;margin-top:22px;background:#fbfcf9;color:#8e9b80}.large-chart-empty>span{font-size:36px;color:#bdc9ac}.large-chart-empty strong{font-size:13px;font-weight:500}.large-chart-empty p{font-size:11px}.progress-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.weights-card,.history-card{padding:24px}.weights-card>p{font-size:11px;color:#929e87;margin:14px 0 22px;line-height:1.8}.weight-row{margin-bottom:17px}.weight-row>div:first-child{display:flex;justify-content:space-between;font-size:11px;margin-bottom:8px;color:#728168}.weight-track{height:5px;border-radius:3px;background:#eef2e8;overflow:hidden}.weight-fill{height:100%;background:#8da574;border-radius:3px}.history-card .card-heading{margin-bottom:18px}.history-empty{padding:45px 10px;text-align:center;line-height:1.8;font-size:12px;color:#99a28c}.history-row{padding:13px 0;border-bottom:1px solid #edf0e7;display:flex;gap:12px;align-items:center}.result-symbol{width:30px;height:30px;display:grid;place-items:center;border-radius:6px;background:#eff4e7;color:#7e9765}.history-row strong{font-size:11px;display:block}.history-row small{font-size:9px;color:#9aa58e;display:block;margin-top:4px}.history-elo{margin-left:auto;font-size:12px;color:#7a8e64}.storage-callout{margin:24px 0;display:flex;gap:12px;padding:17px 20px;border:1px solid #e1e7d8;border-radius:7px;background:#eef2e8;color:#89977b;font-size:11px;line-height:1.9}.storage-callout svg{width:19px!important;height:19px!important;margin-top:3px}.about-hero{background:#213d30;color:#e8f0df;display:flex;gap:55px;align-items:center;padding:42px 55px;margin-bottom:24px}.about-knight{font-family:Georgia,serif;font-size:148px;color:#c4d9ac;line-height:1}.about-hero h2{font-size:30px;line-height:1.35;margin:13px 0;font-weight:600;letter-spacing:-1px}.about-hero p{font-size:12px;line-height:1.9;max-width:510px;color:#afc1a5}.about-hero .section-label{color:#8fac7f}.about-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.about-grid .card{padding:29px}.step-number{font-size:9px;letter-spacing:1px;color:#95a77c}.about-grid h2{font-size:18px;margin:15px 0 12px}.about-grid p{color:#8b9681;font-size:12px;line-height:1.95}dialog{border:1px solid #e1e7d8;border-radius:13px;width:min(430px,calc(100% - 32px));padding:27px;color:var(--ink);box-shadow:0 20px 100px #142e3540}dialog::backdrop{background:#12291f88;backdrop-filter:blur(4px)}.dialog-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}dialog h2{font-size:24px;letter-spacing:-1px}dialog p{font-size:12px;color:#859277;line-height:1.8;margin-top:11px}.form-label{display:block;font-size:11px;font-weight:600;margin:21px 0 10px}.side-options{display:flex;gap:8px}.side-options label{flex:1}.side-options input{position:absolute;opacity:0;pointer-events:none}.side-options label>span{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;border:1px solid #e0e7d6;border-radius:7px;padding:10px 5px;font-size:11px;cursor:pointer}.color-piece{font-size:30px;height:36px}.side-options input:checked+span{background:#eff4e6;border:1px solid #839d67}.side-options input:focus-visible+span{outline:3px solid #9eb77c;outline-offset:2px}select,input[type=number]{width:100%;border:1px solid #dde5d3;border-radius:6px;background:#fbfcf8;color:#687958;padding:11px 12px;font-size:12px}.form-help{font-size:10px!important;line-height:1.7!important}.wide{width:100%;margin-top:23px;justify-content:space-between}.dialog-note{font-size:10px;background:#fbf4e7;color:#9b875a;padding:10px;border-radius:5px;margin-top:18px;line-height:1.7}.dialog-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:22px}.promotion-options{display:flex;gap:10px;margin-top:25px}.promotion-options button{width:25%;background:#edf2e7;border:1px solid #dce5d1;border-radius:7px;padding:9px;display:flex;flex-direction:column;align-items:center;font-size:9px}.promotion-options .piece{width:65px;height:65px;max-width:100%}.toast{position:fixed;left:calc(50% + 113px);bottom:28px;transform:translate(-50%,20px);z-index:100;background:#294635;color:#e3edda;padding:13px 20px;border-radius:8px;box-shadow:0 4px 25px #182a2220;font-size:12px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;max-width:calc(100% - 40px)}.toast.visible{opacity:1;transform:translate(-50%,0)}@keyframes pulse{50%{opacity:.55}}
@media(min-width:1500px){main{padding-top:40px}.game-layout{grid-template-columns:minmax(400px,650px) 360px;gap:30px}.game-panel{gap:21px}.board-surface{padding:0 25px}.player-row{height:75px}.bottom-player{height:75px}.engine-card{padding:23px 24px 0}.chart-container{height:81px}.moves-list{height:165px}.page-heading{margin-bottom:32px}.page-heading h1{font-size:36px}}
@media(max-width:1180px){.sidebar{width:190px;padding-left:14px;padding-right:14px}.main-shell{margin-left:190px;width:calc(100% - 190px)}.workspace-label{font-size:7px;letter-spacing:1px}.topbar{padding:0 25px}main{padding:28px 25px 0}.game-layout{grid-template-columns:minmax(300px,1fr) 290px;gap:18px}.engine-card{padding:17px 17px 0}.elo-value>span:first-child{font-size:40px}.elo-change{font-size:8px;padding:5px}.board-surface{padding:0 14px}.page-heading h1{font-size:27px}.keyboard-note{display:none}.page-footer{font-size:8px}.toast{left:calc(50% + 95px)}}
@media(max-width:980px){.sidebar{width:76px;padding:24px 10px}.brand{padding:0;justify-content:center}.brand>span:last-child,.workspace-label,.sidebar-note,.sidebar-footer,.nav-item>.nav-arrow{display:none}nav{margin-top:37px}.nav-item{padding:15px;justify-content:center;font-size:0;gap:0}.nav-item span[data-icon] svg{width:21px;height:21px}.main-shell{margin-left:76px;width:calc(100% - 76px)}.topbar{height:66px}.game-layout{grid-template-columns:minmax(310px,1fr) 280px}.page-heading h1{font-size:26px}.engine-stats span{font-size:8px}.toast{left:calc(50% + 38px)}.progress-stats{gap:12px}.stat-card{padding:17px}.stat-card>span{font-size:10px}.about-hero{padding:35px;gap:30px}.about-knight{font-size:120px}.about-hero h2{font-size:25px}}
@media(max-width:800px){.game-layout{grid-template-columns:1fr}.board-column{max-width:600px;width:100%;margin:auto}.game-panel{display:grid;grid-template-columns:1fr 1fr;align-items:start;margin-top:6px}.elo-disclaimer{grid-column:1/-1}.moves-list{height:287px}.page-heading{margin-bottom:25px}.page-heading h1{font-size:28px}.progress-stats{grid-template-columns:1fr 1fr}.progress-grid{grid-template-columns:1fr}.page-footer{flex-direction:column;gap:7px}.topbar-right .save-state{font-size:9px}.about-grid{gap:15px}.about-grid .card{padding:22px}.about-hero{padding:27px;gap:25px}.about-knight{font-size:95px}.about-hero h2{font-size:22px}.about-hero p{font-size:11px}}
@media(max-width:560px){.sidebar{position:relative;inset:auto;width:100%;height:auto;padding:13px 17px;flex-direction:row;align-items:center;justify-content:space-between;gap:10px}.brand{font-size:24px;gap:7px}.brand-mark{width:29px;height:31px;border-radius:6px;font-size:26px;line-height:31px}.brand>span:last-child{display:block}nav{margin:0;flex-direction:row;gap:3px}.nav-item{padding:10px;min-width:40px}.nav-item span[data-icon] svg{width:18px;height:18px}.app-shell{display:block}.main-shell{width:100%;margin:0}.topbar{height:48px;padding:0 17px}.topbar-right{gap:8px}.save-state{font-size:8px!important}.avatar{display:none}.breadcrumb{font-size:10px}.breadcrumb span{margin:0 8px}main{padding:23px 16px 0}.page-heading{align-items:flex-start;gap:10px;margin-bottom:22px}.eyebrow{font-size:7px;letter-spacing:1.15px;margin-bottom:9px}.page-heading h1{font-size:23px;letter-spacing:-1px}.page-heading p{font-size:10px;line-height:1.6;margin-top:8px;max-width:200px}.page-heading .primary-button,.page-heading .secondary-button{padding:10px 11px;font-size:10px;gap:5px;margin-top:15px}.page-heading .primary-button svg{width:12px!important;height:12px!important}.board-surface{padding:0 12px}.board-wrapper{margin-left:14px}.player-row{height:60px;padding:0 2px}.player-avatar{width:31px;height:31px}.player-identity{gap:8px}.player-identity strong{font-size:12px}.player-detail{font-size:9px}.turn-pill{font-size:9px;padding:5px 7px}.bottom-player{height:59px;margin-top:18px}.rank-labels{left:-19px;width:15px}.board-toolbar{padding-bottom:12px}.status-banner{padding:13px 11px}.status-banner strong{font-size:10px}.status-banner div>span{font-size:9px}.game-panel{grid-template-columns:1fr;gap:15px;margin-top:4px}.engine-card{padding:18px 19px 0}.engine-title{margin-top:12px}.elo-section{margin-top:17px}.chart-container{height:75px}.engine-stats strong{font-size:20px}.engine-stats span{font-size:10px}.learning-note{font-size:10px}.panel-link{font-size:11px}.moves-list{height:160px}.moves-header h2{font-size:13px}.moves-empty strong{font-size:11px}.moves-empty p{font-size:10px}.elo-disclaimer{font-size:10px;line-height:1.8}.page-footer{margin-top:20px;font-size:8px;line-height:1.6}.toast{left:50%;width:max-content;max-width:calc(100% - 30px);font-size:11px}.progress-stats{gap:10px}.stat-card{padding:15px}.stat-card strong{font-size:26px}.stat-card small{font-size:9px}.growth-card,.weights-card,.history-card{padding:19px}.card-heading h2{font-size:14px}.subtle-badge{font-size:7px;padding:5px}.large-chart-empty{height:170px}.large-chart-empty p{font-size:10px;text-align:center;line-height:1.7;padding:0 15px}.chart-caption{font-size:10px}.storage-callout{padding:15px;font-size:10px}.about-hero{padding:24px;gap:18px}.about-knight{font-size:72px}.about-hero h2{font-size:19px}.about-hero p{font-size:10px}.about-grid{grid-template-columns:1fr}.about-grid .card{padding:23px}.about-grid p{font-size:11px}.about-grid h2{font-size:17px}.legal-capture{border-width:4px}.text-button{font-size:9px}.game-mode{font-size:9px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* Helper text stays readable on light backgrounds and small screens. */
.player-detail,.game-mode,.text-button,.elo-label,.elo-disclaimer,.chart-caption,.chart-empty,.engine-stats span,.moves-empty,.moves-empty p,.chart-caption,.weights-card>p,.storage-callout,.page-heading p,.history-row small,.form-help,.status-banner div>span{color:#65725f;font-size:11px}
.status-banner strong{font-size:12px}.turn-pill{font-size:11px}.elo-change,.panel-link,.learning-note,.engine-state{font-size:11px;color:#60734e}.learning-badge{font-size:8px}.rank-labels,.file-labels{font-size:11px;color:#66755c}.section-label,.eyebrow{color:#6d7e5e}.muted,.chart-caption,.analysis-footer{color:#68775e}.analysis-footer{font-size:10px}.move-row>span:first-child{font-size:11px;color:#7b886b}.page-footer{color:#6f7d63;font-size:10px}.player-identity strong{font-size:14px}.moves-header h2{font-size:14px}.primary-button,.secondary-button{font-size:13px}.history-row strong{font-size:12px}.history-row small{font-size:11px}.moves-empty strong{font-size:12px}.history-empty,.weights-card>p,.chart-caption{color:#65725f}.keyboard-note{color:#738368;font-size:10px}.learning-note{line-height:1.65}.sidebar-note p{font-size:12px}.icon-button{color:#647859}.large-chart-empty{color:#687a57}.about-grid p,.about-hero p{font-size:13px}.about-grid p{color:#66735d}dialog p{color:#65775a}.form-help{font-size:11px!important}.side-options label>span{font-size:12px}
@media(max-width:800px){.game-panel{grid-template-columns:1fr 1fr}.engine-title{flex-wrap:wrap}.learning-badge{display:none}}
@media(max-width:650px){.game-panel{grid-template-columns:1fr}.learning-badge{display:block}.engine-title{flex-wrap:nowrap}.moves-list{height:160px}.page-heading .primary-button,.page-heading .secondary-button{font-size:11px}.page-heading p{font-size:11px}.about-grid p{font-size:12px}}
.training-state-pill{display:flex;align-items:center;gap:8px;white-space:nowrap;background:#edf2e6;border:1px solid #dfe7d6;color:#627951;border-radius:6px;padding:10px 13px;font-size:11px}.training-state-pill.running .small-dot{animation:pulse 1s infinite}.training-grid{display:grid;grid-template-columns:1fr 1fr;gap:23px;margin-bottom:24px}.training-controls,.training-live{padding:25px}.training-intro,.training-help,.benchmark-intro{font-size:12px;line-height:1.85;color:#65755b;margin-top:14px}.training-fields{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.training-fields .form-label{font-size:12px}.training-buttons{display:flex;gap:10px;margin-top:24px}.training-buttons .primary-button{flex:1}.training-help{font-size:11px;margin-top:17px}.training-controls .text-button{margin-top:12px;text-decoration:underline}.selfplay-visual{display:flex;align-items:center;justify-content:center;gap:22px;padding:25px 0;margin:15px 0;background:#f6f8f1;border:1px solid #e9eee0;border-radius:7px}.selfplay-visual>span{font-family:Georgia,serif;font-size:58px;color:#698657;line-height:1}.selfplay-visual>span:last-child{transform:scaleX(-1);color:#b2c399}.selfplay-visual>div{text-align:center}.selfplay-visual>div span{font-size:12px;display:block;color:#687e59}.selfplay-visual strong{display:block;font-size:11px;font-weight:400;color:#839171;margin-top:8px}.training-progress-label{display:flex;justify-content:space-between;font-size:12px;margin-top:22px}.training-progress-label>span{color:#80916b}.training-track{height:8px;border-radius:6px;background:#edf1e6;margin-top:11px;overflow:hidden}.training-track>div{height:100%;width:0;background:#8ba56c;transition:width .2s}.training-live>p{font-size:12px;line-height:1.8;color:#65755b;margin-top:16px;min-height:45px}.training-recent{font-size:11px;line-height:1.8;color:#7c8a6a;margin-top:13px;padding-top:15px;border-top:1px solid #e8ede0}.training-save{display:flex;align-items:center;gap:8px;font-size:10px;color:#7b8c69;margin-top:19px}.training-save svg{width:15px!important;height:15px!important}.benchmark-card{padding:26px}.benchmark-card h2{margin-top:10px}.benchmark-empty{display:flex;align-items:center;gap:15px;margin:25px 0;padding:22px;background:#f6f8f0;border:1px dashed #dfe6d4;border-radius:7px}.benchmark-empty>span{font-size:38px;color:#8da377}.benchmark-empty strong{font-size:13px}.benchmark-empty p{font-size:11px;color:#839271;margin-top:6px}.benchmark-summary{display:grid;grid-template-columns:1fr 1.5fr 1fr;margin:25px 0 17px;gap:20px}.benchmark-summary>div:not(:first-child){padding-left:24px;border-left:1px solid #e5ebdd}.benchmark-summary>div>span{font-size:9px;letter-spacing:1px;color:#7e9068}.benchmark-summary strong{display:block;font-size:37px;font-family:var(--font);font-weight:700;letter-spacing:-1.5px;margin:9px 0}.benchmark-summary i{font-style:normal;font-size:18px;font-weight:400;color:#a3b190;letter-spacing:0}.benchmark-summary small{font-size:11px;color:#6b7e58}.benchmark-summary strong.wdl{font-size:30px;letter-spacing:-1px;line-height:1.4}.wdl-track{height:7px;background:#e9eddf;border-radius:5px;display:flex;overflow:hidden;margin-bottom:18px}.wdl-track span:nth-child(1){background:#6f8f51}.wdl-track span:nth-child(2){background:#c5d2af}.wdl-track span:nth-child(3){background:#c9a390}.memory-actions{display:flex;gap:9px}.memory-actions .secondary-button{font-size:11px}.benchmark-card #training-chart{margin-top:20px}.training-help .muted{font-size:11px}
@media(max-width:980px){.training-grid{grid-template-columns:1fr}.benchmark-summary{grid-template-columns:1fr 1fr 1fr;gap:12px}.benchmark-summary>div:not(:first-child){padding-left:12px}.benchmark-summary strong.wdl{font-size:26px}}
@media(max-width:560px){.training-state-pill{font-size:9px;padding:8px;white-space:normal;max-width:110px;margin-top:8px}.training-controls,.training-live,.benchmark-card{padding:19px}.training-fields{gap:0 10px}.training-fields .form-label{font-size:11px}.selfplay-visual{gap:14px}.selfplay-visual>span{font-size:45px}.benchmark-card .card-heading{align-items:start}.benchmark-card .secondary-button{padding:10px;font-size:11px;margin-top:10px;gap:5px}.benchmark-card .card-heading h2{font-size:15px;line-height:1.6}.benchmark-summary{gap:8px}.benchmark-summary strong{font-size:28px}.benchmark-summary strong.wdl{font-size:21px;letter-spacing:-1px}.benchmark-summary i{font-size:13px}.benchmark-summary small{font-size:9px;line-height:1.8;display:block}.benchmark-summary>div>span{font-size:8px;letter-spacing:.5px}.benchmark-summary>div:not(:first-child){padding-left:8px}.memory-actions{flex-direction:column;gap:5px}.memory-actions .secondary-button{padding:8px;font-size:10px}.selfplay-visual>div span{font-size:11px}.training-buttons{gap:7px}.training-buttons button{font-size:11px;padding:12px}.nav-item{min-width:34px;padding:9px}.training-state-pill .small-dot{display:none}}
/* Interface r2 - engine remains 1.0. */
[hidden]{display:none!important}.mobile-revision{display:none}.nav-label{font:inherit}.board-with-eval{display:flex;align-items:stretch;gap:9px}.board-with-eval .board-wrapper{flex:1;min-width:0}.eval-pane{width:32px;display:flex;flex-direction:column;align-items:center;gap:7px;padding-bottom:0}.eval-score{font-size:11px;font-weight:700;white-space:nowrap;color:#334b34;line-height:16px}.eval-track{position:relative;width:13px;flex:1;min-height:80px;background:#253b31;border:1px solid #5e7559;border-radius:4px;overflow:hidden}.eval-track>div{position:absolute;bottom:0;left:0;right:0;height:50%;background:#f5f1de;transition:height .25s}.eval-track.flipped{transform:rotate(180deg)}.eval-state{font-size:8px;color:#66755b;text-align:center;line-height:1.3;max-width:39px;overflow-wrap:anywhere}.eval-toggle{display:flex;align-items:center;gap:7px;min-height:42px;color:#4e6542;font-size:12px;cursor:pointer}.eval-toggle input{width:17px;height:17px;accent-color:#4e7140;cursor:pointer}.board-toolbar{flex-wrap:wrap;gap:4px 12px;padding:6px 0 12px}.board-toolbar .game-mode{margin-left:auto}.board-toolbar>div{margin-left:auto}.square{touch-action:none}.square.drag-source .piece{opacity:.25}.square.drop-target{box-shadow:inset 0 0 0 3px #385c37}.piece-ghost{position:fixed;z-index:1000;pointer-events:none;transform:translate(-50%,-50%);display:grid;place-items:center;filter:drop-shadow(0 8px 6px #15281d45)}.piece-ghost .piece{width:95%;height:95%}.icon-button{min-width:38px;min-height:38px}.text-button{min-height:38px;font-size:12px}.player-identity strong{font-size:15px}.player-detail{font-size:12px}.elo-value>span:last-child{font-size:9px;letter-spacing:.4px;max-width:73px;line-height:1.5}.elo-label{font-size:11px}.engine-card .elo-change{max-width:100px;line-height:1.6;text-align:right}.moves-list{height:175px}.move-row{font-size:14px;padding:11px 19px}.moves-table-head{font-size:10px}.analysis-footer{font-size:11px;line-height:1.6;gap:8px}.analysis-footer>span:last-child{font-size:12px}.turn-pill{font-size:12px}.learning-note,.panel-link{font-size:12px}.sidebar-note h3{font-size:14px}.sidebar-footer{font-size:9px}.history-game{width:100%;text-align:left;background:transparent;color:inherit;border-radius:5px;cursor:pointer}.history-game:disabled{opacity:.7;cursor:default}.history-game .history-elo{font-size:10px;white-space:nowrap}.history-row strong{font-size:12px}.history-row small{font-size:11px;line-height:1.65}.history-archive-note{font-size:11px;line-height:1.7;color:#65745b;margin-top:4px}.archive-summary{background:#eaf0e1;color:#47653b;border:1px solid #dce6ce;border-radius:7px;padding:13px 17px;font-size:12px;line-height:1.8;margin-bottom:23px}.archive-layout{display:grid;grid-template-columns:minmax(280px,.85fr) minmax(320px,1.15fr);gap:24px;align-items:start}.archive-browser,.replay-card{padding:22px}.archive-filters{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:21px 0}.archive-filters label{display:block;font-size:11px;margin-bottom:7px;color:#536a45}.archive-filters input,.archive-filters select{min-width:0;width:100%;border:1px solid #dce5d3;border-radius:6px;padding:10px;font-size:12px;min-height:41px;background:#fafcf6;color:#4a633e}.archive-search{grid-column:1/-1}.archive-list{display:flex;flex-direction:column;gap:8px;max-height:655px;overflow:auto;scrollbar-width:thin}.archive-entry{position:relative;text-align:left;padding:13px 16px;border:1px solid #e1e7d8;border-radius:7px;background:#fff;display:flex;flex-direction:column;gap:6px;flex-shrink:0}.archive-entry.selected-entry{background:#f1f6e8;border-color:#a8bd8b}.archive-entry-kind{font-size:10px;letter-spacing:.5px;color:#72865f}.archive-entry strong{font-size:14px}.archive-entry strong>span{float:right;color:#577746}.archive-entry small{font-size:11px;color:#6a7a5a}.archive-entry-reason{font-size:11px;color:#6b7d5d}.archive-pagination{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-top:18px}.archive-pagination button{padding:9px 11px;font-size:11px}.archive-pagination>span{font-size:11px;color:#718261}.archive-empty{text-align:center;padding:35px 10px;line-height:1.8;color:#667c51}.archive-empty>span{display:block;font-size:36px;color:#879e6e}.archive-empty strong{display:block;font-size:13px;margin:9px 0}.archive-empty p{font-size:12px}.replay-card{position:sticky;top:20px}.replay-detail{font-size:12px;line-height:1.75;margin:12px 0 18px;color:#687b57}.replay-board{border-radius:5px}.replay-board .square{touch-action:pan-y}.replay-rank,.replay-file{position:absolute;z-index:3;font-size:9px;color:#32472d;font-weight:600}.replay-rank{top:3px;left:4px}.replay-file{bottom:2px;right:4px}.square.dark .replay-rank,.square.dark .replay-file{color:#f3f4db}.replay-actions{display:flex;align-items:center;justify-content:space-between;gap:4px;margin:15px 0}.replay-actions .icon-button{font-size:17px;background:#f3f6ec}.replay-actions .secondary-button{font-size:11px;padding:10px}.replay-step{display:block;font-size:12px;color:#506843;margin-bottom:10px;line-height:1.8}.replay-card input[type=range]{width:100%;accent-color:#62854a;cursor:pointer;height:27px}.replay-moves{display:flex;flex-wrap:wrap;gap:4px;padding-top:15px;margin-top:10px;border-top:1px solid #e6eddd;max-height:180px;overflow:auto}.replay-move{padding:8px 10px;border-radius:4px;font-size:13px;background:#f7f9f3;color:#425e38;min-height:34px}.replay-move>span{font-size:11px;color:#8a9976;margin-right:6px}.replay-move.current{background:#dce9c7;color:#34532b;font-weight:600}.guide-intro{display:flex;justify-content:space-between;align-items:center;gap:30px;padding:34px 40px;background:#233f30;color:#edf3e2}.guide-intro h2{font-size:29px;line-height:1.35;margin:14px 0}.guide-intro p{font-size:13px;line-height:1.9;max-width:620px;color:#b7cba5}.guide-intro .section-label{color:#b3cb95}.guide-intro>span{font-family:Georgia,serif;font-size:105px;color:#c5dca9}.guide-contents{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;margin:22px 0}.guide-contents a{padding:10px 13px;border:1px solid #dfe7d4;border-radius:6px;background:#fff;color:#577346;font-size:12px}.guide-section{padding:28px;margin-bottom:21px;scroll-margin-top:20px}.guide-section>h2{font-size:23px;margin:13px 0 19px;line-height:1.45}.guide-section h3{font-size:16px;margin:15px 0 10px;letter-spacing:-.3px}.guide-section p{font-size:14px;line-height:1.9;color:#596d4a;margin-top:12px}.guide-two-columns{display:grid;grid-template-columns:1fr 1fr;gap:30px}.guide-steps{padding-left:24px;line-height:1.9;font-size:14px;color:#596d4a}.guide-steps li{padding:7px 0 7px 7px}.guide-steps strong{color:#334f2c}.guide-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:23px}.glossary{display:grid;grid-template-columns:1fr 1fr;gap:16px 25px;margin:0}.glossary>div{background:#f6f8f1;border:1px solid #e4ebda;border-radius:7px;padding:17px}.glossary dt{font-weight:700;font-size:14px;color:#415d35;margin-bottom:10px}.glossary dd{margin:0;font-size:13px;line-height:1.9;color:#61744f}.guide-example,.guide-callout{background:#edf3e3;border:1px solid #d8e4c6;border-radius:7px;padding:17px 20px;margin:20px 0;color:#456636;font-size:14px;line-height:1.8}.guide-example span{display:block;font-size:12px;margin-top:7px}.guide-callout p{font-size:13px;margin-top:6px}
@media(max-width:1100px){.archive-layout{grid-template-columns:1fr 1fr;gap:18px}.archive-browser,.replay-card{padding:18px}.replay-actions{flex-wrap:wrap}.replay-actions .secondary-button{margin-left:auto}.board-toolbar .game-mode{display:none}.guide-intro{padding:28px}}
@media(max-width:800px){.archive-layout{grid-template-columns:1fr}.replay-card{position:static;max-width:600px;width:100%;margin:0 auto}.archive-list{max-height:340px}.guide-two-columns,.glossary{grid-template-columns:1fr}.guide-two-columns{gap:12px}.guide-section{padding:24px}.guide-section p,.guide-steps{font-size:13px}.guide-intro>span{font-size:82px}.guide-contents{margin-top:20px}}
@media(max-width:560px){.sidebar{display:block;height:61px;padding:12px 16px}.brand{justify-content:flex-start;width:max-content;font-size:24px}.mobile-revision{display:block;position:absolute;right:16px;top:25px;color:#b3c99a;font-size:10px}.sidebar nav{position:fixed;left:0;right:0;bottom:0;z-index:30;display:grid;grid-template-columns:repeat(5,1fr);gap:3px;margin:0;background:#172c25;padding:7px 6px calc(7px + env(safe-area-inset-bottom));box-shadow:0 -3px 12px #18322212;border-top:1px solid #3b513e}.nav-item{font-size:10px;line-height:1.2;flex-direction:column;gap:5px;padding:7px 3px;min-height:49px;min-width:0;text-align:center;border-radius:6px}.nav-label{display:block!important}.nav-item .nav-arrow{display:none}.nav-item span[data-icon] svg{width:17px;height:17px}.topbar{min-height:49px;height:auto;gap:8px;flex-wrap:wrap;padding:10px 16px}.breadcrumb{font-size:11px}.save-state{font-size:10px!important}.topbar-right{margin-left:auto}main{padding:23px 13px 100px}.page-heading h1{font-size:24px}.page-heading p{font-size:12px;max-width:none}.page-heading .primary-button,.page-heading .secondary-button{font-size:12px}.player-row{height:67px}.player-detail{font-size:11px}.turn-pill{font-size:11px;padding:7px}.board-surface{padding:0 10px}.board-with-eval{gap:6px}.eval-pane{width:25px}.eval-score{font-size:9px}.eval-state{font-size:7px}.eval-track{width:10px}.rank-labels,.file-labels{font-size:10px}.eval-toggle{font-size:12px}.board-toolbar>div{margin-left:0;flex:1;justify-content:flex-end}.board-toolbar{gap:0 7px}.icon-button{min-width:40px;min-height:40px}.text-button{font-size:11px;min-height:40px;padding:5px}.status-banner strong{font-size:12px}.status-banner div>span{font-size:11px}.toast{bottom:calc(83px + env(safe-area-inset-bottom));line-height:1.6}.page-footer{font-size:10px}.guide-intro{padding:23px;gap:15px}.guide-intro h2{font-size:23px}.guide-intro p{font-size:12px}.guide-intro>span{font-size:61px}.guide-contents a{font-size:12px;padding:10px 12px}.guide-section{padding:21px}.guide-section>h2{font-size:21px}.guide-section p,.guide-steps{font-size:13px}.glossary>div{padding:15px}.guide-actions button{font-size:12px}.archive-browser,.replay-card{padding:17px}.archive-filters{gap:11px}.archive-summary{font-size:12px;padding:12px 14px}.archive-entry strong{font-size:15px}.archive-entry small,.archive-entry-reason{font-size:12px}.archive-pagination button{font-size:11px;padding:10px 8px}.replay-actions .icon-button{min-width:36px;min-height:40px;width:36px}.replay-actions .secondary-button{font-size:11px}.history-game .history-elo{font-size:10px;max-width:80px;text-align:right;white-space:normal}.history-row small{font-size:11px}.history-archive-note{font-size:11px}}
.replay-moves{position:relative}.history-game:disabled .history-elo{color:#788b67}.guide-section{outline:none}.guide-section:focus-visible{outline:3px solid #9ebc7b;outline-offset:3px}

/* Friendly interface revision: clear type, warm colors and roomy mobile controls. */
:root{--bg:#fff8f0;--paper:#fff;--ink:#2d2520;--muted:#67594f;--green:#b84920;--dark:#2d2925;--line:#e9ddd0;--mint:#fff0e0;--accent:#f3bf84;--board-light:#f1dfbf;--board-dark:#ad805b;--primary:#b84920;--teal:#25665d;--font:'Pumpkin Sans',ui-rounded,'Segoe UI',Arial,sans-serif}
html{scroll-behavior:smooth;scroll-padding-top:24px}
body{font-family:var(--font);font-size:14px;line-height:1.55;-webkit-text-size-adjust:100%}
h1,h2,h3,.brand,.elo-value>span:first-child,.engine-stats strong,.stat-card strong,.benchmark-summary strong{font-family:var(--font)}
h1{font-size:34px;font-weight:700;letter-spacing:-1.1px}h1>span{color:var(--primary)}h2{font-size:19px;line-height:1.4;letter-spacing:-.4px}h3{font-size:16px;line-height:1.5}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,.guide-section:focus-visible{outline-color:var(--primary)}
.sidebar{width:240px;padding:29px 19px 21px;background:var(--dark);color:#fff5e9}
.brand{gap:9px;font-size:28px;font-weight:700;letter-spacing:-1.2px;padding:0 4px;white-space:nowrap}
.brand-mark{background:transparent;width:43px;height:46px;display:grid;place-items:center;flex-shrink:0}.brand-mark img,.brand-mark svg{width:43px;height:46px;object-fit:contain}.brand-dot{color:#f2a052}
.workspace-label{font-size:10px;letter-spacing:1.1px;color:#d6c9ba;margin:35px 11px 15px}
.nav-item{gap:12px;padding:13px 14px;border-radius:11px;font-size:14px;color:#ded3c6;font-weight:600;min-height:48px}.nav-item.active{background:#51382a;color:#fff3e3;box-shadow:inset 3px 0 #efa459}.nav-arrow{color:#ffc185;font-size:19px}
.sidebar-note{padding:19px 16px;border-color:#5a4a3a;border-radius:14px;background:#38312a}.tiny-stars{color:#ffc78a}.sidebar-note h3{font-size:14px;color:#fff5e9;margin:10px 0 8px}.sidebar-note p,.local-label{color:#ded1c1}.sidebar-note p{font-size:12px}.local-label{font-size:11px}.note-line{background:#5a4a3a}.sidebar-footer{font-size:10px;color:#d3c4b1}.small-dot{background:#6ea991}
.main-shell{margin-left:240px;width:calc(100% - 240px);min-width:0}.topbar{min-height:76px;height:auto;padding:15px 35px;gap:20px;background:#fffdf9}.breadcrumb{font-size:13px}.breadcrumb strong{color:var(--ink);font-weight:600}.breadcrumb span{color:#b6a391}.topbar-right{gap:16px}.save-state{font-size:12px;color:var(--muted);line-height:1.5}.avatar{width:36px;height:36px;background:var(--mint);border-color:#efcba9;font-size:11px;color:#874324;flex-shrink:0}
.mobile-nav,.topbar-mobile-brand{display:none}.mobile-revision{display:none}
main{padding:32px 35px 0}.page-heading{gap:22px;margin-bottom:27px}.eyebrow,.section-label{font-size:11px;letter-spacing:1px;color:#875339;font-weight:600}.page-heading p{font-size:14px;color:var(--muted);margin-top:11px;line-height:1.75}
.primary-button,.secondary-button{display:inline-flex;padding:12px 19px;border-radius:10px;font-size:14px;min-height:46px;gap:9px}.primary-button{background:var(--primary);color:#fff}.secondary-button{border-color:#d8c6b4;background:#fff;color:#4e3f33}.primary-button svg{width:18px!important;height:18px!important}
.game-layout{grid-template-columns:minmax(310px,650px) minmax(280px,330px);gap:25px}.board-surface,.card{border-radius:16px;box-shadow:0 5px 18px #61351e05}.board-surface{padding:0 19px}.player-row{height:auto;min-height:75px;padding:8px 3px;gap:12px}.player-identity{gap:10px;min-width:0}.player-identity strong{font-size:15px}.player-detail{font-size:12px;color:var(--muted)}.player-avatar{width:39px;height:41px;border-radius:10px;flex-shrink:0}.engine-avatar,.engine-logo{background:#fff1df;color:#92512a}.engine-avatar img,.engine-avatar svg{width:34px;height:37px;object-fit:contain}.human-avatar{background:#f8f4ee;border-color:var(--line)}.human-avatar svg{color:#706354}
.turn-pill{border-color:var(--line);border-radius:7px;font-size:12px;padding:6px 9px;color:var(--muted);white-space:nowrap}.your-turn{background:#eaf4ef;border-color:#bed7cb;color:var(--teal)}.thinking-pill{background:var(--mint);color:#8a4825}.chessboard{border-radius:5px;border-color:#8e6548}.square.last:after{background:#efb245;opacity:.35}.square.selected{background:#f4bc66!important}.square.selected:after{border-color:#9b471e}.square.check{background:#ce7963!important}.legal-dot{background:#65412299}.legal-capture{border-color:#63412680}.rank-labels,.file-labels{font-size:11px;color:#675346;font-weight:600}.file-labels{bottom:-21px}.bottom-player{height:auto;min-height:71px;margin-top:22px}.square.drop-target{box-shadow:inset 0 0 0 3px #ac501d}
.board-toolbar{gap:4px 9px;padding:6px 0 14px}.game-mode{font-size:12px;color:var(--muted)}.icon-button{color:#685242;border-radius:8px;width:44px;height:44px;min-width:44px;min-height:44px}.icon-button.small{width:38px;height:38px;min-width:38px;min-height:38px;padding:7px;color:var(--muted)}.icon-button.small svg{width:18px!important;height:18px!important}.text-button{font-size:12px;color:#6b4834;min-height:44px;padding:7px 8px}.text-button svg{width:16px!important;height:16px!important}.eval-toggle{font-size:13px;color:#62432e;min-height:44px}.eval-toggle input{width:18px;height:18px;accent-color:var(--primary)}.eval-score{color:var(--ink)}.eval-track{background:#332b26;border-color:#8a7563;border-radius:5px;width:14px}.eval-track>div{background:#fff6e5}.eval-state{font-size:9px;color:var(--muted)}
.status-banner{background:#fff1df;border-color:#efcfac;border-radius:12px;padding:15px}.status-icon{color:#9d5730}.status-banner strong{font-size:13px}.status-banner div>span{font-size:12px;color:var(--muted);line-height:1.6}.keyboard-note{font-size:11px;color:var(--muted)}.game-panel{gap:19px;min-width:0}.engine-card{padding:22px 22px 0}.card-heading{gap:15px}.engine-title{gap:10px;margin-top:13px;min-width:0}.engine-title h2{font-size:17px}.engine-logo{width:47px;height:49px;border-radius:11px;flex-shrink:0}.engine-logo img,.engine-logo svg{width:41px;height:45px;object-fit:contain}.version{font-size:11px;background:var(--mint);color:#8f4626;border-radius:5px;padding:3px 6px;font-weight:600}.engine-state{font-size:12px;color:var(--teal)}.learning-badge{font-size:10px;color:var(--teal);border-color:#c4dbd0;background:#eaf4ef;border-radius:6px;padding:5px 7px}
.elo-section{gap:12px;margin-top:21px}.elo-label{font-size:12px;color:var(--muted)}.elo-value{gap:9px;margin-top:5px}.elo-value>span:first-child{font-size:45px;letter-spacing:-1.7px;line-height:1.15;font-variant-numeric:tabular-nums}.elo-value>span:last-child{font-size:11px;color:var(--muted);max-width:90px;line-height:1.5}.elo-change{font-size:12px;color:var(--teal);background:#eaf4ef;border-radius:7px;max-width:110px;line-height:1.5;padding:6px 8px}.elo-change.negative{color:#99503b;background:#fff0e8}.chart-container{height:86px;margin:15px -2px 12px}.chart-empty{font-size:12px;color:var(--muted);padding:15px;background:#fffaf4;border-color:#e6cdb3;border-radius:9px;line-height:1.65}
.engine-stats{border-color:var(--line);padding-top:17px}.engine-stats>div:last-child{border-color:var(--line);padding-left:18px}.engine-stats strong{font-size:23px;font-variant-numeric:tabular-nums}.engine-stats span{font-size:12px;color:var(--muted)}.learning-note{background:#fff8ef;border-radius:9px;padding:12px;margin-top:18px;font-size:12px;color:var(--muted);line-height:1.75}.panel-link{font-size:13px;color:#9a4521;font-weight:600;border-color:var(--line);min-height:47px}.moves-header h2{font-size:16px;letter-spacing:0}.muted{font-size:12px;color:var(--muted)}.moves-table-head{font-size:11px;font-weight:600;color:#705747;background:#fff8ef;border-color:var(--line)}.moves-list{height:185px;scrollbar-color:#d7b99b transparent}.moves-empty{color:var(--muted);padding:19px}.moves-empty>span{color:#b2815b}.moves-empty strong{font-size:13px}.moves-empty p{font-size:12px;color:var(--muted)}.move-row{font-size:14px;border-color:#f5ebe1}.move-row:nth-child(even){background:#fffaf5}.move-row>span:first-child{font-size:12px;color:var(--muted)}.move-row>span.latest{color:#a14420}.analysis-footer{font-size:11px;color:var(--muted);line-height:1.6}.analysis-footer>span:last-child{font-size:12px;color:#78472d}.elo-disclaimer{font-size:12px;color:var(--muted);line-height:1.75}.page-footer{font-size:11px;color:var(--muted);line-height:1.7;gap:14px;padding:19px 0 24px}
.progress-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.stat-card{padding:22px}.stat-card>span{font-size:13px;color:var(--muted)}.stat-card strong{font-size:32px;letter-spacing:-.8px;font-variant-numeric:tabular-nums}.stat-card small{font-size:12px;color:var(--muted);line-height:1.65;display:block}.subtle-badge{font-size:11px;color:#8b4c28;background:var(--mint);border-radius:6px;line-height:1.5}.chart-caption{font-size:13px;color:var(--muted);line-height:1.85}.large-chart-empty{min-height:220px;height:auto;padding:22px;text-align:center;border-color:#e4c9aa;border-radius:11px;background:#fffaf3;color:var(--muted)}.large-chart-empty>span{color:#b58055}.large-chart-empty strong{font-size:15px}.large-chart-empty p{font-size:13px;line-height:1.7}.weights-card>p{font-size:13px;color:var(--muted);line-height:1.85}.weight-row>div:first-child{font-size:13px;color:#6e4831}.weight-track{height:7px;background:#faead8}.weight-fill{background:#d78541}.history-empty{font-size:14px;color:var(--muted);line-height:1.9}.history-row{border-color:var(--line);padding:14px 0}.result-symbol{width:34px;height:34px;border-radius:9px;background:var(--mint);color:#8d4a28;flex-shrink:0}.history-row strong{font-size:13px}.history-row small{font-size:12px;color:var(--muted);line-height:1.7}.history-elo{color:var(--teal)}.history-game .history-elo{font-size:12px;max-width:92px;text-align:right;white-space:normal;flex-shrink:0}.history-archive-note{font-size:12px;color:var(--muted);line-height:1.8}.storage-callout{border-color:#e5cdb0;border-radius:12px;background:#fff1df;color:#71523c;font-size:13px;line-height:1.85}
.training-state-pill{background:#eaf4ef;border-color:#c0d9ce;color:var(--teal);border-radius:9px;font-size:13px;line-height:1.6;white-space:normal}.training-intro,.training-help,.benchmark-intro{font-size:14px;line-height:1.85;color:var(--muted)}.training-fields,.benchmark-fields,.benchmark-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.training-fields .form-label,.form-label{font-size:14px;color:#493c31;line-height:1.6}.training-help{font-size:13px}.training-controls .text-button{text-underline-offset:3px}.selfplay-visual{background:#fff5e8;border-color:#eed8bd;border-radius:12px}.selfplay-visual>span{color:#aa5c2b}.selfplay-visual>span:last-child{color:#55816b}.selfplay-visual>div span{font-size:14px;color:#764725}.selfplay-visual strong{font-size:12px;color:var(--muted)}.training-progress-label{font-size:14px;gap:15px}.training-progress-label>span{color:var(--muted)}.training-track{height:10px;border-radius:8px;background:#f8e4cf}.training-track>div{background:#c1642c}.training-live>p{font-size:14px;color:var(--muted);line-height:1.85}.training-recent{font-size:13px;color:var(--muted);border-color:var(--line)}.training-save{font-size:12px;color:var(--teal)}.benchmark-card{padding:27px}.benchmark-empty{background:#fff6e8;border-color:#ddb68b;border-radius:12px}.benchmark-empty>span{color:#ab713f}.benchmark-empty strong{font-size:15px}.benchmark-empty p{font-size:13px;color:var(--muted);line-height:1.75}
select,input[type=number],input[type=search],input[type=date],.archive-filters input,.archive-filters select{width:100%;min-width:0;border:1px solid #cbb6a0;border-radius:10px;background:#fffdfa;color:#3d3128;padding:12px 13px;font-size:16px;min-height:48px;line-height:1.4}select{padding-right:30px;text-overflow:ellipsis}select:disabled,input:disabled{background:#f6efe7;color:#776657}.form-help{font-size:13px!important;color:var(--muted);line-height:1.85!important}
.benchmark-summary{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr);gap:22px;margin:25px 0 20px}.benchmark-summary>div{min-width:0}.benchmark-summary>div:not(:first-child){padding-left:22px;border-color:var(--line)}.benchmark-summary>div>span{font-size:11px;letter-spacing:.7px;color:var(--muted);font-weight:600}.benchmark-summary strong{font-size:41px;letter-spacing:-1.5px;font-variant-numeric:tabular-nums;line-height:1.35}.benchmark-summary small{font-size:13px;color:var(--muted);line-height:1.8;display:block}.benchmark-summary i{color:var(--muted)}.benchmark-summary strong.wdl{font-size:30px;white-space:nowrap}.benchmark-card #training-chart{min-height:210px}.wdl-track{height:11px;border-radius:8px;background:#f0e2d1}.wdl-track span:nth-child(1){background:#347568}.wdl-track span:nth-child(2){background:#efd6a5}.wdl-track span:nth-child(3){background:#c97b5a}.memory-actions{flex-wrap:wrap}.memory-actions .secondary-button{font-size:13px}
.benchmark-wdl,.history-wdl,.match-scoreboard{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:13px 0 17px}.benchmark-wdl>span,.history-wdl>span,.match-metric{padding:13px 7px;text-align:center;border:1px solid #ead5bf;border-radius:10px;background:#fff7ed;min-width:0}.benchmark-wdl strong,.history-wdl strong,.match-metric strong{display:block;font-size:26px!important;line-height:1.3;font-weight:700;letter-spacing:-.6px;font-variant-numeric:tabular-nums;color:var(--ink);margin:0}.benchmark-wdl small,.history-wdl small,.match-metric span{display:block;font-size:11px!important;color:var(--muted);margin-top:6px;line-height:1.6}.benchmark-wdl .wdl-wins,.history-wdl .wdl-wins{background:#eef7f0;border-color:#c7ddcc}.benchmark-wdl .wdl-losses,.history-wdl .wdl-losses{background:#fff0e7;border-color:#edceba}.benchmark-model-caption,.model-option-note{font-size:13px;line-height:1.85;color:var(--muted);padding:13px 16px;background:#fff6e9;border:1px solid #eed8ba;border-radius:10px;margin-top:14px}
.benchmark-history-card,.benchmark-history-item{border:1px solid var(--line);border-radius:13px;padding:17px 18px;margin-top:13px;background:#fffdfa;min-width:0}.benchmark-history-heading{display:flex;gap:15px;justify-content:space-between;align-items:flex-start}.benchmark-history-heading>div:first-child{min-width:0}.benchmark-history-heading strong{font-size:14px;line-height:1.65;display:block}.benchmark-history-heading small{font-size:12px;line-height:1.8;color:var(--muted);display:block;margin-top:6px}.benchmark-history-result{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0;min-width:70px}.benchmark-history-result strong{font-size:26px;font-variant-numeric:tabular-nums;letter-spacing:-.8px;line-height:1.2;color:#8b4524}.benchmark-history-result small{font-size:11px;text-align:right;margin-top:5px}.history-wdl{gap:7px;margin:14px 0 10px}.history-wdl>span{padding:10px 5px}.history-wdl strong{font-size:23px!important}.benchmark-history-details{font-size:12px;line-height:1.85;color:var(--muted);margin-top:11px}.benchmark-history-details summary{font-size:12px;font-weight:600;color:#8c4d2c;cursor:pointer;min-height:35px;display:list-item;padding:6px 0}.benchmark-history-details p{margin-top:8px}.rating-hero{background:#fff1df;border:1px solid #eed0aa;border-radius:14px;padding:23px;margin:22px 0}.rating-hero strong{display:block;font-size:45px;font-variant-numeric:tabular-nums;letter-spacing:-1.5px;line-height:1.2}.rating-hero p,.rating-hero small{font-size:13px;line-height:1.8;color:var(--muted);margin-top:8px}.page-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:21px}.page-tabs button,.page-tabs a{padding:11px 16px;border-radius:10px;border:1px solid #dfc6aa;background:#fff;color:#76482c;font-size:14px;font-weight:600;min-height:44px}.page-tabs .active{background:var(--primary);color:#fff;border-color:var(--primary)}
.archive-summary{background:#fff0dc;color:#74492b;border-color:#e9c59e;border-radius:12px;font-size:14px}.archive-layout{grid-template-columns:minmax(300px,.9fr) minmax(320px,1.1fr)}.archive-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.archive-filters label{font-size:13px;font-weight:600;color:#584434;margin-bottom:8px}.archive-list{gap:11px;max-height:720px;scrollbar-color:#d5b08c transparent}.archive-entry{padding:16px 17px;border-color:#deccba;border-radius:12px;gap:8px;line-height:1.65}.archive-entry.selected-entry{background:#fff5e6;border-color:#c36a34}.archive-entry.selected-entry{box-shadow:inset 3px 0 var(--primary)}.archive-entry-kind{font-size:12px;color:#835433;font-weight:600}.archive-entry strong{font-size:15px}.archive-entry small,.archive-entry-reason{font-size:12px;color:var(--muted)}.archive-result-badge,.replay-outcome{align-self:flex-start;display:inline-block!important;border-radius:7px;font-size:13px!important;font-weight:600;padding:5px 9px;background:#f8eee1;color:#70543f;line-height:1.6}.result-win{color:#1c6153;background:#e4f2ea}.result-loss{color:#9c432b;background:#fff0e8}.result-draw{color:#735724;background:#fff1d6}.result-unknown{color:#62574a;background:#f1ede5}.archive-participants,.replay-participants{display:flex;flex-direction:column;gap:7px;margin:3px 0}.archive-participant{display:grid;grid-template-columns:58px minmax(0,1fr);align-items:start;gap:8px;font-size:13px;line-height:1.7;color:#483a30}.participant-color{font-size:12px;color:var(--muted);white-space:nowrap}.archive-participant>span:last-child{overflow-wrap:anywhere}.archive-pagination{gap:8px}.archive-pagination button{padding:10px 12px;font-size:12px}.archive-pagination>span{font-size:12px;color:var(--muted);white-space:nowrap}.archive-empty{color:var(--muted)}.archive-empty>span{color:#b57a43}.archive-empty strong{font-size:15px}.archive-empty p{font-size:13px}
.replay-detail{font-size:14px;color:var(--muted);line-height:1.85;margin:14px 0 20px}.replay-participants{margin-top:13px;padding:13px;background:#fff8ed;border:1px solid #f0dcc5;border-radius:10px}.replay-participants .archive-participant{font-size:14px}.replay-reason{display:block;margin-top:10px;font-size:13px;color:var(--muted)}.replay-board{border-radius:7px}.replay-rank,.replay-file{font-size:10px;color:#644324;font-weight:700}.square.dark .replay-rank,.square.dark .replay-file{color:#fff8e8}.replay-actions .icon-button{background:#fff4e4;font-size:18px}.replay-actions .secondary-button{font-size:13px;padding:10px 13px}.replay-step{font-size:14px;color:#69432b}.replay-card input[type=range]{accent-color:var(--primary);height:32px}.replay-move{padding:9px 10px;border-radius:7px;font-size:14px;background:#fff7ed;color:#704128;min-height:40px}.replay-move>span{font-size:12px;color:#826a56}.replay-move.current{background:#f7d1a4;color:#6c3217;font-weight:700}
.guide-intro,.about-hero{background:#2d4940;color:#fff7e9}.guide-intro{padding:33px 37px}.guide-intro h2{font-size:29px}.guide-intro p,.about-hero p{font-size:14px;color:#e1eadb;line-height:1.9}.guide-intro .section-label,.about-hero .section-label{color:#ffc98b}.guide-intro>span,.about-knight{color:#f1c086}.guide-intro>img{width:105px;height:115px;object-fit:contain}.guide-contents a{padding:11px 14px;border-color:#dfc4a8;border-radius:10px;color:#86502e;font-size:13px;font-weight:600;min-height:44px}.guide-section>h2{font-size:24px}.guide-section h3{font-size:17px}.guide-section p,.guide-steps{font-size:14px;color:var(--muted);line-height:1.9}.guide-steps strong{color:#4b3525}.glossary>div{background:#fff8ee;border-color:#eed9bf;border-radius:12px;padding:18px}.glossary dt{font-size:15px;color:#74462b}.glossary dd{font-size:14px;color:var(--muted);line-height:1.85}.guide-example,.guide-callout{background:#fff0da;border-color:#e8c195;border-radius:12px;color:#6d4226}.guide-example span{font-size:13px}.guide-callout p{font-size:14px}.about-grid p{font-size:14px;color:var(--muted);line-height:1.9}
dialog{border-color:#e2c5a5;border-radius:20px;box-shadow:0 20px 100px #4b2d1a40}dialog::backdrop{background:#251c1680}dialog p{font-size:14px;color:var(--muted);line-height:1.85}.side-options label>span{font-size:14px;border-color:#dec8b0;border-radius:11px}.side-options input:checked+span{background:#fff0db;border-color:#ba5b2a}.side-options input:focus-visible+span{outline-color:var(--primary)}.dialog-note{font-size:13px;background:#fff1dc;color:#82542d;border-radius:9px;padding:12px;line-height:1.75}.promotion-options button{font-size:12px;background:#fff1df;border-color:#e8c7a3;border-radius:10px}.toast{left:calc(50% + 120px);background:#3b3027;color:#fff6e9;font-size:14px;line-height:1.75;border-radius:12px;padding:14px 20px}
.mobile-menu{position:fixed;inset:0;z-index:60;background:#241d1780;display:flex;align-items:flex-end;padding:18px 14px calc(102px + env(safe-area-inset-bottom));backdrop-filter:blur(3px)}.mobile-menu-panel{background:#fffaf3;border:1px solid #e5c5a0;border-radius:19px;padding:21px;width:100%;max-width:520px;margin:0 auto;box-shadow:0 18px 65px #2f1d1430}.mobile-menu-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:13px}.mobile-menu-header h2{font-size:21px}#mobile-menu-close{width:44px;height:44px;min-width:44px;border-radius:10px;background:#ffecd4;font-size:23px;color:#76482b}.mobile-menu-links{display:flex;flex-direction:column;gap:9px}.mobile-menu-links button,.mobile-menu-links a{display:flex;align-items:center;gap:12px;width:100%;text-align:left;min-height:52px;border:1px solid #e5cbb0;border-radius:11px;padding:13px 15px;background:#fff;color:#5c3b27;font-size:16px;font-weight:600}.mobile-menu-links button.active{background:#ffe8cb;border-color:#c06c36}
@media(max-width:1250px){.sidebar{width:216px;padding-left:15px;padding-right:15px}.brand{font-size:25px;gap:7px}.main-shell{margin-left:216px;width:calc(100% - 216px)}.topbar{padding:15px 25px}main{padding:28px 25px 0}.game-layout{gap:20px;grid-template-columns:minmax(300px,1fr) minmax(260px,290px)}.engine-card{padding:19px 18px 0}.learning-badge{display:none}.keyboard-note{display:none}.toast{left:calc(50% + 108px)}.progress-stats{gap:12px}.stat-card{padding:18px}.archive-layout{grid-template-columns:1fr 1fr;gap:19px}}
@media(max-width:1100px){.sidebar{width:84px;height:100vh;padding:22px 12px}.brand{padding:0;justify-content:center}.brand>span:last-child,.workspace-label,.sidebar-note,.sidebar-footer,.nav-item>.nav-arrow{display:none}.sidebar nav{margin-top:30px;position:static;display:flex;background:transparent;box-shadow:none;border:0;padding:0;flex-direction:column}.nav-item{padding:14px;justify-content:center;font-size:0;gap:0;flex-direction:row}.nav-item .nav-label{display:none!important}.nav-item span[data-icon] svg{width:22px;height:22px}.main-shell{margin-left:84px;width:calc(100% - 84px)}.game-layout{grid-template-columns:1fr;max-width:850px;margin:auto}.board-column{width:100%;margin:auto}.game-panel{display:grid;grid-template-columns:1fr 1fr;align-items:start}.training-grid{grid-template-columns:1fr}.toast{left:calc(50% + 42px)}.about-hero{padding:30px;gap:25px}.about-knight{font-size:100px}.archive-browser,.replay-card{padding:19px}.game-mode{display:none}}
@media(max-width:850px){.sidebar{display:none}.main-shell{margin:0;width:100%}.topbar{min-height:74px;padding:12px 20px;gap:14px}.topbar-mobile-brand{display:flex;align-items:center;gap:8px;font-size:23px;letter-spacing:-.8px;font-weight:700;color:var(--ink);white-space:nowrap}.topbar-mobile-brand img,.topbar-mobile-brand svg{width:36px;height:40px;object-fit:contain}.breadcrumb{display:none}.topbar-right{margin-left:auto;gap:10px}.save-state{font-size:11px;max-width:175px}.avatar{width:33px;height:33px}.mobile-nav{position:fixed;left:0;right:0;bottom:0;z-index:50;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;background:#fffaf3;padding:7px 8px calc(7px + env(safe-area-inset-bottom));border-top:1px solid #dec6aa;box-shadow:0 -4px 22px #633e1610}.mobile-nav-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:59px;padding:8px 3px;border-radius:11px;background:transparent;color:#6c5340;font-size:12px;font-weight:600;line-height:1.3}.mobile-nav-item span[data-icon] svg{width:22px;height:22px}.mobile-nav-item.active,.mobile-nav-item[aria-expanded=true]{background:#ffead0;color:#963e1b}.mobile-nav-item .nav-label{display:block}.menu-toggle{display:flex}main{padding:28px 22px 108px}.page-heading h1{font-size:31px}.page-heading p{font-size:14px}.toast{left:50%;bottom:calc(96px + env(safe-area-inset-bottom));font-size:13px}.progress-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.stat-card{padding:20px}.archive-layout{grid-template-columns:1fr}.replay-card{position:static;max-width:640px;width:100%;margin:0 auto}.archive-list{max-height:480px}.guide-two-columns,.glossary{grid-template-columns:1fr}.guide-two-columns{gap:14px}.guide-intro{padding:28px}.guide-intro>span{font-size:83px}.guide-intro>img{width:85px;height:94px}.benchmark-summary{gap:15px}.benchmark-summary>div:not(:first-child){padding-left:15px}.benchmark-wdl{gap:6px}.benchmark-wdl>span{padding:12px 5px}.benchmark-wdl strong{font-size:24px!important}}
@media(max-width:600px){main{padding:24px 14px 105px}.topbar{padding:11px 16px;min-height:69px}.topbar-mobile-brand{font-size:22px}.topbar-mobile-brand img,.topbar-mobile-brand svg{width:32px;height:36px}.save-state{font-size:10px;max-width:145px}.topbar-right .avatar{display:none}.page-heading{align-items:flex-start;flex-wrap:wrap;gap:15px;margin-bottom:23px}.page-heading h1{font-size:28px;letter-spacing:-.9px}.eyebrow{font-size:10px;letter-spacing:1px}.page-heading p{font-size:14px;line-height:1.8;max-width:none}.page-heading>.primary-button,.page-heading>.secondary-button{font-size:14px;min-height:46px;padding:12px 16px;margin-top:0}.page-heading>.memory-actions{width:100%}.memory-actions{flex-direction:row;gap:9px}.memory-actions .secondary-button{flex:1;padding:11px 12px;font-size:13px}.game-layout{gap:18px}.game-panel{grid-template-columns:1fr;gap:17px}.board-surface{padding:0 10px;border-radius:13px}.player-row{height:auto;min-height:68px;padding:7px 1px;gap:8px}.player-avatar{width:34px;height:36px}.engine-avatar img,.engine-avatar svg{width:30px;height:33px}.player-identity{gap:8px}.player-identity strong{font-size:14px}.player-detail{font-size:11px}.turn-pill{font-size:11px;padding:6px 8px}.bottom-player{height:auto;min-height:65px;margin-top:21px}.board-wrapper{margin-left:15px}.rank-labels{left:-19px;width:15px;font-size:10px}.file-labels{font-size:10px}.board-with-eval{gap:5px}.eval-pane{width:26px;gap:5px}.eval-score{font-size:10px}.eval-state{font-size:8px}.eval-track{width:12px}.board-toolbar{gap:0 5px;padding-bottom:10px}.board-toolbar>div{margin-left:0;flex:1;justify-content:flex-end;gap:1px}.eval-toggle{font-size:12px}.icon-button{width:42px;height:44px;min-width:42px;min-height:44px}.text-button{font-size:12px;min-height:44px;padding:6px}.status-banner{padding:14px 13px;align-items:flex-start}.status-banner strong{font-size:13px}.status-banner div>span{font-size:12px}.engine-card{padding:20px 21px 0}.engine-title h2{font-size:18px}.learning-badge{display:block;font-size:9px}.elo-value>span:first-child{font-size:46px}.chart-container{height:92px}.progress-stats{gap:11px}.stat-card{padding:18px 16px}.stat-card strong{font-size:29px}.stat-card>span{font-size:12px}.stat-card small{font-size:11px}.growth-card,.weights-card,.history-card{padding:21px}.card-heading{align-items:flex-start;gap:10px}.card-heading h2{font-size:18px}.subtle-badge{font-size:10px;padding:5px 7px}.progress-grid{grid-template-columns:1fr;gap:18px}.large-chart-empty{min-height:220px}.chart-caption{font-size:13px}.storage-callout{padding:15px 16px;font-size:13px}.training-state-pill{font-size:12px;max-width:none;margin-top:0;padding:10px 13px}.training-state-pill .small-dot{display:inline-block}.training-grid{gap:18px}.training-controls,.training-live,.benchmark-card{padding:21px}.training-fields,.benchmark-fields,.benchmark-settings{grid-template-columns:1fr;gap:0}.training-fields .form-label{font-size:14px;margin-top:19px}.training-buttons{gap:9px}.training-buttons button{font-size:14px;padding:12px}.selfplay-visual{gap:19px;padding:22px 8px}.selfplay-visual>span{font-size:49px}.selfplay-visual>div span{font-size:13px}.selfplay-visual strong{font-size:12px}.benchmark-card .card-heading{flex-wrap:wrap;gap:13px}.benchmark-card .card-heading h2{font-size:21px;line-height:1.4}.benchmark-card .card-heading .secondary-button{font-size:14px;margin-top:0;padding:12px 16px}.benchmark-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:19px;margin-top:23px}.benchmark-summary>div:first-child{grid-column:1/-1;padding:19px 20px;background:#fff0dd;border:1px solid #edcca4;border-radius:13px}.benchmark-summary>div:first-child strong{font-size:45px;margin:7px 0}.benchmark-summary>div:not(:first-child){padding-left:0;border-left:0}.benchmark-summary>.benchmark-match{grid-column:1/-1}.benchmark-summary>.benchmark-sample{grid-column:1/-1;border-left:0;padding-left:0}.benchmark-summary strong{font-size:31px;letter-spacing:-.9px;margin:8px 0}.benchmark-summary small{font-size:13px;line-height:1.75}.benchmark-summary>div>span{font-size:11px;letter-spacing:.4px}.benchmark-wdl{gap:9px;margin:13px 0 0}.benchmark-wdl>span{padding:15px 7px}.benchmark-wdl strong{font-size:29px!important}.benchmark-wdl small{font-size:12px!important}.benchmark-history-card{padding:16px}.benchmark-history-heading{gap:12px}.benchmark-history-heading strong{font-size:14px}.benchmark-history-result strong{font-size:26px}.benchmark-card #training-chart{min-height:220px}.archive-browser,.replay-card{padding:19px}.archive-filters{grid-template-columns:1fr;gap:14px}.archive-search{grid-column:auto}.archive-filters label{font-size:14px}.archive-summary{font-size:13px;padding:13px 15px}.archive-entry{padding:15px}.archive-participant{grid-template-columns:55px minmax(0,1fr);font-size:13px;gap:7px}.archive-pagination{gap:7px}.archive-pagination button{font-size:12px;padding:10px;min-height:44px}.replay-actions{gap:5px}.replay-actions .icon-button{min-width:40px;width:40px;min-height:44px}.replay-actions .secondary-button{font-size:12px;margin-top:4px}.replay-detail{font-size:13px}.history-game .history-elo{font-size:11px;max-width:90px}.history-row strong{font-size:13px}.history-row small{font-size:12px}.history-archive-note{font-size:12px}.guide-intro{padding:24px;gap:18px}.guide-intro h2{font-size:25px}.guide-intro p{font-size:14px}.guide-intro>span{display:none}.guide-intro>img{width:63px;height:70px;align-self:flex-start}.guide-contents a{font-size:13px;padding:10px 12px}.guide-section{padding:22px}.guide-section>h2{font-size:22px}.guide-section p,.guide-steps{font-size:14px}.glossary>div{padding:17px}.guide-actions button{font-size:13px}.page-footer{font-size:11px;flex-wrap:wrap;line-height:1.8;margin-top:25px}.about-hero{padding:24px;gap:17px}.about-knight{font-size:70px}.about-hero h2{font-size:24px}.about-hero p{font-size:14px}.about-grid{grid-template-columns:1fr}.about-grid .card{padding:23px}.about-grid p{font-size:14px}}
@media(max-width:360px){.topbar-mobile-brand{font-size:20px;gap:6px}.save-state{max-width:130px;font-size:10px}.page-heading h1{font-size:25px}.board-toolbar .eval-toggle{width:100%;min-height:40px}.board-toolbar>div{justify-content:space-between}.engine-title{gap:8px}.learning-badge{display:none}.archive-pagination button{font-size:11px;padding:9px 7px}.mobile-nav-item{font-size:11px}.memory-actions{flex-direction:column}.benchmark-history-heading{flex-wrap:wrap}.benchmark-history-result{align-items:flex-start}.benchmark-history-result small{text-align:left}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{animation:none!important;transition:none!important}}
/* Standalone test page and menu behavior. */
.tests-layout{display:grid;grid-template-columns:minmax(270px,.95fr) minmax(330px,1.15fr);gap:22px;align-items:start}
.test-result-card{padding:25px}.test-history-card{padding:25px;margin:24px 0}
.test-primary-fields{grid-template-columns:1fr;margin-top:15px}.training-fields>div{min-width:0}
.test-progress{margin-top:23px}#test-status{font-size:14px;line-height:1.8;color:var(--muted);margin-top:15px}
.advanced-settings,.measurement-details{border-top:1px solid var(--line);margin-top:21px;padding-top:16px}
.advanced-settings summary,.measurement-details summary{font-size:14px;line-height:1.6;font-weight:600;color:#64442d;cursor:pointer;min-height:40px;padding:7px 0;touch-action:manipulation}
.advanced-settings>p{font-size:13px;line-height:1.8;color:var(--muted);margin:11px 0 16px}
.rating-hero{display:grid;grid-template-columns:minmax(200px,.8fr) 1.2fr;align-items:center;gap:30px;margin:0 0 24px}
.rating-number{display:flex;align-items:baseline;flex-wrap:wrap;gap:12px;margin:9px 0}
.rating-number>strong{font-size:56px;line-height:1.15;color:#85401f;letter-spacing:-1.8px}.rating-number>span{font-size:14px;color:#875239}.rating-explainer h2{font-size:19px;margin-bottom:9px}
.test-result-card .benchmark-summary{grid-template-columns:1fr;gap:18px;padding-top:15px}
.test-result-card .benchmark-summary>div{border:0;padding-left:0}.benchmark-primary>strong{font-size:45px;color:#884122}
.benchmark-sample{display:flex;align-items:baseline;flex-wrap:wrap;gap:9px}.benchmark-sample>span{width:100%}.benchmark-sample>strong{font-size:29px;margin:0}
.benchmark-history-heading>div:first-child{flex:1}.benchmark-history-result{font-size:26px;font-weight:700;text-align:right;line-height:1.2;color:#8b4524;font-variant-numeric:tabular-nums;letter-spacing:-.7px}.benchmark-history-result small{font-weight:400;letter-spacing:0}
.page-tabs>span{padding:10px 15px;border:1px solid #e3c9ac;border-radius:10px;background:#fff;color:#795131;font-size:13px;min-height:44px}.page-tabs .current{background:#ffead4;border-color:#d5a276;color:#883511;font-weight:700}
.primary-button,.secondary-button{white-space:normal;text-align:center;line-height:1.4}
.mobile-menu-backdrop{position:absolute;inset:0;width:100%;height:100%;z-index:0;background:transparent;border-radius:0}
.mobile-menu-panel{position:relative;z-index:1}.mobile-menu-link>span:nth-child(2){flex:1}.mobile-menu-link strong{display:block;font-size:16px}.mobile-menu-link small{display:block;font-size:12px;font-weight:400;line-height:1.7;color:var(--muted);margin-top:4px}.mobile-menu-panel>p{font-size:12px;color:var(--muted);line-height:1.8;margin-top:17px}body.menu-open{overflow:hidden}
.topbar-mobile-brand small{display:block;font-size:10px;font-weight:400;letter-spacing:.25px;color:#80614b;margin-top:3px}
@media(max-width:1120px){.tests-layout{grid-template-columns:1fr}.test-result-card #training-chart{max-width:850px}.benchmark-wdl{max-width:540px}.benchmark-summary>.benchmark-primary{max-width:600px}.benchmark-sample{max-width:600px}}
@media(max-width:850px){.mobile-menu{justify-content:center}.topbar-mobile-brand{line-height:1.2}.rating-hero{gap:22px}.game-panel>.elo-disclaimer,.game-panel>.wide{grid-column:1/-1}}
@media(max-width:600px){.tests-layout{gap:18px}.test-result-card,.test-history-card{padding:21px}.rating-hero{grid-template-columns:1fr;padding:22px;gap:18px}.rating-explainer{border-top:1px solid #e7c7a7;padding-top:17px}.rating-number>strong{font-size:55px}.rating-explainer h2{font-size:18px}.test-result-card .benchmark-summary{gap:19px}.test-result-card .benchmark-primary{padding:19px 20px;border:1px solid #edcca4}.benchmark-sample>strong{font-size:26px}.benchmark-history-result{font-size:25px}.page-tabs>span,.page-tabs>button{font-size:12px;padding:9px 12px}.mobile-menu{padding-bottom:calc(98px + env(safe-area-inset-bottom))}.topbar-mobile-brand img,.topbar-mobile-brand svg{width:34px;height:38px}}
.recent-game-description{flex:1;min-width:0}.recent-game-description strong,.recent-game-description small{overflow-wrap:anywhere}
.archive-role-summary{font-size:12px;line-height:1.8;color:var(--muted)}
.selfplay-visual>div{flex:1;min-width:0}.selfplay-visual>img{width:48px;height:52px;object-fit:contain;flex-shrink:0}.selfplay-visual{padding-left:18px;padding-right:18px}
@media(max-width:600px){body{font-size:16px}.training-intro,.benchmark-intro,.training-live>p,.guide-section p,.guide-steps,.glossary dd{font-size:15px}.selfplay-visual>img{width:43px;height:47px}.selfplay-visual>div span{font-size:14px;line-height:1.7}.selfplay-visual strong{font-size:13px;line-height:1.6}}
/* r3: opponent selection and separated test modes; existing theme unchanged. */
.test-mode-tabs{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:24px}
.test-mode-tabs button{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:17px 20px;min-height:82px;text-align:left;border:1px solid var(--line);border-radius:13px;background:var(--paper);color:var(--ink);line-height:1.6}
.test-mode-tabs button strong{font-size:16px}.test-mode-tabs button span{font-size:12px;color:var(--muted)}
.test-mode-tabs button[aria-selected=true]{border-color:var(--primary);background:var(--mint)}
.test-mode-tabs button:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.opponent-picker{margin:18px 0 23px}.opponent-picker select{width:100%;min-width:0}
.opponent-picker-footer{display:flex;align-items:flex-start;gap:14px;margin-top:12px}
.opponent-picker-footer p{flex:1;font-size:13px;line-height:1.8;color:var(--muted);margin:0;overflow-wrap:anywhere}
.opponent-picker-footer button{flex-shrink:0;font-size:12px;padding:10px 13px;min-height:44px}
.duel-points{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.duel-points>span{width:100%}.duel-points>strong{font-size:31px}.duel-points>small{font-size:12px}
.opponent-dialog-panel{width:min(640px,calc(100% - 28px));max-height:calc(100dvh - 36px);overflow:auto;padding:28px}
.opponent-dialog-close{float:right;margin:-12px -12px 0 8px}.opponent-dialog-panel h2{font-size:25px;line-height:1.5;letter-spacing:-.7px}.opponent-dialog-panel h3{font-size:16px;margin-top:22px}
.opponent-dialog-panel input[type=text]{width:100%}.opponent-import-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}.opponent-import-actions button{flex:1;min-width:170px}
.opponent-dialog-panel .opponent-format-note{font-size:12px;line-height:1.8;margin-top:14px;color:var(--muted)}
#opponent-import-status{font-size:13px;line-height:1.8;overflow-wrap:anywhere;margin-top:15px}
.opponent-library-list{display:grid;gap:11px;margin-top:13px}.opponent-library-entry{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:10px;padding:14px}
.opponent-library-entry>div{flex:1;min-width:0}.opponent-library-entry strong,.opponent-library-entry small{display:block;overflow-wrap:anywhere}.opponent-library-entry strong{font-size:14px}.opponent-library-entry small{font-size:12px;line-height:1.8;color:var(--muted);margin-top:4px}.opponent-library-entry button{min-height:44px}
@media(max-width:600px){.test-mode-tabs{gap:9px;margin-bottom:20px}.test-mode-tabs button{padding:13px 12px;min-height:100px}.test-mode-tabs button strong{font-size:14px}.test-mode-tabs button span{font-size:11px;line-height:1.7}.opponent-picker-footer{flex-direction:column;gap:10px}.opponent-picker-footer button{width:100%;font-size:14px}.opponent-picker-footer p{font-size:14px}.opponent-dialog-panel{padding:22px;max-height:calc(100dvh - 28px)}.opponent-dialog-panel h2{font-size:23px}.opponent-import-actions{flex-direction:column}.opponent-import-actions button{min-width:0;width:100%}.opponent-library-entry{align-items:flex-start;flex-wrap:wrap}.opponent-library-entry>div{min-width:180px}.duel-points>strong{font-size:28px}}
/* r4: larger boards, live outcomes and appearance settings. */
body{--board-light:#f4ead7;--board-dark:#bc9975;--board-last-light:#e5ca89;--board-last-dark:#bca265;--board-selected:#f4bc66;--board-coordinate-light:#30251f;--board-coordinate-dark:#30251f}
body[data-board-theme=green]{--board-light:#edf2dd;--board-dark:#78946b;--board-last-light:#d6db83;--board-last-dark:#9eac56;--board-selected:#c0c55d;--board-coordinate-light:#233827;--board-coordinate-dark:#233827}
body[data-board-theme=blue]{--board-light:#eaf0f6;--board-dark:#829bb4;--board-last-light:#e9d996;--board-last-dark:#b4ad75;--board-selected:#cbbb75;--board-coordinate-light:#243446;--board-coordinate-dark:#243446}
body[data-board-theme=gray]{--board-light:#eeeeec;--board-dark:#939593;--board-last-light:#e4d393;--board-last-dark:#b4a367;--board-selected:#c7b378;--board-coordinate-light:#292b29;--board-coordinate-dark:#292b29}
.chessboard .square{background:var(--board-light)}.chessboard .square.dark{background:var(--board-dark)}
.chessboard .square.last{background:var(--board-last-light)}.chessboard .square.dark.last{background:var(--board-last-dark)}.chessboard .square.selected{background:var(--board-selected)}.chessboard .square.check{background:radial-gradient(ellipse at center,#e78378 0%,#edc3a6 95%)}
.chessboard .replay-rank,.chessboard .replay-file{color:var(--board-coordinate-light)}.chessboard .square.dark .replay-rank,.chessboard .square.dark .replay-file{color:var(--board-coordinate-dark)}
.game-layout{grid-template-columns:minmax(0,1fr) minmax(275px,305px);gap:24px}.board-column{max-width:790px;width:100%}.board-surface{padding:0 12px}.board-wrapper{margin-left:15px}.board-with-eval{width:100%}.board-column .piece{width:89%;height:89%}
.replay-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:16px 0 12px}.replay-with-eval{align-items:stretch;gap:8px}.replay-with-eval .replay-board{flex:1;min-width:0;width:auto}.replay-evaluation-note{font-size:12px;color:var(--muted);line-height:1.8;margin-top:12px}.replay-card{min-width:0}.replay-with-eval .eval-pane{flex-shrink:0}.replay-with-eval .eval-track{flex:1;min-height:60px}.replay-with-eval .eval-state{max-width:40px;overflow-wrap:anywhere;font-size:9px}
.archive-entry.result-win{border:2px solid #2d7d46}.archive-entry.result-loss{border:2px solid #bd3f3a}.archive-result-badge.result-win{border:2px solid #2d7d46;color:#215d34;background:#edf7ee}.archive-result-badge.result-loss{border:2px solid #bd3f3a;color:#9b302c;background:#fff0ed}.archive-entry.selected-entry{outline:2px solid var(--primary);outline-offset:2px}
.history-game.result-win{border:1.5px solid #2d7d46;border-radius:10px;padding:13px 10px}.history-game.result-loss{border:1.5px solid #bd3f3a;border-radius:10px;padding:13px 10px}.result-symbol.result-win{border:2px solid #2d7d46}.result-symbol.result-loss{border:2px solid #bd3f3a}
.live-results{margin:17px 0 13px}.live-result-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.live-result-cards>span{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;padding:14px 8px;border:1px solid var(--line);border-radius:11px;background:var(--paper);text-align:center}.live-result-cards strong{font-size:28px;line-height:1.3;font-variant-numeric:tabular-nums}.live-result-cards small{font-size:12px;line-height:1.6;margin-top:5px;overflow-wrap:anywhere}.live-result-cards .live-result-wins{border-color:#2d7d46;color:#215d34}.live-result-cards .live-result-losses{border-color:#bd3f3a;color:#9b302c}.live-result-cards .live-result-draws{color:var(--ink)}.live-results-caption{font-size:12px;line-height:1.8;color:var(--muted);margin-top:10px}
.settings-button{flex-shrink:0}.settings-dialog{width:min(540px,calc(100% - 28px));max-height:calc(100dvh - 28px);overflow:auto}.appearance-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}.appearance-fields select{width:100%;min-width:0}.appearance-previewboard{max-width:230px;margin:23px auto 12px;border:1px solid var(--line);border-radius:10px;overflow:hidden}.appearance-preview-square .piece{width:85%;height:85%}#appearance-status{font-size:13px;color:var(--muted);line-height:1.8;min-height:24px}.settings-dialog .dialog-actions{display:flex;gap:10px;flex-wrap:wrap}.settings-dialog .dialog-actions button{flex:1;min-height:46px}
.library-entry-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.remove-opponent-button{border-color:#bd3f3a;color:#9b302c}.remove-opponent-confirm{flex-basis:100%;width:100%;border:1px solid #bd3f3a;background:#fff8f5;border-radius:10px;padding:13px;line-height:1.8;font-size:13px}.remove-opponent-confirm strong{display:block;color:var(--ink);overflow-wrap:anywhere}.remove-opponent-confirm button{min-height:44px;margin:10px 8px 0 0}.opponent-removal-note,.opponent-library-info{font-size:12px;color:var(--muted);line-height:1.8;overflow-wrap:anywhere}.opponent-library-entry{flex-wrap:wrap}.opponent-library-entry>div:first-child{min-width:150px}
@media(max-width:1250px){.game-layout{grid-template-columns:minmax(0,1fr) 280px;gap:18px}.board-column{max-width:790px}}
@media(max-width:1100px){.game-layout{grid-template-columns:1fr;max-width:940px}.board-column{max-width:830px}.game-panel{display:grid;grid-template-columns:1fr 1fr}.board-surface{padding:0 11px}}
@media(max-width:850px){main{padding-left:14px;padding-right:14px}.board-column{max-width:830px}.topbar{gap:8px}.topbar-right{gap:7px}.save-state{max-width:135px}.settings-button{width:40px;min-width:40px}.replay-card{max-width:720px}}
@media(max-width:600px){main{padding-left:8px;padding-right:8px}.game-layout{gap:15px}.game-panel{grid-template-columns:1fr}.board-surface{padding:0 6px}.board-wrapper{margin-left:12px}.rank-labels{left:-15px;width:12px;font-size:9px}.player-row{padding:7px 2px}.topbar{padding-left:11px;padding-right:11px}.topbar-mobile-brand{font-size:21px}.save-state{max-width:118px;font-size:9px}.settings-button{width:36px;min-width:36px}.board-with-eval{gap:5px}.eval-pane{width:24px}.replay-card{padding:15px}.replay-toolbar .text-button{font-size:12px}.live-result-cards{gap:7px}.live-result-cards>span{padding:12px 5px}.live-result-cards strong{font-size:26px}.live-result-cards small{font-size:11px}.appearance-fields{grid-template-columns:1fr;gap:0}.settings-dialog{padding:23px}.library-entry-actions{width:100%}.library-entry-actions button{flex:1;font-size:12px}.opponent-library-entry>div:first-child{flex-basis:100%}}
@media(max-width:360px){.topbar-mobile-brand{font-size:19px}.topbar-mobile-brand img{width:29px}.save-state{max-width:105px;font-size:9px}.topbar-right{gap:4px}.replay-card{padding:12px}}

.mobile-menu-panel{max-height:calc(100dvh - 112px);overflow:auto}

/* r7: viewport-sized boards and horizontal analysis. Coordinates sit inside
   squares, so neither labels nor the evaluation bar take board width. */
#page-play{--play-board-fallback:max(160px,calc(100svh - 410px))}
#page-archive{--replay-board-fallback:max(160px,calc(100svh - 330px))}
.game-layout{grid-template-columns:minmax(0,calc(var(--play-board-fit,var(--play-board-fallback)) + 26px)) minmax(275px,305px);justify-content:center;max-width:none}
#page-play .board-column{width:100%;max-width:calc(var(--play-board-fit,var(--play-board-fallback)) + 26px);margin:0}
.board-surface{padding:0 12px}
.board-with-eval{display:flex;flex-direction:column;align-items:stretch;gap:8px;width:100%;min-width:0}
.board-with-eval .board-wrapper{flex:none;min-width:0;width:100%;margin:0}
.board-with-eval .replay-board{flex:none;width:100%;min-width:0}
.board-wrapper .rank-labels,.board-wrapper .file-labels{display:none}
.bottom-player{margin-top:0}
.board-with-eval .eval-pane{display:flex;flex:none;flex-direction:column;align-items:stretch;gap:6px;width:100%;min-height:44px;padding:0 0 4px}
.eval-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px;min-height:22px}
.board-with-eval .eval-score{font-size:14px;line-height:22px;font-variant-numeric:tabular-nums}
.board-with-eval .eval-state{font-size:11px;line-height:1.65;text-align:right;max-width:none;overflow-wrap:anywhere}
.board-with-eval .eval-track{flex:none;width:100%;height:12px;min-height:12px;border-radius:5px}
.board-with-eval .eval-track>div{inset:0 auto 0 0;width:50%;height:100%;transition:width .25s}
.replay-with-eval{width:min(100%,var(--replay-board-fit,var(--replay-board-fallback)));margin-inline:auto}
#play-analysis-controls,#replay-analysis-controls{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 16px;min-width:0}
#play-analysis-controls{padding:3px 0}
#play-analysis-controls .eval-toggle,#replay-analysis-controls .eval-toggle{font-size:13px;min-height:44px}
#play-analysis-controls .text-button,#replay-analysis-controls .text-button{white-space:normal;text-align:left}
#replay-analysis-controls{margin:14px 0 10px}
.replay-variation-panel{padding:12px 14px;margin:0 0 12px;border:1px solid var(--line);border-radius:9px;background:var(--mint)}
.replay-variation-label{display:block;font-size:12px;font-weight:600;line-height:1.7;color:var(--muted);margin-bottom:4px}
.replay-variation{font-size:14px;line-height:1.8;color:var(--ink);overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
@media(max-width:1100px){
 .game-layout{grid-template-columns:minmax(0,1fr);max-width:940px}
 #page-play .board-column{margin-inline:auto}
}
@media(max-width:600px){
 /* Expand only the play area. Page headings, panels and controls keep gutters;
    there is no viewport-wide overflow clipping that could hide content. */
 main{--play-page-gutter:8px}
 #page-play .game-layout{width:calc(100% + var(--play-page-gutter) * 2);max-width:none;margin-inline:calc(var(--play-page-gutter) * -1)}
 #page-play .board-column{width:100%;max-width:none;margin:0}
 #page-play .board-surface{padding:0;border-inline:0;border-radius:0;box-shadow:none}
 #page-play .board-with-eval,#page-play .board-wrapper{width:100%;max-width:none;margin-inline:0}
 #page-play #board{width:100%;border:0;border-radius:0}
 #page-play .player-row{padding-inline:14px}
 #page-play #play-analysis-controls,#page-play .board-toolbar{margin-inline:14px}
 #page-play .eval-meta{padding-inline:14px}
 #page-play .eval-track{border-inline:0;border-radius:0}
 #page-play .status-banner{margin-inline:var(--play-page-gutter)}
 #page-play .game-panel{margin-inline:var(--play-page-gutter);min-width:0}
 #page-play .page-heading{gap:12px;margin-bottom:18px}
 #page-play .page-heading h1{font-size:26px}
 #page-play .page-heading p{font-size:13px;line-height:1.65}
 #page-play .eyebrow{margin-bottom:7px}
 .board-with-eval .eval-score{font-size:14px}
 .board-with-eval .eval-state{font-size:11px}
 .replay-with-eval{width:100%}
 #replay-analysis-controls{gap:4px 12px}
 #replay-analysis-controls .eval-toggle{font-size:13px}
 .replay-variation{font-size:13px}
}
@media(prefers-reduced-motion:reduce){.board-with-eval .eval-track>div{transition:none}}

/* Compact analysis chrome keeps labels readable without taking board columns. */
.board-with-eval .analysis-caption{font-size:11px;line-height:1.6;color:var(--muted);margin:0;overflow-wrap:anywhere}
#replay-analysis-controls>h3{flex-basis:100%;font-size:14px;line-height:1.5}
#replay-analysis-controls>.replay-toolbar{flex-basis:100%;width:100%;margin:0}
#replay-analysis-controls>.replay-variation-panel{flex-basis:100%;width:100%;margin:4px 0 0}
#page-play .board-column .board-toolbar{flex-wrap:wrap}
@media(min-width:601px){
 #page-play .page-heading{margin-bottom:16px;gap:14px}
 #page-play .page-heading .eyebrow{margin-bottom:5px}
 #page-play .page-heading h1{font-size:28px}
 #page-play .page-heading p{margin-top:5px;font-size:13px;line-height:1.5}
 #page-play .player-row{height:54px}
}
@media(max-width:600px){#page-play .analysis-caption{padding-inline:14px}}

.eval-meta{flex-wrap:wrap}
.replay-rank,.replay-file{pointer-events:none}

.startup-splash {
  position:fixed;
  inset:0;
  z-index:3000;
  display:grid;
  place-items:center;
  place-items:safe center;
  overflow:auto;
  padding:clamp(16px,5vmin,32px);
  background:
    radial-gradient(ellipse at 50% 39%,#744c3533,transparent 58%),
    var(--ui-bg,#1c1918);
  color:var(--ui-text,#f4ede5);
  text-align:center;
}
.startup-splash:not([hidden]) ~ :not(script) { visibility:hidden; }
.startup-content { width:min(100%,24rem); }
.startup-emblem {
  position:relative;
  display:grid;
  place-items:center;
  isolation:isolate;
  width:clamp(7.5rem,46vmin,12rem);
  aspect-ratio:1;
  margin:0 auto 10px;
}
.startup-board {
  position:absolute;
  inset:4%;
  z-index:-1;
  overflow:hidden;
  border:1px solid var(--ui-copper-detail,#80553e);
  border-radius:8px;
  background:conic-gradient(#4d352b 25%,#332621 0 50%,#4d352b 0 75%,#332621 0) 0 0 / 25% 25%;
  box-shadow:0 12px 30px #120e0b80,inset 0 0 16px #21171480;
  transform:perspective(28rem) rotateX(24deg) rotateZ(-10deg);
}
.startup-board::before,.startup-board::after {
  content:"";
  position:absolute;
  width:12.5%;
  height:12.5%;
  background:#c88a5a55;
  box-shadow:inset 0 0 0 1px #dda67965;
}
.startup-board::before { top:12.5%; left:12.5%; }
.startup-board::after { top:37.5%; left:0; }
.startup-logo {
  display:block;
  width:56%;
  height:auto;
  filter:drop-shadow(0 6px 12px #160e0acc);
}
.startup-content h1 {
  margin:0;
  font-size:clamp(1.5rem,5.5vmin,2.25rem);
  line-height:1.2;
}
.startup-content p {
  margin:10px 0 0;
  color:var(--ui-muted,#c7b9ae);
  font-size:var(--type-secondary,.875rem);
  line-height:1.5;
}
.startup-progress {
  width:57px;
  height:9px;
  margin:16px auto 0;
  background:repeating-linear-gradient(90deg,var(--ui-copper-detail,#80553e) 0 9px,transparent 9px 16px);
}
.startup-progress::after {
  content:"";
  display:block;
  width:9px;
  height:100%;
  background:var(--ui-focus,#dda679);
  transform:translateX(16px);
}
.startup-error,.startup-failed .startup-loading { display:none; }
.startup-failed .startup-error { display:block; }
.startup-retry {
  min-height:44px;
  margin-top:14px;
  padding:8px 16px;
  border:1px solid var(--ui-border-strong);
  border-radius:8px;
  background:var(--ui-surface);
  color:var(--ui-text);
}
.startup-retry:focus-visible { outline:2px solid var(--ui-focus); outline-offset:2px; }
@media(scripting:none) { .startup-loading { display:none; } }
@media(prefers-reduced-motion:no-preference) {
  .startup-splash:not(.startup-failed) .startup-board {
    animation:startup-board-settle .55s cubic-bezier(.2,.8,.2,1) both;
  }
  @keyframes startup-board-settle {
    from { transform:perspective(28rem) rotateX(42deg) rotateZ(-18deg) scale(.93); }
    to { transform:perspective(28rem) rotateX(24deg) rotateZ(-10deg) scale(1); }
  }
  .startup-progress::after { animation:startup-progress 1.2s steps(3,end) infinite alternate; }
  @keyframes startup-progress { from { transform:translateX(0); } to { transform:translateX(48px); } }
}

/* Athlete presentation only; board and surrounding play geometry are untouched. */
#pumpkin-profile-card.pumpkin-profile-card{margin:0 0 18px;padding:20px;min-width:0;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:14px;box-shadow:none}
#pumpkin-profile-card .pumpkin-profile-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
#pumpkin-profile-card .pumpkin-profile-heading .section-label{font-size:10px;letter-spacing:.8px;color:var(--ui-accent-text)}
#pumpkin-profile-card .pumpkin-profile-heading>button{min-height:44px;padding:8px 12px;margin:0;font-size:12px}
#pumpkin-profile-card .pumpkin-player-identity{display:flex;align-items:center;gap:14px;min-width:0}
#pumpkin-profile-card .pumpkin-avatar{display:grid;place-items:center;flex:none;width:72px;height:72px;overflow:hidden;border-radius:17px;background:var(--ui-surface-soft);border:1px solid var(--ui-border)}
#pumpkin-profile-card .pumpkin-avatar>svg,#pumpkin-profile-card .pumpkin-avatar>img{display:block;width:100%;height:100%;object-fit:cover}
#pumpkin-profile-card .pumpkin-player-name{min-width:0}
#pumpkin-profile-card .pumpkin-player-name>h2{margin:0;font-size:23px;line-height:1.25;letter-spacing:-.4px;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-player-name>p{margin:5px 0 7px;color:var(--ui-muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-player-style{display:inline-flex;align-items:center;min-height:25px;padding:3px 8px;border-radius:6px;background:var(--ui-accent-soft);color:var(--ui-accent-text);font-size:11px;line-height:1.4}
#pumpkin-profile-card .pumpkin-player-measurements{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin-top:18px;padding-top:16px;border-top:1px solid var(--ui-border)}
#pumpkin-profile-card .pumpkin-player-measurements>div{min-width:0;padding:0 12px;border-left:1px solid var(--ui-border)}
#pumpkin-profile-card .pumpkin-player-measurements>div:first-child{padding-left:0;border-left:0}
#pumpkin-profile-card .pumpkin-player-measurements>div:last-child{padding-right:0}
#pumpkin-profile-card .pumpkin-player-measurements span{display:block;color:var(--ui-muted);font-size:11px;line-height:1.5;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-player-measurements strong{display:block;margin-top:4px;font-size:23px;font-variant-numeric:tabular-nums;line-height:1.3;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-profile-caption,#pumpkin-profile-card .pumpkin-development-status,#pumpkin-profile-card .pumpkin-profile-message{font-size:12px;line-height:1.65;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-profile-caption{margin:12px 0 0;color:var(--ui-muted)}
#pumpkin-profile-card .pumpkin-development-status{margin:12px 0 0;color:var(--ui-muted)}
#pumpkin-profile-card .pumpkin-development-status[data-status=synced]{color:var(--ui-success)}
#pumpkin-profile-card .pumpkin-development-status[data-status=error],#pumpkin-profile-card .pumpkin-development-status[data-status=conflict]{color:var(--ui-accent-text)}
#pumpkin-profile-card .pumpkin-profile-message{margin:8px 0 0;color:var(--ui-accent-text)}
#pumpkin-profile-card .pumpkin-profile-message:empty{display:none}
#pumpkin-profile-card .pumpkin-development-details{margin-top:14px;border-top:1px solid var(--ui-border)}
#pumpkin-profile-card .pumpkin-development-details>summary{display:flex;align-items:center;min-height:44px;padding:11px 0;font-size:13px;font-weight:600;cursor:pointer}
#pumpkin-profile-card .pumpkin-development-events{list-style:none;margin:10px 0 0;padding:0}
#pumpkin-profile-card .pumpkin-development-events>li{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:8px 0;border-bottom:1px solid var(--ui-border);font-size:12px;line-height:1.5}
#pumpkin-profile-card .pumpkin-development-events span{min-width:0;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-development-events time{flex:none;color:var(--ui-muted);font-variant-numeric:tabular-nums;font-size:11px}
#pumpkin-profile-card .pumpkin-profile-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
#pumpkin-profile-card .pumpkin-profile-actions>button{flex:1 1 180px;min-height:44px;min-width:0;padding:9px 12px;margin:0;font-size:12px;line-height:1.4;white-space:normal}
#pumpkin-profile-card .pumpkin-backup-setting{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding:12px 0;border-block:1px solid var(--ui-border)}
#pumpkin-profile-card .pumpkin-backup-setting[hidden],#pumpkin-profile-card .pumpkin-versions[hidden]{display:none}
#pumpkin-profile-card .pumpkin-backup-setting>div{min-width:0}
#pumpkin-profile-card .pumpkin-backup-setting strong{font-size:12px;line-height:1.6}
#pumpkin-profile-card .pumpkin-backup-setting small{display:block;margin-top:3px;color:var(--ui-muted);font-size:11px;line-height:1.6;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-backup-setting>button{flex:none;min-width:70px;min-height:44px;margin:0;padding:9px 12px;font-size:12px}
#pumpkin-profile-card .pumpkin-versions{margin-top:14px;padding-top:14px;border-top:1px solid var(--ui-border)}
#pumpkin-profile-card #pumpkin-versions-load{min-height:44px;margin:0;padding:9px 12px;font-size:12px}
#pumpkin-profile-card .pumpkin-version-list{max-height:340px;overflow:auto;overscroll-behavior:contain;list-style:none;margin:10px 0 0;padding:0}
#pumpkin-profile-card .pumpkin-version-list:empty{display:none}
#pumpkin-profile-card .pumpkin-version-list>li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--ui-border)}
#pumpkin-profile-card .pumpkin-version-list>li>div:first-child{min-width:0}
#pumpkin-profile-card .pumpkin-version-list time{display:block;font-size:12px;font-variant-numeric:tabular-nums;line-height:1.5}
#pumpkin-profile-card .pumpkin-version-list span{display:block;margin-top:3px;color:var(--ui-muted);font-size:11px;line-height:1.6;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-version-actions{display:flex;flex:none;flex-wrap:wrap;justify-content:flex-end;gap:6px;max-width:55%}
#pumpkin-profile-card .pumpkin-version-actions>button{min-height:44px;min-width:0;margin:0;padding:8px 10px;font-size:11px;line-height:1.4;white-space:normal}
#pumpkin-profile-card .pumpkin-profile-dialog{width:min(560px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);margin:auto;padding:22px;border:1px solid var(--ui-border-strong);border-radius:16px;overflow:auto;background:var(--ui-surface);color:var(--ui-text);box-sizing:border-box}
#pumpkin-profile-card .pumpkin-profile-dialog::backdrop{background:var(--ui-backdrop)}
#pumpkin-profile-card .pumpkin-dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
#pumpkin-profile-card .pumpkin-dialog-heading>h2,#pumpkin-profile-card .pumpkin-confirm-dialog>h2{margin:0;font-size:21px;line-height:1.4;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-dialog-heading>button{flex:none;min-width:44px;width:44px;height:44px;font-size:25px;font-weight:400}
#pumpkin-profile-card #pumpkin-editor-name{width:100%;min-height:44px;box-sizing:border-box}
#pumpkin-profile-card .pumpkin-avatar-editor{display:flex;align-items:center;gap:14px;margin:20px 0 16px}
#pumpkin-profile-card .pumpkin-avatar-preview{width:88px;height:88px;flex:none}
#pumpkin-profile-card .pumpkin-avatar-editor>div:last-child{min-width:0}
#pumpkin-profile-card .pumpkin-avatar-editor strong{font-size:14px;line-height:1.4}
#pumpkin-profile-card .pumpkin-avatar-editor p{margin:3px 0 9px;color:var(--ui-muted);font-size:12px;line-height:1.5}
#pumpkin-profile-card .pumpkin-upload-label{display:inline-flex;justify-content:center;align-items:center;min-height:44px;margin:0;padding:8px 12px;font-size:12px;line-height:1.4;box-sizing:border-box;cursor:pointer}
#pumpkin-profile-card .pumpkin-avatar-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#pumpkin-profile-card .pumpkin-avatar-choice{display:grid;justify-items:center;gap:6px;min-width:0;min-height:94px;padding:10px 6px;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface-soft);color:var(--ui-text);font:inherit;font-size:11px;line-height:1.4;cursor:pointer}
#pumpkin-profile-card .pumpkin-avatar-choice>span:first-child{display:block;width:48px;height:48px}
#pumpkin-profile-card .pumpkin-avatar-choice svg{display:block;width:100%;height:100%;border-radius:10px}
#pumpkin-profile-card .pumpkin-avatar-choice[aria-pressed=true]{border-color:var(--ui-accent);background:var(--ui-accent-soft);color:var(--ui-accent-text)}
#pumpkin-profile-card .pumpkin-avatar-crop{display:grid;gap:10px;margin:16px 0 0;padding:12px;border:1px solid var(--ui-border);border-radius:10px;min-width:0}
#pumpkin-profile-card .pumpkin-avatar-crop[hidden]{display:none}
#pumpkin-profile-card .pumpkin-avatar-crop>legend{padding:0 5px;color:var(--ui-muted);font-size:12px}
#pumpkin-profile-card .pumpkin-avatar-crop>label{display:grid;grid-template-columns:95px minmax(0,1fr);align-items:center;gap:10px;font-size:12px}
#pumpkin-profile-card .pumpkin-avatar-crop input{width:100%;min-height:32px;margin:0;accent-color:var(--ui-accent)}
#pumpkin-profile-card .pumpkin-editor-help{margin:12px 0 0;font-size:11px;line-height:1.6;color:var(--ui-muted)}
#pumpkin-profile-card .pumpkin-dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:20px}
#pumpkin-profile-card .pumpkin-dialog-actions>button{min-width:110px;min-height:44px;margin:0;padding:10px 14px;font-size:13px}
#pumpkin-profile-card .pumpkin-confirm-dialog>p{font-size:13px;line-height:1.75;color:var(--ui-muted);overflow-wrap:anywhere}
#pumpkin-profile-card :is(button,summary,input,label[for]):focus-visible{outline:2px solid var(--ui-focus);outline-offset:3px}
@media(max-width:380px){#pumpkin-profile-card.pumpkin-profile-card{padding:16px}#pumpkin-profile-card .pumpkin-player-name>h2{font-size:21px}#pumpkin-profile-card .pumpkin-avatar{width:60px;height:60px}#pumpkin-profile-card .pumpkin-player-measurements>div{padding:0 8px}#pumpkin-profile-card .pumpkin-player-measurements strong{font-size:21px}#pumpkin-profile-card .pumpkin-profile-dialog{padding:16px}#pumpkin-profile-card .pumpkin-avatar-preview{width:76px;height:76px}#pumpkin-profile-card .pumpkin-avatar-gallery{gap:6px}#pumpkin-profile-card .pumpkin-dialog-actions>button{flex:1;min-width:0}}
@media(prefers-reduced-motion:no-preference){#pumpkin-profile-card .pumpkin-avatar-choice{transition:border-color 140ms ease,background-color 140ms ease}#pumpkin-profile-card .pumpkin-avatar-preview{transition:opacity 120ms ease}}

/* Pumpkin · one warm interface palette, independent of the board/piece themes.
 * :root also applies before preferences or JavaScript are available. */
:root,
html[data-ui-theme="pumpkin"] {
  color-scheme: dark;
  --ui-bg: #1c1918;
  --ui-surface: #302824;
  --ui-surface-soft: #382f2a;
  --ui-inset: #271f1d;
  --ui-surface-hover: #413631;
  --ui-text: #f4ede5;
  --ui-muted: #c6b9ad;
  --ui-border: #514740;
  --ui-border-strong: #968478;
  --ui-accent: #c88a5a;
  --ui-accent-hover: #d2996c;
  --ui-accent-border: #c88a5a;
  --ui-on-accent: #1c1918;
  --ui-accent-soft: #453125;
  --ui-accent-text: #dda679;
  --ui-copper-detail: #80553e;
  --ui-success: #9fc0a0;
  --ui-success-soft: #293429;
  --ui-danger: #e3a196;
  --ui-danger-soft: #3e2925;
  --ui-neutral: #d2c2b3;
  --ui-neutral-soft: #3a322d;
  --ui-sidebar: #241f1c;
  --ui-sidebar-soft: #302824;
  --ui-sidebar-hover: #382f2a;
  --ui-sidebar-active: #453125;
  --ui-sidebar-text: #f4ede5;
  --ui-sidebar-muted: #c6b9ad;
  --ui-sidebar-border: #514740;
  --ui-hero: #382c25;
  --ui-hero-text: #f4ede5;
  --ui-hero-muted: #c6b9ad;
  --ui-hero-accent: #dda679;
  --ui-backdrop: #110e0dd9;
  --ui-shadow: 0 6px 18px #0000001c;
  --ui-dialog-shadow: 0 22px 90px #00000080;
  --ui-focus: #dda679;
  --ui-scrollbar: #968478;
  --ui-track: #51423a;
  --ui-win-fill: #87a889;
  --ui-draw-fill: #b8a589;
  --ui-loss-fill: #bf8174;
  --chart-line: #dda679;
  --chart-grid: #514740;
  --chart-text: #c6b9ad;
  --chart-fill: #c88a5a2b;
  --chart-positive: #9fc0a0;
  --chart-negative: #e3a196;
}
/* Compatibility aliases let existing views adopt the palette without a
 * parallel set of components. New modules should use the --ui-* names. */
:root {
  --bg: var(--ui-bg);
  --paper: var(--ui-surface);
  --ink: var(--ui-text);
  --muted: var(--ui-muted);
  --green: var(--ui-accent);
  --primary: var(--ui-accent);
  --dark: var(--ui-sidebar);
  --line: var(--ui-border);
  --mint: var(--ui-accent-soft);
  --accent: var(--ui-focus);
  --teal: var(--ui-success);
}
html { background: var(--ui-bg); }
body { background: var(--ui-bg); color: var(--ui-text); }
a { color: var(--ui-accent-text); }
::selection { background: var(--ui-accent-soft); color: var(--ui-text); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 3px;
}
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, .guide-section:focus-visible {
  outline-color: var(--ui-focus);
}
button:disabled { opacity: .5; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--ui-accent); }
input[type="range"] { max-width: 100%; }
input::placeholder, textarea::placeholder { color: var(--ui-muted); opacity: 1; }
select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.archive-filters input, .archive-filters select {
  background: var(--ui-surface);
  color: var(--ui-text);
  border-color: var(--ui-border-strong);
}
select:disabled, input:disabled, textarea:disabled {
  background: var(--ui-surface-soft);
  color: var(--ui-muted);
}
select option { background: var(--ui-surface); color: var(--ui-text); }
button { color: inherit; }
.primary-button { background: var(--ui-accent); color: var(--ui-on-accent); border-color: var(--ui-accent-border); }
.secondary-button {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface);
  color: var(--ui-text);
}
.text-button, .icon-button, .icon-button.small, .eval-toggle { color: var(--ui-muted); }
.panel-link { color: var(--ui-accent-text); border-color: var(--ui-border); }

/* Navigation and chrome. */
.sidebar { background: var(--ui-sidebar); color: var(--ui-sidebar-text); }
.sidebar .brand { color: var(--ui-sidebar-text); }
.brand-dot, .tiny-stars, .nav-arrow { color: var(--ui-hero-accent); }
.workspace-label, .sidebar-note p, .local-label, .sidebar-footer, .mobile-revision { color: var(--ui-sidebar-muted); }
.nav-item { color: var(--ui-sidebar-muted); }
.nav-item.active { background: var(--ui-sidebar-active); color: var(--ui-sidebar-text); box-shadow: inset 3px 0 var(--ui-hero-accent); }
.sidebar-note { background: var(--ui-sidebar-soft); border-color: var(--ui-sidebar-border); }
.sidebar-note h3 { color: var(--ui-sidebar-text); }
.note-line { background: var(--ui-sidebar-border); }
.small-dot, .game-mode .small-dot { background: var(--ui-success); }
.sidebar .small-dot { background: var(--ui-success); }
.topbar { background: var(--ui-surface); border-color: var(--ui-border); }
.breadcrumb, .breadcrumb span, .save-state, .topbar-mobile-brand small { color: var(--ui-muted); }
.breadcrumb strong, .topbar-mobile-brand { color: var(--ui-text); }
.avatar { background: var(--ui-accent-soft); border-color: var(--ui-border); color: var(--ui-accent-text); }
.mobile-nav { background: var(--ui-surface); border-top: 1px solid var(--ui-border); box-shadow: 0 -4px 22px #0000000b; }
.mobile-nav-item { color: var(--ui-muted); }
.mobile-nav-item.active, .mobile-nav-item[aria-expanded="true"] { background: var(--ui-accent-soft); color: var(--ui-accent-text); }
.mobile-menu { background: var(--ui-backdrop); }
.mobile-menu-panel { background: var(--ui-surface); border-color: var(--ui-border); box-shadow: var(--ui-dialog-shadow); }
.mobile-menu-links button, .mobile-menu-links a { background: var(--ui-surface); color: var(--ui-text); border-color: var(--ui-border-strong); }
.mobile-menu-links button.active { background: var(--ui-accent-soft); border-color: var(--ui-accent); }
#mobile-menu-close { background: var(--ui-surface-soft); color: var(--ui-text); }

/* Surfaces, measured statistics and reusable informational text. */
.card, .board-surface { background: var(--ui-surface); color: var(--ui-text); border-color: var(--ui-border); box-shadow: var(--ui-shadow); }
.card :is(h1, h2, h3), .player-identity strong { color: var(--ui-text); }
.eyebrow, .section-label, .archive-entry-kind { color: var(--ui-muted); }
h1>span { color: var(--ui-accent-text); }
.page-heading p, .player-detail, .game-mode, .elo-label, .elo-value>span:last-child,
.elo-disclaimer, .chart-caption, .chart-empty, .engine-stats span, .moves-empty,
.moves-empty p, .weights-card>p, .history-row small, .form-help,
.status-banner div>span, .keyboard-note, .muted, .analysis-footer,
.stat-card>span, .stat-card small, .history-empty, .page-footer,
.training-intro, .training-help, .benchmark-intro, .training-progress-label>span,
.training-live>p, .training-recent, .selfplay-visual strong,
.benchmark-empty p, .benchmark-summary>div>span, .benchmark-summary small,
.benchmark-summary i, .benchmark-history-heading small, .benchmark-history-details,
.rating-hero p, .rating-hero small, .benchmark-wdl small, .history-wdl small,
.match-metric span, .opponent-picker-footer p, .opponent-dialog-panel .opponent-format-note,
.opponent-library-entry small, .opponent-removal-note, .opponent-library-info,
.archive-entry small, .archive-entry-reason, .archive-pagination>span,
.archive-empty, .archive-role-summary, .participant-color, .replay-detail,
.replay-reason, .replay-evaluation-note, .replay-variation-label,
.guide-section p, .guide-steps, .glossary dd, .about-grid p,
.mobile-menu-link small, .mobile-menu-panel>p, .live-results-caption, .eval-state,
#appearance-status, dialog p { color: var(--ui-muted); }
.form-label, .training-fields .form-label, .archive-filters label,
.guide-steps strong, .archive-participant, .weight-row>div:first-child,
.replay-step, .large-chart-empty strong { color: var(--ui-text); }
.turn-pill { border-color: var(--ui-border); color: var(--ui-muted); }
.your-turn, .training-state-pill, .learning-badge, .elo-change {
  background: var(--ui-success-soft); color: var(--ui-success); border-color: var(--ui-success);
}
.engine-state, .training-save, .history-elo { color: var(--ui-success); }
.thinking-pill, .engine-avatar, .engine-logo {
  background: var(--ui-accent-soft); color: var(--ui-accent-text);
}
.version, .subtle-badge, .result-symbol, .step-number {
  background: var(--ui-surface-soft); color: var(--ui-muted);
}
.human-avatar { background: var(--ui-surface-soft); border-color: var(--ui-border); }
.human-avatar svg { color: var(--ui-muted); }
.elo-change.negative { color: var(--ui-danger); background: var(--ui-danger-soft); }
.status-banner, .storage-callout, .benchmark-model-caption, .model-option-note,
.guide-example, .guide-callout, .dialog-note, .archive-summary {
  background: var(--ui-surface-soft); color: var(--ui-text); border-color: var(--ui-border);
}
.status-icon, .analysis-footer>span:last-child { color: var(--ui-accent-text); }
.learning-note, .moves-table-head, .glossary>div, .selfplay-visual,
.chart-empty, .large-chart-empty, .benchmark-empty {
  background: var(--ui-surface-soft); color: var(--ui-muted); border-color: var(--ui-border);
}
.glossary dt, .selfplay-visual>div span { color: var(--ui-accent-text); }
.selfplay-visual>span, .moves-empty>span, .large-chart-empty>span,
.benchmark-empty>span, .archive-empty>span { color: var(--ui-accent-text); }
.selfplay-visual>span:last-child { color: var(--ui-success); }
.engine-stats, .engine-stats>div:last-child, .analysis-footer,
.moves-table-head, .move-row, .history-row, .training-recent,
.benchmark-summary>div:not(:first-child), .rating-explainer { border-color: var(--ui-border); }
.moves-list, .archive-list, .replay-moves, dialog { scrollbar-color: var(--ui-scrollbar) transparent; }
.move-row:nth-child(even) { background: var(--ui-surface-soft); }
.move-row>span:first-child { color: var(--ui-muted); }
.move-row>span.latest { color: var(--ui-accent-text); }
.history-game { background: transparent; }
.history-game:disabled .history-elo { color: var(--ui-muted); }
.weight-track, .training-track, .wdl-track { background: var(--ui-track); }
.weight-fill, .training-track>div { background: var(--ui-accent); }
.wdl-track span:nth-child(1) { background: var(--ui-win-fill); }
.wdl-track span:nth-child(2) { background: var(--ui-draw-fill); }
.wdl-track span:nth-child(3) { background: var(--ui-loss-fill); }

/* All chart SVG labels inherit this palette. Piece paths are left untouched. */
.chart-container svg text, #progress-chart svg text, #training-chart svg text,
.archive-evaluation-chart svg text, .training-diagnostics svg text { fill: var(--chart-text); }
.chart-container svg, #progress-chart svg, #training-chart svg { max-width: 100%; }

/* Test modes, history and opponent library. */
.test-mode-tabs button { background: var(--ui-surface); border-color: var(--ui-border-strong); color: var(--ui-text); }
.test-mode-tabs button span { color: var(--ui-muted); }
.test-mode-tabs button[aria-selected="true"] { background: var(--ui-accent-soft); border-color: var(--ui-accent); }
.benchmark-wdl>span, .history-wdl>span, .match-metric { background: var(--ui-surface-soft); border-color: var(--ui-border); }
.benchmark-wdl strong, .history-wdl strong, .match-metric strong { color: var(--ui-text); }
.benchmark-wdl .wdl-wins, .history-wdl .wdl-wins { background: var(--ui-success-soft); border-color: var(--ui-success); }
.benchmark-wdl .wdl-losses, .history-wdl .wdl-losses { background: var(--ui-danger-soft); border-color: var(--ui-danger); }
.benchmark-history-card, .benchmark-history-item { background: var(--ui-surface); border-color: var(--ui-border); }
.benchmark-history-result, .benchmark-history-result strong,
.benchmark-history-details summary, .benchmark-primary>strong,
.rating-number>strong, .rating-number>span { color: var(--ui-accent-text); }
.benchmark-summary>div:first-child, .test-result-card .benchmark-primary,
.rating-hero { background: var(--ui-accent-soft); border-color: var(--ui-border); }
.page-tabs button, .page-tabs a, .page-tabs>span { background: var(--ui-surface); border-color: var(--ui-border-strong); color: var(--ui-text); }
.page-tabs .active { background: var(--ui-accent); color: var(--ui-on-accent); border-color: var(--ui-accent); }
.page-tabs .current { background: var(--ui-accent-soft); color: var(--ui-accent-text); border-color: var(--ui-accent); }
.advanced-settings summary, .measurement-details summary { color: var(--ui-text); }
.advanced-settings>p { color: var(--ui-muted); }
.opponent-library-entry { background: var(--ui-surface); border-color: var(--ui-border); }
.remove-opponent-button { color: var(--ui-danger); border-color: var(--ui-danger); }
.remove-opponent-confirm { background: var(--ui-danger-soft); border-color: var(--ui-danger); }
.remove-opponent-confirm strong { color: var(--ui-text); }

/* Archive outcomes remain relative to the participant described in each card. */
.archive-entry { background: var(--ui-surface); color: var(--ui-text); border-color: var(--ui-border); }
.archive-entry.selected-entry { background: var(--ui-surface-hover); }
.archive-entry strong>span { color: var(--ui-text); }
.archive-result-badge, .replay-outcome { background: var(--ui-neutral-soft); color: var(--ui-neutral); }
.result-win, .archive-result-badge.result-win { background: var(--ui-success-soft); color: var(--ui-success); }
.result-loss, .archive-result-badge.result-loss { background: var(--ui-danger-soft); color: var(--ui-danger); }
.result-draw, .result-unknown { background: var(--ui-neutral-soft); color: var(--ui-neutral); }
.archive-entry.result-win, .archive-result-badge.result-win,
.history-game.result-win, .result-symbol.result-win { border-color: var(--ui-success); }
.archive-entry.result-loss, .archive-result-badge.result-loss,
.history-game.result-loss, .result-symbol.result-loss { border-color: var(--ui-danger); }
.archive-entry.result-win, .archive-entry.result-loss { background: var(--ui-surface); color: var(--ui-text); }
.archive-entry.result-win.selected-entry, .archive-entry.result-loss.selected-entry { background: var(--ui-surface-hover); }
.replay-participants, .replay-variation-panel { background: var(--ui-surface-soft); border-color: var(--ui-border); }
.replay-variation { color: var(--ui-text); }
.replay-actions .icon-button, .replay-move { background: var(--ui-surface-soft); color: var(--ui-text); }
.replay-move>span { color: var(--ui-muted); }
.replay-move.current { background: var(--ui-accent-soft); color: var(--ui-accent-text); box-shadow: inset 0 0 0 1px var(--ui-accent); }
.replay-card input[type="range"] { accent-color: var(--ui-accent); }
.live-result-cards>span { background: var(--ui-surface); border-color: var(--ui-border); }
.live-result-cards .live-result-wins { color: var(--ui-success); border-color: var(--ui-success); }
.live-result-cards .live-result-losses { color: var(--ui-danger); border-color: var(--ui-danger); }
.live-result-cards .live-result-draws { color: var(--ui-text); }

/* Help uses one restrained forest surface in both interface modes. */
.guide-intro, .about-hero { background: var(--ui-hero); color: var(--ui-hero-text); }
.guide-intro h2, .about-hero h2 { color: var(--ui-hero-text); }
.guide-intro p, .about-hero p { color: var(--ui-hero-muted); }
.guide-intro .section-label, .about-hero .section-label,
.guide-intro>span, .about-knight { color: var(--ui-hero-accent); }
.guide-contents a { background: var(--ui-surface); color: var(--ui-accent-text); border-color: var(--ui-border-strong); }

/* Dialogs never extend beyond a small or landscape viewport. Scrolling is
 * local to the dialog; the existing page board sizing is not changed here. */
dialog {
  background: var(--ui-surface);
  color: var(--ui-text);
  border-color: var(--ui-border);
  box-shadow: var(--ui-dialog-shadow);
  max-width: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
dialog::backdrop { background: var(--ui-backdrop); }
.side-options label>span { border-color: var(--ui-border-strong); background: var(--ui-surface); color: var(--ui-text); }
.side-options input:checked+span { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
.side-options input:focus-visible+span { outline-color: var(--ui-focus); }
.promotion-options button { background: var(--ui-surface-soft); color: var(--ui-text); border-color: var(--ui-border-strong); }
.toast { background: var(--ui-sidebar-soft); color: var(--ui-sidebar-text); border: 1px solid var(--ui-sidebar-border); box-shadow: var(--ui-dialog-shadow); max-width: min(520px,calc(100% - 24px)); overflow-wrap: anywhere; }

/* Responsive controls grow or reflow instead of shrinking their text.
 * Board dimensions remain governed by board-viewport.js and the r7 rules. */
.page, .page-heading>div, .training-controls, .training-live,
.test-result-card, .test-history-card, .archive-browser,
.opponent-library-info { min-width: 0; }
.page-heading p, .card p, .card small, .storage-callout, .guide-callout,
.opponent-dialog-panel p, .replay-title { overflow-wrap: anywhere; }
.training-fields>div, .benchmark-fields>div, .benchmark-settings>div { min-width: 0; }
.advanced-settings summary, .measurement-details summary, .benchmark-history-details summary { min-height: 44px; padding-block: 10px; cursor: pointer; }
.replay-actions .icon-button, .archive-pagination button, .replay-move { min-height: 44px; }
@media (pointer: coarse) {
  .icon-button.small { min-width: 44px; min-height: 44px; }
  .text-button { min-height: 44px; }
}
@media (max-width: 600px) {
  dialog { padding: 22px 18px; max-height: calc(100dvh - 20px); }
  .page-heading { flex-wrap: wrap; gap: 14px; }
  .page-heading>div { max-width: 100%; }
  .page-heading :is(.primary-button,.secondary-button) { max-width: 100%; }
  .topbar-right { min-width: 0; }
  .settings-button { min-width: 44px; width: 44px; height: 44px; }
  .archive-pagination { flex-wrap: wrap; justify-content: center; }
  .archive-pagination>span { white-space: normal; text-align: center; }
  .opponent-import-actions button { min-width: 0; flex-basis: 100%; }
  .benchmark-history-heading { flex-wrap: wrap; }
  .benchmark-history-heading>div:first-child { flex: 1 1 180px; }
  .benchmark-history-result { margin-left: auto; }
  .toast { left: 50%; }
}
@media (max-width: 380px) {
  .topbar-mobile-brand { font-size: 18px; gap: 5px; }
  .topbar-mobile-brand small { font-size: 10px; }
  .topbar-mobile-brand img { width: 28px; }
  .save-state { max-width: 88px; font-size: 10px; }
  .topbar-right { gap: 3px; }
  .topbar { column-gap: 5px; }
  .training-fields, .benchmark-fields, .benchmark-settings { grid-template-columns: 1fr; }
  .benchmark-wdl, .history-wdl, .live-result-cards { gap: 5px; }
  .benchmark-wdl small, .history-wdl small { font-size: 11px !important; overflow-wrap: anywhere; }
}
@media (max-height: 500px) and (orientation: landscape) {
  dialog { max-height: calc(100dvh - 12px); padding: 18px; }
  .mobile-menu { padding-top: 6px; }
  .mobile-menu-panel { max-height: calc(100dvh - 110px); }
  .mobile-menu-header { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Unified brand presentation; no geometry or game-board changes. */
.settings-pumpkin-theme { display:flex;align-items:center;gap:14px;margin:0 0 8px;padding:14px 0;border-top:1px solid var(--ui-border); }
.settings-pumpkin-theme strong { color:var(--ui-text);font-size:14px; }
.settings-pumpkin-theme p { margin:4px 0 0;color:var(--ui-muted);font-size:12px;line-height:1.5; }
.pumpkin-theme-swatches { display:flex;flex:0 0 auto;gap:4px; }
.pumpkin-theme-swatches>span { width:15px;height:38px;border-radius:5px;border:1px solid var(--ui-border-strong); }
.pumpkin-theme-swatches>span:nth-child(1) { background:var(--ui-accent); }
.pumpkin-theme-swatches>span:nth-child(2) { background:var(--ui-text); }
.pumpkin-theme-swatches>span:nth-child(3) { background:var(--ui-bg); }

/* MEGADYNIA: independent presentation preferences and native-button galleries. */
.settings-dialog{width:min(760px,calc(100% - 24px));padding:26px;overscroll-behavior:contain;scrollbar-gutter:stable;max-height:calc(100dvh - 24px)}
.settings-dialog .dialog-top{align-items:center}.settings-dialog h2{margin:12px 0 8px}.settings-intro{margin:0 0 20px;font-size:13px!important;line-height:1.7!important}
.settings-section{border:0;border-top:1px solid var(--line);margin:0;padding:22px 0;min-width:0}.settings-section legend{float:left;width:100%;font-size:15px;font-weight:700;margin:0 0 12px;color:var(--ink)}.settings-section legend+*{clear:both}.settings-section p{font-size:12px;margin:8px 0 0}
.settings-segmented{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.settings-segmented button{padding:10px 6px;min-height:44px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink);font:inherit;font-size:13px;cursor:pointer}.settings-segmented button[aria-pressed=true]{background:var(--mint);border-color:var(--ui-accent-border);box-shadow:none}
.theme-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}.theme-choice{position:relative;display:flex;flex-direction:column;gap:9px;align-items:stretch;min-width:0;padding:8px 8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);cursor:pointer;font:inherit;text-align:left}.theme-choice[aria-pressed=true]{border-color:var(--ui-accent-border);box-shadow:none;background:var(--mint)}.theme-choice:focus-visible,.settings-segmented button:focus-visible{outline:3px solid var(--ui-focus);outline-offset:3px}.theme-choice-label{font-size:11px;line-height:1.5;font-weight:600;overflow-wrap:anywhere;padding-right:12px}.theme-choice-selected{display:none;position:absolute;right:7px;bottom:8px;color:var(--ui-accent-text);font-size:14px;font-weight:700}.theme-choice[aria-pressed=true] .theme-choice-selected{display:block}
.theme-board-thumbnail{display:grid;grid-template-columns:repeat(4,1fr);border-radius:5px;overflow:hidden;aspect-ratio:1.7}.theme-board-thumbnail>span{aspect-ratio:auto;min-height:10px}.theme-piece-thumbnail{display:flex;align-items:center;justify-content:center;gap:0;aspect-ratio:1.7;background:var(--ui-neutral);border-radius:5px;padding:2px}.theme-piece-thumbnail .piece{width:33.333%;height:auto;filter:none}.appearance-previewboard{width:160px;margin:15px auto 5px}.settings-preview{display:grid;grid-template-columns:170px minmax(0,1fr);gap:20px;align-items:center}.settings-preview p{font-size:12px;line-height:1.8}
.settings-toggles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 18px}.settings-toggle{display:flex;align-items:center;gap:10px;min-height:44px;font-size:13px;line-height:1.5;cursor:pointer}.settings-toggle input{width:18px;height:18px;accent-color:var(--primary);flex-shrink:0}.settings-volume{display:grid;grid-template-columns:auto minmax(60px,1fr) 40px;gap:13px;align-items:center;min-height:44px;font-size:13px}.settings-volume input{width:100%;accent-color:var(--primary)}.settings-volume output{font-variant-numeric:tabular-nums;text-align:right}.settings-dialog .dialog-actions{position:sticky;bottom:-26px;padding:12px 0 18px;background:var(--paper);z-index:2;border-top:1px solid var(--line)}
@media(max-width:600px){.settings-dialog{padding:20px;max-height:calc(100dvh - 20px)}.theme-gallery{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.theme-choice{padding:6px 6px 8px}.theme-choice-label{font-size:10px}.settings-toggles{grid-template-columns:1fr}.settings-section{padding:18px 0}.settings-preview{grid-template-columns:110px minmax(0,1fr);gap:14px}.appearance-previewboard{width:105px}.settings-dialog .dialog-actions{bottom:-20px}.settings-volume{gap:10px}.settings-intro{font-size:12px!important}}
@media(max-width:350px){.settings-dialog{padding:16px}.theme-gallery{gap:7px}.theme-choice-label{font-size:9px}.settings-preview{grid-template-columns:1fr}.settings-preview .appearance-previewboard{display:none}.settings-dialog .dialog-actions{bottom:-16px}.settings-dialog .dialog-actions button{font-size:11px;padding:10px 6px}}
@media(prefers-reduced-motion:reduce){.settings-dialog *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}


/* Interaction layers never consume a grid cell or the board's available width. */
.chessboard{position:relative;isolation:isolate}
.board-annotations{position:absolute;inset:0;width:100%;height:100%;z-index:5;overflow:visible;pointer-events:none}
.annotation-drawing,.annotation-drawing .square{cursor:crosshair;touch-action:none!important;user-select:none}
.move-animation-piece{position:absolute;z-index:4;display:grid;place-items:center;pointer-events:none;will-change:transform}
.move-animation-piece .piece{width:89%;height:89%}
#board .square[data-can-drag="true"]{touch-action:none}
.piece-ghost{pointer-events:none;z-index:1000}
#replay-draw-mode[aria-pressed=true]{background:var(--ui-accent-soft,#fff0dd);border-color:var(--ui-accent,#b75c25);color:var(--ui-text,#26372d)}
.play-heading-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px;min-width:0}
.play-heading-actions>button{min-height:44px;white-space:normal}
#focus-mode-toggle{min-height:44px;white-space:normal}
#focus-last-move{display:none;font-size:12px;line-height:1.6;color:var(--ui-muted,var(--muted))}
body.focus-mode-active .sidebar,body.focus-mode-active .topbar,body.focus-mode-active .mobile-nav,
body.focus-mode-active #page-play .game-panel,body.focus-mode-active #page-play .page-footer,
body.focus-mode-active #page-play .page-heading>div:not(.play-heading-actions),body.focus-mode-active #page-play .keyboard-note,
body.focus-mode-active #page-play #game-hint{display:none!important}
body.focus-mode-active .main-shell{margin-left:0;width:100%}
body.focus-mode-active main{padding-top:8px;padding-bottom:max(12px,env(safe-area-inset-bottom))}
body.focus-mode-active #page-play .page-heading{margin-bottom:8px;justify-content:flex-end}
body.focus-mode-active #page-play .game-layout{grid-template-columns:minmax(0,1fr);gap:10px}
body.focus-mode-active #page-play .board-column{margin-inline:auto}
body.focus-mode-active #page-play .board-toolbar{padding-block:6px}
body.focus-mode-active #page-play #focus-last-move{display:block}
body.focus-mode-active #page-play .status-banner{padding-block:9px;margin-top:6px}
@media(max-width:600px){
 .play-heading-actions{width:100%;justify-content:stretch;gap:8px}
 .play-heading-actions>button{flex:1;min-width:0;padding:11px 13px;font-size:13px}
 body.focus-mode-active main{padding-top:4px}
 body.focus-mode-active #page-play .page-heading{padding-inline:8px}
 body.focus-mode-active #page-play .player-row{min-height:44px;padding-block:4px}
 body.focus-mode-active #page-play .player-avatar{width:30px;height:30px}
 body.focus-mode-active #page-play .bottom-player{margin-top:0}
 body.focus-mode-active #page-play .play-analysis-toolbar{gap:6px;margin-top:0}
 body.focus-mode-active #page-play .game-mode{display:none}
}
@media(prefers-reduced-motion:reduce){.move-animation-piece{animation:none;transition:none}}

.archive-analysis{border-top:1px solid var(--line,#deded5);padding-top:18px;margin-top:20px;min-width:0}.archive-analysis-heading,.archive-analysis-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.archive-analysis-heading h3{margin:0}.archive-analysis-actions{justify-content:flex-start;margin:12px 0}.archive-analysis p{font-size:.85rem;line-height:1.55}.archive-eval-chart{height:168px;width:100%;min-width:0;border-radius:10px;background:var(--ui-surface-soft,var(--ui-bg,#f6f5ef));border:1px solid var(--line,#deded5);overflow:hidden;touch-action:pan-y}.archive-eval-chart svg{display:block;width:100%;height:100%}.archive-chart-equilibrium{stroke:var(--muted,#777);stroke-dasharray:5 4;opacity:.7}.archive-chart-line{fill:none;stroke:var(--ui-accent,#b56a35);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}.archive-chart-marker{stroke:var(--ui-text,#26362e);stroke-width:1;opacity:.65}.archive-chart-point{fill:var(--ui-accent,#b56a35);stroke:var(--ui-surface,#fff);stroke-width:1}.archive-chart-point.current{r:5;stroke-width:2}.archive-chart-label{font-size:11px;fill:var(--muted,#68726c)}.archive-chart-hit{cursor:pointer;fill:transparent}.archive-chart-empty{padding:28px 18px;text-align:center;color:var(--muted,#68726c);font-size:.85rem}.archive-chart-slider-label{display:block;font-size:.8rem;margin-top:12px}.archive-analysis input[type=range]{width:100%;min-height:36px;accent-color:var(--ui-accent,#b56a35)}.archive-move-quality{border-left:3px solid var(--line,#deded5);padding:6px 10px}.archive-move-quality[data-quality=best],.archive-move-quality[data-quality=good]{border-color:var(--ui-success,#65854a)}.archive-move-quality[data-quality=inaccuracy]{border-color:#a78027}.archive-move-quality[data-quality=mistake],.archive-move-quality[data-quality=blunder]{border-color:var(--ui-danger,#af5d48)}.archive-analysis-method summary{cursor:pointer;font-size:.85rem;min-height:36px;display:flex;align-items:center}.archive-annotation-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:12px 0}.archive-annotation-toolbar .muted{font-size:.75rem;flex-basis:100%}.archive-analysis-actions button{min-height:44px;white-space:normal}#replay-moves .current{scroll-margin-block:20px}#replay-eval-chart:focus-visible{outline:3px solid var(--ui-accent,#b56a35);outline-offset:3px}@media(max-width:480px){.archive-eval-chart{height:145px}.archive-analysis-heading{align-items:flex-start}.archive-analysis-heading .toggle-label{font-size:.8rem}.archive-analysis-actions button{flex:1 1 150px}}

/* Real training telemetry, kept out of the basic results until expanded. */
.training-diagnostics{padding:0;min-width:0}
.training-diagnostics>summary{cursor:pointer;padding:20px 24px;min-height:48px;font-weight:700;display:list-item;list-style-position:inside}
.training-diagnostics>summary:focus-visible{outline:3px solid var(--ui-accent,#b55e2e);outline-offset:2px}
.training-diagnostics>summary small{display:block;margin:5px 0 0 20px;font-weight:400;color:var(--ui-muted,#6c756e);font-size:13px}
#training-diagnostics-body{padding:0 24px 24px}
.diagnostics-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));gap:12px}
.diagnostics-metric{background:var(--ui-surface-soft,#f7f8f4);border:1px solid var(--ui-border,#dce1d6);border-radius:12px;padding:14px;min-width:0}
.diagnostics-metric>span,.diagnostics-metric>strong,.diagnostics-metric>small{display:block}
.diagnostics-metric>span{font-size:12px;color:var(--ui-muted,#6c756e);line-height:1.5}
.diagnostics-metric>strong{font-size:22px;line-height:1.4;margin:4px 0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.diagnostics-metric>small,.diagnostics-note,.diagnostics-empty{font-size:12px;line-height:1.7;color:var(--ui-muted,#6c756e)}
.diagnostics-note{margin:16px 0 0}.diagnostics-empty{margin:0}
.diagnostics-weight-section{margin-top:20px}.diagnostics-weight-section h4{font-size:14px;margin:0 0 12px}
.diagnostics-weight-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr));gap:0 24px}
.diagnostics-weight{display:grid;grid-template-columns:minmax(0,1fr) auto 56px;gap:8px;align-items:baseline;padding:9px 0;border-bottom:1px solid var(--ui-border,#dce1d6);font-size:12px;font-variant-numeric:tabular-nums}
.diagnostics-weight>span:first-child{overflow-wrap:anywhere}.diagnostics-weight>strong{text-align:right}
@media(max-width:560px){.training-diagnostics>summary{padding:18px}#training-diagnostics-body{padding:0 18px 18px}.diagnostics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.diagnostics-metric{padding:12px}.diagnostics-metric>strong{font-size:19px}.diagnostics-weight{font-size:11px;grid-template-columns:minmax(0,1fr) auto 50px}}
.diagnostics-snapshots{margin-top:22px;border-top:1px solid var(--ui-border,#dce1d6);padding-top:12px}
.diagnostics-snapshots>summary{cursor:pointer;font-weight:700;min-height:44px;padding:12px 0;line-height:1.5}
.diagnostics-snapshots>summary:focus-visible,.diagnostics-comparison-scroll:focus-visible{outline:3px solid var(--ui-accent,#b55e2e);outline-offset:3px;border-radius:4px}
.diagnostics-snapshots>.diagnostics-note{margin-top:0;margin-bottom:12px}
.diagnostics-comparison-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;border:1px solid var(--ui-border,#dce1d6);border-radius:10px}
.diagnostics-comparison{width:100%;border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums;min-width:390px}
.diagnostics-comparison th,.diagnostics-comparison td{padding:10px 12px;text-align:right;vertical-align:top;border-bottom:1px solid var(--ui-border,#dce1d6)}
.diagnostics-comparison th:first-child{text-align:left}
.diagnostics-comparison thead th{background:var(--ui-surface-soft,#f7f8f4);font-weight:700;min-width:100px}
.diagnostics-comparison small{display:block;font-size:10px;line-height:1.6;font-weight:400;color:var(--ui-muted,#6c756e);margin-top:3px}
.diagnostics-comparison tbody tr:last-child>*{border-bottom:0}
.diagnostics-learning-table{min-width:660px}
.diagnostics-learning-table th:not(:first-child){min-width:82px}
.diagnostics-learning-table td{white-space:nowrap}
@media(max-width:560px){.diagnostics-comparison th,.diagnostics-comparison td{padding:9px}.diagnostics-comparison{font-size:11px}}

/* Shared board presentation. Geometry lives in board-viewport/styles.css.
   All state colors come from the active board palette, independently of UI theme. */
body .chessboard{border-color:var(--board-coordinate-light);isolation:isolate}
body .chessboard .square{
 --square-base:var(--board-light);--square-last:var(--board-last-light);
 --square-coordinate:var(--board-coordinate-light);
 --square-legal:var(--board-legal-light);--square-capture:var(--board-capture-light);
 background:var(--square-base);
}
body .chessboard .square.dark{
 --square-base:var(--board-dark);--square-last:var(--board-last-dark);
 --square-coordinate:var(--board-coordinate-dark);
 --square-legal:var(--board-legal-dark);--square-capture:var(--board-capture-dark);
 background:var(--square-base);
}
body .chessboard .square.last{background:var(--square-last)}
body .chessboard .square.last:after{background:transparent;opacity:1;pointer-events:none}
body .chessboard .square.selected{--square-coordinate:var(--board-coordinate-light);background:var(--board-selected)!important}
body .chessboard .square.selected:after{border:2px solid var(--board-selection-ring);background:transparent;opacity:1}
body .chessboard .square.check{--square-coordinate:var(--board-coordinate-light);background:var(--board-check)!important;box-shadow:inset 0 0 0 2px var(--board-check-ring)}
body .chessboard .square.drop-target{box-shadow:inset 0 0 0 3px var(--board-selection-ring)}
body .chessboard .square .replay-rank,body .chessboard .square .replay-file,body .chessboard .square .board-rank,body .chessboard .square .board-file{color:var(--square-coordinate);text-shadow:none;pointer-events:none}
body .chessboard .legal-dot{background:var(--square-legal,var(--board-legal));opacity:1;width:19%;height:19%;box-shadow:0 0 0 1px var(--board-light),0 0 0 2px #11111124}
body .chessboard .legal-capture{border-color:var(--square-capture,var(--board-capture));border-width:clamp(2px,.6vw,4px);opacity:1;box-shadow:0 0 0 1px var(--board-light),inset 0 0 0 1px var(--board-light)}
body .chessboard .square:focus-visible{outline-color:var(--board-selection-ring);outline-offset:-4px}
body .chessboard .square.promotion .piece{filter:drop-shadow(0 1px 2px #11111150)}
.promotion-marker{position:absolute;right:4px;top:4px;display:grid;place-items:center;width:17px;height:17px;border-radius:50%;background:var(--board-selection-ring);color:var(--board-light);font:700 13px/1 var(--font);z-index:4;pointer-events:none;box-shadow:0 0 0 1px var(--board-light)}
/* Tiny tonal seams suggest marble without loading textures or obscuring pieces. */
body[data-board-texture=marble] .chessboard .square{background-image:repeating-linear-gradient(128deg,transparent 0 19px,#ffffff08 20px 21px,transparent 22px 39px)}
/* Disable exactly the requested decoration; legality and keyboard state remain intact. */
body[data-highlight-last-move=false] .chessboard .square.last{background:var(--square-base)}
body[data-highlight-last-move=false] .chessboard .square.last:after{background:none}
body[data-highlight-selection=false] .chessboard .square.selected{background:var(--square-base)!important}
body[data-highlight-selection=false] .chessboard .square.selected:after{border-color:transparent}
body[data-highlight-selection=false] .chessboard .square.selected .replay-rank,body[data-highlight-selection=false] .chessboard .square.selected .replay-file{color:var(--board-coordinate-light)}
body[data-highlight-selection=false] .chessboard .square.dark.selected .replay-rank,body[data-highlight-selection=false] .chessboard .square.dark.selected .replay-file{color:var(--board-coordinate-dark)}
body[data-highlight-legal-moves=false] .chessboard .legal-dot,body[data-highlight-legal-moves=false] .chessboard .legal-capture{display:none}
body[data-highlight-check=false] .chessboard .square.check{background:var(--square-base)!important;box-shadow:none}
body[data-highlight-check=false] .chessboard .square.check .replay-rank,body[data-highlight-check=false] .chessboard .square.check .replay-file{color:var(--board-coordinate-light)}
body[data-highlight-check=false] .chessboard .square.dark.check .replay-rank,body[data-highlight-check=false] .chessboard .square.dark.check .replay-file{color:var(--board-coordinate-dark)}
/* When a disabled check/selection shares a last-move field, retain enabled last-move color. */
body[data-highlight-check=false]:not([data-highlight-last-move=false]) .chessboard .square.last.check{background:var(--square-last)!important}
body[data-highlight-selection=false]:not([data-highlight-last-move=false]) .chessboard .square.last.selected{background:var(--square-last)!important}
body[data-highlight-check=false]:not([data-highlight-selection=false]) .chessboard .square.check.selected{background:var(--board-selected)!important}
body[data-highlight-selection=false]:not([data-highlight-check=false]) .chessboard .square.selected.check{background:var(--board-check)!important}
@media(max-width:400px){.promotion-marker{width:14px;height:14px;right:3px;top:3px;font-size:11px}}
@media(prefers-reduced-motion:reduce){.chessboard .piece{animation:none!important;transition:none!important}.piece-move-animation{animation:none!important;transition:none!important}}

/* Display state is separate from evaluation; these styles never assign scores. */
.eval-pane[data-evaluation-status] .eval-track>div{transition:width 180ms ease-out}
.eval-pane[data-evaluation-status=pending] .eval-track,
.eval-pane[data-evaluation-status=unavailable] .eval-track{background:var(--ui-surface-hover);border-color:var(--ui-border-strong)}
.eval-pane[data-evaluation-status=pending] .eval-track>div,
.eval-pane[data-evaluation-status=unavailable] .eval-track>div{visibility:hidden;transition:none}
.eval-pane[data-evaluation-status=stale] .eval-track:after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(120deg,transparent 0 7px,#8884 7px 9px)}
.eval-pane[data-evaluation-status=stale] .eval-state{color:var(--ui-muted)}
.eval-pane[data-evaluation-status] .eval-state{white-space:normal;max-width:100%;overflow-wrap:anywhere}
.eval-pane[data-evaluation-status] .eval-meta{align-items:baseline;gap:8px}
.eval-pane[data-evaluation-status] .eval-note{line-height:1.5}
.live-history-tools{display:flex;align-items:center;justify-content:space-between;gap:8px 14px;flex-wrap:wrap;margin-top:4px;min-width:0}
.history-navigation{display:flex;align-items:center;gap:5px;flex-shrink:0}
.history-navigation .icon-button{border:1px solid var(--ui-border);background:var(--ui-surface);min-width:44px;min-height:44px}
.live-history-banner{display:flex;align-items:center;justify-content:space-between;flex:1 1 260px;gap:8px;padding:8px 10px;border:1px solid var(--ui-border-strong);border-radius:8px;background:var(--ui-accent-soft);color:var(--ui-text);font-size:12px;line-height:1.5;min-width:0}
.live-history-banner>span{min-width:0;overflow-wrap:anywhere}
.live-history-banner .secondary-button{min-height:44px;font-size:12px;padding:8px 12px;white-space:normal;flex:0 1 180px}
#board.history-view{outline:2px solid var(--ui-accent);outline-offset:-2px}
#board.history-view .square{cursor:default}
:is(#moves-list,#replay-moves) .move-row{align-items:stretch;min-height:44px}
:is(#moves-list,#replay-moves) .move-row>span:first-child{align-self:center}
:is(#moves-list,#replay-moves) .move-row button{min-width:0;min-height:44px;padding:8px 7px;text-align:left;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--ui-text);font:inherit;font-variant-numeric:tabular-nums;line-height:1.5}
:is(#moves-list,#replay-moves) .move-row button.current-move,
:is(#moves-list,#replay-moves) .move-row button[aria-current=step]{background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-accent-text);font-weight:700}
:is(#moves-list,#replay-moves) .move-row button:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}
:is(#moves-list,#replay-moves){overscroll-behavior:contain;scroll-behavior:auto}
.focus-strip-start{display:none}
.mobile-focus-history{display:none}
#appearance-notation{width:100%;min-height:44px}
@media(max-width:600px){
 .live-history-tools{gap:7px;padding-inline:10px;margin-top:7px}
 .history-navigation{width:100%;justify-content:center;gap:9px}
 .live-history-banner{flex-basis:100%;padding:8px;font-size:12px}
 .live-history-banner .secondary-button{flex-basis:170px}
 :is(#moves-list,#replay-moves) .move-row button{padding-inline:8px}
 body.focus-mode-active .live-history-tools{padding-inline:8px}
}
@media(prefers-reduced-motion:reduce){.eval-pane[data-evaluation-status] .eval-track>div{transition:none!important}}

/* The same strip is attached to the top edge of both boards. */
.board-with-eval {
  --evaluation-slot-height:24px;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto auto;
  gap:0;
  align-items:start;
}
.board-with-eval>.eval-pane {
  position:relative;
  grid-column:1;
  grid-row:1;
  height:0;
  min-height:0;
  max-height:var(--evaluation-slot-height);
  padding:0;
  overflow:hidden;
  opacity:0;
  pointer-events:none;
}
.board-with-eval>.eval-pane[aria-hidden="false"] {
  height:var(--evaluation-slot-height);
  opacity:1;
}
@media(prefers-reduced-motion:no-preference) {
  .board-with-eval>.eval-pane { transition:height 180ms ease,opacity 150ms ease; }
}
.board-with-eval>:is(.board-wrapper,.replay-board) { grid-column:1; grid-row:2; }
.board-with-eval:has(>.eval-pane[aria-hidden="false"]) :is(#board,#replay-board) {
  border-start-start-radius:0;
  border-start-end-radius:0;
}
.board-with-eval .eval-track {
  position:absolute;
  inset:auto 0 0;
  height:var(--evaluation-slot-height);
  min-height:0;
  border-inline:0;
  border-bottom:0;
  border-radius:0;
}
:is(#page-play,#page-archive) .board-with-eval .eval-meta {
  position:absolute;
  inset:auto 0 0;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:center;
  height:var(--evaluation-slot-height);
  min-height:0;
  margin:0;
  padding:0;
}
.board-with-eval .eval-score {
  min-width:3.25rem;
  padding:0 6px;
  border-radius:4px;
  background:var(--ui-inset);
  color:var(--ui-text);
  font-size:14px;
  line-height:20px;
  text-align:center;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.board-with-eval .eval-pane .eval-state,.board-with-eval .eval-pane .analysis-caption{display:none!important}
.board-with-eval .eval-pane .eval-track>div{transition:none!important;animation:none!important}
.board-with-eval .eval-pane .eval-track:after{content:none!important;display:none!important;animation:none!important}
#page-play .game-panel>.moves-card{order:-1}
#page-play .game-panel>.engine-card{order:0}
/* The history heading spans the entire panel, without changing its spacing. */
#page-play .moves-card .moves-header{justify-content:center}
#page-play .moves-card .moves-header h2{width:100%;text-align:center}
#saved-models-card{margin-top:24px;margin-bottom:24px}
#saved-models-card .guide-actions{gap:12px;flex-wrap:wrap}
#saved-models-card .guide-actions>button{min-height:44px;white-space:normal}
.saved-models-note{font-size:12px!important;color:var(--ui-muted);line-height:1.7}
#page-play .moves-card .moves-list{max-height:340px;min-height:144px}
@media(max-width:600px){
 #page-play .game-panel{gap:18px}
 #page-play .game-panel>.moves-card{margin-top:0}
 #page-play .moves-card .moves-list{max-height:264px}
 #saved-models-card{margin-top:20px;margin-bottom:20px}
 #saved-models-card .card-heading{align-items:flex-start;gap:12px;flex-wrap:wrap}
 #saved-models-card .guide-actions{display:grid;grid-template-columns:1fr;gap:10px}
 #saved-models-card .guide-actions>button{width:100%}
}
/* Allow ordinary tap/scroll without the double-tap click wait on empty targets. */
#board .square:not([data-can-drag="true"]){touch-action:manipulation}
#board .square[data-can-drag="true"]{touch-action:none}

/* Play-only desktop geometry. Phone/tablet layout and other pages retain r3. */
@media (min-width:851px) and (hover:hover) and (pointer:fine) {
  .main-shell:has(#page-play.active-page)>main {
    max-width:none;
    padding:12px clamp(16px,1.6vw,32px) 0;
  }
  #page-play .page-heading { align-items:center; margin-bottom:12px; gap:16px; }
  #page-play .page-heading .eyebrow { display:none; }
  #page-play .page-heading h1 { font-size:24px; line-height:1.25; }
  #page-play .page-heading p { margin-top:3px; font-size:12px; line-height:1.4; }
  #page-play .play-heading-actions { flex-shrink:0; }

  #page-play {
    --play-board-fallback:max(64px,calc(100svh - 230px));
  }
  #page-play .game-layout {
    /* The adapter caps the square by both viewport height and this row's width.
       A fixed, fluid sidebar avoids a board/panel resize feedback loop. */
    grid-template-columns:minmax(0,calc(var(--play-board-fit,var(--play-board-fallback)) + 22px)) clamp(260px,22vw,340px);
    justify-content:center;
    gap:20px;
    width:100%;
    max-width:none;
    margin-inline:0;
  }
  #page-play .board-column {
    width:100%;
    max-width:calc(var(--play-board-fit,var(--play-board-fallback)) + 22px);
    margin:0;
  }
  #page-play .board-surface {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    column-gap:12px;
    padding:0 10px;
  }
  #page-play .board-surface>.player-row:first-child { grid-column:1; grid-row:1; }
  #page-play #play-analysis-controls {
    grid-column:2;
    grid-row:1;
    margin:0;
    padding:0;
  }
  #page-play #play-analysis-controls .eval-toggle { min-height:40px; font-size:12px; }
  #page-play .board-with-eval { grid-column:1/-1; grid-row:2; }
  #page-play .bottom-player { grid-column:1/-1; grid-row:3; }
  #page-play .player-row {
    height:44px;
    min-height:44px;
    margin:0;
    padding:4px 0;
    gap:8px;
  }
  #page-play .player-avatar { width:32px; height:32px; border-radius:7px; }
  #page-play .player-identity { gap:8px; min-width:0; }
  #page-play .player-identity strong { font-size:12px; }
  #page-play .player-detail { margin-top:2px; font-size:10px; }
  #page-play .turn-pill { font-size:10px; padding:5px 7px; white-space:nowrap; }
  #page-play .game-panel { display:flex; flex-direction:column; gap:18px; margin-top:0; }

  body.focus-mode-active .main-shell:has(#page-play.active-page)>main { padding-top:8px; }
  body.focus-mode-active #page-play .page-heading { margin-bottom:8px; }
  body.focus-mode-active #page-play .game-layout {
    grid-template-columns:minmax(0,calc(var(--play-board-fit,var(--play-board-fallback)) + 22px));
    gap:0;
  }
  body.focus-mode-active #page-play .board-column { margin-inline:auto; }
}

/* A queued intention has its own quiet outline, independent of move/check fill. */
#board .square.premove-from { box-shadow:inset 0 0 0 3px var(--board-arrow,var(--accent,#c2793c)); }
#board .square.premove-to { box-shadow:inset 0 0 0 4px var(--board-arrow,var(--accent,#c2793c)); }
#board .premove-mark { position:absolute; inset:29%; border:2px dashed var(--board-arrow,var(--accent,#c2793c)); border-radius:50%; pointer-events:none; opacity:.9; }
.premove-cancel { min-height:40px; font-size:12px; padding:7px 10px; }
.premove-cancel[hidden] { display:none; }

/* Normal play, desktop focus and other tabs keep their existing layout. */
.mobile-focus-controls{display:contents}
html.mobile-focus-locked{overflow:hidden;overscroll-behavior:none}
body.mobile-focus-locked{position:fixed;top:var(--focus-document-top,0px);left:var(--focus-document-left,0px);width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
body.mobile-focus-locked #page-play.active-page{
 position:fixed;z-index:30;top:var(--focus-viewport-top,0px);left:var(--focus-viewport-left,0px);
 width:var(--focus-viewport-width,100vw);height:var(--focus-viewport-height,100dvh);
 max-width:none;margin:0;padding:calc(4px + env(safe-area-inset-top,0px)) env(safe-area-inset-right,0px) calc(4px + env(safe-area-inset-bottom,0px)) env(safe-area-inset-left,0px);
 display:grid;grid-template-rows:auto minmax(0,1fr);row-gap:4px;overflow:hidden;background:var(--ui-bg,var(--bg));
}
body.mobile-focus-locked #page-play .page-heading{margin:0;padding:0 8px;min-width:0;min-height:44px}
body.mobile-focus-locked #page-play .play-heading-actions{width:100%;display:flex;flex-wrap:nowrap;gap:8px;justify-content:center}
body.mobile-focus-locked #page-play .play-heading-actions>button{flex:0 1 210px;padding:6px 10px;min-height:44px;font-size:12px;line-height:1.3}
body.mobile-focus-locked #page-play .game-layout{display:block;min-height:0;width:100%;max-width:none;margin:0;overflow:hidden}
body.mobile-focus-locked #page-play .board-column{display:flex;flex-direction:column;align-items:center;width:100%;height:100%;max-width:none;margin:0;padding-block-start:var(--focus-board-offset,0px);min-height:0;overflow:hidden}
body.mobile-focus-locked #page-play .board-surface{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:6px;flex:none;width:var(--focus-board-size);max-width:100%;padding:0;border:0;border-radius:0;overflow:hidden}
body.mobile-focus-locked #page-play .board-surface>.player-row:first-child{grid-column:1;grid-row:1}
body.mobile-focus-locked #page-play #play-analysis-controls{grid-column:2;grid-row:1;margin:0;padding:0 4px;min-width:0}
body.mobile-focus-locked #page-play #play-analysis-controls .eval-toggle{font-size:10px;gap:4px;min-height:36px;line-height:1.2}
body.mobile-focus-locked #page-play #play-analysis-controls input{width:16px;height:16px;min-width:16px}
body.mobile-focus-locked #page-play .board-with-eval{grid-column:1/-1;grid-row:2;width:100%;max-width:none}
body.mobile-focus-locked #page-play .board-with-eval .board-wrapper{width:100%;max-width:none;margin:0}
body.mobile-focus-locked #page-play #board{width:100%;aspect-ratio:1;border:0;border-radius:0}
body.mobile-focus-locked #page-play .bottom-player{grid-column:1/-1;grid-row:3;margin:0}
body.mobile-focus-locked #page-play .player-row{height:36px;min-height:36px;padding:2px 6px;gap:6px}
body.mobile-focus-locked #page-play .player-avatar{width:26px;height:26px;font-size:24px;border-radius:5px}
body.mobile-focus-locked #page-play .player-identity{gap:6px;min-width:0}
body.mobile-focus-locked #page-play .player-identity strong{font-size:11px;line-height:1.2}
body.mobile-focus-locked #page-play .player-detail{font-size:9px;line-height:1.2;margin-top:1px}
body.mobile-focus-locked #page-play .turn-pill{font-size:9px;line-height:1.2;padding:4px 5px;white-space:nowrap}
body.mobile-focus-locked.mobile-focus-compact #page-play .player-avatar,body.mobile-focus-locked.mobile-focus-compact #page-play .player-detail{display:none}
body.mobile-focus-locked.mobile-focus-compact #page-play .player-row,body.mobile-focus-locked.mobile-focus-compact #page-play .player-identity>div:last-child{min-width:0}
body.mobile-focus-locked.mobile-focus-compact #page-play .player-identity strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.mobile-focus-locked.mobile-focus-narrow #page-play .turn-pill{display:none}
body.mobile-focus-locked #page-play .mobile-focus-controls{display:flex;flex-direction:column;flex:1 1 108px;min-height:108px;width:100%;max-width:max(400px,var(--focus-board-size));overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;padding:4px 8px 8px;touch-action:pan-y}
body.mobile-focus-locked #page-play .live-history-tools{display:contents}
body.mobile-focus-locked #page-play .history-navigation{width:100%;flex:none;min-height:44px;justify-content:center;gap:6px}
body.mobile-focus-locked #page-play .board-toolbar{flex:none;min-height:52px;margin:0;padding:4px 0;gap:4px}
body.mobile-focus-locked #page-play .game-mode{display:none}
body.mobile-focus-locked #page-play .board-toolbar>div{width:100%;justify-content:center;gap:8px;flex-wrap:wrap}
body.mobile-focus-locked #page-play .premove-cancel{order:2;flex:none;align-self:center;margin-top:4px}
body.mobile-focus-locked #page-play .live-history-banner{order:3;flex:none;width:100%;margin-top:4px}
body.mobile-focus-locked #page-play #focus-last-move{order:4;flex:none;margin:0;font-size:11px;line-height:1.5}
body.mobile-focus-locked #page-play .status-banner{order:5;flex:none;margin:4px 0 0;padding:6px 8px;min-width:0}
body.mobile-focus-locked #page-play .status-banner strong{font-size:11px}
body.mobile-focus-locked.mobile-focus-landscape #page-play.active-page{grid-template-columns:minmax(0,1fr) var(--focus-controls-width,32%);grid-template-rows:minmax(0,1fr);column-gap:8px;row-gap:0}
body.mobile-focus-locked.mobile-focus-landscape #page-play .game-layout,body.mobile-focus-locked.mobile-focus-landscape #page-play .board-column{display:contents}
body.mobile-focus-locked.mobile-focus-landscape #page-play .page-heading{grid-column:2;grid-row:1;align-self:start;z-index:1;padding:0;min-height:44px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .play-heading-actions{gap:4px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .play-heading-actions>button{font-size:11px;padding:5px 6px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .board-surface{grid-column:1;grid-row:1;align-self:center;justify-self:center;max-height:100%;min-height:0}
body.mobile-focus-locked.mobile-focus-landscape #page-play .player-row{height:32px;min-height:32px}
body.mobile-focus-locked.mobile-focus-landscape #page-play #play-analysis-controls .eval-toggle{min-height:32px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .player-avatar{display:none}
body.mobile-focus-locked.mobile-focus-landscape #page-play .mobile-focus-controls{grid-column:2;grid-row:1;align-self:stretch;width:100%;max-width:none;min-height:0;margin-top:var(--focus-controls-top,48px);padding:4px 4px 8px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .history-navigation{gap:2px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .history-navigation .icon-button{min-width:40px;min-height:44px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .board-toolbar>div{gap:4px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .live-history-banner{display:block}
body.mobile-focus-locked.mobile-focus-landscape #page-play .live-history-banner .secondary-button{width:100%;margin-top:5px}

/* One engine workspace. Existing panels and form nodes retain their identities. */
.engine-hub-heading { margin-bottom: 20px; }
.engine-hub-overview { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:18px 22px; margin-bottom:24px; }
.engine-hub-identity { display:flex; align-items:center; gap:12px; min-width:0; }
.engine-hub-identity img { width:40px; height:40px; object-fit:contain; flex-shrink:0; }
.engine-hub-identity .section-label { display:block; margin-bottom:3px; }
.engine-hub-identity strong { display:block; font-size:17px; line-height:1.4; overflow-wrap:anywhere; }
.engine-hub-summary { display:flex; flex-direction:column; align-items:flex-end; gap:5px; text-align:right; min-width:0; }
#engine-hub-games { color:var(--ui-muted); font-size:12px; }
.engine-hub-status { color:var(--ui-success); font-size:12px; overflow-wrap:anywhere; }
.engine-hub-tabs { display:none; }
.engine-hub-sections { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px; align-items:start; }
.engine-pane { min-width:0; }
.engine-pane>.page-heading { min-height:110px; align-items:flex-start; flex-wrap:wrap; gap:14px; margin-bottom:20px; }
.engine-pane>.page-heading .eyebrow { margin-bottom:7px; }
.engine-pane>.page-heading h2 { font-size:24px; line-height:1.3; }
.engine-pane>.page-heading p { line-height:1.6; }
.engine-pane>.page-heading .memory-actions { flex-wrap:wrap; }
.engine-pane .progress-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:20px; }
.engine-pane .stat-card { min-width:0; padding:19px; }
.engine-pane .stat-card strong { overflow-wrap:anywhere; }
.engine-pane .training-grid, .engine-pane .progress-grid { grid-template-columns:minmax(0,1fr); gap:20px; }
.engine-pane .training-grid { margin-bottom:20px; }
.engine-pane .training-controls, .engine-pane .training-live, .engine-pane .growth-card, .engine-pane .weights-card, .engine-pane .history-card { padding:22px; }
.engine-pane .training-fields { grid-template-columns:minmax(0,1fr); gap:0; }
.engine-pane .card-heading { flex-wrap:wrap; }
.engine-pane .training-buttons { flex-wrap:wrap; }
.engine-pane .training-buttons>button { min-width:0; flex:1 1 145px; white-space:normal; }
.engine-pane .memory-actions .secondary-button { min-height:44px; }
/* Related-function shortcuts are a button row, not a framed tablist. */
.engine-pane .engine-section-links {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
  width:min(100%,480px); gap:8px; margin-top:0; margin-bottom:20px;
}
.engine-pane .engine-section-links>button {
  display:flex; align-items:center; justify-content:center;
  min-width:0; min-height:44px; width:100%; margin:0; padding:10px 8px;
  text-align:center; white-space:normal;
}
.engine-pane .storage-callout { margin-block:20px; }
.engine-pane .saved-models-card { margin-top:20px; }
.engine-pane .saved-models-card .guide-actions>button { white-space:normal; }
.engine-pane .training-diagnostics { margin-top:20px; }
.engine-pane .training-diagnostics summary { flex-wrap:wrap; }

/* League intentionally has no controls or simulated data. */
.league-placeholder { max-width:760px; margin:30px auto; min-height:310px; padding:52px 24px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:16px; }
.league-trophy { color:var(--ui-accent-text); background:var(--ui-accent-soft); width:72px; height:72px; border-radius:18px; margin-bottom:5px; }
.league-trophy svg { width:38px!important; height:38px!important; }
.league-placeholder .eyebrow { margin:0; }
.league-placeholder h1 { font-size:clamp(28px,3.5vw,40px); letter-spacing:-1px; }
.league-coming-soon { color:var(--ui-muted); font-size:15px; }

@media (min-width:1500px) {
  .engine-pane .training-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; }
}
@media (max-width:1100px) {
  .engine-hub-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; background:var(--ui-surface-soft); border:1px solid var(--ui-border); border-radius:12px; padding:5px; margin-bottom:24px; }
  .engine-hub-tabs button { display:flex; justify-content:center; align-items:center; gap:8px; min-height:46px; padding:10px 14px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--ui-muted); font-size:14px; font-weight:600; }
  .engine-hub-tabs button[aria-selected="true"] { background:var(--ui-surface); color:var(--ui-accent-text); border-color:var(--ui-border); box-shadow:var(--ui-shadow); }
  .engine-hub-sections { grid-template-columns:minmax(0,1fr); gap:0; }
  .engine-pane>.page-heading { min-height:0; }
  .engine-pane .training-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; }
  .engine-pane .progress-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .engine-hub-overview { padding:16px; gap:12px; margin-bottom:18px; align-items:flex-start; }
  .engine-hub-identity { gap:9px; }
  .engine-hub-identity img { width:34px; height:38px; }
  .engine-hub-identity .section-label { font-size:9px; letter-spacing:.8px; }
  .engine-hub-identity strong { font-size:15px; }
  .engine-hub-summary { flex:1; gap:5px; }
  #engine-hub-games, .engine-hub-status { font-size:11px; line-height:1.6; }
  .engine-hub-tabs { margin-bottom:22px; }
  .engine-pane>.page-heading { margin-bottom:20px; }
  .engine-pane>.page-heading h2 { font-size:23px; }
  .engine-pane>.page-heading .memory-actions { flex-direction:row; width:100%; gap:9px; }
  .engine-pane .memory-actions .secondary-button { flex:1 1 140px; padding:11px 10px; margin-top:0; font-size:12px; }
  .engine-pane .progress-stats { gap:11px; }
  .engine-pane .stat-card { padding:18px 16px; }
  .engine-pane .training-fields, .engine-pane .progress-grid { grid-template-columns:minmax(0,1fr); gap:0; }
  .engine-pane .progress-grid { gap:18px; }
  .engine-pane .training-controls, .engine-pane .training-live, .engine-pane .growth-card, .engine-pane .weights-card, .engine-pane .history-card { padding:21px; }
  .league-placeholder { min-height:280px; margin:10px auto; padding:42px 20px; }
}
@media (max-width:360px) {
  .engine-hub-overview { padding:14px 12px; gap:8px; }
  .engine-hub-identity img { width:28px; height:34px; }
  .engine-hub-identity strong { font-size:14px; }
  #engine-hub-games, .engine-hub-status { font-size:10px; }
}

.engine-hub-status[data-state="training"],.engine-hub-status[data-state="testing"],.engine-hub-status[data-state="thinking"]{color:var(--ui-accent-text)}
.engine-hub-status[data-state="paused"]{color:var(--ui-muted)}

/* Archive cards share a compact reading order on phones and desktop. */
#page-archive .archive-entry {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 2px solid var(--ui-border);
  text-align: left;
  line-height: 1.5;
}
#page-archive .archive-entry-kind { font-size: 14px; font-weight: 650; letter-spacing: .01em; }
#page-archive .archive-outcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
#page-archive .archive-result-badge {
  min-width: 0;
  padding: 5px 9px;
  line-height: 1.5;
  font-size: 13px !important;
  overflow-wrap: anywhere;
}
#page-archive .archive-entry-score,
#page-archive .replay-score {
  display: inline-block;
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  color: var(--ui-text);
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
#page-archive .archive-participants,
#page-archive .replay-participants {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}
#page-archive .archive-participant {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
}
#page-archive .participant-color { font-size: 12px; line-height: 1.7; }
#page-archive .archive-participant > span:last-child { min-width: 0; overflow-wrap: anywhere; }
#page-archive .archive-role-summary { font-size: 12px; line-height: 1.5; }
#page-archive .archive-entry-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 16px;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
#page-archive .archive-entry-metadata time,
#page-archive .archive-move-count { white-space: nowrap; }
#page-archive .archive-entry-reason,
#page-archive .replay-reason {
  display: block;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--ui-border);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#page-archive .replay-detail { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px; }
#page-archive .replay-participants { padding: 12px; }
#page-archive .archive-browser > .card-heading { align-items: baseline; flex-wrap: wrap; gap: 8px 14px; }
#page-archive #archive-total { font-size: 13px; white-space: nowrap; }
#page-archive .archive-list { gap: 12px; padding: 4px; }
#page-archive .archive-entry:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
#page-archive .archive-pagination button,
#page-archive .replay-actions .icon-button,
#page-archive .replay-move { min-width: 44px; min-height: 44px; }
#page-archive .replay-actions { flex-wrap: wrap; gap: 8px; }
#page-archive .archive-pagination { flex-wrap: wrap; justify-content: center; gap: 8px; }
@media (max-width: 600px) {
  #page-archive .archive-entry { padding: 15px; gap: 11px; }
  #page-archive .archive-entry-metadata { gap: 4px 12px; }
  #page-archive .archive-entry-kind { font-size: 13px; }
  #page-archive .archive-participant { grid-template-columns: 45px minmax(0, 1fr); gap: 8px; }
  #page-archive .replay-participants { padding: 10px; }
}

/* Archive capacity and explicit cleanup share the existing Pumpkin palette. */
.archive-capacity{padding:22px;margin-bottom:20px;min-width:0}
.archive-capacity .card-heading{margin-bottom:12px}
.archive-limit-description,.archive-management>p,.archive-management-block{font-size:13px;line-height:1.7;color:var(--ui-muted);margin:0 0 16px}
.archive-usage{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.archive-usage-pool{min-width:0;padding:14px 16px;border:1px solid transparent;border-radius:10px;background:var(--ui-surface-soft)}
.archive-usage-pool>span{display:block;font-size:12px;color:var(--ui-muted);margin-bottom:6px}
.archive-usage-pool strong{display:block;font-size:18px;line-height:1.5;font-variant-numeric:tabular-nums;overflow-wrap:normal}
.archive-usage-pool strong>span{font-size:12px;font-weight:400;color:var(--ui-muted)}
.archive-usage progress{appearance:none;display:block;width:100%;height:5px;border:0;border-radius:3px;margin-top:10px;overflow:hidden;background:var(--ui-border);accent-color:var(--ui-accent)}
.archive-usage progress::-webkit-progress-bar{background:var(--ui-border)}
.archive-usage progress::-webkit-progress-value{background:var(--ui-accent)}
.archive-usage progress::-moz-progress-bar{background:var(--ui-accent)}
.archive-usage-pool.is-near-full{border-color:var(--ui-accent)}
.archive-usage-pool.is-full{border-color:var(--ui-danger)}
.archive-capacity-warning,.archive-run-notice{padding:12px 14px;border:1px solid var(--ui-accent);border-radius:9px;background:var(--ui-accent-soft);color:var(--ui-text);font-size:13px;line-height:1.65}
.archive-capacity-warning{margin:16px 0 0}
.archive-run-notice{margin:12px 0 18px;min-width:0}
.archive-run-notice p{margin:0;font-size:13px;line-height:1.65;color:var(--ui-text)}
.archive-run-notice .text-button{padding-left:0;white-space:normal;min-height:44px;text-align:left}
.archive-management{margin-top:18px;border-top:1px solid var(--ui-border);padding-top:6px}
.archive-management>summary{display:flex;align-items:center;justify-content:space-between;min-height:44px;cursor:pointer;font-size:14px;font-weight:600;list-style:none;gap:12px}
.archive-management>summary::-webkit-details-marker{display:none}
.archive-management>summary::after{content:'+';font-size:20px;font-weight:400;color:var(--ui-muted)}
.archive-management[open]>summary::after{content:'−'}
.archive-management>p{margin:10px 0 14px}
.archive-management-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:14px}
.archive-management-fields>div{min-width:0}
.archive-management-fields .form-label{margin:0 0 7px;font-size:13px}
.archive-management-fields input,.archive-management-fields select{width:100%;min-width:0;min-height:44px;box-sizing:border-box;font:inherit;font-size:14px;padding:10px;border:1px solid var(--ui-border);border-radius:8px;color:var(--ui-text);background:var(--ui-surface)}
.archive-management-actions{display:flex;flex-wrap:wrap;gap:10px}
.archive-management .secondary-button{min-height:44px;white-space:normal;font-size:13px}
.archive-management .text-button{min-height:44px;white-space:normal;text-align:left}
.archive-management .archive-remove-button{color:var(--ui-danger);border-color:var(--ui-danger)}
.archive-delete-confirm{padding:14px;border:1px solid var(--ui-danger);border-radius:9px;margin-top:14px;background:var(--ui-danger-soft)}
.archive-delete-confirm p{font-size:13px;line-height:1.7;margin:0 0 12px;color:var(--ui-text)}
.archive-management #archive-management-status:empty{display:none}
.archive-management #archive-management-status{margin-bottom:0}
.archive-management summary:focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px;border-radius:4px}
@media(max-width:650px){
 .archive-capacity{padding:18px}
 .archive-capacity .card-heading{flex-wrap:wrap}
 .archive-usage{grid-template-columns:1fr;gap:9px}
 .archive-usage-pool{padding:12px 14px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;column-gap:12px}
 .archive-usage-pool>span{font-size:13px;margin-bottom:0}
 .archive-usage-pool strong{font-size:17px;white-space:nowrap}
 .archive-usage-pool strong>span{font-size:12px}
 .archive-usage-pool progress{grid-column:1/-1;margin-top:9px}
 .archive-management-fields{grid-template-columns:1fr;gap:13px}
 .archive-management-fields input,.archive-management-fields select{font-size:16px}
 .archive-management-actions>button{flex:1 1 140px}
 .archive-limit-description,.archive-management>p{font-size:13px}
}
@media(max-width:360px){.archive-usage-pool{grid-template-columns:1fr;gap:4px}.archive-usage-pool progress{grid-column:1}}

/* Local archive status, distinct from the future account archive. */
.archive-destinations{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0}
.archive-destination{min-width:0;padding:15px 16px;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface-soft)}
.archive-destination>strong{font-size:14px;display:block}
.archive-destination p,.archive-destination small{font-size:12px;line-height:1.7;color:var(--ui-muted);margin:7px 0 0;display:block}
.archive-cloud-unavailable{background:var(--ui-surface);border-style:dashed}
.archive-usage-pool strong>span{font-size:12px}
.archive-volatile-note{font-size:12px;line-height:1.6;color:var(--ui-accent-text)}
.training-archive-plan{margin:18px 0 12px;padding:14px 16px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-surface-soft)}
.training-archive-plan>strong{font-size:13px}
.training-archive-plan p{font-size:12px;line-height:1.7;color:var(--ui-muted);margin:7px 0 0}
.archive-run-summary{padding:22px;margin:20px 0;min-width:0}
.archive-run-summary .card-heading{flex-wrap:wrap;gap:8px 14px}
.archive-report-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:16px}
.archive-report-metric{min-width:0;padding:0 0 0 14px;border-left:1px solid var(--ui-border)}
.archive-report-metric:first-child{padding-left:0;border-left:0}
.archive-report-metric>span{font-size:12px;color:var(--ui-muted);line-height:1.5;display:block}
.archive-report-metric strong{font-size:26px;line-height:1.5;font-variant-numeric:tabular-nums;display:block;overflow-wrap:anywhere}
.archive-report-metric.has-failures strong{color:var(--ui-danger)}
.archive-report-note{font-size:13px;line-height:1.75;color:var(--ui-muted);margin:16px 0}
.archive-report-actions{display:flex;align-items:center;gap:8px 14px;flex-wrap:wrap}
.archive-report-actions button{min-height:44px;white-space:normal;font-size:13px}
.archive-run-summary[data-archive-state=warning]{border-color:var(--ui-accent)}
@media(max-width:650px){
 .archive-destinations{grid-template-columns:1fr;gap:10px}
 .archive-run-summary{padding:18px}
 .archive-report-metrics{gap:10px}
 .archive-report-metric{padding-left:10px}
 .archive-report-metric strong{font-size:23px}
 .archive-report-actions>button{flex:1 1 150px}
 .training-archive-plan p,.archive-destination p,.archive-destination small{font-size:13px}
}
@media(max-width:360px){.archive-report-metrics{grid-template-columns:1fr}.archive-report-metric{border:0;border-top:1px solid var(--ui-border);padding:9px 0 0}.archive-report-metric:first-child{border:0;padding:0}}

/* Optional long panels share native disclosure behavior; core controls stay exposed. */
.compact-panel { min-width:0; }
.engine-pane .progress-grid { align-items:start; }
.compact-panel>.compact-panel-summary {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:44px;
  margin:0;
  padding:2px 0;
  color:var(--ui-text);
  cursor:pointer;
  list-style:none;
  touch-action:manipulation;
}
.compact-panel-summary::-webkit-details-marker { display:none; }
.compact-panel-summary::marker { content:''; }
.compact-panel-summary>h2,
.compact-panel-summary>strong { flex:1; min-width:0; margin:0; line-height:1.5; overflow-wrap:anywhere; }
.compact-panel-summary>h2 { font-size:18px; }
.compact-panel-summary::after {
  content:'';
  width:8px;
  height:8px;
  flex:0 0 8px;
  border-right:2px solid var(--ui-muted);
  border-bottom:2px solid var(--ui-muted);
  transform:rotate(45deg);
  margin:0 4px 5px 2px;
}
.compact-panel[open]>.compact-panel-summary::after {
  transform:rotate(225deg);
  margin-top:6px;
  margin-bottom:0;
}
.compact-panel-summary:focus-visible {
  outline:3px solid var(--ui-accent);
  outline-offset:4px;
  border-radius:4px;
}
.compact-panel-body { padding-top:14px; min-width:0; }
.weights-card .compact-panel-body>p {
  color:var(--ui-muted);
  font-size:13px;
  line-height:1.85;
  margin:0 0 22px;
}
.history-card .compact-panel-summary .muted { display:block; margin-top:2px; font-size:12px; font-weight:400; }
.test-history-card .compact-panel-body>.text-button { margin-top:12px; }
.archive-destination.compact-panel { align-self:start; }
.archive-destination .compact-panel-body { padding-top:0; }
.archive-destination .compact-panel-summary>strong { font-size:14px; }

@media (max-width:650px) {
  .engine-pane .progress-grid { grid-template-columns:minmax(0,1fr); gap:14px; align-items:start; }
  .engine-pane .weights-card,
  .engine-pane .history-card,
  .test-history-card { padding:15px 18px; }
  .compact-panel-summary>h2 { font-size:17px; }
  .compact-panel-body { padding-top:12px; }
  .history-card .compact-panel-summary .muted { font-size:11px; }
}

/* Mobile focus only: readable identity strips without taking width from the board. */
body.mobile-focus-locked #page-play .play-heading-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:48px;gap:6px;align-items:stretch}
body.mobile-focus-locked #page-play .play-heading-actions>button{width:100%;min-width:0;height:48px;min-height:48px;max-height:48px;margin:0;padding:4px 6px;font-size:12px;line-height:1.25;gap:4px;align-self:stretch;box-sizing:border-box}
body.mobile-focus-locked #page-play #play-analysis-controls{display:flex;align-items:stretch;justify-content:center;grid-column:auto;grid-row:auto;min-width:0;height:48px;min-height:48px;max-height:48px;margin:0;padding:0;gap:0}
body.mobile-focus-locked #page-play #play-analysis-controls .eval-toggle{display:flex;align-items:center;justify-content:center;width:100%;min-width:0;height:48px;min-height:48px;max-height:48px;margin:0;padding:4px;gap:5px;font-size:12px;line-height:1.25;color:var(--ui-text,var(--ink));border:1px solid var(--ui-border,var(--line));border-radius:6px;white-space:normal;box-sizing:border-box}
body.mobile-focus-locked #page-play #play-analysis-controls input{flex:none;width:18px;height:18px;min-width:18px;margin:0}
body.mobile-focus-locked #page-play .board-surface{grid-template-columns:minmax(0,1fr);column-gap:0}
body.mobile-focus-locked #page-play .board-surface>.player-row:first-child{grid-column:1/-1;grid-row:1}
body.mobile-focus-locked #page-play .player-row{height:52px;min-height:52px;max-height:52px;min-width:0;margin:0;padding:6px 10px;gap:8px}
body.mobile-focus-locked #page-play .player-identity{flex:1 1 auto;min-width:0;gap:8px}
body.mobile-focus-locked #page-play .player-identity>div:last-child{min-width:0}
body.mobile-focus-locked #page-play .player-identity strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:18px}
body.mobile-focus-locked #page-play .player-detail{display:block;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:16px}
body.mobile-focus-locked #page-play .player-avatar{display:grid;flex:none;width:32px;height:32px;border-radius:7px;font-size:28px}
body.mobile-focus-locked #page-play .player-avatar :is(img,svg){max-width:28px;max-height:30px}
body.mobile-focus-locked #page-play .turn-pill{flex:none;font-size:11px;line-height:16px;padding:4px 6px}
body.mobile-focus-locked.mobile-focus-compact #page-play .player-avatar{display:none}
body.mobile-focus-locked.mobile-focus-compact #page-play .player-detail{display:block}
body.mobile-focus-locked.mobile-focus-narrow #page-play .turn-pill{display:none}
body.mobile-focus-locked.mobile-focus-landscape #page-play .play-heading-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .play-heading-actions>button{font-size:10px;padding:2px}
body.mobile-focus-locked.mobile-focus-landscape #page-play #play-analysis-controls{grid-column:auto}
body.mobile-focus-locked.mobile-focus-landscape #page-play #play-analysis-controls .eval-toggle{flex-direction:column;gap:0;font-size:10px;line-height:1.1;padding:2px;min-height:48px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .player-row{height:44px;min-height:44px;max-height:44px;padding:3px 8px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .player-avatar{display:none}
/* Reuse the normal history node; only its single horizontal row may scroll. */
body.mobile-focus-locked #page-play .bottom-player{width:100%;border-top:1px solid var(--ui-border);align-items:center}
body.mobile-focus-locked #page-play .mobile-focus-history{grid-column:1/-1;grid-row:4}
#page-archive #replay-moves.focus-move-strip,
body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip{display:flex;flex:1 1 auto;flex-wrap:nowrap;align-items:stretch;gap:0;min-width:0;width:100%;height:100%;min-height:0;max-height:100%;margin:0;padding:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;touch-action:pan-x pinch-zoom;scrollbar-width:none;scroll-behavior:auto}
#page-archive #replay-moves.focus-move-strip::-webkit-scrollbar,
body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip::-webkit-scrollbar{display:none}
#page-archive #replay-moves.focus-move-strip .move-row,
body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip .move-row{display:flex;flex:none;align-items:stretch;gap:0;width:max-content;height:100%;min-height:0;margin:0;padding:0;border:0;background:transparent}
#page-archive #replay-moves.focus-move-strip .move-row:nth-child(even),
body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip .move-row:nth-child(even){background:var(--ui-surface-soft)}
#page-archive #replay-moves.focus-move-strip .move-row>span:first-child{display:none}
body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip .move-row>span:first-child{flex:none;width:auto;min-width:20px;font-size:11px;color:var(--ui-muted)}
#page-archive #replay-moves.focus-move-strip .move-row>button,
body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip .move-row>button,body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip>.focus-strip-start{display:inline-flex;flex:none;align-items:center;justify-content:center;min-width:44px;min-height:44px;height:100%;margin:0;padding:6px 8px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ui-text);font:inherit;font-size:13px;line-height:1.25;white-space:nowrap}
#page-archive #replay-moves.focus-move-strip .history-move[aria-current=step],
body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip .history-move[aria-current=step]{background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-accent-text);font-weight:700}
#page-archive #replay-moves.focus-move-strip .history-move:focus-visible,
body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip .history-move:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}
#page-archive #replay-moves.focus-move-strip .move-placeholder,
#page-archive #replay-moves.focus-move-strip .moves-empty,
body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip .moves-empty,body:is(.mobile-focus-locked,.mobile-history-active) #page-play #moves-list.focus-move-strip .move-placeholder{display:none}
body:is(.mobile-focus-locked,.mobile-history-active) #page-play .mobile-focus-history>.secondary-button{flex:none;min-width:64px;max-width:100px;height:44px;min-height:44px;max-height:44px;margin:0;padding:4px 8px;font-size:11px;line-height:1.25}
body.mobile-focus-locked #page-play .mobile-focus-controls{display:flex;flex:none;width:100%;max-width:var(--focus-board-size);height:52px;min-height:52px;max-height:52px;margin:0;padding:4px 0;overflow:hidden;touch-action:manipulation}
body.mobile-focus-locked #page-play .mobile-focus-controls>.live-history-tools,body.mobile-focus-locked #page-play #focus-last-move,body.mobile-focus-locked #page-play #status-banner{display:none}
body.mobile-focus-locked #page-play .board-toolbar{flex:none;width:100%;height:52px;min-height:52px;max-height:52px;margin:0;padding:4px 0;overflow:hidden}
body.mobile-focus-locked #page-play .board-toolbar>div{flex:1;display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;width:100%;min-width:0;gap:4px}
body.mobile-focus-locked.mobile-focus-landscape #page-play .mobile-focus-controls{align-self:start;max-width:none;height:60px;min-height:60px;max-height:60px;margin-top:var(--focus-controls-top);padding:4px 0}
body.mobile-focus-locked.mobile-focus-landscape #page-play #resign{width:44px;min-width:44px;padding:4px;font-size:0}

/* Local presentation only. Existing dimensions and history actions are retained. */
#page-play #moves-list.focus-move-strip .move-row>span:first-child{display:none}
#page-play #live-history-controls{align-items:center;column-gap:6px}
#page-play #live-history-controls>button,
#page-archive .replay-actions :is(#replay-start,#replay-prev,#replay-next,#replay-end){display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);color:var(--ui-text)}
#page-play #live-history-controls>button>[data-icon],
#page-archive .replay-actions :is(#replay-start,#replay-prev,#replay-next,#replay-end)>[data-icon]{display:inline-flex;align-items:center;justify-content:center}
#page-play #live-history-controls>button:disabled,
#page-archive .replay-actions :is(#replay-start,#replay-prev,#replay-next,#replay-end):disabled{opacity:.32;box-shadow:none;cursor:default}
#page-play #live-history-controls>button:focus-visible,
#page-archive .replay-actions :is(#replay-start,#replay-prev,#replay-next,#replay-end):focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}
#page-play .board-toolbar #undo{border:1px solid var(--ui-accent);background:var(--ui-accent-soft);color:var(--ui-accent-text)}
#page-play .board-toolbar #undo:disabled{opacity:.32;box-shadow:none}

/* Existing guide chapters use native disclosure controls; no layout outside the guide changes. */
#page-about .guide-chapter {
  padding:0;
  overflow:visible;
}
#page-about .guide-chapter-summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  min-height:64px;
  padding:22px 28px;
  margin:0;
  background:var(--ui-surface);
  border-radius:inherit;
  color:var(--ui-text);
  cursor:pointer;
  list-style:none;
  touch-action:manipulation;
}
#page-about .guide-chapter-summary::-webkit-details-marker { display:none; }
#page-about .guide-chapter-summary::marker { content:''; }
#page-about .guide-chapter-summary>h2 { min-width:0; }
#page-about .guide-chapter-summary h2 {
  margin:0;
  font-size:24px;
  line-height:1.45;
  overflow-wrap:anywhere;
}
#page-about .guide-chapter-title { display:block; margin-top:10px; }
#page-about .guide-chapter-summary::after {
  content:'';
  flex:0 0 9px;
  width:9px;
  height:9px;
  margin:0 4px 5px 0;
  border-right:2px solid var(--ui-muted);
  border-bottom:2px solid var(--ui-muted);
  transform:rotate(45deg);
}
#page-about .guide-chapter-summary:focus-visible {
  outline:3px solid var(--ui-accent);
  outline-offset:3px;
}
#page-about .guide-chapter[open]>.guide-chapter-summary {
  position:sticky;
  top:8px;
  z-index:4;
  border-bottom:1px solid var(--ui-border);
  border-bottom-left-radius:0;
  border-bottom-right-radius:0;
}
#page-about .guide-chapter[open]>.guide-chapter-summary::after {
  transform:rotate(225deg);
  margin-top:6px;
  margin-bottom:0;
}
#page-about .guide-chapter-body {
  min-width:0;
  padding:18px 28px 28px;
}
@media (max-width:800px) {
  #page-about .guide-chapter-summary { padding:20px 24px; }
  #page-about .guide-chapter-body { padding:18px 24px 24px; }
}
@media (max-width:600px) {
  #page-about .guide-chapter-summary { gap:14px; padding:18px 22px; }
  #page-about .guide-chapter-summary h2 { font-size:22px; }
  #page-about .guide-chapter-body { padding:16px 22px 22px; }
}

/* Native guide disclosures need their own inner corners because visible
   overflow preserves sticky chapter summaries while reading a long chapter.
   The card has a 16px outer radius and a 1px border. */
#page-about .guide-chapter>.guide-chapter-summary {
  border-radius:15px;
  background-clip:padding-box;
}
#page-about .guide-chapter[open]>.guide-chapter-summary {
  border-radius:15px 15px 0 0;
}

/* Decoration stays on static controls and disclosure/dialog surfaces. No
   animation is attached to the board, analysis, or frequently updated lists. */
@media (prefers-reduced-motion:no-preference) {
  #page-about .guide-chapter-summary::after,
  #page-engine .compact-panel-summary::after,
  #page-tests .compact-panel-summary::after {
    transition:transform 160ms ease;
  }
  #page-about .guide-chapter[data-disclosure-motion="closing"]>.guide-chapter-summary::after,
  #page-engine .compact-panel[data-disclosure-motion="closing"]>.compact-panel-summary::after,
  #page-tests .compact-panel[data-disclosure-motion="closing"]>.compact-panel-summary::after {
    transform:rotate(45deg);
  }
  #settings-dialog[open],
  #opponent-dialog[open],
  #new-dialog[open],
  #confirm-dialog[open],
  .mobile-menu:not([hidden])>.mobile-menu-panel {
    animation:interface-reveal-r13 180ms ease-out;
  }
  @keyframes interface-reveal-r13 {
    from { opacity:.75; transform:translateY(6px); }
    to { opacity:1; transform:translateY(0); }
  }
}
@media (prefers-reduced-motion:reduce) {
  #settings-dialog[open],
  #opponent-dialog[open],
  #new-dialog[open],
  #confirm-dialog[open],
  .mobile-menu:not([hidden])>.mobile-menu-panel {
    animation:none;
  }
}

/* Guide content must scroll behind its own opaque chapter heading, never
   through the gap above it. Keep overflow visible: clipping this card would
   make the sticky summary stop following the page scroll. */
#page-about .guide-chapter {
  isolation:isolate;
}
#page-about .guide-chapter[open]>.guide-chapter-summary {
  position:sticky;
  top:0;
  z-index:2;
  background:var(--ui-surface);
}
#page-about .guide-chapter>.guide-chapter-body {
  position:relative;
  z-index:0;
}

/* Three game actions and two arrows share a 52px row in portrait focus. */
body.mobile-focus-locked #page-play .mobile-focus-controls {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  align-items:center;
  column-gap:2px;
  width:100%;
  max-width:none;
  height:52px;
  min-height:52px;
  max-height:52px;
  margin:0;
  padding:4px 0;
  overflow:hidden;
  background:var(--ui-surface);
}
body.mobile-focus-locked #page-play .mobile-focus-controls :is(#live-history-controls,.board-toolbar>div)>button {
  background:transparent;
  border:1px solid var(--ui-border-strong);
  border-radius:8px;
  box-shadow:none;
}
body.mobile-focus-locked #page-play .mobile-focus-controls :is(#live-history-controls,.board-toolbar>div)>button:focus-visible {
  outline-offset:-2px;
}
body.mobile-focus-locked #page-play .mobile-focus-controls>.live-history-tools {
  display:contents;
}
body.mobile-focus-locked #page-play .mobile-focus-controls #live-history-controls {
  display:grid;
  grid-row:1;
  grid-column:4 / span 2;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:center;
  gap:2px;
  width:100%;
  min-width:0;
  height:44px;
  min-height:44px;
  max-height:44px;
  margin:0;
  padding:0;
}
body.mobile-focus-locked #page-play .mobile-focus-controls #live-history-controls>button {
  width:100%;
  min-width:0;
  height:44px;
  min-height:44px;
  max-height:44px;
  padding:0;
  margin:0;
}
body.mobile-focus-locked #page-play .mobile-focus-controls :is(#live-history-start,#live-history-end) {
  display:none;
}
body.mobile-focus-locked #page-play .mobile-focus-controls .board-toolbar {
  display:flex;
  grid-row:1;
  grid-column:1 / span 3;
  align-items:center;
  width:100%;
  min-width:0;
  height:44px;
  min-height:44px;
  max-height:44px;
  margin:0;
  padding:0;
  overflow:hidden;
}
body.mobile-focus-locked #page-play .mobile-focus-controls .board-toolbar>div {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:center;
  gap:2px;
  width:100%;
  min-width:0;
}
body.mobile-focus-locked #page-play .mobile-focus-controls .board-toolbar>div>button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-width:0;
  height:44px;
  min-height:44px;
  max-height:44px;
  margin:0;
  padding:0;
}
body.mobile-focus-locked #page-play .mobile-focus-controls #resign {
  gap:0;
}
/* Use the same explicit label as ordinary mobile play; shared typography
   may change control font sizes without exposing text outside an icon cell. */
body.mobile-focus-locked #page-play .mobile-focus-controls #resign>.resign-label {
  display:none;
}
body.mobile-focus-locked #page-play .mobile-focus-controls #resign [data-icon] {
  font-size:20px;
}
/* Its return button already lives in the horizontal strip. Extra banner text
   must not create an implicit row inside the pinned footer. */
body.mobile-focus-locked #page-play .mobile-focus-controls .live-history-banner {
  display:none;
}
/* Wrap the right-hand arrows below the actions when five 44px targets
   cannot share the side column. */
body.mobile-focus-locked.mobile-focus-landscape #page-play .mobile-focus-controls {
  display:flex;
  flex-flow:row wrap;
  align-content:flex-start;
  align-items:center;
  gap:4px;
  height:100px;
  min-height:100px;
  max-height:100px;
  margin-top:var(--focus-controls-top);
  padding:4px 0;
}
body.mobile-focus-locked.mobile-focus-landscape #page-play .mobile-focus-controls #live-history-controls {
  flex:0 0 90px;
  min-width:90px;
  margin-inline-start:auto;
}
body.mobile-focus-locked.mobile-focus-landscape #page-play .mobile-focus-controls .board-toolbar {
  flex:0 0 136px;
  min-width:136px;
}

/* Suppress native mobile blue tap overlays on interactive chrome, including
   labels and native summaries. Keep keyboard focus and editable fields native. */
:is(.sidebar,.topbar,.mobile-nav,.mobile-menu-panel,.page,dialog) :is(button,a,summary,label,[tabindex],[role="button"],[role="tab"],.archive-eval-chart) {
  -webkit-tap-highlight-color:transparent;
}
:is(.sidebar,.topbar,.mobile-nav,.mobile-menu-panel,.page,dialog) :is(button,summary,[role="button"],[role="tab"],.eval-toggle,.toggle-label,.settings-toggle,.side-options>label),
:is(.sidebar,.topbar,.mobile-nav,.mobile-menu-panel) a,
#page-about .guide-contents a {
  -webkit-user-select:none;
  user-select:none;
}

/* Undo changes the actual game; its curved icon and description distinguish it
   from history navigation without a persistent orange tile. */
#page-play .board-toolbar #undo {
  border-color:var(--ui-border);
  background:var(--ui-surface);
  color:var(--ui-muted);
}

/* Numbers belong to each move in the single scrolling focus strip. The normal
   table retains its existing number column and notation spacing. */
#page-archive #replay-moves .history-move-number,
#page-play #moves-list .history-move-number { display:none; }
#page-archive #replay-moves.focus-move-strip .history-move-number,
#page-play #moves-list.focus-move-strip .history-move-number {
  display:inline;
  flex:none;
  margin-right:5px;
  color:var(--ui-muted);
  font-size:10px;
  font-weight:500;
  font-variant-numeric:tabular-nums;
}

/* Use the same order as mobile focus, with game actions before the arrows. */
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls {
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  align-items:center;
  column-gap:2px;
  row-gap:8px;
  width:100%;
  min-width:0;
  margin:4px 0 0;
  padding:4px 0 0;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls>.live-history-tools {
  display:contents;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls #live-history-controls {
  display:grid;
  grid-column:4 / span 4;
  grid-row:1;
  grid-template-columns:repeat(4,minmax(0,1fr));
  align-items:center;
  gap:2px;
  width:100%;
  min-width:0;
  height:44px;
  margin:0;
  padding:0;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls .board-toolbar {
  display:flex;
  grid-column:1 / span 3;
  grid-row:1;
  align-items:center;
  width:100%;
  min-width:0;
  height:44px;
  margin:0;
  padding:0;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls .board-toolbar>.game-mode {
  display:none;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls .board-toolbar>div {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:center;
  gap:2px;
  width:100%;
  min-width:0;
  margin:0;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls :is(#live-history-controls,.board-toolbar>div)>button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-width:0;
  height:44px;
  min-height:44px;
  max-height:44px;
  padding:0;
  margin:0;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls #cancel-premove {
  grid-column:1 / -1;
  justify-self:start;
  max-width:100%;
  margin:0 8px;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls .live-history-banner {
  grid-column:1 / -1;
  min-width:0;
  margin:0 8px;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls #focus-last-move {
  grid-column:1 / -1;
  margin:0 8px;
}
body:not(.mobile-focus-locked) #page-play .mobile-focus-controls #status-banner {
  grid-column:1 / -1;
  min-width:0;
}
/* The label remains in aria-label/title while the narrow row uses its flag. */
@media(max-width:850px),(hover:none),(pointer:coarse) {
  body:not(.mobile-focus-locked) #page-play .mobile-focus-controls #resign {
    gap:0;
  }
  /* Hide the explicit visual label, not its inherited font size. The shared
     typography layer intentionally owns control fonts. aria-label/title stay. */
  body:not(.mobile-focus-locked) #page-play .mobile-focus-controls #resign>.resign-label {
    display:none;
  }
  body:not(.mobile-focus-locked) #page-play .mobile-focus-controls #resign [data-icon] {
    font-size:20px;
  }
}
@media(min-width:851px) and (hover:hover) and (pointer:fine) {
  body:not(.mobile-focus-locked) #page-play .mobile-focus-controls {
    grid-template-columns:repeat(2,minmax(0,1fr)) minmax(100px,2fr) repeat(4,minmax(0,1fr));
  }
  body:not(.mobile-focus-locked) #page-play .mobile-focus-controls .board-toolbar>div {
    grid-template-columns:repeat(2,minmax(0,1fr)) minmax(100px,2fr);
  }
  body.focus-mode-active:not(.mobile-focus-locked) #page-play .mobile-focus-controls {
    grid-template-columns:repeat(2,minmax(0,1fr)) minmax(100px,2fr) repeat(2,minmax(0,1fr));
  }
  body.focus-mode-active:not(.mobile-focus-locked) #page-play .mobile-focus-controls #live-history-controls {
    grid-column:4 / span 2;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body.focus-mode-active:not(.mobile-focus-locked) #page-play .mobile-focus-controls :is(#live-history-start,#live-history-end) {
    display:none;
  }
}

/* One feedback treatment for application controls. Selected/current states,
   primary actions and outcome colors keep their own existing palette. The
   board's square buttons and the evaluation surface are intentionally excluded. */
:where(.sidebar,.topbar,.mobile-nav,.mobile-menu-panel,.page,dialog)
  :is(button,a[href],summary,.eval-toggle,.toggle-label,.settings-toggle,.side-options>label,[role="button"],[role="tab"]):not(.square):not(:disabled):not([aria-disabled="true"]) {
  filter:none;
}

/* A touch release never leaves a simulated hover tint behind. */
@media (hover:hover) and (pointer:fine) {
  :where(.sidebar,.topbar,.mobile-nav,.mobile-menu-panel,.page,dialog)
    :is(button,a[href],summary,.eval-toggle,.toggle-label,.settings-toggle,.side-options>label,[role="button"],[role="tab"]):not(.square):not(:disabled):not([aria-disabled="true"]):hover {
    filter:brightness(1.045);
  }
}

/* A short neutral press works for mouse, touch and native keyboard activation.
   No transforms or dimensions change, and no event waits for this effect. */
:where(.sidebar,.topbar,.mobile-nav,.mobile-menu-panel,.page,dialog)
  :is(button,a[href],summary,.eval-toggle,.toggle-label,.settings-toggle,.side-options>label,[role="button"],[role="tab"]):not(.square):not(:disabled):not([aria-disabled="true"]):active {
  filter:brightness(.94);
}

@media (prefers-reduced-motion:no-preference) {
  :where(.sidebar,.topbar,.mobile-nav,.mobile-menu-panel,.page,dialog)
    :is(button,a[href],summary,.eval-toggle,.toggle-label,.settings-toggle,.side-options>label,[role="button"],[role="tab"]):not(.square):not(:disabled):not([aria-disabled="true"]) {
    transition:filter 120ms ease-out;
  }
}

/* Archive facets stay keyboard accessible inside the native disclosure. */
#page-archive .archive-filter-panel {
  margin:12px 0;
  padding:0 0 12px;
  border-bottom:1px solid var(--ui-border);
}
#page-archive .archive-filter-panel>.compact-panel-summary {
  min-height:44px;
  gap:10px;
}
#page-archive #archive-filter-count {
  min-width:0;
  font-size:12px;
  font-weight:400;
  line-height:1.5;
  color:var(--ui-muted);
}
#page-archive .archive-filter-panel .archive-filters {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px 12px;
  margin:0;
}
#page-archive .archive-filters>div { min-width:0; }
#page-archive .archive-search,
#page-archive .archive-choice-group { grid-column:1 / -1; }
#page-archive .archive-choice-group {
  min-width:0;
  margin:0;
  padding:0;
  border:0;
}
#page-archive .archive-choice-group legend {
  margin:0 0 2px;
  padding:0;
  font-weight:650;
  color:var(--ui-text);
}
#page-archive .archive-choices {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  column-gap:12px;
}
#page-archive .archive-choices label {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  min-height:44px;
  margin:0;
  padding:4px 0;
  color:var(--ui-text);
  font-weight:400;
  cursor:pointer;
}
#page-archive .archive-choices input[type="checkbox"] {
  accent-color:var(--ui-neutral);
  flex:0 0 20px;
  width:20px;
  height:20px;
  min-height:0;
  margin:0;
  padding:0;
  cursor:pointer;
}
#page-archive .archive-filter-selection {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:8px;
  min-width:0;
  margin:0 0 12px;
}
#page-archive .archive-active-filters {
  display:flex;
  flex:1 1 auto;
  flex-wrap:wrap;
  gap:6px;
  min-width:0;
}
#page-archive .archive-filter-chip {
  display:inline-flex;
  align-items:center;
  gap:8px;
  max-width:100%;
  min-width:0;
  min-height:44px;
  margin:0;
  padding:7px 10px;
  border:1px solid var(--ui-border);
  border-radius:8px;
  background:var(--ui-surface-soft);
  color:var(--ui-text);
  font-size:12px;
  line-height:1.4;
  text-align:left;
}
#page-archive .archive-filter-value {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#page-archive .archive-filter-chip>span:last-child { flex:none; font-size:17px; }
#page-archive #archive-clear-filters { min-height:44px; margin:0; font-size:12px; }
#page-archive .archive-filters input[data-filter-active="true"] { border-color:var(--ui-border-strong); }
@media(prefers-reduced-motion:no-preference) {
  #page-archive .archive-filter-panel>.compact-panel-summary::after { transition:transform 160ms ease; }
  #page-archive .archive-filter-panel[data-disclosure-motion="closing"]>.compact-panel-summary::after { transform:rotate(45deg); }
}
@media(max-width:650px) {
  #page-archive .archive-filter-panel .archive-filters {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px 10px;
  }
  #page-archive .archive-filters :is(input:not([type="checkbox"]),select) {
    width:100%;
    max-width:100%;
    min-width:0;
    min-height:44px;
    padding:10px 8px;
    font-size:16px;
    box-sizing:border-box;
  }
  #page-archive .archive-filters label { font-size:13px; }
}

/* Mobile capacity information stays in horizontal rows. The desktop archive,
   storage controls and all persistence behavior retain their existing layout. */
@media(max-width:650px) {
  #page-archive .archive-capacity .archive-destinations {
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:start;
    gap:8px;
    margin:12px 0;
  }
  #page-archive .archive-capacity .archive-destination {
    min-width:0;
    padding:10px;
    overflow-wrap:anywhere;
  }
  #page-archive .archive-capacity .archive-destination>strong,
  #page-archive .archive-capacity .archive-destination .compact-panel-summary>strong {
    font-size:13px;
    line-height:1.45;
  }
  #page-archive .archive-capacity .archive-destination .compact-panel-summary {
    gap:8px;
    min-height:44px;
  }
  #page-archive .archive-capacity .archive-destination .compact-panel-summary::after {
    margin-right:0;
  }
  #page-archive .archive-capacity .archive-destination p,
  #page-archive .archive-capacity .archive-destination small {
    font-size:13px;
    line-height:1.55;
  }
  #page-archive .archive-capacity .archive-usage {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
  }
  #page-archive .archive-capacity .archive-usage-pool {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:6px;
    min-width:0;
    padding:10px 8px;
    overflow-wrap:anywhere;
  }
  #page-archive .archive-capacity .archive-usage-pool>span {
    min-height:36px;
    margin:0;
    font-size:13px;
    line-height:1.4;
  }
  #page-archive .archive-capacity .archive-usage-pool strong {
    min-width:0;
    font-size:18px;
    line-height:1.4;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  #page-archive .archive-capacity .archive-usage-pool strong>span {
    display:block;
    margin-top:2px;
    font-size:12px;
    line-height:1.35;
    white-space:normal;
  }
}

/* Keep the archive's real counters in view; storage explanations use the
   existing native disclosure and height animator. No game or global rules. */
#page-archive .archive-capacity>.archive-storage-caption {
  margin:0 0 14px;
  color:var(--ui-muted);
  font-size:13px;
  line-height:1.65;
}
#page-archive .archive-capacity>.archive-storage-details {
  margin:14px 0 0;
  padding:0;
  border:0;
  border-top:1px solid var(--ui-border);
  border-radius:0;
  background:transparent;
  min-width:0;
}
#page-archive .archive-storage-details>summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:44px;
  margin:0;
  padding:6px 0;
  color:var(--ui-text);
  font-size:14px;
  font-weight:600;
  line-height:1.5;
  list-style:none;
  cursor:pointer;
}
#page-archive .archive-storage-details>summary::-webkit-details-marker {
  display:none;
}
#page-archive .archive-storage-details>summary::after {
  content:'+';
  flex:none;
  color:var(--ui-muted);
  font-size:20px;
  font-weight:400;
}
#page-archive .archive-storage-details[open]>summary::after {
  content:'−';
}
#page-archive .archive-storage-details>summary:focus-visible {
  outline:2px solid var(--ui-accent);
  outline-offset:3px;
  border-radius:4px;
}
#page-archive .archive-storage-details-body {
  min-width:0;
  padding-top:6px;
}
#page-archive .archive-storage-details-body>.archive-destinations {
  margin-bottom:0;
}
#page-archive .archive-capacity>.archive-storage-details+.archive-management {
  margin-top:4px;
}

/* Import confirmation only; the board and page layout retain their dimensions. */
#model-import-dialog { width:min(580px,calc(100% - 24px)); max-height:calc(100dvh - 24px); overflow:auto; overscroll-behavior:contain; }
#model-import-dialog h2 { margin:0 0 14px; }
#model-import-dialog p { line-height:1.7; }
#model-import-dialog .model-import-comparison { display:grid; gap:12px; margin:20px 0; }
#model-import-dialog .model-import-comparison>div { min-width:0; padding:14px; border:1px solid var(--ui-border); border-radius:10px; background:var(--ui-surface-soft); }
#model-import-dialog dt { font-weight:600; }
#model-import-dialog dd { margin:6px 0 0; line-height:1.7; color:var(--ui-muted); overflow-wrap:anywhere; }
#model-import-file { display:block; margin-top:3px; font-size:12px; font-weight:400; color:var(--ui-muted); overflow-wrap:anywhere; }
#model-import-dialog #backup-current-model { min-height:44px; max-width:100%; white-space:normal; }
#model-import-dialog .model-import-backup-note { margin-top:12px; font-size:13px; }
#model-import-status { margin-top:12px; }
#model-import-status:empty { display:none; }
#model-import-dialog .dialog-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
#model-import-dialog .dialog-actions button { flex:1 1 150px; min-height:44px; white-space:normal; }

/* Keep the original header in normal flow; no new fixed spacer or page sizing. */
.main-shell>.topbar {
  position:sticky;
  top:0;
  z-index:20;
  background:var(--ui-surface);
  flex-wrap:nowrap;
}
.main-shell>.topbar .topbar-right { min-width:0; }
/* Header geometry belongs to the shared shell, independently of the active tab.
   Keep the compact play header and use the same chrome on every other page. */
@media(min-width:851px) and (hover:hover) and (pointer:fine) {
  .main-shell>.topbar {
    height:52px;
    min-height:52px;
    padding:4px clamp(16px,1.6vw,32px);
  }
}
@media(max-width:850px), (max-width:1100px) and (hover:none), (max-width:1100px) and (pointer:coarse) {
  .main-shell>.topbar {
    height:60px;
    min-height:60px;
    padding:8px 12px;
    gap:8px;
  }
  .main-shell>.topbar .topbar-mobile-brand {
    gap:7px;
    font-size:20px;
  }
  .main-shell>.topbar .topbar-mobile-brand img {
    width:28px;
    height:32px;
  }
  .main-shell>.topbar .save-state {
    min-width:0;
    max-width:134px;
    font-size:10px;
    line-height:1.3;
  }
}
@media(max-width:380px) {
  .main-shell>.topbar { column-gap:5px; }
  .main-shell>.topbar .topbar-mobile-brand { gap:5px; font-size:18px; }
  .main-shell>.topbar .save-state { max-width:88px; }
}
/* Other sticky surfaces follow the measured shared header height. */
#page-about .guide-chapter[open]>.guide-chapter-summary {
  top:var(--sticky-topbar-height,76px);
}
#page-about .guide-chapter {
  scroll-margin-top:calc(var(--sticky-topbar-height,76px) + 8px);
}
#page-archive .replay-card {
  top:calc(var(--sticky-topbar-height,76px) + 20px);
}

/* Account surfaces only. The board, training panels and main navigation retain their layout. */
#account-dialog { width:min(640px,calc(100% - 24px)); max-height:calc(100dvh - 24px); overflow:auto; overscroll-behavior:contain; }
#account-dialog h2 { margin:10px 0 12px; }
#account-dialog h3 { margin:0 0 12px; font-size:17px; }
#account-dialog p { line-height:1.7; }
#account-dialog .account-intro { font-size:13px; margin-bottom:18px; }
#account-dialog .account-auth-modes { display:flex; gap:8px; margin-bottom:18px; }
#account-dialog .account-auth-modes button { flex:1; min-height:44px; }
#account-dialog .account-auth-modes button[aria-pressed="true"] { border-color:var(--ui-accent); background:var(--ui-accent-soft); color:var(--ui-accent-text); }
#account-dialog label { display:block; font-size:13px; font-weight:600; line-height:1.5; margin:14px 0 7px; }
#account-dialog input:not([type="checkbox"]) { display:block; width:100%; min-width:0; min-height:44px; font-size:16px; }
#account-dialog form>.primary-button { margin-top:18px; width:100%; min-height:44px; }
#account-dialog .account-section { margin-top:22px; padding-top:20px; border-top:1px solid var(--ui-border); }
#account-dialog .account-profile-avatars { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#account-dialog .account-avatar-slot { display:flex; align-items:center; gap:10px; min-width:0; padding:12px; border:1px dashed var(--ui-border-strong); border-radius:10px; }
#account-dialog .account-avatar-placeholder { flex:0 0 38px; width:38px; height:38px; display:grid; place-items:center; border-radius:10px; background:var(--ui-surface-soft); color:var(--ui-muted); font-weight:600; }
#account-dialog .account-avatar-slot strong { display:block; font-size:13px; }
#account-dialog .account-avatar-slot small { display:block; margin-top:4px; color:var(--ui-muted); font-size:11px; line-height:1.5; }
#account-dialog .account-identity { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
#account-current-email,#account-existing-target { overflow-wrap:anywhere; }
#account-dialog .account-sync-toggle { display:flex; align-items:flex-start; gap:10px; font-weight:400; cursor:pointer; }
#account-dialog .account-sync-toggle input { flex:none; width:18px; height:18px; accent-color:var(--ui-accent); margin-top:2px; }
#account-dialog .account-sync-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
#account-dialog .account-sync-actions button { flex:1 1 190px; min-height:44px; white-space:normal; }
#account-dialog .account-sync-summary { padding:14px; border:1px solid var(--ui-border); border-radius:10px; background:var(--ui-surface-soft); }
#account-sync-count { margin-top:6px; font-variant-numeric:tabular-nums; }
#account-sync-metrics,#account-sync-note { margin-top:10px; font-size:13px; }
#account-dialog .account-existing-confirmation { margin-top:16px; padding:16px; border:1px solid var(--ui-accent); border-radius:10px; background:var(--ui-accent-soft); }
#account-message,#account-session-error { margin-top:16px; font-size:13px; overflow-wrap:anywhere; }
#account-message:empty,#account-session-error:empty { display:none; }
#account-message[data-state="error"],#account-session-error { color:var(--ui-danger); }
#account-dialog .account-local-note { margin-top:18px; font-size:12px; }
#account-dialog button { max-width:100%; }
#page-archive #archive-cloud-status,#page-archive #archive-cloud-count { overflow-wrap:anywhere; }
@media(max-width:420px) {
 #account-dialog .account-profile-avatars { grid-template-columns:1fr; }
 #account-dialog .account-identity>.secondary-button { min-height:44px; }
}

/* Local play preference only; board, navigation and shared theme tokens stay intact. */
#engine-style-card { padding:20px 22px; margin-bottom:20px; min-width:0; }
#engine-style-card .compact-panel-summary { flex-wrap:wrap; }
#engine-style-card .compact-panel-summary h2 { flex:1 1 140px; }
#engine-style-card .play-style-summary { color:var(--ui-accent-text); font-size:12px; font-weight:600; margin-left:auto; }
#engine-style-card .play-style-intro,
#engine-style-card .play-style-note,
#engine-style-card #engine-style-status { font-size:12px; line-height:1.75; color:var(--ui-muted); }
#engine-style-card .play-style-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; padding:0; margin:14px 0; border:0; min-width:0; }
#engine-style-card .play-style-options legend { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#engine-style-card .play-style-option { display:grid; grid-template-columns:18px minmax(0,1fr); align-content:start; gap:7px; min-width:0; min-height:100px; padding:12px 10px; border:1px solid var(--ui-border); border-radius:10px; background:var(--ui-surface); cursor:pointer; touch-action:manipulation;  }
@media (hover:hover) and (pointer:fine) {
  #engine-style-card .play-style-option:hover { filter:brightness(1.045); }
}
#engine-style-card .play-style-option:active { filter:brightness(.94); }
@media (prefers-reduced-motion:no-preference) {
  #engine-style-card .play-style-option { transition:filter 120ms ease-out; }
}
#engine-style-card .play-style-option.is-selected { border-color:var(--ui-accent); background:var(--ui-accent-soft); }
#engine-style-card .play-style-option:focus-within { outline:2px solid var(--ui-focus); outline-offset:2px; }
#engine-style-card .play-style-option input { margin:2px 0 0; width:17px; height:17px; accent-color:var(--ui-accent); }
#engine-style-card .play-style-option strong { display:block; font-size:13px; color:var(--ui-text); line-height:1.5; overflow-wrap:anywhere; }
#engine-style-card .play-style-option small { display:block; margin-top:5px; font-size:11px; color:var(--ui-muted); line-height:1.65; overflow-wrap:anywhere; }
#engine-style-card .play-style-note { margin-top:10px; }
@media (max-width:600px) {
  #engine-style-card { padding:16px 18px; }
  #engine-style-card .play-style-options { grid-template-columns:minmax(0,1fr); }
  #engine-style-card .play-style-option { min-height:54px; padding:11px 12px; gap:10px; }
  #engine-style-card .play-style-option small { margin-top:2px; }
}
@media (prefers-reduced-motion:reduce) {
  #engine-style-card .play-style-option { transition:none; }
}

/* Local explanations stay in document flow and use the existing native
   disclosure controller. No page, board, typography or theme defaults change. */
.context-help {
  min-width:0;
  margin-block:10px;
  color:var(--ui-muted);
  font-size:13px;
  line-height:1.65;
}
.context-help > summary {
  display:flex;
  align-items:center;
  gap:9px;
  min-height:44px;
  padding:8px 4px;
  border-radius:8px;
  color:var(--ui-text);
  font-size:13px;
  font-weight:600;
  line-height:1.45;
  list-style:none;
  cursor:pointer;
  overflow-wrap:anywhere;
}
.context-help > summary::-webkit-details-marker { display:none; }
.context-help > summary > span { min-width:0; }
.context-help > summary:focus-visible {
  outline:2px solid var(--ui-accent-text);
  outline-offset:3px;
}
.context-help .context-help-icon { flex:0 0 18px; color:var(--ui-muted); }
.context-help .context-help-chevron {
  flex:0 0 16px;
  margin-left:auto;
  color:var(--ui-muted);
  transition:transform 180ms ease;
}
.context-help[open] > summary .context-help-chevron { transform:rotate(180deg); }
.context-help > .context-help-body {
  padding:2px 4px 10px 31px;
  overflow-wrap:anywhere;
}
.context-help > .context-help-body > p,
.context-help > .context-help-body > .muted {
  margin:0;
  color:var(--ui-muted);
  font-size:13px;
  line-height:1.7;
}
.context-help.context-help-callout {
  padding:6px 12px;
  border:1px solid var(--ui-border);
  border-radius:12px;
  background:var(--ui-surface-soft);
}
@media (prefers-reduced-motion:reduce) {
  .context-help .context-help-chevron { transition:none; }
}

/* The viewport adapter moves the original history node below the player.
   List, move and selected-state styles are shared with focus-r9.css. */
body:is(.mobile-history-active,.mobile-focus-locked) #page-play .mobile-focus-history {
  display:flex;
  align-items:stretch;
  gap:6px;
  width:100%;
  min-width:0;
  height:48px;
  min-height:48px;
  max-height:48px;
  margin:0;
  overflow:hidden;
  border-top:1px solid var(--ui-border);
  background:var(--ui-surface);
  box-sizing:border-box;
}
/* Only the now-empty phone history shell is hidden. Desktop keeps its table. */
body.mobile-history-active:not(.mobile-focus-locked) #page-play .game-panel>.moves-card {
  display:none;
}

body:is(.mobile-history-active,.mobile-focus-locked) #page-play .mobile-focus-history>.secondary-button { align-self:center; }

/* Contextual help is a small, recognizable control, using existing theme colors.
   These rules leave boards, game history and global typography unchanged. */
:where(#page-engine,#page-tests,#page-archive,dialog) .context-help {
  border:1px solid var(--ui-border);
  border-radius:10px;
  background:var(--ui-surface-soft);
}
:where(#page-engine,#page-tests,#page-archive,dialog) .context-help.context-help-callout {
  padding:0;
}
:where(#page-engine,#page-tests,#page-archive,dialog) .context-help>summary {
  min-height:46px;
  padding:10px 12px;
  gap:10px;
  border-radius:9px;
}
:where(#page-engine,#page-tests,#page-archive,dialog) .context-help>summary .context-help-icon {
  color:var(--ui-accent-text);
}
:where(#page-engine,#page-tests,#page-archive,dialog) .context-help>.context-help-body {
  padding:2px 14px 14px 40px;
}
:where(#page-engine,#page-tests,#page-archive,dialog) .context-help[open]>summary {
  color:var(--ui-accent-text);
}
@media (hover:hover) and (pointer:fine) {
  :where(#page-engine,#page-tests,#page-archive,dialog) .context-help>summary:hover {
    background:var(--ui-surface-hover);
  }
}
/* Utility actions keep a comfortable target even when their labels wrap. */
:where(#page-engine,#page-tests,#page-archive) .guide-actions {
  gap:10px;
}
:where(#page-engine,#page-tests,#page-archive) .guide-actions>button {
  min-height:44px;
  line-height:1.5;
}

/* Tests and training use one spacing system. These rules intentionally reset
   the older metric-specific cascade; game boards and history are untouched. */
:is(#page-tests,#page-training) { --utility-gap:20px; --utility-inset:24px; }
#page-tests .tests-layout { gap:var(--utility-gap); align-items:start; }
#page-tests :is(.benchmark-card,.test-result-card,.test-history-card),
#page-training :is(.training-controls,.training-live) {
  min-width:0;
  padding:var(--utility-inset);
}
:is(#page-tests,#page-training) .card-heading {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
  gap:10px 14px;
  margin:0 0 20px;
}
:is(#page-tests,#page-training) .card-heading h2 {
  flex:1 1 180px;
  min-width:0;
  margin:0;
  font-size:21px;
  line-height:1.35;
  letter-spacing:-.35px;
}
:is(#page-tests,#page-training) .card-heading .subtle-badge {
  flex:0 0 auto;
  align-self:flex-start;
  margin:0;
  padding:6px 9px;
  font-size:10px;
  line-height:1.4;
  letter-spacing:.2px;
  white-space:nowrap;
}

/* A metric has a label, a value and a caption, all inside its actual padding. */
#page-tests .test-result-card .benchmark-summary {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin:0;
  padding:0;
}
#page-tests .test-result-card .benchmark-summary>div {
  min-width:0;
  max-width:none;
  margin:0;
  border:0;
  padding:0;
}
#page-tests .test-result-card .benchmark-summary>.benchmark-primary {
  display:grid;
  grid-column:1/-1;
  justify-items:start;
  align-content:start;
  gap:8px;
  padding:18px 20px;
  border:1px solid var(--ui-border);
  border-radius:12px;
  background:var(--ui-surface-soft);
}
#page-tests .test-result-card .benchmark-summary>div>span {
  display:block;
  width:auto;
  margin:0;
  color:var(--ui-muted);
  font-size:13px;
  font-weight:500;
  line-height:1.5;
  letter-spacing:0;
}
#page-tests .test-result-card .benchmark-primary>strong {
  display:block;
  margin:0;
  color:var(--ui-accent-text);
  font-size:44px;
  line-height:1.1;
  letter-spacing:-1px;
  font-variant-numeric:tabular-nums;
}
#page-tests .test-result-card .benchmark-primary>strong>i {
  margin-left:3px;
  font-size:20px;
  font-style:normal;
  line-height:1;
  letter-spacing:0;
}
#page-tests .test-result-card .benchmark-summary small {
  display:block;
  margin:0;
  color:var(--ui-muted);
  font-size:12px;
  line-height:1.6;
  overflow-wrap:anywhere;
}
#page-tests .test-result-card .benchmark-summary>.benchmark-match {
  display:grid;
  grid-column:1/-1;
  gap:10px;
}
#page-tests .test-result-card .benchmark-wdl,
:is(#page-tests,#page-training) .live-result-cards {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
  gap:8px;
  width:100%;
  max-width:none;
  margin:0;
}
#page-tests .test-result-card .benchmark-wdl>span,
:is(#page-tests,#page-training) .live-result-cards>span {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:0;
  min-height:94px;
  margin:0;
  padding:14px 6px;
  border:1px solid var(--ui-border);
  border-radius:10px;
  text-align:center;
  box-sizing:border-box;
}
#page-tests .test-result-card .benchmark-wdl strong,
:is(#page-tests,#page-training) .live-result-cards strong {
  display:block;
  margin:0;
  color:var(--ui-text);
  max-width:100%;
  font-size:clamp(20px,6vw,30px);
  line-height:1.1;
  overflow-wrap:anywhere;
  letter-spacing:-.5px;
  font-variant-numeric:tabular-nums;
}
#page-tests .test-result-card .benchmark-wdl small,
:is(#page-tests,#page-training) .live-result-cards small {
  margin:0;
  font-size:12px;
  line-height:1.4;
}
#page-tests .test-result-card .benchmark-wdl>.wdl-wins { border-color:var(--ui-success); }
#page-tests .test-result-card .benchmark-wdl>.wdl-losses { border-color:var(--ui-danger); }
:is(#page-tests,#page-training) .live-result-cards>.live-result-wins { border-color:var(--ui-success); }
:is(#page-tests,#page-training) .live-result-cards>.live-result-losses { border-color:var(--ui-danger); }
#page-tests .test-result-card .benchmark-summary>:is(.duel-points,.benchmark-sample) {
  display:grid;
  align-content:start;
  gap:7px;
  padding:14px;
  border:1px solid var(--ui-border);
  border-radius:10px;
  background:var(--ui-surface);
}
#page-tests .test-result-card :is(.duel-points,.benchmark-sample)>strong {
  display:block;
  width:auto;
  margin:0;
  max-width:100%;
  font-size:28px;
  line-height:1.2;
  overflow-wrap:anywhere;
  letter-spacing:-.6px;
  font-variant-numeric:tabular-nums;
}
#page-tests .test-result-card .benchmark-sample:last-child:nth-child(3) { grid-column:1/-1; }
#page-tests .test-result-card .benchmark-model-caption {
  margin:14px 0;
  color:var(--ui-muted);
  font-size:12px;
  line-height:1.6;
}
#page-tests .test-result-card .wdl-track { margin:0 0 20px; height:8px; }
#page-tests .test-result-card #training-chart { margin-top:0; }
#page-tests .test-result-card .measurement-details { margin-top:16px; }

/* Fields share their label/input rhythm; actions use equal, wrapping cells. */
:is(#page-tests,#page-training) .opponent-picker { margin:0 0 20px; }
:is(#page-tests,#page-training) .opponent-picker>.form-label,
:is(#page-tests,#page-training) .training-fields .form-label {
  display:block;
  margin:0 0 8px;
  color:var(--ui-text);
  font-size:13px;
  line-height:1.5;
}
:is(#page-tests,#page-training) .training-fields {
  gap:16px;
  margin:0 0 20px;
}
:is(#page-tests,#page-training) .training-fields>div { min-width:0; margin:0; }
:is(#page-tests,#page-training) :is(.training-fields,.opponent-picker) :is(select,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"])) {
  display:block;
  width:100%;
  min-width:0;
  min-height:48px;
  margin:0;
  padding:11px 13px;
  border:1px solid var(--ui-border-strong);
  border-radius:10px;
  font-size:14px;
  line-height:1.5;
  box-sizing:border-box;
}
:is(#page-tests,#page-training) .opponent-picker-footer {
  display:grid;
  gap:10px;
  align-items:stretch;
  margin:12px 0 0;
}
:is(#page-tests,#page-training) .opponent-picker-footer .library-entry-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  width:100%;
  min-width:0;
}
:is(#page-tests,#page-training) .opponent-picker-footer .library-entry-actions>button {
  width:100%;
  min-width:0;
  min-height:44px;
  margin:0;
  padding:10px;
  font-size:12px;
  line-height:1.4;
  white-space:normal;
}
:is(#page-tests,#page-training) .opponent-picker-footer>.context-help { margin:0; }
:is(#page-tests,#page-training) .opponent-picker-footer .context-help-body>p {
  display:block;
  margin:0;
  font-size:13px;
  line-height:1.65;
}
:is(#page-tests,#page-training) .series-method-help { margin:0 0 20px; }
:is(#page-tests,#page-training) .series-method-help .model-option-note {
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}
:is(#page-tests,#page-training) .training-buttons {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
  gap:8px;
  margin:20px 0 0;
}
:is(#page-tests,#page-training) .training-buttons>button {
  min-width:0;
  min-height:48px;
  margin:0;
  padding:11px 12px;
  font-size:13px;
  line-height:1.4;
}
:is(#page-tests,#page-training) .test-mode-tabs { gap:10px; margin-bottom:20px; }
#page-tests .test-mode-tabs>button {
  display:grid;
  grid-template-rows:auto 1fr;
  align-content:start;
  justify-items:start;
  gap:7px;
  min-height:100px;
  margin:0;
  padding:16px;
  text-align:left;
}
#page-tests .test-mode-tabs>button>strong { font-size:15px; line-height:1.35; }
#page-tests .test-mode-tabs>button>span { font-size:12px; line-height:1.5; }
@media(max-width:600px) {
  :is(#page-tests,#page-training) { --utility-inset:20px; --utility-gap:16px; }
  :is(#page-tests,#page-training) .card-heading h2 { font-size:20px; flex-basis:160px; }
  #page-tests .test-result-card .benchmark-primary>strong { font-size:40px; }
  #page-tests .test-mode-tabs>button { padding:14px 12px; min-height:104px; }
  #page-tests .test-result-card .benchmark-summary { gap:14px; }
}
@media(max-width:359px) {
  :is(#page-tests,#page-training) { --utility-inset:16px; }
  #page-tests .test-result-card .benchmark-summary { grid-template-columns:minmax(0,1fr); }
  #page-tests .test-result-card .benchmark-wdl>span { min-height:86px; }
  :is(#page-tests,#page-training) .card-heading { gap:8px; }
}

/* Native Android selects retain DOM focus after their picker closes. Remove
   only pointer-origin focus outlines, not real selected/checked states. A
   keyboard-navigation event immediately restores the existing focus rules.
   !important is limited to this transient outline so old ID-specific focus
   selectors cannot leave a second orange ring on touched utility controls. */
html[data-input-modality="pointer"]
  :where(.sidebar,.topbar,.mobile-nav,.mobile-menu-panel,.page,dialog)
  :is(button,a[href],summary,select,[role="button"],[role="tab"],
    input[type="checkbox"],input[type="radio"],input[type="range"]):not(.square):focus-visible {
  outline:none !important;
}
html[data-input-modality="pointer"] .side-options input:focus-visible+span,
html[data-input-modality="pointer"] #engine-style-card .play-style-option:focus-within {
  outline:none !important;
}

/* The summary occupies its reserved cell. The popup sits under the trigger
   row and scrolls behind the sticky app header. */
body:not(.mobile-focus-locked) #page-play .play-heading-actions {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px;
  align-items:start;
  justify-content:end;
  column-gap:8px;
  row-gap:0;
  width:420px;
  max-width:100%;
}
body:not(.mobile-focus-locked) #page-play .play-heading-actions>button {
  grid-row:1;
  width:100%;
  min-width:0;
  min-height:44px;
  margin:0;
}
body:not(.mobile-focus-locked) #page-play .play-heading-actions>button:first-child { grid-column:1; }
body:not(.mobile-focus-locked) #page-play .play-heading-actions>button:nth-child(2) { grid-column:2; }
#page-play .play-options {
  display:flow-root;
  grid-column:1/-1;
  grid-row:2;
  min-width:0;
  margin:0;
  padding:0;
  border:0;
}
#page-play .play-options>summary {
  position:absolute;
  top:0;
  right:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  margin:0;
  padding:8px;
  border:1px solid var(--ui-border-strong);
  border-radius:8px;
  background:var(--ui-surface);
  color:var(--ui-muted);
  font-size:12px;
  line-height:1.4;
  list-style:none;
}
#page-play .play-options>summary::-webkit-details-marker { display:none; }
#page-play .play-options>summary::marker { content:''; }
#page-play .play-options>summary [data-icon] { flex:none; }
#page-play .play-options:not([open])>.play-options-body { display:none; }
#page-play .play-options-label {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}
#page-play .play-options-body {
  position:absolute;
  inset:calc(100% + 8px) 0 auto;
  z-index:15;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px 14px;
  padding:10px 12px;
  max-height:max(44px,calc(100svh - var(--sticky-topbar-height,60px) - var(--app-mobile-nav-height,0px) - 72px));
  overflow-y:auto;
  overscroll-behavior:contain;
  overflow-anchor:none;
  border:1px solid var(--ui-border-strong);
  border-radius:8px;
  background:var(--ui-surface);
  box-shadow:0 12px 28px #0003;
}
#page-play .play-options-body #play-analysis-controls { margin:0; padding:0; }
#page-play .play-options-body .secondary-button {
  min-height:44px;
  margin:0;
  padding:8px 12px;
  font-size:12px;
}
/* The emptied disclosure must not become a fourth tile in the focus header. */
body.mobile-focus-locked #page-play .play-options { display:none; }

@media(min-width:851px) and (hover:hover) and (pointer:fine) {
  body:not(.mobile-focus-locked) #page-play .board-surface {
    grid-template-columns:minmax(0,1fr);
    column-gap:0;
  }
  body:not(.mobile-focus-locked) #page-play .board-surface>.player-row:first-child {
    grid-column:1/-1;
  }
}
@media(max-width:850px), (max-width:1100px) and (hover:none), (max-width:1100px) and (pointer:coarse) {
  body:not(.mobile-focus-locked) .main-shell:has(#page-play.active-page)>main {
    padding-top:10px;
  }
  body:not(.mobile-focus-locked) #page-play>.page-heading {
    display:block;
    margin:0 0 10px;
  }
  /* Navigation already names this screen; retain its heading for assistive
     technology without spending the phone's first screen on repeated copy. */
  body:not(.mobile-focus-locked) #page-play>.page-heading>div:first-child {
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
  }
  body:not(.mobile-focus-locked) #page-play .play-heading-actions {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px;
    align-items:start;
    column-gap:8px;
    row-gap:0;
    width:100%;
  }
  body:not(.mobile-focus-locked) #page-play .play-heading-actions>button {
    width:100%;
    min-width:0;
    min-height:44px;
    margin:0;
    padding:8px;
    font-size:12px;
    line-height:1.35;
  }
  body:not(.mobile-focus-locked) #page-play .play-options>summary {
    width:44px;
    height:44px;
    padding:8px;
  }

}

/* Black pieces carry their own ink so boards, thumbnails and moving pieces match. */
body :is(.chessboard,.piece-ghost,.move-animation-piece,.promotion-options,.theme-piece-thumbnail,.appearance-previewboard) .piece[fill="#faf7eb"] {
  stroke:#293c30;
  stroke-width:1.95;
}
/* An outline stays sharp on dense mobile screens. Remove the old theme halo;
   Pixel keeps its deliberately crisp SVG edges, as do moving pieces. */
body[data-board-theme] .chessboard .piece,
body[data-board-theme] .chessboard .square.promotion .piece,
body :is(.piece-ghost,.move-animation-piece,.promotion-options,.appearance-previewboard) .piece {
  filter:none;
}

/* Coordinates use a dark ink on light/mid-tone fields and pale ink on the
   three darkest palettes. Highlighted squares are handled explicitly so
   disabling a highlight never leaves its coordinate treatment behind. */
body .chessboard .square {
  --board-readable-coordinate:#07110b;
}
body .chessboard .square :is(.replay-rank,.replay-file,.board-rank,.board-file) {
  /* Earlier highlight-off rules assign color directly. This one local
     override delegates every visible state to the explicit variables below. */
  color:var(--board-readable-coordinate) !important;
  font-size:clamp(10px,2.35vw,11px);
  font-weight:700;
  line-height:1;
  text-shadow:none;
}
body:is([data-board-theme="walnut"],[data-board-theme="midnight"],[data-board-theme="monochrome"])
  .chessboard .square.dark {
  --board-readable-coordinate:#f4f6ed;
}
body:not([data-highlight-last-move="false"]) .chessboard .square.last,
body:not([data-highlight-selection="false"]) .chessboard .square.selected,
body:not([data-highlight-check="false"]) .chessboard .square.check {
  --board-readable-coordinate:#020805;
}
body[data-board-theme="midnight"]:not([data-highlight-check="false"])
  .chessboard .square.check {
  --board-readable-coordinate:#ffffff;
}

/* Hard, dual-tone edges retain the active board theme's center/ring color
   while separating legal markers from pieces and differently shaded fields.
   No display rule is changed: the existing highlight switches stay in charge. */
body .chessboard .legal-dot {
  box-shadow:0 0 0 1px var(--board-light),0 0 0 2px #101b15;
}
body .chessboard .legal-capture {
  box-shadow:0 0 0 1px var(--board-light),inset 0 0 0 1px var(--board-light),0 0 0 2px #101b15;
}

/* One engine workspace: status, model controls and measurements have distinct
   levels. Existing nodes, native radios and responsive panels are retained. */
#page-engine .engine-hub-heading { margin-bottom:18px; }
#page-engine .engine-hub-heading .eyebrow { margin-bottom:7px; }
#page-engine .engine-hub-overview {
  gap:18px;
  padding:14px 18px;
  margin-bottom:18px;
  border-radius:12px;
  box-shadow:none;
}
#page-engine .engine-hub-identity { gap:11px; }
#page-engine .engine-hub-identity img { width:34px; height:34px; }
#page-engine .engine-hub-identity .section-label { font-size:10px; letter-spacing:.65px; }
#page-engine .engine-hub-identity strong { font-size:15px; line-height:1.45; }
#page-engine .engine-hub-summary { gap:4px; }
#page-engine .engine-hub-tabs { margin-bottom:18px; }
#page-engine .engine-pane>.page-heading {
  min-height:0;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}
#page-engine .engine-pane>.page-heading h2 { font-size:19px; line-height:1.4; letter-spacing:-.3px; }
#page-engine .engine-pane>.page-heading .memory-actions { gap:8px; }
#page-engine .engine-pane>.page-heading .secondary-button { min-height:44px; margin:0; }
#page-engine .engine-section-links { gap:8px; margin-bottom:16px; }
#page-engine .engine-section-links>button { min-height:44px; padding:8px 12px; font-size:12px; }

/* A single measurement strip replaces the visual repetition of four cards. */
#page-engine .progress-stats {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0;
  margin:0 0 20px;
  border:1px solid var(--ui-border);
  border-radius:14px;
  background:var(--ui-inset);
}
#page-engine .progress-stats>.stat-card {
  display:grid;
  align-content:start;
  gap:7px;
  min-width:0;
  min-height:116px;
  margin:0;
  padding:16px;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
#page-engine .progress-stats>.stat-card:nth-child(odd) { border-right:1px solid var(--ui-border); }
#page-engine .progress-stats>.stat-card:nth-child(n+3) { border-top:1px solid var(--ui-border); }
#page-engine .progress-stats>.stat-card>span { margin:0; font-size:12px; line-height:1.5; }
#page-engine .progress-stats>.stat-card>strong {
  margin:0;
  font-size:28px;
  line-height:1.15;
  letter-spacing:-.65px;
  overflow-wrap:anywhere;
  font-variant-numeric:tabular-nums;
}
#page-engine .progress-stats>.stat-card>small { margin:0; font-size:11px; line-height:1.6; }
#page-engine .progress-grid {
  gap:0;
  border:1px solid var(--ui-border);
  border-radius:14px;
  background:var(--ui-surface);
}
#page-engine .progress-grid>.card {
  margin:0;
  padding:17px 18px;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
#page-engine .progress-grid>.card+.card { border-top:1px solid var(--ui-border); }
#page-engine .progress-grid .compact-panel-summary>h2 { font-size:16px; }
#page-engine .growth-card { margin-bottom:20px; }
#page-engine .growth-card .card-heading h2 { font-size:18px; line-height:1.4; }

/* Three real radio choices. Their illustration, name and description form a
   single tile; the original checked state is always visible and accessible. */
#engine-style-card { padding:18px 20px; border-radius:14px; box-shadow:none; }
#engine-style-card .compact-panel-summary { gap:10px; }
#engine-style-card .compact-panel-summary h2 { font-size:18px; }
#engine-style-card .play-style-options { gap:10px; margin:16px 0; }
#engine-style-card .play-style-option {
  display:grid;
  grid-template-columns:minmax(0,1fr) 17px;
  align-content:start;
  align-items:start;
  gap:10px;
  min-height:160px;
  padding:16px 13px;
  border:1px solid var(--ui-border);
  border-radius:12px;
  background:var(--ui-inset);
  filter:none;
}
#engine-style-card .play-style-option>input {
  grid-column:2;
  grid-row:1;
  width:17px;
  height:17px;
  margin:3px 0 0;
  align-self:start;
}
#engine-style-card .play-style-option>span { grid-column:1; grid-row:1; min-width:0; }
#engine-style-card .style-choice-icon {
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  margin:0 0 13px;
  border:1px solid transparent;
  border-radius:10px;
  background:var(--ui-surface-soft);
  color:var(--ui-muted);
}
#engine-style-card .style-choice-icon svg { width:21px; height:21px; }
#engine-style-card .play-style-option strong { font-size:14px; line-height:1.4; }
#engine-style-card .play-style-option small { margin-top:6px; font-size:12px; line-height:1.65; }
#engine-style-card .play-style-option.is-selected {
  border-color:var(--ui-accent);
  background:var(--ui-accent-soft);
}
#engine-style-card .play-style-option.is-selected .style-choice-icon {
  color:var(--ui-accent-text);
}
#engine-style-card .play-style-option.is-selected strong { color:var(--ui-accent-text); }
#engine-style-card .style-choice-kicker { display:block; margin-bottom:5px; color:var(--ui-muted); font-size:10px; line-height:1.4; letter-spacing:.35px; }

@media(min-width:700px) and (max-width:1100px) {
  #page-engine .progress-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #page-engine .progress-grid>.card+.card { border-top:0; border-left:1px solid var(--ui-border); }
}
@media(max-width:600px) {
  #page-engine .engine-hub-overview { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; padding:14px 16px; }
  #page-engine .engine-hub-summary {
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:5px 12px;
    width:100%;
    padding-top:10px;
    border-top:1px solid var(--ui-border);
    text-align:left;
  }
  #page-engine .engine-pane>.page-heading .memory-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
  #page-engine .engine-pane>.page-heading .memory-actions>.secondary-button { width:100%; min-width:0; padding:10px; font-size:12px; }
  #page-engine .progress-stats>.stat-card { min-height:112px; padding:14px; }
  #page-engine .progress-stats>.stat-card>strong { font-size:26px; }
  #page-engine .progress-grid>.card { padding:15px 16px; }
  #engine-style-card { padding:16px; }

}
@media(max-width:600px), (min-width:1101px) and (max-width:1280px) {
  #engine-style-card .play-style-options { grid-template-columns:minmax(0,1fr); }
  #engine-style-card .play-style-option { align-items:center; min-height:88px; padding:14px; gap:12px; }
  #engine-style-card .play-style-option>input { align-self:center; margin:0; }
  #engine-style-card .play-style-option>span { display:grid; grid-template-columns:36px minmax(0,1fr); align-items:center; column-gap:12px; }
  #engine-style-card .style-choice-icon { grid-column:1; grid-row:1/4; margin:0; }
  #engine-style-card .play-style-option strong,
  #engine-style-card .play-style-option small,
  #engine-style-card .style-choice-kicker { grid-column:2; }
  #engine-style-card .play-style-option small { margin-top:3px; }
}
@media(hover:hover) and (pointer:fine) {
  #engine-style-card .play-style-option:hover { border-color:var(--ui-border-strong); background:var(--ui-surface-hover); filter:none; }
  #engine-style-card .play-style-option.is-selected:hover { border-color:var(--ui-accent); background:var(--ui-accent-soft); }
}
@media(prefers-reduced-motion:no-preference) {
  #engine-style-card .play-style-option { transition:border-color 150ms ease,background-color 150ms ease; }
  #engine-style-card .style-choice-icon { transition:color 150ms ease,border-color 150ms ease; }
  #page-engine .engine-hub-tabs button { transition:background-color 150ms ease,color 150ms ease; }
}
@media(prefers-reduced-motion:reduce) {
  #engine-style-card .play-style-option,
  #engine-style-card .style-choice-icon,
  #page-engine .engine-hub-tabs button { transition:none; }
}

#engine-style-card .style-method-help { margin:12px 0; }
#engine-style-card .style-method-help .context-help-body>p+p { margin-top:12px; }

/* An honest league preview: brand artwork and a readable roadmap, no invented
   standings, seasons, countdowns or unavailable actions. */
#page-league .league-preview {
  width:100%;
  max-width:1040px;
  margin:12px auto 0;
  padding:0;
  border:1px solid var(--ui-border);
  border-radius:18px;
  background:var(--ui-surface);
  box-shadow:none;
}
#page-league .league-preview-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  padding:18px 28px;
  border-bottom:1px solid var(--ui-border);
}
#page-league .league-season-label {
  color:var(--ui-muted);
  font-size:11px;
  line-height:1.5;
  font-weight:600;
  letter-spacing:1.1px;
  text-transform:uppercase;
}
#page-league .league-coming-soon {
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 10px;
  border:1px solid transparent;
  border-radius:999px;
  background:var(--ui-inset);
  color:var(--ui-muted);
  font-size:11px;
  line-height:1.4;
}
#page-league .league-preview-content {
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(200px,.8fr);
  align-items:center;
  gap:36px;
  padding:36px;
}
#page-league .league-preview-copy { min-width:0; }
#page-league #league-heading { margin:0 0 16px; font-size:clamp(30px,3.5vw,44px); line-height:1.15; letter-spacing:-1.25px; }
#page-league .league-intro { max-width:32em; margin:0 0 14px; color:var(--ui-text); font-size:17px; line-height:1.65; }
#page-league .league-description { max-width:38em; margin:0; color:var(--ui-muted); font-size:14px; line-height:1.8; }
#page-league .league-emblem {
  display:grid;
  place-items:center;
  width:100%;
  max-width:260px;
  aspect-ratio:1;
  justify-self:end;
  padding:24px;
  border:1px solid var(--ui-border);
  border-radius:22px;
  color:var(--ui-accent-text);
  background:var(--ui-surface-soft);
}
#page-league .league-emblem svg { display:block; width:100%; height:auto; max-height:210px; }
#page-league .league-preview-topics { display:flex; flex-wrap:wrap; gap:8px; padding:0 36px 28px; }
#page-league .league-preview-topics>span {
  display:inline-flex;
  align-items:center;
  min-height:32px;
  padding:6px 11px;
  border:1px solid var(--ui-border);
  border-radius:999px;
  color:var(--ui-muted);
  font-size:12px;
  line-height:1.5;
}
#page-league .league-preview-note {
  margin:0;
  padding:17px 28px;
  border-top:1px solid var(--ui-border);
  color:var(--ui-muted);
  font-size:12px;
  line-height:1.75;
}
@media(max-width:600px) {
  #page-league .league-preview { margin-top:0; border-radius:14px; }
  #page-league .league-preview-header { padding:16px 20px; }
  #page-league .league-preview-content { display:flex; flex-direction:column; align-items:flex-start; gap:24px; padding:24px 20px; }
  #page-league .league-emblem { order:-1; width:116px; max-width:116px; padding:15px; border-radius:16px; }
  #page-league #league-heading { margin-bottom:13px; font-size:30px; letter-spacing:-.9px; }
  #page-league .league-intro { font-size:16px; line-height:1.6; }
  #page-league .league-description { font-size:13px; line-height:1.75; }
  #page-league .league-preview-topics { padding:0 20px 22px; }
  #page-league .league-preview-note { padding:16px 20px; }
}
@media(max-width:359px) {
  #page-league .league-preview-header,
  #page-league .league-preview-note { padding-inline:16px; }
  #page-league .league-preview-content { padding-inline:16px; }
  #page-league .league-preview-topics { padding-inline:16px; }
}

/* Short, event-driven presentation transitions only. No looping decoration or
   animation hooks run during search, training, dragging or game updates. */
@media(prefers-reduced-motion:no-preference) {
  :where(#page-engine,#page-tests,#page-archive,#page-play,dialog)
    :is(.primary-button,.secondary-button,.play-options>summary):not(:disabled) {
    transition:background-color 140ms ease,border-color 140ms ease,color 140ms ease,filter 120ms ease-out;
  }
  #page-engine .compact-panel-summary::after {
    transition:transform 180ms ease,color 140ms ease;
  }
}
@media(hover:hover) and (pointer:fine) {
  #page-play .play-options>summary:hover {
    background:var(--ui-surface-hover);
    border-color:var(--ui-accent);
  }
}
@media(prefers-reduced-motion:reduce) {
  :where(#page-engine,#page-tests,#page-archive,#page-play,dialog)
    :is(.primary-button,.secondary-button,.play-options>summary),
  #page-engine .compact-panel-summary::after { transition:none; }
}

/* Retain semantic page names without the removed visible introduction or
   an empty heading wrapper taking space above the actual controls. */
.page-a11y-title {
  position:absolute;
  width:1px;
  height:1px;
  margin:-1px;
  padding:0;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
  border:0;
}

/* One athlete card: identity, its current engine, and one source of totals. */
#pumpkin-profile-card .pumpkin-profile-heading{margin-bottom:14px}
#pumpkin-profile-card .pumpkin-player-name .pumpkin-player-model{margin:5px 0 7px;color:var(--ui-muted);font-size:12px;line-height:1.5}
#pumpkin-profile-card .pumpkin-player-model strong{font-size:inherit;font-weight:400}
#pumpkin-profile-card .pumpkin-player-name .pumpkin-player-trainer{margin:0 0 7px;font-size:11px}
#pumpkin-profile-card .pumpkin-player-measurements{margin-top:16px;padding-top:16px}
#pumpkin-profile-card .pumpkin-player-measurements>div{display:flex;flex-direction:column;justify-content:flex-start}
#pumpkin-profile-card .pumpkin-player-measurements span{min-height:2.8em;line-height:1.4}
#pumpkin-profile-card .pumpkin-player-measurements strong{margin-top:6px;line-height:1.25}
#pumpkin-profile-card .pumpkin-player-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;margin-top:16px;min-width:0;font-size:12px;line-height:1.5}
#pumpkin-profile-card .pumpkin-player-footer>.engine-hub-status{min-width:0;max-width:100%;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-storage-tag{display:inline-flex;align-items:center;max-width:100%;padding:3px 8px;border:1px solid var(--ui-border);border-radius:6px;color:var(--ui-muted);font-size:11px;line-height:1.5;overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-storage-tag[data-status=synced]{color:var(--ui-success)}
#pumpkin-profile-card .pumpkin-storage-tag[data-status=error],#pumpkin-profile-card .pumpkin-storage-tag[data-status=conflict],#pumpkin-profile-card .pumpkin-storage-tag[data-status=handoff-required]{color:var(--ui-accent-text)}
#pumpkin-profile-card .pumpkin-profile-attention{margin:10px 0 0;font-size:12px;line-height:1.6;color:var(--ui-accent-text)}
#pumpkin-profile-card .pumpkin-development-details{margin-top:14px}
#pumpkin-profile-card .pumpkin-profile-placeholder{display:grid;gap:8px;min-width:0;font-size:13px;line-height:1.5;color:var(--ui-muted)}
#page-engine .engine-learning-details{min-width:0;padding:16px 20px;margin-bottom:18px}
#page-engine .engine-learning-details .progress-stats{margin:0;grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:380px){#page-engine .engine-learning-details{padding:16px}#page-engine .engine-learning-details .progress-stats{grid-template-columns:minmax(0,1fr)}}
@media(min-width:1101px){
  #pumpkin-profile-card #pumpkin-profile-overview{display:grid;grid-template-columns:minmax(240px,1fr) minmax(330px,1.2fr);gap:16px 24px;align-items:center}
  #pumpkin-profile-card .pumpkin-player-measurements{margin:0;padding:0 0 0 24px;border-top:0;border-left:1px solid var(--ui-border)}
  #pumpkin-profile-card .pumpkin-player-footer{grid-column:1/-1;margin:0}
  #pumpkin-profile-card .pumpkin-profile-attention{grid-column:1/-1;margin:0}
}
@media(max-width:380px){
  #pumpkin-profile-card .pumpkin-player-measurements strong{font-size:20px}
  #pumpkin-profile-card .pumpkin-player-measurements>div{padding-left:8px;padding-right:8px}
  #pumpkin-profile-card .pumpkin-player-measurements>div:first-child{padding-left:0}
  #pumpkin-profile-card .pumpkin-player-measurements>div:last-child{padding-right:0}
}

/* Phase context stays with the progress bar, above the outcome tiles. */
#page-training .training-phase-reason,
#page-tests .training-phase-reason {
  margin: 14px 0 0;
  min-height: 0;
  padding: 11px 13px;
  border-left: 2px solid var(--ui-accent);
  border-radius: 0 8px 8px 0;
  background: var(--ui-surface-soft);
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.65;
}
#page-training .training-phase-reason[hidden],
#page-tests .training-phase-reason[hidden],
#training-status[hidden],
#test-status[hidden] {
  display: none !important;
}
#page-training .training-phase-reason + .training-progress-label,
#page-tests .training-phase-reason + .training-progress-label {
  margin-top: 15px;
}
#training-live-results,
#test-live-results {
  margin-bottom: 0;
}

/* Archive browsing: quiet surfaces, compact rows, explicit outcomes. */
#page-archive .archive-list {
  gap: 8px;
  padding: 3px;
}
#page-archive .archive-list[aria-busy="true"] { opacity:.72; }
#page-archive .archive-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--ui-surface-soft);
  color: var(--ui-text);
  line-height: 1.45;
  box-shadow: none;
  outline: 0;
}
#page-archive .archive-entry.selected-entry {
  border-color: var(--ui-border);
  background: var(--ui-surface-hover);
  box-shadow: none;
}
/* Reserve the check beside the score so selecting a row never moves its text. */
#page-archive .archive-entry .archive-entry-score::before {
  content:'';
  display:inline-block;
  visibility:hidden;
  width:.35em;
  height:.65em;
  margin-inline-end:.65em;
  border:solid currentColor;
  border-width:0 1.8px 1.8px 0;
  transform:translateY(-.08em) rotate(45deg);
}
#page-archive .archive-entry.selected-entry .archive-entry-score::before { visibility:visible; }
#page-archive .archive-entry-kind {
  align-self: center;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--ui-text);
}
#page-archive .archive-entry .archive-outcome-row {
  display: contents;
}
#page-archive .archive-entry .archive-result-badge {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
  padding: 2px 6px;
  border: 0;
  border-radius: 5px;
  font-size: 12px !important;
  line-height: 1.45;
  text-align: left;
}
#page-archive .archive-entry-score {
  font-size: 14px;
  letter-spacing: -.02em;
}
#page-archive .archive-entry .archive-entry-score { grid-column: 2; grid-row: 1; }
#page-archive .archive-result-badge:is(.result-draw,.result-unknown) {
  background: var(--ui-neutral-soft);
  color: var(--ui-neutral);
}
#page-archive .archive-entry .archive-participants {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
#page-archive .archive-entry .archive-participant {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 2px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
}
#page-archive .archive-entry .participant-color {
  flex: none;
  color: var(--ui-muted);
  font-size: 10px;
  line-height: inherit;
}
#page-archive .archive-entry .archive-participant > span:last-child {
  min-width:0;
  white-space:normal;
  overflow-wrap:anywhere;
}
#page-archive .archive-entry .archive-selfplay { grid-template-columns: minmax(0, 1fr); }
#page-archive .archive-entry .archive-role-summary,
#page-archive .archive-entry .archive-volatile-note {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.5;
}
#page-archive .archive-entry .archive-entry-metadata {
  grid-column: 1 / -1;
  gap: 4px 12px;
  font-size: 12px;
  line-height: 1.5;
}
#page-archive .archive-entry .archive-entry-reason {
  grid-column: 1 / -1;
  padding-top: 0;
  border-top: 0;
  font-size: 12px;
  line-height: 1.5;
}
#page-archive .archive-entry:focus-visible {
  outline: 2px solid var(--ui-neutral);
  outline-offset: -2px;
}
#page-archive .replay-detail { gap: 8px; margin: 12px 0 16px; }
#page-archive .replay-participants { padding: 10px 12px; gap: 4px; }
#page-archive .replay-reason { padding-top: 8px; }

/* Successful writes need no panel; exceptions stay close to the run. */
:is(#page-training,#page-tests) .archive-run-summary {
  padding: 15px 18px;
  margin: 16px 0;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--ui-surface);
  box-shadow: none;
}
:is(#page-training,#page-tests) .archive-run-summary .card-heading :is(h2,h3) { margin:0;font-size:15px;line-height:1.5; }
:is(#page-training,#page-tests) .archive-run-summary .card-heading { margin:0; }
:is(#page-training,#page-tests) .archive-run-summary .subtle-badge { display: none; }
:is(#page-training,#page-tests) .archive-report-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 10px;
}
:is(#page-training,#page-tests) .archive-report-metric {
  display: flex;
  align-items: baseline;
  gap: 7px;
  border: 0;
  padding: 0;
}
:is(#page-training,#page-tests) .archive-report-metric > span { font-size: 11px; }
:is(#page-training,#page-tests) .archive-report-metric strong { font-size: 14px; }
:is(#page-training,#page-tests) .archive-report-note { font-size: 12px; line-height: 1.6; margin: 10px 0 6px; }
:is(#page-training,#page-tests) .archive-report-actions { gap: 6px 12px; }
:is(#page-training,#page-tests) .archive-report-actions button { flex: initial; min-height: 44px; padding: 7px 10px; font-size: 12px; }
:is(#page-training,#page-tests) .archive-run-summary[data-archive-state=warning] { border-inline-start: 3px solid var(--ui-accent); }

@media (max-width: 420px) {
  #page-archive .archive-entry { gap: 7px 8px; padding: 12px; }
  #page-archive .archive-entry-kind { font-size: 13px; }
  #page-archive .archive-entry .archive-participants { gap: 8px; }
  #page-archive .archive-entry .archive-participant { font-size: 13px; gap: 2px; }
}

/* Compact utility headings are controls, so they do not inherit the spacing
   reserved for a card heading above visible content. Keep natural height for
   wrapped labels and let the existing disclosure controller measure it. */
#page-tests .test-history-card {
  padding:16px var(--utility-inset);
}
#page-tests .test-history-card .compact-panel>.compact-panel-summary,
#page-engine .compact-panel>.compact-panel-summary {
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:12px;
  min-width:0;
  min-height:44px;
  margin:0;
  padding:2px 0;
}
#page-tests .test-history-card .compact-panel-summary>h2,
#page-engine .compact-panel>.compact-panel-summary>h2 {
  flex:1 1 0;
  min-width:0;
  margin:0;
  line-height:1.5;
  white-space:normal;
  overflow-wrap:anywhere;
}
#page-tests .test-history-card .compact-panel-summary>h2 {
  font-size:18px;
}
#page-tests .test-history-card .compact-panel-summary::after,
#page-engine .compact-panel>.compact-panel-summary::after {
  flex:0 0 8px;
}
/* Body spacing belongs to the body, which native details hides when closed. */
#page-tests .test-history-card .compact-panel-body {
  padding-top:14px;
}
#page-tests .test-history-card .compact-panel-body>.benchmark-intro {
  margin:0 0 14px;
  font-size:13px;
  line-height:1.7;
}
@media (max-width:650px) {
  #page-tests .test-history-card .compact-panel-summary>h2 {
    font-size:17px;
  }
  #page-tests .test-history-card .compact-panel-body {
    padding-top:12px;
  }
}

/* Four compact rows; every existing field can still wrap in full. */
#page-archive .archive-entry {
  grid-template-columns: fit-content(48%) minmax(0, 1fr) auto;
  gap: 4px 8px;
  min-height: 44px;
  padding: 9px 10px;
  line-height: 1.4;
}
#page-archive .archive-entry-kind {
  grid-column: 1 / 3;
  grid-row: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
#page-archive .archive-entry .archive-entry-score {
  grid-column: 3;
  grid-row: 1;
}
#page-archive .archive-entry .archive-participants {
  grid-column: 1 / -1;
  grid-row: 2;
  gap: 8px;
}
#page-archive .archive-entry .archive-participant {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
  line-height: 1.4;
}
#page-archive .archive-entry .participant-color {
  font-size: 11px;
  white-space: nowrap;
}
#page-archive .archive-entry .archive-result-badge {
  grid-column: 1;
  grid-row: 3;
  align-self: baseline;
  max-width: 100%;
  padding: 1px 5px;
  line-height: 1.4;
}
#page-archive .archive-entry .archive-entry-reason {
  grid-column: 2 / -1;
  grid-row: 3;
  align-self: baseline;
  min-width: 0;
  line-height: 1.4;
}
#page-archive .archive-entry .archive-entry-metadata {
  grid-column: 1 / -1;
  grid-row: 4;
  gap: 2px 10px;
  line-height: 1.4;
}
#page-archive .archive-entry > :is(.archive-role-summary, .archive-volatile-note) {
  grid-column: 1 / -1;
  line-height: 1.4;
}

/* Fixed cells prevent labels and enabled states from moving nearby tools. */
#page-archive .archive-annotation-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 6px;
}
#page-archive .archive-annotation-toolbar > button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 56px;
  min-height: 56px;
  margin: 0;
  padding: 6px;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
#page-archive .archive-annotation-toolbar > .context-help {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
}

/* Fit the saved portrait into the existing player slot without moving the board. */
#page-play .player-avatar {
  overflow: hidden;
}
#page-play .player-avatar > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: inherit;
}
#page-play .player-avatar > svg {
  width: 100%;
  height: 100%;
}

/* The recovery screen reuses existing controls and never changes game layout. */
.profile-recovery { max-width: 720px; margin: 24px auto; }
.profile-recovery h1 { font-size: 24px; margin-bottom: 16px; }
.profile-recovery h2 { margin: 24px 0 12px; }
.profile-recovery p { line-height: 1.65; margin: 12px 0; }
.profile-recovery .profile-recovery-message { color: var(--ui-muted); }
.profile-recovery-actions, #profile-recovery-candidates { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.profile-recovery-actions > button, #profile-recovery-candidates > button { min-height: 44px; white-space: normal; }
.profile-recovery-confirm { border-top: 1px solid var(--ui-border); margin-top: 20px; padding-top: 12px; }
.profile-lease-note { margin: 8px 0; font-size: 12px; color: var(--ui-muted); }

#page-archive .archive-export-panel { margin: 12px 0; padding: 14px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface); }
#page-archive .archive-export-panel[hidden] { display: none; }
#page-archive .archive-export-panel p { margin: 0; font-size: 13px; line-height: 1.6; }
#page-archive .archive-export-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#page-archive .archive-export-actions button { min-height: 44px; padding: 8px 12px; }

/* Full-copy management stays inside the existing development disclosure. */
.pumpkin-profile-card .pumpkin-copy-budget{margin:12px 0;padding:10px 12px;border:1px solid var(--ui-accent);border-radius:8px;font-size:12px;line-height:1.6}
.pumpkin-profile-card .pumpkin-local-copy-panel{margin-top:14px;border-top:1px solid var(--ui-border);padding-top:10px}
.pumpkin-profile-card .pumpkin-local-copy-panel>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:600}
.pumpkin-profile-card .pumpkin-local-copy-list{list-style:none;margin:10px 0;padding:0;max-height:320px;overflow-y:auto}
.pumpkin-profile-card .pumpkin-local-copy-list label{display:flex;align-items:center;gap:10px;min-height:48px;padding:6px 0;border-bottom:1px solid var(--ui-border);font-size:12px}
.pumpkin-profile-card .pumpkin-local-copy-list input{flex:none;width:20px;height:20px;accent-color:var(--ui-accent)}
.pumpkin-profile-card .pumpkin-local-copy-list time,.pumpkin-profile-card .pumpkin-local-copy-list small{display:block;overflow-wrap:anywhere}
.pumpkin-profile-card .pumpkin-local-copy-list small{color:var(--ui-muted);margin-top:3px}

/* Desktop ergonomics only. Touch layouts retain their existing board/history. */
@media (min-width:851px) and (hover:hover) and (pointer:fine) {
  .main-shell:has(#page-play.active-page)>main {
    padding-top:8px;
  }
  #page-play .page-heading {
    min-height:44px;
    margin-bottom:10px;
  }
  #page-play .page-heading p { display:none; }

  body:not(.focus-mode-active) #page-play .game-layout {
    --play-panel-min:300px;
    grid-template-columns:minmax(0,calc(var(--play-board-fit,var(--play-board-fallback)) + 22px)) minmax(var(--play-panel-min),1fr);
    justify-content:start;
    gap:20px;
  }
  #page-play .game-panel {
    width:100%;
    min-width:0;
    gap:12px;
  }
  #page-play .game-panel>.card { width:100%; min-width:0; }
  #page-play .game-panel>.wide { margin-top:0; }
  #page-archive .replay-move-history .moves-header,
  #page-play .moves-header { padding:0 16px 12px; }
  #page-archive .replay-move-history .moves-table-head,
  #page-play .moves-table-head { padding-inline:16px; }
  #page-archive .replay-move-history .move-row,
  #page-play .move-row { padding-inline:16px; }
  #page-archive .replay-move-history .moves-list,
  #page-play .moves-list { height:clamp(150px,22svh,240px); }

  /* Use the wider side panel for the existing rating and graph, rather than
     stacking every field into a tall, narrow card. No statistics are hidden. */
  #page-play .engine-card {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    align-items:center;
    gap:12px 16px;
    padding:16px;
  }
  #page-play .engine-card>:is(.card-heading,.engine-title,.engine-stats,.learning-note,.panel-link) {
    grid-column:1/-1;
    min-width:0;
    margin:0;
  }
  #page-play .engine-title { gap:10px; flex-wrap:wrap; }
  #page-play .engine-title>div { min-width:0; }
  #page-play .engine-title h2 { font-size:18px; line-height:1.35; }
  #page-play .engine-state { font-size:11px; }
  #page-play .engine-logo { width:40px; height:40px; }
  #page-play .engine-logo img { width:36px; height:36px; }
  #page-play .elo-section {
    grid-column:1;
    min-width:0;
    margin:0;
    flex-wrap:wrap;
    justify-content:flex-start;
    gap:8px;
  }
  #page-play .elo-value { flex-wrap:wrap; gap:4px 8px; }
  #page-play .elo-value>span:first-child { font-size:36px; }
  #page-play .engine-card .elo-change { text-align:left; max-width:100%; }
  #page-play .chart-container {
    grid-column:2;
    min-width:0;
    height:80px;
    margin:0;
  }
  #page-play .chart-container .chart-empty { padding:8px; font-size:11px; line-height:1.5; }
  #page-play .engine-stats { padding-top:12px; }
  #page-play .engine-stats strong { font-size:21px; }
  #page-play .engine-stats span { font-size:11px; line-height:1.45; }
  #page-play .learning-note { padding:10px; font-size:11px; line-height:1.6; }
  #page-play .panel-link { min-height:40px; padding-top:10px; }
  #page-play .elo-disclaimer { font-size:11px; line-height:1.6; }

  /* Navigation always keeps a real gap above the illustration, including
     short laptop windows where the note's automatic top margin becomes zero. */
  .sidebar { overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; }
  .sidebar>nav { flex-shrink:0; margin-bottom:18px; }
  .sidebar-note {
    position:relative;
    flex-shrink:0;
    padding:16px;
    overflow:hidden;
    background:linear-gradient(145deg,var(--ui-sidebar-soft),var(--ui-sidebar));
  }
  .sidebar-note h3 { margin:12px 0 6px; }
  .sidebar-note p { line-height:1.6; }
  .sidebar-note .note-line { margin:12px 0; }
  .sidebar-journey {
    display:grid;
    grid-template-columns:1fr 12px 1fr 12px 1fr;
    align-items:start;
    gap:3px;
    color:var(--ui-sidebar-muted);
  }
  .sidebar-journey>span:not(.journey-arrow) {
    display:grid;
    justify-items:center;
    gap:6px;
    min-width:0;
    font-size:10px;
    line-height:1.4;
  }
  .sidebar-journey [data-icon] {
    width:34px;
    height:34px;
    border:1px solid var(--ui-sidebar-border);
    border-radius:10px;
    background:var(--ui-sidebar-soft);
    color:var(--ui-hero-accent);
  }
  .sidebar-journey .journey-arrow { padding-top:8px; font-size:13px; opacity:.65; }
  .sidebar-footer { flex-shrink:0; }
}

@media (min-width:851px) and (max-width:1100px) and (hover:hover) and (pointer:fine) {
  body:not(.focus-mode-active) #page-play .game-layout { --play-panel-min:260px; }
}

@media (min-width:1101px) and (max-height:760px) and (hover:hover) and (pointer:fine) {
  .sidebar { padding-top:20px; padding-bottom:16px; }
  .sidebar .workspace-label { margin-block:24px 12px; }
  .sidebar-note { padding:14px; }
  .sidebar-footer { margin-top:18px; }
}

/* Dialog presentation only; the game layout keeps its existing breakpoints. */
#account-dialog .dialog-top,
#settings-dialog .dialog-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 18px;
}

#account-dialog .dialog-top .dialog-title-r34,
#settings-dialog .dialog-top .dialog-title-r34 {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  color: var(--ui-accent-text, var(--ui-accent));
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .045em;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

#account-dialog .dialog-top > .icon-button,
#settings-dialog .dialog-top > .icon-button {
  grid-column: 3;
  grid-row: 1;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  justify-self: end;
}

#account-dialog .dialog-info-r34,
#settings-dialog .dialog-info-r34 {
  margin-block: 10px 16px;
}

#account-dialog .dialog-info-r34 > .context-help-body > p,
#settings-dialog .dialog-info-r34 > .context-help-body > p {
  margin: 0;
}

@media (max-width: 600px) {
  #account-dialog .dialog-top .dialog-title-r34,
  #settings-dialog .dialog-top .dialog-title-r34 {
    font-size: 17px;
    letter-spacing: .025em;
  }
}

/* Post-game review only. The live board, training and app navigation retain
   their existing layout. Dynamic feedback always follows the replay square. */
#page-archive .replay-card { position:relative; border-radius:0; box-shadow:none; }
#page-archive .replay-review-heading {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(0,3fr) 44px;
  align-items:center;
  gap:8px;
  min-height:4.25rem;
  margin-bottom:8px;
}
#page-archive .replay-review-heading>h2 {
  display:grid;
  grid-column:1;
  grid-row:1;
  align-content:center;
  align-self:stretch;
  min-width:0;
  margin:0;
  font-size:18px;
  line-height:1.35;
  overflow-wrap:anywhere;
}
#page-archive #replay-game-kind {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  line-height:1.16;
}
#page-archive #replay-game-number,
#page-archive #replay-players dd {
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
#page-archive #replay-game-number {
  color:var(--ui-muted);
  font-size:var(--type-label);
  line-height:1.2;
  font-weight:500;
  font-variant-numeric:tabular-nums;
}
#page-archive #replay-players {
  display:grid;
  grid-column:2;
  grid-row:1;
  grid-template-columns:3.25em minmax(0,1fr);
  align-items:baseline;
  gap:2px 4px;
  min-width:0;
  margin:0;
  font-size:var(--type-secondary);
  line-height:1.35;
}
#page-archive #replay-players dt { color:var(--ui-muted); }
#page-archive #replay-players dd { min-width:0; margin:0; color:var(--ui-text); font-weight:600; }
#page-archive #replay-title { scroll-margin-top:calc(var(--sticky-topbar-height,60px) + 8px); }
#page-archive #replay-analysis-controls {
  grid-column:3;
  grid-row:1;
  display:block;
  flex:none;
  min-width:44px;
  width:44px;
  height:44px;
  margin:0;
  padding:0;
  border:0;
}
#page-archive .review-view-options>summary {
  display:flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  margin:0;
  padding:8px;
  border:1px solid var(--ui-border);
  border-radius:9px;
  color:var(--ui-muted);
  background:var(--ui-surface);
  cursor:pointer;
  list-style:none;
}
#page-archive .review-view-options>summary::-webkit-details-marker { display:none; }
#page-archive .review-view-options>summary::marker { content:''; }
#page-archive .review-view-options>.replay-toolbar {
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  /* Match the play options layer below the sticky app header. */
  z-index:15;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:4px;
  width:min(300px,calc(100vw - 40px));
  min-width:0;
  margin:0;
  padding:10px 14px;
  overflow-anchor:none;
  border:1px solid var(--ui-border-strong);
  border-radius:12px;
  background:var(--ui-surface);
  box-shadow:var(--ui-dialog-shadow);
}
#page-archive .review-view-options:not([open])>.replay-toolbar { display:none; }
#page-archive .review-view-options .eval-toggle { margin:0; }
#page-archive .review-view-options .text-button { justify-content:flex-start; min-height:44px; }
#page-archive .archive-annotation-toolbar { margin:8px 0; }
#page-archive .archive-annotation-toolbar>button { height:48px; min-height:48px; }

#page-archive #replay-board {
  align-self:start;
  aspect-ratio:1;
  width:100%;
  margin:0;
}
#page-archive .replay-actions {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px;
  align-items:center;
  width:100%;
  margin:8px 0 0;
  padding:0;
}
#page-archive .replay-actions>.icon-button {
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-width:0;
  height:44px;
  min-height:44px;
  margin:0;
  border:1px solid var(--ui-border);
  border-radius:9px;
  background:var(--ui-surface);
}
#page-archive .replay-actions>.icon-button:disabled { opacity:.3; }
#page-archive .review-position-navigation {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:2px;
  margin-top:8px;
}
#page-archive .review-position-navigation .replay-step { margin:0; min-height:21px; font-size:12px; line-height:1.6; }
#page-archive .review-position-navigation>input { width:100%; height:28px; min-height:28px; margin:0; }
#page-archive .replay-move-history {
  min-width:0;
  margin-top:12px;
  padding-top:14px;
  border-top:1px solid var(--ui-border);
}
#page-archive .replay-move-history .moves-header {
  justify-content:center;
  text-align:center;
}
#page-archive #replay-moves .history-move {
  display:flex;
  align-items:center;
  gap:6px;
  overflow-wrap:anywhere;
}
#page-archive #replay-moves .review-history-quality { flex:none; }

#page-archive .archive-analysis { margin-top:18px; padding-top:16px; }
#page-archive .archive-analysis-heading { gap:8px; margin-bottom:12px; }
#page-archive .archive-analysis-heading h3 { font-size:18px; line-height:1.4; }
#page-archive .archive-analysis-heading .toggle-label { min-height:44px; font-size:12px; }
#page-archive .review-summary {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  min-width:0;
}
#page-archive .review-accuracy-card {
  display:grid;
  align-content:start;
  gap:6px;
  min-width:0;
  padding:13px;
  border:1px solid transparent;
  border-radius:12px;
  background:var(--ui-surface-soft);
}
#page-archive .review-side { display:flex; align-items:center; gap:7px; color:var(--ui-muted); font-size:12px; }
#page-archive .review-side-marker { width:12px; height:12px; flex:none; border:1px solid var(--ui-border-strong); border-radius:50%; }
#page-archive .review-side-marker.side-white { background:#f6f2e7; border-color:#a6aaa2; }
#page-archive .review-side-marker.side-black { background:#26322b; border-color:#7c887e; }
#page-archive .review-accuracy-card>strong { display:block; min-height:36px; font-size:25px; line-height:1.4; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#page-archive .review-accuracy-detail { color:var(--ui-muted); font-size:11px; line-height:1.5; overflow-wrap:anywhere; }
#page-archive .review-coverage { margin:8px 0 0; color:var(--ui-muted); font-size:11px; line-height:1.6; }
#page-archive .archive-analysis-actions { display:flex; gap:8px; margin:12px 0 8px; }
#page-archive .archive-analysis-actions>button { flex:1 1 150px; min-height:44px; }
#page-archive #replay-analysis-progress { min-height:21px; margin:0 0 12px; font-size:12px; }
#page-archive .review-moment-navigation {
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 44px;
  gap:8px;
  align-items:center;
  min-width:0;
  margin:12px 0;
  padding:6px;
  border:1px solid transparent;
  border-radius:12px;
  background:var(--ui-surface-soft);
}
#page-archive .review-moment-navigation>.icon-button { width:44px; height:44px; min-width:44px; min-height:44px; }
#page-archive #replay-moment-current { min-width:0; color:var(--ui-muted); font-size:12px; line-height:1.5; text-align:center; overflow-wrap:anywhere; }
#page-archive .review-position-card { padding:8px 0 0; }
#page-archive .review-position-card .archive-move-quality { min-height:24px; margin:0; padding:0 0 0 9px; font-size:14px; font-weight:650; line-height:1.6; }
#page-archive .review-explanation { margin:9px 0 12px; color:var(--ui-muted); font-size:13px; line-height:1.65; }
#page-archive .review-best { min-width:0; padding:10px 12px; border-radius:9px; background:var(--ui-surface-soft); }
#page-archive .review-field-label { display:block; margin-bottom:4px; color:var(--ui-muted); font-size:11px; line-height:1.5; }
#page-archive #replay-best-move { font-size:16px; line-height:1.6; }
#page-archive .review-line { margin:5px 0 0; font-size:13px; line-height:1.7; color:var(--ui-text); overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
#page-archive .review-variants { display:grid; gap:6px; margin:8px 0 0; padding:0; list-style:none; min-width:0; }
#page-archive .review-variants:empty { display:none; }
#page-archive .review-variants>* { min-width:0; padding:8px 10px; border-left:2px solid var(--ui-border); border-radius:0 8px 8px 0; color:var(--ui-muted); background:var(--ui-surface-soft); font-size:12px; line-height:1.65; overflow-wrap:anywhere; }
#page-archive .review-variants>li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 10px; }
#page-archive .review-variants>li>span { font-variant-numeric:tabular-nums; }
#page-archive .review-variants>li>p { grid-column:1/-1; margin:0; font-size:12px; line-height:1.65; }
#page-archive .review-try-again { width:100%; min-height:44px; margin-top:12px; }
#page-archive .review-chart-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:18px 0 8px; }
#page-archive .review-chart-heading h4 { margin:0; font-size:14px; line-height:1.5; }
#page-archive .review-chart-heading>span { color:var(--ui-muted); font-size:11px; line-height:1.5; }
#page-archive .archive-eval-chart { height:164px; border-color:var(--ui-border); border-radius:12px; background:var(--ui-surface-soft); }
#page-archive .archive-chart-moment { fill:var(--review-quality); stroke:var(--ui-surface); stroke-width:1.5; pointer-events:none; }
#page-archive #replay-chart-current { min-height:22px; font-size:12px; margin:6px 0 14px; }
#page-archive .review-moments-section>h4 { margin:14px 0 8px; font-size:14px; }
#page-archive .review-key-moments { display:grid; gap:6px; min-width:0; }
#page-archive .review-key-moments>[data-review-ply] {
  display:grid;
  grid-template-columns:20px minmax(0,1fr);
  gap:2px 8px;
  align-items:center;
  width:100%;
  min-width:0;
  min-height:48px;
  padding:9px 10px;
  border:1px solid transparent;
  border-radius:9px;
  color:var(--ui-text);
  background:var(--ui-surface-soft);
  text-align:left;
  font-size:12px;
  line-height:1.5;
  overflow-wrap:anywhere;
}
#page-archive .review-key-moments>[data-review-ply][aria-current=step] { border-color:var(--ui-accent-border); background:var(--ui-accent-soft); }
#page-archive .review-key-moments>[data-review-ply]>.review-history-quality { grid-column:1; grid-row:1/3; }
#page-archive .review-key-moments>[data-review-ply]>span:not(.review-history-quality) { grid-column:2; grid-row:1; min-width:0; }
#page-archive .review-key-moments>[data-review-ply]>strong { grid-column:2; grid-row:2; min-width:0; color:var(--ui-muted); font-size:12px; font-weight:500; }
#page-archive .review-key-moments>p { margin:0; color:var(--ui-muted); font-size:12px; }
#page-archive .review-categories { display:grid; gap:0; min-width:0; }
#page-archive .review-categories>* { display:grid; grid-template-columns:minmax(0,1fr) 40px 40px; align-items:center; gap:6px; padding:8px 0; border-bottom:1px solid var(--ui-border); font-size:12px; line-height:1.5; }
#page-archive .review-categories>*>:not(:first-child) { text-align:center; font-variant-numeric:tabular-nums; }
#page-archive .review-category-label { display:flex; align-items:center; gap:8px; min-width:0; }
#page-archive .review-category-label>span:last-child { min-width:0; overflow-wrap:anywhere; }
#page-archive .review-category-head { color:var(--ui-muted); font-size:11px; }
#page-archive .review-disclosure-plus { flex:none; margin-left:auto; color:var(--ui-muted); font-size:20px; font-weight:400; }
#page-archive details[open]>summary>.review-disclosure-plus { transform:rotate(45deg); }
#page-archive .archive-analysis-method .context-help-body>p+p { margin-top:10px; }
#page-archive .review-category-details>.context-help-body,
#page-archive .review-game-info>.context-help-body { padding-left:4px; }
#page-archive .review-game-info { margin-top:16px; border-top:1px solid var(--ui-border); padding-top:5px; }
#page-archive .review-game-info #replay-detail { margin:0; }
#page-archive .review-drawing-help { margin-bottom:0; }
#page-archive .review-retry-panel { margin:12px 0; padding:14px; border:1px solid transparent; border-radius:12px; background:var(--ui-surface-soft); }
#page-archive .review-retry-heading { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; }
#page-archive #replay-retry-status { margin:10px 0; font-size:13px; line-height:1.65; }
#page-archive .review-retry-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
#page-archive .review-retry-actions>button { width:100%; min-width:0; min-height:44px; padding:8px; white-space:normal; }
#page-archive .review-retry-promotion { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:8px 0; }
#page-archive .review-retry-promotion>button { min-width:0; min-height:44px; white-space:normal; padding:8px; }

/* Class symbols supplement text in the review; colour is never the sole cue. */
#page-archive [data-quality] { --review-quality:var(--ui-muted); }
#page-archive [data-quality=brilliant],
#page-archive [data-quality=great] { --review-quality:var(--ui-accent-text); }
#page-archive [data-quality=best],
#page-archive [data-quality=excellent],
#page-archive [data-quality=good] { --review-quality:var(--ui-success); }
#page-archive [data-quality=inaccuracy],
#page-archive [data-quality=missed] { --review-quality:var(--ui-accent-text); }
#page-archive [data-quality=mistake],
#page-archive [data-quality=blunder] { --review-quality:var(--ui-danger); }
#page-archive .archive-move-quality[data-quality] { border-color:var(--review-quality); }
#page-archive .review-history-quality { display:inline-grid; place-items:center; min-width:17px; height:19px; padding:0 3px; border-radius:5px; color:var(--review-quality); background:var(--ui-surface); font-size:11px; font-weight:700; line-height:1; }
#page-archive .review-quality-badge {
  position:absolute;
  top:2px;
  right:2px;
  z-index:5;
  display:grid;
  place-items:center;
  min-width:17px;
  height:19px;
  padding:0 3px;
  border:1px solid var(--review-quality);
  border-radius:5px;
  background:var(--ui-surface);
  color:var(--review-quality);
  font:700 11px/1 var(--font);
  pointer-events:none;
}
#page-archive #replay-board .square.review-selected { box-shadow:inset 0 0 0 3px var(--board-selection-ring); }
#page-archive #replay-board .square { touch-action:manipulation; }
#page-archive #replay-board .square[data-can-drag=true] { touch-action:none; }
#page-archive #replay-board .square.review-legal-target::before { content:''; position:absolute; z-index:3; width:20%; height:20%; min-width:8px; min-height:8px; border:1px solid var(--board-light); border-radius:50%; background:#26372bb3; pointer-events:none; }
#page-archive #replay-board button.square { font:inherit; border:0; min-width:0; min-height:0; margin:0; cursor:pointer; }
#page-archive #replay-board button.square:disabled { opacity:1; cursor:default; }
#page-archive #replay-board button.square:focus-visible { outline:3px solid var(--ui-focus); outline-offset:-3px; }

@media (max-width:600px) {
  #page-archive .replay-card { width:calc(100% + 16px); max-width:none; margin-inline:-8px; padding:12px 0; border-inline:0; }
  #page-archive .replay-card>.replay-review-heading,
  #page-archive .replay-card>.archive-annotation-toolbar,
  #page-archive .replay-card>.replay-actions,
  #page-archive .replay-card>.review-position-navigation,
  #page-archive .replay-card>.review-retry-panel,
  #page-archive .replay-card>.replay-variation-panel,
  #page-archive .replay-card>.archive-analysis,
  #page-archive .replay-card>.review-game-info,
  #page-archive .replay-card>.review-drawing-help { width:calc(100% - 24px); margin-inline:12px; }
  #page-archive .replay-card>.replay-with-eval { width:100%; max-width:none; margin-inline:0; }
  #page-archive #replay-board { border:0; border-radius:0; }
  #page-archive .replay-review-heading>h2 { font-size:17px; }
  #page-archive .archive-annotation-toolbar>button { padding:5px; font-size:11px; line-height:1.35; }
  #page-archive .review-accuracy-card { padding:11px; }
  #page-archive .review-accuracy-card>strong { font-size:23px; }
  #page-archive .review-position-card { padding:12px; }
  #page-archive .archive-eval-chart { height:150px; }
}
@media (prefers-reduced-motion:no-preference) {
  #page-archive .review-disclosure-plus { transition:transform 160ms ease; }
}

/* Archive browsing on phones/tablets: quiet counters and one row of file
   actions. Replay geometry and every desktop rule are owned elsewhere. */
@media (max-width:850px), (max-width:1100px) and (hover:none), (max-width:1100px) and (pointer:coarse) {
  #page-archive>.archive-page-actions {
    margin:0 0 10px;
    padding:0;
  }
  #page-archive .archive-page-actions>.memory-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    min-width:0;
    gap:8px;
  }
  #page-archive .archive-page-actions>.memory-actions>button {
    width:100%;
    min-width:0;
    height:44px;
    min-height:44px;
    margin:0;
    padding:7px 8px;
    font-size:12px;
    line-height:1.35;
    white-space:normal;
  }

  #page-archive>.archive-capacity {
    min-width:0;
    margin:0 0 10px;
    padding:12px;
    border-radius:12px;
  }
  #page-archive .archive-capacity>.card-heading {
    margin:0 0 6px;
    gap:6px;
  }
  #page-archive #archive-capacity-title {
    margin:0;
    font-size:16px;
    line-height:1.4;
    letter-spacing:0;
  }
  /* The heading and caption already state that these are local records. */
  #page-archive .archive-capacity>.card-heading>.subtle-badge { display:none; }
  #page-archive .archive-capacity>.archive-storage-caption {
    margin:0 0 8px;
    font-size:12px;
    line-height:1.5;
  }
  #page-archive .archive-capacity>.archive-usage {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    align-items:stretch;
    gap:0;
    margin:0;
    padding:8px 0;
    border-block:1px solid var(--ui-border);
  }
  #page-archive .archive-capacity .archive-usage-pool {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    min-width:0;
    gap:2px;
    margin:0;
    padding:0 8px;
    border:0;
    border-radius:0;
    background:transparent;
  }
  #page-archive .archive-capacity .archive-usage-pool:first-child { padding-left:0; }
  #page-archive .archive-capacity .archive-usage-pool:last-child { padding-right:0; }
  #page-archive .archive-capacity .archive-usage-pool+.archive-usage-pool {
    border-inline-start:1px solid var(--ui-border);
  }
  #page-archive .archive-capacity .archive-usage-pool>span {
    min-height:32px;
    margin:0;
    font-size:12px;
    line-height:1.35;
  }
  #page-archive .archive-capacity .archive-usage-pool strong {
    display:block;
    min-width:0;
    font-size:18px;
    line-height:1.35;
    white-space:normal;
    overflow-wrap:anywhere;
    font-variant-numeric:tabular-nums;
  }
  #page-archive .archive-capacity .archive-usage-pool strong>span {
    display:block;
    margin:0;
    font-size:11px;
    line-height:1.4;
    white-space:normal;
  }
  #page-archive .archive-capacity>.archive-storage-details {
    margin:4px 0 0;
    border-top:0;
  }
  #page-archive .archive-capacity>.archive-storage-details>summary,
  #page-archive .archive-capacity>.archive-management>summary {
    min-height:44px;
    gap:8px;
    padding:6px 0;
    font-size:13px;
    line-height:1.4;
  }
  #page-archive .archive-capacity>.archive-storage-details+.archive-management {
    margin:0;
    padding-top:0;
  }
  #page-archive .archive-capacity-warning {
    margin:8px 0;
    padding:9px 10px;
    font-size:12px;
    line-height:1.5;
  }

  #page-archive>.archive-summary {
    margin:0 0 10px;
    padding:2px 0;
    border:0;
    border-radius:0;
    background:transparent;
    color:var(--ui-muted);
    font-size:12px;
    line-height:1.5;
  }
  #page-archive .archive-browser { padding:12px; }
  #page-archive .archive-browser>.card-heading {
    align-items:center;
    gap:8px;
    margin-bottom:4px;
  }
  #page-archive .archive-browser>.card-heading>h2 { font-size:16px; line-height:1.4; }
  #page-archive #archive-total { font-size:12px; line-height:1.4; }
  #page-archive .archive-filter-panel { margin:4px 0 8px; padding-bottom:8px; }
  #page-archive .archive-filter-panel>.compact-panel-summary {
    min-height:44px;
    padding-block:6px;
    gap:8px;
    font-size:13px;
  }
  #page-archive .archive-filter-selection { gap:6px; margin-bottom:8px; }
  #page-archive .archive-filter-chip { padding:6px 8px; min-height:44px; }
  #page-archive .archive-pagination {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    align-items:center;
    gap:6px;
    margin-top:10px;
  }
  #page-archive .archive-pagination>button {
    min-width:0;
    min-height:44px;
    padding:7px;
    font-size:11px;
    line-height:1.4;
    white-space:normal;
  }
  #page-archive .archive-pagination>span { font-size:11px; white-space:nowrap; }
  #page-archive>.storage-callout {
    position:relative;
    margin:12px 0;
    padding:12px;
    gap:9px;
    border-radius:10px;
    font-size:12px;
    line-height:1.55;
  }
  #page-archive>.storage-callout>p { margin:0; font-size:12px; line-height:1.55; }
}

/* Compact archive workspace only. Live play and desktop review retain r35. */
#page-archive .replay-mobile-quick,
#page-archive .replay-mobile-details-host,
#page-archive .replay-flip-label { display:none; }

@media (max-width:850px), (max-width:1100px) and (hover:none), (max-width:1100px) and (pointer:coarse) {
  #page-archive .replay-card {
    /* r19's sticky offset must not move a relative mobile card out of flow. */
    top:auto;
    --replay-mobile-layout:1;
    --replay-mobile-bottom:140px;
    padding:6px 12px 10px;
  }
  #page-archive .replay-review-heading {
    height:3.75rem;
    min-height:3.75rem;
    margin-bottom:4px;
    gap:8px;
  }
  #page-archive #replay-game-kind { font-size:var(--type-subheading); }
  #page-archive .review-view-options>.replay-toolbar {
    /* Reuse the measured header/navigation reserve, excluding the score and
       fixed bottom controls (24 + 140). Keep the menu above the bottom bar. */
    max-height:max(44px,calc(100svh - var(--replay-mobile-reserved-height,366px) + 164px));
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  #page-archive .replay-toolbar>.archive-annotation-toolbar {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:4px;
    margin:6px 0;
    padding-top:8px;
    border-top:1px solid var(--ui-border);
  }
  #page-archive .replay-toolbar>.archive-annotation-toolbar>button {
    height:44px;
    min-height:44px;
    min-width:0;
    padding:4px;
    font-size:11px;
    line-height:1.3;
  }
  #page-archive .replay-toolbar>.review-position-navigation {
    margin:0;
    padding-top:6px;
    border-top:1px solid var(--ui-border);
  }
  #page-archive .replay-toolbar .replay-step { font-size:11px; }
  #page-archive .replay-toolbar>#replay-flip {
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
    width:100%;
    min-height:44px;
    height:auto;
    margin:0;
    padding:0 6px;
    border:0;
    background:transparent;
    color:var(--ui-text);
  }
  #page-archive .replay-toolbar .replay-flip-label { display:inline; }
  #page-archive .replay-with-eval {
    width:min(100%,var(--replay-board-fit,100%));
    width:min(100%,var(--replay-board-fit,100%),max(224px,calc(100svh - var(--replay-mobile-reserved-height,366px))));
    max-width:none;
    margin:0 auto;
  }
  #page-archive .replay-card>.replay-move-history {
    display:flex;
    width:100%;
    height:44px;
    min-height:44px;
    margin:0;
    padding:0;
    border:0;
    overflow:hidden;
  }
  #page-archive .replay-move-history>:is(.moves-header,.moves-table-head) { display:none; }
  #page-archive #replay-moves.focus-move-strip {
    overscroll-behavior-y:auto;
    touch-action:manipulation;
  }
  #page-archive #replay-moves.focus-move-strip .history-move {
    position:relative;
    padding:0 22px 0 8px;
    border:0;
    border-radius:0;
  }
  #page-archive #replay-moves.focus-move-strip .history-move[aria-current=step] {
    box-shadow:inset 0 -2px var(--ui-accent);
  }
  #page-archive #replay-moves.focus-move-strip .review-history-quality {
    position:absolute;
    inset-inline-end:4px;
    inset-block-start:50%;
    transform:translateY(-50%);
    min-width:14px;
    padding:0;
    background:transparent;
  }
  #page-archive .replay-card>.replay-actions {
    grid-template-columns:repeat(4,minmax(0,1fr));
    width:100%;
    margin:0;
    gap:0;
    background:var(--ui-surface-soft);
  }
  #page-archive .replay-card>.replay-actions:has(>#replay-flip) {
    grid-template-columns:repeat(5,minmax(0,1fr));
  }
  #page-archive .replay-card>.replay-actions>.icon-button {
    min-height:44px;
    height:44px;
    border:0;
    border-radius:0;
    background:transparent;
    touch-action:manipulation;
  }
  #page-archive .replay-mobile-quick {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    width:100%;
    min-height:44px;
    margin:4px 0 0;
    padding:0 8px;
    border-radius:6px;
    background:var(--ui-inset);
  }
  #page-archive .replay-mobile-proposal-copy { display:grid; gap:1px; min-width:0; }
  #page-archive .replay-mobile-proposal-copy>span { color:var(--ui-muted); font-size:10px; line-height:14px; }
  #page-archive #replay-mobile-proposal-line {
    display:block;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:12px;
    font-weight:600;
    line-height:18px;
  }
  #page-archive #replay-mobile-proposal-action {
    min-width:56px;
    min-height:44px;
    margin:0;
    padding:0 3px;
    font-size:11px;
    white-space:nowrap;
  }
  #page-archive .replay-mobile-details-host:not([hidden]) {
    display:block;
    margin-top:8px;
  }
  #page-archive .replay-card:has(>.replay-mobile-details-host:not([hidden]))>.review-game-info { display:none; }
  #page-archive .mobile-review-sections {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:2px;
    padding:2px;
    border-radius:9px;
    background:var(--ui-inset);
  }
  #page-archive .mobile-review-sections>button {
    min-width:0;
    min-height:44px;
    margin:0;
    padding:6px 4px;
    border:0;
    border-radius:7px;
    background:transparent;
    color:var(--ui-muted);
    font-size:var(--type-secondary);
    font-weight:600;
  }
  #page-archive .mobile-review-sections>button[aria-expanded="true"] {
    background:var(--ui-accent-soft);
    color:var(--ui-accent-text);
  }
  #page-archive .mobile-review-sections>button:focus-visible { outline:2px solid var(--ui-focus); outline-offset:-2px; }
  #page-archive .mobile-review-panel {
    min-width:0;
    margin-top:8px;
    padding:10px;
    border-radius:9px;
    background:var(--ui-surface-soft);
    overflow-anchor:none;
  }
  #page-archive .mobile-review-panel>.archive-analysis {
    margin:0;
    padding:0;
    border:0;
  }
  #page-archive .mobile-review-panel .archive-analysis-heading { display:none; }
  #page-archive .mobile-review-panel .archive-analysis-actions { margin-top:0; }
  #page-archive .mobile-review-panel .review-position-card {
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
  }
  #page-archive .review-accuracy-card { gap:3px; padding:9px; }
  #page-archive .review-accuracy-card>strong { min-height:28px; font-size:21px; line-height:1.3; }
  #page-archive .review-coverage { font-size:11px; line-height:1.45; }
  #page-archive .mobile-review-panel .review-variation-panel,
  #page-archive .mobile-review-panel .replay-variation-panel { margin:0 0 10px; }
  #page-archive .mobile-review-panel .context-help {
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
  }
  #page-archive .mobile-review-panel>.storage-callout {
    margin:8px 0 0;
    padding:0;
    gap:8px;
    border:0;
    border-radius:0;
    background:transparent;
  }
  #page-archive .mobile-review-panel>.storage-callout>p { margin:0; font-size:12px; line-height:1.55; }
  #page-archive .mobile-review-panel .context-help>summary { min-height:44px; padding:8px 0; font-size:12px; }
  #page-archive .mobile-review-panel .context-help-body { padding:0 0 10px; }
  #page-archive .mobile-review-panel .review-moments-section>h4 { margin-top:10px; }
  #page-archive .review-key-moments { gap:4px; }
  #page-archive .review-key-moments>[data-review-ply] { min-height:44px; padding:6px 8px; }
}

@media (max-width:390px) {
  #page-archive .replay-review-heading {
    grid-template-columns:minmax(0,38fr) minmax(0,62fr) 44px;
  }
}
@media (max-width:600px) {
  #page-archive .replay-card { padding:6px 0 10px; }
  #page-archive .replay-card>.replay-review-heading { width:calc(100% - 16px); margin:0 8px 4px; }
  #page-archive .replay-card>.replay-with-eval {
    width:min(100%,var(--replay-board-fit,100%));
    width:min(100%,var(--replay-board-fit,100%),max(224px,calc(100svh - var(--replay-mobile-reserved-height,366px))));
    margin-inline:auto;
  }
  #page-archive .replay-card>.replay-mobile-quick,
  #page-archive .replay-card>.replay-mobile-details-host { width:calc(100% - 16px); margin-inline:8px; }
}

/* Full-width phone replay with the shared evaluation row. */
@media (max-width:850px), (max-width:1100px) and (hover:none), (max-width:1100px) and (pointer:coarse) {
  #page-archive .replay-card {
    --replay-mobile-full-width:1;
    --replay-mobile-layout:0;
    border-bottom:0;
  }
  #page-archive .replay-with-eval,
  #page-archive .replay-card>.replay-with-eval {
    width:100%;
    max-width:none;
    margin-inline:0;
  }
  /* Keep the scrollable options bounded by the current app chrome. */
  #page-archive .review-view-options>.replay-toolbar {
    max-height:max(44px,calc(100svh - var(--sticky-topbar-height,60px) - var(--app-mobile-nav-height,0px) - 72px));
  }
}

/* Test dashboard only. Game, training and the other pages keep their layout. */
#page-tests { --tests-gap:18px; }
#page-tests [hidden] { display:none!important; }
#page-tests .tests-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px; }
#page-tests .tests-heading h1 { margin:0;font-size:25px;line-height:1.25;letter-spacing:-.6px; }
#page-tests .tests-state { display:inline-flex;align-items:center;gap:8px;padding:7px 11px;border:1px solid var(--ui-border);border-radius:99px;color:var(--ui-muted);font-size:12px;line-height:1.4;text-align:right; }
#page-tests .tests-state::before { content:"";width:6px;height:6px;border-radius:50%;background:var(--ui-muted);flex-shrink:0; }
#page-tests .tests-state.running { color:var(--ui-accent-text); }
#page-tests .tests-state.running::before { background:var(--ui-accent); }
#page-tests .test-mode-tabs { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:5px;margin:0 0 var(--tests-gap);border:1px solid var(--ui-border);border-radius:14px;background:var(--ui-surface-soft); }
#page-tests .test-mode-tabs>button { display:flex;align-items:center;justify-content:center;gap:12px;min-height:68px;margin:0;padding:12px 16px;border:1px solid transparent;border-radius:10px;background:transparent;box-shadow:none;text-align:left;color:var(--ui-muted); }
#page-tests .test-mode-tabs>button[aria-selected="true"] { color:var(--ui-accent-text);border-color:var(--ui-accent);background:var(--ui-accent-soft); }
#page-tests .test-mode-tabs>button>svg { flex:0 0 22px; }
#page-tests .test-mode-tabs .tests-mode-copy { display:grid;gap:3px;margin:0;font-size:inherit;color:inherit; }
#page-tests .tests-mode-copy strong { font-size:15px;line-height:1.3; }
#page-tests .tests-mode-copy small { color:var(--ui-muted);font-size:12px;line-height:1.3; }
#page-tests #test-rating-hero { display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 24px;margin:0 0 var(--tests-gap);border-radius:14px;background:var(--ui-surface);box-shadow:none; }
#page-tests .tests-rating-copy { display:grid;grid-template-columns:auto 1fr;align-items:center;gap:5px 20px;min-width:0; }
#page-tests .tests-rating-copy .section-label { grid-column:1/-1;font-size:10px;line-height:1.4;letter-spacing:1.1px; }
#page-tests .rating-number { display:flex;align-items:baseline;gap:9px;white-space:nowrap; }
#page-tests .rating-number strong { margin:0;font-size:40px;line-height:1.1;font-variant-numeric:tabular-nums;letter-spacing:-1px;color:var(--ui-text); }
#page-tests .rating-number>span { font-size:12px;color:var(--ui-muted); }
#page-tests #test-ranking-caption { margin:0;color:var(--ui-muted);font-size:12px;line-height:1.5; }
#page-tests .tests-rating-meta { display:grid;gap:5px;flex:0 1 auto;color:var(--ui-muted);font-size:12px;line-height:1.5;text-align:right; }
#page-tests #test-ranking-range { color:var(--ui-text); }
#page-tests .tests-layout { display:grid;grid-template-columns:minmax(300px,.85fr) minmax(0,1.15fr);gap:var(--tests-gap);align-items:start; }
#page-tests :is(.benchmark-card,.test-result-card,.test-history-card) { padding:22px;border-radius:14px;min-width:0;margin-bottom:0; }
#page-tests .benchmark-card { overflow:visible; }
#page-tests .card-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px; }
#page-tests .card-heading>div { min-width:0; }
#page-tests .card-heading h2 { margin:4px 0 0;font-size:19px;line-height:1.35;letter-spacing:-.3px; }
#page-tests .tests-eyebrow { display:block;color:var(--ui-muted);font-size:10px;line-height:1.4;letter-spacing:1px;font-weight:600; }
#page-tests .card-heading .subtle-badge { padding:5px 8px;font-size:9px;white-space:nowrap; }
#page-tests .tests-info { position:relative;flex:0 0 36px;margin:0;padding:0;border:0;background:transparent; }
#page-tests .tests-info>summary { display:flex;align-items:center;justify-content:center;width:36px;height:36px;min-height:0;padding:0;border:1px solid var(--ui-border);border-radius:50%;background:transparent;color:var(--ui-muted);list-style:none; }
#page-tests .tests-info>summary::after { content:none; }
#page-tests .tests-info>summary::-webkit-details-marker { display:none; }
#page-tests .tests-info>.context-help-body { position:absolute;top:44px;right:0;z-index:15;width:min(320px,calc(100vw - 64px));max-height:min(360px,55svh);overflow:auto;box-sizing:border-box;padding:16px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface);box-shadow:0 12px 35px #0004;color:var(--ui-muted);font-size:13px;line-height:1.6; }
#page-tests .tests-info .context-help-body p { margin:10px 0 0; }
#page-tests .tests-info .context-help-body>strong { color:var(--ui-text); }
#page-tests .tests-reference { display:flex;align-items:center;gap:12px;padding:12px 14px;margin-bottom:16px;border-radius:10px;background:var(--ui-surface-soft); }
#page-tests .tests-reference>svg { flex:0 0 22px;color:var(--ui-muted); }
#page-tests .tests-reference>div { display:grid;gap:3px; }
#page-tests .tests-reference strong { font-size:13px;line-height:1.4; }
#page-tests .tests-reference span { font-size:11px;color:var(--ui-muted);line-height:1.4; }
#page-tests :is(.test-primary-fields,.training-fields) { gap:12px; }
#page-tests .test-primary-fields { display:block;margin:0; }
#page-tests .form-label { display:block;font-size:13px;line-height:1.4;margin:0 0 8px;color:var(--ui-text); }
#page-tests select { box-sizing:border-box;width:100%;min-height:46px;margin:0;padding:10px 13px;font-size:14px;line-height:1.5;border-radius:9px; }
#page-tests .opponent-picker { padding:0;margin:0 0 16px;border:0;background:transparent; }
#page-tests .tests-library-actions { display:flex;justify-content:space-between;gap:10px;margin:8px 0 0; }
#page-tests .tests-library-actions button { padding:4px 0;min-height:32px;font-size:12px;color:var(--ui-text); }
#page-tests .tests-parameters { margin:14px 0 0;padding:0;border:0;background:transparent; }
#page-tests .tests-parameters>summary { display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 0;color:var(--ui-muted);font-size:12px;line-height:1.5; }
#page-tests .tests-parameters>summary small { margin-left:auto;color:var(--ui-text);font-size:11px; }
#page-tests .tests-parameters>summary::after { content:"";flex:0 0 6px;width:6px;height:6px;margin:0 3px 3px 2px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg); }
#page-tests .tests-parameters[open]>summary::after { transform:rotate(225deg);margin-bottom:0; }
#page-tests .tests-parameters>p { margin:8px 0 12px;font-size:12px;line-height:1.5;color:var(--ui-muted); }
#page-tests .tests-parameters .training-fields { margin-bottom:4px; }
#page-tests .training-buttons { display:grid;grid-template-columns:minmax(0,1fr);margin-top:14px;gap:0; }
#page-tests .training-buttons>button { grid-area:1/1;width:100%;min-height:48px;margin:0;padding:12px;font-size:14px;box-sizing:border-box; }
#page-tests[data-test-state="running"] #run-benchmark { visibility:hidden; }
#page-tests #stop-benchmark { color:var(--ui-text);border-color:var(--ui-accent);background:var(--ui-accent-soft); }
#page-tests .tests-config-summary { margin:9px 0 0;text-align:center;color:var(--ui-muted);font-size:11px;line-height:1.5; }
#page-tests #reset-benchmark { margin-top:10px;font-size:12px; }
#page-tests .test-progress { margin:20px 0 0;padding-top:18px;border-top:1px solid var(--ui-border); }
#page-tests .tests-progress-heading { display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px; }
#page-tests #test-series-context { font-size:11px;color:var(--ui-muted);font-weight:500; }
#page-tests .training-phase-reason { margin:8px 0 10px;padding:0;border:0;background:transparent;box-shadow:none;font-size:12px;line-height:1.5;color:var(--ui-muted); }
#page-tests .training-progress-label { margin-top:12px;font-size:13px; }
#page-tests .training-track { margin-top:8px;height:6px; }
#page-tests #test-live-results { margin-top:12px; }
#page-tests .live-result-cards { gap:8px; }
#page-tests .live-result-cards>span { min-height:64px;padding:10px 5px;gap:4px;border:0;border-radius:9px;background:var(--ui-surface-soft); }
#page-tests .live-result-cards>span>strong { font-size:24px;line-height:1.15; }
#page-tests .live-result-cards>span>small { font-size:11px;line-height:1.4; }
#page-tests .benchmark-summary { gap:14px; }
#page-tests .test-result-card .benchmark-summary>.benchmark-primary { padding:0;background:transparent;border:0;gap:5px; }
#page-tests .test-result-card .benchmark-primary>strong { font-size:40px;line-height:1.15;color:var(--ui-text); }
#page-tests .test-result-card .benchmark-primary>span { font-size:12px; }
#page-tests .test-result-card .benchmark-primary .benchmark-range { color:var(--ui-muted);font-size:12px; }
#page-tests .test-result-card .benchmark-wdl>span { min-height:70px;padding:10px 5px;gap:5px;border:0;border-radius:9px;background:var(--ui-surface-soft); }
#page-tests .live-result-cards>.live-result-wins,
#page-tests .test-result-card .benchmark-wdl>.wdl-wins { background:var(--ui-success-soft); }
#page-tests .live-result-cards>.live-result-losses,
#page-tests .test-result-card .benchmark-wdl>.wdl-losses { background:var(--ui-danger-soft); }
#page-tests .live-result-cards>.live-result-wins>strong,
#page-tests .test-result-card .benchmark-wdl>.wdl-wins>strong { color:var(--ui-success); }
#page-tests .live-result-cards>.live-result-losses>strong,
#page-tests .test-result-card .benchmark-wdl>.wdl-losses>strong { color:var(--ui-danger); }
#page-tests .test-result-card .benchmark-wdl>span>strong { font-size:27px;line-height:1.2; }
#page-tests .test-result-card .benchmark-wdl>span>small { font-size:11px; }
#page-tests .test-result-card .benchmark-summary>:is(.duel-points,.benchmark-sample) { display:grid;gap:3px;padding:0;background:transparent;border:0;border-radius:0; }
#page-tests .test-result-card :is(.duel-points,.benchmark-sample)>strong { font-size:23px;line-height:1.3; }
#page-tests .test-result-card .benchmark-summary small { font-size:11px;line-height:1.5; }
#page-tests .benchmark-model-caption { margin:14px 0 10px;font-size:12px;line-height:1.5; }
#page-tests .benchmark-empty { display:flex;align-items:center;gap:16px;min-height:120px;margin:0;padding:18px;border:0;background:var(--ui-surface-soft); }
#page-tests .benchmark-empty>span { font-size:38px;color:var(--ui-muted); }
#page-tests .benchmark-empty strong { font-size:14px;line-height:1.5; }
#page-tests .benchmark-empty p { font-size:12px;line-height:1.6;margin:7px 0 0; }
#page-tests #training-chart { margin-top:14px; }
#page-tests .measurement-details { margin-top:12px;border:0;padding:0;background:transparent; }
#page-tests .measurement-details>summary { padding:5px 0;font-size:12px;color:var(--ui-muted); }
#page-tests .test-history-card { margin-top:var(--tests-gap); }
#page-tests .test-history-card .card-heading { margin-bottom:12px; }
#page-tests .test-history-card .card-heading>.text-button { padding:4px 0;font-size:12px;white-space:nowrap; }
#page-tests .benchmark-intro { margin:0 0 14px;font-size:12px;line-height:1.5; }
#page-tests #benchmark-history { display:grid;gap:0; }
#page-tests .benchmark-history-card { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 20px;padding:14px 0;margin:0;border:0;border-top:1px solid var(--ui-border);border-radius:0;background:transparent;box-shadow:none; }
#page-tests .benchmark-history-heading { display:contents; }
#page-tests .benchmark-history-heading>div:first-child { display:grid;gap:5px;min-width:0; }
#page-tests .benchmark-history-heading strong { font-size:13px;line-height:1.4; }
#page-tests .benchmark-history-heading small { font-size:11px;line-height:1.5;color:var(--ui-muted); }
#page-tests .benchmark-history-result { align-self:start;justify-self:end;font-size:18px;font-weight:600;color:var(--ui-text);font-variant-numeric:tabular-nums;white-space:nowrap; }
#page-tests .history-wdl { display:flex;align-items:center;justify-content:flex-start;gap:14px;margin:0;grid-column:1/-1; }
#page-tests .history-wdl>span { display:inline-flex;align-items:baseline;gap:4px;margin:0;padding:0;border:0;background:transparent; }
#page-tests .history-wdl strong { font-size:13px;line-height:1.4; }
#page-tests .history-wdl small { font-size:10px;color:var(--ui-muted); }
#page-tests .benchmark-history-meta { grid-column:1/-1;margin:0;font-size:11px;line-height:1.5;color:var(--ui-muted); }
@media(min-width:1100px) {
  #page-tests .benchmark-history-card { grid-template-columns:minmax(0,1fr) auto auto; }
  #page-tests .benchmark-history-result { grid-column:3;grid-row:1;align-self:center; }
  #page-tests .history-wdl { grid-column:2;grid-row:1;align-self:center; }
}
@media(max-width:1000px) {
  #page-tests .tests-layout { grid-template-columns:minmax(0,1fr); }
  #page-tests .tests-rating-copy { grid-template-columns:1fr;gap:5px; }
  #page-tests .tests-rating-meta { max-width:42%; }
}
@media(max-width:600px) {
  #page-tests { --tests-gap:14px; }
  #page-tests .tests-heading { margin-bottom:14px; }
  #page-tests .tests-heading h1 { font-size:21px; }
  #page-tests .tests-state { max-width:48%;font-size:10px;padding:6px 8px; }
  #page-tests .test-mode-tabs>button { min-height:64px;gap:8px;padding:9px 8px; }
  #page-tests .tests-mode-copy strong { font-size:12px; }
  #page-tests .tests-mode-copy small { font-size:10px; }
  #page-tests .test-mode-tabs>button>svg { width:19px;height:19px;flex-basis:19px; }
  #page-tests #test-rating-hero { padding:15px 16px;gap:12px; }
  #page-tests .rating-number strong { font-size:34px; }
  #page-tests .rating-number>span { font-size:11px; }
  #page-tests :is(#test-ranking-caption,.tests-rating-meta) { font-size:10px; }
  #page-tests :is(.benchmark-card,.test-result-card,.test-history-card) { padding:17px; }
  #page-tests .card-heading h2 { font-size:18px; }
  #page-tests .card-heading .subtle-badge { font-size:8px;padding:4px 6px; }
  #page-tests .tests-reference { padding:10px 12px; }
  #page-tests .history-wdl { gap:12px; }
  #page-tests .benchmark-history-card { gap:8px 10px; }
}
@media(prefers-reduced-motion:no-preference) {
  #page-tests .test-mode-tabs>button { transition:background-color .16s,border-color .16s,color .16s; }
}

/* The coaching dashboard uses the existing Pumpkin palette and is isolated from game views. */
#page-training .coaching-dashboard{margin:0 0 20px;min-width:0}
#page-training .coaching-readiness{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,300px);align-items:center;gap:28px;padding:22px 24px;margin:0 0 16px}
#page-training .coaching-athlete{display:grid;gap:5px;min-width:0}
#page-training .coaching-eyebrow{font-size:10px;line-height:1.4;letter-spacing:1.1px;font-weight:700;color:var(--ui-muted)}
#page-training .coaching-athlete>strong{font-size:23px;line-height:1.3;overflow-wrap:anywhere}
#page-training .coaching-athlete>span:last-child{font-size:12px;color:var(--ui-muted)}
#page-training .coaching-energy-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:8px;font-size:12px;color:var(--ui-muted)}
#page-training .coaching-energy-heading strong{font-size:23px;line-height:1.2;font-variant-numeric:tabular-nums;color:var(--ui-success)}
#page-training .coaching-energy-meter,#page-training .coaching-progress-track{height:7px;background:var(--ui-track);border-radius:8px;overflow:hidden}
#page-training .coaching-energy-meter>span{display:block;width:100%;height:100%;border-radius:inherit;background:var(--ui-success);transition:width .35s linear}
#page-training .coaching-energy>small{display:block;margin-top:7px;color:var(--ui-muted);font-size:10px;text-align:right}
#page-training .coaching-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr);align-items:start;gap:16px}
#page-training .coaching-composer,#page-training .coaching-session{min-width:0;padding:22px;margin:0}
#page-training .coaching-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
#page-training .coaching-section-heading h3,#page-training .coaching-session h3{font-size:18px;line-height:1.4;letter-spacing:-.3px}
#page-training .coaching-section-heading>span{font-size:11px;color:var(--ui-muted);white-space:nowrap}
#page-training .coaching-disciplines{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
#page-training .coaching-choice{position:relative;display:flex;align-items:flex-start;gap:10px;padding:13px 11px;min-height:91px;text-align:left;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface-soft);color:var(--ui-text);transition:background-color .18s,border-color .18s,transform .18s}
#page-training .coaching-choice[data-coaching-discipline="sparring"]{grid-column:1/-1;min-height:68px;align-items:center}
@media(hover:hover) and (pointer:fine){#page-training .coaching-choice:not(:disabled):hover{filter:brightness(1.06)}}
#page-training .coaching-choice:not(:disabled):active{transform:scale(.985)}
#page-training .coaching-choice.is-selected{border-color:var(--ui-accent-border);background:var(--ui-accent-soft)}
#page-training .coaching-choice:disabled{opacity:.65;cursor:default}
#page-training .coaching-choice.is-selected:disabled{opacity:.9}
#page-training .coaching-choice-icon{display:grid;place-items:center;flex:none;width:28px;height:28px;color:var(--ui-muted)}
#page-training .coaching-choice.is-selected .coaching-choice-icon{color:var(--ui-accent-text)}
#page-training .coaching-choice-copy{display:grid;gap:5px;min-width:0;padding-right:11px}
#page-training .coaching-choice-copy strong{font-size:13px;line-height:1.35}
#page-training .coaching-choice-copy small{font-size:10px;line-height:1.55;color:var(--ui-muted)}
#page-training .coaching-choice-add{position:absolute;right:9px;top:10px;font-size:17px;color:var(--ui-muted);line-height:1}
#page-training .coaching-choice-count{position:absolute;right:8px;bottom:8px;display:grid;place-items:center;min-width:17px;height:17px;border-radius:5px;background:var(--ui-accent);color:var(--ui-on-accent);font-size:10px;font-weight:700}
#page-training .coaching-choice-count[hidden]{display:none}
#page-training .coaching-plan-heading{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:22px 0 10px}
#page-training .coaching-plan-heading h4,#page-training .coaching-skill-heading h4{margin:0;font-size:13px;line-height:1.5;font-weight:600}
#page-training .coaching-plan-heading>span{font-size:10px;line-height:1.5;color:var(--ui-muted);text-align:right}
#page-training .coaching-plan-empty{padding:15px 13px;border:1px dashed var(--ui-border);border-radius:10px;font-size:12px;line-height:1.65;color:var(--ui-muted)}
#page-training .coaching-plan{margin:0;padding:0;list-style:none;display:grid;gap:8px}
#page-training .coaching-plan-row{display:flex;align-items:center;gap:10px;min-width:0;padding:11px 9px;border:1px solid transparent;border-radius:10px;background:var(--ui-inset)}
#page-training .coaching-plan-number{display:grid;place-items:center;flex:none;width:24px;height:28px;font-size:12px;font-weight:700;color:var(--ui-muted);background:var(--ui-surface-soft);border-radius:6px}
#page-training .coaching-plan-label{display:grid;gap:3px;min-width:0;flex:1}
#page-training .coaching-plan-label strong{font-size:12px;line-height:1.4}
#page-training .coaching-plan-label small{font-size:10px;line-height:1.4;color:var(--ui-muted)}
#page-training .coaching-intensity{flex:0 1 128px;min-width:90px;margin:0}
#page-training .coaching-intensity select{width:100%;max-width:128px;margin:0;padding:8px 21px 8px 8px;min-height:38px;border:1px solid var(--ui-border);border-radius:8px;background-color:var(--ui-surface-soft);color:var(--ui-text);font-size:10px;line-height:1.4}
#page-training .coaching-remove{display:grid;place-items:center;flex:none;width:34px;height:38px;background:transparent;border:0;border-radius:7px;font-size:23px;line-height:1;color:var(--ui-muted)}
@media(hover:hover) and (pointer:fine){#page-training .coaching-remove:not(:disabled):hover{filter:brightness(1.06)}}
#page-training .coaching-action-slot{display:grid;margin-top:15px;min-height:48px}
#page-training .coaching-action-slot>button{grid-area:1/1;width:100%;min-height:48px;white-space:normal}
#page-training .coaching-action-slot>button[hidden]{display:none}
#page-training .coaching-blocked{margin-top:10px;font-size:11px;line-height:1.6;color:var(--ui-accent-text)}
#page-training .coaching-session-heading{display:flex;align-items:center;gap:13px;margin:21px 0 25px}
#page-training .coaching-session-emblem{display:grid;place-items:center;flex:none;width:55px;height:60px;border:1px solid var(--ui-accent-border);border-radius:15px;background:var(--ui-accent-soft);color:var(--ui-accent-text);font-size:40px;line-height:1}
#page-training .coaching-session-heading p{margin:6px 0 0;font-size:11px;line-height:1.65;color:var(--ui-muted)}
#page-training .coaching-progress-heading{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:8px;font-size:11px;color:var(--ui-muted)}
#page-training .coaching-progress-heading strong{font-size:13px;font-variant-numeric:tabular-nums;color:var(--ui-text)}
#page-training .coaching-progress-track>span{display:block;height:100%;width:0;border-radius:inherit;background:var(--ui-accent-text);transition:width .3s linear}
#page-training .coaching-session-message{margin:12px 0 0;font-size:12px;line-height:1.65;color:var(--ui-muted);min-height:40px;overflow-wrap:anywhere}
#page-training .coaching-last-result,#page-training .coaching-candidate-status{margin:10px 0 0;font-size:11px;line-height:1.6;color:var(--ui-text)}
#page-training .coaching-candidate-status{color:var(--ui-accent-text)}
#page-training .coaching-skill-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:23px;padding-top:17px;border-top:1px solid var(--ui-border)}
#page-training .coaching-info{position:relative;flex:none;margin:0;padding:0;border:0;background:transparent}
#page-training .coaching-info>summary{display:grid;place-items:center;width:32px;height:32px;border:1px solid var(--ui-border);border-radius:50%;font:600 14px Georgia,serif;color:var(--ui-accent-text);cursor:pointer;list-style:none}
#page-training .coaching-info>summary::-webkit-details-marker{display:none}
#page-training .coaching-info>div{position:absolute;right:0;top:39px;width:min(300px,74vw);z-index:3;padding:15px;border:1px solid var(--ui-border-strong);border-radius:11px;background:var(--ui-surface-soft);box-shadow:var(--ui-shadow)}
#page-training .coaching-info p{font-size:11px;line-height:1.75;color:var(--ui-muted)}
#page-training .coaching-info p+p{margin-top:9px}
#page-training .coaching-skills{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;margin-top:7px}
#page-training .coaching-skill{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;padding:13px 12px;min-width:0;border-bottom:1px solid var(--ui-border)}
#page-training .coaching-skill:nth-child(odd){padding-left:0;border-right:1px solid var(--ui-border)}
#page-training .coaching-skill:nth-child(even){padding-right:0}
#page-training .coaching-skill>span{font-size:11px;line-height:1.6;color:var(--ui-muted)}
#page-training .coaching-skill>strong{font-size:16px;line-height:1.2;color:var(--ui-text);font-variant-numeric:tabular-nums}
#page-training .coaching-skill>small{grid-column:1/-1;font-size:9px;color:var(--ui-muted);line-height:1.5}
#page-training .coaching-classic{margin:0 0 22px;border:1px solid var(--ui-border);border-radius:13px;background:var(--ui-surface);overflow:hidden}
#page-training .coaching-classic>summary{display:flex;justify-content:space-between;align-items:center;gap:15px;min-height:62px;padding:15px 19px;font-size:13px;line-height:1.5;font-weight:600;cursor:pointer;list-style:none}
#page-training .coaching-classic>summary::-webkit-details-marker{display:none}
#page-training .coaching-classic>summary:after{content:'⌄';font-size:21px;color:var(--ui-muted);line-height:1;transition:transform .2s}
#page-training .coaching-classic[open]>summary:after{transform:rotate(180deg)}
#page-training .coaching-classic>summary>small{margin-left:auto;font-size:10px;font-weight:400;line-height:1.5;color:var(--ui-muted)}
#page-training .coaching-classic-body{padding:18px;border-top:1px solid var(--ui-border)}
#page-training .coaching-classic-body>.training-grid{margin-top:15px}
#page-training .coaching-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:1050px){#page-training .coaching-layout{grid-template-columns:minmax(0,1fr)}#page-training .coaching-skills{grid-template-columns:repeat(4,minmax(0,1fr))}#page-training .coaching-skill:nth-child(n){padding:10px 12px;border-right:1px solid var(--ui-border);border-bottom:0}#page-training .coaching-skill:first-child{padding-left:0}#page-training .coaching-skill:last-child{padding-right:0;border-right:0}#page-training .coaching-skill{grid-template-columns:1fr}#page-training .coaching-skill>strong{grid-row:2}#page-training .coaching-session-heading{margin:15px 0 18px}}
@media(max-width:600px){#page-training .coaching-readiness{padding:17px 16px;grid-template-columns:minmax(0,1fr) minmax(110px,.7fr);gap:15px;border-radius:14px}#page-training .coaching-athlete>strong{font-size:19px}#page-training .coaching-eyebrow{font-size:9px}#page-training .coaching-athlete>span:last-child{font-size:10px}#page-training .coaching-energy-heading strong{font-size:21px}#page-training .coaching-energy-heading{font-size:10px}#page-training .coaching-composer,#page-training .coaching-session{padding:17px 15px;border-radius:14px}#page-training .coaching-layout{gap:13px}#page-training .coaching-section-heading h3,#page-training .coaching-session h3{font-size:16px}#page-training .coaching-choice{padding:12px 9px;gap:7px;border-radius:10px;min-height:99px}#page-training .coaching-choice-icon{width:24px;height:25px}#page-training .coaching-choice-copy strong{font-size:12px}#page-training .coaching-choice-copy small{font-size:10px}#page-training .coaching-plan-row{gap:7px;padding:10px 6px}#page-training .coaching-plan-label strong{font-size:11px}#page-training .coaching-plan-label small{font-size:9px}#page-training .coaching-plan-number{width:22px}#page-training .coaching-intensity{flex-basis:103px;min-width:85px}#page-training .coaching-remove{width:29px}#page-training .coaching-classic>summary{padding:15px;font-size:12px}#page-training .coaching-classic>summary>small{display:none}#page-training .coaching-classic-body{padding:12px}#page-training .coaching-plan-heading{align-items:flex-start;flex-direction:column;gap:3px}#page-training .coaching-plan-heading>span{text-align:left}}
@media(max-width:360px){#page-training .coaching-choice{min-height:109px;gap:5px;padding:11px 7px}#page-training .coaching-choice-icon{width:20px}#page-training .coaching-plan-row{flex-wrap:wrap}#page-training .coaching-plan-label{flex-basis:calc(100% - 35px)}#page-training .coaching-intensity{margin-left:29px;flex:1}#page-training .coaching-intensity select{max-width:none}#page-training .coaching-skills{grid-template-columns:repeat(2,minmax(0,1fr))}#page-training .coaching-skill:nth-child(n){padding:11px 9px;border-bottom:1px solid var(--ui-border)}#page-training .coaching-skill:nth-child(odd){padding-left:0}#page-training .coaching-skill:nth-child(even){border-right:0;padding-right:0}}
@media(prefers-reduced-motion:reduce){#page-training .coaching-dashboard *,#page-training .coaching-classic>summary:after{transition:none!important;animation:none!important}}

#page-training .coaching-plan-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:10px}#page-training .coaching-plan-note,#page-training .coaching-skill-caption{font-size:12px;line-height:1.5;color:var(--ui-muted);margin:12px 0}#page-training .coaching-plan-actions .text-button{font-size:12px;padding:8px 0;min-height:36px}

/* Rapid reference UI is deliberately scoped to the existing Tests page. */
#page-tests .rapid-rating-dashboard{padding:24px;margin:0 0 20px;overflow:hidden}
#page-tests .rapid-rating-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px}
#page-tests .rapid-rating-header h2{font-size:23px;line-height:1.3;margin:7px 0 0;letter-spacing:-.5px}
#page-tests .rapid-rating-phase{font-size:11px;padding:7px 10px;border:1px solid var(--ui-border);border-radius:20px;color:var(--ui-muted);white-space:nowrap}
#page-tests .rapid-rating-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(230px,.8fr);gap:30px;align-items:center}
#page-tests .rapid-rating-result{min-width:0}
#page-tests .rapid-rating-number{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
#page-tests .rapid-rating-number>strong{font-size:58px;line-height:1.05;letter-spacing:-2px;color:var(--ui-accent-text);font-variant-numeric:tabular-nums}
#page-tests .rapid-rating-number>span{font-size:11px;color:var(--ui-muted)}
#page-tests #rapid-rating-caption{font-size:13px;line-height:1.55;margin:13px 0 7px;color:var(--ui-text)}
#page-tests .rapid-rating-range{font-size:13px;line-height:1.5;color:var(--ui-muted);margin:0 0 9px}
#page-tests .rapid-rating-sample{font-size:11px;line-height:1.5;color:var(--ui-muted)}
#page-tests .rapid-rating-controls{display:grid;gap:10px;min-width:0;padding-left:24px;border-left:1px solid var(--ui-border)}
#page-tests .rapid-rating-controls .form-label{font-size:12px;margin:0}
#page-tests .rapid-rating-controls select{width:100%;min-height:48px;font-size:13px}
#page-tests .rapid-rating-action-slot{display:grid;grid-template-areas:'action';min-height:50px;margin-top:4px}
#page-tests .rapid-rating-action-slot>button{grid-area:action;width:100%;min-height:50px;margin:0;font-size:14px}
#page-tests .rapid-rating-action-slot>button[hidden]{display:none!important}
#page-tests .rapid-rating-message{font-size:12px;line-height:1.5;color:var(--ui-muted);margin:0}
#page-tests .rapid-rating-progress{margin-top:24px;padding-top:20px;border-top:1px solid var(--ui-border)}
#page-tests .rapid-rating-progress-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;font-size:12px;color:var(--ui-muted);font-variant-numeric:tabular-nums}
#page-tests .rapid-rating-progress-heading>strong{font-size:13px;color:var(--ui-text)}
#page-tests .rapid-rating-track{height:7px;overflow:hidden;border-radius:8px;background:var(--ui-track);margin:12px 0}
#page-tests .rapid-rating-track>span{display:block;width:0;height:100%;background:var(--ui-accent-text);transition:width .25s linear}
#page-tests .rapid-rating-progress-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:7px 14px;color:var(--ui-muted);font-size:11px;line-height:1.5}
#page-tests .rapid-rating-info{border:0;border-top:1px solid var(--ui-border);background:transparent;margin:23px 0 0;border-radius:0;padding:0}
#page-tests .rapid-rating-info>summary{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:42px;padding:14px 0 0;font-size:12px;color:var(--ui-muted);list-style:none;cursor:pointer}
#page-tests .rapid-rating-info>summary::-webkit-details-marker,#page-tests .internal-test-details>summary::-webkit-details-marker{display:none}
#page-tests .rapid-rating-info>summary>span:first-child{display:flex;align-items:center;gap:8px}
#page-tests .rapid-rating-info-body{padding-top:10px;font-size:12px;line-height:1.65;color:var(--ui-muted)}
#page-tests .rapid-rating-info-body>p{margin:9px 0}
#page-tests .rapid-rating-info-body h3{font-size:13px;color:var(--ui-text);margin:18px 0 6px}
#page-tests .rapid-rating-history{padding:0;margin:0;list-style:none}
#page-tests .rapid-rating-history>li{display:grid;grid-template-columns:1fr auto auto;gap:16px;align-items:center;padding:9px 0;border-bottom:1px solid var(--ui-border);font-size:12px}
#page-tests .rapid-rating-history strong{font-size:15px;color:var(--ui-text);font-variant-numeric:tabular-nums}
#page-tests .rapid-rating-history small{font-size:11px}
#page-tests .internal-test-details{margin:0 0 20px;padding:0;border:1px solid var(--ui-border);border-radius:14px;background:var(--ui-surface);overflow:hidden}
#page-tests .internal-test-details>summary{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:17px 20px;list-style:none;font-size:14px;font-weight:600;cursor:pointer}
#page-tests .internal-test-body{padding:18px;border-top:1px solid var(--ui-border)}
#page-tests .internal-test-body>.card{margin-bottom:18px}
#page-tests[data-rapid-active="true"]>.tests-heading #test-state{visibility:hidden}
@media(max-width:800px){#page-tests .rapid-rating-dashboard{padding:20px}#page-tests .rapid-rating-header{align-items:flex-start;gap:12px}#page-tests .rapid-rating-header h2{font-size:21px}#page-tests .rapid-rating-layout{grid-template-columns:minmax(0,1fr);gap:22px}#page-tests .rapid-rating-controls{border-left:0;border-top:1px solid var(--ui-border);padding:18px 0 0;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;column-gap:12px}#page-tests .rapid-rating-controls .form-label{grid-column:1}#page-tests .rapid-rating-controls select{grid-column:1}#page-tests .rapid-rating-action-slot{grid-column:2;grid-row:1/3;margin:0}#page-tests #rapid-rating-blocked{grid-column:1/-1}#page-tests .rapid-rating-number>strong{font-size:52px}#page-tests .internal-test-body{padding:12px}}
@media(max-width:430px){#page-tests .rapid-rating-dashboard{padding:18px 16px;border-radius:15px}#page-tests .rapid-rating-header{flex-wrap:wrap;margin-bottom:18px}#page-tests .rapid-rating-header h2{font-size:20px}#page-tests .rapid-rating-phase{font-size:10px;padding:5px 8px}#page-tests .rapid-rating-number>strong{font-size:48px}#page-tests .rapid-rating-controls{column-gap:9px}#page-tests .rapid-rating-controls select{font-size:12px;padding-left:10px;padding-right:22px}#page-tests .rapid-rating-action-slot>button{font-size:12px;padding:9px;min-height:48px}#page-tests .internal-test-details>summary{padding:16px;font-size:13px}}
@media(prefers-reduced-motion:reduce){#page-tests .rapid-rating-track>span{transition:none}}

#page-tests .rapid-rating-new{padding:7px 0;min-height:32px;font-size:12px;text-align:left;justify-self:start}#page-tests .rapid-rating-controls #rapid-rating-model-changed{grid-column:1/-1}#page-tests .rapid-rating-controls #rapid-rating-new{grid-column:1/-1}

/* One reading hierarchy for every application page and dialog. The important
 * font declarations only replace legacy, view-specific type sizes. Board
 * squares, coordinates, notation controls, diagrams and the wordmark keep
 * their own display metrics; no geometry or palette is changed here. */
:root {
  --type-body: 1rem;
  --type-label: .875rem;
  --type-secondary: .875rem;
  --type-overline: .75rem;
  --type-heading: 1.375rem;
  --type-subheading: 1.125rem;
  --type-page-title: 1.75rem;
  --type-stat: 2rem;
  --type-stat-compact: 1.5rem;
  --type-leading: 1.55;
}

body {
  font-family: var(--font);
  font-size: var(--type-body);
  line-height: var(--type-leading);
}

/* The same semantic heading has the same size in Training, Tests, Archive,
 * the guide and account/settings dialogs, including headings in disclosures. */
:is(.page, dialog) h1,
.page .page-heading h2 {
  font-family: var(--font) !important;
  font-size: var(--type-page-title) !important;
  font-weight: 700;
  line-height: 1.25 !important;
  letter-spacing: -.025em;
}
:is(.page, dialog) h2,
:is(.page, dialog) .guide-chapter-title,
.page .card-heading h3,
.page .coaching-section-heading h3,
.page .coaching-session h3,
dialog .dialog-title-r34 {
  font-family: var(--font) !important;
  font-size: var(--type-heading) !important;
  font-weight: 700;
  line-height: 1.3 !important;
  letter-spacing: -.015em;
}
:is(.page, dialog) h3 {
  font-family: var(--font) !important;
  font-size: var(--type-subheading) !important;
  font-weight: 600;
  line-height: 1.35 !important;
  letter-spacing: -.01em;
}
:is(.page, dialog) h4 {
  font-family: var(--font) !important;
  font-size: var(--type-body) !important;
  font-weight: 600;
  line-height: 1.4 !important;
}

/* Readable text, independent of the old font size attached to a given card. */
:is(.page, dialog) p,
:is(.page, dialog) .context-help-body,
:is(.page, dialog) .guide-content,
:is(.page, dialog) .guide-copy,
:is(.page, dialog) .opponent-description,
:is(.page, dialog) .review-explanation,
:is(.page, dialog) .settings-toggle > span {
  font-family: var(--font) !important;
  font-size: var(--type-body) !important;
  line-height: var(--type-leading) !important;
}
:is(.page, dialog) :is(ul, ol):not(.rapid-rating-history):not(.benchmark-history):not(.coaching-plan):not(.pumpkin-development-events) > li {
  font-size: var(--type-body) !important;
  line-height: var(--type-leading) !important;
}

/* Controls use one family and reading size. Icon-only and chess controls are
 * deliberately absent: changing their font box would move arrows or pieces. */
:is(.page, dialog) :is(.primary-button, .secondary-button, .text-button, .panel-link),
dialog :is(input, select, textarea),
.page :is(input, select, textarea) {
  font-family: var(--font) !important;
  font-size: var(--type-body) !important;
  line-height: 1.4 !important;
}
:is(.page, dialog) :is(.form-label, label:not(.eval-toggle):not(.toggle-label), legend),
:is(.page, dialog) :is(.page-tabs, .engine-hub-tabs) button,
.page .tests-mode-copy strong,
.sidebar .nav-item,
.mobile-menu-links :is(button, a) {
  font-family: var(--font) !important;
  font-size: var(--type-label) !important;
  line-height: 1.45 !important;
}
:is(.page, dialog) summary {
  font-family: var(--font) !important;
  font-size: var(--type-body) !important;
  line-height: 1.45 !important;
}
.page .coaching-info > summary {
  font-size: var(--type-secondary) !important;
  line-height: 1 !important;
}
.mobile-nav-item .nav-label,
.mobile-nav-item > span:last-child {
  font-family: var(--font) !important;
  font-size: var(--type-overline) !important;
  line-height: 1.3 !important;
}

/* Secondary information is consistent too; it does not shrink with the card.
 * These are text roles, not a wildcard over every span or numeric value. */
:is(.page, dialog) small,
:is(.page, dialog) :is(.muted, .form-help, .chart-caption, .chart-empty, .chart-empty p,
  .history-empty, .history-empty p, .history-row small, .tests-mode-copy small,
  .tests-reference, .tests-rating-meta, .tests-config-summary, .training-help,
  .training-intro, .training-phase-reason, .training-recent, .training-save,
  .coaching-plan-heading > span, .coaching-plan-label small, .coaching-plan-empty,
  .coaching-readiness, .coaching-session-message, .coaching-last-result,
  .coaching-candidate-status, .coaching-energy-heading, .coaching-plan-note,
  .coaching-skill-caption, .coaching-blocked, .coaching-athlete > span:last-child,
  .rapid-rating-range, .rapid-rating-sample, .rapid-rating-message,
  .player-detail, .game-mode, .diagnostics-note, .diagnostics-empty,
  .diagnostics-metric > span, .diagnostics-weight, .diagnostics-comparison,
  .style-learning-metrics, .style-learning-status, .league-preview-topics > span,
  .archive-storage-caption, .archive-capacity-warning, .archive-summary,
  .archive-pagination > span, .archive-usage-pool > span,
  .review-side, .review-accuracy-detail, .review-coverage, .review-field-label,
  .pumpkin-player-model, .pumpkin-player-trainer, .pumpkin-player-footer,
  .pumpkin-profile-caption, .pumpkin-profile-attention, .pumpkin-profile-placeholder,
  .archive-entry-metadata, .archive-role-summary, .archive-participant,
  .replay-participant, .participant-color, .archive-storage-description,
  .archive-filter-summary, .analysis-footer, .keyboard-note, .page-footer) {
  font-family: var(--font) !important;
  font-size: var(--type-secondary) !important;
  line-height: 1.5 !important;
}

/* Labels of cards, modes and statuses form a separate small-text role. */
:is(.page, dialog) :is(.section-label, .eyebrow, .tests-eyebrow, .coaching-eyebrow,
  .subtle-badge, .training-state-pill, .tests-state, .rapid-rating-phase,
  .pumpkin-storage-tag, .step-number, .version, .style-choice-kicker,
  .league-season-label, .league-coming-soon) {
  font-family: var(--font) !important;
  font-size: var(--type-overline) !important;
  line-height: 1.4 !important;
  letter-spacing: .045em;
}

/* Card names and metric labels have clear roles even when generated as spans
 * rather than headings. Big ranking figures retain their display type size. */
:is(.page, dialog) :is(.coaching-choice-copy strong, .coaching-plan-label strong,
  .archive-entry-kind, .benchmark-history strong, .history-row strong,
  .play-style-option strong) {
  font-family: var(--font) !important;
  font-size: var(--type-body) !important;
  line-height: 1.4 !important;
}
.page :is(.stat-card > span, .stat-card > small, .pumpkin-player-measurements span,
  .engine-stats span, .coaching-skill > span) {
  font-family: var(--font) !important;
  font-size: var(--type-label) !important;
  line-height: 1.45 !important;
}
.page .stat-card > strong {
  font-family: var(--font) !important;
  font-size: var(--type-stat) !important;
  line-height: 1.2 !important;
  font-variant-numeric: tabular-nums;
}
.page :is(.pumpkin-player-measurements strong, .coaching-energy-heading strong,
  .diagnostics-metric > strong, .archive-usage-pool strong) {
  font-family: var(--font) !important;
  font-size: var(--type-stat-compact) !important;
  line-height: 1.25 !important;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  :root {
    --type-page-title: 1.5rem;
    --type-heading: 1.25rem;
  }
}
/* Fieldset legends are section names, rather than individual control labels. */
:is(.page, dialog) .settings-section > legend {
  font-family: var(--font) !important;
  font-size: var(--type-subheading) !important;
  font-weight: 600;
  line-height: 1.35 !important;
}

/* Tests only: shared typography is supplied by typography-r43.css. */
#page-tests{--tests-gap:18px}
#page-tests .tests-heading{margin-bottom:16px}
#page-tests .test-mode-tabs.tests-view-tabs{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:5px;margin:0 0 20px;border-radius:14px;background:var(--ui-surface);position:relative;z-index:1}
#page-tests .tests-view-tabs>button{position:relative;min-height:76px;padding:13px 15px;gap:11px;border-radius:10px;align-items:center;justify-content:flex-start;color:var(--ui-muted);transition:background .18s,border-color .18s,color .18s}
#page-tests .tests-view-tabs>button[aria-selected="true"]{color:var(--ui-text);background:var(--ui-accent-soft);border-color:var(--ui-accent-border)}
#page-tests .tests-view-tabs>button[aria-selected="true"]>svg{color:var(--ui-accent-text)}
#page-tests .tests-view-tabs>button:disabled{opacity:.45;cursor:default}
#page-tests .tests-view-tabs .tests-mode-copy{min-width:0;gap:4px}
#page-tests .tests-view-tabs .tests-mode-copy strong{font-size:var(--type-label,.875rem);line-height:1.35;overflow-wrap:normal;word-break:normal}
#page-tests .tests-view-tabs .tests-mode-copy small{font-size:var(--type-overline,.75rem);line-height:1.35}
#page-tests .rapid-rating-dashboard{padding:26px;margin:0 0 20px;position:relative;background:linear-gradient(125deg,var(--ui-hero),var(--ui-surface) 72%);border-color:var(--ui-border-strong);border-radius:18px}
#page-tests .rapid-rating-header{align-items:flex-start;gap:16px;margin-bottom:24px}
#page-tests .ranking-heading{display:flex;align-items:center;gap:13px;min-width:0}
#page-tests .ranking-mark{display:grid;place-items:center;width:48px;height:48px;flex:none;border:1px solid var(--ui-accent-border);border-radius:14px;background:var(--ui-accent-soft);color:var(--ui-accent-text)}
#page-tests .rapid-rating-header h2{margin:4px 0 0}
#page-tests .rapid-rating-phase{max-width:45%;white-space:normal;text-align:right;line-height:1.4;border-color:var(--ui-border);background:var(--ui-surface);font-size:var(--type-overline,.75rem);padding:7px 10px}
#page-tests .rapid-rating-layout{grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:30px;align-items:center}
#page-tests .rapid-rating-result{padding:5px 0 8px;min-width:0}
#page-tests .rapid-rating-number{gap:11px;align-items:baseline}
#page-tests .rapid-rating-number>strong{font-size:56px;line-height:1.05;font-weight:650;letter-spacing:-1.8px;color:var(--ui-text)}
#page-tests .rapid-rating-number>span{font-size:var(--type-label,.875rem);color:var(--ui-muted);font-weight:500;letter-spacing:0}
#page-tests #rapid-rating-caption{margin:16px 0 8px;color:var(--ui-text)}
#page-tests .rapid-rating-range{margin:0 0 10px;color:var(--ui-muted)}
#page-tests .rapid-rating-sample{display:inline-flex;align-items:center;line-height:1.5;font-size:var(--type-secondary,.875rem)}
#page-tests .rapid-rating-controls{grid-template-columns:minmax(0,1fr);gap:10px;padding-left:26px;border-left:1px solid var(--ui-border);border-top:0;align-items:stretch}
#page-tests .rapid-rating-controls .form-label,#page-tests .rapid-rating-controls select,#page-tests .rapid-rating-action-slot{grid-column:1;grid-row:auto}
#page-tests .rapid-rating-controls select{min-width:0;max-width:none;min-height:48px;height:auto;padding:12px 38px 12px 14px;text-overflow:clip;font-size:var(--type-label,.875rem);line-height:1.5}
#page-tests .rapid-rating-action-slot{margin-top:2px;min-height:50px}
#page-tests .rapid-rating-action-slot>button{font-size:var(--type-label,.875rem);min-height:50px;margin:0}
#page-tests .rapid-rating-new{margin:0;padding:7px 0;line-height:1.5;min-height:35px}
#page-tests .rapid-rating-progress{margin-top:23px;padding-top:20px}
#page-tests .rapid-rating-progress-heading{font-size:var(--type-label,.875rem)}
#page-tests .rapid-rating-progress-heading>strong{font-size:inherit}
#page-tests .rapid-rating-progress-meta{justify-content:flex-start;gap:8px 18px;line-height:1.5}
#page-tests .rapid-rating-info{margin-top:21px}
#page-tests .rapid-rating-info>summary{padding-top:13px;min-height:42px;font-size:var(--type-label,.875rem)}
#page-tests .rapid-rating-info-body{padding-top:7px}
#page-tests .ranking-history-panel{margin-top:20px;padding-top:19px;border-top:1px solid var(--ui-border)}
#page-tests .ranking-history-panel>h3{margin:0 0 10px}
#page-tests .rapid-rating-history{margin:0;padding:0;list-style:none}
#page-tests .rapid-rating-history>li{min-height:58px;padding:12px 0;gap:12px;grid-template-columns:minmax(0,1fr) auto auto;line-height:1.5}
#page-tests .rapid-rating-history>li>span{min-width:0;overflow-wrap:anywhere}
#page-tests .rapid-rating-history strong{font-size:var(--type-subheading,1.125rem)}
#page-tests .rapid-rating-history small{font-size:var(--type-overline,.75rem)}
#page-tests section.internal-test-details{margin:0;border:0;border-radius:0;background:transparent;overflow:visible}
#page-tests .tests-panel-heading{margin:4px 0 17px}
#page-tests .tests-panel-heading h2{margin:5px 0 0}
#page-tests .internal-test-body{padding:0;border:0}
#page-tests .internal-test-body>.rating-hero{margin:0 0 var(--tests-gap)}
#page-tests .history-page-items{display:grid;gap:0;min-width:0}
#page-tests .history-pagination{display:flex;align-items:center;gap:10px;margin-top:14px;padding-top:12px;border-top:1px solid var(--ui-border);min-height:54px;flex-wrap:wrap}
#page-tests .history-page-button{min-height:38px;padding:8px 12px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-surface);color:var(--ui-text);font-size:var(--type-label,.875rem);line-height:1.4}
#page-tests .history-page-button:disabled{opacity:.4;cursor:default}
#page-tests .history-page-label{font-size:var(--type-label,.875rem);line-height:1.4;color:var(--ui-text);font-variant-numeric:tabular-nums;text-align:center;white-space:nowrap}
#page-tests .history-range-label{margin-left:auto;color:var(--ui-muted);font-size:var(--type-overline,.75rem);line-height:1.4;white-space:nowrap}
#page-tests[data-tests-view="ranking"] #internal-test-details,#page-tests[data-tests-view="internal"] #rapid-rating-dashboard,#page-tests[data-tests-view="duel"] #rapid-rating-dashboard{display:none!important}
#page-tests[data-tests-view="duel"] .tests-panel-heading>.tests-eyebrow{display:none}
@media(max-width:900px){#page-tests .rapid-rating-layout{grid-template-columns:minmax(0,1fr);gap:22px}#page-tests .rapid-rating-controls{padding:20px 0 0;border-left:0;border-top:1px solid var(--ui-border);grid-template-columns:minmax(0,1fr)}#page-tests .rapid-rating-controls .form-label,#page-tests .rapid-rating-controls select,#page-tests .rapid-rating-action-slot{grid-column:1;grid-row:auto}#page-tests .rapid-rating-controls .rapid-rating-action-slot{margin-top:2px}#page-tests .rapid-rating-dashboard{padding:23px}}
@media(max-width:600px){#page-tests{--tests-gap:15px}#page-tests .test-mode-tabs.tests-view-tabs{gap:3px;padding:4px;border-radius:13px;margin-bottom:16px}#page-tests .tests-view-tabs>button{min-height:77px;padding:10px 5px;gap:6px;flex-direction:column;justify-content:center;text-align:center}#page-tests .tests-view-tabs>button>svg{width:19px;height:19px;flex:0 0 19px}#page-tests .tests-view-tabs .tests-mode-copy strong{font-size:var(--type-label,.875rem);line-height:1.2;min-height:2.4em;display:grid;align-items:center}#page-tests .tests-view-tabs .tests-mode-copy small{display:none}#page-tests .rapid-rating-dashboard{padding:20px 17px;border-radius:16px}#page-tests .rapid-rating-header{gap:10px;margin-bottom:21px;flex-wrap:nowrap}#page-tests .ranking-heading{gap:10px}#page-tests .ranking-mark{width:40px;height:40px;border-radius:11px}#page-tests .ranking-mark svg{width:23px;height:23px}#page-tests .rapid-rating-phase{padding:6px 8px;max-width:42%}#page-tests .rapid-rating-number>strong{font-size:48px;letter-spacing:-1.4px}#page-tests .rapid-rating-controls select{font-size:var(--type-label,.875rem);padding-right:36px}#page-tests .rapid-rating-controls{gap:10px;padding-top:18px}#page-tests .rapid-rating-controls .rapid-rating-action-slot>button{font-size:var(--type-label,.875rem);padding:12px 14px;min-height:49px}#page-tests .rapid-rating-progress-meta{flex-direction:column;gap:6px}#page-tests .rapid-rating-info{margin-top:19px}#page-tests .history-pagination{gap:8px}#page-tests .history-page-button{padding:8px 10px}#page-tests .history-range-label{width:100%;margin-left:0;text-align:center}#page-tests .rapid-rating-history>li{grid-template-columns:minmax(0,1fr) auto;gap:4px 12px}#page-tests .rapid-rating-history small{grid-column:1/-1}}
@media(prefers-reduced-motion:reduce){#page-tests .tests-view-tabs>button{transition:none}}

#page-tests .history-page-items,#page-tests .rapid-rating-history{max-block-size:30rem;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
@media(max-width:600px){#page-tests .history-page-items,#page-tests .rapid-rating-history{max-block-size:26rem}}

/* Shared surfaces and controls use the Pumpkin application palette. */
.page .card:not(#pumpkin-profile-card):not(.board-surface):not(.moves-card):not(.stat-card):not(.replay-card),
#page-play .engine-card,
#page-tests .rapid-rating-dashboard,
#page-training :is(.coaching-readiness, .coaching-composer, .coaching-session, .coaching-classic),
#page-league .league-preview {
  background: var(--ui-surface);
  border-color: var(--ui-border);
  border-radius: 18px;
  box-shadow: none;
}

.page .stat-card {
  background: var(--ui-surface-soft);
  border-color: transparent;
  box-shadow: none;
}

.page .context-help:not(.tests-info):not(.coaching-info),
#page-engine .progress-stats,
#page-training .coaching-choice:not(.is-selected),
#page-tests .tests-reference,
#page-league .league-preview-topics > span,
#account-dialog :is(.account-sync-summary, .account-existing-confirmation) {
  background: var(--ui-inset);
  border-color: transparent;
  box-shadow: none;
}

.page .advanced-settings,
#settings-dialog .settings-section {
  border-color: var(--ui-border);
}

:is(.page, dialog) .primary-button:not(.danger-button) {
  background: var(--ui-accent);
  border-color: var(--ui-accent-border);
  color: var(--ui-on-accent);
  box-shadow: none;
}
:is(.page, dialog) .secondary-button:not(.remove-opponent-button):not(.danger-button),
.page .page-tabs > :is(button, a):not(.active):not(.current),
.topbar .icon-button,
#page-tests .history-page-button {
  background: var(--ui-surface);
  border-color: var(--ui-border-strong);
  box-shadow: none;
}
:is(.page, dialog) :is(select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"])):not(:disabled) {
  background: var(--ui-inset);
  box-shadow: none;
}

.sidebar-note {
  background: var(--ui-sidebar-soft);
  border-color: transparent;
  box-shadow: none;
}
.topbar,
.mobile-nav {
  background: var(--ui-surface);
  border-color: var(--ui-border);
  box-shadow: none;
}
.sidebar .nav-item.active,
.mobile-nav-item.active,
.mobile-nav-item[aria-expanded="true"],
.mobile-menu-links button.active {
  background: var(--ui-accent-soft);
  box-shadow: inset 3px 0 var(--ui-accent);
}
.mobile-menu-panel,
dialog {
  background: var(--ui-surface);
  border-color: var(--ui-border);
  box-shadow: var(--ui-dialog-shadow);
}
.mobile-menu-links :is(button, a):not(.active) {
  background: var(--ui-inset);
  border-color: var(--ui-border);
  box-shadow: none;
}

#page-tests .test-mode-tabs.tests-view-tabs,
#page-engine .engine-hub-tabs {
  background: var(--ui-inset);
  border-color: transparent;
  box-shadow: none;
}
#page-tests .tests-view-tabs > button[aria-selected="true"],
#page-engine .engine-hub-tabs > button[aria-selected="true"],
#page-training .coaching-choice.is-selected,
#engine-style-card .play-style-option.is-selected {
  background: var(--ui-accent-soft);
  border-color: var(--ui-accent-border);
  box-shadow: none;
}
#page-tests .ranking-mark,
#page-league .league-emblem {
  background: var(--ui-surface-soft);
  border-color: transparent;
  box-shadow: none;
}

#page-tests :is(.rapid-rating-progress, .ranking-history-panel, .history-pagination, .rapid-rating-info),
#page-training .coaching-classic-body,
#page-archive :is(.archive-filter-panel, .archive-storage-details),
#page-league .league-preview-topics {
  border-color: var(--ui-border);
}

/* A single copper edge marks the athlete card. Inner groups use neutral surfaces. */
#pumpkin-profile-card.pumpkin-profile-card{
  position:relative;isolation:isolate;padding:24px;border-radius:23px;
  border-color:var(--ui-copper-detail);
  background:var(--ui-surface);
}
#pumpkin-profile-card .pumpkin-profile-heading{gap:16px;margin-bottom:24px;align-items:center}
#pumpkin-profile-card #pumpkin-edit{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;flex:none;max-width:58%;
  padding:10px 15px;border-radius:13px;
}
#pumpkin-profile-card #pumpkin-edit svg{width:20px;height:20px;flex:none;color:var(--ui-muted)}
#pumpkin-profile-card #pumpkin-profile-overview{display:flex;flex-direction:column;gap:0;min-width:0}
#pumpkin-profile-card .pumpkin-player-identity{gap:19px;padding:0 0 24px;align-items:center;min-width:0}
#pumpkin-profile-card .pumpkin-player-identity>.pumpkin-avatar{
  width:88px;height:88px;border-radius:23px;
}
#pumpkin-profile-card .pumpkin-player-name{flex:1;min-width:0}
#pumpkin-profile-card .pumpkin-player-name .pumpkin-player-model{margin:5px 0 9px}
#pumpkin-profile-card .pumpkin-player-style{
  border:1px solid transparent;border-radius:10px;padding:5px 12px;
  background:var(--ui-surface-soft);color:var(--ui-muted);
}
#pumpkin-profile-card .pumpkin-player-rankings{
  align-self:stretch;margin:0;padding:15px 0;border:1px solid transparent;border-radius:17px;
  background:var(--ui-inset);
}
#pumpkin-profile-card .pumpkin-player-rankings>.pumpkin-player-ranking{
  position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
  min-width:0;padding:0 14px;border-left-color:var(--ui-border);text-align:center;
}
#pumpkin-profile-card .pumpkin-player-rankings>.pumpkin-player-ranking:first-child{padding-left:14px}
#pumpkin-profile-card .pumpkin-player-rankings>.pumpkin-player-ranking:last-child{padding-right:14px}
#pumpkin-profile-card .pumpkin-player-rankings span{min-height:0}
#pumpkin-profile-card .pumpkin-player-rankings .pumpkin-ranking-icon{display:flex;align-items:center;justify-content:center;margin:0 0 8px;color:var(--ui-muted)}
#pumpkin-profile-card .pumpkin-ranking-icon svg{display:block;width:24px;height:24px;flex:none}
#pumpkin-profile-card .pumpkin-player-rankings .pumpkin-ranking-label{display:flex;flex-direction:column;justify-content:flex-start;gap:2px;min-height:calc(3em + 2px);max-width:100%;color:var(--ui-text);overflow-wrap:normal;word-break:normal}
#pumpkin-profile-card .pumpkin-ranking-label small{display:block;color:var(--ui-muted)}
#pumpkin-profile-card .pumpkin-player-rankings strong{margin:7px 0 0;max-width:100%;color:var(--ui-text);overflow-wrap:anywhere}
#pumpkin-profile-card .pumpkin-ranking-stale{display:block;margin-top:5px;color:var(--ui-muted)}
#pumpkin-profile-card .pumpkin-player-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 0;padding:0 0 20px;min-width:0}
#pumpkin-profile-card .pumpkin-player-activity{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
#pumpkin-profile-card .pumpkin-player-activity>.pumpkin-activity-icon{display:flex;align-items:center;justify-content:center;flex:none;color:var(--ui-muted)}
#pumpkin-profile-card .pumpkin-activity-icon svg{width:22px;height:22px;display:block}
#pumpkin-profile-card .pumpkin-player-activity .engine-hub-status{min-width:0;overflow-wrap:anywhere}
#pumpkin-profile-card .engine-hub-status:is([data-state=training],[data-state=testing],[data-state=thinking]){color:var(--ui-accent-text)}
#pumpkin-profile-card .pumpkin-storage-tag{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:none;max-width:50%;
  padding:8px 12px;border-color:transparent;border-radius:12px;
  background:var(--ui-surface-soft);
}
#pumpkin-profile-card .pumpkin-storage-tag>svg{width:19px;height:19px;flex:none}
#pumpkin-profile-card .pumpkin-storage-tag>span{min-width:0}
#pumpkin-profile-card .pumpkin-development-details{margin-top:0}
#pumpkin-profile-card .pumpkin-development-details>summary{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:18px 0 0;list-style:none}
#pumpkin-profile-card .pumpkin-development-details>summary::-webkit-details-marker{display:none}
#pumpkin-profile-card .pumpkin-development-details>summary::after{display:none}
#pumpkin-profile-card .pumpkin-development-details>summary>svg{display:block;width:22px;height:22px;flex:none;color:var(--ui-text)}
#pumpkin-profile-card .pumpkin-development-details[open]>summary>svg{rotate:90deg}
#pumpkin-profile-card .pumpkin-development-metrics{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:18px 0 12px;padding:14px 0;
  border-top:0;border-left:0;border-bottom:1px solid var(--ui-border);gap:0;
}
#pumpkin-profile-card .pumpkin-development-metrics>div{min-width:0;padding:0 14px;border-left:1px solid var(--ui-border)}
#pumpkin-profile-card .pumpkin-development-metrics>div:first-child{padding-left:0;border-left:0}
#pumpkin-profile-card .pumpkin-development-metrics>div:last-child{padding-right:0}
#pumpkin-profile-card .pumpkin-development-metrics span{min-height:0}
#pumpkin-profile-card .pumpkin-profile-attention{margin:0 0 15px}
@media(max-width:600px){
  #pumpkin-profile-card.pumpkin-profile-card{padding:20px 18px;border-radius:21px}
  #pumpkin-profile-card .pumpkin-profile-heading{gap:10px;margin-bottom:21px}
  #pumpkin-profile-card #pumpkin-edit{padding:9px 11px;gap:7px;border-radius:12px}
  #pumpkin-profile-card .pumpkin-player-identity{gap:15px;padding-bottom:22px}
  #pumpkin-profile-card .pumpkin-player-identity>.pumpkin-avatar{width:78px;height:78px;border-radius:21px}
  #pumpkin-profile-card .pumpkin-player-rankings{padding:14px 0;border-radius:15px}
  #pumpkin-profile-card .pumpkin-player-rankings>.pumpkin-player-ranking{padding:0 8px}
  #pumpkin-profile-card .pumpkin-player-rankings>.pumpkin-player-ranking:first-child{padding-left:8px}
  #pumpkin-profile-card .pumpkin-player-rankings>.pumpkin-player-ranking:last-child{padding-right:8px}
  #pumpkin-profile-card .pumpkin-player-footer{gap:10px;margin-top:18px;padding-bottom:18px}
  #pumpkin-profile-card .pumpkin-storage-tag{padding:7px 9px;gap:5px}
}
@media(max-width:360px){
  #pumpkin-profile-card.pumpkin-profile-card{padding:18px 14px}
  #pumpkin-profile-card .pumpkin-profile-heading{align-items:flex-start}
  #pumpkin-profile-card #pumpkin-edit{max-width:57%;padding:8px 9px}
  #pumpkin-profile-card .pumpkin-player-identity{gap:12px}
  #pumpkin-profile-card .pumpkin-player-identity>.pumpkin-avatar{width:68px;height:68px;border-radius:18px}
  #pumpkin-profile-card .pumpkin-player-rankings>.pumpkin-player-ranking{padding:0 1px}
  #pumpkin-profile-card .pumpkin-player-rankings>.pumpkin-player-ranking:first-child{padding-left:1px}
  #pumpkin-profile-card .pumpkin-player-rankings>.pumpkin-player-ranking:last-child{padding-right:1px}
  #pumpkin-profile-card .pumpkin-player-footer{flex-wrap:wrap}
  #pumpkin-profile-card .pumpkin-player-footer .pumpkin-player-activity{flex-basis:100%}
  #pumpkin-profile-card .pumpkin-storage-tag{max-width:100%;margin-left:32px}
}

/* Training workbench uses restrained surfaces around the board and controls. */
#page-training .coaching-workbench{grid-template-columns:minmax(0,1fr);gap:14px}
#page-training .coaching-live-card{display:grid;gap:12px;padding:17px 15px}
#page-training .coaching-task-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:34px}
#page-training #coaching-current-title{scroll-margin-top:calc(var(--sticky-topbar-height,76px) + 12px)}
#page-training .coaching-task-number{color:var(--ui-muted);font-variant-numeric:tabular-nums}
#page-training .coaching-board-shell{width:100%;max-width:520px;margin-inline:auto;min-width:0}
#page-training .coaching-task-board{width:100%;aspect-ratio:1;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr))}
#page-training .coaching-task-board .square{min-width:0;min-height:0;cursor:default;touch-action:pan-y}
#page-training .coaching-task-board .piece{pointer-events:none}
#page-training .coaching-board-empty{display:grid;place-content:center;gap:12px;aspect-ratio:1;min-height:0;padding:22px;text-align:center;border:1px solid transparent;border-radius:10px;background:var(--ui-inset);color:var(--ui-muted)}
#page-training .coaching-board-empty>span{color:var(--ui-muted);font-size:2.5em;line-height:1}
#page-training .coaching-board-empty p{max-width:34ch;margin-inline:auto}
#page-training .coaching-board-tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#page-training .coaching-board-tools>button{min-height:44px;padding:8px 6px;border:1px solid var(--ui-border-strong);border-radius:8px;background:var(--ui-inset);color:var(--ui-muted);overflow-wrap:anywhere}
#page-training .coaching-board-tools>button[aria-pressed=true]{color:var(--ui-accent-text);border-color:var(--ui-accent-border);background:var(--ui-accent-soft)}
#page-training .coaching-task-feedback{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap;color:var(--ui-muted)}
#page-training .coaching-task-verdict{font-weight:600;color:var(--ui-muted)}
#page-training .coaching-task-verdict[data-verdict=correct]{color:var(--ui-success)}
#page-training .coaching-task-verdict[data-verdict=incorrect]{color:var(--ui-danger,var(--ui-text))}
#page-training .coaching-move-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#page-training .coaching-move-comparison>div{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;padding:11px;border:1px solid transparent;border-radius:9px;background:var(--ui-inset)}
#page-training .coaching-move-comparison span{color:var(--ui-muted)}
#page-training .coaching-move-comparison strong{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#page-training .coaching-live-card .coaching-progress-heading{margin:3px 0 -5px}
#page-training .coaching-live-counts{display:flex;align-items:baseline;gap:8px 16px;flex-wrap:wrap;color:var(--ui-muted);font-variant-numeric:tabular-nums}
#page-training .coaching-live-counts strong{color:var(--ui-text)}
#page-training .coaching-live-counts>span:last-child{margin-left:auto}
#page-training .coaching-action-slot{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.8fr);grid-auto-rows:minmax(66px,auto);gap:8px;margin-top:2px;min-height:48px}
#page-training .coaching-primary-action{display:grid;min-width:0}
#page-training .coaching-primary-action>button{grid-area:1/1;width:100%;min-height:48px;justify-content:center;white-space:normal;padding:10px}
#page-training .coaching-action-slot>button{grid-area:auto;width:100%;padding:10px;justify-content:center;white-space:normal}
#page-training .coaching-live-card .coaching-session-message{min-height:0;margin:0}
#page-training .coaching-live-card :is(.coaching-last-result,.coaching-candidate-status){margin:0}
#page-training :is(.coaching-position-details,.coaching-validation-details){min-width:0;padding-top:11px;border-top:1px solid var(--ui-border)}
#page-training :is(.coaching-position-details,.coaching-validation-details)>summary{min-height:36px;display:list-item;cursor:pointer;color:var(--ui-muted)}
#page-training .coaching-position-details code{display:block;padding:8px 0;overflow-wrap:anywhere;color:var(--ui-muted)}
#page-training .coaching-validation-details p{color:var(--ui-muted)}
#page-training .coaching-review-context{padding:9px 12px;border-left:3px solid var(--ui-border-strong);background:var(--ui-inset);color:var(--ui-muted)}
#page-training .coaching-review-navigation{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px;font-variant-numeric:tabular-nums}
#page-training .coaching-review-navigation>button{min-width:0;min-height:48px;padding:9px 7px;justify-content:center;white-space:normal}
#page-training #coaching-return-live{justify-self:start;padding-inline:0}
#page-training .coaching-sparring-note{color:var(--ui-muted)}
#page-training .is-sparring-task .coaching-live-counts{display:none}
#page-training .is-complete-empty:not(.is-reviewing-task) .coaching-live-card :is(.coaching-board-shell,.coaching-board-tools,.coaching-task-feedback,.coaching-move-comparison,.coaching-progress-heading,.coaching-progress-track,.coaching-live-counts,.coaching-position-details,.coaching-validation-details){display:none}
#page-training .coaching-composer{padding:0 15px}
#page-training .coaching-plan-panel>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px;cursor:pointer;list-style:none}
#page-training .coaching-plan-panel>summary::-webkit-details-marker{display:none}
#page-training .coaching-plan-panel>summary:after{content:'⌄';color:var(--ui-muted)}
#page-training .coaching-plan-panel[open]>summary:after{transform:rotate(180deg)}
#page-training .coaching-plan-panel>summary h3{margin:0}
#page-training #coaching-plan-count{margin-left:auto;color:var(--ui-muted)}
#page-training .coaching-plan-panel-body{padding:4px 0 17px}
#page-training .coaching-readiness{padding:14px 15px;gap:16px}
#page-training :is(.coaching-session-report,.coaching-history){margin-top:16px;min-width:0}
#page-training .coaching-session-report:empty,#page-training .coaching-history:empty{display:none}
@media(min-width:1051px){
  #page-training .coaching-workbench{grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr)}
  #page-training .coaching-live-card{padding:20px}
  #page-training .coaching-composer{padding-inline:20px}
}
@media(max-width:600px){
  #page-training .coaching-skills{grid-template-columns:repeat(2,minmax(0,1fr))}
  #page-training .coaching-skill:nth-child(n){padding:11px 9px;border-bottom:1px solid var(--ui-border)}
  #page-training .coaching-skill:nth-child(odd){padding-left:0}
  #page-training .coaching-skill:nth-child(even){border-right:0;padding-right:0}
  #page-training .coaching-plan-row{flex-wrap:wrap}
  #page-training .coaching-plan-label{flex-basis:calc(100% - 35px)}
  #page-training .coaching-intensity{margin-left:29px;flex:1}
  #page-training .coaching-intensity select{max-width:none}
}
@media(max-width:360px){
  #page-training .coaching-action-slot{grid-template-columns:minmax(0,1fr);grid-auto-rows:minmax(48px,auto)}
  #page-training .coaching-move-comparison>div{padding:9px;gap:5px}
  #page-training .coaching-live-counts>span:last-child{margin-left:0}
}

/* Soft wells distinguish the report values and history rows. */
#page-training .coaching-report-card{margin:0;padding:20px}
#page-training .coaching-report-heading,#page-training .coaching-report-subheading{display:flex;align-items:center;justify-content:space-between;gap:14px}
#page-training .coaching-report-heading h3{margin:5px 0 0}
#page-training .coaching-report-heading time{color:var(--ui-muted);overflow-wrap:anywhere}
#page-training .coaching-report-outcome{margin:16px 0;color:var(--ui-muted)}
#page-training [data-model-outcome=accepted] .coaching-report-outcome{color:var(--ui-success)}
#page-training .coaching-report-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px 0}
#page-training .coaching-report-stats>.stat-card{min-width:0;margin:0;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ui-inset)}
#page-training .coaching-report-stats>.stat-card strong{display:block;margin-top:8px;overflow-wrap:anywhere}
#page-training .coaching-report-stats>.stat-card>span{overflow-wrap:anywhere}
#page-training .coaching-report-extra,#page-training .coaching-report-unmeasured{margin:12px 0}
#page-training .coaching-report-validation{margin-top:20px;border-top:1px solid var(--ui-border);padding-top:18px}
#page-training .coaching-report-subheading h4{margin:0}
#page-training .coaching-report-subheading{flex-wrap:wrap}
#page-training .coaching-report-overall{margin:13px 0}
#page-training .coaching-report-domain-results{list-style:none;margin:0;padding:0}
#page-training .coaching-report-domain-results>li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--ui-border)}
#page-training .coaching-report-domain-results>li>div{display:grid;gap:4px;min-width:0}
#page-training .coaching-report-domain-results small{color:var(--ui-muted)}
#page-training .coaching-report-comparison{text-align:right;flex:none}
#page-training .coaching-report-method{margin:12px 0 0}
#page-training .coaching-report-inspect{margin-top:16px;width:100%}
#page-training .coaching-report-tasks{margin-top:18px;padding-top:16px;border-top:1px solid var(--ui-border)}
#page-training .coaching-report-task-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#page-training .coaching-report-task-heading h4{margin:0}
#page-training .coaching-report-task-filters{display:flex;gap:8px}
#page-training .coaching-report-task-filters>button{padding:8px 10px;min-height:40px}
#page-training .coaching-report-task-filters>button[aria-pressed=true]{border-color:var(--ui-accent-border);color:var(--ui-accent-text)}
#page-training .coaching-report-task-nav{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;margin:16px 0}
#page-training .coaching-report-task-nav>button{min-width:0;padding:10px}
#page-training .coaching-report-task-nav>button,#page-training .coaching-report-inspect,#page-training .coaching-report-tasks>.text-button{min-height:44px}
#page-training .coaching-report-selected-task{margin:12px 0}
#page-training .coaching-session-history{list-style:none;padding:0;margin:0;display:grid;gap:10px}
#page-training .coaching-session-history>li{margin:0;padding:0}
#page-training .coaching-session-history>li>button{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;min-height:44px;padding:14px;text-align:left;overflow-wrap:anywhere;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-inset);color:var(--ui-text)}
#page-training .coaching-session-history>li>button[aria-expanded=true]{border-color:var(--ui-accent-border);background:var(--ui-accent-soft)}
#page-training .coaching-session-history>li>button>span:first-child{display:grid;gap:6px;min-width:0}
#page-training .coaching-session-history small,#page-training .coaching-session-outcome{color:var(--ui-muted)}
#page-training .coaching-session-outcome[data-outcome=accepted]{color:var(--ui-success)}
#page-training .coaching-session-outcome{text-align:right;max-width:42%}
#page-training #coaching-session-report[hidden]{display:none!important}
#page-training .coaching-report-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:600px){
  #page-training .coaching-report-card{padding:17px 15px}
  #page-training .coaching-report-heading{align-items:flex-start;flex-wrap:wrap;gap:8px}
  #page-training .coaching-report-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #page-training .coaching-report-stats>.stat-card{padding:11px}
  #page-training .coaching-report-domain-results>li{gap:8px}
  #page-training .coaching-report-domain-results>li{align-items:flex-start;flex-wrap:wrap}
  #page-training .coaching-report-domain-results>li>div{flex:1 1 160px}
  #page-training .coaching-report-domain-results .coaching-report-comparison{text-align:left;flex:1 1 130px;overflow-wrap:anywhere}
  #page-training .coaching-report-task-nav>button{min-height:66px;justify-content:center;white-space:normal;overflow-wrap:anywhere}
  #page-training .coaching-session-history>li>button{padding:12px;gap:9px;align-items:flex-start}
  #page-training .coaching-report-task-filters{width:100%}
  #page-training .coaching-report-task-filters>button{flex:1;min-height:44px}
}

/* Athlete layout only. The established r43 type scale and r44 button sizes stay. */
#pumpkin-profile-card.pumpkin-profile-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(180px,.72fr);
  grid-template-areas:"identity edit" "identity status" "rankings rankings" "attention attention" "message message" "development development";
  column-gap:22px;
  row-gap:0;
  align-items:start;
}
#pumpkin-profile-card #pumpkin-profile-overview{display:contents}
#pumpkin-profile-card .pumpkin-profile-heading{
  grid-area:edit;justify-content:flex-start;align-items:flex-start;align-self:stretch;
  margin:0;padding:0 0 0 22px;border-left:1px solid var(--ui-border);
}
/* Keep the original intrinsic button size when its parent becomes a column. */
#pumpkin-profile-card #pumpkin-edit{max-width:none}
#pumpkin-profile-card .pumpkin-player-identity{grid-area:identity;align-self:center;padding:0;gap:19px}
#pumpkin-profile-card .pumpkin-player-name{min-width:0}
#pumpkin-profile-card .pumpkin-player-footer{
  grid-area:status;align-self:stretch;display:grid;justify-content:start;justify-items:start;align-content:start;
  gap:12px;margin:0;padding:14px 0 0 22px;border-left:1px solid var(--ui-border);
}
#pumpkin-profile-card .pumpkin-player-footer .pumpkin-player-activity{flex:none;gap:9px;max-width:100%}
#pumpkin-profile-card .pumpkin-player-footer .pumpkin-storage-tag{max-width:100%;margin:0;justify-self:start}
#pumpkin-profile-card .pumpkin-player-rankings{grid-area:rankings;margin:25px 0 0;width:100%;box-sizing:border-box}
#pumpkin-profile-card .pumpkin-profile-attention{grid-area:attention;margin:12px 0 0}
#pumpkin-profile-card #pumpkin-profile-message{grid-area:message}
#pumpkin-profile-card .pumpkin-development-details{grid-area:development;margin-top:20px;min-width:0}
@media(max-width:600px){
  #pumpkin-profile-card.pumpkin-profile-card{grid-template-columns:minmax(0,1fr) 156px;column-gap:10px}
  #pumpkin-profile-card .pumpkin-player-identity{gap:8px;padding:0}
  #pumpkin-profile-card .pumpkin-player-identity>.pumpkin-avatar{width:64px;height:64px;border-radius:18px}
  #pumpkin-profile-card .pumpkin-profile-heading{padding-left:10px}
  #pumpkin-profile-card .pumpkin-player-footer{padding:12px 0 0 10px;gap:10px}
  #pumpkin-profile-card .pumpkin-player-footer .pumpkin-player-activity{flex-basis:auto}
  #pumpkin-profile-card .pumpkin-player-rankings{margin-top:20px}
  #pumpkin-profile-card .pumpkin-development-details{margin-top:18px}
}
@media(max-width:380px){
  #pumpkin-profile-card .pumpkin-player-identity{flex-direction:column;align-items:flex-start;gap:10px}
  #pumpkin-profile-card .pumpkin-player-identity>.pumpkin-avatar{width:60px;height:60px;border-radius:17px}
  #pumpkin-profile-card .pumpkin-player-name{width:100%}
}
@media(max-width:360px){
  #pumpkin-profile-card.pumpkin-profile-card{grid-template-columns:minmax(0,1fr) 150px;column-gap:8px}
  #pumpkin-profile-card .pumpkin-profile-heading{padding-left:8px}
  #pumpkin-profile-card .pumpkin-player-footer{padding-left:8px}
}

/* One viewport anchor and one row size across all mobile tabs. Keep the shared
   copper materials and typography; focus mode still hides the app navigation. */
@media (max-width:850px) {
  .mobile-nav {
    --mobile-nav-row-height:max(59px,calc(43px + var(--type-overline,.75rem) * 1.3));
    position:fixed;
    inset:auto 0 0;
    margin:0;
    width:auto;
    height:calc(var(--mobile-nav-row-height) + 15px + env(safe-area-inset-bottom,0px));
    min-height:calc(var(--mobile-nav-row-height) + 15px + env(safe-area-inset-bottom,0px));
    box-sizing:border-box;
    grid-template-columns:repeat(5,minmax(0,1fr));
    grid-template-rows:var(--mobile-nav-row-height);
    align-items:stretch;
    padding:7px 8px calc(7px + env(safe-area-inset-bottom,0px));
  }
  .mobile-nav>.mobile-nav-item {
    width:100%;
    height:100%;
    min-height:0;
    margin:0;
    align-self:stretch;
    box-sizing:border-box;
    transform:none;
    transition-property:background-color,border-color,color,box-shadow,filter;
  }
  .mobile-nav>.mobile-nav-item>span[data-icon] {
    flex:none;
    width:22px;
    height:22px;
  }
  .mobile-nav>.mobile-nav-item>span:last-child {
    display:block;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}

/* Keep the mobile document inside its viewport. Individual move lists, tables
   and replay strips retain their own scroll containers and touch gestures. */
@media(max-width:850px),(max-width:1100px) and (hover:none),(max-width:1100px) and (pointer:coarse){
  html{
    overflow-x:hidden;
    overscroll-behavior-x:none;
  }
  body,.app-shell,.main-shell,.main-shell>main{
    min-width:0;
    max-width:100%;
  }
  body,.app-shell,.main-shell,.main-shell>main{width:100%}
  .sidebar{display:none}
  .main-shell{margin-left:0}
  .main-shell>.topbar .topbar-mobile-brand{
    display:flex;
    align-items:center;
    color:var(--ui-text);
    font-weight:700;
    letter-spacing:-.8px;
    white-space:nowrap;
  }
  .main-shell>.topbar .topbar-mobile-brand img{object-fit:contain}
  .main-shell>.topbar .topbar-mobile-brand small{display:block}
  .main-shell>.topbar .breadcrumb,
  .main-shell>.topbar .topbar-right>.avatar{display:none}
  .main-shell>.topbar .topbar-right{margin-left:auto;gap:10px}
  .menu-toggle{display:flex}
  .main-shell>main>.page,
  #page-engine .engine-hub-sections,
  #page-engine .engine-pane,
  #page-tests .tests-layout,
  #page-tests .rapid-rating-layout,
  #page-archive .archive-layout{
    min-width:0;
    max-width:100%;
  }
  #page-tests .tests-layout,
  #page-archive .archive-layout{grid-template-columns:minmax(0,1fr)}
  .main-shell>main .page :is(.page-heading,.card-heading)>*,
  #page-tests .rapid-rating-header,
  #page-tests .ranking-heading,
  #page-tests .ranking-heading>div{
    min-width:0;
    max-width:100%;
  }
  #page-tests .ranking-heading{flex:1 1 auto}
  #page-tests .rapid-rating-header{flex-wrap:wrap}
  .main-shell>main .page :is(h1,h2,h3,p,summary),
  #pumpkin-profile-card .pumpkin-player-style,
  #pumpkin-profile-card .pumpkin-profile-attention{
    overflow-wrap:anywhere;
  }
}
@supports(overflow-x:clip){
  @media(max-width:850px),(max-width:1100px) and (hover:none),(max-width:1100px) and (pointer:coarse){
    /* Unlike hidden, clip does not create a second vertical scroll container. */
    html{overflow-x:clip}
  }
}

/* The application bar stays available in regular compact layouts and Menu.
   Focus deliberately hides app navigation; native dialogs own the top layer. */
@media(max-width:850px), (max-width:1100px) and (hover:none), (max-width:1100px) and (pointer:coarse){
  :root{--app-mobile-nav-height:calc(max(59px,calc(43px + var(--type-overline,.75rem) * 1.3)) + 15px + env(safe-area-inset-bottom,0px))}
  .main-shell>main{padding-bottom:calc(var(--app-mobile-nav-height) + 16px)}
  /* At the end of Archive, the replay surface meets the fixed bar. */
  .main-shell>main:has(>#page-archive.active-page){padding-bottom:var(--app-mobile-nav-height)}
  .toast{left:50%;bottom:calc(var(--app-mobile-nav-height) + 22px)}
  .mobile-nav{
    --mobile-nav-row-height:max(59px,calc(43px + var(--type-overline,.75rem) * 1.3));
    display:grid;position:fixed;inset:auto 0 0;z-index:70;margin:0;width:auto;
    height:var(--app-mobile-nav-height);min-height:var(--app-mobile-nav-height);
    box-sizing:border-box;grid-template-columns:repeat(5,minmax(0,1fr));
    grid-template-rows:var(--mobile-nav-row-height);gap:5px;align-items:stretch;
    padding:7px 8px calc(7px + env(safe-area-inset-bottom,0px));
  }
  .mobile-menu{padding-bottom:calc(var(--app-mobile-nav-height) + 24px)}
  .mobile-menu-panel{
    max-height:calc(100vh - var(--app-mobile-nav-height) - 42px);
    max-height:calc(100dvh - var(--app-mobile-nav-height) - 42px);
  }
  .mobile-nav-item{border-radius:11px;background:transparent;color:var(--ui-muted)}
  .mobile-nav>.mobile-nav-item{
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
    width:100%;height:100%;min-width:0;min-height:0;margin:0;padding:8px 3px;
    align-self:stretch;box-sizing:border-box;transform:none;
    transition-property:background-color,border-color,color,box-shadow,filter;
  }
  .mobile-nav>.mobile-nav-item>span[data-icon]{flex:none;width:22px;height:22px}
  .mobile-nav>.mobile-nav-item>span[data-icon]>svg{width:22px;height:22px}
  .mobile-nav>.mobile-nav-item>span:last-child{
    display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  body.focus-mode-active{--app-mobile-nav-height:0px}
  body.focus-mode-active .mobile-nav{display:none!important}
  /* A keyboard-constrained window may be shorter than the existing chrome and
     a readable board. Scroll only the play surface above the stationary bar. */
  body.mobile-focus-locked.mobile-focus-scroll #page-play .board-column{
    min-height:0;overflow-y:auto;overscroll-behavior-y:contain;
  }
  body.mobile-focus-locked.mobile-focus-scroll.mobile-focus-landscape #page-play .board-surface{
    min-height:0;max-height:100%;overflow-y:auto;overscroll-behavior-y:contain;
  }
}

/* Play athlete preview uses the shared surfaces and keeps a separate rating group. */
#page-play #play-player-card{
  position:relative;display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;
  gap:17px;padding:20px 18px 0;min-width:0;overflow:hidden;
  border-radius:21px;
}
#page-play .play-player-card>*{grid-column:1/-1;min-width:0;margin:0}
#page-play .play-player-card>.card-heading{align-items:center;gap:12px}
#page-play .play-player-identity{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:13px}
#page-play .play-player-avatar{
  display:grid;place-items:center;width:64px;height:64px;overflow:hidden;border:1px solid var(--ui-border);border-radius:18px;
  background:var(--ui-surface-soft);
}
#page-play .play-player-avatar>:is(img,svg){display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
#page-play .play-player-copy{min-width:0}
#page-play .play-player-copy h2{margin:0;overflow-wrap:anywhere}
#page-play .play-player-model{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:4px 0 8px;color:var(--ui-muted)}
#page-play .play-player-model .version{display:inline-flex;align-items:center;margin:0}
#page-play .play-player-meta{display:flex;flex-wrap:wrap;align-items:center;gap:7px 10px;min-width:0}
#page-play .play-player-style{
  padding:3px 8px;border:1px solid transparent;border-radius:8px;color:var(--ui-muted);
  background:var(--ui-surface-soft);
}
#page-play .play-player-meta .engine-state{display:flex;align-items:center;gap:6px;min-width:0;overflow-wrap:anywhere}
#page-play .play-player-rankings{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;padding:13px 0;
  border:1px solid transparent;border-radius:15px;background:var(--ui-inset);
}
#page-play .play-player-ranking{display:flex;flex-direction:column;align-items:center;min-width:0;padding:0 5px;text-align:center}
#page-play .play-player-ranking+.play-player-ranking{border-left:1px solid var(--ui-border)}
#page-play .play-ranking-icon{display:block;color:var(--ui-muted);margin-bottom:6px}
#page-play .play-ranking-icon svg{display:block;width:22px;height:22px}
#page-play .play-ranking-label{display:flex;flex-direction:column;color:var(--ui-text);font-size:var(--type-label);max-width:100%;overflow-wrap:anywhere}
#page-play .play-player-ranking strong{display:block;max-width:100%;margin-top:7px;font-size:var(--type-stat-compact);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#page-play .play-ranking-note{display:block;min-height:1.55em;margin-top:2px;color:var(--ui-muted);max-width:100%;overflow-wrap:anywhere}
#page-play .play-player-ranking.is-stale strong{color:var(--ui-muted)}
#page-play .play-player-chart-heading{display:flex;align-items:center;gap:8px;color:var(--ui-muted);font-size:var(--type-secondary)}
#page-play .play-player-chart-heading::before{content:'';width:6px;height:6px;border-radius:50%;background:var(--ui-accent-text);flex:none}
#page-play .play-player-card>.chart-container{grid-column:1/-1;height:92px;margin:-9px 0 0;min-width:0}
#page-play .play-player-card .chart-empty{display:flex;align-items:center;height:100%;padding:12px}
#page-play .play-player-card>.engine-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:15px 0 0;border-top:1px solid var(--ui-border)}
#page-play .play-player-card .engine-stats>div{display:flex;flex-direction:column;gap:4px;min-width:0}
#page-play .play-player-card .engine-stats>div:last-child{padding-left:12px;border-left:1px solid var(--ui-border)}
#page-play .play-player-card .engine-stats span{overflow-wrap:anywhere}
#page-play .play-player-card>.panel-link{width:100%;min-height:52px;gap:12px;padding:14px 0;border-top-color:var(--ui-border);text-align:left}
#page-play .play-player-card>.panel-link>span{flex:none}
@media(max-width:360px){
  #page-play #play-player-card{padding:18px 14px 0;gap:15px}
  #page-play .play-player-identity{grid-template-columns:58px minmax(0,1fr);gap:11px}
  #page-play .play-player-avatar{width:58px;height:58px;border-radius:16px}
  #page-play .play-player-ranking{padding:0 2px}
}

/* These two disclosures are separate cards, not rounded children inside a
   second card frame. Keep their native details and persisted open states. */
#page-engine #page-progress .progress-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:start;
  gap:16px;
  margin:0 0 22px;
  padding:0;
  min-width:0;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
}
#page-engine #page-progress .progress-grid>:is(.weights-card,.history-card){
  min-width:0;
  margin:0;
  padding:17px 20px;
  border:1px solid var(--ui-border);
  border-radius:18px;
  background:var(--ui-surface);
  box-shadow:none;
}
#page-engine #page-progress .progress-grid .compact-panel>.compact-panel-summary{
  align-items:center;
  gap:14px;
  min-width:0;
  min-height:56px;
  margin:0;
  padding:2px 0;
}
#page-engine #page-progress .progress-grid .compact-panel-summary>h2{
  flex:1 1 0;
  min-width:0;
  margin:0;
  white-space:normal;
  overflow-wrap:anywhere;
}
#page-engine #page-progress .progress-grid .compact-panel-summary::after{
  flex:none;
  align-self:center;
}
#page-engine #page-progress #history-total{
  display:block;
  margin-top:4px;
  max-width:100%;
  color:var(--ui-muted);
}
#page-engine #page-progress .progress-grid .compact-panel-body{
  min-width:0;
  padding-top:14px;
  border-top:1px solid var(--ui-border);
}
@media(min-width:700px) and (max-width:1100px){
  #page-engine #page-progress .progress-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  #page-engine #page-progress .progress-grid{gap:14px;margin-bottom:20px}
  #page-engine #page-progress .progress-grid>:is(.weights-card,.history-card){padding:15px 16px}
}

/* Mobile safe-area pixels can expose the document canvas. Match the navigation
   surface there while the page content keeps its own body background. */
@media(max-width:850px), (max-width:1100px) and (hover:none), (max-width:1100px) and (pointer:coarse){
  html{background-color:var(--ui-surface)}
  .mobile-nav{background:var(--ui-surface)}
}

/* The focus viewport and document edges share the browser theme color. */
html.mobile-focus-locked,
body.mobile-focus-locked,
body.mobile-focus-locked #page-play.active-page {
  background:var(--ui-surface);
}

/* The usage row owns its separator. The shared copper well's inset shadow
   must not draw a second line above the storage disclosure. */
#page-archive .archive-capacity>#archive-storage-details{
  box-shadow:none;
}

/* Keep browsing compact on the same touch layouts as the mobile archive.
   The existing list scroll and pagination retain every saved game. */
@media(max-width:850px), (max-width:1100px) and (hover:none), (max-width:1100px) and (pointer:coarse){
  #page-archive .archive-capacity>#archive-storage-details{
    margin-top:0;
    border-top:0;
  }
  #page-archive #archive-list{
    max-height:clamp(220px,42vh,340px);
    max-height:clamp(220px,42svh,340px);
  }
}

/* Keep recovery outside the locked model view and native modal top layer. */
#account-recovery[hidden]{display:none}
#account-recovery{
  position:fixed;inset:0;z-index:1200;display:grid;grid-template-columns:minmax(0,1fr);
  align-content:start;align-content:safe center;justify-items:center;box-sizing:border-box;
  gap:16px;max-height:100%;overflow-y:auto;overscroll-behavior:contain;
  padding:calc(24px + env(safe-area-inset-top,0px)) max(18px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(18px,env(safe-area-inset-left,0px));
  background:var(--ui-bg);color:var(--ui-text);outline:none;
}
#account-recovery>*{width:min(100%,560px);min-width:0;margin:0;justify-self:center}
#account-recovery .account-recovery-card{
  display:grid;grid-template-columns:minmax(0,1fr);gap:16px;
  padding:22px 20px;border:1px solid var(--ui-border);border-radius:20px;
  background:var(--ui-surface);box-shadow:none;
}
#account-recovery .account-recovery-card>*{min-width:0;margin:0}
#account-recovery :is(h1,h2){color:var(--ui-accent-text);font-size:var(--type-heading);font-weight:700;line-height:1.3;overflow-wrap:anywhere}
#account-recovery p{font-size:var(--type-body);line-height:var(--type-leading)}
#account-recovery-message{line-height:1.6;overflow-wrap:anywhere}
#account-recovery .account-recovery-actions{display:flex;flex-wrap:wrap;gap:10px}
#account-recovery .account-recovery-actions>button{flex:1 1 180px;min-width:0;min-height:48px;font-size:var(--type-body);white-space:normal;overflow-wrap:anywhere}
#account-recovery-export-status{color:var(--ui-muted);font-size:var(--type-secondary);line-height:1.5;overflow-wrap:anywhere}

/* R54: previews and game boards use the same .chessboard/.square paint.
 * Keep textures in the square background. ::before belongs to review's legal
 * targets; sharing it hid surfaces or changed the marker's size and position. */
/* These IDs match the existing boards. Their specificity also restores the
 * image when legacy !important highlight shorthands are disabled by settings. */
body .chessboard .square,
body :is(#board,#replay-board,#coaching-task-board) .square,
#settings-dialog .chessboard .square{
  background-image:var(--square-surface,var(--board-surface-texture,none))!important;
  background-size:var(--board-texture-size,200px 200px)!important;
  background-position:var(--square-surface-position,0 0)!important;
}
body .chessboard .square:nth-child(3n+1){--square-surface-position:47px 28px}
body .chessboard .square:nth-child(5n+2){--square-surface-position:110px 85px}
/* Enabled move/check/selection feedback gets its full, readable palette.
 * Disabled feedback leaves the original material visible. */
body:not([data-highlight-last-move=false]) .chessboard .square.last,
body:not([data-highlight-selection=false]) .chessboard .square.selected,
body:not([data-highlight-check=false]) .chessboard .square.check{--square-surface:none}
body .theme-board-thumbnail.chessboard,
body .appearance-preview-grid.chessboard{grid-template-columns:repeat(4,minmax(0,1fr));gap:0;pointer-events:none}
body .theme-board-thumbnail.chessboard{aspect-ratio:1.7;box-shadow:inset 0 0 0 1px #0002}
body .theme-board-thumbnail.chessboard>.square{aspect-ratio:auto;min-height:10px;padding:0}
body .appearance-preview-grid.chessboard{aspect-ratio:1}
body .appearance-preview-grid.chessboard>.square{aspect-ratio:1;padding:2px}

/* The combined selection stays visible even with both choice lists closed. */
#settings-dialog .settings-preview{
  display:grid;grid-template-columns:112px minmax(0,1fr);gap:16px;align-items:center;
}
#settings-dialog .settings-preview .appearance-previewboard{display:block;width:100%;margin:0}
#settings-dialog .appearance-preview-copy{min-width:0;overflow-wrap:anywhere}
#settings-dialog .appearance-preview-copy h3{font-size:var(--type-body);margin:0 0 8px;line-height:1.4}
#settings-dialog .appearance-preview-copy p{font-size:var(--type-secondary);margin:4px 0;color:var(--ui-muted);line-height:1.4}
@media(max-width:350px){#settings-dialog .settings-preview{grid-template-columns:96px minmax(0,1fr);gap:12px}}

/* Native disclosures preserve keyboard use and their state across selection. */
#settings-dialog .theme-picker-section{padding-block:16px}
#settings-dialog .theme-picker-section>legend{margin-bottom:10px}
#settings-dialog .theme-picker{clear:both;min-width:0}
#settings-dialog .theme-picker>summary{
  display:flex;align-items:center;gap:12px;min-height:68px;padding:10px 12px;
  list-style:none;cursor:pointer;border:1px solid var(--ui-border-strong);
  border-radius:12px;background:var(--ui-inset);
}
#settings-dialog .theme-picker>summary::-webkit-details-marker{display:none}
#settings-dialog .theme-picker>summary:focus-visible{outline:3px solid var(--ui-focus);outline-offset:3px}
#settings-dialog .theme-picker>summary>svg{width:20px;height:20px;flex:none;fill:none;stroke:var(--ui-muted);stroke-width:1.7;transition:transform .15s ease}
#settings-dialog .theme-picker[open]>summary>svg{transform:rotate(180deg)}
#settings-dialog .theme-picker-mini{display:block;width:58px;flex:none;overflow:hidden;border-radius:6px}
#settings-dialog .theme-picker-mini .theme-board-thumbnail{width:100%;aspect-ratio:1.4}
#settings-dialog .theme-picker-pieces{display:flex;align-items:center;background:var(--ui-neutral);padding:2px}
#settings-dialog .theme-picker-pieces .piece{width:50%;height:auto;filter:none}
#settings-dialog .theme-picker-copy{display:flex;flex:1;flex-direction:column;gap:3px;min-width:0;overflow-wrap:anywhere}
#settings-dialog .theme-picker-copy strong{font-size:var(--type-body);font-weight:600}
#settings-dialog .theme-picker-copy small{font-size:var(--type-secondary);color:var(--ui-muted)}
#settings-dialog .theme-picker-body{padding-top:12px;min-width:0}
#settings-dialog .theme-picker .theme-gallery{max-height:350px;max-height:min(350px,48svh);overflow-y:auto;overscroll-behavior-y:contain;padding:3px;scrollbar-gutter:stable}
#settings-dialog .theme-picker .settings-preview{margin-top:12px}
.opponent-strength-control{display:flex;flex-wrap:wrap;align-items:center;gap:7px 12px;margin-top:12px;min-width:0}
.opponent-strength-control>span{font-size:var(--type-secondary);color:var(--ui-muted)}
.opponent-strength-control>select{width:auto;max-width:100%;min-height:44px;flex:1 1 140px;margin:0}
@media(max-width:600px){
  #settings-dialog .theme-picker .theme-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
  #settings-dialog .theme-picker .theme-choice-label{font-size:var(--type-label)}
}
@media(prefers-reduced-motion:reduce){#settings-dialog .theme-picker>summary>svg{transition:none}}

/* The same pager serves ranking, duels and training-session history.
 * The range is a separate row; equal outer tracks keep both actions symmetric
 * regardless of label length, disabled state or the current page number. */
.history-pagination,
:is(#page-tests,#page-training) .history-pagination{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:8px;
  min-width:0;
  min-height:0;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--ui-border);
}
.history-page-controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:stretch;
  gap:8px;
  width:100%;
  min-width:0;
}
.history-page-button,
#page-tests .history-page-button{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-width:0;
  min-height:44px;
  margin:0;
  padding:9px 8px;
  border:1px solid var(--ui-border-strong);
  border-radius:9px;
  background:var(--ui-surface);
  color:var(--ui-text);
  font-family:inherit;
  font-size:var(--type-label,.875rem);
  line-height:1.4;
  text-align:center;
  overflow-wrap:anywhere;
  box-shadow:none;
}
.history-page-button:disabled,
#page-tests .history-page-button:disabled{opacity:.4;cursor:default}
.history-page-label,
#page-tests .history-page-label{
  display:grid;
  place-items:center;
  align-self:center;
  min-width:3.5em;
  margin:0;
  padding:0;
  color:var(--ui-text);
  font-size:var(--type-label,.875rem);
  line-height:1.4;
  font-variant-numeric:tabular-nums;
  text-align:center;
  white-space:nowrap;
}
.history-range-label,
#page-tests .history-range-label{
  width:auto;
  margin:0;
  color:var(--ui-muted);
  font-size:var(--type-overline,.75rem);
  line-height:1.4;
  text-align:center;
  white-space:nowrap;
}

/* Three test views share the same title, card surfaces and tab rows.
 * Existing controllers continue to own state, controls and measurement rules. */
#page-tests .tests-mode-heading{
  display:flex;align-items:center;min-height:48px;margin:0 0 18px;gap:12px;
}
#page-tests .tests-mode-heading h2{margin:0;min-width:0;overflow-wrap:anywhere}
#page-tests .tests-mode-heading .ranking-heading{align-items:center;gap:12px}
#page-tests .tests-mode-heading .ranking-mark{
  width:40px;height:40px;border:0;border-radius:11px;background:var(--ui-surface);color:var(--ui-muted);box-shadow:none;
}
#page-tests .tests-mode-heading .ranking-mark svg{width:24px;height:24px}
#page-tests .tests-mode-duel-icon{display:none}
#page-tests[data-tests-view="duel"] .tests-mode-internal-icon{display:none}
#page-tests[data-tests-view="duel"] .tests-mode-duel-icon{display:block}
#page-tests:not([data-tests-view="ranking"]) [data-tests-heading="ranking"]{display:none}
#page-tests .rapid-rating-header{align-items:center;margin:0 0 20px}
#page-tests .rapid-rating-header>.section-label{margin:0;color:var(--ui-muted)}
#page-tests .rapid-rating-phase{max-width:50%}
#page-tests :is(.rapid-rating-dashboard,#test-rating-hero,.benchmark-card,.test-result-card,.test-history-card){
  box-sizing:border-box;min-width:0;border:1px solid transparent;
  border-radius:18px;padding:24px;background:var(--ui-surface);box-shadow:none;
}
#page-tests .tests-rating-copy{grid-template-columns:minmax(0,1fr);gap:10px}
#page-tests .tests-rating-copy .section-label{color:var(--ui-muted)}
#page-tests .rating-number{flex-wrap:wrap;white-space:normal;row-gap:4px}
#page-tests .tests-rating-meta{min-width:0}
#page-tests .test-mode-tabs.tests-view-tabs>button{
  display:grid;grid-template-columns:24px minmax(0,1fr);align-content:center;
  align-items:center;justify-items:start;min-width:0;min-height:88px;
}
#page-tests .test-mode-tabs.tests-view-tabs>button>svg{display:block;width:24px;height:24px;margin:0}
#page-tests .tests-view-tabs .tests-mode-copy{display:grid;align-content:center;min-width:0;width:100%;margin:0}
#page-tests .tests-view-tabs .tests-mode-copy strong{display:flex;align-items:center;min-height:3.1em;overflow-wrap:anywhere}
/* The SVG already contains the information circle. Keep one visible symbol
 * and a generous transparent target, without an extra circular frame. */
#page-tests .context-help.tests-info{flex:0 0 44px;border:0;background:transparent;box-shadow:none}
#page-tests .context-help.tests-info>summary{
  width:44px;height:44px;min-height:44px;padding:0;border:0;
  background:transparent;box-shadow:none;border-radius:9px;
}
#page-tests .context-help.tests-info>summary>svg{width:22px;height:22px}
#page-tests .tests-info>.context-help-body{top:48px}
@media(max-width:600px){
  #page-tests .tests-mode-heading{min-height:44px;margin-bottom:16px}
  #page-tests :is(.rapid-rating-dashboard,#test-rating-hero,.benchmark-card,.test-result-card,.test-history-card){padding:20px 17px}
  #page-tests .test-mode-tabs.tests-view-tabs>button{
    grid-template-columns:minmax(0,1fr);grid-template-rows:24px minmax(3.1em,1fr);
    justify-items:center;align-content:stretch;gap:8px;padding:10px 5px;
  }
  #page-tests .tests-view-tabs .tests-mode-copy{grid-template-rows:minmax(3.1em,1fr);align-self:stretch}
  #page-tests .tests-view-tabs .tests-mode-copy strong{justify-content:center;text-align:center}
  #page-tests #test-rating-hero{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
  #page-tests .tests-rating-meta{display:flex;flex-wrap:wrap;gap:6px 14px;max-width:none;text-align:left}
  #page-tests .tests-rating-meta>span{min-width:0;overflow-wrap:anywhere}
}

/* The ranking tab uses the same result/configuration/history card grouping
 * as the internal measurement; the outer tabpanel is only a layout owner. */
#page-tests #rapid-rating-dashboard{
  padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;
  overflow:visible;margin:0;
}
#page-tests .rapid-rating-layout{align-items:start;gap:var(--tests-gap)}
#page-tests :is(.rapid-rating-summary,.rapid-rating-config,.ranking-history-panel.card){
  box-sizing:border-box;min-width:0;padding:24px;border:1px solid transparent;
  border-radius:18px;background:var(--ui-surface);box-shadow:none;
}
#page-tests .rapid-rating-summary .rapid-rating-result{padding:0}
#page-tests .rapid-rating-config .rapid-rating-controls{padding:0;border:0;gap:10px}
#page-tests .ranking-history-panel.card{margin-top:var(--tests-gap)}
@media(max-width:600px){
  #page-tests :is(.rapid-rating-summary,.rapid-rating-config,.ranking-history-panel.card){padding:20px 17px}
}
@media(max-width:360px){
  #page-tests .test-mode-tabs.tests-view-tabs>button{padding-inline:1px}
}

/* Ranking owns its status in the result card; the other badge belongs to
 * internal/duel series and can describe a different paused or completed run. */
#page-tests[data-tests-view="ranking"] #test-state{display:none}
