:root {
  --navy: #20264f;
  --deep: #07182f;
  --gold: #b8944d;
  --gold-soft: #f4ead4;
  --paper: #f7f3ea;
  --surface: #fffdf8;
  --surface-2: #ffffff;
  --line: #e4ddcf;
  --line-strong: #d3c8b7;
  --text: #202124;
  --muted: #667085;
  --success: #237248;
  --danger: #a23a3a;
  --orange: #ad6818;
  --blue: #1c4e7d;
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, 0.06);
  --shadow-md: 0 14px 34px rgba(11, 31, 58, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --ease: 180ms cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, "Segoe UI", Arial, sans-serif;
  background: #f8f6f0;
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--navy);
}

.auth-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background:
    linear-gradient(135deg, rgba(32, 38, 79, 0.96) 0%, rgba(32, 38, 79, 0.9) 42%, rgba(248, 246, 240, 0.98) 42%, rgba(248, 246, 240, 0.98) 100%),
    #f8f6f0;
}

.auth-shell {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(11, 31, 58, 0.18);
  overflow: hidden;
}

.auth-shell.compact {
  max-width: 820px;
}

.auth-side {
  min-height: 470px;
  padding: 34px;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(7, 24, 47, 0.98), rgba(32, 38, 79, 0.96)),
    var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.auth-side .brand {
  margin-bottom: 0;
}

.auth-side .brand strong,
.auth-side .brand span,
.auth-side p {
  color: #ffffff;
}

.auth-side h1 {
  margin: 54px 0 12px;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.02;
}

.auth-side p {
  max-width: 390px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
  line-height: 1.55;
}

.auth-card {
  width: 100%;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  padding: 38px;
  box-shadow: none;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card.demo-card {
  max-width: 720px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 60px rgba(11, 31, 58, 0.12);
}

.auth-card h2 {
  margin: 8px 0 8px;
  color: var(--navy);
  font-size: 1.75rem;
}

.auth-card .field {
  margin-top: 16px;
}

.auth-card input {
  min-height: 48px;
  border-color: var(--line-strong);
  background: #fffdf8;
}

.auth-card input:focus {
  outline: 3px solid rgba(184, 148, 77, 0.24);
  border-color: var(--gold);
}

.auth-card .primary {
  width: 100%;
  min-height: 48px;
}

.turnstile-wrap {
  min-height: 65px;
  margin-top: 16px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 0;
  text-align: left;
  font-weight: 760;
}

.link-button:hover {
  color: var(--gold);
}

.auth-link {
  align-self: flex-start;
  margin-top: 14px;
}

.auth-link.secondary {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 680;
}

.auth-link.secondary:hover {
  color: var(--gold);
}

.small {
  font-size: 0.88rem;
}

.demo-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.demo-role-button {
  min-height: 96px;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  min-width: 0;
  max-width: 100%;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand strong {
  display: block;
  color: var(--navy);
  font-size: 1.08rem;
  min-width: 0;
}

.brand span,
.muted,
.notice {
  color: var(--muted);
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  color: var(--navy);
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.45rem;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 1rem;
}

p {
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

label {
  color: var(--deep);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(184, 148, 77, 0.28);
  outline-offset: 2px;
}

.button {
  min-height: 40px;
  border: 1px solid rgba(37, 43, 84, 0.18);
  border-radius: 10px;
  padding: 9px 14px;
  background: #ffffff;
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), border-color var(--ease), color var(--ease);
}

.button:hover {
  border-color: var(--gold);
  color: var(--deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #ffffff;
}

.button.dark {
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
}

.button.danger {
  border-color: rgba(155, 47, 47, 0.34);
  color: var(--danger);
}

.button[disabled] {
  opacity: 0.58;
  cursor: wait;
}

.portal-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.sidebar {
  background: #ffffff;
  color: var(--text);
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 16px;
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  border-right: 1px solid var(--line);
}

.sidebar .brand strong,
.sidebar h2 {
  color: var(--deep);
}

.sidebar .brand span,
.sidebar .notice {
  color: var(--muted);
}

.sidebar .brand {
  margin-bottom: 2px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid var(--line);
}

.sidebar .brand img {
  width: 34px;
  height: 34px;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #3c4150;
  text-align: left;
  padding: 9px 10px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}

.nav-button.active,
.nav-button:hover {
  background: #f7f3ea;
  border-color: rgba(184, 148, 77, 0.32);
  color: var(--deep);
}

.nav-button:hover {
  transform: translateX(2px);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(37, 43, 84, 0.18);
  flex: 0 0 auto;
}

.nav-button.active .nav-dot {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(184, 148, 77, 0.15);
}

.profile-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fbfaf7;
  border-radius: 14px;
  padding: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--deep);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.profile-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-copy strong,
.profile-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}

.main {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: 0;
  max-width: 100%;
}

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
  max-width: 100%;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 16px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.editor-card {
  padding: 0;
  overflow: hidden;
}

.editor-card > .list-title {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.website-editor-frame {
  display: block;
  width: 100%;
  min-height: calc(100vh - 190px);
  border: 0;
  background: #ffffff;
}

.stat {
  border-left: 4px solid var(--gold);
}

.stat strong {
  font-size: 1.55rem;
  color: var(--deep);
}

.toolbar,
.row-actions,
.form-grid {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.form-grid {
  align-items: end;
}

.form-grid > * {
  flex: 1 1 190px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  border: 1px solid rgba(37, 43, 84, 0.12);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.list-item.selected,
.list-item.active {
  border-color: rgba(184, 148, 77, 0.72);
  background: #fff8e9;
}

.text-left {
  width: 100%;
  text-align: left;
  color: var(--text);
}

.list-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.pill {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--paper);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill.success {
  background: #e7f5ed;
  color: var(--success);
}

.pill.warn {
  background: #fff4dd;
  color: #8a5a10;
}

.pill.danger {
  background: #fdecec;
  color: var(--danger);
}

.pill.blue {
  background: #eef5ff;
  color: var(--blue);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.drawer {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 16px;
  position: sticky;
  top: 88px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  padding: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.error {
  color: var(--danger);
}

.success-text {
  color: var(--success);
}

.file-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}

.checkbox-line {
  color: var(--deep);
  font-size: 0.9rem;
}

.student-hero {
  border: 1px solid rgba(184, 148, 77, 0.24);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--deep), var(--navy));
  color: #fffdf6;
  padding: clamp(20px, 4vw, 34px);
  display: grid;
  gap: 12px;
}

.student-hero h2 {
  color: #fffdf6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.student-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 253, 246, 0.78);
}

.homework-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.homework-list {
  position: sticky;
  top: 88px;
}

.homework-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.homework-status-grid > div,
.homework-status-grid > button {
  border: 1px solid rgba(184, 148, 77, 0.22);
  background: var(--paper);
  color: var(--text);
  padding: 10px;
  display: grid;
  gap: 2px;
  text-align: left;
  border-radius: var(--radius-sm);
}

.homework-status-grid > button.active,
.homework-status-grid > button:hover {
  border-color: rgba(184, 148, 77, 0.76);
  background: #fff8e9;
}

.homework-status-grid strong {
  color: var(--deep);
  font-size: 1.3rem;
}

.homework-status-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.homework-task {
  width: 100%;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.homework-task.active {
  border-color: rgba(184, 148, 77, 0.72);
  background: #fff8e9;
}

.homework-detail {
  min-height: 520px;
  align-content: start;
}

.submission-panel,
.upload-panel {
  border: 1px solid rgba(37, 43, 84, 0.12);
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.upload-panel input[type="file"] {
  background: #ffffff;
  border-style: dashed;
  padding: 16px;
}

.spaced-admin {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.42fr);
}

.spaced-drawer {
  display: grid;
  gap: 18px;
}

.traffic-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: min(100%, 360px);
}

.traffic-button {
  border: 1px solid rgba(37, 43, 84, 0.14);
  background: #ffffff;
  color: var(--text);
  padding: 9px;
  min-height: 58px;
  display: grid;
  gap: 2px;
  text-align: left;
}

.traffic-button strong,
.traffic-button span {
  overflow-wrap: anywhere;
}

.traffic-button span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.traffic-button.red {
  border-left: 4px solid var(--danger);
}

.traffic-button.orange {
  border-left: 4px solid #b66b12;
}

.traffic-button.green {
  border-left: 4px solid var(--success);
}

.traffic-button.active,
.traffic-button:hover:not([disabled]) {
  background: #fff8e9;
  border-color: rgba(184, 148, 77, 0.78);
}

.traffic-button[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
}

.latex-text {
  white-space: pre-wrap;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.math-block {
  display: block;
  overflow-x: auto;
  padding: 8px 0;
  max-width: 100%;
}

.math-inline {
  display: inline;
  max-width: 100%;
  line-height: 1;
  vertical-align: baseline;
}

.math-inline .katex {
  line-height: 1;
  vertical-align: -0.04em;
}

.practice-image {
  display: block;
  max-width: min(100%, 760px);
  border: 1px solid var(--line);
  background: #ffffff;
}

.solution-panel {
  border: 1px solid rgba(37, 43, 84, 0.12);
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.topic-group {
  gap: 14px;
}

.topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.44fr);
  gap: 12px;
  align-items: center;
  border-top: 1px solid rgba(37, 43, 84, 0.1);
  padding-top: 12px;
}

.topic-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.learning-dashboard {
  display: grid;
  gap: 18px;
  max-width: 1440px;
  width: 100%;
}

.learning-hero,
.surface-card,
.stat-card,
.review-card,
.clear-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.learning-hero {
  border-radius: 22px;
  padding: clamp(20px, 3vw, 30px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(7, 24, 47, 0.98), rgba(32, 38, 79, 0.94)),
    var(--deep);
  color: #fffdf8;
}

.learning-hero h2 {
  color: #fffdf8;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.05;
  max-width: 720px;
}

.learning-hero p {
  color: rgba(255, 253, 248, 0.76);
  max-width: 720px;
  margin: 10px 0 0;
}

.hero-action {
  flex: 0 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.learning-hero .eyebrow {
  color: rgba(255, 253, 248, 0.7);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  border-radius: 16px;
  padding: 14px 15px;
  display: grid;
  gap: 6px;
  min-height: 112px;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 148, 77, 0.35);
  box-shadow: var(--shadow-md);
}

.stat-card span,
.stat-card small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 760;
}

.stat-card strong {
  color: var(--deep);
  font-size: 2rem;
  line-height: 1;
}

.read-only-note {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 10px 14px;
}

.class-link-card {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease), background var(--ease);
}

.class-link-card:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 148, 77, 0.58);
  box-shadow: var(--shadow-sm);
  background: #fffdf8;
}

.review-due-card {
  border-left: 4px solid var(--gold);
}

.class-dashboard {
  display: grid;
  gap: 16px;
}

.class-hero {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(251, 250, 247, 0.94)),
    #ffffff;
  box-shadow: var(--shadow-sm);
  padding: clamp(16px, 2.4vw, 24px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.28fr);
  gap: 16px;
  align-items: end;
}

.class-hero h2 {
  margin-top: 4px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.class-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.back-link {
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 0 0 10px;
  font-weight: 850;
}

.class-tutor-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfaf7;
  padding: 14px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.class-tutor-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.class-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.dashboard-review-list .pill,
.class-dashboard .pill {
  flex: 0 0 auto;
}

.student-preview-panel {
  display: grid;
  gap: 14px;
}

.preview-header {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  padding: clamp(16px, 2.4vw, 24px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  box-shadow: var(--shadow-sm);
}

.preview-header h2 {
  margin-top: 4px;
}

.preview-header p {
  margin: 8px 0 0;
}

.preview-tabs,
.roster-preview-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.student-class-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.student-class-row select {
  min-height: 42px;
}

.preview-tabs {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfaf7;
  padding: 6px;
}

.preview-tab {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-weight: 850;
}

.preview-tab.active {
  border-color: rgba(184, 148, 77, 0.42);
  background: #ffffff;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.calendar-card {
  overflow-x: auto;
}

.calendar-heading {
  align-items: center;
}

.calendar-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  justify-content: center;
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.74rem;
  font-weight: 820;
}

.legend-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
}

.legend-item.red::before {
  background: var(--danger);
}

.legend-item.orange::before {
  background: var(--orange);
}

.legend-item.green::before {
  background: var(--success);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: #f4f0e8;
}

.calendar-weekdays span {
  padding: 9px 6px;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-days {
  border: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  background: var(--line);
  gap: 1px;
}

.calendar-day {
  min-height: 118px;
  background: #ffffff;
  padding: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.calendar-day.outside {
  background: #fbfaf7;
  color: rgba(76, 85, 102, 0.62);
}

.calendar-day.today {
  background: #fff8e9;
  box-shadow: inset 0 0 0 2px rgba(184, 148, 77, 0.5);
}

.calendar-day-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 850;
}

.calendar-day.today .calendar-day-number {
  background: var(--deep);
  color: #ffffff;
}

.calendar-events {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.calendar-event {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(37, 43, 84, 0.1);
  border-left-width: 4px;
  border-radius: 8px;
  background: #f7fbff;
  color: var(--text);
  padding: 5px 6px;
  font-size: 0.72rem;
  font-weight: 780;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.calendar-event.red {
  background: #fff2f2;
  border-left-color: var(--danger);
}

.calendar-event.orange {
  background: #fff7e8;
  border-left-color: var(--orange);
}

.calendar-event.green {
  background: #ecf8f0;
  border-left-color: var(--success);
}

.calendar-more {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  padding-left: 4px;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.38fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.surface-card {
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.queue-panel {
  position: sticky;
  top: 92px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.section-heading.compact {
  align-items: center;
}

.section-heading h2,
.section-heading h3 {
  margin-top: 4px;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-card {
  border-radius: 15px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease), background var(--ease);
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.review-card.selected {
  border-color: rgba(184, 148, 77, 0.7);
  background: #fffaf0;
  box-shadow: 0 0 0 3px rgba(184, 148, 77, 0.12);
}

.review-card-main {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.review-card-main strong,
.review-card-main span,
.review-card-main small {
  overflow-wrap: anywhere;
}

.review-card-main small {
  color: var(--muted);
  font-weight: 760;
}

.review-button {
  min-width: 86px;
}

.review-button.selected {
  background: var(--deep);
  border-color: var(--deep);
  color: #ffffff;
}

.review-heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.fullscreen-review-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(7, 24, 47, 0.72);
  backdrop-filter: blur(6px);
  padding: clamp(12px, 3vw, 32px);
  display: grid;
  place-items: center;
}

.fullscreen-review-shell {
  width: min(1120px, 100%);
  max-height: min(920px, 94vh);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  padding: clamp(16px, 2.4vw, 26px);
  display: grid;
  gap: 14px;
}

.fullscreen-review-nav {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.question-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.question-dots button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-weight: 850;
}

.question-dots button.active {
  border-color: var(--deep);
  background: var(--deep);
  color: #ffffff;
}

.question-dots button.complete {
  border-color: rgba(46, 125, 75, 0.35);
  background: #e7f5ed;
  color: var(--success);
}

.question-dots button.active.complete {
  background: var(--success);
  color: #ffffff;
}

.review-finished-card {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfaf7);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  padding: clamp(20px, 5vw, 44px);
}

.review-finished-card p {
  color: var(--muted);
  margin: 0;
  max-width: 480px;
}

.completion-mark {
  min-width: 72px;
  height: 72px;
  border-radius: 999px;
  background: #e7f5ed;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(46, 125, 75, 0.24);
}

.status-chip {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 850;
}

.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.status-chip.danger,
.status-chip.red {
  background: #fdecec;
  color: var(--danger);
}

.status-chip.warn,
.status-chip.orange {
  background: #fff4dd;
  color: var(--orange);
}

.status-chip.success,
.status-chip.green {
  background: #e7f5ed;
  color: var(--success);
}

.clear-card {
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 6px;
  background: linear-gradient(180deg, #ffffff, #fbfaf7);
}

.clear-card p {
  margin: 0;
  color: var(--muted);
}

.practice-panel {
  min-height: 560px;
}

.question-card,
.attempt-card,
.confidence-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfaf7;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.question-card .latex-text {
  font-size: 1.05rem;
}

.attempt-card {
  align-items: start;
}

.attempt-card p {
  margin: 0;
  color: var(--muted);
}

.solution-panel.polished {
  border-radius: 16px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.answer-callout,
.hint-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
  padding: 12px;
}

.answer-callout {
  display: grid;
  gap: 6px;
}

.hint-panel summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 820;
}

.question-hint {
  background: #fff8e9;
  border-color: rgba(184, 148, 77, 0.28);
}

.confidence-panel {
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
  align-items: center;
}

.confidence-panel p {
  margin: 4px 0 0;
}

.confidence-selector {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f0e8;
  min-width: min(100%, 430px);
}

.confidence-option {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 820;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.confidence-option:hover:not([disabled]) {
  background: #ffffff;
  transform: translateY(-1px);
}

.confidence-option:active:not([disabled]) {
  transform: scale(0.98);
}

.confidence-option.active {
  background: #ffffff;
  border-color: rgba(184, 148, 77, 0.46);
  box-shadow: 0 8px 18px rgba(11, 31, 58, 0.08);
}

.confidence-option[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  flex: 0 0 auto;
}

.confidence-option.red .status-dot {
  background: var(--danger);
}

.confidence-option.orange .status-dot {
  background: var(--orange);
}

.confidence-option.green .status-dot {
  background: var(--success);
}

.topic-map-card {
  gap: 16px;
}

.mx1-map {
  scroll-margin-top: 20px;
}

.course-progress-meter {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.course-progress-meter strong {
  font-size: 1.8rem;
  color: var(--navy);
}

.course-progress-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfaf7;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.search-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 820;
}

.search-field input,
.dump-filters select,
.dump-filters input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.search-field input:focus,
.dump-filters select:focus,
.dump-filters input:focus {
  outline: 0;
  border-color: rgba(184, 148, 77, 0.72);
  box-shadow: 0 0 0 3px rgba(184, 148, 77, 0.14);
}

.topic-accordion-list,
.topic-group-modern {
  display: grid;
  gap: 10px;
}

.topic-group-modern {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfaf7;
  padding: 12px;
}

.topic-group-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 4px 4px 8px;
}

.topic-group-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.topic-accordion {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.topic-accordion:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.topic-accordion.open {
  border-color: rgba(184, 148, 77, 0.55);
  box-shadow: 0 0 0 3px rgba(184, 148, 77, 0.1);
}

.main-topic-card {
  border-color: rgba(11, 31, 58, 0.16);
  background: linear-gradient(180deg, #ffffff, #fffdf8);
}

.topic-summary {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.topic-chevron {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
}

.topic-accordion.open .topic-chevron {
  background: var(--deep);
  color: #ffffff;
}

.topic-summary-main,
.topic-summary-meta {
  min-width: 0;
}

.topic-summary-main {
  display: grid;
  gap: 4px;
}

.topic-summary-main strong,
.topic-summary-main span {
  overflow-wrap: anywhere;
}

.topic-summary-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.due-count,
.chevron {
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 0.74rem;
  font-weight: 820;
}

.topic-details {
  display: grid;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  padding: 0 13px;
  overflow: hidden;
  transition: max-height 260ms cubic-bezier(0.2, 0, 0, 1), opacity var(--ease), padding var(--ease), visibility var(--ease);
}

.topic-accordion.open .topic-details {
  max-height: 1600px;
  opacity: 1;
  visibility: visible;
  padding: 0 13px 13px;
}

.topic-details > * {
  min-height: 0;
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: #ede7dc;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #d9bf83);
  transition: width 260ms cubic-bezier(0.2, 0, 0, 1);
}

.progress-track.overall {
  height: 10px;
  margin: 0;
}

.progress-track.mini {
  height: 6px;
}

.topic-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.topic-detail-grid span {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 3px;
  background: #fbfaf7;
}

.topic-detail-grid small {
  color: var(--muted);
  font-weight: 780;
}

.topic-confidence-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: auto minmax(280px, 430px);
  gap: 12px;
  align-items: center;
}

.subtopic-list-wrap {
  gap: 10px;
}

.subtopic-list {
  display: grid;
  gap: 9px;
}

.subtopic-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
  overflow: hidden;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.subtopic-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.subtopic-card.open {
  border-color: rgba(11, 31, 58, 0.18);
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.05);
}

.subtopic-summary {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.subtopic-summary > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subtopic-summary strong,
.subtopic-summary span {
  overflow-wrap: anywhere;
}

.subtopic-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.subtopic-details {
  display: grid;
  gap: 10px;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  padding: 0 12px;
  transition: max-height 240ms cubic-bezier(0.2, 0, 0, 1), opacity var(--ease), padding var(--ease), visibility var(--ease);
}

.subtopic-card.open .subtopic-details {
  max-height: 460px;
  opacity: 1;
  visibility: visible;
  padding: 0 12px 12px;
}

.course-tag {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(37, 43, 84, 0.12);
  background: #eef5ff;
  color: var(--blue);
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.course-tag.a {
  background: #f4f0e8;
  color: var(--navy);
}

.course-tag.e1 {
  background: #eef5ff;
  color: var(--blue);
}

.course-tag.e1-link {
  background: #fff4dd;
  color: #8a510f;
}

.course-tag.e1-application {
  background: #e7f5ed;
  color: var(--success);
}

.request-question-row {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.request-question-button {
  min-width: 150px;
}

.request-question-button.sent {
  border-color: rgba(46, 125, 75, 0.28);
  background: #e7f5ed;
  color: var(--success);
}

.question-dump-panel {
  gap: 14px;
}

.assignment-panel {
  gap: 14px;
}

.assignment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.assignment-question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.assignment-question {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 12px;
  display: grid;
  gap: 5px;
  text-align: left;
  min-height: 132px;
  align-content: start;
}

.assignment-question:hover,
.assignment-question.selected {
  border-color: rgba(184, 148, 77, 0.7);
  background: #fff8e9;
}

.assignment-question strong,
.assignment-question span,
.assignment-question small {
  overflow-wrap: anywhere;
}

.assignment-question small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.assignment-check {
  justify-self: start;
  border: 1px solid rgba(184, 148, 77, 0.32);
  border-radius: 999px;
  color: var(--deep);
  background: #fbf7ef;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 850;
}

.assignment-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr) minmax(140px, 0.7fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.topic-assignment-grid,
.admin-question-list,
.request-list {
  display: grid;
  gap: 10px;
}

.topic-assignment-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-height: 360px;
  overflow: auto;
}

.assignment-question.compact {
  min-height: 104px;
}

.admin-question-browser {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.section-heading.compact {
  margin-bottom: 0;
}

.admin-question-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 11px;
}

.admin-question-row > div {
  display: grid;
  gap: 5px;
}

.admin-question-row small,
.request-card small {
  color: var(--muted);
}

.question-order {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--deep);
  color: #fff;
  font-weight: 850;
}

.completion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.completion-tag {
  border-radius: 999px;
  background: #e7f5ed;
  color: var(--success);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

.request-management {
  gap: 14px;
}

.request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 13px;
}

.request-card > div:first-child {
  display: grid;
  gap: 4px;
}

.request-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.danger-note {
  grid-column: 1 / -1;
  color: var(--danger);
}

.completion-note {
  border: 1px solid rgba(46, 125, 75, 0.22);
  border-radius: 9px;
  background: #e7f5ed;
  color: var(--success);
  margin: 0;
  padding: 10px 12px;
  font-weight: 800;
}

.dump-textarea {
  min-height: 330px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
}

.dump-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dump-filters {
  flex: 1 1 520px;
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(100px, 0.8fr) minmax(130px, 0.9fr) minmax(80px, 0.5fr);
  gap: 8px;
}

.dump-results {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.dump-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.dump-preview > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dump-preview.error {
  border-color: rgba(185, 28, 28, 0.22);
  background: #fff7f5;
  grid-template-columns: 1fr;
}

.dump-preview.error span {
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 720;
}

.dump-preview-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.skeleton-block {
  position: relative;
  overflow: hidden;
  min-height: 110px;
  background: #f1ece3;
}

.skeleton-block.tall {
  min-height: 220px;
}

.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.68), transparent);
  animation: skeleton-sweep 1.35s infinite;
}

@keyframes skeleton-sweep {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .auth-screen {
    background: #f8f6f0;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-side {
    min-height: 280px;
  }

  .auth-side h1 {
    margin-top: 52px;
  }

  .portal-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: 0;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split,
  .homework-layout,
  .class-hero,
  .class-dashboard-grid,
  .spaced-admin,
  .review-layout,
  .confidence-panel,
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .drawer,
  .homework-list,
  .queue-panel {
    position: static;
  }

  .homework-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-row,
  .demo-role-grid,
  .stat-grid,
  .topic-detail-grid,
  .topic-confidence-row,
  .assignment-form,
  .request-card,
  .dump-filters,
  .traffic-buttons {
    grid-template-columns: 1fr;
  }

  .learning-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .confidence-selector {
    min-width: 0;
  }

  .calendar-weekdays,
  .calendar-days {
    min-width: 680px;
  }

  .calendar-day {
    min-height: 104px;
  }
}

@media (max-width: 560px) {
  .auth-screen,
  .content {
    padding: 14px;
  }

  .auth-card {
    max-width: none;
    width: 100%;
    padding: 24px;
  }

  .auth-shell {
    border-radius: var(--radius-md);
  }

  .auth-side {
    min-height: 230px;
    padding: 24px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .sidebar {
    padding: 14px;
    gap: 12px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button,
  .nav-button {
    width: 100%;
  }

  .portal-shell {
    background: #f8f6f0;
  }

  .topbar .pill {
    display: none;
  }

  .calendar-heading,
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-controls,
  .review-heading-actions {
    justify-content: flex-start;
  }

  .calendar-controls .button {
    width: auto;
  }

  .calendar-controls .icon-button {
    width: 38px;
    min-width: 38px;
  }

  .fullscreen-review-backdrop {
    padding: 8px;
  }

  .fullscreen-review-shell {
    max-height: 96vh;
    border-radius: 14px;
  }

  .fullscreen-review-nav {
    grid-template-columns: 1fr;
  }

  .question-dots {
    justify-content: flex-start;
  }

  .topic-summary,
  .subtopic-summary {
    grid-template-columns: 1fr;
  }

  .learning-dashboard {
    gap: 14px;
  }

  .learning-hero,
  .surface-card {
    border-radius: 16px;
  }

  .review-card,
  .topic-summary,
  .subtopic-summary,
  .dump-preview,
  .admin-question-row,
  .request-card {
    grid-template-columns: 1fr;
  }

  .request-card-actions {
    justify-content: flex-start;
  }

  .review-button {
    width: 100%;
  }

  .topic-summary-meta,
  .subtopic-meta,
  .dump-preview-meta {
    justify-content: flex-start;
  }

  .confidence-selector {
    border-radius: 16px;
    grid-template-columns: 1fr;
  }

  .confidence-option {
    justify-content: flex-start;
  }
}
