/* ============================================================
   irikos — Classrooms feature styles.
   Built strictly on the existing tokens (--card, --rule, --accent,
   --ink*, status colors). No new palette. Reuses .card, .cta-*,
   .segmented, .big-stat, .status-dot, .switch, .task-tag, etc.
   ============================================================ */

/* ---------- shared shell (mirrors .stats-shell etc.) ---------- */
.class-shell {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px 96px;
}
@media (max-width: 720px) { .class-shell { padding: 10px 16px 80px; } }

/* role switch (shown when a signed-in user is both teacher and student) */
.class-roleswitch { max-width: 1120px; margin: 0 auto; padding: 12px 24px 0; }
.class-roleswitch .text-link { font-size: 13px; }
@media (max-width: 720px) { .class-roleswitch { padding: 10px 16px 0; } }

.class-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 2px 14px; flex-wrap: wrap; }
.class-head-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.class-title { font-weight: 700; font-size: 26px; letter-spacing: -0.02em; line-height: 1.1; }
.class-sub { color: var(--ink-3); font-size: 14px; margin: -4px 0 20px; max-width: 64ch; }

.back-link {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500;
  color: var(--ink-3); padding: 8px 0; min-height: 40px;
}
.back-link:hover { color: var(--ink); }
.back-link .arr { font-weight: 700; }

.role-chip {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
}
.role-chip.is-student { background: color-mix(in oklab, #3b82c4 16%, var(--bg-2)); color: color-mix(in oklab, #3b82c4 72%, var(--ink)); }

/* ---------- avatars ---------- */
.avatar {
  flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; letter-spacing: 0.01em; color: #fff; line-height: 1;
  width: 40px; height: 40px; font-size: 15px;
  background: hsl(var(--h, 200) 42% 46%);
}
:root[data-theme="dark"] .avatar { background: hsl(var(--h, 200) 38% 52%); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 21px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--card); margin-left: -10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- classroom cards (Class home) ---------- */
.cls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cls-card {
  text-align: left; background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.cls-card:hover { border-color: var(--ink-4); transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.cls-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cls-card-name { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; line-height: 1.25; text-wrap: pretty; }
.cls-card-meta { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.cls-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.cls-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.is-review { background: var(--warn-soft); color: color-mix(in oklab, var(--warn) 62%, var(--ink)); }
.badge.is-overdue { background: var(--no-soft); color: color-mix(in oklab, var(--no) 64%, var(--ink)); }
.badge.is-pending { background: color-mix(in oklab, #3b82c4 15%, var(--bg-2)); color: color-mix(in oklab, #3b82c4 70%, var(--ink)); }
.badge.is-ok { background: var(--ok-soft); color: color-mix(in oklab, var(--ok) 62%, var(--ink)); }

/* create-classroom prominent tile */
.cls-create {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px;
  border: 1.5px dashed var(--rule-2); background: var(--accent-tint); border-radius: var(--radius-lg);
  padding: 22px 24px; min-height: 150px; transition: border-color 140ms ease, background 140ms ease;
}
.cls-create:hover { border-color: var(--accent); }
.cls-create-h { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.cls-create-s { font-size: 13px; color: var(--ink-3); }

/* ---------- join code chip ---------- */
.joincode {
  display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--rule-2);
  border-radius: var(--radius-md); overflow: hidden; background: var(--bg-2);
}
.joincode-val {
  font-family: var(--mono); font-weight: 700; font-size: 18px; letter-spacing: 0.16em;
  padding: 10px 14px; color: var(--ink);
}
.joincode-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; min-height: 44px;
  border-left: 1px solid var(--rule-2); font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: var(--card); transition: background 120ms ease, color 120ms ease;
}
.joincode-btn:hover { background: var(--bg-2); color: var(--ink); }
.joincode-btn.is-done { color: var(--ok); }
.joincode-rotate { padding: 10px 12px; border-left: 1px solid var(--rule-2); color: var(--ink-3); min-height: 44px; }
.joincode-rotate:hover { color: var(--ink); background: var(--bg-2); }

/* ---------- tabs ---------- */
.ctabs {
  display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--rule);
  border-radius: 999px; overflow-x: auto; scrollbar-width: none; margin-bottom: 22px;
}
.ctabs::-webkit-scrollbar { display: none; }
.ctab {
  padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-3);
  white-space: nowrap; min-height: 40px; transition: color 120ms ease, background 120ms ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.ctab:hover { color: var(--ink); }
.ctab.is-on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-card); }
.ctab-count {
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--bg-3); color: var(--ink-3); display: grid; place-items: center;
}
.ctab.is-on .ctab-count { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- generic list card ---------- */
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.panel-pad { padding: 22px 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.panel-head .muted { font-size: 13px; }
.section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 12px; }

/* ---------- roster ---------- */
.roster-toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }

.person-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center;
  padding: 13px 24px; border-top: 1px solid var(--rule);
}
.person-row:first-child { border-top: 0; }
.person-id { min-width: 0; }
.person-name { font-weight: 600; font-size: 15px; color: var(--ink); line-height: 1.25; }
.person-handle { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.person-meta { font-size: 12px; color: var(--ink-3); text-align: right; white-space: nowrap; }
.person-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  color: var(--ink-3); border: 1px solid transparent; transition: background 120ms, color 120ms, border-color 120ms;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn.danger:hover { color: var(--no); border-color: color-mix(in oklab, var(--no) 30%, var(--rule)); }
@media (max-width: 560px) {
  .person-row { grid-template-columns: auto 1fr auto; }
  .person-meta { display: none; }
}

/* ---------- @autocomplete ---------- */
.ac-wrap { position: relative; flex: 1; min-width: 240px; }
.ac-field { position: relative; display: flex; align-items: center; }
.ac-at { position: absolute; left: 14px; color: var(--ink-4); font-weight: 600; pointer-events: none; }
.ac-input {
  width: 100%; padding: 12px 14px 12px 30px; background: var(--bg-2);
  border: 1.5px solid var(--rule-2); border-radius: var(--radius-md); color: var(--ink);
  min-height: 48px; transition: border-color 140ms ease, background 140ms ease;
}
.ac-input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.ac-input::placeholder { color: var(--ink-4); }
.ac-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop); overflow: hidden; max-height: 280px; overflow-y: auto;
}
.ac-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 14px; border-top: 1px solid var(--rule); transition: background 100ms ease;
}
.ac-item:first-child { border-top: 0; }
.ac-item:hover, .ac-item.is-active { background: var(--accent-tint); }
.ac-item-name { font-weight: 600; font-size: 14px; }
.ac-item-handle { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.ac-item .spacer { flex: 1; }
.ac-item-add { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.ac-empty { padding: 16px 14px; }
.ac-empty-h { font-size: 13px; font-weight: 600; color: var(--ink); }
.ac-empty-s { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }

/* ---------- invites list ---------- */
.invite-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center;
  padding: 12px 24px; border-top: 1px solid var(--rule);
}
.invite-row:first-child { border-top: 0; }
.invite-status { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.02em; white-space: nowrap; }
.invite-status.is-pending { background: color-mix(in oklab, #3b82c4 15%, var(--bg-2)); color: color-mix(in oklab, #3b82c4 70%, var(--ink)); }
.invite-status.is-noacct { background: var(--warn-soft); color: color-mix(in oklab, var(--warn) 60%, var(--ink)); }

/* ---------- progress / overview ---------- */
.overview-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 860px) { .overview-grid { grid-template-columns: 1fr; } }

.fam-bars { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.fam-row { display: grid; grid-template-columns: 150px 1fr 46px; gap: 14px; align-items: center; }
.fam-name { font-size: 13px; color: var(--ink-2); }
.fam-track { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.fam-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 320ms ease; }
.fam-fill[data-lvl="warn"] { background: var(--warn); }
.fam-fill[data-lvl="no"] { background: var(--no); }
.fam-pct { font-size: 13px; font-weight: 700; text-align: right; color: var(--ink-2); }
@media (max-width: 480px) { .fam-row { grid-template-columns: 110px 1fr 40px; } }

.completion-ring { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring-pct { position: absolute; font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.completion-meta { font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.completion-meta b { color: var(--ink); font-weight: 700; }

/* ---------- student table (sortable) ---------- */
.stable { width: 100%; border-collapse: collapse; }
.stable thead th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap;
  position: sticky; top: 0; background: var(--card);
}
.stable thead th.num { text-align: right; }
.stable th.sortable { cursor: pointer; user-select: none; }
.stable th.sortable:hover { color: var(--ink); }
.stable th .sort-arr { font-size: 9px; margin-left: 4px; color: var(--accent-ink); }
.stable tbody tr { border-bottom: 1px solid var(--rule); transition: background 100ms ease; cursor: pointer; }
.stable tbody tr:hover { background: var(--bg-2); }
.stable tbody tr:last-child { border-bottom: 0; }
.stable td { padding: 12px 14px; font-size: 14px; color: var(--ink-2); vertical-align: middle; }
.stable td.num { text-align: right; font-weight: 600; color: var(--ink); }
.stable .st-name { display: flex; align-items: center; gap: 11px; }
.stable .st-name .nm { font-weight: 600; color: var(--ink); font-size: 14px; }
.stable .st-name .hd { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.acc-pill { display: inline-block; font-weight: 700; font-size: 13px; }
.acc-pill[data-lvl="ok"] { color: var(--ok); }
.acc-pill[data-lvl="warn"] { color: color-mix(in oklab, var(--warn) 64%, var(--ink)); }
.acc-pill[data-lvl="no"] { color: var(--no); }
.last-seen { font-size: 12px; color: var(--ink-3); }
.last-seen.is-today { color: var(--ok); font-weight: 600; }
.table-scroll { overflow-x: auto; }
@media (max-width: 640px) { .stable .hide-sm { display: none; } }

/* ---------- homework list ---------- */
.hw-row {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  padding: 16px 24px; border-top: 1px solid var(--rule); transition: background 100ms ease;
  width: 100%; text-align: left;
}
.hw-row:first-child { border-top: 0; }
button.hw-row:hover { background: var(--bg-2); }
.hw-main { min-width: 0; }
.hw-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.hw-title { font-weight: 600; font-size: 16px; letter-spacing: -0.005em; color: var(--ink); line-height: 1.3; }
.hw-note { font-size: 13px; color: var(--ink-3); margin-top: 4px; max-width: 60ch; }
.hw-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.hw-due.is-overdue { color: var(--no); font-weight: 600; }
.hw-progress-mini { display: flex; align-items: center; gap: 10px; }
.hw-mini-track { width: 90px; height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.hw-mini-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.hw-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.hw-count { font-weight: 700; font-size: 18px; color: var(--ink); }
.hw-count small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
@media (max-width: 560px) { .hw-row { grid-template-columns: 1fr; } .hw-right { align-items: flex-start; text-align: left; } }

/* status pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; letter-spacing: 0.01em; white-space: nowrap;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill[data-st="completed"] { background: var(--ok-soft); color: color-mix(in oklab, var(--ok) 60%, var(--ink)); }
.status-pill[data-st="in-progress"] { background: var(--accent-soft); color: var(--accent-ink); }
.status-pill[data-st="not-started"] { background: var(--bg-2); color: var(--ink-3); }
.status-pill[data-st="overdue"] { background: var(--no-soft); color: color-mix(in oklab, var(--no) 62%, var(--ink)); }

/* ---------- builder (assignment + task editor) ---------- */
.builder { display: flex; flex-direction: column; gap: 0; }
.build-field { padding: 20px 24px; border-top: 1px solid var(--rule); }
.build-field:first-child { border-top: 0; }
.build-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.build-hint { font-size: 12px; color: var(--ink-3); margin-bottom: 12px; line-height: 1.45; }
.field-input, .field-textarea, .field-select {
  width: 100%; padding: 12px 14px; background: var(--bg-2); border: 1.5px solid var(--rule-2);
  border-radius: var(--radius-md); color: var(--ink); min-height: 48px; transition: border-color 140ms, background 140ms;
}
.field-input:focus, .field-textarea:focus, .field-select:focus { outline: none; border-color: var(--accent); background: var(--card); }
.field-input::placeholder, .field-textarea::placeholder { color: var(--ink-4); }
.field-textarea { min-height: 76px; resize: vertical; line-height: 1.5; }

.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip {
  padding: 9px 16px; border-radius: 999px; background: var(--bg-2); border: 1.5px solid var(--rule-2);
  font-size: 14px; font-weight: 500; color: var(--ink-2); transition: all 120ms ease; min-height: 42px;
}
.choice-chip:hover { border-color: var(--ink-4); color: var(--ink); }
.choice-chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.kind-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kind-card {
  text-align: left; padding: 14px 16px; border-radius: var(--radius-md); border: 1.5px solid var(--rule-2);
  background: var(--bg-2); transition: all 130ms ease; display: flex; flex-direction: column; gap: 4px;
}
.kind-card:hover { border-color: var(--ink-4); }
.kind-card.is-on { border-color: var(--accent); background: var(--accent-tint); }
.kind-card-t { font-weight: 600; font-size: 14px; color: var(--ink); }
.kind-card-s { font-size: 12px; color: var(--ink-3); }

.assignee-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.student-pick {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px;
  background: var(--bg-2); border: 1.5px solid var(--rule-2); font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: all 120ms ease;
}
.student-pick:hover { border-color: var(--ink-4); }
.student-pick.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.builder-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.builder-summary { font-size: 13px; color: var(--ink-3); }
.builder-summary b { color: var(--ink); font-weight: 600; }

/* mini answer preview in task editor */
.task-preview {
  background: var(--bg-2); border: 1px dashed var(--rule-2); border-radius: var(--radius-md);
  padding: 16px 18px; margin-top: 12px;
}
.task-preview-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); margin-bottom: 8px; }
.task-preview-sentence { font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.task-preview-sentence .blank-prev { color: var(--accent-ink); border-bottom: 2px solid var(--accent); padding: 0 0.3em; font-weight: 700; }

/* ---------- per-student detail ---------- */
.sd-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.sd-name { font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.sd-handle { font-size: 13px; color: var(--ink-3); font-family: var(--mono); margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 820px) { .sd-grid { grid-template-columns: 1fr; } }

/* Student-detail (design B) enrichments */
.big-stat.is-accent .big-stat-value { color: var(--accent-ink); }
.sd-exam-badge { font-family: system-ui, sans-serif; font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent-tint); border-radius: 999px; padding: 2px 9px; }
.sd-otherexam { font-family: system-ui, sans-serif; font-size: 12px; color: var(--ink-4); }
.mistake-wrote { font-size: 13px; color: var(--no); margin-top: 4px; }
.mistake-wrote s { font-weight: 600; }
.sd-sessions { overflow-x: auto; }
.sd-sess-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sd-sess-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.sd-sess-table th.num, .sd-sess-table td.num { text-align: right; }
.sd-sess-table td { padding: 11px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.sd-sess-table tbody tr:last-child td { border-bottom: 0; }
.sd-sess-date { color: var(--ink-2); }
.sd-sess-muted { color: var(--ink-4); }
.sd-sess-pts { font-weight: 700; color: var(--ink-2); }
.sess-tag { display: inline-block; font-family: system-ui, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; padding: 2px 6px; border-radius: 5px; margin-right: 6px; }
.sess-tag.is-self { background: color-mix(in oklab, var(--ink) 8%, transparent); color: var(--ink-3); }
.sess-tag.is-hw { background: var(--accent-tint); color: var(--accent-ink); }
.sd-sess-table tr.is-reviewable { cursor: pointer; }
.sd-sess-table tr.is-reviewable:hover { background: color-mix(in oklab, var(--ink) 4%, transparent); }
.sess-review-arrow { color: var(--ink-4); margin-left: 7px; font-weight: 700; }

/* mini activity chart (reuses .chart styling pattern but local) */
.mini-chart { display: flex; gap: 4px; height: 90px; align-items: flex-end; }
.mini-col { flex: 1; display: flex; flex-direction: column; align-items: stretch; height: 100%; }
.mini-stack { position: relative; flex: 1; }
.mini-bar { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); opacity: 0.85; border-radius: 3px 3px 0 0; }
.mini-acc { position: absolute; left: -1px; right: -1px; height: 2px; background: var(--ink-2); }

/* ---------- student class home ---------- */
.invite-banner {
  background: var(--accent-tint); border: 1px solid color-mix(in oklab, var(--accent) 36%, var(--rule));
  border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center;
}
.invite-banner.is-fresh { box-shadow: 0 0 0 4px var(--accent-soft); }
.invite-kicker { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-ink); margin-bottom: 8px; }
.invite-h { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; line-height: 1.3; text-wrap: pretty; }
.invite-h b { color: var(--accent-ink); }
.invite-shares { margin-top: 14px; }
.shares-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 8px; }
.shares-list { display: flex; flex-direction: column; gap: 7px; }
.share-item { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.share-item .tick { color: var(--accent-ink); flex-shrink: 0; font-weight: 700; margin-top: 1px; }
.share-item.no .tick { color: var(--ink-4); }
.invite-actions { display: flex; flex-direction: column; gap: 8px; min-width: 140px; }
@media (max-width: 600px) { .invite-banner { grid-template-columns: 1fr; } .invite-actions { flex-direction: row; } }

.join-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.join-input {
  font-family: var(--mono); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 12px 16px; background: var(--bg-2); border: 1.5px solid var(--rule-2); border-radius: var(--radius-md);
  color: var(--ink); min-height: 50px; width: 180px; font-size: 17px;
}
.join-input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.join-input::placeholder { letter-spacing: 0.16em; color: var(--ink-4); font-weight: 600; }

/* ---------- empty states ---------- */
.empty {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 48px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-mark {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 22px; margin-bottom: 6px;
}
.empty-title { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.empty .muted { max-width: 46ch; }
.empty-cta { margin-top: 14px; }

/* error state */
.empty-mark.is-error { background: var(--no-soft); color: var(--no); }

/* ---------- skeleton loaders ---------- */
@keyframes skel-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.skel { background: var(--bg-2); border-radius: 6px; animation: skel-pulse 1.3s ease-in-out infinite; }
:root[data-motion="reduced"] .skel { animation: none; opacity: 0.7; }
.skel-line { height: 12px; }
.skel-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 14px 24px; border-top: 1px solid var(--rule);
}
.skel-row:first-child { border-top: 0; }
.skel-av { width: 40px; height: 40px; border-radius: 50%; }
.skel-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--nav); color: #fff;
  padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop);
  animation: toast-in 220ms cubic-bezier(.2,.7,.2,1);
}
.toast .tick { color: var(--nav-brand-2); font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
:root[data-motion="reduced"] .toast { animation: none; }

/* ---------- modal ---------- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 80; background: rgba(20,22,21,0.5);
  display: grid; place-items: center; padding: 20px; animation: scrim-in 160ms ease;
}
:root[data-theme="dark"] .modal-scrim { background: rgba(0,0,0,0.62); }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--rule-2);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-pop); overflow: hidden;
  animation: modal-in 200ms cubic-bezier(.2,.7,.2,1);
  /* Cap to the viewport and make the body the only scroller, so the head and
     footer (Publish/Save) stay pinned and reachable on short / phone screens.
     Before this, a tall modal (Assign homework, New task) overflowed with
     overflow:hidden and the bottom buttons were unreachable on mobile. */
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 40px);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
:root[data-motion="reduced"] .modal-scrim, :root[data-motion="reduced"] .modal { animation: none; }
.modal-head { padding: 22px 24px 4px; flex: 0 0 auto; }
.modal-title { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.modal-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.modal-body { padding: 18px 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px 22px; flex: 0 0 auto; }
/* Phones: tighter scrim, honour the home-indicator safe area. */
@media (max-width: 560px) {
  .modal-scrim { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .modal { max-height: calc(100dvh - 24px); }
}
.modal-success { text-align: center; padding: 14px 24px 8px; }
.modal-success-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 26px; margin: 0 auto 14px; }

/* The auth screen is the app's own component, styled in styles.css.
   (The design's .auth-* layout rules were removed so they don't override it.) */
.auth-error { font-size: 12px; color: var(--no); margin-top: 6px; }

.role-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.role-card {
  text-align: left; padding: 16px; border-radius: var(--radius-md); border: 1.5px solid var(--rule-2);
  background: var(--bg-2); transition: all 130ms ease; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
}
.role-card:hover { border-color: var(--ink-4); }
.role-card.is-on { border-color: var(--accent); background: var(--accent-tint); }
.role-card-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--card); display: grid; place-items: center; color: var(--accent-ink); margin-bottom: 2px; }
.role-card.is-on .role-card-icon { background: var(--accent); color: #fff; }
.role-card-t { font-weight: 700; font-size: 15px; }
.role-card-s { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.auth-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.auth-actions .cta-primary { width: 100%; justify-content: space-between; }
.auth-guest { text-align: center; font-size: 13px; color: var(--ink-3); }
.auth-guest button { color: var(--accent-ink); font-weight: 600; }
.auth-guest button:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-note { font-size: 12px; color: var(--ink-3); background: var(--bg-2); border-radius: var(--radius-md); padding: 11px 14px; margin-top: 14px; line-height: 1.5; }
.auth-note b { color: var(--ink-2); }

/* account menu in nav */
.acct-menu-wrap { position: relative; }
.acct-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 220px;
  background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop); overflow: hidden; padding: 6px;
}
.acct-pop-head { padding: 12px 12px 10px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
.acct-pop-name { font-weight: 700; font-size: 14px; }
.acct-pop-role { font-size: 12px; color: var(--ink-3); }
.acct-pop-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); transition: background 100ms; }
.acct-pop-item:hover { background: var(--bg-2); color: var(--ink); }
.acct-pop-item.danger:hover { color: var(--no); }

/* utility */
.row-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--ink-3); font-size: 14px; }
.mono-sm { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.divider-h { height: 1px; background: var(--rule); margin: 22px 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.nowrap { white-space: nowrap; }

/* student roster modal (names only) */
.cls-card-chev { color: var(--ink-3); font-weight: 700; font-size: 16px; align-self: center; }
.roster-list { display: flex; flex-direction: column; }
.roster-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--rule); }
.roster-row:last-child { border-bottom: 0; }
.roster-name { font-weight: 600; font-size: 15px; }
.roster-handle { margin-left: auto; color: var(--ink-3); font-size: 13px; }

/* class leaderboard (student taps their class) */
.lb-list { display: flex; flex-direction: column; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--rule); }
.lb-row:last-child { border-bottom: 0; }
.lb-row.is-you { background: var(--accent-soft); border-radius: 10px; margin-inline: -6px; padding-inline: 10px; border-bottom-color: transparent; }
.lb-rank { flex: 0 0 24px; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lb-rank.is-top { color: var(--accent-ink); }
.lb-name { flex: 1; font-weight: 600; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-streak { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.lb-streak-pet { width: 24px; height: 24px; display: grid; place-items: center; overflow: visible; flex: 0 0 auto; }
.lb-streak-n { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-score { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.lb-score-u { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-top: 2px; }

/* =====================================================================
   Teacher · My Tasks (top-level bank page)
   ===================================================================== */
.mt-shell, .st-shell { max-width: 1080px; }
.exam-pill { font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; line-height: 1.05; }
.exam-pill.is-oge { color: var(--accent); }
.exam-pill.is-ege { color: #7fb0ff; }
.mt-filters { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center; margin: 4px 0 16px; }
.mt-filter { display: flex; align-items: center; gap: 10px; }
.mt-cap { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }
.mt-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 880px) { .mt-grid { grid-template-columns: 1fr 1fr; } }
.mt-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg, 16px); padding: 16px 18px; }
.mt-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mt-cue { font-size: 12px; font-weight: 800; letter-spacing: .03em; padding: 3px 10px; border-radius: 999px; background: var(--ink); color: var(--bg-2); }
.mt-acts { margin-left: auto; display: flex; gap: 2px; }
.mt-icon { width: 30px; height: 30px; display: grid; place-items: center; border: none; background: transparent; color: var(--ink-4); border-radius: 8px; cursor: pointer; }
.mt-icon:hover { background: var(--bg-3); color: var(--ink); }
.mt-sentence { font-size: 17px; font-weight: 700; line-height: 1.4; margin-bottom: 10px; }
.mt-answer { font-size: 14px; color: var(--ink-3); }
.mt-answer b { color: var(--accent); font-weight: 700; }
.mt-mc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.mt-opt { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--rule); font-size: 14px; }
.mt-opt.is-correct { border-color: color-mix(in oklab, var(--ok) 60%, transparent); background: var(--ok-soft); }
.mt-opt-l { font-size: 11px; font-weight: 800; color: var(--ink-4); }
.mt-opt.is-correct .mt-opt-l { color: var(--ok); }
.mt-opt-t { flex: 1; }
.mt-opt-c { color: var(--ok); font-weight: 800; }
.mt-note { font-size: 13px; font-style: italic; color: var(--ink-4); margin-top: 2px; }

/* =====================================================================
   Teacher · My Students
   ===================================================================== */
.st-controls { display: flex; gap: 12px; align-items: center; margin: 6px 0 8px; flex-wrap: wrap; }
.st-search { position: relative; flex: 1 1 280px; }
.st-search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-4); font-size: 18px; pointer-events: none; }
.st-search .field-input { padding-left: 38px; width: 100%; }
.st-list { display: flex; flex-direction: column; }
.st-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 8px; border-bottom: 1px solid var(--rule); cursor: pointer; border-radius: 10px; }
.st-row:hover { background: var(--bg-3); }
.st-id { flex: 1; min-width: 0; }
.st-name { font-weight: 700; font-size: 16px; }
.st-handle { color: var(--ink-4); font-weight: 500; font-size: 14px; margin-left: 4px; }
.st-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.st-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--rule-2, var(--rule)); color: var(--ink-3); white-space: nowrap; }
.st-chip.is-oge { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 42%, transparent); }
.st-chip.is-ege { color: #7fb0ff; border-color: rgba(127,176,255,.42); }
.st-meta { text-align: right; flex-shrink: 0; }
.st-active { font-size: 13px; color: var(--ink-4); }
.st-active.is-today { color: var(--ok); font-weight: 700; }
.st-more { font-size: 13px; color: var(--ink-4); margin-top: 4px; }
.st-pop { position: absolute; z-index: 30; top: calc(100% - 4px); left: 56px; right: 10px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg, 16px); box-shadow: var(--shadow-pop); padding: 14px 16px; }
.st-pop-head { font-weight: 800; font-size: 17px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.st-pop-sub { font-size: 12.5px; font-weight: 500; color: var(--ink-4); }
.st-pop-row { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 4px; border: none; background: transparent; border-top: 1px solid var(--rule); cursor: pointer; text-align: left; }
.st-pop-row:hover { background: var(--bg-3); }
.st-pop-cls { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-weight: 700; font-size: 15px; }
.st-pop-stat { text-align: right; display: flex; flex-direction: column; }
.st-pop-stat b { font-size: 17px; }
.st-pop-stat span { font-size: 11px; color: var(--ink-4); }
.st-pop-arrow { color: var(--ink-4); font-size: 18px; }
