*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--fs-sm)/1.45 var(--font); background: var(--bg); color: var(--ink); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--s-2); font-weight: 600; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--fs-lg); letter-spacing: 0; } h2 { font-size: 1.125rem; } h3 { font-size: var(--fs); }
p { margin: 0 0 var(--s-4); } a { color: var(--brand-text); text-underline-offset: 3px; }
.muted { color: var(--ink-2); } .small { font-size: var(--fs-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 20px; height: 20px; } svg.i.xs { width: 16px; height: 16px; }

/* Buttons: pills, as designed */
.btn, button { font: 500 var(--fs-sm)/1 var(--font); min-height: var(--tap); padding: 0 var(--s-5); border-radius: var(--radius-pill); border: 1px solid transparent;
  background: var(--brand); color: var(--on-brand); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  text-decoration: none; transition: background var(--dur), transform var(--dur) var(--ease); }
.btn:hover, button:hover { background: var(--brand-hover); }
.btn:active, button:active { transform: translateY(1px); }
.btn-secondary, .btn-outline { background: var(--surface); color: var(--brand-text); border-color: var(--brand); } .btn-secondary:hover, .btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--brand-text); } .btn-ghost:hover { background: var(--surface-2); }
.btn-accent { background: var(--accent); color: var(--on-accent); } .btn-accent:hover { background: #d97614; }
.btn-danger { background: var(--danger); color: #fff; } .btn-block { width: 100%; }
.btn.big, button.big { min-height: 48px; padding: 0 var(--s-6); }

/* Forms: pill fields with bold labels */
label { display: block; font-weight: 600; font-size: var(--fs-sm); color: var(--ink); margin: var(--s-4) 0 var(--s-2); }
input, select, textarea { font: 400 var(--fs-sm) var(--font); width: 100%; min-height: 48px; padding: 0 20px; border: 1px solid var(--border-input); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); }
textarea { border-radius: 20px; padding: 14px 20px; min-height: 96px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type=checkbox], input[type=radio] { width: 20px; min-height: 20px; height: 20px; padding: 0; accent-color: var(--brand); }
input[type=file] { padding: 12px 20px; height: auto; }
.hint { font-size: var(--fs-xs); color: var(--ink-2); margin: var(--s-1) 0 0 var(--s-2); }
.err { color: var(--danger); font-weight: 500; font-size: var(--fs-xs); margin: var(--s-2) 0 0 var(--s-2); }
label.tap { display: grid; place-items: center; min-width: var(--tap); min-height: var(--tap); margin: 0; cursor: pointer; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s-5); }
.card.soft { border: 0; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* Stat card: icon tile, big number, grey label */
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 19px 20px; min-height: 147px; display: flex; flex-direction: column; gap: 17px; }
.stat .tile { width: 41px; height: 36px; border-radius: 5px; display: grid; place-items: center; background: var(--tile-lavender); color: var(--brand); }
.stat .tile.pink { background: var(--tile-pink); color: var(--pink); } .stat .tile.peach { background: var(--tile-peach); color: var(--orange); }
.stat .n { font-size: var(--fs-xl); font-weight: 600; line-height: 1.45; color: var(--ink); } .stat .l { font-size: var(--fs); color: var(--ink-2); line-height: 1.45; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 500; background: var(--surface-2); color: var(--ink); }
.badge.ok { background: var(--success-bg); color: var(--success); } .badge.warn { background: var(--warning-bg); color: var(--warning); }
.badge.bad { background: var(--danger-bg); color: var(--danger); } .badge.info { background: var(--brand-soft); color: var(--brand-text); }
.alert { border-radius: var(--radius); padding: var(--s-3) var(--s-4); display: flex; gap: var(--s-3); margin-bottom: var(--s-3); font-size: var(--fs-sm); }
.alert.ok { background: var(--success-bg); color: var(--success); } .alert.warn { background: var(--warning-bg); color: var(--warning); }
.alert.bad { background: var(--danger-bg); color: var(--danger); } .alert.info { background: var(--brand-soft); color: var(--brand-text); }
.progress { height: 8px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width var(--dur) var(--ease); }

/* Tables: light grey header band, airy rows */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); vertical-align: middle; }
thead th { background: var(--surface-2); color: var(--ink); font-weight: 500; font-size: var(--fs-sm); border-bottom: 0; }
.card.table-wrap, .table-card { padding: 0; box-shadow: var(--shadow); border: 0; overflow-x: auto; }
.table-card table th:first-child, .table-card table td:first-child { padding-left: 20px; }
tbody tr:hover { background: var(--surface-2); }
td .who { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--tile-pink); color: var(--brand-text); display: inline-grid; place-items: center; font-weight: 600; font-size: .7rem; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: .9rem; } .avatar.xl { width: 80px; height: 80px; font-size: 1.5rem; }

/* Page heading row, as in the lists */
.page-head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-5); }
.page-head h1 { text-transform: uppercase; font-size: var(--fs-lg); font-weight: 600; margin: 0; letter-spacing: 0; }
.page-head .count { color: var(--brand-text); font-weight: 600; font-size: var(--fs-lg); }
.page-head .push { margin-left: auto; }
.filter-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-input); border-radius: var(--radius-pill); padding: 0 12px 0 14px; min-height: 36px; color: var(--ink-2); background: var(--surface); font-size: var(--fs-xs); font-weight: 500; text-decoration: none; }
.filter-pill.on { border-color: var(--brand); color: var(--brand-text); background: var(--surface-2); }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-weight: 500; margin-bottom: var(--s-3); }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s-5); color: var(--ink-2); font-size: var(--fs-xs); }
.pager a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.pager .next { color: var(--brand-text); font-weight: 500; }
.pager .nums { display: flex; gap: 6px; } .pager .nums a, .pager .nums span { min-width: 25px; height: 25px; border-radius: 4px; display: inline-grid; place-items: center; padding: 0 6px; }
.pager .nums .on { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

/* Empty state: rings and a folder, as designed */
.empty { text-align: center; padding: 56px 0; }
.empty .rings { width: 200px; height: 200px; margin: 0 auto 8px; border-radius: 50%; border: 1px solid rgba(193, 199, 208, .4); display: grid; place-items: center; position: relative; }
.empty .rings::before, .empty .rings::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(193, 199, 208, .5); }
.empty .rings::before { inset: 22px; } .empty .rings::after { inset: 46px; }
.empty .rings svg { width: 86px; height: 86px; color: var(--ink); position: relative; z-index: 1; stroke-width: 1.4; }
.empty p { font-size: var(--fs-xl); font-weight: 500; color: var(--ink); margin: 0; }
.empty .sub { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 6px; font-weight: 400; }

/* Student rewards */
.streak, .xp { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; padding: 4px 12px; border-radius: var(--radius-pill); }
.streak { background: var(--streak); color: var(--on-streak); } .xp { background: var(--xp); color: var(--on-xp); }

/* Sign-in and other pages before sign-in. From the Figma "sign up" frames: logo and round back button on top,
   the teacher photo in a rounded card with glass squares and a glass caption, the form on the right. */
.auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.auth-top { display: flex; justify-content: space-between; align-items: center; min-height: 124px; padding: 0 clamp(20px, 13.8vw, 199px); }
.back-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; text-decoration: none; transition: transform .3s var(--ease), background .2s; }
.back-btn:hover { transform: scale(1.08); background: var(--brand); } .back-btn .i { width: 20px; height: 20px; }
.auth-body { flex: 1; display: grid; grid-template-columns: minmax(0, 510px) minmax(0, 404px); gap: clamp(32px, 8.4vw, 121px); justify-content: center; align-items: center; padding: 0 20px 60px; }
.auth-visual { position: relative; height: 621px; border-radius: 20px; overflow: hidden; background: var(--brand); box-shadow: 0 20px 60px rgba(28, 32, 64, .12); }
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .28), rgba(102, 102, 102, 0) 40%); }
.auth-visual .pane { position: absolute; z-index: 1; backdrop-filter: blur(9.5px); -webkit-backdrop-filter: blur(9.5px); background: rgba(0, 0, 0, .04); border: 2px solid rgba(227, 227, 227, .3); }
.pane.p1 { left: 19px; top: 19px; width: 76px; height: 76px; border-top-left-radius: 9px; } .pane.p2 { left: 46px; top: 215px; width: 76px; height: 76px; } .pane.p3 { left: 30px; top: 197px; width: 38px; height: 38px; }
.auth-visual .glass { position: absolute; z-index: 1; left: 19px; right: 19px; bottom: 22px; padding: 22px 20px; border-radius: 12px; background: rgba(0, 0, 0, .05); backdrop-filter: blur(9.5px); -webkit-backdrop-filter: blur(9.5px); border: 2px solid rgba(227, 227, 227, .1); color: #fff; }
.auth-visual .glass strong { display: block; font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; } .auth-visual .glass span { font-size: 1rem; line-height: 1.45; }
.auth-form { width: 100%; max-width: 404px; }
.auth-form.wide { max-width: 404px; }
.auth-form h1 { font-size: 2rem; font-weight: 600; line-height: 1.45; margin: 0; text-transform: none; }
.auth-form .alt { color: var(--ink-2); font-size: var(--fs-sm); margin: 0 0 28px; } .auth-form a.orange, .orange { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-form button[type=submit] { width: 100%; margin-top: 28px; min-height: 48px; font-size: 1rem; }
.auth-form .links { margin-top: 14px; font-size: var(--fs-sm); color: var(--ink-2); }
.round-btn { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%; background: var(--navy); color: #fff; }
@media (max-width: 980px) { .auth-body { grid-template-columns: minmax(0, 440px); } .auth-visual { display: none; } .auth-top { min-height: 84px; } .auth-form { margin: 0 auto; } }

/* role picker (Figma "Role picker") */
.roles-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 8px; }
.role-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 12px 22px; border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--ink); text-align: center;
  transition: border-color .25s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease); }
.role-card:hover, .role-card:focus-visible { border-color: var(--brand); box-shadow: 0 14px 40px rgba(61, 53, 140, .14); transform: translateY(-3px); }
.role-card .i { width: 34px; height: 34px; margin-bottom: 14px; } .role-card strong { font-size: 1.05rem; font-weight: 600; } .role-card span { color: var(--ink-2); font-size: var(--fs-sm); }
.auth-form .picked { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--brand); font-weight: 600; margin-bottom: 6px; }

/* Logo wordmark: Tech in navy, scholar in orange */
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.logo svg { width: 28px; height: 30px; } .logo .w1 { color: var(--ink); } .logo .w2 { color: var(--accent); }
.sidebar .logo .w1 { color: #fff; }

/* App shell */
.shell { min-height: 100vh; display: grid; grid-template-columns: clamp(232px, 20.5vw, 296px) minmax(0, 1fr); }
.sidebar { background: var(--sidebar); color: var(--on-sidebar); padding: 24px 32px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding-bottom: 56px; }
.nav { display: flex; flex-direction: column; gap: 8px; }
.nav a, .sidebar .side-foot a, .sidebar .side-foot button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 8px; color: inherit; text-decoration: none; font: 500 14px/20px var(--font); letter-spacing: -.02em; background: transparent; border: 0; width: 100%; justify-content: flex-start; }
.nav a:hover, .sidebar .side-foot a:hover, .sidebar .side-foot button:hover { background: rgba(255, 255, 255, .1); }
.nav a[aria-current=page] { background: var(--sidebar-active); color: var(--on-sidebar-active); border-radius: var(--radius-pill); }
.sidebar .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 24px; }
.sidebar .side-foot .logout { color: var(--accent); }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 20px; min-height: 81px; padding: 0 32px; border-bottom: 1px solid var(--border-soft); background: var(--surface); }
.topbar .lead { margin-right: auto; display: flex; align-items: center; gap: 10px; }
.pill-select { position: relative; }
.pill-select summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 134px; height: 42px; padding: 0 20px; border: 1px solid var(--border-input); border-radius: var(--radius-pill); color: var(--ink-2); font-weight: 500; font-size: var(--fs-sm); background: var(--surface); }
.pill-select summary::-webkit-details-marker { display: none; }
.pill-select .menu-pop { position: absolute; right: 0; top: 48px; background: var(--surface); border-radius: 12px; box-shadow: 0 8px 30px rgba(28, 32, 64, .15); min-width: 200px; padding: 8px; z-index: 30; border: 1px solid var(--border); }
.pill-select .menu-pop a, .pill-select .menu-pop button { display: flex; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink); background: transparent; border: 0; justify-content: flex-start; text-decoration: none; font-weight: 500; }
.pill-select .menu-pop a:hover, .pill-select .menu-pop button:hover { background: var(--surface-2); }
.pill-select .menu-pop .cur { color: var(--brand-text); }
.icon-btn { background: transparent; border: 0; color: var(--ink); min-height: 40px; width: 40px; padding: 0; border-radius: 50%; position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.who-block { display: flex; align-items: center; gap: 12px; } .who-block .t { text-align: right; line-height: 1.25; } .who-block .t b { display: block; font-weight: 500; color: var(--ink); font-size: var(--fs-sm); } .who-block .t span { font-size: 10px; letter-spacing: .04em; color: var(--ink-2); text-transform: capitalize; }
.main { padding: 24px 32px 48px; max-width: 1280px; width: 100%; min-width: 0; }
.main.narrow { max-width: 760px; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 24px; align-items: start; }
@media (max-width: 1180px) { .layout-2 { grid-template-columns: 1fr; } }

/* To-do cards */
.todos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-4); margin: 8px 0 var(--s-4); }
.todo { min-height: 120px; border-radius: 10px; padding: 14px 14px 12px; color: #fff; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.todo b { font-weight: 500; font-size: var(--fs-xs); line-height: 1.45; padding-left: 0; display: block; }
.todo .line { height: 2px; background: rgba(255, 255, 255, .4); border-radius: 2px; margin: 10px 0 8px; position: relative; } .todo .line i { position: absolute; inset: 0 auto 0 0; background: #fff; border-radius: 2px; }
.todo .go { color: #1c2040; width: 16px; height: 16px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--navy); }
.todo .go svg { width: 10px; height: 10px; stroke-width: 2.4; }
.todo:hover { filter: brightness(1.06); }
.c-blue { background: var(--blue); } .c-pink { background: var(--pink); } .c-navy { background: var(--navy); } .c-orange { background: var(--orange); } .c-brand { background: var(--brand); } .c-green { background: var(--green); }

/* Calendar and events */
.cal { padding: 32px 36px; }
.cal .head { display: flex; align-items: center; justify-content: center; position: relative; font-weight: 700; font-size: var(--fs); color: var(--ink); margin-bottom: 24px; }
.cal .head .arrows { position: absolute; right: 0; display: flex; gap: 14px; color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 6px; text-align: center; font-weight: 500; font-size: var(--fs); color: var(--ink-2); }
.cal-grid .wd { color: var(--ink); padding-bottom: 8px; } .cal-grid .d { height: 38px; display: grid; place-items: center; }
.cal-grid .today { background: var(--brand); color: #fff; border-radius: 50%; width: 38px; margin: 0 auto; }
.cal-grid .mark { position: relative; } .cal-grid .mark::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.events { margin-top: 24px; } .events h2 { font-size: var(--fs-lg); padding: 4px 4px 12px; }
.event { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.event .pillx { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: var(--fs-xs); font-weight: 500; padding: 3px 12px; border-radius: var(--radius-pill); margin-bottom: 10px; }
.event .when { text-align: right; line-height: 1.2; } .event .when b { display: block; font-size: var(--fs-lg); font-weight: 600; } .event .when span { font-size: var(--fs-sm); color: var(--ink-2); }
.event p { margin: 0; font-size: var(--fs); font-weight: 500; }

/* Slide-over panel for pick-and-assign lists */
.slide-back { position: fixed; inset: 0; background: rgba(28, 32, 64, .35); backdrop-filter: blur(6px); z-index: 40; display: none; }
.slide-back.open { display: block; }
.slide { position: fixed; top: 0; right: 0; bottom: 0; width: min(100%, 560px); background: var(--surface); z-index: 41; padding: 24px 28px; overflow-y: auto; display: none; }
.slide.open { display: block; }
.slide .search { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.slide .row-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; } .slide .row-item .grow { flex: 1; font-weight: 500; }

/* Student theme stays lively but inside the same system */
@media print { .sidebar, .topbar, button, .no-print { display: none !important; } .shell { display: block; } body { background: var(--surface); } }

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: auto 0 0 0; height: auto; flex-direction: row; padding: 4px 8px; z-index: 10; overflow: visible; }
  .sidebar .brand, .sidebar .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 2px; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; min-height: 52px; justify-content: center; text-align: center; border-radius: 10px; flex: 1; min-width: 0; }
  .nav a span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
  .nav a[aria-current=page] { border-radius: 10px; }
  .main { padding: 16px 16px 96px; } .topbar { padding: 0 16px; gap: 10px; min-height: 64px; }
  .who-block .t { display: none; } .pill-select summary { min-width: 0; padding: 0 12px; height: 38px; }
  .cal { padding: 20px; }
}

h2.sect { font-size: var(--fs); font-weight: 700; margin: 0 0 8px; color: var(--ink); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; max-width: 860px; }
.setting { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; text-decoration: none; color: var(--ink); min-height: 84px; border: 1px solid transparent; }
.setting:hover { border-color: var(--brand-soft); }
.setting .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; } .setting .grow strong { font-weight: 600; font-size: var(--fs); }
.stat .tile .num, .setting .tile .num { font-weight: 700; font-size: var(--fs-sm); }
.setting .tile { width: 41px; height: 36px; border-radius: 5px; display: grid; place-items: center; background: var(--tile-lavender); color: var(--brand); flex: none; }
.setting .tile.pink { background: var(--tile-pink); color: var(--pink); } .setting .tile.peach { background: var(--tile-peach); color: var(--orange); }

.page-head .filter-select { width: auto; min-width: 120px; min-height: 36px; height: 36px; padding: 0 36px 0 14px; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-2); background-position: right 10px center; }
.search-pill { width: 260px; min-height: 36px; height: 36px; font-size: var(--fs-xs); padding: 0 16px; }
.page-head .push { margin-left: auto; }
details.dots summary { min-width: 0; width: 36px; height: 36px; padding: 0; border: 0; justify-content: center; background: transparent; color: var(--ink); }
details.dots .menu-pop { right: 0; top: 34px; min-width: 170px; }
.table-card td, .table-card th { padding-top: 14px; padding-bottom: 14px; }
.crumb { margin: 0; width: 36px; height: 36px; justify-content: center; border-radius: 50%; } .crumb:hover { background: var(--surface-2); }
.form-card { max-width: 760px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 36px; }
.form-card h1 { font-size: var(--fs-lg); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; } @media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.detail { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 24px; align-items: start; } @media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }
.idbox { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.form-pane { padding: 32px 36px; }
.pager .next { color: var(--brand-text); }

/* Report card (Figma "Student Report card": navy table heads, boxed header and remarks) */
.rc-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.rc { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; max-width: 980px; margin: 0 auto; color: var(--ink); }
.rc-head { display: grid; grid-template-columns: 110px 1fr 110px; gap: 16px; align-items: center; text-align: center; margin-bottom: 20px; }
.rc-title h2 { font-size: 1.25rem; text-transform: uppercase; margin: 0 0 6px; }
.rc-title h3 { font-size: .95rem; text-transform: uppercase; margin: 10px 0 0; }
.rc-title p { margin: 0; }
.rc-crest, .rc-photo { width: 100px; height: 100px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.6rem; }
.rc-crest .i { width: 56px; height: 56px; }
.rc-who { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink); margin: 0 0 24px; }
.rc-who div { display: flex; gap: 6px; padding: 8px 10px; font-size: .8rem; border-bottom: 1px solid var(--line); }
.rc-who dt { color: var(--ink-2); } .rc-who dd { margin: 0; font-weight: 600; }
.rc-sect { text-align: center; text-transform: uppercase; border: 1px solid var(--ink); border-bottom: 0; margin: 0; padding: 10px; font-size: .85rem; }
.rc-table { width: 100%; border-collapse: collapse; border: 1px solid var(--ink); font-size: .85rem; }
.rc-table th { background: var(--ink); color: #fff; text-transform: uppercase; font-size: .72rem; padding: 10px 6px; text-align: center; }
.rc-table tr.max th { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); }
.rc-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.rc-table .l { text-align: left; padding-left: 12px; }
.rc-table .subj { font-weight: 600; text-transform: uppercase; }
.rc-grid { margin: 20px 0; max-width: 420px; }
.rc-bar-h { background: var(--ink); color: #fff; margin: 0; padding: 8px; text-align: center; text-transform: uppercase; font-size: .75rem; }
.rc-remark { margin-top: 20px; } .rc-remark h4 { font-style: italic; margin: 0 0 6px; font-size: .85rem; }
.rc-remark p { border: 1px solid var(--ink); padding: 14px; margin: 0 0 14px; min-height: 52px; }
.rc-sign { display: flex; justify-content: space-between; font-size: .8rem; }
@media (max-width: 700px) { .rc { padding: 16px; } .rc-who { grid-template-columns: 1fr; } .rc-head { grid-template-columns: 1fr; } .rc-crest, .rc-photo { display: none; } }
@media print { .rc { box-shadow: none; padding: 0; max-width: none; } .rc-table th, .rc-bar-h, .rc-crest, .rc-photo { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Motion: calm, short, and only where it helps you see what changed. */
@media (prefers-reduced-motion: no-preference) {
  :root { --ease: cubic-bezier(.28, .11, .32, 1); --dur: 260ms; }
  .shell main, .auth-form { animation: page-in .5s var(--ease) both; }
  .topbar { backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); }
  .card, .stat, .todo, .setting, .table-card { transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
  .stat:hover, .setting:hover, .todo:hover { transform: translateY(-3px); box-shadow: 0 18px 50px rgba(28, 32, 64, .1); }
  .menu-pop, .pop { animation: pop-in .22s var(--ease) both; transform-origin: top right; }
  tbody tr { transition: background .2s var(--ease); }
  .alert { animation: page-in .4s var(--ease) both; }
}
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.logo img { display: block; height: 30px; width: auto; }

/* School logo and colour choice */
.logo-row { display: flex; gap: 20px; align-items: center; margin-top: 8px; } .logo-row > div { flex: 1; }
.school-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 14px; border: 1px solid var(--border); background: #fff; }
.school-logo.none { display: grid; place-items: center; font-size: .7rem; color: var(--ink-2); text-align: center; }
.theme-pick { border: 0; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; } .theme-pick legend { font-weight: 600; font-size: var(--fs-sm); margin-bottom: 8px; padding: 0; }
.opt { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; padding: 12px 16px; border: 1px solid var(--border-input); border-radius: 14px; cursor: pointer; flex-wrap: wrap; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt small { flex-basis: 100%; margin-left: 66px; font-weight: 400; } .sw { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.auth .school-mark { height: 56px; width: auto; max-width: 160px; object-fit: contain; display: block; margin: 0 0 16px; }
.rc-crest-img { width: 100px; height: 100px; object-fit: contain; }

/* Report & Analysis (Figma "Report card template" frames) */
.ana { display: grid; grid-template-columns: 1.1fr 1.1fr .6fr .6fr; gap: 16px; align-items: stretch; }
.ana-card { min-height: 190px; } .ana-h { font-size: .95rem; font-weight: 600; margin: 0; }
.donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 112px; height: 112px; border-radius: 50%; background: var(--g); display: grid; place-items: center; flex: none; }
.donut span { width: 74px; height: 74px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 600; font-size: 1.05rem; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 8px; } .legend i { width: 9px; height: 9px; border-radius: 50%; } .legend b { margin-left: auto; color: var(--ink); padding-left: 10px; }
.tpls { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.tpl { position: relative; width: 220px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--surface); transition: box-shadow .4s var(--ease), transform .4s var(--ease); }
.tpl:hover { box-shadow: 0 16px 40px rgba(28, 32, 64, .1); transform: translateY(-3px); }
.tpl-thumb { height: 190px; border-radius: 4px; background: var(--surface-2); display: grid; gap: 8px; padding: 14px; align-content: start; }
.tpl-thumb i { height: 14px; border-radius: 3px; background: var(--track); } .tpl-thumb i:first-child { background: var(--navy); height: 22px; }
.tpl-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: var(--fs-sm); }
.tpl-btn { position: absolute; left: 50%; top: 44%; translate: -50% -50%; opacity: 0; transition: opacity .3s var(--ease); white-space: nowrap; }
.tpl:hover .tpl-btn, .tpl:focus-within .tpl-btn { opacity: 1; } @media (hover: none) { .tpl-btn { opacity: 1; position: static; translate: none; margin-top: 10px; width: 100%; } }
@media (max-width: 980px) { .ana { grid-template-columns: 1fr 1fr; } } @media (max-width: 560px) { .ana { grid-template-columns: 1fr; } }

/* Phones: the five to-do tiles and the stat cards keep the same widths as each other, and nothing may push the page sideways. */
@media (max-width: 760px) { .todos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } .todo { min-height: 104px; padding: 12px; } }
@media (max-width: 420px) { .todos { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { min-height: 120px; padding: 14px; } }
html, body { max-width: 100%; overflow-x: clip; }
img, svg, video { max-width: 100%; }
.table-wrap, .table-card { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 880px) {
  .page-head { gap: 8px; } .page-head .push { margin-left: 0; width: 100%; } .page-head .push.row { justify-content: flex-start; }
  .search-pill { width: 100%; } .form-card { padding: 20px 16px; }
  .detail, .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .pager { flex-wrap: wrap; gap: 6px; justify-content: center; }
}
@media (max-width: 420px) {
  .todo { min-height: 92px; } .todo:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 72px; }
  .grid:has(> .stat) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid > .stat { padding: 12px; gap: 10px; min-height: 0; } .stat .n { font-size: 1.15rem; } .stat .l { font-size: .72rem; }
  .stat .tile { width: 32px; height: 28px; }
}
@media (max-width: 600px) { .table-card td, .table-card th { padding-left: 10px; padding-right: 10px; } }

/* The school's own logo comes first; Techscholar sits quietly at the bottom */
.school-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; text-decoration: none; color: #fff; padding-bottom: 28px; }
.school-brand .plate { width: 72px; height: 72px; border-radius: 16px; background: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.school-brand .plate img { width: 56px; height: 56px; object-fit: contain; }
.school-brand strong { font-size: .8rem; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.powered { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 0 0; font-size: .72rem; color: rgba(255, 255, 255, .7); }
.powered img { height: 22px; width: auto; opacity: .95; }
.powered.dark { color: var(--ink-2); padding: 0 0 28px; } .powered.dark img { height: 24px; }
.top-school { display: none; width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.auth .school-top { gap: 14px; } .auth .school-top img { width: 44px; height: 44px; object-fit: contain; } .auth .school-top strong { font-size: .95rem; color: var(--ink); font-weight: 600; }
@media (max-width: 880px) { .top-school { display: block; } }

/* School name and logo on one line, sized like the Techscholar logo (about 33px tall) */
.school-brand { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; text-align: left; padding-bottom: 44px; }
.school-brand .plate { width: 40px; height: 40px; border-radius: 10px; flex: none; box-shadow: none; }
.school-brand .plate img { width: 32px; height: 32px; }
.school-brand strong { font-size: .9rem; font-weight: 700; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.auth .school-top { gap: 10px; } .auth .school-top img { width: 36px; height: 36px; } .auth .school-top strong { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }

/* The logo lines up with the top bar: same height, same centre line */
@media (min-width: 881px) {
  .sidebar { padding-top: 0; }
  .sidebar .brand, .sidebar .school-brand { min-height: 81px; padding: 0; margin-bottom: 20px; display: flex; align-items: center; }
}
@media (max-width: 880px) { .sidebar .school-brand, .sidebar .powered { display: none; } }

/* Report card options (Figma "Customize your report card") */
.big-title { font-size: 1.5rem; text-transform: uppercase; margin: 0 0 6px; } .lead-p { margin: 0 0 24px; font-size: 1.05rem; }
.opt-card { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); max-width: 860px; padding: 8px 40px 40px; }
.opt-card h2 { font-size: 1.1rem; margin: 24px 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.opt-card > p.muted { margin: 18px 0 8px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; margin: 0; font-weight: 400; cursor: pointer; }
.switch-row strong { display: block; font-weight: 500; font-size: 1.05rem; } .switch-row small { display: block; color: var(--ink-2); font-size: var(--fs-sm); margin-top: 6px; max-width: 34em; }
input.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 28px; min-height: 28px; padding: 0; border-radius: 99px; border: 0; background: var(--track); position: relative; flex: none; cursor: pointer; transition: background .3s var(--ease); }
input.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .3s var(--ease); }
input.switch:checked { background: var(--brand); } input.switch:checked::after { transform: translateX(24px); }
.switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt-card .center { display: flex; justify-content: center; margin-top: 24px; } .opt-card .center .big { min-width: 300px; }
.key { margin: 0 0 16px; } .key summary { cursor: pointer; font-weight: 600; } .key ol { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); font-size: var(--fs-sm); }
.rate-table th.rot span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; padding: 4px 0; }
.rate-table th.rot { vertical-align: bottom; text-align: center; padding: 8px 4px; } .rate-table td { padding: 6px 8px; }
.rate-table select.rate { width: 62px; min-height: 36px; padding: 0 8px; border-radius: 99px; } .rate-table input.num { width: 76px; min-height: 36px; padding: 0 12px; text-align: center; }
.rc-extras { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.rc-key { list-style: none; margin: 0; padding: 10px 12px; border: 1px solid var(--ink); border-top: 0; font-size: .75rem; display: grid; gap: 4px; }
@media (max-width: 700px) { .rc-extras { grid-template-columns: 1fr; } .opt-card { padding: 4px 20px 28px; } }

/* Code entry (Figma "Check your Mail"): one wide field that reads like six boxes */
input.code-input { text-align: center; font-size: 1.6rem; font-weight: 600; letter-spacing: .5em; padding-left: calc(20px + .5em); height: 64px; border-radius: 16px;
  background: repeating-linear-gradient(90deg, transparent 0 calc(16.66% - 1px), #e4e6ee calc(16.66% - 1px) 16.66%); }
input.code-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* Classroom page (Figma "SSS1A Classroom") */
.room { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.room-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 28px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.room-head h1 { margin: 0; font-size: 1.4rem; text-transform: uppercase; }
.room-bar { display: flex; align-items: center; gap: 20px; padding: 16px 28px; flex-wrap: wrap; }
.room-tabs { display: flex; gap: 6px; } .room-tabs a { padding: 10px 24px; border-radius: 99px; text-decoration: none; color: var(--brand); font-weight: 500; font-size: var(--fs-sm); }
.room-tabs a.on { background: var(--brand); color: #fff; }
.room-search { flex: 1; min-width: 180px; } .room-search .search-pill { width: 100%; }
.link-add { display: inline-flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none; font-weight: 500; margin-left: auto; }
.link-add .plus { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; } .link-add .plus .i { width: 14px; height: 14px; }
.room-teacher { display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: var(--surface-2); flex-wrap: wrap; font-size: var(--fs-sm); } .room-teacher span { color: var(--ink-2); }
.room-table { width: 100%; border-collapse: collapse; } .room-table thead th { background: var(--surface-2); text-align: left; padding: 14px 28px; font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); }
.room-table td { padding: 22px 28px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; } .room-table .subj { font-weight: 600; font-size: 1.02rem; }
.room-table .tc b { display: block; font-weight: 500; } .room-table .tc small { color: var(--ink-2); }
.assign summary { list-style: none; cursor: pointer; } .assign summary::-webkit-details-marker { display: none; }
.assign-link { color: var(--brand); font-weight: 500; } .assign[open] form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; } .assign form select { max-width: 240px; min-height: 40px; } .assign form button { min-height: 40px; }
.room-teacher .assign[open] { flex-basis: 100%; }
@media (max-width: 700px) { .room-head, .room-bar, .room-teacher { padding-left: 16px; padding-right: 16px; } .room-table th, .room-table td { padding: 14px 16px; } .link-add { margin-left: 0; } }

/* Phones, as in the Figma mobile frames: you first (photo, name, email), the bell on the right; the to-dos swipe sideways */
@media (max-width: 880px) {
  .topbar { gap: 10px; min-height: 76px; }
  .topbar .lead { order: 1; margin-right: 0; }
  .topbar > details:last-of-type { order: 2; margin-right: auto; }
  .topbar > details:nth-last-of-type(2) { order: 3; }
  .who-block { flex-direction: row-reverse; gap: 10px; } .who-block .t { display: block; text-align: left; max-width: 46vw; }
  .who-block .t b { font-weight: 600; font-size: var(--fs); } .who-block .t span { display: block; font-size: var(--fs-xs); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .todos { display: flex; overflow-x: auto; scroll-snap-type: x proximity; gap: 12px; margin-right: -16px; padding: 2px 16px 6px 0; scrollbar-width: none; }
  .todos::-webkit-scrollbar { display: none; }
  .todo, .todo:last-child:nth-child(odd) { flex: 0 0 128px; min-height: 100px; grid-column: auto; scroll-snap-align: start; padding: 14px 12px 10px; }
}

/* ---- Lists on phones: one card per row, nothing leaves the screen ---- */
@media (max-width: 700px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); position: relative; }
  table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 5px 0; border: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  table.stack td::before { content: attr(data-label); flex: none; max-width: 42%; color: var(--ink-2); font-size: var(--fs-xs); text-align: left; font-weight: 500; }
  table.stack td[data-label=""]::before, table.stack td.cell-name::before, table.stack td.cell-wide::before { display: none; }
  table.stack td.cell-name { display: block; text-align: left; padding: 0 44px 8px 0; font-size: 1rem; }
  table.stack td.cell-wide { display: block; text-align: left; }
  table.stack td.cell-empty { display: none; }
  table.stack td:last-child:has(details.dots) { position: absolute; top: 8px; right: 8px; width: auto; padding: 0; }
  table.stack td:last-child:has(details.dots)::before { display: none; }
  .table-card table.stack td:first-child, .table-card table.stack th:first-child { padding-left: 0; }
  table.stack td .badge { white-space: normal; }
  .table-card, .room { overflow: visible; background: transparent; box-shadow: none; }
  .table-card .table-wrap { overflow: visible; }
  table.stack tbody tr { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
  .room-table.stack td.subj { display: block; text-align: left; font-size: 1.02rem; padding-right: 44px; }
  .room-table.stack td.subj::before { display: none; }
  .room-head, .room-bar, .room-teacher { background: var(--surface); border-radius: 14px; margin-bottom: 10px; }
}
@media (max-width: 700px) { table.stack td.cell-sn { display: none; } }
@media (max-width: 700px) {
  table.stack td.tc { display: block; text-align: left; } table.stack td.tc::before { display: block; max-width: none; margin-bottom: 2px; }
  table.stack td.tc small { display: block; overflow-wrap: anywhere; }
}
@media (max-width: 700px) { .card.table-wrap { background: transparent; border: 0; box-shadow: none; padding: 0; overflow: visible; } }

/* Confirmation pages (Figma "Password reset successful"): a soft circle with a tick, centred */
.auth-form.centered { text-align: center; }
.auth-form.centered h1 { font-size: 1.75rem; line-height: 1.2; margin-bottom: 8px; } .auth-form.centered .alt { margin-bottom: 24px; }
.status-icon { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 22px; }
.status-icon .i { width: 44px; height: 44px; stroke-width: 2.2; }
.status-icon.ok { background: var(--success-bg); color: #2fbf5b; } .status-icon.bad { background: var(--danger-bg); color: var(--danger); }
@media (prefers-reduced-motion: no-preference) { .status-icon { animation: pop-in .5s var(--ease) both; } }

/* Calendar you can move, and an events list you can scroll */
.cal .head { justify-content: space-between; padding: 0 4px; } .cal .head .arrows { position: static; display: flex; gap: 6px; }
.cal .head .arrows a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--ink); transition: background .2s var(--ease); } .cal .head .arrows a:hover { background: var(--surface-2); }
.cal-grid .day { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: inherit; text-decoration: none; margin: 0 auto; position: relative; transition: background .2s var(--ease); }
a.day:hover { background: var(--brand-soft); } .cal-grid .day.today { background: var(--brand); color: #fff; }
.cal-grid .day.mark::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.cal-today { display: block; text-align: center; margin-top: 14px; font-size: var(--fs-sm); color: var(--brand); text-decoration: none; font-weight: 500; }
.events { padding: 20px; } .ev-head { display: flex; align-items: center; gap: 10px; } .ev-head h2 { margin: 0; padding: 4px 4px 12px; }
.ev-scroll { max-height: 440px; overflow-y: auto; padding: 4px; margin: -4px; scrollbar-width: thin; overscroll-behavior: contain; } .ev-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 10px; }
.ev-edit { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--brand); text-decoration: none; }
@media (max-width: 880px) { .ev-scroll { max-height: 360px; } }

#calendar.busy .cal-grid { opacity: .45; transition: opacity .15s; }
@media (prefers-reduced-motion: no-preference) { .cal-grid.swap { animation: cal-in .3s var(--ease); } }
@keyframes cal-in { from { opacity: 0; transform: translateY(6px); } }

/* "Account created" (Figma): a centred confirmation with the one-time link */
.done-card { max-width: 520px; margin: 24px auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 36px 36px 30px; text-align: center; display: grid; gap: 14px; }
.done-card h1 { text-transform: none; font-size: 1.7rem; margin: 0; } .done-card p { margin: 0; line-height: 1.5; }
.done-card .status-icon { margin-bottom: 0; }
.copy-row { display: flex; gap: 8px; align-items: center; } .copy-row input { flex: 1; min-width: 0; } .copy-row button { flex: none; }
.who-can { margin: 0; text-align: left; } .who-can div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--surface-2); border-radius: 12px; } .who-can dt { color: var(--ink-2); } .who-can dd { margin: 0; font-weight: 600; }
.add-child { text-align: left; } .add-child label { margin-top: 0; }
.inline-edit summary { padding: 10px 14px; cursor: pointer; font-size: var(--fs-sm); } .inline-edit form { display: grid; gap: 8px; padding: 8px 14px 12px; min-width: 220px; } .inline-edit form input { min-height: 40px; }
@media (max-width: 560px) { .done-card { padding: 26px 20px; margin: 8px auto; } .copy-row { flex-direction: column; align-items: stretch; } }

/* Attendance (Figma "Mark Attendance") */
.att-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; } .att-pick { display: flex; gap: 10px; align-items: center; }
.att-table td { padding-top: 10px; padding-bottom: 10px; }
.pick { display: inline-block; margin: 0; cursor: pointer; } .pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick span { display: inline-block; min-width: 92px; text-align: center; padding: 8px 14px; border: 1px solid #9aa1b9; border-radius: 6px; font-size: var(--fs-xs); font-weight: 500; color: var(--ink); background: var(--surface); transition: background .15s, color .15s, border-color .15s; }
.pick:hover span { border-color: var(--brand); } .pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.pick.p-present input:checked + span { background: var(--success-bg); border-color: var(--green); color: var(--ok, #17724a); } .pick.p-absent span { background: var(--danger-bg); border-color: #f5b5b5; color: var(--danger); }
.pick.p-absent input:checked + span { background: #c0392b; border-color: var(--danger); color: #fff; } .pick.p-excused input:checked + span { background: var(--warning-bg); border-color: var(--orange); color: var(--warning); }
.att-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.mk { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; font-weight: 600; font-size: var(--fs-xs); background: var(--surface-2); color: var(--ink-2); }
.mk.m-present { background: var(--success-bg); color: var(--success); } .mk.m-absent { background: var(--danger-bg); color: var(--danger); } .mk.m-excused { background: var(--warning-bg); color: var(--warning); }
/* Recent CA and grade weights (Figma teacher screens) */
.ca-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s-4); }
.ca-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 8px; text-decoration: none; color: var(--ink); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.ca-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(28, 32, 64, .1); } .ca-card b { font-size: 1.05rem; } .ca-card .badge { justify-self: start; }
.ca-bar { height: 7px; border-radius: 7px; background: #ffd9b0; overflow: hidden; } .ca-bar i { display: block; height: 100%; background: var(--brand); border-radius: 7px; }
.ca-legend { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--ink-2); } .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; } .dot.ok { background: var(--brand); } .dot.warn { background: var(--orange); }
.wcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); margin: 0 0 var(--s-4); }
.wcard { border-radius: 10px; padding: 14px 16px; display: grid; gap: 2px; background: var(--tile-pink); border-left: 5px solid var(--pink); } .wcard span { font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; } .wcard strong { font-size: 1.6rem; } .wcard small { color: var(--ink-2); }
.wcard.w1 { background: var(--tile-peach); border-color: var(--orange); } .wcard.w2 { background: var(--tile-lavender); border-color: var(--brand); } .wcard.w3 { background: var(--tile-cyan); border-color: var(--blue); }
@media (max-width: 700px) { .att-table td[data-label] .pick span { min-width: 0; padding: 7px 12px; } }

/* Notifications, excuses and the attendance chart */
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; } .icon-btn { position: relative; }
.bell-pop { min-width: 300px; max-width: 340px; padding: 6px; } .bell-pop a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); } .bell-pop a:hover { background: var(--surface-2); }
.bell-pop a.new, .notif-list li.new { background: var(--brand-soft); } .bell-pop span, .bell-pop small, .notif-list span, .notif-list small { color: var(--ink-2); font-size: var(--fs-xs); } .bell-pop .see-all { text-align: center; color: var(--brand); font-weight: 600; }
.notif-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; max-width: 720px; } .notif-list li { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; } .notif-list a { display: grid; gap: 3px; padding: 14px 18px; text-decoration: none; color: var(--ink); }
.notif-pref { max-width: 720px; } .att-top { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); margin: 6px 0 14px; align-items: start; } .att-donut { display: flex; align-items: center; gap: 18px; width: max-content; } .att-excuses { min-width: 0; }
.exc { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; } .exc:last-child { border: 0; }
.excuse form { display: grid; gap: 4px; margin-top: 12px; } .excuse summary { list-style: none; display: inline-flex; cursor: pointer; } .excuse summary::-webkit-details-marker { display: none; }
.exc-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; } .exc-list li { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); }
@media (max-width: 760px) { .att-top { grid-template-columns: minmax(0, 1fr); } .att-donut { width: auto; } .bell-pop { min-width: 0; width: min(320px, 86vw); } }

/* Attendance card on the student page (Figma): chart, then a month of marks */
.att-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .att-card-head h2 { margin: 0; }
.att-nav { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); } .att-nav a { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; text-decoration: none; color: var(--ink); font-size: 1.2rem; } .att-nav a:hover { background: var(--surface-2); }
.att-donut-row { display: flex; align-items: center; gap: 16px; margin: 14px 0; } .donut.sm { width: 92px; height: 92px; } .donut.sm span { width: 62px; height: 62px; font-size: .95rem; }
.mini-cal { width: 100%; border-collapse: separate; border-spacing: 4px; text-align: center; table-layout: fixed; } .mini-cal th { font-weight: 500; color: var(--ink-2); font-size: var(--fs-xs); padding: 4px 0; background: none; text-transform: none; }
.mini-cal td { padding: 2px 0; border: 0; vertical-align: top; height: 44px; } .mini-cal .n { display: block; font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.4; }
.mini-cal .mk { width: 22px; height: 22px; border-radius: 6px; font-size: .72rem; }
.mini-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-2); margin: 8px 0 0; } .mini-legend span { display: inline-flex; align-items: center; gap: 6px; } .mini-legend .mk { width: 16px; height: 16px; font-size: .6rem; font-style: normal; }

/* Locked sidebar items (Figma locked variant): visible, not clickable */
.nav .locked { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; font: 500 14px/20px var(--font); letter-spacing: -.02em; opacity: .5; cursor: not-allowed; }
.nav .locked em { margin-left: auto; font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .16); }
@media (max-width: 760px) { .nav .locked { display: none; } }

/* Dashboard: calendar and events keep their size and sit at the right edge; the middle stretches */
.main:has(> .layout-2) { max-width: none; }

/* To-do progress line sits on its own row (Figma) */
.todo .line { display: block; }
/* Dashboard attendance area chart (Figma) */
.att-chart select { min-height: 36px; border-radius: 99px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 13px; }
.att-chart .area { width: 100%; height: auto; margin-top: 12px; display: block; }
.att-chart .grid line { stroke: var(--line); } .att-chart .fill { fill: var(--brand); opacity: .14; } .att-chart .ln { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linejoin: round; }
.att-chart circle { fill: var(--surface); stroke: var(--brand); stroke-width: 3; } .att-chart text { font-size: 13px; fill: var(--ink-2); }

/* Admin overview cards */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ins h3 { margin: 0 0 4px; font-size: var(--fs); } .ins .att-donut-row { margin: 8px 0; }
.locked-card { opacity: .65; border-style: dashed; }
.bar-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 36px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: var(--fs-sm); } .bar-row b { text-align: right; }

/* Notes to a person, shown at the top of their dashboard */
.notes { display: grid; gap: 10px; margin-bottom: 16px; }
.note { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 18px; border-radius: 12px; background: var(--brand-soft); border: 1px solid rgba(60, 54, 140, .18); }
.note p { margin: 4px 0 0; }

.nav .soon-h { margin: 14px 12px 2px; font: 600 11px/16px var(--font); letter-spacing: .08em; text-transform: uppercase; opacity: .55; }
.nav .locked em { font-size: 10px; }
@media (max-width: 760px) { .nav .soon-h { display: none; } }

/* Brain gym card on the student dashboard (locked until it ships) */
.brain-card { display: flex; align-items: center; gap: 16px; margin-top: 16px; opacity: .75; border-style: dashed; }
.brain-card > div { flex: 1; min-width: 0; }

/* Messages */
.msg p { margin: 6px 0 8px; white-space: pre-line; } .msg.fresh { border-left: 4px solid var(--brand); }
.msg details summary { cursor: pointer; color: var(--brand); }

/* Slide-over panels and pop-ups (Figma) */
dialog.panel, dialog.modal { border: 0; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(28, 32, 64, .45); backdrop-filter: blur(6px); }
dialog.panel { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(560px, 100vw); height: 100vh; max-height: none; box-shadow: -20px 0 60px rgba(28, 32, 64, .2); }
dialog.panel[open] { animation: panel-in .28s var(--ease); }
@keyframes panel-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.modal { width: min(460px, calc(100vw - 32px)); border-radius: 16px; box-shadow: 0 30px 80px rgba(28, 32, 64, .3); }
.panel-in { height: 100%; display: flex; flex-direction: column; padding: 24px; overflow-y: auto; } .modal-in { padding: 24px; }
.panel-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; justify-content: space-between; } .panel-top .search-pill { flex: 1; }
.x { background: transparent; border: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); cursor: pointer; padding: 0; margin: 0; } .x:hover { background: var(--surface-2); }
.panel-list { list-style: none; margin: 0; padding: 0; flex: 1; } .panel-list li { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.panel-list.people li { display: flex; align-items: center; gap: 12px; } .panel-list.people .grow { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.panel-list li[hidden] { display: none; } .panel-form { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { dialog.panel[open] { animation: none; } }
label .btn-link, .btn-link[data-open] { background: none; border: 0; padding: 0 0 0 8px; margin: 0; width: auto; min-height: 0; color: var(--brand-text, var(--brand)); font: 600 13px/1 var(--font); cursor: pointer; text-decoration: none; display: inline; }
label .btn-link:hover { text-decoration: underline; }
.panel-list .btn-link { background: none; border: 0; padding: 8px; margin: 0; width: auto; color: var(--brand); font: 600 14px/1 var(--font); cursor: pointer; }

@media (max-width: 700px) {
  .att-chart form { flex-wrap: nowrap; gap: 8px; align-items: center; } .att-chart form h2 { font-size: 1.05rem; }
  .att-chart form .row { flex-wrap: nowrap; gap: 6px !important; margin-left: auto; }
  .att-chart select { min-height: 34px; padding: 0 8px; font-size: 12px; max-width: 108px; text-overflow: ellipsis; }
}
/* More menu on phones (Figma: a short bottom bar) */
.nav .more-btn, .more-sheet-link { display: none; }
dialog.sheet { border: 0; padding: 0; background: var(--surface); color: var(--ink); width: 100%; max-width: 480px; margin: auto auto 0; border-radius: 20px 20px 0 0; box-shadow: 0 -20px 60px rgba(28, 32, 64, .25); }
dialog.sheet[open] { animation: panel-in .28s var(--ease); }
.sheet-in { padding: 16px 16px 24px; display: grid; gap: 4px; }
.sheet-in a, .sheet-in button.row-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font: 500 15px/20px var(--font); background: transparent; border: 0; width: 100%; cursor: pointer; text-align: left; }
.sheet-in a:hover, .sheet-in a[aria-current=page] { background: var(--brand-soft); }
.sheet-in .logout { color: var(--accent); }
.sheet-in .soon-h { margin: 10px 12px 2px; font: 600 11px/16px var(--font); letter-spacing: .08em; text-transform: uppercase; opacity: .55; }
.sheet-in .locked-row { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 12px; opacity: .5; font-size: 14px; }
@media (max-width: 880px) {
  .nav a.more-item { display: none; }
  .nav .more-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 500 11px/16px var(--font); padding: 6px 4px; min-height: 52px; border-radius: 10px; flex: 1; min-width: 0; color: inherit; background: transparent; border: 0; cursor: pointer; }
  .nav .more-btn.on { background: var(--sidebar-active); color: var(--on-sidebar-active); }
}

/* Attendance by class: bars, low classes in orange */
.bar-row.low .progress > span { background: #e8863a; } .bar-row.low b { color: var(--warning); }
.att-chart .bar-row { grid-template-columns: 110px minmax(0, 1fr) 44px; }
.att-chart form select { width: auto; min-width: 140px; flex: none; }

.att-chart .bar-row.split { grid-template-columns: 110px minmax(0, 1fr) 84px; } .bar-row.split .track { min-width: 0; }
.bar-row.split b { text-align: right; white-space: nowrap; }

/* Notification bell: a proper panel (these selectors out-rank the generic .menu-pop link styles) */
.pill-select .menu-pop.bell-pop { width: 380px; min-width: 0; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.bell-new { font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 99px; padding: 2px 10px; }
.bell-list { max-height: min(420px, 62vh); overflow-y: auto; }
.pill-select .menu-pop.bell-pop a.bell-item, .notif-list a.bell-item { display: flex; align-items: flex-start; gap: 12px; width: auto; min-height: 0; padding: 12px 16px; border-radius: 0; border-bottom: 1px solid var(--border-soft); text-align: left; font-weight: 400; }
.pill-select .menu-pop.bell-pop a.bell-item:last-child { border-bottom: 0; }
.bell-item.new { background: var(--brand-soft); } .notif-list li.new { background: var(--brand-soft); }
.bell-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-soft); display: grid; place-items: center; color: var(--brand); }
.bell-item.new .bell-ic, .notif-list li.new .bell-ic { background: var(--brand); border-color: var(--brand); color: #fff; }
.bell-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.bell-tx b { font-size: 14px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bell-tx span { font-size: 13px; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bell-tx small { font-size: 12px; color: var(--ink-2); opacity: .8; margin-top: 2px; }
.notif-list .bell-tx b, .notif-list .bell-tx span { -webkit-line-clamp: unset; display: block; }
.bell-empty { margin: 0; padding: 24px 16px; text-align: center; color: var(--ink-2); font-size: 14px; }
.pill-select .menu-pop.bell-pop a.see-all { display: block; text-align: center; padding: 12px; border-top: 1px solid var(--border-soft); border-radius: 0; min-height: 0; }
@media (max-width: 760px) { .pill-select .menu-pop.bell-pop { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; } }
.topbar { position: relative; z-index: 40; } /* menus open over the page cards, not under them */

/* Appearance switch in the account menu */
.mode-row { display: flex; align-items: center; gap: 6px; padding: 8px 12px 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.mode-row span { width: 100%; font-size: 12px; color: var(--ink-2); }
.pill-select .menu-pop .mode-row button { display: inline-flex; width: auto; min-height: 32px; padding: 0 12px; border: 1px solid var(--border-input); border-radius: 99px; font-size: 13px; background: transparent; color: var(--ink); justify-content: center; }
.pill-select .menu-pop .mode-row button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* The report card is a document: it stays on light "paper" in night mode, so what a parent sees matches what is printed. */
.rc { color-scheme: light; --surface: #fff; --surface-2: #f4f3fb; --ink: #1c2040; --ink-2: #71717a; --ink-3: #667185; --line: #e3e5ee; --track: #eceef6;
  --border: rgba(113, 113, 122, .2); --border-input: #d0d5dd; --border-soft: rgba(113, 113, 122, .1); --success: #17724a; --success-bg: #e3f4eb; --warning: #7a4e00; --warning-bg: #fdf0d2;
  --danger: #b42318; --danger-bg: #fde9e7; --brand-text: #3d358c; --brand-soft: #d6d2ff; --shadow: 0 4px 50px rgba(221, 228, 234, .35); }

/* The Techscholar logo has a dark-ink version for night mode (its indigo becomes white, the orange stays) */
.logo-on-dark { display: none; }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) .logo-on-light { display: none; }
  :root:not([data-mode="light"]) .logo-on-dark { display: inline-block; }
}
@media screen {
  :root[data-mode="dark"] .logo-on-light { display: none; }
  :root[data-mode="dark"] .logo-on-dark { display: inline-block; }
}

/* Transcript */
.transcript .tr-session { margin-top: 22px; } .transcript .tr-session h3 { margin: 0 0 8px; }
.tr-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; } .tr-sign .line { display: block; border-bottom: 1px solid var(--ink); height: 40px; } .tr-sign p { margin: 6px 0 0; font-size: 13px; }
.rc-table tfoot th { text-align: left; }
@media print { .tr-session { break-inside: avoid; } }

/* Brain gym */
a.brain-card.live { opacity: 1; border-style: solid; text-decoration: none; color: inherit; }
a.brain-card.live:hover { border-color: var(--brand); }
.persona { border-left: 4px solid var(--brand); } .badges { display: flex; flex-wrap: wrap; gap: 8px; }
.bq-form { max-width: 640px; } .bq-bar { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; margin: 0 0 14px; }
.bq-bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s var(--ease); }
.bq { border: 0; padding: 20px; margin: 0 0 14px; } .bq legend { padding: 0; margin-bottom: 6px; } .bq[hidden] { display: none; }
.bq-q { font-size: 1.15rem; font-weight: 600; margin: 4px 0 14px; line-height: 1.4; }
.bq-choices { display: grid; gap: 10px; }
.bq-choice { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; border: 2px solid var(--border-input); border-radius: 14px; cursor: pointer; background: var(--surface); font-size: 1.05rem; }
.bq-choice input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); }
.bq-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* Alert channel choice */
.chan-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.chan { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 2px solid var(--border-input); border-radius: 99px; cursor: pointer; background: var(--surface); }
.chan input { accent-color: var(--brand); } .chan:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); } .chan:has(input:disabled) { opacity: .5; cursor: not-allowed; }

/* Brain gym: the playful parts. Motion is switched off for people who ask for less of it. */
.hero-gym { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 20px 24px; }
.hero-text { min-width: 0; } .bq-say { margin: 0 0 8px; font-weight: 600; } .bq-say.big { font-size: 1.25rem; }
.flame-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; } .flame-row strong { font-size: 1.6rem; }
.flame { font-size: 1.6rem; filter: grayscale(1); opacity: .5; } .flame.lit { filter: none; opacity: 1; animation: flicker 1.6s ease-in-out infinite; }
.week { display: flex; gap: 8px; margin-bottom: 12px; }
.wd { display: grid; justify-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); }
.wd i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-input); display: grid; place-items: center; font-style: normal; font-weight: 700; color: #fff; }
.wd.done i { background: var(--success); border-color: var(--success); } .wd.today i { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); } .wd.future { opacity: .5; }
.lvl { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; } .lvl-n { font-weight: 700; }
.zap { display: block; overflow: visible; } .zap-body { transform-origin: 60px 130px; }
.hero-zap .zap, .result-hero .zap { animation: bob 2.4s ease-in-out infinite; }
.zap.cheer .zap-body { animation: hop .5s ease; } .zap.oops .zap-body { animation: wobble .5s ease; } .zap.oops .zap-mouth { d: path("M52 90q10 -8 20 0"); }
.bq-mascot { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.bq-choice.right { border-color: var(--success); background: var(--success-bg); } .bq-choice.wrong { border-color: var(--danger); background: var(--danger-bg); }
.bq-choice input:disabled + span { opacity: 1; }
.result-hero { text-align: center; padding: 8px 0 16px; } .result-hero h1 { margin: 6px 0; }
.xp-pop { display: inline-block; font-size: 1.6rem; font-weight: 800; color: var(--brand-text); animation: pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.confetti { position: fixed; inset: 0 0 auto 0; height: 0; pointer-events: none; z-index: 20; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.4s ease-in forwards; }
.confetti i:nth-child(odd) { background: var(--accent); } .confetti i:nth-child(3n) { background: var(--brand); } .confetti i:nth-child(4n) { background: #ffd23f; } .confetti i:nth-child(5n) { background: var(--success); }
.confetti i:nth-child(1) { left: 6%; animation-delay: .05s; } .confetti i:nth-child(2) { left: 14%; animation-delay: .25s; } .confetti i:nth-child(3) { left: 22%; animation-delay: .1s; }
.confetti i:nth-child(4) { left: 31%; animation-delay: .4s; } .confetti i:nth-child(5) { left: 40%; animation-delay: .15s; } .confetti i:nth-child(6) { left: 48%; animation-delay: .35s; }
.confetti i:nth-child(7) { left: 57%; animation-delay: .05s; } .confetti i:nth-child(8) { left: 66%; animation-delay: .3s; } .confetti i:nth-child(9) { left: 74%; animation-delay: .12s; }
.confetti i:nth-child(10) { left: 82%; animation-delay: .42s; } .confetti i:nth-child(11) { left: 90%; animation-delay: .2s; } .confetti i:nth-child(12) { left: 96%; animation-delay: .32s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes hop { 0% { transform: scale(1); } 40% { transform: scale(1.18) rotate(-4deg); } 100% { transform: scale(1); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.12) rotate(2deg); } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .zap, .zap *, .flame, .xp-pop, .confetti i { animation: none !important; } .confetti { display: none; } }
@media (max-width: 700px) { .hero-gym { grid-template-columns: 1fr; text-align: left; } .hero-zap { justify-self: start; } }

/* Question timer: calm, never alarming. It turns amber near the end, not red. */
.bq-clock { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.bq-clock[hidden] { display: none; }
.bq-clock-n { min-width: 3.2em; font-weight: 700; font-variant-numeric: tabular-nums; }
.bq-clock-track { flex: 1; height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bq-clock-track span { display: block; height: 100%; width: 100%; background: var(--brand); border-radius: inherit; transition: width 1s linear, background .3s; }
.bq-clock.low .bq-clock-track span { background: #e8863a; } .bq-clock.low .bq-clock-n { color: var(--warning); }
@media (prefers-reduced-motion: reduce) { .bq-clock-track span { transition: none; } }

/* Learning hub */
.lc-indigo { --lc: #3d358c; --lc2: #6b61e0; } .lc-pink { --lc: #c01f95; --lc2: #fe28cf; } .lc-orange { --lc: #c4630b; --lc2: #f18820; } .lc-green { --lc: #1f7a3a; --lc2: #3db551; }
.lc-blue { --lc: #1f5fbf; --lc2: #3f87fe; } .lc-teal { --lc: #0e7490; --lc2: #22b8cf; } .lc-violet { --lc: #6d28d9; --lc2: #a78bfa; } .lc-red { --lc: #b42318; --lc2: #f0605d; }
.lh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.lh-card { display: block; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); animation: lh-in .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.lh-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(28, 32, 64, .14); }
.lh-banner { background: linear-gradient(135deg, var(--lc) 45%, color-mix(in srgb, var(--lc) 55%, var(--lc2))); color: #fff; padding: 18px 18px 16px; min-height: 92px; }
.lh-banner h3 { margin: 0 0 4px; font-size: 1.15rem; } .lh-banner span { font-size: 13px; opacity: .92; }
.lh-body { display: flex; align-items: center; gap: 14px; padding: 14px 18px; } .lh-meta { display: grid; gap: 4px; justify-items: start; }
.ring { --p: 0; width: 56px; height: 56px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--track) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); } .ring b { position: relative; font-size: 12px; }
.lh-head { border-radius: 18px; padding: 22px 24px; color: #fff; background: linear-gradient(135deg, var(--lc) 45%, color-mix(in srgb, var(--lc) 55%, var(--lc2))); display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.lh-head h1 { margin: 0 0 4px; color: inherit; } .lh-head p { margin: 0; opacity: .94; } .lh-about { margin-top: 8px !important; max-width: 60ch; }
.lh-set summary { color: #fff; border-color: rgba(255, 255, 255, .6); cursor: pointer; } .lh-set .card { position: absolute; z-index: 5; min-width: 280px; color: var(--ink); }
.lh-tabs { margin: 14px 0; }
.lh-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; animation: lh-in .35s var(--ease) both; }
.lh-link { text-decoration: none; color: inherit; align-items: center; } .lh-link:hover { border-color: var(--brand); }
.lh-main { flex: 1; min-width: 0; }
.lh-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.lh-ic.work { background: var(--warning-bg); color: var(--warning); } .lh-ic.mat { background: var(--success-bg); color: var(--success); }
.lh-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; flex-wrap: wrap; }
a.lh-row:hover { background: var(--surface-2); } .lh-row:last-child { border-bottom: 0; }
.lh-topic { margin-bottom: 18px; } .lh-topic .lh-row { background: var(--surface); }
.lh-file { display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; margin: 4px 6px 4px 0; border: 1px solid var(--border-input); border-radius: 10px; text-decoration: none; background: var(--surface); }
.lh-file:hover { border-color: var(--brand); }
.lh-sub { border-left: 4px solid var(--border-input); } .lh-gb th, .lh-gb td { white-space: nowrap; }
.prose-lh p { margin: 0 0 10px; } .prose-lh ul { margin: 0 0 10px; padding-left: 20px; } .text-warn { color: var(--warning); }
.lh-mark { display: flex; gap: 18px; align-items: center; border-left: 4px solid var(--success); }
.mark-badge { width: 92px; height: 92px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-content: center; text-align: center; flex: none; }
.mark-badge b { font-size: 1.8rem; line-height: 1; } .mark-badge span { font-size: 11px; }
.mark-badge.pop { animation: pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.quiz-builder { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-top: 14px; } .quiz-builder[hidden] { display: none; }
.qb { border-top: 1px dashed var(--line); padding: 8px 0; } .qb[hidden] { display: none; } .qb-ans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.lh-hero { margin-bottom: 16px; }
@keyframes lh-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lh-card, .lh-item, .mark-badge.pop { animation: none; } .lh-card:hover { transform: none; } }
@media (max-width: 700px) { .lh-head { padding: 16px; } .qb-ans { grid-template-columns: 1fr; } .lh-mark { flex-direction: column; text-align: center; } }

/* Learning hub, primary school: bigger, friendlier, one thing at a time */
.lh-young { font-size: 1.12rem; }
.lh-young h1, .lh-young h2 { letter-spacing: 0; }
.lh-young button, .lh-young .btn, .lh-young .bq-choice { min-height: 56px; font-size: 1.1rem; border-radius: 16px; }
.lh-young .bq-choice { padding: 14px 18px; }
.lh-young .badge { font-size: 1rem; padding: 8px 14px; }
.yg-h { margin: 26px 0 10px; font-size: 1.35rem; }
.yg-stars { margin: 4px 0 8px; font-size: 1.2rem; }
.yg-star { color: #b45309; font-size: 1.5rem; display: inline-block; animation: yg-twinkle 2.4s ease-in-out infinite; }
.yg-list { display: grid; gap: 12px; }
.yg-todo { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; text-decoration: none; color: inherit; min-height: 72px;
  animation: lh-in .4s ease both; animation-delay: calc(var(--i, 0) * 70ms); }
.yg-todo:hover, .yg-todo:focus-visible { border-color: var(--brand, #3d358c); transform: translateY(-2px); }
.yg-todo.late { border-color: #b42318; }
.yg-dot { width: 48px; height: 48px; border-radius: 50%; background: #3d358c; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex: none; }
.yg-t { display: grid; gap: 2px; flex: 1; min-width: 0; }
.yg-go { font-weight: 800; color: #3d358c; white-space: nowrap; }
.yg-clear { text-align: center; padding: 28px; }
.yg-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 14px; }
.yg-tile { display: grid; justify-items: center; gap: 8px; padding: 20px 12px; border-radius: 24px; background: linear-gradient(160deg, var(--lc) 50%, color-mix(in srgb, var(--lc) 60%, var(--lc2)));
  color: #fff; text-decoration: none; text-align: center; min-height: 168px; align-content: center; transition: transform .2s ease; animation: lh-in .45s ease both; animation-delay: calc(var(--i, 0) * 60ms); }
.yg-tile:hover, .yg-tile:focus-visible { transform: translateY(-5px) rotate(-1deg); }
.yg-letter { width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 2rem; font-weight: 800; }
.yg-count { font-size: .95rem; background: rgba(0, 0, 0, .22); padding: 3px 12px; border-radius: 99px; }
.yg-help { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.yg-help legend { font-weight: 700; margin-bottom: 6px; }
.yg-help label { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; margin: 0; }
.yg-help input { width: 22px; height: 22px; }
.fb-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-chips .chip { min-height: 32px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; cursor: pointer; color: inherit; }
.fb-chips .chip:hover { border-color: #3d358c; }
@keyframes yg-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .yg-star, .yg-todo, .yg-tile { animation: none; } .yg-tile:hover { transform: none; } }
.lh-young [hidden], .lh [hidden], .quiz-builder [hidden], form[data-steps] [hidden] { display: none !important; }

/* Learning hub: every block spans the same column, so left and right edges line up on every screen */
.lh-young, .lh-grid, .yg-tiles, .yg-list, .detail, .lh-hero, .lh-head { width: 100%; min-width: 0; }
.yg-tile strong, .yg-t strong { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .yg-todo { padding: 12px; gap: 10px; }
  .yg-dot { width: 40px; height: 40px; font-size: 1.1rem; }
  .yg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .yg-tile { min-height: 140px; padding: 14px 8px; }
  .yg-letter { width: 52px; height: 52px; font-size: 1.6rem; }
  .lh-grid { grid-template-columns: minmax(0, 1fr); }
  .lh-row { flex-wrap: wrap; gap: 6px; }
}
.lh-tabs { overflow-x: auto; align-items: center; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.lh-tabs::-webkit-scrollbar { display: none; }
.lh-tabs a { white-space: nowrap; flex: none; }
@media (max-width: 640px) { .lh-tabs a { padding: 8px 14px; } .lh-tabs { gap: 2px; } }

/* Report card templates: modern, compact, primary, detailed. They share the .rc base (always light, print friendly). */
.rc-foot { margin: 16px 0 0; text-align: center; font-size: .85rem; color: var(--ink-2); }
.rc-keyline { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; margin: 16px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.rc-remarks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; } @media (max-width: 700px) { .rc-remarks { grid-template-columns: 1fr; } }
/* modern */
.rc-modern { padding: 0; overflow: hidden; }
.rcm-head { display: flex; gap: 16px; align-items: center; padding: 22px 28px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: #fff; }
.rcm-head h2 { margin: 0; font-size: 1.3rem; color: inherit; } .rcm-head p { margin: 2px 0 0; opacity: .92; font-size: .9rem; }
.rcm-head .rc-crest-img { background: #fff; border-radius: 14px; padding: 6px; width: 72px; height: 72px; }
.rcm-who { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; padding: 20px 28px; }
.rcm-name { display: grid; gap: 2px; } .rcm-name strong { font-size: 1.35rem; }
.rcm-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.rcm-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.rcm-stats > div { display: grid; gap: 2px; min-width: 92px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); text-align: center; } .rcm-stats strong { font-size: 1.3rem; }
.rcm-table { width: calc(100% - 56px); margin: 0 28px; border-collapse: collapse; font-size: .88rem; }
.rcm-table th { text-align: center; padding: 10px 6px; font-size: .72rem; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--brand); } .rcm-table th span { display: block; font-weight: 400; }
.rcm-table td { text-align: center; padding: 10px 6px; border-bottom: 1px solid var(--line); } .rcm-table .l { text-align: left; }
.rcm-grade { display: inline-block; min-width: 34px; padding: 3px 8px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 14%, #fff); color: var(--brand); font-weight: 800; }
.rc-modern .rc-keyline, .rc-modern .rc-extras, .rc-modern .rc-remarks, .rc-modern .rc-foot, .rc-modern > p { margin-left: 28px; margin-right: 28px; }
.rc-modern .rc-remarks { margin-bottom: 24px; }
/* compact: one page */
.rc-compact { padding: 18px 20px; font-size: .85rem; }
.rcc-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--ink); padding-bottom: 6px; text-transform: uppercase; font-size: .9rem; }
.rcc-who { margin: 8px 0; }
.rcc-table { width: 100%; border-collapse: collapse; } .rcc-table th { text-align: center; padding: 5px; background: var(--surface-2); font-size: .72rem; text-transform: uppercase; }
.rcc-table td { text-align: center; padding: 4px 6px; border-bottom: 1px solid var(--line); } .rcc-table .l { text-align: left; }
.rc-compact .rc-remark p { min-height: 36px; padding: 8px; } .rc-compact .rc-remark h4 { margin-bottom: 2px; }
/* primary: friendly */
.rc-primary { padding: 0; overflow: hidden; font-size: 1.05rem; }
.rcp-head { display: flex; gap: 16px; align-items: center; padding: 20px 28px; background: color-mix(in srgb, var(--brand) 12%, #fff); }
.rcp-head h2 { margin: 0; color: var(--brand); } .rcp-head p { margin: 2px 0 0; }
.rcp-hello { display: flex; gap: 18px; align-items: center; padding: 20px 28px; } .rcp-hello h3 { margin: 0; font-size: 1.5rem; } .rcp-hello p { margin: 4px 0 0; }
.rcp-sum strong { color: var(--brand); }
.rcp-subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding: 0 28px 20px; }
.rcp-subject { border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.rcp-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rcp-bar { height: 12px; border-radius: 99px; background: var(--track); margin: 10px 0 6px; overflow: hidden; } .rcp-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.rcp-say { margin: 6px 0 0; font-style: italic; }
.rc-primary .rc-extras, .rc-primary .rc-remarks, .rc-primary .rc-foot { margin-left: 28px; margin-right: 28px; } .rc-primary .rc-remarks { margin-bottom: 24px; }
/* detailed: with a comparison chart */
.rcd-chart { border: 1px solid var(--ink); border-top: 0; padding: 10px 12px; display: grid; gap: 6px; }
.rcd-row { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 70px; gap: 10px; align-items: center; font-size: .82rem; }
.rcd-bars { position: relative; height: 18px; background: var(--track); border-radius: 6px; overflow: hidden; }
.rcd-bars i { position: absolute; left: 0; display: block; border-radius: 6px; } .rcd-bars .me { top: 0; height: 10px; background: var(--brand); } .rcd-bars .avg { top: 10px; height: 8px; background: #b8bfd4; }
.rcd-num { text-align: right; } .rcd-legend { display: flex; gap: 8px; align-items: center; margin: 6px 0 16px; }
.rcd-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; } .rcd-legend .me { background: var(--brand); } .rcd-legend .avg { background: #b8bfd4; }
.rcd-remarks { border: 1px solid var(--ink); border-top: 0; padding: 10px 14px; font-size: .85rem; } .rcd-remarks p { margin: 4px 0; }
@media (max-width: 640px) { .rcm-head, .rcm-who, .rcp-head, .rcp-hello { padding-left: 16px; padding-right: 16px; } .rcm-table { width: calc(100% - 32px); margin: 0 16px; } .rcd-row { grid-template-columns: 1fr 70px; } .rcd-name { grid-column: 1 / -1; } }
@media print { .rc-modern, .rc-primary { box-shadow: none; } .rcm-head, .rcp-head, .rcm-grade, .rcp-bar span, .rcd-bars i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* the designer */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.tpl-opt { position: relative; display: grid; gap: 8px; padding: 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; }
.tpl-opt input { position: absolute; opacity: 0; } .tpl-opt:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.tpl-opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.tpl-thumb { height: 96px; border-radius: 10px; background: var(--surface-2); padding: 8px; display: grid; gap: 4px; align-content: start; overflow: hidden; }
.tpl-thumb i { display: block; height: 6px; border-radius: 3px; background: #c9cde0; } .tpl-thumb i.h { height: 14px; background: var(--brand); } .tpl-thumb i.s { width: 60%; } .tpl-thumb i.b { height: 12px; background: #e3e6f2; }
.tpl-opt strong { font-size: .95rem; } .tpl-opt span { font-size: .8rem; color: var(--ink-2); }

/* the report card designer uses the full column, so the cards line up with the text above them */
.opt-card.wide { max-width: none; width: 100%; }
.opt-card.wide ~ *, .lead-p { max-width: none; }
.tpl-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
@media (min-width: 1100px) { .tpl-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* class card and classroom banners: the subject name is always white and bold, on every colour */
.lh-banner h3, .lh-head h1, .yg-tile strong { color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.lh-banner span, .lh-head p { color: #fff; }

/* classrooms grouped by class, so a school's page reads class by class */
.lh-class { margin-top: 14px; }
.lh-class-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.05rem; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.lh-class-h .count { font-size: .85rem; font-weight: 500; color: var(--ink-2); }
.lh-class .lh-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

/* classroom action bar: buttons on the left, "add a topic" on the right, one row, same height; stacks neatly on a phone */
.lh-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px; margin: 4px 0 18px; }
.lh-bar-l, .lh-bar-r { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.lh-bar .btn, .lh-bar button { min-height: 44px; margin: 0; white-space: nowrap; }
.lh-bar-r input { min-height: 44px; width: 260px; max-width: 100%; margin: 0; }
@media (max-width: 640px) { .lh-bar { align-items: stretch; } .lh-bar-l, .lh-bar-r { width: 100%; } .lh-bar-l .btn { flex: 1; text-align: center; justify-content: center; } .lh-bar-r input { flex: 1; width: auto; min-width: 0; } }

/* content library */
.lib-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-bottom: 12px; }
.lib-store { display: flex; align-items: center; gap: 10px; min-width: 260px; } .lib-store .progress { flex: 1; min-width: 80px; }
.lib-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; } .lib-filter input { flex: 1; min-width: 200px; max-width: 420px; margin: 0; min-height: 44px; }
.lib-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; } @media (max-width: 880px) { .lib-layout { grid-template-columns: 1fr; } }
.lib-folders { display: grid; gap: 4px; }
.lib-folder-row { display: flex; align-items: center; gap: 4px; }
.lib-folder { display: flex; justify-content: space-between; flex: 1; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); } .lib-folder:hover { background: var(--surface-2); }
.lib-folder.on { background: var(--brand); color: #fff; } .lib-folder.on .count { color: #fff; }
.lib-x { min-height: 32px; padding: 0 8px; }
.lib-newfolder { display: flex; gap: 6px; margin-top: 8px; } .lib-newfolder input { min-width: 0; margin: 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.lib-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: transform .18s ease, box-shadow .18s ease; }
.lib-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(28, 32, 64, .1); }
.lib-link { display: grid; gap: 5px; padding: 14px 16px; text-decoration: none; color: inherit; }
.lib-kind { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; background: #3d358c; text-transform: uppercase; }
.lib-kind.lib-note { background: #1f7a3a; } .lib-kind.lib-link { background: #1f5fbf; } .lib-kind.lib-video { background: #b42318; }
.lib-pick { position: absolute; top: 10px; right: 12px; margin: 0; } .lib-pick input { width: 20px; height: 20px; }
.lib-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.lib-form { max-width: 760px; }
.lib-kinds { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; } .lib-kinds legend { font-weight: 700; margin-bottom: 8px; }
.lib-kindopt { display: flex; gap: 10px; padding: 12px; border: 2px solid var(--line); border-radius: 14px; margin: 0; cursor: pointer; }
.lib-kindopt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.lib-kindopt small { display: block; color: var(--ink-2); font-weight: 400; }
.lib-drop { border: 2px dashed var(--line); border-radius: 16px; padding: 22px; text-align: center; transition: border-color .15s ease, background .15s ease; }
.lib-drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.lib-drop input[type=file] { margin: 0 auto 8px; max-width: 100%; }
.lib-share { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-weight: 500; }
.lib-preview { margin: 10px 0; } .lib-preview img { max-width: 100%; max-height: 360px; border-radius: 12px; border: 1px solid var(--line); }
.lib-filerow { gap: 8px; flex-wrap: wrap; }
.lib-courses { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.lib-course { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 0; font-weight: 500; }
.lib-when { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; } .lib-when label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 500; flex-wrap: wrap; }
.lib-when input[type=datetime-local] { margin: 0; min-height: 36px; }
@media (prefers-reduced-motion: reduce) { .lib-card, .lib-drop { transition: none; } .lib-card:hover { transform: none; } }
/* library pages use the same full column as every other learning page */
.lib-form { max-width: none; width: 100%; }
.lib-form .two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* one-tap light/dark button in the top bar, for every signed-in role */
.mode-flip { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; border-radius: 50%; }
.mode-flip:hover { background: var(--surface-2); }
.mode-flip .i { width: 22px; height: 22px; }
.mode-flip .sun { display: none; } .mode-flip[data-now="dark"] .sun { display: block; } .mode-flip[data-now="dark"] .moon { display: none; }

/* question import */
.qi-example { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font: 13px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; margin: 0; }
.qi-item.bad { border-color: #b42318; }
.qi-take { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 500; } .qi-take input { margin-top: 4px; flex: none; }
.qi-choices { margin: 8px 0 0 34px; padding: 0; display: grid; gap: 3px; } .qi-choices li.right { font-weight: 700; }
.qi-problem { margin: 8px 0 0 34px; }
.qi-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; } @media (max-width: 1000px) { .qi-layout { grid-template-columns: 1fr; } }

/* tests and exams */
.tx-rules { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 12px; } .tx-rules legend { font-weight: 700; padding: 0 6px; }
.tx-rules [hidden] { display: none !important; }
.test-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 14px rgba(28, 32, 64, .08); }
.test-clock { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 800; margin-left: auto; color: var(--brand); } .test-clock.low { color: #b42318; animation: lh-pulse 1s ease-in-out infinite; }
@keyframes lh-pulse { 50% { opacity: .55; } } @media (prefers-reduced-motion: reduce) { .test-clock.low { animation: none; } }
/* a student's work page: the work gets the wide column, the status card the narrow one */
.detail.lh-asg { grid-template-columns: minmax(0, 1fr) 300px; } @media (max-width: 1000px) { .detail.lh-asg { grid-template-columns: 1fr; } }

/* my grades: one card per subject, in the columns the school chose */
.mg-sum { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 18px; }
.mg-sum > div { min-width: 130px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; } .mg-sum strong { font-size: 1.5rem; }
.mg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.mg-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; animation: lh-in .35s ease both; }
.mg-card header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; } .mg-card h3 { margin: 0; font-size: 1.05rem; }
.mg-grade { min-width: 42px; text-align: center; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--brand); font-weight: 800; }
.lh-fields { display: flex; flex-wrap: wrap; gap: 8px; } .lh-field { display: grid; gap: 2px; min-width: 88px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.lh-field strong { font-size: 1.15rem; } .lh-total { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.mg-bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; margin-top: 10px; } .mg-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.mg-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .82rem; color: var(--ink-2); }
.lh-young .mg-card { border-width: 2px; } .lh-young .lh-field strong { font-size: 1.3rem; }
.qi-edit { width: 100%; margin: 8px 0; } .qi-opts { display: grid; gap: 6px; }
.qi-opt { display: flex; align-items: center; gap: 8px; margin: 0; } .qi-opt input[type=text], .qi-opt input:not([type]) { flex: 1; margin: 0; min-width: 0; }
.qi-opt.right input:not([type=radio]) { border-color: #1f7a3a; } .qi-letter { width: 26px; font-weight: 800; text-align: center; }

/* item analysis */
.ia-hist { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 150px; }
.ia-col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 4px; }
.ia-bar { align-self: end; width: 100%; max-width: 38px; min-height: 2px; background: var(--brand); border-radius: 6px 6px 0 0; } .ia-n { font-size: .8rem; font-weight: 700; } .ia-l { font-size: .68rem; color: var(--ink-2); }
.ia-pct { font-size: 1.3rem; font-weight: 800; white-space: nowrap; } .ia-pct.low { color: #b42318; } .ia-pct.high { color: #1f7a3a; }
.ia-track { height: 8px; border-radius: 99px; background: var(--track); margin: 8px 0; overflow: hidden; } .ia-track span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.ia-opts { display: grid; gap: 4px; margin-top: 6px; }
.ia-opt { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); overflow: hidden; font-size: .9rem; }
.ia-bar2 { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--brand) 16%, transparent); } .ia-opt.right .ia-bar2 { background: color-mix(in srgb, #1f7a3a 26%, transparent); }
.ia-opt-t, .ia-opt-n { position: relative; } .ia-opt-n { white-space: nowrap; color: var(--ink-2); }
.ia-flag { margin: 8px 0 0; font-size: .9rem; } .ia-flag.check { color: var(--ink); }

/* offline / poor connection notice */
.net-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 12px;
  background: var(--ink, #1b1a33); color: #fff; font-size: .92rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.net-banner[hidden] { display: none; }
.net-banner[data-tone="warn"] { background: #8a4b00; }
.net-banner[data-tone="ok"] { background: #1c6b3a; }

/* read aloud */
.speak-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.speak-btn { min-height: 36px; padding: 4px 14px; border-radius: 999px; border: 1.5px solid var(--brand, #3d358c); background: transparent; color: var(--brand, #3d358c); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.speak-btn[aria-pressed="true"] { background: var(--brand, #3d358c); color: #fff; }
.speak-btn:hover, .speak-btn:focus-visible, .speak-btn[aria-pressed="true"] { background: var(--brand, #3d358c); color: #fff; border-color: var(--brand, #3d358c); }
.speak-btn:hover:not([aria-pressed="true"]) { filter: brightness(1.1); }

/* accessibility: contrast fixes found by the axe audit (e2e/test_accessibility.py) */
.sidebar .side-foot .logout, .sheet-in .logout { color: #ffbe73; }
.room-tabs a, .link-add { color: var(--brand-text); }
.room-tabs a.on { color: #fff; }
.c-blue { background: #2563eb; } .c-pink { background: #c01f95; } .c-orange { background: #b45309; }
.locked-card { opacity: 1; border-style: dashed; } .locked-card .muted { color: var(--ink-2); }
.badge[data-locked] { background: transparent; border: 1px dashed var(--line); color: var(--ink-2); }
.skip-link { position: absolute; left: 8px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
/* exam practice: the question navigator */
.pq-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.pq-nav button { min-width: 42px; min-height: 42px; padding: 0 8px; border-radius: 10px; background: transparent; color: var(--ink); border: 1.5px solid var(--line); font-weight: 600; }
.pq-nav button:hover { background: var(--brand-soft); color: var(--brand-text); }
.pq-nav button.done { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand); }
.pq-nav button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.test-clock { color: var(--brand-text); }
.test-clock.low { color: var(--danger); }

/* in-page confirmation (replaces the browser's confirm box) */
dialog.ts-confirm { padding: 22px; }
dialog.ts-confirm p { margin: 0 0 16px; font-size: 1.05rem; line-height: 1.5; }
.ts-confirm-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
/* exam practice landing, hub and cards */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 14px 0; }
.exam-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm, 0 2px 10px rgba(28,32,64,.06)); transition: transform .2s, border-color .2s; }
.exam-card:hover, .exam-card:focus-visible { transform: translateY(-3px); border-color: var(--brand); }
.exam-card img { flex: none; border-radius: 16px; }
.exam-card-body { display: grid; gap: 4px; }
.exam-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.exam-head img { border-radius: 14px; }
.gym-banner { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); margin: 12px 0; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 14px 0; }
.mode-card { display: grid; gap: 6px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); position: relative; }
.mode-card:hover, .mode-card:focus-visible { border-color: var(--brand); transform: translateY(-3px); }
.mode-card.is-off { opacity: 1; border-style: dashed; }
.mode-no { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; font-weight: 800; }
.pq-diagram { margin: 10px 0; padding: 10px; border-radius: 12px; background: var(--surface-2, transparent); border: 1px solid var(--line); color: var(--ink); max-width: 100%; overflow-x: auto; }
.pq-diagram svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.pq-diagram img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.bq-choice.is-right { border-color: var(--success, #1c6b3a); background: var(--success-bg, rgba(28,107,58,.1)); }
.bq-choice.is-wrong { border-color: var(--danger); background: var(--danger-bg, rgba(180,35,24,.08)); }
.pq-why { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); }
.fc-card { min-height: 220px; display: grid; place-content: center; text-align: center; padding: 24px; cursor: pointer; gap: 10px; }
.fc-text { font-size: 1.25rem; font-weight: 700; margin: 0; white-space: pre-line; }
.fc-label { margin: 0 0 4px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.fc-back { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 14px; }
.fc-rate { gap: 10px; margin-top: 12px; flex-wrap: wrap; }
#deck > button { margin-top: 12px; }
.exam-card img, .exam-head img { object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; border: 1px solid var(--line); }

/* sign-in picture changes with the profile */
.auth-visual img { transition: opacity .14s ease; }
.auth-visual img.swap { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .auth-visual img { transition: none; } }

/* one Techscholar logo at a time: the light and dark versions were both showing in light mode, because ".logo img" outranked the hide rule */
.logo img.logo-on-dark, .powered img.logo-on-dark { display: none; }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) .logo img.logo-on-light, :root:not([data-mode="light"]) .powered img.logo-on-light { display: none; }
  :root:not([data-mode="light"]) .logo img.logo-on-dark, :root:not([data-mode="light"]) .powered img.logo-on-dark { display: block; }
}
:root[data-mode="dark"] .logo img.logo-on-light, :root[data-mode="dark"] .powered img.logo-on-light { display: none; }
:root[data-mode="dark"] .logo img.logo-on-dark, :root[data-mode="dark"] .powered img.logo-on-dark { display: block; }
.powered img.logo-on-light { display: inline-block; }
/* password show / hide */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); min-height: 36px; min-width: 60px; padding: 4px 10px; border-radius: 999px; border: 0; background: transparent; color: var(--brand-text, var(--brand)); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.pw-toggle:hover, .pw-toggle:focus-visible { background: var(--brand-soft); color: var(--brand-text, var(--brand)); }
