:root{--bg:#f4f7fb;--card:#fff;--ink:#142033;--muted:#68758a;--line:#dde4ee;--nav:#142238;--nav2:#1b2e49;--blue:#3f6fde;--blue-soft:#edf3ff;--teal:#2e8e89;--green:#247a55;--green-soft:#edf8f2;--amber:#9a6b18;--amber-soft:#fff7e8;--red:#a84b50;--red-soft:#fff0f1;--shadow:0 10px 30px rgba(20,32,51,.07);--radius:18px}*{box-sizing:border-box}html{color-scheme:light}body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Arial,sans-serif;line-height:1.45}.app-shell{min-height:100vh;display:grid;grid-template-columns:240px 1fr}.sidebar{background:var(--nav);color:#dfe8f5;padding:20px 16px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:#fff;padding:8px 7px 20px}.brand-mark{width:38px;height:38px;border-radius:11px;background:linear-gradient(145deg,#4d7de2,#2d5cb8);display:grid;place-items:center;font-weight:900;box-shadow:inset 0 0 0 1px rgba(255,255,255,.14)}.brand strong,.brand small{display:block}.brand small{color:#9fb0c8;margin-top:2px}.sidebar nav{display:grid;gap:6px}.nav-link{color:#b9c7da;text-decoration:none;padding:11px 12px;border-radius:11px;font-size:14px}.nav-link:hover{background:rgba(255,255,255,.06);color:#fff}.nav-link.active{background:#243b5e;color:#fff}.side-footer{margin-top:auto;border-top:1px solid rgba(255,255,255,.12);padding:16px 8px 4px;font-size:12px;color:#9fb0c8;display:grid;gap:4px}.side-footer strong{color:#eaf1fb}.side-footer a{color:#bcd2ff;text-decoration:none;margin-top:8px}.main{min-width:0}.topbar{height:78px;background:rgba(255,255,255,.86);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:14px;padding:0 28px;position:sticky;top:0;z-index:10}.topbar h1{font-size:23px;margin:0;letter-spacing:-.02em}.topbar>div{flex:1}.menu-btn{display:none;border:0;background:transparent;font-size:22px}.content{max-width:1280px;margin:0 auto;padding:28px}.hero{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:24px}.eyebrow{font-size:13px;color:var(--blue);font-weight:700;margin-bottom:5px}.hero h2{font-size:30px;line-height:1.18;margin:0 0 8px;letter-spacing:-.03em}.hero p{margin:0;color:var(--muted);max-width:720px}.pill{display:inline-flex;align-items:center;gap:7px;border:1px solid #d5dfef;background:#f8fbff;color:#506179;border-radius:999px;padding:8px 11px;font-size:12px;white-space:nowrap}.grid{display:grid;gap:16px}.quick-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:24px}.dashboard-grid{grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);align-items:start}.subject-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.card-pad{padding:20px}.quick-card{display:flex;flex-direction:column;min-height:150px;padding:19px;text-decoration:none;color:inherit;transition:.18s transform,.18s box-shadow,.18s border-color}.quick-card:hover{transform:translateY(-2px);border-color:#c6d4ea;box-shadow:0 16px 36px rgba(20,32,51,.1)}.quick-icon{width:42px;height:42px;border-radius:12px;background:var(--blue-soft);color:var(--blue);display:grid;place-items:center;font-weight:800;margin-bottom:16px}.quick-card strong{font-size:16px}.quick-card span{font-size:13px;color:var(--muted);margin-top:5px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:30px 0 12px}.section-head h3{margin:0;font-size:18px}.section-head a{color:var(--blue);text-decoration:none;font-size:13px}.list{display:grid}.list-row{display:flex;gap:14px;align-items:center;padding:14px 0;border-bottom:1px solid var(--line)}.list-row:last-child{border-bottom:0}.list-main{flex:1;min-width:0}.list-main strong{display:block;font-size:14px}.list-main small{display:block;color:var(--muted);margin-top:3px}.status{font-size:12px;border-radius:999px;padding:5px 9px;background:#f0f3f7;color:#617086}.status.blue{background:var(--blue-soft);color:#355eae}.status.green{background:var(--green-soft);color:var(--green)}.status.amber{background:var(--amber-soft);color:var(--amber)}.empty{padding:24px;text-align:center;color:var(--muted);font-size:14px}.subject-card{padding:17px;display:flex;flex-direction:column;gap:13px}.subject-top{display:flex;align-items:center;gap:10px}.subject-icon{font-size:21px}.subject-title{font-weight:750}.subject-meta{font-size:12px;color:var(--muted);margin-top:1px}.actions{display:flex;gap:8px;flex-wrap:wrap}.btn,.ghost-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:10px 14px;border-radius:11px;border:1px solid transparent;font:inherit;font-weight:700;font-size:13px;text-decoration:none;cursor:pointer}.btn{background:var(--blue);color:white}.btn:hover{background:#345fc2}.ghost-btn{background:#fff;color:#40506a;border-color:var(--line)}.ghost-btn:hover{background:#f8fafc}.ghost-btn.small{min-height:36px;padding:8px 11px}.btn.secondary{background:#edf3ff;color:#355eae}.btn.danger{background:var(--red-soft);color:var(--red)}.btn:disabled{opacity:.45;cursor:not-allowed}.form-card{max-width:860px;margin:0 auto}.form-head{padding:22px 24px;border-bottom:1px solid var(--line)}.form-head h2{margin:0 0 5px;font-size:22px}.form-head p{margin:0;color:var(--muted);font-size:14px}.form-body{padding:24px}.field{margin-bottom:20px}.field label,.field .label{display:block;font-size:14px;font-weight:750;margin-bottom:7px}.field small{display:block;color:var(--muted);margin-top:6px}.input,select,textarea,input[type=date],input[type=text],input[type=url],input[type=password]{width:100%;border:1px solid #cad5e3;background:#fff;color:var(--ink);border-radius:12px;padding:12px 13px;font:inherit;outline:none;transition:.15s border-color,.15s box-shadow}.input:focus,select:focus,textarea:focus,input:focus{border-color:#6f92e8;box-shadow:0 0 0 3px rgba(63,111,222,.12)}textarea{min-height:105px;resize:vertical}.radio-grid{display:grid;gap:10px}.choice{display:flex;align-items:flex-start;gap:10px;border:1px solid var(--line);border-radius:13px;padding:13px;cursor:pointer}.choice:hover{background:#fbfcfe}.choice input{margin-top:3px}.choice strong{display:block;font-size:14px}.choice span small{margin-top:3px}.process-box{background:#f7faff;border:1px solid #ccdbf3;border-radius:15px;padding:16px}.form-actions{display:flex;gap:10px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:20px;margin-top:24px}.form-actions .btn{min-width:190px}.notice{border-radius:13px;padding:13px 15px;font-size:13px;margin-bottom:18px}.notice.info{background:var(--blue-soft);color:#355eae}.notice.warn{background:var(--amber-soft);color:#7c5515}.notice.success{background:var(--green-soft);color:var(--green)}.hidden{display:none!important}.preview-box{margin-top:18px;border:1px dashed #bac6d6;background:#fafcff;border-radius:13px;padding:14px;font-size:13px;color:#526078;white-space:pre-wrap;max-height:280px;overflow:auto}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse}.table th,.table td{text-align:left;padding:12px 13px;border-bottom:1px solid var(--line);font-size:13px;vertical-align:top}.table th{color:#66758a;font-weight:700;background:#fbfcfe}.admin-row{display:grid;grid-template-columns:180px 1fr 1fr;gap:10px;align-items:center;padding:11px 0;border-bottom:1px solid var(--line)}.admin-row:last-child{border-bottom:0}.admin-row strong{font-size:13px}.toast{position:fixed;right:22px;bottom:22px;background:#18263a;color:#fff;padding:12px 15px;border-radius:12px;box-shadow:0 12px 30px rgba(0,0,0,.22);opacity:0;transform:translateY(8px);pointer-events:none;transition:.2s;z-index:100}.toast.show{opacity:1;transform:translateY(0)}@media(max-width:1050px){.quick-grid{grid-template-columns:repeat(2,1fr)}.subject-grid{grid-template-columns:repeat(2,1fr)}.dashboard-grid{grid-template-columns:1fr}}@media(max-width:780px){.app-shell{grid-template-columns:1fr}.sidebar{position:fixed;left:0;top:0;bottom:0;width:250px;z-index:50;transform:translateX(-105%);transition:.2s;height:100vh}.sidebar.open{transform:translateX(0)}.menu-btn{display:block}.topbar{padding:0 16px}.content{padding:20px 14px}.quick-grid,.subject-grid{grid-template-columns:1fr}.hero{flex-direction:column}.hero h2{font-size:26px}.form-body,.form-head{padding-left:16px;padding-right:16px}.admin-row{grid-template-columns:1fr}.form-actions .btn,.form-actions .ghost-btn{width:100%}}
.muted{color:var(--muted)}.quick-grid-6{grid-template-columns:repeat(3,minmax(0,1fr))}.metric-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.metric-card{border:1px solid var(--line);border-radius:14px;padding:14px;background:#fbfcfe}.metric-card span,.metric-card small{display:block;color:var(--muted);font-size:12px}.metric-card strong{display:block;font-size:24px;margin:3px 0;color:var(--ink)}.progress-card .score-row{display:flex;align-items:baseline;gap:9px;border-top:1px solid var(--line);padding-top:12px}.progress-card .score-row strong{font-size:24px}.progress-card .score-row span,.compare-note{font-size:12px;color:var(--muted)}.mini-block{display:grid;gap:3px;border-top:1px solid var(--line);padding-top:10px}.mini-block b{font-size:12px}.mini-block span{font-size:12px;color:var(--muted)}.chip-list{display:flex;flex-wrap:wrap;gap:8px}.chip{display:inline-flex;gap:5px;align-items:center;border:1px solid var(--line);background:#f8fafc;border-radius:999px;padding:7px 10px;font-size:12px;color:#536178}.chip b{color:var(--ink)}input[type=file]{width:100%;border:1px dashed #b9c7d8;border-radius:12px;padding:14px;background:#fafcff;color:var(--muted)}code{font-size:12px;background:#f2f5f9;border:1px solid #e0e6ef;border-radius:6px;padding:2px 5px}@media(max-width:1050px){.quick-grid-6{grid-template-columns:repeat(2,1fr)}.metric-grid{grid-template-columns:repeat(3,1fr)}}@media(max-width:780px){.quick-grid-6,.metric-grid{grid-template-columns:1fr}}

/* V3 · Student / Parent split */
.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:var(--bg)}
.login-card{width:min(430px,100%);padding:26px}.login-brand{display:flex;align-items:center;gap:14px;margin-bottom:22px}.login-brand h1{margin:0;font-size:24px}.login-brand p{margin:3px 0 0;color:var(--muted)}.login-parent-link{text-align:center;margin-top:16px}.login-parent-link a{color:var(--muted);font-size:13px}
.student-hero{margin-bottom:18px}.student-subject-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.subject-launch-card{display:flex;flex-direction:column;gap:14px;padding:18px;text-decoration:none;color:inherit;transition:.18s transform,.18s box-shadow,.18s border-color}.subject-launch-card:hover{transform:translateY(-2px);border-color:#c5d3e8;box-shadow:0 16px 36px rgba(20,32,51,.1)}.subject-card-statuses{display:flex;flex-wrap:wrap;gap:7px;min-height:26px}.subject-open{margin-top:auto;padding-top:12px;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;color:var(--blue);font-weight:700;font-size:13px}.student-secondary-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:22px;color:var(--muted);font-size:13px}.student-secondary-actions a{color:#506789;text-decoration:none;border-bottom:1px solid #c9d3e0}.subject-focus{max-width:900px;margin:0 auto}.subject-focus-head{display:flex;align-items:center;gap:16px;margin-bottom:22px}.subject-icon.large{width:64px;height:64px;font-size:30px;border-radius:18px}.subject-focus h2{margin:0 0 4px;font-size:28px}.subject-focus p{margin:0;color:var(--muted)}.subject-action-stack{display:grid;gap:12px}.action-tile{display:block;border:1px solid var(--line);border-radius:14px;padding:17px;text-decoration:none;color:inherit;background:#fff;transition:.16s}.action-tile:hover{border-color:#bfd0e9;transform:translateY(-1px)}.action-tile strong,.action-tile span{display:block}.action-tile strong{font-size:16px}.action-tile span{font-size:13px;color:var(--muted);margin-top:3px}.primary-tile{background:var(--blue-soft);border-color:#c8d8fb}.disabled-tile{opacity:.62;cursor:not-allowed}.subject-mini-grid{margin-top:16px}.parent-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:1050px){.student-subject-grid,.parent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:780px){.student-subject-grid,.parent-grid{grid-template-columns:1fr}.subject-focus-head{align-items:flex-start}.student-secondary-actions{display:grid}.subject-mini-grid{grid-template-columns:1fr}}

/* V5 · StudyLab */
:root{--lab-violet:#6d5dfc;--lab-cyan:#23b6d8;--lab-pink:#ef6ea8;--lab-lime:#8bcf63;--lab-soft:#f4f2ff;--lab-ink:#172033}
body.student-area{background:linear-gradient(180deg,#f8f7ff 0,#f5f8fc 42%,#f4f7fb 100%)}
.student-area .sidebar{background:linear-gradient(180deg,#18213b 0,#1d2948 100%)}
.student-area .brand-mark{background:linear-gradient(145deg,var(--lab-violet),#4c7cff);border-radius:13px}
.student-area .nav-link.active{background:rgba(109,93,252,.22);box-shadow:inset 3px 0 0 #8e85ff}
.student-area .topbar{background:rgba(255,255,255,.9)}
.topbar-title{display:flex;align-items:baseline;gap:10px}.topbar-brand-mini{font-weight:900;color:var(--lab-violet);font-size:12px;letter-spacing:.06em;text-transform:uppercase}
.student-welcome{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:26px 28px;border-radius:24px;background:linear-gradient(125deg,#6d5dfc 0%,#547bf6 52%,#23b6d8 100%);color:white;box-shadow:0 18px 44px rgba(78,82,190,.24)}
.student-welcome h2{font-size:34px;line-height:1.08;margin:7px 0 8px;letter-spacing:-.035em}.student-welcome p{margin:0;color:rgba(255,255,255,.84);font-size:15px}.day-chip{display:inline-flex;padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.24);font-size:12px;font-weight:800}.welcome-orbit{position:relative;width:150px;height:96px;flex:0 0 150px}.welcome-orbit:before,.welcome-orbit:after{content:"";position:absolute;border:1px solid rgba(255,255,255,.24);border-radius:50%;inset:10px 8px;transform:rotate(-12deg)}.welcome-orbit:after{inset:24px -4px 6px 20px;transform:rotate(22deg)}.welcome-orbit span{position:absolute;width:38px;height:38px;border-radius:13px;background:rgba(255,255,255,.18);backdrop-filter:blur(4px);display:grid;place-items:center;font-weight:900;font-size:20px}.welcome-orbit span:nth-child(1){right:8px;top:2px}.welcome-orbit span:nth-child(2){left:4px;bottom:6px}.welcome-orbit span:nth-child(3){right:48px;bottom:0}
.today-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:18px;align-items:start}.today-side{display:grid;gap:14px;margin-top:59px}.today-mini-card{padding:17px}.mini-card-head{display:flex;align-items:center;gap:9px}.mini-card-head span{width:34px;height:34px;border-radius:11px;background:var(--lab-soft);display:grid;place-items:center}.today-mini-card p{font-size:13px;color:var(--muted);margin:12px 0}.today-mini-card>a{font-size:12px;color:var(--lab-violet);font-weight:800;text-decoration:none}.mini-schedule-list{display:grid;gap:8px;margin:12px 0}.mini-schedule-list div{display:flex;align-items:center;gap:9px;font-size:13px}.mini-schedule-list b{width:34px;color:var(--lab-violet)}
.student-area .subject-launch-card{border-radius:19px;box-shadow:0 9px 24px rgba(34,45,78,.06);position:relative;overflow:hidden}.student-area .subject-launch-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:linear-gradient(180deg,var(--lab-violet),var(--lab-cyan));opacity:.72}.student-area .featured-subject{border-color:#d9d4ff;background:linear-gradient(180deg,#fff 0,#fbfaff 100%)}.student-area .subject-icon{width:44px;height:44px;border-radius:14px;background:linear-gradient(145deg,#f3f0ff,#edf8ff);display:grid;place-items:center;font-size:22px}.student-area .subject-title{font-size:15px}.student-area .subject-open{color:var(--lab-violet)}
.empty-state-card{padding:34px 22px;text-align:center}.empty-state-card.compact{padding:25px}.empty-state-icon{width:58px;height:58px;border-radius:18px;background:var(--lab-soft);display:grid;place-items:center;margin:0 auto 12px;font-size:27px}.empty-state-card h3{margin:0 0 5px}.empty-state-card p{margin:0;color:var(--muted);font-size:13px}
.weekly-board{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:13px}.week-day-card{padding:15px}.week-day-card.today,.activity-day-card.today{border-color:#cfc9ff;box-shadow:0 12px 30px rgba(109,93,252,.11)}.week-day-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:11px;border-bottom:1px solid var(--line)}.week-lessons{display:grid;margin-top:8px}.week-lesson-row{display:grid;grid-template-columns:28px 30px 1fr;gap:7px;align-items:center;padding:10px 0;border-bottom:1px solid #edf0f5;text-decoration:none;color:inherit}.week-lesson-row:last-child{border-bottom:0}.week-lesson-row small{grid-column:3;color:var(--muted);font-size:11px}.week-subject-icon{font-size:17px}.week-subject-name{font-size:12px;font-weight:750}.week-empty{padding:16px 0;color:var(--muted);font-size:12px}.period-badge{width:26px;height:26px;border-radius:9px;background:#f0edff;color:var(--lab-violet);display:grid;place-items:center;font-size:11px;font-weight:900}
.schedule-editor-note{margin-bottom:14px;padding:13px 15px;border-radius:13px;background:#f6f7fb;color:var(--muted);font-size:13px}.schedule-days-editor{display:grid;gap:14px}.schedule-edit-day{overflow:hidden}.schedule-day-title{padding:14px 16px;background:#fafbfe;border-bottom:1px solid var(--line)}.schedule-edit-row{display:grid;grid-template-columns:34px minmax(260px,1fr) 135px 135px;gap:9px;align-items:center;padding:9px 14px;border-bottom:1px solid #edf0f5}.schedule-edit-row:last-child{border-bottom:0}.sticky-save{position:sticky;bottom:12px;display:flex;justify-content:flex-end;margin-top:16px;pointer-events:none}.sticky-save .btn{pointer-events:auto;box-shadow:0 12px 26px rgba(63,111,222,.22)}
.activity-form{display:grid;grid-template-columns:1.2fr .8fr .65fr .65fr 1.4fr auto;gap:10px;align-items:end}.activity-form .field{margin:0}.activity-form .btn{height:44px}.activity-week-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.activity-day-card{padding:15px}.activity-list{display:grid}.activity-row{display:flex;align-items:center;gap:11px;padding:12px 0;border-bottom:1px solid #edf0f5}.activity-row:last-child{border-bottom:0}.activity-time{min-width:56px;color:var(--lab-violet);font-weight:900;font-size:13px}.activity-time small{display:block;color:var(--muted);font-weight:600;font-size:10px}.activity-main{flex:1;min-width:0}.activity-main strong,.activity-main span{display:block}.activity-main strong{font-size:13px}.activity-main span{font-size:11px;color:var(--muted);margin-top:2px}.icon-delete{width:30px;height:30px;border:0;border-radius:9px;background:#fff0f1;color:var(--red);font-size:19px;cursor:pointer}
.settings-grid{grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr)}.settings-shortcuts{display:grid;gap:10px}.account-block{padding:15px;border:1px solid var(--line);border-radius:14px;margin-bottom:12px;background:#fbfcff}.account-badge{display:inline-flex;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900;margin-bottom:11px}.account-badge.parent{background:#edf3ff;color:#355eae}.account-badge.student{background:#f1edff;color:#6653db}.subject-settings-list{display:grid;gap:12px}.subject-settings-card{border:1px solid var(--line);border-radius:16px;padding:15px;background:#fff}.subject-settings-head{display:flex;align-items:center;gap:10px}.subject-settings-head>div:nth-child(2){flex:1}.subject-settings-head strong,.subject-settings-head small{display:block}.subject-settings-head small{color:var(--muted);font-size:11px;margin-top:2px}.switch-row{display:flex!important;align-items:center;gap:7px;font-size:12px!important}.subject-settings-fields{display:grid;grid-template-columns:1fr 1.3fr;gap:10px;margin-top:12px}.subject-settings-fields .field{margin:0}.day-picker{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin-top:12px}.day-picker>span{font-size:12px;color:var(--muted);margin-right:4px}.day-picker label{cursor:pointer}.day-picker input{position:absolute;opacity:0;pointer-events:none}.day-picker label span{display:inline-flex;min-width:39px;justify-content:center;padding:7px 8px;border-radius:9px;border:1px solid var(--line);font-size:11px;font-weight:800;color:#66758a}.day-picker input:checked+span{background:#edeaff;border-color:#c8c0ff;color:#5f50d3}
.login-page{background:#121a31}.login-shell{min-height:100vh;padding:22px;background:radial-gradient(circle at 15% 15%,rgba(109,93,252,.32),transparent 33%),radial-gradient(circle at 85% 80%,rgba(35,182,216,.22),transparent 34%),#121a31}.login-panel{width:min(920px,100%);display:grid;grid-template-columns:1fr 430px;gap:24px;align-items:center}.login-visual{color:white;padding:30px;display:flex;flex-direction:column;justify-content:center;min-height:470px}.login-visual h1{font-size:56px;letter-spacing:-.05em;margin:5px 0 8px}.login-visual p{color:#c8d1e8;max-width:420px}.login-kicker{font-size:12px;text-transform:uppercase;letter-spacing:.14em;color:#8ecfe2;font-weight:900}.lab-orbit{height:125px;position:relative;width:180px}.lab-orbit:before,.lab-orbit:after{content:"";position:absolute;border:1px solid rgba(255,255,255,.22);border-radius:50%;inset:10px 0;transform:rotate(-15deg)}.lab-orbit:after{inset:20px 14px 0 -12px;transform:rotate(24deg)}.lab-orbit span{position:absolute;width:42px;height:42px;border-radius:14px;background:rgba(255,255,255,.13);backdrop-filter:blur(5px);display:grid;place-items:center;font-weight:900;font-size:21px}.lab-orbit span:nth-child(1){top:0;right:4px}.lab-orbit span:nth-child(2){bottom:4px;left:8px}.lab-orbit span:nth-child(3){bottom:0;right:42px}.login-card{width:100%;padding:28px;border:1px solid rgba(255,255,255,.1);box-shadow:0 28px 70px rgba(0,0,0,.28)}.login-brand h2{margin:0;font-size:23px}.login-submit{width:100%;min-height:48px;background:linear-gradient(135deg,var(--lab-violet),#4e79f5)}.login-migration-note{font-size:11px;line-height:1.5;color:var(--muted);margin:15px 0 0}

@media(max-width:1150px){.weekly-board{grid-template-columns:repeat(3,minmax(0,1fr))}.today-layout{grid-template-columns:1fr}.today-side{grid-template-columns:1fr 1fr;margin-top:0}.activity-form{grid-template-columns:repeat(2,1fr)}.activity-form .activity-note-field{grid-column:1/-1}.settings-grid{grid-template-columns:1fr}}
@media(max-width:850px){.weekly-board,.activity-week-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.schedule-edit-row{grid-template-columns:34px 1fr 110px 110px}.login-panel{grid-template-columns:1fr;max-width:470px}.login-visual{display:none}.login-shell{place-items:center}}
@media(max-width:600px){.student-welcome{padding:22px 20px}.student-welcome h2{font-size:29px}.welcome-orbit{display:none}.today-side{grid-template-columns:1fr}.weekly-board,.activity-week-grid{grid-template-columns:1fr}.schedule-edit-row{grid-template-columns:30px 1fr}.schedule-edit-row input[type=time]{grid-column:2}.subject-settings-fields{grid-template-columns:1fr}.activity-form{grid-template-columns:1fr}.topbar-brand-mini{display:none}.student-secondary-actions{font-size:12px}}

/* V6 · Records, reconciliation and school results */
.status.gray{background:#eef1f5;color:#68758a}.status.soft{background:#f4f1ff;color:#6554c8}.table-subline{display:block;color:var(--muted);font-size:10px;margin-top:4px}.parent-metrics{margin-bottom:22px}.reconcile-note{margin-top:10px;padding:10px 12px;border-radius:11px;background:#f7f9fc;color:var(--muted);font-size:12px}.exam-history-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.exam-history-card{padding:18px}.exam-card-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.exam-card-head h3{margin:0 0 3px;font-size:18px}.exam-card-head p{margin:0;color:var(--muted);font-size:12px}.exam-card-status{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.exam-detail{display:grid;grid-template-columns:72px 1fr;gap:10px;padding:11px 0;border-top:1px solid var(--line);font-size:13px}.exam-detail:first-of-type{margin-top:14px}.exam-detail b{color:#5c6a7e}.exam-id-row{padding-top:10px}.school-grade-panel{margin-top:15px;padding:15px;border:1px solid #dfe4ee;border-radius:14px;background:#fbfcff}.school-grade-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.school-score{font-size:20px;font-weight:900;color:var(--blue)}.grade-compact-row{display:grid;grid-template-columns:.6fr .6fr 1fr;gap:10px}.grade-notes-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.grade-form .field{margin-bottom:10px}.grade-form input[type=number]{width:100%;border:1px solid #cad5e3;background:#fff;color:var(--ink);border-radius:12px;padding:12px 13px;font:inherit;outline:none}.small-btn{min-height:38px;padding:8px 12px}.school-result-strip{display:grid;grid-template-columns:1fr auto;gap:3px 10px;align-items:center;margin:10px 0;padding:11px 12px;border-radius:12px;background:#f5f2ff;border:1px solid #e4ddff}.school-result-strip span{font-size:12px;color:#675aab}.school-result-strip strong{font-size:20px;color:#5544c1}.school-result-strip small{grid-column:1/-1;color:var(--muted)}
@media(max-width:950px){.exam-history-grid{grid-template-columns:1fr}}
@media(max-width:650px){.exam-card-head{flex-direction:column}.exam-card-status{justify-content:flex-start}.grade-compact-row,.grade-notes-row{grid-template-columns:1fr}}

/* V7 · StudyLab visual refresh */
:root{
  --lab-indigo:#4f46e5;
  --lab-violet:#6d5dfc;
  --lab-blue:#2563eb;
  --lab-cyan:#27c2e8;
  --lab-soft:#f3f5ff;
  --lab-ink:#111b35;
  --lab-sidebar:#18213b;
}
body.student-area{background:linear-gradient(180deg,#f5f7ff 0,#f8faff 100%);color:var(--lab-ink)}
.student-area .app-shell{grid-template-columns:274px 1fr}
.student-area .sidebar{background:linear-gradient(180deg,#17213e 0%,#1a2c58 58%,#182a55 100%);padding:22px 14px;box-shadow:18px 0 50px rgba(27,43,91,.08)}
.brand{padding:4px 13px 24px;gap:12px}.brand-app-icon{width:44px;height:44px;border-radius:13px;display:block;box-shadow:0 8px 20px rgba(43,77,218,.22)}.brand strong{font-size:18px;letter-spacing:-.01em}.brand small{font-size:12px;color:#76aaff}
.sidebar nav{gap:7px}.nav-link{display:flex;align-items:center;gap:12px;min-height:48px;padding:11px 13px;border-radius:13px;color:#d8e2f7;font-size:14px}.nav-link:hover{background:rgba(255,255,255,.065);color:#fff}.student-area .nav-link.active{background:linear-gradient(135deg,#5b58f4,#4c63db);box-shadow:0 10px 24px rgba(73,75,225,.28);color:#fff}.parent-area .nav-link.active{background:#243b5e;color:#fff}.nav-icon{width:21px;height:21px;flex:none}.button-icon{width:17px;height:17px}
.sidebar-tools{margin-top:24px;padding:0 3px}.sidebar-tool-card{display:grid;grid-template-columns:40px 1fr auto;align-items:center;gap:10px;padding:13px 12px;border:1px solid rgba(129,143,255,.26);border-radius:15px;background:linear-gradient(135deg,rgba(71,74,199,.18),rgba(49,101,218,.12));color:#fff;text-decoration:none}.sidebar-tool-card:hover{border-color:rgba(159,171,255,.48);background:linear-gradient(135deg,rgba(86,80,233,.26),rgba(48,107,226,.2))}.tool-card-icon{width:24px;height:24px;color:#ffd563}.sidebar-tool-card strong,.sidebar-tool-card small{display:block}.sidebar-tool-card strong{font-size:14px}.sidebar-tool-card small{font-size:10px;color:#aebbe0;margin-top:2px}.sidebar-tool-card b{font-size:23px;font-weight:400;color:#91a7e4}.side-footer{padding:17px 8px 2px}.side-footer a{display:flex;align-items:center;gap:10px;margin:0;padding:9px 5px;color:#c8d6f2}.side-footer a:hover{color:#fff}
.topbar{height:74px;background:rgba(255,255,255,.88);border-bottom:1px solid #e5e9f3;box-shadow:0 3px 18px rgba(36,48,87,.035)}.topbar-brand-mini{font-size:11px;text-transform:uppercase;letter-spacing:.06em;font-weight:900;color:var(--lab-violet)}.topbar-title h1{font-size:23px;color:#17203d}.top-logout{color:#6c7890;background:#fff}
.content{max-width:1340px;padding:28px 30px 38px}

.form-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:124px;margin:-28px -30px 18px;padding:24px 38px 20px;background:radial-gradient(circle at 86% 20%,rgba(101,105,255,.14),transparent 18%),linear-gradient(180deg,#fbfcff,#f5f7ff);border-bottom:1px solid #e4e9f5;overflow:hidden}.form-kicker{text-transform:uppercase;letter-spacing:.06em;color:#584bfb;font-weight:900;font-size:12px}.form-hero h2{margin:2px 0 4px;font-size:31px;line-height:1.15;letter-spacing:-.035em}.form-hero p{margin:0;color:#687695;max-width:760px;font-size:14px}.form-hero-art{width:110px;height:82px;border-radius:28px;background:linear-gradient(145deg,#e8edff,#f4f0ff);display:grid;place-items:center;transform:rotate(-4deg);box-shadow:0 18px 38px rgba(77,84,205,.13)}.hero-art-icon{width:54px;height:54px;color:#315df4}.target-art{font-size:51px;transform:rotate(4deg)}
.modern-form{display:grid;gap:14px}.form-grid{display:grid;gap:14px}.form-grid.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}.form-section-card{background:#fff;border:1px solid #e0e6f1;border-radius:17px;padding:17px 18px;box-shadow:0 8px 22px rgba(34,49,85,.045)}.compact-card{min-height:132px}.section-card-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:12px}.section-card-head h3{margin:0;color:#121b38;font-size:15px;line-height:1.25}.section-card-head p{margin:2px 0 0;color:#8290ad;font-size:12px;line-height:1.35}.section-icon{width:34px;height:34px;flex:none;border-radius:10px;display:grid;place-items:center;font-size:18px}.section-icon.blue{background:linear-gradient(145deg,#e6edff,#f3f7ff);color:#245af2}.section-icon.indigo{background:linear-gradient(145deg,#ebe9ff,#f4f1ff);color:#5c4df4}.section-icon.teal{background:linear-gradient(145deg,#e4f9fb,#f1fcff);color:#1497b9}.section-icon.violet{background:linear-gradient(145deg,#eee9ff,#f7f3ff);color:#6d5dfc}.section-svg{width:21px;height:21px}.required-chip{display:inline-flex;vertical-align:middle;margin-left:5px;padding:3px 7px;border-radius:999px;background:#fff0e8;color:#ff6b38;font-size:9px;font-weight:850}
.modern-form input[type=date],.modern-form select,.modern-form textarea,.modern-form input[type=text]{border:1px solid #cfd8e8;border-radius:11px;background:#fff;min-height:45px}.modern-form textarea{min-height:98px}.modern-form input:focus,.modern-form select:focus,.modern-form textarea:focus{border-color:#6c7cff;box-shadow:0 0 0 3px rgba(92,95,246,.10)}.modern-form small{display:block;margin-top:6px;color:#8996ae;font-size:11px}
.choice-grid{display:grid;gap:11px}.choice-grid.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}.choice-grid.three-col{grid-template-columns:repeat(3,minmax(0,1fr))}.choice-grid.four-col{grid-template-columns:repeat(4,minmax(0,1fr))}.visual-choice{position:relative;display:grid;grid-template-columns:18px 38px 1fr;gap:10px;align-items:start;min-height:94px;padding:13px 13px;border:1px solid #d9e0ed;border-radius:13px;background:#fff;cursor:pointer;transition:.16s border-color,.16s box-shadow,.16s transform}.visual-choice:hover{border-color:#b8c4e4;box-shadow:0 8px 18px rgba(56,75,126,.06);transform:translateY(-1px)}.visual-choice input{position:absolute;opacity:0;pointer-events:none}.choice-dot{width:17px;height:17px;border-radius:50%;border:1.5px solid #a8b5cc;margin-top:4px;display:grid;place-items:center}.visual-choice input:checked~.choice-dot{border-color:#4d63ff;box-shadow:inset 0 0 0 4px #fff;background:#4d63ff}.visual-choice:has(input:checked){border-color:#5770ff;box-shadow:0 0 0 1px rgba(82,102,255,.22),0 10px 24px rgba(71,83,220,.09);background:linear-gradient(180deg,#fff,#fbfbff)}.mood-icon,.process-icon,.exam-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;font-size:22px;background:#f4f6fb}.easy-choice .mood-icon{background:#d9f8e6}.medium-choice .mood-icon{background:#fff0c8}.hard-choice .mood-icon{background:#ffe1e6}.choice-copy{min-width:0}.choice-copy strong{display:block;font-size:13px;line-height:1.3;color:#15203d}.choice-copy small{display:block!important;margin:6px 0 0!important;color:#7886a1!important;font-size:11px!important;line-height:1.38!important}.difficulty-detail{margin-top:12px;padding-top:13px;border-top:1px solid #edf0f6}.difficulty-detail label{display:block;font-size:12px;font-weight:800;margin-bottom:7px}.process-section{background:linear-gradient(180deg,#fff,#fcfbff)}.process-choice{min-height:86px}.process-icon{background:#eeeaff;color:#5c49e8}.exam-choice{grid-template-columns:18px 38px 1fr;min-height:105px}.exam-icon{background:#f3f1ff}.support-chip-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.support-chip-grid label{cursor:pointer}.support-chip-grid input{position:absolute;opacity:0}.support-chip-grid span{display:flex;align-items:center;justify-content:center;min-height:38px;padding:8px 9px;border:1px solid #dce2ec;border-radius:10px;background:#fff;color:#586681;font-size:11px;font-weight:700}.support-chip-grid input:checked+span{border-color:#6e78ff;background:#f1efff;color:#5145d2;box-shadow:inset 0 0 0 1px rgba(83,71,222,.08)}.inline-check{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12px;color:#5d6980;cursor:pointer}.inline-check input{width:16px;height:16px}.modern-form-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:6px 4px 0}.modern-form-actions .action-copy{margin-right:auto}.modern-form-actions .btn,.modern-form-actions .ghost-btn{min-height:44px;border-radius:11px}.action-chat{background:linear-gradient(135deg,#6b55f9,#2867f5);box-shadow:0 8px 20px rgba(72,80,238,.2)}.action-chat:hover{background:linear-gradient(135deg,#5e4be6,#205ce0)}

.login-shell{background:radial-gradient(circle at 14% 12%,rgba(96,82,244,.28),transparent 33%),radial-gradient(circle at 88% 82%,rgba(37,194,232,.18),transparent 35%),#121a31}.login-app-icon{width:118px;height:118px;border-radius:28px;box-shadow:0 22px 48px rgba(21,38,103,.35);margin-bottom:26px}.login-card-icon{width:42px;height:42px;border-radius:11px;box-shadow:0 8px 18px rgba(41,73,185,.18)}.login-brand{display:flex;align-items:center;gap:12px;margin-bottom:20px}.login-card{border-radius:20px}.login-card .field label{font-size:12px}.login-migration-note{display:none!important}

@media(max-width:1100px){.choice-grid.four-col{grid-template-columns:repeat(2,minmax(0,1fr))}.choice-grid.three-col{grid-template-columns:1fr}.student-area .app-shell{grid-template-columns:240px 1fr}}
@media(max-width:850px){.form-grid.two-col,.choice-grid.two-col{grid-template-columns:1fr}.support-chip-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.modern-form-actions{flex-direction:column}.modern-form-actions .action-copy{margin-right:0}.modern-form-actions .btn,.modern-form-actions .ghost-btn{width:100%}.form-hero{margin:-20px -14px 16px;padding:22px 18px}.form-hero-art{width:82px;height:66px}.form-hero h2{font-size:27px}}
@media(max-width:600px){.choice-grid.four-col,.support-chip-grid{grid-template-columns:1fr}.form-hero-art{display:none}.form-section-card{padding:15px}.visual-choice{grid-template-columns:18px 34px 1fr}.mood-icon,.process-icon,.exam-icon{width:34px;height:34px;font-size:19px}.top-logout span{display:none}.top-logout{padding:8px}.brand-app-icon{width:40px;height:40px}}

/* V8 · simpler student flow + focused Parent Center */
.parent-area{background:#f5f7fb;color:#17213a}.parent-area .app-shell{grid-template-columns:252px 1fr}.parent-area .sidebar{background:linear-gradient(180deg,#17213a 0%,#1c2948 100%);padding:22px 14px;box-shadow:14px 0 40px rgba(25,38,70,.06)}.parent-area .brand small{color:#91a6cf}.parent-area .nav-link{color:#dbe4f6}.parent-area .nav-link.active{background:#293c60;box-shadow:none}.parent-area .content{max-width:1380px}.parent-area .topbar{background:rgba(255,255,255,.92)}

.student-page-intro{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px;padding:22px 26px;border-radius:20px;background:linear-gradient(135deg,#eef2ff,#f8faff);border:1px solid #e0e6f5}.student-page-intro h2{margin:2px 0 5px;font-size:29px;letter-spacing:-.03em}.student-page-intro p{margin:0;color:#6f7d99}.subjects-intro-icon{width:70px;height:70px;border-radius:20px;display:grid;place-items:center;background:linear-gradient(145deg,#5960f2,#3b78e7);color:#fff;box-shadow:0 16px 34px rgba(65,83,218,.22)}.subjects-hero-icon{width:34px;height:34px}.subjects-page-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.subjects-page-grid .subject-launch-card{min-height:168px}

.today-dashboard-hero{margin-bottom:18px}.today-summary-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(300px,.8fr);gap:16px;align-items:start}.today-focus-card{padding:18px;border-radius:18px}.today-focus-head{display:flex;align-items:center;gap:11px;margin-bottom:14px}.today-focus-head .focus-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#eef1ff;color:#4d5df2}.focus-svg{width:21px;height:21px}.today-focus-head>div{display:flex;flex-direction:column;min-width:0}.today-focus-head strong{font-size:15px}.today-focus-head small{color:#8190ab}.today-focus-head>a{margin-left:auto;color:#5664e9;font-weight:750;font-size:12px;text-decoration:none}.today-empty{padding:18px;border:1px dashed #d7dfef;border-radius:14px;background:#fbfcff;display:flex;flex-direction:column;gap:5px}.today-empty b{font-size:14px}.today-empty span{color:#7987a1;font-size:12px}.text-action{margin-top:6px;color:#4d5de9;font-weight:800;text-decoration:none;font-size:12px}.today-glance-stack{display:grid;gap:14px}.glance-card{padding:16px;display:grid;grid-template-columns:42px 1fr;gap:12px;align-items:start;border-radius:17px}.glance-icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center}.test-glance{background:#fff0f4;color:#dc4e78}.activity-glance{background:#edf8ff;color:#208bb4}.glance-svg{width:22px;height:22px}.glance-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.glance-copy>span{font-size:10px;text-transform:uppercase;letter-spacing:.05em;font-weight:900;color:#8a96ac}.glance-copy strong{font-size:14px;line-height:1.3}.glance-copy small{color:#7b88a0}.glance-copy a{margin-top:5px;color:#5562e5;font-size:11px;font-weight:800;text-decoration:none}.today-bottom-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}.today-bottom-grid .today-mini-card{margin:0}.mini-card-head{display:flex;align-items:center;gap:8px}.mini-card-head>a{margin-left:auto;font-size:11px;font-weight:800;color:#5964dc;text-decoration:none}.mini-svg{width:18px;height:18px;color:#5966e8}.mini-schedule-list div{display:grid;grid-template-columns:38px 1fr auto;gap:8px;align-items:center}.mini-schedule-list small{color:#8b96aa}

.studycraft-context{display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:center;margin-top:12px;padding:12px 14px;border:1px solid #e1e5f4;border-radius:13px;background:#fafbff}.studycraft-context>span{width:34px;height:34px;border-radius:10px;background:#fff4c8;display:grid;place-items:center}.studycraft-context strong,.studycraft-context small{display:block}.studycraft-context strong{font-size:12px}.studycraft-context small{margin-top:2px!important;font-size:10px!important;color:#7b879d!important}.studycraft-context a{font-size:11px;font-weight:800;text-decoration:none;color:#5962df}

.parent-dashboard-hero,.admin-hero{margin-bottom:18px;padding:24px 26px;border:1px solid #e2e7f0;border-radius:19px;background:linear-gradient(135deg,#fff,#f8faff)}.parent-dashboard-hero h2,.admin-hero h2{margin:3px 0 5px;font-size:29px;letter-spacing:-.03em}.parent-dashboard-hero p,.admin-hero p{margin:0;color:#6f7c93}.parent-attention-card{padding:18px;margin-bottom:16px;border-radius:18px;border-color:#eedbb6;background:#fffdf8}.parent-attention-card.all-clear{border-color:#cfe8d8;background:#fbfffc}.parent-attention-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.parent-attention-head h3{margin:2px 0 0;font-size:17px}.parent-attention-card>p{margin:9px 0 0;color:#6f7b8f}.attention-list{display:grid;gap:8px;margin-top:14px}.attention-row{display:grid;grid-template-columns:38px 1fr auto;gap:10px;align-items:center;padding:10px 11px;border-radius:12px;background:#fff;border:1px solid #ede8dc;color:inherit;text-decoration:none}.attention-row:hover{border-color:#ddcfad}.attention-icon{width:34px;height:34px;border-radius:10px;background:#fff7df;display:grid;place-items:center}.attention-row strong,.attention-row small{display:block}.attention-row strong{font-size:13px}.attention-row small{margin-top:2px;color:#7d8798;font-size:11px}.attention-row b{font-size:11px;color:#956e25}.parent-primary-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.parent-action-card{display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:12px;padding:16px;text-decoration:none;color:inherit}.parent-action-card.primary{background:linear-gradient(135deg,#eef2ff,#fafaff);border-color:#cfd7ff}.parent-action-icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:#eef1f8;color:#4057cb}.parent-action-card.primary .parent-action-icon{background:#dfe4ff;color:#4d52d9}.parent-action-svg{width:22px;height:22px}.parent-action-card strong,.parent-action-card small{display:block}.parent-action-card strong{font-size:14px}.parent-action-card small{margin-top:3px;color:#7a879e;font-size:11px;line-height:1.4}.parent-action-card>b{font-size:19px;color:#8e9ab0}.parent-secondary-actions{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0 18px}.mini-parent-action{display:flex;align-items:center;gap:9px;padding:10px 13px;border:1px solid #e0e5ee;border-radius:12px;background:#fff;text-decoration:none;color:inherit}.mini-parent-svg{width:18px;height:18px;color:#5b68d9}.mini-parent-action strong,.mini-parent-action small{display:block}.mini-parent-action strong{font-size:12px}.mini-parent-action small{font-size:10px;color:#8893a6}.parent-dashboard-grid{margin-top:0}.parent-footer-tools{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;padding:13px 15px;border-radius:13px;background:#eef2f7;color:#67758e}.parent-footer-tools strong,.parent-footer-tools span{display:block}.parent-footer-tools strong{font-size:12px;color:#32405a}.parent-footer-tools span{font-size:10px;margin-top:2px}.parent-tool-links{display:flex;gap:12px}.parent-tool-links a{font-size:11px;font-weight:800;color:#4b5c78;text-decoration:none}

.admin-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px}.admin-summary-card{padding:14px 16px;border:1px solid #e1e6ef;border-radius:14px;background:#fff}.admin-summary-card span{display:block;color:#7d899e;font-size:10px;text-transform:uppercase;letter-spacing:.05em;font-weight:850}.admin-summary-card strong{display:block;margin-top:4px;font-size:24px;color:#1b2944}.admin-jumpbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:15px;padding:8px;border:1px solid #e2e6ee;border-radius:13px;background:#fff}.admin-jumpbar a{padding:8px 11px;border-radius:9px;text-decoration:none;color:#53617a;font-size:11px;font-weight:800}.admin-jumpbar a:hover{background:#f2f4fa;color:#3242a8}.admin-top-grid{grid-template-columns:1fr 1fr;gap:14px}.admin-section{scroll-margin-top:90px}.admin-section-title{display:flex;gap:11px;align-items:flex-start;margin-bottom:14px}.admin-section-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#eef1ff;color:#4d59db}.admin-svg{width:20px;height:20px}.admin-section-title h3{margin:0;font-size:16px}.admin-section-title p{margin:3px 0 0;color:#7d899d;font-size:11px}.admin-account-form{display:grid;gap:12px}.account-block.compact{padding:12px;border-radius:12px}.admin-shortcut-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;padding-top:13px;border-top:1px solid #edf0f4}.admin-shortcut-row a{display:inline-flex;align-items:center;gap:7px;padding:8px 10px;border-radius:9px;background:#f5f7fb;color:#53617a;font-size:10px;font-weight:800;text-decoration:none}.shortcut-svg{width:15px;height:15px}.admin-subjects-section{margin-top:14px}.modern-subject-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.compact-subject-setting{margin:0;padding:13px}.compact-subject-setting .subject-settings-fields{grid-template-columns:1fr 1.4fr}.compact-subject-setting .day-picker{margin-top:9px}.sticky-admin-save{position:sticky;bottom:10px;z-index:5;display:flex;justify-content:flex-end;padding:10px;margin:12px -4px -4px;background:linear-gradient(180deg,rgba(255,255,255,.1),rgba(255,255,255,.96) 35%)}

@media(max-width:1150px){.subjects-page-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.today-summary-grid{grid-template-columns:1fr}.today-glance-stack{grid-template-columns:1fr 1fr}.parent-primary-actions{grid-template-columns:1fr}.modern-subject-settings{grid-template-columns:1fr}.admin-top-grid{grid-template-columns:1fr}.parent-area .app-shell{grid-template-columns:230px 1fr}}
@media(max-width:850px){.today-bottom-grid,.today-glance-stack,.admin-summary-grid{grid-template-columns:1fr}.subjects-page-grid{grid-template-columns:1fr}.parent-secondary-actions{display:grid;grid-template-columns:1fr 1fr}.parent-footer-tools{align-items:flex-start;flex-direction:column}.parent-area .app-shell{grid-template-columns:1fr}.student-page-intro{padding:18px}.subjects-intro-icon{width:58px;height:58px}.today-summary-grid{gap:12px}}
@media(max-width:560px){.parent-secondary-actions{grid-template-columns:1fr}.attention-row{grid-template-columns:34px 1fr}.attention-row>b{grid-column:2}.parent-tool-links{flex-direction:column;gap:5px}.admin-jumpbar{overflow-x:auto;flex-wrap:nowrap}.admin-jumpbar a{white-space:nowrap}.compact-subject-setting .subject-settings-fields{grid-template-columns:1fr}}

/* V17 school timetable */
.schedule-edit-row{grid-template-columns:34px minmax(210px,1fr) minmax(150px,.75fr) 118px 118px}.schedule-edit-row.is-club{background:#faf8ff}.schedule-edit-row.is-club .period-badge{background:#f0e8ff;color:#7550c8}.schedule-edit-row input[type=text]{min-width:0}
.schedule-now-bar{display:flex;align-items:center;gap:9px;margin:0 0 13px;padding:11px 14px;border:1px solid #dfe6ef;border-radius:14px;background:#fff;box-shadow:0 6px 18px rgba(25,49,88,.04)}.schedule-now-bar small{margin-left:auto;color:var(--muted)}.schedule-now-dot{width:9px;height:9px;border-radius:50%;background:#3ba776;box-shadow:0 0 0 4px #e6f6ef}
.timetable-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:0 10px 28px rgba(34,54,92,.06)}.school-timetable{width:100%;min-width:980px;border-collapse:separate;border-spacing:0;table-layout:fixed}.school-timetable th,.school-timetable td{border-right:1px solid #e4e9f1;border-bottom:1px solid #e4e9f1}.school-timetable tr:last-child th,.school-timetable tr:last-child td{border-bottom:0}.school-timetable th:last-child,.school-timetable td:last-child{border-right:0}.school-timetable thead th{height:54px;padding:10px;background:#f7f9fd;text-align:center;font-size:12px;font-weight:900;color:#26334b}.school-timetable thead th.today-col{background:#eef3ff;color:#4057c8}.school-timetable thead th span{display:block;margin-top:2px;font-size:9px;color:#6476cf;text-transform:uppercase;letter-spacing:.04em}.school-timetable .time-head{width:82px;background:#eef2f8;color:#506079}.school-timetable .period-head{width:82px;padding:8px;background:#f8fafc;text-align:center}.period-head strong{display:block;color:#394b67;font-size:13px}.period-head small{display:block;margin-top:3px;color:#8a96aa;font-size:9px;font-weight:600;white-space:nowrap}.school-timetable td{height:76px;padding:5px;background:#fff;vertical-align:middle}.school-timetable td.today-cell{background:#fcfdff}.school-timetable .current-period-row .period-head{background:#edf8f2;color:#18734f}.school-timetable td.now-cell{box-shadow:inset 0 0 0 2px #55b88d;background:#f5fcf8}.timetable-subject,.timetable-club{height:100%;min-height:62px;border-radius:11px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:7px;text-align:center;text-decoration:none}.timetable-subject{background:#f5f7ff;color:#24324b}.timetable-subject>span{font-size:17px}.timetable-subject strong,.timetable-club strong{font-size:11px;line-height:1.18}.timetable-subject small,.timetable-club small{font-size:9px;color:#7c899f}.club-cell{background:#fffbf3!important}.timetable-club{background:#fff3d9;color:#765516;border:1px solid #f4dcaa}.club-kicker{font-size:8px!important;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#a5741d}.empty-slot{display:block;text-align:center;color:#c5ccd7}.schedule-legend{display:flex;gap:17px;flex-wrap:wrap;margin-top:12px;color:#68778e;font-size:11px}.schedule-legend span{display:flex;align-items:center;gap:6px}.legend-dot{width:9px;height:9px;border-radius:50%;display:inline-block}.legend-dot.standard{background:#8ba1f4}.legend-dot.club{background:#e2b14e}.legend-dot.now{background:#55b88d}
@media(max-width:850px){.schedule-edit-row{grid-template-columns:34px 1fr 1fr}.schedule-edit-row input[type=time]{grid-column:auto}.school-timetable{min-width:860px}}
@media(max-width:600px){.schedule-edit-row{grid-template-columns:30px 1fr}.schedule-edit-row input[type=text],.schedule-edit-row input[type=time]{grid-column:2}.timetable-wrap{margin-left:-4px;margin-right:-4px}.school-timetable{min-width:820px}}
.mini-schedule-list .mini-club-row span{color:#8b671f;font-weight:750}

/* V18: global school-period times + planning dashboard */
.period-times-card{margin:16px 0}.period-times-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.period-times-head strong{display:block;font-size:1rem}.period-times-head small{display:block;color:var(--muted,#7a8599);margin-top:2px}.period-times-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.period-time-row{display:grid;grid-template-columns:72px 1fr 14px 1fr;gap:8px;align-items:center;padding:10px 12px;background:#f7f9fd;border:1px solid #e3e8f2;border-radius:12px}.period-time-row span{font-weight:800;color:#283553}.period-time-row input{width:100%;min-width:0}.period-time-row b{text-align:center;color:#8792a7}
.schedule-edit-row{grid-template-columns:42px minmax(180px,1fr) minmax(160px,1fr)!important}
.home-planning-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:18px}.mini-card-head>div{min-width:0}.mini-card-head>div strong,.mini-card-head>div small{display:block}.mini-card-head>div small{font-size:.78rem;color:#8290a6;margin-top:2px}.next-day-timetable{display:grid;gap:7px;margin-top:14px}.next-day-row{display:grid;grid-template-columns:44px 104px 1fr;gap:10px;align-items:center;padding:9px 11px;border-radius:11px;background:#f7f9fd;border:1px solid #e7ebf3}.next-day-row.club-row{background:#fff8e8;border-color:#f3dfad}.next-period{font-weight:900;color:#5766d9}.next-time{font-size:.82rem;color:#748198;font-variant-numeric:tabular-nums}.next-day-row strong{font-size:.9rem}.study-suggestion-list{display:grid;gap:10px;margin-top:12px}.study-suggestion-list>div{display:grid;grid-template-columns:34px 1fr;gap:9px;align-items:flex-start;padding:10px;border-radius:12px;background:#f8fafc}.study-suggestion-list>div>span{font-size:1.15rem}.study-suggestion-list p{margin:0;color:#526078;line-height:1.4}.study-suggestion-list strong{display:block;color:#1f2c47;margin-bottom:2px}.weekend-review-list{display:grid;gap:9px;margin-top:12px}.weekend-review-list>div{padding:11px 12px;border-radius:12px;background:#f8fafc;border-left:3px solid #6d63ff}.weekend-review-list strong,.weekend-review-list span{display:block}.weekend-review-list span{font-size:.84rem;color:#66748b;margin-top:3px}.next-week-test-list{display:grid;gap:8px;margin-top:12px}.next-week-test-list a{display:grid;grid-template-columns:58px 1fr;gap:10px;text-decoration:none;align-items:center;padding:10px 12px;border:1px solid #e6eaf2;border-radius:11px;background:#fff}.next-week-test-list a:hover{border-color:#818cf8}.next-week-test-list span{font-weight:900;color:#e05b79}.next-week-test-list strong{color:#22304b}.activities-home-card{margin-top:18px}
@media(max-width:980px){.period-times-grid{grid-template-columns:1fr 1fr}.home-planning-grid{grid-template-columns:1fr}}
@media(max-width:640px){.period-times-grid{grid-template-columns:1fr}.period-time-row{grid-template-columns:62px 1fr 12px 1fr}.next-day-row{grid-template-columns:40px 88px 1fr}.schedule-edit-row{grid-template-columns:36px 1fr!important}.schedule-edit-row input[type=text]{grid-column:2}}

/* V18.1: custom school subjects distinct from clubs */
.schedule-edit-row.is-custom-subject{background:linear-gradient(135deg,#f8fafc,#f1f5f9);border-color:#cbd5e1}
.custom-subject-cell{background:linear-gradient(180deg,#fbfdff,#f8fafc)}
.timetable-custom-subject{display:flex;min-height:72px;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center;padding:8px;color:#172033}
.timetable-custom-subject strong{font-size:13px;line-height:1.25}
.timetable-custom-subject small{font-size:10px;color:#718096}
.legend-dot.custom{background:#94a3b8}
.next-day-row.custom-subject-row{background:#f8fafc}


/* V18.2 polished student home */
.home-v182-hero{margin:26px 0 18px;padding:24px 28px;border-radius:22px;background:linear-gradient(115deg,#6658ef 0%,#536cf1 42%,#31b4d4 100%);color:#fff;display:flex;justify-content:space-between;gap:24px;align-items:center;box-shadow:0 16px 42px rgba(72,83,190,.18)}
.home-v182-date{display:inline-flex;padding:5px 10px;border-radius:999px;background:rgba(255,255,255,.16);font-size:11px;font-weight:900}
.home-v182-hero h2{margin:9px 0 4px;font-size:30px;line-height:1.05}.home-v182-hero p{margin:0;max-width:690px;color:rgba(255,255,255,.86);font-size:14px}
.home-v182-hero-stats{display:grid;grid-template-columns:repeat(3,96px);gap:8px}.home-v182-hero-stats>div{padding:12px 10px;border-radius:15px;background:rgba(255,255,255,.12);text-align:center;backdrop-filter:blur(6px)}.home-v182-hero-stats span,.home-v182-hero-stats small{display:block;font-size:9px;color:rgba(255,255,255,.78)}.home-v182-hero-stats strong{display:block;margin:2px 0;font-size:22px}
.home-v182-top-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(280px,.75fr);gap:16px}.home-v182-next-card,.home-v182-study-card,.home-v182-weekend-card,.home-v182-tests-card,.home-v182-today-card{padding:18px}.home-v182-section-head{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-bottom:14px}.home-v182-section-head.compact{margin-bottom:11px}.home-v182-section-head a{font-size:11px;font-weight:850;text-decoration:none;color:#5664d9}.home-v182-title-wrap{display:flex;align-items:center;gap:10px}.home-v182-icon{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:#eef1ff;color:#5967dc}.home-v182-title-wrap h3{margin:1px 0 0;font-size:17px}.eyebrow{display:block;font-size:9px;line-height:1.2;font-weight:900;letter-spacing:.08em;color:#8792a6}.home-v182-next-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.home-v182-next-item{display:grid;grid-template-columns:38px 92px 1fr auto;gap:8px;align-items:center;padding:10px 11px;border:1px solid #e7ebf2;border-radius:12px;background:#fbfcff}.home-v182-next-item .period{font-weight:900;color:#5968df}.home-v182-next-item .time{font-size:11px;color:#7e899c;font-variant-numeric:tabular-nums}.home-v182-next-item strong{font-size:12px;color:#1d2940}.home-v182-next-item em{font-style:normal;font-size:8px;font-weight:900;color:#a6781c;background:#fff1c9;padding:3px 6px;border-radius:999px}.home-v182-next-item.is-club{background:#fffbf2;border-color:#f2dfb3}.home-v182-next-item.is-custom{background:#f8fafc}
.home-v182-next-item.is-link{color:inherit;text-decoration:none;cursor:pointer;transition:.15s border-color,.15s box-shadow,.15s transform}
.home-v182-next-item.is-link:hover{border-color:#98a3ee;box-shadow:0 6px 16px rgba(65,77,150,.08);transform:translateY(-1px)}
.home-v182-next-item.is-link:focus-visible{outline:2px solid #6774e8;outline-offset:2px}
.home-v182-alerts{display:grid;gap:12px}.home-v182-alert-card{display:grid;grid-template-columns:42px 1fr;gap:12px;align-items:start;padding:16px}.home-v182-alert-card strong,.home-v182-alert-card small{display:block}.home-v182-alert-card strong{margin-top:3px;font-size:14px;color:#1f2c45}.home-v182-alert-card small{margin-top:3px;color:#7b879a;font-size:11px}.home-v182-alert-icon{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:#fff0f3;color:#df6680}.home-v182-alert-card.activity .home-v182-alert-icon{background:#edf8ff;color:#3996c5}
.home-v182-middle-grid{display:grid;grid-template-columns:1.1fr .95fr .95fr;gap:16px;margin-top:16px}.home-v182-task-list,.home-v182-review-list,.home-v182-test-list{display:grid;gap:8px}.home-v182-task-list>div{display:grid;grid-template-columns:30px 1fr;gap:8px;align-items:start;padding:9px 10px;border-radius:10px;background:#f8fafc}.home-v182-task-list p{margin:0}.home-v182-task-list strong,.home-v182-task-list small{display:block}.home-v182-task-list strong{font-size:12px;color:#22304a}.home-v182-task-list small{margin-top:2px;color:#65728a;font-size:10.5px;line-height:1.35}.home-v182-review-list>div{padding:10px 11px;border-radius:10px;background:#f8fafc;border-left:3px solid #7064f5}.home-v182-review-list strong,.home-v182-review-list small{display:block}.home-v182-review-list strong{font-size:12px}.home-v182-review-list small{margin-top:3px;color:#67758d;font-size:10.5px;line-height:1.35}.home-v182-test-list a{display:grid;grid-template-columns:48px 1fr auto;gap:8px;align-items:center;padding:9px 10px;border:1px solid #e6eaf1;border-radius:10px;text-decoration:none;background:#fff}.home-v182-test-list a>span{font-weight:900;color:#e0607d;font-size:11px}.home-v182-test-list strong{font-size:11px;color:#24314a}.home-v182-test-list small{font-size:9px;color:#8691a3}
.home-v182-empty{padding:15px;border:1px dashed #dce3ee;border-radius:12px;background:#fafbfd;color:#6c788c}.home-v182-empty.small{padding:12px;font-size:11px;line-height:1.4}
.home-v182-today-card{margin-top:16px}.home-v182-today-content{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:18px;align-items:start}.home-v182-subject-chips{display:flex;gap:8px;flex-wrap:wrap}.home-subject-chip{display:grid;grid-template-columns:30px 1fr auto;gap:8px;align-items:center;min-width:190px;padding:9px 11px;border:1px solid #e4e9f2;border-radius:11px;text-decoration:none;background:#fff;color:#1d2940}.home-subject-chip:hover{border-color:#8691f4;box-shadow:0 6px 16px rgba(65,77,150,.08)}.home-subject-chip-icon{width:30px;height:30px;border-radius:9px;background:#f1f4ff;display:grid;place-items:center}.home-subject-chip strong,.home-subject-chip small{display:block}.home-subject-chip strong{font-size:11px}.home-subject-chip small{font-size:9px;color:#8792a4;margin-top:1px}.home-subject-chip>b{color:#2d9c6b}.home-subject-chip.is-done{background:#f6fbf8;border-color:#d8eee2}.home-v182-activity-list{padding-left:16px;border-left:1px solid #e8ebf2;display:grid;gap:7px}.home-v182-activity-list>div{display:grid;grid-template-columns:48px 1fr;gap:8px;font-size:11px}.home-v182-activity-list b{color:#5e66d8}.home-v182-activity-list>small{color:#7f8a9c;font-size:11px}
@media(max-width:1100px){.home-v182-top-grid{grid-template-columns:1fr}.home-v182-alerts{grid-template-columns:1fr 1fr}.home-v182-middle-grid{grid-template-columns:1fr 1fr}.home-v182-tests-card{grid-column:1/-1}.home-v182-today-content{grid-template-columns:1fr}}
@media(max-width:760px){.home-v182-hero{align-items:flex-start;flex-direction:column}.home-v182-hero-stats{grid-template-columns:repeat(3,minmax(76px,1fr));width:100%}.home-v182-next-list{grid-template-columns:1fr}.home-v182-alerts,.home-v182-middle-grid{grid-template-columns:1fr}.home-v182-tests-card{grid-column:auto}.home-v182-today-content{grid-template-columns:1fr}.home-v182-activity-list{padding-left:0;padding-top:12px;border-left:0;border-top:1px solid #e8ebf2}.home-v182-section-head{align-items:flex-start}.home-v182-next-item{grid-template-columns:34px 84px 1fr auto}}


/* V18.3.1 — 4 subject cards per row on desktop */
.subjects-page-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.subjects-page-grid .subject-launch-card{
  min-height:154px;
}
@media(max-width:1280px){
  .subjects-page-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:1000px){
  .subjects-page-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:680px){
  .subjects-page-grid{grid-template-columns:1fr}
}


/* V18.4 schedule/home/subjects refinement */
.home-v182-next-list{grid-template-columns:1fr!important}
.home-v182-next-item{min-height:44px}

.schedule-now-bar{display:none!important}
.timetable-subject,.timetable-club,.timetable-custom-subject{min-height:50px!important;height:auto!important;padding:7px 6px!important}
.timetable-subject small,.timetable-club small,.timetable-custom-subject small{display:none!important}
.school-timetable td{height:64px!important}
.schedule-activities-card{margin-top:16px;padding:18px}
.schedule-activities-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:13px}
.schedule-activities-head h3{margin:2px 0 3px;font-size:17px}
.schedule-activities-head p{margin:0;color:var(--muted);font-size:11px}
.schedule-activities-head a{font-size:11px;font-weight:800;color:#5866db;text-decoration:none}
.schedule-activities-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.schedule-activity-item{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;padding:10px 11px;border:1px solid #e4e9f1;border-radius:11px;background:#fafcff}
.schedule-activity-day{font-size:9px;font-weight:900;color:#5967dc;text-transform:uppercase}
.schedule-activity-item strong{font-size:11px}
.schedule-activity-item small{font-size:10px;color:#7f8ba0;font-variant-numeric:tabular-nums}
.schedule-activities-empty{padding:12px;border:1px dashed #dce3ee;border-radius:10px;color:#748197;font-size:11px}

/* Compact student subject cards */
.subjects-intro{padding:18px 22px!important;margin-bottom:14px!important;min-height:0!important}
.subjects-intro h2{font-size:25px!important;margin-bottom:3px!important}
.subjects-intro p{font-size:12px!important}
.subjects-page-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:11px!important}
.subject-launch-card{min-height:0!important;height:auto!important;padding:12px 13px!important;gap:8px!important;border-radius:14px!important}
.subject-launch-card .subject-top{align-items:center!important;gap:9px!important}
.subject-launch-card .subject-icon{width:34px!important;height:34px!important;min-width:34px;display:grid!important;place-items:center;border-radius:10px;background:#f1f4ff;font-size:18px!important}
.subject-launch-card .subject-title{font-size:12.5px!important;line-height:1.25!important}
.subject-launch-card .subject-meta{font-size:9.5px!important;line-height:1.25!important;margin-top:2px!important}
.subject-card-statuses{margin-top:0!important;display:flex;gap:5px;flex-wrap:wrap}
.subject-card-statuses .status{font-size:9px!important;padding:3px 6px!important}

/* timetable mobile usability */
@media(max-width:1280px){
  .subjects-page-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .schedule-activities-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
  .subjects-page-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .timetable-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .school-timetable{min-width:760px!important}
  .school-timetable .period-head,.school-timetable .time-head{position:sticky;left:0;z-index:3}
  .school-timetable thead .time-head{z-index:5}
}
@media(max-width:600px){
  .content{padding:14px 10px!important}
  .student-page-intro.subjects-intro{padding:14px 15px!important;border-radius:15px!important}
  .subjects-intro-icon{display:none!important}
  .subjects-page-grid{grid-template-columns:1fr!important;gap:8px!important}
  .subject-launch-card{padding:10px 11px!important}
  .subject-launch-card .subject-icon{width:32px!important;height:32px!important;min-width:32px}
  .subject-launch-card .subject-title{font-size:12px!important}
  .subject-launch-card .subject-meta{font-size:9px!important}
  .schedule-activities-grid{grid-template-columns:1fr}
  .schedule-activities-head{flex-direction:column}
  .school-timetable{min-width:700px!important}
}


/* ==========================================================
   V18.5 — StudyLab visual system for a 12-year-old student
   Modern, energetic, clear, not childish.
   ========================================================== */

:root{
  --bg:#f5f7ff;
  --card:#ffffff;
  --ink:#17213a;
  --muted:#71809a;
  --line:#e2e7f2;
  --nav:#17264d;
  --nav2:#213765;
  --blue:#5968f5;
  --blue-2:#3f87ef;
  --cyan:#31b9d7;
  --purple:#7564f6;
  --blue-soft:#eef1ff;
  --green:#24966d;
  --green-soft:#eaf8f2;
  --amber:#b77814;
  --amber-soft:#fff5dc;
  --red:#d95870;
  --red-soft:#fff0f3;
  --shadow:0 10px 28px rgba(55,70,130,.08);
  --shadow-hover:0 16px 34px rgba(55,70,130,.13);
  --radius:18px;
}

body{
  background:
    radial-gradient(circle at 85% 6%,rgba(70,176,224,.10),transparent 26rem),
    radial-gradient(circle at 10% 35%,rgba(117,100,246,.07),transparent 24rem),
    var(--bg);
}

/* Sidebar */
.sidebar{
  background:linear-gradient(180deg,#17264d 0%,#19325d 100%);
  box-shadow:10px 0 30px rgba(28,43,84,.08);
}
.brand{padding-top:6px}
.brand-mark{
  background:linear-gradient(145deg,#7065ff,#376ee9 55%,#28bad8);
  box-shadow:0 8px 18px rgba(66,94,224,.34),inset 0 0 0 1px rgba(255,255,255,.20);
}
.brand strong{font-size:16px}
.brand small{color:#93c9ff}
.nav-link{
  display:flex;
  align-items:center;
  min-height:46px;
  border-radius:13px;
  font-weight:700;
  color:#c8d5ef;
  transition:.18s ease;
}
.nav-link:hover{
  background:rgba(255,255,255,.08);
  color:white;
  transform:translateX(2px);
}
.nav-link.active{
  background:linear-gradient(100deg,#675af4,#536ef0);
  color:white;
  box-shadow:0 8px 20px rgba(69,76,210,.25);
}

/* Top bar + general cards */
.topbar{
  height:68px;
  background:rgba(255,255,255,.92);
  border-bottom:1px solid rgba(218,225,239,.9);
  box-shadow:0 4px 18px rgba(40,56,105,.04);
}
.topbar h1{font-size:21px}
.card{
  border-color:#e1e6f1;
  box-shadow:var(--shadow);
}
.card:hover{border-color:#d6dff0}
.hero h2,.student-page-intro h2{color:#14213c}
.eyebrow{
  font-size:10px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#6571df;
  font-weight:900;
}

/* Buttons */
.btn{
  background:linear-gradient(100deg,#5d62f0,#3d84eb);
  box-shadow:0 7px 16px rgba(68,89,221,.20);
}
.btn:hover{background:linear-gradient(100deg,#5157df,#3779da);transform:translateY(-1px)}
.ghost-btn{border-color:#dce3ef;background:#fbfcff}

/* Home */
.home-v182-hero{
  background:linear-gradient(110deg,#6859f2 0%,#5268ee 45%,#30b6d5 100%);
  border:1px solid rgba(255,255,255,.25);
  box-shadow:0 18px 40px rgba(74,84,192,.18);
}
.home-v182-hero-stats>div{
  background:rgba(255,255,255,.15);
  border:1px solid rgba(255,255,255,.13);
}
.home-v182-next-item{
  border-color:#e4e9f4;
  background:linear-gradient(180deg,#fff,#fafbff);
}
.home-v182-next-item .period{
  width:34px;height:34px;border-radius:9px;
  display:grid;place-items:center;
  background:#eef1ff;color:#5f64e8;
}
.home-v182-alert-card,.home-v182-study-card,.home-v182-weekend-card,.home-v182-tests-card,.home-v182-today-card,.home-v182-next-card{
  transition:.18s box-shadow,.18s transform;
}
.home-v182-alert-card:hover,.home-v182-study-card:hover,.home-v182-weekend-card:hover,.home-v182-tests-card:hover,.home-v182-today-card:hover,.home-v182-next-card:hover{
  box-shadow:var(--shadow-hover);
}

/* Student subjects page */
.student-page-intro.subjects-intro{
  background:linear-gradient(120deg,#f1f3ff 0%,#f7fbff 100%);
  border:1px solid #dfe6f5;
  box-shadow:none;
}
.subjects-page-grid{align-items:stretch}
.subject-launch-card{
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,#fff 0%,#fbfcff 100%);
  border:1px solid #e1e7f2;
  box-shadow:0 6px 18px rgba(49,62,116,.055);
  transition:.18s ease;
}
.subject-launch-card::before{
  content:"";
  position:absolute;left:0;top:0;bottom:0;width:4px;
  background:linear-gradient(180deg,#7564f6,#35bdd7);
}
.subject-launch-card:hover{
  transform:translateY(-2px);
  border-color:#ccd6ef;
  box-shadow:0 12px 26px rgba(55,70,130,.11);
}
.subject-launch-card .subject-icon{
  background:linear-gradient(145deg,#f0f1ff,#eef9ff);
  box-shadow:inset 0 0 0 1px #e5e9f5;
}
.subject-launch-card .subject-title{font-weight:850;color:#1a2741}
.subject-launch-card .subject-meta{color:#7b879c}

/* School timetable */
.timetable-wrap{
  border:1px solid #dfe6f1;
  border-radius:18px;
  overflow:auto;
  box-shadow:var(--shadow);
  background:#fff;
}
.school-timetable{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
}
.school-timetable th,.school-timetable td{border-color:#e3e8f1!important}
.school-timetable thead th{
  background:#f4f6fc!important;
  color:#26324d;
  font-weight:850;
}
.school-timetable thead th.today-col{
  background:#edf1ff!important;
  color:#5664db;
}
.period-head{
  width:82px;
  background:#f8faff!important;
  text-align:center!important;
}
.period-head strong{
  display:block;
  font-size:13px;
  color:#34405a;
}
.period-head small{
  display:block!important;
  margin-top:3px;
  font-size:8.5px!important;
  line-height:1.15;
  color:#8290a8!important;
  font-variant-numeric:tabular-nums;
}
.timetable-subject,.timetable-club,.timetable-custom-subject{
  border-radius:12px!important;
}
.timetable-subject{
  background:linear-gradient(180deg,#f8f9ff,#f3f6ff)!important;
  border:1px solid #e7e9f7!important;
  color:#17213a!important;
}
.timetable-subject:hover{
  border-color:#cdd5f6!important;
  background:#f0f3ff!important;
}
.timetable-club{
  background:linear-gradient(180deg,#fff9e8,#fff4d9)!important;
  border:1px solid #f2dc9e!important;
}
.timetable-custom-subject{
  background:#f7f9fc!important;
  border:1px solid #e4e9f0!important;
}
.today-cell{background:#fbfcff!important}
.current-period-row td,.current-period-row .period-head{
  box-shadow:inset 0 2px 0 rgba(86,103,224,.18),inset 0 -2px 0 rgba(86,103,224,.18);
}

/* Activities under schedule */
.schedule-activities-card{
  background:linear-gradient(180deg,#fff,#fbfcff);
}
.schedule-activity-item{
  min-height:48px;
  background:#fff;
  transition:.15s ease;
}
.schedule-activity-item:hover{transform:translateY(-1px);box-shadow:0 7px 18px rgba(55,70,130,.07)}
.schedule-activity-day{
  background:#eef1ff;
  border-radius:999px;
  padding:4px 7px;
}

/* Admin */
.admin-section,.subject-settings-card{
  box-shadow:0 6px 18px rgba(44,57,108,.05);
}
.drag-handle,.subject-order-buttons button{
  transition:.15s ease;
}
.drag-handle:hover,.subject-order-buttons button:hover{
  background:#eef1ff;border-color:#cbd4f3;color:#5963dc;
}

/* Forms */
.input,select,textarea,input[type=date],input[type=text],input[type=url],input[type=password]{
  border-color:#d7dfed;
  background:#fff;
}
.input:focus,select:focus,textarea:focus,input:focus{
  border-color:#7e89f5;
  box-shadow:0 0 0 3px rgba(100,106,235,.11);
}

/* Mobile */
@media(max-width:780px){
  .topbar{height:58px;padding:0 12px}
  .topbar h1{font-size:18px}
  .content{padding:14px 10px 24px}
  .sidebar{width:276px}
  .nav-link{min-height:48px;font-size:14px}
  .card{border-radius:15px}

  .home-v182-hero{
    margin-top:10px;
    padding:18px 16px;
    border-radius:17px;
  }
  .home-v182-hero h2{font-size:24px}
  .home-v182-hero p{font-size:12px}
  .home-v182-hero-stats{gap:6px}
  .home-v182-hero-stats>div{padding:9px 6px}
  .home-v182-hero-stats strong{font-size:18px}

  .home-v182-top-grid,.home-v182-middle-grid{gap:10px}
  .home-v182-next-card,.home-v182-study-card,.home-v182-weekend-card,.home-v182-tests-card,.home-v182-today-card{padding:13px}
  .home-v182-next-item{
    grid-template-columns:34px 76px minmax(0,1fr) auto!important;
    padding:8px;
    gap:6px;
  }
  .home-v182-next-item .time{font-size:9px}
  .home-v182-next-item strong{font-size:10.5px}
  .home-v182-section-head{margin-bottom:10px}
  .home-v182-title-wrap h3{font-size:15px}

  .subjects-intro h2{font-size:22px!important}
  .subjects-intro p{font-size:11px!important}
  .subject-launch-card{
    min-height:auto!important;
    padding:10px 11px!important;
    border-radius:13px!important;
  }
  .subject-launch-card .subject-top{gap:8px!important}
  .subject-launch-card .subject-icon{
    width:34px!important;height:34px!important;min-width:34px!important;
  }
  .subject-launch-card .subject-title{font-size:12.5px!important}
  .subject-launch-card .subject-meta{font-size:9.5px!important}

  .schedule-activities-card{padding:13px}
  .schedule-activity-item{grid-template-columns:auto 1fr auto;padding:9px}
  .timetable-wrap{border-radius:13px}
  .school-timetable{min-width:720px!important}
  .period-head{width:74px}
}

@media(max-width:430px){
  .content{padding-left:8px;padding-right:8px}
  .home-v182-hero-stats{grid-template-columns:repeat(3,1fr)}
  .home-v182-hero-stats span,.home-v182-hero-stats small{font-size:8px}
  .home-v182-next-item{grid-template-columns:31px 70px minmax(0,1fr)!important}
  .home-v182-next-item em{display:none}
  .subject-launch-card .subject-meta{white-space:normal}
}


/* ==========================================================
   V18.6 — stronger visual polish + aligned activities
   ========================================================== */

/* Make the redesign more visibly modern and lively */
body{
  background:
    linear-gradient(180deg,rgba(245,247,255,.94),rgba(248,250,255,.98)),
    radial-gradient(circle at 12% 8%,rgba(117,100,246,.14),transparent 22rem),
    radial-gradient(circle at 88% 12%,rgba(49,185,215,.13),transparent 24rem)!important;
}
.main{
  background:transparent!important;
}
.topbar{
  backdrop-filter:blur(12px);
}
.content{
  max-width:1380px;
  margin:0 auto;
}
.card{
  border:1px solid rgba(216,224,240,.92)!important;
  box-shadow:0 10px 30px rgba(50,64,118,.075)!important;
}
.student-page-intro,.hero{
  border-radius:20px!important;
}
.student-page-intro.subjects-intro{
  background:
    radial-gradient(circle at 90% 18%,rgba(61,133,235,.10),transparent 14rem),
    linear-gradient(120deg,#f2f3ff 0%,#f8fbff 100%)!important;
}
.subjects-intro-icon{
  background:linear-gradient(145deg,#6e62f4,#3e88ee)!important;
  color:#fff!important;
  box-shadow:0 10px 22px rgba(74,92,220,.22)!important;
}

/* tighter + more useful subject cards */
.subject-launch-card{
  min-height:88px!important;
  padding:12px 13px!important;
  display:flex!important;
  align-items:flex-start!important;
}
.subject-launch-card .subject-top{
  width:100%;
}
.subject-launch-card .subject-title{
  font-size:13px!important;
}
.subject-launch-card .subject-meta{
  margin-top:3px!important;
}
.subjects-page-grid{
  gap:10px!important;
}

/* integrated sample schedule action */
.schedule-quick-actions{
  margin:10px 0 14px;
  padding:11px 12px;
  border:1px solid #e2e7f3;
  border-radius:12px;
  background:linear-gradient(180deg,#fbfcff,#f7f9ff);
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.schedule-quick-actions form{margin:0}
.schedule-quick-actions small{color:#7a879d;font-size:10px}

/* activities aligned exactly under weekday columns */
.schedule-activities-card{
  padding:16px!important;
  margin-top:14px!important;
}
.activities-timetable-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid #e1e7f2;
  border-radius:14px;
  background:#fff;
}
.activities-timetable{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
}
.activities-timetable th,
.activities-timetable td{
  border-right:1px solid #e3e8f1;
  border-bottom:1px solid #e3e8f1;
  padding:8px;
  vertical-align:top;
}
.activities-timetable tr:last-child th,
.activities-timetable tr:last-child td{border-bottom:0}
.activities-timetable th:last-child,
.activities-timetable td:last-child{border-right:0}
.activities-timetable thead th{
  background:#f4f6fc;
  color:#2c3853;
  font-size:10px;
  font-weight:850;
  text-align:center;
}
.activities-timetable .today-col{
  background:#eef1ff;
  color:#5965dc;
}
.activity-label-head,
.activity-label-cell{
  width:82px;
  background:#f8faff!important;
  text-align:center;
}
.activity-label-cell{
  font-size:9px;
  color:#7f8aa0;
  font-weight:800;
  vertical-align:middle!important;
}
.activity-day-stack{
  display:grid;
  gap:6px;
}
.activity-chip{
  display:block;
  padding:8px 9px;
  border-radius:10px;
  border:1px solid #dfe5f2;
  background:linear-gradient(180deg,#fff,#f8faff);
  text-decoration:none;
  color:#1c2942;
  transition:.15s ease;
}
.activity-chip:hover{
  transform:translateY(-1px);
  border-color:#c9d4f4;
  box-shadow:0 6px 16px rgba(55,70,130,.08);
}
.activity-chip strong{
  display:block;
  font-size:10.5px;
  line-height:1.2;
}
.activity-chip small{
  display:block;
  margin-top:3px;
  color:#768399;
  font-size:9px;
  font-variant-numeric:tabular-nums;
}

/* home: stronger hierarchy and less empty space */
.home-v182-hero{
  padding:22px 24px!important;
}
.home-v182-next-card{
  background:
    radial-gradient(circle at 92% 12%,rgba(86,104,245,.08),transparent 12rem),
    #fff;
}
.home-v182-next-list{
  gap:6px!important;
}
.home-v182-next-item{
  border-radius:10px!important;
}
.home-v182-middle-grid{
  gap:12px!important;
}
.home-v182-study-card,
.home-v182-weekend-card,
.home-v182-tests-card{
  min-height:180px;
}

/* mobile */
@media(max-width:900px){
  .activities-timetable{min-width:760px}
  .activity-label-head,.activity-label-cell{
    position:sticky;
    left:0;
    z-index:3;
  }
  .activities-timetable thead .activity-label-head{z-index:5}
}
@media(max-width:600px){
  .content{max-width:none}
  .subjects-page-grid{gap:7px!important}
  .subject-launch-card{
    min-height:70px!important;
    padding:9px 10px!important;
  }
  .subject-launch-card .subject-title{
    font-size:12px!important;
  }
  .student-page-intro.subjects-intro{
    margin-bottom:10px!important;
  }
  .activities-timetable{min-width:700px}
  .schedule-quick-actions{align-items:flex-start;flex-direction:column}
}


/* ==========================================================
   V18.7 — schedule normalization + rich subject page
   ========================================================== */

/* Unlinked school subjects look like regular subjects */
.timetable-custom-subject{
  min-height:50px!important;
  height:auto!important;
  padding:7px 6px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  border-radius:12px!important;
  background:linear-gradient(180deg,#f8f9ff,#f3f6ff)!important;
  border:1px solid #e7e9f7!important;
  color:#17213a!important;
  font-family:inherit!important;
  font-size:inherit!important;
  font-weight:inherit!important;
}
.timetable-custom-subject>span{
  display:block;
  font-size:16px;
  line-height:1;
}
.timetable-custom-subject>strong{
  font-family:inherit!important;
  font-size:10.5px!important;
  line-height:1.2!important;
  font-weight:800!important;
  color:#17213a!important;
}
.timetable-custom-subject:hover{
  border-color:#cdd5f6!important;
  background:#f0f3ff!important;
}

/* Remove unnecessary activities explanatory copy */
.schedule-activities-head>div>p{display:none!important}

/* Subject page */
.subject-v187-hero{
  padding:20px;
  margin-top:24px;
  background:
    radial-gradient(circle at 94% 10%,rgba(65,136,239,.11),transparent 14rem),
    linear-gradient(135deg,#fff,#f8faff);
}
.subject-v187-head{
  display:grid;
  grid-template-columns:52px minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
}
.subject-v187-icon{
  width:52px;height:52px;
  border-radius:15px;
  display:grid;place-items:center;
  font-size:27px;
  background:linear-gradient(145deg,#eef0ff,#eaf8ff);
  box-shadow:inset 0 0 0 1px #e1e6f3;
}
.subject-v187-title h2{
  margin:2px 0 5px;
  font-size:27px;
  line-height:1.1;
}
.subject-v187-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px 14px;
  color:#748198;
  font-size:11px;
}
.subject-v187-quick-status{
  display:flex;
  gap:8px;
}
.subject-v187-quick-status>div{
  min-width:112px;
  padding:9px 11px;
  border-radius:12px;
  border:1px solid #e0e6f2;
  background:rgba(255,255,255,.78);
}
.subject-v187-quick-status small,
.subject-v187-quick-status strong{display:block}
.subject-v187-quick-status small{font-size:8.5px;color:#8490a4}
.subject-v187-quick-status strong{margin-top:2px;font-size:12px;color:#24314c}

.subject-v187-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin-top:16px;
}
.subject-action{
  display:grid;
  grid-template-columns:36px 1fr;
  gap:9px;
  align-items:center;
  min-height:64px;
  padding:10px 12px;
  border:1px solid #e1e7f2;
  border-radius:13px;
  background:#fff;
  text-decoration:none;
  color:#1b2943;
  transition:.16s ease;
}
.subject-action:hover{
  transform:translateY(-1px);
  border-color:#cbd5f4;
  box-shadow:0 8px 20px rgba(55,70,130,.08);
}
.subject-action.primary{
  background:linear-gradient(180deg,#f2f4ff,#edf2ff);
  border-color:#d6ddff;
}
.subject-action.test{background:linear-gradient(180deg,#fff8fa,#fff)}
.subject-action.chat{background:linear-gradient(180deg,#eefbff,#fff)}
.subject-action.disabled{opacity:.62}
.subject-action-icon{
  width:36px;height:36px;border-radius:10px;
  display:grid;place-items:center;
  background:rgba(255,255,255,.82);
  box-shadow:inset 0 0 0 1px rgba(214,222,239,.9);
}
.subject-action strong,.subject-action small{display:block}
.subject-action strong{font-size:12px}
.subject-action small{margin-top:2px;color:#79869a;font-size:9.5px;line-height:1.3}

.subject-v187-grid{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(300px,.8fr);
  gap:14px;
  margin-top:14px;
}
.subject-v187-panel{
  padding:17px;
}
.subject-v187-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:12px;
}
.subject-v187-panel-head h3{
  margin:2px 0 0;
  font-size:17px;
}
.subject-v187-panel-head>a{
  font-size:10px;
  font-weight:800;
  text-decoration:none;
  color:#5966dc;
}
.subject-v187-detail-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.subject-v187-detail{
  display:grid;
  grid-template-columns:28px 1fr;
  gap:8px;
  align-items:start;
  min-height:68px;
  padding:10px;
  border-radius:11px;
  background:#f8faff;
  border:1px solid #e6ebf3;
}
.subject-v187-detail>span{font-size:16px}
.subject-v187-detail small,.subject-v187-detail strong{display:block}
.subject-v187-detail small{font-size:8.5px;color:#8490a4}
.subject-v187-detail strong{
  margin-top:3px;
  font-size:10.5px;
  line-height:1.35;
  color:#26334d;
  font-weight:700;
}
.subject-v187-study-notes{
  display:grid;
  gap:7px;
  margin-top:9px;
}
.subject-v187-study-notes>div{
  padding:9px 10px;
  border-left:3px solid #7168ef;
  border-radius:8px;
  background:#fafaff;
}
.subject-v187-study-notes small{
  display:block;
  color:#6d77d2;
  font-size:8.5px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.subject-v187-study-notes p{
  margin:3px 0 0;
  color:#536078;
  font-size:10.5px;
  line-height:1.4;
}

.subject-v187-date-badge{
  background:#eef1ff;
  color:#5965dc;
  border-radius:999px;
  padding:5px 8px;
  font-size:9px;
  font-weight:900;
}
.subject-v187-test-info{
  display:grid;
  gap:9px;
}
.subject-v187-test-info>div:not(.subject-v187-test-footer){
  padding:10px;
  border-radius:10px;
  background:#f8fafc;
  border:1px solid #e6ebf2;
}
.subject-v187-test-info small{
  display:block;
  color:#8490a5;
  font-size:8.5px;
  font-weight:800;
}
.subject-v187-test-info p{
  margin:4px 0 0;
  color:#344159;
  font-size:10.5px;
  line-height:1.4;
}
.subject-v187-test-footer{
  display:flex;
  justify-content:space-between;
  gap:8px;
  align-items:center;
  padding-top:2px;
}
.subject-v187-test-footer span{
  color:#77849a;
  font-size:9.5px;
}
.subject-v187-test-footer a{
  color:#5966dc;
  font-size:9.5px;
  font-weight:850;
  text-decoration:none;
}

.subject-v187-history{
  margin-top:14px;
  padding:17px;
}
.subject-v187-history-list{
  display:grid;
  gap:7px;
}
.subject-v187-history-row{
  display:grid;
  grid-template-columns:74px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:9px 10px;
  border-radius:10px;
  background:#fafbfe;
  border:1px solid #e7ebf3;
}
.subject-v187-history-date strong,
.subject-v187-history-date small,
.subject-v187-history-main strong,
.subject-v187-history-main small{display:block}
.subject-v187-history-date strong{font-size:11px;color:#34415a}
.subject-v187-history-date small{margin-top:2px;font-size:8px;color:#8a95a7}
.subject-v187-history-main strong{font-size:10.5px;color:#25324b}
.subject-v187-history-main small{
  margin-top:2px;
  color:#7a8699;
  font-size:9px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.subject-v187-score{
  padding:4px 7px;
  border-radius:999px;
  background:#edf8f2;
  color:#2a8f68;
  font-size:8.5px;
  font-weight:900;
}
.subject-v187-empty{
  padding:13px;
  border:1px dashed #dce3ee;
  border-radius:10px;
  background:#fafbfd;
  color:#748198;
  font-size:10.5px;
  line-height:1.45;
}

@media(max-width:950px){
  .subject-v187-grid{grid-template-columns:1fr}
}
@media(max-width:720px){
  .subject-v187-hero{margin-top:12px;padding:14px}
  .subject-v187-head{
    grid-template-columns:44px 1fr;
  }
  .subject-v187-icon{width:44px;height:44px;font-size:22px}
  .subject-v187-title h2{font-size:22px}
  .subject-v187-quick-status{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .subject-v187-actions{grid-template-columns:1fr}
  .subject-action{min-height:56px}
  .subject-v187-detail-grid{grid-template-columns:1fr}
  .subject-v187-panel,.subject-v187-history{padding:13px}
  .subject-v187-history-row{
    grid-template-columns:58px minmax(0,1fr);
  }
  .subject-v187-score{grid-column:2;justify-self:start}
}


/* ==========================================================
   V18.8 — friendlier 12-year-old visual system + readability
   ========================================================== */
:root{
  --kid-violet:#7065f4;
  --kid-blue:#4e83ef;
  --kid-cyan:#35bad7;
  --kid-mint:#4cc49a;
  --kid-yellow:#f5c451;
  --kid-coral:#f17783;
  --kid-ink:#17233d;
  --kid-muted:#6f7d96;
}

/* Global readability: slightly larger, warmer, more inviting */
body{
  font-size:15px!important;
  color:var(--kid-ink)!important;
}
.topbar h1{font-size:23px!important}
.nav-link{font-size:14.5px!important}
.card h3{font-size:18px}
.eyebrow{font-size:10.5px!important}
.muted,.subject-meta,.subject-launch-card .subject-meta{color:var(--kid-muted)!important}

/* More cheerful without becoming childish */
.sidebar{
  background:
    radial-gradient(circle at 26% 5%,rgba(75,134,238,.20),transparent 12rem),
    linear-gradient(180deg,#17264d 0%,#1a3565 100%)!important;
}
.nav-link.active{
  background:linear-gradient(105deg,#7564f6,#4c7ff0 70%,#3caedc)!important;
}
.home-v182-hero{
  background:
    radial-gradient(circle at 92% 15%,rgba(255,255,255,.16),transparent 9rem),
    linear-gradient(110deg,#735ff3 0%,#4d79ef 52%,#34bad6 100%)!important;
}
.home-v182-title-wrap .home-v182-icon,
.subject-v187-icon,
.subject-launch-card .subject-icon{
  background:linear-gradient(145deg,#f0efff,#eafaff)!important;
}
.home-v182-study-card{border-top:3px solid var(--kid-violet)!important}
.home-v182-weekend-card{border-top:3px solid var(--kid-mint)!important}
.home-v182-tests-card{border-top:3px solid var(--kid-coral)!important}
.home-v182-next-card{border-top:3px solid var(--kid-blue)!important}

/* Home readability */
.home-v182-hero h2{font-size:32px!important}
.home-v182-hero p{font-size:14px!important}
.home-v182-next-item strong{font-size:12.5px!important}
.home-v182-next-item .time{font-size:10.5px!important}
.home-v182-alert-card strong{font-size:14.5px!important}
.home-v182-alert-card small{font-size:11px!important}
.home-v182-task-list strong,.home-v182-review-list strong{font-size:12.5px!important}
.home-v182-task-list small,.home-v182-review-list small{font-size:10.8px!important}

/* Subjects catalogue: readable but compact */
.subject-launch-card{
  min-height:92px!important;
  padding:13px 14px!important;
}
.subject-launch-card .subject-title{
  font-size:14px!important;
  line-height:1.25!important;
}
.subject-launch-card .subject-meta{
  font-size:10.5px!important;
  line-height:1.3!important;
}
.subjects-intro h2{font-size:28px!important}
.subjects-intro p{font-size:13px!important}

/* Timetable */
.school-timetable thead th{font-size:11.5px!important}
.period-head strong{font-size:14px!important}
.period-head small{font-size:9px!important}
.timetable-subject strong,
.timetable-custom-subject>strong,
.timetable-club strong{
  font-size:11.5px!important;
}
.timetable-subject,
.timetable-custom-subject{
  background:linear-gradient(180deg,#fafaff,#f4f7ff)!important;
}
.timetable-subject:hover,.timetable-custom-subject:hover{
  background:linear-gradient(180deg,#f5f5ff,#eef3ff)!important;
}
.activity-chip strong{font-size:11.5px!important}
.activity-chip small{font-size:9.5px!important}

/* Rich subject page: larger type */
.subject-v187-title h2{font-size:30px!important}
.subject-v187-meta{font-size:12px!important}
.subject-action strong{font-size:13.5px!important}
.subject-action small{font-size:10.5px!important}
.subject-v187-detail small{font-size:9.5px!important}
.subject-v187-detail strong{font-size:11.5px!important}
.subject-v187-study-notes p{font-size:11px!important}
.subject-v187-history-main strong{font-size:11.5px!important}
.subject-v187-history-main small{font-size:9.8px!important}
.subject-v187-empty{font-size:11.5px!important}

/* Little visual personality in cards */
.subject-launch-card:nth-child(6n+1)::before{background:linear-gradient(180deg,#7564f6,#4c83ef)!important}
.subject-launch-card:nth-child(6n+2)::before{background:linear-gradient(180deg,#4c83ef,#35bad7)!important}
.subject-launch-card:nth-child(6n+3)::before{background:linear-gradient(180deg,#35bad7,#4cc49a)!important}
.subject-launch-card:nth-child(6n+4)::before{background:linear-gradient(180deg,#f5c451,#f17783)!important}
.subject-launch-card:nth-child(6n+5)::before{background:linear-gradient(180deg,#f17783,#7564f6)!important}
.subject-launch-card:nth-child(6n+6)::before{background:linear-gradient(180deg,#4cc49a,#35bad7)!important}

/* Internal subjects in Parent admin */
.internal-subject-badge{
  display:inline-block;
  margin-left:6px;
  padding:2px 6px;
  border-radius:999px;
  background:#eef1f6;
  color:#77839a;
  font-size:8px;
  font-weight:800;
  vertical-align:middle;
}

/* Mobile: maintain readable sizes, not tiny */
@media(max-width:600px){
  body{font-size:14px!important}
  .topbar h1{font-size:19px!important}
  .nav-link{font-size:14px!important}
  .home-v182-hero h2{font-size:25px!important}
  .subjects-intro h2{font-size:23px!important}
  .subject-launch-card{
    min-height:74px!important;
    padding:10px 11px!important;
  }
  .subject-launch-card .subject-title{font-size:13px!important}
  .subject-launch-card .subject-meta{font-size:10px!important}
  .subject-v187-title h2{font-size:23px!important}
  .subject-action strong{font-size:13px!important}
  .subject-action small{font-size:10px!important}
}


/* ==========================================================
   V18.9 — Bigger type, softer weights, colorful accents
   ========================================================== */

/* Softer typography: larger instead of extra-bold */
body{
  font-size:15.5px!important;
}
.topbar h1{
  font-size:23px!important;
  font-weight:700!important;
}
.nav-link{
  font-size:14.5px!important;
  font-weight:650!important;
}
.eyebrow{
  font-size:10.5px!important;
  font-weight:750!important;
}
.card h3,
.home-v182-title-wrap h3,
.subject-v187-panel-head h3{
  font-weight:700!important;
}

.subject-launch-card .subject-title{
  font-size:14.5px!important;
  font-weight:700!important;
}
.subject-launch-card .subject-meta{
  font-size:11px!important;
  font-weight:400!important;
}
.subjects-intro h2{
  font-size:29px!important;
  font-weight:700!important;
}
.subjects-intro p{
  font-size:13.5px!important;
}

.home-v182-hero h2{
  font-size:32px!important;
  font-weight:700!important;
}
.home-v182-next-item strong,
.home-v182-alert-card strong,
.home-v182-task-list strong,
.home-v182-review-list strong,
.home-v182-test-list strong{
  font-weight:650!important;
}
.home-v182-next-item strong{font-size:13px!important}
.home-v182-alert-card strong{font-size:15px!important}
.home-v182-task-list strong,.home-v182-review-list strong{font-size:13px!important}

/* Home cards: colorful left accents inspired by subject cards */
.home-v182-next-card{
  border-left:5px solid #4e83ef!important;
  border-top:1px solid rgba(216,224,240,.92)!important;
}
.home-v182-study-card{
  border-left:5px solid #7564f6!important;
  border-top:1px solid rgba(216,224,240,.92)!important;
}
.home-v182-weekend-card{
  border-left:5px solid #4cc49a!important;
  border-top:1px solid rgba(216,224,240,.92)!important;
}
.home-v182-tests-card{
  border-left:5px solid #f17783!important;
  border-top:1px solid rgba(216,224,240,.92)!important;
}
.home-v182-today-card{
  border-left:5px solid #35bad7!important;
}
.home-v182-alert-card.test{
  border-left:4px solid #f17783!important;
}
.home-v182-alert-card.activity{
  border-left:4px solid #35bad7!important;
}

/* More playful icon tiles on the home page */
.home-v182-next-card .home-v182-icon{
  background:#edf3ff!important;
  color:#4e83ef!important;
}
.home-v182-study-card .home-v182-icon{
  background:#f1efff!important;
  color:#7564f6!important;
}
.home-v182-weekend-card .home-v182-icon{
  background:#eaf9f3!important;
  color:#38a97f!important;
}
.home-v182-tests-card .home-v182-icon,
.home-v182-alert-card.test .home-v182-alert-icon{
  background:#fff0f3!important;
  color:#e06377!important;
}

/* Subject-specific accent palette */
.subject-theme{--subject-accent:#5968f5}
.subject-key-algebra{--subject-accent:#5b78f6}
.subject-key-geometry{--subject-accent:#50a1ef}
.subject-key-greek_language{--subject-accent:#45c2a1}
.subject-key-literature{--subject-accent:#f39a79}
.subject-key-ancient_greek{--subject-accent:#8b68e8}
.subject-key-ancient_history{--subject-accent:#d08a48}
.subject-key-odyssey{--subject-accent:#4c9ed9}
.subject-key-physics_experiments{--subject-accent:#44b8cf}
.subject-key-biology{--subject-accent:#4fbd91}
.subject-key-geography{--subject-accent:#e18f6f}
.subject-key-informatics{--subject-accent:#916fe8}
.subject-key-french{--subject-accent:#50bea8}
.subject-key-english{--subject-accent:#557ff2}
.subject-key-physical_education{--subject-accent:#f0b649}

/* Carry the accent into the subject page */
.subject-v187-hero.subject-theme{
  border-left:6px solid var(--subject-accent)!important;
}
.subject-v187-hero.subject-theme .subject-v187-icon{
  box-shadow:
    inset 0 0 0 1px rgba(225,230,243,.9),
    0 7px 16px rgba(55,70,130,.08)!important;
  border-bottom:3px solid var(--subject-accent)!important;
}
.subject-v187-grid.subject-theme .subject-v187-latest{
  border-left:4px solid var(--subject-accent)!important;
}
.subject-v187-grid.subject-theme .subject-v187-test{
  border-left:4px solid #f17783!important;
}
.subject-v187-history.subject-theme{
  border-left:4px solid color-mix(in srgb,var(--subject-accent) 72%,#35bad7)!important;
}
.subject-v187-grid.subject-theme .subject-v187-study-notes>div{
  border-left-color:var(--subject-accent)!important;
}
.subject-v187-grid.subject-theme .subject-v187-study-notes small{
  color:var(--subject-accent)!important;
}
.subject-v187-grid.subject-theme .subject-action.primary{
  border-left:4px solid var(--subject-accent)!important;
}

/* Softer weight + slightly larger text inside a subject */
.subject-v187-title h2{
  font-size:30px!important;
  font-weight:700!important;
}
.subject-v187-meta{
  font-size:12.5px!important;
}
.subject-action strong{
  font-size:14px!important;
  font-weight:650!important;
}
.subject-action small{
  font-size:11px!important;
}
.subject-v187-detail strong{
  font-size:12px!important;
  font-weight:600!important;
}
.subject-v187-history-main strong{
  font-size:12px!important;
  font-weight:600!important;
}

/* Timetable text: readable, less heavy */
.school-timetable thead th{
  font-size:12px!important;
  font-weight:700!important;
}
.period-head strong{
  font-size:14px!important;
  font-weight:700!important;
}
.timetable-subject strong,
.timetable-custom-subject>strong,
.timetable-club strong{
  font-size:12px!important;
  font-weight:650!important;
}

/* Mobile: keep type readable */
@media(max-width:600px){
  body{font-size:14.5px!important}
  .subject-launch-card .subject-title{font-size:13.5px!important}
  .subject-launch-card .subject-meta{font-size:10.5px!important}
  .subject-v187-title h2{font-size:24px!important}
  .subject-action strong{font-size:13.5px!important}
  .home-v182-hero h2{font-size:26px!important}
}


/* ==========================================================
   V18.10 — layout precision, unified schedule, StudyCraft link
   ========================================================== */

/* Exact alignment: next-week card uses the same right column as top alerts */
.home-v182-middle-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1.75fr) minmax(280px,.75fr)!important;
  gap:16px!important;
}
.home-v182-middle-left{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  min-width:0;
}
.home-v182-tests-card{
  grid-column:auto!important;
  min-width:0;
}
.home-v182-middle-grid>.home-v182-tests-card{
  align-self:stretch;
}

/* Student schedule starts directly with timetable; no redundant intro block */
.student-area .timetable-wrap{
  margin-top:24px;
}

/* Happier but restrained weekday palette */
.school-timetable thead th:nth-child(2){box-shadow:inset 0 4px 0 #7564f6}
.school-timetable thead th:nth-child(3){box-shadow:inset 0 4px 0 #4e83ef}
.school-timetable thead th:nth-child(4){box-shadow:inset 0 4px 0 #35bad7}
.school-timetable thead th:nth-child(5){box-shadow:inset 0 4px 0 #4cc49a}
.school-timetable thead th:nth-child(6){box-shadow:inset 0 4px 0 #f5b94b}
.school-timetable td:nth-child(2) .timetable-subject{border-left:3px solid #7564f6!important}
.school-timetable td:nth-child(3) .timetable-subject{border-left:3px solid #4e83ef!important}
.school-timetable td:nth-child(4) .timetable-subject{border-left:3px solid #35bad7!important}
.school-timetable td:nth-child(5) .timetable-subject{border-left:3px solid #4cc49a!important}
.school-timetable td:nth-child(6) .timetable-subject{border-left:3px solid #f5b94b!important}
.schedule-legend{opacity:.76}

/* Activity chips: icon + title + time */
.activity-chip{
  display:grid!important;
  grid-template-columns:26px minmax(0,1fr)!important;
  gap:7px!important;
  align-items:center!important;
}
.activity-chip-icon{
  grid-row:1/3;
  width:26px;height:26px;
  display:grid;place-items:center;
  border-radius:8px;
  background:#eef3ff;
  font-size:15px;
}
.activity-chip strong{grid-column:2}
.activity-chip small{grid-column:2}

/* Weekend activities */
.schedule-weekend-strip{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.schedule-weekend-chip{
  display:grid;
  grid-template-columns:32px 1fr;
  gap:8px;
  align-items:center;
  min-width:190px;
  padding:9px 10px;
  border:1px solid #e2e7f1;
  border-radius:11px;
  background:#fffaf0;
}
.schedule-weekend-chip>span{
  width:32px;height:32px;
  display:grid;place-items:center;
  border-radius:9px;
  background:#fff1cb;
}
.schedule-weekend-chip small,.schedule-weekend-chip strong,.schedule-weekend-chip em{display:block}
.schedule-weekend-chip small{font-size:8.5px;color:#a37926;font-weight:700}
.schedule-weekend-chip strong{font-size:11px;color:#26334d;font-weight:650}
.schedule-weekend-chip em{font-style:normal;font-size:9px;color:#7c8799;margin-top:1px}

/* Parent: activity editing is now part of schedule */
.schedule-parent-activities{
  margin-top:16px;
  padding:16px;
}
.schedule-parent-activities-head h3{margin:2px 0 0}
.schedule-activity-form{
  display:grid;
  grid-template-columns:1.2fr .85fr .65fr .65fr 1.2fr auto;
  gap:9px;
  align-items:end;
  margin-top:12px;
}
.schedule-activity-form .field{margin:0}
.schedule-parent-activity-list{
  display:grid;
  gap:7px;
  margin-top:13px;
}
.schedule-parent-activity-row{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  padding:8px 10px;
  border:1px solid #e3e8f1;
  border-radius:10px;
  background:#fafcff;
}
.activity-manage-icon{
  width:34px;height:34px;
  display:grid;place-items:center;
  border-radius:9px;
  background:#eef3ff;
}
.schedule-parent-activity-row strong,.schedule-parent-activity-row small{display:block}
.schedule-parent-activity-row strong{font-size:11.5px}
.schedule-parent-activity-row small{font-size:9.5px;color:#7d899c;margin-top:2px}

/* StudyCraft lives as motivation/reward, secondary to studying */
.student-game-link{
  margin-top:auto!important;
  padding-top:14px!important;
}
.studycraft-sidebar-card{
  background:
    radial-gradient(circle at 92% 12%,rgba(255,255,255,.16),transparent 5rem),
    linear-gradient(110deg,#664fe8,#406fdc 58%,#2da5c7)!important;
  color:#fff!important;
  border:1px solid rgba(255,255,255,.12)!important;
  box-shadow:0 10px 22px rgba(33,59,135,.22)!important;
}
.studycraft-sidebar-card small{color:#dbe9ff!important}
.studycraft-sidebar-card .tool-card-icon{color:#ffd36a!important}
.studycraft-sidebar-card b{color:#fff!important}

/* Since StudyCraft occupies the lower motivation area, keep logout separated */
.student-area .side-footer{margin-top:10px!important}

@media(max-width:1050px){
  .schedule-activity-form{grid-template-columns:repeat(2,minmax(0,1fr))}
  .schedule-activity-form .btn{justify-self:start}
}
@media(max-width:900px){
  .home-v182-middle-grid{grid-template-columns:1fr!important}
  .home-v182-middle-left{grid-template-columns:1fr 1fr}
}
@media(max-width:620px){
  .home-v182-middle-left{grid-template-columns:1fr}
  .schedule-activity-form{grid-template-columns:1fr}
  .schedule-weekend-strip{display:grid;grid-template-columns:1fr}
}


/* ==========================================================
   V18.11 — Canonical subject colors across all StudyLab
   Same subject = same duotone in catalogue, timetable and subject page.
   ========================================================== */

/* Fallback */
.subject-theme{
  --subject-a:#5b78f6;
  --subject-b:#35bad7;
  --subject-soft-a:#f0f3ff;
  --subject-soft-b:#eafaff;
}

/* Canonical subject palettes */
.subject-key-algebra{
  --subject-a:#5d70f2; --subject-b:#43a6ee;
  --subject-soft-a:#eef0ff; --subject-soft-b:#eaf7ff;
}
.subject-key-geometry{
  --subject-a:#8a78df; --subject-b:#68b5e8;
  --subject-soft-a:#f2efff; --subject-soft-b:#eef9ff;
}
.subject-key-greek_language{
  --subject-a:#ec7184; --subject-b:#f4a267;
  --subject-soft-a:#fff0f3; --subject-soft-b:#fff6ea;
}
.subject-key-literature{
  --subject-a:#ef8a64; --subject-b:#efbf62;
  --subject-soft-a:#fff3ed; --subject-soft-b:#fff8e8;
}
.subject-key-ancient_greek{
  --subject-a:#8a67df; --subject-b:#bc76d8;
  --subject-soft-a:#f2efff; --subject-soft-b:#faefff;
}
.subject-key-ancient_history{
  --subject-a:#c88143; --subject-b:#e0aa58;
  --subject-soft-a:#fff3e8; --subject-soft-b:#fff8ea;
}
.subject-key-odyssey{
  --subject-a:#4397dc; --subject-b:#54c0da;
  --subject-soft-a:#edf7ff; --subject-soft-b:#ecfbff;
}
.subject-key-physics_experiments{
  --subject-a:#6a75d9; --subject-b:#49b9cf;
  --subject-soft-a:#f0f1ff; --subject-soft-b:#eafbff;
}
.subject-key-biology{
  --subject-a:#d65a91; --subject-b:#5dc8a1;
  --subject-soft-a:#fff0f7; --subject-soft-b:#ebfaf4;
}
.subject-key-geography{
  --subject-a:#46a969; --subject-b:#4eb8da;
  --subject-soft-a:#edf9f1; --subject-soft-b:#ecfaff;
}
.subject-key-informatics{
  --subject-a:#4f8ee8; --subject-b:#8e72df;
  --subject-soft-a:#edf5ff; --subject-soft-b:#f3efff;
}
.subject-key-french{
  --subject-a:#e08a5b; --subject-b:#e7bd63;
  --subject-soft-a:#fff2e9; --subject-soft-b:#fff8e8;
}
.subject-key-english{
  --subject-a:#4f78e8; --subject-b:#56b0e8;
  --subject-soft-a:#eef2ff; --subject-soft-b:#eef9ff;
}
.subject-key-physical_education{
  --subject-a:#efad43; --subject-b:#5fc58b;
  --subject-soft-a:#fff7e6; --subject-soft-b:#edf9f2;
}

/* SUBJECTS CATALOGUE — same duotone belongs to that subject */
.subject-launch-card.subject-theme{
  border-left:0!important;
  background:
    linear-gradient(180deg,#fff,#fbfcff)!important;
  position:relative;
}
.subject-launch-card.subject-theme::before{
  content:""!important;
  position:absolute!important;
  left:0!important;top:0!important;bottom:0!important;
  width:5px!important;
  background:linear-gradient(180deg,var(--subject-a),var(--subject-b))!important;
  border-radius:14px 0 0 14px!important;
}
.subject-launch-card.subject-theme .subject-icon{
  background:linear-gradient(145deg,var(--subject-soft-a),var(--subject-soft-b))!important;
  border:1px solid color-mix(in srgb,var(--subject-a) 15%,#e7ebf3)!important;
}
.subject-launch-card.subject-theme:hover{
  border-color:color-mix(in srgb,var(--subject-a) 28%,#dfe5ef)!important;
  box-shadow:0 12px 26px color-mix(in srgb,var(--subject-a) 10%,transparent)!important;
}

/* Disable old nth-child color cycle: subject identity wins */
.subject-launch-card:nth-child(n)::before{
  background:linear-gradient(180deg,var(--subject-a),var(--subject-b))!important;
}

/* WEEKLY TIMETABLE — subject keeps the same duotone every day */
.school-timetable td .timetable-subject.subject-theme{
  border-left:4px solid var(--subject-a)!important;
  border-top:1px solid color-mix(in srgb,var(--subject-a) 14%,#e7e9f7)!important;
  border-right:1px solid color-mix(in srgb,var(--subject-b) 14%,#e7e9f7)!important;
  border-bottom:1px solid color-mix(in srgb,var(--subject-b) 14%,#e7e9f7)!important;
  background:
    linear-gradient(135deg,var(--subject-soft-a) 0%,#fff 48%,var(--subject-soft-b) 100%)!important;
}
.school-timetable td .timetable-subject.subject-theme:hover{
  background:
    linear-gradient(135deg,
      color-mix(in srgb,var(--subject-soft-a) 78%,white),
      #fff 46%,
      color-mix(in srgb,var(--subject-soft-b) 78%,white)
    )!important;
  box-shadow:0 6px 14px color-mix(in srgb,var(--subject-a) 10%,transparent)!important;
}

/* Remove weekday-specific lesson accents; the subject color is more useful */
.school-timetable td:nth-child(n) .timetable-subject.subject-theme{
  border-left-color:var(--subject-a)!important;
}

/* SUBJECT PAGE — exactly the same identity colors */
.subject-v187-hero.subject-theme{
  border-left:6px solid var(--subject-a)!important;
  background:
    radial-gradient(circle at 92% 12%,color-mix(in srgb,var(--subject-b) 13%,transparent),transparent 14rem),
    linear-gradient(135deg,#fff,var(--subject-soft-a) 58%,var(--subject-soft-b))!important;
}
.subject-v187-hero.subject-theme .subject-v187-icon{
  background:linear-gradient(145deg,var(--subject-soft-a),var(--subject-soft-b))!important;
  border-bottom:3px solid var(--subject-b)!important;
}
.subject-v187-grid.subject-theme .subject-v187-latest{
  border-left:4px solid var(--subject-a)!important;
}
.subject-v187-history.subject-theme{
  border-left:4px solid var(--subject-b)!important;
}
.subject-v187-grid.subject-theme .subject-v187-study-notes>div{
  border-left-color:var(--subject-b)!important;
  background:linear-gradient(90deg,var(--subject-soft-a),#fff)!important;
}
.subject-v187-grid.subject-theme .subject-v187-study-notes small{
  color:var(--subject-a)!important;
}
.subject-v187-grid.subject-theme .subject-action.primary{
  border-left:4px solid var(--subject-a)!important;
  background:linear-gradient(135deg,var(--subject-soft-a),var(--subject-soft-b))!important;
}
.subject-v187-grid.subject-theme .subject-action.chat{
  border-left:4px solid var(--subject-b)!important;
}

/* Subject-specific small status surfaces */
.subject-v187-hero.subject-theme .subject-v187-quick-status>div:first-child{
  border-top:3px solid var(--subject-a)!important;
}
.subject-v187-hero.subject-theme .subject-v187-quick-status>div:last-child{
  border-top:3px solid var(--subject-b)!important;
}

/* Keep timetable weekday headers cheerful, but not as lesson identity */
.school-timetable thead th:nth-child(2){box-shadow:inset 0 3px 0 #7564f6!important}
.school-timetable thead th:nth-child(3){box-shadow:inset 0 3px 0 #4e83ef!important}
.school-timetable thead th:nth-child(4){box-shadow:inset 0 3px 0 #35bad7!important}
.school-timetable thead th:nth-child(5){box-shadow:inset 0 3px 0 #4cc49a!important}
.school-timetable thead th:nth-child(6){box-shadow:inset 0 3px 0 #f5b94b!important}


/* V18.11.1 — stable activity icons */
.activity-chip-icon,
.activity-manage-icon{
  display:grid!important;
  place-items:center!important;
}
.activity-svg{
  width:24px;
  height:24px;
  display:inline-grid;
  place-items:center;
  border-radius:7px;
  background:#eef3ff;
  color:#5267d9;
  font-weight:800;
  font-size:9px;
  line-height:1;
}
.activity-svg svg{
  width:19px;
  height:19px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.activity-svg-basket{
  background:#fff1df;
  color:#d77d24;
}
.activity-svg-en{
  background:linear-gradient(145deg,#eef2ff,#e8f8ff);
  color:#4e73da;
  letter-spacing:.02em;
}
.activity-svg-generic{
  background:#f1efff;
  color:#7b66db;
}
.activity-emoji{
  font-size:17px;
  line-height:1;
}


/* ==========================================================
   V18.11.2 — Subject catalogue color + compact alignment fix
   ========================================================== */

/* Compact cards: content centered vertically, less dead space */
.subjects-page-grid{
  align-items:stretch!important;
  gap:10px!important;
}
.subject-launch-card{
  min-height:74px!important;
  height:auto!important;
  padding:10px 12px!important;
  display:flex!important;
  align-items:center!important;
  border-radius:13px!important;
}
.subject-launch-card .subject-top{
  width:100%!important;
  display:grid!important;
  grid-template-columns:38px minmax(0,1fr)!important;
  gap:10px!important;
  align-items:center!important;
}
.subject-launch-card .subject-icon{
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  border-radius:11px!important;
  font-size:20px!important;
}
.subject-launch-card .subject-title{
  margin:0!important;
  font-size:14.5px!important;
  line-height:1.22!important;
  font-weight:700!important;
}
.subject-launch-card .subject-meta{
  margin-top:3px!important;
  font-size:10.5px!important;
  line-height:1.2!important;
}

/* Canonical duotone is visible in the catalogue too */
.subject-launch-card.subject-theme{
  position:relative!important;
  overflow:hidden!important;
  border:1px solid color-mix(in srgb,var(--subject-a) 14%,#dfe5ef)!important;
  background:
    linear-gradient(105deg,
      color-mix(in srgb,var(--subject-soft-a) 70%,#fff) 0%,
      #fff 34%,
      #fff 72%,
      color-mix(in srgb,var(--subject-soft-b) 58%,#fff) 100%
    )!important;
}
.subject-launch-card.subject-theme::before{
  content:""!important;
  position:absolute!important;
  left:0!important;
  top:0!important;
  bottom:0!important;
  width:5px!important;
  background:linear-gradient(180deg,var(--subject-a),var(--subject-b))!important;
  border-radius:13px 0 0 13px!important;
}
.subject-launch-card.subject-theme .subject-icon{
  background:linear-gradient(145deg,var(--subject-soft-a),var(--subject-soft-b))!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--subject-a) 15%,#e5eaf2)!important;
}
.subject-launch-card.subject-theme:hover{
  transform:translateY(-2px)!important;
  border-color:color-mix(in srgb,var(--subject-a) 30%,#dfe5ef)!important;
  box-shadow:0 10px 24px color-mix(in srgb,var(--subject-a) 11%,transparent)!important;
}

/* Mobile: compact but comfortable */
@media(max-width:600px){
  .subject-launch-card{
    min-height:66px!important;
    padding:9px 10px!important;
  }
  .subject-launch-card .subject-top{
    grid-template-columns:34px minmax(0,1fr)!important;
    gap:9px!important;
  }
  .subject-launch-card .subject-icon{
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    font-size:18px!important;
  }
  .subject-launch-card .subject-title{
    font-size:13.5px!important;
  }
  .subject-launch-card .subject-meta{
    font-size:10px!important;
  }
}


/* ==========================================================
   V18.13 — Subject card alignment + mobile navigation polish
   ========================================================== */

/* Desktop subject cards: match the clearer Algebra example */
.subject-launch-card{
  min-height:84px!important;
  height:auto!important;
  padding:11px 13px!important;
  display:flex!important;
  align-items:center!important;
}
.subject-launch-card .subject-top{
  width:100%!important;
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr)!important;
  gap:11px!important;
  align-items:center!important;
}
.subject-launch-card .subject-icon{
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  border-radius:12px!important;
  font-size:21px!important;
}
.subject-launch-card .subject-title{
  font-size:15.5px!important;
  line-height:1.2!important;
  font-weight:650!important;
  letter-spacing:-.01em!important;
}
.subject-launch-card .subject-meta{
  margin-top:3px!important;
  font-size:11px!important;
  line-height:1.2!important;
}
.subject-card-statuses{
  margin-top:6px!important;
}

/* Top mobile actions */
.mobile-top-actions{
  display:flex;
  align-items:center;
  gap:7px;
}
.mobile-brand-shortcut{
  display:none;
}
.mobile-brand-shortcut img{
  width:36px;
  height:36px;
  border-radius:11px;
  display:block;
  box-shadow:0 6px 16px rgba(43,77,218,.18);
}
.topbar-title-mobile{
  display:none;
}

/* Bottom quick nav is mobile-only */
.mobile-bottom-nav{
  display:none;
}

@media(max-width:820px){
  /* Give content room above the fixed bottom navigation */
  .student-area .content,
  .parent-area .content{
    padding-bottom:88px!important;
  }

  .mobile-top-actions{
    display:flex!important;
  }
  .mobile-brand-shortcut{
    display:grid!important;
    place-items:center;
    width:40px;
    height:40px;
    min-width:40px;
    border-radius:11px;
    text-decoration:none;
    transition:.15s ease;
  }
  .mobile-brand-shortcut:active{
    transform:scale(.96);
  }

  /* Better mobile topbar balance */
  .topbar{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr) auto!important;
    align-items:center!important;
  }
  .topbar-title{
    justify-self:start!important;
  }
  .topbar-title.has-mobile-title .topbar-title-full{
    display:none;
  }
  .topbar-title.has-mobile-title .topbar-title-mobile{
    display:inline;
  }
  .topbar h1{
    max-width:52vw!important;
  }

  /* App-like bottom navigation for the five most useful destinations */
  .mobile-bottom-nav{
    position:fixed;
    left:8px;
    right:8px;
    bottom:8px;
    z-index:80;
    display:grid!important;
    grid-template-columns:repeat(5,1fr);
    gap:4px;
    padding:6px;
    border:1px solid rgba(214,221,236,.96);
    border-radius:17px;
    background:rgba(255,255,255,.94);
    box-shadow:0 12px 34px rgba(31,46,91,.18);
    backdrop-filter:blur(14px);
  }
  .mobile-bottom-link{
    min-width:0;
    min-height:48px;
    padding:5px 3px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    border-radius:11px;
    color:#748099;
    text-decoration:none;
    font-size:8.5px;
    font-weight:650;
    line-height:1;
  }
  .mobile-bottom-link.active{
    background:linear-gradient(135deg,#eef0ff,#edf9ff);
    color:#5865df;
  }
  .mobile-bottom-link:last-child{
    color:#6a5fd8;
  }
  .mobile-bottom-link:last-child.active{
    background:linear-gradient(135deg,#f1efff,#eaf8ff);
  }
  .mobile-bottom-icon{
    width:20px!important;
    height:20px!important;
  }

  /* Subject cards: larger and vertically aligned, but still compact */
  .subjects-page-grid{
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  .subject-launch-card{
    min-height:72px!important;
    padding:9px 10px!important;
  }
  .subject-launch-card .subject-top{
    grid-template-columns:38px minmax(0,1fr)!important;
    gap:9px!important;
  }
  .subject-launch-card .subject-icon{
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    font-size:19px!important;
  }
  .subject-launch-card .subject-title{
    font-size:14px!important;
    font-weight:650!important;
  }
  .subject-launch-card .subject-meta{
    font-size:10.5px!important;
  }

  /* Drawer becomes a secondary navigation surface */
  .sidebar nav{
    margin-top:4px!important;
  }
  .sidebar .nav-link{
    min-height:48px!important;
    padding:11px 12px!important;
  }
  .student-game-link{
    display:none!important;
  }
}

@media(max-width:390px){
  .mobile-bottom-nav{
    left:6px;
    right:6px;
    bottom:6px;
    gap:2px;
    padding:5px;
  }
  .mobile-bottom-link{
    font-size:8px;
  }
  .topbar h1{
    max-width:46vw!important;
  }
}


/* ==========================================================
   V18.14.2 — Runtime/UI recovery guards
   ========================================================== */

/* Desktop content must always be visible. */
@media(min-width:821px){
  .main{display:block!important;visibility:visible!important;opacity:1!important}
  .topbar{display:flex!important;visibility:visible!important;opacity:1!important}
  .content{display:block!important;visibility:visible!important;opacity:1!important}
  .mobile-brand-shortcut,
  .mobile-bottom-nav,
  .menu-btn{display:none!important}
}

/* Mobile-only icons are always bounded. */
svg.mobile-home-icon,
svg.mobile-bottom-icon{
  width:20px!important;
  height:20px!important;
  min-width:20px!important;
  min-height:20px!important;
  max-width:20px!important;
  max-height:20px!important;
  flex:0 0 20px!important;
}

/* Mobile re-enable. */
@media(max-width:820px){
  .main,.topbar,.content{visibility:visible!important;opacity:1!important}
  .menu-btn,.mobile-brand-shortcut{display:grid!important}
  .mobile-bottom-nav{display:grid!important}
}


/* ==========================================================
   V18.14.3 — GRID / SIDEBAR BACKDROP ROOT CAUSE FIX
   Root cause:
   .sidebar-backdrop existed in the HTML as a direct child of .app-shell
   but had no desktop display:none rule in the restored stylesheet.
   CSS Grid therefore treated it as a real grid item and pushed <main>
   into the next grid row.
   ========================================================== */

/* Desktop/tablet: only sidebar + main participate in the 2-column grid */
.sidebar-backdrop{
  display:none!important;
}

.student-area .app-shell{
  display:grid!important;
  grid-template-columns:274px minmax(0,1fr)!important;
  grid-template-rows:minmax(100vh,auto)!important;
  align-items:stretch!important;
}

.student-area .sidebar{
  grid-column:1!important;
  grid-row:1!important;
}

.student-area .main{
  grid-column:2!important;
  grid-row:1!important;
  min-width:0!important;
  width:auto!important;
  display:block!important;
}

@media(max-width:1100px) and (min-width:821px){
  .student-area .app-shell{
    grid-template-columns:240px minmax(0,1fr)!important;
  }
}

/* Mobile: backdrop leaves grid flow and becomes an overlay */
@media(max-width:820px){
  .student-area .app-shell{
    display:block!important;
    min-height:100vh!important;
  }

  .student-area .main{
    width:100%!important;
    min-width:0!important;
  }

  .student-area .sidebar,
  .parent-area .sidebar{
    display:none!important;
  }

  .sidebar{
    z-index:100!important;
  }

  .sidebar-backdrop{
    display:block!important;
    position:fixed!important;
    inset:0!important;
    z-index:90!important;
    border:0!important;
    margin:0!important;
    padding:0!important;
    width:100vw!important;
    height:100dvh!important;
    background:rgba(14,25,53,.48)!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    backdrop-filter:none;
    transition:opacity .2s ease,visibility .2s ease;
  }

  body.menu-open .sidebar-backdrop{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
}


/* ==========================================================
   V18.14.4 — Schedule dual-render + weekend-home fix
   ========================================================== */

/* Desktop/tablet:
   schedule.php intentionally renders BOTH desktop and mobile markup.
   The mobile copy must never participate in desktop layout. */
.mobile-week-schedule{
  display:none!important;
}

@media(min-width:821px){
  .timetable-wrap{display:block!important}
  .schedule-legend{display:flex!important}
  .mobile-week-schedule{display:none!important}
}

/* Mobile:
   hide the wide table and show the dedicated day-card version. */
@media(max-width:820px){
  .timetable-wrap,
  .schedule-legend{
    display:none!important;
  }

  .mobile-week-schedule{
    display:grid!important;
    gap:9px!important;
    margin-top:4px!important;
  }

  .mobile-day-card{
    background:#fff;
    border:1px solid #e1e7f2;
    border-radius:14px;
    box-shadow:0 7px 20px rgba(50,64,118,.06);
    overflow:hidden;
  }

  .mobile-day-card.is-today{
    border-color:#cfd7ff;
    box-shadow:0 8px 22px rgba(83,98,220,.10);
  }

  .mobile-day-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:10px 11px;
    background:linear-gradient(100deg,#f4f6ff,#f5fbff);
    border-bottom:1px solid #e6eaf2;
  }

  .mobile-day-head strong{font-size:14px}

  .mobile-day-head span{
    font-size:8px;
    font-weight:800;
    text-transform:uppercase;
    color:#5b67dc;
    background:#eef1ff;
    padding:4px 7px;
    border-radius:999px;
  }

  .mobile-day-lessons{display:grid}

  .mobile-lesson-row{
    display:grid;
    grid-template-columns:72px minmax(0,1fr);
    align-items:stretch;
    border-bottom:1px solid #edf0f5;
  }

  .mobile-lesson-row:last-child{border-bottom:0}

  .mobile-period{
    padding:9px 8px;
    background:#fafbfe;
    border-right:1px solid #edf0f5;
    text-align:center;
  }

  .mobile-period strong,
  .mobile-period small{display:block}

  .mobile-period strong{
    font-size:12px;
    color:#5966dc;
  }

  .mobile-period small{
    font-size:8px;
    color:#8994a5;
    margin-top:2px;
  }

  .mobile-lesson-main{
    display:grid;
    grid-template-columns:30px minmax(0,1fr);
    gap:7px;
    align-items:center;
    padding:8px 10px;
    text-decoration:none;
    color:#1f2c45;
    position:relative;
  }

  a.mobile-lesson-main.subject-theme::before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:4px;
    background:linear-gradient(180deg,var(--subject-a),var(--subject-b));
  }

  a.mobile-lesson-main.subject-theme{
    background:linear-gradient(100deg,var(--subject-soft-a),#fff 64%,var(--subject-soft-b));
  }

  .mobile-lesson-main>span{
    width:30px;
    height:30px;
    border-radius:8px;
    display:grid;
    place-items:center;
    background:#f2f5fb;
    font-size:17px;
  }

  .mobile-lesson-main strong{
    font-size:11.5px;
    line-height:1.25;
  }

  .mobile-lesson-row.is-club .mobile-lesson-main{
    background:#fff9e8;
  }

  .mobile-day-empty{
    padding:12px;
    color:#8290a4;
    font-size:11px;
    text-align:center;
  }
}


/* ==========================================================
   V18.15 — English B1 external course
   ========================================================== */

.subject-key-english_b1{
  --subject-accent:#6d64df;
  --subject-a:#665fdc;
  --subject-b:#38aacb;
  --subject-soft-a:#f0efff;
  --subject-soft-b:#eaf9fd;
}

/* Slight distinction from ordinary school subjects, without making it look
   like a different application. */
.subject-launch-card.subject-kind-external{
  border-style:dashed!important;
  border-color:color-mix(in srgb,var(--subject-a) 28%,#dfe5ef)!important;
  background:
    linear-gradient(105deg,
      color-mix(in srgb,var(--subject-soft-a) 78%,#fff) 0%,
      #fff 42%,
      color-mix(in srgb,var(--subject-soft-b) 66%,#fff) 100%
    )!important;
}

.subject-title-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
  min-width:0;
}

.subject-external-badge{
  display:inline-flex;
  align-items:center;
  min-height:18px;
  padding:2px 6px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--subject-soft-a),var(--subject-soft-b));
  border:1px solid color-mix(in srgb,var(--subject-a) 20%,#dfe5ef);
  color:var(--subject-a);
  font-size:7.5px;
  line-height:1;
  font-weight:800;
  letter-spacing:.05em;
  white-space:nowrap;
}

/* Linked extracurricular lesson in the weekly schedule */
a.activity-chip,
a.schedule-weekend-chip{
  color:inherit;
  text-decoration:none;
}

.activity-chip-linked{
  cursor:pointer;
  border-color:#d8ddf5!important;
  background:linear-gradient(135deg,#f3f2ff,#effbff)!important;
}

.activity-chip-linked:hover{
  transform:translateY(-1px);
  box-shadow:0 7px 16px rgba(76,91,165,.10);
}

.external-subject-setting{
  border-left:4px solid #6d64df!important;
}

@media(max-width:820px){
  .subject-external-badge{
    font-size:7px;
    padding:2px 5px;
  }
}


/* ==========================================================
   V18.17 — Header alignment + Parent auto-sync navigation
   ========================================================== */

/* Page titles: left aligned in every StudyLab area, no mini StudyLab label. */
.topbar{
  justify-content:flex-start!important;
}

.topbar .mobile-top-actions{
  flex:0 0 auto!important;
}

.topbar-title{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex:0 1 auto!important;
  margin-right:auto!important;
  min-width:0!important;
  text-align:left!important;
}

.topbar-title h1{
  margin:0!important;
  text-align:left!important;
}

.topbar-brand-mini{
  display:none!important;
}

/* Parent Center: Sync/Audit is diagnostic, not a normal primary action. */
.parent-footer-tools{
  margin-top:18px;
}

.parent-footer-tools>div:first-child span{
  max-width:760px;
}

@media(min-width:821px){
  .topbar{
    padding-left:28px!important;
  }
}

@media(max-width:820px){
  .topbar-title{
    flex:1 1 auto!important;
  }
}


/* ==========================================================
   V18.18 — Parent/Admin schedule visual editor
   ========================================================== */

.schedule-editor-v1818{
  display:grid;
  gap:14px;
}

.schedule-admin-card{
  padding:0!important;
  overflow:hidden;
}

.schedule-admin-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:18px 20px 14px;
  border-bottom:1px solid #e8ecf3;
}

.schedule-admin-head h3{
  margin:2px 0 3px;
  font-size:20px;
}

.schedule-admin-head p{
  margin:0;
  color:#7c879b;
  font-size:12px;
}

.schedule-admin-timetable-wrap{
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}

.schedule-admin-timetable td{
  padding:5px!important;
  background:#fff!important;
}

.schedule-admin-choice{
  min-height:54px;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  padding:6px;
  border:1px solid #e2e7f0;
  border-left:3px solid #cbd4e3;
  border-radius:11px;
  background:#f8fafe;
  transition:.16s ease;
}

.schedule-admin-choice.subject-theme{
  border-color:color-mix(in srgb,var(--subject-a) 18%,#e1e6ef);
  border-left-color:var(--subject-a);
  background:linear-gradient(105deg,var(--subject-soft-a),#fff 62%,var(--subject-soft-b));
}

.schedule-admin-choice.is-custom-subject{
  border-left-color:#9aa8bc;
  background:linear-gradient(135deg,#f8fafc,#f1f5f9);
}

.schedule-admin-choice.is-club{
  border-left-color:#e3b451;
  background:linear-gradient(135deg,#fffaf0,#fff4d8);
}

.schedule-admin-choice select{
  width:100%;
  min-width:0;
  border:0!important;
  outline:0;
  background:transparent!important;
  padding:6px 24px 6px 7px!important;
  font-size:10.5px!important;
  font-weight:800;
  color:#24324b;
  box-shadow:none!important;
  cursor:pointer;
}

.schedule-admin-choice input[type=text]{
  width:100%;
  min-width:0;
  border:1px solid rgba(126,140,166,.22)!important;
  background:rgba(255,255,255,.76)!important;
  border-radius:8px!important;
  padding:6px 8px!important;
  font-size:9.5px!important;
}

.schedule-admin-choice input[hidden]{
  display:none!important;
}

.schedule-admin-savebar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  padding:12px 18px;
  border-top:1px solid #e8ecf3;
  background:#fafbfe;
}

.schedule-admin-savebar span{
  margin-right:auto;
  color:#7c879b;
  font-size:10.5px;
}

.schedule-admin-tools{
  padding:0!important;
  overflow:hidden;
}

.schedule-admin-tools summary{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 17px;
  cursor:pointer;
}

.schedule-admin-tools summary::-webkit-details-marker{
  display:none;
}

.schedule-admin-tools summary span{
  display:grid;
  gap:2px;
}

.schedule-admin-tools summary strong{
  font-size:13px;
}

.schedule-admin-tools summary small{
  color:#8792a5;
  font-size:10px;
}

.schedule-admin-tools summary b{
  width:27px;
  height:27px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#f1f4fa;
  color:#65738a;
  font-size:17px;
  transition:.15s ease;
}

.schedule-admin-tools[open] summary b{
  transform:rotate(45deg);
}

.schedule-admin-tools-body{
  padding:0 17px 16px;
  border-top:1px solid #edf0f5;
}

.schedule-admin-tools-body>p{
  margin:13px 0;
  color:#6f7d92;
  font-size:11.5px;
  line-height:1.55;
}

.schedule-admin-sample{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px;
  border:1px solid #e5e9f1;
  border-radius:12px;
  background:#fafbfe;
}

.schedule-admin-sample div{
  display:grid;
  gap:2px;
}

.schedule-admin-sample strong{
  font-size:11.5px;
}

.schedule-admin-sample small{
  color:#8893a5;
  font-size:9.5px;
}

.schedule-parent-activities{
  margin-top:18px;
}

/* Make parent editor visually follow the student's timetable proportions. */
.schedule-admin-timetable.school-timetable{
  min-width:980px;
}

.schedule-admin-timetable.school-timetable td{
  height:72px!important;
}

@media(max-width:820px){
  .schedule-admin-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .schedule-admin-head .btn{
    width:100%;
  }

  .schedule-admin-savebar{
    position:sticky;
    bottom:72px;
    z-index:8;
    flex-wrap:wrap;
  }

  .schedule-admin-savebar span{
    width:100%;
  }

  .schedule-admin-savebar .btn{
    width:100%;
  }

  .schedule-admin-sample{
    align-items:flex-start;
    flex-direction:column;
  }

  .schedule-admin-sample .ghost-btn{
    width:100%;
  }
}


/* ==========================================================
   V18.19 — English B1 spelling + targeted test form
   ========================================================== */

.b1-focus-section{
  border-color:#d8d4ff!important;
  background:
    linear-gradient(135deg,rgba(240,239,255,.82),rgba(255,255,255,.96) 45%,rgba(234,249,253,.72))!important;
}

.b1-focus-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.b1-focus-card{
  border:1px solid #e0e5ef;
  border-radius:14px;
  background:#fff;
  padding:14px;
  box-shadow:0 6px 18px rgba(53,68,120,.04);
}

.b1-focus-card.spelling-card{
  border-top:3px solid #6d64df;
}

.b1-focus-card.target-test-card{
  border-top:3px solid #38aacb;
}

.b1-focus-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.b1-focus-head>div{
  display:grid;
  gap:3px;
}

.b1-focus-head strong{
  font-size:13px;
  color:#22304a;
}

.b1-focus-head small{
  font-size:10px;
  color:#8994a5;
}

.mini-toggle{
  position:relative;
  flex:0 0 auto;
  cursor:pointer;
}

.mini-toggle input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.mini-toggle span{
  display:block;
  width:42px;
  height:24px;
  border-radius:999px;
  background:#dce3ee;
  position:relative;
  transition:.18s ease;
}

.mini-toggle span::after{
  content:"";
  position:absolute;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#fff;
  top:3px;
  left:3px;
  box-shadow:0 2px 5px rgba(0,0,0,.12);
  transition:.18s ease;
}

.mini-toggle input:checked + span{
  background:linear-gradient(135deg,#6d64df,#38aacb);
}

.mini-toggle input:checked + span::after{
  transform:translateX(18px);
}

.b1-conditional{
  margin-top:14px;
  padding-top:13px;
  border-top:1px solid #edf0f5;
  display:grid;
  gap:12px;
}

.b1-auto-note{
  min-height:42px;
  padding:9px 10px;
  border-radius:9px;
  background:#f7f8fc;
  border:1px solid #e7ebf2;
  color:#66758a;
  font-size:9.5px;
  line-height:1.45;
}

.b1-target-info{
  padding:10px 11px;
  border-radius:10px;
  background:linear-gradient(135deg,#f3f2ff,#effbff);
  border:1px solid #dfe3f6;
  color:#53627a;
  font-size:10px;
  line-height:1.45;
}

@media(max-width:820px){
  .b1-focus-grid{
    grid-template-columns:1fr;
  }
}


/* ==========================================================
   V18.20 — English B1 spelling-only form
   ========================================================== */

#lessonForm.b1-spelling-mode .standard-lesson-section{
  display:none!important;
}

#lessonForm.b1-spelling-mode #studycraftHint{
  display:none!important;
}

.b1-spelling-section{
  border-color:#d9d5ff!important;
  background:
    linear-gradient(135deg,#f5f3ff 0%,#fff 48%,#eefbff 100%)!important;
}

.b1-spelling-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}

.b1-spelling-summary>div{
  display:grid;
  gap:3px;
  padding:10px 11px;
  border:1px solid #e2e6f2;
  border-radius:11px;
  background:rgba(255,255,255,.82);
}

.b1-spelling-summary span{
  font-size:8px;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:#8a94a8;
}

.b1-spelling-summary strong{
  font-size:11px;
  color:#26334c;
}

.b1-range-grid .field input{
  font-size:18px!important;
  font-weight:800;
  letter-spacing:.02em;
  text-align:center;
  min-height:50px;
}

.b1-range-info{
  margin-top:12px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #dcdff3;
  background:linear-gradient(135deg,#f3f2ff,#effbff);
  color:#56647d;
  font-size:11px;
  font-weight:700;
}

.b1-spelling-note{
  display:grid;
  gap:3px;
  margin-top:14px;
  padding:11px 12px;
  border-radius:10px;
  background:#fbfcfe;
  border:1px solid #e8ebf2;
}

.b1-spelling-note strong{
  font-size:10.5px;
  color:#42516b;
}

.b1-spelling-note span{
  font-size:9.5px;
  color:#8792a5;
}

#lessonForm.b1-spelling-mode .modern-form-actions{
  margin-top:14px;
}

@media(max-width:820px){
  .b1-spelling-summary{
    grid-template-columns:1fr;
  }

  .b1-range-grid{
    grid-template-columns:1fr 1fr!important;
  }
}

/* V18.22 Simple English B1 weekend reminder */
.home-b1-simple-reminder{padding:15px 16px!important;border-color:#d8d5ff!important;background:linear-gradient(115deg,#f3f1ff 0%,#fff 52%,#eefbff 100%)!important;box-shadow:0 10px 24px rgba(85,77,181,.07)!important}
.home-b1-simple-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.home-b1-simple-count{flex:0 0 auto;padding:5px 8px;border-radius:999px;background:#fff;border:1px solid #dcdff3;color:#665fdc;font-size:9px;font-weight:800}
.home-b1-simple-reminder>p{margin:10px 0 12px;color:#617087;font-size:11px;line-height:1.5}
.home-b1-simple-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
.home-b1-simple-actions small{color:#8792a5;font-size:9.5px}
@media(max-width:820px){.home-b1-simple-head,.home-b1-simple-actions{align-items:stretch;flex-direction:column}.home-b1-simple-count{align-self:flex-start}.home-b1-simple-actions .btn{width:100%}}


/* V18.23 — Parent history record/exam management */
.danger-link{color:#a84b50!important;border-color:#f0cfd2!important;background:#fff7f8!important}
.exam-management-panel{margin-top:12px;padding-top:12px;border-top:1px solid #e7ebf2;display:grid;gap:10px}
.exam-management-date{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.exam-management-date label{font-size:11px;font-weight:800;color:#64718a}
.exam-management-date input{width:auto;min-width:170px;padding:8px 10px}
.exam-management-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:820px){
  .exam-management-date{align-items:stretch;flex-direction:column}
  .exam-management-date input{width:100%}
  .exam-management-actions{display:grid;grid-template-columns:1fr 1fr}
  .exam-management-actions .ghost-btn{width:100%}
}


/* V18.24 — Parent History filters + date picker affordance */
.history-filter-card{
  margin:0 0 20px;
  padding:16px;
  border-color:#e1e6f2;
  background:linear-gradient(135deg,#fbfcff,#f7f9ff);
}
.history-filter-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:13px;
}
.history-filter-head>div{display:grid;gap:2px}
.history-filter-head strong{font-size:14px;color:#22304a}
.history-filter-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:10px;
}
.history-filter-grid .field{margin:0}
.history-filter-grid label{font-size:9px}
.history-filter-grid input,
.history-filter-grid select{
  width:100%;
  min-height:40px;
  border:1px solid #d7dfed;
  border-radius:12px;
  background:#fff;
  color:var(--ink);
  padding:12px 13px;
  font:inherit;
  outline:none;
  transition:.15s border-color,.15s box-shadow;
}
.history-filter-grid input:focus,
.history-filter-grid select:focus{
  border-color:#7e89f5;
  box-shadow:0 0 0 3px rgba(100,106,235,.11);
}
.history-filter-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:10px;
}
.history-no-results{margin:0 0 18px}
.history-section-block{margin:0}
#exam_date{cursor:pointer}
@media(max-width:1100px){
  .history-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:820px){
  .history-filter-card{padding:13px}
  .history-filter-head{align-items:stretch;flex-direction:column;gap:5px}
  .history-filter-grid{grid-template-columns:1fr 1fr}
  .history-search-field{grid-column:1/-1}
  .history-filter-actions .ghost-btn{width:100%}
}
@media(max-width:520px){
  .history-filter-grid{grid-template-columns:1fr}
  .history-search-field{grid-column:auto}
}


/* V18.26 — Historical records integrated in lesson history */
.history-date-estimate{font-weight:400;color:inherit}


/* V18.27 — next-school-day preparation at first glance */
.home-v182-tomorrow-prep{
  padding:18px;
  min-width:0;
  align-self:stretch;
}
.home-v182-tomorrow-prep-list{
  display:grid;
  gap:8px;
}
.home-v182-prep-item{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  gap:9px;
  align-items:start;
  padding:9px 10px;
  min-height:44px;
  border:1px solid #e5eaf2;
  border-radius:11px;
  background:#fbfcff;
  color:inherit;
  text-decoration:none;
}
.home-v182-prep-item:hover{
  border-color:#98a3ee;
  box-shadow:0 5px 14px rgba(69,82,153,.07);
}
.home-v182-prep-icon{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#f1f4ff;
}
.home-v182-prep-item strong,
.home-v182-prep-item small{
  display:block;
}
.home-v182-prep-item strong{
  font-size:11.5px;
  color:#22304a;
}
.home-v182-prep-item small{
  margin-top:2px;
  color:#66738a;
  font-size:10px;
  line-height:1.35;
}
.home-v182-prep-item.is-historical{
  background:#fbfaf7;
  border-color:#ece5d5;
}
.home-v182-prep-item.is-historical small{
  color:#786f60;
}
.home-v182-middle-left{
  grid-template-columns:1fr!important;
}
@media(max-width:1100px){
  .home-v182-tomorrow-prep{margin-top:0}
}


/* V18.28 — compact next-day schedule, wider preparation panel */
.home-v182-top-grid{
  grid-template-columns:minmax(0,1.25fr) minmax(390px,.95fr)!important;
  gap:14px!important;
}
.home-v182-next-card{
  padding:14px 15px!important;
}
.home-v182-next-card .home-v182-section-head{
  margin-bottom:10px!important;
}
.home-v182-next-card .home-v182-next-list{
  gap:6px!important;
}
.home-v182-next-card .home-v182-next-item{
  grid-template-columns:34px 80px minmax(0,1fr) auto!important;
  min-height:38px!important;
  padding:7px 9px!important;
  gap:7px!important;
  border-radius:10px!important;
}
.home-v182-next-card .home-v182-next-item .period{
  width:30px!important;
  height:30px!important;
  border-radius:8px!important;
  font-size:11px!important;
}
.home-v182-next-card .home-v182-next-item .time{
  font-size:9.5px!important;
}
.home-v182-next-card .home-v182-next-item strong{
  font-size:11px!important;
}
.home-v182-tomorrow-prep{
  padding:15px!important;
}
.home-v182-tomorrow-prep .home-v182-section-head{
  margin-bottom:10px!important;
}
.home-v182-tomorrow-prep-list{
  gap:7px!important;
}
.home-v182-prep-item{
  padding:8px 9px!important;
}
.home-v182-prep-item small{
  font-size:10.2px!important;
  line-height:1.38!important;
}
@media(max-width:1100px){
  .home-v182-top-grid{
    grid-template-columns:1fr!important;
  }
}
@media(max-width:760px){
  .home-v182-next-card{
    padding:13px!important;
  }
  .home-v182-next-card .home-v182-next-item{
    grid-template-columns:31px 72px minmax(0,1fr)!important;
  }
}


/* V18.29 — unified next-day schedule + preparation rows */
.home-v182-next-combined{
  padding:15px 16px!important;
}
.home-v182-next-combined .home-v182-section-head{
  margin-bottom:10px!important;
}
.home-v182-combined-head{
  display:grid;
  grid-template-columns:minmax(360px,.95fr) minmax(0,1.25fr);
  gap:14px;
  padding:0 10px 6px;
  color:#8792a6;
  font-size:9px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.home-v182-combined-list{
  display:grid;
  gap:6px;
}
.home-v182-combined-row{
  display:grid;
  grid-template-columns:minmax(360px,.95fr) minmax(0,1.25fr);
  gap:14px;
  align-items:stretch;
  min-height:46px;
  padding:0;
  border:1px solid #e4e9f4;
  border-radius:11px;
  background:linear-gradient(180deg,#fff,#fafbff);
  color:inherit;
  text-decoration:none;
  overflow:hidden;
  transition:.15s border-color,.15s box-shadow,.15s transform;
}
a.home-v182-combined-row:hover{
  border-color:#98a3ee;
  box-shadow:0 6px 16px rgba(65,77,150,.08);
  transform:translateY(-1px);
}
a.home-v182-combined-row:focus-visible{
  outline:2px solid #6774e8;
  outline-offset:2px;
}
.home-v182-combined-subject{
  display:grid;
  grid-template-columns:34px 82px minmax(0,1fr) auto;
  gap:7px;
  align-items:center;
  padding:7px 9px;
  min-width:0;
}
.home-v182-combined-subject .period{
  width:30px;
  height:30px;
  border-radius:8px;
  display:grid;
  place-items:center;
  background:#eef1ff;
  color:#5f64e8;
  font-weight:900;
  font-size:11px;
}
.home-v182-combined-subject .time{
  color:#7e899c;
  font-size:9.5px;
  font-variant-numeric:tabular-nums;
}
.home-v182-combined-subject strong{
  min-width:0;
  color:#1d2940;
  font-size:11px;
}
.home-v182-combined-subject em{
  font-style:normal;
  font-size:8px;
  font-weight:900;
  color:#a6781c;
  background:#fff1c9;
  padding:3px 6px;
  border-radius:999px;
}
.home-v182-combined-prep{
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  gap:7px;
  align-items:center;
  min-width:0;
  padding:7px 10px;
  border-left:1px solid #e7ebf2;
  background:#fbfcff;
}
.home-v182-combined-prep-icon{
  width:27px;
  height:27px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#f1f4ff;
  font-size:14px;
}
.home-v182-combined-prep-text{
  min-width:0;
  color:#65728a;
  font-size:10px;
  line-height:1.35;
}
.home-v182-combined-row.is-historical .home-v182-combined-prep{
  background:#fbfaf7;
}
.home-v182-combined-row.is-historical .home-v182-combined-prep-text{
  color:#786f60;
}
.home-v182-combined-row.is-club{
  background:#fffbf2;
  border-color:#f2dfb3;
}
.home-v182-combined-row.is-custom{
  background:#f8fafc;
}
.home-v182-combined-row.is-club .home-v182-combined-prep,
.home-v182-combined-row.is-custom .home-v182-combined-prep{
  background:transparent;
}
@media(max-width:980px){
  .home-v182-combined-head{display:none}
  .home-v182-combined-row{
    grid-template-columns:1fr;
    gap:0;
  }
  .home-v182-combined-prep{
    border-left:0;
    border-top:1px solid #e7ebf2;
  }
}
@media(max-width:520px){
  .home-v182-next-combined{padding:13px!important}
  .home-v182-combined-subject{
    grid-template-columns:31px 70px minmax(0,1fr);
  }
  .home-v182-combined-subject em{display:none}
  .home-v182-combined-prep{
    grid-template-columns:26px minmax(0,1fr);
    padding:7px 8px;
  }
}


/* V18.30 — roomier next-day rows + actionable home priorities + historical subject data */
.home-v182-combined-row{
  min-height:54px!important;
}
.home-v182-combined-subject{
  padding:9px 11px!important;
}
.home-v182-combined-prep{
  padding:9px 12px!important;
}
.home-v182-combined-subject .period{
  width:32px!important;
  height:32px!important;
}
.home-v182-combined-prep-icon{
  width:30px!important;
  height:30px!important;
}
.home-v182-combined-prep-text{
  font-size:10.4px!important;
  line-height:1.42!important;
}

.home-priority-card{
  margin-top:16px;
  padding:17px 18px;
}
.home-priority-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.home-priority-item{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  gap:9px;
  align-items:start;
  padding:10px 11px;
  border:1px solid #e4e9f2;
  border-radius:11px;
  background:#fbfcff;
  color:inherit;
  text-decoration:none;
}
.home-priority-item:hover{
  border-color:#98a3ee;
  box-shadow:0 5px 14px rgba(69,82,153,.07);
}
.home-priority-icon{
  width:32px;height:32px;
  display:grid;place-items:center;
  border-radius:9px;
  background:#f1f4ff;
}
.home-priority-item strong,.home-priority-item small{display:block}
.home-priority-item strong{font-size:11.5px;color:#22304a}
.home-priority-item small{margin-top:2px;font-size:10px;line-height:1.4;color:#68758b}
.home-priority-item.is-test{border-left:3px solid #e26882}
.home-priority-item.is-homework{border-left:3px solid #6374ee}
.home-priority-item.is-review{border-left:3px solid #45b597}
.home-priority-item.is-spelling{border-left:3px solid #a77ad9}
.home-priority-weekend{
  margin-top:12px;
  padding:12px;
  border-top:1px solid #e7ebf2;
}
.home-priority-weekend>strong,.home-priority-weekend>small{display:block}
.home-priority-weekend-list{
  display:flex;gap:8px;flex-wrap:wrap;margin-top:8px
}
.home-priority-weekend-list a{
  padding:8px 10px;border-radius:10px;background:#f8fafc;
  color:#27344e;text-decoration:none;font-size:11px;font-weight:800
}
.home-priority-weekend-list small{display:block;margin-top:2px;color:#778399;font-size:9.5px;font-weight:500}

.subject-v187-latest.is-historical{
  border-color:#e9dfc8!important;
  background:linear-gradient(180deg,#fff,#fffcf6)!important;
}
.subject-historical-estimate{
  margin-left:6px;
  font-size:9px;
  font-weight:500;
  color:#8b806c;
}
.subject-historical-card{
  margin-top:16px;
  padding:18px;
}
.subject-historical-list{display:grid;gap:12px}
.subject-historical-record{
  padding:14px;
  border:1px solid #e7e1d4;
  border-radius:13px;
  background:#fffdf8;
}
.subject-historical-record-head{
  display:flex;justify-content:space-between;gap:12px;align-items:flex-start
}
.subject-historical-record-head strong,
.subject-historical-record-head small{display:block}
.subject-historical-record-head strong{font-size:12px;color:#27344e}
.subject-historical-record-head small{margin-top:2px;font-size:9px;color:#8d826e}
.subject-historical-record-head>span{
  padding:4px 7px;border-radius:999px;background:#f3efe6;color:#7e735f;font-size:9px;font-weight:800
}
.subject-historical-record h4{
  margin:10px 0 12px;font-size:13px;line-height:1.45;color:#24314a
}
.subject-historical-record>div:not(.subject-historical-record-head){margin-top:10px}
.subject-historical-record>div>small{display:block;font-size:9px;font-weight:850;color:#8792a5;margin-bottom:3px}
.subject-historical-record p{margin:0;font-size:11px;line-height:1.5;color:#5f6c82}
.subject-historical-knowledge{display:flex;flex-wrap:wrap;gap:6px}
.subject-historical-knowledge span{
  padding:5px 8px;border-radius:999px;background:#f4f6fb;border:1px solid #e4e8f0;
  font-size:9.5px;color:#536078
}
.subject-v187-score.muted{background:#f2efe8!important;color:#7b725f!important}

@media(max-width:820px){
  .home-priority-grid{grid-template-columns:1fr}
  .subject-historical-card{padding:14px}
}


/* V18.31 — rebalance next-day columns and restore readable typography */
.home-v182-combined-head,
.home-v182-combined-row{
  grid-template-columns:minmax(300px,.72fr) minmax(0,1.38fr)!important;
  gap:10px!important;
}
.home-v182-combined-head{
  font-size:10px!important;
  padding-left:10px!important;
  padding-right:10px!important;
}
.home-v182-combined-subject{
  grid-template-columns:36px 86px minmax(0,1fr) auto!important;
  gap:8px!important;
  padding:10px 11px!important;
}
.home-v182-combined-subject .period{
  width:34px!important;
  height:34px!important;
  font-size:12px!important;
}
.home-v182-combined-subject .time{
  font-size:10.5px!important;
}
.home-v182-combined-subject strong{
  font-size:12.5px!important;
  line-height:1.25!important;
}
.home-v182-combined-prep{
  grid-template-columns:32px minmax(0,1fr)!important;
  gap:9px!important;
  padding:10px 12px!important;
}
.home-v182-combined-prep-icon{
  width:31px!important;
  height:31px!important;
  font-size:15px!important;
}
.home-v182-combined-prep-text{
  font-size:11.3px!important;
  line-height:1.42!important;
}
.home-v182-combined-row{
  min-height:58px!important;
}
@media(max-width:980px){
  .home-v182-combined-row{
    grid-template-columns:1fr!important;
    gap:0!important;
  }
}
@media(max-width:520px){
  .home-v182-combined-subject{
    grid-template-columns:32px 74px minmax(0,1fr)!important;
  }
  .home-v182-combined-subject strong{
    font-size:12px!important;
  }
  .home-v182-combined-prep-text{
    font-size:11px!important;
  }
}


/* V18.32 — larger home typography + cleaner lower dashboard */
.home-v182-next-combined .home-v182-title-wrap h3{
  font-size:19px!important;
}
.home-v182-next-combined .eyebrow,
.home-priority-card .eyebrow{
  font-size:10.5px!important;
}
.home-v182-combined-head{
  font-size:10.8px!important;
}
.home-v182-combined-subject .period{
  font-size:13px!important;
}
.home-v182-combined-subject .time{
  font-size:11.2px!important;
}
.home-v182-combined-subject strong{
  font-size:13.5px!important;
  line-height:1.3!important;
}
.home-v182-combined-prep-text{
  font-size:12.2px!important;
  line-height:1.45!important;
}
.home-priority-card .home-v182-title-wrap h3{
  font-size:18px!important;
}
.home-priority-item strong{
  font-size:12.8px!important;
  line-height:1.3!important;
}
.home-priority-item small{
  font-size:11.2px!important;
  line-height:1.45!important;
}
.home-priority-weekend>strong{
  font-size:13px!important;
}
.home-priority-weekend>small,
.home-priority-weekend-list small{
  font-size:10.5px!important;
}
.home-priority-weekend-list a{
  font-size:11.8px!important;
}
@media(max-width:520px){
  .home-v182-combined-subject strong{font-size:12.8px!important}
  .home-v182-combined-prep-text{font-size:11.5px!important}
  .home-priority-item strong{font-size:12.3px!important}
  .home-priority-item small{font-size:10.8px!important}
}


/* V18.33 — complete subject/history visibility without duplicate records */
.subject-history-archive-card{
  margin-top:16px;
  padding:17px 18px;
}
.subject-history-archive-list{display:grid;gap:8px}
.subject-history-archive{
  border:1px solid #e5e9f1;
  border-radius:11px;
  background:#fbfcff;
  overflow:hidden;
}
.subject-history-archive>summary{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:11px 12px;
  cursor:pointer;
}
.subject-history-archive>summary::-webkit-details-marker{display:none}
.subject-history-archive>summary span{min-width:0}
.subject-history-archive>summary strong,
.subject-history-archive>summary small{display:block}
.subject-history-archive>summary strong{font-size:12.5px;line-height:1.35;color:#24314a}
.subject-history-archive>summary small{margin-top:3px;font-size:10px;color:#7b879b}
.subject-history-archive>summary b{font-size:10px;color:#5f6ee8;white-space:nowrap}
.subject-history-archive-body{
  display:grid;
  gap:10px;
  padding:0 12px 12px;
  border-top:1px solid #e8ecf3;
}
.subject-history-archive-body>div{padding-top:10px}
.subject-history-archive-body small{display:block;font-size:9.5px;font-weight:850;color:#8792a5;margin-bottom:4px}
.subject-history-archive-body p{margin:0;font-size:11.2px;line-height:1.5;color:#59677e}
.subject-history-archive-tags{display:flex;flex-wrap:wrap;gap:6px}
.subject-history-archive-tags span{
  padding:5px 8px;border-radius:999px;background:#f2f5fb;border:1px solid #e3e8f1;
  font-size:9.8px;color:#526079
}

.history-row-details{margin-top:7px}
.history-row-details>summary{
  cursor:pointer;
  color:#5566df;
  font-size:10.5px;
  font-weight:800;
  list-style:none;
}
.history-row-details>summary::-webkit-details-marker{display:none}
.history-row-detail-body{
  display:grid;
  gap:7px;
  margin-top:8px;
  padding:9px 10px;
  border:1px solid #e3e8f1;
  border-radius:10px;
  background:#f8faff;
  min-width:280px;
}
.history-row-detail-body>div{display:grid;gap:2px}
.history-row-detail-body b{font-size:9.5px;color:#4e5d75}
.history-row-detail-body span{font-size:10.5px;line-height:1.45;color:#66748a}
@media(max-width:760px){
  .subject-history-archive-card{padding:14px}
  .subject-history-archive>summary{align-items:flex-start}
  .history-row-detail-body{min-width:0}
}


/* V18.34 — Study Request actions */
.subject-v187-actions{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.subject-study-form{margin:0;min-width:0}
.subject-study-form .subject-action{width:100%;height:100%;text-align:left;font:inherit;cursor:pointer}
.subject-action.study{background:linear-gradient(180deg,#f4f0ff,#fff)!important;border-color:#ded4fb!important;color:#1b2943}
.subject-action.study:hover{border-color:#b9a9f1!important}
.subject-test-footer-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.subject-test-footer-actions form{margin:0}
.subject-test-study-btn{appearance:none;border:1px solid #d9d2f5;border-radius:9px;background:#f5f1ff;color:#5d52c7;padding:7px 9px;font:inherit;font-size:10px;font-weight:850;cursor:pointer}
.subject-test-study-btn:hover{background:#eee8ff}
@media(max-width:1050px){.subject-v187-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:700px){.subject-v187-actions{grid-template-columns:1fr!important}.subject-test-footer-actions{justify-content:flex-start}}


/* V18.35 — Study launcher */
.study-launcher-card{
  width:100%;
  max-width:none;
  margin:18px 0;
  box-sizing:border-box;
  padding:26px;
  display:grid;
  grid-template-columns:58px minmax(0,1fr);
  gap:18px;
  border-top:4px solid #7065f4;
}
.study-launcher-icon{
  width:58px;height:58px;border-radius:17px;
  display:grid;place-items:center;
  font-size:29px;
  background:linear-gradient(145deg,#f0efff,#eafaff);
  box-shadow:inset 0 0 0 1px #dddaf6;
}
.study-launcher-copy h2{margin:4px 0 6px;font-size:25px}
.study-launcher-lead{margin:0;color:#5f6d85}
.study-launcher-focus{
  margin-top:18px;padding:14px 16px;border-radius:14px;
  background:#f7f8ff;border:1px solid #e4e6f6;
}
.study-launcher-focus small{font-weight:850;color:#676fcf}
.study-launcher-focus ul{margin:8px 0 0;padding-left:20px}
.study-launcher-focus li{margin:5px 0;line-height:1.4}
.study-launcher-steps{
  margin-top:18px;padding:15px 16px;border-left:4px solid #35bad7;
  border-radius:12px;background:#f4fcff;
}
.study-launcher-steps p{margin:7px 0 0;line-height:1.5}
.study-launcher-main-btn{
  margin-top:18px;
  min-height:52px;
  font-size:14px;
  font-weight:850;
  width:100%;
}
.study-launcher-main-btn:disabled{opacity:.65;cursor:wait}
.study-launcher-status{min-height:22px;margin-top:8px;font-size:12px;font-weight:800;color:#53617a}
.study-launcher-fallback{margin-top:10px;padding:12px;border:1px dashed #d5d9e7;border-radius:12px;background:#fafbff}
.study-launcher-fallback label{display:block;margin-bottom:7px;font-size:11px;color:#6f7d96}
.study-launcher-fallback-row{display:flex;gap:8px}
.study-launcher-fallback-row input{flex:1;min-width:0;font-weight:800}
.study-launcher-secondary{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.study-launcher-request-id{display:block;margin-top:14px;color:#8b95a8}
@media(max-width:700px){
  .study-launcher-card{grid-template-columns:1fr;padding:18px}
  .study-launcher-icon{width:50px;height:50px;font-size:25px}
  .study-launcher-copy h2{font-size:22px}
  .study-launcher-fallback-row{flex-direction:column}
  .study-launcher-secondary{flex-direction:column}
  .study-launcher-secondary .ghost-btn{text-align:center}
}


/* V18.36 — Study scope vs homework */
.study-launcher-scope-item{margin-top:10px}
.study-launcher-scope-item:first-of-type{margin-top:8px}
.study-launcher-scope-item b{display:block;color:#26334d;font-size:12px}
.study-launcher-scope-item p{margin:5px 0 0;line-height:1.45}
.study-launcher-scope-item ul{margin:6px 0 0;padding-left:20px}
.study-launcher-homework{
  margin-top:10px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid #f0dfb7;
  background:#fffaf0;
}
.study-launcher-homework small{font-weight:850;color:#a17424}
.study-launcher-homework p{margin:6px 0 0;line-height:1.4;color:#44361f}


/* V18.37 — Structured study request trigger */
.study-launcher-fallback-row textarea{
  flex:1;
  min-width:0;
  resize:none;
  font-weight:750;
  line-height:1.4;
}


/* V18.38 — Compact study action + lesson description */
.subject-action.study strong{
  white-space:nowrap;
  font-size:11.5px;
}
.study-launcher-description{
  margin:7px 0 0;
  color:#34425f;
  font-size:12.5px;
  line-height:1.45;
}
@media(max-width:700px){
  .subject-action.study strong{white-space:normal}
}


/* V18.39 — Contextual exam lifecycle on subject page */
.subject-v187-grid{
  grid-template-columns:1fr!important;
}
.subject-exam-alert{
  margin-top:14px;
  padding:16px 18px;
  border-left:5px solid #f17783;
  background:linear-gradient(135deg,#fff8fa,#fffdfd);
}
.subject-exam-alert-head,
.subject-exam-alert-footer{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.subject-exam-alert-head h3{margin:3px 0 0;font-size:18px}
.subject-exam-alert-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin-top:12px;
}
.subject-exam-alert-grid>div{
  padding:10px 12px;
  border-radius:11px;
  border:1px solid #f1e2e6;
  background:rgba(255,255,255,.82);
}
.subject-exam-alert-grid small{display:block;color:#a06b78;font-size:9px;font-weight:850}
.subject-exam-alert-grid p{margin:4px 0 0;line-height:1.4;font-size:11.5px}
.subject-exam-alert-footer{
  align-items:center;
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid #f2e2e6;
  font-size:10px;
  font-weight:800;
}
.subject-completed-exam-note{
  margin-top:14px;
  padding:13px 16px;
  background:#fafbfe;
  border:1px solid #e1e6ef;
}
.subject-completed-exam-main{
  display:flex;
  gap:11px;
  align-items:flex-start;
}
.subject-completed-exam-icon{
  width:34px;height:34px;border-radius:10px;
  display:grid;place-items:center;
  background:#f1f3f8;
}
.subject-completed-exam-main strong{display:block;margin-top:2px;font-size:12.5px}
.subject-completed-exam-main p{margin:4px 0 0;font-size:11.5px;color:#58657a}
.subject-completed-exam-main small{display:block;margin-top:4px;color:#778397}
@media(max-width:800px){
  .subject-exam-alert-grid{grid-template-columns:1fr}
}
@media(max-width:700px){
  .subject-exam-alert-head,.subject-exam-alert-footer{flex-direction:column;align-items:flex-start}
}


/* V18.40 — Automatic Tutor → Quiz flow */
.study-launcher-flow-note{
  margin-top:10px;
  padding:9px 12px;
  border-radius:10px;
  background:#f2f7ff;
  border:1px solid #dbe7fb;
  color:#41516e;
  font-size:11.5px;
  line-height:1.35;
}


/* V18.41 — Symmetric subject actions + inline chat */
.subject-chat-inline{
  display:inline-flex;
  align-items:center;
  gap:4px;
  color:#5966dc;
  font-weight:800;
  text-decoration:none;
  white-space:nowrap;
}
.subject-chat-inline:hover{text-decoration:underline}
.subject-action.study-test{
  background:linear-gradient(180deg,#fff7ed,#fff)!important;
  border-color:#f2dcc4!important;
  color:#1b2943;
}
.subject-action.study-test:hover{border-color:#e7c59d!important}
.subject-action.disabled{cursor:default}
.subject-action.disabled:hover{transform:none;box-shadow:none}
@media(max-width:700px){
  .subject-v187-meta{gap:6px 10px}
}


/* V18.42 — Adaptive Test readiness */
.study-launcher-readiness{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin-top:10px;
}
.study-launcher-readiness>div{
  padding:10px 12px;
  border-radius:11px;
  border:1px solid #dfe7f4;
  background:#f8fbff;
}
.study-launcher-readiness small,
.study-launcher-readiness strong{display:block}
.study-launcher-readiness small{
  font-size:9px;
  color:#78859a;
  font-weight:800;
}
.study-launcher-readiness strong{
  margin-top:3px;
  font-size:11.5px;
  line-height:1.35;
  color:#26334d;
}
@media(max-width:800px){
  .study-launcher-readiness{grid-template-columns:1fr}
}


/* V18.43 — Deferred Quiz 2 mastery checks */
.subject-pending-quiz2{
  margin-top:14px;
  padding:16px 18px;
  border-color:#d9dcff;
  background:linear-gradient(180deg,#fafaff,#fff);
}
.subject-pending-quiz2-head h3{margin:3px 0 4px;font-size:18px}
.subject-pending-quiz2-head p{margin:0;color:#667085;font-size:13px}
.subject-pending-quiz2-list{display:grid;gap:9px;margin-top:12px}
.subject-pending-quiz2-item{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:11px 12px;border:1px solid #e1e5f4;border-radius:12px;background:#fff;
}
.subject-pending-quiz2-copy{display:grid;gap:2px}
.subject-pending-quiz2-copy strong{font-size:14px;color:#1d2942}
.subject-pending-quiz2-copy span{font-size:12px;color:#667085}
.subject-pending-quiz2-copy small{font-size:11px;color:#7b8497}
.subject-pending-quiz2-btn{white-space:nowrap}
@media(max-width:700px){
  .subject-pending-quiz2-item{align-items:stretch;flex-direction:column}
  .subject-pending-quiz2-item form,.subject-pending-quiz2-btn{width:100%}
}


/* V18.44 — Quiz progress, visible XP and Mastery Chain */
.subject-quiz-progress{
  margin-top:14px;
  padding:16px 18px;
  border-color:#d9dcff;
  background:linear-gradient(180deg,#fafaff,#fff);
}
.subject-quiz-progress-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.subject-quiz-progress-head h3{margin:3px 0 4px;font-size:18px}
.subject-quiz-progress-head p{margin:0;color:#667085;font-size:12px}
.subject-mastery-chain{
  min-width:230px;
  padding:10px 12px;
  border:1px solid #f1d6a0;
  border-radius:12px;
  background:linear-gradient(135deg,#fffaf0,#fff);
}
.subject-mastery-chain-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:#694b16;
  font-size:11px;
  font-weight:900;
}
.subject-mastery-chain-title strong{font-size:16px}
.subject-mastery-dots{display:flex;gap:6px;margin:7px 0}
.subject-mastery-dots i{
  display:block;
  width:100%;
  height:7px;
  border-radius:999px;
  background:#eceff5;
}
.subject-mastery-dots i.filled{background:linear-gradient(90deg,#f0a42b,#f6c454)}
.subject-mastery-chain small{display:block;color:#7a6b50;font-size:9.5px}
.subject-quiz-progress-list{display:grid;gap:8px;margin-top:13px}
.subject-quiz-progress-row{
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(260px,1.4fr) auto;
  align-items:center;
  gap:10px;
  padding:10px 11px;
  border:1px solid #e5e8f4;
  border-radius:11px;
  background:#fff;
}
.subject-quiz-progress-meta strong,
.subject-quiz-progress-meta small{display:block}
.subject-quiz-progress-meta strong{font-size:11.5px;color:#26334d}
.subject-quiz-progress-meta small{
  margin-top:2px;
  color:#7c8799;
  font-size:9.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.subject-quiz-chip-wrap{display:flex;flex-wrap:wrap;gap:5px}
.subject-quiz-chip{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:5px 8px;
  border-radius:999px;
  font-size:9.5px;
  font-weight:800;
  white-space:nowrap;
}
.subject-quiz-chip.done{background:#edf8f2;color:#22785a}
.subject-quiz-chip.pending{background:#fff7e9;color:#9a6418}
.subject-quiz-chip.chain{background:#fff2d6;color:#895718}
.subject-quiz-chip b{font-weight:950}
.subject-mastered-set{
  justify-self:end;
  color:#2a8f68;
  font-size:9.5px;
  font-weight:900;
  white-space:nowrap;
}
.subject-history-rewards{display:flex;align-items:center;gap:5px;justify-content:flex-end}
.subject-xp-badge{
  display:inline-flex;
  align-items:center;
  padding:4px 7px;
  border-radius:999px;
  background:#fff4cf;
  color:#85600b;
  border:1px solid #f0d98a;
  font-size:8.5px;
  font-weight:950;
  white-space:nowrap;
}
@media(max-width:850px){
  .subject-quiz-progress-head{flex-direction:column}
  .subject-mastery-chain{width:100%;min-width:0}
  .subject-quiz-progress-row{grid-template-columns:1fr}
  .subject-quiz-resume-form,.subject-pending-quiz2-btn{width:100%}
  .subject-mastered-set{justify-self:start}
}
@media(max-width:720px){
  .subject-quiz-progress{padding:13px}
  .subject-history-rewards{grid-column:2;justify-content:flex-start}
}


/* V18.45 — Mastery Chain shown as 4 Quiz steps / 2 sets */
.subject-mastery-chain-title strong{
  display:flex;
  align-items:baseline;
  gap:3px;
}
.subject-mastery-chain-title strong em{
  font-style:normal;
  font-size:8px;
  font-weight:850;
  opacity:.72;
  text-transform:uppercase;
}
.subject-mastery-set-groups{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:8px 0 7px;
}
.subject-mastery-set-group{
  min-width:0;
}
.subject-mastery-set-group>small{
  display:block;
  margin:0 0 3px;
  color:#9a7b43;
  font-size:7.5px;
  font-weight:950;
  letter-spacing:.06em;
  text-align:center;
}
.subject-mastery-set-steps{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
}
.subject-mastery-set-steps span{
  display:flex;
  align-items:center;
  justify-content:center;
  height:19px;
  border-radius:6px;
  background:#eceff5;
  color:#9299a8;
  border:1px solid #e1e4eb;
  font-size:8px;
  font-weight:950;
  transition:background .2s ease,border-color .2s ease,color .2s ease;
}
.subject-mastery-set-steps span.filled{
  background:linear-gradient(135deg,#f6b43a,#f7cd69);
  border-color:#ecb84f;
  color:#63420c;
  box-shadow:0 2px 5px rgba(194,132,24,.12);
}
.subject-mastery-rule{
  margin-top:1px;
  line-height:1.35;
}
@media(max-width:480px){
  .subject-mastery-set-groups{gap:6px}
  .subject-mastery-set-steps span{height:21px;font-size:8.5px}
}


/* English B1 Vocabulary Hub v2 */
.vocab-subject-card{margin-top:16px;padding:18px 20px;overflow:hidden;background:linear-gradient(135deg,#fff 0%,#fbfcff 62%,#f2fbff 100%)}
.vocab-subject-main{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:13px;align-items:center}
.vocab-subject-icon{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;font-size:22px;background:linear-gradient(145deg,#eef2ff,#eafcff);box-shadow:inset 0 0 0 1px #dce5f5}
.vocab-subject-copy h3{margin:2px 0 0;font-size:19px}.vocab-subject-copy p{margin:5px 0 0;color:var(--muted);font-size:13px}
.vocab-subject-title-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.vocab-open-btn{white-space:nowrap}
.vocab-subject-progress{margin-top:16px}.vocab-progress-head{display:flex;justify-content:space-between;gap:14px;align-items:center;font-size:12px;color:var(--muted)}
.vocab-progress-head strong{color:var(--ink)}.vocab-progress-track{height:8px;border-radius:999px;background:#e8edf6;overflow:hidden;margin-top:7px}.vocab-progress-track span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6c63ff,#38b6e9)}
.vocab-progress-track.large{height:10px;margin-top:10px}
.vocab-subject-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:14px}
.vocab-subject-stats>div{padding:10px 12px;border:1px solid #e5eaf3;border-radius:11px;background:rgba(255,255,255,.82);min-width:0}
.vocab-subject-stats small,.vocab-subject-stats span{display:block;color:var(--muted);font-size:11px}.vocab-subject-stats strong{display:block;margin:2px 0;font-size:18px}.vocab-subject-stats span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vocab-subject-next{display:flex;gap:10px;align-items:center;margin-top:12px;padding:11px 13px;border-radius:11px;font-size:12px}
.vocab-subject-next>span{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-weight:900;flex:0 0 auto}.vocab-subject-next strong,.vocab-subject-next small{display:block}.vocab-subject-next small{margin-top:2px;color:inherit;opacity:.78}
.vocab-subject-next.ready{background:#eef9f1;color:#28723d}.vocab-subject-next.ready>span{background:#d9f1df}.vocab-subject-next.pending{background:#fff7e7;color:#885f18}.vocab-subject-next.pending>span{background:#fbe8bd}.vocab-subject-next.importing{background:#eef5ff;color:#3d619c}.vocab-subject-next.importing>span{background:#dce9fc}
.vocab-hub-hero{padding:22px 24px;background:linear-gradient(135deg,#fff,#f8faff 62%,#eefbff)}
.vocab-hub-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.vocab-hub-head h2{margin:3px 0 6px;font-size:26px}.vocab-hub-head p{margin:0;color:var(--muted)}
.vocab-hub-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:20px}.vocab-metric{padding:14px;border:1px solid #e2e8f2;border-radius:13px;background:rgba(255,255,255,.86)}
.vocab-metric.primary{background:linear-gradient(145deg,#f1f2ff,#f8fbff)}.vocab-metric small,.vocab-metric span{display:block;color:var(--muted);font-size:11px}.vocab-metric strong{display:block;font-size:24px;margin:3px 0;color:var(--ink)}
.vocab-import-status{margin-top:16px;padding:15px;border:1px solid #e0e7f1;border-radius:13px;background:#fbfcff}.vocab-import-top{display:flex;justify-content:space-between;gap:16px;align-items:center}.vocab-import-top strong,.vocab-import-top small{display:block}.vocab-import-top small{margin-top:3px;color:var(--muted)}.vocab-import-top b{font-size:20px}
.vocab-page-chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.vocab-page-chip{display:inline-flex;align-items:center;justify-content:center;min-width:39px;height:30px;padding:0 8px;border-radius:999px;border:1px solid #dce3ee;text-decoration:none;font-size:11px;font-weight:750;color:#68778d;background:#fff}
.vocab-page-chip.done{background:#eef9f1;color:#2d7a43;border-color:#d7eddc}.vocab-page-chip.missing{background:#fff7e7;color:#94671e;border-color:#f1dfb5}.vocab-page-chip.active{box-shadow:0 0 0 2px rgba(78,112,218,.15);border-color:#9eb3f0}.vocab-missing-note{display:block;margin-top:9px;color:#9a6b22}
.vocab-browser{margin-top:16px;padding:20px}.vocab-browser-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}.vocab-browser-head h3{margin:3px 0 4px}.vocab-browser-head p{margin:0;color:var(--muted);font-size:13px}
.vocab-search{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;margin-top:16px}.vocab-search-box{position:relative}.vocab-search-box>span{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:#8b96a8;font-size:19px}.vocab-search-box input{padding-left:38px}
.vocab-active-filter{margin-top:9px;font-size:12px;color:var(--muted)}.vocab-active-filter a{color:var(--blue)}
.vocab-entry-list{display:grid;margin-top:14px;border-top:1px solid var(--line)}.vocab-entry-row{display:grid;grid-template-columns:minmax(160px,1.2fr) minmax(220px,2fr) minmax(120px,1fr) 56px;gap:12px;align-items:center;padding:12px 4px;border-bottom:1px solid var(--line)}
.vocab-entry-word strong,.vocab-entry-word small{display:block}.vocab-entry-word strong{font-size:14px}.vocab-entry-word small{margin-top:2px;color:var(--muted);font-size:11px}.vocab-entry-meaning{font-size:13px;color:#42526b}
.vocab-entry-refs{display:flex;gap:5px;flex-wrap:wrap}.vocab-entry-refs span{display:inline-flex;padding:4px 7px;border-radius:999px;background:#eef3fb;color:#536d98;font-size:10px;font-weight:750}.vocab-entry-source{text-align:right;color:var(--muted);font-size:11px}
.vocab-pagination{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:16px}.vocab-pagination span{font-size:12px;color:var(--muted)}.ghost-btn.disabled{opacity:.45;pointer-events:none}
.vocab-empty-state{display:grid;place-items:center;text-align:center;padding:34px 18px;color:var(--muted)}.vocab-empty-state>span{font-size:28px}.vocab-empty-state strong{color:var(--ink);margin-top:6px}.vocab-empty-state small{margin-top:3px}
.vocab-two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}.vocab-section-card{padding:18px 20px}.vocab-section-head{display:flex;justify-content:space-between;gap:12px;align-items:center}.vocab-section-head h3{margin:3px 0 0}
.vocab-set-list{display:grid;gap:8px;margin-top:13px}.vocab-set-row{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:11px 12px;border:1px solid #e5eaf2;border-radius:11px;background:#fbfcfe}.vocab-set-row strong,.vocab-set-row small{display:block}.vocab-set-row small{margin-top:3px;color:var(--muted);font-size:11px}
.vocab-empty-compact{margin-top:13px;padding:18px;border:1px dashed #ccd6e4;border-radius:12px;background:#fafcff}.vocab-empty-compact strong,.vocab-empty-compact small{display:block}.vocab-empty-compact small{margin-top:4px;color:var(--muted)}
.vocab-rule-strip{display:flex;gap:12px;align-items:flex-start;margin:16px 0 4px;padding:14px 16px;border:1px solid #dce5f0;border-radius:13px;background:#f8fbff;color:#465975}.vocab-rule-strip>span{font-size:20px}.vocab-rule-strip strong,.vocab-rule-strip small{display:block}.vocab-rule-strip small{margin-top:3px;color:#6d7b91}
@media(max-width:900px){.vocab-subject-stats,.vocab-hub-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.vocab-entry-row{grid-template-columns:1fr 1.4fr}.vocab-two-col{grid-template-columns:1fr}}
@media(max-width:650px){.vocab-subject-main{grid-template-columns:40px 1fr}.vocab-open-btn{grid-column:1/-1;width:100%}.vocab-subject-stats,.vocab-hub-metrics{grid-template-columns:1fr 1fr}.vocab-hub-head{flex-direction:column}.vocab-search{grid-template-columns:1fr}.vocab-entry-row{grid-template-columns:1fr}.vocab-entry-source{text-align:left}.vocab-progress-head{align-items:flex-start}.vocab-import-top{align-items:flex-start}.vocab-browser,.vocab-hub-hero{padding:16px}.vocab-page-chips{gap:5px}}


/* English B1 Vocabulary Student UX v3 */
.vocab-learning-card{margin-top:16px;padding:18px 20px;background:linear-gradient(135deg,#fff 0%,#fbfcff 70%,#f4fbff 100%)}
.vocab-learning-head{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:13px;align-items:center}
.vocab-learning-icon{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;font-size:22px;background:linear-gradient(145deg,#eef2ff,#eafcff);box-shadow:inset 0 0 0 1px #dce5f5}
.vocab-learning-copy h3{margin:2px 0 0;font-size:19px}.vocab-learning-copy p{margin:5px 0 0;color:var(--muted);font-size:13px}.vocab-learning-title-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.vocab-learning-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:14px}.vocab-learning-stats>div{padding:11px 12px;border:1px solid #e5eaf3;border-radius:11px;background:#fff}.vocab-learning-stats small,.vocab-learning-stats span{display:block;color:var(--muted);font-size:11px}.vocab-learning-stats strong{display:block;font-size:20px;margin:2px 0}.vocab-learning-stats .new strong{color:#64748b}.vocab-learning-stats .learning strong{color:#4f63c6}.vocab-learning-stats .review strong{color:#b06a19}.vocab-learning-stats .secure strong{color:#27814a}
.vocab-learning-note{display:flex;gap:10px;align-items:flex-start;margin-top:12px;padding:11px 13px;border-radius:11px;background:#eef5ff;color:#3f5f96}.vocab-learning-note strong,.vocab-learning-note small{display:block}.vocab-learning-note small{margin-top:2px;opacity:.8}
.vocab-learning-progress{margin-top:12px;padding:11px 13px;border:1px solid #e6ebf3;border-radius:11px;background:#fbfcfe}.vocab-learning-progress>div:first-child{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted)}.vocab-learning-progress strong{color:var(--ink)}.vocab-learning-progress small{display:block;margin-top:6px;color:var(--muted)}

.student-vocab-hero{padding:21px 23px;background:linear-gradient(135deg,#fff,#f8faff 66%,#f0fbff)}
.student-vocab-hero-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.student-vocab-hero h2{margin:3px 0 5px;font-size:26px}.student-vocab-hero p{margin:0;color:var(--muted)}
.student-vocab-hero-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.student-vocab-hero-actions form{margin:0}
.student-vocab-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-top:18px}.student-vocab-stats>div{padding:12px 14px;border:1px solid #e4e9f2;border-radius:12px;background:rgba(255,255,255,.9)}.student-vocab-stats small{display:block;color:var(--muted);font-size:11px}.student-vocab-stats strong{display:block;margin-top:2px;font-size:24px}.student-vocab-stats .new strong{color:#64748b}.student-vocab-stats .learning strong{color:#4f63c6}.student-vocab-stats .review strong{color:#b06a19}.student-vocab-stats .secure strong{color:#27814a}
.student-vocab-progress{margin-top:14px}.student-vocab-progress>div:first-child{display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:12px}.student-vocab-progress strong{color:var(--ink)}.student-vocab-progress small{display:block;margin-top:7px;color:var(--muted)}

.student-vocab-tabs{display:flex;gap:7px;flex-wrap:wrap;margin:14px 0}.student-vocab-tabs a{display:inline-flex;align-items:center;gap:6px;padding:9px 12px;border:1px solid #dce3ee;border-radius:999px;background:#fff;color:#617087;text-decoration:none;font-size:12px;font-weight:750}.student-vocab-tabs a span{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#eef2f8;font-size:10px}.student-vocab-tabs a.active{color:#3e54bb;border-color:#bdc9f8;background:#f2f4ff}.student-vocab-tabs a.active span{background:#dfe5ff}

.student-vocab-panel{padding:20px}.student-vocab-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}.student-vocab-panel-head h3{margin:3px 0 4px}.student-vocab-panel-head p{margin:0;color:var(--muted);font-size:13px}
.student-vocab-toolbar{margin-top:15px;display:grid;gap:10px}.student-vocab-search{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px}.student-vocab-search.book{margin-top:16px}.student-vocab-filters{display:flex;gap:6px;flex-wrap:wrap}.student-vocab-filters a{padding:7px 10px;border-radius:999px;border:1px solid #e0e6ef;background:#fff;color:#68768b;text-decoration:none;font-size:11px;font-weight:700}.student-vocab-filters a.active{background:#eff3ff;border-color:#c5d0fb;color:#4058bb}.student-vocab-filters b{margin-left:3px}
.student-vocab-list{display:grid;margin-top:14px;border-top:1px solid var(--line)}.student-vocab-row{display:grid;grid-template-columns:62px minmax(160px,1.15fr) minmax(220px,1.65fr) 110px;gap:12px;align-items:center;padding:12px 4px;border-bottom:1px solid var(--line)}
.student-vocab-code{font-weight:800;font-size:11px;color:#596c94;background:#eef3fb;border-radius:999px;padding:5px 8px;text-align:center}.student-vocab-word strong,.student-vocab-word small{display:block}.student-vocab-word strong{font-size:14px}.student-vocab-word small{margin-top:2px;color:var(--muted);font-size:11px}.student-vocab-meaning{font-size:13px;color:#40516a;transition:opacity .15s}.student-vocab-list.meanings-hidden .student-vocab-meaning{color:transparent;user-select:none;position:relative}.student-vocab-list.meanings-hidden .student-vocab-meaning:after{content:"κρυμμένη σημασία";position:absolute;left:0;color:#9aa5b5;font-size:11px;font-style:italic}
.student-vocab-state{justify-self:end;display:inline-flex;padding:6px 9px;border-radius:999px;font-size:10px;font-weight:800}.student-vocab-state.new{background:#f0f2f5;color:#667085}.student-vocab-state.learning{background:#eef0ff;color:#4e5fc2}.student-vocab-state.needs_review{background:#fff2df;color:#9a5d14}.student-vocab-state.secure{background:#eaf8ee;color:#287845}
.student-vocab-list.book .student-vocab-row{grid-template-columns:minmax(180px,1.1fr) minmax(220px,1.6fr) minmax(120px,.8fr)}.student-vocab-book-refs{color:var(--muted);font-size:11px}
.student-vocab-empty{display:grid;place-items:center;text-align:center;padding:34px 18px;margin-top:14px;border:1px dashed #cfd8e5;border-radius:12px;background:#fbfcfe;color:var(--muted)}.student-vocab-empty strong,.student-vocab-empty small{display:block}.student-vocab-empty>span{font-size:25px}.student-vocab-empty strong{margin-top:5px;color:var(--ink)}.student-vocab-empty small{margin-top:3px}.student-vocab-empty.positive{background:#f6fbf7;border-color:#d6eadb}
.student-vocab-subtitle{margin:20px 0 8px}.student-vocab-scope-list,.student-vocab-history-list{display:grid;gap:8px;margin-top:12px}.student-vocab-scope-row,.student-vocab-history-row{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:11px;align-items:center;padding:12px;border:1px solid #e5eaf2;border-radius:11px;background:#fbfcfe}.student-vocab-scope-icon{width:38px;height:38px;border-radius:11px;background:#eef3fb;display:grid;place-items:center}.student-vocab-scope-row strong,.student-vocab-scope-row small,.student-vocab-history-row strong,.student-vocab-history-row small{display:block}.student-vocab-scope-row small,.student-vocab-history-row small{margin-top:3px;color:var(--muted);font-size:11px}
@media(max-width:900px){.vocab-learning-stats,.student-vocab-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.student-vocab-row{grid-template-columns:55px 1fr 1.35fr}.student-vocab-state{grid-column:3;justify-self:start}.student-vocab-list.book .student-vocab-row{grid-template-columns:1fr 1.4fr}.student-vocab-book-refs{grid-column:1/-1}}
@media(max-width:650px){.vocab-learning-head{grid-template-columns:40px 1fr}.vocab-open-btn{grid-column:1/-1;width:100%}.vocab-learning-stats,.student-vocab-stats{grid-template-columns:1fr 1fr}.student-vocab-hero-head{flex-direction:column}.student-vocab-hero-actions{width:100%}.student-vocab-hero-actions .ghost-btn,.student-vocab-hero-actions form,.student-vocab-hero-actions .btn{width:100%}.student-vocab-search{grid-template-columns:1fr}.student-vocab-panel{padding:16px}.student-vocab-row,.student-vocab-list.book .student-vocab-row{grid-template-columns:1fr}.student-vocab-code{justify-self:start}.student-vocab-state{grid-column:auto;justify-self:start}.student-vocab-panel-head{flex-direction:column}.student-vocab-scope-row,.student-vocab-history-row{grid-template-columns:38px 1fr}.student-vocab-scope-row>.status,.student-vocab-history-row>.status{grid-column:2}}


/* English B1 Phrasal Verbs UX v1 */
.vocab-phrasal-inline{display:inline-flex;align-items:center;gap:3px;color:#8b5b08;text-decoration:none;font-weight:750}.vocab-phrasal-inline:hover{text-decoration:underline}
.student-vocab-filters a.phrasal-focus{background:#fff7e6;border-color:#edd9a8;color:#8c6114}
.phrasal-panel{background:linear-gradient(180deg,#fff 0%,#fffdfa 100%)}
.phrasal-focus-banner{display:flex;gap:11px;align-items:flex-start;margin-top:14px;padding:12px 14px;border:1px solid #f0ddb1;border-radius:12px;background:#fff8e9;color:#805912}
.phrasal-focus-banner>span{font-size:20px}.phrasal-focus-banner strong,.phrasal-focus-banner small{display:block}.phrasal-focus-banner small{margin-top:3px;line-height:1.45;color:#8c6b2e}
.phrasal-list .student-vocab-code{background:#fff3d9;color:#8c6114}.phrasal-mini{display:inline-flex;margin-left:6px;padding:3px 6px;border-radius:999px;background:#fff3d9;color:#8c6114;font-size:9px;font-weight:800;vertical-align:middle}


/* B1 vocabulary assignment inside normal Daily Log */
.b1-vocab-toggle{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border:1px solid #e4e8f2;border-radius:12px;background:#fbfcff;cursor:pointer}
.b1-vocab-toggle input{margin-top:3px;width:18px;height:18px}.b1-vocab-toggle span{display:grid;gap:3px}.b1-vocab-toggle small{color:var(--muted);font-weight:400}
.form-grid.three-col{grid-template-columns:repeat(3,minmax(0,1fr))}
#b1VocabularyFields{margin-top:12px}.b1-range-info{margin-top:8px;padding:9px 11px;border-radius:9px;background:#f1f5ff;color:#52628a;font-size:12px}
@media(max-width:760px){.form-grid.three-col{grid-template-columns:1fr}}


/* Lesson-specific Practice Quiz actions */
.lesson-practice-form{margin:0}
.lesson-practice-btn{white-space:nowrap}
.subject-history-rewards{gap:7px;flex-wrap:wrap}
.history-row-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.history-row-actions form{margin:0}
@media(max-width:760px){.lesson-practice-btn{white-space:normal}}


/* Vocabulary flashcard study mode */
.vocab-study-cards{margin:16px 0 4px;padding:16px;border:1px solid #dce5f1;border-radius:14px;background:linear-gradient(145deg,#f9fbff,#fff)}
.vocab-study-cards-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.vocab-study-cards-head h4{margin:3px 0 4px;font-size:18px}.vocab-study-cards-head p{margin:0;color:var(--muted);font-size:12px}
.vocab-card-modes{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.vocab-card-modes .active{background:#eef2ff;border-color:#bdc8f7;color:#4058bb}
.vocab-flashcard{min-height:230px;margin-top:14px;padding:22px;border:1px solid #dbe3ef;border-radius:16px;background:#fff;box-shadow:0 8px 24px rgba(52,73,110,.06);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;cursor:pointer;outline:none}
.vocab-flashcard:focus{box-shadow:0 0 0 3px rgba(84,105,220,.14),0 8px 24px rgba(52,73,110,.06)}
.vocab-flashcard-meta{width:100%;display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:14px;color:#718096;font-size:11px;font-weight:750}
.vocab-flashcard-prompt{font-size:30px;font-weight:850;line-height:1.15;color:var(--ink)}.vocab-flashcard-sub{margin-top:6px;color:var(--muted);font-size:12px}
.vocab-flashcard-answer{margin-top:18px;padding:11px 16px;border-radius:12px;background:#eef8f2;color:#276a40;font-size:18px;font-weight:750}.vocab-flashcard-answer.hidden{display:none}
.vocab-flashcard>small{margin-top:14px;color:#8a96a8}.vocab-card-controls{display:grid;grid-template-columns:auto 1fr 1fr;gap:8px;align-items:center;margin-top:12px}.vocab-card-controls>*:last-child{justify-self:end}
.vocab-card-progress{margin-top:12px}.vocab-card-progress>span{display:block;text-align:center;color:var(--muted);font-size:11px;margin-bottom:5px}
@media(max-width:650px){.vocab-study-cards-head{flex-direction:column}.vocab-card-modes{justify-content:flex-start}.vocab-flashcard{min-height:205px;padding:18px}.vocab-flashcard-prompt{font-size:25px}.vocab-card-controls{grid-template-columns:1fr 1fr}.vocab-card-controls #cardReveal{grid-column:1/-1;grid-row:1}.vocab-card-controls>*:last-child{justify-self:stretch}.vocab-card-controls .ghost-btn{width:100%}}


/* Vocabulary historical set study */
.student-vocab-history-row{text-decoration:none;color:inherit;transition:.15s ease}.student-vocab-history-row:hover{border-color:#bfcaf5;background:#fbfcff;transform:translateY(-1px)}
.vocab-set-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.compact-head{margin-top:18px}.compact-head h4{margin:0 0 3px}


/* Vocabulary card shuffle, swipe and lesson phrasal focus */
.vocab-card-modes .ghost-btn.active,
.vocab-set-head-actions .ghost-btn.active{background:#eef2ff;border-color:#aebdf7;color:#3450bf;box-shadow:inset 0 0 0 1px rgba(73,94,210,.08)}
.vocab-flashcard{touch-action:pan-y;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}
.vocab-flashcard.is-phrasal{border-color:#e6bb61;background:linear-gradient(145deg,#fffdf7,#fff8e6);box-shadow:0 8px 24px rgba(154,104,12,.08)}
.vocab-flashcard.is-phrasal .vocab-flashcard-prompt{color:#7b5310}
.vocab-flashcard.is-phrasal .vocab-flashcard-meta{color:#936817}
.student-vocab-row.is-phrasal{background:linear-gradient(90deg,#fffaf0 0%,#fff 68%);border-left:3px solid #e8bd63;padding-left:10px}
.student-vocab-row.is-phrasal .student-vocab-code{background:#fff0cd;color:#8a5f12}
.student-vocab-row.is-phrasal .student-vocab-word>strong{color:#75500f}
.phrasal-toggle-active{background:#fff5d9!important;border-color:#e8c36f!important;color:#835b0e!important}
.vocab-swipe-hint{display:none;margin-top:9px;color:#9b8659;font-size:10px;font-weight:650}
@media(max-width:650px){
  .vocab-swipe-hint{display:block}
  .vocab-flashcard{user-select:none;-webkit-user-select:none}
}


/* Surprise school test UI */
.surprise-test-toggle{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border:1px solid #eadcb9;border-radius:12px;background:#fffaf0;cursor:pointer}
.surprise-test-toggle input{margin-top:3px;width:18px;height:18px}
.surprise-test-toggle span{display:grid;gap:3px}
.surprise-test-toggle small{color:var(--muted);font-weight:400}
#surpriseTestFields{display:grid;gap:12px;margin-top:13px}
.surprise-test-mode-card{background:linear-gradient(145deg,#fff,#fff9ea)}
.surprise-test-badge{display:inline-flex;align-items:center;gap:4px;padding:4px 7px;border-radius:999px;background:#fff0cf;color:#8a5a08;font-size:10px;font-weight:800}


/* ==========================================================
   V18.20 — Mobile parent schedule editor
   Keep the editable timetable visible and horizontally scrollable.
   ========================================================== */
@media(max-width:820px){
  .schedule-admin-card{
    overflow:visible!important;
  }

  .schedule-admin-timetable-wrap{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:visible!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    scrollbar-width:thin;
    padding-bottom:8px;
  }

  .schedule-admin-timetable.school-timetable{
    display:table!important;
    min-width:980px!important;
    width:980px!important;
  }

  .schedule-admin-timetable thead{
    display:table-header-group!important;
  }

  .schedule-admin-timetable tbody{
    display:table-row-group!important;
  }

  .schedule-admin-timetable tr{
    display:table-row!important;
  }

  .schedule-admin-timetable th,
  .schedule-admin-timetable td{
    display:table-cell!important;
  }

  .schedule-admin-timetable .time-head,
  .schedule-admin-timetable .period-head{
    position:sticky;
    left:0;
    z-index:3;
    background:#fff!important;
  }

  .schedule-admin-timetable .time-head{
    z-index:4;
  }
}


/* ==========================================================
   V18.20.1 — Mobile admin timetable touch-scroll fix
   The card must clip, while the inner timetable owns horizontal scrolling.
   ========================================================== */
@media(max-width:820px){
  .schedule-admin-card{
    overflow:hidden!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }

  .schedule-admin-timetable-wrap.timetable-wrap{
    display:block!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:scroll!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-x pan-y!important;
    overscroll-behavior-x:contain;
    position:relative;
  }

  .schedule-admin-timetable.school-timetable{
    display:table!important;
    width:980px!important;
    min-width:980px!important;
    max-width:none!important;
    table-layout:fixed!important;
  }

  .schedule-admin-timetable .time-head,
  .schedule-admin-timetable .period-head{
    position:sticky!important;
    left:0!important;
  }
}


/* V18.20.2 — Daily lesson form: full-width steps 4/5 + compact surprise test inside step 5 */
.teacher-note-section .surprise-test-inline{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid #edf0f6;
}
.teacher-note-section .surprise-test-inline .surprise-test-toggle{
  margin:0;
  padding:9px 11px;
  min-height:0;
}
.teacher-note-section .surprise-test-inline .surprise-test-toggle span strong{font-size:12px}
.teacher-note-section .surprise-test-inline .surprise-test-toggle span small{font-size:10px;margin-top:2px}
.teacher-note-section .surprise-test-inline #surpriseTestFields{
  margin-top:10px;
}
.teacher-note-section .surprise-test-inline #surpriseTestFields .field{margin-top:8px}
.teacher-note-section .surprise-test-inline #surpriseTestFields textarea{min-height:76px}


/* V18.21 — Tomorrow readiness assistant */
.home-ready-actions{border-top:1px solid var(--line);margin-top:14px;padding-top:14px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.home-ready-btn{display:inline-flex;align-items:center;gap:9px;background:var(--ink);color:#fff;text-decoration:none;border-radius:12px;padding:11px 15px;font-size:13px;font-weight:800}.home-ready-btn span{font-size:17px}.home-ready-actions small{color:var(--muted);font-size:11px}
.ready-hero{margin-bottom:18px}.ready-back{display:inline-block;color:var(--muted);text-decoration:none;font-size:13px;margin-bottom:14px}.ready-hero-main{display:flex;align-items:center;gap:14px}.ready-bag{width:54px;height:54px;border-radius:16px;background:var(--blue-soft);display:grid;place-items:center;font-size:27px}.ready-hero h2{margin:0 0 4px;font-size:27px}.ready-hero p{margin:0;color:var(--muted);font-size:13px}.ready-summary{display:inline-flex;margin-top:14px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:7px 11px;font-size:12px;color:var(--muted);gap:4px}.ready-summary strong{color:var(--ink)}
.ready-list{display:grid;gap:12px}.ready-card{padding:16px 18px}.ready-card-head{display:grid;grid-template-columns:auto 1fr auto;gap:11px;align-items:center}.ready-subject-icon{width:38px;height:38px;border-radius:11px;background:#f4f7fb;display:grid;place-items:center;font-size:20px}.ready-card-head h3{margin:0;font-size:16px}.ready-card-head small{color:var(--muted);font-size:10px}.ready-state{font-size:10px;font-weight:800;border-radius:999px;padding:5px 8px;background:var(--amber-soft);color:var(--amber)}.ready-card.is-clear .ready-state{background:var(--green-soft);color:var(--green)}
.ready-checks{display:grid;gap:7px;margin-top:12px}.ready-check{display:grid;grid-template-columns:24px 1fr;gap:8px;padding:9px 10px;background:#f8fafc;border-radius:10px}.ready-check b{font-size:11px;text-transform:uppercase;letter-spacing:.02em;color:#58677b}.ready-check p{margin:2px 0 0;font-size:13px}.ready-check.is-note{background:#fffaf0}.ready-check.is-intel{background:#f3f7ff}.ready-check.is-test{background:#fff3f3}.ready-clear{padding:10px;border-radius:10px;background:var(--green-soft);color:var(--green);font-size:12px}.ready-subject-link{display:inline-block;margin-top:11px;color:var(--blue);text-decoration:none;font-size:11px;font-weight:750}.ready-footnote{color:var(--muted);font-size:11px;text-align:center;padding:16px}.ready-empty{padding:22px}.ready-empty strong,.ready-empty span{display:block}.ready-empty span{color:var(--muted);font-size:12px;margin-top:4px}
@media(max-width:780px){.home-ready-actions{align-items:stretch}.home-ready-btn{width:100%;justify-content:space-between}.home-ready-actions small{padding:0 2px}.ready-card{padding:14px}.ready-card-head{grid-template-columns:auto 1fr}.ready-state{grid-column:2;justify-self:start}.ready-hero-main{align-items:flex-start}.ready-bag{flex:0 0 48px;width:48px;height:48px}.ready-hero h2{font-size:23px}}


/* V18.21.1 — Subjects: alphabetical + compact two-column mobile grid */
@media(max-width:780px){
  .subjects-page-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  .subjects-page-grid .subject-launch-card{
    min-width:0;
    min-height:132px;
    padding:13px 11px;
    gap:9px;
  }
  .subjects-page-grid .subject-top{
    align-items:flex-start;
    gap:8px;
  }
  .subjects-page-grid .subject-icon{
    flex:0 0 38px;
    width:38px;
    height:38px;
    font-size:19px;
    border-radius:11px;
  }
  .subjects-page-grid .subject-title{font-size:14px;line-height:1.2}
  .subjects-page-grid .subject-meta{font-size:10px;line-height:1.25;margin-top:4px}
  .subjects-page-grid .subject-title-row{align-items:flex-start}
  .subjects-page-grid .subject-external-badge{font-size:7px;padding:3px 5px}
  .subjects-page-grid .subject-card-statuses{min-height:0;gap:4px}
  .subjects-page-grid .status{font-size:8px;padding:4px 6px}
}
@media(max-width:360px){
  .subjects-page-grid{gap:8px!important}
  .subjects-page-grid .subject-launch-card{padding:11px 9px}
  .subjects-page-grid .subject-icon{flex-basis:34px;width:34px;height:34px;font-size:17px}
  .subjects-page-grid .subject-title{font-size:13px}
}


/* V18.21.2 — Subjects mobile card spacing/readability refinement */
@media(max-width:780px){
  .subjects-page-grid .subject-launch-card{
    min-height:148px;
    padding:17px 13px;
    align-content:start;
  }
  .subjects-page-grid .subject-top{
    gap:10px;
    align-items:center;
  }
  .subjects-page-grid .subject-icon{
    flex:0 0 42px;
    width:42px;
    height:42px;
    font-size:20px;
  }
  .subjects-page-grid .subject-title{
    font-size:15px;
    line-height:1.22;
    margin-bottom:3px;
  }
  .subjects-page-grid .subject-meta{
    font-size:11px;
    line-height:1.35;
    margin-top:2px;
  }
}
@media(max-width:360px){
  .subjects-page-grid .subject-launch-card{min-height:142px;padding:15px 10px}
  .subjects-page-grid .subject-title{font-size:14px}
  .subjects-page-grid .subject-meta{font-size:10px}
}


/* V18.21.3 — Subjects mobile definitive spacing override */
@media(max-width:780px){
  .subjects-page-grid .subject-launch-card{
    min-height:96px!important;
    height:auto!important;
    padding:14px 12px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
  }
  .subjects-page-grid .subject-launch-card .subject-top{
    width:100%!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    gap:10px!important;
    align-items:center!important;
  }
  .subjects-page-grid .subject-launch-card .subject-icon{
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    font-size:20px!important;
  }
  .subjects-page-grid .subject-launch-card .subject-title{
    font-size:15px!important;
    line-height:1.22!important;
  }
  .subjects-page-grid .subject-launch-card .subject-meta{
    font-size:11px!important;
    line-height:1.3!important;
    margin-top:4px!important;
  }
}


/* V18.21.4 — Subjects mobile compact cards with balanced text alignment */
@media(max-width:780px){
  .subjects-page-grid .subject-launch-card{
    min-height:76px!important;
    height:auto!important;
    padding:10px 11px!important;
    align-items:center!important;
  }
  .subjects-page-grid .subject-launch-card .subject-top{
    grid-template-columns:38px minmax(0,1fr)!important;
    gap:10px!important;
    align-items:center!important;
  }
  .subjects-page-grid .subject-launch-card .subject-icon{
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    font-size:19px!important;
  }
  .subjects-page-grid .subject-launch-card .subject-title-row{
    display:flex!important;
    align-items:center!important;
    min-height:18px!important;
  }
  .subjects-page-grid .subject-launch-card .subject-title{
    font-size:14px!important;
    line-height:1.18!important;
    margin:0!important;
  }
  .subjects-page-grid .subject-launch-card .subject-meta{
    font-size:10.5px!important;
    line-height:1.2!important;
    margin-top:3px!important;
  }
}


/* V18.21.5 — Subjects mobile optical vertical centering */
@media(max-width:780px){
  .subjects-page-grid .subject-launch-card .subject-top > div:last-child{
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    min-height:38px!important;
    transform:translateY(2px);
  }
}


/* V18.21.6 — Subjects mobile true centered content */
@media(max-width:780px){
  .subjects-page-grid .subject-launch-card{
    justify-content:center!important;
  }
  .subjects-page-grid .subject-launch-card .subject-top{
    align-items:center!important;
  }
  .subjects-page-grid .subject-launch-card .subject-top > div:last-child{
    min-height:0!important;
    align-self:center!important;
    justify-content:center!important;
    transform:none!important;
  }
}

/* V18.21.7 */
@media(max-width:780px){
.subjects-page-grid .subject-launch-card .subject-top{position:relative!important;min-height:38px!important}
.subjects-page-grid .subject-launch-card .subject-top>div:last-child{position:absolute!important;top:50%!important;left:48px!important;right:0!important;transform:translateY(-50%)!important;margin:0!important}
}

.login-remember{display:flex;align-items:flex-start;gap:11px;margin:2px 0 18px;padding:11px 12px;border:1px solid #e0e6f0;border-radius:12px;background:#f8faff;cursor:pointer;user-select:none;transition:.15s border-color,.15s background,.15s box-shadow}.login-remember:hover{border-color:#cbd7ea;background:#f4f7ff}.login-remember:has(input:focus-visible){border-color:#7b8df7;box-shadow:0 0 0 3px rgba(95,103,242,.10)}.login-remember input{width:18px!important;height:18px!important;margin:1px 0 0!important;padding:0!important;flex:0 0 18px;accent-color:#5f67f2;box-shadow:none!important}.login-remember-copy{display:flex;flex-direction:column;gap:2px;min-width:0;line-height:1.25}.login-remember-title{display:block;font-size:13px;font-weight:800;color:#1d2a3e}.login-remember-subtitle{display:block;font-size:11px;font-weight:500;color:#748197}


/* V18.46 — clickable Quiz results + assessment detail */
a.subject-quiz-chip.result-link{
  text-decoration:none;
  border:1px solid #d8eee4;
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
}
a.subject-quiz-chip.result-link:hover{
  transform:translateY(-1px);
  border-color:#afd9c8;
  box-shadow:0 4px 12px rgba(40,120,90,.10);
}
.subject-quiz-open{font-size:9px;opacity:.7;margin-left:1px}
.assessment-result-shell{display:grid;gap:16px}
.assessment-result-hero{padding:20px}
.assessment-result-hero-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.assessment-result-score{font-size:34px;line-height:1;font-weight:950;color:#17264a}
.assessment-result-meta{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}
.assessment-result-meta span{display:inline-flex;padding:6px 9px;border-radius:999px;background:#f3f6fb;color:#5f6d85;font-size:11px;font-weight:800}
.assessment-result-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:16px}
.assessment-result-stat{padding:12px;border:1px solid #e4e9f2;border-radius:12px;background:#fff}
.assessment-result-stat small,.assessment-result-stat strong{display:block}
.assessment-result-stat small{color:#7a879b;font-size:10px}
.assessment-result-stat strong{margin-top:4px;font-size:18px;color:#25334f}
.assessment-question-list{display:grid;gap:12px}
.assessment-question-card{padding:16px;border:1px solid #e4e9f2;border-radius:14px;background:#fff}
.assessment-question-card.correct{border-color:#bfe6d1;background:#f7fcf9}
.assessment-question-card.partial{border-color:#f0d79d;background:#fffbf2}
.assessment-question-card.wrong{border-color:#f0c2c2;background:#fff8f8}
.assessment-question-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}
.assessment-question-head strong{color:#1f2f4d}
.assessment-question-score{font-weight:950}
.assessment-question-line{display:grid;grid-template-columns:145px 1fr;gap:10px;margin-top:7px;font-size:13px;line-height:1.5}
.assessment-question-line b{color:#34435e}
.assessment-question-muted{color:#7f8aa0}
.assessment-result-note{padding:13px 15px;border-radius:12px;background:#f5f7fb;color:#65728a;font-size:12px;line-height:1.5}
@media(max-width:850px){.assessment-result-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){
  .assessment-result-hero-head{flex-direction:column}
  .assessment-result-summary{grid-template-columns:1fr 1fr}
  .assessment-question-line{grid-template-columns:1fr;gap:2px}
}


/* V18.47 — complete per-subject Quiz history + archived Quiz detail */
.assessment-result-context{padding:16px;display:grid;gap:13px}
.assessment-result-context>div{padding-bottom:10px;border-bottom:1px solid #edf0f6}
.assessment-result-context>div:last-child{padding-bottom:0;border-bottom:0}
.assessment-result-context small{display:block;color:#78859a;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.04em}
.assessment-result-context p{margin:5px 0 0;color:#2e3d59;font-size:13px;line-height:1.55}
.assessment-result-context ul{margin:7px 0 0;padding-left:20px;color:#2e3d59;font-size:13px;line-height:1.55}
.subject-quiz-progress-list{max-height:none;overflow:visible}

/* V18.47 — archived-vs-full Quiz snapshot clarity */
.assessment-result-meta .snapshot-full{background:#eaf8f0;color:#247556}
.assessment-result-meta .snapshot-archive{background:#fff4df;color:#8a5d18}
.assessment-result-archive-warning{border:1px solid #f1d59b;background:#fff9ed}
.assessment-question-missing span{color:#8b93a3;font-style:italic}
.assessment-question-card.correct .assessment-question-missing{opacity:.82}

/* Reference Library · student-facing */
.ref-library-promo{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:16px;padding:18px 20px;margin-top:16px}
.ref-library-promo-icon{width:48px;height:48px;border-radius:14px;background:var(--lab-soft);display:grid;place-items:center;font-size:24px}
.ref-library-promo-copy h3{margin:2px 0 4px;font-size:18px}.ref-library-promo-copy p{margin:0;color:var(--muted);font-size:13px}
.ref-library-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:24px;margin-bottom:16px}
.ref-library-hero h2{margin:3px 0 8px;font-size:28px}.ref-library-hero p{margin:0;color:var(--muted);max-width:760px}
.ref-library-empty{text-align:center;padding:42px 24px}.ref-library-empty-icon{font-size:38px}.ref-library-empty h3{margin:10px 0 6px}.ref-library-empty p{margin:0;color:var(--muted)}
.ref-library-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}.ref-library-summary>div{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 16px}.ref-library-summary strong,.ref-library-summary span{display:block}.ref-library-summary strong{font-size:20px}.ref-library-summary span{font-size:12px;color:var(--muted);margin-top:2px}
.ref-chapter-list{display:grid;gap:16px}.ref-chapter-card{padding:20px}.ref-chapter-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.ref-chapter-head h3{margin:2px 0 0;font-size:20px}
.ref-lesson-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.ref-lesson-card{display:flex;flex-direction:column;gap:10px;min-height:145px;padding:16px;border:1px solid var(--line);border-radius:14px;text-decoration:none;color:inherit;background:#fbfcff;transition:.16s}.ref-lesson-card:hover{border-color:#bfcdf2;transform:translateY(-1px);box-shadow:0 10px 24px rgba(20,32,51,.07)}.ref-lesson-card>strong{font-size:15px}.ref-lesson-card>small{margin-top:auto;color:var(--blue);font-weight:750}
.ref-lesson-meta{display:flex;flex-wrap:wrap;gap:6px}.ref-lesson-meta span{font-size:11px;background:#f1f4fa;border-radius:999px;padding:5px 7px;color:#5d687d}
.ref-breadcrumb{display:flex;flex-wrap:wrap;gap:7px;align-items:center;margin:0 0 14px;color:var(--muted);font-size:13px}.ref-breadcrumb a{color:#536889;text-decoration:none}.ref-breadcrumb strong{color:var(--ink)}
.ref-lesson-shell{overflow:hidden}.ref-lesson-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;padding:22px 24px;border-bottom:1px solid var(--line)}.ref-lesson-head h2{margin:3px 0 7px;font-size:28px}.ref-lesson-head p{margin:0;color:var(--muted);max-width:760px;font-size:13px}
.ref-concept-outline{padding:18px 24px;border-bottom:1px solid var(--line);background:#fbfbff}.ref-concept-outline-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}.ref-concept-outline-head span{color:var(--muted);font-size:12px}.ref-concept-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px}.ref-concept-grid>div{display:flex;align-items:center;gap:9px}.ref-concept-grid>div>span{width:27px;height:27px;border-radius:50%;display:grid;place-items:center;background:var(--lab-soft);color:var(--lab-violet);font-size:12px;font-weight:800}.ref-concept-grid strong{font-size:13px}
.ref-resource-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;padding:18px 24px;border-bottom:1px solid var(--line)}.ref-resource-tabs a{display:flex;flex-direction:column;gap:6px;padding:12px;border:1px solid var(--line);border-radius:13px;text-decoration:none;color:inherit;background:#fff}.ref-resource-tabs a.active{border-color:#9488ff;background:#f4f2ff;box-shadow:0 0 0 2px rgba(109,93,252,.08)}.ref-resource-tabs a span{font-size:18px}.ref-resource-tabs a strong{font-size:12px}
.ref-resource-content{padding:24px;max-width:980px}.ref-study-copy{font-size:15px;line-height:1.7}.ref-study-copy h2,.ref-study-copy h3,.ref-study-copy h4{margin:1.25em 0 .5em}.ref-study-copy p{margin:.65em 0}.ref-study-copy li{margin:.35em 0}.ref-tooltip{border-bottom:1px dotted #8894ab;cursor:help}
.ref-sos-box{margin-top:18px;background:#fff8e9;border:1px solid #f0d8a4;border-radius:14px;padding:15px 17px}.ref-sos-box ul{margin:8px 0 0;padding-left:20px}
.ref-content-card-grid{display:grid;gap:12px}.ref-content-card{border:1px solid var(--line);border-radius:14px;padding:16px;background:#fbfcff}
.ref-flashcard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.ref-flashcard{border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden}.ref-flashcard summary{padding:15px;cursor:pointer;font-weight:750}.ref-flashcard>div{padding:0 15px 15px;color:#44536b}
.ref-exercise-list{display:grid;gap:12px}.ref-exercise{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;border:1px solid var(--line);border-radius:14px;padding:15px}.ref-exercise-num{width:30px;height:30px;border-radius:9px;background:var(--lab-soft);color:var(--lab-violet);display:grid;place-items:center;font-weight:850}.ref-exercise details{margin-top:10px;border-top:1px solid var(--line);padding-top:10px}.ref-exercise summary{cursor:pointer;font-weight:750;color:#52698d}
@media(max-width:950px){.ref-lesson-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ref-resource-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:680px){.ref-library-promo{grid-template-columns:auto 1fr}.ref-library-promo .btn{grid-column:1/-1}.ref-library-hero,.ref-lesson-head{flex-direction:column}.ref-library-summary,.ref-lesson-grid,.ref-concept-grid,.ref-flashcard-grid{grid-template-columns:1fr}.ref-resource-tabs{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px}.ref-resource-content{padding:18px}.ref-chapter-card{padding:16px}}

.ref-library-test-form{display:grid;gap:14px}
.ref-library-test-form .ref-exercise{background:#fff}
.ref-library-test-form textarea,.ref-library-test-form input[type="text"],.ref-library-test-form select{width:100%;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);padding:10px 12px;font:inherit}
.ref-library-test-form textarea:focus,.ref-library-test-form input[type="text"]:focus,.ref-library-test-form select:focus{outline:2px solid rgba(63,111,222,.18);border-color:#9cb5ed}
.ref-test-options{display:grid;gap:9px;margin-top:12px}
.ref-test-options label{display:flex;align-items:flex-start;gap:10px;border:1px solid var(--line);border-radius:11px;padding:10px 12px;background:#fbfcff;cursor:pointer}
.ref-test-options input{margin-top:3px}
.ref-test-matching,.ref-test-fill{display:grid;gap:10px;margin-top:12px}
.ref-test-matching label,.ref-test-fill label{display:grid;grid-template-columns:minmax(140px,.8fr) minmax(180px,1.2fr);gap:12px;align-items:center}
.ref-test-matching label>span,.ref-test-fill label>span{font-weight:700;color:#44536b}
.ref-test-feedback{margin-top:12px;border-radius:10px;padding:10px 12px;border:1px solid var(--line)}
.ref-test-feedback.ok{background:var(--green-soft);color:var(--green);border-color:#c9e8d8}
.ref-test-feedback.bad{background:var(--red-soft);color:var(--red);border-color:#f1c8cb}
.ref-test-feedback div{margin-top:4px;color:inherit}
@media(max-width:680px){.ref-test-matching label,.ref-test-fill label{grid-template-columns:1fr;gap:6px}}

/* Reference content directive rendering */
.ref-callout{display:grid;grid-template-columns:34px minmax(0,1fr);gap:12px;margin:18px 0;border:1px solid #d9deea;border-radius:14px;padding:14px 16px;background:#f7f8fc;color:#374158}
.ref-callout-icon{font-size:18px;line-height:1.2;padding-top:1px}
.ref-callout-copy>strong{display:block;font-size:14px;color:#3d4660;margin-bottom:6px}
.ref-callout-copy>div>p:first-child{margin-top:0}.ref-callout-copy>div>p:last-child{margin-bottom:0}
.ref-callout-alert,.ref-callout-warning{background:#fff8e9;border-color:#efd7a1}.ref-callout-alert .ref-callout-copy>strong,.ref-callout-warning .ref-callout-copy>strong{color:#75551b}
.ref-callout-tip{background:#eef9f4;border-color:#cae9db}.ref-callout-tip .ref-callout-copy>strong{color:#23664a}
.ref-callout-fact{background:#f1f2f8;border-color:#d9dce8}
.ref-callout-info,.ref-callout-note{background:#eef4ff;border-color:#d4e0f7}
.ref-math{font-family:"Cambria Math","STIX Two Math","Times New Roman",serif;font-size:1.05em;white-space:normal}
.ref-math-block{display:block;margin:8px 0}

/* Library Test v2 */
.ref-quiz-page{max-width:900px;margin:0 auto 36px}
.ref-quiz-breadcrumb{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:13px;color:var(--muted);margin:4px 0 24px}
.ref-quiz-breadcrumb a{text-decoration:none;color:#576b91}.ref-quiz-breadcrumb strong{color:var(--ink)}
.ref-quiz-title-row{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:16px}.ref-quiz-title-row h2{margin:0;font-size:30px}
.ref-quiz-badge{border:1px solid #d8def0;border-radius:999px;padding:8px 12px;background:#f7f8fc;color:#59647d;font-size:13px;font-weight:700}
.ref-quiz-rules{padding:0;overflow:hidden}.ref-quiz-rules>strong{display:block;padding:18px 20px 0;font-size:18px}.ref-quiz-rules ul{margin:10px 20px 18px;padding-left:20px;color:#4d576d}.ref-quiz-rules li{margin:8px 0}
.ref-quiz-start{display:block;margin:0 auto 18px}
.ref-quiz-run{padding-top:70px}
.ref-quiz-status{margin:0 8px 22px}.ref-quiz-progress{height:8px;background:#e8e5ff;border-radius:999px;overflow:hidden}.ref-quiz-progress span{display:block;height:100%;width:0;background:linear-gradient(90deg,#6d5dfc,#8c67ff);transition:width .2s ease}
.ref-quiz-status-line{display:flex;justify-content:space-between;color:#606984;font-size:13px;margin-top:8px}
.ref-quiz-question{overflow:hidden;border-radius:18px}
.ref-quiz-question-head{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:18px 20px 8px}.ref-quiz-question-head>span{font-size:12px;font-weight:800;color:#6459d8;text-transform:uppercase;letter-spacing:.04em}.ref-quiz-question-head small{color:var(--muted)}
.ref-quiz-question-text{padding:0 20px 8px;font-size:16px;font-weight:750}.ref-quiz-question-text p{margin:8px 0}
.ref-quiz-options{display:grid;gap:11px;padding:14px 20px 18px}
.ref-quiz-option{width:100%;min-height:54px;border:2px solid #e2e5ee;border-radius:12px;background:#fff;color:#343946;text-align:left;padding:13px 16px;font:inherit;font-size:15px;cursor:pointer;transition:.14s ease;display:flex;align-items:center;justify-content:space-between;gap:12px}
.ref-quiz-option:hover{border-color:#bcb5ff;background:#fbfaff}.ref-quiz-option.correct{border-color:#0aaf63;background:#ebf8f2;color:#07864d}.ref-quiz-option.wrong{border-color:#ef4747;background:#fff0f0;color:#d63333}
.ref-quiz-option.check{justify-content:flex-start}.ref-quiz-option.check input{margin:0}
.ref-quiz-matching,.ref-quiz-fill,.ref-quiz-open{display:grid;gap:12px;padding:14px 20px 8px}
.ref-quiz-matching label{display:grid;grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr);gap:12px;align-items:center;border:2px solid #e2e5ee;border-radius:12px;padding:9px 12px;background:#fff}.ref-quiz-matching label>b{text-align:center;color:#a2a9bb}.ref-quiz-matching label.correct{border-color:#0aaf63;background:#ebf8f2}.ref-quiz-matching label.wrong{border-color:#ef4747;background:#fff0f0}
.ref-quiz-matching select,.ref-quiz-fill input,.ref-quiz-open textarea{width:100%;border:1px solid #d9deea;border-radius:10px;background:#fff;padding:11px 12px;font:inherit;color:var(--ink)}
.ref-quiz-fill label{display:grid;grid-template-columns:110px 1fr;gap:12px;align-items:center}.ref-quiz-fill label.correct input{border-color:#0aaf63;background:#ebf8f2}.ref-quiz-fill label.wrong input{border-color:#ef4747;background:#fff0f0}
.ref-check-btn{margin:8px 20px 0}
.ref-quiz-feedback{margin:14px 20px 0;border-radius:11px;padding:12px 14px;border:1px solid #dfe3ee}.ref-quiz-feedback.ok{background:#ebf8f2;border-color:#bde7d2;color:#087f4a}.ref-quiz-feedback.bad{background:#fff0f0;border-color:#f1c2c2;color:#c73535}.ref-quiz-feedback div{margin-top:5px}
.ref-quiz-actions{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#f4f2ff;padding:14px 18px;margin-top:18px}.ref-quiz-skip{border:0;background:transparent;color:#6d7080;font-weight:700;cursor:pointer}.ref-quiz-next:disabled{opacity:.45;cursor:not-allowed}
.ref-quiz-result{text-align:center;padding:42px 28px;margin-top:80px}.ref-quiz-result-icon{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;margin:0 auto 12px;background:#eaf8f1;color:#0a9d5b;font-size:30px;font-weight:900}.ref-quiz-result h2{font-size:40px;margin:6px 0 12px}.ref-quiz-result p{color:var(--muted)}.ref-quiz-result-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:20px}
@media(max-width:680px){.ref-quiz-page{max-width:none}.ref-quiz-title-row{flex-direction:column}.ref-quiz-run{padding-top:28px}.ref-quiz-matching label{grid-template-columns:1fr}.ref-quiz-matching label>b{display:none}.ref-quiz-fill label{grid-template-columns:1fr;gap:6px}.ref-quiz-actions{position:sticky;bottom:0}.ref-quiz-question-text{font-size:15px}}


/* Reference lesson top navigation */
.ref-lesson-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex:0 0 auto}
.ref-lesson-nav-btn,.ref-lesson-library-btn{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid #dfe5f0;border-radius:11px;background:#fff;color:#40506a;text-decoration:none;font-size:12px;font-weight:760;line-height:1;transition:background .15s,border-color .15s,box-shadow .15s,transform .15s}
.ref-lesson-nav-btn{padding:9px 11px}
.ref-lesson-library-btn{padding:9px 13px;background:#f8faff;border-color:#d7e0f0;color:#334764}
.ref-lesson-nav-btn:hover,.ref-lesson-library-btn:hover{background:#f6f8fc;border-color:#c9d4e6;box-shadow:0 5px 14px rgba(34,52,82,.07);transform:translateY(-1px)}
.ref-lesson-library-btn:hover{background:#f1f5fb}
.ref-lesson-nav-btn.is-disabled{opacity:.34;cursor:default;pointer-events:none}
.ref-lesson-nav-btn>span[aria-hidden="true"],.ref-lesson-library-btn>span[aria-hidden="true"]{font-size:16px;font-weight:800}
@media(max-width:860px){.ref-lesson-head{align-items:stretch}.ref-lesson-head-actions{width:100%;display:grid;grid-template-columns:1fr auto 1fr}.ref-lesson-nav-btn,.ref-lesson-library-btn{min-width:0}.ref-lesson-nav-prev{justify-self:stretch}.ref-lesson-nav-next{justify-self:stretch}}
@media(max-width:520px){.ref-lesson-head{padding:18px 16px;gap:14px}.ref-lesson-head h2{font-size:24px}.ref-lesson-head-actions{gap:6px}.ref-lesson-nav-btn,.ref-lesson-library-btn{min-height:39px;padding:8px 9px}.ref-lesson-nav-label{font-size:0}.ref-lesson-nav-prev .ref-lesson-nav-label:after{content:"Προηγ.";font-size:11px}.ref-lesson-nav-next .ref-lesson-nav-label:after{content:"Επόμ.";font-size:11px}.ref-lesson-library-btn span:last-child{font-size:11px}}

/* Reference Library UX v3 */
.ref-outline-collapsible{border-bottom:1px solid var(--line);background:#fbfbff}
.ref-outline-collapsible summary{list-style:none;cursor:pointer;padding:13px 24px;display:flex;justify-content:space-between;align-items:center;gap:14px}
.ref-outline-collapsible summary::-webkit-details-marker{display:none}
.ref-outline-collapsible summary>span{display:flex;align-items:center;gap:10px;min-width:0}.ref-outline-collapsible summary b{font-size:14px}.ref-outline-collapsible summary small{color:var(--muted)}.ref-outline-collapsible summary em{font-style:normal;font-size:12px;color:#65718a}
.ref-outline-collapsible[open] summary em{font-size:0}.ref-outline-collapsible[open] summary em:after{content:"Κλείσιμο";font-size:12px}
.ref-outline-collapsible .ref-concept-grid{padding:0 24px 18px}

.ref-resource-tabs-v2{grid-template-columns:repeat(6,minmax(0,1fr));padding:14px 24px}
.ref-resource-tabs-v2 a{flex-direction:row;align-items:center;gap:10px;padding:11px 12px}
.ref-resource-tabs-v2 a>span{font-size:17px}.ref-resource-tabs-v2 a>div{min-width:0}.ref-resource-tabs-v2 a strong,.ref-resource-tabs-v2 a small{display:block}.ref-resource-tabs-v2 a strong{font-size:12px}.ref-resource-tabs-v2 a small{font-size:10px;color:var(--muted);margin-top:2px}
.ref-resource-content-v2{padding-top:18px}
.ref-section-intro{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.ref-section-intro>div{display:flex;align-items:center;gap:10px}.ref-section-intro>div>span{width:34px;height:34px;border-radius:10px;background:#f2f4fb;display:grid;place-items:center}.ref-section-intro strong,.ref-section-intro small{display:block}.ref-section-intro strong{font-size:17px}.ref-section-intro small{color:var(--muted);margin-top:2px}

.ref-knowledge-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.ref-knowledge-card{position:relative;border:1px solid #dfe4ef;border-radius:14px;padding:16px 16px 16px 48px;background:linear-gradient(180deg,#fff,#fbfcff);min-height:90px}
.ref-knowledge-card-num{position:absolute;left:14px;top:15px;width:25px;height:25px;border-radius:50%;background:#eeecff;color:#685ce5;display:grid;place-items:center;font-size:12px;font-weight:800}
.ref-knowledge-card p:first-child{margin-top:0}.ref-knowledge-card p:last-child{margin-bottom:0}

.ref-flash-study{max-width:820px;margin:0 auto}
.ref-flash-toolbar{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;margin-bottom:16px}.ref-flash-progress{height:7px;border-radius:999px;background:#e9e7f7;overflow:hidden}.ref-flash-progress span{display:block;height:100%;width:0;background:linear-gradient(90deg,#745ff6,#55b8e8);transition:width .2s}.ref-flash-toolbar>strong{font-size:13px;color:#66708a}
.ref-flash-mini-btn{border:1px solid #d9deea;border-radius:10px;background:#fff;padding:7px 10px;color:#515d76;font-weight:700;cursor:pointer}
.ref-flash-stage{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;gap:12px;align-items:center}
.ref-flash-nav{width:42px;height:42px;border-radius:50%;border:1px solid #dde2ed;background:#fff;font-size:26px;color:#6c7690;cursor:pointer;box-shadow:0 4px 14px rgba(20,32,51,.06)}
.ref-flash-deck{position:relative;min-height:410px;perspective:1300px}
.ref-flash-deck:before,.ref-flash-deck:after{content:"";position:absolute;inset:12px 8px 0;border-radius:18px;background:linear-gradient(135deg,#9fdcff,#cbc7ff);border:1px solid rgba(116,95,246,.22);z-index:0;transform:rotate(1.2deg);box-shadow:0 10px 25px rgba(84,78,180,.12)}
.ref-flash-deck:after{inset:22px 14px -8px;transform:rotate(-1deg);opacity:.65}
.ref-flash-card3d{position:absolute;inset:0;z-index:2;perspective:1200px;transition:transform .18s ease,opacity .18s ease}
.ref-flash-card3d.swipe-left{transform:translateX(-120%) rotate(-8deg);opacity:0}.ref-flash-card3d.swipe-right{transform:translateX(120%) rotate(8deg);opacity:0}
.ref-flash-card3d-inner{position:relative;width:100%;height:100%;min-height:410px;transform-style:preserve-3d;transition:transform .55s cubic-bezier(.2,.75,.2,1)}
.ref-flash-card3d.flipped .ref-flash-card3d-inner{transform:rotateY(180deg)}
.ref-flash-face{position:absolute;inset:0;backface-visibility:hidden;border-radius:18px;border:1px solid #9c9fea;background:linear-gradient(135deg,#9fddff,#d8d1ff);box-shadow:0 16px 38px rgba(77,70,167,.16),0 7px 0 rgba(116,95,246,.18);padding:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.ref-flash-face.back{transform:rotateY(180deg);background:linear-gradient(135deg,#eef2f9,#cfeff0);border-color:#9acfc1}
.ref-flash-label{position:absolute;left:24px;top:24px;background:rgba(255,255,255,.7);border-radius:999px;padding:6px 10px;font-size:12px;font-weight:800;color:#6957e7}.ref-flash-label.answer{color:#18835a}
.ref-flash-main{font-size:25px;font-weight:760;max-width:620px}.ref-flash-main p{margin:.4em 0}.ref-flash-face>small{position:absolute;bottom:26px;background:rgba(255,255,255,.66);border-radius:999px;padding:6px 10px;color:#707890}
.ref-flash-hint{text-align:center;color:#778198;font-size:12px;margin:18px 0 10px}
.ref-flash-actions{display:flex;justify-content:center;gap:12px}.ref-flash-actions button{border-radius:999px;padding:10px 22px;font-weight:800;cursor:pointer}.ref-flash-known{border:1px solid #15985b;background:#10a964;color:#fff}.ref-flash-unknown{border:1px solid #d9deea;background:#fff;color:#5a647a}
.ref-flash-session{text-align:center;padding:26px;border:1px solid #dfe4ef;border-radius:16px;background:#fbfcff}.ref-flash-session strong,.ref-flash-session span{display:block}.ref-flash-session strong{font-size:20px}.ref-flash-session span{color:var(--muted);margin:7px 0 16px}

@media(max-width:1050px){.ref-resource-tabs-v2{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:680px){
 .ref-outline-collapsible summary{padding:12px 16px}.ref-outline-collapsible .ref-concept-grid{padding:0 16px 14px}
 .ref-resource-tabs-v2{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px 14px}.ref-resource-tabs-v2 a{padding:10px}
 .ref-resource-tabs-v2 a small{display:none}.ref-knowledge-card-grid{grid-template-columns:1fr}
 .ref-flash-toolbar{grid-template-columns:1fr auto}.ref-flash-mini-btn{grid-column:1/-1;justify-self:end}
 .ref-flash-stage{grid-template-columns:1fr}.ref-flash-nav{display:none}.ref-flash-deck,.ref-flash-card3d-inner{min-height:350px}.ref-flash-main{font-size:21px}.ref-flash-actions{position:sticky;bottom:10px;z-index:5}
}

/* Reference Library polish v4 */
.ref-empty-resource{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:180px;border:1px dashed #d8deeb;border-radius:16px;background:#fbfcff;padding:26px;color:#65718a}
.ref-empty-resource>span{width:46px;height:46px;border-radius:14px;background:#f1f3fa;display:grid;place-items:center;font-size:22px;margin-bottom:10px}.ref-empty-resource strong{font-size:17px;color:var(--ink)}.ref-empty-resource small{margin-top:5px}

.ref-knowledge-card-grid{gap:16px}
.ref-knowledge-card{padding:0;overflow:hidden;min-height:180px;background:linear-gradient(145deg,#f8faff,#eef1ff);border-color:#d9def4;box-shadow:0 8px 20px rgba(60,66,130,.06)}
.ref-knowledge-card:nth-child(3n+2){background:linear-gradient(145deg,#fff9f4,#fff0e7);border-color:#f1d7c4}
.ref-knowledge-card:nth-child(3n+3){background:linear-gradient(145deg,#f5fbf8,#eaf7f0);border-color:#cfe7d9}
.ref-knowledge-card-top{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid rgba(100,110,160,.12)}.ref-knowledge-card-top span{width:34px;height:24px;border-radius:999px;background:rgba(255,255,255,.72);display:grid;place-items:center;font-size:11px;font-weight:900;color:#5f59c7}.ref-knowledge-card-top b{font-size:10px;letter-spacing:.08em;color:#6f7890}
.ref-knowledge-card-body{padding:18px;font-size:15px;line-height:1.6}.ref-knowledge-card-body h2,.ref-knowledge-card-body h3,.ref-knowledge-card-body h4{font-size:18px;margin:.2em 0 .6em}.ref-knowledge-card-body p:first-child{margin-top:0}.ref-knowledge-card-body p:last-child{margin-bottom:0}
.ref-knowledge-card-foot{display:none}

.ref-library-tests-grid{display:grid;gap:16px}
.ref-library-test-launch{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:18px;align-items:center;border:1px solid #dddff0;border-radius:18px;padding:20px;background:linear-gradient(135deg,#fafaff,#f4f2ff)}
.ref-library-test-launch-icon{width:56px;height:56px;border-radius:16px;background:linear-gradient(135deg,#7563ff,#9b70ff);color:#fff;display:grid;place-items:center;font-size:26px;font-weight:900;box-shadow:0 10px 22px rgba(109,93,252,.2)}
.ref-library-test-launch-copy h3{margin:1px 0 5px;font-size:20px}.ref-library-test-launch-copy p{margin:0;color:#4e5870}.ref-library-test-launch-copy small{display:block;color:var(--muted);margin-top:6px}
.ref-library-test-start{white-space:nowrap}

.ref-quiz-welcome{display:grid;grid-template-columns:82px minmax(0,1fr) minmax(280px,.8fr);gap:24px;align-items:center;padding:28px}
.ref-quiz-welcome-icon{width:74px;height:74px;border-radius:22px;background:linear-gradient(135deg,#7663ff,#5ec5f1);color:#fff;display:grid;place-items:center;font-size:34px;box-shadow:0 14px 30px rgba(78,87,190,.18)}
.ref-quiz-welcome-copy h2{margin:2px 0 7px;font-size:28px}.ref-quiz-welcome-copy>p{color:#59647a;margin:0 0 18px}
.ref-quiz-welcome-stats{display:flex;gap:10px;flex-wrap:wrap}.ref-quiz-welcome-stats span{min-width:92px;border:1px solid #e0e4ef;border-radius:12px;background:#fff;padding:10px 12px}.ref-quiz-welcome-stats b,.ref-quiz-welcome-stats small{display:block}.ref-quiz-welcome-stats b{font-size:17px}.ref-quiz-welcome-stats small{font-size:11px;color:var(--muted);margin-top:2px}
.ref-quiz-welcome-rules{border-left:1px solid #e2e5ef;padding-left:24px}.ref-quiz-welcome-rules>strong{font-size:16px}.ref-quiz-welcome-rules ul{margin:9px 0 18px;padding-left:18px;color:#586278}.ref-quiz-welcome-rules li{margin:7px 0}
.ref-quiz-welcome-rules .ref-quiz-start{margin:0}

.ref-quiz-result{max-width:900px}.ref-quiz-review{margin:24px auto 8px;text-align:left;max-width:720px}.ref-quiz-review h3{font-size:18px;margin:0 0 12px}
.ref-quiz-review-item{display:grid;grid-template-columns:34px 1fr;gap:12px;border:1px solid #e1e5ef;border-radius:13px;padding:13px 14px;margin-bottom:10px;background:#fbfcff}.ref-quiz-review-item>b{width:30px;height:30px;border-radius:9px;background:#fff0f0;color:#c63c3c;display:grid;place-items:center}.ref-quiz-review-item strong{display:block;font-size:14px}.ref-quiz-review-item small{display:block;color:#617086;margin-top:4px}.ref-quiz-review-item p{margin:6px 0 0;color:#404b62;font-size:13px}
.ref-quiz-all-good{border:1px solid #cce8d9;background:#edf8f2;border-radius:13px;padding:14px;color:#20784f}.ref-quiz-all-good strong,.ref-quiz-all-good span{display:block}.ref-quiz-all-good span{margin-top:4px;font-size:13px}
.ref-quiz-practice-note{font-size:12px;color:#8a93a5!important;margin-top:18px!important}

@media(max-width:850px){
 .ref-library-test-launch{grid-template-columns:auto 1fr}.ref-library-test-start{grid-column:1/-1;text-align:center}
 .ref-quiz-welcome{grid-template-columns:1fr}.ref-quiz-welcome-icon{width:58px;height:58px;border-radius:17px;font-size:27px}.ref-quiz-welcome-rules{border-left:0;border-top:1px solid #e2e5ef;padding:18px 0 0}
}

/* Reference Library centering pass */
.ref-resource-content-v2 .ref-empty-resource{
  width:min(100%,820px);
  margin:18px auto;
}
.ref-resource-content-v2 .ref-library-tests-grid{
  width:min(100%,900px);
  margin:18px auto;
}
.ref-resource-content-v2 .ref-library-test-launch{
  width:100%;
}
.ref-quiz-page .ref-quiz-intro,
.ref-quiz-page .ref-quiz-run,
.ref-quiz-page .ref-quiz-result{
  width:min(100%,900px);
  margin-left:auto;
  margin-right:auto;
}

/* Open-question self-check flow */
.ref-quiz-open-selfcheck{padding:14px 20px 8px}
.ref-quiz-think{display:flex;align-items:center;gap:10px;border:1px dashed #d8deea;border-radius:12px;background:#fbfcff;padding:14px 16px;color:#536079}
.ref-quiz-think span{font-size:22px}.ref-quiz-think p{margin:0}
.ref-open-reveal{margin-top:12px}
.ref-open-answer{margin-top:14px;border:1px solid #dfe5ef;border-radius:12px;background:#f9fbff;padding:14px}
.ref-open-answer>strong{display:block;font-size:13px;color:#5c6781;margin-bottom:8px}
.ref-open-answer>div:not(.ref-open-self-buttons){font-size:15px;line-height:1.6;color:#30394d}
.ref-open-self-buttons{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.ref-open-self-buttons button{border-radius:999px;padding:9px 16px;font-weight:800;cursor:pointer}
.ref-self-known{border:1px solid #15985b;background:#10a964;color:#fff}
.ref-self-unknown{border:1px solid #d9deea;background:#fff;color:#5a647a}

/* Reference Library landing + exam builder v7 */
.ref-library-promo-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.ref-library-open-btn,.ref-library-exam-btn{border-radius:11px;font-weight:800;text-decoration:none;white-space:nowrap}
.ref-library-open-btn{background:linear-gradient(135deg,#6357f6,#387de9);color:#fff!important;border:1px solid transparent}
.ref-library-open-btn:hover{background:linear-gradient(135deg,#574be8,#2f6fd5);color:#fff!important;filter:none}
.ref-library-exam-btn{background:#fff;border:1px solid #dce2ef;color:#33415f!important}
.ref-library-exam-btn:hover{background:#f7f9fd;color:#1f2d4c!important}

.ref-library-exam-banner{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:18px;align-items:center;padding:20px 22px;margin:16px 0 20px;background:linear-gradient(135deg,#f8f7ff,#eef6ff)}
.ref-library-exam-banner-icon{width:54px;height:54px;border-radius:15px;display:grid;place-items:center;background:linear-gradient(135deg,#7460ff,#4cb7ea);color:#fff;font-size:25px;box-shadow:0 10px 24px rgba(77,90,190,.15)}
.ref-library-exam-banner h3{margin:2px 0 4px}.ref-library-exam-banner p{margin:0;color:var(--muted)}
.ref-library-exam-banner .btn{white-space:nowrap}

.ref-lesson-card{min-height:108px}
.ref-lesson-card>small{margin-top:auto;color:#5c62e8;font-weight:800}
.ref-lesson-card .ref-lesson-meta{display:none!important}

.ref-exam-builder{max-width:1050px;margin:0 auto 40px;overflow:hidden}
.ref-exam-builder-head{display:flex;gap:16px;align-items:center;padding:24px;border-bottom:1px solid var(--line);background:linear-gradient(135deg,#fbfbff,#f4f8ff)}
.ref-exam-builder-head h2{margin:2px 0 4px}.ref-exam-builder-head p{margin:0;color:var(--muted)}
.ref-exam-builder-icon{width:58px;height:58px;border-radius:17px;background:linear-gradient(135deg,#7461ff,#55bce9);display:grid;place-items:center;color:#fff;font-size:27px}
.ref-exam-chapters{display:grid;gap:14px;padding:20px 24px}
.ref-exam-chapter{border:1px solid #dfe4ef;border-radius:15px;background:#fff;overflow:hidden}
.ref-exam-chapter-head{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:13px 15px;background:#fafbfe;border-bottom:1px solid #e7eaf2}
.ref-exam-chapter-head label{display:flex;align-items:center;gap:9px;cursor:pointer}.ref-exam-chapter-head span{font-size:12px;color:var(--muted)}
.ref-exam-lessons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px}
.ref-exam-lessons label{display:flex;gap:9px;align-items:flex-start;border:1px solid #e5e8f0;border-radius:10px;padding:10px 11px;cursor:pointer;background:#fff}
.ref-exam-lessons label:hover{border-color:#bbb5ff;background:#fbfaff}
.ref-exam-lessons input,.ref-exam-chapter-head input{margin-top:2px;accent-color:#6b5cf6}
.ref-exam-size{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:20px 24px;border-top:1px solid var(--line);background:#fbfcff}
.ref-exam-size>div>strong,.ref-exam-size>div>small{display:block}.ref-exam-size>div>small{color:var(--muted);margin-top:3px}
.ref-exam-size-options{display:flex;gap:10px}.ref-exam-size-options label{cursor:pointer}.ref-exam-size-options input{position:absolute;opacity:0;pointer-events:none}
.ref-exam-size-options span{min-width:100px;border:2px solid #e0e4ef;border-radius:12px;padding:10px 14px;background:#fff;display:block;text-align:center}
.ref-exam-size-options b,.ref-exam-size-options small{display:block}.ref-exam-size-options b{font-size:20px}.ref-exam-size-options small{color:var(--muted)}
.ref-exam-size-options input:checked+span{border-color:#7563ff;background:#f1efff;color:#5148ca}
.ref-exam-builder-footer{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:16px 24px;border-top:1px solid var(--line);background:#f5f3ff}.ref-exam-builder-footer>span{font-size:13px;color:#626d84}
.ref-exam-builder-footer .btn:disabled{opacity:.45;cursor:not-allowed}

@media(max-width:760px){
 .ref-library-exam-banner{grid-template-columns:auto 1fr}.ref-library-exam-banner .btn{grid-column:1/-1;text-align:center}
 .ref-library-promo-actions{width:100%}.ref-library-promo-actions .btn{flex:1;text-align:center}
 .ref-exam-lessons{grid-template-columns:1fr}.ref-exam-size{align-items:flex-start;flex-direction:column}.ref-exam-builder-footer{align-items:stretch;flex-direction:column}.ref-exam-builder-footer .btn{width:100%}
}

/* Reference Library warmer chapter cards */
.ref-chapter-card:nth-child(4n+1){background:linear-gradient(180deg,#fff 0%,#fbfbff 100%)}
.ref-chapter-card:nth-child(4n+2){background:linear-gradient(180deg,#fff 0%,#fffaf5 100%)}
.ref-chapter-card:nth-child(4n+3){background:linear-gradient(180deg,#fff 0%,#f6fbff 100%)}
.ref-chapter-card:nth-child(4n+4){background:linear-gradient(180deg,#fff 0%,#f8fcf8 100%)}
.ref-chapter-card:nth-child(4n+1) .ref-lesson-card:nth-child(4n+1){background:#f8f6ff;border-color:#ded8ff}
.ref-chapter-card:nth-child(4n+1) .ref-lesson-card:nth-child(4n+2){background:#f2f8ff;border-color:#d7e7fb}
.ref-chapter-card:nth-child(4n+1) .ref-lesson-card:nth-child(4n+3){background:#fff8f2;border-color:#f2dfcf}
.ref-chapter-card:nth-child(4n+1) .ref-lesson-card:nth-child(4n+4){background:#f4fbf7;border-color:#d7eadf}
.ref-chapter-card:nth-child(4n+2) .ref-lesson-card:nth-child(4n+1){background:#fff7f3;border-color:#f3ddd1}
.ref-chapter-card:nth-child(4n+2) .ref-lesson-card:nth-child(4n+2){background:#f7f4ff;border-color:#e2d9ff}
.ref-chapter-card:nth-child(4n+2) .ref-lesson-card:nth-child(4n+3){background:#f1fbfb;border-color:#d4eeee}
.ref-chapter-card:nth-child(4n+2) .ref-lesson-card:nth-child(4n+4){background:#fffbed;border-color:#efe4bb}
.ref-chapter-card:nth-child(4n+2) .ref-lesson-card:nth-child(4n+5){background:#f4f8ff;border-color:#d9e4f6}
.ref-chapter-card:nth-child(4n+3) .ref-lesson-card:nth-child(4n+1){background:#f3f9ff;border-color:#d9e8f7}
.ref-chapter-card:nth-child(4n+3) .ref-lesson-card:nth-child(4n+2){background:#fff7ec;border-color:#f0dec6}
.ref-chapter-card:nth-child(4n+3) .ref-lesson-card:nth-child(4n+3){background:#f7f5ff;border-color:#e0dcfb}
.ref-chapter-card:nth-child(4n+3) .ref-lesson-card:nth-child(4n+4){background:#f2faf5;border-color:#d8e9df}
.ref-chapter-card:nth-child(4n+4) .ref-lesson-card:nth-child(4n+1){background:#f5fbf7;border-color:#d9eadf}
.ref-chapter-card:nth-child(4n+4) .ref-lesson-card:nth-child(4n+2){background:#fff6f4;border-color:#f1d9d4}
.ref-chapter-card:nth-child(4n+4) .ref-lesson-card:nth-child(4n+3){background:#f4f6ff;border-color:#dce1f7}
.ref-chapter-card:nth-child(4n+4) .ref-lesson-card:nth-child(4n+4){background:#fffaf0;border-color:#eadfca}
.ref-lesson-card{transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.ref-lesson-card:hover{transform:translateY(-2px);box-shadow:0 8px 18px rgba(55,68,115,.08);border-color:#bfc9e6}

/* Generated Library Exam scope */
.ref-quiz-scope{margin:16px 0 18px;border:1px solid #e0e4ef;border-radius:13px;background:#fbfcff;padding:13px 14px}
.ref-quiz-scope>strong{display:block;font-size:13px;color:#4d5870;margin-bottom:9px}
.ref-quiz-scope-list{display:flex;flex-wrap:wrap;gap:8px}
.ref-quiz-scope-list>span{display:flex;flex-direction:column;gap:2px;border:1px solid #dde2f0;border-radius:10px;background:#fff;padding:8px 10px;min-width:150px}
.ref-quiz-scope-list small{font-size:10px;color:#7a8498}
.ref-quiz-scope-list b{font-size:12px;color:#26324b}

/* Reference Library lesson cards v10 — align with Subjects UI */
.ref-chapter-card{
  background:#fff!important;
  border:1px solid #dfe5f0;
  box-shadow:0 8px 24px rgba(35,54,92,.045);
}
.ref-chapter-head{
  padding-bottom:14px;
  margin-bottom:2px;
}
.ref-lesson-grid{
  gap:14px;
}
.ref-lesson-card.ref-lesson-card-v2{
  position:relative;
  min-height:128px;
  display:grid;
  grid-template-columns:52px minmax(0,1fr) auto;
  grid-template-rows:1fr auto;
  column-gap:14px;
  row-gap:10px;
  align-items:center;
  padding:18px 18px 15px 20px;
  overflow:hidden;
  background:#fff!important;
  border:1px solid #dce3ef!important;
  border-radius:14px;
  color:var(--ink);
  text-decoration:none;
  box-shadow:0 4px 12px rgba(32,51,86,.035);
}
.ref-lesson-card-v2 .ref-lesson-card-accent{
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:5px;
  background:#6f63f6;
}
.ref-lesson-card-v2:nth-child(4n+2) .ref-lesson-card-accent{background:#4ab6e8}
.ref-lesson-card-v2:nth-child(4n+3) .ref-lesson-card-accent{background:#b77adf}
.ref-lesson-card-v2:nth-child(4n+4) .ref-lesson-card-accent{background:#65c9a2}
.ref-lesson-card-v2 .ref-lesson-card-icon{
  grid-row:1 / span 2;
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:linear-gradient(145deg,#f2f5ff,#edf6ff);
  border:1px solid #dce5f5;
  font-size:23px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.6);
}
.ref-lesson-card-v2:nth-child(4n+2) .ref-lesson-card-icon{background:linear-gradient(145deg,#eef9ff,#edf4ff)}
.ref-lesson-card-v2:nth-child(4n+3) .ref-lesson-card-icon{background:linear-gradient(145deg,#faf2ff,#f5efff)}
.ref-lesson-card-v2:nth-child(4n+4) .ref-lesson-card-icon{background:linear-gradient(145deg,#eefbf5,#f4fbf8)}
.ref-lesson-card-copy{
  align-self:end;
  min-width:0;
}
.ref-lesson-card-copy strong{
  display:block;
  font-size:15px;
  line-height:1.35;
  color:#17243d;
}
.ref-lesson-card-copy em{
  display:block;
  margin-top:5px;
  font-size:11px;
  line-height:1.2;
  font-style:normal;
  color:#8a94a8;
}
.ref-lesson-card-open{
  grid-column:2 / 4;
  align-self:start;
  font-size:12px;
  font-weight:800;
  color:#5f5ae7;
}
.ref-lesson-card-v2:hover{
  transform:translateY(-3px);
  border-color:#c5cce0!important;
  box-shadow:0 12px 26px rgba(42,59,99,.09);
}
.ref-lesson-card-v2:hover .ref-lesson-card-open{
  color:#3f46cf;
}
.ref-lesson-card-v2:hover .ref-lesson-card-icon{
  transform:scale(1.03);
}
.ref-lesson-card-v2 .ref-lesson-card-icon{
  transition:transform .16s ease;
}
@media(max-width:680px){
  .ref-lesson-card.ref-lesson-card-v2{
    min-height:116px;
    grid-template-columns:46px minmax(0,1fr);
    padding:15px 14px 14px 18px;
  }
  .ref-lesson-card-v2 .ref-lesson-card-icon{
    width:42px;height:42px;font-size:21px;
  }
  .ref-lesson-card-open{
    grid-column:2;
  }
}

/* Subject page Library card alignment */
.ref-library-promo{
  margin-top:16px;
  padding:18px 20px;
  background:#fff!important;
  border:1px solid var(--line)!important;
  border-left:4px solid #5e63f2!important;
  border-radius:16px!important;
  box-shadow:0 8px 22px rgba(34,50,84,.045)!important;
}
.ref-library-promo-icon{
  width:44px;
  height:44px;
  border-radius:12px;
  background:#f4f6fb!important;
  border:1px solid #e1e6ef;
  box-shadow:none!important;
}
.ref-library-promo-copy h3{
  font-size:17px;
  margin:1px 0 4px;
}
.ref-library-promo-copy p{
  font-size:12px;
  color:#738096;
}
.ref-library-promo .eyebrow{
  color:#6670e8;
}
.ref-library-promo .ref-library-open-btn{
  box-shadow:none;
  min-height:40px;
}
.ref-library-promo:hover{
  box-shadow:0 10px 26px rgba(34,50,84,.065)!important;
}

/* Reference lesson inner cards full-width */
.ref-resource-content-v2 .ref-empty-resource,
.ref-resource-content-v2 .ref-library-tests-grid{
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
}
.ref-resource-content-v2 .ref-library-test-launch{
  width:100%!important;
  max-width:none!important;
}

/* Reference lesson layout + resource tabs v13 */
.ref-lesson-shell .ref-resource-content{
  max-width:none!important;
  width:100%!important;
  box-sizing:border-box;
}
.ref-lesson-shell .ref-resource-content-v2{
  padding:24px!important;
}
.ref-lesson-shell .ref-flash-study{
  max-width:none!important;
  width:100%!important;
  margin:0!important;
}
.ref-lesson-shell .ref-flash-stage{
  width:100%;
}
.ref-lesson-shell .ref-flash-deck{
  width:100%;
}
.ref-lesson-shell .ref-empty-resource,
.ref-lesson-shell .ref-library-tests-grid,
.ref-lesson-shell .ref-library-test-launch{
  width:100%!important;
  max-width:none!important;
  box-sizing:border-box;
}

/* StudyLab-style resource selector cards */
.ref-resource-tabs-v2{
  gap:12px;
  padding:16px 24px!important;
  background:#fbfcff;
}
.ref-resource-tabs-v2 a{
  position:relative;
  min-height:68px;
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr);
  gap:11px!important;
  align-items:center!important;
  padding:11px 13px!important;
  border:1px solid #dfe5f0!important;
  border-radius:13px!important;
  background:#fff!important;
  color:#22304a!important;
  box-shadow:0 3px 10px rgba(35,52,88,.025);
  overflow:hidden;
}
.ref-resource-tabs-v2 a:before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:4px;
  background:#6c63f1;
  opacity:.85;
}
.ref-resource-tabs-v2 a:nth-child(2):before{background:#4a9fe8}
.ref-resource-tabs-v2 a:nth-child(3):before{background:#6a74d8}
.ref-resource-tabs-v2 a:nth-child(4):before{background:#f5a33d}
.ref-resource-tabs-v2 a:nth-child(5):before{background:#f17a58}
.ref-resource-tabs-v2 a:nth-child(6):before{background:#b66bd8}

.ref-resource-tabs-v2 a>span{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:linear-gradient(145deg,#eef4ff,#f7f9ff);
  border:1px solid #dde6f5;
  font-size:18px!important;
}
.ref-resource-tabs-v2 a:nth-child(2)>span{background:linear-gradient(145deg,#eef8ff,#f7fbff)}
.ref-resource-tabs-v2 a:nth-child(3)>span{background:linear-gradient(145deg,#f1f3ff,#fafaff)}
.ref-resource-tabs-v2 a:nth-child(4)>span{background:linear-gradient(145deg,#fff5e8,#fffaf3)}
.ref-resource-tabs-v2 a:nth-child(5)>span{background:linear-gradient(145deg,#fff0eb,#fff8f4)}
.ref-resource-tabs-v2 a:nth-child(6)>span{background:linear-gradient(145deg,#f9efff,#fcf7ff)}

.ref-resource-tabs-v2 a>div{
  min-width:0;
}
.ref-resource-tabs-v2 a strong{
  font-size:13px!important;
  line-height:1.2;
  color:#1e2a41;
}
.ref-resource-tabs-v2 a small{
  display:block!important;
  margin-top:4px!important;
  font-size:10px!important;
  color:#8390a5!important;
  line-height:1.2;
}
.ref-resource-tabs-v2 a:hover{
  transform:translateY(-2px);
  border-color:#c8d2e5!important;
  box-shadow:0 8px 18px rgba(34,51,88,.07);
}
.ref-resource-tabs-v2 a.active{
  border-color:#7b70f4!important;
  background:linear-gradient(180deg,#fff,#f7f5ff)!important;
  box-shadow:0 7px 18px rgba(103,91,226,.10);
}
.ref-resource-tabs-v2 a.active>span{
  border-color:#cfc8ff;
  box-shadow:0 0 0 3px rgba(112,97,240,.08);
}

@media(max-width:1050px){
  .ref-resource-tabs-v2{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media(max-width:680px){
  .ref-lesson-shell .ref-resource-content-v2{padding:16px!important}
  .ref-resource-tabs-v2{grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:12px 14px!important}
  .ref-resource-tabs-v2 a{min-height:60px;grid-template-columns:36px minmax(0,1fr);padding:9px 10px!important}
  .ref-resource-tabs-v2 a>span{width:34px;height:34px;font-size:16px!important}
  .ref-resource-tabs-v2 a small{display:none!important}
}

/* Flashcard progress toolbar v14 */
.ref-flash-toolbar-v2{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:14px!important;
  align-items:end!important;
  margin-bottom:18px!important;
}
.ref-flash-progress-block{min-width:0}
.ref-flash-progress-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:8px;
}
.ref-flash-progress-head strong{
  font-size:13px;
  color:#26334c;
}
.ref-flash-progress-head span{
  font-size:12px;
  font-weight:700;
  color:#66728a;
}
.ref-flash-toolbar-v2 .ref-flash-progress{
  height:7px;
}
.ref-flash-stats{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:9px;
}
.ref-flash-stats span{
  display:inline-flex;
  align-items:center;
  gap:5px;
  border:1px solid #e0e5ef;
  border-radius:999px;
  background:#fff;
  padding:5px 9px;
  font-size:11px;
  color:#748096;
}
.ref-flash-stats b{
  color:#343f58;
  font-size:11px;
}
.ref-flash-toolbar-v2 .ref-flash-mini-btn{
  align-self:center;
  white-space:nowrap;
  background:#fff;
  border:1px solid #dce3ee;
  color:#536079;
  box-shadow:0 3px 9px rgba(35,51,88,.035);
}
.ref-flash-toolbar-v2 .ref-flash-mini-btn:hover{
  border-color:#c5cee0;
  background:#f8faff;
}
@media(max-width:680px){
  .ref-flash-toolbar-v2{grid-template-columns:1fr!important}
  .ref-flash-toolbar-v2 .ref-flash-mini-btn{justify-self:end!important}
  .ref-flash-progress-head{align-items:flex-start;flex-direction:column;gap:3px}
}

/* Reference outline help tooltips v15 */
.ref-outline-item{
  display:flex!important;
  align-items:center;
  gap:8px;
}
.ref-outline-item>strong{
  min-width:0;
}
.ref-outline-help{
  width:18px;
  height:18px;
  flex:0 0 18px;
  display:grid;
  place-items:center;
  border:1px solid #8b95aa;
  border-radius:50%;
  background:#fff;
  color:#667188;
  font-size:11px;
  font-weight:800;
  line-height:1;
  padding:0;
  cursor:pointer;
}
.ref-outline-help:hover{
  border-color:#655cf0;
  color:#554bd9;
  background:#f6f4ff;
}
.ref-outline-popover{
  position:fixed;
  z-index:9999;
  width:max-content;
  max-width:320px;
  border:1px solid #dde2ec;
  border-radius:11px;
  background:#fff;
  color:#566078;
  padding:11px 13px;
  font-size:12px;
  line-height:1.5;
  box-shadow:0 10px 28px rgba(25,38,68,.16);
}

/* Reference outline tooltip motion v17 */
.ref-outline-popover{
  opacity:0;
  transform:translateY(5px) scale(.985);
  transform-origin:50% 100%;
  transition:
    opacity 150ms ease,
    transform 170ms cubic-bezier(.2,.75,.25,1),
    box-shadow 170ms ease;
  will-change:opacity,transform;
  pointer-events:auto;
}
.ref-outline-popover.below{
  transform:translateY(-5px) scale(.985);
  transform-origin:50% 0%;
}
.ref-outline-popover.is-visible{
  opacity:1;
  transform:translateY(0) scale(1);
  box-shadow:0 12px 30px rgba(25,38,68,.18);
}
.ref-outline-popover.is-hiding{
  opacity:0;
  transform:translateY(3px) scale(.99);
  pointer-events:none;
}
.ref-outline-help{
  transition:border-color 140ms ease,color 140ms ease,background-color 140ms ease,transform 140ms ease;
}
.ref-outline-help:hover{
  transform:scale(1.06);
}
@media (prefers-reduced-motion: reduce){
  .ref-outline-popover,.ref-outline-help{transition:none!important;transform:none!important}
}
@media(max-width:680px){
  .ref-outline-help{
    width:36px;
    height:36px;
    flex:0 0 36px;
    font-size:13px;
  }
}

/* Reference outline expand/collapse motion v18 */
.ref-outline-collapsible summary{
  user-select:none;
}
.ref-outline-collapsible summary em{
  display:inline-flex!important;
  align-items:center;
  gap:7px;
  min-width:76px;
  justify-content:flex-end;
  color:#68748a;
  font-size:12px;
  font-style:normal;
}
.ref-outline-chevron{
  display:inline-grid;
  place-items:center;
  width:18px;
  height:18px;
  border-radius:50%;
  border:1px solid #d7deea;
  background:#fff;
  color:#667188;
  font-size:13px;
  font-style:normal;
  line-height:1;
  transition:
    transform 180ms cubic-bezier(.2,.75,.25,1),
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}
.ref-outline-collapsible[open] .ref-outline-chevron{
  transform:rotate(180deg);
  background:#f4f2ff;
  border-color:#cfc8ff;
  color:#5a50dc;
}
.ref-outline-collapsible summary:hover .ref-outline-chevron{
  border-color:#bfc8da;
  background:#f8faff;
}
.ref-outline-panel{
  overflow:hidden;
  max-height:0;
  opacity:0;
  transform:translateY(-4px);
  transition:
    max-height 260ms cubic-bezier(.2,.75,.25,1),
    opacity 180ms ease,
    transform 220ms cubic-bezier(.2,.75,.25,1);
  will-change:max-height,opacity,transform;
}
.ref-outline-collapsible[open] .ref-outline-panel{
  transform:translateY(0);
}
.ref-outline-panel .ref-concept-grid{
  padding-top:2px;
}
@media (prefers-reduced-motion: reduce){
  .ref-outline-panel,.ref-outline-chevron{transition:none!important;transform:none!important}
}

/* Reference micro-polish v19 */
html{
  scrollbar-gutter:stable;
}

/* Clean CSS chevron */
.ref-outline-chevron{
  position:relative;
  width:20px;
  height:20px;
  border-radius:50%;
  border:1px solid #d7deea;
  background:#fff;
  font-size:0!important;
  color:transparent!important;
}
.ref-outline-chevron::before{
  content:"";
  position:absolute;
  left:50%;
  top:46%;
  width:6px;
  height:6px;
  border-right:1.6px solid #6a758b;
  border-bottom:1.6px solid #6a758b;
  transform:translate(-50%,-55%) rotate(45deg);
  transition:border-color 150ms ease;
}
.ref-outline-collapsible[open] .ref-outline-chevron{
  transform:rotate(180deg);
}
.ref-outline-collapsible[open] .ref-outline-chevron::before{
  border-color:#5a50dc;
}
.ref-outline-collapsible summary:hover .ref-outline-chevron::before{
  border-color:#505b72;
}

/* Exact horizontal alignment across all lesson tabs */
.ref-lesson-shell .ref-resource-content-v2{
  margin-inline:0!important;
}
.ref-lesson-shell .ref-empty-resource,
.ref-lesson-shell .ref-library-tests-grid,
.ref-lesson-shell .ref-exercise-list,
.ref-lesson-shell .ref-flash-study,
.ref-lesson-shell .ref-knowledge-card-grid,
.ref-lesson-shell .ref-study-copy{
  margin-left:0!important;
  margin-right:0!important;
}

/* Flashcard completion state v20 */
.ref-flash-complete{
  min-height:360px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:38px 26px;
  border:1px solid #dde4ef;
  border-radius:20px;
  background:
    radial-gradient(circle at 50% 0%,rgba(102,92,244,.08),transparent 42%),
    linear-gradient(180deg,#fff,#fafbff);
  opacity:0;
  transform:translateY(8px) scale(.992);
  transition:opacity 220ms ease,transform 240ms cubic-bezier(.2,.75,.25,1);
}
.ref-flash-complete.is-visible{
  opacity:1;
  transform:translateY(0) scale(1);
}
.ref-flash-complete-icon{
  width:72px;
  height:72px;
  display:grid;
  place-items:center;
  border-radius:50%;
  margin-bottom:14px;
  background:linear-gradient(135deg,#eafaf2,#eef8ff);
  border:1px solid #cfe9dd;
  color:#0f9b5e;
  font-size:34px;
  font-weight:900;
  box-shadow:0 10px 28px rgba(36,133,92,.10);
  animation:refFlashCompletePop 420ms cubic-bezier(.2,.85,.3,1.15) both;
}
.ref-flash-complete>.eyebrow{
  margin-bottom:6px;
}
.ref-flash-complete>strong{
  font-size:24px;
  color:#18253d;
}
.ref-flash-complete>span{
  max-width:560px;
  margin:8px 0 20px;
  color:#6e7890;
  line-height:1.5;
}
.ref-flash-complete-stats{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:center;
  margin-bottom:22px;
}
.ref-flash-complete-stats>div{
  min-width:155px;
  padding:13px 16px;
  border:1px solid #e0e5ef;
  border-radius:13px;
  background:#fff;
}
.ref-flash-complete-stats b,
.ref-flash-complete-stats small{
  display:block;
}
.ref-flash-complete-stats b{
  font-size:22px;
  color:#3f46cf;
}
.ref-flash-complete-stats small{
  margin-top:3px;
  color:#8791a4;
  font-size:11px;
}
.ref-flash-complete-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
}
@keyframes refFlashCompletePop{
  0%{opacity:0;transform:scale(.72)}
  70%{opacity:1;transform:scale(1.06)}
  100%{opacity:1;transform:scale(1)}
}
@media(max-width:680px){
  .ref-flash-complete{min-height:300px;padding:28px 18px}
  .ref-flash-complete>strong{font-size:21px}
  .ref-flash-complete-actions{width:100%}
  .ref-flash-complete-actions .btn{width:100%}
}
@media(prefers-reduced-motion:reduce){
  .ref-flash-complete,.ref-flash-complete-icon{animation:none!important;transition:none!important;transform:none!important}
}

/* Flashcard state visibility + compact completion v21 */
.ref-flash-stage[hidden],
.ref-flash-actions[hidden],
.ref-flash-hint[hidden],
.ref-flash-toolbar-v2[hidden],
.ref-flash-session[hidden]{
  display:none!important;
}

.ref-flash-complete{
  width:min(100%,560px);
  min-height:0!important;
  margin:28px auto 10px;
  padding:34px 30px!important;
  border-radius:18px;
  box-shadow:0 12px 30px rgba(35,52,88,.08);
}
.ref-flash-complete-icon{
  width:68px;
  height:68px;
  font-size:32px;
}
.ref-flash-complete-stats{
  margin-bottom:18px;
}
.ref-flash-complete-stats>div{
  min-width:145px;
}
.ref-flash-actions{
  transition:opacity 160ms ease,transform 160ms ease;
}
.ref-flash-actions:not([hidden]){
  animation:refFlashActionsIn 180ms ease both;
}
@keyframes refFlashActionsIn{
  from{opacity:0;transform:translateY(-4px)}
  to{opacity:1;transform:translateY(0)}
}
@media(max-width:680px){
  .ref-flash-complete{
    width:100%;
    margin:18px 0 6px;
    padding:28px 18px!important;
  }
}

/* =========================================================
   Reference Library — comprehensive mobile responsive v22
   ========================================================= */
@media (max-width:760px){

  /* Global safety inside Reference Library */
  .ref-library-hero,
  .ref-library-summary,
  .ref-library-exam-banner,
  .ref-chapter-card,
  .ref-lesson-shell,
  .ref-exam-builder,
  .ref-quiz-page,
  .ref-quiz-intro,
  .ref-quiz-run,
  .ref-quiz-result{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box;
  }
  .ref-library-hero *,
  .ref-chapter-card *,
  .ref-lesson-shell *,
  .ref-exam-builder *,
  .ref-quiz-page *{
    min-width:0;
  }

  /* Breadcrumbs: compact single-line scroll, no layout push */
  .ref-breadcrumb,
  .ref-quiz-breadcrumb{
    flex-wrap:nowrap!important;
    overflow-x:auto;
    overflow-y:hidden;
    white-space:nowrap;
    gap:6px!important;
    margin-bottom:10px!important;
    padding-bottom:4px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }
  .ref-breadcrumb::-webkit-scrollbar,
  .ref-quiz-breadcrumb::-webkit-scrollbar{display:none}
  .ref-breadcrumb,
  .ref-quiz-breadcrumb{font-size:11px!important}

  /* Library landing */
  .ref-library-hero{
    padding:18px!important;
    gap:14px!important;
    margin-bottom:12px!important;
  }
  .ref-library-hero h2{
    font-size:23px!important;
    line-height:1.18;
    overflow-wrap:anywhere;
  }
  .ref-library-hero p{font-size:12px!important;line-height:1.5}
  .ref-library-hero .ghost-btn{
    width:100%;
    text-align:center;
    box-sizing:border-box;
  }

  .ref-library-summary{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
    margin-bottom:12px!important;
  }
  .ref-library-summary>div{
    padding:10px 7px!important;
    text-align:center;
    border-radius:11px!important;
  }
  .ref-library-summary strong{font-size:17px!important}
  .ref-library-summary span{
    font-size:9px!important;
    line-height:1.2;
    overflow-wrap:anywhere;
  }

  .ref-library-exam-banner{
    grid-template-columns:44px minmax(0,1fr)!important;
    gap:12px!important;
    padding:15px!important;
    margin:12px 0 14px!important;
  }
  .ref-library-exam-banner-icon{
    width:44px!important;height:44px!important;
    border-radius:12px!important;
    font-size:20px!important;
  }
  .ref-library-exam-banner h3{font-size:16px!important;line-height:1.25}
  .ref-library-exam-banner p{font-size:11px!important;line-height:1.45}
  .ref-library-exam-banner .btn{
    grid-column:1/-1!important;
    width:100%!important;
    text-align:center!important;
    box-sizing:border-box;
  }

  .ref-chapter-list{gap:12px!important}
  .ref-chapter-card{
    padding:14px!important;
    border-radius:14px!important;
  }
  .ref-chapter-head{
    align-items:flex-start!important;
    margin-bottom:12px!important;
  }
  .ref-chapter-head h3{
    font-size:18px!important;
    line-height:1.25;
  }
  .ref-chapter-head .status{
    flex:0 0 auto;
    font-size:10px!important;
    padding:5px 7px!important;
  }
  .ref-lesson-grid{
    grid-template-columns:1fr!important;
    gap:9px!important;
  }
  .ref-lesson-card.ref-lesson-card-v2{
    min-height:94px!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    column-gap:11px!important;
    row-gap:5px!important;
    padding:13px 13px 12px 17px!important;
  }
  .ref-lesson-card-v2 .ref-lesson-card-icon{
    width:38px!important;height:38px!important;
    font-size:19px!important;
    grid-row:1 / span 2!important;
  }
  .ref-lesson-card-copy strong{font-size:14px!important}
  .ref-lesson-card-copy em{font-size:10px!important}
  .ref-lesson-card-open{
    grid-column:2!important;
    font-size:11px!important;
  }

  /* Lesson header + outline */
  .ref-lesson-head{
    padding:17px 16px!important;
    gap:12px!important;
  }
  .ref-lesson-head h2{
    font-size:22px!important;
    line-height:1.2;
    overflow-wrap:anywhere;
  }
  .ref-lesson-head .ghost-btn{
    width:100%;
    text-align:center;
    box-sizing:border-box;
  }

  .ref-outline-collapsible summary{
    padding:12px 16px!important;
    gap:8px!important;
  }
  .ref-outline-collapsible summary>span{
    gap:7px!important;
  }
  .ref-outline-collapsible summary b{font-size:12px!important}
  .ref-outline-collapsible summary small{font-size:10px!important}
  .ref-outline-collapsible summary em{font-size:10px!important}
  .ref-outline-collapsible .ref-concept-grid{
    grid-template-columns:1fr!important;
    padding:2px 16px 14px!important;
    gap:7px!important;
  }
  .ref-outline-item strong{
    font-size:12px!important;
    line-height:1.35;
  }
  .ref-outline-item>span{
    width:24px!important;height:24px!important;
    flex:0 0 24px!important;
    font-size:10px!important;
  }

  /* Resource tabs: one-row touch carousel */
  .ref-resource-tabs-v2{
    display:flex!important;
    grid-template-columns:none!important;
    gap:8px!important;
    padding:11px 14px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x proximity;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }
  .ref-resource-tabs-v2::-webkit-scrollbar{display:none}
  .ref-resource-tabs-v2 a{
    flex:0 0 148px!important;
    min-height:56px!important;
    grid-template-columns:34px minmax(0,1fr)!important;
    gap:8px!important;
    padding:9px 9px 9px 11px!important;
    scroll-snap-align:start;
  }
  .ref-resource-tabs-v2 a>span{
    width:32px!important;height:32px!important;
    font-size:15px!important;
  }
  .ref-resource-tabs-v2 a strong{font-size:11px!important}
  .ref-resource-tabs-v2 a small{
    display:block!important;
    font-size:8.5px!important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .ref-lesson-shell .ref-resource-content-v2{
    padding:15px!important;
    overflow:hidden;
  }

  /* Theory / summary */
  .ref-study-copy{
    font-size:14px!important;
    line-height:1.65!important;
    overflow-wrap:anywhere;
  }
  .ref-study-copy h1{font-size:22px!important}
  .ref-study-copy h2{font-size:20px!important;line-height:1.25}
  .ref-study-copy h3{font-size:17px!important;line-height:1.3}
  .ref-study-copy img,
  .ref-study-copy video,
  .ref-study-copy iframe{
    max-width:100%!important;
    height:auto;
  }
  .ref-study-copy pre,
  .ref-study-copy .ref-math-block{
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  .ref-callout{
    grid-template-columns:28px minmax(0,1fr)!important;
    gap:9px!important;
    padding:12px!important;
    margin:13px 0!important;
  }

  /* Knowledge cards */
  .ref-knowledge-card-grid{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  .ref-knowledge-card{border-radius:14px!important}
  .ref-knowledge-card-body{font-size:13px!important;line-height:1.55}

  /* Flashcards */
  .ref-flash-toolbar-v2{
    grid-template-columns:1fr!important;
    gap:9px!important;
    margin-bottom:12px!important;
  }
  .ref-flash-progress-head{
    flex-direction:row!important;
    align-items:center!important;
    gap:8px!important;
  }
  .ref-flash-progress-head strong{font-size:11px!important}
  .ref-flash-progress-head span{font-size:10px!important}
  .ref-flash-stats{margin-top:7px!important;gap:6px!important}
  .ref-flash-stats span{font-size:9px!important;padding:4px 7px!important}
  .ref-flash-toolbar-v2 .ref-flash-mini-btn{
    justify-self:end!important;
    min-height:36px;
    font-size:11px;
  }
  .ref-flash-stage{
    grid-template-columns:34px minmax(0,1fr) 34px!important;
    gap:5px!important;
    align-items:center!important;
  }
  .ref-flash-nav{
    width:34px!important;height:34px!important;
    font-size:22px!important;
    z-index:4;
  }
  .ref-flash-deck{
    width:100%!important;
    min-width:0!important;
  }
  .ref-flash-card3d{
    width:100%!important;
    height:clamp(340px,58vh,460px)!important;
    max-height:62vh;
  }
  .ref-flash-face{
    padding:20px 17px!important;
  }
  .ref-flash-main{
    font-size:20px!important;
    line-height:1.35!important;
  }
  .ref-flash-label{font-size:10px!important}
  .ref-flash-face small{font-size:10px!important}
  .ref-flash-hint{
    font-size:9px!important;
    line-height:1.4;
    padding-inline:8px;
    text-align:center;
  }
  .ref-flash-actions{
    gap:8px!important;
    flex-wrap:wrap;
  }
  .ref-flash-actions button{
    flex:1 1 135px;
    min-height:42px;
  }
  .ref-flash-complete{
    width:100%!important;
    margin:12px 0 0!important;
    padding:25px 15px!important;
  }
  .ref-flash-complete-icon{
    width:58px!important;height:58px!important;
    font-size:27px!important;
  }
  .ref-flash-complete>strong{font-size:20px!important}
  .ref-flash-complete>span{font-size:12px!important}
  .ref-flash-complete-stats{
    width:100%;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px!important;
  }
  .ref-flash-complete-stats>div{
    min-width:0!important;
    padding:11px 8px!important;
  }
  .ref-flash-complete-actions{
    width:100%;
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  .ref-flash-complete-actions .btn{width:100%!important}

  /* Exercises / empty / Library Test launch */
  .ref-empty-resource{
    min-height:190px!important;
    padding:25px 15px!important;
    margin:0!important;
  }
  .ref-library-test-launch{
    grid-template-columns:46px minmax(0,1fr)!important;
    gap:12px!important;
    padding:15px!important;
  }
  .ref-library-test-launch-icon{
    width:46px!important;height:46px!important;
    border-radius:13px!important;
    font-size:22px!important;
  }
  .ref-library-test-launch-copy h3{font-size:17px!important}
  .ref-library-test-launch-copy p{font-size:11px!important;line-height:1.4}
  .ref-library-test-launch-copy small{font-size:10px!important;line-height:1.35}
  .ref-library-test-start{
    grid-column:1/-1!important;
    width:100%!important;
    text-align:center!important;
    box-sizing:border-box;
  }

  /* Library quiz/test pages */
  .ref-quiz-page{
    width:100%!important;
    margin:0 auto 20px!important;
  }
  .ref-quiz-welcome{
    grid-template-columns:1fr!important;
    gap:15px!important;
    padding:17px!important;
    border-radius:15px!important;
  }
  .ref-quiz-welcome-icon{
    width:50px!important;height:50px!important;
    border-radius:14px!important;
    font-size:23px!important;
  }
  .ref-quiz-welcome-copy h2{
    font-size:22px!important;
    line-height:1.2;
    overflow-wrap:anywhere;
  }
  .ref-quiz-welcome-copy>p{
    font-size:12px!important;
    margin-bottom:12px!important;
  }
  .ref-quiz-welcome-stats{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px!important;
  }
  .ref-quiz-welcome-stats span{
    min-width:0!important;
    padding:8px 6px!important;
    text-align:center;
  }
  .ref-quiz-welcome-stats b{font-size:15px!important}
  .ref-quiz-welcome-stats small{font-size:9px!important}
  .ref-quiz-welcome-rules{
    padding:14px 0 0!important;
  }
  .ref-quiz-welcome-rules>strong{font-size:14px!important}
  .ref-quiz-welcome-rules ul{
    padding-left:18px!important;
    font-size:12px!important;
    line-height:1.45;
  }
  .ref-quiz-welcome-rules .ref-quiz-start{
    width:100%!important;
    min-height:44px;
  }
  .ref-quiz-scope{
    padding:11px!important;
  }
  .ref-quiz-scope-list{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  .ref-quiz-scope-list>span{
    min-width:0!important;
  }

  .ref-quiz-run{
    padding-top:14px!important;
    width:100%!important;
  }
  .ref-quiz-status{
    margin:0 0 12px!important;
  }
  .ref-quiz-question{
    border-radius:15px!important;
  }
  .ref-quiz-question-head{
    padding:14px 14px 6px!important;
    align-items:flex-start!important;
    flex-direction:column;
    gap:4px!important;
  }
  .ref-quiz-question-text{
    padding:0 14px 7px!important;
    font-size:14px!important;
    line-height:1.5;
  }
  .ref-quiz-options{
    padding:10px 14px 14px!important;
    gap:8px!important;
  }
  .ref-quiz-option{
    min-height:48px!important;
    padding:11px 12px!important;
    font-size:13px!important;
    line-height:1.35;
  }
  .ref-quiz-matching,
  .ref-quiz-fill{
    padding-left:14px!important;
    padding-right:14px!important;
  }
  .ref-quiz-matching label,
  .ref-quiz-fill label{
    grid-template-columns:1fr!important;
    gap:6px!important;
  }
  .ref-quiz-matching label>b{display:none!important}
  .ref-quiz-matching select,
  .ref-quiz-fill input,
  .ref-quiz-open-selfcheck textarea{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box;
    font-size:16px!important; /* prevent iOS zoom */
  }
  .ref-quiz-open-selfcheck{
    padding:10px 14px!important;
  }
  .ref-quiz-think{padding:11px!important}
  .ref-open-self-buttons{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  .ref-open-self-buttons button{width:100%!important}
  .ref-quiz-actions{
    padding:11px 14px!important;
    gap:8px!important;
    bottom:0;
    padding-bottom:max(11px,env(safe-area-inset-bottom))!important;
  }
  .ref-quiz-actions .btn{min-height:42px}
  .ref-quiz-result{
    margin-top:20px!important;
    padding:25px 15px!important;
  }
  .ref-quiz-result h2{font-size:31px!important}
  .ref-quiz-review{
    max-width:100%!important;
  }
  .ref-quiz-review-item{
    grid-template-columns:28px minmax(0,1fr)!important;
    gap:9px!important;
    padding:11px!important;
  }

  /* Exam builder */
  .ref-exam-builder{
    margin:0 auto 22px!important;
    border-radius:15px!important;
  }
  .ref-exam-builder-head{
    padding:16px!important;
    gap:12px!important;
    align-items:flex-start!important;
  }
  .ref-exam-builder-icon{
    width:46px!important;height:46px!important;
    border-radius:13px!important;
    font-size:21px!important;
    flex:0 0 46px;
  }
  .ref-exam-builder-head h2{font-size:21px!important}
  .ref-exam-builder-head p{font-size:11px!important;line-height:1.45}
  .ref-exam-chapters{
    gap:10px!important;
    padding:13px!important;
  }
  .ref-exam-chapter{
    border-radius:12px!important;
  }
  .ref-exam-chapter-head{
    padding:11px!important;
    align-items:flex-start!important;
  }
  .ref-exam-chapter-head label{
    align-items:flex-start!important;
    line-height:1.35;
  }
  .ref-exam-chapter-head strong{font-size:13px!important}
  .ref-exam-chapter-head span{font-size:9px!important}
  .ref-exam-lessons{
    grid-template-columns:1fr!important;
    gap:7px!important;
    padding:9px!important;
  }
  .ref-exam-lessons label{
    padding:10px!important;
    font-size:12px!important;
    line-height:1.35;
  }
  .ref-exam-size{
    padding:15px!important;
    gap:12px!important;
  }
  .ref-exam-size-options{
    width:100%;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .ref-exam-size-options label,
  .ref-exam-size-options span{
    width:100%!important;
    min-width:0!important;
    box-sizing:border-box;
  }
  .ref-exam-builder-footer{
    padding:13px!important;
    gap:9px!important;
  }
  .ref-exam-builder-footer .btn{
    width:100%!important;
    min-height:44px;
  }

  /* Touch targets */
  .ref-outline-help,
  .ref-outline-chevron{
    min-width:24px!important;
    min-height:24px!important;
  }
  .ref-outline-popover{
    max-width:calc(100vw - 28px)!important;
    font-size:12px!important;
  }
}

@media (max-width:430px){
  .ref-library-hero h2,
  .ref-lesson-head h2{font-size:21px!important}

  .ref-library-summary span{font-size:8px!important}
  .ref-chapter-head h3{font-size:17px!important}

  .ref-resource-tabs-v2 a{
    flex-basis:138px!important;
  }

  .ref-flash-card3d{
    height:clamp(310px,54vh,405px)!important;
  }
  .ref-flash-main{font-size:18px!important}
  .ref-flash-stage{
    grid-template-columns:30px minmax(0,1fr) 30px!important;
    gap:3px!important;
  }
  .ref-flash-nav{
    width:30px!important;height:30px!important;
  }

  .ref-quiz-welcome-stats span{padding:7px 4px!important}
  .ref-quiz-welcome-stats b{font-size:14px!important}

  .ref-exam-size-options span{
    padding:9px 7px!important;
  }
}

/* Landscape phones: avoid overly tall flashcards */
@media (max-width:900px) and (orientation:landscape){
  .ref-flash-card3d{
    height:min(68vh,390px)!important;
  }
}

/* =========================================================
   Mobile header + Reference compact pass v23
   ========================================================= */
@media (max-width:760px){

  /* Top sticky header: keep long lesson/subject names on one clean line */
  .student-area .topbar{
    height:64px!important;
    min-height:64px!important;
    padding:0 14px!important;
    gap:10px!important;
  }
  .student-area .topbar>div{
    min-width:0!important;
    overflow:hidden!important;
  }
  .student-area .topbar-title{
    min-width:0!important;
    width:100%!important;
    display:block!important;
  }
  .student-area .topbar h1{
    display:block!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    font-size:20px!important;
    line-height:1.15!important;
    letter-spacing:-.025em!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .student-area .menu-btn{
    flex:0 0 auto;
  }
  .student-area .topbar .ghost-btn,
  .student-area .topbar>a:last-child{
    flex:0 0 auto;
  }

  /* Subject page: compact Library promo */
  .student-area .ref-library-promo{
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    column-gap:11px!important;
    row-gap:10px!important;
    align-items:center!important;
    padding:14px!important;
    margin-top:12px!important;
    border-radius:15px!important;
  }
  .student-area .ref-library-promo-icon{
    width:40px!important;
    height:40px!important;
    border-radius:11px!important;
    font-size:20px!important;
    align-self:start!important;
  }
  .student-area .ref-library-promo-copy{
    min-width:0!important;
  }
  .student-area .ref-library-promo .eyebrow{
    font-size:9px!important;
    line-height:1.1!important;
    letter-spacing:.055em!important;
    margin:0 0 3px!important;
  }
  .student-area .ref-library-promo-copy h3{
    margin:0 0 3px!important;
    font-size:16px!important;
    line-height:1.18!important;
  }
  .student-area .ref-library-promo-copy p{
    margin:0!important;
    font-size:10.5px!important;
    line-height:1.35!important;
    display:-webkit-box!important;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden!important;
  }
  .student-area .ref-library-promo-actions{
    grid-column:1/-1!important;
    width:100%!important;
    display:block!important;
  }
  .student-area .ref-library-promo .ref-library-open-btn{
    width:100%!important;
    min-height:38px!important;
    padding:8px 12px!important;
    box-sizing:border-box!important;
    text-align:center!important;
    font-size:12px!important;
  }

  /* Library lesson heading: much shorter vertical footprint */
  .student-area .ref-lesson-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    column-gap:10px!important;
    row-gap:0!important;
    padding:14px 15px!important;
  }
  .student-area .ref-lesson-head>div{
    min-width:0!important;
  }
  .student-area .ref-lesson-head .eyebrow{
    font-size:9px!important;
    line-height:1.1!important;
    letter-spacing:.055em!important;
    margin:0 0 4px!important;
  }
  .student-area .ref-lesson-head h2{
    margin:0!important;
    font-size:20px!important;
    line-height:1.16!important;
    letter-spacing:-.025em!important;
    overflow-wrap:anywhere;
  }
  .student-area .ref-lesson-head .ghost-btn{
    width:auto!important;
    min-height:36px!important;
    padding:8px 10px!important;
    font-size:10.5px!important;
    line-height:1.1!important;
    white-space:nowrap!important;
    align-self:center!important;
  }

  /* Slightly tighten lesson page top spacing */
  .student-area .ref-breadcrumb{
    margin-bottom:8px!important;
  }
  .student-area .ref-lesson-shell{
    border-radius:15px!important;
  }
}

/* Very small phones: protect title area from crowding */
@media (max-width:410px){
  .student-area .topbar h1{
    font-size:18px!important;
  }
  .student-area .ref-lesson-head{
    grid-template-columns:1fr!important;
    row-gap:9px!important;
  }
  .student-area .ref-lesson-head .ghost-btn{
    justify-self:start!important;
    width:auto!important;
  }
  .student-area .ref-lesson-head h2{
    font-size:19px!important;
  }
}

/* =========================================================
   Mobile Reference lesson header + Flashcards fix v24
   ========================================================= */
@media (max-width:760px){

  /* Lesson header: breadcrumb already provides context/back navigation */
  .student-area .ref-lesson-head{
    display:block!important;
    padding:11px 14px 12px!important;
    min-height:0!important;
  }
  .student-area .ref-lesson-head .eyebrow{
    display:none!important;
  }
  .student-area .ref-lesson-head .ghost-btn{
    display:none!important;
  }
  .student-area .ref-lesson-head h2{
    margin:0!important;
    font-size:19px!important;
    line-height:1.18!important;
    letter-spacing:-.02em!important;
    display:-webkit-box!important;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden!important;
  }

  /* Tighter breadcrumb above lesson */
  .student-area .ref-breadcrumb{
    margin:0 0 7px!important;
    padding-bottom:2px!important;
    font-size:10.5px!important;
  }

  /* Flashcards: robust full-width mobile layout */
  .student-area .ref-lesson-shell .ref-resource-content-v2{
    padding:12px!important;
  }
  .student-area .ref-flash-study{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:visible!important;
  }
  .student-area .ref-flash-toolbar-v2{
    display:grid!important;
    grid-template-columns:1fr auto!important;
    column-gap:8px!important;
    row-gap:8px!important;
    width:100%!important;
    margin:0 0 12px!important;
  }
  .student-area .ref-flash-progress-block{
    grid-column:1/-1!important;
    min-width:0!important;
  }
  .student-area .ref-flash-toolbar-v2 .ref-flash-mini-btn{
    grid-column:1/-1!important;
    justify-self:end!important;
    margin:0!important;
    min-height:34px!important;
    padding:7px 10px!important;
    font-size:10.5px!important;
  }

  /* Do not use desktop 3-column stage on phones */
  .student-area .ref-flash-stage{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    position:relative!important;
  }
  .student-area .ref-flash-nav{
    display:none!important;
  }
  .student-area .ref-flash-deck{
    position:relative!important;
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:360px!important;
    min-height:360px!important;
    perspective:1100px!important;
    box-sizing:border-box!important;
  }
  .student-area .ref-flash-deck:before,
  .student-area .ref-flash-deck:after{
    box-sizing:border-box!important;
  }
  .student-area .ref-flash-card3d{
    position:absolute!important;
    inset:0!important;
    left:0!important;
    right:0!important;
    top:0!important;
    bottom:0!important;
    width:auto!important;
    max-width:none!important;
    height:360px!important;
    min-height:360px!important;
    max-height:none!important;
    box-sizing:border-box!important;
  }
  .student-area .ref-flash-card3d-inner{
    width:100%!important;
    height:360px!important;
    min-height:360px!important;
    box-sizing:border-box!important;
  }
  .student-area .ref-flash-face{
    inset:0!important;
    width:100%!important;
    height:100%!important;
    box-sizing:border-box!important;
    padding:18px 16px!important;
    border-radius:16px!important;
  }
  .student-area .ref-flash-main{
    width:100%!important;
    max-width:100%!important;
    padding:0 8px!important;
    box-sizing:border-box!important;
    font-size:18px!important;
    line-height:1.35!important;
    overflow-wrap:anywhere!important;
  }
  .student-area .ref-flash-label{
    left:16px!important;
    top:16px!important;
    font-size:9.5px!important;
    padding:5px 8px!important;
  }
  .student-area .ref-flash-face>small{
    bottom:17px!important;
    max-width:calc(100% - 30px)!important;
    text-align:center!important;
    font-size:9.5px!important;
  }
  .student-area .ref-flash-hint{
    margin:12px 0 8px!important;
  }
  .student-area .ref-flash-actions{
    position:static!important;
    width:100%!important;
    margin-top:8px!important;
  }
}

@media (max-width:430px){
  .student-area .ref-lesson-head h2{
    font-size:18px!important;
  }
  .student-area .ref-flash-deck,
  .student-area .ref-flash-card3d,
  .student-area .ref-flash-card3d-inner{
    height:330px!important;
    min-height:330px!important;
  }
  .student-area .ref-flash-main{
    font-size:17px!important;
  }
}

/* =========================================================
   Mobile Library landing compact v25
   ========================================================= */
@media (max-width:760px){

  /* Hero: identify subject, then get out of the way */
  .student-area .ref-library-hero{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    column-gap:10px!important;
    row-gap:5px!important;
    padding:13px 14px!important;
    margin-bottom:9px!important;
    border-radius:14px!important;
  }
  .student-area .ref-library-hero>div{
    min-width:0!important;
  }
  .student-area .ref-library-hero .eyebrow{
    display:none!important;
  }
  .student-area .ref-library-hero h2{
    margin:0!important;
    font-size:20px!important;
    line-height:1.15!important;
    letter-spacing:-.02em!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .student-area .ref-library-hero p{
    grid-column:1/-1!important;
    margin:2px 0 0!important;
    font-size:10.5px!important;
    line-height:1.35!important;
    color:#7a8599!important;
    display:-webkit-box!important;
    -webkit-line-clamp:1;
    -webkit-box-orient:vertical;
    overflow:hidden!important;
  }
  .student-area .ref-library-hero .ghost-btn{
    width:auto!important;
    min-height:32px!important;
    padding:6px 9px!important;
    font-size:0!important;
    border-radius:10px!important;
  }
  .student-area .ref-library-hero .ghost-btn::after{
    content:"←";
    font-size:18px;
    line-height:1;
  }

  /* Stats become a light compact strip, not three large cards */
  .student-area .ref-library-summary{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:1px!important;
    margin:0 0 9px!important;
    border:1px solid #e1e6ef!important;
    border-radius:12px!important;
    overflow:hidden!important;
    background:#e1e6ef!important;
  }
  .student-area .ref-library-summary>div{
    min-height:48px!important;
    padding:7px 4px!important;
    border:0!important;
    border-radius:0!important;
    background:#fff!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    align-items:center!important;
  }
  .student-area .ref-library-summary strong{
    font-size:16px!important;
    line-height:1!important;
  }
  .student-area .ref-library-summary span{
    margin-top:4px!important;
    font-size:8.5px!important;
    line-height:1.05!important;
    white-space:nowrap!important;
  }

  /* Exam: one compact action card */
  .student-area .ref-library-exam-banner{
    display:grid!important;
    grid-template-columns:36px minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:9px!important;
    padding:10px 11px!important;
    margin:0 0 11px!important;
    border-radius:13px!important;
  }
  .student-area .ref-library-exam-banner-icon{
    width:36px!important;
    height:36px!important;
    border-radius:10px!important;
    font-size:17px!important;
  }
  .student-area .ref-library-exam-banner .eyebrow{
    display:none!important;
  }
  .student-area .ref-library-exam-banner h3{
    margin:0!important;
    font-size:13px!important;
    line-height:1.2!important;
  }
  .student-area .ref-library-exam-banner p{
    display:none!important;
  }
  .student-area .ref-library-exam-banner .btn{
    grid-column:auto!important;
    width:36px!important;
    height:36px!important;
    min-height:36px!important;
    padding:0!important;
    border-radius:10px!important;
    font-size:0!important;
    display:grid!important;
    place-items:center!important;
  }
  .student-area .ref-library-exam-banner .btn::after{
    content:"→";
    font-size:18px;
    font-weight:900;
  }

  /* Chapters and lessons: higher information density */
  .student-area .ref-chapter-list{
    gap:10px!important;
  }
  .student-area .ref-chapter-card{
    padding:12px!important;
  }
  .student-area .ref-chapter-head{
    margin-bottom:9px!important;
    align-items:center!important;
  }
  .student-area .ref-chapter-head .eyebrow{
    font-size:8.5px!important;
    margin-bottom:2px!important;
  }
  .student-area .ref-chapter-head h3{
    margin:0!important;
    font-size:17px!important;
    line-height:1.18!important;
  }
  .student-area .ref-chapter-head .status{
    font-size:9px!important;
    padding:4px 6px!important;
  }
  .student-area .ref-lesson-grid{
    gap:7px!important;
  }
  .student-area .ref-lesson-card.ref-lesson-card-v2{
    min-height:76px!important;
    grid-template-columns:34px minmax(0,1fr) auto!important;
    grid-template-rows:1fr!important;
    align-items:center!important;
    column-gap:9px!important;
    row-gap:0!important;
    padding:10px 10px 10px 14px!important;
  }
  .student-area .ref-lesson-card-v2 .ref-lesson-card-icon{
    width:32px!important;
    height:32px!important;
    font-size:15px!important;
    grid-row:auto!important;
  }
  .student-area .ref-lesson-card-copy strong{
    font-size:13px!important;
    line-height:1.25!important;
  }
  .student-area .ref-lesson-card-copy em{
    display:none!important;
  }
  .student-area .ref-lesson-card-open{
    grid-column:auto!important;
    font-size:0!important;
    align-self:center!important;
  }
  .student-area .ref-lesson-card-open::after{
    content:"›";
    font-size:21px;
    color:#6b63e8;
    font-weight:700;
  }
}

@media (max-width:410px){
  .student-area .ref-library-hero h2{font-size:19px!important}
  .student-area .ref-library-summary span{font-size:8px!important}
  .student-area .ref-library-exam-banner h3{font-size:12.5px!important}
}

/* =========================================================
   Mobile Library landing correction v26
   ========================================================= */
@media (max-width:760px){

  /* Stats are not useful enough on mobile landing */
  .student-area .ref-library-summary{
    display:none!important;
  }

  /* Restore previous richer lesson cards */
  .student-area .ref-lesson-grid{
    grid-template-columns:1fr!important;
    gap:9px!important;
  }
  .student-area .ref-lesson-card.ref-lesson-card-v2{
    min-height:94px!important;
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    align-items:center!important;
    column-gap:11px!important;
    row-gap:5px!important;
    padding:13px 13px 12px 17px!important;
  }
  .student-area .ref-lesson-card-v2 .ref-lesson-card-icon{
    width:38px!important;
    height:38px!important;
    font-size:19px!important;
    grid-row:1 / span 2!important;
  }
  .student-area .ref-lesson-card-copy strong{
    font-size:14px!important;
    line-height:1.3!important;
  }
  .student-area .ref-lesson-card-copy em{
    display:block!important;
    font-size:10px!important;
    line-height:1.2!important;
    margin-top:2px!important;
  }
  .student-area .ref-lesson-card-open{
    grid-column:2!important;
    align-self:end!important;
    font-size:11px!important;
    line-height:1.2!important;
  }
  .student-area .ref-lesson-card-open::after{
    content:none!important;
  }
}

/* =========================================================
   Resource labels + mobile selector v30
   ========================================================= */
@media (max-width:760px){
  .student-area .ref-resource-tabs-v2{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
    padding:9px 10px!important;
    overflow:visible!important;
    scroll-snap-type:none!important;
  }
  .student-area .ref-resource-tabs-v2 a{
    width:100%!important;
    min-width:0!important;
    min-height:66px!important;
    flex:none!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    padding:8px 5px!important;
    text-align:center!important;
    border-radius:11px!important;
  }
  .student-area .ref-resource-tabs-v2 a:before{
    left:0!important;
    right:0!important;
    top:auto!important;
    bottom:0!important;
    width:auto!important;
    height:3px!important;
  }
  .student-area .ref-resource-tabs-v2 a>span{
    width:30px!important;
    height:30px!important;
    flex:0 0 30px!important;
    font-size:15px!important;
    border-radius:9px!important;
  }
  .student-area .ref-resource-tabs-v2 a>div{
    width:100%!important;
  }
  .student-area .ref-resource-tabs-v2 a strong{
    display:block!important;
    width:100%!important;
    font-size:10px!important;
    line-height:1.15!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  .student-area .ref-resource-tabs-v2 a small{
    display:none!important;
  }
}
@media (max-width:380px){
  .student-area .ref-resource-tabs-v2{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .student-area .ref-resource-tabs-v2 a{
    min-height:60px!important;
  }
}

/* Mobile resource tiles horizontal compact v31 */
@media (max-width:760px){
  .student-area .ref-resource-tabs-v2 a{
    min-height:54px!important;
    display:grid!important;
    grid-template-columns:30px minmax(0,1fr)!important;
    grid-template-rows:1fr!important;
    align-items:center!important;
    justify-content:stretch!important;
    gap:8px!important;
    padding:8px 9px!important;
    text-align:left!important;
  }
  .student-area .ref-resource-tabs-v2 a>span{
    width:28px!important;
    height:28px!important;
    flex:0 0 28px!important;
    font-size:14px!important;
    border-radius:8px!important;
  }
  .student-area .ref-resource-tabs-v2 a>div{
    width:auto!important;
    min-width:0!important;
  }
  .student-area .ref-resource-tabs-v2 a strong{
    text-align:left!important;
    font-size:10.5px!important;
    line-height:1.15!important;
  }
}
@media (max-width:380px){
  .student-area .ref-resource-tabs-v2 a{
    min-height:52px!important;
  }
}

/* Mini Quiz readability fixes v34 */
.ref-quiz-page .ref-check-btn{
  background:linear-gradient(135deg,#5b5cf0,#2f91e8)!important;
  border-color:transparent!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-weight:800!important;
  opacity:1!important;
  text-shadow:none!important;
}
.ref-quiz-page .ref-check-btn:hover,
.ref-quiz-page .ref-check-btn:focus-visible{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
.ref-quiz-question-text{
  overflow-wrap:anywhere;
}

/* Mini Quiz wording/render polish v35 */
.ref-quiz-page .ref-open-reveal,
.ref-quiz-page .ref-check-btn{
  background:linear-gradient(135deg,#5b5cf0,#2f91e8)!important;
  border:0!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  opacity:1!important;
  font-weight:800!important;
  text-shadow:none!important;
  box-shadow:0 7px 18px rgba(66,93,218,.18)!important;
}
.ref-quiz-page .ref-open-reveal:hover,
.ref-quiz-page .ref-open-reveal:focus-visible,
.ref-quiz-page .ref-check-btn:hover,
.ref-quiz-page .ref-check-btn:focus-visible{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  filter:brightness(.98);
}
.ref-quiz-matching label>span,
.ref-quiz-option{
  white-space:normal;
  overflow-wrap:anywhere;
}

/* Mini Quiz launch scope + direct start v36 */
.ref-mini-quiz-scope{
  margin:5px 0 6px;
  font-size:12px;
  line-height:1.45;
  color:#667085;
}
.ref-mini-quiz-scope strong{
  color:#344054;
}
.ref-mini-quiz-scope span{
  color:#667085;
}
@media(max-width:760px){
  .ref-mini-quiz-scope{font-size:11px}
}

/* Geometry Reference Library SVG labels: keep text independent of shape strokes */
.ref-resource-content-v2 figure svg text,
.ref-resource-content-v2 figure svg tspan {
  stroke: none !important;
  stroke-width: 0 !important;
  paint-order: normal;
  fill: #172554;
  font-family: Arial, sans-serif;
  font-weight: 500;
  text-shadow: none;
}
@media (max-width: 760px) {
  .ref-resource-content-v2 figure svg { max-width: 100%; height: auto; }
}


/* Reference Library responsive semantic Markdown tables */
.ref-table-scroll{width:100%;max-width:100%;overflow-x:auto;margin:16px 0 22px;border:1px solid #dce2ec;border-radius:12px;background:#fff}
.ref-study-table{width:100%;border-collapse:collapse;font-size:14px;line-height:1.55;color:#25324a}
.ref-study-table th,.ref-study-table td{padding:12px 15px;text-align:left;vertical-align:top;overflow-wrap:anywhere;border-bottom:1px solid #e4e8f0}
.ref-study-table th{font-weight:750;background:#f3f5fb;color:#24334e}
.ref-study-table tbody tr:nth-child(even){background:#fafbfe}
.ref-study-table tbody tr:last-child td{border-bottom:0}
.ref-study-table th:not(:last-child),.ref-study-table td:not(:last-child){border-right:1px solid #edf0f5}
@media(max-width:680px){.ref-table-scroll{margin:12px 0 18px}.ref-study-table{font-size:13px;line-height:1.45}.ref-study-table th,.ref-study-table td{padding:10px 11px}.ref-study-table:has(tr>:nth-child(3)){min-width:520px}}

/* Accessible Practice Quiz explanation — hover, keyboard and tap */
.lesson-practice-form,.subject-latest-actions form:has(.lesson-practice-help){display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.lesson-practice-help{position:relative;display:inline-flex;align-items:center;flex:0 0 auto}
.lesson-practice-help summary{list-style:none;display:grid;place-items:center;width:23px;height:23px;border:1px solid #aab6cc;border-radius:50%;background:#f5f7fc;color:#53627e;font-weight:800;font-size:13px;cursor:help;user-select:none}
.lesson-practice-help summary::-webkit-details-marker{display:none}
.lesson-practice-help summary:focus-visible{outline:2px solid #655cf0;outline-offset:3px}
.lesson-practice-help-popover{display:none;position:absolute;z-index:100;right:0;bottom:calc(100% + 9px);width:min(295px,calc(100vw - 42px));padding:11px 13px;border:1px solid #d6deed;border-radius:11px;background:#fff;color:#34425c;font-size:12px;font-weight:500;line-height:1.5;box-shadow:0 9px 25px rgba(28,42,70,.18);white-space:normal}
.lesson-practice-help[open] .lesson-practice-help-popover,.lesson-practice-help:hover .lesson-practice-help-popover,.lesson-practice-help:focus-within .lesson-practice-help-popover{display:block}

/* Mobile touch targets for Reference Library outline hints */
.ref-outline-help{touch-action:manipulation;-webkit-tap-highlight-color:transparent;cursor:pointer}
@media(hover:none){.ref-outline-popover{pointer-events:auto}}

/* Unified Reference Library landing and lesson mobile UX v37 */
.ref-library-quick-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap}
.ref-library-quick-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:10px 14px;background:#fff;border:1px solid #d6deec;border-radius:12px;color:#37455e;text-decoration:none;font:inherit;font-size:13px;font-weight:750;cursor:pointer;white-space:nowrap}
.ref-library-quick-btn:hover,.ref-library-quick-btn:focus-visible{background:#f3f5ff;border-color:#989cf1}
.ref-library-quick-exam{background:linear-gradient(110deg,#6260ec,#398ce9);color:#fff;border-color:transparent;box-shadow:0 5px 13px rgba(75,100,228,.15)}
.ref-library-quick-exam:hover,.ref-library-quick-exam:focus-visible{color:#fff;background:linear-gradient(110deg,#5652df,#2f7ed9)}
.ref-action-mobile{display:none}
.ref-search-card[hidden]{display:none!important}
.ref-library-hero>div:first-child,.ref-lesson-head>div:first-child{min-width:0;flex:1}
.ref-lesson-head h2{overflow-wrap:break-word;word-break:normal;hyphens:auto}
@media(max-width:760px){
 .student-area:has(.ref-library-hero) .topbar-title,
 .student-area:has(.ref-lesson-shell) .topbar-title{display:none!important}
 .student-area:has(.ref-library-hero) .topbar,
 .student-area:has(.ref-lesson-shell) .topbar{justify-content:space-between}
 .student-area .ref-breadcrumb{display:flex;align-items:center;min-width:0;gap:7px;white-space:normal;margin-bottom:9px;font-size:12px}
 .student-area .ref-lesson-breadcrumb>a:first-child,
 .student-area .ref-lesson-breadcrumb>span,
 .student-area .ref-lesson-breadcrumb>strong,
 .student-area .ref-lesson-breadcrumb>a:not(.ref-crumb-library){display:none!important}
 .student-area .ref-lesson-breadcrumb .ref-crumb-library{display:inline-block;max-width:100%;overflow-wrap:anywhere;font-size:0}
 .student-area .ref-lesson-breadcrumb .ref-crumb-library:before{content:"← Πίσω στη " ;font-size:12px}
 .student-area .ref-lesson-breadcrumb .ref-crumb-library:after{content:attr(data-mobile-label);font-size:12px}
 .student-area .ref-lesson-head{padding:16px!important;gap:12px!important}
 .student-area .ref-lesson-head h2{font-size:clamp(20px,5.7vw,24px)!important;line-height:1.27!important;font-weight:700!important;margin:3px 0 0!important;overflow-wrap:break-word;word-break:normal}
 .student-area .ref-lesson-head .eyebrow{font-size:10px}
 .student-area .ref-lesson-head-actions{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr) minmax(0,1fr)!important;width:100%;gap:7px}
 .student-area .ref-lesson-library-btn,.student-area .ref-lesson-nav-btn{min-width:0;min-height:44px;padding:8px!important;font-size:12px;text-align:center}
 .student-area .ref-lesson-library-btn>span:last-child{font-size:0;line-height:1.15}
 .student-area .ref-lesson-library-btn>span:last-child:after{content:"Βιβλιοθήκη";font-size:12px}
 .student-area .ref-resource-tabs-v2{gap:6px!important;padding:9px!important}
 .student-area .ref-resource-tabs-v2 a{min-height:48px!important;padding:6px 8px!important}
 .student-area .ref-library-hero{padding:16px!important;gap:12px!important}
 .student-area .ref-library-hero h2{font-size:clamp(19px,5.4vw,24px)!important;line-height:1.24!important;overflow-wrap:break-word;word-break:normal;margin:4px 0!important}
 .student-area .ref-library-hero p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:12px;line-height:1.4;margin:3px 0 0}
 .student-area .ref-library-quick-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:8px}
 .student-area .ref-library-quick-btn{min-width:0;padding:9px 7px;font-size:12px;min-height:46px;white-space:normal}
 .student-area .ref-action-desktop{display:none}
 .student-area .ref-action-mobile{display:inline}
 .student-area .ref-chapter-card{padding:14px!important}
 .student-area:has(.ref-library-hero) .content,
 .student-area:has(.ref-lesson-shell) .content{padding-bottom:calc(110px + env(safe-area-inset-bottom,0px))}
}

/* Reference Library layout corrections v38: scoped to Reference pages */
.student-area:has(.ref-exam-builder) .content{max-width:1340px!important;width:100%;box-sizing:border-box}
.student-area .ref-exam-builder{max-width:none!important;width:100%!important;margin:0 0 36px!important}
.student-area .ref-lesson-head{align-items:center}
.student-area .ref-lesson-head h2{margin:0!important;font-size:clamp(21px,1.65vw,26px)!important;line-height:1.25!important}
.student-area .ref-lesson-head>div:first-child{min-width:0}
@media(max-width:760px){
 /* Keep logout right, never let a flex item stretch across the topbar */
 .student-area:has(.ref-library-hero) .topbar,
 .student-area:has(.ref-lesson-shell) .topbar{display:flex!important;align-items:center!important;justify-content:space-between!important}
 .student-area:has(.ref-library-hero) .topbar .mobile-top-actions,
 .student-area:has(.ref-lesson-shell) .topbar .mobile-top-actions{flex:0 0 auto!important;width:auto!important;min-width:0}
 .student-area:has(.ref-library-hero) .topbar .top-logout,
 .student-area:has(.ref-lesson-shell) .topbar .top-logout{flex:0 0 auto!important;width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;padding:8px!important;margin-left:auto!important;display:inline-flex!important}
 .student-area:has(.ref-library-hero) .topbar .top-logout span,
 .student-area:has(.ref-lesson-shell) .topbar .top-logout span{display:none!important}
 /* Override older two-column library header and avoid title truncation */
 .student-area .ref-library-hero{display:flex!important;flex-direction:column!important;align-items:stretch!important;grid-template-columns:none!important;gap:13px!important;padding:17px!important}
 .student-area .ref-library-hero>div:first-child{display:block!important;width:100%!important;min-width:0!important;max-width:none!important}
 .student-area .ref-library-hero h2{display:block!important;width:100%!important;max-width:none!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;font-size:clamp(20px,5.5vw,24px)!important;line-height:1.3!important;overflow-wrap:normal!important;word-break:normal!important}
 .student-area .ref-library-hero .ref-library-quick-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;max-width:none!important;grid-column:1/-1!important}
 /* Headline and controls remain two separate rows, with breathing room */
 .student-area .ref-lesson-head{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:18px!important;padding:19px 16px!important}
 .student-area .ref-lesson-head>div:first-child{width:100%!important;flex:none!important}
 .student-area .ref-lesson-head h2{font-size:clamp(20px,5vw,23px)!important;line-height:1.34!important;margin:0!important;font-weight:700!important;hyphens:none!important;overflow-wrap:normal!important;word-break:normal!important}
 .student-area .ref-lesson-head-actions{margin-top:0!important;display:grid!important;width:100%!important;grid-template-columns:minmax(0,1.35fr) repeat(2,minmax(0,1fr))!important}
 .student-area:has(.ref-exam-builder) .content{padding-left:14px!important;padding-right:14px!important}
 .student-area:has(.ref-exam-builder) .ref-exam-builder{width:100%!important;max-width:none!important}
}

/* Reference Library topbar: no repeated lesson heading (desktop) */
@media(min-width:761px){
 .student-area:has(.ref-lesson-shell) .topbar-title h1{font-size:19px!important}
}

/* Reference Library structural responsive QA v39: explicit page scope, no :has() dependency */
@media(max-width:760px){
 body.student-area.reference-landing-page .topbar,
 body.student-area.reference-lesson-page .topbar,
 body.student-area.reference-exam-page .topbar{
   display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;
 }
 body.student-area.reference-landing-page .topbar .topbar-title,
 body.student-area.reference-lesson-page .topbar .topbar-title,
 body.student-area.reference-exam-page .topbar .topbar-title{display:none!important;flex:0!important}
 body.student-area.reference-landing-page .topbar .mobile-top-actions,
 body.student-area.reference-lesson-page .topbar .mobile-top-actions,
 body.student-area.reference-exam-page .topbar .mobile-top-actions{
   display:flex!important;flex:0 0 auto!important;width:auto!important;max-width:fit-content!important;overflow:visible!important
 }
 body.student-area.reference-landing-page .topbar>a.top-logout,
 body.student-area.reference-lesson-page .topbar>a.top-logout,
 body.student-area.reference-exam-page .topbar>a.top-logout{
   display:inline-flex!important;flex:0 0 44px!important;width:44px!important;min-width:44px!important;max-width:44px!important;
   height:44px!important;min-height:44px!important;margin:0 0 0 auto!important;padding:9px!important;align-items:center!important;justify-content:center!important
 }
 body.student-area.reference-landing-page .topbar>a.top-logout span,
 body.student-area.reference-lesson-page .topbar>a.top-logout span,
 body.student-area.reference-exam-page .topbar>a.top-logout span{display:none!important}
 body.student-area.reference-landing-page .ref-library-hero{
   display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;
   width:100%!important;grid-template-columns:none!important;gap:14px!important
 }
 body.student-area.reference-landing-page .ref-library-hero>div:first-child{
   display:grid!important;grid-template-columns:52px minmax(0,1fr)!important;grid-template-rows:auto!important;
   align-items:center!important;column-gap:12px!important;
   flex:0 0 auto!important;width:100%!important;min-width:0!important;max-width:100%!important;
 }
 body.student-area.reference-landing-page .ref-library-hero .ref-library-brand-icon{
   grid-column:1!important;grid-row:1!important;min-width:52px!important;width:52px!important;height:52px!important;
 }
 body.student-area.reference-landing-page .ref-library-hero .ref-library-brand-copy{
   grid-column:2!important;grid-row:1!important;min-width:0!important;width:auto!important;
 }
 body.student-area.reference-landing-page .ref-library-hero h2{
   display:block!important;max-width:100%!important;white-space:normal!important;text-overflow:clip!important;
   overflow:visible!important;word-break:normal!important;overflow-wrap:break-word!important;line-height:1.3!important
 }
 body.student-area.reference-landing-page .ref-library-hero .ref-library-quick-actions{
   display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-column:auto!important;
   width:100%!important;justify-self:stretch!important
 }
 body.student-area.reference-lesson-page .ref-lesson-head{
   display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:19px!important
 }
 body.student-area.reference-lesson-page .ref-lesson-head>div:first-child{
   display:block!important;flex:0 0 auto!important;width:100%!important;max-width:100%!important;
 }
 body.student-area.reference-lesson-page .ref-lesson-head h2{
   display:block!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
   -webkit-line-clamp:unset!important;-webkit-box-orient:initial!important;hyphens:none!important;
   font-size:clamp(19px,5vw,22px)!important;line-height:1.38!important;letter-spacing:-.015em!important;
   overflow-wrap:break-word!important;word-break:normal!important;margin:0!important
 }
 body.student-area.reference-lesson-page .ref-lesson-head-actions{width:100%!important;margin:0!important}
 body.student-area.reference-exam-page .content{width:100%!important;max-width:1340px!important}
 body.student-area.reference-exam-page .ref-exam-builder{width:100%!important;max-width:none!important;margin-inline:0!important}
}
@media(min-width:761px){
 body.student-area.reference-exam-page .ref-exam-builder{width:100%!important;max-width:none!important;margin-inline:0!important}
}

/* Align exercise numbers with the opening question text across all libraries */
.student-area .ref-lesson-shell .ref-exercise{align-items:start}
.student-area .ref-lesson-shell .ref-exercise-num{
  align-self:start;
  margin-top:7px;
  flex-shrink:0;
}
.student-area .ref-lesson-shell .ref-exercise-main{min-width:0}
.student-area .ref-lesson-shell .ref-exercise-main>.ref-study-copy>p:first-child{margin-top:0}
@media(max-width:760px){.student-area .ref-lesson-shell .ref-exercise-num{margin-top:3px}}

/* Quiz & Progress panel: consistent left accent with lesson panels */
.subject-quiz-progress.card{border-left:4px solid #605cf4!important;}


/* SLA school library: compact desktop presentation and restrained, responsive card motion. */
.sla-home .sla-grade{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  transform:translateY(0);
  transition:transform .26s cubic-bezier(.2,.75,.25,1), box-shadow .26s ease, border-color .26s ease, background-color .26s ease;
}
.sla-home .sla-grade::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background:linear-gradient(125deg,rgba(255,255,255,0) 25%,rgba(106,102,248,.075) 100%);
  opacity:0;
  transition:opacity .3s ease;
  pointer-events:none;
}
.sla-home .sla-grade-bubble{
  transition:transform .3s cubic-bezier(.18,.85,.25,1),box-shadow .3s ease;
}
.sla-home .sla-grade-arrow{
  display:inline-block;
  transition:transform .24s ease,color .24s ease;
}
@media(hover:hover) and (pointer:fine){
  .sla-home .sla-grade:hover{
    transform:translateY(-5px) rotate(-.35deg);
    border-color:#bcbafe;
    box-shadow:0 14px 29px rgba(47,65,144,.14);
  }
  .sla-home .sla-grade:hover::before{opacity:1}
  .sla-home .sla-grade:hover .sla-grade-bubble{
    transform:translateY(-3px) rotate(7deg) scale(1.08);
    box-shadow:0 8px 15px rgba(48,68,123,.14);
  }
  .sla-home .sla-grade:hover .sla-grade-arrow{transform:translateX(5px)}
}
.sla-home .sla-grade:focus-visible{
  outline:3px solid #605cf4;
  outline-offset:3px;
  border-color:#7772fb;
}
@media(min-width:1181px) and (min-height:700px){
  .sla-home{gap:11px;padding-bottom:8px}
  .sla-home .sla-dashboard{padding:17px 23px;border-radius:20px}
  .sla-home .sla-top{gap:15px}
  .sla-home .sla-kicker{margin-bottom:4px;font-size:10px}
  .sla-home .sla-heading{font-size:29px;margin-bottom:4px}
  .sla-home .sla-heading span{font-size:17px;margin-top:5px}
  .sla-home .sla-intro{font-size:12px;line-height:1.45;margin-top:7px}
  .sla-home .sla-stat{min-height:85px;padding:10px 12px;gap:3px;border-radius:13px}
  .sla-home .sla-stat-icon{width:25px;height:25px;font-size:15px}
  .sla-home .sla-stat-number{font-size:21px}
  .sla-home .sla-stat-label{font-size:11px}
  .sla-home .sla-tools{margin-top:12px;gap:12px}
  .sla-home .sla-search{height:40px}
  .sla-home .sla-filters{padding:3px}
  .sla-home .sla-filter{min-height:31px;padding:6px 12px}
  .sla-home .sla-stage{padding:11px 15px 12px;border-radius:17px}
  .sla-home .sla-stage-header{margin-bottom:9px;gap:10px}
  .sla-home .sla-stage-icon{width:35px;height:35px;font-size:19px;border-radius:10px}
  .sla-home .sla-stage-title{font-size:17px}
  .sla-home .sla-stage-description{font-size:11px;margin-top:1px}
  .sla-home .sla-stage-total{font-size:11px}
  .sla-home .sla-grade-grid{gap:10px}
  .sla-home .sla-grade{min-height:66px;padding:10px 12px;gap:10px;border-radius:12px}
  .sla-home .sla-grade-bubble{width:40px;height:40px;font-size:19px}
  .sla-home .sla-grade-text{gap:3px}
  .sla-home .sla-grade-name{font-size:12px}
  .sla-home .sla-grade-count{font-size:11px}
  .sla-home .sla-grade-arrow{font-size:21px}
}
@media(prefers-reduced-motion:reduce){
  .sla-home .sla-grade,.sla-home .sla-grade-bubble,.sla-home .sla-grade-arrow,.sla-home .sla-grade::before{transition:none!important}
  .sla-home .sla-grade:hover,.sla-home .sla-grade:hover .sla-grade-bubble{transform:none!important}
}

/* SLA library entry alongside StudyCraft — desktop sidebar only */
.student-area .sidebar-tools.student-game-link{display:grid;gap:9px;min-width:0}
.student-area .sla-sidebar-card{background:linear-gradient(115deg,#304d91,#315eac)!important;border:1px solid rgba(145,185,255,.35)!important;box-shadow:0 5px 15px rgba(11,32,81,.17);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.student-area .sla-sidebar-card .tool-card-icon{color:#b8d9ff!important}
.student-area .sla-sidebar-card small,.student-area .sla-sidebar-card b{color:#dbe9ff!important}
.student-area .sla-sidebar-card:hover,.student-area .sla-sidebar-card.is-active{background:linear-gradient(115deg,#3d62bf,#327ac9)!important;border-color:rgba(199,223,255,.7)!important;box-shadow:0 8px 18px rgba(24,63,131,.26)}
@media(hover:hover) and (prefers-reduced-motion:no-preference){.student-area .sla-sidebar-card:hover{transform:translateY(-2px)}}
@media(prefers-reduced-motion:reduce){.student-area .sla-sidebar-card{transition:none}}
