:root { color-scheme: dark; --bg:#11130f; --surface:#1a1d18; --surface-2:#22251f; --line:#30342c; --muted:#979d91; --text:#f1f3ed; --green:#a8c66c; --green-deep:#718e3f; --cream:#ddd8c7; --brown:#70815a; font-family:"DM Sans",system-ui,sans-serif; }
* { box-sizing:border-box; }
html,body { width:100%;height:100%;overflow:hidden; }
body { margin:0; background:radial-gradient(circle at 20% 0%,#25291f 0,transparent 33%),var(--bg); color:var(--text); min-height:100vh; }
button,a { font:inherit; }
button { color:inherit; }
.app-shell { min-height:100vh; }
.topbar { height:72px; padding:0 clamp(20px,4vw,56px); display:flex; align-items:center; border-bottom:1px solid #292c26; background:rgba(17,19,15,.86); backdrop-filter:blur(18px); position:relative; z-index:5; }
.brand { color:var(--text); text-decoration:none; display:flex; align-items:center; gap:12px; letter-spacing:.14em; font:700 14px Manrope,sans-serif; }
.brand>span { width:34px;height:34px;border:1px solid #78825e;border-radius:10px;display:grid;place-items:center;color:#cadd96;font-size:17px;box-shadow:inset 0 0 0 3px #1d2119; }
.brand-mark { display:block;width:100%;height:100%;object-fit:contain; }
.top-status { margin:auto; color:#a8ada2; font-size:13px; display:flex; align-items:center; gap:8px; }
.online-dot { width:7px;height:7px;border-radius:50%;background:var(--green);box-shadow:0 0 0 4px #9cbd6120; }
.avatar { border:1px solid #3c4137; background:#252922; width:36px;height:36px;border-radius:50%;font-weight:700;font-size:11px;cursor:pointer; }
.workspace { width:min(1440px,100%); min-height:calc(100vh - 72px); margin:auto; display:grid; grid-template-columns:minmax(540px,1fr) 440px; }
.board-area { padding:clamp(28px,4vw,58px); display:flex; flex-direction:column; justify-content:center; min-width:0; }
.board-header,.board-footer { width:min(100%,760px); margin-inline:auto; display:flex; justify-content:space-between; align-items:center; }
.board-header { margin-bottom:14px; }
.board-header div { display:grid;gap:3px; }.board-header small,.eyebrow { color:var(--green); font-size:10px;letter-spacing:.14em;font-weight:700; }.board-header strong { font-size:14px;font-weight:600; }
.icon-button { border:1px solid var(--line);background:#1c1f1a;border-radius:9px;width:34px;height:34px;cursor:pointer;color:#acb1a6; }
.board-shell { width:min(100%,760px); margin:auto; padding:10px; border-radius:14px; background:#292c26; box-shadow:0 28px 80px #0008,0 0 0 1px #3b4036; }
.board { display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));width:100%;height:100%;aspect-ratio:1;border-radius:7px;overflow:hidden; }
.square { border:0;border-radius:0;padding:0;position:relative;display:grid;place-items:center;cursor:pointer;min-width:0;min-height:0;overflow:hidden; }
.square.light { background:#d8d6c2; }.square.dark { background:#70815a; }
.square.last:after { content:"";position:absolute;inset:0;background:#d5db5570; }
.square.selected:after { content:"";position:absolute;inset:0;box-shadow:inset 0 0 0 4px #dbea87;background:#e6ee7540; }
.square.target:before { content:"";width:20%;height:20%;border-radius:50%;background:#29312466;position:absolute;z-index:2; }
.square.capture:before { content:"";inset:7%;border:5px solid #29312466;border-radius:50%;position:absolute;z-index:2; }
.square.hint { animation:hint 1.2s infinite;box-shadow:inset 0 0 0 5px #f4d872; }
@keyframes hint { 50% { box-shadow:inset 0 0 0 5px #f4d87255; } }
.piece { position:relative;z-index:3;font-family:"Arial Unicode MS","Apple Symbols",serif;font-size:clamp(36px,6.6vw,78px);line-height:1;cursor:grab;user-select:none;filter:drop-shadow(0 3px 1px #0005);transform:translateY(-1%); }
.piece:active { cursor:grabbing; }.white-piece { color:#f6f2de;text-shadow:0 0 1px #23251e,1px 1px 0 #3a3d35,-1px -1px 0 #3a3d35; }.black-piece { color:#20231e;text-shadow:0 1px 0 #64705a; }
.rank,.file { position:absolute;z-index:4;font-size:9px;font-weight:700;opacity:.72;pointer-events:none; }.rank{top:5px;left:6px}.file{right:6px;bottom:4px}.light .rank,.light .file{color:#617151}.dark .rank,.dark .file{color:#e4e2ce}
.board-footer { padding-top:12px;color:#858b80;font-size:11px; }.orientation{letter-spacing:.1em;font-size:9px;}
.sidebar { border-left:1px solid #2b2e28; background:#171916; display:flex;flex-direction:column;min-height:calc(100vh - 72px); }
.tabs { display:grid;grid-template-columns:1fr 1fr;padding:18px 22px 0;gap:7px;border-bottom:1px solid #2b2e28; }
.tabs button { border:0;border-bottom:2px solid transparent;background:transparent;color:#858b80;padding:13px 8px 16px;cursor:pointer;font-weight:600;font-size:13px; }.tabs button span{margin-right:7px}.tabs button.active{color:#e9ece4;border-color:var(--green)}
.panel-content { padding:32px;display:flex;flex-direction:column;gap:25px;min-height:0;flex:1; }
h1 { font:700 30px/1.15 Manrope,sans-serif;letter-spacing:-.04em;margin:8px 0 9px; }.muted { color:var(--muted);font-size:13px;line-height:1.55;margin:0; }
.turn-card,.coach { display:flex;align-items:center;gap:14px;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:15px 16px; }.turn-card div,.coach div{display:grid;gap:2px}.turn-card small,.coach small,.mastery small{font-size:9px;letter-spacing:.13em;color:#81877c;font-weight:700}.turn-card strong,.coach strong{font-size:13px}.turn-dot{width:30px;height:30px;border-radius:50%;border:2px solid #555b50}.turn-dot.w{background:#f0eddc;box-shadow:inset 0 0 0 5px #c5c3b5}.turn-dot.b{background:#272a25;box-shadow:inset 0 0 0 5px #151713}
.move-list { background:#141613;border:1px solid #292d26;border-radius:12px;min-height:220px;max-height:35vh;overflow:auto;padding:15px;display:grid;grid-template-columns:30px 1fr 1fr;align-content:start;gap:7px 8px;font-size:12px; }.move-no{color:#666c62}.empty-moves{grid-column:1/-1;min-height:185px;display:grid;place-content:center;text-align:center;color:#656b61}.empty-moves span{font-size:28px}.empty-moves p{font-size:11px}
.panel-actions { display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:auto; }.secondary,.primary { border-radius:10px;padding:13px 16px;font-weight:700;font-size:12px;cursor:pointer; }.secondary{border:1px solid #363b31;background:#22251f}.secondary:disabled{opacity:.35;cursor:default}.primary{border:1px solid #bddb7c;background:var(--green);color:#18200e;box-shadow:0 8px 25px #9ab45f25}.full{width:100%}
.mastery { display:flex;align-items:center;gap:17px;background:linear-gradient(135deg,#22261f,#1c1f1a);border:1px solid #30352b;border-radius:13px;padding:17px; }.mastery-ring{--p:0deg;width:62px;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--green) var(--p),#3a3e35 0);position:relative}.mastery-ring:before{content:"";position:absolute;inset:5px;border-radius:50%;background:#20231e}.mastery-ring span{position:relative;font-weight:700;font-size:16px}.mastery-ring small{font-size:9px}.mastery>div:last-child{display:grid;gap:2px}.mastery strong{font-size:13px}.mastery p{margin:0;color:#777d72;font-size:10px}
.line-heading{display:flex;justify-content:space-between;align-items:center;font-size:12px}.line-heading span{color:#777d72;font-size:10px}.lines{display:grid;gap:7px}.line-card{width:100%;display:grid;grid-template-columns:32px 1fr auto 10px;align-items:center;gap:11px;text-align:left;background:#1d201b;border:1px solid #2b2f28;border-radius:11px;padding:12px;cursor:pointer;transition:.18s ease}.line-card:hover{transform:translateX(-3px);border-color:#5d6949;background:#22261f}.line-index{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:#2a2e27;color:#b9c0b1;font-size:11px;font-weight:700}.line-card>span:nth-child(2){display:grid;gap:3px}.line-card strong{font-size:12px}.line-card small{color:#7d8378;font-size:9px}.line-card>b{color:#777d72}.line-stars{display:flex;gap:3px}.line-stars i{width:5px;height:5px;border-radius:50%;background:#42473d}.line-stars i.filled{background:var(--green);box-shadow:0 0 5px #a8c66c88}
.text-button{align-self:flex-start;border:0;background:transparent;padding:0;color:#92998d;font-size:11px;cursor:pointer}.progress-track{height:4px;background:#30342d;border-radius:3px;overflow:hidden}.progress-track i{display:block;height:100%;background:var(--green);transition:width .3s}.coach{border-color:#455136;background:#20251d}.coach>span{color:var(--green);font-size:21px}.coach.wrong{border-color:#6a443c;background:#2a211e}.coach.wrong>span{color:#d68772}.notation{display:flex;flex-wrap:wrap;gap:7px;background:#131512;border:1px solid #292c26;border-radius:10px;padding:14px;font-size:14px;line-height:1.7}.notation span{color:#555b51}.notation span.done{color:#8d9488}.notation span.current{color:var(--ember-deep);background:#db56281f;border-radius:4px;padding:0 4px}.tip{color:#686e64;font-size:10px;text-align:center;margin-top:auto}.complete-panel{text-align:center;justify-content:center}.success-mark{margin:0 auto 5px;width:62px;height:62px;border-radius:50%;display:grid;place-items:center;background:#a8c66c1c;border:1px solid #809b4f;color:var(--green);font-size:27px}.complete-panel .primary{margin-top:8px}
@media(max-width:1000px){.workspace{grid-template-columns:minmax(460px,1fr) 370px}.board-area{padding:30px}.panel-content{padding:25px}.piece{font-size:clamp(32px,6.5vw,65px)}}
@media(max-width:760px){.topbar{height:60px;padding:0 16px}.top-status{display:none}.workspace{display:flex;flex-direction:column;min-height:calc(100vh - 60px)}.board-area{padding:18px 14px 24px}.board-shell{padding:6px}.sidebar{border-left:0;border-top:1px solid #2b2e28;min-height:auto}.tabs{position:sticky;top:0;background:#171916;z-index:8;padding-top:8px}.panel-content{padding:24px 20px 32px;min-height:500px}.piece{font-size:clamp(36px,11.5vw,72px)}.brand strong{font-size:12px}}

/* Refined lesson-first layout */
:root { --bg:#07080a; --surface:#101114; --surface-2:#202126; --line:#292a2f; --muted:#96969e; --text:#f6f6f7; --green:#9f7aea; --cream:#f1dfbc; --brown:#c9a277; }
body { background:var(--bg); }
.app-shell { width:100%;height:100dvh;min-height:0;padding:clamp(12px,2vh,28px);display:grid;place-items:center;overflow:hidden; }
.workspace { width:min(1800px,100%);height:100%;min-height:0;max-height:1180px;display:grid;grid-template-columns:minmax(0,1fr) minmax(430px,560px);gap:clamp(16px,2vw,28px);overflow:hidden; }
.board-area { padding:0;min-width:0;min-height:0;height:100%;display:flex;flex-direction:column;justify-content:center;overflow:hidden; }
.board-header { width:min(100%,calc(100vh - 120px)); max-width:1050px; margin:0 auto 12px; min-height:42px; justify-content:flex-start; gap:12px; }
.board-header .brand { margin-right:3px; }.board-header .brand>span { width:34px;height:34px;border-radius:8px;background:#9258ee;border:0;color:white;box-shadow:none; }
.board-header>div { display:grid; gap:1px; }.board-header small { color:#777780;font-size:9px; }.board-header strong { font-size:14px; }.board-header .icon-button { margin-left:auto; }
.board-shell { width:min(100%,calc(100dvh - 108px));max-width:1050px;max-height:calc(100% - 64px);aspect-ratio:1;padding:0;border-radius:3px;background:transparent;box-shadow:0 24px 70px #0009;overflow:hidden;flex:0 1 auto; }
.board { border-radius:3px; }.square.light { background:#f0dfbc; }.square.dark { background:#c8a076; }
.piece-wrap { position:absolute;inset:4%;width:auto;height:auto;display:grid;place-items:center;z-index:3;cursor:grab;user-select:none; }.piece-wrap:active{cursor:grabbing}.piece-image{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;filter:drop-shadow(0 2px 1px #0003)}
.piece-wrap .piece { position:absolute;font-size:clamp(38px,7vw,92px); }
.rank,.file { color:#9d7954!important;font-size:clamp(9px,.7vw,13px);font-weight:700;opacity:.8; }.dark .rank,.dark .file{color:#f0dfbc!important}.rank{top:6px;left:8px}.file{right:8px;bottom:5px}
.square.last:after { background:#f6e65a77; }.square.selected:after{box-shadow:inset 0 0 0 5px #8bc34a;background:#a8d95b55}.square.hint{box-shadow:inset 0 0 0 6px #9d51ff;}
.board-footer { width:min(100%,calc(100vh - 120px)); max-width:1050px; padding-top:10px;color:#6e6e75; }
.sidebar { min-height:0; height:100%; border:1px solid #24252a; border-radius:14px; background:#0f1013; overflow:hidden; display:flex;flex-direction:column; box-shadow:0 24px 70px #0005; }
.panel-content { padding:clamp(20px,3vh,36px) clamp(22px,2.5vw,36px) 18px;gap:clamp(10px,1.7vh,20px);overflow:hidden;min-height:0; }
.lesson-top { display:grid;grid-template-columns:34px auto 1fr auto;align-items:center;gap:10px;font:700 25px Manrope,sans-serif;letter-spacing:-.03em; }.lesson-top .lesson-icon{font-size:25px;color:white}.lesson-top>span:nth-child(3){color:#8d8d96;font-size:20px;margin-left:5px}.lesson-top>b{font-size:17px;color:#67676e}
.lesson-top-heading{min-width:0;display:flex;flex-direction:column;gap:1px;line-height:1.1}.lesson-top-heading .opening{font-size:11px;font-weight:600;letter-spacing:.02em;opacity:.72}.lesson-top-heading .line{font-weight:700}
.speech { position:relative;background:#f7f7f8;color:#121216;border-radius:17px;padding:23px 25px;margin:4px 0 2px;box-shadow:0 8px 26px #0003; }.speech:before{content:"";position:absolute;left:-10px;top:22px;width:22px;height:22px;background:#f7f7f8;transform:rotate(45deg);border-radius:3px}.speech p{position:relative;margin:0 0 10px;font-size:16px;line-height:1.45;letter-spacing:-.01em}.speech strong{position:relative;font-size:16px}
.activity-grid { display:grid;gap:10px;margin-top:5px }.activity { min-height:86px;border:1px solid #2b2c32;border-radius:14px;padding:16px 19px;display:grid;grid-template-columns:38px 1fr auto;align-items:center;gap:10px;text-align:left;color:white}.activity>span{font-size:25px}.activity>div{display:grid;gap:4px}.activity>div strong{font:700 18px Manrope,sans-serif}.activity small{font-size:11px;color:#bdb9c7}.activity>b{display:grid;text-align:right;font-size:24px}.activity>b small{font-weight:500}.learn-activity{background:linear-gradient(135deg,#a44ff2,#7837e8);border-color:#a85ff1;box-shadow:0 9px 25px #853eea35;cursor:pointer}.practice-activity{background:#222329}
.line-heading { margin-top:4px; }.line-heading strong{font-size:13px}.line-heading span{font-size:11px}.lines{gap:8px}.line-card{background:#18191d;border-color:#292a2f;border-radius:12px;padding:12px 13px}.line-card:hover{background:#202126;border-color:#5d477a;transform:translateX(2px)}.line-index{background:#26272d}.line-card small{color:#888891}.line-stars i.filled{background:#a44ff2;box-shadow:0 0 5px #a44ff288}
.tabs { order:2; margin-top:auto; display:flex;justify-content:center;gap:62px;border-top:1px solid #222329;border-bottom:0;padding:15px 22px 16px;background:#101114; }.tabs button { min-width:74px;padding:4px 8px;border:0!important;display:grid;justify-items:center;gap:3px;color:#74747c }.tabs button span{margin:0;font-size:22px}.tabs button small{font-size:10px;font-weight:600}.tabs button.active{color:#f1f1f3}.tabs button.active span{color:#ab62ff}
.free-panel { padding-top:44px; }.free-panel h1{font-size:30px}.move-list{max-height:none;flex:1;background:#0c0d0f;border-color:#24252a}.turn-card{background:#1b1c20;border-color:#2c2d32}.secondary{background:#1d1e22;border-color:#303137}.secondary:hover{background:#25262b}
.practice-panel .text-button{order:2}.practice-panel .speech{order:3}.panel-topbar{display:flex;align-items:center;justify-content:space-between;order:2}.panel-topbar .text-button{align-self:center}.practice-panel .progress-track{order:4}.practice-panel .moves-block{order:5}.practice-panel .tip{order:6}.progress-track{background:#26272c;height:5px}.progress-track i{background:linear-gradient(90deg,#9d4cf1,#c477ff)}.notation{background:#15161a;border-color:#28292e}.complete-panel .primary{background:#9950ec;border-color:#b875fb;color:white}.success-mark{background:#9b4feb22;border-color:#9b4feb;color:#b86cff}.moves-block{display:grid;gap:8px}.moves-head{display:flex;align-items:center;justify-content:space-between;min-height:22px;padding:0 2px}.moves-head strong{font-size:11px;font-weight:600;letter-spacing:.02em;color:#8d8d96}.moves-toggle{width:28px;height:28px;display:grid;place-items:center;border:1px solid #2c2d33;border-radius:8px;background:#1b1c20;color:#9a9aa2;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.moves-toggle:hover{background:#24252b;color:#f1f1f3;border-color:#3a3b42}.moves-toggle:focus-visible{outline:2px solid #9d4cf1;outline-offset:2px}.moves-toggle svg{transition:transform .18s ease}.moves-block:not(.collapsed) .moves-toggle svg{transform:rotate(180deg)}
@media(max-height:850px) and (min-width:821px){
  .app-shell{padding:12px}.workspace{gap:16px}.board-shell{width:min(100%,calc(100dvh - 82px));max-height:calc(100% - 54px)}.board-header{margin-bottom:7px;min-height:34px}.board-footer{padding-top:6px}
  .panel-content{padding:18px 22px 12px;gap:9px}.lesson-top{font-size:20px;grid-template-columns:28px auto 1fr auto}.lesson-top .lesson-icon{font-size:20px}.lesson-top>span:nth-child(3){font-size:17px}
  .speech{padding:14px 17px;border-radius:12px;margin:0}.speech:before{width:16px;height:16px;left:-7px;top:18px}.speech p{font-size:12px;line-height:1.35;margin-bottom:5px}.speech strong{font-size:12px}
  .activity-grid{grid-template-columns:1fr 1fr;gap:8px}.activity{min-height:62px;padding:10px 12px;grid-template-columns:27px 1fr auto}.activity>span{font-size:19px}.activity>div strong{font-size:14px}.activity>div small{font-size:9px}.activity>b{font-size:17px}
  .line-heading{margin-top:0}.line-card{padding:7px 9px;border-radius:9px}.line-index{width:25px;height:25px}.lines{gap:5px}.tabs{padding:9px 20px 10px}.tabs button span{font-size:18px}.free-panel{padding-top:22px}.move-list{min-height:120px}
}
@media(max-width:1100px){.workspace{grid-template-columns:minmax(0,1fr) 410px}.panel-content{padding-left:22px;padding-right:22px}.speech p,.speech strong{font-size:14px}.board-shell,.board-header,.board-footer{width:min(100%,calc(100dvh - 84px))}}
@media(max-width:820px){
  .app-shell{padding:0}.workspace{height:100dvh;display:grid;grid-template-rows:minmax(0,46dvh) minmax(0,54dvh);grid-template-columns:1fr;max-height:none;gap:0}.board-area{height:46dvh;padding:8px}.board-header{min-height:28px;margin-bottom:4px}.board-header .brand{display:none}.board-header small{display:none}.board-shell{width:min(100%,calc(46dvh - 48px));height:min(100%,calc(46dvh - 48px));}.board-footer{display:none}
  .sidebar{height:54dvh;min-height:0;border-radius:14px 14px 0 0;border-left:0;border-right:0;border-bottom:0}.panel-content{padding:14px 18px 8px;gap:7px}.lesson-top{font-size:18px;grid-template-columns:24px auto 1fr auto}.lesson-top .lesson-icon{font-size:18px}.lesson-top>span:nth-child(3){font-size:15px}.lesson-top>b{font-size:13px}.speech{padding:11px 14px}.speech p{font-size:11px;line-height:1.3;margin-bottom:3px}.speech strong{font-size:11px}.activity-grid{grid-template-columns:1fr 1fr;gap:6px}.activity{min-height:52px;padding:7px 9px;grid-template-columns:22px 1fr auto}.activity>span{font-size:16px}.activity>div strong{font-size:12px}.activity>div small,.activity>b small{font-size:8px}.activity>b{font-size:14px}.line-heading{margin:0}.line-card{padding:5px 7px}.line-index{width:22px;height:22px}.line-card strong{font-size:10px}.line-card small,.line-stars{display:none}.lines{gap:3px}.tabs{position:static;margin-top:auto;padding:6px 20px 7px}.tabs button span{font-size:16px}.piece-wrap .piece{font-size:clamp(25px,9vw,60px)}
}

/* Quiet editorial theme */
:root{--bg:#f5f4f0;--surface:#fff;--surface-2:#eeece7;--line:#deddd8;--muted:#8c8d91;--text:#171819;--green:#8eaa9f;--cream:#edf0e9;--brown:#8eaa9f}
body{background:#f5f4f0;color:#171819}
.app-shell{padding:clamp(14px,2.4vh,28px)}
.workspace{width:min(1260px,100%);grid-template-columns:minmax(0,730px) minmax(390px,460px);gap:clamp(28px,3.6vw,52px);justify-content:center}
.board-area{justify-content:center}
.board-header{width:min(100%,calc(100dvh - 120px));max-width:730px;margin-bottom:12px}.board-header .brand>span{width:28px;height:28px;background:#171819;border-radius:7px;font-size:13px}.board-header small{color:#9a9a9d}.board-header strong{color:#303134;font-size:12px}.icon-button{background:white;border-color:#dfded9;color:#4e5052;box-shadow:0 1px 2px #0000000b}
.board-shell{width:min(100%,calc(100dvh - 120px));max-width:730px;border-radius:10px;box-shadow:0 14px 34px #2f3c3514}
.board{border-radius:10px}.square.light{background:#edf0e9}.square.dark{background:#8eaa9f}.rank,.file{color:#75968a!important}.dark .rank,.dark .file{color:#e5ebe5!important}.piece-image{filter:drop-shadow(0 1px 1px #0002)}
.board-footer{width:min(100%,calc(100dvh - 120px));max-width:730px;color:#838488;font-size:10px}.orientation{color:#aaa}
.sidebar{height:100%;background:transparent;border:0;border-radius:0;box-shadow:none;overflow:hidden;padding-top:42px}
.tabs{order:0;margin:0 0 18px;display:grid;grid-template-columns:1fr 1fr;gap:3px;background:#e9e7e2;border:0;border-radius:11px;padding:4px}.tabs button{min-width:0;padding:9px;border:0!important;border-radius:8px;display:flex;justify-content:center;gap:7px;color:#88898d}.tabs button span{font-size:14px}.tabs button small{font-size:11px}.tabs button.active{background:#fff;color:#242527;box-shadow:0 1px 4px #0000000e}.tabs button.active span{color:#242527}
.panel-content{padding:0;gap:16px;color:#202123}.opening-title{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}.opening-title h1{margin:4px 0 0;font-size:31px;letter-spacing:-.055em}.eyebrow{color:#a2a2a4}.mastery-pill{display:flex;align-items:center;gap:5px;padding:7px 10px;border:1px solid #e2e1dc;border-radius:999px;background:#fff;font-size:10px;color:#55565a;white-space:nowrap}.mastery-pill i{width:6px;height:6px;border-radius:50%;background:#db5628}.mastery-pill small{color:#929397}
.speech{background:#fff;color:#242527;border:1px solid #e2e1dc;border-radius:13px;padding:18px 20px;margin:0;box-shadow:none}.speech:before{display:none}.speech>small{display:block;margin-bottom:10px;color:#96979b;font-size:9px;letter-spacing:.12em;font-weight:700}.speech p{font-size:13px;line-height:1.55;margin-bottom:8px}.speech strong{font-size:12px}.line-heading{margin-top:2px}.line-heading strong{font-size:12px}.line-heading span{font-size:10px;color:#999a9d}
/* A paywalled course ships only its free preview lines; this note keeps the
   missing lines visible instead of letting the preview read as a full course. */
.preview-note{margin:0;padding:9px 12px;border:1px solid #f0d9cd;border-radius:10px;background:#fdf3ee;color:#8a4a2c;font-size:11px;line-height:1.45}
.progress-error{margin:0;display:flex;align-items:center;gap:7px;padding:9px 12px;border:1px solid #e2e1dc;border-radius:10px;background:#fff;color:#55565a;font-size:11px;line-height:1.45}
.progress-error .text-button{align-self:center;color:#a8402a;text-decoration:underline;text-underline-offset:2px}
.lines{display:block;background:#fff;border:1px solid #e2e1dc;border-radius:13px;overflow:hidden}.line-card{border:0;border-bottom:1px solid #ecebe7;border-radius:0;background:white;padding:10px 12px}.line-card:last-child{border-bottom:0}.line-card:hover{transform:none;background:#faf9f6;border-color:#ecebe7}.line-index{width:25px;height:25px;border-radius:7px;background:#f0efeb;color:#55565a}.line-card strong{font-size:11px;color:#292a2c}.line-card small{font-size:9px;color:#9a9b9d}.line-card>b{color:#b3b3b4}.line-stars{gap:3px}.line-stars i{width:12px;height:3px;border-radius:4px;background:#e2e1dc}.line-stars i.filled{background:#db5628;box-shadow:none}
.free-panel{padding:0}.free-panel h1{font-size:31px}.turn-card{background:white;border-color:#e2e1dc}.move-list{background:white;border-color:#e2e1dc}.secondary{background:white;border-color:#deddd8;color:#353638}.secondary:hover{background:#f0efeb}.empty-moves{color:#a3a4a5}
.practice-panel .lesson-top,.complete-panel{color:#222}.lesson-top{font-size:20px}.lesson-top .lesson-icon{color:#222}.lesson-top>span:nth-child(3),.lesson-top>b{color:#9a9b9d}.practice-panel .text-button{color:#77787b}.progress-track{background:#e5e3df}.progress-track i{background:#db5628}.notation{background:white;border-color:#e2e1dc}.notation span{color:#b0b0b2}.notation span.done{color:#737477}.tip{color:#999a9d}.complete-panel .primary{background:#171819;border-color:#171819;color:white}.success-mark{background:#fff3ee;border-color:#db5628;color:#db5628}.moves-head strong{color:#8c8d91}.moves-toggle{background:#fff;border-color:#e2e1dc;color:#8c8d91;box-shadow:0 1px 2px #0000000a}.moves-toggle:hover{background:#f3f2ee;color:#242527;border-color:#d2d0c8}
.drag-ghost{position:fixed;left:0;top:0;z-index:9999;display:grid;place-items:center;pointer-events:none;will-change:transform;filter:drop-shadow(0 12px 12px #0004);transform-origin:center;animation:piece-pickup .09s ease-out}.drag-ghost .piece-image{width:100%;height:100%;object-fit:contain}.piece-lifted{opacity:.22}.square.target:before{width:20%;height:20%;background:#315f5160}.square.capture:before{inset:7%;border-color:#315f5160}.square.selected:after{box-shadow:inset 0 0 0 4px #f1c84e;background:#f6db6445}@keyframes piece-pickup{from{scale:.9}to{scale:1}}
@media(max-height:850px) and (min-width:821px){.sidebar{padding-top:28px}.panel-content{padding:0;gap:9px}.opening-title h1{font-size:25px}.speech{padding:12px 15px}.speech p{font-size:11px;line-height:1.4;margin-bottom:4px}.line-card{padding:7px 10px}.tabs{padding:3px;margin-bottom:10px}.tabs button{padding:7px}.board-shell,.board-header,.board-footer{width:min(100%,calc(100dvh - 88px))}}
@media(max-width:1100px){.workspace{grid-template-columns:minmax(0,1fr) 390px;gap:24px}.board-shell,.board-header,.board-footer{width:min(100%,calc(100dvh - 90px))}.sidebar{padding-top:30px}}
@media(max-width:820px){.workspace{grid-template-rows:minmax(0,48dvh) minmax(0,52dvh)}.board-area{height:48dvh}.board-shell{width:min(100%,calc(48dvh - 46px));height:min(100%,calc(48dvh - 46px))}.sidebar{height:52dvh;padding:10px 14px 0;background:#f5f4f0}.tabs{margin-bottom:8px}.panel-content{padding:0;gap:6px}.eyebrow{display:none}.opening-title h1{font-size:20px}.speech{padding:8px 11px}.speech p{font-size:10px;margin:0}.speech strong,.speech>small{display:none}.line-card{padding:4px 7px}.line-heading{margin:0}}

/* Board interaction: drag, selection, check, promotion, results */
.board-shell{position:relative}
.board{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.square{-webkit-tap-highlight-color:transparent;outline:none}
.square:focus-visible{box-shadow:inset 0 0 0 3px #f1c84e}
.piece-image,.piece-wrap{-webkit-user-drag:none}
.piece-wrap.moving{z-index:6;pointer-events:none}
.square.target{cursor:pointer}.square.target:hover:before{width:100%;height:100%;border-radius:0;background:#315f5126}
.square.capture:hover:before{inset:0;border-width:0;border-radius:0;background:#315f5126}
.square.drag-over{outline:4px solid #ffffffb3;outline-offset:-4px}
.square.last.drag-over,.square.selected.drag-over{outline-color:#ffffffd9}
.square.check .check-glow{position:absolute;inset:0;border-radius:50%;background:radial-gradient(circle at center,#ff2b2b 0,#eb2525 26%,#eb252500 72%);z-index:2;pointer-events:none}
.square.selected.check:after{background:#f6db6445}
.square.hint{box-shadow:inset 0 0 0 5px #db5628;animation:hint 1.1s infinite}
@keyframes hint{50%{box-shadow:inset 0 0 0 5px #db562855}}
.drag-ghost{position:fixed;left:0;top:0;z-index:9999;display:grid;place-items:center;pointer-events:none;will-change:transform;cursor:grabbing;animation:none}
.drag-ghost .piece-image{width:92%;height:92%;object-fit:contain;filter:drop-shadow(0 10px 10px #0004)}
.piece-lifted{opacity:.25}
.board-shell.promoting .board{opacity:.72}
.promotion{position:absolute;top:auto;width:12.5%;z-index:20;display:flex;flex-direction:column;background:#fff;border-radius:6px;box-shadow:0 10px 30px #0005,0 0 0 1px #0000001a;overflow:hidden;animation:promo-in .12s ease-out}
.promotion.top{top:0}.promotion.bottom{bottom:0;flex-direction:column-reverse}
.promotion button{border:0;background:#fff;width:100%;aspect-ratio:1;display:grid;place-items:center;padding:0;cursor:pointer;position:relative}
.promotion button .piece-image{width:86%;height:86%;object-fit:contain}.promotion button .piece{font-size:clamp(26px,4vw,64px)}
.promotion button:hover,.promotion button:focus-visible{background:#f1c84e}
.promotion .promotion-cancel{aspect-ratio:2;font-size:13px;color:#6b6c70;background:#f0efeb}.promotion .promotion-cancel:hover{background:#e3e1dc;color:#171819}
@keyframes promo-in{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}
.panel-actions.three{grid-template-columns:1fr 1fr 1fr}
.turn-dot.draw{background:linear-gradient(135deg,#f0eddc 50%,#272a25 50%);box-shadow:none}
.turn-card.result{border-color:#db5628;background:#fff7f3}.turn-card.result strong{color:#b8431c}
.move-list .ply{justify-self:start;padding:1px 6px;border-radius:4px;cursor:default}.move-list .ply.current{background:#171819;color:#fff}
.board-footer .orientation{letter-spacing:.12em}

/* Account header & auth dialog */
:root{--header-h:58px;--vh:calc(100dvh - var(--header-h));--ink:#171819;--ink-2:#55565a;--hair:#e2e1dc;--paper:#fff;--paper-2:#faf9f6;--sage:#8eaa9f;--sage-deep:#5f8577;--ember:#db5628;--ember-deep:#b8431c;--ease:cubic-bezier(.2,.8,.2,1)}
.app-shell{padding:0;display:grid;grid-template-rows:var(--header-h) minmax(0,1fr);place-items:stretch;gap:0}
.stage{min-height:0;display:grid;place-items:center;padding:clamp(14px,2.4vh,28px);overflow:hidden}
.topbar{height:var(--header-h);padding:0 clamp(16px,3vw,40px);display:flex;align-items:center;gap:18px;border-bottom:1px solid var(--hair);background:#f5f4f0f2;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);position:relative;z-index:30}
.topbar .brand{color:var(--ink);text-decoration:none;display:flex;align-items:center;gap:11px;letter-spacing:0;font:700 15px/1 Manrope,sans-serif}
.topbar .brand>span{width:30px;height:30px;border:0;border-radius:8px;background:var(--ink);color:#fff;display:grid;place-items:center;font-size:14px;box-shadow:none;transition:transform .25s var(--ease)}.topbar .brand:hover>span{transform:rotate(-6deg) scale(1.04)}
.topbar .brand strong{letter-spacing:-.02em;font-weight:700}
.top-status{margin:auto;color:#8c8d91;font-size:12px;display:flex;align-items:center;gap:8px}.online-dot{width:7px;height:7px;border-radius:50%;background:var(--sage);box-shadow:0 0 0 4px #8eaa9f26}
.auth-buttons{display:flex;align-items:center;gap:8px;margin-left:auto;animation:fade-in .3s var(--ease) both}
.ghost-button,.solid-button{border-radius:999px;padding:9px 16px;font-size:12.5px;font-weight:600;cursor:pointer;transition:transform .18s var(--ease),background .18s,box-shadow .18s,color .18s;white-space:nowrap}
.ghost-button{border:1px solid transparent;background:transparent;color:var(--ink-2)}.ghost-button:hover{background:#ebe9e4;color:var(--ink)}
.solid-button{border:1px solid var(--ink);background:var(--ink);color:#fff;box-shadow:0 1px 2px #1718191a}.solid-button:hover{transform:translateY(-1px);box-shadow:0 6px 16px #17181926}.solid-button:active,.ghost-button:active{transform:translateY(0) scale(.98)}
.ghost-button:focus-visible,.solid-button:focus-visible,.avatar-button:focus-visible{outline:none;box-shadow:0 0 0 3px #8eaa9f59}
.account-placeholder{margin-left:auto;width:36px;height:36px}
.account{margin-left:auto;position:relative;animation:pop-in .32s var(--ease) both}
.avatar-button{width:36px;height:36px;border-radius:50%;border:1px solid #d4d3ce;background:linear-gradient(145deg,#edf0e9,#d9e3dd);color:var(--sage-deep);font:700 13px Manrope,sans-serif;cursor:pointer;display:grid;place-items:center;transition:transform .18s var(--ease),box-shadow .18s,border-color .18s;padding:0}
.avatar-button:hover,.account.open .avatar-button{transform:translateY(-1px);border-color:var(--sage);box-shadow:0 6px 16px #17181918}
.avatar-img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
.account-menu{position:absolute;right:0;top:calc(100% + 10px);min-width:240px;background:var(--paper);border:1px solid var(--hair);border-radius:14px;box-shadow:0 18px 48px #17181926,0 2px 6px #1718190f;padding:6px;transform-origin:top right;animation:menu-in .18s var(--ease) both;z-index:40}
.account-menu[hidden]{display:none}
.account-identity{display:grid;gap:3px;padding:10px 12px 11px;border-bottom:1px solid #eeede8;margin-bottom:5px}.account-identity small{font-size:9px;letter-spacing:.12em;font-weight:700;color:#9a9b9d}.account-identity strong{font-size:12.5px;color:var(--ink);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:260px}
.account-menu button{width:100%;text-align:left;border:0;background:transparent;border-radius:9px;padding:10px 12px;font-size:12.5px;font-weight:600;color:var(--ink-2);cursor:pointer;transition:background .15s,color .15s}.account-menu button:hover{background:#f3f2ee;color:var(--ember-deep)}
/* One variable sizes the board column: the square can never exceed the height left after the header, stage padding and board chrome. */
:root{--stage-pad:clamp(14px,2.4vh,28px);--board-chrome:80px;--board-size:min(100%,calc(var(--vh) - 2*var(--stage-pad) - var(--board-chrome)))}
.stage{padding:var(--stage-pad)}
.board-header,.board-shell,.board-footer{width:var(--board-size);max-width:730px}
.board-shell{height:auto;max-height:none;flex:0 0 auto}
.board-header .brand{display:none}
@media(max-height:850px) and (min-width:821px){:root{--stage-pad:12px;--board-chrome:64px}.board-shell,.board-header,.board-footer{width:var(--board-size)}}
@media(max-width:1100px){.board-shell,.board-header,.board-footer{width:var(--board-size)}}
@media(max-width:820px){:root{--header-h:52px;--stage-pad:0px}.topbar{padding:0 14px;gap:10px}.top-status{display:none}.topbar .brand strong{font-size:14px}.ghost-button,.solid-button{padding:8px 13px;font-size:12px}.stage{padding:0}.workspace{height:100%;grid-template-rows:minmax(0,48fr) minmax(0,52fr)}.board-area{height:100%}.sidebar{height:100%}.board-header,.board-footer{width:100%}.board-shell{width:min(100%,calc(var(--vh)*.48 - 52px));height:min(100%,calc(var(--vh)*.48 - 52px))}}

/* Dialog */
.auth-dialog{border:0;padding:0;background:transparent;max-width:none;max-height:none;width:100%;height:100%;margin:0;inset:0;display:none;place-items:center;overflow:visible;color:var(--ink)}
.auth-dialog[open]{display:grid}
.auth-dialog::backdrop{background:#17181966;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);animation:fade-in .22s var(--ease) both}
.auth-dialog.closing::backdrop{animation:fade-out .16s var(--ease) both}
.auth-card{position:relative;width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);background:var(--paper);border:1px solid var(--hair);border-radius:22px;box-shadow:0 36px 90px #17181933,0 2px 8px #17181914;padding:38px 38px 32px;animation:card-in .3s var(--ease) both;overflow-x:hidden;overflow-y:auto}
.auth-dialog.closing .auth-card{animation:card-out .16s var(--ease) both}
.auth-card.shake{animation:shake .42s var(--ease)}
.auth-stage{position:relative}
.auth-view{display:flex;flex-direction:column;animation:view-in .28s var(--ease) both}
.auth-view.entering{opacity:0}.auth-view.leaving{animation:view-out .14s var(--ease) both;pointer-events:none}
.auth-close{position:absolute;right:-16px;top:-16px;width:36px;height:36px;border-radius:50%;border:0;background:transparent;color:#8c8d91;display:grid;place-items:center;cursor:pointer;transition:background .15s,color .15s,transform .18s var(--ease)}.auth-close:hover{background:#f0efeb;color:var(--ink);transform:rotate(90deg)}.auth-close:focus-visible{outline:none;box-shadow:0 0 0 3px #8eaa9f59}
.auth-mark{width:52px;height:52px;border-radius:15px;background:#edf0e9;border:1px solid #d9e3dd;display:grid;place-items:center;color:var(--sage-deep);font-size:30px;line-height:1;margin-bottom:22px;animation:pop-in .4s var(--ease) both;animation-delay:.05s}
.auth-mark svg:not(.auth-check){width:22px;height:22px}
.auth-mark:has(.auth-check){background:transparent;border:0;width:64px;height:64px;border-radius:0}
.auth-eyebrow{font-size:10px;letter-spacing:.14em;font-weight:700;color:#a2a2a4}
.auth-title{font:700 27px/1.15 Manrope,sans-serif;letter-spacing:-.045em;margin:6px 0 8px;color:var(--ink)}
.auth-lead{margin:0 0 26px;color:#6b6c70;font-size:13.5px;line-height:1.55}.auth-lead .auth-email{color:var(--ink);font-weight:600;overflow-wrap:anywhere}
.auth-form{display:flex;flex-direction:column;gap:16px}
.auth-google{position:relative;width:100%;height:48px;border:1px solid #d8d7d2;border-radius:12px;background:#fff;color:var(--ink);font:600 13.5px "DM Sans",system-ui,sans-serif;display:flex;align-items:center;justify-content:center;gap:10px;cursor:pointer;box-shadow:0 1px 2px #1718190d;transition:border-color .18s,box-shadow .18s,transform .18s var(--ease),background .18s}.auth-google:hover:not(:disabled){border-color:#b9b8b3;background:#fdfcf9;box-shadow:0 5px 16px #17181912;transform:translateY(-1px)}.auth-google:active:not(:disabled){transform:none}.auth-google:focus-visible{outline:none;box-shadow:0 0 0 4px #8eaa9f40}.auth-google:disabled{cursor:default;color:#77787b}.auth-google-icon{display:grid;place-items:center}.auth-google-spinner{position:absolute;right:15px;width:16px;height:16px;border:2px solid #d7d7d7;border-top-color:#55565a;border-radius:50%;opacity:0}.auth-google.pending .auth-google-spinner{opacity:1;animation:spin .7s linear infinite}
.auth-divider{display:flex;align-items:center;gap:12px;margin:17px 0;color:#9a9a9c;font-size:10.5px;letter-spacing:.01em}.auth-divider::before,.auth-divider::after{content:"";height:1px;background:#e8e7e2;flex:1}.auth-divider span{white-space:nowrap}
.auth-field{display:grid;gap:7px}.auth-field-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px}.auth-field label{font-size:11.5px;font-weight:600;color:var(--ink-2);letter-spacing:.01em}
.auth-input{position:relative;display:flex}
.auth-input input{width:100%;height:48px;border:1px solid #deddd8;border-radius:12px;background:var(--paper-2);color:var(--ink);padding:0 14px;font:500 14px/1 "DM Sans",system-ui,sans-serif;transition:border-color .18s,box-shadow .18s,background .18s;outline:none;-webkit-appearance:none;appearance:none}
.auth-input input::placeholder{color:#b0b0b2}
.auth-input input:hover{border-color:#cfceca}
.auth-input input:focus{background:#fff;border-color:var(--sage);box-shadow:0 0 0 4px #8eaa9f33}
.auth-input input:disabled{opacity:.7}
.auth-input:has(.auth-eye) input{padding-right:46px}
.auth-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:36px;height:36px;border:0;border-radius:9px;background:transparent;color:#8c8d91;display:grid;place-items:center;cursor:pointer;transition:color .15s,background .15s}.auth-eye:hover{color:var(--ink);background:#eeece7}.auth-eye:focus-visible{outline:none;box-shadow:0 0 0 3px #8eaa9f59}
.auth-field-error{margin:0;min-height:0;font-size:12px;color:var(--ember-deep);line-height:1.4;display:none}
.auth-hint{margin:0;font-size:12px;color:#8c8d91;line-height:1.4}
.auth-field.invalid .auth-field-error{display:block;animation:slide-down .2s var(--ease) both}
.auth-field.invalid input{border-color:var(--ember);background:#fffaf8}.auth-field.invalid input:focus{box-shadow:0 0 0 4px #db562826;border-color:var(--ember)}
.auth-alert{display:flex;gap:10px;align-items:flex-start;background:#fff3ee;border:1px solid #f4c7b7;border-radius:12px;padding:12px 14px;color:var(--ember-deep);font-size:12.5px;line-height:1.45;animation:slide-down .22s var(--ease) both}.auth-alert[hidden]{display:none}.auth-alert>span{flex:none;margin-top:1px}.auth-alert p{margin:0}.auth-alert .auth-link{color:var(--ember-deep);text-decoration:underline;text-underline-offset:2px}
.auth-link{border:0;background:transparent;padding:0;color:var(--ink-2);font-size:12px;font-weight:500;cursor:pointer;text-decoration:none;transition:color .15s;border-radius:4px}.auth-link:hover{color:var(--ink);text-decoration:underline;text-underline-offset:3px}.auth-link.strong{font-weight:600;color:var(--ink)}.auth-link.strong:hover{color:var(--sage-deep)}.auth-link:focus-visible{outline:none;box-shadow:0 0 0 3px #8eaa9f59}.auth-link:disabled{color:#a3a4a5;cursor:default;text-decoration:none}
.auth-submit{position:relative;height:50px;border-radius:12px;border:1px solid var(--ink);background:var(--ink);color:#fff;font:700 14px "DM Sans",system-ui,sans-serif;cursor:pointer;margin-top:6px;display:grid;place-items:center;transition:transform .18s var(--ease),box-shadow .18s,background .18s;box-shadow:0 1px 2px #1718191a;overflow:hidden}
.auth-submit:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 10px 24px #17181933;background:#232426}.auth-submit:active:not(:disabled){transform:translateY(0) scale(.99)}.auth-submit:focus-visible{outline:none;box-shadow:0 0 0 3px #fff,0 0 0 6px #8eaa9f}
.auth-submit:disabled{cursor:default}
.auth-submit-label{transition:opacity .15s}
.auth-spinner{position:absolute;right:16px;top:50%;width:16px;height:16px;margin-top:-8px;border-radius:50%;border:2px solid #ffffff40;border-top-color:#fff;opacity:0;transform:scale(.6);transition:opacity .18s,transform .18s var(--ease)}
.auth-form.pending .auth-spinner{opacity:1;transform:scale(1);animation:spin .7s linear infinite}
.auth-form.pending .auth-submit{background:#2a2b2e}
.auth-strength{display:grid;gap:8px;margin-top:-6px}
.auth-strength-bar{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.auth-strength-bar i{height:4px;border-radius:4px;background:#e5e3df;transition:background .3s var(--ease),transform .3s var(--ease)}
.auth-strength[data-filled="1"] i:nth-child(-n+1),.auth-strength[data-filled="2"] i:nth-child(-n+2),.auth-strength[data-filled="3"] i:nth-child(-n+3),.auth-strength[data-filled="4"] i:nth-child(-n+4){background:var(--meter,#e5e3df)}
.auth-strength[data-score="1"]{--meter:var(--ember)}.auth-strength[data-score="2"]{--meter:#e0a33b}.auth-strength[data-score="3"]{--meter:var(--sage)}.auth-strength[data-score="4"]{--meter:var(--sage-deep)}
.auth-strength-text{display:flex;justify-content:space-between;gap:12px;font-size:11.5px;color:#8c8d91;min-height:16px}.auth-strength-text strong{font-weight:600;color:var(--ink-2);transition:color .3s}
.auth-strength[data-score="1"] strong{color:var(--ember-deep)}.auth-strength[data-score="2"] strong{color:#b27d22}.auth-strength[data-score="3"] strong{color:var(--sage-deep)}.auth-strength[data-score="4"] strong{color:#3f7c5f}
.auth-actions{display:grid;gap:14px;justify-items:center}.auth-actions .auth-submit{width:100%;margin-top:0}
.auth-footer{margin:26px 0 0;text-align:center;font-size:12.5px;color:#8c8d91}
.auth-check-ring{fill:#edf0e9;stroke:var(--sage);stroke-width:1.5;stroke-dasharray:190;stroke-dashoffset:190;animation:draw .6s var(--ease) forwards;animation-delay:.05s}
.auth-check-mark{stroke:var(--sage-deep);stroke-width:3.5;stroke-dasharray:40;stroke-dashoffset:40;animation:draw .4s var(--ease) forwards;animation-delay:.35s}
/* Required username prompt — one field, no copy. The card shrinks to the width
   of the decision: the default 440px reads as a form, and there is no form
   here, only a name. */
.prompt-card{width:min(380px,calc(100vw - 32px));padding:42px 22px 22px}
.prompt-view{position:relative}
/* The escape hatch rides in a reserved lane above the field. Hung off the card's
   corner instead it straddles the border radius, where a grey glyph on white
   reads as a rendering artefact rather than a control. */
.prompt-exit{position:absolute;right:10px;top:-34px;width:30px;height:30px;border-radius:50%;border:0;background:transparent;color:#8c8d91;display:grid;place-items:center;cursor:pointer;transition:background .15s,color .15s}
.prompt-exit:hover{background:#f0efeb;color:var(--ink)}.prompt-exit:focus-visible{outline:none;box-shadow:0 0 0 3px #8eaa9f59}
.prompt-go{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:36px;height:36px;border:0;border-radius:9px;background:var(--ink);color:#fff;display:grid;place-items:center;cursor:pointer;overflow:hidden;transition:background .15s,transform .18s var(--ease)}
.prompt-go:hover:not(:disabled){background:#232426}
.prompt-go:active:not(:disabled){transform:translateY(-50%) scale(.96)}
.prompt-go:focus-visible{outline:none;box-shadow:0 0 0 3px #fff,0 0 0 6px #8eaa9f}
.prompt-go:disabled{cursor:default}
/* Direct child only: the loader is itself an <svg> nested in the .auth-spinner
   slot, and a descendant selector here would fade it out along with the arrow. */
.prompt-go > svg{transition:opacity .15s}
.auth-form.pending .prompt-go > svg{opacity:0}
/* Matches the full-width submit's pending treatment — the button stays dark and
   the label swaps for the loader. Fading the whole control with opacity would
   take the white loader down with it, and it is the only thing left to see. */
.auth-form.pending .prompt-go{background:#2a2b2e}
/* The loader is a 16:9 Lottie, so a square slot letterboxes it down to a speck.
   It keeps the wide aspect, re-centred inside the 36px arrow rather than parked
   at the trailing edge the way the full-width submit has room to do. */
.prompt-go .auth-spinner{left:50%;right:auto;top:50%;width:34px;height:22px;margin:-11px 0 0 -17px;overflow:visible}
.auth-input:has(.prompt-go) input{padding-right:54px}
/* Toasts */
.toast-stack{position:fixed;top:calc(var(--header-h) + 14px);right:18px;display:grid;gap:8px;z-index:60;pointer-events:none}
.toast{display:flex;align-items:center;gap:11px;background:var(--ink);color:#fff;border-radius:13px;padding:11px 15px 11px 13px;box-shadow:0 14px 40px #17181940;opacity:0;transform:translateY(-8px) scale(.98);transition:opacity .26s var(--ease),transform .26s var(--ease);min-width:200px;max-width:min(360px,calc(100vw - 36px))}
.toast.show{opacity:1;transform:none}.toast-dot{width:8px;height:8px;border-radius:50%;background:var(--sage);box-shadow:0 0 0 4px #8eaa9f33;flex:none}.toast div{display:grid;gap:1px;min-width:0}.toast strong{font-size:13px;font-weight:600}.toast small{font-size:11px;color:#c9cac6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.toast.actionable{pointer-events:auto}.toast-action{margin-left:auto;flex:none;border:1px solid #ffffff2e;background:#ffffff1a;border-radius:8px;padding:6px 11px;color:#fff;font:600 12px "DM Sans",system-ui,sans-serif;cursor:pointer;transition:background .15s,border-color .15s}
.toast-action:hover{background:#ffffff2e;border-color:#ffffff59}.toast-action:focus-visible{outline:none;box-shadow:0 0 0 3px #8eaa9f73}
@keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes fade-out{from{opacity:1}to{opacity:0}}
@keyframes card-in{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:none}}@keyframes card-out{from{opacity:1;transform:none}to{opacity:0;transform:translateY(10px) scale(.98)}}
@keyframes view-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@keyframes view-out{from{opacity:1;transform:none}to{opacity:0;transform:translateY(-6px)}}
@keyframes pop-in{from{opacity:0;transform:scale(.7)}60%{transform:scale(1.06)}to{opacity:1;transform:none}}@keyframes menu-in{from{opacity:0;transform:translateY(-6px) scale(.96)}to{opacity:1;transform:none}}
@keyframes slide-down{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes draw{to{stroke-dashoffset:0}}
@keyframes shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(2px)}30%,50%,70%{transform:translateX(-4px)}40%,60%{transform:translateX(4px)}}
@media(max-width:520px){.auth-dialog[open]{place-items:end center}.auth-card{width:100vw;border-radius:22px 22px 0 0;border-bottom:0;padding:30px 24px calc(26px + env(safe-area-inset-bottom));animation-name:sheet-in}.auth-dialog.closing .auth-card{animation-name:sheet-out}.auth-close{right:-6px;top:-8px}.auth-title{font-size:24px}.prompt-card{padding:44px 20px calc(18px + env(safe-area-inset-bottom))}}
@keyframes sheet-in{from{opacity:0;transform:translateY(40px)}to{opacity:1;transform:none}}@keyframes sheet-out{from{opacity:1;transform:none}to{opacity:0;transform:translateY(30px)}}
/* Streak */
.streak-badge{display:flex;align-items:center;gap:5px;padding:5px 11px 5px 8px;border-radius:999px;background:linear-gradient(135deg,#fff3ee,#ffe8dc);border:1px solid #f4c7b7;animation:pop-in .32s var(--ease) both}.streak-fire{display:inline-flex;color:#FF6B35;filter:drop-shadow(0 0 3px #ff6b3533);animation:flame-flicker 1.6s var(--ease) infinite}.streak-fire svg{width:15px;height:15px;display:block}.streak-badge strong{font-size:13px;font-weight:700;color:var(--ember)}
@keyframes flame-flicker{0%,100%{transform:scale(1) rotate(-1deg)}30%{transform:scale(1.06) rotate(1.2deg)}60%{transform:scale(.95) rotate(-1.4deg)}80%{transform:scale(1.03) rotate(.8deg)}}
@media(max-width:820px){.streak-badge{padding:4px 9px 4px 6px}.streak-fire svg{width:12px;height:12px}.streak-badge strong{font-size:11px}}
@media(prefers-reduced-motion:reduce){.auth-card,.auth-view,.auth-mark,.account,.auth-buttons,.account-menu,.study-menu,.auth-dialog::backdrop,.auth-alert,.auth-field-error{animation-duration:.01ms!important}.auth-card.shake{animation:none}.toast{transition:none}.auth-check-ring,.auth-check-mark{animation:none;stroke-dashoffset:0}.streak-badge,.streak-fire{animation:none}}

/* Home / lesson selection */
.home-panel{overflow-y:auto;padding-bottom:6px;scrollbar-width:thin;scrollbar-color:#d8d7d2 transparent}
.home-panel::-webkit-scrollbar{width:6px}
.home-panel::-webkit-scrollbar-thumb{background:#d8d7d2;border-radius:999px}
.home-hero{display:grid;gap:3px}
.home-hero h1{margin:0;font-size:29px;letter-spacing:-.05em}
.home-hero .eyebrow{color:#a2a2a4}
.home-stats{margin:2px 0 0;font-size:12px;font-weight:700;color:var(--sage-deep);letter-spacing:-.01em}
.home-hero .muted{font-size:12px}
.home-suggest,.home-section{display:grid;gap:8px}
.suggest-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.suggest-card{display:grid;grid-template-columns:30px 1fr auto;align-items:center;gap:10px;text-align:left;padding:11px 12px;background:var(--paper);border:1px solid var(--hair);border-radius:12px;cursor:pointer;transition:transform .18s var(--ease),border-color .18s,box-shadow .18s}
.suggest-card:hover{transform:translateY(-1px);border-color:var(--sage);box-shadow:0 8px 20px #17181910}
.suggest-card>span{width:30px;height:30px;display:grid;place-items:center;background:#edf0e9;border-radius:8px;font-size:15px}
.suggest-card>div{display:grid;gap:1px}
.suggest-card small{font-size:9px;color:#9a9b9d}
.suggest-card strong{font-size:11.5px;color:var(--ink);font-weight:700}
.suggest-card>b{color:#b3b3b4;font-size:13px}
.lesson-progress{font-size:9.5px;font-weight:700;color:var(--sage-deep);background:#edf0e9;border-radius:999px;padding:3px 8px;white-space:nowrap}
@media(max-width:820px){.home-hero h1{font-size:20px}.home-stats,.home-hero .muted{font-size:10px}.suggest-card{padding:7px 9px}.suggest-card>span{width:24px;height:24px;font-size:13px}.suggest-card small{font-size:8px}.suggest-card strong{font-size:10px}.lesson-progress{display:none}}

/* Lesson library — a distinct, scrollable screen from the trainer. */
.catalog-shell{background:var(--bg);color:var(--ink)}
.catalog-shell .topbar{background:#f5f4f0f2;border-color:var(--hair)}
.catalog-shell .topbar .brand{color:var(--ink)}
.catalog-shell .topbar .brand>span{background:var(--ink)}
.catalog-shell .top-status{color:#8c8d91}
.catalog-stage{min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#d8d7d2 transparent}
.catalog-page{width:min(1160px,calc(100% - 40px));margin:0 auto;padding:clamp(54px,8vh,92px) 0 80px}
.catalog-hero{text-align:center;display:grid;justify-items:center;gap:10px;margin-bottom:42px}
.catalog-hero .eyebrow{color:#9a9b9d}
.catalog-hero h1{font-size:clamp(34px,4.6vw,58px);letter-spacing:-.055em;margin:0;max-width:850px}
.catalog-hero p{margin:0;color:var(--muted);font-size:16px}
.catalog-hero>strong{margin-top:5px;color:var(--sage-deep);font-size:12px;font-weight:600}
.catalog-tools{display:grid;grid-template-columns:minmax(220px,360px) auto 1fr;align-items:center;gap:12px;margin-bottom:20px}
.catalog-search{height:42px;display:flex;align-items:center;gap:9px;border:1px solid var(--hair);border-radius:10px;background:var(--paper);padding:0 12px;color:#9a9b9d;box-shadow:0 1px 2px #1718190a}
.catalog-search:focus-within{border-color:var(--sage);box-shadow:0 0 0 4px #8eaa9f26}
.catalog-search input{border:0;outline:0;background:transparent;color:var(--ink);width:100%;font:500 13px "DM Sans",sans-serif}
.catalog-search input::placeholder{color:#aaa9a6}
.catalog-filters{display:flex;gap:3px;padding:4px;border:0;border-radius:10px;background:#e9e7e2}
.catalog-filters button{border:0;border-radius:7px;background:transparent;color:#88898d;padding:7px 12px;font-size:11px;font-weight:600;cursor:pointer}
.catalog-filters button.active{background:#fff;color:#252628;box-shadow:0 1px 3px #0000000c}
.lesson-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.lesson-card{min-width:0;min-height:188px;display:grid;grid-template-columns:188px 1fr;color:var(--ink);text-decoration:none;background:var(--paper);border:1px solid var(--hair);border-radius:13px;overflow:hidden;box-shadow:0 1px 2px #1718190a;transition:border-color .18s,box-shadow .18s}
.lesson-card:hover{border-color:#c5d2cd;box-shadow:0 10px 28px #2f3c3514}
.lesson-card:focus-visible{outline:none;border-color:var(--sage);box-shadow:0 0 0 4px #8eaa9f26}
.lesson-board{aspect-ratio:1;align-self:stretch;display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);place-items:center;background-color:#edf0e9;background-image:conic-gradient(#8eaa9f 25%,#edf0e9 0 50%,#8eaa9f 0 75%,#edf0e9 0);background-size:25% 25%;color:#242527;font-family:"Arial Unicode MS","Apple Symbols",serif;font-size:18px;line-height:1;overflow:hidden}
.lesson-board i{font-style:normal;filter:drop-shadow(0 1px 0 #fff4)}
.lesson-copy{min-width:0;padding:20px 20px 16px;display:flex;flex-direction:column}
.lesson-kicker{color:var(--sage-deep);font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}
.lesson-copy>strong{font:700 19px/1.2 Manrope,sans-serif;letter-spacing:-.035em;margin:7px 0}
.lesson-copy>small{color:#8c8d91;font-size:11.5px;line-height:1.5;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.lesson-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;padding-top:13px;border-top:1px solid #eeede8;color:#999a9d;font-size:10px}
.lesson-meta b{color:var(--ember-deep);font-weight:600}
.catalog-empty{padding:80px 20px;text-align:center;display:grid;justify-items:center;gap:6px;color:#999a9d}
.catalog-empty>span{font-size:36px}.catalog-empty strong{color:#55565a}.catalog-empty p{margin:0;font-size:12px}
.line-card{text-decoration:none;color:inherit}
.text-button{text-decoration:none}
@media(max-width:900px){.lesson-grid{grid-template-columns:1fr}.lesson-card{grid-template-columns:170px 1fr}.catalog-tools{grid-template-columns:1fr auto}}
@media(max-width:600px){.catalog-page{width:min(100% - 24px,1160px);padding:36px 0 50px}.catalog-hero{margin-bottom:28px}.catalog-hero h1{font-size:33px}.catalog-hero p{font-size:13px;max-width:330px}.catalog-tools{grid-template-columns:1fr}.catalog-filters{justify-self:start}.lesson-card{grid-template-columns:116px 1fr;min-height:150px}.lesson-board{font-size:12px}.lesson-copy{padding:15px 14px 12px}.lesson-copy>strong{font-size:16px}.lesson-copy>small{font-size:10px}.lesson-kicker{font-size:8px}.lesson-meta{padding-top:9px}.lesson-meta b{display:none}}

/* Lesson library: light, editorial catalogue treatment. */
.catalog-shell{--catalog-bg:#f3f2ee;--catalog-ink:#141414;--catalog-muted:#7a7c80;--catalog-line:#e3e1da;background:var(--catalog-bg);color:var(--catalog-ink);font-family:"Schibsted Grotesk",system-ui,sans-serif}
.catalog-shell .topbar{height:63px;padding:0 clamp(16px,3vw,40px);background:#f3f2eed1;border-color:var(--catalog-line);backdrop-filter:blur(14px)}
.catalog-shell .brand{color:var(--catalog-ink);font:600 16px "Schibsted Grotesk",sans-serif;letter-spacing:-.01em}.catalog-shell .brand>span{width:30px;height:30px;border:0;border-radius:8px;background:#141414;color:#f3f2ee;box-shadow:none;font-size:14px}.catalog-shell .top-status{display:none}.catalog-shell .streak-badge{background:#fff;border-color:var(--catalog-line)}
.catalog-stage{background:var(--catalog-bg);overflow-y:auto;scrollbar-color:#d8d7d2 transparent}.catalog-page{width:min(1360px,100%);margin:0 auto;padding:clamp(28px,5vw,72px) clamp(16px,3vw,40px) 0;display:grid;gap:clamp(40px,5vw,64px)}
.catalog-intro{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(28px,4vw,56px);align-items:center}.catalog-copy{display:grid;gap:16px;align-content:start}.catalog-label{font:400 12px "Spline Sans Mono",monospace;text-transform:uppercase;letter-spacing:.08em;color:var(--catalog-muted)}.catalog-copy h1{margin:0;max-width:620px;font:600 clamp(44px,6vw,76px)/.98 "Schibsted Grotesk",sans-serif;letter-spacing:-.055em;color:var(--catalog-ink)}.catalog-copy p{margin:0;max-width:480px;color:#5e6064;font-size:18px;line-height:1.5}.catalog-stats{display:flex;max-width:460px;margin-top:12px;padding-top:20px;border-top:1px solid var(--catalog-line)}.catalog-stats span{flex:1;display:grid;gap:4px;color:var(--catalog-muted);font-size:13px}.catalog-stats span+span{padding-left:20px;border-left:1px solid var(--catalog-line)}.catalog-stats b{font:400 26px "Spline Sans Mono",monospace;color:var(--catalog-ink);letter-spacing:-.04em}.catalog-stats span:last-child b{color:#d9541e}
.continue-card{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;padding:16px;background:#141414;color:#f3f2ee;border-radius:24px;text-decoration:none;box-shadow:0 40px 80px -40px rgba(20,30,25,.55);transition:transform .2s ease,box-shadow .2s ease}.continue-card:hover{color:#f3f2ee;transform:translateY(-3px);box-shadow:0 46px 90px -40px rgba(20,30,25,.7)}.continue-card>.lesson-board{border-radius:14px}.continue-card>span:last-child{min-width:0;display:flex;flex-direction:column;gap:14px;padding:8px 8px 8px 0}.continue-card small{display:flex;align-items:center;gap:8px;color:#a5a39c;font-size:12px;letter-spacing:.06em;text-transform:uppercase}.continue-card small i{width:6px;height:6px;border-radius:50%;background:#d9541e}.continue-card strong{font-size:clamp(22px,2.2vw,28px);line-height:1.1;letter-spacing:-.025em}.continue-card em{font:400 12px/1.5 "Spline Sans Mono",monospace;color:#a5a39c;font-style:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.continue-progress{display:grid;gap:8px;margin-top:auto}.continue-progress label{display:flex;justify-content:space-between;color:#a5a39c;font-size:12px}.continue-progress b{color:#f3f2ee;font:400 12px "Spline Sans Mono",monospace}.continue-progress>span,.lesson-progress-bars{display:flex;gap:4px}.continue-progress i{flex:1;height:5px;border-radius:3px;background:#3a3a3a}.continue-progress i.done{background:#d9541e}.continue-card button{height:44px;border:0;border-radius:12px;background:#f3f2ee;color:#141414;font:600 14px "Schibsted Grotesk",sans-serif;cursor:pointer}.continue-card button b{margin-left:6px;font-size:18px}
.catalog-library{display:grid;gap:clamp(36px,4vw,56px)}.catalog-tools{position:sticky;top:63px;z-index:4;display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:10px;margin:-10px;background:#f3f2eee0;border-radius:16px;backdrop-filter:blur(14px)}.catalog-search{flex:1 1 280px;max-width:420px;height:42px;display:flex;align-items:center;gap:10px;padding:0 8px 0 14px;background:#fff;border:1px solid var(--catalog-line);border-radius:12px;color:var(--catalog-muted)}.catalog-search:focus-within{border-color:#141414;box-shadow:none}.catalog-search input{font:400 14px "Schibsted Grotesk",sans-serif}.catalog-filters{padding:4px;gap:0;border-radius:12px;background:#e8e6e0}.catalog-filters button{height:34px;padding:0 16px;border-radius:9px;font:500 14px "Schibsted Grotesk",sans-serif;display:inline-flex;align-items:center;gap:7px}.catalog-filters button.active{box-shadow:0 1px 2px #00000014}.filter-pawn{width:16px;height:16px;object-fit:contain;flex:none}
.catalog-results{display:grid;gap:clamp(36px,4vw,56px)}.catalog-sentinel{height:1px}
.catalog-results{display:grid;gap:clamp(36px,4vw,56px)}.catalog-sentinel{height:1px}
.lesson-group{display:grid;gap:20px}.lesson-group header{display:flex;align-items:baseline;gap:14px;padding-bottom:14px;border-bottom:1px solid var(--catalog-line)}.lesson-group h2{margin:0;font:600 22px "Schibsted Grotesk",sans-serif;letter-spacing:-.02em}.lesson-group header>span{font:400 13px "Spline Sans Mono",monospace;color:var(--catalog-muted)}.lesson-group header small{margin-left:auto;font:400 12px "Spline Sans Mono",monospace;color:#a5a39c}.lesson-grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:clamp(12px,1.4vw,20px)}.lesson-card{min-height:0;display:flex;flex-direction:column;gap:14px;padding:8px 8px 16px;background:#fff;border:1px solid #e7e5df;border-radius:20px;box-shadow:none;overflow:hidden;transition:transform .2s cubic-bezier(.2,.7,.2,1),box-shadow .2s,border-color .2s}.lesson-card:hover{transform:translateY(-3px);border-color:#d9d7cf;box-shadow:0 24px 44px -24px rgba(30,40,35,.38)}.lesson-preview{position:relative}.lesson-board{width:100%;aspect-ratio:1;display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);place-items:center;overflow:hidden;background:#edf0e9;color:#242527;font:clamp(14px,1.6vw,21px) "Arial Unicode MS","Apple Symbols",serif;line-height:1}.lesson-board i{display:grid;place-items:center;width:100%;height:100%;font-style:normal}.lesson-board i.white{color:#f6f5ef;text-shadow:0 1px 1px #4e625a}.lesson-board i.black{color:#242527}.lesson-board i:nth-child(8n+1):nth-child(-n+64),.lesson-board i:nth-child(8n+3):nth-child(-n+64),.lesson-board i:nth-child(8n+5):nth-child(-n+64),.lesson-board i:nth-child(8n+7):nth-child(-n+64){background:#8ea99d}.lesson-move{position:absolute;left:8px;bottom:8px;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:24px;padding:0 9px;border-radius:999px;background:#141414c7;color:#f3f2ee;font:400 11px/24px "Spline Sans Mono",monospace}.lesson-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:8px;padding:0 8px}.lesson-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#5e6064;font-size:12px}.lesson-card-top>span{display:flex;align-items:center;gap:6px}.side-dot{width:10px;height:10px;border-radius:50%;box-shadow:inset 0 0 0 1px #b3b0a6}.side-dot.white{background:#fff}.side-dot.black{background:#141414;box-shadow:none}.lesson-copy>strong{font:600 18px/1.2 "Schibsted Grotesk",sans-serif;letter-spacing:-.02em;color:#141414}.lesson-meta{display:flex;align-items:center;gap:10px;margin-top:auto;padding-top:6px;color:var(--catalog-muted);font-size:12px}.lesson-progress-bars{flex:1}.lesson-progress-bars i{flex:1;height:4px;border-radius:2px;background:#e6e4de}.lesson-progress-bars i.done{background:#d9541e}.lesson-meta small{font:400 12px "Spline Sans Mono",monospace;white-space:nowrap}.catalog-empty{border-color:#d9d7cf;background:transparent;color:var(--catalog-muted);border-radius:20px}
@media(max-width:760px){.catalog-shell .topbar{height:52px}.catalog-shell .auth-buttons .solid-button{display:none}.catalog-page{padding:36px 12px 0;gap:36px}.catalog-intro{grid-template-columns:1fr}.catalog-copy h1{font-size:44px}.catalog-copy p{font-size:16px}.catalog-stats b{font-size:21px}.continue-card{grid-template-columns:120px 1fr;gap:14px;border-radius:18px;padding:10px}.continue-card>span:last-child{padding:3px 3px 3px 0;gap:8px}.continue-card strong{font-size:20px}.continue-card em{display:none}.continue-card button{height:36px;font-size:12px}.catalog-tools{top:52px}.lesson-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.lesson-card{border-radius:14px;padding:6px 6px 12px;gap:10px}.lesson-copy{padding:0 5px;gap:6px}.lesson-copy>strong{font-size:15px}.lesson-card-top,.lesson-meta{font-size:10px}.lesson-meta small{font-size:9px}.lesson-group header{gap:9px}.lesson-group h2{font-size:19px}.lesson-group header small{display:none}.catalog-filters button{padding:0 12px}}

.catalog-shell .lesson-board{background-color:#edf0e9;background-image:conic-gradient(#8ea99d 25%,#edf0e9 0 50%,#8ea99d 0 75%,#edf0e9 0);background-size:25% 25%}.catalog-shell .lesson-board i{background:transparent!important}

/* Signed-in dashboard */
.dashboard-nav{display:flex;gap:2px;margin-left:8px}.dashboard-nav a{height:32px;padding:0 12px;border-radius:8px;display:flex;align-items:center;color:#68696d;text-decoration:none;font-size:14px;font-weight:500;transition:background .15s,color .15s}.dashboard-nav a:hover{background:#ebe9e4;color:#141414}.dashboard-nav a.active{background:#e8e6e0;color:#141414}
.header-account{display:flex;align-items:center;gap:10px;margin-left:auto}.header-account .account{margin-left:0}.header-account .streak-badge{height:34px;padding:0 12px;background:#fff;border-color:#e3e1da}.header-account .streak-badge strong::after{content:" days";margin-left:5px;color:#7a7c80;font-weight:400;font-size:12px}
/* Full-bleed: the rail anchors to the left edge instead of sitting in a centred column. */
.dashboard-page{max-width:none;width:100%;margin:0;padding-top:clamp(18px,3vw,32px);gap:42px}
.dashboard-hero{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(320px,1fr);gap:16px}
.dashboard-focus{min-height:210px;padding:24px;display:flex;flex-direction:column;align-items:flex-start;background:#141414;color:#f3f2ee;border-radius:22px;box-shadow:0 30px 70px -46px #14231b}.dashboard-focus>span{color:#a5a39c;font-size:12px}.dashboard-focus h1{max-width:650px;margin:8px 0 8px;font:600 clamp(26px,2.8vw,36px)/1.05 "Schibsted Grotesk",sans-serif;letter-spacing:-.045em}.dashboard-focus p{margin:0 0 18px;color:#a5a39c;font-size:13px}.dashboard-focus>a{height:42px;margin-top:auto;padding:0 17px;border-radius:11px;background:#d9541e;color:#fff;display:flex;align-items:center;gap:16px;text-decoration:none;font-size:13px;font-weight:600;transition:transform .18s,background .18s,box-shadow .18s}.dashboard-focus>a:hover{background:#c74819;color:#fff;transform:translateY(-2px);box-shadow:0 12px 28px #0005}.dashboard-focus>a b{font-size:17px}
.dashboard-activity{min-height:210px;padding:21px 22px 18px;display:flex;flex-direction:column;background:#fff;border:1px solid #e7e5df;border-radius:22px}.dashboard-activity-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.dashboard-activity-head strong{font-size:14px}.dashboard-activity-head span{color:#929397;font:400 11px "Spline Sans Mono",monospace}.activity-bars{height:104px;display:grid;grid-template-columns:repeat(7,1fr);align-items:end;gap:10px;margin:14px 0 10px}.activity-day{height:100%;display:grid;grid-template-rows:1fr 16px;align-items:end;justify-items:center;gap:5px}.activity-day i{display:block;width:min(100%,24px);min-height:4px;border-radius:7px 7px 5px 5px;background:#d9541e;transition:height .3s var(--ease)}.activity-day small{color:#a5a39c;font:400 10px "Spline Sans Mono",monospace}.activity-day.today small{color:#141414;font-weight:700}.dashboard-activity-foot{display:flex;align-items:center;gap:14px;margin-top:auto;padding-top:11px;border-top:1px solid #efede7;color:#8a8b8e;font-size:10px;white-space:nowrap}.dashboard-activity-foot b{color:#242527;font:500 13px "Spline Sans Mono",monospace}
.dashboard-summary{min-height:250px;padding:22px;display:flex;flex-direction:column;background:#fff;border:1px solid #e7e5df;border-radius:22px}.dashboard-summary-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.dashboard-summary-head>span{font-size:14px;font-weight:600}.dashboard-summary-head small{color:#929397;font:400 10px "Spline Sans Mono",monospace}.dashboard-metrics{display:grid;grid-template-columns:1fr 1fr;margin:20px 0}.dashboard-metrics>span{display:grid;gap:3px;padding:13px 0}.dashboard-metrics>span:nth-child(even){padding-left:18px;border-left:1px solid #efede7}.dashboard-metrics>span:nth-child(n+3){border-top:1px solid #efede7}.dashboard-metrics b{font:400 24px "Spline Sans Mono",monospace;letter-spacing:-.04em}.dashboard-metrics span:nth-child(2) b,.dashboard-metrics span:nth-child(4) b{color:#d9541e}.dashboard-metrics small{color:#7a7c80;font-size:11px}.dashboard-summary-foot{display:grid;gap:8px;margin-top:auto;color:#7a7c80;font-size:11px}.dashboard-summary-foot>i{height:6px;background:#eceae4;border-radius:99px;overflow:hidden}.dashboard-summary-foot>i b{display:block;height:100%;border-radius:inherit;background:#d9541e}
.dashboard-studying{display:grid;gap:18px}.dashboard-studying>header,.dashboard-library-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}.dashboard-studying>header>div{display:flex;align-items:baseline;gap:12px}.dashboard-studying h2,.dashboard-library-head h2{margin:0;font:600 21px "Schibsted Grotesk",sans-serif;letter-spacing:-.025em}.dashboard-studying>header span{color:#7a7c80;font:400 12px "Spline Sans Mono",monospace}.dashboard-studying>header>a{color:#5e6064;font-size:12px;text-decoration:none}.dashboard-studying>header>a:hover{color:#d9541e}
/* Finished openings. A quieter, denser list under Studying — smaller than a
   study card because there is nothing left to resume. */
.dashboard-completed{display:grid;gap:18px}
.dashboard-completed>header,.dashboard-completed>header>div{display:flex;align-items:baseline}
.dashboard-completed>header{justify-content:space-between;gap:16px}
.dashboard-completed>header>div{gap:12px}
.dashboard-completed h2{margin:0;font:600 21px "Schibsted Grotesk",sans-serif;letter-spacing:-.025em}
.dashboard-completed>header span{color:#7a7c80;font:400 12px "Spline Sans Mono",monospace}
.completed-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px}
.completed-card{min-width:0;display:grid;grid-template-columns:56px minmax(0,1fr);align-items:center;gap:12px;padding:10px 12px;background:#fff;border:1px solid #e7e5df;border-radius:14px;color:#141414;text-decoration:none;transition:transform .18s cubic-bezier(.2,.7,.2,1),box-shadow .18s,border-color .18s}
.completed-card:hover{color:#141414;transform:translateY(-1px);border-color:#d2d0c8;box-shadow:0 14px 28px -22px #1e282359}
.completed-card-board .lesson-board{width:56px;border-radius:9px;font-size:7px}
.completed-card-main{min-width:0;display:flex;flex-direction:column;gap:3px}
.completed-card-main .lesson-card-top{justify-content:flex-start;gap:6px;font-size:10px}
.completed-card-main .side-dot{width:7px;height:7px}
.completed-card-main>strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 13px/1.25 "Schibsted Grotesk",sans-serif;letter-spacing:-.015em}
.completed-card-main>small{color:#7a7c80;font:400 11px "Spline Sans Mono",monospace}
.studying-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(max(290px,calc((100% - 32px)/3)),1fr));gap:16px}.study-card{min-width:0;display:grid;grid-template-columns:104px minmax(0,1fr);grid-template-rows:auto auto auto;gap:16px;padding:14px;background:#fff;border:1px solid #e7e5df;border-radius:20px;color:#141414;text-decoration:none;transition:transform .2s cubic-bezier(.2,.7,.2,1),box-shadow .2s,border-color .2s}.study-card:hover{color:#141414;transform:translateY(-2px);border-color:#d2d0c8;box-shadow:0 22px 44px -28px #1e282359}.study-card-board{grid-row:1}.study-card-board .lesson-board{width:104px;border-radius:11px;font-size:11px}.study-card-main{min-width:0;display:flex;flex-direction:column;gap:6px}.study-card-main>strong{font-size:19px;line-height:1.2;letter-spacing:-.025em}.study-card-main>small{color:#7a7c80;font-size:11px}.study-card-progress{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;align-items:baseline;gap:9px 10px;padding-top:14px;border-top:1px solid #e7e5df}.study-card-known{display:flex;align-items:baseline;gap:5px}.study-card-known b{font:400 22px "Spline Sans Mono",monospace;letter-spacing:-.03em}.study-card-known small{color:#7a7c80;font-size:11px}.study-card-seen{justify-self:end;color:#7a7c80;font-size:11px;white-space:nowrap}.study-card-bar{grid-column:1/-1;height:6px;background:#eceae4;border-radius:99px;overflow:hidden}.study-card-bar b{display:block;height:100%;border-radius:inherit;background:#d9541e}.study-card-legend{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:5px 14px;color:#5e6064;font-size:11px}.study-card-legend>span{display:flex;align-items:center;gap:6px;white-space:nowrap}.study-card-legend i{width:8px;height:8px;border-radius:50%;background:#d9541e}.study-card-legend .learning i{background:#f0a868}.study-card-legend .not-started i{background:#e0ded7}.study-card .lesson-card-top{justify-content:flex-start;gap:7px}.study-card-action{grid-column:1/3;height:38px;border-radius:10px;background:#141414;color:#f3f2ee;display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px;font-weight:600}.study-card:hover .study-card-action{background:#292929}.study-card-action b{font-size:16px}.study-empty{grid-column:1/-1;min-height:190px;border:1px dashed #d2d0c8;border-radius:20px;color:#5e6064;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-decoration:none;transition:background .18s,border-color .18s}.study-empty:hover{background:#edeae5;border-color:#bbb9b2;color:#141414}.study-empty>span{width:40px;height:40px;border-radius:12px;background:#fff;border:1px solid #e3e1da;display:grid;place-items:center;font-size:20px}.study-empty strong{font-size:14px}.study-empty small{color:#929397;font-size:12px}
/* The card is a link, so the kebab and its menu are siblings of the anchor inside
   this wrapper — the wrapper, not the card, is the grid item. */
.study-card-wrap{position:relative;min-width:0;display:grid}.study-card-wrap.open{z-index:20}
.study-menu-button{position:absolute;top:8px;right:8px;z-index:2;width:26px;height:26px;padding:0;display:grid;place-items:center;border:1px solid #e0ded7;border-radius:9px;background:#ffffffd9;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);color:#5e6064;font:600 15px/1 "DM Sans",system-ui,sans-serif;cursor:pointer;transition:opacity .16s,background .16s,color .16s,border-color .16s,transform .2s cubic-bezier(.2,.7,.2,1)}
.study-menu-button:hover,.study-card-wrap.open .study-menu-button{border-color:#c9c7bf;background:#fff;color:#141414}
.study-card-wrap:hover .study-menu-button{transform:translateY(-2px)}
.study-menu-button:focus-visible{outline:none;box-shadow:0 0 0 3px #8eaa9f59}
.study-menu{position:absolute;top:40px;right:8px;z-index:30;min-width:196px;padding:6px;background:var(--paper);border:1px solid var(--hair);border-radius:13px;box-shadow:0 18px 48px #17181926,0 2px 6px #1718190f;transform-origin:top right}
/* Bound to .open rather than to the element, because the menu is toggled in
   place: an animation on the element itself would only ever run once, at page
   render, while the menu was still hidden. */
.study-card-wrap.open .study-menu{animation:menu-in .18s var(--ease) both}
.study-menu[hidden]{display:none}
.study-menu button{width:100%;text-align:left;border:0;background:transparent;border-radius:9px;padding:9px 11px;font-size:12.5px;font-weight:600;color:var(--ink-2);cursor:pointer;white-space:nowrap;transition:background .15s,color .15s}
.study-menu button:hover{background:#f3f2ee;color:var(--ember-deep)}
.study-menu button:focus-visible{outline:none;box-shadow:inset 0 0 0 2px #8eaa9f80}
/* The popup overflows a bottom-row card; the side column scrolls, so claim the
   room up front rather than making the user scroll to read their own menu. */
.studying-grid:has(.study-card-wrap.open){padding-bottom:52px}
.dashboard-library{gap:18px;scroll-margin-top:82px}.dashboard-library-head p{margin:0;color:#7a7c80;font-size:13px}.dashboard-library-head>span{color:#7a7c80;font:400 12px "Spline Sans Mono",monospace}.dashboard-library .catalog-tools{position:static;top:auto;margin:0;padding:0;background:none;backdrop-filter:none}
/* Heading + search stay pinned while the lesson list scrolls under them. */
.dashboard-library-top{position:sticky;top:63px;z-index:4;display:grid;gap:12px;padding-bottom:12px;background:var(--catalog-bg)}
.dashboard-library-head{align-items:baseline}
/* Dense menu rows: small board, title, ECO + lines. */
.lesson-rows{display:grid;gap:8px}
.lesson-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:8px 10px;background:#fff;border:1px solid #e7e5df;border-radius:14px;color:#141414;text-decoration:none;transition:transform .18s cubic-bezier(.2,.7,.2,1),box-shadow .18s,border-color .18s}
.lesson-row:hover{color:#141414;transform:translateY(-1px);border-color:#d2d0c8;box-shadow:0 16px 30px -24px #1e282359}
.lesson-row:focus-visible{outline:none;border-color:var(--sage);box-shadow:0 0 0 4px #8eaa9f26}
.lesson-row-board .lesson-board{width:76px;border-radius:11px;font-size:9px}
.lesson-row-copy{min-width:0;display:grid;gap:4px}
.lesson-row-copy>strong{font:600 14px/1.25 "Schibsted Grotesk",sans-serif;letter-spacing:-.015em}
.lesson-row-meta{display:flex;align-items:center;gap:6px;color:#7a7c80;font-size:11px}
.lesson-row-meta .side-dot{width:8px;height:8px}
.lesson-row-meta small{white-space:nowrap;font:400 11px "Spline Sans Mono",monospace}
.lesson-row.started .lesson-row-meta small{color:#d9541e;font-weight:500}
.lesson-row-go{color:#c4c2ba;font-size:14px;font-weight:600;transition:color .18s,transform .18s}
.lesson-row:hover .lesson-row-go{color:#d9541e;transform:translateX(2px)}
@media(max-width:900px){.dashboard-hero{grid-template-columns:1fr}.studying-grid{grid-template-columns:1fr}}
/* Hero + Studying keep their order at every width; the split places them in the right column by grid area. */
.dashboard-side{display:grid;gap:inherit}

/* Signed-in dashboard on desktop: the library hugs the left edge and scrolls on its own,
   hero + Studying fill the rest of the viewport. */
@media(min-width:901px){
  /* --rail-x mirrors the topbar's own inset, so the rail's heading sits exactly under the
     brand and the right column keeps the same breathing room from the screen edge. */
  .dashboard-split{--rail-x:clamp(16px,3vw,40px);height:100%;min-height:0;overflow:hidden;grid-template-columns:clamp(320px,23vw,372px) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:clamp(28px,3vw,52px);padding:clamp(24px,4vw,44px) var(--rail-x) 0 0}
  /* Both rails are grid columns with a definite height, so their auto rows would
     otherwise stretch to fill it: the library's heading and search box would drift
     apart and its rows would grow taller whenever a search left the list short.
     Pack the tracks at the top and let the leftover height fall at the bottom. */
  .dashboard-split>.dashboard-library{align-content:start;grid-area:1/1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 10px clamp(24px,4vw,44px) var(--rail-x);scrollbar-width:thin;scrollbar-color:#d8d7d2 transparent}
  .dashboard-split>.dashboard-side{align-content:start;grid-area:1/2;min-height:0;overflow-y:auto;overscroll-behavior:contain;gap:clamp(28px,3vw,42px);padding-right:10px;padding-bottom:clamp(24px,4vw,44px);scrollbar-width:thin;scrollbar-color:#d8d7d2 transparent}
  .dashboard-split>.dashboard-library::-webkit-scrollbar,.dashboard-split>.dashboard-side::-webkit-scrollbar{width:10px}
  .dashboard-split>.dashboard-library::-webkit-scrollbar-thumb,.dashboard-split>.dashboard-side::-webkit-scrollbar-thumb{background:#d8d7d2;border-radius:999px;border:3px solid #f3f2ee}
  /* The pinned header's backdrop has to cover the rail edge to edge, padding included,
     or rows scroll up through the inset strip beside it. */
  .dashboard-split .dashboard-library-top{top:0;margin-left:calc(-1 * var(--rail-x));padding-left:var(--rail-x)}
  .dashboard-split .dashboard-library .catalog-search{flex:1 1 auto;max-width:none}
  /* The wider right column fits two study cards comfortably again. */
  .dashboard-split .studying-grid{grid-template-columns:repeat(auto-fill,minmax(340px,1fr))}
}

/* Scroll fade. The dashboard's columns scroll independently, so a list that
   runs past the fold has to say so — otherwise a clipped card looks like the
   end of the list. syncScrollFades() in app.js flags the edges that still have
   content under them and this mask dissolves them.
   A mask rather than a gradient overlay: it reveals whatever is genuinely
   behind the scroller, so there is no background colour to keep in sync and
   the effect survives the dark theme untouched. Registering the two depths as
   animatable lengths lets the fade ease in and out instead of popping;
   browsers without @property just snap, which is the old behaviour anyway. */
@property --scroll-fade-top{syntax:"<length>";inherits:false;initial-value:0px}
@property --scroll-fade-bottom{syntax:"<length>";inherits:false;initial-value:0px}
[data-scroll-fade]{
  --scroll-fade-size:30px;
  /* How deep the top edge dissolves. Per-element, because a scroller with an
     opaque header pinned across its top edge never shows content up there —
     see the library rail below. */
  --scroll-fade-top-size:var(--scroll-fade-size);
  --scroll-fade-top:0px;
  --scroll-fade-bottom:0px;
  transition:--scroll-fade-top .22s ease-out,--scroll-fade-bottom .22s ease-out;
  -webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--scroll-fade-top),#000 calc(100% - var(--scroll-fade-bottom)),transparent 100%);
  mask-image:linear-gradient(to bottom,transparent 0,#000 var(--scroll-fade-top),#000 calc(100% - var(--scroll-fade-bottom)),transparent 100%);
}
[data-scroll-fade][data-fade-top]{--scroll-fade-top:var(--scroll-fade-top-size)}
[data-scroll-fade][data-fade-bottom]{--scroll-fade-bottom:var(--scroll-fade-size)}
/* The rail pins an opaque header — title, search, filters — across its top edge,
   so nothing ever reaches the top of the scroller: the whole band the top fade
   would cover is header. Dissolving it there fades the header itself, which
   reads as a rendering fault rather than an affordance. Rows sliding under the
   header already say the list continues upward, so this column keeps the
   bottom fade only. */
.dashboard-split>.dashboard-library{--scroll-fade-top-size:0px}
/* A study card's options menu is a popup that hangs *below* its card, so a card
   sitting near the fold can catch it in the bottom band and render it half
   dissolved. Retract that band while a menu is open: the transition above makes
   it a soft retract rather than a snap, and the menu stays fully legible. */
[data-scroll-fade]:has(.study-card-wrap.open){--scroll-fade-bottom:0px}
@media(max-width:760px){.dashboard-nav{display:none}.header-account{gap:7px}.header-account .streak-badge strong::after{display:none}.dashboard-page{padding-top:16px;gap:34px}.dashboard-focus{min-height:200px;padding:20px;border-radius:18px}.dashboard-focus h1{font-size:28px}.dashboard-activity{min-height:210px;border-radius:18px}.dashboard-activity-foot{gap:9px}.study-card{grid-template-columns:82px minmax(0,1fr);gap:12px;padding:11px;border-radius:16px}.study-card-board .lesson-board{width:82px}.study-card-main>strong{font-size:16px}.study-card-known b{font-size:17px}.study-card-legend{gap:5px 12px;font-size:10px}.study-card-action{grid-column:1/-1}.completed-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px}.completed-card{grid-template-columns:48px minmax(0,1fr);gap:10px;padding:9px 10px}.completed-card-board .lesson-board{width:48px;font-size:6px}.completed-card-main>strong{font-size:12px}.dashboard-library-head p{display:none}}

/* The study card's board drops to 82px here, so its glyphs must fit the 82/8 =
   10.25px row. The board hides its overflow, so an 11px glyph clips the bottom
   rank silently rather than overflowing visibly. */
@media(max-width:760px){.study-card-board .lesson-board{width:82px;font-size:10px}}

.line-card b.mastered{color:var(--sage-deep);font-weight:700}

/* Loading system: stable page geometry, a restrained shimmer and one shared Lottie. */
.loading-view{cursor:progress}
.loading-view .catalog-page a,.loading-view .catalog-page button,.loading-view .catalog-page input,.loading-view .catalog-page label{pointer-events:none}
.skeleton{display:block;position:relative;overflow:hidden;background:#e5e3dd;border-radius:8px;color:transparent!important}
.skeleton::after,.skeleton-lines span::after,.skeleton-tabs span::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(100deg,transparent 20%,rgba(255,255,255,.72) 48%,transparent 76%);animation:skeletonShimmer 1.6s ease-in-out infinite}
@keyframes skeletonShimmer{to{transform:translateX(100%)}}
.skeleton-header .skeleton-account{width:86px;height:34px;margin-left:auto;border-radius:10px}
/* Placeholder text. The real tag, the real class and a real string lay the box out, so
   wrapping, gaps and every breakpoint match the loaded page to the pixel; the bars are
   painted inside it as one `lh`-tall tile per line. `em` sizing is the fallback for the
   handful of engines without `lh`; the `@supports` block upgrades it to exact line boxes. */
.sk-line{position:relative;display:inline-block;color:transparent!important;background-image:linear-gradient(#e5e3dd 60%,transparent 60%);background-size:100% 1.15em;background-position:0 .4em;background-repeat:repeat-y;border-radius:5px}
@supports (background-size:1lh){
  .sk-line{background-image:linear-gradient(#e5e3dd .58lh,transparent .58lh);background-size:100% 1lh;background-position:0 .2lh}
  .sk-line::after{content:"";position:absolute;inset:0;background-image:linear-gradient(100deg,transparent 20%,rgba(255,255,255,.72) 48%,transparent 76%);background-size:300% 100%;background-repeat:no-repeat;animation:skLineShimmer 1.6s ease-in-out infinite;-webkit-mask-image:linear-gradient(#000 .58lh,transparent .58lh);mask-image:linear-gradient(#000 .58lh,transparent .58lh);-webkit-mask-size:100% 1lh;mask-size:100% 1lh;-webkit-mask-position:0 .2lh;mask-position:0 .2lh;-webkit-mask-repeat:repeat-y;mask-repeat:repeat-y}
}
@keyframes skLineShimmer{from{background-position-x:-50%}to{background-position-x:150%}}
.loading-animation-card{align-self:stretch;display:grid;place-items:center;align-content:center;gap:4px;border:1px solid #e4e1da;border-radius:24px;background:#fff;overflow:hidden;color:#92908a;font:400 11px "Spline Sans Mono",monospace;letter-spacing:.04em}
.lottie-spinner{width:min(280px,80%);aspect-ratio:16/9;overflow:hidden}.lottie-spinner svg{display:block!important}
/* The loader's mini boards carry the real .lesson-board class, so every breakpoint size,
   radius and the catalog-shell checkerboard come for free. They are emitted empty — the
   class alone paints a full checkerboard — so the only thing added here is the sweep. */
.sk-board{position:relative}
.sk-board::after{content:"";position:absolute;inset:0;border-radius:inherit;background-image:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.78) 48%,transparent 66%);background-size:300% 100%;background-repeat:no-repeat;animation:skLineShimmer 1.6s ease-in-out infinite}
.sk-move{width:64px;background:#e0ded7}
/* The real search control is an <input>; the loader stands a span in for it, so the span
   has to carry the input's own font and flex sizing or the toolbar reflows on swap. */
.catalog-search-text{width:100%;font:400 14px "Schibsted Grotesk",sans-serif}
.skeleton-board{width:100%;aspect-ratio:1;border-radius:13px}.study-card-board .skeleton-board{width:104px;border-radius:11px}.lesson-row-board .skeleton-board{width:76px;border-radius:11px}.skeleton-move{width:64px;background:#e0ded7}.skeleton-cta{width:168px;height:42px;margin-top:auto;border-radius:11px}.skeleton-lines span,.skeleton-tabs span{position:relative;display:block;overflow:hidden;height:11px;border-radius:6px;background:#e5e3dd}
.loading-view:not(.catalog-shell) .skeleton{background:#e3e1db}.skeleton-board-label{width:120px;height:12px}.skeleton-chessboard{position:relative;isolation:isolate;box-shadow:0 24px 70px #2e312a1c}.skeleton-chessboard .board{background:#edf0e9}.skeleton-chessboard .board i{background:#edf0e9}.skeleton-chessboard .board i:nth-child(16n + 1),.skeleton-chessboard .board i:nth-child(16n + 3),.skeleton-chessboard .board i:nth-child(16n + 5),.skeleton-chessboard .board i:nth-child(16n + 7),.skeleton-chessboard .board i:nth-child(16n + 10),.skeleton-chessboard .board i:nth-child(16n + 12),.skeleton-chessboard .board i:nth-child(16n + 14),.skeleton-chessboard .board i:nth-child(16n + 16){background:#8eaa9f}.board-loader{position:absolute;z-index:2;inset:0;display:grid;place-items:center;align-content:center;gap:10px;background:rgba(245,244,240,.58);backdrop-filter:blur(2px)}.board-loader .lottie-spinner{width:36%}.board-loader-label{font:600 12px "DM Sans",system-ui,sans-serif;letter-spacing:.02em;color:#55565a;text-align:center;padding:0 16px}.skeleton-footer-line{width:98px;height:10px}.skeleton-footer-line.short{width:72px}.skeleton-tabs{pointer-events:none}.skeleton-tabs span{width:74px;height:26px;background:#e3e1db}.skeleton-back{width:92px;height:12px}.skeleton-panel-title{width:76%;height:45px;border-radius:10px}.skeleton-speech{width:100%;height:126px;border-radius:17px}.skeleton-section-title{width:58%;height:14px}.skeleton-lines{display:grid;gap:8px}.skeleton-lines span{width:100%;height:56px;border-radius:12px}
.content-enter .catalog-page>*{animation:contentReveal .52s cubic-bezier(.22,.72,.26,1) both}.content-enter .catalog-page>*:nth-child(2){animation-delay:70ms}.content-enter .catalog-page>*:nth-child(3){animation-delay:110ms}.content-enter .board-area{animation:contentReveal .48s cubic-bezier(.22,.72,.26,1) both}.content-enter .sidebar{animation:contentReveal .52s 70ms cubic-bezier(.22,.72,.26,1) both}
@keyframes contentReveal{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
/* A search or filter rebuilds the results in place. The fresh rows arrive with the same
   motion the page itself uses on load, stepped off --i so the list reads as a cascade
   rather than one block. The step is capped: a full page of rows should not take a
   second to settle. */
.catalog-results-in .lesson-row,.catalog-results-in .lesson-card,.catalog-results-in .catalog-empty{animation:contentReveal .52s cubic-bezier(.22,.72,.26,1) both;animation-delay:min(calc(var(--i,0) * 26ms),208ms)}
/* Training panel swap (puzzle/line details → solved). The board stays mounted;
   only the sidebar content leaves and enters. */
.panel-content.panel-leaving{animation:panel-out .16s ease both;pointer-events:none}
@keyframes panel-out{to{opacity:0;transform:translateY(8px)}}
.complete-panel{animation:panel-in .34s cubic-bezier(.22,.72,.26,1) both}
.complete-panel .success-mark{animation:pop-in .42s var(--ease) both}
.complete-panel .eyebrow{animation:fade-in .28s .05s both}
.complete-panel h1{animation:contentReveal .36s .1s cubic-bezier(.22,.72,.26,1) both}
.complete-panel .muted{animation:contentReveal .36s .16s cubic-bezier(.22,.72,.26,1) both}
.complete-panel .puzzle-themes{animation:contentReveal .36s .22s cubic-bezier(.22,.72,.26,1) both}
.complete-panel .primary{animation:contentReveal .36s .28s cubic-bezier(.22,.72,.26,1) both}
.complete-panel .secondary.full{animation:fade-in .3s .34s both}
/* The reveal stagger plays once, when swapTrainingPanel inserts the panel. Progress
   echoes re-render the whole app in the seconds after an award, and each render
   remounts the panel fresh; `.revealed` stops those remounts from replaying it. */
.complete-panel.revealed,.complete-panel.revealed .success-mark,.complete-panel.revealed .success-mark:after,.complete-panel.revealed .eyebrow,.complete-panel.revealed h1,.complete-panel.revealed .muted,.complete-panel.revealed .puzzle-themes,.complete-panel.revealed .primary,.complete-panel.revealed .secondary.full{animation:none}
@keyframes panel-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){
  .panel-content.panel-leaving{animation:none}
  .complete-panel,.complete-panel .success-mark,.complete-panel .eyebrow,.complete-panel h1,.complete-panel .muted,.complete-panel .puzzle-themes,.complete-panel .primary,.complete-panel .secondary.full{animation:gentleFade .18s ease-out both}
}
.load-error{min-height:100dvh;display:grid;place-content:center;justify-items:center;gap:10px;padding:24px;background:#f3f2ee;color:#141414;text-align:center}.load-error>span{font-size:34px}.load-error h1{margin:4px 0 0;font:600 28px "Schibsted Grotesk",sans-serif}.load-error p{margin:0 0 12px;color:#7a7c80}.load-error button{height:42px;padding:0 18px;border:0;border-radius:11px;background:#141414;color:#fff;cursor:pointer}
@media(max-width:760px){.loading-animation-card{display:none}.study-card-board .skeleton-board{width:82px}.board-loader .lottie-spinner{width:52%}}
@media(prefers-reduced-motion:reduce){.skeleton::after,.skeleton-lines span::after,.skeleton-tabs span::after{animation:none}.sk-line::after{display:none}.content-enter .catalog-page>*,.content-enter .board-area,.content-enter .sidebar,.catalog-results-in .lesson-row,.catalog-results-in .lesson-card,.catalog-results-in .catalog-empty{animation:gentleFade .18s ease-out both}@keyframes gentleFade{from{opacity:.55}to{opacity:1}}}

/* Button loading uses the same supplied Lottie artwork—there are no competing CSS spinners. */
.auth-google-spinner{right:10px;width:36px;height:22px;border:0;border-radius:0;overflow:hidden;animation:none!important}
.auth-google.pending .auth-google-spinner{animation:none!important}
.auth-spinner{right:9px;width:40px;height:24px;margin-top:-12px;border:0;border-radius:0;overflow:hidden;animation:none!important}
.auth-form.pending .auth-spinner{animation:none!important}
.header-account .streak-badge{min-width:66px;justify-content:center;font-variant-numeric:tabular-nums}

/* ---------- Chess puzzles ---------- */
.focus-actions{margin-top:auto;display:flex;flex-wrap:wrap;gap:10px}
.focus-actions>a:not(.puzzles-link){height:42px;padding:0 17px;border-radius:11px;background:#d9541e;color:#fff;display:flex;align-items:center;gap:16px;text-decoration:none;font-size:13px;font-weight:600;transition:transform .18s,background .18s,box-shadow .18s}
.focus-actions>a:not(.puzzles-link):hover{background:#c74819;color:#fff;transform:translateY(-2px);box-shadow:0 12px 28px #0005}
.focus-actions>a:not(.puzzles-link) b{font-size:17px}
.puzzles-link{height:42px;padding:0 17px;border-radius:11px;display:inline-flex;align-items:center;gap:9px;text-decoration:none;font-size:13px;font-weight:600;transition:transform .18s,background .18s,border-color .18s,box-shadow .18s}
.puzzles-link span{font-size:17px;line-height:1}
.puzzles-link small{padding-left:9px;border-left:1px solid currentColor;font-size:11px;font-weight:500;opacity:.6}
.puzzles-link:focus-visible{outline:2px solid #d9541e;outline-offset:2px}
.focus-actions>.puzzles-link{border:1px solid #3a3b37;background:#1f201d;color:#f3f2ee}
.focus-actions>.puzzles-link:hover{background:#2a2b27;border-color:#55564f;color:#fff;transform:translateY(-2px);box-shadow:0 12px 28px #0005}
.catalog-actions{display:flex;gap:10px}
.catalog-actions .puzzles-link{height:46px;padding:0 20px;font-size:14px;border:1px solid #141414;background:#141414;color:#fff}
.catalog-actions .puzzles-link:hover{background:#d9541e;border-color:#d9541e;transform:translateY(-2px);box-shadow:0 12px 28px #d9541e40}
.puzzle-actions{order:5;display:grid;grid-template-columns:1fr;gap:10px}
.puzzle-actions .secondary{padding:11px 12px}
.puzzle-panel .puzzle-actions .secondary:focus-visible,.puzzle-complete .secondary:focus-visible{outline:2px solid #171819;outline-offset:2px}

.puzzle-themes{list-style:none;margin:6px 0 4px;padding:0;display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.puzzle-themes li{padding:5px 10px;border-radius:999px;border:1px solid #e2e1dc;background:#fff;color:#55565a;font-size:11px}
.puzzle-themes li.rating{background:#171819;border-color:#171819;color:#fff}
.puzzle-message{min-height:100%;box-sizing:border-box;display:grid;place-content:center;justify-items:center;gap:12px;padding:40px 20px 90px;text-align:center;color:#141414}
.puzzle-message>span{font-size:44px;line-height:1}
.puzzle-message h1{margin:4px 0 0;font:600 clamp(28px,4vw,40px)/1.05 "Schibsted Grotesk",sans-serif;letter-spacing:-.045em}
.puzzle-message p{margin:0;max-width:440px;color:#5e6064;font-size:16px;line-height:1.5}
.puzzle-message-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:10px}
.puzzle-primary,.puzzle-secondary{height:44px;padding:0 20px;border-radius:11px;font:600 14px "Schibsted Grotesk",system-ui,sans-serif;cursor:pointer;transition:background .18s,border-color .18s,transform .18s}
.puzzle-primary{border:0;background:#d9541e;color:#fff}
.puzzle-primary:hover{background:#c74819;transform:translateY(-1px)}
.puzzle-secondary{border:1px solid #d8d6cf;background:#fff;color:#141414}
.puzzle-secondary:hover{background:#ebe9e4}
.puzzle-primary:focus-visible,.puzzle-secondary:focus-visible{outline:2px solid #141414;outline-offset:2px}
.content-enter .puzzle-message{animation:contentReveal .52s cubic-bezier(.22,.72,.26,1) both}
@media(prefers-reduced-motion:reduce){.content-enter .puzzle-message{animation:gentleFade .18s ease-out both}}
@media(max-width:760px){.focus-actions{width:100%}.focus-actions>a{flex:1 1 auto;justify-content:center}.puzzle-message-actions{width:100%;flex-direction:column}.puzzle-primary,.puzzle-secondary{width:100%}}

/* Lesson sign-in gate: the account wall a signed-out visitor meets on opening a
   lesson. The lesson's own preview board sits beside the copy so the prompt
   reads as a gate on that specific opening, not a generic login page. */
.lesson-gate{min-height:100%;box-sizing:border-box;display:grid;place-content:center;padding:clamp(24px,5vw,64px) 20px}
.lesson-gate-card{width:min(880px,100%);display:grid;grid-template-columns:minmax(220px,320px) minmax(0,1fr);align-items:center;gap:clamp(28px,4vw,60px)}
.lesson-gate-board{position:relative;aspect-ratio:1;width:min(100%,320px);justify-self:center;border-radius:24px;overflow:hidden;box-shadow:0 44px 96px -40px rgba(20,30,25,.55);background:#141414}
.lesson-gate-board .lesson-board{width:100%;height:100%;aspect-ratio:auto;border-radius:0;font:clamp(24px,3vw,40px) "Arial Unicode MS","Apple Symbols",serif;line-height:1}
.lesson-gate-fallback{width:100%;height:100%;display:grid;place-items:center;font-size:96px;color:#f3f2ee;background:#141414}
.lesson-gate-copy{min-width:0;display:grid;justify-items:start;gap:14px}
.lesson-gate-copy h1{margin:0;font:600 clamp(32px,4vw,48px)/1.02 "Schibsted Grotesk",sans-serif;letter-spacing:-.05em;color:var(--catalog-ink)}
.lesson-gate-copy>p{margin:0;max-width:440px;color:#5e6064;font-size:16px;line-height:1.55}
.lesson-gate-meta{font:400 12px "Spline Sans Mono",monospace;color:#a5a39c;text-transform:uppercase;letter-spacing:.04em}
.lesson-gate-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px}
.lesson-gate-back{margin-top:16px;color:var(--catalog-muted);font-size:13px;text-decoration:none;border-bottom:1px solid transparent;transition:color .15s,border-color .15s}
.lesson-gate-back:hover{color:var(--catalog-ink);border-color:currentColor}
.lesson-gate-back:focus-visible{outline:2px solid #d9541e;outline-offset:3px;border-radius:2px}
.content-enter .lesson-gate-card{animation:contentReveal .52s cubic-bezier(.22,.72,.26,1) both}
@media(prefers-reduced-motion:reduce){.content-enter .lesson-gate-card{animation:gentleFade .18s ease-out both}}
@media(max-width:760px){
  .lesson-gate-card{grid-template-columns:1fr;justify-items:center;text-align:center;gap:28px}
  .lesson-gate-board{width:min(66vw,280px)}
  .lesson-gate-copy{justify-items:center}
  .lesson-gate-copy>p{font-size:15px}
  .lesson-gate-actions{width:100%;flex-direction:column}
  .lesson-gate-actions .puzzle-primary,.lesson-gate-actions .puzzle-secondary{width:100%}
}
html[data-theme="dark"] .lesson-gate-copy>p{color:var(--catalog-muted)}
html[data-theme="dark"] .lesson-gate-meta{color:#8b8f97}
html[data-theme="dark"] .lesson-gate-board{box-shadow:0 44px 96px -40px rgba(0,0,0,.7)}


/* Move verdicts. A wrong move turns the coach red, flashes the attempted
   squares and gives the board a short shake; the right move flashes green and
   the coach ticks over. Both are one-shot: the next render starts clean. */
.speech.feedback-wrong{border-color:#f0c7ba;background:#fff6f2}
.speech.feedback-nudge{animation:feedback-nudge .38s var(--ease)}
.speech.feedback-wrong:before{background:#fff6f2}
.speech.feedback-correct{border-color:#cfe2c5;background:#f6fbf1}
.speech.feedback-correct:before{background:#f6fbf1}
.speech-kicker{display:block;margin:0 0 8px;font-size:9px;font-weight:700;letter-spacing:.13em;text-transform:uppercase;color:#9a9b9d}
.speech-kicker.wrong{color:#b8431c}
.speech-kicker.correct{color:#5f8577}
@keyframes feedback-nudge{0%,100%{transform:none}18%{transform:translateX(-5px)}36%{transform:translateX(5px)}54%{transform:translateX(-3px)}72%{transform:translateX(2px)}}
.board-shell.feedback-denied{animation:board-denied .4s cubic-bezier(.36,.07,.19,.97) both}
@keyframes board-denied{10%,90%{transform:translateX(-2px)}20%,80%{transform:translateX(3px)}30%,50%,70%{transform:translateX(-5px)}40%,60%{transform:translateX(5px)}}
/* The running score of the attempt: clean while green, red the moment it is not. */
.panel-topbar .puzzle-mistakes{flex:0 0 auto;display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border:1px solid #d9e6d2;border-radius:999px;background:#f2f8ec;color:#4f7a36;font-size:10px;font-weight:600;white-space:nowrap}
.panel-topbar .puzzle-mistakes.has{border-color:#f1d0c6;background:#fdf1ee;color:#b8431c}
/* The solved screen's CTA owns its wait, so the press is acknowledged even when
   the next puzzle has to come from the server. */
.puzzle-complete .puzzle-next{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:46px;transition:transform .18s,background .18s,opacity .18s}
.puzzle-complete .puzzle-next span[aria-hidden]{font-size:17px;line-height:1}
.puzzle-complete .puzzle-next.is-loading{cursor:progress;opacity:.9;transform:none;filter:none}
.puzzle-next-spinner{width:34px;height:20px;overflow:hidden;flex:0 0 auto}
.puzzle-next-spinner svg{display:block!important}
/* One ring leaves the success mark as the puzzle hands over to the next. */
.puzzle-complete .success-mark{position:relative}
.puzzle-complete .success-mark:after{content:"";position:absolute;inset:-7px;border-radius:50%;border:2px solid currentColor;opacity:0;animation:success-ring .9s .1s ease-out both}
@keyframes success-ring{0%{opacity:.55;transform:scale(.72)}70%{opacity:.16}100%{opacity:0;transform:scale(1.5)}}
html[data-theme="dark"] .board-loader-label{color:#b7bcc4}
html[data-theme="dark"] .speech.feedback-wrong{border-color:#4a2e28;background:#231512}
html[data-theme="dark"] .speech.feedback-wrong:before{background:#231512}
html[data-theme="dark"] .speech.feedback-correct{border-color:#2b3a2a;background:#182116}
html[data-theme="dark"] .speech.feedback-correct:before{background:#182116}
html[data-theme="dark"] .speech-kicker.wrong{color:#f0805c}
html[data-theme="dark"] .speech-kicker.correct{color:#a8c66c}
html[data-theme="dark"] .panel-topbar .puzzle-mistakes{border-color:#2b3a2a;background:#182116;color:#a8c66c}
html[data-theme="dark"] .panel-topbar .puzzle-mistakes.has{border-color:#4a2e28;background:#241512;color:#f0805c}
/* The short sidebar hides the coach's label lines, but the verdict is the one
   line that has to survive the squeeze — on a phone it is the whole feedback. */
@media(max-width:820px){.speech .speech-kicker{display:block;margin:0 0 3px;font-size:8px}}
@media(prefers-reduced-motion:reduce){.speech.feedback-nudge,.board-shell.feedback-denied,.puzzle-complete .success-mark:after{animation:none}}

/* Weekly activity: puzzle solves stack on top of lesson repetitions. Segment
   colours are locked to the legend swatches — a bar that changes hue on "today"
   would contradict the key. Today is marked by the bold day label only.
   Lessons wear the site-wide highlight orange, which is the same value in both
   themes, so it needs no dark override. Empty days are placeholders, so they
   wear a neutral grey rather than the lesson colour and never read as data. */
.activity-day i.empty{height:5%;background:#d8d6cf}
.activity-stack{width:min(100%,24px);display:flex;flex-direction:column;gap:2px;overflow:hidden;border-radius:7px 7px 5px 5px;transition:height .3s var(--ease)}
.activity-day .activity-stack i{width:100%;min-height:4px;flex-basis:0;border-radius:0}
.activity-day .activity-stack i.lesson{background:#d9541e}
.activity-day .activity-stack i.puzzle{background:var(--sage-deep)}
.activity-legend{display:flex;gap:10px}
.activity-legend span{display:flex;align-items:center;gap:5px}
.activity-legend i{width:7px;height:7px;border-radius:50%}
.activity-legend .lesson i{background:#d9541e}
.activity-legend .puzzle i{background:var(--sage-deep)}
.foot-puzzles b{color:var(--sage-deep)}

/* ---------- Theme control (account menu) ---------- */
.theme-menu-item{display:flex;align-items:center;gap:10px}
.theme-menu-icon{display:grid;place-items:center;flex:none}
.theme-menu-icon svg{width:18px;height:18px;display:block}
.theme-menu-label{flex:1}
.theme-menu-state{font-size:11px;font-weight:600;color:#9a9b9d;font-variant-numeric:tabular-nums}
.account-menu .theme-menu-item:hover{color:var(--ink)}
html[data-theme="dark"] .theme-menu-state{color:#8b8f97}

/* ---------- Pre-hydration splash ---------- */
/* Auth-neutral full-viewport loading screen shown before the app shell mounts.
   It mirrors the catalogue's light/dark tokens so the hand-off to the real
   page never shifts the background, and it shows the brand instead of a screen
   (signed-in dashboard or signed-out library) that would flash and swap. */
.splash{
  --splash-bg:#f3f2ee; --splash-ink:#141414; --splash-muted:#7a7c80;
  --splash-line:#e3e1da; --splash-vignette:rgba(20,30,25,.05); --splash-shimmer:rgba(20,30,25,.09);
  position:fixed; inset:0; z-index:999;
  display:grid; place-items:center;
  background:
    radial-gradient(130% 95% at 50% 42%, transparent 0 55%, var(--splash-vignette) 100%),
    var(--splash-bg);
  color:var(--splash-ink);
  font-family:"Schibsted Grotesk",system-ui,sans-serif;
}
html[data-theme="dark"] .splash{
  --splash-bg:#0e0f12; --splash-ink:#eef0f3; --splash-muted:#8b8f97;
  --splash-line:#26292f; --splash-vignette:rgba(0,0,0,.5); --splash-shimmer:rgba(255,255,255,.08);
}
.splash-inner{
  display:grid; justify-items:center; gap:14px;
  transform:translateY(-4vh); /* optical centring: sit a touch above true centre */
}
.splash-mark{
  width:64px; height:64px; display:grid; place-items:center;
  border-radius:16px; background:#141414;
  box-shadow:0 22px 46px -18px rgba(20,30,25,.55), inset 0 1px 0 rgba(255,255,255,.06);
  animation:splash-in .6s cubic-bezier(.22,.72,.26,1) both,
             splash-float 3.8s ease-in-out .9s infinite;
}
html[data-theme="dark"] .splash-mark{
  background:#1f2328;
  box-shadow:0 22px 46px -18px rgba(0,0,0,.7), inset 0 0 0 1px #2a2e34, inset 0 1px 0 rgba(255,255,255,.05);
}
.splash-mark img{width:100%;height:100%;object-fit:contain;display:block}
.splash-wordmark{
  margin-top:2px; font:600 22px/1 "Schibsted Grotesk",system-ui,sans-serif;
  letter-spacing:-.02em;
  animation:splash-in .6s .08s cubic-bezier(.22,.72,.26,1) both;
}
.splash-label{
  font:400 11px "Spline Sans Mono",monospace; text-transform:uppercase;
  letter-spacing:.16em; color:var(--splash-muted);
  animation:splash-in .6s .15s cubic-bezier(.22,.72,.26,1) both;
}
.splash-animation{
  position:relative; width:min(240px,80vw); margin-top:6px;
  animation:splash-in .6s .22s cubic-bezier(.22,.72,.26,1) both;
}
/* A faint CSS ghost stands in until the Lottie runtime + artwork finish their
   two cold fetches, so the splash never shows a bare gap while they load. It
   retires the moment the real animation injects its <svg>. */
.splash-animation::before{
  content:""; position:absolute; inset:36% 10%;
  border-radius:999px;
  background:linear-gradient(100deg,transparent 20%,var(--splash-shimmer) 48%,transparent 76%);
  background-size:220% 100%;
  animation:splash-ghost 1.5s ease-in-out infinite;
}
.splash-animation:has(svg)::before{display:none}
@keyframes splash-in{from{opacity:0;transform:translateY(10px) scale(.96)}to{opacity:1;transform:none}}
@keyframes splash-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@keyframes splash-ghost{from{background-position:200% 0}to{background-position:-20% 0}}
@media(max-width:600px){.splash-mark{width:56px;height:56px;border-radius:14px}.splash-wordmark{font-size:20px}}
@media(prefers-reduced-motion:reduce){
  .splash-mark,.splash-wordmark,.splash-label,.splash-animation{animation:none}
  .splash-animation::before{animation:none}
}

/* ---------- Dark theme (default) ---------- */
/* Light is the base (no attribute); `data-theme="dark"` re-maps the semantic
   tokens and flips the handful of hardcoded light colours that don't read from
   a variable. Chessboard squares and dark-on-light "ink" surfaces (dark hero
   cards, dark buttons) stay dark — only the page/surface/text layer inverts. */
:root{color-scheme:light}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0e0f12; --surface:#15171c; --surface-2:#1b1e24; --line:#26292f;
  --muted:#8b8f97; --text:#eef0f3; --green:#8eaa9f; --cream:#1b1e24; --brown:#8eaa9f;
  --ink:#eef0f3; --ink-2:#b7bcc4; --hair:#26292f; --paper:#15171c; --paper-2:#0f1114;
  --sage:#8eaa9f; --sage-deep:#a6c1b8; --ember:#db5628; --ember-deep:#f0805c;
  --catalog-bg:#0e0f12; --catalog-ink:#eef0f3; --catalog-muted:#8b8f97; --catalog-line:#26292f;
}
/* `.catalog-shell` declares the catalogue tokens on itself (see "Lesson library:
   light, editorial catalogue treatment" above), and a declaration on a
   descendant shadows `:root` for that whole subtree no matter how specific the
   `:root` selector is. Re-declare them here or the shell keeps light ink,
   borders and page background while everything reading `--paper`/`--ink`
   inverts — text goes black on black. */
html[data-theme="dark"] .catalog-shell{
  --catalog-bg:#0e0f12; --catalog-ink:#eef0f3; --catalog-muted:#8b8f97; --catalog-line:#26292f;
}

/* Shell & topbar */
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .topbar{background:rgba(14,15,18,.82);border-color:var(--hair)}
html[data-theme="dark"] .topbar .brand>span{background:#1f2328;color:#fff}
/* The header auth buttons read their fill from `--ink`, which flips near-white
   in dark mode — the solid pill's hardcoded `#fff` label lands on it and both
   buttons vanish. Re-point them at the same light-ink-on-dark treatment the
   other primary buttons (`.auth-submit`, `.prompt-go`) use. */
html[data-theme="dark"] .ghost-button{color:var(--ink-2)}
html[data-theme="dark"] .ghost-button:hover{background:#1b1e24;color:var(--ink)}
html[data-theme="dark"] .solid-button{border-color:#e8ebef;background:#e8ebef;color:#0e0f12;box-shadow:0 1px 2px #00000040}
html[data-theme="dark"] .solid-button:hover{box-shadow:0 6px 16px #00000055}
html[data-theme="dark"] .catalog-shell .topbar{background:rgba(14,15,18,.82);border-color:var(--catalog-line)}
html[data-theme="dark"] .catalog-stage,html[data-theme="dark"] .home-panel{scrollbar-color:#2c2f35 transparent}
html[data-theme="dark"] .catalog-stage::-webkit-scrollbar-thumb,html[data-theme="dark"] .home-panel::-webkit-scrollbar-thumb{background:#2c2f35}

/* Trainer / board panel */
html[data-theme="dark"] .panel-content{color:var(--ink)}
html[data-theme="dark"] .practice-panel .lesson-top,html[data-theme="dark"] .complete-panel{color:var(--ink)}
html[data-theme="dark"] .lesson-top .lesson-icon{color:var(--ink)}
html[data-theme="dark"] .icon-button{background:var(--paper);border-color:var(--hair);color:#a7adb6;box-shadow:0 1px 2px #00000040}
html[data-theme="dark"] .board-header small{color:#7c818a}
html[data-theme="dark"] .board-header strong{color:#d9dce1}
html[data-theme="dark"] .board-footer{color:#7c818a}
html[data-theme="dark"] .board-footer .orientation{color:#5f646d}
html[data-theme="dark"] .eyebrow{color:#8b8f97}
html[data-theme="dark"] .speech{background:var(--surface-2);color:var(--ink);border-color:var(--hair)}
html[data-theme="dark"] .speech>small{color:#8b8f97}
html[data-theme="dark"] .preview-note{border-color:#3a2b24;background:#241a16;color:#c9a08a}
html[data-theme="dark"] .progress-error{border-color:var(--hair);background:var(--paper);color:#c4c8ce}
html[data-theme="dark"] .progress-error .text-button{color:#d79a86}
html[data-theme="dark"] .tabs{background:var(--surface-2)}
html[data-theme="dark"] .tabs button{color:#8b8f97}
html[data-theme="dark"] .tabs button.active{background:var(--paper);color:var(--ink);box-shadow:0 1px 4px #00000040}
html[data-theme="dark"] .tabs button.active span{color:var(--ink)}
html[data-theme="dark"] .mastery-pill{border-color:var(--hair);background:var(--paper);color:#c4c8ce}
html[data-theme="dark"] .mastery-pill small{color:#8b8f97}
html[data-theme="dark"] .lines{background:var(--paper);border-color:var(--hair)}
html[data-theme="dark"] .line-card{border-bottom-color:#1f2228;background:var(--paper)}
html[data-theme="dark"] .line-card:hover{background:var(--surface-2);border-color:#1f2228}
html[data-theme="dark"] .line-index{background:var(--surface-2);color:#c4c8ce}
html[data-theme="dark"] .line-card strong{color:#dfe2e7}
html[data-theme="dark"] .line-card small{color:#8b8f97}
html[data-theme="dark"] .line-card>b{color:#6a6e75}
html[data-theme="dark"] .line-stars i{background:#2c2f35}
html[data-theme="dark"] .turn-card{background:var(--paper);border-color:var(--hair)}
html[data-theme="dark"] .turn-card.result{border-color:#e2602f;background:#241512}
html[data-theme="dark"] .turn-card.result strong{color:#f0805c}
html[data-theme="dark"] .move-list{background:var(--paper-2);border-color:var(--hair)}
html[data-theme="dark"] .empty-moves{color:#6a6e75}
html[data-theme="dark"] .secondary{background:var(--paper);border-color:var(--hair);color:#d7dade}
html[data-theme="dark"] .secondary:hover{background:var(--surface-2)}
html[data-theme="dark"] .progress-track{background:#26292f}
html[data-theme="dark"] .notation{background:var(--paper-2);border-color:var(--hair)}
html[data-theme="dark"] .notation span{color:#6a6e75}
html[data-theme="dark"] .notation span.done{color:#a7adb6}
html[data-theme="dark"] .notation span.current{color:var(--ember-deep);background:#db56282e}
html[data-theme="dark"] .tip{color:#6a6e75}
html[data-theme="dark"] .moves-head strong{color:#8b8f97}
html[data-theme="dark"] .moves-toggle{background:var(--paper);border-color:var(--hair);color:#8b8f97}
html[data-theme="dark"] .moves-toggle:hover{background:var(--surface-2);color:var(--ink);border-color:#3a3e46}
html[data-theme="dark"] .success-mark{background:rgba(226,96,47,.12);border-color:#e2602f;color:#e2602f}
html[data-theme="dark"] .complete-panel .primary{background:#e8ebef;border-color:#e8ebef;color:#0e0f12}
html[data-theme="dark"] .promotion{background:var(--paper);box-shadow:0 10px 30px #0008,0 0 0 1px #00000040}
html[data-theme="dark"] .promotion button{background:var(--paper)}
html[data-theme="dark"] .promotion .promotion-cancel{color:#a7adb6;background:var(--surface-2)}
html[data-theme="dark"] .promotion .promotion-cancel:hover{background:#1d1f25;color:var(--ink)}

/* Home / lesson selection */
html[data-theme="dark"] .suggest-card>span{background:var(--surface-2)}
html[data-theme="dark"] .suggest-card small{color:#8b8f97}
html[data-theme="dark"] .suggest-card>b{color:#6a6e75}
html[data-theme="dark"] .lesson-progress{background:#1b1e24}

/* Lesson library (catalog) */
html[data-theme="dark"] .catalog-copy p{color:#8b8f97}
html[data-theme="dark"] .catalog-tools{background:rgba(14,15,18,.9)}
html[data-theme="dark"] .catalog-search{background:var(--paper);border-color:var(--catalog-line)}
html[data-theme="dark"] .catalog-search:focus-within{border-color:#8eaa9f}
html[data-theme="dark"] .catalog-filters{background:var(--surface-2)}
html[data-theme="dark"] .catalog-filters button{color:#8b8f97}
html[data-theme="dark"] .catalog-filters button.active{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .filter-pawn.black{filter:drop-shadow(1px 0 0 #b7bcc4) drop-shadow(-1px 0 0 #b7bcc4) drop-shadow(0 1px 0 #b7bcc4) drop-shadow(0 -1px 0 #b7bcc4)}
html[data-theme="dark"] .lesson-group header small{color:#6a6e75}
html[data-theme="dark"] .lesson-card{background:var(--paper);border-color:var(--catalog-line)}
html[data-theme="dark"] .lesson-card:hover{border-color:#3a3e46}
html[data-theme="dark"] .lesson-card-top{color:#8b8f97}
html[data-theme="dark"] .side-dot{box-shadow:inset 0 0 0 1px #4a4e56}
html[data-theme="dark"] .lesson-copy>strong{color:var(--catalog-ink)}
html[data-theme="dark"] .lesson-progress-bars i{background:#2c2f35}
html[data-theme="dark"] .loading-animation-card{border-color:#26292f;background:var(--paper);color:#8b8f97}
html[data-theme="dark"] .continue-card{background:#171a1f;border:1px solid #26292f;box-shadow:0 40px 80px -40px rgba(0,0,0,.7)}
html[data-theme="dark"] .catalog-empty{border-color:#26292f}
html[data-theme="dark"] .catalog-empty strong{color:#b7bcc4}

/* Account header & auth dialog */
html[data-theme="dark"] .avatar-button{background:linear-gradient(145deg,#242a33,#1a1e25);border-color:#3a4049;color:#a6c1b8}
html[data-theme="dark"] .account-identity{border-bottom-color:#1f2228}
html[data-theme="dark"] .account-menu button:hover{background:#1b1e24}
html[data-theme="dark"] .auth-mark{background:#1b1e24;border-color:#26292f}
html[data-theme="dark"] .auth-check-ring{fill:#1b1e24}
html[data-theme="dark"] .auth-google{background:var(--paper);border-color:var(--hair)}
html[data-theme="dark"] .auth-google:hover:not(:disabled){background:var(--surface-2);border-color:#3a3e46}
html[data-theme="dark"] .auth-divider{color:#6a6e75}
html[data-theme="dark"] .auth-divider::before,html[data-theme="dark"] .auth-divider::after{background:#26292f}
html[data-theme="dark"] .auth-input input{border-color:var(--hair)}
html[data-theme="dark"] .auth-input input::placeholder{color:#6a6e75}
html[data-theme="dark"] .auth-input input:hover{border-color:#3a3e46}
html[data-theme="dark"] .auth-input input:focus{background:var(--paper);border-color:var(--sage)}
html[data-theme="dark"] .auth-input.invalid input{background:#241512}
html[data-theme="dark"] .auth-field.invalid input{background:#241512}
html[data-theme="dark"] .auth-eye{color:#8b8f97}
html[data-theme="dark"] .auth-eye:hover{color:var(--ink);background:#1b1e24}
html[data-theme="dark"] .auth-close{color:#8b8f97}
html[data-theme="dark"] .auth-close:hover{background:#1b1e24;color:var(--ink)}
html[data-theme="dark"] .auth-lead{color:#8b8f97}
html[data-theme="dark"] .auth-alert{background:#241512;border-color:#5a2c1c}
html[data-theme="dark"] .auth-strength-bar i{background:#2c2f35}
html[data-theme="dark"] .auth-strength-text{color:#8b8f97}
html[data-theme="dark"] .auth-footer{color:#8b8f97}
html[data-theme="dark"] .auth-hint{color:#8b8f97}
html[data-theme="dark"] .auth-submit{background:#e8ebef;border-color:#e8ebef;color:#0e0f12}
html[data-theme="dark"] .auth-submit:hover:not(:disabled){background:#ffffff;box-shadow:0 10px 24px #00000055}
html[data-theme="dark"] .auth-form.pending .auth-submit{background:#3a3e46}
html[data-theme="dark"] .auth-submit-label{color:#0e0f12}
html[data-theme="dark"] .auth-spinner{border-color:#0e0f1210;border-top-color:#0e0f12}
html[data-theme="dark"] .auth-google-spinner{border-color:#3a3e46;border-top-color:#e8ebef}
html[data-theme="dark"] .prompt-exit{color:#8b8f97}
html[data-theme="dark"] .prompt-exit:hover{background:#1b1e24;color:var(--ink)}
html[data-theme="dark"] .prompt-go{background:#e8ebef;color:#0e0f12}
html[data-theme="dark"] .prompt-go:hover:not(:disabled){background:#fff}
html[data-theme="dark"] .auth-form.pending .prompt-go{background:#3a3e46}

/* Toasts */
html[data-theme="dark"] .toast{background:#1f2328;color:#f2f4f6;border:1px solid #2a2e34}

/* Streak */
html[data-theme="dark"] .streak-badge{background:linear-gradient(135deg,#2a1a12,#241712);border-color:#5a2c1c}
html[data-theme="dark"] .catalog-shell .streak-badge{background:#15171c;border-color:var(--catalog-line)}
html[data-theme="dark"] .header-account .streak-badge{background:#15171c;border-color:var(--hair)}
html[data-theme="dark"] .header-account .streak-badge strong::after{color:#8b8f97}

/* Signed-in dashboard */
html[data-theme="dark"] .dashboard-nav a{color:#8b8f97}
html[data-theme="dark"] .dashboard-nav a:hover{background:#1b1e24;color:#eef0f3}
html[data-theme="dark"] .dashboard-nav a.active{background:#26292f;color:#eef0f3}
/* The hero is the page's focal point, and in light mode it earns that by being
   the darkest thing on a cream page. Here the page is already near-black, so it
   has to earn it the other way round: the *lightest* surface, top-lit. */
html[data-theme="dark"] .dashboard-focus{background:linear-gradient(152deg,#252b35 0%,#1b2028 56%,#171a20 100%);border:1px solid #323a46;box-shadow:0 34px 76px -48px #000,inset 0 1px 0 #ffffff14}
html[data-theme="dark"] .dashboard-activity,html[data-theme="dark"] .dashboard-summary,html[data-theme="dark"] .study-card{background:var(--paper);border-color:var(--catalog-line)}
html[data-theme="dark"] .dashboard-activity-head span,html[data-theme="dark"] .dashboard-summary-head small{color:#8b8f97}
html[data-theme="dark"] .activity-day i{background:#d9541e}
html[data-theme="dark"] .activity-day i.empty{background:#2c2f35}
html[data-theme="dark"] .activity-day small{color:#8b8f97}
html[data-theme="dark"] .activity-day.today small{color:#eef0f3}
html[data-theme="dark"] .dashboard-activity-foot{border-top-color:#1f2228;color:#6a6e75}
html[data-theme="dark"] .dashboard-activity-foot b{color:#d7dade}
html[data-theme="dark"] .dashboard-metrics>span:nth-child(even){border-left-color:#1f2228}
html[data-theme="dark"] .dashboard-metrics>span:nth-child(n+3){border-top-color:#1f2228}
html[data-theme="dark"] .dashboard-metrics small{color:#8b8f97}
html[data-theme="dark"] .dashboard-summary-foot{color:#8b8f97}
html[data-theme="dark"] .dashboard-summary-foot>i{background:#26292f}
html[data-theme="dark"] .dashboard-studying>header span,html[data-theme="dark"] .dashboard-library-head>span,html[data-theme="dark"] .dashboard-library-head p{color:#8b8f97}
html[data-theme="dark"] .dashboard-studying>header>a{color:#8b8f97}
html[data-theme="dark"] .study-card{color:var(--catalog-ink)}
html[data-theme="dark"] .study-card-main>small{color:#8b8f97}
html[data-theme="dark"] .study-card-progress{border-top-color:#1f2228}
html[data-theme="dark"] .study-card-known small{color:#8b8f97}
html[data-theme="dark"] .study-card-seen{color:#8b8f97}
html[data-theme="dark"] .study-card-bar{background:#26292f}
html[data-theme="dark"] .study-card-legend{color:#8b8f97}
html[data-theme="dark"] .study-card-legend .not-started i{background:#2c2f35}
/* Light mode fills this with ink because the card is white. Near-white here
   would put a row of glaring slabs on the page, and the page's one loud action
   is the hero CTA — so this reads as a raised control instead. */
html[data-theme="dark"] .study-card-action{background:#242931;color:#eef0f3;border:1px solid #333a44}
html[data-theme="dark"] .study-card:hover .study-card-action{background:#2f353f;border-color:#414a55}
/* Finished openings. Quieter than study cards: smaller board, less chrome. */
html[data-theme="dark"] .completed-card{background:var(--paper);border-color:var(--catalog-line);color:var(--catalog-ink)}
html[data-theme="dark"] .completed-card:hover{border-color:#3a3e46}
html[data-theme="dark"] .completed-card-main>small{color:#8b8f97}
html[data-theme="dark"] .study-empty{border-color:#2c2f35;color:#8b8f97}
html[data-theme="dark"] .study-empty:hover{background:#15171c;border-color:#3a3e46;color:#eef0f3}
html[data-theme="dark"] .study-empty>span{background:var(--paper);border-color:var(--hair)}
html[data-theme="dark"] .study-menu-button{border-color:#2c2f35;background:#1f2328e6;color:#8b8f97}
html[data-theme="dark"] .study-menu-button:hover,html[data-theme="dark"] .study-card-wrap.open .study-menu-button{border-color:#3a3e46;background:#1f2328;color:#eef0f3}
html[data-theme="dark"] .study-menu button:hover{background:#1b1e24}
html[data-theme="dark"] .lesson-row{background:var(--paper);border-color:var(--catalog-line);color:var(--catalog-ink)}
html[data-theme="dark"] .lesson-row:hover{border-color:#3a3e46}
html[data-theme="dark"] .lesson-row-meta{color:#8b8f97}
html[data-theme="dark"] .lesson-row-go{color:#6a6e75}

/* Loading system */
html[data-theme="dark"] .skeleton,html[data-theme="dark"] .skeleton-lines span,html[data-theme="dark"] .skeleton-tabs span,html[data-theme="dark"] .sk-line{background-image:none;background-color:#1b1e24}
html[data-theme="dark"] .sk-line{background-image:linear-gradient(#1b1e24 60%,transparent 60%)}
/* The coach card is already #1b1e24 in the dark theme, so the default skeleton
   tone vanishes inside it; the waiting card needs a tone above its own surface. */
html[data-theme="dark"] .loading-view .speech .sk-line{background-color:#2b303a;background-image:linear-gradient(#2b303a 60%,transparent 60%)}
html[data-theme="dark"] .sk-move,html[data-theme="dark"] .skeleton-move{background:#1b1e24}
html[data-theme="dark"] .board-loader{background:rgba(14,15,18,.58)}
html[data-theme="dark"] .load-error{background:#0e0f12;color:#eef0f3}
html[data-theme="dark"] .load-error p{color:#8b8f97}

/* Puzzles */
html[data-theme="dark"] .puzzle-themes li{border-color:var(--hair);background:var(--paper);color:#c4c8ce}
html[data-theme="dark"] .puzzle-message{color:var(--ink)}
html[data-theme="dark"] .puzzle-message p{color:#8b8f97}
html[data-theme="dark"] .puzzle-secondary{border-color:var(--hair);background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .puzzle-secondary:hover{background:var(--surface-2)}
/* Not redundant with the base `.foot-puzzles b` token: the generic rule above
   greys every `b` in the dark foot, so this has to out-specify it to keep the
   puzzle count the same sage as the puzzle bars and legend swatch. */
html[data-theme="dark"] .foot-puzzles b{color:var(--sage-deep)}

/* Signed-in dashboard rail (desktop) scrollbars */
html[data-theme="dark"] .dashboard-split>.dashboard-library,html[data-theme="dark"] .dashboard-split>.dashboard-side{scrollbar-color:#2c2f35 transparent}
html[data-theme="dark"] .dashboard-split>.dashboard-library::-webkit-scrollbar-thumb,html[data-theme="dark"] .dashboard-split>.dashboard-side::-webkit-scrollbar-thumb{background:#2c2f35;border-color:#0e0f12}

/* ---------- XP system ----------
   Four surfaces — header pill, dashboard level band, the reward block on a
   completion panel, and a floating toast — drawn from one animation record in
   src/xp-ui.js. Every keyframe below is resumed through `--xp-t`, a negative
   animation-delay equal to how long the celebration has already been running,
   so a re-render mid-animation picks up exactly where the last paint left off.
   Timings mirror XP_TIMING in xp-ui.js: fill .9s, level-up 1.8s. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Ring. pathLength="1" lets dasharray/dashoffset speak in fractions, so one
   rule serves every size. */
.level-ring{position:relative;display:inline-grid;place-items:center;flex:none}
.level-ring svg{display:block;transform:rotate(-90deg)}
.level-ring circle{fill:none}
.level-ring-track{stroke:#e7e5df}
.level-ring-fill{stroke:#d9541e;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:calc(1 - var(--xp-p,0));transition:stroke-dashoffset .5s var(--ease)}
.level-ring>b{position:absolute;inset:0;display:grid;place-items:center;font:700 11px/1 "Schibsted Grotesk",sans-serif;letter-spacing:-.02em;color:#141414;font-variant-numeric:tabular-nums}
/* Bar. */
.level-bar{position:relative;display:block;height:6px;border-radius:99px;background:#eceae4;overflow:hidden}
.level-bar b{display:block;height:100%;width:calc(var(--xp-p,0) * 100%);border-radius:inherit;background:#d9541e}
.level-bar::after{content:"";position:absolute;inset:0;border-radius:inherit;background:#fff;opacity:0;pointer-events:none}
/* Old → new swap for the level number during a level-up. */
.xp-swap{display:inline-grid;vertical-align:baseline}
.xp-swap>span{grid-area:1/1}
.xp-swap-in{opacity:0}

/* Celebration choreography. --xp-from/--xp-to are the bar fractions before and after. */
@keyframes xp-bar-fill{from{width:calc(var(--xp-from) * 100%)}to{width:calc(var(--xp-to) * 100%)}}
@keyframes xp-bar-level{0%{width:calc(var(--xp-from) * 100%)}42%{width:100%}50%{width:100%}50.1%{width:0%}100%{width:calc(var(--xp-to) * 100%)}}
@keyframes xp-bar-flash{0%,38%{opacity:0}44%{opacity:.85}52%,100%{opacity:0}}
@keyframes xp-ring-fill{from{stroke-dashoffset:calc(1 - var(--xp-from))}to{stroke-dashoffset:calc(1 - var(--xp-to))}}
@keyframes xp-ring-level{0%{stroke-dashoffset:calc(1 - var(--xp-from))}42%{stroke-dashoffset:0}50%{stroke-dashoffset:0}50.1%{stroke-dashoffset:1}100%{stroke-dashoffset:calc(1 - var(--xp-to))}}
@keyframes xp-swap-out{0%,44%{opacity:1;transform:none}52%,100%{opacity:0;transform:translateY(-55%) scale(.8)}}
@keyframes xp-swap-in{0%,48%{opacity:0;transform:translateY(55%) scale(.8)}60%{opacity:1;transform:translateY(0) scale(1.16)}70%,100%{opacity:1;transform:none}}
@keyframes xp-pulse{0%{transform:none}30%{transform:scale(1.06)}100%{transform:none}}
.xp-animating .level-bar b{animation:xp-bar-fill .9s cubic-bezier(.2,.8,.2,1) both;animation-delay:var(--xp-t,0ms)}
.xp-animating .level-ring-fill{transition:none;animation:xp-ring-fill .9s cubic-bezier(.2,.8,.2,1) both;animation-delay:var(--xp-t,0ms)}
.xp-level-up .level-bar b{animation-name:xp-bar-level;animation-duration:1.8s;animation-timing-function:cubic-bezier(.3,.7,.2,1)}
.xp-level-up .level-ring-fill{animation-name:xp-ring-level;animation-duration:1.8s;animation-timing-function:cubic-bezier(.3,.7,.2,1)}
.xp-level-up .level-bar::after{animation:xp-bar-flash 1.8s linear both;animation-delay:var(--xp-t,0ms)}
.xp-level-up .xp-swap-out{animation:xp-swap-out 1.8s cubic-bezier(.2,.8,.2,1) both;animation-delay:var(--xp-t,0ms)}
.xp-level-up .xp-swap-in{animation:xp-swap-in 1.8s cubic-bezier(.2,1.2,.3,1) both;animation-delay:var(--xp-t,0ms)}

/* Header pill: level in a ring, total XP beside it. */
.level-pill{height:34px;display:flex;align-items:center;gap:8px;padding:0 12px 0 3px;border-radius:999px;background:#fff;border:1px solid #e3e1da;color:#141414;font-variant-numeric:tabular-nums;animation:pop-in .32s var(--ease) both}
.level-pill.xp-animating{animation:xp-pulse .9s cubic-bezier(.2,.8,.2,1) both;animation-delay:var(--xp-t,0ms)}
.level-pill-xp{font:500 12px "Spline Sans Mono",monospace;color:#7a7c80;white-space:nowrap}
.level-pill-xp [data-xp-count]{color:#141414;font-weight:600}

/* Dashboard level band: the footer of the dark focus card. */
.level-band{width:100%;margin-top:20px;padding-top:16px;border-top:1px solid #ffffff1c}
.level-band-copy{min-width:0;display:grid;gap:8px}
.level-band-head{display:flex;align-items:baseline;gap:9px;min-width:0}
.level-band-head strong{font:600 14px "Schibsted Grotesk",sans-serif;letter-spacing:-.01em;color:#f3f2ee;white-space:nowrap}
.level-band-xp{margin-left:auto;font:400 12px "Spline Sans Mono",monospace;color:#a5a39c;white-space:nowrap}
.level-band-xp [data-xp-count]{font-weight:500;color:#f3f2ee}
.level-band .level-bar{height:7px;background:#ffffff24}
.level-band-foot{display:flex;font:400 11px "Spline Sans Mono",monospace;color:#a5a39c}
/* The bar sweeps in from empty when the dashboard arrives (route changes only). */
@keyframes xp-bar-enter{from{width:0}}
.content-enter .level-band:not(.xp-animating) .level-bar b{animation:xp-bar-enter 1s .3s cubic-bezier(.2,.8,.2,1) both}
.loading-view .level-band .level-bar b{width:0}

/* Reward toast — body-level so re-renders leave it alone, pointer-events none
   so it never stands between the user and the next button. The screen below
   keeps working while it plays; nothing waits for it. */
.xp-toast-anchor{position:fixed;z-index:100;top:calc(var(--header-h) + 12px);left:0;right:0;display:flex;justify-content:flex-end;pointer-events:none;padding:0 18px}
.xp-toast{position:relative;width:min(400px,100%);display:grid;gap:12px;padding:14px 18px 14px 14px;border-radius:20px;background:#141414;color:#f3f2ee;border:1px solid #ffffff14;box-shadow:0 26px 60px -12px #17181966,0 2px 8px #17181926;animation:xp-toast-in .55s cubic-bezier(.2,1.3,.3,1) both;will-change:transform}
.xp-toast.leaving{animation:xp-toast-out .36s cubic-bezier(.4,0,.8,.4) both}
.xp-toast.xp-level-up{border-color:#d9541e66;animation:xp-toast-in .55s cubic-bezier(.2,1.3,.3,1) both,xp-toast-hop 1.8s cubic-bezier(.2,1.2,.3,1) both;animation-delay:0ms,var(--xp-t,0ms)}
.xp-toast.xp-level-up.leaving{animation:xp-toast-out .36s cubic-bezier(.4,0,.8,.4) both}
@keyframes xp-toast-in{from{opacity:0;transform:translateY(-28px) scale(.9)}to{opacity:1;transform:none}}
@keyframes xp-toast-out{to{opacity:0;transform:translateY(-16px) scale(.96)}}
@keyframes xp-toast-hop{0%,46%{transform:none}54%{transform:scale(1.035)}66%{transform:scale(.99)}76%,100%{transform:none}}
.xp-toast-main{display:flex;align-items:center;gap:14px;min-width:0}
.xp-toast .level-ring-track{stroke:#ffffff24}
.xp-toast .level-ring>b{color:#fff;font-size:15px}
.xp-toast-copy{min-width:0;display:grid;gap:6px;flex:1}
.xp-toast-gain{display:flex;align-items:baseline;gap:5px;font:600 32px/1 "Schibsted Grotesk",sans-serif;letter-spacing:-.045em;color:#ff8a5b;font-variant-numeric:tabular-nums;transform-origin:left center}
.xp-toast-gain small{font:400 12px "Spline Sans Mono",monospace;letter-spacing:.08em;color:#a5a39c}
@keyframes xp-gain-pop{0%{opacity:0;transform:translateY(8px) scale(.7)}60%{opacity:1;transform:translateY(0) scale(1.08)}100%{opacity:1;transform:none}}
.xp-animating .xp-toast-gain{animation:xp-gain-pop .6s cubic-bezier(.2,1.2,.3,1) both;animation-delay:calc(var(--xp-t,0ms) + 80ms)}
.xp-toast-awards{display:flex;flex-wrap:wrap;gap:5px}
.xp-toast-awards>span{display:inline-flex;align-items:center;gap:6px;padding:4px 9px 4px 7px;border-radius:999px;background:#ffffff14;color:#e8e6df;font:500 11px "DM Sans",system-ui,sans-serif;white-space:nowrap}
.xp-toast-awards i{font-style:normal;font-size:10px;color:#ff8a5b}
.xp-toast-awards b{font:500 11px "Spline Sans Mono",monospace;color:#ff8a5b}
@keyframes xp-row-in{from{opacity:0;transform:translateY(6px) scale(.9)}to{opacity:1;transform:none}}
.xp-animating .xp-toast-awards>span{animation:xp-row-in .4s cubic-bezier(.2,1.2,.3,1) both;animation-delay:calc(var(--xp-t,0ms) + 260ms + var(--i,0) * 90ms)}
.xp-toast-level{display:grid;gap:7px;padding-top:11px;border-top:1px solid #ffffff14}
.xp-toast-level-head{display:flex;align-items:baseline;gap:7px;min-width:0}
.xp-toast-level-head strong{font:600 12.5px "Schibsted Grotesk",sans-serif;white-space:nowrap}
.xp-toast-total{margin-left:auto;font:400 11px "Spline Sans Mono",monospace;color:#a5a39c;white-space:nowrap;font-variant-numeric:tabular-nums}
.xp-toast-total [data-xp-count]{color:#f3f2ee;font-weight:500}
.xp-toast .level-bar{height:7px;background:#ffffff1f}
/* A shine runs down the bar as it settles. */
.xp-toast .level-bar b{position:relative;overflow:hidden}
.xp-toast .level-bar b::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,#ffffffa6 50%,transparent 70%);transform:translateX(-120%);opacity:0}
@keyframes xp-bar-shine{0%{opacity:1;transform:translateX(-120%)}100%{opacity:1;transform:translateX(120%)}}
.xp-animating .level-bar b::after{animation:xp-bar-shine .7s ease-out both;animation-delay:calc(var(--xp-t,0ms) + 700ms)}
.xp-level-up .level-bar b::after{animation-delay:calc(var(--xp-t,0ms) + 1600ms)}
/* Arrival sparks from the ring; a bigger ring of them when the level turns. */
.xp-toast-burst{position:absolute;pointer-events:none;left:37px;top:38px;width:0;height:0}
.xp-toast-burst i{position:absolute;left:-2px;top:-5px;width:4px;height:10px;border-radius:3px;background:#ff8a5b;opacity:0}
.xp-toast-burst i:nth-child(1){--ray:0}.xp-toast-burst i:nth-child(2){--ray:1}.xp-toast-burst i:nth-child(3){--ray:2}.xp-toast-burst i:nth-child(4){--ray:3}.xp-toast-burst i:nth-child(5){--ray:4}.xp-toast-burst i:nth-child(6){--ray:5}.xp-toast-burst i:nth-child(7){--ray:6}.xp-toast-burst i:nth-child(8){--ray:7}.xp-toast-burst i:nth-child(9){--ray:8}.xp-toast-burst i:nth-child(10){--ray:9}.xp-toast-burst i:nth-child(11){--ray:10}.xp-toast-burst i:nth-child(12){--ray:11}
.xp-toast-burst i:nth-child(even){background:#f3f2ee;height:7px}
@keyframes xp-spark{0%{opacity:0;transform:rotate(calc(var(--ray) * 30deg)) translateY(-14px) scale(.3)}15%{opacity:1}100%{opacity:0;transform:rotate(calc(var(--ray) * 30deg)) translateY(-58px) scale(1)}}
.xp-animating .xp-toast-burst i{animation:xp-spark .9s cubic-bezier(.1,.7,.3,1) both;animation-delay:calc(var(--xp-t,0ms) + 120ms + var(--ray) * 12ms)}
.xp-toast-levelup{position:relative;display:flex;align-items:center;justify-content:center;padding:11px 14px;border-radius:14px;background:#f3f2ee;color:#141414;animation:xp-chip-in 1.8s cubic-bezier(.2,1.2,.3,1) both;animation-delay:var(--xp-t,0ms)}
.xp-toast-levelup>span:last-child{display:flex;align-items:baseline;gap:10px}
.xp-toast-levelup small{font:400 10px "Spline Sans Mono",monospace;text-transform:uppercase;letter-spacing:.12em;color:#d9541e}
.xp-toast-levelup strong{font:600 14px "Schibsted Grotesk",sans-serif;letter-spacing:-.01em}
@keyframes xp-chip-in{0%,48%{opacity:0;transform:translateY(10px) scale(.92)}62%{opacity:1;transform:translateY(0) scale(1.03)}72%,100%{opacity:1;transform:none}}
/* A ring of sparks from the chip at the moment the level turns. */
.xp-levelup-burst{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none}
.xp-levelup-burst i{position:absolute;left:-2px;top:-5px;width:4px;height:11px;border-radius:3px;background:#d9541e;opacity:0}
.xp-levelup-burst i:nth-child(even){background:#141414;height:8px}
.xp-levelup-burst i:nth-child(1){--ray:0}.xp-levelup-burst i:nth-child(2){--ray:1}.xp-levelup-burst i:nth-child(3){--ray:2}.xp-levelup-burst i:nth-child(4){--ray:3}.xp-levelup-burst i:nth-child(5){--ray:4}.xp-levelup-burst i:nth-child(6){--ray:5}.xp-levelup-burst i:nth-child(7){--ray:6}.xp-levelup-burst i:nth-child(8){--ray:7}.xp-levelup-burst i:nth-child(9){--ray:8}.xp-levelup-burst i:nth-child(10){--ray:9}.xp-levelup-burst i:nth-child(11){--ray:10}.xp-levelup-burst i:nth-child(12){--ray:11}
@keyframes xp-spark-level{0%,50%{opacity:0;transform:rotate(calc(var(--ray) * 30deg)) translateY(-10px) scale(.3)}58%{opacity:1}100%{opacity:0;transform:rotate(calc(var(--ray) * 30deg)) translateY(-90px) scale(1.1)}}
.xp-level-up .xp-levelup-burst i{animation:xp-spark-level 1.8s cubic-bezier(.1,.7,.3,1) both;animation-delay:calc(var(--xp-t,0ms) + var(--ray) * 10ms)}

@media(max-width:820px){
  .level-pill{padding:0 3px;gap:0}.level-pill-xp{display:none}
  .xp-toast-anchor{justify-content:center;padding:0 12px}.xp-toast{width:100%;padding:12px 14px 12px 12px;gap:10px;border-radius:18px}.xp-toast .level-ring{width:40px;height:40px}.xp-toast .level-ring svg{width:40px;height:40px}.xp-toast-gain{font-size:26px}
}
@media(max-width:760px){.level-band{margin-top:16px;padding-top:14px}}
@media(prefers-reduced-motion:reduce){
  .level-pill,.level-pill.xp-animating,.xp-toast,.xp-toast.leaving,.xp-toast-burst i,.xp-levelup-burst i,.xp-toast-levelup,.xp-toast.xp-level-up,
  .xp-animating .level-bar b,.xp-animating .level-bar b::after,.xp-animating .level-ring-fill,.xp-level-up .level-bar::after,.xp-level-up .xp-swap-out,.xp-level-up .xp-swap-in,
  .xp-animating .xp-toast-gain,.xp-animating .xp-toast-awards>span,.content-enter .level-band:not(.xp-animating) .level-bar b{animation:none!important}
  .level-ring-fill{transition:none}
  .xp-swap-out{display:none}.xp-swap-in{opacity:1}
  .xp-animating .level-bar b{width:calc(var(--xp-to) * 100%)}
  .xp-animating .level-ring-fill{stroke-dashoffset:calc(1 - var(--xp-to))}
}

/* Dark theme */
html[data-theme="dark"] .level-ring-track{stroke:#2c2f35}
html[data-theme="dark"] .level-ring>b{color:#eef0f3}
html[data-theme="dark"] .level-bar{background:#26292f}
html[data-theme="dark"] .level-pill{background:#15171c;border-color:var(--hair);color:#eef0f3}
html[data-theme="dark"] .level-pill-xp{color:#8b8f97}
html[data-theme="dark"] .level-pill-xp [data-xp-count]{color:#eef0f3}
html[data-theme="dark"] .level-band{border-top-color:#ffffff14}
html[data-theme="dark"] .level-band .level-bar{background:#ffffff1f}
html[data-theme="dark"] .xp-toast{background:#1b1e24;border-color:#2c3037;box-shadow:0 24px 60px #00000080,0 0 0 1px #00000040}
html[data-theme="dark"] .xp-toast.xp-level-up{border-color:#d9541e80}
html[data-theme="dark"] .xp-toast-awards>span{background:#ffffff12;color:#dfe2e7}
html[data-theme="dark"] .xp-toast-level{border-top-color:#ffffff14}
html[data-theme="dark"] .xp-toast .level-bar{background:#ffffff1f}
html[data-theme="dark"] .xp-toast-levelup{background:#e8ebef;color:#0e0f12}
html[data-theme="dark"] .xp-toast-levelup small{color:#c74819}
html[data-theme="dark"] .xp-levelup-burst i:nth-child(even){background:#0e0f12}

/* Square recognition trainer */
.squares-panel .lesson-top{color:var(--ink)}
.squares-panel .lesson-icon{color:var(--ink)}
.squares-panel .text-button{color:var(--ink-2)}
.squares-panel .tip{color:var(--ink-2)}
.squares-target{display:grid;place-items:center;gap:2px;padding:clamp(20px,4vh,34px) 16px;background:var(--paper);border:1px solid var(--hair);border-radius:16px}
.squares-target small{font-size:10px;letter-spacing:.16em;font-weight:700;text-transform:uppercase;color:var(--ink-2)}
.squares-target strong{font:700 clamp(54px,9vh,88px)/1 "Spline Sans Mono",monospace;letter-spacing:.01em;color:var(--ink);font-variant-numeric:tabular-nums}
.squares-target strong.pop{animation:squares-pop .26s var(--ease)}
.squares-clock{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:13px 16px;background:var(--surface-2);border:1px solid var(--hair);border-radius:14px}
.squares-clock span{font-size:10px;letter-spacing:.16em;font-weight:700;text-transform:uppercase;color:var(--ink-2)}
.squares-clock strong{font:500 24px/1 "Spline Sans Mono",monospace;color:var(--ink);font-variant-numeric:tabular-nums}
.squares-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.squares-stats>div{display:grid;gap:4px;padding:14px 8px;text-align:center;background:var(--paper);border:1px solid var(--hair);border-radius:14px}
.squares-stats b{font-size:10px;letter-spacing:.06em;font-weight:600;color:var(--ink-2)}
.squares-stats strong{font:600 20px/1 "Spline Sans Mono",monospace;color:var(--ink);font-variant-numeric:tabular-nums}
.squares-orientation{display:flex;align-items:center;justify-content:space-between;gap:12px}
.squares-orientation>span{font-size:10px;letter-spacing:.16em;font-weight:700;text-transform:uppercase;color:var(--ink-2)}
.squares-orientation-tabs{display:flex;gap:2px;padding:3px;background:var(--surface-2);border:1px solid var(--hair);border-radius:10px}
.squares-orientation-tabs button{border:0;background:transparent;padding:7px 12px;border-radius:7px;font:600 12px "DM Sans",system-ui,sans-serif;color:var(--ink-2);cursor:pointer;transition:background .15s,color .15s}
.squares-orientation-tabs button:hover{color:var(--ink)}
.squares-orientation-tabs button.active{background:var(--paper);color:var(--ink);box-shadow:0 1px 2px #00000014}
@keyframes squares-pop{0%{transform:scale(.86);opacity:.4}60%{transform:scale(1.06)}100%{transform:scale(1);opacity:1}}
.board-shell.squares-mode .square:hover{filter:brightness(.94)}
.square-correct:after,.square-wrong:after{content:"";position:absolute;inset:0;pointer-events:none;z-index:3;animation:square-flash .34s ease-out forwards}
.square-correct:after{background:#8bc34a;box-shadow:inset 0 0 0 3px #ffffffcc}
.square-wrong:after{background:#e5484d;box-shadow:inset 0 0 0 3px #ffffffb3}
@keyframes square-flash{0%{opacity:.95}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){
  .square-correct:after,.square-wrong:after{animation:none;opacity:.95}
  .squares-target strong.pop{animation:none}
}

/* Puzzles reserve a compact control strip, then give the square all remaining
   space. Keep the same board size while feedback and completion panels swap. */
@media (max-width: 1100px), (max-height: 700px) {
  .puzzle-shell { --puzzle-controls: 220px; }
  .puzzle-shell .stage { padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .puzzle-shell .workspace { grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr); gap: 16px; min-height: 0; }
  .puzzle-shell .board-area { height: 100%; padding: 0; }
  .puzzle-shell .board-header { min-height: 44px; height: 44px; margin: 0 auto; }
  .puzzle-shell .board-header small { display: block; }
  .puzzle-shell .board-header .icon-button { width: 44px; height: 44px; }
  .puzzle-shell .board-shell { width: min(100%, calc(var(--vh) - 60px)); height: auto; margin: 0 auto; }
  .puzzle-shell .board-footer { display: none; }
  .puzzle-shell .sidebar { height: 100%; padding: 0; justify-content: center; }
  .puzzle-shell .panel-content { flex: 0 0 auto; padding: 0; gap: 6px; overflow: visible; }
  .puzzle-shell .lesson-top { font-size: 16px; grid-template-columns: auto auto 1fr; gap: 6px; }
  .puzzle-shell .lesson-top .lesson-icon { font-size: 18px; }
  .puzzle-shell .lesson-top > span:nth-child(3) { font-size: 12px; text-align: right; }
  .puzzle-shell .lesson-top > b, .puzzle-shell .tip { display: none; }
  .puzzle-shell .panel-topbar .text-button { min-height: 44px; display: inline-flex; align-items: center; font-size: 12px; }
  .puzzle-shell .speech { margin: 0; padding: 8px 12px; }
  .puzzle-shell .speech:before { display: none; }
  .puzzle-shell .speech p { font-size: 12px; line-height: 1.4; margin: 0; }
  .puzzle-shell .speech strong { display: none; }
  .puzzle-shell .speech .speech-kicker { display: block; font-size: 10px; margin: 0 0 3px; }
  .puzzle-shell .secondary, .puzzle-shell .primary { min-height: 44px; padding: 10px 12px; font-size: 12px; }
  .puzzle-shell .puzzle-complete { display: grid; grid-template-columns: 1fr 1fr; align-content: center; }
  .puzzle-shell .puzzle-complete h1 { grid-column: 1 / -1; margin: 0; font-size: 24px; }
  .puzzle-shell .puzzle-complete .muted { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 1.4; }
  .puzzle-shell .puzzle-complete .success-mark, .puzzle-shell .puzzle-complete .eyebrow, .puzzle-shell .puzzle-themes { display: none; }
  .puzzle-shell .puzzle-next { grid-column: 1 / -1; margin: 0; }
}
@media (max-width: 820px) and (min-height: 501px) {
  .puzzle-shell .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) var(--puzzle-controls); gap: 4px; }
  .puzzle-shell .board-shell { width: min(100%, calc(var(--vh) - var(--puzzle-controls) - 64px)); height: auto; }
  .puzzle-shell .sidebar { width: 100%; max-width: 560px; margin: auto; background: transparent; }
  .puzzle-shell .board-header { width: min(100%, calc(var(--vh) - var(--puzzle-controls) - 64px)); }
}
@media (max-height: 500px) {
  .puzzle-shell { --header-h: 44px; }
  .puzzle-shell .workspace { grid-template-columns: minmax(0, 1fr) minmax(240px, 38%); gap: 12px; }
  .puzzle-shell .lesson-top { display: none; }
  .puzzle-shell .puzzle-complete h1 { font-size: 20px; }
}

/* Lesson repertoire list: the panel is a fixed-height flex column, and the
   course can hold 40+ lines, so the list itself is the scroll container.
   Without this the overflow was clipped by .panel-content and the last lines
   of a long opening could not be reached. */
.lesson-panel .lines{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#d8d7d2 transparent;
  padding-right:2px;
}
.lesson-panel .lines::-webkit-scrollbar{width:8px}
.lesson-panel .lines::-webkit-scrollbar-thumb{background:#d8d7d2;border-radius:999px}
.lesson-panel .line-heading{flex:0 0 auto}
html[data-theme="dark"] .lesson-panel .lines{scrollbar-color:#2c2f35 transparent}
html[data-theme="dark"] .lesson-panel .lines::-webkit-scrollbar-thumb{background:#2c2f35}

/* The dark theme's own `.line-stars i` rule is more specific than the filled
   state, so completed pips were painted the same grey as empty ones and the
   bars never appeared to move. */
html[data-theme="dark"] .line-stars i.filled{background:var(--green);box-shadow:0 0 5px #8eaa9f66}
