:root{color-scheme:dark;--bg:#0c100e;--panel:#121815;--panel2:#171f1a;--border:#29332c;--text:#edf2eb;--muted:#8d9b90;--green:#c4f36a;--green2:#8dbb3f;--red:#ff8f7b;--square-light:#c8bcb5;--square-dark:#3d3f44;--shadow:0 20px 70px #0005}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:Manrope,system-ui,sans-serif;min-height:100vh;overflow-x:hidden}body.light{color-scheme:light;--bg:#f1f3ec;--panel:#fff;--panel2:#f5f7ef;--border:#d9dfd4;--text:#182019;--muted:#657267;--green:#416b0b;--green2:#608d20;--shadow:0 20px 70px #17221812}.ambient{position:absolute;pointer-events:none;filter:blur(95px);opacity:.12;border-radius:50%;z-index:-1}.ambient-a{width:420px;height:420px;background:#8bd148;top:70px;left:-260px}.ambient-b{width:380px;height:380px;background:#3e7659;top:570px;right:-240px}.topbar{height:78px;max-width:1240px;margin:auto;padding:0 30px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border)}.brand{display:flex;align-items:center;gap:10px;color:var(--text);text-decoration:none;font-size:12px;letter-spacing:2px;font-weight:800}.brand-mark{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--green2);border-radius:10px;color:var(--green);font-size:24px}.brand-light{font-weight:500;color:var(--muted)}nav{display:flex;gap:30px}nav a{color:var(--muted);text-decoration:none;font-size:12px}nav a:hover,nav .nav-active{color:var(--text)}button,input{font:inherit}.icon-button{width:38px;height:38px;border:1px solid var(--border);border-radius:50%;background:var(--panel);color:var(--text);font-size:20px;cursor:pointer}main{max-width:1180px;margin:auto;padding:0 28px}.hero{padding:86px 0 76px;max-width:760px}.eyebrow{font-family:"DM Mono",monospace;font-size:10px;letter-spacing:2px;color:var(--green);display:flex;align-items:center;gap:9px}.live-dot{width:6px;height:6px;background:var(--green);display:inline-block;border-radius:50%;box-shadow:0 0 12px #b6ec54aa}.hero h1{font-size:clamp(46px,7vw,78px);line-height:1.02;letter-spacing:-4px;margin:24px 0 18px;font-weight:600}.hero h1 em,.how-section h2 em{font-family:Georgia,serif;font-weight:400;color:var(--green);letter-spacing:-2px}.hero-copy{font-size:15px;line-height:1.8;color:var(--muted);max-width:510px}.hero-stats{display:flex;align-items:center;gap:20px;margin-top:34px}.hero-stats div{display:grid;gap:6px}.hero-stats strong{font-family:"DM Mono",monospace;font-size:12px;color:var(--green)}.hero-stats span{font-size:10px;color:var(--muted)}.hero-stats i{height:1px;width:40px;background:var(--border)}.workspace{border-top:1px solid var(--border);padding-top:32px}.section-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.section-heading h2{font-size:25px;letter-spacing:-1px;margin:9px 0 0}.status-pill,.engine-tag{font:10px "DM Mono",monospace;letter-spacing:1px;border:1px solid var(--border);padding:8px 10px;border-radius:30px;color:var(--muted);display:flex;gap:8px;align-items:center}.analyzer-grid{display:grid;grid-template-columns:minmax(300px,1fr) minmax(300px,.86fr);gap:16px}.panel{background:var(--panel);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);min-width:0}.board-panel{padding:18px}.panel-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:17px}.panel-label{font:10px "DM Mono",monospace;letter-spacing:1.5px;color:var(--muted)}.board-actions{display:flex;gap:8px}.quiet-button{border:1px solid var(--border);background:transparent;color:var(--muted);border-radius:7px;padding:7px 10px;font-size:11px;cursor:pointer}.board-surround{display:grid;grid-template-columns:18px minmax(0,1fr);grid-template-rows:auto auto;column-gap:5px;row-gap:0;align-items:stretch;width:100%;max-width:100%}.rank-labels{grid-column:1;grid-row:1;display:grid;grid-template-rows:repeat(8,minmax(0,1fr));align-items:center;text-align:center;padding:3px 0;color:#a9bdd6;font-size:11px;font-weight:700;line-height:1}.file-labels{grid-column:2;grid-row:2;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));align-items:center;text-align:center;padding:8px 3px 0;color:#a9bdd6;font-size:12px;font-weight:700;line-height:1}.chessboard{grid-column:2;grid-row:1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));aspect-ratio:1;border:3px solid #1a1c20;border-radius:3px;overflow:hidden;user-select:none;background:#202226;box-shadow:0 0 0 1px #73757a50,0 12px 30px #0008,inset 0 0 0 1px #ffffff16}.square{aspect-ratio:1;min-width:0;min-height:0;display:grid;place-items:center;position:relative;overflow:hidden;cursor:pointer;padding:0;border:0;border-radius:0;line-height:1}.square.light{background-color:#c6bab3;background-image:repeating-linear-gradient(0deg,#ffffff06 0 1px,transparent 1px 4px),repeating-linear-gradient(90deg,#00000004 0 1px,transparent 1px 5px),linear-gradient(145deg,#d1c6bf 0%,#b8aca5 100%)}.square.dark{background-color:#3a3c41;background-image:repeating-linear-gradient(135deg,#ffffff07 0 1px,transparent 1px 5px),repeating-linear-gradient(0deg,#00000008 0 1px,transparent 1px 4px),linear-gradient(145deg,#45474d 0%,#303237 100%)}.square.selected{z-index:2;box-shadow:inset 0 0 0 3px #a2ffc1,inset 0 0 18px #57efa33d,0 0 12px #6effae35}.square.last-move:after{content:"";position:absolute;inset:0;background:linear-gradient(140deg,#8cfcad46,#47d98520);box-shadow:inset 0 0 0 1px #83f4a75c;pointer-events:none;z-index:1}.square.legal:before{content:"";position:absolute;z-index:1;width:24%;height:24%;border-radius:50%;background:#172c2290;box-shadow:0 1px 3px #0004}.square.capture:before{content:"";position:absolute;z-index:1;inset:4px;border:3px solid #9cf8b6b8;border-radius:50%;box-shadow:inset 0 0 12px #0003}.piece-image{position:relative;z-index:3;display:block;width:91%;height:91%;object-fit:contain;pointer-events:none;user-select:none;filter:drop-shadow(0 2px 1px #000b) drop-shadow(0 5px 2px #0005);transform:translateY(-1px)}.square:focus-visible{outline:3px solid #9bffc0;outline-offset:-3px;z-index:4}.board-footer{display:flex;justify-content:space-between;gap:12px;margin:13px 0 18px;font-size:11px;color:var(--muted)}.board-footer span:last-child,.mono{font:9px "DM Mono",monospace;letter-spacing:1px}.position-input{border-top:1px solid var(--border);padding-top:16px;display:grid;gap:9px}.position-input>label{font:10px "DM Mono",monospace;letter-spacing:1.5px;color:var(--muted)}.input-row{display:flex;gap:8px;align-items:center;min-width:0}.input-row input:not([type=file]){min-width:0;width:100%;border:1px solid var(--border);border-radius:7px;background:var(--panel2);padding:11px 10px;color:var(--text);font-size:11px;outline:none}.input-row input:focus{border-color:var(--green2)}.small-button{flex-shrink:0;border:1px solid var(--green2);border-radius:7px;padding:10px 12px;background:#a6d95714;color:var(--green);font-size:11px;cursor:pointer}.upload-button{font-size:11px;color:var(--green);cursor:pointer;border:1px dashed var(--border);padding:9px 11px;border-radius:7px;white-space:nowrap}.subtle{font-size:10px;color:var(--muted);line-height:1.5}.image-preview{width:100%;max-height:180px;object-fit:contain;border-radius:8px;border:1px solid var(--border)}.results-panel{padding:18px;display:flex;flex-direction:column;min-height:100%}.engine-tag{font-size:8px;padding:7px;color:var(--green);white-space:nowrap}.empty-analysis{flex:1;min-height:420px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px}.radar{width:90px;height:90px;border:1px solid var(--border);border-radius:50%;display:grid;place-items:center;position:relative;color:var(--green);font-size:40px;margin-bottom:24px;background:radial-gradient(circle,var(--panel2),transparent)}.radar i{position:absolute;border:1px solid var(--border);border-radius:50%;inset:10px}.radar i:nth-child(2){inset:-10px}.radar i:nth-child(3){inset:22px}.empty-analysis h3{font-size:16px;margin:0 0 9px}.empty-analysis p{font-size:12px;line-height:1.7;color:var(--muted);max-width:260px;margin:0 0 22px}.primary-button{background:var(--green);color:#16200e;border:0;border-radius:8px;padding:13px 17px;font-size:12px;font-weight:800;cursor:pointer;transition:transform .15s,opacity .15s}.primary-button:hover{transform:translateY(-1px);opacity:.92}.primary-button:disabled{opacity:.55;cursor:wait}.microcopy{font-size:9px;color:var(--muted);margin-top:13px}.engine-footer{margin-top:auto;padding-top:15px;border-top:1px solid var(--border);display:flex;align-items:center;gap:8px;font-size:10px;color:var(--muted)}.engine-dot{width:6px;height:6px;border-radius:50%;background:var(--green2)}.engine-footer .mono{margin-left:auto;font-size:9px}.eval-block{background:var(--panel2);border:1px solid var(--border);border-radius:10px;padding:15px;display:grid;gap:7px}.eval-block strong{font-size:32px;letter-spacing:-1px}.eval-block>span:last-child{font-size:11px;color:var(--muted)}.best-move-block{padding:20px 0;border-bottom:1px solid var(--border)}.result-kicker{font:10px "DM Mono",monospace;letter-spacing:1.5px;color:var(--green)}.best-move-line{display:flex;align-items:baseline;gap:12px;margin-top:9px}.best-move-line strong{font-size:31px;letter-spacing:-1px}.best-move-line span{font:12px "DM Mono",monospace;color:var(--muted)}.best-move-block p,.brilliant-block p{font-size:11px;line-height:1.7;color:var(--muted);margin-bottom:0}.candidate-block{padding:18px 0}.row-heading{display:flex;justify-content:space-between;gap:8px;margin-bottom:11px}.candidate-row{display:grid;grid-template-columns:28px 1fr auto;gap:9px;align-items:center;padding:11px 0;border-top:1px solid var(--border);font-size:11px}.candidate-rank{font:10px "DM Mono",monospace;color:var(--muted)}.candidate-line{color:var(--text);overflow-wrap:anywhere}.candidate-eval{font:11px "DM Mono",monospace;color:var(--green)}.brilliant-block{display:flex;gap:13px;padding:15px;border:1px solid #9fc65a55;background:#a8d75a0a;border-radius:10px;margin-bottom:15px}.brilliant-icon{width:30px;height:30px;flex-shrink:0;border-radius:8px;background:#a8d75a1a;display:grid;place-items:center;color:var(--green);font-size:19px}.brilliant-block h3{font-size:13px;margin:7px 0 0}.full-button{width:100%}.how-section{padding:95px 0 85px}.how-section h2{font-size:clamp(34px,5vw,52px);line-height:1.12;letter-spacing:-2px;margin:19px 0 38px}.principles{display:grid;grid-template-columns:repeat(3,1fr);gap:25px}.principles article{border-top:1px solid var(--border);padding-top:17px}.principles article span{font:10px "DM Mono",monospace;color:var(--green)}.principles h3{font-size:15px;margin:17px 0 8px}.principles p{font-size:12px;line-height:1.8;color:var(--muted);margin:0}footer{border-top:1px solid var(--border);min-height:80px;display:flex;align-items:center;justify-content:space-between;gap:15px;color:var(--muted);font-size:10px}.footer-brand{font-size:10px}.footer-brand .brand-mark{width:28px;height:28px;font-size:20px}.notice{padding:10px 12px;background:#f0b65a14;border:1px solid #f0b65a44;color:#d9b578;border-radius:8px;font-size:11px;line-height:1.6;margin:10px 0}.error-notice{background:#ff8f7b12;border-color:#ff8f7b55;color:var(--red)}[hidden]{display:none!important}@media(max-width:820px){main{padding:0 18px}.topbar{padding:0 18px}.analyzer-grid{grid-template-columns:1fr}.hero{padding:65px 0 58px}.hero h1{letter-spacing:-2.5px}.empty-analysis{min-height:330px}.principles{gap:15px}.principles p{font-size:11px}}@media(max-width:540px){nav{gap:13px}nav a{font-size:10px}.topbar{height:66px}.brand{font-size:10px;letter-spacing:1px}.hero-stats{gap:11px}.hero-stats i{width:18px}.hero-stats span{font-size:9px}.section-heading h2{font-size:22px}.board-panel,.results-panel{padding:12px}.piece-image{width:92%;height:92%}.rank-labels{font-size:10px}.file-labels{font-size:11px}.principles{grid-template-columns:1fr;gap:24px}.how-section{padding:65px 0}.how-section h2{font-size:37px}footer{flex-wrap:wrap;padding:20px 0}footer .mono{display:none}.engine-tag{font-size:7px}.upload-button{font-size:10px}.subtle{font-size:9px}}
.turn-select{flex-shrink:0;max-width:132px;border:1px solid var(--border);border-radius:7px;padding:9px 8px;background:var(--panel2);color:var(--text);font-size:10px;outline:none}.turn-select:focus{border-color:var(--green2)}.recognition-privacy{margin:0 0 4px}.success-notice{background:#8fdda416;border-color:#8fdda45a;color:var(--green)}.warning-notice{background:#f0b65a14;border-color:#f0b65a55;color:#d9b578}@media(max-width:540px){.turn-select{max-width:112px;padding:8px 5px;font-size:9px}.recognition-privacy{font-size:9px}}

/* Chess-engine evaluation rail: White's advantage fills from the bottom. */
.board-surround{grid-template-columns:13px 18px minmax(0,1fr)}
.rank-labels{grid-column:2}
.chessboard{grid-column:3}
.file-labels{grid-column:3}
.evaluation-rail{grid-column:1;grid-row:1;align-self:stretch;min-height:0;width:12px;margin:3px auto 0;display:flex;flex-direction:column;overflow:hidden;border:1px solid #858b9666;border-radius:4px;background:#292d34;box-shadow:inset 0 0 0 1px #0005}
.evaluation-black{width:100%;height:50%;flex:0 0 auto;background:linear-gradient(90deg,#22262c,#373c45);transition:height .35s ease}
.evaluation-white{width:100%;height:50%;flex:0 0 auto;background:linear-gradient(90deg,#d6d1c7,#faf7ee);transition:height .35s ease}
.eval-score-pill{display:inline-flex;align-items:center;justify-content:center;padding:6px 7px;border:1px solid var(--border);border-radius:7px;background:var(--panel2);color:var(--text);font:9px "DM Mono",monospace;letter-spacing:.1px;white-space:nowrap;min-width:55px}
.board-actions{align-items:center}
@media(max-width:540px){.board-surround{grid-template-columns:10px 14px minmax(0,1fr)}.evaluation-rail{width:9px}.eval-score-pill{padding:5px 4px;min-width:48px;font-size:8px}.board-actions{gap:5px}.quiet-button{padding:6px 7px}}


/* Engine move arrows and checkmate celebration. */
.chessboard{position:relative;isolation:isolate}
.move-arrows-overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:10;overflow:visible}
.arrow-outline{fill:none;stroke:#0a100c;stroke-width:17;stroke-linecap:round;opacity:.82}
.arrow-path{fill:none;stroke-width:8;stroke-linecap:round;opacity:.96}
.arrow-path.best{stroke:#c4f36a}
.arrow-path.alternative{stroke:#4edacc;stroke-width:7;stroke-dasharray:14 9;opacity:.9}
.arrow-origin{stroke:#0a100c;stroke-width:5;opacity:.98}
.arrow-origin.best{fill:#c4f36a}
.arrow-origin.alternative{fill:#4edacc}
.arrow-legend{display:flex;align-items:center;justify-content:flex-end;gap:15px;margin:8px 0 0;font-size:10px;color:var(--muted)}
.arrow-legend span{display:inline-flex;align-items:center;gap:6px}
.arrow-legend-dot{display:inline-block;width:8px;height:8px;border-radius:50%}
.arrow-legend-dot.best-dot{background:#c4f36a;box-shadow:0 0 9px #c4f36866}
.arrow-legend-dot.alternative-dot{background:#4edacc}
.checkmate-banner{display:flex;align-items:center;gap:12px;margin:12px 0 2px;padding:12px 14px;border:1px solid #c4f36a66;border-radius:12px;background:radial-gradient(circle at 12% 50%,#c4f36a20,transparent 45%),linear-gradient(110deg,#c4f36a12,#4edacc08);box-shadow:inset 0 0 24px #c4f36a08;animation:checkmate-pop .45s cubic-bezier(.2,.8,.2,1) both}
.checkmate-trophy{width:42px;height:42px;display:grid;place-items:center;flex:0 0 auto;border-radius:11px;background:#c4f36a19;border:1px solid #c4f36a42;font-size:24px}
.checkmate-copy{display:grid;gap:4px;min-width:0}
.checkmate-copy strong{font-size:13px;letter-spacing:-.2px;color:var(--green)}
.checkmate-copy small{font-size:10px;line-height:1.6;color:var(--muted)}
.checkmate-flair{margin-left:auto;white-space:nowrap;font-size:17px;letter-spacing:2px;animation:checkmate-sparkle 1.8s ease-in-out infinite alternate}
@keyframes checkmate-pop{from{opacity:0;transform:translateY(7px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes checkmate-sparkle{from{opacity:.55;transform:scale(.96)}to{opacity:1;transform:scale(1.04)}}
@media(max-width:540px){.arrow-legend{justify-content:flex-start;gap:10px;font-size:9px}.checkmate-banner{gap:9px;padding:10px}.checkmate-trophy{width:36px;height:36px;font-size:21px}.checkmate-copy strong{font-size:12px}.checkmate-copy small{font-size:9px}.checkmate-flair{font-size:14px;letter-spacing:0}}
@media(prefers-reduced-motion:reduce){.checkmate-banner,.checkmate-flair{animation:none}}


/* Clear signed evaluations at each end of the bar: Black above, White below. */
.board-surround{grid-template-columns:39px 18px minmax(0,1fr)}
.evaluation-gauge{grid-column:1;grid-row:1;align-self:stretch;min-height:0;display:flex;flex-direction:column;align-items:center;gap:5px;padding-top:3px}
.evaluation-end-score{display:block;width:100%;text-align:center;white-space:nowrap;font:700 8px/1.2 "DM Mono",monospace;letter-spacing:-.35px;transition:color .2s,opacity .2s}
.black-score{color:#a7afbc}
.white-score{color:#f5f1e9}
.evaluation-end-score.is-ahead{color:var(--green);text-shadow:0 0 8px #c4f36a45}
.evaluation-end-score.is-behind{opacity:.62}
.evaluation-gauge .evaluation-rail{flex:1;align-self:stretch;min-height:0;width:11px;margin:0 auto}
@media(max-width:540px){
  .board-surround{grid-template-columns:35px 14px minmax(0,1fr)}
  .evaluation-end-score{font-size:7px;letter-spacing:-.45px}
  .evaluation-gauge{gap:4px}
  .evaluation-gauge .evaluation-rail{width:9px}
}


/* Screenshot-matched arrows: bold green best move, softer green alternatives. */
.arrow-outline{fill:none;stroke:#172018;stroke-width:18;stroke-linecap:round;stroke-linejoin:round;opacity:.30}
.arrow-path{fill:none;stroke:#78b82b;stroke-width:15;stroke-linecap:round;stroke-linejoin:round;opacity:.96}
.arrow-path.best{stroke:#78b82b;stroke-width:15;opacity:.94}
.arrow-path.alternative{stroke:#78b82b;stroke-width:13;stroke-dasharray:none;opacity:.62}
.move-arrow-group.alternative{opacity:.78}
.arrow-origin{display:none}
.arrow-legend-dot.best-dot,.arrow-legend-dot.alternative-dot{background:#78b82b;box-shadow:0 0 8px #78b82b55}


/* Explicit solid arrowheads: high-contrast outline keeps the point crisp. */
.arrow-head{fill:#78b82b;stroke:#172018;stroke-width:8;stroke-linejoin:round;paint-order:stroke fill;opacity:.98}
.arrow-head.best{fill:#78b82b;stroke:#172018;stroke-width:8;opacity:1}
.arrow-head.alternative{fill:#78b82b;stroke:#172018;stroke-width:7;opacity:.72}
.arrow-path.best{stroke-width:15;opacity:1}
.arrow-path.alternative{stroke-width:13;opacity:.7}
.arrow-outline{stroke-width:21;opacity:.45}


/* Classification states reflect the engine's actual verdict, not the panel title. */
.brilliant-block.review-brilliant{border-color:#c4f36a99;background:linear-gradient(115deg,#c4f36a16,#4edacc08)}
.brilliant-block.review-best,.brilliant-block.review-positive{border-color:#8fdda45a;background:#8fdda40b}
.brilliant-block.review-warning{border-color:#f0b65a66;background:#f0b65a0b}
.brilliant-block.review-error{border-color:#ff8f7b77;background:#ff8f7b0b}
.brilliant-block.review-neutral{border-color:var(--border);background:var(--panel2)}
.brilliant-block.review-best .brilliant-icon,.brilliant-block.review-positive .brilliant-icon{color:var(--green);background:#8fdda419}
.brilliant-block.review-warning .brilliant-icon{color:#d9b578;background:#f0b65a18}
.brilliant-block.review-error .brilliant-icon{color:var(--red);background:#ff8f7b18}


/* Read-only engine line explorer with obvious back/forward navigation. */
.explore-line-button{margin-top:12px;border-color:var(--green2);color:var(--green);padding:9px 12px}
.line-explorer-controls{margin:12px 0 2px;padding:12px;border:1px solid var(--border);background:var(--panel2);border-radius:10px;display:grid;gap:11px}
.line-explorer-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex-wrap:wrap}
.line-explorer-heading strong{font-size:11px;color:var(--green)}
.line-explorer-heading span{font:9px "DM Mono",monospace;color:var(--muted)}
.line-explorer-buttons{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.line-explorer-buttons .primary-button{padding:9px 12px}
.line-explorer-buttons .quiet-button{padding:8px 10px}
.line-explorer-buttons button:disabled{opacity:.4;cursor:not-allowed;transform:none}
@media(max-width:540px){
  .line-explorer-controls{padding:10px}
  .line-explorer-buttons{display:grid;grid-template-columns:1fr 1fr}
  .line-explorer-buttons #lineExitBtn{grid-column:1 / -1}
  .line-explorer-heading span{width:100%}
}


/* Timeline navigation: jump to any played or recommended move. */
.line-explorer-buttons{display:grid;grid-template-columns:auto 1fr 1fr auto}
.line-explorer-buttons #lineExitBtn{grid-column:1 / -1}
.line-explorer-buttons .jump-button{font-size:10px;padding:8px 9px}
.line-explorer-move-list{display:flex;flex-wrap:wrap;gap:6px;max-height:118px;overflow:auto;padding:2px 1px 4px}
.line-move-chip{border:1px solid var(--border);border-radius:6px;padding:6px 8px;background:var(--panel);color:var(--muted);font:10px "DM Mono",monospace;cursor:pointer}
.line-move-chip:hover{border-color:var(--green2);color:var(--text)}
.line-move-chip.is-current{background:var(--green);border-color:var(--green);color:#17200f;font-weight:800}
.line-move-chip.engine-move-chip:not(.is-current){border-style:dashed}
@media(max-width:540px){
  .line-explorer-buttons{grid-template-columns:1fr 1fr}
  .line-explorer-buttons #lineExitBtn{grid-column:1 / -1}
  .line-explorer-move-list{max-height:150px}
}


/* Special engine-checked castling recommendation. */
#castleArrowLegend{color:var(--green);font-weight:700}
.brilliant-block.review-brilliant .brilliant-icon{font-weight:900}


/* Chess Academy: training challenges, practice bots, and opening lessons. */
.academy-section{max-width:1180px;margin:0 auto;padding:82px 30px 40px}
.academy-rating-pill{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:999px;padding:8px 11px;color:var(--muted);font:9px "DM Mono",monospace;letter-spacing:.06em}
.academy-progress{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:24px;padding:22px 24px;margin-bottom:18px;align-items:center}
.academy-progress-main,.academy-progress-stat{display:grid;gap:5px}
.academy-rating-number{display:flex;align-items:baseline;gap:8px}
.academy-rating-number strong{font-size:38px;line-height:1;color:var(--green);letter-spacing:-1.5px}
.academy-rating-number span,.academy-progress-stat>span:last-child{font-size:10px;color:var(--muted)}
.academy-rank-label{font-size:12px;color:var(--text)}
.academy-progress-stat{padding-left:20px;border-left:1px solid var(--border)}
.academy-progress-stat>strong{font-size:16px}
.academy-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}
.academy-card{padding:22px;min-width:0}
.academy-card-heading{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.academy-icon{display:grid;place-items:center;width:42px;height:42px;flex:0 0 auto;border:1px solid #c4f36a35;background:#c4f36a0d;border-radius:12px;color:var(--green);font-size:24px}
.academy-card-heading h3{font-size:18px;line-height:1.35;margin:3px 0 0;letter-spacing:-.4px}
.academy-card-copy{font-size:12px;color:var(--muted);line-height:1.8;margin:0 0 18px}
.challenge-list{display:grid;gap:8px}
.challenge-card{display:grid;gap:7px;text-align:left;width:100%;border:1px solid var(--border);border-radius:10px;background:var(--panel2);padding:13px 14px;color:var(--text);cursor:pointer;transition:border-color .18s,transform .18s,background .18s}
.challenge-card:hover{border-color:var(--green2);transform:translateY(-1px)}
.challenge-card.challenge-complete{border-color:#a6d96780;background:#c4f36a0a}
.challenge-card strong{font-size:12px}
.challenge-card>span:last-child{font-size:10px;color:var(--muted);line-height:1.5}
.challenge-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.challenge-level,.challenge-state{font:8px "DM Mono",monospace;letter-spacing:.045em;color:var(--muted)}
.challenge-state{color:var(--green)}
.academy-field-label{display:block;font-size:10px;color:var(--muted);margin:13px 0 7px}
.academy-select{width:100%;background:var(--panel2);border:1px solid var(--border);color:var(--text);border-radius:9px;padding:11px 12px;font:12px Manrope,system-ui,sans-serif}
.bot-actions{display:flex;gap:9px;align-items:center;margin-top:17px;flex-wrap:wrap}
.bot-actions .primary-button{padding:11px 15px}
.academy-feedback{border:1px solid var(--border);background:var(--panel2);border-radius:9px;padding:11px 12px;margin-top:13px;font-size:10px;line-height:1.8;color:var(--muted)}
.success-feedback{border-color:#c4f36a60;color:var(--text);background:#c4f36a0a}
.error-feedback{border-color:#ff8f7b66;color:var(--text);background:#ff8f7b0a}
.info-feedback{color:var(--muted)}
.academy-disclaimer,.academy-note{font-size:10px;color:var(--muted);line-height:1.8}
.academy-disclaimer{margin:13px 0 0}
.challenge-active-panel{margin-top:12px;border-left:2px solid var(--green);padding:7px 11px;background:var(--panel2);display:grid;gap:4px}
.challenge-active-panel strong{font-size:12px}
.challenge-active-panel p{font-size:10px;color:var(--muted);line-height:1.65;margin:0}
.opening-teacher-card{margin-top:0}
.opening-card-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.opening-card{border:1px solid var(--border);background:var(--panel2);border-radius:10px;padding:14px;display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.opening-code{font:8px "DM Mono",monospace;color:var(--green2);letter-spacing:.04em}
.opening-card h4{font-size:12px;line-height:1.5;margin:10px 0 6px}
.opening-card p{font-size:10px;line-height:1.7;color:var(--muted);margin:0 0 15px;flex:1}
.opening-card .quiet-button{font-size:10px;padding:8px 9px;max-width:100%}
.academy-note{margin:14px 0 0}
.line-explorer-note{border-left:2px solid var(--green);padding:8px 11px;background:#c4f36a0a;color:var(--muted);font-size:11px;line-height:1.8;border-radius:0 7px 7px 0}
@media(max-width:880px){.opening-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.academy-grid{grid-template-columns:1fr}}
@media(max-width:600px){.academy-section{padding:58px 14px 30px}.academy-progress{grid-template-columns:1fr 1fr;gap:18px;padding:18px}.academy-progress-main{grid-column:1/-1}.academy-progress-stat{padding-left:0;border-left:0;border-top:1px solid var(--border);padding-top:14px}.academy-rating-number strong{font-size:32px}.academy-card{padding:15px}.challenge-card-top{align-items:flex-start;flex-direction:column;gap:5px}.opening-card-grid{grid-template-columns:1fr 1fr}.opening-card{padding:11px}.academy-rating-pill{font-size:8px}}


/* Actual view navigation: only the selected workspace is visible. */
[hidden]{display:none!important}
nav.main-nav{display:flex;align-items:center;justify-content:center;gap:clamp(9px,1.6vw,22px);max-width:calc(100% - 195px);margin:0 8px 0 auto;overflow-x:auto;white-space:nowrap;scrollbar-width:none}
nav.main-nav::-webkit-scrollbar{display:none}
nav.main-nav .nav-link{position:relative;flex:0 0 auto;border:0;border-bottom:2px solid transparent;padding:10px 0 9px;background:transparent;color:var(--muted);font-size:11px;font-weight:650;cursor:pointer}
nav.main-nav .nav-link:hover{color:var(--text)}
nav.main-nav .nav-link.nav-active{color:var(--text);border-bottom-color:var(--green)}
nav.main-nav .nav-link:focus-visible{outline:2px solid var(--green2);outline-offset:4px;border-radius:3px}
body[data-page="challenges"] .academy-grid.is-single-panel,
body[data-page="bot-arena"] .academy-grid.is-single-panel{grid-template-columns:minmax(0,1fr)}
body[data-page="opening-teacher"] .academy-grid{display:none}
.academy-section{padding-top:44px}
.academy-section>.section-heading{margin-bottom:18px}
.academy-progress{margin-bottom:16px}
.line-explorer-note{white-space:pre-line}
@media(max-width:820px){
  nav.main-nav{gap:12px;max-width:calc(100% - 175px);margin-right:7px}
  nav.main-nav .nav-link{font-size:10px}
}
@media(max-width:540px){
  .topbar{gap:7px}
  nav.main-nav{gap:12px;max-width:calc(100% - 150px);margin-right:3px}
  nav.main-nav .nav-link{font-size:9px;padding:9px 0 8px}
  .academy-section{padding-top:30px}
}


/* Keep the navigation available while switching study workspaces. */
.topbar{position:sticky;top:0;z-index:100;background:var(--bg);backdrop-filter:blur(14px)}
main{display:flex;flex-direction:column}
#hero{order:0}
#analyzer{order:1}
#academy{order:2}
#how-it-works{order:3}
footer{order:4}
body[data-page="challenges"] #academy,
body[data-page="bot-arena"] #academy,
body[data-page="opening-teacher"] #academy{order:0}
body[data-page="challenges"] #analyzer,
body[data-page="bot-arena"] #analyzer,
body[data-page="opening-teacher"] #analyzer{order:1}
body[data-page="how-it-works"] #how-it-works{order:0}


/* Context for the active puzzle or bot match stays next to the board. */
.board-training-notice{display:grid;gap:5px;margin:12px 0 4px;padding:12px 14px;border:1px solid #c4f36a55;border-left:3px solid var(--green);border-radius:8px;background:var(--panel2)}
.board-training-notice strong{font-size:11px;color:var(--green)}
.board-training-notice p{margin:0;color:var(--muted);font-size:11px;line-height:1.7}
body[data-page="challenges"] .board-training-notice,
body[data-page="bot-arena"] .board-training-notice,
body[data-page="opening-teacher"] .line-explorer-controls{scroll-margin-top:88px}


/* Opening practice controls: the practice mode is interactive, not a board preview. */
.opening-card-actions{display:flex;flex-direction:column;gap:7px;width:100%;margin-top:auto}
.opening-card-actions button{width:100%;min-height:34px;font-size:10px;padding:8px 9px}
.opening-practice-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:center;padding:15px 16px;margin-top:14px;border:1px solid #c4f36a55;border-left:3px solid var(--green);border-radius:10px;background:var(--panel2)}
.opening-practice-controls>div:first-child{display:grid;gap:5px}
.opening-practice-controls strong{font-size:13px}
.opening-practice-controls p{margin:0;color:var(--muted);font-size:11px;line-height:1.75}
.opening-practice-actions{display:flex;gap:8px;flex-wrap:wrap}
.opening-practice-actions button{font-size:10px;padding:9px 11px}

/* Chess.com public archive importer. */
.chesscom-section{max-width:1180px;margin:0 auto;padding:46px 30px 55px}
.chesscom-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:18px;align-items:start}
.chesscom-form-card,.chesscom-games-card{padding:22px;min-width:0}
.chesscom-search-form{margin-top:4px}
.chesscom-username-row,.chesscom-select-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.academy-input{width:100%;min-width:0;background:var(--panel2);border:1px solid var(--border);color:var(--text);border-radius:9px;padding:11px 12px;font:12px Manrope,system-ui,sans-serif;outline:none}
.academy-input:focus,.academy-select:focus{border-color:var(--green2);box-shadow:0 0 0 2px #c4f36a16}
.chesscom-username-row .primary-button,.chesscom-select-row .quiet-button{min-height:39px;padding:9px 12px;white-space:nowrap;font-size:10px}
.chesscom-selected-details{min-height:74px;padding:12px;margin-top:12px;border:1px solid var(--border);border-radius:9px;background:var(--panel2);color:var(--muted);font-size:11px;line-height:1.9;white-space:pre-line;overflow-wrap:anywhere}
.chesscom-import-btn{width:100%;margin-top:12px;padding:12px 15px}
.chesscom-import-btn:disabled,.chesscom-search-form button:disabled,.chesscom-select-row button:disabled{opacity:.45;cursor:not-allowed}
.chesscom-section .section-heading{margin-bottom:18px}
@media(max-width:820px){.chesscom-layout{grid-template-columns:1fr}.opening-practice-controls{grid-template-columns:1fr}}
@media(max-width:600px){
  .chesscom-section{padding:30px 14px}
  .chesscom-form-card,.chesscom-games-card{padding:15px}
  .chesscom-username-row{grid-template-columns:1fr}
  .chesscom-username-row .primary-button{width:100%}
  .chesscom-select-row{grid-template-columns:1fr}
  .chesscom-select-row .quiet-button{width:100%}
  .opening-practice-actions{display:grid;grid-template-columns:1fr 1fr}
  .opening-practice-actions button{white-space:normal}
}


/* Chess.com connection and personalized, pattern-based coaching report. */
.chesscom-count-row{display:grid;grid-template-columns:minmax(90px,130px) 1fr;gap:10px;align-items:center;margin:0 0 14px}
.chesscom-count-help{font-size:10px;line-height:1.5;color:var(--muted)}
.chesscom-insights-card{grid-column:1/-1;padding:22px}
.chesscom-insights-card>.academy-card-copy{max-width:820px;line-height:1.7}
.chesscom-insight-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px 0}
.chesscom-stat{display:flex;flex-direction:column;gap:5px;background:var(--panel2);border:1px solid var(--border);border-radius:10px;padding:14px;min-width:0}
.chesscom-stat strong{font:600 20px "DM Mono",monospace;color:var(--text);overflow-wrap:anywhere}
.chesscom-stat span{font-size:9px;line-height:1.45;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.chesscom-insight-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 14px}
.chesscom-insight-card{border:1px solid var(--border);background:var(--panel2);border-radius:10px;padding:15px}
.chesscom-insight-card h4{font-size:12px;line-height:1.5;margin:0 0 7px;color:var(--text)}
.chesscom-insight-card p{font-size:11px;line-height:1.75;color:var(--muted);margin:0}
.opening-coach-arrow-overlay{z-index:8}
.opening-coach-arrow .arrow-outline{stroke:rgba(8,20,14,.82);stroke-width:15;fill:none}
.opening-coach-arrow .arrow-path.best{stroke:#20e878;stroke-width:9;fill:none;opacity:.96}
.opening-coach-arrow .arrow-head.best{fill:#20e878;stroke:#0b4c2b;stroke-width:3;opacity:.98}
@media(max-width:820px){
  .chesscom-insight-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .chesscom-insights-card{padding:15px}
  .chesscom-insight-cards{grid-template-columns:1fr}
  .chesscom-count-row{grid-template-columns:minmax(80px,110px) 1fr}
}


/* Professional Chess.com game library. */
.chesscom-library-card{grid-column:1/-1;min-width:0;padding:22px}
.chesscom-library-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
.chesscom-library-heading .academy-card-heading{margin-bottom:0}
.chesscom-games-count{white-space:nowrap;border:1px solid var(--border);border-radius:999px;padding:7px 10px;color:var(--muted);font:10px "DM Mono",monospace;margin-top:2px}
.chesscom-library-toolbar{display:grid;grid-template-columns:minmax(220px,1fr) 160px 160px;gap:10px;margin:20px 0 12px;align-items:end}
.chesscom-search-box{position:relative;display:block}
.chesscom-search-box input{min-height:42px;padding-left:14px}
.chesscom-filter-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.chesscom-filter-field>span{font-size:9px;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.chesscom-filter-field .academy-select{width:100%;min-height:42px}
.chesscom-archive-tools{display:flex;align-items:flex-end;gap:10px;padding:12px 0 15px;border-bottom:1px solid var(--border)}
.chesscom-archive-tools .chesscom-filter-field{width:min(280px,100%)}
.chesscom-archive-tools button{min-height:42px;white-space:nowrap}
.chesscom-games-list{display:flex;flex-direction:column;gap:9px;padding-top:13px}
.chesscom-games-empty{padding:32px 18px;text-align:center;border:1px dashed var(--border);border-radius:12px;background:var(--panel2);font-size:11px;line-height:1.8;color:var(--muted);margin-top:13px}
.chesscom-game-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:14px;padding:15px 14px;border:1px solid var(--border);border-radius:12px;background:var(--panel2);transition:border-color .16s,transform .16s,background .16s}
.chesscom-game-row:hover{border-color:var(--green2);background:var(--panel);transform:translateY(-1px)}
.chesscom-game-index{font:11px "DM Mono",monospace;color:var(--muted);align-self:start;padding-top:3px}
.chesscom-game-main{min-width:0}
.chesscom-game-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:9px}
.chesscom-game-date{font:10px "DM Mono",monospace;color:var(--text)}
.chesscom-game-format{font-size:9px;color:var(--muted);border:1px solid var(--border);padding:3px 7px;border-radius:999px}
.chesscom-matchup{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.chesscom-player-pair{display:grid;grid-template-columns:repeat(2,minmax(130px,1fr));gap:12px;min-width:min(100%,390px)}
.chesscom-player{display:flex;align-items:center;gap:9px;min-width:0}
.chesscom-player-piece{font-size:22px;line-height:1;flex-shrink:0}
.chesscom-player-piece.white{color:var(--text)}
.chesscom-player-piece.black{color:var(--muted)}
.chesscom-player-name-wrap{display:flex;flex-direction:column;min-width:0;gap:3px}
.chesscom-player-name-wrap strong{font-size:11px;line-height:1.4;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chesscom-player-name-wrap small{font-size:9px;color:var(--muted)}
.chesscom-player.is-account .chesscom-player-name-wrap strong:after{content:"YOU";display:inline-block;font:8px "DM Mono",monospace;color:var(--green2);border:1px solid currentColor;border-radius:4px;padding:1px 4px;margin-left:6px;vertical-align:1px}
.chesscom-versus{font:8px "DM Mono",monospace;color:var(--muted);letter-spacing:.08em}
.chesscom-result-badge{font:9px "DM Mono",monospace;letter-spacing:.07em;border:1px solid var(--border);border-radius:999px;padding:6px 9px;white-space:nowrap}
.chesscom-result-badge.result-win{color:#6ed99a;border-color:#6ed99a4d;background:#6ed99a0c}
.chesscom-result-badge.result-loss{color:#f08a8a;border-color:#f08a8a4d;background:#f08a8a0c}
.chesscom-result-badge.result-draw{color:#d8bb74;border-color:#d8bb744d;background:#d8bb740c}
.chesscom-result-badge.result-unknown{color:var(--muted)}
.chesscom-game-extra{display:flex;gap:10px;flex-wrap:wrap;font-size:9px;line-height:1.5;color:var(--muted);margin-top:8px}
.chesscom-row-analyze{min-height:40px;white-space:nowrap;padding:10px 13px;font-size:10px}
@media(max-width:850px){
  .chesscom-library-toolbar{grid-template-columns:minmax(0,1fr) minmax(130px,180px)}
  .chesscom-search-box{grid-column:1/-1}
  .chesscom-game-row{grid-template-columns:24px minmax(0,1fr);gap:10px}
  .chesscom-row-analyze{grid-column:2;justify-self:start}
}
@media(max-width:560px){
  .chesscom-library-card{padding:15px}
  .chesscom-library-heading{flex-direction:column;gap:12px}
  .chesscom-library-toolbar{grid-template-columns:1fr 1fr}
  .chesscom-game-row{padding:12px 10px}
  .chesscom-player-pair{grid-template-columns:1fr;gap:8px}
  .chesscom-matchup{gap:8px}
  .chesscom-archive-tools{align-items:stretch;flex-direction:column}
  .chesscom-archive-tools .chesscom-filter-field{width:100%}
  .chesscom-archive-tools button{width:100%}
  .chesscom-row-analyze{width:100%}
}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}


/* Imported PGN opens at the result; move navigation starts there and steps backward. */
.pgn-review-controls{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:10px 0 14px;padding:14px 15px;border:1px solid var(--border);border-radius:11px;background:var(--panel2)}
.pgn-review-copy{display:flex;flex-direction:column;gap:5px;min-width:0}
.pgn-review-kicker{font:9px "DM Mono",monospace;letter-spacing:.12em;color:var(--green2)}
.pgn-review-copy strong{font-size:11px;line-height:1.5;color:var(--text)}
.pgn-review-copy p{font-size:10px;line-height:1.6;color:var(--muted);margin:0}
.pgn-review-controls button{flex-shrink:0;min-height:38px;white-space:nowrap}
@media(max-width:600px){
  .pgn-review-controls{align-items:stretch;flex-direction:column}
  .pgn-review-controls button{width:100%;white-space:normal}
}


/* Engine-backed move-quality stickers for game history. */
.line-move-chip{display:inline-flex;align-items:center;justify-content:space-between;gap:7px;white-space:nowrap}
.line-move-label{display:inline-block}
.move-grade-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:3px 5px;font:800 7px "DM Mono",monospace;letter-spacing:.025em;line-height:1.25;border:1px solid transparent;white-space:nowrap}
.grade-brilliant{background:#c4f36a24;color:#9edf37;border-color:#c4f36a70}
.grade-best{background:#76b9ff20;color:#77baff;border-color:#77baff55}
.grade-excellent,.grade-good{background:#65dca41c;color:#65dca4;border-color:#65dca455}
.grade-inaccuracy{background:#e1ca5520;color:#d9c257;border-color:#d9c25755}
.grade-mistake{background:#f5a04b20;color:#f5a04b;border-color:#f5a04b66}
.grade-blunder,.grade-mate{background:#ff777720;color:#ff8585;border-color:#ff858566}
.grade-unrated{background:var(--panel2);color:var(--muted);border-color:var(--border)}
.grade-pending{background:var(--panel2);color:var(--muted);border-color:var(--border);animation:grade-pulse 1.1s ease-in-out infinite alternate}
@keyframes grade-pulse{from{opacity:.45}to{opacity:1}}
.pgn-review-actions{display:flex;flex-wrap:wrap;gap:8px}
.pgn-review-actions button{white-space:nowrap}
.move-audit-status{font-size:10px;line-height:1.6;color:var(--muted)}
.square.checkmate-king-square{background:#ef8585!important;box-shadow:inset 0 0 0 3px #e64a4a,inset 0 0 22px #df3e3e88!important;z-index:2}
.square.checkmate-king-square:after{content:"";position:absolute;inset:0;background:rgba(255,105,105,.52);box-shadow:inset 0 0 0 2px #e23a3a;pointer-events:none;z-index:2}
@media(max-width:600px){
  .pgn-review-actions{display:grid;grid-template-columns:1fr}
  .pgn-review-actions button{width:100%;white-space:normal}
  .line-move-chip{white-space:normal;gap:5px}
  .move-grade-badge{font-size:6px;padding:3px 4px}
}


/* Chess Vision Game Review — stays inside the original Analyzer visual system. */
.game-review-overlay{position:fixed;inset:0;z-index:1000;display:block;overflow:auto;padding:0;background:var(--bg);color:var(--text)}
.game-review-overlay[hidden]{display:none}
.game-review-backdrop{display:none}
.game-review-dialog{position:relative;width:min(1180px,calc(100% - 48px));max-height:none;overflow:visible;margin:0 auto;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--text)}
.game-review-header{position:relative;top:auto;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:78px;padding:12px 0;border-bottom:1px solid var(--border);background:transparent}
.game-review-brand{display:flex;align-items:center;gap:12px}
.game-review-mark{width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--green2);border-radius:10px;background:var(--panel);color:var(--green);font-size:20px}
.game-review-kicker{display:block;color:var(--green2);font:9px "DM Mono",monospace;letter-spacing:1.5px}
.game-review-header h2{font-size:20px;letter-spacing:-.4px;margin:3px 0 0}
.game-review-header-actions{display:flex;align-items:center;gap:13px}
.game-review-engine-status,.review-engine-note{color:var(--muted);font:9px "DM Mono",monospace}
.game-review-close{width:38px;height:38px;border:1px solid var(--border);border-radius:50%;background:var(--panel);color:var(--text);font-size:21px;cursor:pointer}
.game-review-summary-view{padding:28px 0 36px}
.game-review-greeting{display:flex;align-items:center;gap:13px;margin:2px 0 20px}
.game-review-coach-avatar{flex:0 0 48px;width:48px;height:48px;display:grid;place-items:center;border:1px solid var(--border);border-radius:12px;background:var(--panel2);color:var(--green);font-size:27px}
.game-review-greeting>div:last-child{padding:13px 16px;border:1px solid var(--border);border-radius:10px;background:var(--panel);flex:1}
.game-review-greeting strong{font-size:14px}
.game-review-greeting p{font-size:10px;color:var(--muted);margin:5px 0 0}
.review-player-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:24px}
.review-player-card{padding:17px 19px;border:1px solid var(--border);border-radius:12px;background:var(--panel);min-width:0;box-shadow:var(--shadow)}
.review-player-top{display:flex;align-items:center;gap:9px;min-width:0}
.review-player-top strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.review-player-dot{width:11px;height:11px;flex:0 0 auto;border-radius:50%;background:#ddd8cd;border:1px solid #8a8982}
.review-player-black .review-player-dot{background:#363a3e;border-color:#8d9297}
.review-player-score{font:800 31px "DM Mono",monospace;letter-spacing:-.06em;margin-top:12px;color:var(--green)}
.review-player-caption{display:block;color:var(--muted);font:9px "DM Mono",monospace;letter-spacing:1.2px;margin-top:3px}
.review-player-card small{display:block;color:var(--muted);font-size:10px;margin-top:9px}
.game-review-section-head{display:flex;align-items:end;justify-content:space-between;gap:14px;margin:0 0 12px}
.game-review-section-head h3{font-size:15px;margin:4px 0 0}
.review-category-wrap{overflow:auto;border:1px solid var(--border);border-radius:10px;background:var(--panel)}
.review-category-table{width:100%;border-collapse:collapse;min-width:430px}
.review-category-table th,.review-category-table td{padding:10px 14px;border-bottom:1px solid var(--border);font-size:11px}
.review-category-table tr:last-child th,.review-category-table tr:last-child td{border-bottom:0}
.review-category-table thead th{color:var(--muted);font:9px "DM Mono",monospace;text-align:left;background:var(--panel2)}
.review-category-table thead th:not(:first-child),.review-category-table td{text-align:center}
.review-category-table tbody th{font-weight:700;text-align:left}
.review-category-table td{font:700 12px "DM Mono",monospace}
.review-category-label{display:flex;align-items:center;gap:9px}
.review-category-label:before{content:"";width:7px;height:7px;border-radius:2px;background:var(--green2);opacity:.9}
.review-category-table tr:nth-child(7) .review-category-label:before{background:#dfc552}
.review-category-table tr:nth-child(8) .review-category-label:before{background:#f3a14e}
.review-category-table tr:nth-child(10) .review-category-label:before{background:var(--red)}
.game-review-disclaimer{margin:12px 0 0;color:var(--muted);font-size:10px;line-height:1.65}
.game-review-progress{margin-top:15px;padding:11px 13px;border:1px solid var(--border);border-radius:9px;background:var(--panel);color:var(--muted);font-size:10px;line-height:1.55}
.game-review-summary-actions{display:flex;justify-content:flex-end;margin-top:18px}
.game-review-start-btn{display:flex;align-items:center;justify-content:center;gap:14px;min-width:210px;min-height:43px;padding:10px 16px;border:0;border-radius:8px;background:var(--green);color:#16200e;font-size:12px;font-weight:800;cursor:pointer}
.game-review-start-btn span{font-size:18px}
.game-review-guided-view{padding:20px 0 35px}
.game-review-guided-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.game-review-back-btn{border:1px solid var(--border);border-radius:7px;background:var(--panel);color:var(--muted);padding:8px 11px;font-size:11px;cursor:pointer}
#gameReviewStepLabel{font:700 10px "DM Mono",monospace;color:var(--text);letter-spacing:.5px}
.game-review-layout{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(310px,.88fr);gap:16px;align-items:start}
.game-review-board-column,.game-review-coach-column{min-width:0}
.game-review-board-column{padding:17px;border:1px solid var(--border);border-radius:14px;background:var(--panel);box-shadow:var(--shadow)}
.game-review-board{width:min(100%,610px);aspect-ratio:1;margin:0 auto;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));overflow:hidden;border:3px solid #1a1c20;border-radius:3px;background:#202226;box-shadow:0 0 0 1px #73757a50,0 12px 30px #0008,inset 0 0 0 1px #ffffff16}
.game-review-square{aspect-ratio:1;min-width:0;min-height:0;display:grid;place-items:center;position:relative;overflow:hidden;cursor:default;padding:0;border:0;border-radius:0;line-height:1}
.game-review-square img{width:91%;height:91%;object-fit:contain}
.game-review-board-caption{width:min(100%,610px);margin:11px auto 14px;display:flex;justify-content:space-between;gap:10px;color:var(--muted);font:9px "DM Mono",monospace}
#gameReviewBoardEval{color:var(--green);font-weight:800}
.game-review-graph-card{width:100%;margin:14px auto 0;padding:13px;border:1px solid var(--border);border-radius:10px;background:var(--panel2)}
.game-review-graph-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:8px}
.game-review-graph-heading strong{font:10px "DM Mono",monospace;letter-spacing:1.1px;color:var(--text)}
.game-review-graph-heading span{color:var(--muted);font:8px "DM Mono",monospace}
.game-review-graph{min-height:80px;display:grid;place-items:center;color:var(--muted);font-size:9px;text-align:center}
.game-review-graph svg{display:block;width:100%;height:auto;overflow:visible}
.review-graph-baseline{stroke:var(--muted);stroke-width:1;stroke-dasharray:4 4;opacity:.7}
.review-graph-line{fill:none;stroke:var(--green);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.review-graph-current{fill:var(--red);stroke:var(--panel2);stroke-width:2}
.game-review-players-line{display:flex;justify-content:space-between;gap:12px;width:100%;margin:12px auto 0;color:var(--muted);font:9px "DM Mono",monospace}
.game-review-coach-card,.game-review-moves-card{border:1px solid var(--border);border-radius:12px;background:var(--panel);box-shadow:var(--shadow)}
.game-review-coach-card{padding:16px;margin-bottom:13px}
.game-review-coach-heading{display:flex;align-items:center;gap:11px}
.game-review-coach-avatar.small{width:38px;height:38px;flex-basis:38px;border-radius:10px;font-size:22px}
.game-review-coach-heading>div:last-child{display:flex;flex-direction:column;gap:4px;min-width:0}
.game-review-coach-heading strong{font-size:12px}
.game-review-coach-card>p{font-size:11px;line-height:1.65;color:var(--text);margin:13px 0}
.game-review-coach-detail{padding:11px;border:1px solid var(--border);border-radius:8px;background:var(--panel2);color:var(--muted);font-size:10px;line-height:1.65;margin:0 0 12px}
.game-review-coach-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.game-review-coach-actions .quiet-button,.game-review-next-btn{min-height:40px}
.game-review-next-btn{display:flex;align-items:center;justify-content:center;gap:9px;border:0;border-radius:8px;background:var(--green);color:#16200e;font-size:11px;font-weight:800;cursor:pointer}
.game-review-next-btn span{font-size:17px}
.game-review-moves-card{padding:13px}
.game-review-moves-card .game-review-section-head{align-items:center}
.game-review-moves-card .game-review-section-head h3{font-size:14px}
.game-review-move-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:430px;overflow:auto;padding-right:3px}
.game-review-move{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0;padding:8px;border:1px solid var(--border);border-radius:7px;background:var(--panel2);color:var(--text);font:10px "DM Mono",monospace;cursor:pointer}
.game-review-move>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.game-review-move:hover{border-color:var(--green2)}
.game-review-move.is-current{border-color:var(--green2);background:#8dbb3f16;color:var(--green)}
.review-move-grade{flex:0 0 auto;padding:3px 4px;border:1px solid var(--border);border-radius:4px;background:var(--panel);color:var(--muted);font:800 7px "DM Mono",monospace}
.review-move-grade.grade-brilliant,.review-move-grade.grade-great{color:var(--green)}
.review-move-grade.grade-blunder,.review-move-grade.grade-miss{color:var(--red)}
.review-move-grade.grade-mistake{color:#f2a14c}
.game-review-playback{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:10px}
.game-review-playback button{min-height:40px;border:1px solid var(--border);border-radius:8px;background:var(--panel);color:var(--text);font-size:14px;font-weight:800;cursor:pointer}
.game-review-playback button:hover{border-color:var(--green2);color:var(--green)}
.game-review-playback button:disabled,.game-review-next-btn:disabled{opacity:.35;cursor:not-allowed}
@media(max-width:760px){
  .game-review-dialog{width:min(100% - 24px,650px)}
  .game-review-header{min-height:66px}
  .game-review-engine-status{font-size:8px}
  .game-review-layout{grid-template-columns:1fr}
  .game-review-board{width:min(100%,520px)}
  .game-review-move-list{max-height:280px}
}
@media(max-width:460px){
  .game-review-dialog{width:calc(100% - 20px)}
  .game-review-summary-view{padding:19px 0 25px}
  .game-review-greeting{align-items:flex-start;gap:9px}
  .game-review-coach-avatar{width:40px;height:40px;flex-basis:40px;font-size:23px}
  .review-player-cards{gap:8px}
  .review-player-card{padding:12px}
  .review-player-score{font-size:26px}
  .review-engine-note{font-size:8px}
  .game-review-header h2{font-size:16px}
  .game-review-guided-view{padding:14px 0 25px}
  .game-review-graph-heading span{display:none}
}

/* AI Studio-inspired Chess Vision visual system */
:root{
  color-scheme:dark;--bg:#09090b;--panel:#171719;--panel2:#111114;--border:#2b2b31;
  --text:#f4f4f5;--muted:#a1a1aa;--green:#34d399;--green2:#10b981;--red:#fb7185;
  --accent:#f59e0b;--accent-bright:#ffad00;--square-light:#e8edcf;--square-dark:#789952;
  --shadow:0 18px 46px #0008;
}
body{background:var(--bg);color:var(--text);font-family:Inter,system-ui,sans-serif}
body.light{
  color-scheme:light;--bg:#f3f3f1;--panel:#fff;--panel2:#f5f5f4;--border:#dededb;
  --text:#18181b;--muted:#71717a;--green:#059669;--green2:#047857;--red:#e11d48;
  --accent:#d97706;--accent-bright:#f59e0b;--square-light:#edf0d8;--square-dark:#8ca96a;
  --shadow:0 14px 34px #18181b12;
}
.ambient{opacity:0!important}
.topbar{
  position:sticky;top:0;z-index:80;width:100%;height:68px;max-width:none;
  padding:0 clamp(16px,3.2vw,48px);gap:16px;background:#09090bef;
  border-bottom:1px solid #242428;backdrop-filter:blur(18px);
}
.brand{flex:0 0 auto;gap:10px;color:#f4f4f5;font-family:Cinzel,Georgia,serif;font-size:13px;letter-spacing:1.2px}
.brand-mark{
  width:36px;height:36px;border:0;border-radius:11px;
  background:linear-gradient(145deg,#ffbd31,#e98b00);color:#171717;
  box-shadow:0 7px 22px #f59e0b20;font-size:23px;
}
.brand-light{color:#fbbf24;font-weight:800}
.brand>span:last-child{display:flex;flex-direction:column;align-items:flex-start;line-height:1.15}
.brand>span:last-child::after{
  content:"PRO STOCKFISH REVIEW";margin-top:3px;color:#8d8d96;
  font:500 8px "JetBrains Mono",monospace;letter-spacing:1.05px;
}
nav.main-nav{
  display:flex;align-items:center;justify-content:center;gap:3px;max-width:calc(100% - 230px);
  margin:0 0 0 auto;padding:4px;border:1px solid #2b2b31;border-radius:13px;background:#171719;
}
nav.main-nav .nav-link{
  padding:8px 12px;border:0;border-radius:8px;background:transparent;color:#a1a1aa;
  font:700 10px Inter,system-ui,sans-serif;letter-spacing:.1px;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
nav.main-nav .nav-link:hover{color:#fafafa;background:#252529}
nav.main-nav .nav-link.nav-active{
  color:#18181b;background:var(--accent-bright);border:0;box-shadow:0 2px 8px #f59e0b30;
}
nav.main-nav .nav-link:focus-visible,button:focus-visible{outline:2px solid #fbbf24;outline-offset:3px}
.icon-button{
  flex:0 0 auto;width:34px;height:34px;border:1px solid #34343a;border-radius:10px;
  background:#171719;color:#f4f4f5;font-size:17px;
}
main{max-width:1420px;padding:0 clamp(16px,2.2vw,30px)}
.hero{padding:64px 0 52px}
.hero h1{font-family:Cinzel,Georgia,serif;letter-spacing:-2px}
.section-heading h2,.academy-card-heading h3,.game-review-section-head h3{
  font-family:Cinzel,Georgia,serif;letter-spacing:-.2px;
}
.eyebrow,.panel-label,.result-kicker,.game-review-kicker{font-family:"JetBrains Mono","DM Mono",monospace}
.panel{
  background:var(--panel);border:1px solid var(--border);border-radius:17px;box-shadow:var(--shadow);
}
.board-panel,.results-panel{padding:17px}
.panel-top{margin-bottom:14px}
.panel-label{letter-spacing:1.1px;font-weight:600}
.board-surround{column-gap:7px}
.chessboard{
  border:2px solid #29292e;border-radius:11px;background:#242429;
  box-shadow:0 0 0 1px #ffffff0c,0 18px 38px #0008;
}
.square.light,.game-review-square.light{background-color:#e8edcf;background-image:none}
.square.dark,.game-review-square.dark{background-color:#789952;background-image:none}
.square.selected{box-shadow:inset 0 0 0 3px #ffb020,inset 0 0 18px #f59e0b45}
.square.last-move:after{background:#fbbf2440;box-shadow:inset 0 0 0 1px #fbbf24a0}
.square.legal:before{background:#293b1f88}
.square.capture:before{border-color:#fbbf24}
.rank-labels,.file-labels{color:#a3a3a3}
.board-footer{color:var(--muted)}
.quiet-button,.small-button,.upload-button{
  border:1px solid #38383f;border-radius:9px;background:#202024;color:#d4d4d8;
  transition:background .18s ease,border-color .18s ease,color .18s ease;
}
.quiet-button:hover,.small-button:hover,.upload-button:hover{background:#29292f;border-color:#55555f;color:#fafafa}
.primary-button,.game-review-start-btn,.game-review-next-btn{
  background:linear-gradient(135deg,#ffb21c,#f59e0b);color:#18181b;border:0;border-radius:9px;
  box-shadow:0 5px 18px #f59e0b20;font-weight:800;
}
.primary-button:hover,.game-review-start-btn:hover,.game-review-next-btn:hover{
  background:linear-gradient(135deg,#ffc34f,#ffad00);color:#18181b;
}
input,select,textarea,.academy-input,.academy-select{
  border:1px solid #33333a;border-radius:9px;background:#111114;color:#f4f4f5;
}
input:focus,select:focus,textarea:focus,.academy-input:focus,.academy-select:focus{
  border-color:#f59e0b;outline:0;box-shadow:0 0 0 3px #f59e0b1a;
}
.eval-block,.candidate-row,.academy-progress,.challenge-card,.opening-card{background:var(--panel2);border-color:var(--border)}
.result-kicker{color:#fbbf24}
.status-pill,.engine-tag,.academy-rating-pill{background:#1e1e22;border:1px solid #33333a;color:#c4c4ca}
.engine-tag{border-radius:99px}
.brilliant-block,.game-review-coach-card,.game-review-moves-card{background:var(--panel);border-color:var(--border)}
footer{border-color:var(--border)}
footer .brand>span:last-child::after{display:none}

/* Game Review shell */
.game-review-overlay{background:var(--bg);color:var(--text)}
.game-review-dialog{width:min(1420px,calc(100% - 32px));max-width:1420px}
.game-review-header{
  position:sticky;top:0;z-index:20;min-height:68px;margin:0 calc(clamp(16px,2.2vw,30px) * -1);
  padding:10px clamp(16px,3.2vw,48px);background:#09090bee;border-bottom:1px solid #242428;
  backdrop-filter:blur(18px);
}
.game-review-mark{
  width:36px;height:36px;border:0;border-radius:11px;
  background:linear-gradient(145deg,#ffbd31,#e98b00);color:#171717;box-shadow:0 7px 22px #f59e0b20;
}
.game-review-kicker{color:#fbbf24}
.game-review-header h2{color:#f4f4f5;font-family:Cinzel,Georgia,serif;font-size:16px;letter-spacing:.3px}
.game-review-engine-status,.review-engine-note{font-family:"JetBrains Mono",monospace}
.game-review-close{border:1px solid #34343a;border-radius:10px;background:#171719;color:#f4f4f5}
.game-review-summary-view{padding:22px 0 38px}
.game-review-summary-banner{
  display:flex;align-items:center;justify-content:space-between;gap:22px;margin-bottom:18px;padding:21px 24px;
  border:1px solid #2b2b31;border-radius:16px;background:#171719;box-shadow:var(--shadow);
}
.game-review-summary-title{min-width:0}
.game-review-summary-title-line{display:flex;align-items:center;gap:12px}
.game-review-eco-badge{
  flex:0 0 auto;padding:4px 10px;border:1px solid #b77911;border-radius:99px;
  background:#f59e0b20;color:#fbbf24;font:700 10px "JetBrains Mono",monospace;
}
.game-review-summary-title h2{
  margin:0;color:#f8e7bd;font:700 clamp(18px,2vw,24px) Cinzel,Georgia,serif;letter-spacing:.1px;
}
.game-review-summary-title p{margin:7px 0 0;color:#a1a1aa;font-size:12px}
.game-review-summary-progress{
  flex:0 0 min(300px,34%);min-width:210px;padding:12px 14px;
  border:1px solid #2b2b31;border-radius:12px;background:#101012;
}
.game-review-summary-progress-line{
  display:flex;align-items:center;justify-content:space-between;gap:10px;color:#d4d4d8;font-size:11px;
}
.game-review-summary-progress-line>span{display:flex;align-items:center;gap:8px}
.game-review-progress-dot{
  width:7px;height:7px;border-radius:50%;background:#f59e0b;box-shadow:0 0 0 4px #f59e0b1a;
  animation:review-pulse 1.5s infinite;
}
.game-review-summary-progress-line strong{color:#fbbf24;font:700 11px "JetBrains Mono",monospace}
.game-review-summary-progress-track{height:6px;margin-top:10px;overflow:hidden;border-radius:99px;background:#303036}
.game-review-summary-progress-track span{
  display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#f59e0b,#34d399);transition:width .3s ease;
}
@keyframes review-pulse{50%{opacity:.45;box-shadow:0 0 0 6px #f59e0b0c}}
.game-review-summary-grid{
  display:grid;grid-template-columns:minmax(0,1.12fr) minmax(380px,.88fr);gap:18px;align-items:start;
}
.game-review-summary-left,.game-review-summary-right{display:flex;flex-direction:column;gap:14px;min-width:0}
.game-review-summary-board-card,.game-review-summary-card{
  min-width:0;padding:15px;border:1px solid #2b2b31;border-radius:15px;background:#171719;box-shadow:var(--shadow);
}
.game-review-summary-board-heading,.game-review-summary-card-heading{
  display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;
}
.game-review-summary-panel-label{color:#a1a1aa;font:700 10px "JetBrains Mono",monospace;letter-spacing:1px}
.game-review-summary-board-card .game-review-board{width:min(100%,650px);margin:0 auto}
.game-review-summary-board-card .game-review-board-caption{width:min(100%,650px);margin-bottom:0}
.game-review-board{
  border:2px solid #303036;border-radius:11px;background:#232329;
  box-shadow:0 0 0 1px #ffffff0b,0 18px 38px #0008;
}
.game-review-square.light{background:#e8edcf;background-image:none}
.game-review-square.dark{background:#789952;background-image:none}
.game-review-board-caption{color:#a1a1aa;font:10px "JetBrains Mono",monospace}
#gameReviewBoardEval,#gameReviewSummaryBoardEval{color:#fbbf24;font-weight:800}
.review-player-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
.review-player-card{padding:14px;border:1px solid #2b2b31;border-radius:12px;background:#171719;box-shadow:none}
.review-player-top strong{color:#f4f4f5;font-size:12px}
.review-player-score{color:#34d399;font:800 26px "JetBrains Mono",monospace}
.review-player-caption{font:9px "JetBrains Mono",monospace}
.review-player-card small{font-size:10px}
.game-review-summary-actions{margin:0}
.game-review-start-btn{
  display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:44px;padding:11px 16px;font-size:11px;
}
.game-review-summary-card-heading{margin-bottom:11px}
.review-category-wrap{overflow:visible;border:0;border-radius:0;background:transparent}
.review-category-table{display:block;min-width:0;border-collapse:separate;border-spacing:0}
.review-category-table thead{display:block;margin-bottom:8px}
.review-category-table thead tr{display:grid;grid-template-columns:minmax(0,1fr) 30px 30px;align-items:center}
.review-category-table thead th{padding:3px 7px;background:transparent;color:#85858e;font:700 9px "JetBrains Mono",monospace}
.review-category-table tbody{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.review-category-table tbody tr{
  display:grid;grid-template-columns:minmax(0,1fr) 30px 30px;align-items:center;min-width:0;overflow:hidden;
  border:1px solid #2b2b31;border-radius:9px;background:#111114;
}
.review-category-table th,.review-category-table td{min-width:0;padding:10px 7px;border:0;font-size:10px}
.review-category-table tbody th{font-size:10px;color:#d4d4d8}
.review-category-table td{color:#f4f4f5;font:700 10px "JetBrains Mono",monospace}
.review-category-label{gap:7px;white-space:nowrap}
.review-category-label:before{width:7px;height:7px;flex:0 0 7px}
.game-review-summary-moves-card .game-review-move-list{max-height:430px;overflow:auto;padding-right:3px}
.game-review-summary-moves-card .game-review-move{
  min-height:35px;background:#111114;border-color:#2b2b31;color:#e4e4e7;
}
.game-review-summary-moves-card .game-review-move.is-current{background:#f59e0b18;border-color:#b77911}
.game-review-progress{
  padding:12px 14px;border:1px solid #2b2b31;border-radius:10px;background:#111114;color:#a1a1aa;font-size:10px;line-height:1.6;
}
.game-review-disclaimer{margin:0;color:#777780;font-size:9px;line-height:1.65}
.game-review-guided-view{padding:18px 0 36px}
.game-review-guided-top{padding:0 0 12px;border-bottom:1px solid var(--border)}
.game-review-board-column,.game-review-coach-card,.game-review-moves-card{
  border-color:#2b2b31;background:#171719;box-shadow:var(--shadow);
}
.game-review-coach-avatar{border-color:#3b3b42;background:#202024;color:#fbbf24}
.game-review-coach-detail{background:#111114;border-color:#303036}
.game-review-move{border-color:#2b2b31;background:#111114}
.game-review-move.is-current{border-color:#b77911;background:#f59e0b18}
.game-review-playback button{
  min-width:40px;border:1px solid #33333a;border-radius:9px;background:#202024;color:#e4e4e7;
}
.game-review-playback button:hover{border-color:#b77911;background:#29292f}
.game-review-engine-status{color:#a1a1aa}
.game-review-guided-top .game-review-back-btn{background:#171719;border-color:#33333a}
.game-review-overlay .game-review-summary-view,.game-review-overlay .game-review-guided-view{color:var(--text)}
.chesscom-game-row,.chesscom-library-card,.chesscom-form-card,.chesscom-insights-card{background:var(--panel);border-color:var(--border)}
.chesscom-game-row:hover{background:#202024;border-color:#55555f}
.academy-card,.academy-progress,.opening-card,.challenge-card{background:var(--panel);border-color:var(--border)}
.academy-feedback{border-color:var(--border);background:var(--panel2)}
.academy-note,.academy-disclaimer{color:var(--muted)}
@media(max-width:980px){
  .game-review-summary-grid{grid-template-columns:minmax(0,1fr) minmax(320px,.9fr)}
}
@media(max-width:760px){
  .topbar{height:auto;min-height:68px;flex-wrap:wrap;padding:10px 14px}
  nav.main-nav{order:3;width:100%;max-width:100%;margin:0;justify-content:flex-start;overflow-x:auto}
  nav.main-nav .nav-link{font-size:10px;padding:8px 10px}
  .game-review-dialog{width:calc(100% - 24px)}
  .game-review-header{margin:0 -12px;padding:10px 14px}
  .game-review-summary-banner{align-items:stretch;flex-direction:column;padding:17px}
  .game-review-summary-progress{flex-basis:auto;width:100%}
  .game-review-summary-grid{grid-template-columns:1fr}
}
@media(max-width:520px){
  .brand{font-size:11px;letter-spacing:.8px}
  .brand-mark{width:32px;height:32px}
  .icon-button{width:32px;height:32px}
  .game-review-summary-view{padding-top:14px}
  .game-review-summary-title-line{align-items:flex-start;flex-direction:column;gap:7px}
  .game-review-summary-title h2{font-size:19px}
  .game-review-summary-board-card{padding:10px}
  .review-player-cards{grid-template-columns:1fr 1fr}
  .review-player-card{padding:11px}
  .review-category-table tbody{grid-template-columns:1fr}
  .game-review-summary-card{padding:12px}
}


/* Preserve the original light-mode option with the new visual system. */
body.light .topbar,
body.light .game-review-header{
  background:#f8f8f6;
  border-color:#dededb;
}
body.light .brand{color:#18181b}
body.light .brand-light{color:#b77911}
body.light .brand>span:last-child::after{color:#71717a}
body.light nav.main-nav,
body.light .icon-button{
  background:#fff;
  border-color:#dededb;
}
body.light nav.main-nav .nav-link{color:#71717a}
body.light nav.main-nav .nav-link:hover{background:#f1f1ef;color:#18181b}
body.light nav.main-nav .nav-link.nav-active{background:#f59e0b;color:#18181b}
body.light .icon-button{color:#18181b}
body.light .game-review-header h2{color:#18181b}
body.light .game-review-close,
body.light .game-review-guided-top .game-review-back-btn{
  background:#fff;
  border-color:#dededb;
  color:#27272a;
}
body.light .game-review-summary-banner,
body.light .game-review-summary-board-card,
body.light .game-review-summary-card,
body.light .review-player-card,
body.light .game-review-board-column,
body.light .game-review-coach-card,
body.light .game-review-moves-card{
  background:#fff;
  border-color:#dededb;
  box-shadow:0 12px 28px #18181b0a;
}
body.light .game-review-summary-title h2{color:#4b3410}
body.light .game-review-summary-title p,
body.light .game-review-summary-panel-label,
body.light .review-engine-note,
body.light .game-review-engine-status{color:#71717a}
body.light .game-review-summary-progress{background:#f5f5f4;border-color:#dededb}
body.light .game-review-summary-progress-line{color:#3f3f46}
body.light .game-review-summary-progress-track{background:#e4e4e7}
body.light .review-player-top strong,
body.light .game-review-coach-heading strong,
body.light .game-review-move{color:#27272a}
body.light .review-player-caption,
body.light .review-player-card small{color:#71717a}
body.light .review-category-table tbody tr,
body.light .game-review-summary-moves-card .game-review-move,
body.light .game-review-coach-detail,
body.light .game-review-progress{
  background:#f7f7f5;
  border-color:#dededb;
}
body.light .review-category-table tbody th,
body.light .review-category-table td{color:#27272a}
body.light .review-category-table thead th{color:#71717a}
body.light .game-review-summary-moves-card .game-review-move.is-current,
body.light .game-review-move.is-current{
  background:#fff4dc;
  border-color:#d9a441;
}
body.light .game-review-disclaimer{color:#71717a}
body.light .game-review-playback button{
  background:#fff;
  border-color:#dededb;
  color:#27272a;
}
body.light input,
body.light select,
body.light textarea,
body.light .academy-input,
body.light .academy-select{
  background:#fff;
  border-color:#d4d4d8;
  color:#18181b;
}


/* Classification symbols: visible and consistent in the summary and move list. */
.review-category-label{display:inline-flex;align-items:center;gap:8px}
.review-category-label:before{display:none!important}
.review-category-icon{
  display:inline-grid;place-items:center;flex:0 0 18px;width:18px;height:18px;
  border:1px solid #3a3a42;border-radius:5px;background:#222228;
  color:#d4d4d8;font:800 10px "JetBrains Mono",monospace;
}
.category-brilliant .review-category-icon{color:#fbbf24;border-color:#9a6a1a;background:#f59e0b16}
.category-great .review-category-icon{color:#fbbf24;border-color:#9a6a1a;background:#f59e0b16}
.category-book .review-category-icon{color:#93c5fd;border-color:#365b87;background:#3b82f615}
.category-best .review-category-icon,.category-excellent .review-category-icon{color:#34d399;border-color:#24634d;background:#10b98114}
.category-good .review-category-icon{color:#a3e635;border-color:#536c26;background:#84cc1614}
.category-inaccuracy .review-category-icon{color:#facc15;border-color:#8a6c1e;background:#eab30814}
.category-mistake .review-category-icon{color:#fb923c;border-color:#8e4e24;background:#f9731614}
.category-blunder .review-category-icon,.category-miss .review-category-icon{color:#fb7185;border-color:#8e3849;background:#f43f5e14}
.category-mate .review-category-icon{color:#a78bfa;border-color:#5b4a89;background:#8b5cf614}
.review-move-grade{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-width:0;
  padding:3px 5px;
  font-size:7px;
  letter-spacing:.1px;
}
.review-move-grade-symbol{font-size:10px;line-height:1}
.review-move-grade-label{white-space:nowrap}
.review-move-grade.grade-great{color:#fbbf24;border-color:#9a6a1a;background:#f59e0b12}
.review-move-grade.grade-book{color:#93c5fd;border-color:#365b87;background:#3b82f615}
.review-move-grade.grade-brilliant{color:#fbbf24;border-color:#9a6a1a;background:#f59e0b12}
.review-move-grade.grade-best,.review-move-grade.grade-excellent{color:#34d399}
.review-move-grade.grade-good{color:#a3e635}
.review-move-grade.grade-inaccuracy{color:#facc15}
.review-move-grade.grade-mistake{color:#fb923c}
.review-move-grade.grade-blunder,.review-move-grade.grade-miss{color:#fb7185}
.review-move-grade.grade-mate{color:#a78bfa}
body.light .review-category-icon{background:#f4f4f5;border-color:#dededb;color:#3f3f46}
body.light .review-move-grade{background:#fff}
body.light .review-move-grade.grade-great,body.light .review-move-grade.grade-book{background:#fffbeb}


/* New product navigation, Home, Dashboard and Learn views */
.brand{cursor:pointer}
.main-nav .nav-dropdown{position:relative;display:flex;align-items:center}
.nav-learn-toggle span{margin-left:4px;font-size:12px;color:inherit}
.nav-dropdown-menu{
  position:absolute;top:calc(100% + 13px);left:0;z-index:120;display:grid;gap:4px;
  width:254px;padding:11px;border:1px solid #33333b;border-radius:14px;background:#171719;
  box-shadow:0 22px 55px #000b;backdrop-filter:blur(18px);
}
.nav-dropdown-menu[hidden]{display:none}
.nav-dropdown-label{padding:7px 9px 8px;color:#888891;font:700 8px "JetBrains Mono",monospace;letter-spacing:1.1px}
.nav-dropdown-menu button{
  display:flex;align-items:center;gap:12px;width:100%;padding:10px;border:0;border-radius:8px;
  background:transparent;color:#e4e4e7;text-align:left;font:600 11px Inter,system-ui,sans-serif;cursor:pointer;
}
.nav-dropdown-menu button span{width:20px;color:#fbbf24;font:700 9px "JetBrains Mono",monospace}
.nav-dropdown-menu button:hover,.nav-dropdown-menu button.nav-active{background:#29292f;color:#fff}
.nav-dropdown-menu button.nav-active{box-shadow:inset 2px 0 #f59e0b}
.nav-dropdown-divider{height:1px;margin:4px 2px;background:#303036}
body.light .nav-dropdown-menu{background:#fff;border-color:#dededb;box-shadow:0 20px 45px #18181b20}
body.light .nav-dropdown-menu button{color:#27272a}
body.light .nav-dropdown-menu button:hover{background:#f4f4f5}
.home-page,.dashboard-page{padding:44px 0 54px}
.home-hero{
  display:grid;grid-template-columns:minmax(0,1.04fr) minmax(320px,.96fr);gap:clamp(28px,5vw,72px);
  align-items:center;min-height:420px;padding:30px 0 54px;
}
.home-hero-copy{max-width:660px}
.home-hero h1,.dashboard-heading h1{
  margin:22px 0 16px;color:#f4f4f5;font:800 clamp(42px,6vw,76px)/1.04 Cinzel,Georgia,serif;
  letter-spacing:-1.8px;
}
.home-hero h1 em,.dashboard-heading h1 em{color:#fbbf24;font-weight:700}
.home-hero-copy>p{max-width:520px;color:#a1a1aa;font-size:15px;line-height:1.85}
.home-actions{display:flex;align-items:center;gap:10px;margin-top:28px}
.home-actions .primary-button,.home-actions .quiet-button{min-height:44px;padding:13px 18px}
.home-actions .primary-button span{margin-left:13px}
.home-trust-line{display:flex;flex-wrap:wrap;align-items:center;gap:11px;margin-top:28px;color:#777780;font:700 8px "JetBrains Mono",monospace;letter-spacing:.8px}
.home-trust-line i{width:4px;height:4px;border-radius:50%;background:#b77911}
.home-visual-card{
  padding:15px;border:1px solid #34343a;border-radius:19px;background:linear-gradient(145deg,#19191d,#101013);
  box-shadow:0 28px 70px #0008;transform:rotate(1deg);
}
.home-visual-top,.home-visual-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#85858e;font:700 8px "JetBrains Mono",monospace;letter-spacing:.8px}
.home-live{display:flex;align-items:center;gap:7px;color:#a7d5ac}
.home-live i{width:6px;height:6px;border-radius:50%;background:#34d399;box-shadow:0 0 10px #34d39980}
.home-board-preview{
  display:grid;grid-template-columns:repeat(8,1fr);margin:15px auto;max-width:440px;aspect-ratio:1;
  overflow:hidden;border:5px solid #24242a;border-radius:9px;box-shadow:0 18px 40px #0009;
}
.home-board-preview span{
  display:grid;place-items:center;aspect-ratio:1;background:#e8edcf;color:#f8f8f2;
  font:clamp(18px,3vw,38px)/1 "Segoe UI Symbol",serif;text-shadow:0 2px 4px #1119;
}
.home-board-preview span:nth-child(16n+1),.home-board-preview span:nth-child(16n+3),
.home-board-preview span:nth-child(16n+5),.home-board-preview span:nth-child(16n+7),
.home-board-preview span:nth-child(16n+10),.home-board-preview span:nth-child(16n+12),
.home-board-preview span:nth-child(16n+14),.home-board-preview span:nth-child(16n+16){background:#789952}
.home-board-preview span:nth-child(-n+16){color:#1d2320}
.home-visual-footer{padding:2px 3px 1px;color:#a0a0a7;font-size:7px}
.home-section-heading{display:flex;justify-content:space-between;align-items:end;gap:16px;margin:22px 0 15px}
.home-section-heading h2{margin:5px 0 0;font:700 23px Cinzel,Georgia,serif;color:#f4f4f5}
.home-profile-status{color:#92929b;font:8px "JetBrains Mono",monospace;letter-spacing:.6px;text-align:right}
.home-feature-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.home-feature-card{
  display:flex;flex-direction:column;align-items:flex-start;min-height:225px;padding:18px;
  border:1px solid #2d2d33;border-radius:14px;background:#171719;color:#f4f4f5;text-align:left;cursor:pointer;
  transition:transform .18s ease,border-color .18s ease,background .18s ease;
}
.home-feature-card:hover{transform:translateY(-3px);border-color:#9a6a1a;background:#1e1e22}
.home-feature-icon{display:grid;place-items:center;width:37px;height:37px;margin-bottom:20px;border:1px solid #57401c;border-radius:10px;background:#f59e0b16;color:#fbbf24;font-size:19px}
.home-feature-kicker{color:#909099;font:700 8px "JetBrains Mono",monospace;letter-spacing:.8px}
.home-feature-card strong{margin-top:8px;font:700 15px Cinzel,Georgia,serif}
.home-feature-card p{margin:8px 0 16px;color:#a1a1aa;font-size:10px;line-height:1.7}
.home-feature-link{margin-top:auto;color:#fbbf24;font-size:10px;font-weight:700}
.home-bottom-strip{
  display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:16px;padding:18px 20px;
  border:1px solid #3c321f;border-radius:13px;background:linear-gradient(110deg,#1c1a17,#171719);
}
.home-bottom-strip>div{display:grid;gap:5px}
.home-bottom-strip strong{color:#f5e3bc;font:700 14px Cinzel,Georgia,serif}
.home-bottom-strip p{margin:0;color:#a1a1aa;font-size:10px;line-height:1.6}
.home-bottom-strip .result-kicker{font-size:8px;color:#fbbf24}
.dashboard-heading{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:22px}
.dashboard-heading h1{margin:12px 0 8px;font-size:clamp(34px,4.2vw,52px)}
.dashboard-heading p{margin:0;color:#a1a1aa;font-size:12px;line-height:1.6}
.dashboard-actions{display:flex;gap:8px;flex:0 0 auto}
.dashboard-connect-card{
  display:flex;align-items:center;gap:15px;margin-bottom:15px;padding:15px 18px;
  border:1px solid #3c321f;border-radius:13px;background:linear-gradient(110deg,#201c14,#171719);
}
.dashboard-connect-card.is-connected{border-color:#28533e;background:linear-gradient(110deg,#142119,#171719)}
.dashboard-connect-mark{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border-radius:11px;background:#f59e0b18;color:#fbbf24;font-size:22px}
.dashboard-connect-card>div:nth-child(2){flex:1;min-width:0}
.dashboard-connect-card strong{color:#f5e3bc;font-size:12px}
.dashboard-connect-card p{margin:4px 0 0;color:#a1a1aa;font-size:10px;line-height:1.6}
.dashboard-connect-card .quiet-button{flex:0 0 auto}
.dashboard-metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-bottom:15px}
.dashboard-metric{min-width:0;padding:17px;border:1px solid #2b2b31;border-radius:13px;background:#171719;box-shadow:0 12px 28px #0003}
.dashboard-metric>span{display:block;color:#93939d;font:700 8px "JetBrains Mono",monospace;letter-spacing:.8px}
.dashboard-metric strong{display:block;margin:12px 0 5px;color:#fbbf24;font:800 clamp(21px,3vw,32px) "JetBrains Mono",monospace}
.dashboard-metric small{color:#8e8e97;font-size:9px}
.dashboard-main-grid,.dashboard-insight-grid,.dashboard-bottom-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}
.dashboard-card{min-width:0;padding:17px;border:1px solid #2b2b31;border-radius:14px;background:#171719;box-shadow:0 12px 28px #0003}
.dashboard-card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}
.dashboard-card-heading h2{margin:4px 0 0;color:#f0e3c9;font:700 15px Cinzel,Georgia,serif}
.dashboard-card-meta{color:#8f8f98;font:8px "JetBrains Mono",monospace;white-space:nowrap}
.dashboard-section-note{margin:-2px 0 13px;color:#85858e;font-size:9px;line-height:1.6}
.dashboard-week-chart{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));align-items:end;gap:10px;min-height:146px;padding:5px 2px 0}
.dashboard-day-column{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;height:136px}
.dashboard-day-count{color:#c4c4ca;font:700 9px "JetBrains Mono",monospace}
.dashboard-day-rail{display:flex;align-items:end;justify-content:center;width:min(100%,26px);height:93px;overflow:hidden;border-radius:6px;background:#25252b}
.dashboard-day-fill{display:block;width:100%;min-height:2px;border-radius:5px 5px 0 0;background:linear-gradient(180deg,#fbbf24,#b77911);transition:height .25s}
.dashboard-day-label{color:#8f8f98;font:8px "JetBrains Mono",monospace}
.dashboard-chart-legend{display:flex;gap:15px;margin-top:10px;color:#96969f;font-size:8px}
.dashboard-chart-legend span{display:flex;align-items:center;gap:6px}
.dashboard-chart-legend i{width:7px;height:7px;border-radius:2px;background:#f59e0b}
.dashboard-chart-legend .legend-win{background:#34d399}
.dashboard-time-controls{display:grid;gap:13px}
.dashboard-format-row{display:grid;gap:6px}
.dashboard-format-heading{display:flex;justify-content:space-between;gap:10px;color:#e4e4e7;font-size:10px}
.dashboard-format-heading span,.dashboard-format-row small{color:#8f8f98;font:8px "JetBrains Mono",monospace}
.dashboard-format-track{height:6px;overflow:hidden;border-radius:9px;background:#303036}
.dashboard-format-track span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#34d399,#fbbf24)}
.dashboard-weaknesses{display:grid;gap:9px}
.dashboard-weakness{display:grid;grid-template-columns:auto 1fr;column-gap:10px;row-gap:4px;padding:11px;border:1px solid #34343b;border-radius:10px;background:#111114}
.dashboard-weakness-count{grid-row:span 3;display:grid;place-items:center;min-width:43px;padding:3px 7px;border:1px solid #8a6726;border-radius:7px;background:#f59e0b16;color:#fbbf24;font:700 10px "JetBrains Mono",monospace}
.dashboard-weakness strong{color:#e4e4e7;font-size:10px}
.dashboard-weakness p{margin:0;color:#96969f;font-size:9px;line-height:1.6}
.dashboard-weakness small{color:#fbbf24;font-size:8px;font-weight:700}
.dashboard-engine-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.dashboard-engine-counts>div{display:grid;gap:5px;padding:10px 6px;border:1px solid #34343b;border-radius:8px;background:#111114;text-align:center}
.dashboard-engine-counts strong{color:#fbbf24;font:800 18px "JetBrains Mono",monospace}
.dashboard-engine-counts small{color:#93939d;font-size:7px}
.dashboard-phase-note{color:#d4d4d8;font-size:9px}
.dashboard-reviewed-game{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-top:1px solid #303036}
.dashboard-reviewed-game strong{color:#d4d4d8;font-size:9px}
.dashboard-reviewed-game small{color:#8f8f98;font:8px "JetBrains Mono",monospace;text-align:right}
.dashboard-plan{display:grid;gap:9px}
.dashboard-plan-item{padding:11px;border:1px solid #34343b;border-radius:10px;background:#111114}
.dashboard-plan-priority{display:block;margin-bottom:6px;color:#fbbf24;font:700 8px "JetBrains Mono",monospace;letter-spacing:.7px}
.dashboard-plan-item strong{color:#f4f4f5;font-size:10px}
.dashboard-plan-item p{margin:5px 0 0;color:#9a9aa3;font-size:9px;line-height:1.6}
.dashboard-recent-games{display:grid}
.dashboard-recent-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:9px;padding:10px 0;border-bottom:1px solid #303036}
.dashboard-recent-row>div{display:grid;gap:3px;min-width:0}
.dashboard-recent-row strong{overflow:hidden;color:#e4e4e7;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.dashboard-recent-row small{color:#8f8f98;font-size:8px}
.dashboard-result{padding:4px 6px;border-radius:5px;font:700 7px "JetBrains Mono",monospace}
.dashboard-result.is-win{background:#10b9811a;color:#34d399}
.dashboard-result.is-draw{background:#fbbf2415;color:#fbbf24}
.dashboard-result.is-loss{background:#fb71851a;color:#fb7185}
.text-action{padding:5px;border:0;background:transparent;color:#fbbf24;font-size:9px;font-weight:700;cursor:pointer;white-space:nowrap}
.dashboard-week-chart>p,.dashboard-time-controls>p,.dashboard-weaknesses>p,.dashboard-engine-insights>p,.dashboard-plan>p,.dashboard-recent-games>p{margin:8px 0;color:#8f8f98;font-size:10px;line-height:1.65}
.academy-global-feedback{margin:13px 0 10px}
.academy-active-challenge{margin:10px 0 15px}
.endgame-tactics-card{margin-top:8px}
.endgame-topic-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:17px 0}
.endgame-topic{padding:12px;border:1px solid #34343b;border-radius:10px;background:#111114}
.endgame-topic span{display:block;margin-bottom:7px;color:#fbbf24;font:700 8px "JetBrains Mono",monospace}
.endgame-topic strong{color:#e4e4e7;font-size:10px}
.endgame-topic p{margin:6px 0 0;color:#96969f;font-size:9px;line-height:1.6}
body.light .home-hero h1,body.light .dashboard-heading h1,body.light .home-section-heading h2{color:#18181b}
body.light .home-hero-copy>p,body.light .home-trust-line,body.light .home-profile-status{color:#71717a}
body.light .home-visual-card,body.light .home-feature-card,body.light .dashboard-metric,body.light .dashboard-card{background:#fff;border-color:#dededb;box-shadow:0 12px 28px #18181b0b;color:#18181b}
body.light .home-visual-top,body.light .home-visual-footer,body.light .home-feature-card p{color:#71717a}
body.light .home-section-heading h2,body.light .home-feature-card strong,body.light .dashboard-card-heading h2{color:#27272a}
body.light .home-feature-card:hover{background:#fffcf5;border-color:#d6a23b}
body.light .home-bottom-strip,body.light .dashboard-connect-card{background:#fffaf0;border-color:#ead7ae}
body.light .home-bottom-strip strong,body.light .dashboard-connect-card strong{color:#5b4215}
body.light .home-bottom-strip p,body.light .dashboard-connect-card p{color:#71717a}
body.light .dashboard-metric>span,body.light .dashboard-metric small,body.light .dashboard-card-meta,body.light .dashboard-section-note{color:#71717a}
body.light .dashboard-card-heading h2{color:#4b3410}
body.light .dashboard-weakness,body.light .dashboard-plan-item,body.light .dashboard-engine-counts>div,body.light .dashboard-format-track,body.light .dashboard-day-rail,body.light .endgame-topic{background:#f5f5f4;border-color:#dededb}
body.light .dashboard-weakness strong,body.light .dashboard-plan-item strong,body.light .dashboard-recent-row strong,body.light .dashboard-format-heading,body.light .dashboard-engine-counts strong,body.light .endgame-topic strong{color:#27272a}
body.light .dashboard-weakness p,body.light .dashboard-plan-item p,body.light .dashboard-recent-row small,body.light .dashboard-format-heading span,body.light .dashboard-format-row small,body.light .endgame-topic p{color:#71717a}
body.light .dashboard-reviewed-game{border-color:#dededb}
@media(max-width:1050px){
 .home-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .dashboard-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:820px){
 .home-hero{grid-template-columns:1fr;min-height:0}
 .home-visual-card{max-width:480px;width:100%;margin:0 auto;transform:none}
 .dashboard-heading{align-items:flex-start;flex-direction:column}
 .dashboard-main-grid,.dashboard-insight-grid,.dashboard-bottom-grid{grid-template-columns:1fr}
}
@media(max-width:760px){
 .main-nav .nav-dropdown{position:static}
 .nav-dropdown-menu{position:absolute;top:calc(100% - 4px);left:12px;right:12px;width:auto;max-width:340px}
}
@media(max-width:540px){
 .home-page,.dashboard-page{padding-top:28px}
 .home-hero{padding-top:15px}
 .home-hero h1{font-size:42px}
 .home-feature-grid{grid-template-columns:1fr}
 .home-feature-card{min-height:180px}
 .home-section-heading{align-items:flex-start;flex-direction:column}
 .home-profile-status{text-align:left}
 .home-bottom-strip{align-items:flex-start;flex-direction:column}
 .dashboard-actions{width:100%}
 .dashboard-actions button{flex:1}
 .dashboard-connect-card{align-items:flex-start;flex-wrap:wrap}
 .dashboard-connect-card>div:nth-child(2){min-width:calc(100% - 60px)}
 .dashboard-connect-card>button{margin-left:55px}
 .dashboard-metric-grid{gap:8px}
 .dashboard-metric{padding:12px}
 .dashboard-engine-counts{grid-template-columns:repeat(2,minmax(0,1fr))}
 .endgame-topic-grid{grid-template-columns:1fr}
}

.dashboard-day-fill{position:relative}
.dashboard-day-win-fill{position:absolute;left:0;bottom:0;display:block;width:100%;background:#34d399;border-radius:0 0 5px 5px}
body.light .dashboard-day-win-fill{background:#059669}

.dashboard-mistake-heading{margin:13px 0 4px;color:#fbbf24;font:700 8px "JetBrains Mono",monospace;letter-spacing:.9px}
.dashboard-mistake-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:9px 0;border-top:1px solid #303036}
.dashboard-mistake-row strong{color:#e4e4e7;font-size:9px}
.dashboard-mistake-row small{grid-column:1;color:#8f8f98;font-size:8px}
.dashboard-mistake-row>span{grid-column:2;grid-row:1/3;align-self:center;color:#fb923c;font:700 9px "JetBrains Mono",monospace}
body.light .dashboard-mistake-row{border-color:#dededb}
body.light .dashboard-mistake-row strong{color:#27272a}
body.light .dashboard-mistake-row small{color:#71717a}


/* Restore the original playable chessboard appearance.
   These rules intentionally override the AI Studio page palette only for boards. */
.chessboard{
  border:3px solid #1a1c20;
  border-radius:3px;
  background:#202226;
  box-shadow:0 0 0 1px #73757a50,0 12px 30px #0008,inset 0 0 0 1px #ffffff16;
}
.square.light,.game-review-square.light{
  background-color:#c6bab3;
  background-image:
    repeating-linear-gradient(0deg,#ffffff06 0 1px,transparent 1px 4px),
    repeating-linear-gradient(90deg,#00000004 0 1px,transparent 1px 5px),
    linear-gradient(145deg,#d1c6bf 0%,#b8aca5 100%);
}
.square.dark,.game-review-square.dark{
  background-color:#3a3c41;
  background-image:
    repeating-linear-gradient(135deg,#ffffff07 0 1px,transparent 1px 5px),
    repeating-linear-gradient(0deg,#00000008 0 1px,transparent 1px 4px),
    linear-gradient(145deg,#45474d 0%,#303237 100%);
}
.square.selected{
  z-index:2;
  box-shadow:inset 0 0 0 3px #a2ffc1,inset 0 0 18px #57efa33d,0 0 12px #6effae35;
}
.square.last-move:after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(140deg,#8cfcad46,#47d98520);
  box-shadow:inset 0 0 0 1px #83f4a75c;
  pointer-events:none;
  z-index:1;
}
.square.legal:before{
  content:"";
  position:absolute;
  z-index:1;
  width:24%;
  height:24%;
  border-radius:50%;
  background:#172c2290;
  box-shadow:0 1px 3px #0004;
}
.square.capture:before{
  content:"";
  position:absolute;
  z-index:1;
  inset:4px;
  border:3px solid #9cf8b6b8;
  border-radius:50%;
  box-shadow:inset 0 0 12px #0003;
}
.square:focus-visible{
  outline:3px solid #9bffc0;
  outline-offset:-3px;
  z-index:4;
}
.board-surround{column-gap:5px}
.rank-labels,.file-labels{color:#a9bdd6}
.game-review-board{
  border:3px solid #1a1c20;
  border-radius:3px;
  background:#202226;
  box-shadow:0 0 0 1px #73757a50,0 12px 30px #0008,inset 0 0 0 1px #ffffff16;
}


/* Analyzer board: restore the pre-AI-Studio working layout, not just its squares. */
body[data-page="analyzer"] main{
  width:100%;
  max-width:1180px;
  margin:0 auto;
  padding:0 28px;
  font-family:Manrope,system-ui,sans-serif;
}
body[data-page="analyzer"] .analyzer-grid{
  display:grid;
  grid-template-columns:minmax(300px,1fr) minmax(300px,.86fr);
  gap:16px;
}
body[data-page="analyzer"] .analyzer-grid>.panel{
  border-radius:16px;
  box-shadow:0 20px 70px #0005;
}
body[data-page="analyzer"] .board-panel,
body[data-page="analyzer"] .results-panel{
  padding:18px;
}
body[data-page="analyzer"] .panel-top{margin-bottom:17px}
body[data-page="analyzer"] .panel-label{
  font:10px "DM Mono",monospace;
  letter-spacing:1.5px;
  color:var(--muted);
}
body[data-page="analyzer"] .board-surround{column-gap:5px}
body[data-page="analyzer"] .rank-labels{
  color:#a9bdd6;
  font-size:11px;
}
body[data-page="analyzer"] .file-labels{
  color:#a9bdd6;
  font-size:12px;
}
body[data-page="analyzer"] .piece-image{width:91%;height:91%}
body[data-page="analyzer"] .board-footer{color:var(--muted)}
body[data-page="analyzer"] .evaluation-end-score.is-ahead{color:#c4f36a}
body.light[data-page="analyzer"] .evaluation-end-score.is-ahead{color:#416b0b}

/* Keep the decorative Home-page board consistent with the playable board. */
.home-board-preview span{
  background-color:#c6bab3;
  background-image:
    repeating-linear-gradient(0deg,#ffffff06 0 1px,transparent 1px 4px),
    repeating-linear-gradient(90deg,#00000004 0 1px,transparent 1px 5px),
    linear-gradient(145deg,#d1c6bf 0%,#b8aca5 100%);
}
.home-board-preview span:nth-child(16n+1),.home-board-preview span:nth-child(16n+3),
.home-board-preview span:nth-child(16n+5),.home-board-preview span:nth-child(16n+7),
.home-board-preview span:nth-child(16n+10),.home-board-preview span:nth-child(16n+12),
.home-board-preview span:nth-child(16n+14),.home-board-preview span:nth-child(16n+16){
  background-color:#3a3c41;
  background-image:
    repeating-linear-gradient(135deg,#ffffff07 0 1px,transparent 1px 5px),
    repeating-linear-gradient(0deg,#00000008 0 1px,transparent 1px 4px),
    linear-gradient(145deg,#45474d 0%,#303237 100%);
}
@media(max-width:820px){
  body[data-page="analyzer"] .analyzer-grid{grid-template-columns:1fr}
  body[data-page="analyzer"] main{padding:0 18px}
}
@media(max-width:540px){
  body[data-page="analyzer"] .board-panel,
  body[data-page="analyzer"] .results-panel{padding:12px}
  body[data-page="analyzer"] .rank-labels{font-size:10px}
  body[data-page="analyzer"] .file-labels{font-size:11px}
  body[data-page="analyzer"] .piece-image{width:92%;height:92%}
}


/* Brilliant moves are rendered from completed Stockfish classifications. */
.game-review-brilliant-moves{display:grid;gap:7px;min-width:0}
.game-review-brilliant-empty{margin:0;padding:12px;border:1px dashed #34343b;border-radius:9px;background:#111114;color:#92929c;font-size:10px;line-height:1.6}
.game-review-brilliant-move{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-width:0;padding:10px 11px;border:1px solid #33333a;border-radius:9px;background:#111114;color:#e4e4e7;text-align:left;cursor:pointer}
.game-review-brilliant-move:hover{border-color:#b77911;background:#f59e0b12}
.game-review-brilliant-move-main{display:flex;flex-direction:column;gap:4px;min-width:0}
.game-review-brilliant-move-main strong{font:700 11px "JetBrains Mono",monospace;color:#f4f4f5}
.game-review-brilliant-move-main small{overflow:hidden;color:#92929c;font-size:9px;line-height:1.45;text-overflow:ellipsis}
.game-review-brilliant-move-badge{flex:0 0 auto;padding:5px 7px;border:1px solid #247d60;border-radius:6px;background:#10b98118;color:#34d399;font:800 8px "JetBrains Mono",monospace;letter-spacing:.5px}
@media(max-width:620px){.game-review-brilliant-move{align-items:flex-start;gap:7px;padding:9px}.game-review-brilliant-move-main small{max-width:190px}}


/* Game Review is a normal page, not a full-screen modal overlay. */
.game-review-overlay{position:relative;inset:auto;z-index:auto;display:block;overflow:visible;width:100%;min-height:calc(100vh - 68px);padding:0 clamp(12px,2vw,24px) 42px;background:var(--bg);color:var(--text)}
.game-review-overlay[hidden]{display:none}
.game-review-backdrop{display:none}
.game-review-dialog{position:relative;width:min(1420px,100%);max-width:1420px;max-height:none;overflow:visible;margin:0 auto;border:0;border-radius:0;background:transparent;box-shadow:none}
.game-review-header{position:relative;top:auto;margin:0;padding:10px 0;background:var(--bg);backdrop-filter:none}
.game-review-performance-panel{margin:0 0 18px;padding:17px;border:1px solid #2b2b31;border-radius:14px;background:#171719;box-shadow:var(--shadow)}
.game-review-performance-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}
.game-review-performance-heading h3{margin:4px 0 0;color:#f4f4f5;font:600 14px Cinzel,Georgia,serif}
.game-review-performance-graph{min-height:78px;display:flex;align-items:center;margin-bottom:14px;padding:5px 8px;border:1px solid #2b2b31;border-radius:9px;background:#111114;color:#92929c;font-size:10px}
.game-review-performance-graph svg{display:block;width:100%;height:78px;overflow:visible}
.review-performance-baseline{stroke:#4b4b53;stroke-width:1;stroke-dasharray:4 5}
.review-performance-line{fill:none;stroke:#d4d4d8;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.review-performance-marker{stroke:#171719;stroke-width:1.5;fill:#a1a1aa}
.review-performance-marker.marker-brilliant{fill:#10b981}
.review-performance-marker.marker-great{fill:#34d399}
.review-performance-marker.marker-best{fill:#84cc16}
.review-performance-marker.marker-inaccuracy{fill:#eab308}
.review-performance-marker.marker-mistake{fill:#f97316}
.review-performance-marker.marker-miss,.review-performance-marker.marker-blunder{fill:#ef4444}
.review-player-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
.review-player-card{min-width:0;padding:14px;border:1px solid #2b2b31;border-radius:11px;background:#111114;box-shadow:none}
.review-player-top{display:flex;align-items:center;gap:9px;min-width:0}
.review-player-avatar{display:grid;place-items:center;width:36px;height:36px;flex:0 0 36px;border:1px solid #b77911;border-radius:9px;background:#202024;color:#fbbf24;font-weight:800}
.review-player-identity{display:flex;flex-direction:column;gap:3px;min-width:0}
.review-player-identity strong{overflow:hidden;color:#f4f4f5;font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.review-player-identity small{color:#92929c;font:8px "JetBrains Mono",monospace;letter-spacing:1px}
.review-player-score{margin-top:12px;color:#f4f4f5;font:800 27px "JetBrains Mono",monospace;letter-spacing:-.04em}
.review-player-caption{margin-top:2px;color:#a1a1aa;font:9px "JetBrains Mono",monospace}
.review-player-foot{display:block;margin-top:5px;color:#85858e;font-size:9px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.review-player-quality-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:13px}
.review-player-quality-item{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;align-items:center;column-gap:5px;min-width:0;padding:6px 5px;border:1px solid #29292f;border-radius:7px;background:#18181b}
.review-player-quality-icon{grid-row:1/3;color:#a1a1aa;font-size:12px;font-weight:800;text-align:center}
.review-player-quality-item strong{color:#e4e4e7;font:700 11px "JetBrains Mono",monospace}
.review-player-quality-item small{overflow:hidden;color:#92929c;font-size:8px;text-overflow:ellipsis;white-space:nowrap}
.review-player-quality-item.quality-brilliant .review-player-quality-icon{color:#34d399}
.review-player-quality-item.quality-great .review-player-quality-icon{color:#10b981}
.review-player-quality-item.quality-best .review-player-quality-icon{color:#a3e635}
.review-player-quality-item.quality-good .review-player-quality-icon{color:#84cc16}
.review-player-quality-item.quality-inaccuracy .review-player-quality-icon{color:#eab308}
.review-player-quality-item.quality-mistake .review-player-quality-icon{color:#f97316}
.review-player-quality-item.quality-miss .review-player-quality-icon,.review-player-quality-item.quality-blunder .review-player-quality-icon{color:#ef4444}
.review-player-extra{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:10px}
.review-player-extra-item{display:flex;flex-direction:column;gap:6px;min-width:0;padding:8px 7px;border-top:1px solid #2b2b31}
.review-player-extra-item>small{color:#85858e;font:8px "JetBrains Mono",monospace;letter-spacing:.5px}
.review-player-extra-item>strong{overflow:hidden;color:#e4e4e7;font:700 10px "JetBrains Mono",monospace;text-overflow:ellipsis;white-space:nowrap}
.review-player-extra-item.review-player-official-accuracy{border:1px solid #59451d;border-radius:8px;background:#f59e0b0a}
.review-player-extra-item.review-player-official-accuracy>strong{color:#fbbf24;font-size:12px}
.review-player-coach-badge{width:max-content;max-width:100%;padding:4px 6px;border:1px solid #444;border-radius:99px;background:#29292f}
.review-player-coach-badge.coach-excellent,.review-player-coach-badge.coach-good{border-color:#237a5c;background:#0e3a2e;color:#34d399}
.review-player-coach-badge.coach-average{border-color:#8d6b1b;background:#3a2c0e;color:#fbbf24}
.review-player-coach-badge.coach-needs-work{border-color:#8c3e3e;background:#3c1717;color:#fca5a5}
.review-player-coach-badge.coach-pending{border-color:#444;background:#222;color:#a1a1aa}
@media(max-width:760px){.game-review-overlay{padding-right:12px;padding-left:12px}.game-review-performance-panel{padding:12px}.game-review-performance-heading{align-items:flex-start;flex-direction:column}}
@media(max-width:540px){.review-player-cards{grid-template-columns:1fr}.review-player-quality-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.game-review-performance-graph{min-height:65px}.game-review-performance-graph svg{height:65px}}


/* Attribute every reviewed move to the player who actually played it. */
.game-review-guided-top{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.game-review-move-owner{padding:6px 9px;border:1px solid #b77911;border-radius:7px;background:#f59e0b16;color:#fbbf24;font:800 9px "JetBrains Mono",monospace;letter-spacing:.45px}
.game-review-move-main{display:flex;flex-direction:column;gap:3px;min-width:0;text-align:left}
.game-review-move-san{font:700 10px "JetBrains Mono",monospace;color:var(--text)}
.game-review-move-player{overflow:hidden;color:var(--muted);font:8px "JetBrains Mono",monospace;text-overflow:ellipsis;white-space:nowrap}
.game-review-move{align-items:center}
@media(max-width:560px){.game-review-guided-top{align-items:flex-start}.game-review-move-owner{order:4;width:100%;white-space:normal}.game-review-move-main{max-width:65%}}


/* Small classification stickers sit on the destination square of the moved piece. */
.square .move-sticker,.game-review-square .move-sticker{
  position:absolute;top:2px;right:2px;z-index:5;display:inline-flex;align-items:center;justify-content:center;
  max-width:calc(100% - 4px);padding:3px 4px;border:1px solid #ffffff55;border-radius:5px;
  background:#171719eF;color:#f4f4f5;font:900 clamp(5px,.68vw,8px)/1 "JetBrains Mono",monospace;
  letter-spacing:-.25px;white-space:nowrap;text-overflow:clip;box-shadow:0 2px 5px #0009;
  pointer-events:none;transform:rotate(-2deg);
}
.move-sticker-brilliant{background:#075b43ed!important;border-color:#5eead4!important;color:#d1fae5!important}
.move-sticker-great,.move-sticker-excellent,.move-sticker-best{background:#174e35ed!important;border-color:#86efac!important;color:#dcfce7!important}
.move-sticker-good{background:#365314ed!important;border-color:#bef264!important;color:#ecfccb!important}
.move-sticker-inaccuracy{background:#713f12ed!important;border-color:#facc15!important;color:#fef3c7!important}
.move-sticker-mistake{background:#7c2d12ed!important;border-color:#fdba74!important;color:#ffedd5!important}
.move-sticker-blunder,.move-sticker-miss{background:#7f1d1ded!important;border-color:#fca5a5!important;color:#fee2e2!important}
.move-sticker-mate{background:#581c87ed!important;border-color:#d8b4fe!important;color:#f3e8ff!important}
.move-sticker-book{background:#1e3a8aed!important;border-color:#93c5fd!important;color:#dbeafe!important}
@media(max-width:540px){
  .square .move-sticker,.game-review-square .move-sticker{top:1px;right:1px;padding:2px 2px;font-size:5px;border-radius:3px;letter-spacing:-.4px}
}


/* ================================================================
   Chess Vision interface refresh
   Visual-only layer: routing, engine logic, board colours and pieces
   remain owned by the existing application styles and renderers.
   ================================================================ */
:root{
  --ui-surface:#151619;
  --ui-surface-raised:#1b1c20;
  --ui-border:#303137;
  --ui-muted:#b0b0b8;
  --ui-text:#f4f4f5;
}
body{
  font-size:15px;
  line-height:1.55;
  color:var(--ui-text);
  background:
    radial-gradient(ellipse at 74% -18%,#29201635 0,transparent 38%),
    var(--bg);
}
body.light{
  --ui-surface:#ffffff;
  --ui-surface-raised:#f6f5f2;
  --ui-border:#dedbd4;
  --ui-muted:#62636b;
  --ui-text:#202126;
}
.ambient{display:none}

/* Persistent desktop navigation. Existing data-page controls and IDs are intact. */
.topbar{
  position:fixed!important;
  inset:0 auto 0 0;
  z-index:180;
  width:252px;
  height:100vh!important;
  min-height:100vh;
  max-width:none;
  padding:26px 16px 18px!important;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
  overflow-y:auto;
  overflow-x:visible;
  background:#101114!important;
  border-right:1px solid #303137!important;
  border-bottom:0!important;
  box-shadow:12px 0 42px #00000018;
  backdrop-filter:none!important;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:52px;
  padding:0 7px;
  color:#f4f4f5!important;
  font-family:Cinzel,Georgia,serif;
  font-size:14px;
  letter-spacing:1.1px;
}
.brand-mark{
  width:42px!important;
  height:42px!important;
  flex:0 0 42px;
  display:grid;
  place-items:center;
  border:1px solid #b77911!important;
  border-radius:13px!important;
  background:linear-gradient(145deg,#fbbf24,#d58a0c)!important;
  color:#171719!important;
  font-size:25px!important;
  box-shadow:0 7px 18px #f59e0b22;
}
.brand-wordmark{display:flex;flex-direction:column;gap:4px;line-height:1.1}
.brand-wordmark>small{
  color:#96969f;
  font:700 9px "JetBrains Mono",monospace;
  letter-spacing:1.35px;
}
.brand-light{color:#c4c4cb!important}
.sidebar-caption,.nav-section-label{
  display:block;
  padding:24px 11px 9px;
  color:#85858e;
  font:800 10px "JetBrains Mono",monospace;
  letter-spacing:1.5px;
}
nav.main-nav{
  display:flex;
  flex:1 0 auto;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  gap:5px;
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  overflow:visible;
}
nav.main-nav .nav-link{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:13px;
  width:100%;
  min-height:46px;
  padding:10px 12px;
  border:1px solid transparent;
  border-radius:11px;
  background:transparent;
  color:#b4b4bc;
  font:650 14px Inter,system-ui,sans-serif;
  letter-spacing:0;
  text-align:left;
  transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease;
}
nav.main-nav .nav-link:hover{
  color:#fff;
  background:#ffffff0b;
  border-color:#ffffff0c;
  transform:translateX(2px);
}
nav.main-nav .nav-link.nav-active{
  color:#ffd26a;
  border-color:#9a681f55;
  background:linear-gradient(100deg,#f59e0b22,#f59e0b09);
  box-shadow:inset 3px 0 #f6b72e,0 5px 15px #0002;
}
.nav-symbol{
  display:grid;
  place-items:center;
  width:25px;
  height:25px;
  flex:0 0 25px;
  border-radius:8px;
  background:#ffffff0a;
  color:#f3bd4a;
  font-size:18px;
  line-height:1;
}
.nav-text{display:block;min-width:0}
.nav-chevron{margin-left:auto;color:#8e8e97;font-size:16px}
.nav-section-label{padding:20px 11px 6px}
.nav-dropdown{position:relative;display:block;width:100%;flex:0 0 auto}
.nav-dropdown .nav-learn-toggle{width:100%}
.nav-dropdown-menu{
  position:static!important;
  display:grid;
  gap:4px;
  width:100%!important;
  margin:5px 0 4px;
  padding:9px 5px 9px 15px!important;
  border:0!important;
  border-left:1px solid #424047!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
}
.nav-dropdown-menu[hidden]{display:none!important}
.nav-dropdown-menu .nav-dropdown-label{
  padding:3px 8px 7px;
  color:#85858e;
  font:800 9px "JetBrains Mono",monospace;
  letter-spacing:1px;
}
.nav-dropdown-menu button{
  display:flex;
  align-items:center;
  gap:9px;
  width:100%;
  min-height:38px;
  padding:8px 9px;
  border:1px solid transparent;
  border-radius:8px;
  background:transparent;
  color:#b8b8c0;
  font:600 12.5px Inter,system-ui,sans-serif;
  text-align:left;
  cursor:pointer;
}
.nav-dropdown-menu button span{
  width:20px;
  flex:0 0 20px;
  color:#fbbf24;
  font:800 10px "JetBrains Mono",monospace;
}
.nav-dropdown-menu button:hover,.nav-dropdown-menu button.nav-active{
  background:#ffffff0b;
  color:#fff;
}
.nav-dropdown-menu button.nav-active{
  border-color:#9a681f44;
  box-shadow:inset 2px 0 #fbbf24;
}
.nav-dropdown-divider{height:1px;margin:5px 7px;background:#34343b}
.sidebar-bottom{
  display:grid;
  gap:13px;
  margin-top:auto;
  padding:18px 4px 2px;
  border-top:1px solid #303137;
}
.sidebar-engine-card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px;
  border:1px solid #333238;
  border-radius:11px;
  background:#ffffff06;
}
.sidebar-engine-icon{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  flex:0 0 30px;
  border-radius:9px;
  background:#f59e0b1a;
  color:#fbbf24;
  font-size:16px;
}
.sidebar-engine-card>span:last-child{display:grid;gap:3px}
.sidebar-engine-card strong{color:#e8e8ec;font-size:11px}
.sidebar-engine-card small{color:#96969f;font-size:10px}
.sidebar-theme-row{display:flex;align-items:center;gap:10px;padding:0 7px;color:#aaaab2;font-size:12px}
.sidebar-theme-row .icon-button{
  width:37px;
  height:37px;
  border:1px solid #393940;
  border-radius:10px;
  background:#ffffff08;
  color:#f7c75a;
  font-size:19px;
}
.content-utility-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  min-height:57px;
  margin:0 0 25px;
  border-bottom:1px solid var(--ui-border);
  color:#a4a4ac;
  font:700 10px "JetBrains Mono",monospace;
  letter-spacing:1px;
}
.content-utility-bar span{display:flex;align-items:center;gap:10px}
.content-utility-bar i{color:#fbbf24;font-style:normal;font-size:14px}
.content-utility-bar b{color:#5d5d66}
.content-utility-bar strong{color:#777780;font-size:9px;letter-spacing:1.3px}
main{
  display:flex;
  flex-direction:column;
  width:calc(100% - 252px);
  max-width:none!important;
  min-width:0;
  margin:0 0 0 252px!important;
  padding:0 clamp(24px,3vw,48px) 44px!important;
}
main>section{min-width:0}
.home-page,.dashboard-page{padding-top:28px}
.hero{padding:48px 0 38px}
.hero h1,.home-hero h1,.dashboard-heading h1{
  font-size:clamp(40px,4.6vw,64px);
  line-height:1.08;
}
.home-hero{min-height:380px;padding:16px 0 36px}
.home-hero-copy{max-width:680px}
.home-hero-copy>p,.home-page p,.dashboard-page p,.hero-copy,.how-section p{
  font-size:15px;
  line-height:1.75;
}
.home-actions{gap:12px;margin-top:25px}
.home-feature-grid{gap:14px}
.home-feature-card,.dashboard-metric,.dashboard-connect-card,.panel{
  border-radius:16px;
}
.home-feature-card{padding:19px;min-height:190px}
.dashboard-heading{gap:24px;margin-bottom:25px}
.dashboard-heading h1{margin:12px 0}
.dashboard-metric-grid{gap:13px}
.dashboard-metric{padding:18px}
.dashboard-metric>span{font-size:11px;letter-spacing:1.1px}
.dashboard-metric>strong{font-size:27px}
.dashboard-metric>small{font-size:12px}
.dashboard-section,.dashboard-connect-card{margin-top:18px}
.section-heading{margin-bottom:24px}
.section-heading h2,.academy-card-heading h3,.game-review-section-head h3{
  font-size:25px;
}
.eyebrow,.panel-label,.result-kicker,.game-review-kicker,.mono{
  font-size:11px!important;
  letter-spacing:1.2px;
}
.status-pill,.engine-tag{font-size:11px}
.workspace{padding-top:26px}
.analyzer-grid{
  grid-template-columns:minmax(300px,.88fr) minmax(340px,1.12fr);
  align-items:start;
  gap:20px;
}
.board-panel,.results-panel{padding:19px}
.panel-top{margin-bottom:14px}
.board-surround{
  width:min(100%,560px);
  max-width:560px;
  margin:0 auto;
}
#board{width:100%;max-width:560px}
.file-labels,.rank-labels{font-size:12px}
.board-footer{font-size:12px}
.position-input>label,.academy-field-label{font-size:12px}
.position-input input,.academy-input,.input-row input:not([type=file]),.turn-select{
  font-size:14px;
  line-height:1.4;
  padding:12px;
}
.quiet-button,.small-button,.upload-button,.primary-button{
  font-size:13px;
  line-height:1.35;
}
.subtle,.microcopy,.academy-note,.recognition-privacy,.chesscom-count-help{
  font-size:12px;
  line-height:1.6;
}
.empty-analysis h3{font-size:19px}
.empty-analysis p{font-size:14px;line-height:1.7}
.best-move-line strong{font-size:34px}
.best-move-block p,.brilliant-block p,.candidate-row{font-size:13px;line-height:1.65}
.eval-block>span:last-child{font-size:12px}
.candidate-rank,.candidate-eval{font-size:12px}
.academy-section{padding-top:34px}
.academy-card-copy,.academy-field-label,.academy-feedback,.academy-note{
  font-size:13px;
  line-height:1.65;
}
.academy-card-heading h3{font-size:19px}
.academy-card-heading .result-kicker{font-size:10px}
.academy-progress,.academy-rating-pill{font-size:12px}
.chesscom-layout{gap:18px}
.chesscom-form-card,.chesscom-results-card{padding:22px}
.chesscom-search-form{gap:14px}
.chesscom-search-form input{min-height:45px}
.chesscom-section p{font-size:14px;line-height:1.7}
.how-section{padding:68px 0}
.how-section h2{font-size:clamp(34px,4vw,50px)}
.principles{gap:22px}
.principles h3{font-size:18px}
.principles p{font-size:14px;line-height:1.7}
footer{font-size:12px}

/* Review board slightly reduced to match the new content proportions. */
.game-review-overlay{padding-top:0}
.game-review-dialog{width:min(1360px,100%)}
.game-review-board{width:min(100%,560px)!important}
.game-review-board-column{padding:15px}
.game-review-board-caption{font-size:11px}
.game-review-performance-panel{padding:20px}
.review-player-card{padding:17px}
.review-player-identity strong{font-size:14px}
.review-player-score{font-size:30px}
.review-player-caption,.review-player-foot{font-size:11px}
.review-player-quality-item strong{font-size:12px}
.review-player-quality-item small{font-size:10px}
.review-player-extra-item>small{font-size:9px}
.review-player-extra-item>strong{font-size:11px}
.game-review-summary-panel-label{font-size:11px}
.game-review-summary-progress{font-size:12px}
.game-review-move{min-height:42px}
.game-review-move-san{font-size:12px}
.game-review-move-player{font-size:10px}
.review-move-grade-label{font-size:10px}
.game-review-coach-card p{font-size:14px;line-height:1.7}
.game-review-coach-heading strong{font-size:14px}
.game-review-guided-top{font-size:12px}
.game-review-move-owner{font-size:10px}
.game-review-kicker{font-size:10px}
.game-review-section-head h3{font-size:20px}
.game-review-engine-status,.review-engine-note{font-size:11px}

/* Global readability: secondary copy, helper text and controls no longer use tiny type. */
body,button,input,select,textarea{font-size:14px}
p{font-size:14px;line-height:1.7}
small{font-size:12px}
label{font-size:13px}
table{font-size:13px}
th,td{padding-top:9px;padding-bottom:9px}
.badge,.status-pill,.engine-tag{letter-spacing:.2px}
.nav-link,.nav-dropdown-menu button{font-size:13px}
a,button{touch-action:manipulation}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid #fbbf24;
  outline-offset:3px;
}

/* Tablet navigation becomes a compact icon rail. */
@media(max-width:1050px) and (min-width:761px){
  .topbar{
    width:82px;
    padding:20px 10px 14px!important;
    align-items:center;
  }
  .brand{justify-content:center;padding:0;min-height:48px}
  .brand-wordmark,.sidebar-caption,.nav-section-label,.nav-text,.nav-chevron,.sidebar-engine-card>span:last-child,.sidebar-theme-row>span{display:none!important}
  .brand-mark{width:42px!important;height:42px!important}
  nav.main-nav{align-items:center;margin-top:22px}
  nav.main-nav .nav-link{justify-content:center;gap:0;width:58px;height:50px;padding:8px}
  .nav-symbol{width:29px;height:29px;font-size:20px}
  .nav-dropdown{width:58px}
  .nav-dropdown .nav-learn-toggle{width:58px}
  .nav-dropdown-menu{
    position:absolute!important;
    top:0;
    left:calc(100% + 9px);
    z-index:200;
    width:238px!important;
    margin:0;
    padding:12px!important;
    border:1px solid #37373d!important;
    border-radius:12px!important;
    background:#171719!important;
    box-shadow:0 18px 44px #0009!important;
  }
  .sidebar-bottom{width:100%;justify-items:center;padding-top:13px}
  .sidebar-engine-card{justify-content:center;width:56px;height:48px;padding:8px}
  .sidebar-engine-icon{width:28px;height:28px}
  .sidebar-theme-row{padding:0}
  main{width:calc(100% - 82px);margin-left:82px!important;padding-inline:24px!important}
  .analyzer-grid{grid-template-columns:minmax(270px,.9fr) minmax(300px,1.1fr)}
  .board-panel,.results-panel{padding:15px}
}

/* Phone and small tablet: keep navigation visible and scrollable at the top. */
@media(max-width:760px){
  .topbar{
    position:sticky!important;
    inset:auto;
    width:100%;
    height:auto!important;
    min-height:112px;
    max-width:none;
    padding:10px 14px 8px!important;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-rows:auto auto;
    align-items:center;
    gap:5px 10px;
    overflow:visible;
    border-right:0!important;
    border-bottom:1px solid #303137!important;
    box-shadow:0 8px 24px #0003;
  }
  .brand{grid-column:1;grid-row:1;min-height:42px;padding:0 2px}
  .brand-mark{width:36px!important;height:36px!important;flex-basis:36px;font-size:21px!important}
  .brand-wordmark{font-size:12px}
  .brand-wordmark>small{font-size:8px}
  .sidebar-caption{display:none}
  nav.main-nav{
    grid-column:1/-1;
    grid-row:2;
    display:flex;
    flex-direction:row;
    align-items:center;
    width:100%;
    max-width:100%;
    margin:0;
    padding:4px 0 1px;
    gap:5px;
    overflow-x:auto;
    overflow-y:visible;
    scrollbar-width:none;
  }
  nav.main-nav::-webkit-scrollbar{display:none}
  nav.main-nav .nav-link{
    display:flex;
    flex:0 0 auto;
    width:auto;
    min-height:39px;
    justify-content:center;
    gap:7px;
    padding:8px 10px;
    font-size:12px;
    white-space:nowrap;
  }
  .nav-symbol{width:21px;height:21px;flex-basis:21px;font-size:15px}
  .nav-text{display:block!important}
  .nav-section-label{display:none}
  .nav-dropdown{display:block;flex:0 0 auto;width:auto}
  .nav-dropdown .nav-learn-toggle{width:auto}
  .nav-chevron{display:none}
  .nav-dropdown-menu{
    position:absolute!important;
    top:calc(100% + 5px);
    left:0;
    z-index:220;
    width:245px!important;
    margin:0;
    padding:11px!important;
    border:1px solid #38383f!important;
    border-radius:12px!important;
    background:#171719!important;
    box-shadow:0 18px 44px #000b!important;
  }
  .nav-dropdown-menu button{font-size:12px}
  .sidebar-bottom{
    grid-column:2;
    grid-row:1;
    display:flex;
    align-items:center;
    gap:8px;
    width:auto;
    margin:0;
    padding:0;
    border:0;
  }
  .sidebar-engine-card{display:none}
  .sidebar-theme-row{padding:0}
  .sidebar-theme-row>span{display:none}
  .sidebar-theme-row .icon-button{width:36px;height:36px}
  main{
    width:100%;
    max-width:none!important;
    margin:0!important;
    padding:0 16px 32px!important;
  }
  .content-utility-bar{min-height:44px;margin-bottom:17px;font-size:9px}
  .content-utility-bar strong{display:none}
  .home-page,.dashboard-page{padding-top:20px}
  .home-hero{grid-template-columns:1fr;gap:25px;min-height:0}
  .home-visual-card{max-width:100%}
  .analyzer-grid{grid-template-columns:minmax(0,1fr);gap:14px}
  .board-panel,.results-panel{padding:14px}
  .board-surround{width:min(100%,520px)}
  #board{max-width:520px}
  .dashboard-heading{align-items:flex-start;flex-direction:column}
  .dashboard-actions{width:100%;flex-wrap:wrap}
  .dashboard-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .game-review-overlay{padding-inline:0}
  .game-review-dialog{width:100%}
  .game-review-header{position:relative;margin:0 -16px;padding:10px 16px}
}
@media(max-width:520px){
  body{font-size:14px}
  .content-utility-bar{font-size:8px;letter-spacing:.7px}
  .hero h1,.home-hero h1,.dashboard-heading h1{font-size:clamp(34px,10vw,46px);letter-spacing:-1px}
  .section-heading h2{font-size:22px}
  .dashboard-metric-grid{gap:9px}
  .dashboard-metric{padding:13px}
  .dashboard-metric>strong{font-size:23px}
  .dashboard-metric>small{font-size:11px}
  .board-surround{width:min(100%,470px)}
  #board{max-width:470px}
  .game-review-board{width:min(100%,470px)!important}
  .game-review-performance-panel{padding:13px}
  .game-review-summary-title h2{font-size:23px}
  .game-review-move{padding:8px 9px}
  .game-review-move-player{font-size:9px}
  .nav-symbol{display:none}
  nav.main-nav .nav-link{padding:8px 10px}
}


/* Sidebar collapse / expand. Navigation routing remains data-page driven. */
.sidebar-brand-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.sidebar-brand-row .brand{min-width:0;padding-left:7px}
.sidebar-collapse-toggle{
  display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;
  border:1px solid #393940;border-radius:9px;background:#ffffff08;color:#e8e8ec;
  font:500 24px/1 Inter,system-ui,sans-serif;cursor:pointer;
}
.sidebar-collapse-toggle:hover{background:#f59e0b20;border-color:#9a681f;color:#ffd26a}
.nav-learn-row{display:flex;align-items:center;gap:4px;width:100%}
.nav-learn-row .nav-learn-page{flex:1 1 auto;min-width:0}
.nav-learn-menu-toggle{
  display:grid;place-items:center;flex:0 0 34px;width:34px;height:42px;
  border:1px solid transparent;border-radius:9px;background:transparent;color:#a1a1aa;
  font-size:17px;cursor:pointer;
}
.nav-learn-menu-toggle:hover,.nav-learn-menu-toggle[aria-expanded="true"]{border-color:#4a3a22;background:#f59e0b14;color:#fbbf24}
.nav-dropdown-menu{z-index:210}
body.sidebar-collapsed .topbar{width:82px;padding:20px 10px 14px!important;align-items:center}
body.sidebar-collapsed .sidebar-brand-row{width:100%;flex-direction:column;gap:12px}
body.sidebar-collapsed .sidebar-brand-row .brand{justify-content:center;padding:0}
body.sidebar-collapsed .brand-wordmark,
body.sidebar-collapsed .sidebar-caption,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-chevron,
body.sidebar-collapsed .sidebar-engine-card>span:last-child,
body.sidebar-collapsed .sidebar-theme-row>span{display:none!important}
body.sidebar-collapsed .sidebar-collapse-toggle{width:42px;height:34px;flex-basis:34px}
body.sidebar-collapsed nav.main-nav{align-items:center;margin-top:18px}
body.sidebar-collapsed nav.main-nav .nav-link{justify-content:center;gap:0;width:58px;height:50px;padding:8px}
body.sidebar-collapsed .nav-symbol{width:29px;height:29px;flex-basis:29px;font-size:20px}
body.sidebar-collapsed .nav-learn-row{width:58px;justify-content:center;gap:0}
body.sidebar-collapsed .nav-learn-row .nav-learn-page{width:58px;flex:0 0 58px}
body.sidebar-collapsed .nav-learn-menu-toggle{position:absolute;right:-4px;top:-5px;width:20px;height:20px;min-height:20px;flex-basis:20px;padding:0;border:1px solid #51402a;border-radius:6px;background:#25252a;font-size:13px}
body.sidebar-collapsed .nav-dropdown{width:58px}
body.sidebar-collapsed .nav-dropdown-menu{
  position:absolute!important;top:0;left:calc(100% + 12px);width:250px!important;
  margin:0;padding:12px!important;border:1px solid #37373f!important;border-radius:12px!important;
  background:#171719!important;box-shadow:0 18px 44px #0009!important;
}
body.sidebar-collapsed .sidebar-bottom{width:100%;justify-items:center}
body.sidebar-collapsed .sidebar-engine-card{justify-content:center;width:56px;height:48px;padding:8px}
body.sidebar-collapsed .sidebar-theme-row{justify-content:center;padding:0}
body.sidebar-collapsed main{width:calc(100% - 82px);margin-left:82px!important}
@media(min-width:761px) and (max-width:1050px){
  .topbar{width:252px}
  main{width:calc(100% - 252px);margin-left:252px!important}
  body.sidebar-collapsed .topbar{width:82px}
  body.sidebar-collapsed main{width:calc(100% - 82px);margin-left:82px!important}
  body:not(.sidebar-collapsed) .topbar{align-items:stretch}
  body:not(.sidebar-collapsed) .sidebar-brand-row{flex-direction:row}
  body:not(.sidebar-collapsed) .brand-wordmark,
  body:not(.sidebar-collapsed) .sidebar-caption,
  body:not(.sidebar-collapsed) .nav-section-label,
  body:not(.sidebar-collapsed) .nav-text,
  body:not(.sidebar-collapsed) .sidebar-engine-card>span:last-child,
  body:not(.sidebar-collapsed) .sidebar-theme-row>span{display:initial!important}
  body:not(.sidebar-collapsed) nav.main-nav{align-items:stretch;margin-top:0}
  body:not(.sidebar-collapsed) nav.main-nav .nav-link{justify-content:flex-start;width:100%;height:auto}
  body:not(.sidebar-collapsed) .nav-learn-row{width:100%}
}
@media(max-width:760px){
  .sidebar-collapse-toggle{display:none}
  .sidebar-brand-row{display:contents}
  .topbar{width:100%!important}
  main{width:100%!important;margin:0!important}
  body.sidebar-collapsed .topbar{width:100%!important;align-items:stretch}
  body.sidebar-collapsed .sidebar-brand-row{display:contents}
  body.sidebar-collapsed .brand-wordmark,
  body.sidebar-collapsed .nav-text,
  body.sidebar-collapsed .sidebar-theme-row>span{display:flex!important}
  body.sidebar-collapsed .sidebar-caption,
  body.sidebar-collapsed .nav-section-label{display:none!important}
  body.sidebar-collapsed nav.main-nav{align-items:center;margin:0}
  body.sidebar-collapsed nav.main-nav .nav-link{justify-content:center;width:auto;height:auto}
  body.sidebar-collapsed .nav-dropdown{width:auto}
  body.sidebar-collapsed .nav-learn-row{width:auto}
  body.sidebar-collapsed .nav-learn-row .nav-learn-page{width:auto;flex:1 1 auto}
  body.sidebar-collapsed .nav-learn-menu-toggle{position:static;width:30px;height:34px;flex:0 0 30px}
  body.sidebar-collapsed .sidebar-bottom{width:auto;justify-items:initial}
}

/* Dedicated Learn landing page and clear training paths. */
.learn-page{width:100%;min-width:0;padding:32px 0 50px}
.learn-page-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:4px 0 26px}
.learn-page-heading h1{margin:12px 0 10px;color:var(--ui-text);font:800 clamp(38px,4.5vw,60px)/1.05 Cinzel,Georgia,serif;letter-spacing:-1.3px}
.learn-page-heading h1 em{color:#f3bc47;font-family:Georgia,serif;font-weight:500}
.learn-page-heading p{max-width:690px;margin:0;color:var(--ui-muted);font-size:15px;line-height:1.75}
.learn-page-level{flex:0 0 auto;padding:9px 12px;border:1px solid #484034;border-radius:999px;background:#f59e0b0d;color:#e5bd69;font:800 9px "JetBrains Mono",monospace;letter-spacing:1px}
.learn-path-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.learn-path-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;min-width:0;min-height:280px;padding:24px;border:1px solid #34343b;border-radius:17px;background:linear-gradient(145deg,#1c1d21,#141518);box-shadow:0 14px 35px #0002;overflow:hidden}
.learn-path-card:after{content:"";position:absolute;right:-50px;top:-60px;width:170px;height:170px;border:1px solid #ffffff0a;border-radius:50%;box-shadow:0 0 0 22px #ffffff04,0 0 0 45px #ffffff03;pointer-events:none}
.learn-path-icon{display:grid;place-items:center;width:46px;height:46px;margin-bottom:19px;border:1px solid #6b5124;border-radius:13px;background:#f59e0b16;color:#f7c75a;font-size:25px}
.learn-path-kicker{color:#c69a43;font:800 9px "JetBrains Mono",monospace;letter-spacing:1px}
.learn-path-card h2{margin:9px 0 8px;color:#f4f4f5;font:700 23px Cinzel,Georgia,serif}
.learn-path-card p{max-width:530px;margin:0 0 17px;color:#b5b5bd;font-size:14px;line-height:1.75}
.learn-path-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto;margin-bottom:17px}
.learn-path-meta span{padding:6px 9px;border:1px solid #34343a;border-radius:999px;background:#ffffff05;color:#b3b3bb;font-size:10px}
.learn-path-card .primary-button,.learn-path-card .quiet-button{min-height:42px;font-size:13px}
.learn-path-openings{border-top:2px solid #c99b3b}
.learn-path-middle{border-top:2px solid #6ba4c6}
.learn-path-endgame{border-top:2px solid #8d9c70}
.learn-path-bot{border-top:2px solid #a58ab8}
body.light .learn-path-card{background:linear-gradient(145deg,#fff,#f6f5f1);border-color:#dedbd4;box-shadow:0 14px 30px #0000000d}
body.light .learn-path-card h2{color:#202126}
body.light .learn-path-card p{color:#5f6067}
body.light .learn-path-meta span{border-color:#e2dfd8;background:#f8f7f3;color:#5f6067}
@media(max-width:760px){
  .learn-page{padding-top:22px}
  .learn-page-heading{align-items:flex-start;flex-direction:column}
  .learn-path-grid{grid-template-columns:1fr}
  .learn-path-card{min-height:240px;padding:19px}
}
@media(min-width:761px) and (max-width:980px){
  .learn-path-grid{grid-template-columns:1fr}
}

/* Analyzer layout: prevent grid min-content sizing from clipping its heading or right panel. */
#analyzer{width:100%;max-width:100%;min-width:0;overflow:visible}
#analyzer>.section-heading{width:100%;min-width:0;flex-wrap:wrap;gap:12px}
#analyzer>.section-heading>div{min-width:0}
#analyzer>.section-heading h2{overflow-wrap:anywhere}
#analyzer .analyzer-grid{
  display:grid;width:100%;min-width:0;
  grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr);
  align-items:start;gap:18px;overflow:visible;
}
#analyzer .analyzer-grid>.panel{min-width:0;max-width:100%;overflow:hidden}
#analyzer .board-surround{width:min(100%,500px);max-width:500px}
#analyzer #board{width:100%;max-width:500px}
#analyzer .results-panel>*{min-width:0;max-width:100%}
@media(min-width:761px) and (max-width:920px){
  #analyzer .analyzer-grid{grid-template-columns:minmax(0,1fr)}
  #analyzer .board-surround{width:min(100%,540px);max-width:540px}
  #analyzer #board{max-width:540px}
}
@media(max-width:760px){
  #analyzer .analyzer-grid{grid-template-columns:minmax(0,1fr)}
  #analyzer .section-heading{align-items:flex-start}
}

/* The actual Learn hub route is separate from the optional submenu. */


/* Analyzer panels: restore a clear outer edge on both columns. */
#analyzer .analyzer-grid{
  width:100%;
  min-width:0;
  box-sizing:border-box;
  grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr);
  align-items:stretch;
  gap:18px;
  padding:1px 2px 3px 1px;
}
#analyzer .analyzer-grid>.board-panel.panel,
#analyzer .analyzer-grid>.results-panel.panel{
  box-sizing:border-box;
  min-width:0;
  width:100%;
  max-width:100%;
  min-height:100%;
  border:1px solid #55565f;
  border-radius:16px;
  outline:1px solid #ffffff0b;
  outline-offset:-1px;
  box-shadow:0 14px 34px #0006,0 0 0 1px #0004;
}
#analyzer .analyzer-grid>.results-panel.panel{
  overflow:hidden;
  background:linear-gradient(160deg,#17181c,#131417);
}
#analyzer .analyzer-grid>.board-panel.panel{
  overflow:hidden;
}
body.light #analyzer .analyzer-grid>.board-panel.panel,
body.light #analyzer .analyzer-grid>.results-panel.panel{
  border-color:#b8b9bf;
  outline-color:#00000008;
  box-shadow:0 12px 28px #0000000c,0 0 0 1px #00000008;
}
body.light #analyzer .analyzer-grid>.results-panel.panel{
  background:linear-gradient(160deg,#ffffff,#f7f7f4);
}

/* Increase only piece artwork; the board and square geometry are unchanged. */
#analyzer .piece-image{
  width:95%;
  height:95%;
}
@media(max-width:540px){
  #analyzer .piece-image{
    width:95%;
    height:95%;
  }
}

/* Analyzer page must occupy only the space remaining beside the fixed sidebar.
   The older analyzer-specific main rule incorrectly reset this to 100vw. */
body[data-page="analyzer"] main{
  width:calc(100% - 252px)!important;
  max-width:none!important;
  min-width:0;
  margin:0 0 0 252px!important;
  padding:0 clamp(24px,3vw,48px) 44px!important;
}
body.sidebar-collapsed[data-page="analyzer"] main{
  width:calc(100% - 82px)!important;
  margin-left:82px!important;
}

/* Give the Engine Report a distinct, continuous outer edge. */
body[data-page="analyzer"] #analyzer .analyzer-grid>.results-panel.panel{
  border:1px solid #777781!important;
  outline:1px solid #ffffff24;
  outline-offset:0;
  box-shadow:0 0 0 1px #77778155,0 16px 36px #0007;
}
body.light[data-page="analyzer"] #analyzer .analyzer-grid>.results-panel.panel{
  border-color:#9b9ba3!important;
  outline-color:#00000018;
  box-shadow:0 0 0 1px #9b9ba355,0 14px 30px #00000012;
}

/* Mobile navigation has no fixed-width sidebar. */
@media(max-width:760px){
  body[data-page="analyzer"] main{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:0 16px 32px!important;
  }
}


/* Highlight the active player identity in the guided review header. */
.game-review-move-owner{
  display:inline-flex;align-items:center;gap:7px;max-width:100%;padding:0;border:0;
  background:transparent;color:var(--muted);font:800 9px "JetBrains Mono",monospace;
  letter-spacing:.35px;white-space:normal;
}
.game-review-owner-side{
  flex:0 0 auto;padding:5px 7px;border:1px solid var(--border);border-radius:6px;
  background:var(--panel2);color:var(--text);font:900 9px "JetBrains Mono",monospace;
}
.game-review-move-owner.is-white .game-review-owner-side{
  background:#f4f4f5;border-color:#d4d4d8;color:#18181b;
}
.game-review-move-owner.is-black .game-review-owner-side{
  background:#27272a;border-color:#71717a;color:#fafafa;
}
.game-review-owner-separator{color:var(--muted);flex:0 0 auto}
.game-review-owner-name{
  display:inline-block;max-width:min(35vw,260px);overflow:hidden;text-overflow:ellipsis;
  padding:5px 8px;border:1px solid var(--green2);border-radius:6px;
  background:color-mix(in srgb,var(--green) 12%,transparent);color:var(--green);
  font:900 10px "JetBrains Mono",monospace;white-space:nowrap;
}
.game-review-owner-action{color:var(--muted);font:500 9px "JetBrains Mono",monospace}
@media(max-width:560px){
  .game-review-owner-name{max-width:min(48vw,220px)}
}

/* Keep opening-theory moves separate from the engine-quality counts. */
.review-player-quality-item.quality-book .review-player-quality-icon,
.review-player-quality-item.quality-book strong{color:#93c5fd}


/* Consistent colors for all move-grade labels. */
.review-player-quality-item.quality-excellent .review-player-quality-icon{color:#34d399}
.review-player-quality-item.quality-book .review-player-quality-icon{color:#93c5fd}
.review-move-grade.grade-book{color:#93c5fd;border-color:#365b87;background:#3b82f615}
.review-move-grade.grade-excellent{color:#34d399}


/* Expanded tactical and endgame catalogues. */
.training-library-heading,.repertoire-section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:22px 0 11px}
.training-library-heading h3,.repertoire-section-heading h4{margin:4px 0 0;font-size:17px;letter-spacing:-.35px}
.training-filter-row,.repertoire-catalog-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:9px;margin:12px 0}
.training-filter-row .academy-input,.repertoire-catalog-toolbar .academy-input{width:100%;min-width:0}
.training-catalog-list{grid-template-columns:repeat(2,minmax(0,1fr))}
.training-catalog-list .challenge-card{min-height:104px}
.endgame-scenario-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.endgame-scenario-card{display:grid;gap:8px;min-width:0;padding:15px;border:1px solid var(--border);border-radius:11px;background:var(--panel2)}
.endgame-scenario-card>strong{font-size:13px;line-height:1.45}
.endgame-scenario-card>small{font:9px "DM Mono",monospace;color:var(--green);letter-spacing:.08em;text-transform:uppercase}
.endgame-scenario-card>p{margin:0;color:var(--muted);font-size:11px;line-height:1.7}
.endgame-scenario-card>span{font-size:10px;color:var(--text)}
.endgame-scenario-card>button{justify-self:start}

/* Opening repertoire and spaced-repetition workspace. */
.repertoire-workspace{display:grid;gap:16px}
.repertoire-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.repertoire-metrics article{display:grid;gap:7px;padding:15px;border:1px solid var(--border);border-radius:10px;background:var(--panel2)}
.repertoire-metrics article>span{font:9px "DM Mono",monospace;color:var(--muted);letter-spacing:.08em}
.repertoire-metrics article>strong{font-size:24px;line-height:1;color:var(--green);font-variant-numeric:tabular-nums}
.repertoire-import-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.repertoire-import-panel{display:grid;align-content:start;gap:9px;min-width:0;padding:17px;border:1px solid var(--border);border-radius:11px;background:var(--panel2)}
.repertoire-import-panel h4{margin:0;font-size:15px}
.repertoire-import-panel>p{margin:0;color:var(--muted);font-size:11px;line-height:1.7}
.repertoire-pgn-input{width:100%;min-height:116px;resize:vertical;font-family:"DM Mono",monospace;font-size:10px}
.repertoire-import-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.repertoire-import-actions .academy-field-label{margin:0}
.repertoire-file-label{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.repertoire-grade-controls{display:grid;gap:8px;padding-top:8px}
.repertoire-grade-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.repertoire-grade-buttons button{min-width:0;padding:9px 6px}
.repertoire-idle-copy{margin:0;color:var(--muted);font-size:10px}
.repertoire-queue-list{display:grid;gap:8px}
.repertoire-empty{margin:0;padding:16px;border:1px dashed var(--border);border-radius:9px;color:var(--muted);font-size:11px;line-height:1.7}
.repertoire-line-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;border:1px solid var(--border);border-radius:10px;background:var(--panel2)}
.repertoire-line-card>div:first-child{display:grid;gap:5px;min-width:0}
.repertoire-line-card strong{font-size:12px;line-height:1.4}
.repertoire-line-card small{font:9px "DM Mono",monospace;color:var(--muted)}
.repertoire-due-label{font:9px "DM Mono",monospace;color:var(--muted);letter-spacing:.05em}
.repertoire-due-label.is-due{color:var(--green);font-weight:700}
.repertoire-line-actions{display:flex;align-items:center;gap:7px;flex-shrink:0}
.repertoire-line-actions button{padding:8px 10px;font-size:10px}
.repertoire-catalog-toolbar{grid-template-columns:minmax(0,1fr) 190px}
.repertoire-opening-catalog{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.repertoire-opening-item{display:grid;align-content:start;gap:7px;min-width:0;padding:13px;border:1px solid var(--border);border-radius:10px;background:var(--panel2)}
.repertoire-opening-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:9px}
.repertoire-opening-heading strong{font-size:12px;line-height:1.45}
.repertoire-opening-heading span{flex:0 0 auto;border:1px solid var(--border);border-radius:5px;padding:3px 5px;color:var(--green);font:9px "DM Mono",monospace}
.repertoire-opening-item p{margin:0;color:var(--muted);font-size:10px;line-height:1.65}
.repertoire-opening-item small{color:var(--text);font:9px/1.6 "DM Mono",monospace;overflow-wrap:anywhere}
.repertoire-opening-item button{justify-self:start;padding:7px 9px;font-size:10px}

@media(max-width:820px){
  .repertoire-import-grid{grid-template-columns:1fr}
}
@media(max-width:620px){
  .training-catalog-list,.endgame-scenario-list,.repertoire-opening-catalog{grid-template-columns:1fr}
  .training-filter-row,.repertoire-catalog-toolbar{grid-template-columns:1fr}
  .repertoire-metrics{gap:6px}
  .repertoire-metrics article{padding:11px}
  .repertoire-metrics article>span{font-size:8px}
  .repertoire-metrics article>strong{font-size:21px}
  .repertoire-line-card{align-items:flex-start;flex-direction:column}
  .repertoire-line-actions{width:100%}
  .repertoire-line-actions button{flex:1}
  .repertoire-grade-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}
  .repertoire-import-actions{align-items:stretch}
  .repertoire-import-actions .academy-field-label{width:100%}
  .repertoire-import-actions select,.repertoire-import-actions button,.repertoire-file-label{flex:1}
}


/* Lichess study import: deliberately scoped to the repertoire panel. */
.lichess-study-panel{display:grid;gap:12px;margin:18px 0 20px;padding:17px;border:1px solid var(--border);border-radius:12px;background:linear-gradient(135deg,var(--panel2),#8fdda408)}
.lichess-study-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.lichess-study-heading h4{margin:4px 0 5px;font-size:15px;letter-spacing:-.25px}
.lichess-study-heading p{margin:0;max-width:720px;color:var(--muted);font-size:10px;line-height:1.7}
.lichess-study-mark{display:grid;place-items:center;width:39px;height:39px;flex:0 0 auto;border:1px solid #8fdda455;border-radius:10px;background:#8fdda411;color:var(--green);font-size:22px}
.lichess-connection-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.lichess-connection-row button{padding:9px 12px;font-size:10px}
.lichess-account-label{margin-left:auto;color:var(--muted);font:9px "DM Mono",monospace}
.lichess-study-import-row{display:grid;grid-template-columns:minmax(0,1fr) 150px auto;align-items:end;gap:9px}
.lichess-study-import-row .academy-field-label{grid-column:auto;margin:0 0 -3px}
.lichess-study-import-row select{min-width:0}
.lichess-study-import-row button{height:39px;padding:9px 12px;font-size:10px}
.lichess-privacy-note{color:var(--muted);font-size:9px;line-height:1.65}
.lichess-study-panel .academy-feedback{margin:0}
@media(max-width:720px){.lichess-study-import-row{grid-template-columns:1fr 1fr}.lichess-study-import-row .academy-field-label{display:none}.lichess-study-import-row select:first-of-type{grid-column:1/-1}.lichess-study-import-row button{grid-column:1/-1}}
@media(max-width:540px){.lichess-study-panel{padding:13px}.lichess-account-label{width:100%;margin:2px 0 0}.lichess-connection-row button{flex:1}.lichess-study-import-row{grid-template-columns:1fr}.lichess-study-import-row select:first-of-type{grid-column:auto}}


/* Position-aware AI coach. Scoped styles leave the existing chessboard untouched. */
.ai-coach-workspace{display:grid;gap:15px}
.ai-coach-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.ai-coach-heading h3{font-size:20px;margin:5px 0}
.ai-coach-heading .academy-card-copy{margin:0;max-width:760px}
.ai-coach-mark{display:grid;place-items:center;width:42px;height:42px;flex:0 0 auto;border:1px solid #c4f36a55;border-radius:12px;background:#c4f36a12;color:var(--green);font-size:23px}
.coach-key-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,1.05fr);gap:13px;padding:15px;border:1px solid var(--border);border-radius:11px;background:var(--panel2)}
.coach-key-copy strong{font-size:12px}
.coach-key-copy p{margin:6px 0;color:var(--muted);font-size:10px;line-height:1.65}
.coach-key-copy a{color:var(--green);font-size:10px;text-decoration:none}
.coach-key-copy a:hover{text-decoration:underline}
.coach-key-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-content:start}
.coach-key-controls input{min-width:0}
.coach-key-controls button{font-size:10px;padding:9px 11px}
.coach-key-state{grid-column:1/-1;color:var(--muted);font:9px "DM Mono",monospace}
.coach-model-row{grid-column:1/-1;display:grid;grid-template-columns:100px minmax(0,1fr);align-items:center;gap:10px}
.coach-model-row .academy-field-label{margin:0}
.coach-context-note{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:10px;line-height:1.6}
.coach-chat-messages{display:grid;gap:10px;max-height:440px;min-height:190px;overflow:auto;padding:14px;border:1px solid var(--border);border-radius:11px;background:var(--panel2)}
.coach-empty-state{align-self:center;max-width:620px;color:var(--muted);font-size:11px;line-height:1.8}
.coach-message{max-width:min(88%,760px);padding:12px 14px;border:1px solid var(--border);border-radius:11px;background:var(--panel);justify-self:start}
.coach-message-user{justify-self:end;border-color:#8fdda455;background:#8fdda40d}
.coach-message-label{display:block;margin-bottom:6px;color:var(--green);font:8px "DM Mono",monospace;letter-spacing:.08em}
.coach-message p{margin:0;color:var(--text);font-size:11px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.coach-quick-prompts{display:flex;gap:7px;flex-wrap:wrap}
.coach-quick-prompts button{padding:8px 10px;font-size:9px}
.coach-chat-form{display:grid;gap:8px}
.coach-chat-form textarea{width:100%;resize:vertical;min-height:76px}
.coach-chat-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.coach-chat-actions small{margin-right:auto;color:var(--muted);font-size:9px}
.coach-chat-actions button{padding:9px 12px;font-size:10px}
.coach-privacy-note{display:block;color:var(--muted);font-size:9px;line-height:1.7}
.ai-coach-workspace .academy-feedback{margin:0}
@media(max-width:760px){.coach-key-panel{grid-template-columns:1fr}.coach-message{max-width:96%}.coach-model-row{grid-template-columns:1fr}.coach-chat-actions{justify-content:flex-start}.coach-chat-actions small{width:100%}}
@media(max-width:540px){.coach-key-controls{grid-template-columns:1fr}.coach-key-state{grid-column:auto}.coach-quick-prompts button{flex:1}.ai-coach-heading h3{font-size:18px}}


/* ================================================================
   Chess Vision responsive mobile layout
   Desktop layout remains unchanged above the 760px breakpoint.
   ================================================================ */
.mobile-nav-toggle{display:none}

@media(max-width:760px){
  html{scroll-padding-top:78px;-webkit-text-size-adjust:100%}
  body{min-width:320px;overflow-x:hidden}
  body,button,input,select,textarea{font-size:14px}

  /* Compact app header with an expandable, touch-friendly navigation drawer. */
  .topbar{
    position:sticky!important;top:0;inset:auto;z-index:300;
    display:grid!important;grid-template-columns:minmax(0,1fr) auto;
    grid-template-rows:auto auto;align-items:center;gap:0 12px;
    width:100%!important;height:auto!important;min-height:62px;
    max-width:none;padding:8px max(13px,env(safe-area-inset-left)) 8px max(13px,env(safe-area-inset-right))!important;
    overflow:visible;background:#101114!important;
    border:0!important;border-bottom:1px solid #303137!important;
    box-shadow:0 8px 24px #0005;backdrop-filter:blur(16px);
  }
  .sidebar-brand-row{
    display:flex!important;grid-column:1;grid-row:1;
    align-items:center;justify-content:flex-start;gap:9px;min-width:0;width:auto;
  }
  .sidebar-brand-row .brand{
    display:flex!important;grid-column:auto;grid-row:auto;
    justify-content:flex-start;gap:9px;min-width:0;min-height:44px;padding:0;
  }
  .brand-mark{width:38px!important;height:38px!important;flex:0 0 38px;font-size:22px!important}
  .brand-wordmark{display:flex!important;gap:3px;font-size:12px;letter-spacing:.8px}
  .brand-wordmark>small{display:block!important;font-size:8px;letter-spacing:1px}
  .sidebar-collapse-toggle{display:none!important}
  .sidebar-caption{display:none!important}
  .sidebar-bottom{
    display:flex!important;grid-column:2;grid-row:1;align-items:center;
    justify-content:flex-end;gap:8px;width:auto;margin:0;padding:0;border:0;
  }
  .sidebar-engine-card{display:none!important}
  .sidebar-theme-row{display:flex!important;align-items:center;gap:7px;padding:0}
  .sidebar-theme-row>span{display:none!important}
  .sidebar-theme-row .icon-button{
    width:40px;height:40px;border-radius:11px;background:#ffffff08;
    border-color:#393940;color:#f7c75a;font-size:19px;
  }
  .mobile-nav-toggle{
    display:grid!important;place-items:center;flex:0 0 40px;
    width:40px;height:40px;padding:0;border:1px solid #393940;
    border-radius:11px;background:#ffffff08;color:#f4f4f5;
    font:700 20px/1 Inter,system-ui,sans-serif;cursor:pointer;
  }
  .mobile-nav-toggle:hover,.mobile-nav-toggle[aria-expanded="true"]{
    border-color:#9a681f;background:#f59e0b18;color:#ffd26a;
  }
  nav.main-nav{
    display:none!important;grid-column:1/-1;grid-row:2;
    flex:0 1 auto;flex-direction:column;align-items:stretch;justify-content:flex-start;
    gap:5px;width:100%;max-width:none;max-height:min(70dvh,560px);
    margin:8px 0 0;padding:10px 0 4px;
    overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
    border-top:1px solid #303137;border-radius:0;background:transparent;
    scrollbar-width:thin;
  }
  body.mobile-nav-open nav.main-nav{display:flex!important}
  nav.main-nav .nav-link{
    display:flex;flex:0 0 auto;align-items:center;justify-content:flex-start;
    gap:12px;width:100%;min-height:45px;height:auto;padding:10px 12px;
    border:1px solid transparent;border-radius:10px;
    font:650 14px Inter,system-ui,sans-serif;text-align:left;white-space:normal;
  }
  nav.main-nav .nav-link:hover{transform:none}
  .nav-symbol{display:grid!important;width:27px;height:27px;flex-basis:27px;font-size:18px}
  .nav-text{display:block!important}
  .nav-section-label{
    display:block!important;padding:11px 11px 3px;margin-top:3px;
    color:#85858e;font:800 9px "JetBrains Mono",monospace;letter-spacing:1.4px;
  }
  .nav-dropdown{display:block;position:relative;width:100%;flex:0 0 auto}
  .nav-learn-row{display:flex;width:100%;align-items:center;gap:5px}
  .nav-learn-row .nav-learn-page{flex:1 1 auto;width:auto;min-width:0}
  .nav-learn-menu-toggle{
    display:grid;place-items:center;flex:0 0 40px;width:40px;height:42px;
    border:1px solid #393940;border-radius:9px;background:#ffffff06;color:#c5c5cc;
    font-size:18px;
  }
  .nav-dropdown-menu{
    position:static!important;inset:auto!important;display:grid;
    width:100%!important;max-width:none!important;margin:5px 0 6px;
    padding:7px 8px 8px 17px!important;
    border:0!important;border-left:1px solid #6b5124!important;
    border-radius:0!important;background:transparent!important;
    box-shadow:none!important;backdrop-filter:none!important;
  }
  .nav-dropdown-menu[hidden]{display:none!important}
  .nav-dropdown-menu button{min-height:42px;padding:9px 10px;font-size:13px}
  .nav-dropdown-menu .nav-dropdown-label{font-size:9px}

  body.light .topbar{background:#fbfbf9!important;border-color:#dedbd4!important}
  body.light .mobile-nav-toggle{background:#fff;border-color:#dedbd4;color:#27272a}
  body.light .sidebar-theme-row .icon-button{background:#fff;border-color:#dedbd4;color:#956a16}
  body.light nav.main-nav{border-color:#dedbd4;background:#fbfbf9}
  body.light nav.main-nav .nav-link{color:#56575e}
  body.light nav.main-nav .nav-link:hover{background:#f1f0ec;color:#18181b}
  body.light .nav-dropdown-menu button{color:#56575e}

  /* Main content uses the full phone width with no fixed-sidebar offset. */
  main,body[data-page="analyzer"] main,body.sidebar-collapsed main,
  body.sidebar-collapsed[data-page="analyzer"] main{
    display:flex;flex-direction:column;width:100%!important;max-width:none!important;
    min-width:0;margin:0!important;padding:0 14px calc(28px + env(safe-area-inset-bottom))!important;
  }
  .content-utility-bar{
    min-height:42px;margin:0 0 16px;padding:0 1px;
    gap:8px;font-size:8px;letter-spacing:.65px;
  }
  .content-utility-bar span{gap:6px}
  .content-utility-bar strong{display:none}
  main>section,.home-page,.dashboard-page,.learn-page,.workspace,
  .academy-section,.chesscom-section,.how-section{width:100%;min-width:0;max-width:100%}
  .home-page,.dashboard-page{padding-top:18px}
  .workspace{padding-top:20px}
  .section-heading{align-items:flex-start;gap:10px;margin-bottom:15px}
  .section-heading h2,.academy-card-heading h3,.game-review-section-head h3{font-size:21px}
  .section-heading>.status-pill{flex:0 0 auto;padding:6px 8px;font-size:9px}
  .eyebrow,.panel-label,.result-kicker,.game-review-kicker,.mono{
    font-size:9px!important;letter-spacing:1px;
  }
  .hero{padding:42px 0 30px}
  .hero h1,.home-hero h1,.dashboard-heading h1{
    font-size:clamp(34px,8.5vw,48px);letter-spacing:-1.5px;line-height:1.08;
  }
  .home-hero{grid-template-columns:minmax(0,1fr);gap:20px;min-height:0;padding:12px 0 25px}
  .home-hero-copy>p,.home-page p,.dashboard-page p,.hero-copy,.how-section p{font-size:13px;line-height:1.65}
  .home-trust-line{display:flex;flex-wrap:wrap;gap:7px;font-size:8px}
  .home-actions{display:grid;grid-template-columns:1fr;gap:8px}
  .home-actions button{width:100%;min-height:44px}
  .home-visual-card{width:100%;max-width:100%;transform:none}
  .home-feature-grid{grid-template-columns:1fr;gap:10px}
  .home-feature-card{min-height:0;padding:16px}
  .home-section-heading,.dashboard-heading{align-items:flex-start;flex-direction:column;gap:8px}
  .home-profile-status{text-align:left}
  .home-bottom-strip{align-items:flex-start;flex-direction:column;gap:10px}
  .home-bottom-strip button{width:100%}

  /* Analyzer: board first, readable engine report below it. */
  .analyzer-grid,#analyzer .analyzer-grid{
    display:grid;grid-template-columns:minmax(0,1fr)!important;
    align-items:stretch;gap:12px;width:100%;min-width:0;padding:0;
  }
  #analyzer .analyzer-grid>.panel,.board-panel,.results-panel{
    width:100%;min-width:0;max-width:100%;min-height:0;
    padding:12px;border-radius:13px;
  }
  #analyzer .analyzer-grid>.board-panel.panel,
  #analyzer .analyzer-grid>.results-panel.panel{min-height:0}
  .panel-top{align-items:center;gap:8px;margin-bottom:11px}
  .board-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-wrap:wrap}
  .board-actions .quiet-button{min-height:36px;padding:6px 8px;font-size:11px}
  .eval-score-pill{min-width:52px;padding:6px 5px;font-size:8px}
  .board-surround,#analyzer .board-surround{
    width:min(100%,560px);max-width:560px;margin:0 auto;
  }
  #board{width:100%;max-width:560px}
  .rank-labels{font-size:10px}
  .file-labels{padding-top:6px;font-size:10px}
  .board-footer{align-items:flex-start;gap:8px;margin:10px 0 13px;font-size:10px}
  .board-footer span:last-child{font-size:8px;text-align:right}
  .arrow-legend{flex-wrap:wrap;justify-content:flex-start;gap:8px;margin-top:7px;font-size:9px}
  .checkmate-banner{gap:9px;padding:10px}
  .position-input{gap:8px;padding-top:13px}
  .position-input>label,.academy-field-label{font-size:10px}
  .input-row{display:flex;align-items:stretch;gap:7px;flex-wrap:wrap}
  .input-row input:not([type=file]){flex:1 1 180px;min-width:0;width:auto;min-height:43px;font-size:13px}
  .input-row .small-button{min-height:42px}
  .pgn-row{display:grid;grid-template-columns:minmax(0,1fr) auto}
  .pgn-row input{width:100%;min-width:0}
  .turn-select{max-width:130px;min-height:40px}
  .upload-button{display:inline-flex;align-items:center;justify-content:center;min-height:40px}
  .image-preview{max-height:220px}
  .results-panel{min-height:0;overflow:hidden}
  .empty-analysis{min-height:250px;padding:18px 10px}
  .best-move-block{padding:15px 0}
  .best-move-line{flex-wrap:wrap;gap:7px}
  .best-move-line strong{font-size:27px}
  .candidate-row{grid-template-columns:24px minmax(0,1fr) auto;gap:7px;padding:10px 0;font-size:10px}
  .candidate-line{overflow-wrap:anywhere}
  .brilliant-block{gap:9px;padding:12px}
  .engine-footer{flex-wrap:wrap;font-size:9px}

  /* Dashboard and training pages. */
  .dashboard-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:8px}
  .dashboard-actions button{min-width:0;min-height:42px;padding:10px}
  .dashboard-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .dashboard-metric{min-width:0;padding:12px}
  .dashboard-metric>span{font-size:8px;letter-spacing:.65px}
  .dashboard-metric>strong{font-size:23px}
  .dashboard-metric>small{font-size:10px;line-height:1.4}
  .dashboard-main-grid,.dashboard-insight-grid,.dashboard-bottom-grid{grid-template-columns:minmax(0,1fr);gap:11px}
  .dashboard-card{min-width:0;padding:13px}
  .dashboard-card-heading{align-items:flex-start;gap:8px;flex-wrap:wrap}
  .dashboard-card-heading h2{font-size:17px}
  .dashboard-recent-row{grid-template-columns:minmax(0,1fr) auto;gap:7px}
  .dashboard-recent-row .text-action{grid-column:1/-1;justify-self:start}
  .academy-section{padding:22px 0 28px}
  .academy-grid,.opening-card-grid,.learn-path-grid{grid-template-columns:minmax(0,1fr)}
  .academy-card{min-width:0;padding:13px}
  .academy-progress{grid-template-columns:1fr 1fr;gap:12px;padding:13px}
  .academy-progress-main{grid-column:1/-1}
  .academy-progress-stat{padding:10px 0 0;border:0;border-top:1px solid var(--border)}
  .academy-card-heading{align-items:flex-start;gap:9px}
  .academy-card-heading h3{font-size:17px}
  .challenge-card-top{align-items:flex-start;flex-direction:column;gap:5px}
  .opening-card{padding:12px}
  .chesscom-layout{grid-template-columns:minmax(0,1fr);gap:12px}
  .chesscom-form-card,.chesscom-results-card{min-width:0;padding:14px}
  .chesscom-search-form{gap:9px}
  .chesscom-search-form input{min-height:44px}
  .chesscom-game-row,.chesscom-library-card{min-width:0}
  .chesscom-game-row{grid-template-columns:minmax(0,1fr) auto;gap:8px}
  .training-library-heading,.repertoire-section-heading{align-items:flex-start;flex-direction:column;gap:7px}
  .repertoire-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .repertoire-metrics article{min-width:0;padding:9px}
  .repertoire-metrics article>strong{font-size:19px}
  .repertoire-import-grid,.repertoire-import-panel{grid-template-columns:minmax(0,1fr)}
  .repertoire-line-card{align-items:flex-start;flex-direction:column}
  .repertoire-line-actions{width:100%}
  .repertoire-line-actions button{flex:1;min-height:40px}
  .repertoire-grade-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}
  .repertoire-opening-catalog,.training-catalog-list,.endgame-scenario-list{grid-template-columns:minmax(0,1fr)}
  .repertoire-catalog-toolbar,.training-filter-row{grid-template-columns:minmax(0,1fr)}
  .coach-chat-messages{max-height:52vh;min-height:160px;padding:10px}
  .coach-chat-form textarea{font-size:16px}
  .coach-chat-actions{justify-content:stretch}
  .coach-chat-actions button{flex:1;min-height:42px}
  .coach-quick-prompts button{min-height:38px}
  .how-section{padding:42px 0}
  .how-section h2{font-size:34px}
  .principles{grid-template-columns:minmax(0,1fr);gap:15px}
  footer{flex-wrap:wrap;gap:9px;padding:18px 0}
  footer .mono{display:none}

  /* Game Review becomes a vertical, phone-width workflow. */
  .game-review-overlay{
    width:100%;min-width:0;min-height:0;padding:0 0 24px;
  }
  .game-review-dialog{width:100%;max-width:none;margin:0;border:0;border-radius:0}
  .game-review-header{
    position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:8px;
    margin:0 -14px;padding:9px 14px;background:#101114;
    border-bottom:1px solid #303137;
  }
  .game-review-brand{min-width:0;gap:8px}
  .game-review-brand h2{font-size:17px}
  .game-review-header-actions{min-width:0;gap:7px}
  .game-review-engine-status{max-width:42vw;font-size:9px;line-height:1.35}
  .game-review-close{width:38px;height:38px;flex:0 0 38px}
  .game-review-summary-view{padding-top:12px}
  .game-review-summary-banner{align-items:stretch;flex-direction:column;gap:12px;padding:14px}
  .game-review-summary-title h2{font-size:22px;line-height:1.15}
  .game-review-summary-title p{font-size:11px;line-height:1.55}
  .game-review-summary-progress{width:100%;flex:0 0 auto}
  .game-review-performance-panel{margin:0 0 12px;padding:12px;border-radius:12px}
  .game-review-performance-heading{align-items:flex-start;flex-direction:column;gap:5px}
  .game-review-performance-heading h3{font-size:13px}
  .game-review-performance-graph{min-height:60px;margin-bottom:10px}
  .game-review-performance-graph svg{height:60px}
  .review-player-cards{grid-template-columns:minmax(0,1fr);gap:9px}
  .review-player-card{padding:12px}
  .review-player-score{font-size:26px}
  .review-player-quality-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  .review-player-quality-item{padding:7px 5px}
  .review-player-quality-item small{font-size:8px}
  .review-player-extra{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
  .review-player-extra-item{padding:8px 6px}
  .review-player-extra-item>small{font-size:8px;line-height:1.35}
  .review-player-extra-item>strong{font-size:10px;overflow-wrap:anywhere;white-space:normal}
  .game-review-summary-grid{grid-template-columns:minmax(0,1fr);gap:11px}
  .game-review-summary-left,.game-review-summary-right{min-width:0;width:100%}
  .game-review-summary-board-card,.game-review-summary-card{min-width:0;padding:11px}
  .game-review-summary-board-heading{gap:7px}
  .game-review-board{width:min(100%,560px)!important;max-width:560px;margin-inline:auto}
  .game-review-board-caption{align-items:flex-start;gap:6px;flex-wrap:wrap;font-size:10px}
  .game-review-summary-actions button{width:100%;min-height:44px}
  .game-review-summary-card-heading{align-items:flex-start;gap:6px;flex-wrap:wrap}
  .review-category-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
  .review-category-table{min-width:310px}
  .game-review-brilliant-move{align-items:flex-start;gap:8px;padding:9px}
  .game-review-disclaimer{font-size:9px;line-height:1.6}
  .game-review-guided-view{padding:12px 0 26px}
  .game-review-guided-top{display:flex;align-items:center;gap:8px;padding-bottom:10px}
  .game-review-guided-top .game-review-back-btn{min-height:38px}
  .game-review-step-label{flex:1;min-width:0}
  .game-review-move-owner{order:4;width:100%;max-width:100%;white-space:normal}
  .game-review-layout{grid-template-columns:minmax(0,1fr);gap:11px}
  .game-review-board-column,.game-review-coach-column{min-width:0;width:100%;padding:11px}
  .game-review-coach-card,.game-review-moves-card{min-width:0;padding:12px}
  .game-review-coach-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .game-review-coach-actions button{min-height:42px}
  .game-review-moves-card{max-height:none}
  .game-review-move-list{max-height:340px;overflow:auto;overscroll-behavior:contain}
  .game-review-playback{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
  .game-review-playback button{min-width:0;min-height:44px}
  .game-review-graph-card{min-width:0;padding:10px}
  .game-review-graph{max-width:100%;overflow:hidden}
}

@media(max-width:540px){
  main,body[data-page="analyzer"] main,body.sidebar-collapsed main,
  body.sidebar-collapsed[data-page="analyzer"] main{padding-right:11px!important;padding-left:11px!important}
  .topbar{padding-left:max(11px,env(safe-area-inset-left))!important;padding-right:max(11px,env(safe-area-inset-right))!important}
  .content-utility-bar{font-size:7px;letter-spacing:.5px}
  .section-heading h2{font-size:19px}
  .board-panel,.results-panel{padding:10px}
  .panel-top{align-items:flex-start}
  .board-surround,#analyzer .board-surround{width:100%}
  .rank-labels{font-size:9px}
  .file-labels{font-size:9px}
  .board-actions{gap:4px}
  .board-actions .quiet-button{padding:6px;font-size:10px}
  .evaluation-end-score{font-size:7px}
  .eval-score-pill{font-size:7px;min-width:46px}
  .home-hero h1{font-size:clamp(32px,9.5vw,42px)}
  .home-trust-line{font-size:7px}
  .dashboard-actions{grid-template-columns:1fr}
  .dashboard-metric-grid{gap:7px}
  .dashboard-metric{padding:10px}
  .dashboard-metric>strong{font-size:21px}
  .academy-progress{gap:9px;padding:11px}
  .repertoire-metrics article>span{font-size:7px;letter-spacing:0}
  .repertoire-metrics article>strong{font-size:17px}
  .game-review-header{margin:0 -11px;padding:8px 11px}
  .game-review-brand h2{font-size:15px}
  .game-review-engine-status{font-size:8px;max-width:38vw}
  .review-player-quality-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .review-player-quality-item{grid-template-columns:14px minmax(0,1fr);column-gap:3px}
  .review-player-quality-item strong{font-size:10px}
  .review-player-quality-item small{font-size:7px}
  .review-player-extra-item>small{font-size:7px;letter-spacing:.2px}
  .game-review-summary-title h2{font-size:20px}
  .game-review-move-main{max-width:68%}
  .game-review-move-owner{font-size:8px}
  .game-review-playback{gap:5px}
  .game-review-playback button{padding:8px 4px}
  .checkmate-flair{display:none}
  .line-explorer-controls{padding:10px}
  .line-explorer-buttons{grid-template-columns:1fr 1fr}
}

@media(max-width:380px){
  .brand-wordmark{font-size:10px;letter-spacing:.45px}
  .brand-wordmark>small{font-size:7px}
  .brand-mark{width:34px!important;height:34px!important;flex-basis:34px}
  .mobile-nav-toggle,.sidebar-theme-row .icon-button{width:36px;height:36px;flex-basis:36px}
  .sidebar-theme-row{gap:5px}
  .panel-top{flex-wrap:wrap}
  .board-surround,#analyzer .board-surround{grid-template-columns:32px 12px minmax(0,1fr);column-gap:3px}
  .evaluation-gauge .evaluation-rail{width:8px}
  .evaluation-end-score{font-size:6px;letter-spacing:-.5px}
  .dashboard-metric>span{font-size:7px}
  .review-player-quality-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .review-player-extra{grid-template-columns:1fr 1fr}
  .game-review-summary-banner{padding:11px}
  .game-review-guided-top{gap:6px}
  .game-review-step-label{font-size:9px}
}

@media(prefers-reduced-motion:reduce){
  .topbar,nav.main-nav,.mobile-nav-toggle{scroll-behavior:auto;transition:none!important}
}


/* Mobile must ignore any desktop-only collapsed-sidebar preference. */
@media(max-width:760px){
  body.sidebar-collapsed .sidebar-brand-row{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important}
  body.sidebar-collapsed .brand-wordmark{display:flex!important}
  body.sidebar-collapsed nav.main-nav{align-items:stretch!important;margin:8px 0 0!important}
  body.sidebar-collapsed nav.main-nav .nav-link{
    justify-content:flex-start!important;gap:12px!important;
    width:100%!important;height:auto!important;min-height:45px!important;padding:10px 12px!important;
  }
  body.sidebar-collapsed .nav-section-label{display:block!important}
  body.sidebar-collapsed .nav-dropdown{width:100%!important}
  body.sidebar-collapsed .nav-learn-row{width:100%!important;justify-content:stretch!important;gap:5px!important}
  body.sidebar-collapsed .nav-learn-row .nav-learn-page{width:auto!important;flex:1 1 auto!important}
  body.sidebar-collapsed .nav-learn-menu-toggle{
    position:static!important;right:auto!important;top:auto!important;
    width:40px!important;height:42px!important;flex:0 0 40px!important;
    padding:0!important;border-radius:9px!important;font-size:18px!important;
  }
  body.sidebar-collapsed .nav-dropdown-menu{
    position:static!important;top:auto!important;left:auto!important;right:auto!important;
    width:100%!important;max-width:none!important;margin:5px 0 6px!important;
    padding:7px 8px 8px 17px!important;border:0!important;
    border-left:1px solid #6b5124!important;border-radius:0!important;
    background:transparent!important;box-shadow:none!important;
  }
  body.sidebar-collapsed .sidebar-theme-row>span{display:none!important}
}
