:root{--ink:#211f35;--muted:#615f70;--paper:#faf9f6;--purple:#6250d6;--lilac:#e9e5ff;--lime:#dfff83;--edge:#dcdadf;font:16px/1.5 "DM Sans",Inter,system-ui,sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--purple);outline-offset:3px}button{border:0;background:none}button:disabled{opacity:.5;cursor:default}header{border-bottom:1px solid var(--edge);background:#fff}header>div,.frame{width:min(1040px,calc(100% - 44px));margin:auto}header>div,.row,.hgroup,.bar,.nav,.actions{display:flex;align-items:center;gap:12px}header>div{min-height:72px;justify-content:space-between}.brand{display:flex;align-items:center;gap:10px;font-size:1.1rem;font-weight:850;letter-spacing:-.035em}.mark{width:35px;height:35px;background:var(--ink);border-radius:11px;display:inline-grid;place-items:center;color:var(--lime);font-size:23px;line-height:1;transform:rotate(-6deg)}.frame{padding:36px 0 80px}.bar,.hgroup{justify-content:space-between}.hgroup{align-items:baseline;margin:25px 0 12px}.nav{gap:5px;flex-wrap:wrap}.nav button,.subtle,.link{font-weight:650;font-size:.88rem;padding:8px 12px;border-radius:10px}.nav button.active{background:var(--lilac);color:#4a37ac}.subtle{background:#f1f0f4}.link{color:#4f3cb3;text-decoration:underline;text-underline-offset:3px}.primary,.secondary{min-height:44px;border-radius:12px;padding:10px 17px;font-weight:720}.primary{background:var(--ink);color:white}.primary:hover{background:#41395e}.secondary{background:white;border:1px solid #cfcbd9}.actions{flex-wrap:wrap;margin-top:18px}.eyebrow,.meta{color:var(--muted);font-size:.85rem}.eyebrow{font-weight:750;letter-spacing:.065em;text-transform:uppercase}.eyebrow.light{color:#4c427a}h1,h2,h3,p{margin:0}h1,h2,h3{line-height:1.13;letter-spacing:-.045em}h1{font-size:clamp(2.2rem,6vw,3.7rem);margin:6px 0 12px}h2{font-size:1.48rem}h3{font-size:1.06rem;letter-spacing:-.015em}.grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:24px;align-items:start}.hero,.card,.panel{border:1px solid var(--edge);border-radius:20px}.hero{background:var(--lilac);border-color:#d5cff4;position:relative;overflow:hidden;padding:26px;margin:22px 0 0}.hero h2{font-size:clamp(1.55rem,3.5vw,2.25rem);margin:8px 0;max-width:22ch}.card,.panel{background:#fff;padding:20px}.panel{margin:16px 0}.pile{position:relative;width:145px;height:125px;flex:none;margin-right:15px}.sheet{position:absolute;inset:16px 17px 14px;background:white;border:2px solid var(--ink);border-radius:10px;transform:rotate(-14deg);box-shadow:3px 3px var(--ink)}.sheet+ .sheet{background:var(--lime);transform:translate(10px,-6px) rotate(8deg);display:grid;place-items:center;font-size:46px;font-weight:800}.sheet+ .sheet:after{content:"";position:absolute;left:15%;right:15%;bottom:12%;height:3px;background:var(--ink)}.list{display:grid;gap:8px}.entry{display:flex;gap:14px;background:white;border:1px solid var(--edge);border-radius:15px;padding:14px;align-items:flex-start}.entry>div:nth-child(2){flex:1;min-width:0}.entry h3,.entry p,.bubble,.question,.notes{overflow-wrap:anywhere}.tile{width:38px;height:38px;display:grid;place-items:center;background:var(--lilac);border-radius:12px;font-weight:800;flex:none}.tile.test{background:#ffe1c7}.tile.study{background:var(--lime)}.tile.optional{background:#f4e8fd}.small{font-size:.9rem}.entry p{margin-top:3px}.entrydetails{margin-top:8px;color:var(--muted);font-size:.84rem}.entrydetails summary{cursor:pointer}.entrydetails .subtle{margin:6px 6px 0 0}.pill{display:inline-block;background:#eeeafc;color:#4e4083;border-radius:20px;padding:4px 10px;font-weight:650;font-size:.8rem}.tagline{margin-bottom:8px}.empty,.help{color:var(--muted)}.empty{padding:12px 2px}.badgeboard{background:#f1f5e5}.badgeboard h2,.card h2,.panel h2{margin:6px 0 10px}.padtop{margin-top:22px}.form{display:grid;gap:14px}.form label{display:grid;gap:5px;font-size:.9rem;font-weight:700}input,textarea,select{background:white;width:100%;border:1px solid #aaa5b5;border-radius:10px;padding:10px;font-size:1rem}textarea{resize:vertical;min-height:90px}.login{display:grid;grid-template-columns:1.15fr 1fr;align-items:center;gap:45px;max-width:870px;margin:7vh auto}.login .hero{min-height:325px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center}.login .pile{align-self:flex-end;margin-bottom:-8px}.login h1{font-size:clamp(2.5rem,5vw,4rem);line-height:1}.login .card{padding:24px}.bubble{max-width:85%;padding:12px 15px;border-radius:15px;background:white;border:1px solid var(--edge)}.bubble.me{background:var(--lilac);align-self:flex-end}.chat{display:flex;flex-direction:column;gap:10px;margin:18px 0}.bubble b{font-size:.8rem;display:block;margin-bottom:4px}.prompt{padding:8px 12px;border:1px dashed #aba3bd;border-radius:12px;text-align:left;background:white}.prompts{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.limited{max-width:760px}.question{background:var(--lilac);border:1px solid #d1cbed;border-radius:18px;min-height:150px;padding:24px;display:grid;align-content:center;gap:10px}.choices{display:grid;gap:8px;margin-top:14px}.choices button{text-align:left}.feedback{background:#f1f5e5;border-radius:12px;padding:13px;margin-top:14px}.notes{white-space:pre-wrap}.note{color:var(--muted);font-size:.88rem;margin-top:15px}.block{background:#f7f8f2;border-radius:12px;padding:11px;margin-top:8px}.block .actions{margin-top:7px}.stack{display:grid;gap:12px}.quiet{font-size:.8rem;color:var(--muted)}#notice:not(:empty){position:fixed;bottom:18px;left:50%;transform:translateX(-50%);background:var(--ink);color:white;padding:12px 18px;border-radius:12px;z-index:5;max-width:90vw;width:max-content}dialog{border:1px solid var(--edge);border-radius:20px;padding:24px;width:min(440px,92vw);color:var(--ink)}dialog::backdrop{background:#211f3570}dialog h2{margin-bottom:16px}.error{color:#a02a35}.role{font-size:.83rem;color:var(--muted)}.wrap{flex-wrap:wrap}
@media(max-width:720px){header>div,.frame{width:calc(100% - 32px)}header>div{min-height:60px}.frame{padding-top:22px;padding-bottom:100px}.grid,.login{grid-template-columns:1fr;gap:12px}.login{margin:0 auto}.login .hero{margin:0;min-height:0}.login .pile{position:absolute;right:5px;top:22px;transform:scale(.65);transform-origin:right top}.login .hero h1{max-width:6ch}.login .hero p{max-width:29ch}.nav{position:fixed;bottom:0;left:0;right:0;justify-content:space-evenly;background:#fff;padding:9px 5px max(9px,env(safe-area-inset-bottom));border-top:1px solid var(--edge);z-index:3;gap:2px}.nav button{padding:10px 9px}.hero{padding:20px}.hero:not(.login .hero) .pile{width:74px;height:76px;margin:0}.hero .sheet+.sheet{font-size:26px}.entry{padding:12px;gap:10px}.role{display:none}.hgroup{margin-top:21px}.pile{pointer-events:none}#notice:not(:empty){bottom:72px}.card,.panel{padding:16px}}
.setup li{margin-bottom:10px}.setup code{overflow-wrap:anywhere}.setup{padding-left:22px}
.photo-panel{background:#f2f5eb}
.note-preview{display:block;max-width:100%;max-height:420px;object-fit:contain;border-radius:12px;margin:12px auto}
.source{margin:10px 0;color:var(--muted);font-size:.92rem}
.source summary{cursor:pointer;font-weight:650}
.source p{margin:6px 0}
#photo-status:empty{display:none}
#photo-save fieldset{display:grid;gap:9px;margin:0;min-width:0;padding:14px;border:1px solid var(--edge);border-radius:12px}
#photo-save legend{font-weight:700;padding:0 5px}
#photo-save textarea{min-height:64px}
#photo-save .note{margin:0}

/* Thumb controls and a two-sided study card. */
:root{font-family:-apple-system,BlinkMacSystemFont,"DM Sans",system-ui,sans-serif}
.flip-session,.limited,.entry>div,.grid>*{min-width:0}
.study-count,.card-travel,.photo-pickers{display:flex;align-items:center;gap:12px}
.study-count{justify-content:space-between;font-size:.9rem;font-weight:650;color:var(--muted);margin:20px 0 12px}
.study-count progress{accent-color:var(--purple);width:38%;height:6px;border:0;border-radius:8px;overflow:hidden;background:#dfdbea}
.study-count progress::-webkit-progress-bar{background:#dfdbea}
.study-count progress::-webkit-progress-value{background:var(--purple);border-radius:8px}
.study-face{position:relative;text-align:left;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;gap:24px;width:100%;min-height:clamp(215px,35svh,340px);padding:22px 24px;border-radius:22px;color:#302650;background:#e9e5ff;border:1px solid #cec6eb;box-shadow:0 4px 0 -1px #faf9f6,0 6px 0 -1px #cfc7e2;touch-action:pan-y pinch-zoom;-webkit-user-select:none;user-select:none}
.study-face.back{background:#e9f4d2;color:#284029;border-color:#c4d6b1}
.face-label{font-size:.83rem;font-weight:740;letter-spacing:.045em;text-transform:uppercase}
.face-content{font-size:clamp(1.35rem,5.4vw,2rem);font-weight:680;line-height:1.22;letter-spacing:-.025em;overflow-wrap:anywhere;white-space:pre-line}
.turn-mark{align-self:flex-end;font-size:1.25rem;line-height:1}
.card-hint{text-align:center;color:var(--muted);font-size:.88rem;margin:16px 0}
.card-travel>*{flex:1}
.photo-pickers{align-items:stretch;flex-wrap:wrap}
.photo-pickers .pick{display:flex;position:relative;align-items:center;justify-content:center;gap:9px;border:1px solid #b7b7b1;border-radius:12px;background:white;min-height:48px;padding:9px 15px;cursor:pointer;font-size:1rem}
.photo-pickers .take{background:var(--ink);color:white;border-color:var(--ink)}
.pick input{position:absolute;width:100%;height:100%;inset:0;opacity:0;padding:0;cursor:pointer}
.pick:focus-within{outline:3px solid var(--purple);outline-offset:3px}
.pick:has(input:disabled){opacity:.55}
.camera-icon{position:relative;width:20px;height:14px;border-radius:4px;border:1.6px solid currentColor}
.camera-icon:before{content:"";position:absolute;left:3px;top:-4px;width:8px;height:3px;border:1.5px solid currentColor;border-bottom:0;border-radius:3px 3px 0 0}
.camera-icon:after{content:"";position:absolute;width:5px;height:5px;border:1.5px solid currentColor;border-radius:50%;top:2px;left:5px}
.finished-list summary{cursor:pointer;font-weight:700}.finished-list[open] summary{margin-bottom:14px}
input,textarea,select,fieldset{min-width:0;max-width:100%}
@media(prefers-reduced-motion:no-preference){.face-content{animation:card-in .15s ease-out}@keyframes card-in{from{opacity:.65;transform:translateY(3px)}to{opacity:1;transform:none}}}
@media(max-width:720px),(pointer:coarse) and (max-height:520px){
 :root{--foot:calc(64px + env(safe-area-inset-bottom,0px))}
 body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);-webkit-text-size-adjust:100%}
 header{padding-top:env(safe-area-inset-top)}
 .frame{padding-bottom:calc(var(--foot) + 26px)}
 .nav{position:fixed;inset:auto 0 0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;padding:5px max(9px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left));background:#fff;border-top:1px solid var(--edge);z-index:3}
 .nav button{display:grid;align-content:center;justify-items:center;gap:4px;min-height:50px;padding:4px;border-radius:12px;font-size:.81rem;line-height:1.2}
 .nav button:before{position:relative;content:"";display:block;width:17px;height:15px;border:1.6px solid currentColor;border-radius:4px}
 .nav [data-tab=Today]:before{background:linear-gradient(currentColor,currentColor) center 3px/100% 1.6px no-repeat}
 .nav [data-tab=Upcoming]:before{background:repeating-linear-gradient(to bottom,currentColor 0 1.5px,transparent 1.5px 4px) center/11px 9.5px no-repeat}
 .nav [data-tab=Coach]:before{border-bottom-left-radius:0;border-radius:7px 7px 7px 1px}
 .nav [data-tab=Cards]:before{width:14px;height:12px;box-shadow:2px 2px white,3px 3px currentColor}
 .nav .active:before{color:#503bab}
 .photo-pickers .pick{flex:1;white-space:nowrap}
 .primary,.secondary,.link,.subtle,.prompt,.entrydetails summary,.source summary,.finished-list summary{min-height:44px}
 .entrydetails summary,.source summary,.finished-list summary{align-content:center}
 .frame input,.frame textarea,.frame select,dialog input,dialog textarea{font-size:max(16px,1rem)}
 .form>*,.study-count{min-width:0}
 .hero h2,.card h2,.limited h1,.hero .bar>div:first-child{min-width:0;overflow-wrap:anywhere}
 #notice:not(:empty){bottom:calc(var(--foot) + 8px);width:max-content;max-width:calc(100vw - 36px)}
 dialog{max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);overflow:auto}
 .frame :is(input,textarea,select,button){scroll-margin-bottom:calc(var(--foot) + 12px)}
}
@media(max-width:380px){.photo-pickers{gap:8px}.photo-pickers .pick{padding-inline:9px}.entry{gap:8px}.tile{width:32px;height:32px}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:520px){.study-face{min-height:145px;gap:10px}.frame{padding-top:12px}}

.reward-balance{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:18px 0 4px;padding:16px 20px;border-radius:16px;background:var(--lilac)}
.reward-balance strong{font-size:1.65rem;letter-spacing:-.045em}
.offer{display:flex;align-items:center;justify-content:space-between;gap:12px}
.offer h3{overflow-wrap:anywhere}.offer button{flex-shrink:0}
@media(max-width:720px){
 .nav{grid-template-columns:repeat(5,minmax(0,1fr))}
 .nav [data-tab=Store]:before{border-radius:2px 2px 4px 4px;background:linear-gradient(currentColor,currentColor) center 4px/100% 2px no-repeat}
}

.pair-board{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pair-tile{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:6px;text-align:left;min-height:84px;padding:12px;border:2px solid #d9d4e7;border-radius:15px;background:white;overflow-wrap:anywhere}
.pair-tile small{color:#59506f;font-weight:650}.pair-tile span{font-weight:650}
.pair-tile.face-down{align-items:center;background:#efecfb;color:#514187}.pair-tile.face-down span{font-size:1.5rem}
.pair-tile.picked{background:#e9e4ff;border-color:#6451a9}
.pair-tile.paired{background:#edf5de;border-color:#cad9b8;color:#425337}
.pair-tile:disabled{opacity:1}
.pair-status{margin:12px 0 6px}.quest-progress{display:flex;align-items:center;gap:8px;font-size:.85rem;margin:5px 0}
.quest-progress progress{accent-color:var(--purple);width:75px;max-width:40%;height:8px}

.choices button.answer-wrong,.feedback.answer-wrong{background:#fce6e5;border:1px solid #c36a66;color:#791d1a;opacity:1}
.choices button.answer-correct,.feedback.answer-correct{background:#e8f4df;border:1px solid #7b9d64;color:#284b1e;opacity:1}

@media(max-width:720px),(pointer:coarse) and (max-height:520px){
 .nav.parent-nav{grid-template-columns:repeat(2,minmax(0,1fr))}
}
