/* Brand tokens and Inter are taken from the Dombit School project. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/inter-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/inter-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
:root {
  --primary: #8e00d5;
  --primary-dark: #6500a3;
  --primary-light: #b83dff;
  --wash: #f3e6fa;
  --mist: #ead7f7;
  --ink: #1e002b;
  --page: #f4f4f7;
  --border: #e5e2eb;
  --muted: #777182;
  --positive: #18764e;
  --positive-wash: #ecf8f0;
  --negative: #c84255;
  --negative-wash: #fff0f2;
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: max(
    12px,
    env(safe-area-inset-bottom),
    var(--tg-content-safe-area-inset-bottom, 0px)
  );
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}
button:disabled {
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
}
input,
textarea,
select {
  outline: none;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
input::placeholder,
textarea::placeholder {
  color: #96909f;
}
h1,
h2,
p {
  margin: 0;
}
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100dvh;
  background: radial-gradient(ellipse at 85% 0%, #ead7f748, transparent 40%);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  padding: 31px 18px 20px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--border);
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -1px;
  line-height: 1;
}
.brand img {
  object-fit: contain;
}
.brand small {
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 1.3px;
  display: block;
  margin-top: 7px;
  color: #766b80;
}
.sidebar > .brand {
  margin: 0 8px 47px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: #91849e;
  margin: 0 12px 14px;
  font-weight: 600;
}
.navigation {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 12px;
  color: #7b7185;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  min-height: 47px;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav-item:hover {
  background: #f7f3fa;
}
.nav-item.active {
  background: var(--wash);
  color: var(--primary-dark);
}
.nav-item svg {
  width: 18px;
  height: 18px;
}
.count-pill {
  background: #f0edf4;
  border-radius: 6px;
  padding: 3px 7px;
  min-width: 23px;
  text-align: center;
  font-size: 10px;
  color: #7a6b88;
  font-weight: 600;
}
.nav-item .count-pill {
  margin-left: auto;
}
.nav-item.active .count-pill {
  background: #e4cef2;
  color: var(--primary-dark);
}
.sidebar-note {
  margin-top: auto;
  padding: 25px 12px;
  border-bottom: 1px solid var(--border);
  color: #9e8eaf;
}
.sidebar-note > span {
  color: var(--primary);
  display: block;
  margin-bottom: 13px;
}
.sidebar-note p {
  font-size: 13px;
  font-weight: 600;
  color: #594867;
  margin-bottom: 7px;
}
.sidebar-note small {
  font-size: 11px;
  line-height: 1.7;
  display: block;
  color: #96879f;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 8px 0;
}
.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--wash);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 650;
}
.avatar.small {
  width: 34px;
  height: 34px;
  font-size: 11px;
  border-radius: 50%;
}
.profile strong {
  font-size: 11px;
  display: block;
  max-width: 135px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile small {
  font-size: 10px;
  color: #8f829b;
  display: block;
  margin-top: 5px;
}
.shell > main {
  grid-column: 2;
  width: 100%;
  max-width: 1250px;
  padding: 0 40px;
  margin: auto;
  align-self: start;
  min-width: 0;
}
.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  color: #776c84;
  font-size: 12px;
}
.breadcrumb > span {
  padding: 0 12px;
  color: #c4bccc;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: #91859c;
}
.dev-badge {
  border: 1px solid #e5d6f0;
  background: #faf5fd;
  color: #9071a1;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 10px;
}
.mobile-brand,
.mobile-navigation {
  display: none;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 31px 0 25px;
}
.eyebrow {
  font-size: 10px;
  color: var(--primary);
  letter-spacing: 1.8px;
  font-weight: 650;
  margin-bottom: 9px;
}
h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.2;
}
.page-heading p:not(.eyebrow) {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
}
.heading-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--primary-dark);
  background: var(--wash);
  font-size: 10px;
  border-radius: 20px;
  padding: 9px 12px;
  white-space: nowrap;
}
.heading-badge svg {
  width: 14px;
  height: 14px;
}
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
}
.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--wash);
  color: var(--primary);
}
.stat-icon.positive {
  background: var(--positive-wash);
  color: var(--positive);
}
.stat-icon.negative {
  background: var(--negative-wash);
  color: var(--negative);
}
.stat small {
  display: block;
  font-size: 11px;
  color: #8b8096;
  margin-bottom: 5px;
}
.stat strong {
  font-size: 23px;
  font-weight: 650;
  line-height: 1;
}
.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 600px;
  margin: 0 auto;
  gap: 12px;
  align-items: start;
}
#workspace[data-view="entry"] .stats-strip,
#workspace[data-view="entry"] .recent-section,
#workspace[data-view="entry"] .page-footer {
  display: none;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 3px 12px #24003e03;
}
.student-panel {
  padding: 0;
}
.picker-content {
  padding: 0 16px 12px;
}
.student-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
  margin-bottom: 8px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #f8f7fa;
  min-width: 0;
}
.search-box > span {
  color: #9c8aa9;
}
.search-box svg {
  width: 18px;
  height: 18px;
}
.search-box:focus-within {
  border-color: #bf85df;
  background: #fff;
  box-shadow: 0 0 0 3px #8e00d50a;
}
.search-box input {
  border: 0;
  outline: none;
  background: none;
  min-width: 0;
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.search-box input:focus-visible {
  outline: none;
}
kbd {
  font:
    11px Inter,
    sans-serif;
  color: #b1a5bb;
  border: 1px solid #e2dce9;
  padding: 1px 4px;
  border-radius: 3px;
}
.class-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0;
  color: var(--muted);
}
select {
  font-size: 12px;
  color: #6a577c;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  max-width: 100%;
}
.class-filter-row > span {
  display: none;
}
.class-filter-row select {
  width: 100%;
  height: 100%;
}
.student-list {
  max-height: 210px;
  height: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -8px;
  padding: 0 3px 6px;
  scrollbar-width: thin;
  scrollbar-color: #dac4e8 transparent;
}
.student-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  gap: 11px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  min-height: 65px;
}
.student-item:hover {
  background: #faf7fc;
}
.student-item.selected {
  background: #f7effc;
  border-color: #dfc2ee;
}
.student-item:nth-child(3n + 2) .avatar {
  background: #eff0fc;
  color: #6b6aa1;
}
.student-item:nth-child(3n) .avatar {
  background: #f8edf5;
  color: #a1678d;
}
.student-name {
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.student-class {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #96879f;
  margin-top: 3px;
}
.select-ring {
  margin-left: auto;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1px solid #e0d7e7;
  display: grid;
  place-items: center;
  color: transparent;
  flex-shrink: 0;
}
.select-ring svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.5;
}
.student-item.selected .select-ring {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.selection-actions {
  border-top: 1px solid var(--border);
  padding: 8px 2px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.selection-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 550;
  flex: 1;
}
.selection-caption button:disabled {
  opacity: 0.4;
}
.selection-actions > .primary {
  display: flex;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 12px;
}
.behavior-panel {
  padding: 22px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  padding: 0;
  margin-bottom: 11px;
  width: 100%;
  color: #574360;
  font-size: 12px;
  font-weight: 600;
}
legend > span {
  float: right;
  font-weight: 400;
  color: #a18eac;
  font-size: 10px;
  line-height: 1.6;
}
.type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 23px;
}
.type-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  min-height: 62px;
}
.type-option:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.type-symbol {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #f2f1f5;
  color: #a294ac;
}
.type-symbol svg {
  width: 17px;
  height: 17px;
}
.type-option > span:nth-of-type(2) {
  font-size: 13px;
  font-weight: 600;
}
.type-option small {
  display: block;
  font-size: 10px;
  color: #9c8ea7;
  margin-top: 4px;
  font-weight: 400;
}
.reason-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 22px;
}
.reason-button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 10px;
  min-height: 46px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #80718c;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
}
.reason-button svg {
  width: 16px;
  height: 16px;
  color: #ad96bc;
}
.reason-button:hover {
  border-color: #c9a0df;
  background: #fcf9fe;
}
.reason-button:disabled {
  opacity: 0.45;
}
.comment-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px dashed var(--mist);
  border-radius: 10px;
  color: var(--primary-dark);
  background: #fcf9fe;
  font-size: 12px;
  text-align: left;
}
.comment-toggle > span:last-child {
  margin-left: auto;
}
.comment-toggle svg {
  width: 17px;
  height: 17px;
}
.quick-status {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.reason-button.selected {
  border-color: var(--primary);
  background: var(--wash);
  color: var(--primary-dark);
}
.reason-button.selected svg {
  color: var(--primary);
}
.comment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 10px;
  color: #a08daa;
}
.comment-heading label {
  font-size: 12px;
  color: #574360;
  font-weight: 600;
}
.comment-heading label span {
  font-size: 10px;
  font-weight: 400;
  color: #a18eac;
  margin-left: 5px;
}
textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #faf9fc;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
  min-height: 81px;
  resize: vertical;
}
.save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 21px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.save-row > span {
  font-size: 10px;
  color: #a18eac;
  display: flex;
  align-items: center;
  gap: 5px;
}
.save-row > span svg {
  width: 12px;
  height: 12px;
}
.primary {
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  padding: 12px 17px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 11px;
  box-shadow: 0 4px 12px #8e00d518;
  transition:
    background 0.15s,
    transform 0.15s;
}
.primary:hover:enabled {
  background: var(--primary-dark);
}
.primary:active:enabled {
  transform: translateY(1px);
}
.primary:disabled {
  background: #e7dcef;
  color: #ac91bc;
  box-shadow: none;
}
.primary svg {
  width: 16px;
  height: 16px;
}
.primary svg:last-child {
  margin-left: 8px;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 0;
  min-height: 28px;
}
.text-button svg {
  width: 14px;
  height: 14px;
}
.text-button:hover {
  color: var(--primary-dark);
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.section-title h2 {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.recent-section {
  margin-top: 26px;
}
.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.recent-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 15px;
  text-align: left;
}
.recent-card:hover {
  border-color: #c598dd;
}
.recent-top {
  display: flex;
  align-items: center;
  gap: 9px;
}
.recent-top .avatar {
  width: 33px;
  height: 33px;
  font-size: 10px;
  border-radius: 10px;
}
.recent-name {
  font-size: 11px;
  line-height: 1.6;
  font-weight: 550;
}
.recent-class {
  display: block;
  font-size: 10px;
  color: #9c8ba8;
}
.recent-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.reason-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--positive-wash);
  color: var(--positive);
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 9px;
  line-height: 1.5;
}
.reason-tag svg {
  width: 12px;
  height: 12px;
}
.reason-tag.negative {
  background: var(--negative-wash);
  color: var(--negative);
}
.recent-bottom time {
  font-size: 9px;
  color: #a18eac;
}
.empty-state {
  padding: 32px 15px;
  text-align: center;
  font-size: 12px;
  color: #a08ead;
  line-height: 1.7;
}
.empty-state > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--wash);
  border-radius: 13px;
  margin: 0 auto 13px;
  color: var(--primary);
}
.empty-state strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: #70567f;
  margin-bottom: 3px;
}
.recent-grid > .empty-state {
  grid-column: 1/-1;
  border: 1px dashed #d9c5e5;
  border-radius: 14px;
  background: #fbf8fd;
  padding: 23px;
}
.recent-grid > .empty-state > span {
  display: none;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  color: #ae9cba;
  font-size: 10px;
  margin-top: 30px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.history-card {
  padding: 20px;
}
.history-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.history-filters .search-box {
  flex: 1;
}
.history-filters select {
  padding: 12px;
  min-height: 45px;
}
.history-item {
  display: flex;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child {
  border: 0;
}
.history-detail {
  flex: 1;
  min-width: 0;
}
.history-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.history-header strong {
  font-size: 13px;
  font-weight: 600;
}
.class-badge {
  padding: 4px 7px;
  background: var(--wash);
  color: var(--primary-dark);
  font-size: 10px;
  border-radius: 5px;
}
.history-header time {
  margin-left: auto;
  color: #a590b1;
  font-size: 10px;
}
.history-detail p {
  font-size: 13px;
  line-height: 1.7;
  color: #7f6a8c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 10px;
}
.history-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: #9b88a7;
  font-size: 10px;
}
.history-meta > span:last-child {
  display: flex;
  align-items: center;
  gap: 4px;
}
.history-meta svg {
  width: 12px;
  height: 12px;
}
.auth-panel {
  max-width: 410px;
  margin: 12vh auto;
  text-align: center;
  padding: 28px 16px;
}
.auth-logo {
  margin-bottom: 22px;
  object-fit: contain;
}
.auth-panel > p:not(.eyebrow) {
  color: #8f7b9d;
  font-size: 14px;
  line-height: 1.8;
  margin: 20px 0;
}
.auth-panel .primary {
  font-size: 13px;
}
.auth-panel .text-button {
  display: flex;
  margin: 15px auto;
}
.form-error {
  font-size: 12px;
  color: var(--negative);
  line-height: 1.6;
  margin: 12px 0 0;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  width: max-content;
  background: var(--ink);
  color: white;
  padding: 15px 20px;
  border-radius: 13px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 6px 30px #1e002b25;
  z-index: 50;
}
.toast svg {
  width: 17px;
  height: 17px;
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .sidebar {
    width: 190px;
    padding: 28px 14px 18px;
  }
  .brand {
    font-size: 22px;
    gap: 9px;
  }
  .brand small {
    font-size: 6px;
  }
  .sidebar > .brand {
    margin-left: 5px;
  }
  .shell > main {
    padding: 0 25px;
  }
  .entry-grid {
    gap: 12px;
  }
  .behavior-panel {
    padding: 20px 17px;
  }
  .heading-badge {
    display: none;
  }
  .type-option {
    padding: 10px;
    gap: 7px;
  }
  .type-symbol {
    width: 26px;
    height: 26px;
  }
  .type-option small {
    font-size: 9px;
  }
  .save-row > span {
    display: none;
  }
  .save-row .primary {
    margin-left: auto;
  }
}
@media (max-width: 880px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .shell > main {
    padding: 0 22px;
    max-width: 760px;
  }
  .topbar {
    height: 76px;
  }
  .breadcrumb {
    display: none;
  }
  .mobile-brand {
    display: flex;
    margin: 0;
  }
  .mobile-brand small {
    font-size: 7px;
  }
  .mobile-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: #e9e5ee;
    border-radius: 13px;
    padding: 4px;
    margin-top: 17px;
  }
  .mobile-navigation .nav-item {
    justify-content: center;
    min-height: 43px;
    font-size: 13px;
    padding: 10px;
  }
  .mobile-navigation .nav-item.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 5px #2b003f09;
  }
  .mobile-navigation .count-pill {
    margin-left: 0;
    background: #ded6e7;
    color: #7b668b;
    font-size: 9px;
    min-width: 19px;
    padding: 2px 5px;
  }
  .mobile-navigation .active .count-pill {
    color: var(--primary);
    background: var(--wash);
  }
  .page-heading {
    padding: 24px 0;
  }
  .eyebrow {
    display: none;
  }
  .topbar-right time {
    font-size: 10px;
  }
  .recent-grid {
    grid-template-columns: 1fr;
  }
  .recent-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .recent-bottom {
    margin: 0;
    max-width: 50%;
    justify-content: flex-end;
  }
  .toast {
    bottom: 24px;
  }
}
@media (max-width: 680px) {
  .shell > main {
    padding: 0 16px;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
  }
  .topbar {
    height: 56px;
    border-bottom: 0;
  }
  .mobile-brand {
    font-size: 23px;
  }
  .mobile-brand img {
    width: 25px;
    height: 29px;
  }
  .mobile-brand small {
    font-size: 6px;
    letter-spacing: 1.2px;
  }
  .topbar-right time {
    display: none;
  }
  .dev-badge {
    font-size: 9px;
    padding: 5px 7px;
    border-radius: 7px;
  }
  .mobile-navigation {
    margin-top: 0;
  }
  .page-heading {
    padding: 14px 2px;
  }
  .page-heading h1 {
    font-size: 22px;
    letter-spacing: -0.8px;
  }
  .page-heading p:not(.eyebrow) {
    font-size: 12px;
    margin-top: 7px;
    line-height: 1.6;
    max-width: 300px;
  }
  .heading-badge {
    display: none;
  }
  #workspace[data-view="entry"] .page-heading p {
    display: none;
  }
  .stats-strip {
    gap: 8px;
    margin-bottom: 20px;
  }
  .stat {
    gap: 8px;
    padding: 12px 11px;
    border-radius: 13px;
  }
  .stat-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }
  .stat-icon svg {
    width: 15px;
    height: 15px;
  }
  .stat small {
    font-size: 9px;
    line-height: 1.5;
    margin-bottom: 5px;
  }
  .stat strong {
    font-size: 20px;
  }
  #workspace[data-view="entry"] .stats-strip {
    display: none;
  }
  .entry-grid {
    display: grid;
  }
  .card {
    border-radius: 17px;
  }
  .student-panel {
    padding: 0;
  }
  .search-box {
    padding: 12px;
    min-height: 48px;
    border-radius: 11px;
  }
  .search-box input,
  select,
  textarea {
    font-size: 16px;
  }
  .search-box svg {
    width: 19px;
    height: 19px;
  }
  .search-box kbd {
    display: none;
  }
  .class-filter-row {
    padding: 0;
  }
  .class-filter-row select {
    padding: 9px 11px;
    font-size: 14px;
    min-height: 40px;
  }
  .class-filter-row > span {
    font-size: 11px;
  }
  .student-list {
    height: auto;
    max-height: max(110px, min(24dvh, 210px));
    min-height: 75px;
    padding-bottom: 8px;
    margin: 0 -7px;
  }
  .student-item {
    min-height: 56px;
    padding: 7px 8px;
    gap: 12px;
  }
  .student-name {
    font-size: 14px;
    font-weight: 550;
  }
  .student-class {
    font-size: 11px;
    margin-top: 4px;
  }
  .avatar {
    width: 41px;
    height: 41px;
    font-size: 12px;
  }
  .select-ring {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    padding: 0;
    line-height: 0;
  }
  .select-ring .material-symbol {
    display: grid;
    width: 14px;
    height: 14px;
    place-items: center;
    font-size: 14px;
    line-height: 14px;
  }
  .select-ring svg {
    width: 12px;
    height: 12px;
  }
  .selection-actions {
    background: #fff;
    padding: 8px 0 0;
  }
  .selection-actions > .primary {
    display: flex;
    min-height: 44px;
    margin-top: 0;
    font-size: 12px;
  }
  .behavior-panel {
    padding: 14px;
  }
  .type-options {
    gap: 10px;
    margin-bottom: 14px;
  }
  .type-option {
    padding: 11px;
    gap: 9px;
    min-height: 48px;
    border-radius: 11px;
  }
  .type-option > span:nth-of-type(2) {
    font-size: 14px;
  }
  .type-option small {
    display: none;
  }
  .type-symbol {
    width: 27px;
    height: 27px;
  }
  .type-symbol svg {
    width: 16px;
    height: 16px;
  }
  legend {
    font-size: 12px;
    margin-bottom: 10px;
  }
  .type-fieldset > legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  legend > span {
    font-size: 10px;
  }
  .reason-list {
    gap: 8px;
    margin-bottom: 12px;
  }
  .reason-button {
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 9px;
    min-height: 52px;
    gap: 8px;
    border-radius: 10px;
  }
  .reason-button svg {
    width: 16px;
    height: 16px;
  }
  .comment-heading {
    font-size: 10px;
    margin-bottom: 9px;
  }
  .comment-heading label {
    font-size: 12px;
  }
  .comment-heading label span {
    font-size: 10px;
  }
  textarea {
    font-size: 16px;
    padding: 10px 11px;
    line-height: 1.6;
    min-height: 78px;
  }
  .save-row {
    position: sticky;
    bottom: 0;
    margin: 12px -14px -14px;
    padding: 10px 14px calc(6px + var(--safe-bottom));
    background: #ffffffed;
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    z-index: 5;
  }
  .save-row > span {
    display: none;
  }
  .save-row .primary {
    flex: 1;
    min-height: 49px;
    font-size: 14px;
    border-radius: 11px;
    margin: 0;
  }
  .save-row .primary svg:last-child {
    margin-left: auto;
  }
  .save-row .primary svg:first-child {
    margin-right: auto;
  }
  .behavior-panel {
    overflow: visible;
  }
  .recent-section {
    margin-top: 23px;
  }
  .section-title {
    margin-bottom: 13px;
  }
  .section-title h2 {
    font-size: 14px;
  }
  .text-button {
    font-size: 12px;
  }
  .recent-card {
    border-radius: 12px;
    padding: 13px;
  }
  .recent-name {
    font-size: 12px;
  }
  .recent-class {
    font-size: 10px;
  }
  .recent-top .avatar {
    width: 34px;
    height: 34px;
    font-size: 10px;
  }
  .reason-tag {
    font-size: 9px;
  }
  .recent-bottom time {
    font-size: 9px;
  }
  .recent-grid > .empty-state {
    padding: 19px 12px;
    font-size: 11px;
  }
  .recent-grid > .empty-state strong {
    font-size: 12px;
  }
  .page-footer {
    font-size: 9px;
    margin-top: 24px;
    padding: 17px 0;
  }
  .history-card {
    padding: 15px;
  }
  .history-filters {
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 15px;
  }
  .history-filters .search-box {
    flex-basis: 100%;
  }
  .history-filters select {
    font-size: 14px;
    min-height: 41px;
    padding: 9px 11px;
  }
  .history-item {
    gap: 10px;
    padding: 17px 0;
  }
  .history-item > .avatar {
    width: 35px;
    height: 35px;
    font-size: 10px;
    border-radius: 11px;
  }
  .history-header {
    gap: 6px;
  }
  .history-header strong {
    font-size: 13px;
  }
  .history-header time {
    font-size: 10px;
    flex-basis: 100%;
    margin: 3px 0 0;
  }
  .history-detail p {
    font-size: 12px;
  }
  .history-meta {
    font-size: 10px;
    gap: 8px;
  }
  .class-badge {
    font-size: 9px;
  }
  .toast {
    bottom: calc(24px + var(--safe-bottom));
    font-size: 12px;
    padding: 14px 17px;
  }
  .auth-panel {
    margin-top: 9vh;
    padding: 25px 5px;
  }
  .auth-panel h1 {
    font-size: 25px;
  }
  .auth-panel > p:not(.eyebrow) {
    font-size: 14px;
  }
  .auth-panel .eyebrow {
    display: block;
  }
  .empty-state {
    font-size: 12px;
    padding: 26px 12px;
  }
}

@media (max-width: 359px) {
  .shell > main {
    padding-left: 12px;
    padding-right: 12px;
  }
  .mobile-brand {
    font-size: 21px;
  }
  .type-option {
    gap: 6px;
    padding: 10px 8px;
  }
  .type-symbol {
    width: 23px;
    height: 23px;
  }
  .type-option small {
    font-size: 8px;
  }
  .type-option > span:nth-of-type(2) {
    font-size: 13px;
  }
  .reason-button {
    font-size: 11px;
    gap: 6px;
    padding: 10px 8px;
  }
  .student-name {
    font-size: 13px;
  }
  .stat {
    padding: 11px 8px;
    gap: 5px;
  }
  .stat-icon {
    display: none;
  }
  .stat small {
    font-size: 10px;
  }
}
.mobile-history {
  display: none;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#workspace[data-view="entry"] > .page-heading,
#workspace[data-view="entry"] > .mobile-navigation {
  display: none;
}
#entry-view {
  max-width: 480px;
  margin: 22px auto 0;
}
.wizard-header {
  margin-bottom: 12px;
}
.wizard-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.wizard-title-row h1 {
  font-size: 18px;
  letter-spacing: -0.4px;
  outline: none;
}
#wizard-back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  border-radius: 6px;
  color: var(--primary-dark);
}
#wizard-step-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.wizard-progress {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.wizard-progress > span {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: #e5dfe9;
}
.wizard-progress > .active {
  background: var(--primary);
}
#wizard-context {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wizard {
  display: block;
}
.wizard .card {
  border-radius: 8px;
  box-shadow: none;
}
.wizard .student-panel {
  padding: 0;
  background: transparent;
  border: 0;
}
.wizard .picker-content {
  padding: 0;
}
.wizard .student-filters {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 6px;
  margin-bottom: 8px;
}
.wizard .search-box {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 6px;
  background: white;
}
.wizard .class-filter-row {
  padding: 0;
}
.wizard select {
  border-radius: 6px;
  min-height: 42px;
  padding: 6px;
  font-size: 12px;
}
.wizard .student-list {
  height: min(
    440px,
    calc(100dvh - 268px - var(--safe-top) - var(--safe-bottom))
  );
  max-height: none;
  min-height: 90px;
  margin: 0;
  padding: 0 2px 0 0;
}
.wizard:has(#selected-students:not([hidden])) .student-list {
  height: min(
    440px,
    calc(100dvh - 356px - var(--safe-top) - var(--safe-bottom))
  );
}
.selected-students {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 8px;
}
.selection-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  min-height: 27px;
  padding: 1px 4px 1px 8px;
  border: 1px solid var(--mist);
  border-radius: 999px;
  background: var(--wash);
  color: var(--primary-dark);
  font-size: 10px;
  flex: 0 1 auto;
}
.selection-chip > span:first-child {
  min-width: 0;
  max-width: min(34vw, 140px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-class {
  font-weight: 650;
  background: #fff;
  padding: 2px 4px;
  border-radius: 999px;
}
.selection-chip button {
  display: grid;
  place-items: center;
  width: 22px;
  min-height: 22px;
  font-size: 15px;
}
.history-access-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.history-access-filters:has(> :not([hidden])) select {
  flex: 1;
  min-width: 120px;
  min-height: 42px;
}
.history-access-filters:not(:has(> :not([hidden]))) {
  display: none;
}
.wizard .student-item {
  min-height: 48px;
  padding: 6px 8px;
  gap: 9px;
  border-radius: 6px;
  border-bottom: 1px solid #eae5ee;
}
.wizard .student-item .avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 10px;
}
.wizard .student-name {
  font-size: 12px;
}
.wizard .student-class {
  margin-top: 1px;
  font-size: 10px;
}
.wizard .selection-actions {
  padding: 8px 0 0;
  background: transparent;
}
.wizard .selection-caption,
.wizard .selection-caption button {
  font-size: 11px;
}
.wizard .primary {
  border-radius: 6px;
  min-height: 42px;
  font-size: 12px;
}
.wizard .type-panel {
  border: 0;
  background: transparent;
  padding: 0;
}
.wizard .type-options {
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}
.wizard .type-option {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
}
.wizard .type-option > span:last-child {
  margin-left: auto;
}
.wizard .type-option small {
  display: block;
  font-size: 10px;
  margin-top: 3px;
  color: inherit;
  opacity: 0.7;
}
.wizard .type-option.positive {
  border-color: #cfdfd5;
  background: var(--positive-wash);
  color: var(--positive);
}
.wizard .type-option.negative {
  border-color: #ecd4da;
  background: var(--negative-wash);
  color: var(--negative);
}
.wizard .type-symbol {
  color: inherit;
  background: #ffffffb0;
  width: 30px;
  height: 30px;
}
.wizard .behavior-panel {
  padding: 0;
  border: 0;
  background: transparent;
}
.wizard .reason-fieldset legend {
  font-size: 11px;
  margin-bottom: 8px;
}
.wizard .reason-list {
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.wizard .reason-button {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink);
}
.wizard [data-type="positive"] .reason-button svg {
  color: var(--positive);
}
.wizard [data-type="negative"] .reason-button svg {
  color: var(--negative);
}
.wizard .comment-toggle {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 6px;
}
.wizard .behavior-panel:has(#comment-editor:not([hidden])) .reason-fieldset {
  display: none;
}
.wizard .behavior-panel:has(#comment-editor:not([hidden])) .reason-fieldset {
  display: block;
}
.wizard textarea {
  border-radius: 6px;
  padding: 10px;
  min-height: 112px;
  resize: vertical;
}
.wizard .save-row {
  position: static;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.wizard .save-row .primary {
  width: auto;
  flex: 1;
  min-height: 44px;
}
.wizard .save-row .text-button {
  min-height: 44px;
  padding: 6px 10px;
}
.wizard .quick-status {
  margin-top: 8px;
  font-size: 10px;
}
@media (max-width: 880px) {
  .mobile-history {
    display: inline-flex;
    min-height: 40px;
    font-size: 11px;
  }
  .topbar {
    height: 48px;
  }
  .mobile-brand {
    font-size: 19px;
    gap: 7px;
  }
  .mobile-brand img {
    width: 20px;
    height: 24px;
  }
  .mobile-brand small {
    font-size: 5px;
    letter-spacing: 0.8px;
  }
  body:has(#workspace:not([hidden])[data-view="entry"])
    .topbar-right
    > :not(.mobile-history) {
    display: none;
  }
  #entry-view {
    margin-top: 8px;
  }
  .shell > main {
    padding-left: 12px;
    padding-right: 12px;
  }
  .wizard-header {
    margin-bottom: 8px;
  }
  .wizard-title-row h1 {
    font-size: 17px;
  }
  .wizard .search-box input {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Material Design 3 refresh */
:root {
  --primary: #6750a4;
  --primary-dark: #4f378b;
  --primary-light: #7f67be;
  --wash: #eaddff;
  --mist: #d0bcff;
  --ink: #1d1b20;
  --page: #f7f4fa;
  --border: #cac4d0;
  --muted: #625d68;
  --positive: #386a20;
  --positive-wash: #d9f2c5;
  --negative: #b3261e;
  --negative-wash: #f9dedc;
  font-family: Roboto, Inter, sans-serif;
  color: var(--ink);
  background: var(--page);
  color-scheme: light;
}
body {
  background: var(--page);
  font-family: Roboto, Inter, sans-serif;
}
.material-symbol {
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  overflow: hidden;
  font-family: "Material Symbols Rounded";
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 450, "GRAD" 0, "opsz" 24;
  flex-shrink: 0;
}
.shell {
  background: var(--page);
}
.sidebar {
  background: #f3eff7;
  border-right: 1px solid #e7e0eb;
}
.brand {
  letter-spacing: -0.35px;
  font-weight: 700;
}
.brand small {
  letter-spacing: 1.1px;
  color: #625d68;
}
.nav-item {
  border-radius: 14px;
  min-height: 48px;
  color: #49454f;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.nav-item:hover {
  background: #e9e2ef;
}
.nav-item.active {
  background: #eaddff;
  color: #21005d;
  font-weight: 600;
}
.nav-item.active .material-symbol {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.nav-item .material-symbol {
  font-size: 22px;
}
.count-pill {
  border-radius: 999px;
  background: #e9e2ec;
  color: #49454f;
  font-variant-numeric: tabular-nums;
}
.sidebar-note {
  border-radius: 20px;
  background: #eaddff;
  color: #21005d;
}
.profile {
  border-top-color: #e2dce6;
}
.shell > main {
  max-width: 1360px;
  padding: 0 36px;
}
.topbar {
  height: 72px;
  border-bottom-color: #e7e0eb;
}
.breadcrumb,
.topbar-right {
  color: #625d68;
}
.mobile-brand {
  font-size: 21px;
}
.page-heading {
  padding: 28px 0 20px;
}
.eyebrow {
  color: var(--primary-dark);
  letter-spacing: 1px;
}
.page-heading h1 {
  font-size: 30px;
  letter-spacing: -0.35px;
  font-weight: 600;
}
.page-heading p:not(.eyebrow) {
  color: var(--muted);
}
.heading-badge {
  border-radius: 999px;
  background: #eaddff;
  color: #21005d;
  font-size: 12px;
  font-weight: 500;
}
.heading-badge .material-symbol {
  font-size: 18px;
}
.stats-strip {
  gap: 12px;
}
.stat {
  border: 0;
  border-radius: 20px;
  background: #f0ebf4;
  padding: 16px 20px;
}
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #eaddff;
  color: #4f378b;
}
.stat-icon .material-symbol {
  font-size: 23px;
}
.stat-icon.positive {
  background: #d9f2c5;
  color: #244f0b;
}
.stat-icon.negative {
  background: #f9dedc;
  color: #8c1d18;
}
.stat small {
  color: #625d68;
  font-size: 12px;
}
.stat strong {
  font-size: 24px;
  font-weight: 600;
}
.entry-grid {
  max-width: 680px;
}
.card {
  border: 1px solid #e7e0eb;
  border-radius: 24px;
  background: #fffbff;
  box-shadow: 0 1px 2px #20142a0a;
}
.search-box {
  border: 1px solid #79747e;
  border-radius: 12px;
  background: #fffbff;
  padding: 10px 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.search-box > span {
  color: #625d68;
}
.search-box .material-symbol {
  font-size: 22px;
}
.search-box:focus-within {
  border: 2px solid var(--primary);
  padding: 9px 13px;
  background: #fffbff;
  box-shadow: none;
}
.search-box input {
  color: var(--ink);
}
select,
.history-filters select,
.history-access-filters select,
.class-filter-row select {
  border: 1px solid #79747e;
  border-radius: 12px;
  background-color: #fffbff;
  color: var(--ink);
}
select:focus,
.class-filter-row select:focus {
  border-color: var(--primary);
}
.student-list {
  gap: 4px;
}
.student-item {
  border-radius: 14px;
  border-bottom: 0;
  transition: background 140ms ease;
}
.student-item:hover {
  background: #f2edf5;
}
.student-item.selected {
  background: #eaddff;
}
.avatar {
  border-radius: 14px;
  background: #eaddff;
  color: #21005d;
  font-weight: 600;
}
.student-item.selected .avatar {
  background: #d0bcff;
}
.select-ring {
  border-color: #79747e;
}
.student-item.selected .select-ring {
  border-color: var(--primary);
  background: var(--primary);
}
.selection-chip {
  border: 0;
  background: #eaddff;
  color: #21005d;
  font-size: 12px;
}
.selected-class {
  background: #f6f0ff;
}
.selection-actions {
  border-top: 1px solid #e7e0eb;
  margin-top: 10px;
  padding-top: 12px;
}
.text-button {
  border-radius: 999px;
  color: var(--primary-dark);
  font-weight: 500;
  transition: background 140ms ease;
}
.text-button:hover {
  background: #f1ebf7;
}
.primary {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 4px #20142a1a;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.primary:hover:enabled {
  background: #5b4498;
  box-shadow: 0 3px 8px #20142a26;
}
.primary:active:enabled {
  transform: scale(0.985);
  box-shadow: none;
}
.primary:disabled {
  background: #e6e1e9;
  color: #938d98;
  box-shadow: none;
}
.primary .material-symbol {
  font-size: 20px;
}
.wizard-header {
  margin-bottom: 16px;
}
.wizard-title-row {
  gap: 12px;
}
.wizard-title-row h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.25px;
}
#wizard-back {
  border-radius: 50%;
  color: var(--primary-dark);
}
#wizard-back:hover {
  background: #eaddff;
}
#wizard-back .material-symbol {
  font-size: 24px;
}
#wizard-step-count {
  color: #625d68;
  font-size: 13px;
  font-weight: 500;
}
.wizard-progress {
  gap: 6px;
  margin-top: 12px;
}
.wizard-progress > span {
  height: 4px;
  border-radius: 999px;
  background: #e7e0eb;
}
.wizard-progress > .active {
  background: var(--primary);
}
#wizard-context {
  display: inline-block;
  max-width: 100%;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eaddff;
  color: #21005d;
  font-size: 12px;
}
.wizard .student-filters {
  gap: 8px;
  margin-bottom: 10px;
}
.wizard .search-box {
  min-height: 48px;
}
.wizard .class-filter-row select {
  min-height: 48px;
  padding: 8px 12px;
  font-size: 14px;
}
.wizard .student-list {
  padding-right: 0;
}
.wizard .student-item {
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 14px;
  border-bottom: 0;
}
.wizard .student-item .avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  font-size: 12px;
  background: #eaddff;
  color: #21005d;
}
.wizard .student-name {
  font-size: 14px;
  font-weight: 500;
}
.wizard .student-class {
  color: #625d68;
  font-size: 12px;
}
.wizard .selection-actions {
  border-top: 0;
  margin-top: 6px;
  padding-top: 8px;
}
.wizard .selection-caption,
.wizard .selection-caption button {
  font-size: 12px;
}
.wizard .primary {
  min-height: 48px;
  font-size: 14px;
}
.wizard .type-panel,
.wizard .behavior-panel {
  padding: 18px;
  border: 1px solid #e7e0eb;
  border-radius: 24px;
  background: #fffbff;
}
.wizard .type-options {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wizard .type-option {
  min-height: 132px;
  padding: 18px;
  flex-wrap: wrap;
  align-content: space-between;
  border: 1px solid transparent;
  border-radius: 20px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.wizard .type-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px #20142a14;
}
.wizard .type-option.positive {
  background: #e8f4df;
  color: #244f0b;
}
.wizard .type-option.negative {
  background: #f9dedc;
  color: #8c1d18;
}
.wizard .type-symbol {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #ffffffab;
}
.wizard .type-symbol .material-symbol {
  font-size: 24px;
}
.wizard .type-option > span:nth-of-type(2) {
  width: 100%;
  font-size: 16px;
  font-weight: 600;
}
.wizard .type-option small {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
}
.wizard .type-option > span:last-child {
  display: none;
}
.wizard .reason-fieldset legend {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  color: #1d1b20;
  font-size: 16px;
  font-weight: 600;
}
.wizard .reason-fieldset legend > span {
  color: #625d68;
  font-size: 12px;
  font-weight: 400;
  text-align: right;
}
.wizard .reason-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.wizard .reason-button {
  position: relative;
  min-height: 70px;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 30px 12px 12px;
  border: 1px solid #e7e0eb;
  border-radius: 16px;
  background: #f7f2fa;
  color: #1d1b20;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  transition: background 140ms ease, border-color 140ms ease;
}
.wizard .reason-button:hover {
  border-color: #79747e;
  background: #f1ebf5;
}
.wizard .reason-button .material-symbol {
  margin-top: 1px;
  color: #625d68;
  font-size: 21px;
}
.wizard .reason-button.selected {
  border-color: var(--primary);
  background: #eaddff;
  color: #21005d;
}
.wizard .reason-button.selected .material-symbol {
  color: #4f378b;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.wizard .reason-button.selected::after {
  content: "check";
  position: absolute;
  top: 10px;
  right: 10px;
  color: #4f378b;
  font-family: "Material Symbols Rounded";
  font-size: 19px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}
.wizard .comment-toggle {
  min-height: 48px;
  border: 1px solid #79747e;
  border-radius: 999px;
  background: transparent;
  color: #4f378b;
  font-size: 14px;
  font-weight: 500;
}
.wizard .comment-toggle .material-symbol {
  font-size: 20px;
}
.wizard textarea {
  min-height: 100px;
  border: 1px solid #79747e;
  border-radius: 12px;
  background: #fffbff;
  color: var(--ink);
}
.wizard textarea:focus {
  border: 2px solid var(--primary);
}
.wizard .save-row {
  gap: 8px;
  margin-top: 14px;
}
.wizard .save-row .primary {
  min-height: 50px;
}
.wizard .save-row .text-button {
  padding: 0 14px;
}
.wizard .quick-status {
  color: #625d68;
  font-size: 12px;
}
.history-card {
  border: 1px solid #e7e0eb;
  border-radius: 24px;
  background: #fffbff;
}
.history-item {
  border-color: #e7e0eb;
}
.history-meta .reason-tag,
.reason-tag {
  border-radius: 999px;
}
.reason-tag .material-symbol,
.history-meta .material-symbol,
.recent-card .material-symbol {
  font-size: 17px;
}
.auth-panel {
  border: 1px solid #e7e0eb;
  border-radius: 28px;
  background: #fffbff;
  box-shadow: 0 8px 32px #20142a12;
}
.auth-panel .primary {
  border-radius: 999px;
}
.toast {
  border-radius: 16px;
  background: #322f35;
  box-shadow: 0 4px 14px #20142a29;
}
.toast .material-symbol {
  color: #d0bcff;
  font-size: 20px;
}

@media (max-width: 880px) {
  .shell > main {
    max-width: 700px;
    padding: 0 20px calc(96px + var(--safe-bottom));
  }
  .topbar {
    height: 64px;
    border-bottom: 1px solid #e7e0eb;
  }
  .mobile-brand {
    gap: 9px;
    font-size: 20px;
  }
  .mobile-brand small {
    font-size: 6px;
    letter-spacing: 1px;
  }
  .mobile-history {
    display: none;
  }
  #workspace[data-view="entry"] > .mobile-navigation,
  .mobile-navigation {
    position: fixed;
    z-index: 30;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: calc(76px + var(--safe-bottom));
    margin: 0;
    padding: 8px 12px calc(8px + var(--safe-bottom));
    border-top: 1px solid #e7e0eb;
    border-radius: 0;
    background: #f7f4faeF;
    backdrop-filter: blur(18px);
  }
  .mobile-navigation .nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 56px;
    padding: 4px 10px;
    border-radius: 16px;
    color: #49454f;
    font-size: 12px;
    font-weight: 500;
  }
  .mobile-navigation .nav-item .material-symbol {
    position: relative;
    z-index: 1;
    width: 54px;
    height: 30px;
    border-radius: 999px;
    font-size: 22px;
  }
  .mobile-navigation .nav-item.active {
    background: transparent;
    color: #1d1b20;
    box-shadow: none;
  }
  .mobile-navigation .nav-item.active::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: #eaddff;
    transform: translateX(-50%);
  }
  .mobile-navigation .nav-item.active .material-symbol {
    color: #21005d;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
  }
  .mobile-navigation .count-pill {
    position: absolute;
    top: 5px;
    left: calc(50% + 18px);
    min-width: 17px;
    padding: 1px 4px;
    background: #e9e2ec;
    font-size: 10px;
  }
  .mobile-navigation .active .count-pill {
    background: #d0bcff;
    color: #21005d;
  }
  #entry-view {
    max-width: 620px;
    margin-top: 20px;
  }
  .wizard-header {
    margin-bottom: 14px;
  }
  .wizard-title-row h1 {
    font-size: 23px;
  }
  .wizard .student-panel {
    padding: 0;
  }
  .wizard .picker-content {
    padding: 14px;
    border: 1px solid #e7e0eb;
    border-radius: 24px;
    background: #fffbff;
  }
  .wizard .selection-actions {
    margin-top: 8px;
  }
  .wizard .selection-actions > .primary {
    min-height: 50px;
  }
  .wizard .behavior-panel,
  .wizard .type-panel {
    padding: 18px;
  }
  .wizard .reason-button {
    min-height: 68px;
  }
  .wizard .save-row {
    position: static;
    margin: 14px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .wizard .save-row .primary {
    flex: 1;
    min-height: 50px;
    margin: 0;
    border-radius: 999px;
  }
  .history-card {
    padding: 18px;
  }
  .toast {
    bottom: calc(88px + var(--safe-bottom));
  }
}
@media (max-width: 420px) {
  .shell > main {
    padding-right: 14px;
    padding-left: 14px;
  }
  .topbar {
    height: 58px;
  }
  .wizard-title-row h1 {
    font-size: 21px;
  }
  #entry-view {
    margin-top: 15px;
  }
  .wizard .picker-content {
    padding: 12px;
    border-radius: 20px;
  }
  .wizard .student-filters {
    grid-template-columns: minmax(0, 1fr) 105px;
    gap: 6px;
  }
  .wizard .search-box {
    padding-right: 10px;
    padding-left: 10px;
  }
  .wizard .class-filter-row select {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 12px;
  }
  .wizard .student-list {
    min-height: 76px;
  }
  .wizard .type-panel,
  .wizard .behavior-panel {
    padding: 14px;
    border-radius: 20px;
  }
  .wizard .type-options {
    gap: 8px;
  }
  .wizard .type-option {
    min-height: 118px;
    padding: 13px;
    border-radius: 18px;
  }
  .wizard .reason-list {
    gap: 7px;
  }
  .wizard .reason-button {
    min-height: 72px;
    gap: 7px;
    padding: 10px 26px 10px 9px;
    border-radius: 14px;
    font-size: 12px;
  }
  .wizard .reason-button .material-symbol {
    font-size: 19px;
  }
  .wizard .reason-button.selected::after {
    top: 7px;
    right: 7px;
    font-size: 16px;
  }
  .wizard .reason-fieldset legend {
    align-items: flex-start;
  }
  .wizard .reason-fieldset legend > span {
    max-width: 58%;
    font-size: 11px;
  }
}

/* History: one calm list, color-coded by mark type. */
#workspace[data-view="history"] .stats-strip {
  display: none !important;
}
#history-list {
  margin-top: 4px;
}
#history-list {
  overflow: hidden;
  border: 1px solid #e7e0eb;
  border-radius: 18px;
  background: #fffbff;
}
#history-list > .history-item {
  display: block;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid #e7e0eb;
  border-left: 4px solid transparent;
  background: #fffbff;
}
#history-list > .history-item:last-child {
  border-bottom: 0;
}
#history-list > .history-item.positive {
  border-left-color: #386a20;
}
#history-list > .history-item.negative {
  border-left-color: #b3261e;
}
#history-list .history-header {
  gap: 8px;
}
#history-list .history-header strong {
  color: #1d1b20;
  font-size: 14px;
  font-weight: 600;
}
#history-list .class-badge {
  border-radius: 999px;
  background: #f0ebf4;
  color: #49454f;
  font-size: 11px;
  padding: 4px 9px;
}
#history-list .history-header time {
  color: #625d68;
  font-size: 12px;
}
#history-list .history-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
}
#history-list .reason-tag {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
#history-list .reason-tag.positive {
  background: #e8f4df;
  color: #244f0b;
}
#history-list .reason-tag.negative {
  background: #f9dedc;
  color: #8c1d18;
}
#history-list .history-content p {
  margin: 2px 0 0;
  color: #49454f;
  font-size: 14px;
  line-height: 1.5;
}
#history-list .history-meta {
  margin-top: 8px;
  color: #625d68;
  font-size: 12px;
}
#history-list .history-meta .material-symbol {
  font-size: 16px;
}
#history-list > .empty-state {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
@media (max-width: 680px) {
  #history-list {
    border-radius: 16px;
  }
  #history-list > .history-item {
    padding: 13px 12px;
  }
  #history-list .history-header time {
    flex-basis: auto;
    margin: 0 0 0 auto;
  }
  #history-list .history-content {
    flex-direction: column;
    gap: 4px;
  }
}

/* Mobile polish: consistent picker edges and more comfortable tap targets. */
@media (max-width: 880px) {
  .wizard-title-row h1 {
    font-size: 25px;
  }
  #wizard-step-count {
    font-size: 14px;
  }
  .wizard .picker-content {
    padding: 16px;
    border-radius: 22px;
  }
  .wizard .search-box,
  .wizard .class-filter-row select {
    min-height: 48px;
    border-radius: 12px;
  }
  .wizard .student-item {
    min-height: 60px;
    padding: 9px 10px;
    border-radius: 12px;
  }
  .wizard .student-item .avatar {
    width: 40px;
    height: 40px;
  }
  .wizard .student-name {
    font-size: 15px;
  }
  .wizard .student-class {
    font-size: 13px;
  }
  .select-ring {
    width: 21px;
    height: 21px;
  }
  .mobile-navigation .nav-item {
    min-height: 60px;
    font-size: 13px;
  }
  .mobile-navigation .count-pill {
    top: 3px;
    left: calc(50% + 23px);
    min-width: 18px;
    min-height: 18px;
    padding: 2px 5px;
    font-size: 10px;
    line-height: 14px;
  }
}
@media (max-width: 420px) {
  .shell > main {
    padding-right: 14px;
    padding-left: 14px;
  }
  .wizard-title-row h1 {
    font-size: 23px;
  }
  .wizard .picker-content {
    padding: 14px;
    border-radius: 20px;
  }
  .wizard .student-filters {
    grid-template-columns: minmax(0, 1fr) 105px;
  }
}

#history-list > .history-item {
  position: relative;
  border-left: 0;
  padding-left: 20px;
}
#history-list > .history-item::before {
  position: absolute;
  inset: 0 auto 0 6px;
  width: 3px;
  border-radius: 999px;
  content: "";
}
#history-list > .history-item.positive::before {
  display: none;
}
#history-list > .history-item.negative::before {
  background: #b3261e;
}

/* Keep each history entry compact, especially in the phone layout. */
#history-list > .history-item {
  padding-top: 9px;
  padding-bottom: 9px;
}
#history-list > .history-item.positive {
  padding-left: 16px;
  border-bottom-color: #d6ead2;
  background: #eaf5e5;
}
#history-list .history-header {
  gap: 5px;
}
#history-list .history-header strong {
  font-size: 13px;
}
#history-list .class-badge {
  padding: 3px 7px;
  font-size: 10px;
}
#history-list .history-header time {
  font-size: 11px;
}
#history-list .history-content {
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  margin-top: 4px;
}
#history-list .reason-tag {
  padding: 3px 8px;
  font-size: 11px;
}
#history-list .history-content p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}
#history-list .history-meta {
  margin-top: 4px;
  font-size: 11px;
}
@media (max-width: 680px) {
  #history-list > .history-item {
    padding: 8px 10px 8px 18px;
  }
  #history-list > .history-item.positive {
    padding-left: 10px;
  }
  #history-list .history-content {
    flex-direction: row;
  }
}

.history-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 12px;
  overflow-x: auto;
  border-bottom: 1px solid #e7e0eb;
  scrollbar-width: none;
}
.history-tabs::-webkit-scrollbar {
  display: none;
}
.history-tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #625d68;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.history-tab.active {
  border-bottom-color: #8e00d5;
  color: #6500a3;
}
.history-tab:focus-visible {
  outline: 2px solid #8e00d5;
  outline-offset: -3px;
  border-radius: 6px 6px 0 0;
}
