:root {
  --ink: #17182c;
  --muted: #74758b;
  --line: #e8e8f1;
  --paper: #ffffff;
  --canvas: #f7f7fb;
  --primary: #5b5bd6;
  --primary-dark: #4848bd;
  --primary-soft: #ededff;
  --green: #169b73;
  --green-soft: #e9f8f2;
  --amber: #d88b1d;
  --amber-soft: #fff5e6;
  --red: #d85555;
  --red-soft: #feeeee;
  --shadow: 0 12px 36px rgba(35, 35, 74, 0.07);
  --radius: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 20;
  display: flex; flex-direction: column; padding: 28px 18px 20px;
  background: var(--paper); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0 10px; cursor: pointer; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  color: white; font-size: 18px; font-weight: 800; background: var(--primary);
  box-shadow: 0 8px 16px rgba(91,91,214,.22); transform: rotate(-5deg);
}
.brand-name { font-size: 19px; font-weight: 760; letter-spacing: -.5px; }
.brand-name span { color: var(--primary); }
.primary-nav { display: flex; flex-direction: column; gap: 5px; margin-top: 44px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 13px; width: 100%; min-height: 46px;
  padding: 0 13px; border: 0; border-radius: 12px; background: transparent; color: #68697c;
  font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; transition: .2s ease;
}
.nav-item:hover { color: var(--ink); background: #f4f4fa; }
.nav-item.active { color: var(--primary); background: var(--primary-soft); }
.side-bottom { margin-top: auto; }
.user-card { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; color: #53453b; background: #f2d9c8; font-size: 12px; font-weight: 800; }
.user-card > div:nth-child(2) { min-width: 0; }
.user-card strong, .user-card span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-card strong { font-size: 11px; }
.user-card span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.user-card .icon-btn { margin-left: auto; }

.main { grid-column: 2; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 34px 42px 22px; max-width: 1500px; margin: auto; }
.topbar-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-btn { flex: 0 0 auto; border: 1px solid var(--line); background: white; }

.menu-scrim {
  position: fixed; inset: 0; z-index: 40; visibility: hidden; opacity: 0;
  background: rgba(20,20,45,.45); transition: opacity .2s ease, visibility .2s ease;
}
.menu-scrim.open { visibility: visible; opacity: 1; }
.app-menu {
  position: fixed; inset: 0 auto 0 0; z-index: 50; visibility: hidden;
  display: flex; flex-direction: column; width: min(290px, 86vw);
  padding: 24px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--paper); border-right: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(20,20,45,.18);
  transform: translateX(-100%); transition: transform .22s ease, visibility .22s ease;
}
.app-menu.open { visibility: visible; transform: none; }
.app-menu-head { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px; border-bottom: 1px solid var(--line); }
.app-menu-head > div:nth-child(2) { min-width: 0; }
.app-menu-head strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.app-menu-head span { display: block; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 10px; }
.app-menu-head .icon-btn { margin-left: auto; flex: 0 0 auto; }
.app-menu-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.app-menu-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px;
  border: 0; border-radius: 12px; background: none; color: var(--ink);
  font-size: 13px; font-weight: 700; text-align: left; cursor: pointer;
}
.app-menu-item:hover { background: #f1f1f7; }
.app-menu-item svg { width: 18px; height: 18px; }
.app-menu-item.danger { color: var(--red); }
.app-menu-item.danger:hover { background: var(--red-soft); }
@media (prefers-reduced-motion: reduce) {
  .app-menu, .menu-scrim { transition: none; }
}
.eyebrow { margin: 0 0 7px; color: #9293a4; font-size: 10px; font-weight: 750; letter-spacing: .13em; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 32px); letter-spacing: -.04em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.top-actions .notification-btn { margin-left: auto; }

/* Shown on every screen except the open register itself, so a session left
   running while the team reads another page is never invisible. */
.attendance-live-bar { display:flex; align-items:center; gap:10px; width:calc(100% - 84px); max-width:1416px; margin:0 auto 14px; padding:11px 14px; border:1px solid rgba(216,139,29,.32); border-radius:12px; background:var(--amber-soft); color:#8a5709; font-size:12px; font-weight:700; text-align:left; cursor:pointer; }
.attendance-live-bar:hover { border-color:var(--amber); }
.attendance-live-dot { flex:0 0 auto; width:8px; height:8px; border-radius:50%; background:var(--amber); box-shadow:0 0 0 0 rgba(216,139,29,.45); animation:attendance-live-pulse 1.8s infinite; }
.attendance-live-text { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attendance-live-cta { flex:0 0 auto; padding:4px 9px; border-radius:7px; background:var(--amber); color:white; font-size:10px; font-weight:800; letter-spacing:.03em; }
@keyframes attendance-live-pulse { 70% { box-shadow:0 0 0 7px rgba(216,139,29,0); } 100% { box-shadow:0 0 0 0 rgba(216,139,29,0); } }
.settings-btn {
  position: relative; flex: 0 0 auto; width: 42px; height: 42px; padding: 0;
  color: var(--primary); border: 1px solid #dcdcec; border-radius: 11px; background: white;
  box-shadow: 0 4px 12px rgba(35,35,74,.04);
}
.settings-btn > svg { width: 19px; height: 19px; }
.course-switcher { position:relative; display:flex; align-items:center; gap:8px; min-width:230px; height:42px; padding:0 10px; border:1px solid #dcdcec; border-radius:11px; background:white; box-shadow:0 4px 12px rgba(35,35,74,.04); cursor:pointer; transition:border-color .15s, box-shadow .15s; }
.course-switcher:hover { border-color:var(--primary); box-shadow:0 4px 14px rgba(99,102,241,.10); }
.course-switcher > svg:first-child { flex:0 0 auto; width:16px; height:16px; color:var(--primary); }
.course-switcher > span { color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.07em; }
.course-switcher-trigger { all:unset; min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink); font-size:11px; font-weight:750; cursor:pointer; line-height:42px; }
.course-switcher-chevron { flex:0 0 auto; color:var(--primary); transition:transform .2s; }
.course-switcher.open .course-switcher-chevron { transform:rotate(180deg); }
.course-switcher.open { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.course-switcher-dropdown { position:absolute; top:calc(100% + 6px); left:0; right:0; margin:0; padding:6px; list-style:none; background:white; border:1px solid #dcdcec; border-radius:12px; box-shadow:0 8px 30px rgba(35,35,74,.12); z-index:999; max-height:260px; overflow-y:auto; animation:cs-drop-in .15s ease-out; }
@keyframes cs-drop-in { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.course-switcher-dropdown li { padding:10px 12px; border-radius:8px; font-size:12px; font-weight:600; color:var(--ink); cursor:pointer; transition:background .12s, color .12s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.course-switcher-dropdown li:hover { background:var(--primary-soft); color:var(--primary); }
.course-switcher-dropdown li.active { background:var(--primary); color:white; }
.course-switcher:focus-within { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.role-switch { display:flex; align-items:center; gap:8px; min-height:34px; padding:0 10px 0 12px; color:var(--muted); border:1px solid var(--line); border-radius:10px; background:white; font-size:10px; font-weight:750; cursor:pointer; }
.role-switch:hover { color:var(--primary); border-color:#cccced; }
.role-swap { display:grid; place-items:center; width:19px; height:19px; color:var(--primary); border-radius:6px; background:var(--primary-soft); font-size:12px; }
.icon-btn { display: grid; place-items: center; border: 0; background: none; padding: 8px; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: #f1f1f7; }
.notification-btn {
  position: relative; flex: 0 0 auto; width: 42px; height: 42px; padding: 0;
  color: var(--primary); border: 1px solid #dcdcec; background: white;
  box-shadow: 0 4px 12px rgba(35,35,74,.04);
}
.notification-btn > svg { width: 19px; height: 19px; }
.notification-btn.has-unread { border-color: #cccced; background: #f9f9ff; }
.notification-btn > .notification-count {
  position: absolute; top: -6px; right: -6px; display: flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid var(--canvas); border-radius: 999px;
  color: white; background: var(--red); font-size: 8px; font-weight: 800; line-height: 1;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 17px;
  border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(35,35,74,.08); }
.btn-primary { color: white; border-color: var(--primary); background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-soft { color: var(--primary); border-color: transparent; background: var(--primary-soft); }
.btn-danger { color: var(--red); border-color: #f4d2d2; }
.btn:disabled { cursor: not-allowed; opacity: .48; transform: none; box-shadow: none; }
.btn svg { width: 16px; height: 16px; }
.view { max-width: 1500px; margin: auto; padding: 0 42px 50px; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .78fr); gap: 22px; }
.left-stack, .right-stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 2px 5px rgba(30,30,70,.01); }
.card-pad { padding: 23px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.text-btn { border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer; }

.hero-session { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; min-height: 192px; padding: 26px 28px; color: white; border-radius: var(--radius); background: linear-gradient(125deg, #5556cc, #7774e7); box-shadow: 0 16px 40px rgba(85,86,204,.23); }
.hero-session::after { content:""; position:absolute; right:-45px; top:-100px; width: 310px; height: 310px; border: 38px solid rgba(255,255,255,.07); border-radius:50%; }
.hero-copy { position: relative; z-index: 1; }
.live-tag { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 7px; background: rgba(255,255,255,.13); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.live-tag::before { content:""; width: 6px; height: 6px; border-radius:50%; background:#7ff0c6; box-shadow:0 0 0 4px rgba(127,240,198,.13); }
.hero-session h2 { margin: 18px 0 6px; font-size: 23px; letter-spacing: -.03em; }
.hero-session p { margin: 0; color: rgba(255,255,255,.74); font-size: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; font-size: 11px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 15px; height: 15px; opacity: .8; }
.hero-action { position: relative; z-index: 1; display: flex; align-items: flex-end; }
.hero-action .btn { color: var(--primary); border: 0; background: white; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { padding: 18px 19px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon svg { width: 17px; height: 17px; }
.trend { color: var(--green); font-size: 9px; font-weight: 800; }
.stat-value { margin: 14px 0 3px; font-size: 24px; font-weight: 780; letter-spacing: -.04em; }
.stat-label { color: var(--muted); font-size: 10px; }

.attendance-analytics { overflow:hidden; }
.analytics-heading { align-items:flex-start; }
.analytics-heading .stat-label { display:block; margin-top:5px; }
.analytics-head-metrics { display:flex; flex-direction:column; align-items:flex-end; gap:5px; color:var(--muted); font-size:9px; }
.analytics-head-metrics b { color:var(--ink); font-size:14px; }
.analytics-head-metrics .positive { color:var(--green); font-weight:750; }
.analytics-head-metrics .negative { color:var(--red); font-weight:750; }
.attendance-analytics-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(220px,.7fr); gap:16px; }
.attendance-trend-panel, .mini-plot { min-width:0; border:1px solid #ededf5; border-radius:15px; background:linear-gradient(180deg,#fff,#fbfbff); }
.attendance-trend-panel { padding:17px 16px 8px; }
.plot-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.plot-title strong { font-size:11px; }
.plot-title span { color:var(--muted); font-size:8px; text-transform:uppercase; letter-spacing:.06em; }
.attendance-trend-chart { display:block; width:100%; height:auto; margin-top:10px; overflow:visible; }
.attendance-grid-line line { stroke:#ececf4; stroke-width:1; stroke-dasharray:3 5; }
.attendance-grid-line text, .attendance-day-label { fill:#9494a5; font-size:9px; }
.attendance-area { fill:rgba(91,91,214,.09); }
.attendance-line { fill:none; stroke:var(--primary); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.attendance-point circle { fill:white; stroke:var(--primary); stroke-width:3; cursor:help; transition:.18s ease; vector-effect:non-scaling-stroke; }
.attendance-point:hover circle, .attendance-point:focus circle { fill:var(--primary); stroke:white; transform:scale(1.35); transform-box:fill-box; transform-origin:center; outline:none; }
.attendance-point:focus { outline:none; }
.attendance-supporting-plots { display:grid; grid-template-rows:auto 1fr; gap:12px; }
.mini-plot { padding:15px; }
.attendance-share-content { display:flex; align-items:center; justify-content:space-around; gap:15px; margin-top:17px; }
.attendance-donut { position:relative; width:108px; height:108px; flex:0 0 auto; }
.attendance-donut svg { width:100%; height:100%; transform:rotate(-90deg); }
.attendance-donut circle { fill:none; stroke-width:4.6; }
.donut-track { stroke:#efeff5; }
.donut-value { stroke:var(--primary); stroke-linecap:round; }
.attendance-donut > span { position:absolute; inset:0; display:grid; place-content:center; text-align:center; }
.attendance-donut strong { font-size:20px; letter-spacing:-.05em; }
.attendance-donut small { margin-top:2px; color:var(--muted); font-size:8px; text-transform:uppercase; letter-spacing:.07em; }
.attendance-legend { display:flex; flex-direction:column; gap:10px; color:var(--muted); font-size:9px; }
.attendance-legend span { display:grid; grid-template-columns:7px auto 1fr; align-items:center; gap:6px; }
.attendance-legend i { width:7px; height:7px; border-radius:50%; background:var(--primary); }
.attendance-legend .absent i { background:#d9d9e5; }
.attendance-legend b { color:var(--ink); font-size:11px; }
.weekday-bars { display:grid; grid-template-columns:repeat(7,1fr); gap:7px; height:112px; margin-top:13px; }
.weekday-bar { display:grid; grid-template-rows:1fr auto; gap:6px; min-width:0; text-align:center; }
.weekday-bar > span { position:relative; display:flex; align-items:flex-end; overflow:hidden; min-height:0; border-radius:6px; background:#f1f1f6; }
.weekday-bar i { display:block; width:100%; border-radius:6px; background:#d8d8e5; transition:height .45s ease; }
.weekday-bar.has-data i { background:linear-gradient(180deg,#8582ed,var(--primary)); }
.weekday-bar b { color:var(--muted); font-size:8px; }
.analytics-empty { display:flex; align-items:center; gap:14px; min-height:130px; padding:22px; border:1px dashed #dcdcf0; border-radius:15px; background:#fafaff; }
.analytics-empty .empty-icon { flex:0 0 auto; margin:0; }
.analytics-empty strong { font-size:12px; }
.analytics-empty p { margin:5px 0 0; color:var(--muted); font-size:10px; line-height:1.5; }
.analytics-empty .btn { margin-top:12px; }
.analytics-loading-chart { height:190px; display:flex; align-items:flex-end; gap:8%; padding:22px 7% 14px; border:1px solid var(--line); border-radius:14px; background:linear-gradient(180deg,#fbfaff,#fff); }
.analytics-loading-chart i { flex:1; min-width:10px; border-radius:8px 8px 3px 3px; background:linear-gradient(90deg,#ecebfa,#d9d7f7,#ecebfa); background-size:220% 100%; animation:history-shimmer 1.25s linear infinite; }
.analytics-loading-chart i:nth-child(1), .analytics-loading-chart i:nth-child(5) { height:42%; }
.analytics-loading-chart i:nth-child(2) { height:68%; }
.analytics-loading-chart i:nth-child(3), .analytics-loading-chart i:nth-child(6) { height:55%; }
.analytics-loading-chart i:nth-child(4) { height:82%; }
.history-status-card { display:flex; align-items:center; gap:16px; }
.history-status-card h2 { margin:0 0 5px; font-size:14px; }
.history-status-card p { margin:0; color:var(--muted); font-size:11px; line-height:1.5; }
.history-status-card .btn { margin-top:12px; }
.history-spinner { width:24px; height:24px; flex:0 0 auto; border:3px solid #deddf4; border-top-color:var(--primary); border-radius:50%; animation:history-spin .75s linear infinite; }
.history-inline-error { display:flex; align-items:center; justify-content:space-between; gap:12px; }
@keyframes history-spin { to { transform:rotate(360deg); } }
@keyframes history-shimmer { to { background-position:-220% 0; } }
@media (prefers-reduced-motion: reduce) {
  .history-spinner, .analytics-loading-chart i { animation:none; }
  .attendance-point circle { transition:none; }
}

.class-list { display: flex; flex-direction: column; }
.class-row { display: grid; grid-template-columns: 56px minmax(0,1fr) auto auto; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.class-row:first-child { border-top: 0; padding-top: 2px; }
.time { font-size: 11px; font-weight: 750; }
.time small { display: block; color: var(--muted); font-size: 9px; font-weight: 500; margin-top: 3px; }
.course strong { display:block; font-size: 12px; }
.course span { display:block; color:var(--muted); font-size:10px; margin-top:4px; }
.badge { display:inline-flex; align-items:center; gap:6px; padding:6px 9px; border-radius:20px; font-size:9px; font-weight:750; }
.badge.green { color:var(--green); background:var(--green-soft); }
.badge.amber { color:var(--amber); background:var(--amber-soft); }
.badge.gray { color:var(--muted); background:#f2f2f6; }
.badge.purple { color:var(--primary); background:var(--primary-soft); }
.badge::before { content:""; width:5px; height:5px; border-radius:50%; background:currentColor; }
.chevron { display:grid; place-items:center; color:#a8a8b6; background:none; border:0; cursor:pointer; }
.chevron svg { width:16px; height:16px; }

.date-card { padding: 21px; }
.date-top { display: flex; justify-content: space-between; align-items: start; }
.date-day { color: var(--muted); font-size: 11px; }
.date-number { font-size: 36px; font-weight: 780; line-height: 1; margin-top: 4px; letter-spacing: -.05em; }
.date-month { color: var(--primary); font-size: 11px; font-weight: 750; }
.week-strip { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin-top:22px; text-align:center; }
.week-strip span { padding:7px 2px; color:var(--muted); border-radius:9px; font-size:9px; }
.week-strip b { display:block; margin-top:6px; font-size:10px; color:var(--ink); }
.week-strip .selected { color:white; background:var(--primary); }
.week-strip .selected b { color:white; }
.activity-list { display:flex; flex-direction:column; gap:18px; }
.activity { display:grid; grid-template-columns:auto 1fr auto; gap:11px; align-items:start; }
.activity-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:9px; color:var(--green); background:var(--green-soft); }
.activity-icon.purple { color:var(--primary); background:var(--primary-soft); }
.activity-icon svg { width:15px; height:15px; }
.activity strong { display:block; font-size:10px; line-height:1.4; }
.activity p { margin:4px 0 0; color:var(--muted); font-size:9px; line-height:1.4; }
.activity time { color:#aaaaba; font-size:8px; }

.page-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(290px,.75fr); gap:22px; }
.page-card { padding:24px; }
.back-btn { display:inline-flex; align-items:center; gap:5px; margin-bottom:18px; padding:0; border:0; background:none; color:var(--muted); font-size:11px; font-weight:700; cursor:pointer; }
.back-btn svg { width:15px; height:15px; }
.session-title { display:flex; align-items:start; justify-content:space-between; gap:20px; padding-bottom:20px; border-bottom:1px solid var(--line); }
.session-title h2 { margin:0 0 6px; font-size:20px; }
.session-title p { margin:0; color:var(--muted); font-size:11px; }
.stepper { display:flex; gap:0; margin:24px 0; }
.step { position:relative; flex:1; text-align:center; color:#a0a1ae; font-size:9px; font-weight:700; }
.step::before { content:""; display:block; height:3px; margin-bottom:9px; background:#ececf2; }
.step:first-child::before { border-radius:4px 0 0 4px; }
.step:last-child::before { border-radius:0 4px 4px 0; }
.step.active { color:var(--primary); }
.step.active::before, .step.done::before { background:var(--primary); }
.step.done { color:var(--green); }
.setup-hero { padding:28px; text-align:center; border-radius:16px; background:#fafaff; border:1px dashed #dcdcf0; }
.setup-radar { position:relative; display:grid; place-items:center; width:100px; height:100px; margin:0 auto 20px; border-radius:50%; background:radial-gradient(circle, #e7e7ff 0 26%, transparent 27% 43%, #efefff 44% 45%, transparent 46% 64%, #f1f1ff 65% 66%, transparent 67%); color:var(--primary); }
.setup-radar::before, .setup-radar::after { content:""; position:absolute; width:7px; height:7px; border-radius:50%; background:var(--primary); }
.setup-radar::before { left:18px; top:36px; }
.setup-radar::after { right:14px; bottom:26px; }
.setup-radar svg { width:29px; height:29px; }
.setup-hero h3 { margin:0 0 7px; font-size:16px; }
.setup-hero p { max-width:420px; margin:0 auto; color:var(--muted); font-size:10px; line-height:1.6; }
.check-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:18px; }
.device-check { display:flex; align-items:center; gap:12px; padding:15px; border:1px solid var(--line); border-radius:13px; background:white; text-align:left; cursor:pointer; }
.device-check:hover { border-color:#cacaf0; }
.device-check .device-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; color:var(--primary); background:var(--primary-soft); }
.device-check strong, .device-check span { display:block; }
.device-check strong { font-size:11px; }
.device-check span { margin-top:3px; color:var(--muted); font-size:9px; }
.checkmark { display:grid; place-items:center; margin-left:auto; width:20px; height:20px; border:1px solid #d7d7e2; border-radius:50%; color:white; }
.device-check.ready .checkmark { border-color:var(--green); background:var(--green); }
.device-check.ready { border-color:#bce7d8; }
.device-check.ready .device-icon { color:var(--green); background:var(--green-soft); }
.setup-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; margin-top:20px; }
.manual-add-row { display:flex; flex:1 1 100%; gap:8px; }
.manual-add-row .text-input { width:auto; flex:1; }

.past-session-picker { display:flex; align-items:center; gap:10px; margin:14px 0; }
.past-session-picker span { flex:none; color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.07em; }
.past-session-picker .select { width:auto; min-width:220px; }

.roster-toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.roster-toolbar-actions { display:flex; align-items:center; gap:10px; }
.scan-status { display:flex; align-items:center; gap:8px; font-size:10px; font-weight:700; color:var(--green); }
.pulse { width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 0 5px rgba(22,155,115,.1); animation:pulse 1.5s infinite; }
@keyframes pulse { 50% { box-shadow:0 0 0 9px rgba(22,155,115,0); } }
.roster { border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.student-row { display:grid; grid-template-columns:36px minmax(0,1fr) auto auto; align-items:center; gap:12px; min-height:58px; padding:9px 14px; border-top:1px solid var(--line); }
.student-row:first-child { border-top:0; }
/* A row is now a toggle plus its own "open record" control, so the divider and
   the alternating avatar colours move to the wrapper the two share. */
.student-row-wrap { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; border-top:1px solid var(--line); }
.student-row-wrap:first-child { border-top:0; }
.student-row-wrap .student-row { border-top:0; }
.student-row-wrap:nth-child(3n+2) .student-avatar { background:#e1e8f7; }
.student-row-wrap:nth-child(3n) .student-avatar { background:#e1f2ea; }
.student-row-info { display:grid; place-items:center; width:38px; align-self:stretch; padding:0; color:var(--muted); background:white; border:0; border-left:1px solid var(--line); cursor:pointer; }
.student-row-info svg { width:14px; height:14px; }
button.student-row-info:hover { color:var(--primary); background:#fafaff; }
button.student-row-info:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }
.attendance-row { width:100%; color:inherit; background:white; font:inherit; text-align:left; }
.attendance-row.is-interactive { cursor:pointer; transition:background .15s ease, box-shadow .15s ease; }
.attendance-row.is-interactive:hover { position:relative; z-index:1; background:#fafaff; box-shadow:inset 3px 0 0 var(--primary); }
.attendance-row.is-interactive:focus-visible { position:relative; z-index:2; outline:2px solid var(--primary); outline-offset:-2px; }
.roster-scroll { max-height:620px; overflow:auto; overscroll-behavior:contain; }
.roster-bulk-actions { display:flex; justify-content:flex-end; gap:8px; margin:0 0 10px; }
.roster-picker { display:grid; gap:10px; margin:24px 0; }
.roster-picker > label { color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.07em; }
.roster-source-card { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:13px; margin-top:4px; padding:15px; border:1px solid var(--line); border-radius:13px; background:#fafaff; }
.roster-source-card .student-avatar { width:42px; height:42px; color:var(--primary); background:var(--primary-soft); }
.roster-source-card strong, .roster-source-card p { display:block; margin:0; }
.roster-source-card strong { font-size:11px; }
.roster-source-card p { margin-top:4px; color:var(--muted); font-size:9px; }
.roster-search-toolbar { gap:16px; margin-top:22px; }
.roster-search { display:flex; align-items:center; gap:8px; width:min(420px,100%); min-height:40px; padding:0 12px; border:1px solid var(--line); border-radius:10px; background:white; }
.roster-search svg { width:15px; height:15px; color:var(--muted); }
.roster-search input { width:100%; border:0; outline:0; background:transparent; font:inherit; font-size:10px; }
.professor-roster { max-height:660px; }
.student-avatar { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; font-size:9px; font-weight:800; background:#f0e2d8; }
.student-name strong { display:block; font-size:10px; }
.student-name span { color:var(--muted); font-size:9px; }
.signal { display:flex; gap:2px; align-items:flex-end; height:15px; }
.signal i { display:block; width:3px; background:#d8d8e2; border-radius:2px; }
.signal i:nth-child(1){height:5px}.signal i:nth-child(2){height:8px}.signal i:nth-child(3){height:11px}.signal i:nth-child(4){height:14px}
.signal.good i { background:var(--green); }
.signal.mid i:nth-child(-n+3) { background:var(--amber); }
.summary-ring { position:relative; display:grid; place-items:center; width:150px; height:150px; margin:18px auto; border-radius:50%; background:conic-gradient(var(--green) 0 var(--progress, 0%), #ededf3 var(--progress, 0%)); }
.summary-ring::after { content:""; position:absolute; width:116px; height:116px; border-radius:50%; background:white; }
.summary-ring > div { position:relative; z-index:1; text-align:center; }
.summary-ring strong { display:block; font-size:29px; letter-spacing:-.05em; }
.summary-ring span { color:var(--muted); font-size:9px; }
.summary-list { display:flex; flex-direction:column; gap:11px; margin-top:20px; }
.summary-item { display:flex; justify-content:space-between; font-size:10px; }
.summary-item span { color:var(--muted); }
.summary-item strong { font-size:11px; }
.security-note { display:flex; gap:10px; padding:13px; margin-top:18px; color:#67688a; border-radius:11px; background:#f7f7fc; font-size:9px; line-height:1.5; }
.security-note .lock { color:var(--primary); font-size:14px; }
.official-roster-actions { flex-wrap:wrap; }
.official-roster-actions .btn { flex:1 1 170px; }
.roster-upload-actions { justify-content:flex-start; margin:14px 0 4px; }

.quiz-builder { display:flex; flex-direction:column; gap:16px; }
.question-card { padding:18px; border:1px solid var(--line); border-radius:14px; }
.question-top { display:flex; align-items:center; gap:10px; }
.q-number { display:grid; place-items:center; width:25px; height:25px; border-radius:8px; color:var(--primary); background:var(--primary-soft); font-size:10px; font-weight:800; }
.question-top input { flex:1; border:0; outline:0; font-size:12px; font-weight:650; color:var(--ink); }
.options { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:14px; }
.option-input { display:flex; align-items:center; gap:8px; padding:9px 10px; border:1px solid var(--line); border-radius:9px; }
.option-input input[type="radio"] { accent-color:var(--green); }
.option-input input[type="text"] { width:100%; border:0; outline:0; color:var(--muted); font-size:10px; }
.add-question { min-height:52px; border:1px dashed #ccccdf; border-radius:13px; background:#fafafe; color:var(--primary); font-size:11px; font-weight:700; cursor:pointer; }
.quiz-settings label { display:block; margin:15px 0 7px; color:var(--muted); font-size:9px; font-weight:750; text-transform:uppercase; letter-spacing:.06em; }

.update-banner { position:fixed; z-index:1200; right:24px; bottom:24px; max-width:440px; display:flex; align-items:center; gap:18px; padding:16px 18px; border:1px solid rgba(91,91,214,.28); border-radius:16px; background:#fff; box-shadow:0 18px 48px rgba(33,34,72,.2); }
.update-banner[hidden] { display:none; }
.update-banner div { display:grid; gap:3px; }
.update-banner strong { color:var(--ink); font-size:13px; }
.update-banner span { color:var(--muted); font-size:11px; line-height:1.45; }
.update-banner .btn { flex:none; }
.update-settings-card { grid-column:1 / -1; }
.update-explainer { margin:18px 0; max-width:720px; color:var(--muted); font-size:12px; line-height:1.65; }

@media (max-width: 640px) {
  .update-banner { left:12px; right:12px; bottom:12px; align-items:flex-start; flex-direction:column; gap:12px; }
  .update-banner .btn { width:100%; }
}
.select, .text-input { width:100%; height:40px; border:1px solid var(--line); border-radius:10px; background:white; padding:0 11px; outline:none; font-size:10px; color:var(--ink); }
.select:focus, .text-input:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.quiz-live { text-align:center; padding:25px 10px; }
.response-count { font-size:46px; font-weight:800; letter-spacing:-.06em; color:var(--primary); }
.response-track { height:8px; overflow:hidden; margin:15px 0 8px; border-radius:8px; background:#ededf4; }
.response-track span { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--primary),#8d8bea); transition:width .5s ease; }

.empty-state { display:grid; place-items:center; min-height:430px; text-align:center; }
.empty-state > div { max-width:380px; }
.empty-icon { display:grid; place-items:center; width:68px; height:68px; margin:0 auto 17px; border-radius:20px; color:var(--primary); background:var(--primary-soft); }
.empty-icon svg { width:28px; height:28px; }
.empty-state h2 { margin:0 0 8px; font-size:19px; }
.empty-state p { margin:0 0 18px; color:var(--muted); font-size:11px; line-height:1.6; }
.course-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.course-card { position:relative; overflow:hidden; padding:20px; border:1px solid var(--line); border-radius:16px; background:white; }
.course-accent { width:36px; height:5px; margin-bottom:18px; border-radius:4px; background:var(--primary); }
.course-card:nth-child(2n) .course-accent { background:var(--green); }
.course-card h3 { margin:0 0 5px; font-size:14px; }
.course-card p { margin:0; color:var(--muted); font-size:9px; line-height:1.5; }
.course-code { display:flex; align-items:center; justify-content:space-between; margin-top:18px; padding:10px 11px; border-radius:10px; background:#f7f7fb; }
.course-code span { color:var(--muted); font-size:8px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.course-code strong { color:var(--primary); font-size:12px; letter-spacing:.08em; }
.course-join-codes { display:grid; gap:8px; margin-top:18px; }
.course-join-codes .course-code { margin-top:0; }
.course-footer { display:flex; align-items:center; justify-content:space-between; margin-top:14px; }
.course-footer span { display:inline-flex; align-items:center; gap:5px; color:var(--muted); font-size:9px; }
.course-footer svg { width:13px; height:13px; }
.join-panel { max-width:560px; margin:0 auto; padding:34px; text-align:center; }
.join-code { display:flex; align-items:flex-end; gap:9px; margin-top:20px; }
.join-code-field { flex:1; }
.join-code-field label { display:block; margin-bottom:7px; font-size:9px; color:var(--muted); font-weight:750; }
.join-code input { width:100%; height:46px; padding:0 15px; text-align:center; text-transform:uppercase; letter-spacing:.13em; font-weight:750; border:1px solid var(--line); border-radius:11px; outline:none; }
.join-code input:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.student-course-list { margin-top:22px; text-align:left; }
.modal-backdrop { position:fixed; inset:0; z-index:80; display:grid; place-items:center; padding:20px; background:rgba(20,20,40,.42); backdrop-filter:blur(3px); animation:fade .2s ease; }
.modal { width:min(470px,100%); padding:25px; border-radius:20px; background:white; box-shadow:0 30px 80px rgba(15,15,35,.22); }
.modal-head { display:flex; justify-content:space-between; align-items:start; margin-bottom:20px; }
.modal-head h2 { margin:0 0 5px; font-size:18px; }
.modal-head p { margin:0; color:var(--muted); font-size:9px; }
.notification-modal {
  display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(720px, calc(100dvh - 40px));
  padding: 0; overflow: hidden;
}
.notification-modal .modal-head { flex: 0 0 auto; margin: 0; padding: 24px 25px 18px; border-bottom: 1px solid var(--line); }
.notification-modal-title { display: flex; align-items: center; gap: 10px; }
.notification-modal-title > span {
  display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto;
  color: var(--primary); border-radius: 11px; background: var(--primary-soft);
}
.notification-modal-title svg { width: 18px; height: 18px; }
.notification-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 25px; border-bottom: 1px solid var(--line); background: #fbfbfe;
}
.notification-toolbar span { color: var(--muted); font-size: 10px; font-weight: 700; }
.notification-toolbar .text-btn:disabled { opacity: .45; cursor: default; }
.notification-list { min-height: 130px; overflow-y: auto; overscroll-behavior: contain; }
.notification-item {
  position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px;
  width: 100%; padding: 15px 25px; border: 0; border-bottom: 1px solid var(--line);
  color: var(--ink); background: white; text-align: left; cursor: pointer;
}
.notification-item:hover { background: #fafaff; }
.notification-item.is-unread { background: #f8f8ff; }
.notification-kind {
  display: grid; place-items: center; width: 38px; height: 38px; color: var(--primary);
  border-radius: 12px; background: var(--primary-soft);
}
.notification-kind.is-attendance { color: #087b59; background: var(--green-soft); }
.notification-kind.is-material { color: #9b6111; background: var(--amber-soft); }
.notification-kind svg { width: 17px; height: 17px; }
.notification-copy { min-width: 0; }
.notification-copy strong, .notification-copy span, .notification-copy small { display: block; }
.notification-copy strong { overflow: hidden; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.notification-copy span { margin-top: 4px; color: #55566d; font-size: 10px; line-height: 1.45; }
.notification-copy small { margin-top: 7px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .02em; }
.notification-unread-dot { align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.notification-empty { display: grid; place-items: center; min-height: 230px; padding: 34px; text-align: center; }
.notification-empty .empty-icon { margin: 0 auto 12px; }
.notification-empty h3 { margin: 0 0 7px; font-size: 14px; }
.notification-empty p { max-width: 330px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.notification-status {
  display: flex; align-items: center; gap: 9px; flex: 0 0 auto; margin: 0; padding: 12px 25px;
  color: var(--muted); border-top: 1px solid var(--line); background: #fbfbfe; font-size: 9px; line-height: 1.45;
}
.notification-status svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--primary); }
.notification-status .text-btn { margin-left: auto; white-space: nowrap; }
.role-options { display:flex; flex-direction:column; gap:10px; }
.role-option { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:13px; width:100%; padding:13px; border:1px solid var(--line); border-radius:13px; background:white; text-align:left; cursor:pointer; }
.role-option:hover { border-color:#c9c9ed; background:#fafaff; }
.role-option .avatar { width:38px; height:38px; }
.role-option strong, .role-option span { display:block; }
.role-option strong { font-size:11px; }
.role-option span { margin-top:3px; color:var(--muted); font-size:9px; }
.role-option > svg { width:16px; height:16px; color:var(--primary); }
.auth-root { min-height:100vh; background:#f7f7fb; }

/* First paint. Whatever else is slow, the app is never a blank page. */
.boot-splash {
  --boot-ink:#25255c;
  min-height:100vh;
  position:relative;
  isolation:isolate;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:32px 24px;
  text-align:center;
  background:
    radial-gradient(circle at 28% 22%, rgba(119,116,231,.16), transparent 32%),
    radial-gradient(circle at 72% 76%, rgba(91,91,214,.12), transparent 35%),
    linear-gradient(155deg, #fbfbff 0%, #f4f4fc 100%);
}
.boot-splash::before,
.boot-splash::after {
  content:"";
  position:absolute;
  z-index:-1;
  width:42vmin;
  height:42vmin;
  border:1px solid rgba(91,91,214,.09);
  border-radius:50%;
}
.boot-splash::before { top:-18vmin; right:-13vmin; }
.boot-splash::after { bottom:-20vmin; left:-11vmin; width:52vmin; height:52vmin; }
.boot-visual {
  --boot-x:0px;
  --boot-y:0px;
  --boot-rotate-x:0deg;
  --boot-rotate-y:0deg;
  position:relative;
  width:148px;
  height:148px;
  display:grid;
  place-items:center;
  margin-bottom:4px;
  transform:translate3d(var(--boot-x),var(--boot-y),0) rotateX(var(--boot-rotate-x)) rotateY(var(--boot-rotate-y));
  transform-style:preserve-3d;
  transition:transform .18s ease-out;
  will-change:transform;
}
.boot-logo {
  position:relative;
  z-index:4;
  display:grid;
  place-items:center;
  width:78px;
  height:78px;
  border:1px solid rgba(255,255,255,.55);
  border-radius:25px;
  color:white;
  font-size:42px;
  font-weight:850;
  letter-spacing:-.06em;
  background:linear-gradient(145deg,#7774e7 0%,#5b5bd6 52%,#3f3fa9 100%);
  box-shadow:0 24px 50px rgba(65,65,170,.28),inset 0 1px 0 rgba(255,255,255,.28);
  transform:translateZ(20px) rotate(-5deg);
  animation:bootLogoBreathe 2.4s ease-in-out infinite;
}
.boot-logo::after {
  content:"";
  position:absolute;
  inset:7px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:19px;
}
.boot-orbit,
.boot-pulse { position:absolute; border-radius:50%; }
.boot-orbit { z-index:2; border:1px solid rgba(91,91,214,.2); }
.boot-orbit i {
  position:absolute;
  top:50%;
  right:-4px;
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--primary);
  box-shadow:0 0 0 5px rgba(91,91,214,.1),0 0 18px rgba(91,91,214,.38);
}
.boot-orbit-outer { inset:4px; animation:bootSpin 3.6s linear infinite; }
.boot-orbit-inner { inset:20px; border-style:dashed; animation:bootSpinReverse 2.8s linear infinite; }
.boot-orbit-inner i { top:auto; right:auto; bottom:-3px; left:50%; width:6px; height:6px; background:#9a97f0; }
.boot-pulse {
  z-index:1;
  inset:35px;
  border:1px solid rgba(91,91,214,.22);
  animation:bootPulse 2.4s ease-out infinite;
}
.boot-wordmark { color:var(--boot-ink); font-size:22px; font-weight:780; letter-spacing:-.04em; }
.boot-wordmark span { color:var(--primary); }
.boot-message { min-height:21px; max-width:38ch; margin:0; color:var(--muted); font-size:14px; line-height:1.5; }
.boot-progress {
  width:112px;
  height:3px;
  margin-top:5px;
  overflow:hidden;
  border-radius:99px;
  background:rgba(91,91,214,.12);
}
.boot-progress span {
  display:block;
  width:44%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#7774e7,var(--primary));
  animation:bootProgress 1.35s ease-in-out infinite;
}
@keyframes bootSpin { to { transform:rotate(360deg); } }
@keyframes bootSpinReverse { to { transform:rotate(-360deg); } }
@keyframes bootLogoBreathe { 50% { transform:translateZ(24px) rotate(-2deg) scale(1.045); } }
@keyframes bootPulse { 0% { opacity:.7; transform:scale(.82); } 80%,100% { opacity:0; transform:scale(1.75); } }
@keyframes bootProgress { 0% { transform:translateX(-115%); } 55%,100% { transform:translateX(260%); } }
.boot-actions { display:flex; flex-direction:column; align-items:center; gap:10px; }
@media (prefers-reduced-motion: reduce) {
  .boot-logo,
  .boot-orbit,
  .boot-pulse,
  .boot-progress span { animation:none; }
  .boot-visual { transform:none; transition:none; }
  .boot-progress span { width:100%; opacity:.55; }
}
.auth-layout { display:grid; grid-template-columns:minmax(360px,.92fr) minmax(480px,1.08fr); min-height:100vh; }
.auth-story { position:relative; overflow:hidden; display:flex; flex-direction:column; justify-content:space-between; padding:50px clamp(34px,5vw,76px); color:white; background:linear-gradient(145deg,#34349a 0%,#5858d8 56%,#7774e7 100%); }
.auth-story::before { content:""; position:absolute; width:480px; height:480px; right:-220px; top:-180px; border:55px solid rgba(255,255,255,.08); border-radius:50%; }
.auth-story::after { content:""; position:absolute; width:300px; height:300px; left:-170px; bottom:-170px; border:45px solid rgba(255,255,255,.06); border-radius:50%; }
.auth-brand, .auth-story-copy, .auth-feature-row { position:relative; z-index:1; }
.auth-brand { display:flex; align-items:center; gap:11px; }
.auth-brand .brand-mark { color:var(--primary); background:white; box-shadow:none; }
.auth-brand .brand-name { color:white; font-size:20px; }
.auth-brand .brand-name span { color:#c9c9ff; }
.auth-story-copy { max-width:560px; margin:auto 0; }
.auth-kicker { display:block; margin-bottom:20px; color:#d7d7ff; font-size:10px; font-weight:800; letter-spacing:.16em; }
.auth-story h1 { max-width:520px; font-size:clamp(40px,5vw,68px); line-height:.98; letter-spacing:-.06em; }
.auth-story p { max-width:520px; margin:24px 0 0; color:rgba(255,255,255,.74); font-size:14px; line-height:1.7; }
.auth-feature-row { display:flex; flex-wrap:wrap; gap:11px; }
.auth-feature-row span { display:inline-flex; align-items:center; gap:7px; padding:9px 11px; border:1px solid rgba(255,255,255,.14); border-radius:10px; background:rgba(255,255,255,.08); font-size:9px; font-weight:700; }
.auth-feature-row svg { width:14px; height:14px; }
.auth-panel { display:grid; place-items:center; padding:44px; background:#f7f7fb; }
.auth-card { width:min(490px,100%); padding:38px; border:1px solid var(--line); border-radius:24px; background:white; box-shadow:0 28px 70px rgba(35,35,74,.1); }
.auth-heading { display:flex; align-items:center; gap:14px; }
.auth-heading p { margin:0 0 5px; color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.auth-heading h2 { margin:0; font-size:25px; letter-spacing:-.04em; }
.auth-icon { display:grid; place-items:center; width:52px; height:52px; border-radius:15px; color:white; background:linear-gradient(135deg,var(--primary),#7b78e8); font-size:13px; font-weight:850; box-shadow:0 10px 24px rgba(91,91,214,.2); }
.auth-icon svg { width:21px; height:21px; }
.auth-role-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin:28px 0 16px; }
.auth-role { display:flex; align-items:center; justify-content:center; gap:7px; min-height:48px; padding:7px; color:var(--muted); border:1px solid var(--line); border-radius:11px; background:white; cursor:pointer; }
.auth-role span { display:grid; place-items:center; width:25px; height:25px; border-radius:7px; color:var(--primary); background:var(--primary-soft); font-size:8px; font-weight:850; }
.auth-role strong { font-size:10px; }
.auth-role:hover { color:var(--primary); border-color:#cfcfee; }
.auth-role.active { color:var(--primary); border-color:var(--primary); background:#fafaff; box-shadow:0 0 0 3px var(--primary-soft); }
.auth-mode-switch { display:grid; grid-template-columns:1fr 1fr; gap:4px; margin:0 0 17px; padding:4px; border-radius:11px; background:#f1f1f7; }
.auth-mode-switch button { min-height:34px; border:0; border-radius:8px; color:var(--muted); background:transparent; font-size:9px; font-weight:800; cursor:pointer; }
.auth-mode-switch button.active { color:var(--primary); background:white; box-shadow:0 3px 10px rgba(35,35,74,.08); }
.auth-description { min-height:34px; margin:0 0 20px; color:var(--muted); font-size:10px; line-height:1.6; }
.login-form { display:flex; flex-direction:column; }
.login-form label { margin:0 0 7px; color:#5f6073; font-size:9px; font-weight:800; }
.login-form input { width:100%; height:46px; margin-bottom:16px; padding:0 13px; border:1px solid var(--line); border-radius:11px; outline:none; color:var(--ink); background:#fcfcfe; font-size:11px; }
.login-form input:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); background:white; }
.login-form input[aria-describedby] { margin-bottom:6px; }
.auth-field-help { margin:0 0 16px; color:var(--muted); font-size:9px; line-height:1.5; }
.auth-field-pair { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.auth-field-pair > div { display:flex; flex-direction:column; min-width:0; }
.auth-submit { width:100%; margin-top:4px; }
.auth-demo-note { margin-top:20px; padding:12px 13px; border-radius:11px; background:#f7f7fc; }
.auth-demo-note span { display:block; color:var(--primary); font-size:9px; font-weight:800; }
.auth-demo-note p { margin:4px 0 0; color:var(--muted); font-size:9px; line-height:1.5; }
.attendance-call-stack { display:grid; gap:12px; margin-bottom:16px; }
.attendance-call { padding:20px; border-color:#e0defa; box-shadow:0 10px 30px rgba(91,91,214,.10); }
.attendance-call.is-marked { border-color:#cfe9d8; box-shadow:none; }
.attendance-call-copy { margin:10px 0 0; color:var(--muted); font-size:11px; line-height:1.6; }
.attendance-call-roll { margin:12px 0 0; color:var(--muted); font-size:11px; }
.attendance-call-roll strong { color:var(--ink); letter-spacing:.04em; }
.attendance-call-label { display:block; margin:14px 0 6px; font-size:10px; font-weight:750; }
.attendance-call-submit { width:100%; margin-top:14px; }
.attendance-call-code { margin-top:16px; padding-top:14px; border-top:1px dashed var(--line); }
.attendance-call-code .attendance-call-copy { margin-top:0; }
.attendance-call-code-row { display:flex; gap:10px; align-items:stretch; }
.attendance-call-code-row .text-input { flex:1 1 auto; min-width:0; font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:16px; letter-spacing:.18em; text-transform:uppercase; }
.attendance-call-code-row .attendance-call-submit { width:auto; margin-top:0; flex:0 0 auto; white-space:nowrap; }
@media (max-width: 420px) {
  .attendance-call-code-row { flex-direction:column; }
  .attendance-call-code-row .attendance-call-submit { width:100%; }
}
.field-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.field { display:flex; flex-direction:column; gap:7px; margin-bottom:13px; }
.field.full { grid-column:1/-1; }
.field label { color:var(--muted); font-size:9px; font-weight:750; }
.field input, .field select, .field textarea { width:100%; padding:0 11px; border:1px solid var(--line); border-radius:10px; outline:none; color:var(--ink); background:white; font-size:10px; }
.field input, .field select { height:41px; }
.field textarea { min-height:82px; padding-top:11px; padding-bottom:11px; line-height:1.5; resize:vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.reminder-summary { display:flex; align-items:center; gap:13px; padding:15px; border:1px solid #ddddf2; border-radius:14px; background:#fafaff; }
.reminder-bell { display:grid; place-items:center; flex:0 0 42px; width:42px; height:42px; color:white; border-radius:12px; background:var(--primary); }
.reminder-bell svg { width:20px; height:20px; }
.reminder-summary strong { display:block; font-size:11px; }
.reminder-summary p { margin:4px 0 0; color:var(--muted); font-size:9px; }
.modal-head h2 { display:flex; align-items:center; gap:8px; }
.modal-head h2 svg { width:19px; height:19px; color:var(--primary); }
.student-welcome { padding:28px; color:white; border-radius:var(--radius); background:linear-gradient(125deg,#5556cc,#7774e7); }
.student-welcome h2 { margin:0 0 7px; font-size:22px; }
.student-welcome p { max-width:500px; margin:0; color:rgba(255,255,255,.72); font-size:10px; line-height:1.6; }
.student-welcome .btn { margin-top:18px; color:var(--primary); border:0; }
.schedule-week { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:15px; overflow:hidden; }
.schedule-day { display:grid; grid-template-columns:110px 105px minmax(0,1fr) auto; align-items:center; gap:18px; min-height:82px; padding:15px 18px; border-top:1px solid var(--line); }
.schedule-day:first-child { border-top:0; }
.schedule-day.today { background:#fafaff; box-shadow:inset 3px 0 var(--primary); }
.schedule-date strong, .schedule-date span, .schedule-time strong, .schedule-time span, .schedule-info strong, .schedule-info span { display:block; }
.schedule-date strong { font-size:11px; }
.schedule-date span, .schedule-time span, .schedule-info span { margin-top:4px; color:var(--muted); font-size:9px; }
.schedule-time strong { font-size:10px; }
.schedule-info strong { font-size:11px; }
.schedule-action { display:flex; justify-content:flex-end; min-width:120px; }
.today-agenda-card + .schedule-calendar-card,
.schedule-calendar-card + .weekly-agenda-card { margin-top:22px; }
.agenda-class-list { display:flex; flex-direction:column; gap:10px; }
.agenda-class { display:grid; grid-template-columns:105px minmax(0,1fr) auto; gap:18px; align-items:start; padding:16px; border:1px solid var(--line); border-radius:14px; background:white; }
.agenda-class.is-today { border-color:#d8d8fa; background:#fafaff; box-shadow:inset 3px 0 var(--primary); }
.agenda-class-time strong, .agenda-class-time span { display:block; }
.agenda-class-time strong { font-size:13px; }
.agenda-class-time span { margin-top:4px; color:var(--muted); font-size:9px; }
.agenda-class-main { min-width:0; }
.agenda-class-title { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.agenda-class-title strong { font-size:12px; }
.agenda-class-title span { flex:0 0 auto; color:var(--primary); font-size:9px; font-weight:750; }
.agenda-class-main > p { margin:5px 0 9px; color:var(--muted); font-size:9px; }
.agenda-class-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.subtopic-list { display:flex; flex-wrap:wrap; gap:6px; }
.subtopic-list span, .table-subtopic { display:inline-flex; align-items:center; gap:6px; padding:5px 8px; color:#4b4b91; border:1px solid #ddddfa; border-radius:999px; background:#f4f4ff; font-size:9px; }
.subtopic-list b { display:grid; place-items:center; width:16px; height:16px; color:white; border-radius:50%; background:var(--primary); font-size:8px; }
.table-subtopic { margin:2px 3px 2px 0; }
.empty-agenda { display:flex; flex-direction:column; gap:5px; padding:18px; color:var(--muted); border:1px dashed #dcdcec; border-radius:13px; background:#fbfbfe; font-size:10px; }
.empty-agenda strong { color:var(--ink); font-size:12px; }
.empty-agenda.compact { padding:12px 14px; }
.weekly-agenda { display:flex; flex-direction:column; gap:12px; }
.weekly-agenda-day { padding:16px; border:1px solid var(--line); border-radius:15px; background:#fff; }
.weekly-agenda-day.today { border-color:#d8d8fa; background:#fdfdff; }
.weekly-agenda-day.previous { background:#fbfbfd; }
.weekly-agenda-day-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; }
.weekly-agenda-day-head h3 { margin:0; font-size:13px; }
.weekly-agenda-day-head div > span { display:block; margin-top:3px; color:var(--muted); font-size:9px; }
.calendar-page { overflow:hidden; }
.calendar-titlebar { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:22px; }
.calendar-titlebar h2 { margin:7px 0 5px; font-size:20px; letter-spacing:-.03em; }
.calendar-titlebar p { margin:0; color:var(--muted); font-size:10px; }
.calendar-kicker { display:inline-flex; align-items:center; gap:7px; color:var(--primary); font-size:9px; font-weight:850; letter-spacing:.12em; }
.calendar-kicker svg { width:14px; height:14px; }
.calendar-title-actions { display:flex; align-items:center; gap:9px; }
.calendar-scroll { overflow-x:auto; margin:0 -4px; padding:0 4px 8px; }
.calendar-board { min-width:920px; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:white; }
.calendar-days { display:grid; grid-template-columns:64px repeat(7,1fr); min-height:60px; border-bottom:1px solid var(--line); background:#fbfbfe; }
.calendar-days > span { display:flex; align-items:center; justify-content:center; flex-direction:column; gap:4px; border-left:1px solid var(--line); }
.calendar-days > span:first-child { border-left:0; }
.calendar-days small { color:var(--muted); font-size:8px; font-weight:800; letter-spacing:.08em; }
.calendar-days strong { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; font-size:11px; }
.calendar-days .is-today strong { color:white; background:var(--primary); }
.calendar-days .calendar-zone { color:var(--muted); font-size:8px; font-weight:800; }
.calendar-body { display:grid; grid-template-columns:64px 1fr; height:520px; }
.calendar-times { display:grid; grid-template-rows:repeat(10,1fr); color:var(--muted); background:#fbfbfe; }
.calendar-times span { padding:7px 8px 0 0; border-top:1px solid #eeeef4; font-size:8px; text-align:right; transform:translateY(-1px); }
.calendar-times span:first-child { border-top:0; }
.calendar-lanes { display:grid; grid-template-columns:repeat(7,1fr); }
.calendar-lane { position:relative; min-width:0; border-left:1px solid var(--line); background:repeating-linear-gradient(to bottom,transparent 0,transparent calc(10% - 1px),#eeeef4 calc(10% - 1px),#eeeef4 10%); }
.calendar-lane.is-today { background-color:#fafaff; }
.calendar-event { position:absolute; z-index:2; top:var(--event-top); left:7px; right:7px; height:var(--event-height); min-height:44px; overflow:hidden; padding:8px; color:#4545b4; border:1px solid #d5d5fa; border-left:3px solid var(--primary); border-radius:9px; background:#eeeeff; box-shadow:0 5px 15px rgba(60,60,140,.07); }
.calendar-event.current { color:#087b59; border-color:#b9ead8; border-left-color:var(--green); background:#eaf9f3; }
.calendar-event strong, .calendar-event span { display:block; }
.calendar-event strong { overflow:hidden; font-size:9px; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
.calendar-event span { margin-top:5px; font-size:8px; opacity:.76; }
.calendar-agenda { margin-top:26px; }
.toast-region { position:fixed; right:24px; bottom:24px; z-index:100; display:flex; flex-direction:column; gap:10px; }
.toast { display:flex; align-items:center; gap:10px; min-width:260px; padding:13px 15px; border-radius:12px; color:white; background:#28283d; box-shadow:0 16px 35px rgba(20,20,40,.22); font-size:11px; animation:toastIn .25s ease; }
.toast.success::before { content:"✓"; display:grid; place-items:center; width:20px; height:20px; border-radius:50%; background:var(--green); font-weight:800; }
.toast.error::before { content:"!"; display:grid; place-items:center; width:20px; height:20px; border-radius:50%; background:var(--red); font-weight:800; }
.toast.notification::before { content:""; width:9px; height:9px; flex:0 0 auto; border:5px solid #8b8bea; border-radius:50%; background:white; }
@keyframes toastIn { from{opacity:0;transform:translateY(10px)} }

@media (max-width: 1050px) {
  .auth-layout { grid-template-columns:minmax(300px,.75fr) minmax(420px,1fr); }
  .auth-story { padding:40px 34px; }
  .auth-feature-row { display:none; }
  .app-shell { grid-template-columns: 82px 1fr; }
  .sidebar { width:82px; padding-inline:13px; }
  .brand-name, .nav-item span, .user-card > div:nth-child(2), .user-card .icon-btn { display:none; }
  .brand { justify-content:center; padding:0; }
  .nav-item { justify-content:center; padding:0; }
  .user-card { justify-content:center; padding-inline:0; }
  .main { grid-column:2; }
  .dashboard-grid, .page-grid { grid-template-columns:1fr; }
  .attendance-analytics-grid { grid-template-columns:minmax(0,1.45fr) minmax(220px,.7fr); }
  .right-stack { display:grid; grid-template-columns:1fr 1fr; }
}
@media (max-width: 720px) {
  .auth-layout { display:block; }
  .auth-story { min-height:250px; padding:30px 24px; }
  .auth-story-copy { margin:45px 0 0; }
  .auth-story h1 { font-size:38px; }
  .auth-story p { margin-top:15px; font-size:11px; }
  .auth-panel { padding:20px 15px 34px; }
  .auth-card { margin-top:-25px; padding:24px 19px; border-radius:20px; }
  .auth-heading h2 { font-size:21px; }
  .auth-role { flex-direction:column; gap:4px; }
  .auth-field-pair { grid-template-columns:1fr; gap:0; }
  .app-shell { display:block; padding-bottom:72px; }
  .sidebar { inset:auto 0 0 0; width:100%; height:65px; padding:8px 10px; border-right:0; border-top:1px solid var(--line); }
  .brand, .side-bottom { display:none; }
  .primary-nav { flex-direction:row; justify-content:space-around; margin:0; height:100%; }
  .primary-nav .nav-item:nth-child(n+5) { display:none; }
  .nav-item { width:auto; flex:1; flex-direction:column; gap:3px; min-height:auto; border-radius:9px; font-size:8px; }
  .nav-item span { display:block; }
  .nav-item svg { width:18px; height:18px; }
  .main { width:100%; }
  .topbar { flex-wrap:wrap; padding:22px 18px 17px; }
  .attendance-live-bar { width:calc(100% - 36px); margin:0 auto 10px; }
  .top-actions { width:100%; justify-content:flex-end; }
  .top-actions .notification-btn { display:grid; margin-left:auto; }
  .course-switcher { flex:1; min-width:0; }
  .course-switcher > span { display:none; }
  .role-switch span:first-child { display:none; }
  .role-switch { padding:0 7px; }
  .top-actions .btn { width:42px; padding:0; font-size:0; }
  .view { padding:0 18px 30px; }
  .hero-session { grid-template-columns:1fr; padding:23px; }
  .hero-action { margin-top:20px; align-items:start; }
  .stat-grid { grid-template-columns:1fr 1fr; }
  .stat:last-child { grid-column:span 2; }
  .attendance-analytics-grid { grid-template-columns:1fr; }
  .analytics-heading { flex-direction:column; }
  .analytics-head-metrics { align-items:flex-start; }
  .attendance-supporting-plots { grid-template-columns:1fr; grid-template-rows:none; }
  .attendance-trend-panel { padding-inline:8px; }
  .right-stack { display:flex; }
  .class-row { grid-template-columns:48px minmax(0,1fr) auto auto; }
  .check-grid, .options { grid-template-columns:1fr; }
  .course-grid, .field-grid { grid-template-columns:1fr; }
  .schedule-day { grid-template-columns:74px minmax(0,1fr); gap:11px; padding:14px; }
  .calendar-titlebar { flex-direction:column; }
  .calendar-title-actions { width:100%; justify-content:space-between; }
  .schedule-time { grid-column:1; }
  .schedule-info { grid-column:2; grid-row:1 / span 2; }
  .schedule-action { grid-column:1/-1; justify-content:flex-start; min-width:0; }
  .agenda-class { grid-template-columns:82px minmax(0,1fr); gap:12px; padding:14px; }
  .agenda-class-actions { grid-column:1/-1; justify-content:flex-start; }
  .agenda-class-title { flex-direction:column; gap:5px; }
  .weekly-agenda-day { padding:13px; }
  .page-card { padding:18px; }
  .student-row { grid-template-columns:34px minmax(0,1fr) auto; }
  .student-row .signal { display:none; }
  .roster-search-toolbar { align-items:stretch; flex-direction:column; }
  .roster-search, .roster-search-toolbar .btn { width:100%; }
  .roster-source-card { grid-template-columns:auto minmax(0,1fr); }
  .roster-source-card > .badge { grid-column:1/-1; justify-self:start; }
  .setup-actions .btn { flex:1 1 150px; }
  .toast-region { left:18px; right:18px; bottom:82px; }
  .toast { min-width:0; }
}

.roster-grid { grid-template-columns: minmax(0,1.6fr) minmax(260px,.9fr); align-items: start; }
.roster-table { width:100%; border-collapse:collapse; font-size:11px; }
.roster-table th {
  position:sticky; top:0; z-index:1; padding:9px 10px; text-align:left; color:var(--muted);
  background:var(--paper); border-bottom:1px solid var(--line); font-size:9px; letter-spacing:.08em; text-transform:uppercase;
}
.roster-table td { padding:9px 10px; border-bottom:1px solid #f1f1f6; }
.roster-table tr:hover td { background:#fafaff; }
.roster-serial { width:52px; color:var(--muted); }
.roster-roll { width:120px; font-weight:750; letter-spacing:.02em; }
.roster-actions { width:80px; text-align:right; }
.roster-mark-header { min-width:92px; white-space:nowrap; }
.roster-mark-header span { color:var(--muted); font-weight:650; letter-spacing:0; }
.roster-mark { min-width:92px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.roster-mark strong { color:var(--primary); font-size:12px; }
.roster-mark span { color:var(--muted); }
.roster-mark-empty { color:#a4a3b3; }
.roster-contact { max-width:210px; overflow-wrap:anywhere; color:var(--muted); }
/* Columns the roll list carried that have no column of their own: kept under
   the name so a wide sheet does not push the table off a phone. */
.roster-extra { display:flex; flex-wrap:wrap; gap:2px 10px; margin-top:3px; color:var(--muted); font-size:10px; }
.roster-extra b { font-weight:650; text-transform:uppercase; letter-spacing:.04em; font-size:9px; }
.text-btn.danger { color:var(--red); }
@media (max-width: 1050px) { .roster-grid { grid-template-columns:1fr; } }

.schedule-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px; padding: 16px 20px; border: 1px solid #e0defa; border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfaff, var(--paper));
  box-shadow: 0 8px 24px rgba(91,91,214,.08);
}
.schedule-toolbar strong { display: block; font-size: 13px; }
.schedule-toolbar span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.calendar-event-course {
  display: block; font-size: 8px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; opacity: .75; font-style: normal;
}
.calendar-event.is-other-course { background: #f2f2f8; border-color: #dedeeb; color: var(--muted); }
.calendar-event.is-other-course strong { color: var(--ink); }
@media (max-width: 720px) {
  .schedule-toolbar { flex-direction: column; align-items: stretch; }
  .schedule-toolbar .setup-actions .btn { width: 100%; }
}

.course-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-card-head h3 { margin: 0; }
.course-card.is-open-course { border-color: #c9c6f4; box-shadow: 0 10px 28px rgba(91,91,214,.12); }
.course-card.is-open-course .course-accent { background: var(--primary); }

.calendar-event {
  --event-columns: 1;
  --event-column: 0;
  left: calc(7px + (100% - 14px) * var(--event-column) / var(--event-columns));
  right: auto;
  width: calc((100% - 14px) / var(--event-columns) - 3px);
}

.course-manage { display: flex; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.course-manage .text-btn { font-size: 10px; }

.question-image { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 4px; }
.question-image img { max-width: 220px; max-height: 150px; border: 1px solid var(--line); border-radius: 10px; object-fit: contain; background: #fafafd; }
.question-image-view { display: block; max-width: 100%; max-height: 260px; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; object-fit: contain; background: #fafafd; }

.saved-quizzes { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.saved-quiz { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.saved-quiz strong { display: block; font-size: 12px; }
.saved-quiz span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.saved-quiz-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.saved-quiz-actions .btn { min-height: 34px; padding: 0 12px; font-size: 11px; }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: var(--red-soft); }

.back-nav-btn { flex: 0 0 auto; border: 1px solid var(--line); background: white; }
.back-nav-btn:hover { color: var(--primary); border-color: #cccced; }

.saved-quiz-open {
  flex: 1 1 auto; min-width: 0; padding: 6px 8px; margin: -6px -8px;
  border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer;
}
.saved-quiz-open:hover { background: #f4f4fa; }
.saved-quiz.is-open-draft { border-left: 3px solid var(--primary); padding-left: 9px; }

.notice-list { display: flex; flex-direction: column; gap: 4px; }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid #f1f1f6; }
.notice:first-child { border-top: 0; }
.notice > div { flex: 1 1 auto; min-width: 0; }
.notice strong { display: block; font-size: 12px; }
.notice p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.notice-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }

.results-picker { display: flex; align-items: center; gap: 8px; }
.results-picker > span { color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.results-picker .select { width: auto; min-width: 210px; }
@media (max-width: 720px) {
  .results-picker { width: 100%; }
  .results-picker .select { flex: 1 1 auto; min-width: 0; }
}

.quiz-review { display: flex; flex-direction: column; gap: 14px; }
.quiz-review .question-top { display: flex; align-items: center; gap: 12px; }
.quiz-review .question-top strong { font-size: 13px; }
.review-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; font-size: 12px; }
.review-option.is-correct { color: #087b59; border-color: #b9ead8; background: var(--green-soft); font-weight: 700; }
.review-mark { display: grid; place-items: center; width: 18px; height: 18px; flex: 0 0 auto; }
.review-mark svg { width: 14px; height: 14px; }

.section-link { display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; }
.section-link h3 { margin: 0; }
.section-link svg { width: 14px; height: 14px; color: var(--primary); }
.section-link:hover h3 { color: var(--primary); }

.answer-hint {
  display: flex; align-items: center; gap: 6px; margin: 14px 0 8px;
  color: var(--muted); font-size: 10px; font-weight: 700;
}
.answer-hint svg { width: 13px; height: 13px; color: var(--green); }
.option-input { position: relative; }
.option-input input[type="radio"] { cursor: pointer; }
.option-flag {
  display: none; position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  padding: 2px 7px; border-radius: 999px; background: var(--green-soft);
  color: #087b59; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.option-input:has(input[type="radio"]:checked) { border-color: #b9ead8; background: var(--green-soft); }
.option-input:has(input[type="radio"]:checked) .option-flag { display: block; }
.option-input:has(input[type="radio"]:checked) input[type="text"] { background: transparent; }

.roster-table tr.is-open-row td { background: var(--primary-soft); }

.review-option { position: relative; overflow: hidden; }
.option-bar {
  position: absolute; inset: 0 auto 0 0; width: var(--share, 0%);
  background: #eceafd; z-index: 0;
}
.review-option.is-correct .option-bar { background: #d9f2e7; }
.review-option .review-mark,
.review-option .option-text,
.review-option .option-share { position: relative; z-index: 1; }
.option-text { flex: 1 1 auto; min-width: 0; }
.option-share { color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.review-option.is-correct .option-share { color: #087b59; }

.app-menu-item.nav-item { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 44px; font-size: 13px; text-align: left; }
.app-menu-item.nav-item.active { color: var(--primary); background: var(--primary-soft); }
.app-menu-nav .app-menu-item.danger { margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }

.proximity-code {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 16px 0 4px; padding: 16px 20px;
  border: 1px solid #d5d5fa; border-radius: var(--radius); background: #f6f5ff;
}
.proximity-code > div { display: flex; flex-direction: column; }
.proximity-code span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.proximity-code strong { color: var(--primary); font-size: 16px; font-weight: 800; letter-spacing: .04em; line-height: 1.4; display: flex; align-items: center; gap: 6px; }
.proximity-code strong svg { width: 18px; height: 18px; }
.proximity-code p { flex: 1 1 220px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.proximity-code.no-ble { border-color: #f0dac9; background: #fdf6f0; }
.proximity-code.no-ble strong { color: var(--amber, #b45309); }

/* The typed fallback code, sized to be read from the back of the hall. */
.class-code-panel {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 16px 0 4px; padding: 16px 20px;
  border: 1px solid #cfe9d8; border-radius: var(--radius); background: #f2fbf5;
}
.class-code-panel > div { display: flex; flex-direction: column; }
.class-code-panel span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.class-code-panel strong { color: var(--ink); font-size: 16px; font-weight: 800; line-height: 1.4; }
.class-code-panel .class-code-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 34px; letter-spacing: .12em; color: #1f7a3f; }
.class-code-panel p { flex: 1 1 220px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.class-code-panel p em { font-style: normal; font-weight: 700; color: var(--ink); }
.class-code-panel.is-unavailable { border-color: var(--line); background: #fafafa; }
.class-code-panel.is-unavailable strong { color: var(--muted); }

.review-option.is-wrong { color: #a33; border-color: #f0c9c9; background: var(--red-soft); }
.review-option.is-wrong .review-mark svg { color: var(--red); }

.attendance-call.is-idle { border-color: var(--line); box-shadow: none; }
.attendance-call.is-idle .attendance-call-submit { opacity: .55; }

.verification-code { height: 56px !important; text-align: center; font-size: 22px !important; font-weight: 800; letter-spacing: .28em; }
.verification-actions { display: flex; justify-content: space-between; margin-top: 16px; }

@media (max-width: 560px) {
  .modal-backdrop:has(.notification-modal) { align-items: end; padding: 10px; }
  .notification-modal { max-height: calc(100dvh - 20px); border-radius: 20px 20px 14px 14px; }
  .notification-modal .modal-head { padding: 20px 18px 15px; }
  .notification-toolbar { padding-inline: 18px; }
  .notification-item { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; padding: 14px 18px; }
  .notification-kind { width: 36px; height: 36px; }
  .notification-status { padding-inline: 18px; }
}

.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row label { margin: 0; }
.label-row .text-btn { font-size: 10px; }

/* Pull-to-refresh. Sits above the page and is dragged into view by the gesture,
   so it never occupies layout space when idle. */
.pull-refresh {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: -44px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 6px 18px rgba(35, 35, 74, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0);
}
.pull-refresh:not(.active) { transition: transform .22s ease, opacity .22s ease; }
.pull-refresh-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  transition: border-top-color .15s ease;
}
/* Past the trigger point, so the pull reads as "let go now". */
.pull-refresh.ready .pull-refresh-spinner { border-color: var(--primary-soft); border-top-color: var(--primary); }
.pull-refresh.refreshing .pull-refresh-spinner { animation: pullSpin .7s linear infinite; }
@keyframes pullSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .pull-refresh:not(.active) { transition: none; }
  .pull-refresh.refreshing .pull-refresh-spinner { animation-duration: 1.8s; }
}

.field-optional { color: var(--muted); font-weight: 500; }

/* A student row in the list opens their whole record. */
.roster-row-clickable { cursor:pointer; }
.roster-row-clickable:hover td { background:#fafaff; }
.roster-row-clickable:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }
.marks-table td { vertical-align:middle; }
.marks-input { width:110px; padding:6px 9px; }

.visually-hidden { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
/* The search box above a list needs the same breathing room as the list. */
.roster-search { margin-bottom:14px; }
.roster-search .text-input { border:0; padding:0; background:transparent; }
.exam-totals-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:6px; }
.exam-total { display:flex; flex-direction:column; gap:4px; }
.exam-total span { color:var(--muted); font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.exam-total .text-input { width:100%; padding:7px 10px; }
@media (max-width: 640px) { .exam-totals-grid { grid-template-columns:1fr; } }

.exam-rows { display:flex; flex-direction:column; gap:8px; margin-top:6px; }
.exam-row { display:grid; grid-template-columns:minmax(0,1fr) 92px 34px; align-items:center; gap:8px; }
.exam-row .text-input { padding:7px 10px; }
.exam-row .icon-btn { width:34px; height:34px; }
.exam-row .icon-btn svg { width:13px; height:13px; }
