:root {
  color-scheme: light;
  --ink: #111827;
  --ivory: #f8f7fc;
  --lime: #b9f368;
  --paper: #f5f6fb;
  --card: #ffffff;
  --line: #e6e8f0;
  --mute: #374151;
  --ok: #14532d;
  --accent: #4338ca;
  --font: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  max-width: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #426221; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip {
  position: absolute;
  z-index: 5;
  left: 1rem;
  top: .6rem;
  padding: .7rem 1rem;
  background: var(--lime);
  color: var(--ink);
  transform: translateY(-180%);
}
.skip:focus { transform: none; }
.top { background: var(--ink); color: var(--ivory); }
.top-inner {
  width: min(100% - 1.6rem, 72rem);
  margin-inline: auto;
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem .8rem;
  flex-wrap: wrap;
  padding-block: .45rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  min-width: 0;
  color: var(--ivory);
  text-decoration: none;
  font-weight: 680;
  letter-spacing: -.04em;
  font-size: 1.05rem;
  flex: 1 1 auto;
}
.brand img { object-fit: contain; }
.top-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; }
#view-demo { color: var(--ivory); font-weight: 700; white-space: nowrap; }
.workspace-nav { color: var(--ivory); font-size: .875rem; font-weight: 650; padding: .6rem .65rem; border-radius: .5rem; text-decoration: none; }
.workspace-nav:hover, .workspace-nav[aria-current="page"] { background: #293240; color: var(--lime); }
.workspace-back { margin-bottom: 1rem; font-size: .95rem; font-weight: 650; }
.continue-setup { font-size: .875rem; white-space: nowrap; }
.profile-page { display: grid; gap: 1.5rem; }
.profile-heading, .profile-library-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.profile-heading h1 { margin-block: .25rem; }
.profile-heading .lede { margin: 0; max-width: 44rem; }
.profile-heading .btn { margin: 0; }
.profile-identity { display: flex; justify-content: center; padding: 1.75rem 1.5rem; }
.profile-avatar-block { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; max-width: 28rem; overflow-wrap: anywhere; }
.profile-avatar-frame { position: relative; width: 7.5rem; height: 7.5rem; margin-bottom: .9rem; }
.profile-avatar { position: relative; width: 7.5rem; height: 7.5rem; display: grid; place-items: center; border: 0; padding: 0; border-radius: 999px; background: var(--ink); color: var(--lime); font: inherit; font-size: 2.5rem; font-weight: 650; overflow: hidden; cursor: pointer; }
.profile-avatar:disabled { cursor: default; }
.profile-avatar img, .header-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-camera { position: absolute; right: 0; bottom: 0; z-index: 2; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(17, 24, 39, .16); cursor: pointer; }
.avatar-camera:hover, .avatar-camera:focus-visible { background: #f4f7f1; border-color: #1f2937; }
.avatar-menu { position: absolute; z-index: 4; left: 50%; top: calc(100% + .35rem); transform: translateX(-50%); min-width: 11rem; padding: .3rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--card, #fff); box-shadow: 0 8px 24px rgba(17, 24, 39, .12); }
.avatar-menu button { width: 100%; min-height: 2.75rem; padding: .55rem .75rem; border: 0; border-radius: .45rem; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.avatar-menu button:hover, .avatar-menu button:focus-visible { background: var(--paper, #f6f7f4); }
.header-avatar { position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; padding: 0; border-radius: 999px; overflow: hidden; background: #1c2430; color: var(--lime); font: inherit; font-size: .75rem; font-weight: 700; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(248, 247, 252, .45); cursor: pointer; }
.header-avatar:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.account-menu { position: fixed; z-index: 60; width: min(20rem, calc(100vw - 1rem)); max-height: min(70dvh, 28rem); overflow: auto; padding: .35rem; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 1px 2px rgba(17, 24, 39, .08), 0 18px 48px rgba(17, 24, 39, .2); }
.account-menu-id { padding: .75rem .85rem .65rem; border-bottom: 1px solid var(--line); margin-bottom: .25rem; }
.account-menu-name { font-weight: 700; overflow-wrap: anywhere; }
.account-menu-email { margin-top: .15rem; color: var(--mute); font-size: .92rem; overflow-wrap: anywhere; }
.account-menu [role="menu"] { display: grid; }
.account-menu [role="menuitem"] { display: flex; align-items: center; width: 100%; min-height: 2.75rem; padding: .45rem .85rem; border: 0; border-radius: .55rem; background: transparent; color: inherit; font: inherit; font-weight: 650; text-align: left; text-decoration: none; cursor: pointer; }
.account-menu [role="menuitem"]:hover, .account-menu [role="menuitem"]:focus-visible { background: var(--paper); }
.account-cluster { display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 auto; max-width: 100%; min-width: 0; }
.profile-session { display: flex; justify-content: flex-end; margin-top: .25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.profile-session .btn { margin: 0; min-width: 10.5rem; }
.profile-identity h2 { font-size: clamp(1.3rem, 3vw, 1.65rem); margin: 0 0 .3rem; }
.profile-email { color: var(--mute); overflow-wrap: anywhere; margin-top: .25rem; }
.profile-role { display: inline-block; font-size: .875rem; margin-top: .65rem; color: #365615; background: #edf7db; padding: .3rem .65rem; border-radius: 2rem; }
.profile-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; margin: 0; }
.profile-stats > div { display: flex; flex-direction: column-reverse; gap: .4rem; background: white; border: 1px solid var(--line); border-radius: 1rem; padding: 1.2rem; }
.profile-stats dt { font-size: .875rem; font-weight: 550; color: var(--mute); }
.profile-stats dd { margin: 0; font-size: 2rem; font-weight: 650; letter-spacing: -.05em; }
.profile-start { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1.5rem; background: #edf4e4; border-color: #dce6d0; }
.profile-start h2 { font-size: 1.5rem; margin-block: .4rem .6rem; }
.profile-start p:not(.kicker) { max-width: 40rem; line-height: 1.6; }
.profile-shortcuts { flex: 0 1 24rem; width: min(100%, 24rem); min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: .65rem; }
.profile-shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.profile-shortcut-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.profile-shortcuts .btn { margin: 0; width: 100%; min-height: 2.75rem; padding: .5rem .75rem; white-space: normal; text-align: center; line-height: 1.2; text-decoration: none; appearance: none; text-wrap: balance; }
.profile-shortcuts .btn-secondary { background: #fff; color: var(--ink); border-color: #d5d8e4; }
.profile-library { min-width: 0; }
.profile-library-heading h2 { font-size: 1.6rem; }
.profile-filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.profile-filters .field { margin: 0; }
.profile-filters input, .profile-filters select { width: 100%; min-width: 0; border: 1px solid #8b929c; border-radius: .6rem; background: white; color: var(--ink); font: inherit; padding: .75rem; min-height: 2.75rem; }
.profile-filters .field > span { display: block; font-size: .875rem; margin-bottom: .45rem; font-weight: 650; }
.profile-filter-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.4rem; font-size: .875rem; color: var(--mute); }
.profile-filter-status .btn { margin: 0; padding: .3rem .65rem; min-height: 2rem; font-size: .875rem; }
.profile-class { background: white; border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 4px 16px #11182706; padding: 1.2rem; gap: .75rem; }
.profile-class h3 { font-size: 1.3rem; line-height: 1.3; margin-top: .4rem; overflow-wrap: anywhere; }
.profile-class-state { font-size: .875rem; color: var(--mute); }
.profile-class-state.has-pending { color: #80510a; font-weight: 650; }
.profile-open { margin-top: auto; padding-top: .65rem; font-weight: 650; font-size: .95rem; }
.profile-empty { text-align: center; padding: 2rem; margin-top: .5rem; }
.profile-empty p { margin-top: .6rem; line-height: 1.6; color: var(--mute); }
@media (max-width: 700px) {
  .profile-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .profile-identity, .profile-start { padding: 1.1rem; }
  .profile-start { flex-direction: column; align-items: stretch; }
  .profile-shortcuts { width: 100%; flex-basis: auto; align-items: stretch; text-align: center; }
  .profile-shortcut-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-filters { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .profile-filters .field:first-child { grid-column: 1 / -1; }
  .workspace-nav { padding: .55rem .4rem; }
}
.badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  max-width: 100%;
  padding: .15rem .7rem;
  border-radius: 999px;
  background: var(--lime);
  color: #14210c;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-align: center;
}
.account-logout, .btn, .file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 650;
  letter-spacing: -.02em;
  cursor: pointer;
  text-decoration: none;
}
.btn { background: var(--ink); color: var(--ivory); }
.account-logout { width: 2.75rem; min-width: 2.75rem; height: 2.75rem; padding: 0; background: transparent; color: var(--ivory); border-color: #9aa59c; line-height: 0; }
.account-logout svg { display: block; }
.account-logout:focus-visible { border-color: var(--lime); color: var(--lime); background: transparent; }
.btn.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.btn-secondary:hover { background: var(--paper); color: var(--ink); }
.profile-session .btn.btn-secondary { background: #fff; color: var(--ink); border-color: #c5cad6; }
.page-regrade { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .65rem; margin: .5rem 0; }
.page-regrade .btn-regrade { flex: 0 0 auto; width: auto; min-height: 2.75rem; padding: .25rem .65rem; font-size: .8rem; }
.page-regrade .save-status:not(:empty) { flex-basis: 100%; margin: .25rem 0; }
.page-regrade .save-status:empty { display: none; }
.btn-lime { background: var(--lime); color: #14210c; }
.btn:disabled, .file-btn:disabled { opacity: .65; cursor: progress; }
#app { width: min(100% - 1.6rem, 72rem); max-width: 100%; margin: 1.25rem auto 3rem; min-width: 0; }
#app:focus { outline: none; }
.loading, .noscript { padding: 1rem 0; color: var(--mute); }
.kicker {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #3f6a14;
}
h1 {
  margin-top: .35rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -.05em;
  font-weight: 560;
}
.lede { margin-top: .7rem; max-width: 40rem; color: var(--mute); line-height: 1.5; overflow-wrap: anywhere; }
.back {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 650;
  text-decoration: none;
}
.gate {
  max-width: 36rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1.3rem 1.2rem 1.4rem;
}
.gate .btn { margin-top: 1.1rem; }
.gate .field input,
.auth-panel .field input,
.profile-password .field input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 2.75rem;
  font-size: 1rem;
  border: 1px solid #8a8476;
  border-radius: .55rem;
  padding: .7rem .75rem;
  background: #fff;
  color: var(--ink);
}
.auth-link { margin: .85rem 0 0; }
.auth-link .text-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
.auth-panel { max-width: 36rem; }
.profile-password { min-width: 0; }
.profile-password h2 { font-size: 1.25rem; margin-bottom: .2rem; }
.verify-banner {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: .75rem .9rem;
  background: #fff7e6;
  border: 1px solid #ead7a6;
  border-radius: .85rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.verify-banner .text-link {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  min-height: 2.75rem;
  cursor: pointer;
}
.verify-banner .save-status { margin: 0; min-height: 0; }
.gate-note, .save-status, .drop-status, .flash {
  min-height: 1.3rem;
  margin-top: .75rem;
  line-height: 1.45;
}
.flash {
  background: #e7f5c8;
  color: var(--ok);
  border-radius: .7rem;
  padding: .75rem .9rem;
  margin: .9rem 0;
}
.class-grid, .exam-strip, .students, .stat-grid, .sample-sheets, .review-grid {
  display: grid;
  gap: .8rem;
  grid-template-columns: minmax(0, 1fr);
}
.class-grid > *, .exam-strip > *, .stat-grid > *, .sample-sheets > *, .review-grid > *, .workspace > *, .stack > * {
  min-width: 0;
  max-width: 100%;
}
.class-card, .exam-card, .student, .paper, .panel, .kpi, .review-head, .heat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .06);
}
.class-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 1rem 1rem 1.05rem;
  min-height: 100%;
  text-decoration: none;
}
.class-card h2, .exam-card h2, .paper h2, .student h2 {
  font-size: 1.2rem;
  letter-spacing: -.03em;
  font-weight: 650;
}
.item-card-header, .item-detail-header, .item-heading-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; min-width: 0; }
.item-card-header > :first-child, .item-detail-header > h1 { min-width: 0; overflow-wrap: anywhere; }
.item-heading-actions { align-items: center; }
.class-card-link { text-decoration: none; flex: 1; }
.class-card-link:hover h2 { text-decoration: underline; }
.item-actions { position: relative; flex: 0 0 auto; text-align: left; }
.item-actions > summary { display: flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: .6rem; cursor: pointer; font-size: .85rem; font-weight: 650; list-style: none; }
.item-actions > summary::after { content: "▾"; }
.item-actions > summary::-webkit-details-marker { display: none; }
.item-actions[open] > summary { background: var(--paper); }
.item-actions-popover { position: absolute; z-index: 10; right: 0; top: calc(100% + .3rem); min-width: 10rem; padding: .3rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--card); box-shadow: 0 8px 24px rgba(17,24,39,.12); }
.item-actions-popover button { width: 100%; min-height: 2.75rem; padding: .6rem .7rem; border: 0; border-radius: .4rem; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.item-actions-popover button:hover { background: var(--paper); }
.trash-panel { margin: 1rem 0; }
.trash-panel > summary { cursor: pointer; font-size: 1.1rem; font-weight: 700; }
.trash-panel ul { padding: 0; list-style: none; }
.trash-panel li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.trash-item-name { display: grid; gap: .15rem; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.trash-panel li .save-status { flex-basis: 100%; }
.trash-panel .save-status:empty, .flash .save-status:empty { display: none; }
.archive-dialog { width: min(100% - 2rem, 34rem); max-height: calc(100dvh - 2rem); padding: 1.4rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--card); color: var(--ink); overflow: auto; }
.archive-dialog::backdrop { background: rgba(17,24,39,.55); }
.archive-dialog h2 { font-size: 1.4rem; }
.archive-dialog p { margin-top: .8rem; line-height: 1.5; }
.archive-item-name { font-weight: 700; overflow-wrap: anywhere; }
.archive-impact { padding-left: 1.3rem; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.roster-search-clear { margin: .45rem 0 .6rem; }
#roster-search-status, #roster-empty { margin-top: .6rem; font-size: .85rem; }
.meta, .quiet { color: var(--mute); line-height: 1.45; }
.counts { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: .85rem 0 0; }
.counts li, .pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: .1rem .6rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 650;
}
.pill-not_uploaded { background: #ece7dc; color: #3e463f; border-color: transparent; }
.pill-uploaded { background: #e3ebf5; color: #1d3a5c; border-color: transparent; }
.pill-ai_graded { background: #f6e7cb; color: #6a4308; border-color: transparent; }
.pill-approved { background: #e4f3c4; color: var(--ok); border-color: transparent; }
.bar { height: .45rem; margin-top: .35rem; background: #e6e0d2; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #5f8f18; }
.step-0 { width: 0%; }
.step-1 { width: 10%; }
.step-2 { width: 20%; }
.step-3 { width: 30%; }
.step-4 { width: 40%; }
.step-5 { width: 50%; }
.step-6 { width: 60%; }
.step-7 { width: 70%; }
.step-8 { width: 80%; }
.step-9 { width: 90%; }
.step-10 { width: 100%; }
.section-title { margin: 1.5rem 0 .7rem; font-size: 1.35rem; letter-spacing: -.03em; }
.exam-card, .student, .paper, .panel { padding: 1rem 1rem 1.05rem; }
.exam-card p, .paper p, .panel p { margin-top: .4rem; }
.student-head, .paper-top, .row-top {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: flex-start;
}
.student-head a, .text-link { font-weight: 700; }
.paper-row { border-top: 1px solid var(--line); margin-top: .75rem; padding-top: .75rem; }
.paper-row h3 { font-size: 1rem; letter-spacing: -.02em; }
.row-top { align-items: center; }
.score {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.feedback { margin-top: .35rem; line-height: 1.45; overflow-wrap: anywhere; }
.feedback-pair h3 { margin-top: .8rem; font-size: .95rem; }
.ai-tag { margin: .2rem 0 .4rem; color: var(--mute); font-size: .82rem; }
.one-lines { margin: .4rem 0 0; padding-left: 1.1rem; }
.one-lines li, .one-line { overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .35rem .7rem; font: inherit; color: var(--ink); }
.chip.is-on { background: var(--accent); color: #fff; }
.chip.is-empty { opacity: .45; }
.kpi-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.kpi { padding: 1.1rem 1.15rem 1rem; }
.kpi-num { margin: 0; font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 720; letter-spacing: -.04em; line-height: 1; color: var(--ink); }
.kpi-label, .difficulty h2 { margin: .35rem 0 0; color: var(--mute); font-size: .92rem; font-weight: 650; }
.spark { display: block; width: 5.5rem; height: 2rem; margin-top: .7rem; }
.threshold, .gauge-pair { margin: .15rem 0 0; color: var(--mute); font-size: .75rem; }
.review-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: center; padding: 1rem 1.1rem; margin: .8rem 0 1rem; }
.gauge { margin: 0; display: grid; justify-items: center; text-align: center; }
.gauge svg { width: min(100%, 9.5rem); height: auto; }
.stamp { display: inline-flex; align-items: center; gap: .35rem; margin-top: .35rem; padding: .2rem .65rem; border-radius: 999px; font-weight: 750; }
.stamp-pass { background: #dcfce7; color: #14532d; }
.stamp-fail { background: #fee2e2; color: #7f1d1d; }
.stamp-none { background: #f3f4f6; color: #1f2937; }
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: .45rem; margin-top: .7rem; }
.heat { min-width: 0; }
.heat summary { list-style: none; cursor: pointer; padding: .4rem; display: grid; gap: .2rem; }
.heat summary::-webkit-details-marker { display: none; }
.heat-ref, .heat-pct, .heat-level { font-size: .75rem; font-variant-numeric: tabular-nums; }
.heat-level { color: var(--mute); }
.heat-track { display: block; height: .45rem; border-radius: 999px; background: #ece7dc; overflow: hidden; }
.heat-track span { display: block; height: 100%; }
.heat-low .heat-track span { background: #9b2c2c; }
.heat-mid .heat-track span { background: #b86e00; }
.heat-high .heat-track span { background: #1f6b45; }
.heat-none .heat-track span { background: transparent; }
.heat-detail { margin: 0; padding: 0 .45rem .45rem; font-size: .75rem; color: var(--mute); }
.heat-low { box-shadow: inset 3px 0 0 #9b2c2c, 0 8px 24px rgba(17, 24, 39, .06); }
.heat-mid { box-shadow: inset 3px 0 0 #b86e00, 0 8px 24px rgba(17, 24, 39, .06); }
.heat-high { box-shadow: inset 3px 0 0 #1f6b45, 0 8px 24px rgba(17, 24, 39, .06); }
.no-work { margin: 0 0 .8rem; border: 1px solid var(--line); border-radius: .7rem; background: #fff; padding: .55rem .7rem; }
.no-work summary { cursor: pointer; font-weight: 700; }
.no-work ul { margin: .45rem 0 0; padding-left: 1.1rem; display: flex; flex-wrap: wrap; gap: .35rem .8rem; }
.step-row { display: grid; grid-template-columns: 3.4rem minmax(2.4rem, auto) 3.2rem auto; gap: .25rem .45rem; align-items: center; }
.comment.step-row { background: transparent; color: inherit; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; padding: .55rem 0; }
.step-num, .step-code, .step-score { font-variant-numeric: tabular-nums; font-weight: 700; }
.step-comment { grid-column: 1 / -1; margin: 0; }
.step-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.step-actions .btn { margin: 0; min-height: 2.2rem; padding: .3rem .7rem; }
.step-edit textarea { min-height: 4.5rem; }
.badge { justify-self: start; border-radius: 999px; padding: .12rem .5rem; font-size: .75rem; font-weight: 700; }
.badge.pending { background: #f3e6c4; }
.badge.ok { background: #d9f0df; }
.badge.edited { background: #d9e4f5; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1rem; align-items: start; min-width: 0; }
.roster { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: .8rem; }
.roster-list { list-style: none; margin: .6rem 0 0; padding: 0; max-height: 70vh; overflow: auto; }
.roster-link { display: block; padding: .7rem .55rem; border-radius: .6rem; text-decoration: none; }
.roster-link.is-on { background: #e7f3c8; }
.roster-link > span { display: block; }
.roster-link .meta { display: block; margin-top: .45rem; white-space: nowrap; line-height: 1.45; font-size: .82rem; }
.roster-link .meta-keep { display: inline; white-space: nowrap; }
.stat-grid { gap: .7rem; }
.stat { margin-top: .3rem; font-size: clamp(1.6rem, 6vw, 2rem); letter-spacing: -.04em; font-weight: 650; }
.table-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.questions { width: 100%; min-width: 0; border-collapse: collapse; margin-top: .6rem; font-size: .92rem; }
.exam-glance { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; margin-top: .8rem; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem .7rem; list-style: none; padding: 0; margin: .8rem 0 .4rem; font-size: .78rem; color: var(--mute); }
.legend li { display: inline-flex; align-items: center; gap: .3rem; }
.swatch { width: .7rem; height: .7rem; border-radius: .2rem; display: inline-block; }
.swatch-full { background: #15803d; }
.swatch-partial { background: #b45309; }
.swatch-none { background: #b42318; }
.swatch-blank { background: #6b7280; }
.swatch-review { background: #4338ca; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.2rem, 1fr)); gap: .5rem; }
.qtile { border: 1px solid var(--line); border-radius: .8rem; background: #fff; min-width: 0; box-shadow: 0 6px 16px rgba(17, 24, 39, .05); }
.qtile summary { list-style: none; cursor: pointer; padding: .55rem .6rem; display: grid; gap: .2rem; }
.qtile summary::-webkit-details-marker { display: none; }
.qtile-ref, .qtile-state { font-weight: 750; }
.qtile-review .qtile-state { color: #312e81; }
.qtile-score, .dot, .agree { font-size: .75rem; }
.qtile-dots { display: flex; flex-wrap: wrap; gap: .2rem; }
.dot { border: 1px solid var(--line); border-radius: 999px; padding: .05rem .35rem; }
.qtile p { margin: 0; padding: 0 .6rem .6rem; font-size: .82rem; }
.info-tip { width: 1.4rem; height: 1.4rem; margin-left: .35rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--mute); font: inherit; font-size: .75rem; font-weight: 750; cursor: help; }
.qtile-rule { display: block; color: #7c2d12; font-size: .75rem; line-height: 1.35; }
.rule-actions { display: flex; gap: .35rem; padding: 0 .6rem .6rem; }
.rule-actions button {
  min-height: 2.25rem;
  border: 0;
  border-radius: 999px;
  padding: .2rem .7rem;
  background: #111827;
  color: #fff;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}
.qtile-full { box-shadow: inset 3px 0 0 #15803d, 0 6px 16px rgba(17, 24, 39, .05); }
.qtile-partial { box-shadow: inset 3px 0 0 #b45309, 0 6px 16px rgba(17, 24, 39, .05); }
.qtile-none { box-shadow: inset 3px 0 0 #b42318, 0 6px 16px rgba(17, 24, 39, .05); }
.qtile-blank { box-shadow: inset 3px 0 0 #6b7280, 0 6px 16px rgba(17, 24, 39, .05); }
.qtile-review { box-shadow: inset 3px 0 0 #4338ca, 0 6px 16px rgba(17, 24, 39, .05); }
.agree-suggestion { color: var(--mute); }
.agree-kept { color: #14532d; }
.agree-agree { color: #14532d; }
.agree-changed { color: #7c2d12; }
.exam-link { margin: .35rem 0 .9rem; }
.sheet-card { border: 1px solid var(--line); border-radius: .8rem; padding: .7rem; margin-top: .5rem; background: #fff; }
.sheet-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; overflow-wrap: anywhere; }
.scheme-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem; margin-top: .55rem; }
.scheme-row input { width: 100%; min-width: 0; }
.roster-card { border: 1px solid var(--line); border-radius: .7rem; padding: .7rem .8rem; margin: .5rem 0; background: #fff; overflow-wrap: anywhere; }
.roster-card.is-bad { border-color: #a33b32; background: #fff6f4; }
.roster-card ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.roster-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.student-edit { list-style: none; padding: 0; margin: 0 0 .6rem; }
.student-edit li { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.exam-block { margin: 0 0 .35rem; }
.sheet-upload { width: 100%; margin: .15rem 0 1rem; }
.sheet-upload[hidden] { display: none; }
.sheet-upload.panel { margin-top: .35rem; }
.sheet-grade { display: flex; align-items: center; gap: .75rem; margin: .7rem 0; min-width: 0; }
.sheet-grade .work-brand { margin: 0; flex: 0 0 auto; }
.sheet-grade .grade-progress-track { flex: 1 1 auto; min-width: 3.5rem; height: .7rem; border-radius: 999px; background: #e4e0d4; overflow: hidden; }
.sheet-grade .grade-progress-track > span { display: block; height: 100%; background: #6b9a12; }
.sheet-grade .grade-progress-label { margin: 0; flex: 0 0 auto; font-weight: 650; white-space: nowrap; }
.sheet-summary { margin: .6rem 0; font-weight: 650; }
#student-tools { margin-top: 2.75rem; }
@media (max-width: 560px) {
  .exam-block .student-edit li { flex-wrap: wrap; align-items: center; row-gap: .45rem; }
  .exam-block [data-more-sheets] { flex: 1 1 100%; }
  .sheet-upload .btn { max-width: 100%; }
  .roster-link .meta { white-space: normal; }
  .roster-link .meta-keep { white-space: nowrap; }
  #student-tools { margin-top: 1.75rem; }
}
.id-mask { color: var(--mute); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.scheme-row.student-row { display: flex; flex-direction: column; align-items: stretch; gap: .2rem; padding: .15rem 0; border-bottom: 1px solid var(--line); }
.student-list-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; margin: .2rem 0 .45rem; }
.student-search { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 16rem; font-size: .82rem; font-weight: 700; }
.student-search input { font: inherit; font-weight: 450; border: 1px solid #8a8476; border-radius: .55rem; padding: .3rem .55rem; min-height: 2rem; background: #fff; color: var(--ink); }
.student-page-nav { display: flex; gap: .35rem; align-items: center; }
.list-expand-row { margin: .35rem 0 .15rem; }
.list-expand-row .btn { min-height: 0; padding: .25rem .7rem; font-size: .85rem; }
.list-expand-row[hidden], .student-page-nav[hidden], #student-page-status[hidden],
#class-results tr[hidden], .student-row[hidden] { display: none !important; }
#student-page-status { margin: 0; }
.student-row .student-main { display: flex; flex-wrap: nowrap; align-items: center; gap: .4rem; min-width: 0; min-height: 1.8rem; }
.student-row .student-read { display: flex; align-items: baseline; gap: .75rem; flex: 1 1 auto; min-width: 0; font-size: .9rem; }
.student-row .student-name { flex: 1 1 12rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-row .student-year { flex: 0 0 auto; color: var(--mute); }
.student-row .student-fields { display: none; flex: 1 1 auto; align-items: center; gap: .4rem; min-width: 0; }
.student-row.is-editing .student-read { display: none; }
.student-row.is-editing .student-fields { display: flex; }
.student-row .student-main input[name="name"] { flex: 1 1 12rem; min-width: 12rem; width: auto; }
.student-row .student-main input[name="gradeYear"] { flex: 0 1 8rem; min-width: 6rem; width: auto; }
.student-row .student-main input[name="name"],
.student-row .student-main input[name="gradeYear"],
.student-row .student-main input.id-full { border: 1px solid #8a8476; border-radius: .55rem; padding: .35rem .55rem; background: #fff; color: var(--ink); font: inherit; }
.student-row .id-mask, .student-row .id-full { flex: 0 0 auto; min-width: 6.5rem; width: auto; white-space: nowrap; }
.student-row .student-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: .35rem; flex: 0 0 auto; margin-left: auto; position: relative; }
.student-row .student-menu { display: none; align-items: center; gap: .35rem; }
.student-row:hover .student-menu,
.student-row:focus-within .student-menu,
.student-row.is-menu-open .student-menu { display: flex; }
.student-row .student-edit-actions { display: none; align-items: center; gap: .35rem; }
.student-row.is-editing .student-more,
.student-row.is-editing .student-menu { display: none; }
.student-row.is-editing .student-edit-actions { display: flex; }
.student-row .student-actions .btn { flex: 0 0 auto; width: auto; min-height: 0; padding: .2rem .55rem; font-size: .85rem; white-space: nowrap; }
.student-page-nav .btn { flex: 0 0 auto; width: auto; min-height: 0; padding: .2rem .55rem; font-size: .85rem; white-space: nowrap; }
.student-row .student-consent:not([hidden]) { display: flex; align-items: flex-start; gap: .4rem; margin: .35rem 0 0; font-size: .8rem; line-height: 1.35; }
.bulk-consent { display: flex; align-items: flex-start; gap: .4rem; margin: .7rem 0 0; font-size: .8rem; line-height: 1.35; }
.student-row .student-consent input,
.bulk-consent input { flex: 0 0 auto; width: 1rem; min-width: 1rem; height: 1rem; margin: .15rem 0 0; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table caption { caption-side: top; text-align: left; font-weight: 700; padding: .35rem 0; }
.results-table th, .results-table td { text-align: left; padding: .18rem .45rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .85rem; }
.results-table th { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.result-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: .02rem .45rem; font-size: .75rem; line-height: 1.3; background: #f6f4ee; white-space: nowrap; }
.student-row .save-status { margin: 0; }
.student-row .save-status:empty { display: none; }
@media (max-width: 720px) {
  .student-row .student-main, .student-row .student-actions { flex-wrap: nowrap; }
}
@media (min-width: 720px) {
  .scheme-row { grid-template-columns: 5rem 4.2rem 4.2rem minmax(0, 1fr); }
  .scheme-row.student-row { display: flex; flex-direction: column; }
  .student-row .student-actions .btn, .student-row .id-mask { width: auto; margin: 0; }
}
@media (max-width: 420px) {
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper, .exam-visual, .panel { padding: .75rem; }
}
.questions th, .questions td { text-align: left; padding: .4rem .35rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.questions th { min-width: 5.5rem; white-space: nowrap; overflow-wrap: normal; word-break: keep-all; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
.grade-progress { margin: .6rem 0; }
.grade-progress-track { height: .45rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.grade-progress-track > span { display: block; height: 100%; width: 0; background: var(--accent); }
.grade-progress.is-error .grade-progress-track > span { background: #9f1239; }
.roster select, .field select { width: 100%; min-height: 2.75rem; font: inherit; font-size: 1rem; border: 1px solid #8a8476; border-radius: .55rem; background: #fff; color: var(--ink); padding: .4rem .6rem; }
.proposal, .review, .dropzone { margin-top: 1rem; }
.proposal, .review {
  background: #fbfaf4;
  border-radius: .8rem;
  padding: .85rem .9rem;
}
.proposal h3, .review h3, .dropzone h3 {
  font-size: .95rem;
  letter-spacing: -.02em;
}
.dropzone {
  border: 1.5px dashed #8d927c;
  border-radius: .9rem;
  padding: .95rem;
  background: #fbfaf4;
}
.dropzone.is-hot { border-color: #3d6b12; background: #f3f8e4; }
.file-btn {
  position: relative;
  margin-top: .75rem;
  background: var(--ink);
  color: var(--ivory);
}
.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.field { display: flex; flex-direction: column; gap: .35rem; margin-top: .8rem; }
.field span { font-weight: 700; font-size: .92rem; }
input[type="number"], input[type="search"], textarea {
  width: 100%;
  font-size: 1rem;
  border: 1px solid #8a8476;
  border-radius: .55rem;
  padding: .7rem .75rem;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 7.5rem; resize: vertical; line-height: 1.45; }
.review .btn { margin-top: 1rem; }
.sample-panel { margin-top: 1.4rem; min-width: 0; max-width: 100%; }
.sample-sheets { display: grid; gap: .8rem; margin-top: .8rem; align-items: stretch; }
.sample-sheets figure { margin: 0; min-width: 0; max-width: 100%; display: flex; flex-direction: column; }
.sample-sheets img { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 1500 / 1380; object-fit: contain; object-position: center; background: #fff; border-radius: .5rem; }
.sample-sheets figcaption { margin-top: .35rem; color: var(--mute); font-size: .85rem; }
.mark-steps { margin: .7rem 0 0; padding-left: 1.2rem; }
.mark-steps li { margin-top: .45rem; }
.sample-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.sample-actions .btn { margin-top: 0; }
@media (min-width: 960px) {
  .sample-sheets { grid-template-columns: 1fr 1fr; }
}
.model-text {
  margin-top: .7rem;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .86rem;
  line-height: 1.45;
  background: #fff;
  border-radius: .7rem;
  padding: .8rem;
  border: 1px solid var(--line);
}
.stack { display: flex; flex-direction: column; gap: .85rem; min-width: 0; }
.roster-list { display: block; }
.roster-jump { display: flex; }
.detail, .overview, .review-page, .panel, .paper, .class-card, .exam-card { min-width: 0; max-width: 100%; }
@media (min-width: 720px) {
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review-head { grid-template-columns: auto minmax(0, 1fr); }
}
@media (min-width: 960px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .class-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
  .exam-strip, .sample-sheets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: minmax(20rem, 24rem) minmax(0, 1fr); }
  .roster-list { display: block; }
  .roster-jump { display: none; }
}
@media (max-width: 560px) {
  .top-inner { align-items: flex-start; padding-block: .7rem; }
  .student-head, .paper-top, .row-top { flex-direction: column; align-items: stretch; }
  #app { width: min(100% - 1rem, 72rem); }
  .top-inner { width: min(100% - 1rem, 72rem); }
}
@media (hover: hover) {
  .class-card:hover { border-color: #8ea56a; }
  .btn:hover, .file-btn:hover { background: #26332d; }
  .file-btn-camera:hover { color: var(--ivory); }
  .btn-lime:hover { background: #c9ff83; color: #14210c; }
  .account-logout:hover { border-color: var(--lime); color: var(--lime); background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
.review-stage { position: relative; min-width: 0; max-width: 100%; }
.review-grid { gap: 1rem; align-items: start; min-width: 0; }
.script-col, .comments-col { min-width: 0; max-width: 100%; }
.review-column-title { margin: 0 0 .75rem; font-size: 1rem; font-weight: 700; }
.review-mark-summary { margin: .75rem 0; padding: .6rem 0; border-block: 1px solid var(--line); }
.review-mark-summary summary { cursor: pointer; font-weight: 650; }
.review-mark-summary .table-scroll { margin-top: .75rem; }
.comments-col > .review { margin-top: 1rem; }
.review-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.review-actions .btn { flex: 1 1 12rem; min-width: 0; margin-top: 0; white-space: nowrap; }
.review-done { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem .75rem; }
.review-done-check { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 999px; background: var(--ok); color: #fff; font-weight: 750; }
.review-done a.btn { margin-left: auto; background: var(--ink); color: var(--ivory); }
.has-image-error .scan { display: none; }
.scan-error { padding: 1.25rem; min-height: 12rem; background: var(--card); color: var(--ink); }
.scan-error[hidden] { display: none; }
.scan-error p { margin: 0 0 .75rem; }
.sheet { margin: 0 0 1rem; max-width: 100%; background: #10151a; overflow: hidden; }
.scan { position: relative; max-width: 100%; }
.sheet img { display: block; width: 100%; max-width: 100%; height: auto; }
.sheet figcaption { padding: .4rem .6rem; color: var(--muted, #9aa); }
.scan .hotspot { position: absolute; inset: 0; width: 100%; height: 100%; }
.mark-box { visibility: hidden; }
.mark-box.is-on { visibility: visible; }
.mark-box rect { fill: rgba(214, 255, 74, .28); stroke: #14210c; stroke-width: .8; }
.mark-box.is-hot rect { stroke: #fff; stroke-width: 1.4; }
.mark-box text { fill: #14210c; font-size: 3.4px; font-weight: 700; }
.code { color: #e7f0e4; }
.comment { border: 1px solid #2a3330; border-radius: 12px; padding: .8rem; margin-bottom: .8rem; background: #12181c; color: #e7f0e4; }
.comment .meta, .reason { color: #d5e0d8; overflow-wrap: anywhere; }
.review-page > .slip { color: #6a4308; }
.comment.is-active { border-color: #d6ff4a; }
.comment header, .row-actions { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-actions { justify-content: flex-start; }
.comment h3 { margin: 0; }
.codes { display: flex; flex-wrap: wrap; gap: .35rem; }
.code { border: 1px solid #3a4a40; border-radius: 999px; padding: .1rem .45rem; font-size: .85rem; }
.code.got { border-color: #8ea56a; }
.slip { color: #e6d39a; }
.point-edit { display: flex; flex-wrap: wrap; gap: .6rem; }
.connectors { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; pointer-events: none; overflow: hidden; }
.connectors .link { fill: none; stroke: #d6ff4a; stroke-width: 1.5; }
.connectors .link.is-active { stroke-width: 2.5; }
@media (min-width: 960px) {
  .review-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .script-col, .comments-col { max-height: calc(100vh - 11rem); overflow: auto; }
}
.class-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 1rem; }
.class-tab { display: inline-flex; align-items: center; min-height: 2.4rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 650; }
.class-tab.is-on { background: var(--ink); color: var(--ivory); }
.analysis-block { margin-top: .9rem; }
.analysis-topic, .analysis-error, .analysis-exercise { margin: .45rem 0; overflow-wrap: anywhere; }
.analysis-topic-row { display: flex; gap: .7rem; align-items: flex-start; margin: 1.15rem 0; overflow-wrap: anywhere; }
.analysis-topic-row h3, .analysis-exercise h3 { margin-bottom: .25rem; }
.analysis-dot { width: .6rem; height: .6rem; margin-top: .4rem; border-radius: 50%; flex: none; }
.analysis-dot.is-high { background: #b42318; }
.analysis-dot.is-mid { background: #c2410c; }
.analysis-dot.is-low { background: #3f7d1a; }
.analysis-fail { width: 2.8rem; height: .4rem; margin: .4rem 0 .45rem; background: #e6e0d2; border-radius: 99px; overflow: hidden; }
.analysis-fail > span { display: block; height: 100%; }
.analysis-fail.is-high > span { background: #b42318; }
.analysis-fail.is-mid > span { background: #c2410c; }
.analysis-fail.is-low > span { background: #3f7d1a; }
.analysis-exercise { margin-top: 1.1rem; }
.analysis-exercise ol { margin: .35rem 0 0; padding-left: 1.25rem; }
.analysis-exercise li { margin: .75rem 0; }
.analysis-question { margin: 0; }
.analysis-solution { margin: .4rem 0 0; padding: .45rem .65rem; background: var(--paper); border-radius: .45rem; }
.analysis-solution-label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--mute); }
.analysis-solutions-toggle { margin: .55rem 0 .2rem; }
.analysis-solutions-toggle .btn { margin: 0; }
.analysis-print-solutions { display: none; }
.solutions-hidden .analysis-solution { display: none; }
.analysis-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 1rem; }
.analysis-actions .btn { margin: 0; flex: 1 1 11rem; text-align: center; }
.analysis-sheet, .analysis-block, .analysis-topic-row, .analysis-topic, .analysis-error, .analysis-exercise, .analysis-group, .analysis-question, .analysis-solution {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.analysis-group { margin: 0 0 .9rem; padding: .85rem; border: 1px solid var(--line); border-radius: .8rem; background: #fff; }
.analysis-group header { display: flex; flex-wrap: wrap; gap: .35rem .75rem; align-items: center; }
.analysis-group header h3, .analysis-group header p { margin: 0; }
.analysis-group .btn { margin: .55rem 0 0; }
.analysis-names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin: .7rem 0 0; padding: 0; list-style: none; }
.analysis-names li { min-width: 0; overflow-wrap: anywhere; padding: .4rem .55rem; border-radius: .45rem; background: var(--paper); }
.analysis-exercise { margin: 0 0 .9rem; padding: .85rem; border: 1px solid var(--line); border-radius: .8rem; }
.analysis-exercise .btn { margin: .35rem 0 0; }
@media (min-width: 800px) {
  .analysis-names { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .analysis-actions .btn { flex-basis: 100%; }
}
.sheet-file-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .45rem .5rem; }
.sheet-file-row > .field { flex: 1 1 12rem; min-width: 0; margin-top: .8rem; }
.sheet-file-row input[type="file"] { width: 100%; max-width: 100%; min-width: 0; font-size: .85rem; }
.sheet-scan { flex: 0 0 auto; margin: 0; min-height: 2.75rem; min-width: 6.25rem; }
.sheet-scan-status { flex: 1 1 100%; margin: .15rem 0 0; }
.sheet-scan-status:empty { display: none; }
html.is-scanning, html.is-scanning body { overflow: hidden; }
.sheet-scanner {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .65rem .7rem calc(.55rem + env(safe-area-inset-bottom));
  background: #0e1317;
  color: #f8f7fc;
}
.sheet-scanner-top { display: flex; align-items: center; gap: .6rem; }
.sheet-scanner-top h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1.05rem; letter-spacing: -.02em; }
.sheet-scanner-top .btn { flex: 0 0 auto; margin: 0; min-height: 2.75rem; background: transparent; color: #f8f7fc; border-color: #6d776f; }
.sheet-scanner-hint { margin: 0; color: #d5d8e0; font-size: .9rem; line-height: 1.35; }
.sheet-scanner-stage { position: relative; flex: 1 1 auto; min-height: 12rem; border-radius: .7rem; overflow: hidden; background: #000; touch-action: none; }
.sheet-scanner-stage video, .sheet-scanner-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet-scanner-stage video { object-fit: contain; background: #000; }
.sheet-scanner.is-adjusting video { display: none; }
.sheet-scan-fallback { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.sheet-scanner-pages { display: flex; gap: .4rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; }
.sheet-scanner-pages:empty { display: none; }
.sheet-scanner-pages button { width: 3.25rem; height: 3.25rem; min-height: 3.25rem; padding: 0; border: 2px solid transparent; border-radius: .45rem; background: #000; }
.sheet-scanner-pages img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: .3rem; }
.sheet-scanner-pages .is-selected { border-color: #b9f368; }
.sheet-scanner-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: center; }
.sheet-scanner-actions .btn { flex: 1 1 8rem; margin: 0; min-height: 2.75rem; order: 1; background: #f8f7fc; color: #111827; }
.sheet-scanner-actions .is-primary { order: 2; flex-basis: 100%; min-height: 3.25rem; }
.sheet-scanner .btn-lime { background: var(--lime); color: #14210c; }
@media (max-width: 420px) {
  .sheet-scan { flex: 1 1 auto; }
  .sheet-scanner { padding-inline: .55rem; }
  .sheet-scanner-top h2 { font-size: 1rem; }
}
@media print {
  .sheet-scanner { display: none !important; }
  .top, .class-tabs, .analysis-actions, .back, .analysis-solutions-toggle, [data-group-toggle], [data-solution-toggle] { display: none; }
  .analysis-solution { display: none; }
  .analysis-print-solutions { display: block; }
  .analysis-print-solutions .analysis-solution { display: block; background: transparent; padding: 0; }
}
.getting-started { min-width: 0; max-width: 100%; }
.getting-started ol { margin: .4rem 0 0; padding-left: 1.2rem; }
.getting-started li { overflow-wrap: anywhere; }
.getting-started li[data-done="true"] { text-decoration: line-through; }
.tour-target { outline: 2px solid #1f2937; outline-offset: 3px; border-radius: .45rem; }
html.tour-open #app { padding-bottom: var(--tour-card, 0px); }
.tour { position: fixed; z-index: 30; width: min(22rem, calc(100vw - 1.5rem)); max-width: calc(100vw - 1rem); padding: .9rem 1rem; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 12px 40px rgba(17, 24, 39, .16); overflow-wrap: anywhere; }
.tour.is-centered { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.tour-actions .btn { min-width: 0; }
.tour-skip { margin-left: auto; }
@media (max-width: 720px) {
  .tour, .tour.is-centered, .tour.is-sheet { top: auto; left: .75rem; right: .75rem; bottom: .75rem; width: auto; max-height: 42vh; overflow: auto; transform: none; }
  .tour-skip { display: inline-flex; }
}
@media (max-width: 390px) {
  .tour, .tour.is-centered, .tour.is-sheet { left: .5rem; right: .5rem; bottom: .5rem; padding: .7rem .75rem; max-height: 46vh; }
  .tour-actions .btn { flex: 1 1 5.5rem; }
  .tour-skip { margin-left: 0; }
  .gate, .auth-panel { padding: 1rem .8rem 1.1rem; }
  .gate .btn, .auth-panel .btn, .profile-password .btn, #password-dialog .btn { width: 100%; }
  .verify-banner { flex-direction: column; align-items: stretch; }
  .profile-password { padding-inline: .8rem; }
  .account-menu { width: calc(100vw - 1rem); }
  #password-dialog { width: min(100% - 1rem, 24rem); }
  #password-dialog .dialog-actions { flex-direction: column; align-items: stretch; }
}
.profile-plan { margin: .8rem 0 0; }
.profile-plan .text-link { font-size: .95rem; }
.landing { display: grid; gap: 1.75rem; min-width: 0; }
.landing .gate { margin-inline: auto; width: 100%; }
.plans-page { display: grid; gap: 1rem; min-width: 0; max-width: 100%; }
.plans-heading { min-width: 0; }
.plans-title { margin-top: .35rem; font-size: clamp(1.85rem, 4.2vw, 2.7rem); line-height: 1.05; letter-spacing: -.045em; font-weight: 560; text-wrap: balance; }
.plans-back { margin: 0 0 .15rem; }
.plans-pilot { background: #edf4e4; border-color: #dce6d0; padding: 1rem 1.15rem; }
.plans-pilot p { margin: 0; line-height: 1.5; }
.plans-current { display: grid; gap: .75rem; padding: 1.15rem 1.2rem; }
.plans-current-top { display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem 1rem; flex-wrap: wrap; }
.plans-current h2 { font-size: clamp(1.6rem, 3vw, 2rem); letter-spacing: -.04em; line-height: 1.05; }
.plan-usage-label { font-weight: 650; }
.plans-usage { height: .6rem; border-radius: 999px; background: #e7e9f2; overflow: hidden; }
.plans-usage > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--lime); }
.plans-grid { display: grid; gap: .8rem; grid-template-columns: minmax(0, 1fr); }
.plan-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-width: 0;
  height: 100%;
  padding: 1.1rem 1.05rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .06);
}
.plan-card.is-popular { border-color: #c3d7a4; box-shadow: inset 0 3px 0 #b9f368, 0 12px 28px rgba(63, 106, 20, .08); }
.plan-card.is-current { border-color: var(--ink); }
.plan-flag { margin: 0; min-height: 0; }
.plan-flag:not(:has(.plan-badge)) { display: none; }
.plan-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: .28rem .7rem;
  border-radius: 999px;
  background: var(--lime);
  color: #14210c;
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.2;
}
.plan-badge-current { background: #edf7db; color: #365615; }
.plan-card h3 { margin: 0; font-size: 1.25rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.2; text-wrap: balance; }
.plan-price { margin: .1rem 0 0; font-size: clamp(1.85rem, 3vw, 2.2rem); font-weight: 650; letter-spacing: -.05em; line-height: 1.05; }
.plan-price.is-quote { font-size: clamp(1.45rem, 2.5vw, 1.7rem); letter-spacing: -.03em; }
.plan-cadence { margin: .15rem 0 .2rem; color: var(--mute); font-size: .92rem; line-height: 1.35; }
.plan-features { list-style: none; margin: .2rem 0 .35rem; padding: 0; display: grid; gap: .5rem; flex: 1; }
.plan-features li { display: grid; grid-template-columns: 1rem minmax(0, 1fr); column-gap: .45rem; align-items: start; line-height: 1.35; }
.plan-features li::before { content: ""; width: .45rem; height: .45rem; margin-top: .4rem; border-radius: 999px; background: #3f6a14; box-shadow: 0 0 0 3px #e7f5c8; }
.plan-card .btn { width: 100%; margin-top: auto; text-align: center; white-space: normal; }
.plan-start {
  margin: auto 0 0;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #374151;
  background: transparent;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.25;
}
.plans-soon-note { margin: 0; max-width: 42rem; }
.btn.plan-soon:disabled { opacity: 1; cursor: not-allowed; background: transparent; color: #374151; border-color: var(--line); }
.btn.plan-current-btn:disabled { opacity: 1; cursor: default; background: #edf7db; color: #365615; border-color: #dce6d0; }
@media (min-width: 720px) {
  .plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-cadence { min-height: 2.8rem; }
}
@media (min-width: 1100px) {
  .plans-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plan-flag, .plan-flag:not(:has(.plan-badge)) { display: flex; align-items: center; min-height: 1.85rem; }
}
@media (hover: hover) {
  .btn.plan-soon:disabled:hover { background: transparent; color: #374151; }
  .btn.plan-current-btn:disabled:hover { background: #edf7db; color: #365615; }
  .profile-shortcuts .btn-secondary:hover, .profile-session .btn.btn-secondary:hover { background: #f4f7f1; color: var(--ink); border-color: #b7c3aa; }
}
.photo-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.photo-actions .file-btn { margin-top: 0; }
.file-btn-camera { background: transparent; color: var(--ink); border-color: #8d927c; }
.sheet-file-row .sheet-camera { flex: 0 1 auto; margin: 0; min-height: 2.75rem; min-width: 8.75rem; }
#install-dialog { width: min(100% - 2rem, 24rem); }
#install-dialog .dialog-actions .btn { min-height: 2.75rem; }
@media (display-mode: standalone) {
  [data-install-action] { display: none !important; }
}
@media (max-width: 420px) {
  .photo-actions { align-items: stretch; }
  .photo-actions .file-btn { flex: 1 1 100%; }
  .sheet-file-row .sheet-camera { flex: 1 1 calc(50% - .35rem); min-width: 0; }
  #install-dialog .dialog-actions { flex-direction: column; align-items: stretch; }
  #install-dialog .dialog-actions .btn { width: 100%; }
}
@media (max-width: 420px) {
  .plan-card { padding: 1rem .9rem 1.05rem; }
  .plans-current, .plans-pilot { padding: .95rem .9rem; }
  .workspace-nav { padding: .45rem .45rem; }
  .top-actions { gap: .35rem; }
  .account-cluster { gap: .35rem; }
  .profile-session { justify-content: stretch; }
  .profile-session .btn { width: 100%; min-width: 0; }
  #logout-dialog .dialog-actions { flex-direction: column; align-items: stretch; }
  #logout-dialog .dialog-actions .btn { width: 100%; }
}
#logout-dialog .save-status:empty { display: none; min-height: 0; margin: 0; }
