:root { font-family:var(--font); color:var(--ink); background:var(--bg); font-size:16px; }
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
a {
  color: var(--navy);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #267EBA;
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 2.25rem;
  letter-spacing: -1.3px;
  margin-bottom: 12px;
  line-height: 1.15;
}
h2 {
  font-size: 1.35rem;
  letter-spacing: -.45px;
}
h3 {
  font-size: 1.05rem;
}
p {
  line-height: 1.55;
}
small,
.small {
  font-size: .875rem;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 18px;
}
.gap8 {
  gap: 8px;
}
.mb0 {
  margin-bottom: 0;
}
.mt24 {
  margin-top: 24px;
}
.btn {
  border: 1px solid transparent;
  padding: 13px 20px;
  border-radius: 10px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
  background: var(--navy);
  color: #fff;
  transition: background .15s, transform .15s;
}
.btn:hover {
  background: #2d4c7f;
}
.btn.yellow {
  background: var(--yellow);
  color: #182E51;
}
.btn.yellow:hover {
  background: #FFD254;
}
.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn.secondary:hover {
  background: var(--soft);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
}
.btn.danger {
  background: #B73744;
  color: #fff;
}
.btn.sm {
  font-size: .875rem;
  min-height: 40px;
  padding: 9px 14px;
}
.btn.full {
  width: 100%;
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 5px 0;
  font-weight: 700;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
}
.ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1224px;
  min-height: 88px;
  margin: auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brandmark {
  display: grid;
  place-items: center;
  background: var(--navy);
  color: var(--yellow);
  border-radius: 12px;
  width: 45px;
  height: 45px;
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
}
.brandname {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -.5px;
}
.school {
  font-size: .75rem;
  letter-spacing: .8px;
  margin-top: 4px;
  color: var(--muted);
}
.nav {
  display: flex;
  gap: 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 9px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}
.nav a:hover {
  background: var(--soft);
}
.nav a.active {
  background: var(--soft);
  color: var(--navy);
}
.topright {
  display: flex;
  align-items: center;
  gap: 10px;
}
.classchip {
  border-left: 1px solid var(--line);
  padding-left: 18px;
  font-size: .875rem;
  font-weight: 700;
}
.demo-strip {
  background: #E9EFF8;
  border-bottom: 1px solid #D9E2F0;
  color: #304D72;
}
.demo-strip > div {
  max-width: 1224px;
  margin: auto;
  padding: 9px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .8rem;
}
.demo-strip .text-btn {
  font-size: .8rem;
}
.demo-pill {
  font-weight: 700;
  background: #D5E1F3;
  border-radius: 5px;
  padding: 4px 7px;
  white-space: nowrap;
  font-size: .72rem;
  letter-spacing: .4px;
}
.main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 38px 0 46px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
}
.page-heading h1 {
  margin-bottom: 10px;
}
.date-label {
  font-size: .875rem;
  color: var(--muted);
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr);
  gap: 24px;
}
.home-main {
  display: grid;
  gap: 24px;
}
.weekly-card {
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  position: relative;
  overflow: hidden;
  padding: 30px;
}
.weekly-card:after {
  content: "";
  position: absolute;
  right: -38px;
  top: -70px;
  width: 310px;
  height: 310px;
  border: 1px solid #ffffff19;
  border-radius: 50%;
  pointer-events: none;
}
.weekly-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.week-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  color: #E2E9F3;
}
.status-tag {
  padding: 6px 10px;
  border: 1px solid #ffffff40;
  border-radius: 6px;
  color: #F4F7FB;
  font-size: .8rem;
}
.weekly-card h2 {
  font-size: 2.05rem;
  letter-spacing: -1px;
  margin: 26px 0 10px;
  line-height: 1.12;
  max-width: 400px;
}
.weekly-card p {
  color: #D1DCEF;
  max-width: 400px;
  font-size: .95rem;
}
.weekly-bottom {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.progress-wrap {
  flex: 1;
  max-width: 240px;
}
.progress-label {
  font-size: .8rem;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #D9E3F3;
}
.progress-track {
  background: #ffffff25;
  height: 6px;
  border-radius: 20px;
  overflow: hidden;
}
.progress-track > span {
  display: block;
  height: 100%;
  background: var(--yellow);
  border-radius: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.card-title h2,
.card-title h3 {
  margin: 0;
}
.card-title .text-btn {
  font-size: .8rem;
}
.due-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.due-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.due-list li:last-child {
  border: 0;
  padding-bottom: 0;
}
.topic-symbol {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex: none;
}
.due-name {
  flex: 1;
}
.mini-label {
  font-size: .75rem;
  color: var(--muted);
}
.score-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.score-item {
  padding: 16px;
  background: var(--bg);
  border-radius: 10px;
}
.score-item .score {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 14px 0 12px;
}
.score-item .score small {
  font-weight: 400;
  color: var(--muted);
  font-size: 1rem;
}
.score-track {
  height: 4px;
  background: var(--line);
  border-radius: 8px;
}
.score-track span {
  height: 100%;
  display: block;
  background: var(--teal);
  border-radius: 8px;
}
.check-line {
  font-size: .75rem;
  color: var(--success);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.check-line .ico {
  width: 13px;
  height: 13px;
}
.backup {
  background: #F0F5FA;
}
.backup p {
  font-size: .875rem;
  margin-bottom: 16px;
}
.backup .ico {
  color: var(--navy);
}
.backup h3 {
  margin-bottom: 8px;
}
.footer {
  max-width: 1160px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: .75rem;
}
.footer a {
  color: var(--muted);
}
.callout {
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--soft);
  font-size: .9rem;
  line-height: 1.5;
}
.callout.warn {
  background: #FFF4D4;
  color: #654A07;
  border: 1px solid #EEDB9F;
}
.callout.good {
  background: #E9F6F1;
  color: #14654E;
}
.callout.error {
  background: #FCECEE;
  color: #932D3A;
}
.section-note {
  margin-top: 18px;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5;
}
.pill {
  background: var(--soft);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: .75rem;
  white-space: nowrap;
  color: var(--muted);
}
.pill.ready {
  color: #14654E;
  background: #E8F4EF;
}
.question-shell {
  max-width: 820px;
  margin: auto;
}
.question-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.question-dots {
  display: flex;
  gap: 7px;
  align-items: center;
}
.qdot {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: .75rem;
}
.qdot.current {
  background: var(--navy);
  color: #fff;
}
.qdot.correct {
  background: #D0ECE1;
  color: #14654E;
}
.qdot.wrong {
  background: #F3DADD;
  color: #932D3A;
}
.question-card {
  padding: 32px;
}
.qmeta {
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 23px;
}
.stem {
  font-size: 1.35rem;
  line-height: 1.75;
  letter-spacing: -.25px;
  margin: 0 0 28px;
  overflow-wrap: break-word;
}
.stem .katex {
  font-size: 1.12em;
}
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.option {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 11px;
  min-height: 75px;
  padding: 15px;
  display: flex;
  gap: 15px;
  align-items: center;
  text-align: left;
  color: var(--ink);
}
.option:hover:not(:disabled) {
  border-color: #899CBA;
  background: var(--bg);
}
.option.selected {
  border-color: var(--navy);
  background: var(--soft);
  box-shadow: 0 0 0 1px var(--navy);
}
.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--soft);
  font-weight: 700;
  font-size: .9rem;
  flex: none;
}
.option.selected .option-letter {
  background: var(--navy);
  color: #fff;
}
.option:disabled {
  opacity: 1;
  cursor: default;
}
.option.right {
  border-color: #178668;
  background: #EFF9F5;
}
.option.wrong {
  border-color: #BE5966;
  background: #FFF3F4;
}
.option .katex {
  font-size: 1.22em;
}
.confidence {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.confidence legend {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 12px;
}
.confidence fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.confidence-options {
  display: flex;
  gap: 10px;
}
.confidence-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 10px;
  border-radius: 8px;
  font-size: .9rem;
  color: var(--ink);
}
.confidence-btn.selected {
  background: var(--soft);
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);
  font-weight: 700;
}
.qactions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.error-text {
  color: var(--error);
  font-size: .875rem;
  margin: 12px 0 0;
}
.feedback {
  margin-top: 24px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.feedback-heading {
  background: #E9F6F1;
  color: #11664D;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}
.feedback.incorrect .feedback-heading {
  background: #FBECEE;
  color: #932D3A;
}
.feedback-body {
  padding: 20px;
}
.feedback-body p {
  font-size: .95rem;
}
.solution {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
  display: grid;
  gap: 14px;
}
.solution > div {
  font-size: 1.05rem;
  line-height: 1.55;
}
.schedule-label {
  background: var(--soft);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: .8rem;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
}
.topic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
}
.topic-card {
  padding: 0;
  margin-bottom: 12px;
  overflow: hidden;
}
.topic-card summary {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}
.topic-card summary:after {
  content: "+";
  margin-left: auto;
  font-size: 1.5rem;
  color: var(--muted);
}
.topic-card[open] summary:after {
  content: "−";
}
.topic-card summary small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: .8rem;
  margin-top: 5px;
}
.topic-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
}
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 0;
  font-size: .95rem;
  line-height: 1.4;
}
.checkbox-line input {
  appearance: auto;
  accent-color: var(--navy);
  width: 20px;
  height: 20px;
  flex: none;
}
.checkbox-line.disabled {
  color: var(--muted);
}
.checkbox-line .pill {
  margin-left: auto;
}
.sidebar-sticky {
  position: sticky;
  top: 24px;
  align-self: start;
}
.box-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}
.box-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .875rem;
}
.box-number {
  background: var(--soft);
  border-radius: 7px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-weight: bold;
}
.setup {
  max-width: 720px;
  margin: auto;
}
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}
.field label {
  font-size: .9rem;
  font-weight: 700;
}
.input,
input[type=text],
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid #BFCADB;
  border-radius: 9px;
  color: var(--ink);
  min-height: 48px;
}
.input-help {
  font-size: .8rem;
  color: var(--muted);
}
.setup-topics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  margin-bottom: 24px;
}
.teacher-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}
.teacher-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.scenario {
  min-height: 110px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
}
.scenario:hover {
  border-color: var(--navy);
  background: var(--soft);
}
.scenario strong {
  font-size: .95rem;
}
.scenario small {
  font-size: .8rem;
  line-height: 1.4;
  color: var(--muted);
}
.scenario .ico {
  color: var(--navy);
}
.table-wrap {
  overflow: auto;
  max-height: 610px;
}
.week-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: .875rem;
}
.week-table th {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 1;
}
.week-table th,
.week-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
}
.week-table tr.current {
  background: #EDF3FC;
}
.week-table tr.paused {
  color: var(--muted);
  background: var(--bg);
}
.stamp {
  width: 32px;
  height: 32px;
  flex: none;
}
.stamp.big {
  width: 58px;
  height: 58px;
}
.teacher-stamp {
  background: var(--navy);
  color: white;
  border: 0;
}
.teacher-stamp p {
  color: #D6E2F5;
}
.stamp-swatch {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #ffffff15;
}
.teacher-stamp .stamp {
  width: 48px;
  height: 48px;
}
.teacher-stamp .btn {
  margin-top: 18px;
}
.instruction-box {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: .875rem;
  background: var(--bg);
  padding: 18px;
  border-radius: 10px;
}
.restore-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.qr-box {
  background: #fff;
  border: 1px solid #DCE2EC;
  border-radius: 12px;
  width: 232px;
  height: 232px;
  margin: 18px auto;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.qr-box canvas {
  max-width: 100%;
  height: auto !important;
  width: 216px !important;
}
.upload-zone {
  position: relative;
  border: 2px dashed #BBC9DD;
  border-radius: 12px;
  padding: 26px 20px;
  text-align: center;
  background: var(--bg);
}
.upload-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.upload-zone .ico {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  color: var(--navy);
}
.upload-zone strong {
  display: block;
  margin-bottom: 8px;
}
.video {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 12px;
  background: #111;
}
.code-text {
  font-family: monospace;
  font-size: .75rem;
  min-height: 95px;
  resize: vertical;
}
.completion-mode .topbar,
.completion-mode .demo-strip,
.completion-mode .footer {
  display: none;
}
.completion-mode .main {
  padding-top: 16px;
  padding-bottom: 20px;
}
.receipt-shell {
  max-width: 480px;
  margin: auto;
}
.receipt-nav {
  margin-bottom: 12px;
  font-size: .875rem;
}
.receipt {
  background: #fff;
  color: #172942;
  border: 1px solid #DCE2EC;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
}
.receipt-head {
  background: var(--navy);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: left;
}
.receipt-head .eyebrow {
  font-size: .68rem;
  margin: 0 0 5px;
  color: #D5DFF1;
}
.receipt-head h1 {
  font-size: 1.65rem;
  margin: 0 0 3px;
  letter-spacing: -.6px;
}
.receipt-head p {
  margin: 0;
  font-size: .75rem;
  color: #E5EBF6;
}
.receipt-body {
  padding: 15px 22px 17px;
}
.receipt-name {
  font-size: 1.15rem;
  font-weight: bold;
  margin: 0 0 4px;
}
.receipt-meta {
  font-size: .75rem;
  color: #58677B;
  margin: 0;
}
.receipt-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 14px 0;
  border-top: 1px solid #DCE2EC;
  border-bottom: 1px solid #DCE2EC;
  padding: 12px 0;
}
.receipt-stats > div + div {
  border-left: 1px solid #DCE2EC;
}
.receipt-stats strong {
  display: block;
  font-size: 1.6rem;
  letter-spacing: -.6px;
  margin-bottom: 3px;
}
.receipt-stats small {
  font-size: .75rem;
  color: #58677B;
}
.confidence-counts {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: .75rem;
  margin-bottom: 12px;
}
.confidence-counts b {
  font-size: .9rem;
}
.receipt-next {
  font-size: .75rem;
  line-height: 1.45;
  margin: 8px 0;
  color: #58677B;
}
.receipt-next strong {
  color: #172942;
  display: block;
  margin-bottom: 3px;
}
.receipt .qr-box {
  margin: 8px auto;
  width: 216px;
  height: 216px;
  border: 0;
  border-radius: 0;
}
.receipt-caption {
  font-size: .72rem;
  line-height: 1.4;
  max-width: 340px;
  margin: 4px auto 0;
  color: #58677B;
}
.receipt-footer {
  font-size: .65rem;
  border-top: 1px solid #DCE2EC;
  margin-top: 12px;
  padding-top: 10px;
  letter-spacing: .5px;
  color: #58677B;
}
.receipt-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.receipt-actions .btn {
  flex: 1;
}
.sample-tag {
  background: #FFF1BF;
  color: #6B4F06;
  text-align: center;
  padding: 6px 12px;
  font-size: .7rem;
  font-weight: bold;
  letter-spacing: 1px;
}
.late-tag {
  background: #FBE5E7;
  color: #932D3A;
  font-size: .75rem;
  font-weight: 700;
  padding: 7px;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 360px;
  margin: 16px auto 0;
}
.keypad button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  min-height: 46px;
  font-size: 1.15rem;
}
.typed-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.7rem;
}
.typed-entry input {
  text-align: center;
  max-width: 300px;
  font-size: 1.5rem;
  height: 66px;
}
.typed-entry.coordinate input {
  width: 130px;
}
.typed-entry input.active {
  border: 2px solid var(--navy);
  background: var(--soft);
}
.level-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.level-circle {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #1F3864;
  font-size: 1.45rem;
  font-weight: bold;
  flex: none;
}
.level-card h3 {
  margin-bottom: 5px;
}
.level-progress {
  height: 5px;
  background: var(--line);
  border-radius: 5px;
  margin-top: 10px;
  overflow: hidden;
}
.level-progress span {
  height: 100%;
  display: block;
  background: var(--navy);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  max-width: 520px;
  width: calc(100% - 32px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 100px #0c1c3a35;
}
dialog::backdrop {
  background: #14254177;
  backdrop-filter: blur(3px);
}
dialog h2 {
  margin-bottom: 12px;
}
dialog p {
  font-size: .95rem;
}
dialog .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.skip {
  position: fixed;
  top: -70px;
  left: 20px;
  z-index: 50;
  background: var(--yellow);
  padding: 15px;
}
.skip:focus {
  top: 10px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #172942;
  color: white;
  padding: 13px 20px;
  border-radius: 10px;
  box-shadow: 0 8px 35px #0003;
  font-size: .9rem;
  z-index: 100;
  max-width: calc(100% - 32px);
  display: none;
}
.loading {
  min-height: 80vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 18px;
}
.loading .brandmark {
  margin: auto;
}
.empty {
  text-align: center;
  padding: 32px 18px;
}
.empty .ico {
  width: 36px;
  height: 36px;
  color: var(--muted);
  margin-bottom: 16px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.badge-count {
  background: var(--navy);
  color: white;
  font-size: .75rem;
  border-radius: 20px;
  padding: 3px 8px;
}
.details-link {
  font-size: .9rem;
  color: var(--navy);
  cursor: pointer;
}
.fine {
  font-size: .75rem;
  line-height: 1.5;
  color: var(--muted);
}
@media (min-width:1600px) {
  .main {
    padding-top: 54px;
  }
  .weekly-card {
    padding: 36px;
  }
  .weekly-card h2 {
    margin-top: 34px;
  }
  .weekly-bottom {
    margin-top: 36px;
  }
}
@media (max-width:1230px) {
  .main {
    margin: 0 32px;
  }
  .footer {
    margin: 0 32px;
  }
  .topbar-inner {
    gap: 18px;
  }
  .nav a {
    padding: 12px 10px;
  }
  .nav .ico {
    display: none;
  }
}
@media (max-width:900px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 16px;
  }
  .brand {
    margin-bottom: 12px;
  }
  .topright {
    margin-left: auto;
    margin-bottom: 12px;
  }
  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--line);
    padding: 5px 0;
  }
  .nav a {
    flex: 1;
    justify-content: center;
  }
  .nav .ico {
    display: block;
  }
  .home-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
    gap: 18px;
  }
  .main {
    margin: 0 24px;
  }
  .weekly-card {
    padding: 24px;
  }
  .weekly-bottom {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }
  .progress-wrap {
    max-width: none;
  }
  .topic-layout,
  .teacher-grid {
    grid-template-columns: 1fr;
  }
  .sidebar-sticky {
    position: static;
  }
  .teacher-grid > .stack {
    order: -1;
  }
  .teacher-stamp {
    display: none;
  }
  .topic-layout > aside {
    order: -1;
  }
  .topic-layout > aside .box-list {
    display: none;
  }
}
@media (max-width:650px) {
  h1 {
    font-size: 1.85rem;
  }
  .topbar-inner {
    padding: 13px 18px 0;
  }
  .brandname {
    font-size: 1rem;
  }
  .school {
    font-size: .65rem;
  }
  .brandmark {
    width: 38px;
    height: 38px;
    font-size: 1.65rem;
  }
  .topright .classchip {
    display: none;
  }
  .nav a {
    font-size: .8rem;
    padding: 11px 7px;
    gap: 5px;
  }
  .nav .ico {
    width: 16px;
    height: 16px;
  }
  .demo-strip > div {
    padding: 9px 18px;
    gap: 7px;
    flex-wrap: wrap;
    font-size: .7rem;
  }
  .demo-strip .demo-detail {
    display: none;
  }
  .demo-strip .text-btn {
    font-size: .75rem;
  }
  .main {
    margin: 0 18px;
    padding: 27px 0 32px;
  }
  .home-grid {
    grid-template-columns: 1fr;
  }
  .home-main {
    gap: 18px;
  }
  .page-heading {
    margin-bottom: 22px;
    align-items: flex-start;
  }
  .page-heading p {
    font-size: .9rem;
  }
  .date-label {
    display: none;
  }
  .weekly-card {
    padding: 23px;
  }
  .weekly-card h2 {
    font-size: 1.85rem;
    margin-top: 24px;
  }
  .weekly-card p {
    font-size: .9rem;
  }
  .weekly-bottom {
    gap: 22px;
    margin-top: 25px;
  }
  .weekly-bottom .btn {
    width: 100%;
  }
  .card {
    padding: 20px;
  }
  .score-list {
    gap: 8px;
  }
  .score-item {
    padding: 12px;
  }
  .score-item .score {
    font-size: 1.4rem;
  }
  .footer {
    margin: 0 18px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    font-size: .7rem;
  }
  .question-card {
    padding: 22px 18px;
  }
  .question-toolbar {
    gap: 10px;
    flex-wrap: wrap;
  }
  .question-dots {
    gap: 5px;
  }
  .qdot {
    width: 23px;
    height: 23px;
  }
  .question-toolbar .text-btn {
    font-size: .8rem;
  }
  .stem {
    font-size: 1.13rem;
    line-height: 1.85;
  }
  .option-grid {
    gap: 10px;
  }
  .option {
    padding: 12px 10px;
    gap: 10px;
    min-height: 70px;
  }
  .option-letter {
    width: 26px;
    height: 28px;
    font-size: .8rem;
  }
  .option .katex {
    font-size: 1.1em;
  }
  .confidence-options {
    gap: 7px;
  }
  .confidence-btn {
    font-size: .8rem;
    padding: 13px 6px;
  }
  .qactions {
    flex-direction: column;
    align-items: stretch;
  }
  .qactions .muted {
    text-align: center;
    order: 2;
  }
  .feedback-body {
    padding: 17px;
  }
  .feedback-heading {
    padding: 15px 17px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .setup-topics {
    grid-template-columns: 1fr;
  }
  .restore-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .teacher-controls {
    gap: 9px;
  }
  .scenario {
    padding: 14px;
  }
  .table-wrap {
    margin: 0 -12px;
  }
  .week-table td,
  .week-table th {
    padding: 13px 9px;
  }
  .week-table .btn {
    font-size: .75rem;
    padding: 8px;
  }
  .topic-card {
    padding: 0;
  }
  .topic-card summary {
    padding: 17px;
  }
  .checkbox-line {
    font-size: .875rem;
  }
  .checkbox-line .pill {
    font-size: .65rem;
  }
  .receipt-body {
    padding: 13px 16px;
  }
  .receipt-head {
    padding: 14px 16px;
  }
  .receipt-head .stamp {
    width: 48px;
    height: 48px;
  }
  .receipt-head h1 {
    font-size: 1.5rem;
  }
  .receipt .qr-box {
    width: 208px;
    height: 208px;
  }
  .receipt .qr-box canvas {
    width: 208px !important;
  }
  .receipt-stats {
    padding: 10px 0;
    margin: 12px 0;
  }
  .completion-mode .main {
    margin: 0 12px;
  }
  .receipt-actions {
    flex-wrap: wrap;
  }
  .receipt-caption {
    font-size: .68rem;
  }
  .receipt-footer {
    margin-top: 9px;
    padding-top: 8px;
  }
  .sample-tag {
    font-size: .6rem;
  }
  .restore-layout .card {
    min-width: 0;
  }
  .code-text {
    word-break: break-all;
  }
  .confidence-counts {
    gap: 13px;
  }
  .receipt-next {
    font-size: .72rem;
  }
}
@media (prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-bottom: 100px;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
}
.main,
.footer {
  min-width: 0;
}
.row > *,
.page-heading > *,
.home-grid > *,
.home-main > *,
.stack > *,
.teacher-grid > *,
.topic-layout > *,
.settings-grid > *,
.restore-layout > *,
.option-grid > * {
  min-width: 0;
}
.brandmark {
  flex: none;
}
.pill {
  white-space: normal;
}
.page-heading,
.card-title,
.weekly-top,
.qmeta {
  flex-wrap: wrap;
}
.btn,
.icon-btn,
.text-btn {
  min-height: 44px;
}
.btn,
.text-btn {
  overflow-wrap: anywhere;
}
.icon-btn {
  width: 44px;
  flex: none;
}
.btn.sm {
  min-height: 44px;
}
.small,
.mini-label,
.input-help,
.section-note,
.fine,
.date-label,
.receipt-meta,
.receipt-stats small,
.receipt-next,
.receipt-caption,
.confidence-counts,
.receipt-footer,
.week-label,
.status-tag,
.progress-label,
.qmeta,
.check-line {
  font-size: .875rem;
}
.page-heading p,
.weekly-card p,
.feedback-body p {
  font-size: 1rem;
}
.stem,
.solution > div,
.feedback-body p,
.option > span:nth-child(2) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.stem .katex,
.solution .katex,
.option .katex,
.feedback-body p .katex {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
  padding-block: 4px;
}
.option > span:nth-child(2) {
  flex: 1;
}
.option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.confidence fieldset {
  min-width: 0;
}
.confidence-btn {
  font-size: 1rem;
  min-width: 0;
  min-height: 48px;
}
.question-dots {
  flex-wrap: wrap;
}
.question-toolbar {
  flex-wrap: wrap;
  gap: 12px;
}
.schedule-label {
  flex-wrap: wrap;
  line-height: 1.5;
}
.typed-entry input {
  min-width: 0;
}
.typed-entry.coordinate input {
  width: calc((100% - 70px)/2);
  max-width: 180px;
}
.setup-topics {
  display: block;
}
.setup-topics .topic-card {
  margin-bottom: 10px;
}
.checkbox-line {
  min-height: 48px;
  align-items: flex-start;
  padding-bottom: 8px;
}
.checkbox-line input {
  margin-top: 2px;
}
.topic-card summary {
  min-height: 64px;
}
.topic-card summary > span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.topic-layout > aside {
  order: initial;
}
.week-list {
  display: grid;
  gap: 0;
}
.week-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.week-row.current {
  background: var(--soft);
  border-radius: 10px;
  padding-inline: 12px;
}
.week-number {
  width: 28px;
  flex: none;
  text-align: center;
}
.week-info {
  flex: 1;
  min-width: 0;
}
.week-row small {
  display: block;
  font-size: .875rem;
  color: var(--muted);
  margin-top: 6px;
}
.stamp-label {
  font-size: .875rem;
  margin-top: 8px;
  text-transform: capitalize;
}
.stamp-label .stamp {
  width: 23px;
  height: 23px;
}
.week-row.paused {
  color: var(--muted);
}
.teacher-grid {
  grid-template-columns: minmax(0, 1fr) 320px;
}
.teacher-grid li {
  line-height: 1.65;
  margin-bottom: 12px;
}
.teacher-controls {
  margin-top: 20px;
}
.scenario {
  min-height: 88px;
}
.instruction-box {
  overflow-wrap: anywhere;
}
dialog {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog .actions {
  flex-wrap: wrap;
}
dialog .actions .btn {
  flex: 1;
  min-width: 120px;
}
input[type=text],
select,
textarea,
.code-text {
  font-size: 1rem;
}
.qr-box,
.receipt .qr-box {
  width: min(100%, 300px);
  height: auto;
  aspect-ratio: 1;
}
.qr-box canvas,
.receipt .qr-box canvas {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
}
.receipt-head > div {
  min-width: 0;
}
.receipt-name {
  overflow-wrap: anywhere;
}
.receipt-actions .btn {
  min-width: 130px;
}
.confidence-counts {
  flex-wrap: wrap;
  gap: 8px 14px;
}
.receipt-footer {
  letter-spacing: 0;
  line-height: 1.5;
}
.receipt-caption {
  margin-top: 10px;
}
.receipt-next {
  line-height: 1.6;
}
.receipt-head .eyebrow,
.receipt-head p {
  font-size: .75rem;
}
.receipt-head h1 {
  line-height: 1.25;
}
.footer {
  font-size: .875rem;
}
.footer .row {
  align-items: flex-start;
}
.card-title h2 {
  line-height: 1.4;
}
.demo-strip > div {
  flex-wrap: wrap;
}
.option-grid .option:focus-visible {
  outline-offset: 1px;
}
@media (max-width:900px) {
  .home-grid,
  .teacher-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .teacher-stamp {
    display: block;
  }
  .sidebar-sticky {
    position: static;
  }
}
@media (max-width:650px) {
  .topbar-inner {
    padding: calc(12px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    gap: 8px;
    min-height: 76px;
  }
  .brand,
  .topright {
    margin-bottom: 0;
  }
  .brand {
    gap: 9px;
  }
  .school {
    font-size: .7rem;
    letter-spacing: .3px;
  }
  .topright {
    gap: 6px;
  }
  .nav {
    position: fixed;
    z-index: 20;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    background: var(--surface);
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    box-shadow: 0 -3px 16px #1425410c;
  }
  .nav a {
    flex-direction: column;
    gap: 5px;
    font-size: .875rem;
    line-height: 1.2;
    padding: 8px 2px;
    min-height: 54px;
  }
  .nav .ico {
    width: 20px;
    height: 20px;
  }
  .main {
    margin: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    padding: 24px 0;
  }
  .footer {
    margin: 0 16px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .page-heading {
    gap: 12px;
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: 1.8rem;
    letter-spacing: -.7px;
  }
  .card {
    padding: 18px;
  }
  .question-card {
    padding: 20px 16px;
  }
  .option-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .option {
    min-height: 64px;
    padding: 14px;
    gap: 12px;
  }
  .option .katex {
    font-size: 1.12em;
  }
  .option-letter {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .stem {
    font-size: 1.125rem;
  }
  .confidence-options {
    gap: 6px;
  }
  .confidence-btn {
    font-size: .875rem;
    padding: 12px 5px;
    line-height: 1.35;
  }
  .feedback-body {
    padding: 16px;
  }
  .solution > div {
    font-size: 1rem;
  }
  .qmeta {
    letter-spacing: 0;
    text-transform: none;
    gap: 8px;
  }
  .question-dots {
    gap: 5px;
  }
  .qdot {
    width: 22px;
    height: 22px;
  }
  .question-toolbar .text-btn {
    font-size: .875rem;
  }
  .card-title {
    gap: 8px;
  }
  .weekly-card {
    padding: 22px;
  }
  .weekly-card h2 {
    font-size: 1.85rem;
  }
  .score-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .score-item {
    padding: 10px;
  }
  .check-line {
    flex-wrap: wrap;
  }
  .level-card {
    align-items: flex-start;
  }
  .topic-card {
    padding: 0;
  }
  .topic-card summary {
    padding: 16px 14px;
  }
  .topic-body {
    padding: 0 14px 14px;
  }
  .checkbox-line {
    font-size: 1rem;
  }
  .week-row {
    gap: 8px;
  }
  .week-number {
    width: 20px;
  }
  .week-row .btn {
    padding: 9px;
    font-size: .875rem;
  }
  .week-row.current {
    padding-inline: 8px;
  }
  .teacher-grid .card {
    padding: 16px;
  }
  .teacher-controls {
    grid-template-columns: 1fr 1fr;
  }
  .receipt-head {
    gap: 12px;
    padding: 16px 12px;
    align-items: flex-start;
  }
  .receipt-head h1 {
    font-size: 1.4rem;
  }
  .receipt-head .stamp {
    width: 36px;
    height: 36px;
  }
  .receipt-body {
    padding: 16px 14px;
  }
  .completion-mode .main {
    margin: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .receipt .qr-box {
    max-width: 300px;
  }
  .receipt-actions {
    position: static;
  }
  .receipt-nav .small {
    font-size: .875rem;
  }
  .receipt-caption {
    font-size: .875rem;
  }
  .receipt-footer {
    font-size: .75rem;
  }
  .setup .card {
    padding: 16px;
  }
  .setup .topic-card {
    padding: 0;
  }
  dialog {
    padding: 20px 16px;
    width: calc(100% - 24px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
  }
  #toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100% - 24px);
  }
  .completion-mode #toast {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .receipt-stats strong {
    font-size: 1.6rem;
  }
  .row.between {
    flex-wrap: wrap;
  }
}
@media (max-width:360px) {
  .brandname {
    font-size: .95rem;
  }
  .brandmark {
    width: 32px;
    height: 36px;
  }
  .school {
    font-size: .65rem;
  }
  .topbar-inner {
    gap: 4px;
  }
  .topright {
    gap: 4px;
  }
  .card {
    padding: 16px;
  }
  .confidence-options {
    flex-direction: column;
  }
  .score-list {
    grid-template-columns: 1fr;
  }
  .score-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 8px;
  }
  .score-item .score {
    margin: 0;
  }
  .score-track {
    grid-column: 1/-1;
  }
  .check-line {
    margin: 0;
  }
  .teacher-controls {
    grid-template-columns: 1fr;
  }
}
@media (display-mode:standalone) {
  .loading {
    min-height: 100dvh;
  }
  .install-status {
    display: block;
  }
}
