html[data-theme="dark"]{background:#101827;color-scheme:dark}html[data-theme="dark"] body{background:#101827!important;color:#edf3ff}

*{box-sizing:border-box}html{background:#f5f7fb;overscroll-behavior-y:none}body{margin:0;min-height:100vh;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#f5f7fb;color:#111827;overscroll-behavior-y:none}
header{background:#111827;color:white;padding:18px 22px;display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;z-index:2}
header h1{font-size:20px;margin:0}.wrap{max-width:1050px;margin:0 auto;padding:24px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.card,.stat{background:white;border-radius:16px;padding:20px;box-shadow:0 4px 18px #0000000d}
.stat b{font-size:30px;display:block;margin-top:5px}.muted{color:#6b7280}.btn{border:0;border-radius:11px;padding:12px 16px;font-weight:700;cursor:pointer;background:#111827;color:white}.btn.alt{background:#e5e7eb;color:#111827}.btn.good{background:#166534}.btn.warn{background:#92400e}.btn.bad{background:#991b1b}
nav{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}.tab{border:0;background:#e5e7eb;padding:10px 14px;border-radius:10px;font-weight:700;cursor:pointer}.tab.active{background:#111827;color:#fff}
input,textarea,select{width:100%;padding:12px;border:1px solid #d1d5db;border-radius:10px;margin:7px 0 14px;font:inherit}textarea{min-height:100px;resize:vertical}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.row>*{flex:1}.center{text-align:center}.study-card{min-height:300px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.study-source{font-size:9px;font-weight:600;color:#9ca3af;margin-bottom:6px;max-width:90%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-image{display:block;max-width:100%;max-height:280px;object-fit:contain;border-radius:12px;margin:8px auto 12px;box-shadow:0 2px 10px #00000010}.card-image.small{max-height:220px}.image-wrap{position:relative;display:inline-block;max-width:100%;margin:8px auto 12px}.image-wrap .card-image{margin:0}.image-remove-btn{display:block;margin:5px auto 0;border:0;background:#fee2e2;color:#991b1b;border-radius:8px;padding:4px 8px;font-size:11px;font-weight:700;cursor:pointer}.question{font-size:27px;font-weight:750;line-height:1.35}.answer{font-size:23px;line-height:1.5;margin-top:25px}.rating{display:flex;gap:8px;justify-content:center;margin-top:18px;flex-wrap:wrap}.hidden{display:none!important}.tag{display:inline-block;background:#eef2ff;padding:4px 8px;border-radius:999px;font-size:12px;margin:3px}.danger{color:#991b1b}.small{font-size:13px}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.btn.sm{padding:8px 11px;font-size:13px}.btn.danger{background:#fee2e2;color:#991b1b}.deck-item{padding:15px 0;border-bottom:1px solid #eee}.card-row{padding:12px 0;border-bottom:1px solid #eee}.badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#eef2ff;font-size:12px;font-weight:700}.badge.red{background:#fee2e2;color:#991b1b}.badge.orange{background:#ffedd5;color:#9a3412}.badge.green{background:#dcfce7;color:#166534}
table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:10px;border-bottom:1px solid #eee}
.folder{background:#fff;border:2px dashed #d1d5db;border-radius:14px;padding:12px;margin:10px 0}.folder.drop-active{border-color:#111827;background:#f3f4f6}.folder-head{display:flex;align-items:center;gap:8px;justify-content:space-between}.folder-head>div:first-child{cursor:pointer}.folder-title{font-weight:800}.folder-title-row{display:inline-flex;align-items:center;gap:7px;min-width:0;width:max-content;vertical-align:middle}.folder-toggle{width:30px;height:30px;min-width:28px;padding:0;border:0;border-radius:9px;background:#f3f4f6;color:#111827;display:inline-flex;align-items:center;justify-content:center;font-size:16px;font-weight:900;cursor:pointer;touch-action:manipulation;transition:background .18s ease,transform .18s ease,box-shadow .18s ease}.folder-toggle:active{transform:scale(.92)}.folder-toggle .chevron{display:block;line-height:1;transition:transform .34s cubic-bezier(.22,.8,.25,1)}.folder.collapsed .folder-toggle .chevron{transform:rotate(-90deg)}.folder-children{padding-left:18px;overflow:hidden;max-height:5000px;opacity:1;transform:translateY(0);transition:max-height .42s cubic-bezier(.22,.8,.25,1),opacity .28s ease,transform .42s cubic-bezier(.22,.8,.25,1);will-change:max-height,opacity,transform}.folder.collapsed>.folder-children{max-height:0;opacity:0;transform:translateY(-8px);pointer-events:none}.deck-tile{background:#f8fafc;border:1px solid #e5e7eb;border-radius:13px;padding:12px;margin:8px 0;touch-action:manipulation;user-select:none;-webkit-user-select:none;cursor:pointer;position:relative}.drag-handle{font-size:22px;padding:10px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;flex:0 0 auto!important}.deck-detail-head{display:flex;align-items:center;gap:10px;justify-content:space-between}.swipe-wrap{overflow:hidden;border-radius:12px;margin:8px 0;position:relative}.swipe-delete{position:absolute;left:0;top:0;bottom:0;width:100%;background:#f3f4f6;color:#374151;display:flex;align-items:center;justify-content:center;font-weight:800;z-index:0}.swipe-delete-btn{border:0;background:transparent;color:#991b1b;font-weight:800;font-size:16px;padding:20px 8px;min-width:92px;min-height:100%;cursor:pointer;touch-action:manipulation;position:absolute;left:0;top:0}.swipe-card{position:relative;background:#fff;padding:14px;border:1px solid #e5e7eb;transform:translateX(0);transition:transform .18s ease;z-index:1;touch-action:pan-y;user-select:none;-webkit-user-select:none}.swipe-card.swiped{transform:translateX(92px)}.swipe-card .card-main{min-width:0}.card-actions{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}.subtle{font-size:12px;color:#6b7280}.dragging{opacity:.55}.drag-mode-active,.drag-mode-active *{user-select:none!important;-webkit-user-select:none!important}.drop-root{background:#fff;border:2px dashed #9ca3af;border-radius:14px;padding:14px;margin-top:12px;text-align:center}.drop-root.drop-active{border-color:#111827;background:#f3f4f6}.deck-tile:focus{outline:3px solid #93c5fd;outline-offset:2px}.drop-hint{font-size:12px;color:#6b7280;margin-top:4px}.next-review{display:inline-block;padding:4px 8px;border-radius:999px;background:#f3f4f6;color:#374151;font-size:12px;font-weight:700}.next-review.due{background:#fee2e2;color:#991b1b}.study-progress{display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;line-height:1.15;gap:3px;min-width:112px;white-space:nowrap}.study-progress .progress-count{font-size:18px;font-weight:800;color:#111827}.study-progress .progress-difficulty{font-size:14px;color:#6b7280;font-weight:700}.schedule-note{margin-top:12px;padding:10px 12px;border-radius:10px;background:#eef2ff;color:#3730a3;font-weight:700;font-size:14px};.header-right{display:flex;align-items:center;gap:14px}.streak-btn{border:0;background:transparent;color:#fff;display:flex;align-items:center;gap:5px;font-size:18px;font-weight:800;padding:6px 8px;border-radius:12px;cursor:pointer;min-width:58px;justify-content:center}.streak-btn.missed{filter:grayscale(1);opacity:.55}.streak-btn:not(.today-done) #streakFire{filter:grayscale(1);opacity:.45}.streak-btn.today-done{background:#ffffff14}.streak-btn:active{transform:scale(.97)}.streak-panel{position:fixed;inset:0;background:#0006;z-index:20;display:flex;align-items:flex-start;justify-content:center;padding:72px 15px 20px}.streak-modal{width:min(520px,100%);max-height:calc(100vh - 95px);overflow:auto;background:#fff;border-radius:22px;padding:22px;box-shadow:0 20px 60px #0004}.streak-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.streak-big{font-size:56px;font-weight:900;line-height:1}.streak-fire-big{font-size:54px}.streak-progress{height:12px;background:#e5e7eb;border-radius:999px;overflow:hidden;margin:10px 0}.streak-progress>div{height:100%;background:#111827;border-radius:999px;transition:width .2s}.day-row{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;margin:14px 0;padding:0;overflow:visible;width:100%;box-sizing:border-box}.day-dot{min-width:0;width:100%;box-sizing:border-box;padding:9px 3px;border-radius:12px;background:#f3f4f6;text-align:center;font-size:11px;font-weight:800;line-height:1.25;overflow:hidden}.day-dot.done{background:#dcfce7;color:#166534}.day-dot.missed{background:#e5e7eb;color:#9ca3af}.day-dot.today{outline:2px solid #111827;outline-offset:-1px;transform:none}.streak-close{border:0;background:#e5e7eb;border-radius:10px;padding:8px 12px;font-weight:800;cursor:pointer}.streak-info{background:#f8fafc;border-radius:14px;padding:14px;margin:14px 0}.streak-mini{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid #eee}.streak-mini:last-child{border-bottom:0}
@media(max-width:600px){.wrap{padding:15px}.question{font-size:22px}.deck-detail-head{align-items:flex-start}.btn.sm{padding:9px 10px}.header-right{gap:7px}.streak-btn{font-size:16px;padding:5px}.streak-big{font-size:48px}}
@media(max-width:600px){.wrap{padding:15px}.question{font-size:22px}}
.study-session-zone{position:relative;margin:28px 0 10px;min-height:470px;border-radius:26px;overflow:hidden;background:linear-gradient(180deg,#fff 0%,#f7f9fc 100%);border:1px solid #eef0f3;box-shadow:0 10px 30px #0000000a;padding:22px 18px 18px}.study-session-head{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;text-align:center}.study-session-btn{border:0;border-radius:15px;background:#111827;color:#fff;padding:13px 20px;font-weight:850;font-size:16px;cursor:pointer;box-shadow:0 6px 16px #00000016}.study-session-btn:active{transform:scale(.97)}.study-session-options{display:flex;justify-content:center;gap:9px;flex-wrap:wrap;margin-top:12px;max-width:560px;margin-left:auto;margin-right:auto}.study-session-option{border:0;border-radius:999px;background:#e5e7eb;color:#111827;padding:9px 15px;font-weight:800;cursor:pointer}.study-session-option:active{transform:scale(.96)}.study-session-timer{font-size:30px;font-weight:900;letter-spacing:.5px;text-align:center;margin-top:8px;color:#111827}.study-session-status{text-align:center;color:#6b7280;font-size:14px;font-weight:750;min-height:20px;margin-top:3px}.study-session-stage{position:absolute;left:18px;right:18px;bottom:18px;height:275px;overflow:hidden;border-radius:22px;background:linear-gradient(180deg,#f9fbfd 0%,#eef2f7 100%);border:1px solid #e3e8ef}.study-session-ground{position:absolute;left:5%;right:5%;bottom:25px;height:5px;background:#cfd5dd;border-radius:99px;box-shadow:0 2px 0 #fff}.study-library{position:absolute;left:7%;bottom:28px;width:104px;height:155px;z-index:1}.library-body{position:absolute;inset:0;background:linear-gradient(90deg,#8a5a36,#b87943 18%,#a66838 82%,#70482d);border-radius:8px 8px 3px 3px;box-shadow:0 8px 12px #00000015}.library-top{position:absolute;left:-6px;right:-6px;top:-7px;height:12px;border-radius:6px;background:#6f472b}.library-shelf{position:absolute;left:10px;right:10px;height:7px;border-radius:3px;background:#6f472b}.library-shelf.s1{top:48px}.library-shelf.s2{top:92px}.library-shelf.s3{top:136px}.library-book{position:absolute;width:13px;border-radius:2px 2px 1px 1px;bottom:0}.library-book.b1{height:31px;left:17px;background:#64748b}.library-book.b2{height:38px;left:33px;background:#b77945}.library-book.b3{height:27px;left:49px;background:#7c3aed}.library-book.b4{height:35px;left:65px;background:#15803d}.library-book.b5{height:29px;left:80px;background:#9f1239}.study-chair{position:absolute;left:25%;bottom:27px;width:68px;height:104px;z-index:2;transition:transform .5s ease}.chair-back{position:absolute;left:17px;bottom:43px;width:36px;height:56px;border-radius:16px 16px 9px 9px;background:linear-gradient(90deg,#a56635,#c17c43);border:2px solid #8a542c;box-shadow:inset 4px 0 #d18b50}.chair-seat{position:absolute;left:5px;bottom:35px;width:58px;height:13px;border-radius:8px;background:#8f592f}.chair-leg{position:absolute;bottom:0;width:7px;height:38px;background:#8f592f;border-radius:4px}.chair-leg.l{left:14px}.chair-leg.r{right:8px}.study-desk{position:absolute;right:8%;bottom:28px;width:112px;height:95px;z-index:2}.study-desk-top{position:absolute;top:0;left:0;right:0;height:12px;border-radius:6px;background:linear-gradient(180deg,#c98a50,#a96534);box-shadow:0 4px 7px #00000012}.study-desk-leg{position:absolute;top:10px;width:8px;height:84px;background:#8e5a32;border-radius:4px}.study-desk-leg.left{left:14px}.study-desk-leg.right{right:14px}.study-lamp{position:absolute;right:26%;bottom:105px;width:36px;height:65px;z-index:2}.lamp-base{position:absolute;bottom:0;left:0;width:32px;height:6px;border-radius:99px;background:#64748b}.lamp-stem{position:absolute;left:15px;bottom:5px;width:5px;height:42px;background:#64748b;border-radius:4px;transform:rotate(-8deg);transform-origin:bottom}.lamp-head{position:absolute;left:5px;top:3px;width:26px;height:16px;border-radius:14px 14px 4px 4px;background:#f2c94c;box-shadow:0 6px 15px #f2c94c55}.study-bear{position:absolute;left:25%;bottom:34px;width:86px;height:125px;z-index:4;transform-origin:50% 100%;filter:drop-shadow(0 7px 6px #0000001d);transition:left .2s linear}.bear-shadow{position:absolute;left:5px;bottom:-3px;width:76px;height:10px;border-radius:50%;background:#0002;filter:blur(2px)}.bear-ear{position:absolute;top:2px;width:26px;height:26px;border-radius:50%;background:radial-gradient(circle at 55% 55%,#e2a365 0 35%,#a96534 38% 100%);border:2px solid #7d4a28}.bear-ear.l{left:8px}.bear-ear.r{right:8px}.bear-head{position:absolute;left:12px;top:10px;width:62px;height:58px;border-radius:48% 48% 45% 45%;background:radial-gradient(circle at 38% 28%,#d99758 0 10%,#bd773c 32%,#9b5b2e 100%);border:2px solid #754523;box-shadow:inset -7px -5px 10px #75452333}.bear-muzzle{position:absolute;left:13px;top:31px;width:38px;height:24px;border-radius:50%;background:#d99a58;box-shadow:inset -4px -2px 5px #9b5b2e33}.bear-eye{position:absolute;top:25px;width:7px;height:9px;border-radius:50%;background:#20252d;box-shadow:0 1px 0 #fff5}.bear-eye.l{left:21px}.bear-eye.r{right:21px}.bear-nose{position:absolute;left:28px;top:35px;width:11px;height:8px;border-radius:50%;background:#332117}.bear-body{position:absolute;left:14px;top:60px;width:58px;height:62px;border-radius:48% 48% 35% 35%;background:linear-gradient(90deg,#985a2f,#b96f35 45%,#8d512b);border:2px solid #754523}.bear-belly{position:absolute;left:12px;top:12px;width:32px;height:38px;border-radius:50%;background:#d99a58;box-shadow:inset -5px -3px 7px #8d512b22}.bear-arm{position:absolute;top:71px;width:17px;height:42px;border-radius:12px;background:#ad6835;border:2px solid #754523;transform-origin:50% 12%}.bear-arm.l{left:2px;transform:rotate(13deg)}.bear-arm.r{right:2px;transform:rotate(-13deg)}.bear-leg{position:absolute;top:108px;width:25px;height:17px;border-radius:50%;background:#7f4c2b}.bear-leg.l{left:8px}.bear-leg.r{right:8px}.bear-book{position:absolute;z-index:5;left:49px;top:69px;width:39px;height:31px;border-radius:3px;background:linear-gradient(90deg,#f8fafc 0 47%,#dbe4ef 48% 52%,#fff 53%);border:2px solid #64748b;box-shadow:2px 3px 5px #0002;opacity:0;transform-origin:50% 100%}.study-bear.idle .bear-book{opacity:0}.study-bear.active .bear-book{opacity:1}.study-bear.active{animation:cinematicWalk 13s ease-in-out infinite}.study-bear.active .bear-book{animation:bookBob .65s ease-in-out infinite alternate}.study-bear.active .bear-arm.l{animation:armStudy .65s ease-in-out infinite alternate}.study-bear.active .bear-arm.r{animation:armStudyR .65s ease-in-out infinite alternate}.study-bear.active .bear-leg.l{animation:legWalk .42s ease-in-out infinite alternate}.study-bear.active .bear-leg.r{animation:legWalkR .42s ease-in-out infinite alternate}.study-bear.active .bear-head{animation:headWalk .65s ease-in-out infinite alternate}.study-bear.active .bear-shadow{animation:shadowWalk .42s ease-in-out infinite alternate}.study-bear.active + .bear-bravo{display:none}.study-session-zone.active .study-library{animation:libraryGlow 13s ease-in-out infinite}.study-session-zone.done .study-bear{left:25%;animation:breathe .8s ease-out both}.study-session-zone.done .bear-book{opacity:0}.study-session-zone.done .bear-arm{animation:none}.study-session-zone.done .bear-leg{animation:none}.study-session-zone.done .bear-bravo{animation:bravoPop .55s .25s ease-out forwards}.bear-bravo{position:absolute;left:37%;bottom:177px;background:#fff;border-radius:999px;padding:8px 14px;font-size:18px;font-weight:900;color:#111827;box-shadow:0 6px 18px #0002;opacity:0;transform:translateY(8px) scale(.9);z-index:7}@keyframes cinematicWalk{0%,7%{left:25%;transform:translateY(0) scaleX(1)}16%{left:9%;transform:translateY(-2px) scaleX(1)}22%{left:9%;transform:translateY(0) scaleX(1)}29%{left:25%;transform:translateY(-2px) scaleX(1)}38%{left:70%;transform:translateY(0) scaleX(1)}48%{left:70%;transform:translateY(-2px) scaleX(-1)}58%{left:30%;transform:translateY(0) scaleX(-1)}68%{left:70%;transform:translateY(-2px) scaleX(1)}78%{left:30%;transform:translateY(0) scaleX(1)}88%{left:25%;transform:translateY(-2px) scaleX(1)}100%{left:25%;transform:translateY(0) scaleX(1)}}@keyframes bookBob{from{transform:translateY(2px) rotate(-3deg)}to{transform:translateY(-3px) rotate(3deg)}}@keyframes armStudy{from{transform:rotate(8deg)}to{transform:rotate(30deg)}}@keyframes armStudyR{from{transform:rotate(-28deg)}to{transform:rotate(-7deg)}}@keyframes legWalk{from{transform:rotate(-12deg) translateY(1px)}to{transform:rotate(18deg) translateY(-1px)}}@keyframes legWalkR{from{transform:rotate(18deg) translateY(-1px)}to{transform:rotate(-12deg) translateY(1px)}}@keyframes headWalk{from{transform:translateY(1px) rotate(-2deg)}to{transform:translateY(-2px) rotate(2deg)}}@keyframes shadowWalk{from{transform:scaleX(.92)}to{transform:scaleX(1.02)}}@keyframes breathe{0%{transform:translateY(-8px) scale(1)}100%{transform:translateY(0) scale(.96)}}@keyframes libraryGlow{0%,22%{filter:none}23%,28%{filter:drop-shadow(0 0 10px #f2c94c55)}29%,100%{filter:none}}@keyframes bravoPop{to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:600px){.study-session-zone{min-height:445px;padding:18px 12px}.study-session-stage{left:12px;right:12px;height:245px}.study-bear{left:25%;transform:scale(.88);transform-origin:50% 100%}.study-library{left:4%;transform:scale(.82);transform-origin:left bottom}.study-desk{right:4%;transform:scale(.82);transform-origin:right bottom}.study-lamp{right:23%;transform:scale(.82);transform-origin:center bottom}.bear-bravo{left:36%;bottom:155px}.study-session-timer{font-size:27px}}.study-session-stage{left:12px;right:12px;height:185px}.study-bear{font-size:52px}.study-session-timer{font-size:25px}}


.ai-head-btn{border:0;background:#eef2ff;color:#3730a3;padding:8px 11px;border-radius:10px;font-weight:800;cursor:pointer}.modal{position:fixed;inset:0;background:transparent;display:none;z-index:1000;pointer-events:none}.modal.open{display:block}.modal-box{position:fixed;right:18px;bottom:18px;width:min(720px,calc(100vw - 36px));max-height:82vh;background:#fff;border-radius:22px;box-shadow:0 20px 60px rgba(0,0,0,.28);overflow:hidden;pointer-events:auto;transform:translate3d(0,0,0)}.ai-box{display:flex;flex-direction:column}.ai-top{display:flex;justify-content:space-between;align-items:flex-start;padding:18px;cursor:grab;user-select:none;touch-action:none;border-bottom:1px solid #e5e7eb}.ai-top:active{cursor:grabbing}.ai-drag-hint{font-size:11px;color:#94a3b8;margin-top:5px}.icon-btn{border:0;background:#f3f4f6;border-radius:10px;width:36px;height:36px;font-size:18px;cursor:pointer}.ai-chips{display:flex;gap:8px;overflow:auto;padding:12px 16px;border-bottom:1px solid #eef0f3}.ai-chips button{white-space:nowrap;border:1px solid #dbe1ea;background:#f8fafc;border-radius:999px;padding:8px 11px;font-weight:700;color:#334155}.ai-messages{padding:16px;overflow:auto;min-height:220px;max-height:48vh;background:#f8fafc}.ai-msg{display:flex;margin:8px 0}.ai-msg.user{justify-content:flex-end}.ai-bubble{max-width:88%;padding:11px 13px;border-radius:15px;white-space:pre-wrap;line-height:1.45}.ai-msg.user .ai-bubble{background:#111827;color:#fff;border-bottom-right-radius:5px}.ai-msg.assistant .ai-bubble{background:#fff;border:1px solid #e5e7eb;border-bottom-left-radius:5px}.ai-welcome{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:13px;line-height:1.5}.ai-form{display:flex;gap:8px;padding:12px;border-top:1px solid #e5e7eb;background:#fff}.ai-form textarea{flex:1;resize:none;border:1px solid #d1d5db;border-radius:12px;padding:10px;font:inherit;outline:none}.ai-form textarea:focus{border-color:#6366f1}.ai-form .btn{align-self:stretch}.ai-foot{padding:0 14px 12px;text-align:center;font-size:11px}@media(max-width:600px){.modal-box{right:10px;bottom:10px;width:calc(100vw - 20px);max-height:84vh;border-radius:20px}.ai-messages{max-height:44vh}.ai-top{padding:14px}}

<style>
.shared-lib-folder-head .shared-folder-chevron{display:inline-flex;align-items:center;justify-content:center;width:20px;font-size:24px;line-height:1;opacity:.65;margin-right:2px}
.shared-lib-folder:not(.is-open) .shared-lib-folder-head{border-bottom-left-radius:18px;border-bottom-right-radius:18px}



#battleOverlay .battle-picker-folder{border:1px solid #dce3f0;border-radius:14px;background:#fff;overflow:hidden}
#battleOverlay .battle-folder-heading{display:flex;align-items:center;gap:4px;padding:5px 10px;background:#f2f5fc}
#battleOverlay .battle-folder-check{display:flex;align-items:center;justify-content:center;min-width:30px;min-height:44px;cursor:pointer}
#battleOverlay .battle-folder-select{width:18px;height:18px;accent-color:#644cce;cursor:pointer}
#battleOverlay .battle-folder-toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:1;min-width:0;border:0;background:transparent;text-align:left;color:#243658;padding:7px 2px;font:inherit;font-weight:800;cursor:pointer}
#battleOverlay .battle-folder-toggle>span:first-child{min-width:0;overflow-wrap:anywhere}
#battleOverlay .battle-folder-toggle small{display:block;font-size:11px;font-weight:500;color:#64748b;margin-top:4px}
#battleOverlay .battle-folder-toggle[aria-expanded="true"] .battle-folder-chevron{transform:rotate(180deg)}
#battleOverlay .battle-folder-banks{display:grid;gap:5px;padding:8px}
#battleOverlay .battle-picker-selection{padding-top:12px}
#battleOverlay .battle-picker-heading{flex-wrap:wrap}
#battleOverlay .battle-manager-folder{border:1px solid #dce3f0;border-radius:14px;padding:10px;background:#f7f9fd;min-width:0}
#battleOverlay .battle-folder-manager-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;overflow-wrap:anywhere}
#battleOverlay .battle-library-deck-title{display:grid;gap:5px;min-width:0;overflow-wrap:anywhere}
#battleOverlay .battle-move-folder{display:grid;gap:4px;font-size:11px;color:#64748b;max-width:100%}
#battleOverlay .battle-move-folder select{width:180px;max-width:100%;padding:7px;border:1px solid #dce3f0;border-radius:8px;background:#fff;color:#243658}
#battleOverlay .battle-new-folder{margin:16px 0;display:grid;gap:6px}
#battleOverlay .battle-new-folder>div{display:flex;flex-wrap:wrap;gap:8px}
#battleOverlay .battle-new-folder input{min-width:0;flex:1 1 150px;padding:10px;border:1px solid #dce3f0;border-radius:10px}
#battleOverlay .battle-question-editor>select{width:100%;padding:11px;border:1px solid #dce3f0;border-radius:10px;background:#fff}
#battleOverlay .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}
#battleOverlay .battle-folder-banks.hidden,#battleOverlay .battle-picker-folder.hidden{display:none}

#battleOverlay .battle-library-manage-entry{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 auto 16px;padding:13px 16px;border:1px solid #dce6f8;border-radius:17px;background:#fff;box-shadow:0 8px 24px #263b680c}
#battleOverlay .battle-library-manage-entry>div{display:grid;gap:3px;color:#243a60}
#battleOverlay .battle-library-manager-head,#battleOverlay .battle-question-editor-head,#battleOverlay .battle-question-editor-list-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#battleOverlay .battle-library-item-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
#battleOverlay .battle-question-editor{display:grid;gap:12px}
#battleOverlay .battle-question-editor h3{margin:0 0 4px}
#battleOverlay .battle-question-editor>label,#battleOverlay .battle-question-editor-fields>label{display:block;margin:8px 0 5px;color:#405271;font-size:13px;font-weight:850}
#battleOverlay .battle-question-editor>input,#battleOverlay .battle-question-editor-fields>textarea,#battleOverlay .battle-question-editor-fields>select{width:100%;box-sizing:border-box;border:1px solid #dce4f0;border-radius:12px;padding:11px 13px;background:#fff;color:#223653;font:inherit}
#battleOverlay .battle-question-editor-list-head{margin-top:10px;padding-top:12px;border-top:1px solid #dce6f2}
#battleOverlay .battle-question-editor-card{margin-top:8px;border:1px solid #dfe6f0;border-radius:14px;background:#fff;overflow:hidden}
#battleOverlay .battle-question-editor-card.is-expanded{border-color:#91a8e8;box-shadow:0 8px 24px #394e9814}
#battleOverlay .battle-question-editor-summary{display:grid;grid-template-columns:31px minmax(0,1fr) 20px;align-items:start;gap:10px;width:100%;border:0;background:transparent;color:#253a5a;padding:9px 11px;text-align:left;font:inherit;font-weight:800;cursor:pointer}
#battleOverlay .battle-question-editor-number{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:#edf2ff;color:#475caf;font-size:12px}
#battleOverlay .battle-question-editor-preview{display:grid;min-width:0;gap:4px}
#battleOverlay .battle-question-editor-preview>strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.35}
#battleOverlay .battle-question-mini-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 10px;color:#64748b;font-size:10px;font-weight:550;line-height:1.3}
#battleOverlay .battle-question-mini-options>span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#battleOverlay .battle-question-mini-options b{color:#5369b9;font-weight:850}
#battleOverlay .battle-question-editor-card.is-expanded .battle-question-mini-options{display:none}
#battleOverlay .battle-question-editor-fields{display:grid;gap:8px;padding:4px 14px 14px}
#battleOverlay .battle-question-options-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#battleOverlay .battle-question-option-field{display:flex!important;align-items:center;gap:7px;margin:0!important}
#battleOverlay .battle-question-option-field>span{display:grid;place-items:center;width:25px;height:25px;flex:0 0 25px;border-radius:8px;background:#edf2ff;color:#5369b9;font-size:11px;font-weight:900}
#battleOverlay .battle-question-option-field input{width:100%;min-width:0;box-sizing:border-box;border:1px solid #dce4f0;border-radius:10px;padding:9px;background:#fff;font:inherit}
#battleOverlay .battle-question-editor-actions{display:flex;justify-content:flex-end;margin-top:6px}
#battleOverlay .battle-question-image-preview{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#battleOverlay .battle-question-image-preview img,#battleOverlay .battle-question-image{display:block;max-width:100%;max-height:320px;object-fit:contain;border-radius:14px;border:1px solid #e2e8f0;margin:10px auto}
#battleOverlay .battle-picker-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
#battleOverlay .battle-bank-search{width:100%;box-sizing:border-box;margin-bottom:8px;border:1px solid #e0e6f0;border-radius:10px;padding:8px 10px;font:inherit;font-size:13px}
#battleOverlay .battle-bank-list{display:grid;gap:5px;max-height:min(30vh,230px);overflow:auto;overscroll-behavior:contain;padding-right:2px}
#battleOverlay .battle-bank-option{display:flex;align-items:center;gap:9px;min-height:37px;padding:6px 9px;border:1px solid #e7ebf2;border-radius:10px;background:#fff;cursor:pointer}
#battleOverlay .battle-bank-option input{width:17px;height:17px;flex:0 0 17px;margin:0}
#battleOverlay .battle-bank-option>span{display:flex;align-items:baseline;justify-content:space-between;gap:8px;min-width:0;flex:1}
#battleOverlay .battle-bank-option b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#2a3d5b;font-size:12px}
#battleOverlay .battle-bank-option small{white-space:nowrap;color:#718096;font-size:10px}
#battleOverlay .battle-finished-room{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin:15px auto 0}
#battleOverlay .battle-finished-room>span:first-child{font-size:10px;font-weight:900;letter-spacing:.12em;color:#dce6ff}
#battleOverlay .battle-finished-room .battle-room-code{background:#fff;color:#33488e}
#battleOverlay .battle-kick-btn{flex:0 0 28px;width:28px;height:28px;border:1px solid #f2cccc;border-radius:9px;background:#fff3f3;color:#ad3434;font-weight:900;cursor:pointer}
#battleOverlay .battle-notice{padding:13px;border:1px solid #d9e5f4;border-radius:12px;background:#f4f7fc;color:#536781;font-size:13px;line-height:1.5}
@media(max-width:600px){#battleOverlay .battle-library-manage-entry{align-items:flex-start;flex-direction:column}#battleOverlay .battle-library-item{align-items:flex-start;flex-direction:column}#battleOverlay .battle-library-item-actions{justify-content:flex-start;width:100%}#battleOverlay .battle-question-options-grid{grid-template-columns:1fr}#battleOverlay .battle-finished-room .battle-room-code{font-size:22px;letter-spacing:5px}}


#adminPage{--admin-ink:#152442;--admin-muted:#697995;--admin-line:#e6ebf4;--admin-blue:#526de2}
#adminPage>.admin-shell{overflow:hidden;border:1px solid #e6ebf4;border-radius:28px;background:linear-gradient(145deg,#fff,#f7f9ff);box-shadow:0 24px 70px rgba(31,50,92,.12)}
#adminPage .admin-hero{position:relative;overflow:hidden;padding:clamp(22px,4vw,34px);color:#fff;background:radial-gradient(circle at 88% 5%,#7b91ff66,transparent 28%),linear-gradient(120deg,#131e38,#243d70 66%,#4d5eaa)}
#adminPage .admin-hero:after{content:'✦';position:absolute;right:7%;top:-28px;color:#ffffff17;font-size:130px;transform:rotate(16deg);pointer-events:none}
#adminPage .admin-hero-row{position:relative;z-index:1;display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap}
#adminPage .admin-eyebrow{font-size:11px;font-weight:950;letter-spacing:1.7px;text-transform:uppercase;color:#c9d5ff}
#adminPage .admin-hero h2{margin:6px 0;font-size:clamp(25px,4vw,34px);letter-spacing:-.5px}
#adminPage .admin-hero h2{color:#ffe082!important;text-shadow:0 2px 14px rgba(255,224,130,.24)}
#adminPage .admin-hero p{margin:0;color:#e0e7ff;max-width:620px;line-height:1.55}
#adminPage .admin-refresh{position:relative;z-index:1;border:1px solid #ffffff36;border-radius:13px;padding:10px 14px;background:#ffffff16;color:#fff;font:inherit;font-weight:850;cursor:pointer;backdrop-filter:blur(12px)}
#adminPage .admin-content{padding:clamp(15px,3vw,26px)}
#adminPage .admin-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:16px}
#adminPage .admin-metric{padding:16px 18px;border:1px solid var(--admin-line);border-radius:18px;background:#fff;box-shadow:0 8px 25px rgba(33,53,90,.05)}
#adminPage .admin-metric span{display:block;color:var(--admin-muted);font-size:12px;font-weight:800}
#adminPage .admin-metric strong{display:block;margin-top:4px;color:var(--admin-ink);font-size:27px;font-variant-numeric:tabular-nums}
#adminPage .admin-section{margin-top:14px;border:1px solid var(--admin-line);border-radius:20px;background:#ffffffd9;overflow:hidden}
#adminPage .admin-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 17px;border-bottom:1px solid #edf0f6}
#adminPage .admin-section-head h3{margin:0;color:var(--admin-ink);font-size:16px}
#adminPage .admin-section-head small{color:var(--admin-muted)}
#adminPage .admin-status-pill{display:inline-flex;padding:5px 9px;border-radius:999px;background:#eaf8ef;color:#258354;font-size:10px;font-weight:950;letter-spacing:.7px}
#adminPage .admin-online-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:9px;padding:12px}
#adminPage .admin-online-user{display:flex;align-items:center;gap:11px;padding:12px 13px;border:1px solid #e5efe9;border-radius:15px;background:linear-gradient(120deg,#f5fcf7,#fff)}
#adminPage .admin-online-dot{width:10px;height:10px;flex:0 0 10px;border-radius:50%;background:#20aa66;box-shadow:0 0 0 4px #20aa661b}
#adminPage .admin-online-user b{display:block;color:#1e334e;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#adminPage .admin-online-user small{color:#708097}
#adminPage .admin-empty{padding:20px;text-align:center;color:var(--admin-muted)}
#adminPage .admin-users-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:10px;padding:12px}
#adminPage .admin-user-card{margin:0;border-color:#e6ebf4;border-radius:17px;box-shadow:0 6px 18px #20365b08}
#adminPage .admin-user-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
#adminPage .admin-user-name{font-size:15px;color:var(--admin-ink)}
#adminPage .admin-user-size{flex:0 0 auto;padding:5px 9px;border-radius:999px;background:#eef2ff;color:#4258bc;font-size:11px;font-weight:900}
#adminPage .admin-user-meta{margin-top:5px;color:var(--admin-muted);font-size:11px;overflow-wrap:anywhere}
#adminPage .admin-perm{padding:8px 10px;border:1px solid #e9edf5;border-radius:11px;background:#f9faff;color:#35445f}
#adminPage .admin-perm input{accent-color:var(--admin-blue)}
@media(max-width:600px){#adminPage>.admin-shell{border-radius:21px}#adminPage .admin-metrics{gap:8px}#adminPage .admin-metric{padding:13px}#adminPage .admin-metric strong{font-size:23px}#adminPage .admin-user-actions{display:grid;grid-template-columns:1fr 1fr}}


/* V35: prevent any page-wide horizontal overflow on iPhone. Layout and features unchanged. */
html,body{width:100%;max-width:100%;overflow-x:hidden;}
.wrap,section,.card,.row,nav{min-width:0;max-width:100%;}
.row>*,nav>*{min-width:0;}
select{min-width:0;max-width:100%;}


#aiModal.open{background:transparent;pointer-events:none;align-items:flex-start;justify-content:flex-start;padding:0;}
#aiModal.open .modal-box{pointer-events:auto;position:fixed;width:min(720px,calc(100vw - 24px));max-height:calc(100vh - 24px);}
#aiModal .ai-top{touch-action:none;}
#aiModal.ai-expanded .modal-box{left:8px!important;top:8px!important;right:8px!important;bottom:8px!important;width:auto!important;max-width:none!important;max-height:none!important;border-radius:22px;}
#aiModal.ai-expanded .ai-messages{max-height:none;flex:1;min-height:0;}
.ai-window-tools{display:flex;gap:7px;align-items:center;}
.ai-window-tool{width:36px;height:36px;border:0;border-radius:10px;background:#f3f4f6;color:#111827;font-size:19px;font-weight:700;display:flex;align-items:center;justify-content:center;}
@media(max-width:600px){#aiModal.open .modal-box{width:calc(100vw - 24px);max-height:calc(100vh - 24px);}}


/* Polished app-wide micro animations */
@media (prefers-reduced-motion:no-preference){
  .tab,.btn,.ai-head-btn,.ai-chips button,.icon-btn,.ai-window-tool,.streak-btn,.streak-close,.bubble-close{transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease,opacity .16s ease;}
  .tab:active,.btn:active,.ai-head-btn:active,.ai-chips button:active,.icon-btn:active,.ai-window-tool:active,.streak-close:active{transform:scale(.96);}
  .card,.stat,.deck-tile,.study-card{animation:scFadeUp .32s ease both;}
  .ai-msg{animation:scMsgIn .22s ease both;}
  #aiModal .modal-box{transition:transform .26s cubic-bezier(.22,.8,.25,1),opacity .2s ease,box-shadow .26s ease;}
  #aiModal.ai-dragging .modal-box{transition:none!important;}
  @keyframes scFadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
  @keyframes scMsgIn{from{opacity:0;transform:translateY(7px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
  @keyframes scBubblePop{0%{opacity:0;transform:scale(.45)}65%{opacity:1;transform:scale(1.08)}100%{opacity:1;transform:scale(1)}}
  @keyframes scAiOpen{from{opacity:.25;transform:translate3d(0,18px,0) scale(.88)}to{opacity:1;transform:translate3d(0,0,0) scale(1)}}
  @keyframes scAiMinimize{0%{opacity:1;transform:translate3d(0,0,0) scale(1)}55%{opacity:.98;transform:translate3d(calc(var(--ai-tx,0px)*.72),calc(var(--ai-ty,120px)*.72),0) scale(.48)}100%{opacity:0;transform:translate3d(var(--ai-tx,0px),var(--ai-ty,120px),0) scale(.18)}}
  #aiModal.ai-opening .modal-box{animation:scAiOpen .28s cubic-bezier(.2,.85,.25,1) both;}
  #aiModal.ai-minimizing .modal-box{animation:scAiMinimize .28s cubic-bezier(.55,.05,.8,.25) both;}
}


/* V21: Messenger-style destination + cleaner deck controls */

/* Keep deck action buttons from being squeezed/overlapping on narrow screens. */
.deck-tile .row{align-items:center;}
.deck-tile .actions{flex:0 0 auto!important;display:flex;align-items:center;gap:7px;flex-wrap:nowrap;margin-left:8px;}
.deck-tile .deck-action{flex:0 0 auto!important;white-space:nowrap;min-width:42px;}
@media(max-width:600px){
  .deck-tile .row{gap:8px;}
  .deck-tile .actions{margin-left:4px;gap:5px;}
  .deck-tile .deck-action[data-action="study"]{padding:9px 10px;}
  .deck-tile .deck-action[data-action="rename"],.deck-tile .deck-action[data-action="delete"]{width:42px;padding:9px 0;}
}

/* More natural app-wide motion without changing layout. */
@media (prefers-reduced-motion:no-preference){
  .deck-tile{transition:transform .18s ease,box-shadow .18s ease,opacity .18s ease;}
  .deck-tile:active{transform:scale(.992);}
  .deck-action:hover,.btn:hover,.tab:hover,.ai-head-btn:hover{box-shadow:0 5px 14px rgba(15,23,42,.10);}
  #aiModal .modal-box{will-change:transform,opacity;}
  @keyframes v21BubbleLand{
    0%{transform:scale(.72) translateY(12px);opacity:.35}
    65%{transform:scale(1.08) translateY(-2px);opacity:1}
    100%{transform:scale(1) translateY(0);opacity:1}
  }
}


/* V23: Messenger-style side snapping for AI bubble */
/* AI chat open state: hide the bottom navigation while the chatbot is open. */
body.ai-chat-open > nav.glass-dock{display:none!important;visibility:hidden!important;pointer-events:none!important;}
@keyframes v23BubbleLand{0%{opacity:.2;transform:scale(.22)}55%{opacity:1;transform:scale(1.10)}78%{transform:scale(.96)}100%{opacity:1;transform:scale(1)}}


/* V22: responsive deck/card controls + contained deck detail header */
.deck-tile .row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:10px;}
.deck-tile .row>div:nth-child(2){min-width:0;overflow:hidden;}
.deck-tile .row>div:nth-child(2)>b{display:block;overflow-wrap:anywhere;word-break:break-word;}
.deck-tile .actions{min-width:0;flex:0 0 auto!important;display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:nowrap;margin-left:0!important;}
.deck-tile .deck-action{flex:0 0 auto!important;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;text-align:center;line-height:1.15;}
.folder-head{position:relative;align-items:flex-start;}
.folder-head>div:first-child{min-width:0;flex:1;}
.folder-head .actions{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:nowrap;}

.deck-detail-head{position:relative;display:block;padding-right:92px;min-height:66px;}
.deck-detail-head>div{min-width:0;}
.deck-detail-head h2{overflow-wrap:anywhere;word-break:break-word;}
.deck-detail-head>button{position:absolute;right:12px;top:0;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;text-align:center;}

.card-actions{align-items:stretch;}
.card-actions>span,.card-actions>button{display:inline-flex;align-items:center;justify-content:center;text-align:center;white-space:nowrap;line-height:1.2;}
.card-actions .next-review{min-height:36px;}

@media(max-width:600px){
  .deck-tile{padding:12px 10px;}
  .deck-tile .row{
    grid-template-columns:34px minmax(0,1fr);
    row-gap:9px;
    column-gap:8px;
  }
  .deck-tile .row>.drag-handle{grid-column:1;grid-row:1;align-self:start;}
  .deck-tile .row>div:nth-child(2){grid-column:2;grid-row:1;}
  .deck-tile .actions{
    grid-column:1 / -1;
    grid-row:2;
    width:100%;
    justify-content:flex-end;
    gap:6px;
    margin:0!important;
    padding-left:42px;
  }
  .deck-tile .deck-action[data-action="study"]{
    flex:1 1 auto!important;
    min-width:0;
    padding:10px 12px;
  }
  .deck-tile .deck-action[data-action="rename"],
  .deck-tile .deck-action[data-action="delete"]{
    width:46px;
    min-width:46px;
    padding:10px 0;
  }

  .folder-head{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    row-gap:9px;
  }
  .folder-head .actions{
    width:100%;
    justify-content:flex-end;
    gap:6px;
  }

  .deck-detail-head{
    padding-right:0;
    padding-top:52px;
  }
  .deck-detail-head>button{
    top:0;
    right:0;
    min-width:82px;
    max-width:110px;
  }

  .card-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
  }
  .card-actions>span,.card-actions>button{
    width:100%;
    min-width:0;
    padding:9px 8px;
  }
  .card-actions .next-review{min-height:0;}
}


/* V44: compact Study Session without changing the character animation design. */
.study-session-zone{min-height:300px;margin:18px 0 8px;padding:14px 12px 12px;border-radius:22px}
.study-session-head{gap:7px}
.study-session-btn{padding:10px 16px;border-radius:13px;font-size:15px}
.study-session-options{gap:6px;margin-top:7px}
.study-session-option{padding:7px 11px;font-size:13px}
.study-session-timer{font-size:27px;margin-top:5px}
.study-session-status{font-size:12px;min-height:16px;margin-top:1px}
.study-session-stage{left:10px;right:10px;bottom:10px;height:145px;border-radius:18px}
.study-session-ground{bottom:15px;height:4px}
.study-library{left:6%;bottom:18px;width:78px;height:116px;transform:scale(.72);transform-origin:left bottom}
.study-chair{left:24%;bottom:17px;transform:scale(.72);transform-origin:left bottom}
.study-desk{right:7%;bottom:18px;width:92px;height:76px;transform:scale(.72);transform-origin:right bottom}
.study-lamp{right:25%;bottom:82px;transform:scale(.72);transform-origin:center bottom}
.study-bear{left:24%;bottom:21px;width:72px;height:105px;transform:scale(.72);transform-origin:50% 100%}
.bear-bravo{left:36%;bottom:105px;padding:5px 10px;font-size:15px}
.study-session-zone.done .study-bear{left:24%}
.study-session-zone .study-bear.paused{animation:none!important}
@media(max-width:600px){
  .study-session-zone{min-height:300px;margin:16px 0 6px;padding:12px 10px 10px}
  .study-session-stage{left:9px;right:9px;bottom:9px;height:138px}
  .study-session-timer{font-size:25px}
  .study-library{left:4%;bottom:17px;transform:scale(.64)}
  .study-chair{left:24%;bottom:16px;transform:scale(.64)}
  .study-desk{right:4%;bottom:17px;transform:scale(.64)}
  .study-lamp{right:23%;bottom:78px;transform:scale(.64)}
  .study-bear{left:24%;bottom:20px;transform:scale(.64)}
  .bear-bravo{left:36%;bottom:101px;font-size:14px}
  .study-session-zone.done .study-bear{left:24%}
}


/* V45: make the Study Session intentionally tiny and unobtrusive.
   Keep all existing character/scene animations and timer behavior unchanged. */
.study-session-zone{
  min-height:205px !important;
  margin:14px 0 6px !important;
  padding:10px 8px 8px !important;
  border-radius:18px !important;
}
.study-session-head{gap:5px !important}
.study-session-btn{
  padding:7px 12px !important;
  border-radius:11px !important;
  font-size:13px !important;
  box-shadow:0 4px 10px #00000012 !important;
}
.study-session-options{
  gap:4px !important;
  margin-top:5px !important;
}
.study-session-option{
  padding:5px 8px !important;
  font-size:11px !important;
}
.study-session-timer{
  font-size:21px !important;
  margin-top:3px !important;
}
.study-session-status{
  font-size:10px !important;
  min-height:13px !important;
  margin-top:0 !important;
}
.study-session-stage{
  left:7px !important;
  right:7px !important;
  bottom:7px !important;
  height:88px !important;
  border-radius:14px !important;
}
.study-session-ground{
  bottom:9px !important;
  height:3px !important;
}
.study-library{
  left:5% !important;
  bottom:12px !important;
  transform:scale(.48) !important;
  transform-origin:left bottom !important;
}
.study-chair{
  left:24% !important;
  bottom:11px !important;
  transform:scale(.48) !important;
  transform-origin:left bottom !important;
}
.study-desk{
  right:5% !important;
  bottom:12px !important;
  transform:scale(.48) !important;
  transform-origin:right bottom !important;
}
.study-lamp{
  right:24% !important;
  bottom:48px !important;
  transform:scale(.48) !important;
  transform-origin:center bottom !important;
}
.study-bear{
  left:24% !important;
  bottom:13px !important;
  transform:scale(.48) !important;
  transform-origin:50% 100% !important;
}
.bear-bravo{
  left:38% !important;
  bottom:65px !important;
  padding:3px 7px !important;
  font-size:11px !important;
}
.study-session-zone.done .study-bear{left:24% !important}

@media(max-width:600px){
  .study-session-zone{
    min-height:195px !important;
    margin:12px 0 4px !important;
    padding:9px 7px 7px !important;
  }
  .study-session-stage{
    left:6px !important;
    right:6px !important;
    bottom:6px !important;
    height:82px !important;
  }
  .study-session-timer{font-size:20px !important}
  .study-bear{transform:scale(.43) !important}
  .study-library{transform:scale(.43) !important}
  .study-chair{transform:scale(.43) !important}
  .study-desk{transform:scale(.43) !important}
  .study-lamp{transform:scale(.43) !important}
  .bear-bravo{bottom:61px !important;font-size:10px !important}
}


/* V46: keep the bear tiny in every state, including active/resume,
   and make its walking movement slow and occasional. */
.study-bear{
  transform:scale(.43) !important;
  transform-origin:50% 100% !important;
  left:25% !important;
  bottom:13px !important;
}
.study-bear.idle,
.study-bear.paused{
  transform:scale(.43) !important;
}
.study-bear.active{
  animation:v46SlowStudyWalk 480s ease-in-out infinite !important;
  transform-origin:50% 100% !important;
}
.study-bear.active .bear-book{
  animation:bookBob .65s ease-in-out infinite alternate !important;
}
.study-bear.active .bear-arm.l{animation:armStudy .65s ease-in-out infinite alternate !important}
.study-bear.active .bear-arm.r{animation:armStudyR .65s ease-in-out infinite alternate !important}
.study-bear.active .bear-leg.l{animation:legWalk .42s ease-in-out infinite alternate !important}
.study-bear.active .bear-leg.r{animation:legWalkR .42s ease-in-out infinite alternate !important}
.study-bear.active .bear-head{animation:headWalk .65s ease-in-out infinite alternate !important}
.study-bear.active .bear-shadow{animation:shadowWalk .42s ease-in-out infinite alternate !important}

@keyframes v46SlowStudyWalk{
  0%,23%{
    left:25%;
    transform:translateY(0) scale(.43);
  }
  25%{
    left:42%;
    transform:translateY(-1px) scale(.43);
  }
  27%,48%{
    left:42%;
    transform:translateY(0) scale(.43);
  }
  50%{
    left:14%;
    transform:translateY(-1px) scale(.43);
  }
  52%,73%{
    left:14%;
    transform:translateY(0) scale(.43);
  }
  75%{
    left:57%;
    transform:translateY(-1px) scaleX(-.43) scaleY(.43);
  }
  77%,98%{
    left:57%;
    transform:translateY(0) scaleX(-.43) scaleY(.43);
  }
  100%{
    left:25%;
    transform:translateY(0) scale(.43);
  }
}

/* Keep the finished/Bravo state tiny too. */
.study-session-zone.done .study-bear{
  left:25% !important;
  transform:scale(.43) !important;
  animation:breatheV46 .8s ease-out both !important;
}
@keyframes breatheV46{
  0%{transform:translateY(-4px) scale(.43)}
  100%{transform:translateY(0) scale(.41)}
}

@media(max-width:600px){
  .study-bear,
  .study-bear.idle,
  .study-bear.paused{
    transform:scale(.40) !important;
  }
  .study-bear.active{
    animation:v46SlowStudyWalkMobile 480s ease-in-out infinite !important;
  }
}
@keyframes v46SlowStudyWalkMobile{
  0%,23%{left:25%;transform:translateY(0) scale(.40)}
  25%{left:42%;transform:translateY(-1px) scale(.40)}
  27%,48%{left:42%;transform:translateY(0) scale(.40)}
  50%{left:14%;transform:translateY(-1px) scale(.40)}
  52%,73%{left:14%;transform:translateY(0) scale(.40)}
  75%{left:57%;transform:translateY(-1px) scaleX(-.40) scaleY(.40)}
  77%,98%{left:57%;transform:translateY(0) scaleX(-.40) scaleY(.40)}
  100%{left:25%;transform:translateY(0) scale(.40)}
}


/* V47: make the whole Study Session quieter/smaller while preserving animation. */
.study-session-zone{
  min-height:235px !important;
  margin:14px 0 6px !important;
  padding:10px 9px 8px !important;
  border-radius:19px !important;
}
.study-session-head{gap:5px !important}
.study-session-btn{
  padding:7px 12px !important;
  border-radius:11px !important;
  font-size:13px !important;
}
.study-session-options{
  gap:5px !important;
  margin-top:5px !important;
}
.study-session-option{
  padding:5px 9px !important;
  font-size:11px !important;
}
.study-session-timer{
  font-size:22px !important;
  margin-top:3px !important;
}
.study-session-status{
  font-size:10px !important;
  min-height:13px !important;
  margin-top:0 !important;
}
.study-session-stage{
  left:7px !important;
  right:7px !important;
  bottom:7px !important;
  height:103px !important;
  border-radius:15px !important;
}
.study-session-ground{bottom:11px !important;height:3px !important}
.study-library{
  left:4% !important;
  bottom:14px !important;
  transform:scale(.57) !important;
  transform-origin:left bottom !important;
}
.study-chair{
  left:24% !important;
  bottom:14px !important;
  transform:scale(.57) !important;
  transform-origin:left bottom !important;
}
.study-desk{
  right:4% !important;
  bottom:14px !important;
  transform:scale(.57) !important;
  transform-origin:right bottom !important;
}
.study-lamp{
  right:22% !important;
  bottom:55px !important;
  transform:scale(.57) !important;
  transform-origin:center bottom !important;
}
.study-bear{
  left:24% !important;
  bottom:15px !important;
  transform:scale(.32) !important;
  transform-origin:50% 100% !important;
}
.study-bear.active{
  animation:v47SlowStudyWalk 480s ease-in-out infinite !important;
}
.study-session-zone.done .study-bear{
  left:24% !important;
  transform:scale(.32) !important;
}
.bear-bravo{
  left:36% !important;
  bottom:73px !important;
  padding:4px 8px !important;
  font-size:10px !important;
}
.study-history-btn{
  display:block;
  margin:5px auto 0;
  border:0;
  border-radius:999px;
  background:#eef0f3;
  color:#111827;
  padding:5px 10px;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.study-history-btn:active{transform:scale(.97)}
.study-history-overlay{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:#11182755;
  backdrop-filter:blur(7px);
}
.study-history-card{
  width:min(390px,94vw);
  max-height:78vh;
  overflow:auto;
  background:#fff;
  border-radius:24px;
  padding:20px 17px 16px;
  box-shadow:0 18px 50px #0004;
  animation:v47HistoryPop .28s ease-out;
}
.study-history-title{
  text-align:center;
  font-size:21px;
  font-weight:900;
  color:#111827;
  margin-bottom:4px;
}
.study-history-sub{
  text-align:center;
  color:#6b7280;
  font-size:12px;
  margin-bottom:14px;
}
.study-history-total{
  text-align:center;
  background:#f4f6f8;
  border-radius:17px;
  padding:12px 8px;
  margin-bottom:13px;
}
.study-history-total strong{
  display:block;
  font-size:28px;
  color:#111827;
}
.study-history-total span{
  color:#6b7280;
  font-size:11px;
  font-weight:750;
}
.study-history-day{
  background:#f8fafc;
  border-radius:15px;
  padding:10px 12px;
  margin-top:8px;
}
.study-history-day-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:850;
  color:#111827;
}
.study-history-day-total{
  color:#6b7280;
  font-weight:750;
}
.study-history-sessions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:7px;
}
.study-history-pill{
  background:#e9edf2;
  border-radius:999px;
  padding:5px 8px;
  font-size:10px;
  color:#111827;
  font-weight:750;
}
.study-history-close{
  display:block;
  margin:14px auto 0;
  border:0;
  border-radius:12px;
  background:#111827;
  color:#fff;
  padding:8px 18px;
  font-size:12px;
  font-weight:850;
}
.study-history-empty{
  text-align:center;
  color:#6b7280;
  font-size:12px;
  padding:15px 5px;
}
@keyframes v47HistoryPop{
  from{opacity:0;transform:translateY(10px) scale(.97)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes v47SlowStudyWalk{
  0%,23%{left:24%;transform:translateY(0) scale(.32)}
  25%{left:40%;transform:translateY(-1px) scale(.32)}
  27%,48%{left:40%;transform:translateY(0) scale(.32)}
  50%{left:13%;transform:translateY(-1px) scale(.32)}
  52%,73%{left:13%;transform:translateY(0) scale(.32)}
  75%{left:57%;transform:translateY(-1px) scaleX(-.32) scaleY(.32)}
  77%,98%{left:57%;transform:translateY(0) scaleX(-.32) scaleY(.32)}
  100%{left:24%;transform:translateY(0) scale(.32)}
}


/* Smaller, quieter study-session area; animation stays intact. */
.study-session-zone{
  min-height:178px !important;
  margin:10px 0 5px !important;
  padding:7px 7px 5px !important;
  border-radius:18px !important;
}
.study-session-head{gap:3px !important}
.study-session-btn{
  padding:5px 10px !important;
  border-radius:10px !important;
  font-size:12px !important;
  box-shadow:0 3px 9px #00000012 !important;
}
.study-session-options{gap:4px !important;margin-top:3px !important}
.study-session-option{padding:4px 8px !important;font-size:10px !important}
.study-session-timer{font-size:20px !important;margin-top:2px !important}
.study-session-status{font-size:9px !important;min-height:11px !important;margin-top:0 !important}
.study-session-stage{
  left:0 !important;right:0 !important;bottom:0 !important;
  height:82px !important;
  border:0 !important;
  border-radius:14px !important;
  background:transparent !important;
}
.study-session-ground{bottom:7px !important;height:3px !important}
.study-library{
  left:4% !important;bottom:9px !important;
  transform:scale(.45) !important;
}
.study-chair{
  left:23% !important;bottom:9px !important;
  transform:scale(.45) !important;
}
.study-desk{
  right:4% !important;bottom:9px !important;
  transform:scale(.45) !important;
}
.study-lamp{
  right:22% !important;bottom:37px !important;
  transform:scale(.45) !important;
}
.study-bear{
  left:24% !important;bottom:9px !important;
  transform:scale(.32) !important;
  transform-origin:50% 100% !important;
}
.study-session-zone.done .study-bear{left:24% !important;transform:scale(.32) !important}
.bear-bravo{left:34% !important;bottom:52px !important;padding:3px 6px !important;font-size:9px !important}
.study-history-btn{
  margin:3px auto 0 !important;padding:4px 8px !important;font-size:9px !important;
}
/* Screen-Time-like history */
.study-history-card{width:min(410px,94vw) !important;max-height:82vh !important;padding:17px 14px 13px !important;border-radius:22px !important}
.study-history-title{font-size:19px !important}
.study-history-sub{font-size:10px !important;margin-bottom:11px !important}
.study-history-total{padding:10px 7px !important;margin-bottom:11px !important}
.study-history-total strong{font-size:25px !important}
.study-history-total span{font-size:10px !important}
.study-history-bars{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:6px;
  align-items:end;
  height:145px;
  padding:8px 3px 5px;
  background:#f8fafc;
  border-radius:17px;
}
.study-history-bar-col{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px;cursor:pointer}
.study-history-bar-value{font-size:8px;font-weight:800;color:#6b7280;min-height:10px}
.study-history-bar{
  width:100%;max-width:31px;min-height:5px;border-radius:7px 7px 3px 3px;
  background:#111827;transition:height .3s ease,transform .18s ease,opacity .18s ease;
}
.study-history-bar-col:active .study-history-bar{transform:scale(.94)}
.study-history-bar-col.selected .study-history-bar{opacity:.72;transform:scaleX(1.06)}
.study-history-bar-label{font-size:8px;font-weight:850;color:#6b7280}
.study-history-bar-label.today{color:#111827}
.study-history-detail{
  margin-top:9px;padding:10px 11px;background:#f4f6f8;border-radius:15px;
  animation:v49Detail .22s ease-out;
}
.study-history-detail-head{display:flex;justify-content:space-between;gap:8px;font-size:11px;font-weight:850;color:#111827}
.study-history-detail-sub{font-size:9px;color:#6b7280;margin-top:3px}
.study-history-sessions{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}
.study-history-pill{padding:4px 7px !important;font-size:9px !important}
.study-history-close{margin:11px auto 0 !important;padding:7px 16px !important;font-size:11px !important}
@keyframes v49Detail{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}


/* Put the lamp directly above the desk and the books inside the shelves. */
.study-lamp{
  right:8% !important;
  bottom:48px !important;
}
.library-book{
  bottom:auto !important;
}
.library-book.b1{top:13px !important}
.library-book.b2{top:9px !important}
.library-book.b3{top:17px !important}
.library-book.b4{top:11px !important}
.library-book.b5{top:15px !important}

/* Pause/Resume + Stop stay compact and aligned. */
.study-session-head{align-items:center !important}
.study-session-stop{
  border:0;
  border-radius:10px;
  background:#fee2e2;
  color:#991b1b;
  padding:5px 9px;
  font-size:11px;
  font-weight:850;
  cursor:pointer;
  box-shadow:0 3px 9px #00000010;
}
.study-session-stop:active{transform:scale(.97)}


/* One gentle trip every 5 minutes, then back over the next 5 minutes. */
.study-bear.active{
  animation:v50FiveMinuteWalk 600s ease-in-out infinite !important;
  transform-origin:50% 100% !important;
}
@keyframes v50FiveMinuteWalk{
  0%,46%{left:25%;transform:translateY(0) scale(.43)}
  50%{left:10%;transform:translateY(-1px) scale(.43)}
  54%,96%{left:10%;transform:translateY(0) scale(.43)}
  100%{left:25%;transform:translateY(0) scale(.43)}
}
@media(max-width:600px){
  .study-bear.active{
    animation:v50FiveMinuteWalkMobile 600s ease-in-out infinite !important;
  }
}
@keyframes v50FiveMinuteWalkMobile{
  0%,46%{left:25%;transform:translateY(0) scale(.40)}
  50%{left:10%;transform:translateY(-1px) scale(.40)}
  54%,96%{left:10%;transform:translateY(0) scale(.40)}
  100%{left:25%;transform:translateY(0) scale(.40)}
}


.history-stat{position:relative !important;}
.history-stat .study-history-btn{
  position:absolute !important;
  top:16px !important;
  right:18px !important;
  margin:0 !important;
  padding:9px 14px !important;
  font-size:12px !important;
  line-height:1.1 !important;
  box-shadow:0 2px 8px #0000000b !important;
}
.study-history-breakdown{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:8px;
}
.study-history-count{
  background:#e9edf2;
  border-radius:999px;
  padding:6px 10px;
  font-size:11px;
  font-weight:800;
  color:#111827;
}
@media(max-width:420px){
  .history-stat .study-history-btn{padding:8px 11px !important;font-size:11px !important;right:14px !important;top:15px !important;}
}


#authGate{position:fixed;inset:0;z-index:99999;background:rgba(15,23,42,.72);backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;padding:18px}
#authGate.hidden{display:none}
body.auth-required{min-height:100vh;overflow:hidden;background:linear-gradient(145deg,#dce9ff,#f1f5ff 55%,#e8eaff)}
body.auth-required>:not(#authGate):not(script):not(style):not(#welcome):not(dialog):not(#reviewNotices):not(#previewRibbon){display:none!important}
body.auth-required #authGate{z-index:2147483647;background:radial-gradient(90% 70% at 50% 0%,#b9d4ff 0,transparent 72%),linear-gradient(145deg,#dce9ff,#f1f5ff 55%,#e8eaff);backdrop-filter:none;-webkit-backdrop-filter:none}
.auth-card{width:min(420px,100%);background:#fff;border-radius:24px;padding:24px;box-shadow:0 20px 80px #0004;color:#172033}
.auth-card h2{margin:0 0 8px;font-size:25px}.auth-card p{margin:0 0 18px;color:#64748b;font-size:13px;line-height:1.5}
.auth-card input{width:100%;box-sizing:border-box;margin:7px 0;padding:13px 14px;border:1px solid #d8e0ec;border-radius:12px;font-size:16px}
.auth-card button{width:100%;border:0;border-radius:12px;padding:13px;margin-top:9px;font-weight:800;cursor:pointer}
.auth-primary{background:#2563eb;color:white}.auth-secondary{background:#eef2ff;color:#1d4ed8} .auth-link{background:transparent!important;color:#2563eb!important;padding:8px!important}
#profileModal{position:fixed;inset:0;z-index:99998;background:rgba(15,23,42,.72);backdrop-filter:blur(8px);display:none;align-items:center;justify-content:center;padding:18px}
#profileModal.open{display:flex}
.profile-card{width:min(430px,100%);background:#fff;border-radius:24px;padding:24px;box-shadow:0 20px 80px #0004;color:#172033}
.profile-card h2{margin:0 0 18px;font-size:25px}.profile-row{padding:12px 0;border-bottom:1px solid #e5e7eb}.profile-row:last-of-type{border-bottom:0}.profile-label{font-size:12px;color:#64748b;margin-bottom:4px}.profile-value{font-size:16px;font-weight:700;overflow-wrap:anywhere}.profile-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:18px}.profile-actions button{flex:1;min-width:130px;border:0;border-radius:12px;padding:12px;font-weight:800;cursor:pointer}.profile-primary{background:#e0e7ff;color:#3730a3}.profile-secondary{background:#eef2f7;color:#334155}
#authError{min-height:18px;color:#dc2626;font-size:12px;margin-top:8px;white-space:pre-wrap}
#authUserBar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:#334155}
#authLogoutBtn{border:0;border-radius:9px;padding:7px 10px;background:#fee2e2;color:#991b1b;font-weight:800;cursor:pointer}

:root{--lg-ink:#172033;--lg-glass:rgba(255,255,255,.54);--lg-shadow:0 18px 55px rgba(58,74,104,.13),inset 0 1px 0 rgba(255,255,255,.82)}
html{background:#edf3fb!important}body{background:radial-gradient(600px 380px at 8% -5%,rgba(126,190,255,.34),transparent 65%),radial-gradient(520px 360px at 94% 8%,rgba(193,163,255,.27),transparent 64%),radial-gradient(650px 420px at 50% 100%,rgba(115,224,201,.18),transparent 68%),linear-gradient(145deg,#eef4fb,#f7faff 48%,#edf3fb)!important;color:var(--lg-ink)!important}body:before{content:"";position:fixed;inset:-20%;z-index:-1;pointer-events:none;background:radial-gradient(circle at 20% 30%,rgba(255,255,255,.7),transparent 24%),radial-gradient(circle at 80% 65%,rgba(255,255,255,.48),transparent 22%);filter:blur(35px)}
header{position:sticky!important;top:10px!important;margin:10px 12px 0!important;padding:17px 20px!important;border:1px solid rgba(255,255,255,.72)!important;border-radius:25px!important;background:rgba(18,28,49,.74)!important;backdrop-filter:blur(24px) saturate(150%)!important;-webkit-backdrop-filter:blur(24px) saturate(150%)!important;box-shadow:0 18px 45px rgba(25,38,64,.20),inset 0 1px 0 rgba(255,255,255,.14)!important}header h1{font-size:22px!important;letter-spacing:-.3px}.header-right{gap:9px!important}.ai-head-btn,.streak-btn,#dueBadge{border:1px solid rgba(255,255,255,.28)!important;background:rgba(255,255,255,.12)!important;color:#fff!important;backdrop-filter:blur(12px)!important;-webkit-backdrop-filter:blur(12px)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.14)!important}#dueBadge{padding:7px 11px;border-radius:999px;font-weight:800}
.wrap{max-width:1120px!important;padding:22px 18px 34px!important}nav{padding:6px!important;margin:0 0 18px!important;gap:8px!important;border:1px solid rgba(255,255,255,.68);border-radius:22px;background:rgba(255,255,255,.40);backdrop-filter:blur(18px) saturate(135%);-webkit-backdrop-filter:blur(18px) saturate(135%);box-shadow:var(--lg-shadow)}.tab{background:rgba(255,255,255,.44)!important;color:#334155!important;border:1px solid rgba(255,255,255,.52)!important;border-radius:16px!important;padding:11px 16px!important;transition:.18s ease!important}.tab:hover{transform:translateY(-1px);background:rgba(255,255,255,.68)!important}.tab.active{background:rgba(24,34,54,.90)!important;color:#fff!important;border-color:rgba(255,255,255,.18)!important;box-shadow:0 8px 22px rgba(24,34,54,.18)!important}
#cloudSyncBar{margin:10px 12px!important;border:1px solid rgba(255,255,255,.75)!important;border-radius:20px!important;background:rgba(255,255,255,.48)!important;backdrop-filter:blur(20px) saturate(145%)!important;-webkit-backdrop-filter:blur(20px) saturate(145%)!important;box-shadow:var(--lg-shadow)!important;color:#42516a!important}#authUserBar button{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.card,.stat,.folder,.drop-root,.deck-tile,.swipe-card,.streak-modal,.profile-card,.auth-card{background:var(--lg-glass)!important;border:1px solid rgba(255,255,255,.70)!important;box-shadow:var(--lg-shadow)!important;backdrop-filter:blur(22px) saturate(140%)!important;-webkit-backdrop-filter:blur(22px) saturate(140%)!important}.stat{border-radius:22px!important;min-height:120px;position:relative;overflow:hidden}.stat:after{content:"";position:absolute;right:-40px;top:-50px;width:130px;height:130px;border-radius:50%;background:rgba(255,255,255,.30);filter:blur(2px);pointer-events:none}.stat b{font-size:32px!important;letter-spacing:-1px}
.btn{background:rgba(28,43,67,.88)!important;color:#fff!important;border:1px solid rgba(255,255,255,.20)!important;border-radius:14px!important;box-shadow:0 8px 22px rgba(30,45,70,.14),inset 0 1px 0 rgba(255,255,255,.16)!important;transition:transform .16s ease,box-shadow .16s ease,background .16s ease!important}.btn:hover{transform:translateY(-1px);box-shadow:0 11px 26px rgba(30,45,70,.18),inset 0 1px 0 rgba(255,255,255,.18)!important}.btn.alt{background:rgba(255,255,255,.60)!important;color:#23324a!important;border-color:rgba(255,255,255,.72)!important}.btn.good{background:rgba(21,128,61,.88)!important}.btn.warn{background:rgba(146,64,14,.88)!important}.btn.bad,.btn.danger{background:rgba(185,28,28,.88)!important;color:#fff!important}
input,textarea,select{background:rgba(255,255,255,.58)!important;color:var(--lg-ink)!important;border:1px solid rgba(255,255,255,.82)!important;border-radius:15px!important;box-shadow:inset 0 1px 2px rgba(40,60,90,.05),0 5px 16px rgba(60,80,110,.05)!important;outline:none!important}input:focus,textarea:focus,select:focus{border-color:rgba(25,118,255,.45)!important;box-shadow:0 0 0 4px rgba(25,118,255,.10),inset 0 1px 2px rgba(40,60,90,.05)!important}.question{letter-spacing:-.45px}.answer{letter-spacing:-.2px}.study-card{border-radius:28px!important;background:rgba(255,255,255,.62)!important;box-shadow:0 24px 70px rgba(56,72,104,.14),inset 0 1px 0 rgba(255,255,255,.88)!important;border:1px solid rgba(255,255,255,.80)!important;backdrop-filter:blur(26px) saturate(145%)!important;-webkit-backdrop-filter:blur(26px) saturate(145%)!important}.study-source{color:#8491a8!important}.rating .btn{min-height:48px}.schedule-note{background:rgba(224,231,255,.55)!important;border:1px solid rgba(255,255,255,.68)!important;color:#3d4a86!important;backdrop-filter:blur(12px)!important}.badge,.tag,.next-review{background:rgba(255,255,255,.56)!important;border:1px solid rgba(255,255,255,.65)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.6)}
.folder{border-style:solid!important}.folder.drop-active,.drop-root.drop-active{background:rgba(219,234,254,.58)!important;border-color:rgba(25,118,255,.45)!important}.deck-tile{background:rgba(255,255,255,.48)!important}.swipe-card{background:rgba(255,255,255,.58)!important}.deck-tile:hover{transform:translateY(-1px);box-shadow:0 14px 35px rgba(55,70,100,.11),inset 0 1px 0 rgba(255,255,255,.82)!important}
.study-session-zone{background:rgba(255,255,255,.44)!important;border:1px solid rgba(255,255,255,.72)!important;box-shadow:var(--lg-shadow)!important;backdrop-filter:blur(22px) saturate(140%)!important;-webkit-backdrop-filter:blur(22px) saturate(140%)!important}.study-session-stage{background:rgba(238,244,250,.58)!important;border-color:rgba(255,255,255,.78)!important;backdrop-filter:blur(8px)!important}.study-session-btn,.study-session-option,.study-history-btn,.study-session-stop{border:1px solid rgba(255,255,255,.35)!important;box-shadow:0 8px 20px rgba(45,60,85,.12),inset 0 1px 0 rgba(255,255,255,.20)!important}.study-session-option{background:rgba(255,255,255,.60)!important;color:#25344d!important}
.streak-panel,#aiModal{background:rgba(15,23,42,.38)!important;backdrop-filter:blur(18px) saturate(130%)!important;-webkit-backdrop-filter:blur(18px) saturate(130%)!important}.streak-modal,.ai-window{border:1px solid rgba(255,255,255,.72)!important;background:rgba(255,255,255,.70)!important;backdrop-filter:blur(28px) saturate(150%)!important;-webkit-backdrop-filter:blur(28px) saturate(150%)!important;box-shadow:0 30px 90px rgba(25,35,55,.25),inset 0 1px 0 rgba(255,255,255,.9)!important}.auth-card,.profile-card{background:rgba(255,255,255,.72)!important;backdrop-filter:blur(28px) saturate(150%)!important;-webkit-backdrop-filter:blur(28px) saturate(150%)!important}#authGate{background:rgba(20,30,50,.44)!important;backdrop-filter:blur(18px)!important;-webkit-backdrop-filter:blur(18px)!important}.image-wrap .card-image{box-shadow:0 14px 35px rgba(30,45,70,.13)!important}
@media(max-width:600px){header{margin:7px 8px 0!important;border-radius:21px!important;padding:14px 15px!important}header h1{font-size:19px!important}.wrap{padding:16px 12px 28px!important}#cloudSyncBar{margin:8px!important;border-radius:18px!important}nav{border-radius:18px!important;padding:5px!important}.tab{padding:10px 13px!important;border-radius:14px!important}.study-card{border-radius:24px!important}.stat{min-height:108px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}}


/* V17 — iPhone auth zoom + dark header text refinement */
html{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important}
@media(max-width:700px){
  .auth-card input{font-size:16px!important}
}
header h1,.brand-subtitle{color:#172033!important}
.ai-head-btn,.streak-btn,#dueBadge{color:#172033!important}

/* Liquid Glass v5 refinement — visual only */
:root{
  --lg-blue:#4f8df7;
  --lg-blue-soft:rgba(79,141,247,.16);
  --lg-white:rgba(255,255,255,.52);
  --lg-border:rgba(255,255,255,.76);
}
body{
  min-height:100vh;
  overflow-x:hidden;
}
body:after{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;
  background:
    radial-gradient(380px 260px at 12% 18%,rgba(95,164,255,.16),transparent 72%),
    radial-gradient(420px 300px at 90% 30%,rgba(177,135,255,.14),transparent 72%),
    radial-gradient(440px 320px at 55% 88%,rgba(80,220,190,.10),transparent 72%);
}
header{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:16px!important;
  background:linear-gradient(135deg,rgba(255,255,255,.58),rgba(255,255,255,.34))!important;
  color:#172033!important;
  border:1px solid rgba(255,255,255,.86)!important;
  box-shadow:0 22px 65px rgba(65,85,120,.16),inset 0 1px 0 rgba(255,255,255,.94),inset 0 -1px 0 rgba(255,255,255,.34)!important;
  backdrop-filter:blur(30px) saturate(155%)!important;
  -webkit-backdrop-filter:blur(30px) saturate(155%)!important;
}
header h1{color:#172033!important;text-shadow:0 1px 0 rgba(255,255,255,.65)!important;font-weight:850!important}
.header-right{display:flex!important;align-items:center!important;gap:8px!important}
.ai-head-btn,.streak-btn,#dueBadge{
  min-height:46px!important;box-sizing:border-box!important;
  border:1px solid rgba(255,255,255,.82)!important;
  background:linear-gradient(145deg,rgba(255,255,255,.60),rgba(255,255,255,.27))!important;
  color:#21314d!important;
  border-radius:17px!important;
  box-shadow:0 8px 25px rgba(55,80,120,.10),inset 0 1px 0 rgba(255,255,255,.9)!important;
  backdrop-filter:blur(18px) saturate(150%)!important;
  -webkit-backdrop-filter:blur(18px) saturate(150%)!important;
}
.ai-head-btn{padding:8px 13px!important;font-size:14px!important}
.streak-btn{padding:6px 11px!important;min-width:70px!important;font-size:17px!important}
#dueBadge{display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:7px 12px!important;font-weight:850!important;font-size:14px!important}
.ai-head-btn:hover,.streak-btn:hover,#dueBadge:hover{transform:translateY(-1px);box-shadow:0 12px 28px rgba(55,80,120,.14),inset 0 1px 0 rgba(255,255,255,.95)!important}
#cloudSyncBar{
  background:linear-gradient(135deg,rgba(255,255,255,.54),rgba(223,237,255,.34))!important;
  border:1px solid rgba(255,255,255,.84)!important;
  box-shadow:0 18px 48px rgba(65,85,120,.12),inset 0 1px 0 rgba(255,255,255,.9)!important;
  backdrop-filter:blur(25px) saturate(155%)!important;
  -webkit-backdrop-filter:blur(25px) saturate(155%)!important;
}
#authUserBar button[onclick="cloudSync(true)"]{
  background:linear-gradient(135deg,rgba(66,135,255,.40),rgba(80,145,255,.20))!important;
  color:#1550b5!important;
  border:1px solid rgba(255,255,255,.72)!important;
  box-shadow:0 8px 24px rgba(66,135,255,.12),inset 0 1px 0 rgba(255,255,255,.72)!important;
  backdrop-filter:blur(16px) saturate(155%)!important;
  -webkit-backdrop-filter:blur(16px) saturate(155%)!important;
}
#authUserBar button[onclick="cloudSync(true)"]:hover{background:linear-gradient(135deg,rgba(66,135,255,.52),rgba(80,145,255,.27))!important;transform:translateY(-1px)}
nav{background:linear-gradient(135deg,rgba(255,255,255,.48),rgba(255,255,255,.27))!important;box-shadow:0 18px 48px rgba(65,85,120,.11),inset 0 1px 0 rgba(255,255,255,.88)!important}
.tab{box-shadow:inset 0 1px 0 rgba(255,255,255,.72),0 5px 16px rgba(65,85,120,.05)!important}
.card,.stat,.folder,.drop-root,.deck-tile,.swipe-card,.study-session-zone,.profile-card,.auth-card,.study-card{
  box-shadow:0 20px 60px rgba(65,85,120,.12),inset 0 1px 0 rgba(255,255,255,.9)!important;
}
input,textarea,select{background:rgba(255,255,255,.48)!important;backdrop-filter:blur(14px)!important;-webkit-backdrop-filter:blur(14px)!important}
.btn.alt,.icon-btn,.streak-close,.ai-chips button,.study-session-option,.study-history-btn{
  background:rgba(255,255,255,.48)!important;
  border:1px solid rgba(255,255,255,.76)!important;
  backdrop-filter:blur(16px)!important;-webkit-backdrop-filter:blur(16px)!important;
  box-shadow:0 8px 24px rgba(65,85,120,.08),inset 0 1px 0 rgba(255,255,255,.88)!important;
}
@media(max-width:700px){
  header{gap:9px!important}
  header h1{font-size:19px!important}
  .header-right{gap:5px!important}
  .ai-head-btn{min-height:42px!important;padding:7px 9px!important;border-radius:15px!important}
  .streak-btn{min-width:56px!important;min-height:42px!important;padding:5px 8px!important;border-radius:15px!important}
  #dueBadge{min-height:42px!important;padding:6px 9px!important;border-radius:15px!important;font-size:13px!important}
  #cloudSyncBar{margin:8px!important;padding:11px 12px!important}
}


:root{--lg-ink:#12213d;--lg-blue:#3b82f6;--lg-glass:rgba(255,255,255,.47);--lg-line:rgba(255,255,255,.74);--lg-shadow:0 18px 55px rgba(47,67,104,.14),inset 0 1px 0 rgba(255,255,255,.88)}
html{background:#dbe7ff}
body{color:var(--lg-ink)!important;background:radial-gradient(90% 45% at 50% 0%,rgba(94,154,255,.58),transparent 66%),radial-gradient(70% 40% at 0% 55%,rgba(169,135,255,.24),transparent 70%),radial-gradient(70% 40% at 100% 75%,rgba(95,229,198,.20),transparent 70%),linear-gradient(180deg,#dbe8ff 0%,#eef4ff 48%,#e8e7ff 100%)!important;background-attachment:fixed!important}
body:before{content:"";position:fixed;inset:0;pointer-events:none;background:linear-gradient(120deg,rgba(255,255,255,.16),transparent 38%,rgba(255,255,255,.12) 65%,transparent);z-index:-1}
header{position:relative!important;top:auto!important;margin:22px 18px 10px!important;padding:18px 18px!important;border:1px solid rgba(255,255,255,.78)!important;border-radius:27px!important;background:linear-gradient(135deg,rgba(255,255,255,.48),rgba(207,225,255,.34))!important;backdrop-filter:blur(28px) saturate(165%)!important;-webkit-backdrop-filter:blur(28px) saturate(165%)!important;box-shadow:0 22px 55px rgba(62,89,145,.18),inset 0 1px 0 rgba(255,255,255,.95)!important;color:#fff!important}
.brand-wrap{min-width:0}.brand-subtitle{font-size:12px;color:rgba(255,255,255,.82);margin-top:2px;font-weight:600}.header-right{gap:7px!important}.ai-head-btn,.streak-btn,#dueBadge{min-height:58px!important;min-width:60px!important;border:1px solid rgba(255,255,255,.48)!important;background:rgba(255,255,255,.18)!important;color:#fff!important;border-radius:18px!important;backdrop-filter:blur(16px) saturate(150%)!important;-webkit-backdrop-filter:blur(16px) saturate(150%)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.42),0 8px 22px rgba(49,75,120,.10)!important}.ai-head-btn{font-size:14px!important;padding:8px 11px!important}.streak-btn{font-size:17px!important;flex-direction:column!important;gap:0!important;padding:5px 8px!important}.streak-btn #streakCount{font-size:16px}.streak-btn:after{content:'Streak';font-size:10px;font-weight:700;opacity:.9}#dueBadge{display:flex!important;flex-direction:column!important;justify-content:center!important;gap:1px!important;font-size:16px!important;padding:5px 9px!important}#dueBadge:after{content:none!important;display:none!important}
.wrap{max-width:1120px!important;padding:12px 18px 110px!important}nav:not(.glass-dock){padding:7px!important;margin:0 0 18px!important;gap:8px!important;border:1px solid rgba(255,255,255,.74)!important;border-radius:23px!important;background:rgba(255,255,255,.34)!important;backdrop-filter:blur(20px) saturate(145%)!important;-webkit-backdrop-filter:blur(20px) saturate(145%)!important;box-shadow:var(--lg-shadow)!important}.tab{background:rgba(255,255,255,.48)!important;color:#203353!important;border:1px solid rgba(255,255,255,.62)!important;border-radius:17px!important;padding:12px 15px!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)!important}.tab.active{background:rgba(28,48,83,.88)!important;color:#fff!important;border-color:rgba(255,255,255,.2)!important;box-shadow:0 10px 24px rgba(27,49,85,.18)!important}
#cloudSyncBar{margin:10px 0 18px!important;padding:15px 16px!important;border:1px solid rgba(255,255,255,.78)!important;border-radius:23px!important;background:linear-gradient(135deg,rgba(255,255,255,.52),rgba(224,235,255,.36))!important;backdrop-filter:blur(24px) saturate(155%)!important;-webkit-backdrop-filter:blur(24px) saturate(155%)!important;box-shadow:var(--lg-shadow)!important;color:#243c66!important}#cloudSyncStatus{display:flex!important;align-items:center!important;gap:10px!important}.cloud-symbol{font-size:27px;filter:drop-shadow(0 4px 8px rgba(54,120,255,.20))}.cloud-copy{display:flex;flex-direction:column;gap:2px}.cloud-copy b{font-size:16px}.cloud-copy small{font-size:11px;opacity:.75}#authUserBar button[onclick="cloudSync(true)"]{border:1px solid rgba(255,255,255,.55)!important;background:rgba(76,141,255,.27)!important;color:#174a9d!important;border-radius:17px!important;padding:10px 17px!important;backdrop-filter:blur(15px)!important;-webkit-backdrop-filter:blur(15px)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.62),0 8px 22px rgba(60,117,214,.13)!important}
.home-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px!important}.home-stats .stat{min-height:165px!important;padding:18px!important;border-radius:26px!important;position:relative!important;overflow:hidden!important;background:rgba(255,255,255,.48)!important;border:1px solid rgba(255,255,255,.78)!important;box-shadow:0 18px 45px rgba(67,89,126,.13),inset 0 1px 0 rgba(255,255,255,.88)!important;backdrop-filter:blur(23px) saturate(150%)!important;-webkit-backdrop-filter:blur(23px) saturate(150%)!important}.home-stats .stat:after{content:"";position:absolute;width:160px;height:95px;right:-24px;bottom:-32px;border-radius:55% 0 26px 0;transform:rotate(-8deg);background:rgba(96,159,255,.20);filter:blur(1px);pointer-events:none}.home-stats .stat-studied:after{background:rgba(95,222,176,.22)}.home-stats .stat-total:after{background:rgba(157,104,255,.22)}.home-stats .stat-mastered:after{background:rgba(255,188,91,.24)}.stat-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.stat-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:15px;background:rgba(255,255,255,.42);border:1px solid rgba(255,255,255,.72);box-shadow:inset 0 1px 0 rgba(255,255,255,.85);font-size:23px}.stat-arrow{width:35px;height:35px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.27);border:1px solid rgba(255,255,255,.66);font-size:25px;line-height:1}.home-stats .stat-label{display:block;font-size:15px;font-weight:750;color:#27416d;margin-bottom:2px}.home-stats .stat b{display:block;font-size:35px!important;line-height:1.05!important;color:#08162f!important;margin:3px 0!important}.home-stats .stat small{display:block;font-size:11px;color:#4c6284}.home-stats .study-history-btn{position:absolute;right:14px;top:61px;border:0!important;background:rgba(255,255,255,.38)!important;border:1px solid rgba(255,255,255,.55)!important;border-radius:14px!important;padding:8px 10px!important;color:#31415f!important;backdrop-filter:blur(10px)!important}
.card,.stat,.folder,.drop-root,.deck-tile,.swipe-card,.streak-modal,.profile-card,.auth-card,.study-session-zone{background:rgba(255,255,255,.46)!important;border:1px solid rgba(255,255,255,.76)!important;box-shadow:var(--lg-shadow)!important;backdrop-filter:blur(23px) saturate(145%)!important;-webkit-backdrop-filter:blur(23px) saturate(145%)!important;border-radius:24px!important}.btn{border:1px solid rgba(255,255,255,.52)!important;background:rgba(255,255,255,.47)!important;color:#203353!important;border-radius:16px!important;box-shadow:0 8px 20px rgba(49,70,108,.10),inset 0 1px 0 rgba(255,255,255,.72)!important;backdrop-filter:blur(12px)!important;-webkit-backdrop-filter:blur(12px)!important}.btn.good{background:rgba(44,180,102,.78)!important;color:#fff!important}.btn.bad{background:rgba(221,68,68,.78)!important;color:#fff!important}.btn.warn{background:rgba(214,116,31,.78)!important;color:#fff!important}
input,textarea,select{background:rgba(255,255,255,.50)!important;border:1px solid rgba(255,255,255,.82)!important;border-radius:16px!important;backdrop-filter:blur(14px)!important;-webkit-backdrop-filter:blur(14px)!important;box-shadow:inset 0 1px 2px rgba(40,60,90,.05),0 7px 20px rgba(60,80,110,.05)!important;color:#142542!important}
.study-session-zone{min-height:335px!important;margin:20px 0 12px!important;padding:18px!important;background:rgba(255,255,255,.44)!important}.study-session-head{justify-content:flex-start!important;text-align:left!important}.study-session-btn{background:rgba(25,42,72,.90)!important;border:1px solid rgba(255,255,255,.24)!important;border-radius:18px!important;box-shadow:0 10px 26px rgba(34,51,82,.18)!important}.study-session-zone .study-history-btn{background:rgba(255,255,255,.42)!important;border:1px solid rgba(255,255,255,.64)!important;border-radius:999px!important;color:#32496e!important}.study-session-status{text-align:left!important;margin-left:4px}.study-session-stage{background:rgba(236,244,255,.43)!important;border:1px solid rgba(255,255,255,.72)!important;backdrop-filter:blur(10px)!important;-webkit-backdrop-filter:blur(10px)!important}
.glass-dock{position:fixed;left:14px;right:14px;bottom:12px;z-index:1500;display:flex!important;align-items:center;justify-content:space-around;gap:4px;padding:8px 7px!important;border:1px solid rgba(255,255,255,.78)!important;border-radius:27px!important;background:rgba(255,255,255,.40)!important;backdrop-filter:blur(28px) saturate(160%)!important;-webkit-backdrop-filter:blur(28px) saturate(160%)!important;box-shadow:0 20px 55px rgba(47,66,108,.20),inset 0 1px 0 rgba(255,255,255,.92)!important}.dock-btn{flex:1;border:0!important;background:transparent!important;color:#fff!important;border-radius:21px!important;padding:8px 5px 7px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;font-weight:800!important;box-shadow:none!important}.dock-btn span{font-size:22px;line-height:1}.dock-btn small{font-size:10px;font-weight:750}.dock-btn.active{background:rgba(86,146,255,.48)!important;border:1px solid rgba(255,255,255,.38)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 8px 22px rgba(61,114,214,.13)!important}.glass-dock + *{}
@media(max-width:700px){header{margin:18px 14px 10px!important;padding:15px 13px!important}.brand-subtitle{font-size:10px}.ai-head-btn,.streak-btn,#dueBadge{min-height:54px!important;min-width:52px!important}.wrap{padding-left:14px!important;padding-right:14px!important;padding-bottom:105px!important}.home-stats{gap:14px!important}.home-stats .stat{min-height:158px!important;padding:15px!important}.home-stats .stat b{font-size:32px!important}.home-stats .stat-icon{width:39px;height:39px;font-size:21px}.home-stats .stat-arrow{width:31px;height:31px;font-size:22px}.cloud-copy small{font-size:10px}.cloud-copy b{font-size:15px}.glass-dock{left:10px;right:10px;bottom:9px}.dock-btn span{font-size:20px}}
@media(max-width:430px){header h1{font-size:20px!important}.header-right{gap:4px!important}.ai-head-btn,.streak-btn,#dueBadge{min-width:48px!important;min-height:51px!important;padding-left:5px!important;padding-right:5px!important}.home-stats{gap:12px!important}.home-stats .stat{min-height:148px!important;border-radius:23px!important}.home-stats .stat-label{font-size:14px}.home-stats .stat small{font-size:10px}.study-session-zone{min-height:300px!important}.glass-dock{border-radius:24px!important}}


/* V7: alignment, navigation state, readability, and Study Session placement. */
#cloudSyncBar{
  box-sizing:border-box!important;
  width:min(1084px,calc(100% - 36px))!important;
  max-width:1084px!important;
  margin:10px auto 18px!important;
}
#cloudSyncBar,#cloudSyncBar *{color:#17315b;}
#cloudSyncBar .cloud-copy b{color:#17315b!important;font-weight:850!important;}
#cloudSyncBar .cloud-copy small{color:#466487!important;opacity:1!important;}
#cloudSyncBar #authUserLabel{color:#35557e!important;}
#cloudSyncBar #authLogoutBtn{color:#8b2d36!important;}
#authUserBar button[onclick="cloudSync(true)"]{
  color:#164fa3!important;
  background:rgba(69,139,255,.24)!important;
}
/* Stronger text contrast across the dashboard without removing the glass. */
.home-stats .stat-label{color:#18355f!important;font-weight:850!important;text-shadow:0 1px 1px rgba(255,255,255,.55);}
.home-stats .stat small{color:#405b80!important;font-weight:650!important;}
.home-stats .stat b{color:#07162f!important;font-weight:900!important;}
.card h2,.card p.muted,.study-session-status,.study-session-head,.study-history-btn{
  color:#17315b!important;
}
#home>.card h2{color:#112b50!important;}
#home>.card p.muted{color:#4b6383!important;}
/* Main nav and bottom dock: the selected destination always follows the user. */
nav:not(.glass-dock) .tab{color:#18345c!important;font-weight:850!important;}
nav:not(.glass-dock) .tab.active{color:#fff!important;}
.glass-dock{
  transition:transform .22s ease,opacity .22s ease,box-shadow .22s ease!important;
}
.dock-btn{color:#355277!important;}
.dock-btn.active{color:#123c80!important;background:rgba(92,151,255,.48)!important;}
.dock-btn.active small,.dock-btn.active span{color:#123c80!important;}
/* Keep the dock out of the way of content while retaining its fixed iOS-style behavior. */
body{padding-bottom:4px;}
/* Study Session belongs to Study, not Dashboard. */
#study .study-session-zone{margin:0 0 18px!important;}
#study .study-session-zone + .row{margin-top:4px;}
@media(max-width:700px){
  #cloudSyncBar{width:calc(100% - 28px)!important;margin:8px 14px 18px!important;}
  .home-stats .stat-label{font-size:15px!important;}
  .home-stats .stat small{font-size:11px!important;}
  .card h2{font-weight:900!important;}
}


/* V8: alignment, contrast and More menu. Visual/UI only. */\n#cloudSyncBar{\n  box-sizing:border-box!important;\n  width:calc(100% - 36px)!important;\n  max-width:1084px!important;\n  margin:10px auto 18px!important;\n  min-height:74px!important;\n  padding:14px 16px!important;\n}\n#cloudSyncBar #authUserBar{flex:0 0 auto!important;}\n#cloudSyncBar #authUserBar button[onclick="cloudSync(true)"]{\n  min-height:44px!important;\n  padding:10px 18px!important;\n  border-radius:18px!important;\n  border:1px solid rgba(255,255,255,.72)!important;\n  background:linear-gradient(135deg,rgba(82,145,255,.52),rgba(55,112,230,.34))!important;\n  color:#123f88!important;\n  box-shadow:inset 0 1px 0 rgba(255,255,255,.75),0 8px 24px rgba(55,112,230,.14)!important;\n}\n.home-stats .stat{\n  background:linear-gradient(145deg,rgba(255,255,255,.76),rgba(245,249,255,.62))!important;\n  border:1px solid rgba(255,255,255,.90)!important;\n  box-shadow:0 18px 45px rgba(50,75,115,.13),inset 0 1px 0 rgba(255,255,255,.92)!important;\n}\n.home-stats .stat-label{color:#102e58!important;font-weight:900!important;text-shadow:0 1px 0 rgba(255,255,255,.8)!important;}\n.home-stats .stat b{color:#061a36!important;font-weight:950!important;text-shadow:0 1px 1px rgba(255,255,255,.8)!important;}\n.home-stats .stat small{color:#35577f!important;font-weight:750!important;opacity:1!important;}\n.home-stats .stat-icon,.home-stats .stat-arrow{color:#173e70!important;}\n.home-stats .history-stat .study-history-btn{color:#214b77!important;background:rgba(255,255,255,.62)!important;border:1px solid rgba(255,255,255,.72)!important;}\n#home>.card{background:linear-gradient(145deg,rgba(255,255,255,.72),rgba(241,247,255,.55))!important;border-color:rgba(255,255,255,.88)!important;}\n#home>.card h2{color:#102d56!important;font-weight:950!important;}\n#home>.card p.muted{color:#456486!important;font-weight:650!important;}\n.more-menu{\n  position:fixed;\n  z-index:10000;\n  right:18px;\n  bottom:92px;\n  width:min(285px,calc(100vw - 36px));\n  padding:10px;\n  border:1px solid rgba(255,255,255,.86);\n  border-radius:24px;\n  background:linear-gradient(145deg,rgba(255,255,255,.76),rgba(235,243,255,.58));\n  backdrop-filter:blur(28px) saturate(160%);\n  -webkit-backdrop-filter:blur(28px) saturate(160%);\n  box-shadow:0 22px 60px rgba(30,55,95,.22),inset 0 1px 0 rgba(255,255,255,.92);\n  opacity:0;pointer-events:none;transform:translateY(12px) scale(.97);\n  transition:opacity .18s ease,transform .18s ease;\n}\n.more-menu.open{opacity:1;pointer-events:auto;transform:none;}\n.more-menu button{\n  width:100%;display:grid;grid-template-columns:34px 1fr 20px;align-items:center;gap:8px;\n  border:1px solid rgba(255,255,255,.72);border-radius:17px;padding:13px 14px;margin:5px 0;\n  background:rgba(255,255,255,.54);color:#17345d;cursor:pointer;text-align:left;\n  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);\n}\n.more-menu button span{font-size:21px;text-align:center}.more-menu button b{font-size:14px;font-weight:900}.more-menu button i{font-style:normal;font-size:24px;text-align:right;color:#35618f;}\n.more-menu button:active{transform:scale(.985);}\n.glass-dock .more-btn.active{background:rgba(92,151,255,.50)!important;color:#123c80!important;}\n@media(max-width:600px){\n  #cloudSyncBar{width:calc(100% - 24px)!important;margin:8px 12px 18px!important;border-radius:22px!important;}\n  #cloudSyncBar #cloudSyncStatus{min-width:0;flex:1 1 auto;}\n  #cloudSyncBar #authUserBar{flex:0 0 auto;}\n  #cloudSyncBar #authUserBar button[onclick="cloudSync(true)"]{padding:10px 15px!important;}\n  .more-menu{right:14px;bottom:88px;width:min(290px,calc(100vw - 28px));}\n}


/* Final preview: keep More actions hidden until the More button is tapped. */
#moreMenu{display:none!important;}
#moreMenu.open{display:block!important;}
.more-menu{position:fixed!important;right:14px!important;bottom:92px!important;z-index:50000!important;width:min(300px,calc(100vw - 28px))!important;}
.more-menu button{display:grid!important;visibility:visible!important;opacity:1!important;}
/* Keep the cloud-sync card exactly aligned with the main content width. */
#cloudSyncBar{box-sizing:border-box!important;width:calc(100% - 28px)!important;max-width:1120px!important;margin:8px auto 18px!important;}
/* Dashboard readability. */
.home-stats .stat-label{color:#102e58!important;font-weight:900!important;}
.home-stats .stat b{color:#061a36!important;font-weight:950!important;}
.home-stats .stat small{color:#35577f!important;font-weight:800!important;}
/* Remove accidental literal escape text if any old preview fragment remains. */
body{overflow-x:hidden;}
@media(max-width:600px){#cloudSyncBar{width:calc(100% - 28px)!important;margin:8px 14px 18px!important;}.more-menu{right:14px!important;bottom:92px!important;}}


.home-stats .stat-study-session{cursor:pointer;background:linear-gradient(145deg,rgba(220,236,255,.76),rgba(242,247,255,.58))!important;}
.home-stats .stat-study-session:hover{transform:translateY(-2px);}
.home-stats .stat-study-session b{font-size:31px!important;color:#174a9d!important;}
.study-session-bubble{position:fixed;inset:0;z-index:30000;display:flex;align-items:center;justify-content:center;padding:18px;}
.study-session-bubble.hidden{display:none!important;}
.study-session-bubble-backdrop{position:absolute;inset:0;background:rgba(30,45,75,.20);backdrop-filter:blur(8px) saturate(120%);-webkit-backdrop-filter:blur(8px) saturate(120%);}
.study-session-bubble-panel{position:relative;width:min(720px,calc(100vw - 28px));max-height:min(88vh,760px);overflow:auto;border-radius:30px;padding:14px;background:linear-gradient(145deg,rgba(255,255,255,.80),rgba(226,238,255,.62));border:1px solid rgba(255,255,255,.92);box-shadow:0 30px 90px rgba(25,50,90,.28),inset 0 1px 0 rgba(255,255,255,.95);backdrop-filter:blur(30px) saturate(155%);-webkit-backdrop-filter:blur(30px) saturate(155%);}
.study-session-bubble-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:3px 5px 10px;}
.study-session-bubble-title{display:block;color:#102d56;font-size:20px;font-weight:950;}
.study-session-bubble-subtitle{display:block;color:#557092;font-size:11px;font-weight:700;margin-top:2px;}
.study-session-bubble-close{width:38px;height:38px;border-radius:50%;border:1px solid rgba(255,255,255,.78);background:rgba(255,255,255,.58);color:#17345d;font-size:26px;line-height:1;cursor:pointer;box-shadow:inset 0 1px 0 rgba(255,255,255,.9);}
#studySessionBubbleMount .study-session-zone{display:block!important;position:relative!important;min-height:500px!important;margin:0!important;padding:18px!important;border-radius:25px!important;background:rgba(255,255,255,.46)!important;border:1px solid rgba(255,255,255,.82)!important;box-shadow:0 16px 45px rgba(48,73,112,.12),inset 0 1px 0 rgba(255,255,255,.9)!important;overflow:hidden!important;}
#studySessionBubbleMount .study-session-head{justify-content:flex-start!important;}
#studySessionBubbleMount .study-session-stage{left:10px!important;right:10px!important;bottom:10px!important;height:230px!important;}
#studySessionBubbleMount .study-library{transform:scale(.90)!important;left:4%!important;bottom:18px!important;}
#studySessionBubbleMount .study-chair{transform:scale(.90)!important;left:25%!important;bottom:18px!important;}
#studySessionBubbleMount .study-desk{transform:scale(.90)!important;right:4%!important;bottom:18px!important;}
#studySessionBubbleMount .study-lamp{transform:scale(.90)!important;right:22%!important;bottom:112px!important;}
#studySessionBubbleMount .study-bear,#studySessionBubbleMount .study-bear.idle,#studySessionBubbleMount .study-bear.paused{transform:scale(.66)!important;left:25%!important;bottom:18px!important;}
.study-session-float{position:fixed;z-index:25000;right:16px;bottom:92px;display:flex;align-items:center;gap:7px;border:1px solid rgba(255,255,255,.88);border-radius:999px;padding:10px 13px;background:linear-gradient(135deg,rgba(70,132,255,.78),rgba(103,158,255,.58));color:#fff;font-weight:900;box-shadow:0 14px 35px rgba(39,92,180,.28),inset 0 1px 0 rgba(255,255,255,.72);backdrop-filter:blur(18px) saturate(150%);-webkit-backdrop-filter:blur(18px) saturate(150%);cursor:pointer;}
.study-session-float.hidden{display:none!important;}
.study-session-float.paused{background:linear-gradient(135deg,rgba(120,132,154,.80),rgba(160,171,190,.58));}
.study-session-float-icon{font-size:17px}.study-session-float-time{font-variant-numeric:tabular-nums;font-size:14px;letter-spacing:.2px}.study-session-float-dot{width:7px;height:7px;border-radius:50%;background:#7dffad;box-shadow:0 0 10px #7dffad;}
.study-session-float-dot.paused{background:#ffd36b;box-shadow:0 0 10px #ffd36b;}
@media(max-width:600px){.study-session-bubble{padding:10px}.study-session-bubble-panel{width:calc(100vw - 20px);max-height:90vh;border-radius:26px;padding:10px}#studySessionBubbleMount .study-session-zone{min-height:470px!important;padding:14px 10px!important}#studySessionBubbleMount .study-session-stage{left:8px!important;right:8px!important;height:205px!important}#studySessionBubbleMount .study-library{transform:scale(.76)!important;left:2%!important;bottom:15px!important}#studySessionBubbleMount .study-chair{transform:scale(.76)!important;left:24%!important;bottom:15px!important}#studySessionBubbleMount .study-desk{transform:scale(.76)!important;right:2%!important;bottom:15px!important}#studySessionBubbleMount .study-lamp{transform:scale(.76)!important;right:20%!important;bottom:98px!important}#studySessionBubbleMount .study-bear,#studySessionBubbleMount .study-bear.idle,#studySessionBubbleMount .study-bear.paused{transform:scale(.56)!important;left:24%!important;bottom:15px!important}.study-session-float{right:14px;bottom:88px;padding:9px 12px}}


/* V12: Study Session is available only through the Dashboard card + glass bubble.
   Never render the session inline on Study/Decks/Add/Import or any other page. */
.study-session-zone{display:none!important;}
#studySessionBubbleMount .study-session-zone{display:block!important;}

/* Make the standalone Study Session bubble feel spacious and readable. */
#studySessionBubbleMount .study-session-zone{
  min-height:560px!important;
  padding:24px!important;
  border-radius:28px!important;
}
#studySessionBubbleMount .study-session-head{
  gap:12px!important;
  align-items:center!important;
}
#studySessionBubbleMount .study-session-btn{
  padding:13px 20px!important;
  border-radius:17px!important;
  font-size:18px!important;
  font-weight:900!important;
}
#studySessionBubbleMount .study-session-stop{
  padding:12px 17px!important;
  border-radius:15px!important;
  font-size:16px!important;
  font-weight:900!important;
}
#studySessionBubbleMount .study-history-btn{
  padding:10px 16px!important;
  font-size:14px!important;
  margin:10px auto 0!important;
}
#studySessionBubbleMount .study-session-options{
  gap:9px!important;
  margin-top:12px!important;
}
#studySessionBubbleMount .study-session-option{
  padding:9px 14px!important;
  font-size:15px!important;
  font-weight:800!important;
}
#studySessionBubbleMount .study-session-timer{
  font-size:46px!important;
  line-height:1.05!important;
  font-weight:950!important;
  margin-top:12px!important;
}
#studySessionBubbleMount .study-session-status{
  font-size:15px!important;
  min-height:22px!important;
  margin-top:8px!important;
  font-weight:700!important;
}
#studySessionBubbleMount .study-session-stage{
  left:14px!important; right:14px!important; bottom:14px!important;
  height:255px!important;
  border-radius:24px!important;
}
@media(max-width:600px){
  #studySessionBubbleMount .study-session-zone{
    min-height:560px!important;
    padding:20px 14px 14px!important;
  }
  #studySessionBubbleMount .study-session-btn{font-size:18px!important;padding:13px 18px!important;}
  #studySessionBubbleMount .study-session-timer{font-size:44px!important;}
  #studySessionBubbleMount .study-session-status{font-size:14px!important;}
  #studySessionBubbleMount .study-session-stage{left:10px!important;right:10px!important;height:245px!important;bottom:10px!important;}
}


/* V17 final visual overrides — do not alter app behavior */
html{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important}
.auth-card input{font-size:16px!important}
header h1,.brand-subtitle{color:#172033!important}
.ai-head-btn,.streak-btn,#dueBadge{color:#172033!important}


/* V18: slightly tighten the gap between Cloud Sync and the main navigation.
   No behavior or other layout changes. */
#cloudSyncBar{margin-bottom:10px!important;}
@media(max-width:600px){#cloudSyncBar{margin-bottom:10px!important;}}


.shared-lib-toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:16px}
.shared-lib-toolbar input,.shared-lib-toolbar select,.shared-lib-inline input,.shared-lib-inline select{min-height:44px;border:1px solid rgba(130,160,200,.28);border-radius:14px;padding:10px 13px;background:rgba(255,255,255,.72);font:inherit;outline:none}
.shared-lib-toolbar input{flex:1 1 190px}.shared-lib-toolbar select{min-width:170px}
.shared-lib-folder{margin:12px 0;border:1px solid rgba(130,160,200,.20);border-radius:20px;background:rgba(255,255,255,.48);overflow:hidden}
.shared-lib-folder-head{display:flex;gap:10px;align-items:center;padding:13px 15px;background:rgba(232,241,255,.52);cursor:grab;touch-action:none}
.shared-lib-folder-head b{flex:1;font-size:16px;min-width:0}.shared-lib-folder.drag-over,.shared-lib-deck.drag-over{outline:2px dashed #6b9ff8;outline-offset:-2px;background:rgba(219,234,254,.55)}
.shared-lib-decks{padding:8px 12px 12px}.shared-lib-deck{display:grid;grid-template-columns:30px minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:11px 12px;margin:7px 0;border:1px solid rgba(130,160,200,.18);border-radius:15px;background:rgba(255,255,255,.66);touch-action:none}
.shared-lib-deck .drag,.shared-folder-drag{font-size:18px;color:#7890aa;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}.shared-lib-deck-main{min-width:0}.shared-lib-deck-main b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}.shared-lib-deck-main small{display:block;color:#64748b;margin-top:3px;font-size:12px}.shared-lib-user-actions{display:flex;align-items:center;gap:7px;justify-content:center;white-space:nowrap}.shared-lib-admin-actions{display:flex;flex-direction:column;gap:4px;align-items:stretch}.shared-lib-admin-actions .btn,.shared-lib-user-actions .btn,.shared-lib-folder-actions .btn{width:34px;min-width:34px;height:30px;min-height:30px;padding:0!important;border-radius:9px;font-size:14px;display:inline-flex;align-items:center;justify-content:center}.shared-lib-user-actions .shared-add-btn{width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important;padding:0!important;border-radius:50%!important;font-size:25px!important;line-height:1;background:#22a447!important;color:#fff!important;border:0!important;box-shadow:0 6px 16px rgba(34,164,71,.24)!important}.shared-lib-user-actions .shared-add-btn:hover{background:#1b8f3c!important;color:#fff!important}.shared-add-tab{background:#22a447!important;color:#fff!important;border-color:#22a447!important;font-size:24px!important;font-weight:950!important;min-width:54px!important;padding:8px 16px!important}.shared-add-tab:hover{background:#1b8f3c!important;color:#fff!important}.shared-add-tab.active{background:#1b8f3c!important;color:#fff!important;border-color:#177b34!important}.shared-lib-add-dock{background:transparent!important;color:#355277!important;border-color:transparent!important;box-shadow:none!important}.shared-lib-add-dock span{font-size:28px!important;line-height:1;font-weight:800}.shared-lib-folder-actions{display:flex;flex-direction:column;gap:4px;align-items:stretch}.shared-lib-folder-actions .btn{font-size:13px}.shared-lib-empty{padding:16px;text-align:center;color:#64748b}
.shared-lib-coming{padding:56px 20px;text-align:center;border:1px solid rgba(255,255,255,.7);border-radius:26px;background:linear-gradient(145deg,rgba(255,255,255,.72),rgba(235,243,255,.56));box-shadow:0 18px 50px rgba(50,75,115,.12)}
.shared-lib-coming .icon{font-size:54px;margin-bottom:12px}.shared-lib-readonly{margin-bottom:14px;padding:11px 14px;border-radius:14px;background:rgba(255,243,205,.72);border:1px solid rgba(180,130,30,.16);color:#765b16;font-weight:700}
.shared-lib-cards{display:none;margin:8px 0 2px;padding:10px 12px;border-radius:14px;background:rgba(241,246,255,.72);grid-column:2 / -1}.shared-lib-cards.open{display:block}.shared-lib-card{padding:8px 0;border-bottom:1px solid rgba(100,120,150,.12)}.shared-lib-card:last-child{border-bottom:0}.shared-lib-card b{display:block}.shared-lib-drop{min-height:34px;padding:7px 10px;border-radius:11px;border:1px dashed rgba(90,120,160,.28);color:#64748b;text-align:center;font-size:12px;margin-top:4px}
.shared-lib-touch-dragging{opacity:.45;outline:3px solid #6b9ff8!important}.shared-lib-drag-ghost{position:fixed;z-index:99999;pointer-events:none;left:0;top:0;transform:translate(-50%,-50%);padding:10px 14px;border-radius:14px;background:#fff;box-shadow:0 12px 30px rgba(20,40,80,.22);font-weight:800;max-width:min(80vw,360px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:600px){.shared-lib-deck{grid-template-columns:28px minmax(0,1fr) auto auto;gap:7px;padding:10px 9px}.shared-lib-user-actions{gap:5px}.shared-lib-user-actions .shared-add-btn{min-width:82px;font-size:11px}.shared-lib-deck-main b{font-size:14px}.shared-lib-admin-actions .btn,.shared-lib-user-actions .btn,.shared-lib-folder-actions .btn{width:32px;min-width:32px;height:29px;min-height:29px}.shared-lib-toolbar{gap:8px}.shared-lib-folder-head{padding:11px 12px}}
/* Keep lecture names and their actions aligned across desktop and mobile. */
.shared-lib-deck{touch-action:auto;grid-template-columns:28px minmax(0,1fr) auto}
.shared-lib-deck-main{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;row-gap:4px}
.shared-lib-deck-heading{display:flex;align-items:center;gap:9px;min-width:0}
.shared-lib-deck-icon{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border-radius:11px;background:linear-gradient(145deg,#edf2ff,#e4ebff);font-size:18px}
.shared-lib-deck-title{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#263653;font-size:15px;font-weight:900;line-height:1.35}
.shared-lib-deck-count{justify-self:end;padding:5px 9px;border:1px solid #e4eaf5;border-radius:999px;background:#f7f9fd;color:#61708a;font-size:12px;font-weight:750;white-space:nowrap}
.shared-lib-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;white-space:nowrap}
.shared-lib-actions .btn{width:34px;min-width:34px;height:34px;min-height:34px;padding:0!important;border-radius:11px;display:inline-flex;align-items:center;justify-content:center}
.shared-lib-actions .shared-add-btn{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important;border-radius:50%!important;background:#22a447!important;color:#fff!important;border:0!important;font-size:22px!important;box-shadow:0 6px 16px rgba(34,164,71,.22)!important}
.shared-lib-deck-main .shared-lib-deck-title{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#263653;font-size:15px;font-weight:900;line-height:1.35}
.shared-save-status{flex:1 1 100%;min-height:18px;color:#6b7890;font-size:12px;font-weight:750;text-align:right;cursor:pointer}
.shared-editor-card-summary{display:grid;gap:5px;padding:11px 12px;border:1px solid #e8edf5;border-radius:12px;background:#f8faff;color:#34435f;overflow-wrap:anywhere}
.shared-editor-card-summary b{line-height:1.45}.shared-editor-card-summary span{color:#687791;font-size:13px;line-height:1.5}.shared-editor-card-summary small{color:#566caa;font-weight:750}
.shared-editor-card:not(.is-expanded) .shared-editor-card-head{margin-bottom:0}
/* Allow page scrolling on touch screens; only the drag handle captures touch gestures. */
.shared-lib-deck{touch-action:auto}
.shared-lib-folder-head{touch-action:pan-y}
.shared-lib-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:10px;margin-top:10px}
.shared-lib-card{min-width:0;padding:14px;border:1px solid #e1e8f3;border-radius:15px;background:linear-gradient(145deg,#fff,#f7f9ff);box-shadow:0 5px 16px rgba(36,58,94,.05)}
.shared-lib-card b{display:block;color:#263653;line-height:1.45;overflow-wrap:anywhere}
.shared-lib-card .small{line-height:1.55;overflow-wrap:anywhere;margin-top:6px}
.shared-lib-card-index{display:inline-grid;place-items:center;min-width:25px;height:25px;margin-right:6px;border-radius:8px;background:#eaf0ff;color:#465eb5;font-size:12px;font-weight:900;vertical-align:middle}
.shared-deck-editor{padding:clamp(16px,3vw,26px);border:1px solid #e1e8f3;border-radius:22px;background:linear-gradient(145deg,#fff,#f8faff);box-shadow:0 12px 36px rgba(34,55,90,.08)}
.shared-deck-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:18px}
.shared-deck-editor-meta{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(180px,.8fr);gap:12px;padding:15px;border:1px solid #e5ebf5;border-radius:16px;background:#fff;margin-bottom:18px}
.shared-deck-editor label{display:block;margin:0 0 6px;font-size:13px;font-weight:850;color:#4b5c78}
.shared-deck-editor input,.shared-deck-editor textarea,.shared-new-card input,.shared-new-card textarea{box-sizing:border-box;width:100%;border:1px solid #dce4f0;border-radius:12px;padding:11px 12px;background:#fff;color:#1d2940;font:inherit;outline:none}
.shared-deck-editor textarea,.shared-new-card textarea{min-height:92px;resize:vertical;line-height:1.5}
.shared-deck-editor input:focus,.shared-deck-editor textarea:focus,.shared-new-card input:focus,.shared-new-card textarea:focus{border-color:#7189ee;box-shadow:0 0 0 3px #7189ee20}
.shared-editor-card{padding:15px;margin:10px 0;border:1px solid #e3e9f3;border-radius:17px;background:#fff}
.shared-editor-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;color:#354667;font-weight:900}
.shared-editor-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.shared-editor-fields .wide{grid-column:1/-1}
.shared-editor-card-actions{display:flex;gap:7px;align-items:center}
.shared-editor-drag-handle{display:grid;place-items:center;width:34px;height:34px;border:1px solid #e2e8f3;border-radius:10px;background:#f7f9fd;color:#647895;font-size:22px;line-height:1;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}.shared-editor-drag-handle:active{cursor:grabbing;background:#eaf0ff;color:#425bb5}
.shared-editor-card.is-dragging{opacity:.52;transform:scale(.99)}.shared-editor-card.drag-over-before{border-top:3px solid #5a73df}.shared-editor-card.drag-over-after{border-bottom:3px solid #5a73df}
.shared-new-card{padding:16px;margin-top:18px;border:1px dashed #bdcbea;border-radius:17px;background:#f8faff}
.shared-new-card-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.shared-editor-footer{position:sticky;bottom:10px;z-index:3;display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;padding:11px;margin-top:18px;border:1px solid #e1e7f2;border-radius:16px;background:#ffffffed;backdrop-filter:blur(12px);box-shadow:0 8px 28px #26395818}
@media(max-width:600px){.shared-lib-deck{grid-template-columns:25px minmax(0,1fr);gap:8px;padding:12px}.shared-lib-deck-main{grid-column:2;grid-template-columns:minmax(0,1fr) auto}.shared-lib-deck-heading{gap:7px}.shared-lib-deck-main .shared-lib-deck-title{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:14px}.shared-lib-deck-icon{width:30px;height:30px;flex-basis:30px}.shared-lib-deck-count{font-size:11px;padding:4px 7px}.shared-lib-actions{grid-column:2;justify-content:flex-start;flex-wrap:wrap}.shared-lib-actions .btn{width:34px;min-width:34px;height:34px;min-height:34px}.shared-lib-cards{grid-column:1/-1}.shared-lib-actions .shared-add-btn{width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;font-size:21px!important}.shared-lib-card-grid{grid-template-columns:1fr}.shared-deck-editor-meta,.shared-editor-fields,.shared-new-card-grid{grid-template-columns:1fr}.shared-editor-fields .wide{grid-column:auto}.shared-editor-card{padding:12px}.shared-editor-footer .btn{flex:1}}


#battleOverlay{position:fixed!important;inset:0!important;z-index:2147483003!important;display:block!important;padding:0!important;background:#f5f7fb!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;overflow:auto!important}
#battleOverlay.hidden{display:none!important}
#battleOverlay .battle-fullscreen-shell{min-height:100vh;min-height:100dvh;width:100%;background:#f5f7fb;display:flex;flex-direction:column}
#battleOverlay .battle-fullscreen-top{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;background:#111827;color:#fff;box-shadow:0 3px 16px #0002}
#battleOverlay .battle-fullscreen-title{font-size:19px;font-weight:900}
#battleOverlay .battle-fullscreen-main{width:min(1050px,100%);margin:0 auto;padding:24px 18px 40px;flex:1}
#battleOverlay #battleModalContent{width:100%}
#battleOverlay #battleJoinCard{scroll-margin-bottom:160px;margin-top:0!important;margin-bottom:150px!important}
@media(max-width:600px){
  #battleOverlay #battleJoinCard{margin-top:0!important;margin-bottom:170px!important}
}
#battleOverlay .battle-fullscreen-close{border:0;border-radius:10px;padding:9px 13px;background:#ffffff18;color:#fff;font-weight:800;cursor:pointer}
#battleOverlay .battle-library-admin{margin-bottom:16px;border:1px solid #dbeafe;background:#eff6ff;border-radius:18px;padding:16px}
#battleOverlay .battle-library-admin h3{margin:0 0 5px}
#battleOverlay .battle-library-list{display:grid;gap:8px;margin-top:12px}
#battleOverlay .battle-library-item{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#fff;border:1px solid #e5e7eb;border-radius:13px;padding:11px 12px}
@media(max-width:600px){#battleOverlay .battle-fullscreen-top{padding:12px 13px}#battleOverlay .battle-fullscreen-main{padding:16px 12px 28px}}


#battleOverlay{background:radial-gradient(ellipse at 10% 0%,#e8edff 0,transparent 38%),linear-gradient(145deg,#f7f8fc,#eef2f9)!important;color:#172033}
#battleOverlay .battle-fullscreen-shell{background:radial-gradient(ellipse at 10% 0%,#e8edff 0,transparent 38%),linear-gradient(145deg,#f7f8fc,#eef2f9)}
#battleOverlay .battle-fullscreen-top{background:linear-gradient(110deg,#10182e,#192b50 58%,#263b68);padding:15px clamp(16px,4vw,36px);box-shadow:0 8px 30px #10182e24}
#battleOverlay .battle-fullscreen-title{display:flex;align-items:center;gap:10px;letter-spacing:.2px}
#battleOverlay .battle-fullscreen-close{border:1px solid #ffffff2b;background:#ffffff12;transition:background .18s,transform .18s}
#battleOverlay .battle-fullscreen-close:hover{background:#ffffff25;transform:translateY(-1px)}
#battleOverlay .battle-fullscreen-main{width:min(940px,100%);padding:clamp(18px,4vw,40px) 18px calc(48px + env(safe-area-inset-bottom))}
#battleOverlay .battle-library-admin{background:linear-gradient(135deg,#eff6ff,#fff);border-color:#d9e6ff;box-shadow:0 10px 30px #263b680c}
.battle-home,.battle-lobby,.battle-game,.battle-finish,.battle-state-card{max-width:760px;margin:0 auto}
.battle-hero{position:relative;overflow:hidden;padding:30px 22px;border-radius:28px;background:radial-gradient(circle at 85% 5%,#879cff66,transparent 28%),linear-gradient(135deg,#17264a,#263e70 60%,#37519a);color:#fff;box-shadow:0 22px 55px #1d32602b}
.battle-hero:after{content:'✦';position:absolute;right:9%;top:4%;font-size:80px;color:#ffffff14;transform:rotate(18deg)}
.battle-hero-icon{display:grid;place-items:center;width:54px;height:54px;border-radius:18px;background:#ffffff1c;border:1px solid #ffffff24;font-size:27px;margin-bottom:16px}
.battle-hero h2{font-size:clamp(26px,4vw,36px);letter-spacing:-.7px;margin:0 0 7px}.battle-hero p{color:#e0e8ff;margin:0;max-width:550px;line-height:1.55}
.battle-panel{padding:18px;border:1px solid #e4e9f2;border-radius:20px;background:#ffffffd9;box-shadow:0 12px 34px #1a2b4b0b}
.battle-panel-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px;font-weight:900;color:#223253}
.battle-config-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.battle-config-grid label{display:block;margin-bottom:7px;font-size:13px;font-weight:850;color:#52617c}
.battle-config-grid select,.battle-join-input{width:100%;box-sizing:border-box;padding:12px 13px;border:1px solid #dce3ef;border-radius:12px;background:#fff;font:inherit;color:#1d2940;outline:none}.battle-config-grid select:focus,.battle-join-input:focus{border-color:#7189ee;box-shadow:0 0 0 3px #7189ee22}
.battle-primary-btn,.battle-secondary-btn,.battle-control-btn{border:0;border-radius:13px;padding:13px 16px;font:inherit;font-weight:900;cursor:pointer;transition:transform .15s,filter .15s,box-shadow .15s}.battle-primary-btn{color:#fff;background:linear-gradient(110deg,#425dd2,#6b65e8);box-shadow:0 8px 20px #4b58cd30}.battle-secondary-btn{color:#293c69;background:#eef2ff;border:1px solid #dfe5ff}.battle-control-btn{color:#1d376b;background:#edf3ff;border:1px solid #d5e2ff}.battle-primary-btn:hover,.battle-secondary-btn:hover,.battle-control-btn:hover{filter:brightness(1.03);transform:translateY(-1px)}
.battle-room-code{display:inline-flex;align-items:center;justify-content:center;padding:7px 15px;border-radius:12px;background:#eef2ff;color:#263e8c;font-size:28px;font-weight:950;letter-spacing:7px;font-variant-numeric:tabular-nums}
.battle-player-list{display:grid;gap:8px;margin-top:17px}.battle-player-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid #e8edf5;border-radius:14px;background:#fff}.battle-player-row.is-you{border-color:#c9d5ff;background:#f5f7ff}.battle-player-meta{display:flex;align-items:center;gap:10px;min-width:0}.battle-player-avatar{display:grid;place-items:center;width:36px;height:36px;flex:0 0 36px;border-radius:12px;background:#edf1ff;color:#4659bd;font-weight:950}.battle-player-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.battle-player-score{font-weight:950;color:#334a91;font-variant-numeric:tabular-nums}.battle-status-pill{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:#edf8f2;color:#247044;font-size:12px;font-weight:850}
.battle-game-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px}.battle-progress-meta{font-size:13px;color:#687795;font-weight:850}.battle-question-card{position:relative;overflow:hidden;padding:clamp(18px,4vw,30px);border-radius:24px;background:#fff;border:1px solid #e2e8f1;box-shadow:0 18px 48px #1b2d500d}.battle-question-content{transition:filter .2s,opacity .2s}.battle-paused .battle-question-content{filter:blur(11px);opacity:.38;user-select:none;pointer-events:none}.battle-question-text{font-size:clamp(20px,3vw,28px);font-weight:900;line-height:1.42;letter-spacing:-.25px;margin:14px 0 20px;color:#202b43}.battle-choice-list{display:grid;gap:10px}.battle-choice{display:flex;align-items:center;gap:12px;width:100%;padding:13px 15px!important;border:1px solid #e4e9f2!important;border-radius:14px!important;background:#fbfcff!important;color:#26324a!important;font:inherit!important;font-weight:750!important;line-height:1.4;text-align:left;white-space:normal;transition:border-color .15s,background .15s,transform .15s!important}.battle-choice:not(:disabled):hover{border-color:#8799ee!important;background:#f3f5ff!important;transform:translateY(-1px)}.battle-choice:disabled{opacity:.72}.battle-choice-letter{display:grid;place-items:center;width:31px;height:31px;flex:0 0 31px;border-radius:10px;background:#eef1fb;color:#5265bb;font-size:13px;font-weight:950}
.battle-timer-wrap{min-width:130px}.battle-timer-label{display:flex;align-items:center;justify-content:flex-end;gap:8px;font-size:22px;font-weight:950;font-variant-numeric:tabular-nums;color:#24365b}.battle-timer-track{height:8px;margin-top:7px;border-radius:99px;background:#e7ebf2;overflow:hidden}.battle-timer-fill{height:100%;width:100%;border-radius:inherit;background:linear-gradient(90deg,#4c6ee8,#59b8ef);transform-origin:left;transition:width .1s linear}.battle-paused-overlay{position:absolute;inset:0;z-index:2;display:grid;place-items:center;padding:20px;text-align:center;background:#f8faff72;backdrop-filter:blur(2px)}.battle-paused-card{max-width:330px;padding:22px 24px;border:1px solid #dce4fb;border-radius:20px;background:#ffffffed;box-shadow:0 20px 48px #26375c20}.battle-paused-card strong{display:block;font-size:20px;color:#26375d;margin-bottom:6px}.battle-score-panel{margin-top:15px}.battle-feedback{margin-top:13px;padding:12px 14px;border-radius:13px;font-weight:850}.battle-recovery{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;border:1px solid #cdd8ff;background:linear-gradient(110deg,#f0f3ff,#fff);border-radius:18px;padding:14px 16px}
@media(max-width:600px){#battleOverlay .battle-fullscreen-top{padding:11px 13px}#battleOverlay .battle-fullscreen-main{padding-bottom:calc(28px + env(safe-area-inset-bottom))}.battle-hero{padding:24px 19px;border-radius:23px}.battle-config-grid{grid-template-columns:1fr 1fr;gap:8px}.battle-panel{padding:15px;border-radius:17px}.battle-game-head{align-items:flex-start}.battle-question-card{padding:17px;border-radius:19px}.battle-choice{padding:11px 12px!important}.battle-timer-wrap{min-width:95px}.battle-timer-label{font-size:19px}}


.rich-editor{border:1px solid #d1d5db;border-radius:12px;background:#fff;overflow:hidden}.rich-toolbar{display:flex;gap:5px;flex-wrap:wrap;padding:8px;border-bottom:1px solid #e5e7eb;background:#f8fafc}.rich-toolbar button{border:1px solid #dbe1ea;background:#fff;border-radius:8px;padding:7px 9px;font-weight:800;cursor:pointer}.rich-content{min-height:150px;padding:12px;outline:none;line-height:1.55}.rich-content:empty:before{content:attr(data-placeholder);color:#94a3b8}.make-card-preview{margin-top:16px}.make-card-item{background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:13px;margin:9px 0}.make-card-item .preview-answer{color:#475569;margin-top:6px}.make-card-item .preview-explain{margin-top:8px;padding:10px;border-radius:10px;background:#fff;border:1px solid #eef2f7}.reorder-dragging{opacity:.55;transform:scale(.985);box-shadow:0 12px 28px #0002}.reorder-target{border-top:3px solid #2563eb!important}.deck-card-reorder-hint{font-size:12px;color:#64748b;margin:5px 0 10px}.explain-trigger{position:static;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:11px 18px;margin:18px 0 6px;border-radius:14px;border:1px solid #b8cff4;background:linear-gradient(135deg,#eaf3ff,#dce9ff);color:#254f93;font:inherit;font-size:15px;font-weight:850;box-shadow:0 5px 15px #315e9d16;cursor:pointer;touch-action:manipulation}.explain-trigger:hover{background:#d5e6ff;border-color:#7fa6e0}.explain-trigger:focus-visible{outline:3px solid #6294dc;outline-offset:3px}.explain-trigger:active{transform:scale(.98)}.study-card{position:relative}.explain-overlay{position:fixed;inset:0;background:#0006;z-index:1200;display:flex;align-items:center;justify-content:center;padding:16px}.explain-box{width:min(760px,100%);max-height:88vh;overflow:auto;background:#fff;border-radius:22px;padding:20px;box-shadow:0 20px 60px #0004}.edit-card-modal{position:fixed;inset:0;background:#0006;z-index:2147483500;display:flex;align-items:flex-start;justify-content:center;padding:18px 14px calc(110px + env(safe-area-inset-bottom));overflow:auto}.edit-card-box{width:min(760px,100%);max-height:calc(100vh - 128px);overflow:auto;background:#fff;border-radius:22px;padding:18px;box-shadow:0 20px 60px #0004;margin:0 auto 10px}.admin-user-card{border:1px solid #e5e7eb;border-radius:14px;padding:14px;margin:9px 0;background:#fff}.admin-user-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:9px}.admin-perm{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700}.admin-perm input{width:auto;margin:0}.admin-size{font-weight:900;color:#3730a3}


.deck-tile.study-paused{background:#f0f8f3!important;border-color:#d1e7d9!important}
.folder.study-paused{background:#f5faf6!important;border-color:#d1e7d9!important}
.study-pause-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:36px;padding:7px 10px;border:1px solid #d7e1ed;border-radius:10px;background:#f8faff;color:#53677f;font:inherit;font-size:12px;font-weight:750;white-space:nowrap;cursor:pointer;touch-action:manipulation}
.study-pause-btn[aria-pressed="true"]{background:#e7f3eb;border-color:#c9e3d2;color:#39704e}
.study-pause-btn:hover{border-color:#9db8d7;background:#edf3fa}
.study-pause-btn:focus-visible{outline:3px solid #93b8ec;outline-offset:2px}
.study-pause-btn:disabled{opacity:.45;cursor:default}
.deck-tile>.row>.actions{flex:0 0 auto!important;align-items:center;gap:6px}
.folder-head>.actions{align-items:center;gap:6px;justify-content:flex-end}
@media(max-width:650px){.deck-tile>.row{display:grid!important;grid-template-columns:32px minmax(0,1fr);gap:7px}.deck-tile>.row>.actions{grid-column:2;justify-content:flex-start;flex-wrap:wrap}.deck-tile .drag-handle{padding:6px}.folder-head{flex-wrap:wrap;align-items:flex-start}.folder-head>.actions{width:100%;justify-content:flex-start;margin-left:0}.study-pause-btn{min-height:38px}}
