:root{
  --accent:#7255ae;
  --accent-dark:#533985;
  --accent-soft:#f1ecfa;
  --line:#e9e5e2;
  color:#27313f;
  background:#fbfaf9;
}
body{background:#fbfaf9;color:#27313f}
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.primary{background:var(--accent);border-color:var(--accent);font-weight:650}
.primary:hover{background:var(--accent-dark);border-color:var(--accent-dark)}
.top{
  height:62px;
  justify-content:flex-start;
  gap:12px;
  padding:0 24px;
  background:#fff;
  border-bottom:1px solid var(--line);
}
.brand{flex:none;margin-right:auto;font-size:19px;line-height:1.1;white-space:nowrap}
.brand strong{font-weight:800;letter-spacing:-.025em}
.brand strong span{color:var(--accent)}
#entry-home{font-size:13px}
#app-menu-toggle,#topbar-actions,#study-breadcrumb{display:none}
#global-search{display:none;position:relative;min-width:0;width:100%}
.search-field{display:flex;align-items:center;gap:9px;height:40px;padding:0 13px;border:1px solid #e8e3ee;border-radius:11px;background:#f8f6fa;color:#79668f}
.search-field:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px #7255ae20}
.search-field input{width:100%;height:100%;padding:0;border:0;outline:0;background:transparent;font-size:14px}
.search-field input::placeholder{color:#857c90}
#study-search-results{position:absolute;top:calc(100% + 7px);left:0;right:0;z-index:60;max-height:min(450px,65vh);overflow:auto;padding:7px;border:1px solid var(--line);border-radius:13px;background:#fff;box-shadow:0 18px 42px #28203824}
#study-search-results button{display:grid;gap:3px;width:100%;padding:10px 12px;border:0;border-radius:8px;background:transparent;text-align:left;font-size:14px}
#study-search-results button:hover,#study-search-results button:focus-visible{background:var(--accent-soft)}
#study-search-results button strong{font-size:14px;font-weight:650}
#study-search-results button span{color:#746d7d;font-size:12px}
#study-search-results .search-empty{margin:0;padding:13px;color:#746d7d;font-size:13px}
#app-menu-toggle{
  flex:none;place-items:center;
  width:44px;height:44px;padding:9px;
  border:0;background:transparent;
}
#app-menu-toggle svg{display:block}
#topbar-actions{align-items:center;gap:8px;margin-left:auto}
#topbar-actions>button,#topbar-actions>a{
  display:grid;place-items:center;width:44px;height:44px;padding:0;
  border:0;border-radius:10px;background:transparent;color:#596575;
}
#topbar-actions>button:hover,#topbar-actions>a:hover,#account-menu summary:hover{background:#f6f3f9}
#account-menu{position:relative}
#account-menu summary{
  display:grid;place-items:center;width:44px;height:44px;padding:3px;
  border-radius:10px;cursor:pointer;list-style:none;
}
#account-menu summary::-webkit-details-marker{display:none}
#account-menu summary span{
  display:grid;place-items:center;width:34px;height:34px;
  border-radius:50%;background:#eeeaf3;color:#645978;
  font-size:12px;font-weight:700;
}
.account-popover{
  position:absolute;top:calc(100% + 8px);right:0;z-index:60;
  display:grid;gap:4px;width:210px;padding:10px;
  border:1px solid var(--line);border-radius:12px;
  background:#fff;box-shadow:0 14px 35px #2820381c;
}
.account-popover strong{padding:8px 9px;font-size:13px}
.account-popover a,.account-popover button{
  display:block;width:100%;padding:10px;text-align:left;
  border:0;border-radius:7px;background:transparent;
  color:#27313f;font-size:13px;
}
.account-popover a:hover,.account-popover button:hover{background:var(--accent-soft);text-decoration:none}
body.study-active>.top{position:sticky;top:0;z-index:40;display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,430px) minmax(0,1fr);gap:16px;margin-left:88px}
body.study-active>.top .brand{display:flex;margin:0}
body.study-active #entry-home{display:none}
body.study-active #global-search{display:block;grid-column:2}
body.study-active #topbar-actions{display:flex;grid-column:3;justify-self:end;margin:0}
body.study-active>main{max-width:none;margin-left:88px;padding:0}
body.study-active #workspace>.shell{display:block}
body.study-active .rail{
  position:fixed;inset:0 auto 0 0;z-index:41;
  display:flex;flex-direction:column;gap:0;
  width:88px;height:100dvh;min-height:0;
  padding:14px 7px max(12px,env(safe-area-inset-bottom));
  border-right:1px solid var(--line);
  background:#f8f7f5;
}
.rail-brand{display:flex;justify-content:center;align-items:center;min-height:58px;margin-bottom:12px}
.rail-brand img{display:block;width:36px;height:36px}
#rail-close{display:none}
.rail-sections{display:grid;align-content:start;gap:6px;min-height:0;overflow-y:auto;scrollbar-width:thin}
.rail-sections button,.rail-bottom a{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:7px;width:100%;min-height:72px;padding:8px 3px;
  border:0;border-radius:12px;background:transparent;color:#27313f;
  font-size:11.5px;font-weight:500;line-height:1.25;
  text-align:center;text-decoration:none;
}
.rail-sections button span,.rail-bottom a span{max-width:100%;overflow-wrap:normal}
.rail-sections svg,.rail-bottom svg{display:block;width:23px;height:23px;flex:none}
.rail-sections button:hover,.rail-bottom a:hover{background:#f1eeeb;text-decoration:none}
.rail-sections button[aria-current=page]{background:var(--accent-soft);color:var(--accent-dark)}
.rail-bottom{
  display:grid;gap:3px;flex:none;margin-top:12px;padding-top:10px;
  border-top:1px solid var(--line);
}
.rail-bottom a{min-height:62px;padding:7px 2px}
body.study-active .content{min-width:0;padding:22px 24px 36px}
body.study-active .heading{margin-bottom:20px;align-items:flex-end}
body.study-active .heading h1{font-size:28px;line-height:1.2}
.study-heading-actions{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.study-heading-actions label{gap:4px;color:#68717d;font-size:12px}
.study-heading-actions select{min-width:185px;max-width:min(300px,45vw);min-height:42px;padding:8px 11px}
.study-heading-actions #create{min-height:42px}
body.study-active .card,body.study-active .panel,body:not(.study-active) .study-entry{
  border-color:var(--line);box-shadow:0 4px 18px #49382805;
}
body.study-active .card,body.study-active .panel{border-radius:16px}
body.study-active .tag{background:var(--accent-soft);color:var(--accent-dark)}
body.study-active .tag.late{background:#fff0f1;color:#a12d3c}
body.study-active .row{border-bottom-color:#f0ece8}
body.study-active .row:hover{background:#fcfafc}
body.study-active progress{accent-color:var(--accent)}
body.study-active #notice:not(:empty){
  position:fixed;right:24px;bottom:20px;z-index:70;
  max-width:min(400px,calc(100vw - 48px));margin:0;
  padding:13px 16px;border:1px solid #eed6da;border-radius:9px;
  background:#fff;color:#8a2635;box-shadow:0 8px 25px #27313f18;
}
#study-backdrop{display:none}
#loading{background:#fbfaf9}
#loading::after{background:linear-gradient(90deg,var(--accent) 0 38%,#e6e0ee 38% 100%);background-size:210% 100%}
@media (min-width:761px) and (max-width:900px){
  body.study-active>.top .brand{gap:8px;font-size:16px}
  body.study-active>.top .brand img{width:32px;height:32px}
}
@media(max-width:760px){
  body.study-active>.top{grid-template-columns:44px minmax(0,1fr) auto;grid-template-rows:54px 48px;height:102px;column-gap:7px;row-gap:0;margin-left:0;padding:0 10px 6px}
  body.study-active #app-menu-toggle{display:grid;grid-column:1;grid-row:1}
  body.study-active>.top .brand{grid-column:2;grid-row:1;font-size:16px}
  body.study-active>.top .brand img{width:30px;height:30px}
  body.study-active #global-search{grid-column:1/-1;grid-row:2;width:100%}
  body.study-active #topbar-actions{grid-column:3;grid-row:1;gap:0}
  body.study-active #topbar-actions>a,body.study-active #topbar-actions>button{width:38px;height:38px}
  body.study-active #account-menu summary{width:38px;height:38px}
  body.study-active>main{margin-left:0}
  body.study-active .rail{
    width:80px;padding:8px 6px max(10px,env(safe-area-inset-bottom));
    visibility:hidden;transform:translateX(-100%);
    transition:transform .2s ease,visibility .2s ease;
    box-shadow:8px 0 30px #27313f24;
  }
  body.study-active.menu-open{overflow:hidden}
  body.study-active.menu-open .rail{visibility:visible;transform:translateX(0)}
  .rail-brand{display:none}
  #rail-close{
    display:grid;place-items:center;align-self:center;
    flex:none;width:44px;height:44px;min-height:44px;
    margin:0 0 8px;padding:0;border:0;background:transparent;
  }
  #rail-close img{width:32px;height:32px}
  .rail-sections{gap:4px}
  .rail-sections button{min-height:68px;font-size:10.5px}
  .rail-bottom a{min-height:57px;font-size:10.5px}
  body.study-active.menu-open #study-backdrop{
    display:block;position:fixed;inset:0;z-index:40;
    width:100%;height:100dvh;padding:0;border:0;border-radius:0;
    background:#27313f66;backdrop-filter:blur(2px);
  }
  body.study-active .content{padding:20px 16px 30px}
  body.study-active .heading{align-items:start;gap:14px}
  .study-heading-actions{width:100%}
  .study-heading-actions label{flex:1;min-width:150px}
  .study-heading-actions select{width:100%;max-width:none}
}
@media(max-width:600px){
  body.study-active .cards{grid-template-columns:1fr}
  body.study-active .card{padding:17px}
  body.study-active .heading h1{font-size:24px}
  body.study-active .content .panel{padding:18px}
}
@media(max-width:390px){
  body.study-active #notice-link{display:none}
  .study-heading-actions #create{width:100%}
}
@media(prefers-reduced-motion:reduce){
  body.study-active .rail{transition:none}
}
.academic-filter{max-width:260px;margin:18px 0}#academic-grade-fields{display:grid;gap:16px}#academic-numeric{margin-top:8px}#learner-subjects .row p,#academic-records .row p{margin:5px 0}#academic-records .row>strong{color:var(--accent)}
.academic-check{display:flex;align-items:center;gap:10px}.academic-check input{width:18px;height:18px;accent-color:var(--accent)}
