:root{
 --ink:#302b3f;--muted:#878395;--purple:#5c469d;--purple2:#765bc2;--lilac:#e9ddff;
 --yellow:#f6d455;--pink:#e76a9c;--lav:#c9bce9;--bg:#f7f5fb;--white:#fff;
 --shadow:0 16px 40px rgba(62,38,112,.10);--radius:22px;
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg)}
a{text-decoration:none;color:inherit}button,input,select,textarea{font:inherit}button{cursor:pointer}
.brand{display:flex;align-items:center;gap:10px}.brand-logo{width:38px;height:38px;border-radius:12px;background:#fff;color:var(--purple);display:block;object-fit:contain;font-weight:900;box-shadow:0 5px 14px rgba(71,49,121,.08);border:1px solid #eee9f7}.brand-mark{display:block;width:64px;height:64px;margin:0 auto 16px;object-fit:contain}.brand b{display:block;font-size:15px;letter-spacing:-.2px}.brand small{display:block;color:var(--muted);font-size:9px;margin-top:1px}
.btn{border:0;border-radius:13px;padding:12px 17px;display:inline-flex;gap:10px;align-items:center;justify-content:center;font-weight:800;transition:.2s}.btn.primary{background:var(--purple);color:#fff;box-shadow:0 8px 20px rgba(92,70,157,.22)}.btn.primary:hover{transform:translateY(-1px);background:#4f3c8b}.btn.outline{background:#fff;border:1px solid #e7e0f0;color:var(--purple)}.btn.small{padding:9px 13px;font-size:12px}.btn.full{width:100%}
.eyebrow{font-size:10px;font-weight:900;letter-spacing:1.5px;color:#9b86c9}.alert{padding:12px 14px;border-radius:12px;font-size:13px;margin:12px 0}.alert.success{background:#e8f7ee;color:#24623b}.alert.error{background:#fdeced;color:#8e2f38}
.landing{background:linear-gradient(135deg,#f9dd72 0%,#f4d75d 48%,#f9e99f 100%);overflow-x:hidden}.landing:before,.landing:after{content:"";position:fixed;border-radius:50%;background:rgba(255,255,255,.13);z-index:0}.landing:before{width:420px;height:420px;left:-180px;top:-160px}.landing:after{width:500px;height:500px;right:-250px;bottom:-250px}
.loader{position:fixed;inset:0;background:#fff;z-index:99;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--muted);font-size:12px;transition:.35s}.loader.hide{opacity:0;visibility:hidden;pointer-events:none}.loader-ring{width:42px;height:42px;border:4px solid #eee8f8;border-top-color:var(--purple);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.landing-shell{position:relative;z-index:1;max-width:1200px;margin:auto;padding:30px 34px 50px}.topbar{display:flex;justify-content:space-between;align-items:center}.topbar nav{display:flex;gap:24px;align-items:center;font-size:13px;font-weight:750}.topbar nav a:not(.btn){opacity:.78}.landing-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:72px;align-items:center;min-height:545px}.hero-copy h1{font-size:clamp(45px,7vw,78px);line-height:.98;letter-spacing:-3px;margin:16px 0}.hero-copy h1 span{color:var(--purple)}.hero-copy p{font-size:17px;line-height:1.75;max-width:640px;color:#5e586a}.hero-stats{display:flex;gap:38px;margin-top:35px}.hero-stats strong{display:block;font-size:27px}.hero-stats span{display:block;color:#776f83;font-size:11px;margin-top:2px}
.welcome-card{background:rgba(255,255,255,.95);padding:30px;border-radius:28px;box-shadow:0 28px 65px rgba(103,78,9,.15);border:1px solid rgba(255,255,255,.7)}.card-top{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted)}.mini-icon{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:9px;background:var(--lilac);color:var(--purple);margin-right:7px}.dot-live{font-size:9px;color:#4a8f6a;background:#e9f7ef;padding:6px 8px;border-radius:20px}.welcome-card h2{margin:18px 0 6px;font-size:29px;letter-spacing:-1px}.welcome-card p{color:var(--muted);font-size:13px;line-height:1.65}.stack-form{display:grid;gap:14px}.stack-form label{display:grid;gap:7px;font-size:12px;font-weight:800}.stack-form input,.stack-form select,.stack-form textarea,.search-bar input,.search-bar select{width:100%;border:1px solid #e8e3ee;border-radius:12px;padding:12px 13px;background:#fff;color:var(--ink);outline:none}.stack-form input:focus,.stack-form select:focus,.stack-form textarea:focus,.search-bar input:focus,.search-bar select:focus{border-color:#aa96d8;box-shadow:0 0 0 4px rgba(118,91,194,.09)}.form-divider{display:flex;align-items:center;gap:10px;margin:16px 0;color:#b2adba;font-size:11px}.form-divider:before,.form-divider:after{content:"";height:1px;background:#eeeaf3;flex:1}.small-note{font-size:10px!important;text-align:center;margin-bottom:0;color:#aaa3b3!important}
.preview-strip{background:rgba(255,255,255,.42);border:1px solid rgba(255,255,255,.7);border-radius:30px;padding:28px;display:grid;grid-template-columns:.55fr 1fr;gap:24px;align-items:center}.preview-side h2{font-size:28px;letter-spacing:-1px}.preview-window{background:#fff;border-radius:20px;padding:13px;display:flex;min-height:235px;box-shadow:0 15px 30px rgba(76,60,30,.08);overflow:hidden}.fake-sidebar{width:30%;background:#fbf9fd;border-radius:14px;padding:18px 10px;display:grid;align-content:start;gap:14px;font-size:9px;color:#90879d}.fake-sidebar b{color:var(--ink);font-size:10px}.fake-main{flex:1;padding:10px 18px}.fake-header{display:flex;justify-content:space-between;font-weight:900;font-size:12px}.fake-avatar{background:#dcd0f8;color:var(--purple);width:22px;height:22px;border-radius:50%;display:grid;place-items:center}.fake-hero{margin-top:15px;background:var(--lilac);padding:22px;border-radius:14px;font-weight:900;font-size:18px}.fake-cards{display:flex;gap:8px;margin-top:10px}.fake-cards i{height:40px;flex:1;border-radius:9px;background:#f3d963}.fake-cards i:nth-child(2){background:#604ba5}.fake-cards i:nth-child(3){background:#e76a9c}.fake-list{display:grid;gap:8px;margin-top:10px}.fake-list i{height:30px;background:#f7f4fb;border-radius:7px}
.auth-page{background:linear-gradient(135deg,#f6d45b,#f8ebae);display:grid;place-items:center;padding:30px}.auth-wrap{width:min(460px,100%)}.auth-wrap>.brand{margin-bottom:22px}.auth-card{background:#fff;border-radius:26px;padding:34px;box-shadow:var(--shadow)}.auth-card h1{font-size:34px;letter-spacing:-1.2px;margin:10px 0}.auth-card>p{color:var(--muted);font-size:13px;line-height:1.6}.auth-foot{text-align:center;font-size:12px;color:var(--muted)}.auth-foot a,.text-link{color:var(--purple);font-weight:850}
.setup-page{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#f7d65f,#efe6ff);padding:25px}.setup-card{width:min(560px,100%);background:#fff;border-radius:28px;padding:36px;box-shadow:var(--shadow)}.setup-card h1{margin:14px 0 7px}.setup-card p{color:var(--muted);line-height:1.6}.credential-box{background:#f7f3ff;border:1px solid #ece4fb;padding:16px;border-radius:15px;line-height:1.8;margin:17px 0}.warning{font-size:11px}
.app-body{background:var(--bg)}.app-shell{min-height:100vh;display:grid;grid-template-columns:250px 1fr}.sidebar{background:#fff;border-right:1px solid #eee9f3;padding:28px 18px;display:flex;flex-direction:column;gap:18px;position:relative;z-index:10}.side-brand{padding:0 8px 10px}.create-note{background:#faf7fe;border:1px solid #eee7f7;border-radius:16px;padding:12px;display:flex;gap:10px;align-items:center}.create-note>span{width:26px;height:26px;background:var(--purple);color:#fff;border-radius:50%;display:grid;place-items:center}.create-note small{display:block;color:var(--muted);font-size:9px}.create-note b{font-size:10px}.side-nav{display:grid;gap:6px}.side-nav a{padding:11px 12px;border-radius:11px;display:flex;gap:11px;align-items:center;color:#80788d;font-size:12px;font-weight:750}.side-nav a.active,.side-nav a:hover{background:#f4effc;color:var(--purple)}.side-promo{margin-top:auto;background:linear-gradient(135deg,#f7d75d,#eadbff);border-radius:18px;padding:17px}.side-promo strong{display:block;font-size:13px}.side-promo span{display:block;font-size:10px;color:#746a7b;line-height:1.4;margin-top:5px}.side-logout{padding:10px 12px;color:#8b8591;font-size:11px;font-weight:800}.main-area{padding:25px 46px 20px;min-width:0}.app-header{display:flex;justify-content:space-between;align-items:center;min-height:55px}.page-kicker{font-size:11px;font-weight:900;letter-spacing:1px}.date-line{font-size:10px;color:#9d96a6;margin-top:2px}.header-actions{display:flex;align-items:center;gap:14px;color:#9b94a4;font-size:14px}.user-chip{display:flex;align-items:center;gap:8px;color:var(--ink);font-weight:800;font-size:11px}.avatar{width:30px;height:30px;border-radius:9px;background:#ddd1f6;color:var(--purple);display:grid;place-items:center}.mobile-menu{display:none;border:0;background:transparent;font-size:20px;margin-right:8px}
.welcome-banner{position:relative;overflow:hidden;margin-top:24px;background:linear-gradient(102deg,#dfd0fb,#ecdfff);border-radius:22px;padding:29px 34px;display:flex;justify-content:space-between;align-items:center;min-height:150px}.welcome-banner h1{font-size:31px;margin:6px 0}.welcome-banner p{margin:0;color:#645c71;font-size:12px}.banner-illustration{width:225px;height:125px;position:relative}.sun{position:absolute;width:80px;height:80px;border-radius:50%;background:#f2d057;right:54px;top:7px}.desk{position:absolute;width:170px;height:12px;background:#a78dcf;right:16px;bottom:14px;border-radius:7px;transform:skewX(-15deg)}.person{position:absolute;width:62px;height:75px;background:#62418d;border-radius:35px 35px 18px 18px;right:90px;top:27px;transform:rotate(-8deg)}.laptop{position:absolute;width:76px;height:47px;background:#5d4a8e;border-radius:7px;right:31px;bottom:23px;transform:skew(-10deg);box-shadow:inset 0 0 0 4px #7c68aa}.section-head{display:flex;justify-content:space-between;align-items:end;gap:20px;margin:28px 0 13px}.section-head h2{margin:4px 0 0;font-size:18px;letter-spacing:-.3px}.section-head.compact{margin:0 0 15px}.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.stat-card{border-radius:13px;padding:15px 14px;display:flex;gap:12px;align-items:center}.stat-card.yellow{background:#f1cc4f}.stat-card.purple{background:#5b4699;color:#fff}.stat-card.pink{background:#e66b9c;color:#fff}.stat-card.lavender{background:#c8b9e8}.stat-icon{width:32px;height:32px;border-radius:9px;background:rgba(255,255,255,.25);display:grid;place-items:center;font-weight:900}.stat-card strong{display:block;font-size:21px}.stat-card small{display:block;font-size:9px;opacity:.76}.content-grid{display:grid;grid-template-columns:1.4fr .8fr;gap:15px;margin-top:17px}.panel{background:#fff;border:1px solid #eee9f2;border-radius:18px;padding:20px;min-width:0}.note-row{display:grid;grid-template-columns:38px 1fr 36px;gap:12px;align-items:center;padding:11px 5px;border-top:1px solid #f2eef5}.note-row:first-child{border-top:0}.file-icon,.pdf-badge{background:#efe7f8;color:var(--purple);font-size:8px;font-weight:950;border-radius:9px;display:grid;place-items:center}.file-icon{width:38px;height:38px}.note-meta{min-width:0}.note-meta strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.note-meta span,.note-meta small{display:block;font-size:9px;color:#918898;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.note-meta small{color:#aaa3b0}.icon-btn{width:33px;height:33px;border-radius:10px;background:#f7f3fb;display:grid;place-items:center;color:var(--purple);font-weight:900}.action-tile{display:grid;grid-template-columns:32px 1fr 18px;gap:9px;align-items:center;padding:11px 0;border-bottom:1px solid #f0edf3}.action-tile:last-child{border-bottom:0}.action-tile>span{width:30px;height:30px;border-radius:9px;background:#f2ebfb;display:grid;place-items:center;color:var(--purple)}.action-tile b{display:block;font-size:10px}.action-tile small{display:block;color:#9c96a3;font-size:9px;margin-top:2px}.action-tile em{font-style:normal;color:#aaa}.live-pill{font-size:9px;color:#4f906f;background:#ebf8ef;padding:7px 9px;border-radius:999px}.empty-state{padding:22px;color:#968e9f;font-size:12px;background:#fbf9fd;border-radius:12px}.empty-state.wide{grid-column:1/-1}.footer{padding:22px 0 5px;color:#aaa3b0;font-size:9px;text-align:right}.footer span{margin-left:10px}

/* Small separation between the page hero and the following panel. */
.page-hero + .panel{margin-top:10px;}
.page-hero{margin-top:24px;background:linear-gradient(100deg,#e7dbfd,#f7f0ff);padding:29px 32px;border-radius:22px}.page-hero h1{font-size:33px;margin:7px 0}.page-hero p{margin:0;color:#71697c;font-size:12px}.search-bar{display:grid;grid-template-columns:1fr 290px 100px;gap:10px;background:#fff;padding:13px;border:1px solid #eee9f3;border-radius:18px;margin:16px 0}.notes-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:13px}.note-card{background:#fff;border:1px solid #eee9f2;border-radius:18px;padding:19px}.note-card-top{display:flex;justify-content:space-between;align-items:center}.pdf-badge{width:44px;height:28px}.semester-pill{font-size:9px;background:#f7f4fa;color:#898291;padding:6px 8px;border-radius:999px}.note-card h3{font-size:14px;margin:14px 0 5px}.note-card p{font-size:10px;color:#908895;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.note-file{background:#faf8fc;padding:10px;border-radius:10px;font-size:9px;color:#7c7484;display:flex;justify-content:space-between;gap:10px}.note-file span{color:#a6a0ab}.note-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:13px;font-size:9px;color:#9a929f}.subject-groups{display:grid;gap:25px;margin-top:20px}.subject-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}.subject-card{background:#fff;border:1px solid #eee9f2;border-radius:18px;padding:18px;transition:.2s}.subject-card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}.subject-code{display:inline-flex;background:#f1e9fb;color:var(--purple);padding:6px 8px;border-radius:8px;font-size:9px;font-weight:900}.subject-card h3{font-size:14px;line-height:1.3;margin:12px 0 6px}.subject-card p{font-size:10px;color:#938b99;line-height:1.55;min-height:34px}.subject-foot{display:flex;justify-content:space-between;font-size:9px;color:#9b94a2}.form-layout{display:grid;grid-template-columns:1.2fr .8fr;gap:15px;margin-top:24px}.form-panel h1{font-size:31px;margin:8px 0}.form-panel>p{color:#8d8693;font-size:12px;line-height:1.65}.drop-zone{border:2px dashed #ded4ef;border-radius:14px;background:#fbf9fe;padding:24px;display:grid;place-items:center;gap:5px;position:relative;text-align:center}.drop-zone input{position:absolute;inset:0;width:100%;opacity:0;cursor:pointer}.drop-zone strong{font-size:12px;color:var(--purple)}.drop-zone span{font-size:10px;color:#9991a3}.drop-zone.chosen{border-color:#a88fd4}.check-list{display:grid;gap:10px;color:#777080;font-size:11px;margin:15px 0 24px}.mini-subject{display:grid;grid-template-columns:75px 1fr;gap:5px 8px;padding:9px 0;border-bottom:1px solid #f0edf3}.mini-subject>span{font-size:8px;color:var(--purple);font-weight:900}.mini-subject>b{font-size:10px}.mini-subject small{grid-column:2;font-size:8px;color:#aaa1af}.mini-subject.large{grid-template-columns:90px 1fr}.admin-tag{font-size:9px;background:#efe6fb;color:var(--purple);padding:7px 9px;border-radius:999px;font-weight:900}.danger-text{color:#b94a61}.admin-banner{background:linear-gradient(100deg,#f0dd74,#e6d9fb)}
@media(max-width:1050px){.app-shell{grid-template-columns:210px 1fr}.main-area{padding:22px 28px}.landing-grid{gap:35px}.subject-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:820px){.app-shell{grid-template-columns:1fr}.sidebar{position:fixed;left:-270px;top:0;bottom:0;width:250px;box-shadow:15px 0 35px rgba(0,0,0,.12);transition:.25s}.sidebar.open{left:0}.mobile-menu{display:inline-block}.main-area{padding:18px}.stat-grid{grid-template-columns:repeat(2,1fr)}.content-grid,.form-layout{grid-template-columns:1fr}.notes-grid{grid-template-columns:1fr}.search-bar{grid-template-columns:1fr}.landing-shell{padding:22px 18px}.topbar nav a:not(.btn){display:none}.landing-grid{grid-template-columns:1fr;min-height:auto;padding:55px 0}.hero-copy h1{font-size:55px}.preview-strip{grid-template-columns:1fr}.preview-side{display:none}.banner-illustration{position:absolute;right:-30px;opacity:.45}.welcome-banner{min-height:175px}.subject-grid{grid-template-columns:1fr}}
@media(max-width:520px){.hero-copy h1{font-size:46px}.hero-copy p{font-size:14px}.hero-stats{gap:18px}.hero-stats strong{font-size:21px}.welcome-card,.auth-card,.panel{padding:18px}.stat-grid{gap:8px}.stat-card{padding:12px}.stat-card strong{font-size:18px}.header-actions>span{display:none}.user-chip span:last-child{display:none}.footer{text-align:center}}

.field-help{font-size:10px;color:#a39aa9;font-weight:500}.profile-avatar{width:58px;height:58px;background:var(--lilac);color:var(--purple);border-radius:17px;display:grid;place-items:center;font-weight:950;font-size:24px;margin-bottom:15px}.security-item{padding:13px 0;border-bottom:1px solid #f0edf3}.security-item b{display:block;font-size:11px}.security-item span{display:block;color:#9a929f;font-size:9px;margin-top:3px}.favorite-btn{border:0;background:#f6f1fc;color:#a198aa;width:32px;height:32px;border-radius:10px;font-size:17px;cursor:pointer}.favorite-btn.active{color:#6a4ca5;background:#eadfff}.tag-row{display:flex;flex-wrap:wrap;gap:5px;margin:10px 0}.tag-row span{font-size:8px;background:#f4effb;color:#795db1;padding:5px 7px;border-radius:999px}.note-actions{display:flex;gap:9px;align-items:center}.report-link{border:0;background:transparent;color:#a098a8;font-size:9px;cursor:pointer}.pagination{display:flex;justify-content:center;gap:6px;margin:20px 0}.pagination a{width:31px;height:31px;border-radius:9px;background:#fff;border:1px solid #ece7f1;display:grid;place-items:center;font-size:10px;color:#857d8d}.pagination a.active{background:var(--purple);color:#fff;border-color:var(--purple)}.modal{position:fixed;inset:0;background:rgba(41,32,53,.35);display:none;place-items:center;padding:20px;z-index:80}.modal.show{display:grid}.modal-card{width:min(470px,100%);background:#fff;border-radius:22px;padding:24px;position:relative;box-shadow:0 30px 80px rgba(33,24,47,.25)}.modal-close{position:absolute;right:15px;top:15px;border:0;background:#f4f0f8;width:30px;height:30px;border-radius:9px;font-size:18px;color:#7e7389}.admin-note-row{display:grid;grid-template-columns:38px 1fr auto;gap:12px;align-items:center;padding:12px 0;border-top:1px solid #f1edf4}.admin-note-row:first-child{border-top:0}.admin-actions{display:flex;gap:7px;align-items:center}.danger-btn{background:#fff0f2;color:#a3374d;border:1px solid #f2d8de}.nav-badge{margin-left:auto;min-width:18px;height:18px;background:#e66b9c;color:#fff;border-radius:99px;display:grid;place-items:center;font-size:8px}.quick-card{background:#fff;border:1px solid #eee8f2;border-radius:15px;padding:15px;display:grid;grid-template-columns:32px 1fr;gap:4px 10px}.quick-card>span{width:30px;height:30px;border-radius:9px;background:#f1ebfb;color:var(--purple);display:grid;place-items:center;grid-row:span 2}.quick-card b{font-size:10px}.quick-card small{font-size:9px;color:#9a929f}.admin-quick-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:15px}.activity-row{display:flex;gap:9px;padding:10px 0;border-bottom:1px solid #f1edf4}.activity-row:last-child{border-bottom:0}.activity-dot{width:8px;height:8px;border-radius:50%;background:#9f8acb;margin-top:4px}.activity-row strong{display:block;font-size:10px;text-transform:capitalize}.activity-row small{display:block;color:#9a929f;font-size:8px;margin-top:3px}.report-row{display:grid;grid-template-columns:1fr auto;gap:15px;padding:14px 0;border-top:1px solid #f0edf3}.report-row:first-child{border-top:0}.report-row strong{display:block;font-size:11px}.report-row span,.report-row small{display:block;color:#978f9f;font-size:9px;margin-top:4px;line-height:1.5}.report-form{display:flex;align-items:center;gap:7px}.report-form select{border:1px solid #e7e2ec;border-radius:10px;padding:8px;font-size:9px;background:#fff}.center{text-align:center;display:block;margin-top:12px}
@media(max-width:900px){.admin-quick-grid{grid-template-columns:repeat(2,1fr)}.report-row{grid-template-columns:1fr}.admin-note-row{grid-template-columns:38px 1fr}.admin-actions{grid-column:2;justify-content:flex-start}}
@media(max-width:520px){.admin-quick-grid{grid-template-columns:1fr 1fr}.admin-note-row{grid-template-columns:34px 1fr}.admin-actions{grid-column:1/-1}.admin-actions .btn{padding:8px 10px}.report-form{flex-wrap:wrap}}

.dashboard-subject-row{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:11px 0;border-bottom:1px solid #f1edf4}.dashboard-subject-row:last-child{border-bottom:0}.dashboard-subject-row strong{display:block;font-size:10px}.dashboard-subject-row small{display:block;color:#9a929f;font-size:8px;margin-top:3px}.subject-row-actions{display:flex;gap:6px;align-items:center}.subject-row-actions form,.mini-subject-actions form{margin:0}.btn:disabled{opacity:.45;cursor:not-allowed;transform:none!important}.mini-subject-actions{justify-self:end}
@media(max-width:600px){.dashboard-subject-row{grid-template-columns:1fr}.subject-row-actions{justify-content:flex-start}.mini-subject.large{grid-template-columns:75px 1fr}.mini-subject-actions{grid-column:2;justify-self:start}}

/* ----- QuickNotes v2 landing refinement ----- */
.hero-section{min-height:650px;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr);gap:65px;align-items:center;padding:48px 0 35px}
.hero-copy{min-width:0}.hero-copy h1{max-width:780px;margin-bottom:18px}.hero-copy p{max-width:660px}
.hero-actions{display:flex;flex-wrap:wrap;gap:11px;margin-top:27px}.hero-btn{min-height:46px}.register-gate{display:flex;align-items:center;gap:11px;max-width:530px;margin-top:19px;padding:12px 14px;background:rgba(255,255,255,.52);border:1px solid rgba(255,255,255,.85);border-radius:14px}.gate-icon{width:25px;height:25px;border-radius:50%;display:grid;place-items:center;background:#fff;color:var(--purple);font-size:11px;font-weight:950}.register-gate strong{display:block;font-size:11px}.register-gate small{display:block;color:#756d7d;font-size:9px;line-height:1.5;margin-top:2px}
.hero-visual{position:relative;min-height:510px;display:grid;place-items:center}.visual-glow{position:absolute;width:370px;height:370px;border-radius:50%;background:rgba(255,255,255,.38);filter:blur(2px)}.visual-device{position:relative;z-index:2;width:min(100%,405px);min-height:430px;border-radius:30px;background:#fff;padding:16px;box-shadow:0 28px 70px rgba(89,61,15,.16);transform:rotate(2deg)}.device-top{display:flex;justify-content:space-between;align-items:center;font-size:11px;font-weight:900;padding:5px 6px 12px}.device-user{width:27px;height:27px;border-radius:9px;background:#e8ddfa;color:var(--purple);display:grid;place-items:center}.device-banner{background:linear-gradient(125deg,#dfd1fa,#eee6fc);border-radius:19px;padding:22px;margin-bottom:10px}.device-banner small{font-size:7px;letter-spacing:1.3px;color:#8e79b8;font-weight:900}.device-banner strong{display:block;font-size:26px;line-height:1.03;letter-spacing:-1px;margin-top:7px}.device-stat-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.device-stat-row i{height:46px;border-radius:11px;background:#f4d45d}.device-stat-row i:nth-child(2){background:#6650a3}.device-stat-row i:nth-child(3){background:#e76a9c}.device-list{display:grid;gap:8px;margin-top:10px}.device-list div{display:grid;grid-template-columns:34px 1fr 18px;gap:9px;align-items:center;background:#faf8fd;padding:9px;border-radius:10px}.device-list span{width:32px;height:32px;border-radius:8px;background:#eee7f8;color:var(--purple);display:grid;place-items:center;font-size:7px;font-weight:950}.device-list b{font-size:9px}.device-list em{font-style:normal;color:#9e94aa;font-weight:900}.floating-card{position:absolute;z-index:4;background:rgba(255,255,255,.94);border:1px solid rgba(255,255,255,.9);box-shadow:0 15px 35px rgba(70,48,16,.12);border-radius:15px;padding:10px;display:flex;align-items:center;gap:9px}.floating-card span{width:28px;height:28px;border-radius:9px;background:#efe7fa;color:var(--purple);display:grid;place-items:center;font-size:8px;font-weight:950}.floating-card b{display:block;font-size:9px}.floating-card small{display:block;color:#99909f;font-size:8px;margin-top:2px}.floating-card i{font-style:normal;color:var(--purple);font-weight:900}.card-one{left:-6px;top:82px}.card-two{right:-4px;bottom:92px}.feature-section{padding:40px 0 34px}.feature-heading{max-width:650px}.feature-heading h2{font-size:34px;letter-spacing:-1.3px;margin:8px 0}.feature-heading p{font-size:13px;line-height:1.7;color:#726a7a}.feature-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:23px}.feature-grid article{background:rgba(255,255,255,.52);border:1px solid rgba(255,255,255,.82);border-radius:17px;padding:17px}.feature-grid article>span{width:31px;height:31px;border-radius:9px;display:grid;place-items:center;background:#fff;color:var(--purple);font-weight:900}.feature-grid h3{font-size:11px;margin:12px 0 5px}.feature-grid p{font-size:9px;line-height:1.55;color:#817989;margin:0}.landing-footer{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:28px 0 2px;border-top:1px solid rgba(255,255,255,.6);font-size:9px;color:#7b727f}.landing-footer span:first-child{font-size:11px;font-weight:900;color:var(--ink)}.landing-footer a{font-weight:850;color:var(--purple)}
@media(max-width:980px){.hero-section{grid-template-columns:1fr;gap:20px;padding-top:35px}.hero-copy{max-width:760px}.hero-visual{min-height:500px}.feature-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:620px){.landing-shell{padding:20px 15px 34px}.topbar nav a:first-child{display:none}.topbar nav{gap:7px}.topbar .btn.small{padding:8px 10px;font-size:10px}.hero-section{padding:35px 0 15px;min-height:auto}.hero-copy h1{font-size:48px;letter-spacing:-2.5px}.hero-copy p{font-size:14px;line-height:1.65}.hero-actions{display:grid;grid-template-columns:1fr}.hero-btn{width:100%}.hero-visual{min-height:450px}.visual-device{width:94%;min-height:395px}.device-banner strong{font-size:22px}.card-one{left:-8px;top:50px}.card-two{right:-4px;bottom:55px}.floating-card{padding:8px}.floating-card small{display:none}.feature-grid{grid-template-columns:1fr}.feature-heading h2{font-size:28px}.landing-footer{flex-wrap:wrap}.landing-footer a{width:100%}}

.hidden{display:none!important}.profile-avatar{margin-top:0}.recent-feed{min-height:30px}.note-actions{display:flex;gap:8px;align-items:center}.dashboard-subject-row{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:11px 0;border-bottom:1px solid #f1edf4}.dashboard-subject-row:last-child{border-bottom:0}.subject-row-actions{display:flex;gap:6px}.admin-note-row{min-width:0}.admin-note-row .note-meta{min-width:0}.admin-note-row .note-meta strong,.admin-note-row .note-meta span,.admin-note-row .note-meta small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:900px){.admin-note-row{grid-template-columns:36px minmax(0,1fr);}.admin-note-row .admin-actions{grid-column:2}.subject-row-actions{justify-content:flex-start}.report-row{grid-template-columns:1fr}}
@media(max-width:600px){.main-area{padding:16px}.welcome-banner{padding:24px 20px}.hero-section{padding-top:30px}.stat-grid{grid-template-columns:1fr 1fr}.content-grid{gap:10px}.panel{padding:16px}.search-bar{padding:10px}.note-card{padding:16px}.admin-quick-grid{grid-template-columns:1fr 1fr}.quick-card{padding:12px}.hero-actions{gap:8px}}

.loader-error{font-size:10px;color:#9a4052;max-width:270px;text-align:center;line-height:1.4}.dashboard-subject-panel{margin-top:15px}.dashboard-subject-panel .dashboard-subject-row{grid-template-columns:1fr auto}.dashboard-subject-panel .subject-row-actions{display:flex}.dashboard-subject-row strong{display:block;font-size:10px}.dashboard-subject-row small{display:block;color:#9a929f;font-size:8px;margin-top:3px}

.favorite-btn:disabled{opacity:.55;cursor:wait}

.course-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin-top:18px}.course-card{appearance:none;border:1px solid #eee9f2;background:#fff;border-radius:19px;padding:18px;text-align:left;display:grid;grid-template-columns:44px 1fr;gap:12px;cursor:pointer;transition:.2s}.course-card:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:#e3d8f1}.course-card h3{font-size:15px;line-height:1.25;margin:6px 0}.course-card p{font-size:10px;line-height:1.55;color:#938b99;min-height:32px}.course-card strong{font-size:9px;color:var(--purple)}.course-symbol{width:44px;height:44px;border-radius:13px;background:#eee6fa;color:var(--purple);display:grid;place-items:center;font-size:11px;font-weight:950}.course-symbol.large{width:52px;height:52px;font-size:13px}.course-detail{background:#fff;border:1px solid #eee9f2;border-radius:20px;padding:20px}.course-detail-head{display:flex;align-items:center;gap:13px;padding-bottom:13px;border-bottom:1px solid #f0edf4}.course-detail-head h2{margin:0 0 4px;font-size:21px}.course-detail-head p{margin:0;color:#938b99;font-size:10px;line-height:1.5}.course-count{display:inline-block;margin-top:6px;font-size:9px;background:#f2ebfa;color:var(--purple);padding:5px 8px;border-radius:99px;font-weight:850}.course-selector-panel{margin-top:18px}.course-selector-panel select{max-width:650px}.course-admin-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;align-items:center;padding:13px 0;border-bottom:1px solid #f0edf4}.course-admin-row:last-child{border-bottom:0}.course-admin-meta{min-width:0}.course-admin-meta strong{display:block;font-size:11px}.course-admin-meta small{display:block;color:#948c9b;font-size:8px;margin-top:3px}.course-admin-meta p{margin:4px 0 0;color:#9e96a4;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.course-admin-actions{display:flex;gap:7px;align-items:center}.course-admin-actions form{margin:0}.dashboard-course-panel{margin-top:15px}.notes-filter-grid{grid-template-columns:minmax(220px,1.4fr) minmax(180px,.8fr) minmax(180px,.8fr) minmax(130px,.5fr) 100px}.admin-quick-grid+.content-grid{margin-top:15px}
@media(max-width:1000px){.course-grid{grid-template-columns:repeat(2,1fr)}.notes-filter-grid{grid-template-columns:1fr 1fr}.notes-filter-grid input{grid-column:1/-1}.course-admin-row{grid-template-columns:44px minmax(0,1fr)}.course-admin-actions{grid-column:2;justify-content:flex-start}}
@media(max-width:650px){.course-grid{grid-template-columns:1fr}.course-card{grid-template-columns:40px 1fr}.notes-filter-grid{grid-template-columns:1fr}.notes-filter-grid input{grid-column:auto}.course-admin-row{grid-template-columns:38px minmax(0,1fr)}.course-admin-actions{grid-column:1/-1}.course-detail{padding:15px}.course-detail-head h2{font-size:18px}}
/* Upload progress UI — scoped to admin/upload.html. */
.upload-progress{display:flex;align-items:center;gap:14px;margin-bottom:18px;padding:14px 16px;border:1px solid var(--line,#dfe5ec);border-radius:14px;background:rgba(255,255,255,.72);box-shadow:0 10px 24px rgba(15,23,42,.06);}
.upload-progress.hidden{display:none;}
.upload-progress-spinner{width:20px;height:20px;flex:0 0 20px;border:3px solid currentColor;border-right-color:transparent;border-radius:50%;animation:qnUploadSpin .8s linear infinite;}
.upload-progress-copy{display:flex;flex-direction:column;gap:3px;min-width:0;}
.upload-progress-copy strong{font-size:.92rem;}
.upload-progress-copy span{font-size:.78rem;opacity:.72;}
.upload-progress-bar{position:relative;overflow:hidden;height:4px;flex:1;min-width:90px;border-radius:999px;background:rgba(100,116,139,.16);}
.upload-progress-bar span{position:absolute;inset:0 auto 0 0;width:38%;border-radius:999px;background:currentColor;animation:qnUploadProgress 1.15s ease-in-out infinite;}
@keyframes qnUploadSpin{to{transform:rotate(360deg);}}
@keyframes qnUploadProgress{0%{transform:translateX(-140%)}50%{transform:translateX(95%)}100%{transform:translateX(300%)}}
@media (max-width:640px){.upload-progress{align-items:flex-start;flex-wrap:wrap}.upload-progress-bar{flex-basis:100%;margin-left:34px;width:calc(100% - 34px);}}

/* UI refresh — inspired by the supplied dashboard reference. Visual-only override; functionality/layout markup is preserved. */
.app-body{
  background:#e9edf4;
  overflow-x:hidden;
}
.app-shell{
  width:min(1440px,calc(100% - 36px));
  min-height:calc(100vh - 56px);
  margin:28px auto;
  grid-template-columns:228px minmax(0,1fr);
  background:#fff;
  border:1px solid rgba(225,229,237,.95);
  border-radius:30px;
  overflow:hidden;
  box-shadow:0 24px 70px rgba(48,55,75,.10);
}
.sidebar{
  padding:24px 16px 20px;
  background:#fff;
  border-right:1px solid #edf0f5;
  gap:16px;
}
.side-brand{padding:0 7px 12px}
.side-brand .brand-logo{width:36px;height:36px;border-radius:10px;box-shadow:none}
.create-note{
  padding:11px;
  border-radius:14px;
  background:#f8f7fc;
  border-color:#ece9f5;
}
.side-nav{gap:4px}
.side-nav a{
  min-height:42px;
  padding:10px 12px;
  border-radius:12px;
  color:#8a8792;
  font-size:11px;
  font-weight:800;
}
.side-nav a.active{
  background:#f1ecfb;
  color:var(--purple);
  box-shadow:inset 3px 0 0 var(--purple);
}
.side-nav a:hover{background:#f6f3fb;color:var(--purple)}
.side-promo{border-radius:18px;padding:16px;background:linear-gradient(145deg,#f4d75f,#e9defb)}
.side-logout{padding:10px 12px;border-radius:10px}
.side-logout:hover{background:#f7f5fa;color:var(--purple)}
.main-area{
  padding:24px 34px 20px;
  background:#fff;
}
.app-header{min-height:50px}
.mobile-menu{
  width:38px;height:38px;margin-right:8px;
  border:1px solid #e6e1ef;
  border-radius:11px;
  background:#fff;
  color:var(--purple);
  box-shadow:0 5px 14px rgba(62,38,112,.06);
}
.page-kicker{font-size:10px;letter-spacing:1.4px;color:#8d8796}
.date-line{font-size:10px;color:#aaa5b0}
.header-actions{gap:10px}
.avatar{width:34px;height:34px;border-radius:11px;background:#eee7fb;color:var(--purple)}
.user-chip{font-size:10px}
.welcome-banner,
.page-hero{
  margin-top:20px;
  border-radius:22px;
  border:1px solid #ede9f6;
  box-shadow:0 12px 35px rgba(59,42,92,.06);
}
.welcome-banner{
  min-height:154px;
  padding:28px 30px;
  background:linear-gradient(120deg,#eee8fb 0%,#f8f5fc 100%);
}
.welcome-banner h1{font-size:30px;letter-spacing:-1px}
.welcome-banner p{max-width:520px;font-size:11px}
.page-hero{background:linear-gradient(120deg,#eee8fb,#faf9fd)}
.page-hero h1{font-size:30px;letter-spacing:-1px}
.section-head{margin:26px 0 12px}
.section-head h2{font-size:17px}
.stat-grid{gap:12px}
.stat-card{
  min-height:76px;
  padding:14px;
  border-radius:16px;
  box-shadow:0 8px 22px rgba(55,44,82,.07);
}
.stat-card.yellow{background:#f5d75e;color:#4c4020}
.stat-card.purple{background:#604aa0}
.stat-card.pink{background:#e86d9c}
.stat-card.lavender{background:#cfc1eb;color:#403654}
.stat-icon{width:34px;height:34px;border-radius:10px}
.stat-card strong{font-size:23px}
.stat-card small{font-size:9px}
.content-grid{gap:16px;margin-top:18px}
.panel{
  border-color:#edf0f4;
  border-radius:19px;
  padding:20px;
  box-shadow:0 8px 24px rgba(55,62,79,.035);
}
.recent-feed{display:grid;gap:9px}
.recent-feed .note-row{
  margin:0;
  border:0;
  min-height:74px;
  padding:13px 14px;
  grid-template-columns:40px minmax(0,1fr) 36px;
  border-radius:15px;
  box-shadow:0 7px 16px rgba(50,45,75,.05);
}
.recent-feed .note-row:nth-child(1){background:#5d4a9e;color:#fff}
.recent-feed .note-row:nth-child(2){background:#b964df;color:#fff}
.recent-feed .note-row:nth-child(3){background:#f2d04f;color:#3f371d}
.recent-feed .note-row:nth-child(4){background:#df708f;color:#fff}
.recent-feed .note-row:nth-child(5){background:#bca9df;color:#3f3557}
.recent-feed .note-row .file-icon{background:rgba(255,255,255,.22);color:inherit}
.recent-feed .note-meta strong{font-size:11px}
.recent-feed .note-meta span,
.recent-feed .note-meta small{color:inherit;opacity:.76}
.recent-feed .icon-btn{background:rgba(255,255,255,.23);color:inherit;border:1px solid rgba(255,255,255,.18)}
.tips-panel{background:#fff}
.action-tile{
  padding:13px 0;
  border-bottom-color:#f0f1f4;
}
.action-tile>span{background:#f1ebfb;width:32px;height:32px}
.action-tile em{color:#aaa5b0}
.live-pill{padding:6px 8px;font-size:8px}
.course-grid{gap:12px}
.course-card,
.note-card,
.subject-card{
  border-color:#eceff3;
  box-shadow:0 8px 22px rgba(50,58,76,.035);
}
.course-card:hover,.subject-card:hover,.note-card:hover{box-shadow:0 14px 30px rgba(50,58,76,.08)}
.note-card{border-radius:18px}
.note-file{border:1px solid #f0edf5}
.search-bar{box-shadow:0 8px 22px rgba(50,58,76,.035)}
.form-layout{margin-top:20px}
.drop-zone{background:#faf9fd}
.admin-quick-grid{gap:11px}
.quick-card{border-color:#eceff3;box-shadow:0 8px 20px rgba(50,58,76,.035)}
.admin-note-row{padding:12px 0}
.footer{padding-top:20px}

/* More comfortable mobile experience. */
@media(max-width:1050px){
  .app-shell{width:min(100% - 24px,1440px);margin:12px auto;min-height:calc(100vh - 24px)}
  .main-area{padding:22px 24px 18px}
}
@media(max-width:820px){
  .app-shell{width:100%;margin:0;min-height:100vh;border:0;border-radius:0;box-shadow:none;grid-template-columns:1fr}
  .sidebar{
    width:274px;
    left:-290px;
    top:0;
    bottom:0;
    padding:22px 16px 18px;
    box-shadow:18px 0 45px rgba(38,31,55,.18);
  }
  .sidebar.open{left:0}
  .main-area{padding:16px 15px 18px;min-width:0}
  .app-header{min-height:48px}
  .mobile-menu{display:inline-grid;place-items:center;width:40px;height:40px;font-size:20px}
  .header-actions{gap:7px}
  .welcome-banner,.page-hero{margin-top:16px;border-radius:18px}
  .welcome-banner{min-height:148px;padding:23px 20px}
  .welcome-banner h1{font-size:28px}
  .banner-illustration{right:-55px;opacity:.34;transform:scale(.9)}
  .page-hero{padding:22px 20px}
  .page-hero h1{font-size:27px}
  .section-head{align-items:center;margin-top:22px}
  .section-head .text-link{font-size:10px}
  .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .stat-card{min-height:72px;padding:12px}
  .content-grid{grid-template-columns:1fr;gap:12px}
  .panel{padding:16px;border-radius:17px}
  .recent-feed .note-row{grid-template-columns:38px minmax(0,1fr) 34px;min-height:69px;padding:12px}
  .course-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .notes-grid{grid-template-columns:1fr}
  .subject-grid{grid-template-columns:1fr}
  .form-layout{grid-template-columns:1fr;gap:12px}
  .search-bar{grid-template-columns:1fr;padding:11px}
  .search-bar input,.search-bar select,.search-bar .btn{min-height:44px}
  .admin-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .admin-actions{flex-wrap:wrap}
}
@media(max-width:560px){
  .main-area{padding:13px 11px 16px}
  .app-header{align-items:flex-start}
  .page-kicker{font-size:9px}
  .date-line{max-width:210px;line-height:1.35}
  .header-actions{margin-top:2px}
  .user-chip span:last-child{display:none}
  .avatar{width:36px;height:36px}
  .welcome-banner{padding:20px 18px;min-height:142px}
  .welcome-banner h1{font-size:25px}
  .welcome-banner p{font-size:10px;max-width:240px;line-height:1.55}
  .banner-illustration{right:-76px;opacity:.24;transform:scale(.78)}
  .section-head{gap:10px}
  .section-head h2{font-size:16px}
  .stat-card{min-height:68px;border-radius:14px;padding:10px}
  .stat-icon{width:30px;height:30px;font-size:11px}
  .stat-card strong{font-size:20px}
  .stat-card small{font-size:8px}
  .recent-feed .note-row{grid-template-columns:34px minmax(0,1fr) 32px;gap:9px;padding:10px;border-radius:13px}
  .recent-feed .note-row .file-icon{width:34px;height:34px}
  .recent-feed .note-meta strong{font-size:10px}
  .recent-feed .note-meta span,.recent-feed .note-meta small{font-size:8px}
  .icon-btn{width:30px;height:30px}
  .course-grid{grid-template-columns:1fr}
  .course-card{grid-template-columns:40px 1fr;padding:15px}
  .course-symbol{width:40px;height:40px}
  .note-card{padding:15px}
  .note-card h3{font-size:13px}
  .admin-quick-grid{grid-template-columns:1fr}
  .quick-card{padding:13px}
  .upload-progress{padding:13px}
}


/* Mobile usability enhancement — no desktop layout changes. */
.mobile-sidebar-backdrop{
  display:none;
}
@media(max-width:820px){
  html,body{max-width:100%;overflow-x:hidden}
  body.sidebar-open{overflow:hidden}
  .app-shell{position:relative}
  .sidebar{z-index:120;max-width:86vw;overscroll-behavior:contain}
  .mobile-sidebar-backdrop{
    position:fixed;inset:0;display:block;background:rgba(32,27,45,.28);backdrop-filter:blur(2px);
    opacity:0;visibility:hidden;pointer-events:none;transition:.22s ease;z-index:110;
  }
  .mobile-sidebar-backdrop.show{opacity:1;visibility:visible;pointer-events:auto}
  .main-area{width:100%;max-width:100%;overflow:visible}
  .app-header{gap:10px}
  .app-header>div:first-child{min-width:0}
  .header-actions{flex:0 0 auto}
  .welcome-banner,.page-hero,.panel,.search-bar,.course-detail,.drop-zone,.form-card{max-width:100%;overflow:hidden}
  .welcome-banner h1,.page-hero h1,.section-head h2,.panel h2{overflow-wrap:anywhere}
  .search-bar input,.search-bar select,.search-bar button,.stack-form input,.stack-form select,.stack-form textarea{min-height:44px}
  .btn{min-height:42px}
  .action-tile{min-height:58px}
  .note-row,.course-card,.subject-card,.note-card,.admin-note-row,.report-row{min-width:0}
  .note-meta{min-width:0}
  .note-meta strong,.note-meta span,.note-meta small{overflow-wrap:anywhere}
  .footer{padding-bottom:8px}
}
@media(max-width:560px){
  .mobile-menu{width:42px;height:42px;flex:0 0 42px}
  .admin-banner > div:first-child{min-width:0;flex:1}
  .admin-banner h1{overflow-wrap:normal;word-break:normal}
  .admin-banner .btn{flex:0 0 auto;max-width:110px;text-align:center}
  .main-area{padding-inline:12px}
  .app-header{min-height:46px}
  .page-kicker{letter-spacing:1.1px}
  .welcome-banner,.page-hero{box-shadow:0 8px 24px rgba(59,42,92,.05)}
  .welcome-banner{min-height:136px;padding:18px 16px}
  .welcome-banner h1{font-size:23px;line-height:1.08}
  .welcome-banner p{font-size:10px;line-height:1.6}
  .banner-illustration{right:-92px;opacity:.20;transform:scale(.72)}
  .page-hero{padding:18px 16px}
  .page-hero h1{font-size:23px;line-height:1.1}
  .section-head{margin-top:18px}
  .section-head .text-link{white-space:nowrap}
  .stat-grid{grid-template-columns:1fr 1fr;gap:8px}
  .stat-card{min-width:0;padding:10px 9px}
  .stat-card strong{font-size:19px}
  .stat-card small{line-height:1.25}
  .content-grid{gap:10px}
  .panel{padding:14px;border-radius:16px}
  .search-bar{padding:9px;gap:8px}
  .search-bar .btn{width:100%}
  .course-card{padding:13px;gap:10px;border-radius:16px}
  .course-card h3{font-size:13px}
  .course-card p{font-size:9px;min-height:auto}
  .course-detail-head{align-items:flex-start}
  .course-detail-head h2{font-size:17px}
  .note-card{padding:13px;border-radius:16px}
  .note-card h3{font-size:12px;line-height:1.35}
  .note-file{font-size:9px;gap:8px}
  .note-bottom{gap:8px;align-items:stretch;flex-wrap:wrap}
  .note-bottom .btn{width:100%}
  .admin-quick-grid{grid-template-columns:1fr 1fr;gap:8px}
  .quick-card{min-width:0}
  .admin-actions{width:100%;display:flex;gap:7px}
  .admin-actions .btn{flex:1;min-width:0}
  .report-row{gap:10px!important}
  .report-form{width:100%;display:grid;grid-template-columns:1fr auto;gap:7px}
  .report-form select{min-width:0}
  .upload-progress{gap:10px}
  .upload-progress-bar{margin-left:30px;width:calc(100% - 30px)}
}

/* Mobile header title centered — mobile only. */
@media(max-width:820px){
  .app-header{position:relative;display:block;text-align:center;min-height:52px;padding:0 48px}
  .app-header>div:first-child{display:block;width:100%;min-width:0}
  .app-header .mobile-menu{position:absolute;left:0;top:0;margin:0;z-index:2}
  .app-header .page-kicker,.app-header .date-line{display:block;text-align:center}
  .app-header .header-actions{position:absolute;right:0;top:0;display:flex;z-index:2}
}
@media(max-width:560px){
  .app-header{min-height:50px;padding:0 44px}
}


/* Consistent mobile app header — student and admin pages. */
@media (max-width:820px){
  .app-header{
    position:relative;
    display:grid;
    grid-template-columns:42px minmax(0,1fr) 42px;
    align-items:start;
    justify-items:center;
    gap:0;
    min-height:52px;
    padding:0;
    text-align:center;
  }
  .app-header>div:first-child{
    grid-column:2;
    width:100%;
    min-width:0;
    text-align:center;
  }
  .app-header .mobile-menu{
    position:absolute;
    left:0;
    top:0;
    margin:0;
    z-index:2;
  }
  .app-header .page-kicker,
  .app-header .date-line{
    display:block;
    width:100%;
    max-width:none;
    margin-left:0;
    margin-right:0;
    text-align:center;
  }
  .app-header .header-actions{
    position:absolute;
    right:0;
    top:0;
    z-index:2;
    margin-top:0;
  }
}
@media (max-width:560px){
  .app-header{min-height:50px;grid-template-columns:42px minmax(0,1fr) 42px;}
  .app-header .page-kicker{font-size:9px;letter-spacing:1.1px;}
  .app-header .date-line{font-size:10px;line-height:1.35;}
}

/* Dynamic list viewport optimization — keeps long live data inside a scrollable panel. */
#downloadsList,
#courseList,
#subjectList,
#dashboardCourses,
#dashboardSubjects,
#adminNotesList,
#userList,
#reportList,
#adminRecent,
#activities{
  max-height:520px;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}

#downloadsList .note-row,
#courseList .course-admin-row,
#subjectList .dashboard-subject-row,
#dashboardCourses .dashboard-subject-row,
#dashboardSubjects .dashboard-subject-row,
#adminNotesList .admin-note-row,
#userList .admin-note-row,
#reportList .report-row,
#adminRecent .note-row,
#activities .activity-row{
  min-width:0;
}

#downloadsList .note-meta,
#adminRecent .note-meta,
#courseList .course-admin-meta,
#adminNotesList .note-meta,
#userList .note-meta,
#reportList > .report-row > div:first-child,
#activities .activity-row > div:last-child{
  min-width:0;
  overflow-wrap:anywhere;
}

@media(max-width:820px){
  #downloadsList,
  #courseList,
  #subjectList,
  #dashboardCourses,
  #dashboardSubjects,
  #adminNotesList,
  #userList,
  #reportList,
  #adminRecent,
  #activities{
    max-height:430px;
    -webkit-overflow-scrolling:touch;
  }
}

@media(max-width:560px){
  #downloadsList,
  #courseList,
  #subjectList,
  #dashboardCourses,
  #dashboardSubjects,
  #adminNotesList,
  #userList,
  #reportList,
  #adminRecent,
  #activities{
    max-height:380px;
  }
}

/* Activity list: show four items, then scroll on desktop and mobile. */
#activities{
  height:172px !important;
  max-height:172px !important;
  overflow-y:auto !important;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}

/* Download history: keep exactly four rows in view, then scroll. */
#downloadsList{
  height:324px !important;
  max-height:324px !important;
  overflow-y:auto !important;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}
#downloadsList .note-row{
  min-height:76px;
}
@media(max-width:560px){
  #downloadsList{
    height:276px !important;
    max-height:276px !important;
  }
  #downloadsList .note-row{
    min-height:64px;
  }
}

/* Dynamic data lists: keep four items visible, then scroll (desktop + mobile). */
#adminNotesList,
#userList,
#reportList,
#courseList,
#subjectList,
#dashboardCourses,
#dashboardSubjects,
#adminRecent,
#activities{
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}

/* Desktop: four normal rows before internal scrolling begins. */
#adminNotesList,
#userList{
  height:276px !important;
  max-height:276px !important;
}
#reportList{
  height:300px !important;
  max-height:300px !important;
}
#courseList{
  height:292px !important;
  max-height:292px !important;
}
#subjectList,
#dashboardCourses,
#dashboardSubjects{
  height:228px !important;
  max-height:228px !important;
}
#adminRecent{
  height:306px !important;
  max-height:306px !important;
}
#activities{
  height:172px !important;
  max-height:172px !important;
}

/* Preserve compact rows so the four-row viewport remains predictable. */
#adminNotesList .admin-note-row,
#userList .admin-note-row{
  min-height:60px;
  box-sizing:border-box;
}
#reportList .report-row{
  min-height:68px;
  box-sizing:border-box;
}
#courseList .course-admin-row{
  min-height:73px;
  box-sizing:border-box;
}
#subjectList .dashboard-subject-row,
#dashboardCourses .dashboard-subject-row,
#dashboardSubjects .dashboard-subject-row{
  min-height:55px;
  box-sizing:border-box;
}
#adminRecent .note-row{
  min-height:72px;
  box-sizing:border-box;
}
#activities .activity-row{
  min-height:43px;
  box-sizing:border-box;
}

/* Mobile: allow the same four-item pattern while giving wrapped controls room. */
@media(max-width:820px){
  #adminNotesList,
  #userList{height:340px !important;max-height:340px !important;}
  #reportList{height:330px !important;max-height:330px !important;}
  #courseList{height:340px !important;max-height:340px !important;}
  #subjectList,
  #dashboardCourses,
  #dashboardSubjects{height:300px !important;max-height:300px !important;}
  #adminRecent{height:300px !important;max-height:300px !important;}
  #activities{height:172px !important;max-height:172px !important;}
}

@media(max-width:560px){
  #adminNotesList,
  #userList{height:332px !important;max-height:332px !important;}
  #reportList{height:320px !important;max-height:320px !important;}
  #courseList{height:330px !important;max-height:330px !important;}
  #subjectList,
  #dashboardCourses,
  #dashboardSubjects{height:286px !important;max-height:286px !important;}
  #adminRecent{height:292px !important;max-height:292px !important;}
  #activities{height:172px !important;max-height:172px !important;}
}

/* Keep long values from expanding any list beyond the viewport width. */
#adminNotesList .note-meta,
#userList .note-meta,
#reportList .report-row > div:first-child,
#courseList .course-admin-meta,
#subjectList .dashboard-subject-row > div:first-child,
#dashboardCourses .dashboard-subject-row > div:first-child,
#dashboardSubjects .dashboard-subject-row > div:first-child,
#adminRecent .note-meta,
#activities .activity-row > div:last-child{
  min-width:0;
  overflow-wrap:anywhere;
}


/* Small separation between standalone content blocks that previously touched. */
.welcome-banner + .stat-grid,
.page-hero + .notes-grid{
  margin-top:10px;
}

/* Final layout audit: only bounds long/growing content; normal content appearance is unchanged. */
.welcome-banner > div:first-child,
.page-hero > div,
.section-head > div:first-child,
.course-detail-head > div:last-child,
.course-card > div:last-child,
.note-card,
.note-card-top,
.note-meta,
.admin-note-row > .note-meta,
.report-row > div:first-child,
.dashboard-subject-row > div:first-child{
  min-width:0;
}

.note-card h3,
.note-card p,
.note-file,
.note-file span,
.course-detail-head h2,
.course-detail-head p,
.course-card h3,
.course-card p,
.subject-card h3,
.subject-card p,
.page-hero p,
.welcome-banner p{
  overflow-wrap:anywhere;
}

.note-file{
  min-width:0;
  overflow:hidden;
}
.note-file span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Student dashboard live feed: four rows visible, then internal scroll. */
#recentNotes{
  height:288px;
  max-height:288px;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}
#recentNotes .note-row{
  height:72px;
  min-height:72px;
  box-sizing:border-box;
}
#recentNotes .note-meta strong,
#recentNotes .note-meta span,
#recentNotes .note-meta small{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Favorites can grow indefinitely; keep the page itself stable and scroll the list. */
#favoritesGrid{
  max-height:640px;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
  align-content:start;
}

/* Course picker can also grow when many courses are added. */
#courseArea > .course-grid{
  max-height:560px;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
  align-content:start;
}

/* Keep each semester subject collection bounded when a course has many modules. */
#semesterSections .subject-grid{
  max-height:560px;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
  align-content:start;
}

/* Long moderation/report controls should wrap instead of widening the page. */
.report-form{min-width:0;max-width:100%;}
.report-row > div{min-width:0;}
.pagination{flex-wrap:wrap;max-width:100%;overflow:hidden;padding-inline:2px;}
.pagination-dots{width:31px;height:31px;display:grid;place-items:center;font-size:11px;color:#9a929f;flex:0 0 31px;}

@media(max-width:820px){
  #recentNotes{height:276px;max-height:276px;}
  #recentNotes .note-row{height:69px;min-height:69px;}
  #favoritesGrid{max-height:600px;}
  #courseArea > .course-grid,
  #semesterSections .subject-grid{max-height:520px;}
  .report-form{flex-wrap:wrap;}
}
@media(max-width:560px){
  #recentNotes{height:256px;max-height:256px;}
  #recentNotes .note-row{height:64px;min-height:64px;}
  #favoritesGrid{max-height:520px;}
  #courseArea > .course-grid,
  #semesterSections .subject-grid{max-height:500px;}
  .section-head > div:first-child{min-width:0;}
  .page-hero p{max-width:100%;}
}
