* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #1f2937;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 800;
}

.topbar nav {
  display: flex;
  gap: 10px;
  font-size: 14px;
}

.container {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.card.narrow {
  max-width: 420px;
  margin: 40px auto;
}

h1 {
  margin: 0 0 10px;
  font-size: 26px;
}

h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

h3 {
  margin: 0 0 6px;
}

p {
  line-height: 1.5;
}

.muted {
  color: #6b7280;
  font-size: 14px;
}

label {
  display: block;
  font-weight: 700;
  margin: 14px 0 6px;
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
}

textarea {
  font-family: Consolas, monospace;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #111827;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
}

.btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.btn.small {
  padding: 6px 10px;
  min-height: 32px;
  font-size: 13px;
}

.btn.full {
  width: 100%;
  margin-top: 18px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.space-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.alert {
  padding: 12px;
  border-radius: 10px;
  margin: 12px 0;
  font-weight: 700;
}

.alert.info {
  background: #eff6ff;
  color: #1d4ed8;
}

.alert.warn {
  background: #fffbeb;
  color: #92400e;
}

.alert.error {
  background: #fef2f2;
  color: #b91c1c;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e5e7eb;
  color: #374151;
}

.badge.done {
  background: #dcfce7;
  color: #166534;
}

.badge.warn {
  background: #fef3c7;
  color: #92400e;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.question-list {
  display: grid;
  gap: 10px;
}

.question-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}

.question-no {
  font-weight: 900;
  font-size: 18px;
}

.choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.choice {
  margin: 0;
  cursor: pointer;
}

.choice input {
  display: none;
}

.choice span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  font-weight: 900;
  background: white;
}

.choice input:checked + span {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.teacher-check {
  display: inline-flex;
  background: #f3f4f6;
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 800;
  color: #4b5563;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 26px;
}

.stat span {
  color: #6b7280;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px;
  text-align: center;
  font-size: 14px;
}

th {
  background: #f9fafb;
  font-weight: 900;
}

.assignment-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  padding: 9px 12px;
  background: #f3f4f6;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-weight: 700;
}

.tab.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.wrong-list {
  font-size: 20px;
  font-weight: 900;
  color: #b91c1c;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .container {
    padding: 12px;
  }

  .card {
    padding: 16px;
  }

  .list-item {
    flex-direction: column;
  }

  .question-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .space-between {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 23px;
  }
}
/* =========================
   Mobile compact override
   ========================= */

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .topbar {
    padding: 10px 12px;
    gap: 6px;
  }

  .brand {
    font-size: 15px;
  }

  .topbar nav {
    gap: 8px;
    font-size: 12px;
  }

  .container {
    padding: 10px;
  }

  .card {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
  }

  h1 {
    font-size: 16px;
    margin-bottom: 6px;
  }

  h2 {
    font-size: 15px;
    margin-bottom: 8px;
  }

  h3 {
    font-size: 14px;
    margin-bottom: 4px;
  }

  p {
    font-size: 13px;
    margin: 6px 0;
    line-height: 1.4;
  }

  .muted {
    font-size: 12px;
  }

  label {
    font-size: 13px;
    margin: 10px 0 5px;
  }

  input[type="text"],
  input[type="date"],
  textarea {
    font-size: 14px;
    padding: 9px;
    border-radius: 8px;
  }

  .btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 8px;
  }

  .btn.small {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .btn.full {
    margin-top: 12px;
  }

  .alert {
    padding: 9px;
    font-size: 13px;
    margin: 8px 0;
    border-radius: 8px;
  }

  .badge {
    padding: 3px 7px;
    font-size: 11px;
  }

  .list-item {
    padding: 11px;
    border-radius: 10px;
    gap: 8px;
  }

  .question-list {
    gap: 7px;
  }

  .question-row {
    grid-template-columns: 44px 1fr;
    padding: 8px;
    gap: 8px;
    border-radius: 9px;
  }

  .question-no {
    font-size: 14px;
  }

  .choices {
    gap: 5px;
  }

  .choice span {
    width: 31px;
    height: 31px;
    font-size: 13px;
    font-weight: 800;
  }

  .teacher-check {
    padding: 6px 9px;
    font-size: 12px;
    border-radius: 8px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }

  .stat {
    padding: 9px;
    border-radius: 9px;
  }

  .stat strong {
    font-size: 18px;
  }

  .stat span {
    font-size: 11px;
  }

  table {
    min-width: 720px;
  }

  th,
  td {
    padding: 7px;
    font-size: 12px;
  }

  .tab {
    padding: 7px 9px;
    font-size: 12px;
  }

  .wrong-list {
    font-size: 15px;
  }
}
.select-box {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  background: white;
}

@media (max-width: 720px) {
  .select-box {
    font-size: 14px;
    padding: 9px;
    border-radius: 8px;
  }
}
.code-example {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  font-family: Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
}

@media (max-width: 720px) {
  .code-example {
    font-size: 12px;
    padding: 9px;
  }
}
/* =========================
   Student benchmark style v0.3
   ========================= */

.student-shell {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  margin: -20px -20px 0;
  padding: 22px 20px 0;
}

.student-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 22px;
}

.student-top.compact {
  align-items: center;
  justify-content: flex-start;
}

.student-top h1 {
  margin: 8px 0 4px;
  font-size: 24px;
}

.student-top p {
  margin: 0;
  color: #6b7280;
}

.mini-logo {
  font-weight: 900;
  color: #2563eb;
  font-size: 13px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  background: white;
  font-weight: 900;
}

.student-tabs {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  font-size: 17px;
  font-weight: 900;
  color: #6b7280;
  overflow-x: auto;
}

.student-tabs a,
.student-tabs span {
  white-space: nowrap;
  padding-bottom: 8px;
}

.student-tabs .active {
  color: #2563eb;
  border-bottom: 4px solid #2563eb;
}

.student-section {
  padding: 18px 0 0;
}

.student-section h2 {
  font-size: 21px;
  margin: 0 0 14px;
}

.info-dot {
  display: inline-flex;
  width: 22px;
  height: 22px;
  background: #c7c7c7;
  color: white;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  vertical-align: middle;
}

.summary-card {
  background: white;
  border-radius: 20px;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.summary-col {
  text-align: center;
}

.summary-col span {
  display: block;
  color: #6b7280;
  font-size: 17px;
  margin-bottom: 4px;
}

.summary-col strong {
  font-size: 52px;
  line-height: 1;
}

.summary-col em {
  font-style: normal;
  font-size: 20px;
  margin-left: 4px;
}

.summary-divider {
  height: 70px;
  background: #e5e7eb;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.mini-stat-grid div {
  background: white;
  border-radius: 16px;
  padding: 16px 10px;
  text-align: center;
}

.mini-stat-grid strong {
  display: block;
  font-size: 26px;
}

.mini-stat-grid span {
  color: #6b7280;
  font-size: 13px;
}

.category-row {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 20px;
  font-weight: 900;
  color: #777;
  margin-bottom: 16px;
  overflow-x: auto;
}

.category-row.large {
  font-size: 24px;
}

.category-row .active,
.category-row.active,
.category-row span.active {
  color: #2563eb;
}

.student-card-list,
.book-card-list {
  display: grid;
  gap: 14px;
}

.homework-card,
.page-homework-card {
  background: white;
  border-radius: 18px;
  padding: 18px;
  display: block;
  box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.homework-card h3,
.page-homework-card h3 {
  font-size: 21px;
  margin: 14px 0 6px;
}

.homework-card p,
.page-homework-card p {
  color: #374151;
  margin: 6px 0;
}

.homework-card-head,
.page-card-top {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.blue-label {
  color: #2563eb;
  font-weight: 900;
}

.pill {
  display: inline-flex;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.pill.done {
  color: #166534;
  background: #dcfce7;
}

.pill.warn {
  color: #92400e;
  background: #fef3c7;
}

.homework-meta,
.page-card-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #6b7280;
  font-weight: 800;
  margin-top: 12px;
}

.empty-card {
  background: white;
  border-radius: 16px;
  padding: 22px;
  color: #6b7280;
  text-align: center;
}

.book-card {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 128px 1fr;
  min-height: 128px;
}

.book-cover {
  background: #d9ff78;
  color: #65a30d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  font-weight: 900;
}

.book-info {
  padding: 16px;
}

.book-small {
  display: flex;
  gap: 12px;
  color: #6b7280;
  font-weight: 800;
  margin-bottom: 10px;
}

.book-info h3 {
  margin: 0 0 18px;
  font-size: 20px;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.progress-bar {
  height: 11px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.filter-box {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  min-width: 140px;
  padding: 12px 16px;
  font-size: 18px;
}

.filter-icon {
  background: white;
  color: #2563eb;
  border-radius: 14px;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* Solve screen */

.solve-header {
  background: white;
  margin: -20px -20px 0;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

.back-link {
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  color: #6b7280;
}

.solve-header h1 {
  font-size: 22px;
  text-align: center;
  margin: 0;
}

.solve-header p {
  text-align: center;
  margin: 2px 0 0;
  color: #9ca3af;
  font-size: 13px;
}

.solve-notice {
  margin: 0 -20px 16px;
  padding: 14px 20px;
  background: #f3f4f6;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

.solve-summary-card,
.result-main-card {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.solve-summary-card {
  padding: 22px 16px;
}

.solve-summary-card p {
  color: #6b7280;
  margin: 0 0 8px;
}

.solve-summary-card h2 {
  font-size: 21px;
  margin: 0 0 18px;
}

.solve-summary-card h2 strong {
  color: #2563eb;
}

.solve-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.solve-mini-stats div {
  background: #f9fafb;
  border-radius: 14px;
  padding: 12px 6px;
}

.solve-mini-stats span {
  display: block;
  color: #6b7280;
  font-size: 12px;
}

.solve-mini-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.solve-question-list {
  display: grid;
  gap: 12px;
  padding-bottom: 90px;
}

.solve-question-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.solve-question-title {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.solve-question-title strong {
  font-size: 18px;
  color: #4b5563;
}

.solve-choices {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 14px;
}

.solve-choice {
  margin: 0;
}

.solve-choice input {
  display: none;
}

.solve-choice span {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 40px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  color: #555;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}

.solve-choice.unsure span {
  font-size: 12px;
}

.solve-choice input:checked + span {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.teacher-check-wide {
  margin: 14px;
  padding: 14px;
  background: #f3f4f6;
  border-radius: 12px;
  color: #6b7280;
  text-align: center;
  font-weight: 900;
}

.solve-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(245,246,248,0.96);
  border-top: 1px solid #e5e7eb;
  padding: 12px;
  display: grid;
  grid-template-columns: 0.9fr 2.2fr;
  gap: 10px;
  z-index: 50;
}

.clear-btn {
  color: #ef4444;
  background: white;
}

.submit-btn {
  font-size: 16px;
}

/* Result screen */

.result-main-card p {
  color: #6b7280;
  margin: 0;
  padding-top: 26px;
}

.result-main-card h2 {
  padding: 10px 18px 24px;
  margin: 0;
  font-size: 22px;
}

.result-main-card h2 strong {
  color: #2563eb;
}

.result-score-band {
  background: #eef2ff;
  padding: 18px;
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
}

.result-score-band span {
  color: #6b7280;
}

.result-score-band strong {
  font-size: 24px;
}

.result-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 18px;
}

.result-stat-row div {
  background: #f9fafb;
  border-radius: 14px;
  padding: 14px 6px;
}

.result-stat-row span {
  display: block;
  color: #6b7280;
  font-size: 12px;
}

.result-stat-row strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.result-stat-row .wrong {
  color: #fb7185;
}

.result-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.result-list h2 {
  font-size: 18px;
  margin: 8px 0 0;
}

.result-question-card {
  background: white;
  border-radius: 16px;
  display: grid;
  grid-template-columns: 90px 1fr;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.result-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  text-align: center;
}

.result-question-card.wrong .result-mark {
  background: #ffe4e6;
  color: #fb7185;
}

.result-question-card.correct .result-mark {
  background: #e0f2fe;
  color: #0ea5e9;
}

.result-question-card.unsure .result-mark {
  background: #ffedd5;
  color: #fb923c;
}

.result-content {
  padding: 18px;
}

.result-content p {
  color: #9ca3af;
  margin: 0 0 12px;
}

.result-content strong {
  color: #4b5563;
}

@media (max-width: 720px) {
  .student-shell {
    margin: -10px -10px 0;
    padding: 16px 10px 0;
  }

  .student-top {
    padding-bottom: 16px;
  }

  .student-top h1 {
    font-size: 18px;
  }

  .student-top p {
    font-size: 12px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .student-tabs {
    gap: 22px;
    font-size: 15px;
    justify-content: flex-start;
  }

  .student-section {
    padding-top: 15px;
  }

  .student-section h2 {
    font-size: 17px;
  }

  .summary-card {
    padding: 18px 14px;
    border-radius: 17px;
  }

  .summary-col span {
    font-size: 14px;
  }

  .summary-col strong {
    font-size: 42px;
  }

  .category-row {
    font-size: 17px;
  }

  .category-row.large {
    font-size: 21px;
  }

  .book-card {
    grid-template-columns: 96px 1fr;
    min-height: 112px;
  }

  .book-cover {
    font-size: 18px;
  }

  .book-info {
    padding: 13px;
  }

  .book-info h3 {
    font-size: 17px;
  }

  .homework-card,
  .page-homework-card {
    padding: 15px;
    border-radius: 16px;
  }

  .homework-card h3,
  .page-homework-card h3 {
    font-size: 18px;
  }

  .solve-header {
    margin: -10px -10px 0;
    padding: 11px 10px;
  }

  .solve-header h1 {
    font-size: 18px;
  }

  .solve-notice {
    margin: 0 -10px 12px;
    padding: 11px 10px;
    font-size: 13px;
  }

  .solve-summary-card h2 {
    font-size: 18px;
  }

  .solve-choices {
    gap: 7px;
    padding: 12px;
  }

  .solve-choice span {
    min-height: 34px;
    font-size: 14px;
  }

  .solve-choice.unsure span {
    font-size: 11px;
  }

  .solve-bottom-bar {
    padding: 10px;
  }

  .result-main-card h2 {
    font-size: 19px;
  }

  .result-question-card {
    grid-template-columns: 74px 1fr;
  }
}
/* =========================
   Student compact solve override
   ========================= */

.simple-tabs {
  justify-content: flex-start;
  gap: 42px;
}

.solve-question-card {
  border-radius: 13px;
}

.solve-question-title {
  padding: 11px 12px;
}

.solve-question-title strong {
  font-size: 15px;
}

.solve-choices {
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 10px 12px;
}

.solve-choice span {
  min-height: 34px;
  width: 34px;
  height: 34px;
  aspect-ratio: auto;
  margin: 0 auto;
  font-size: 15px;
}

.solve-choice.unsure span {
  width: 42px;
  height: 34px;
  border-radius: 999px;
  font-size: 12px;
}

.solve-question-list {
  gap: 9px;
}

.solve-summary-card {
  padding: 18px 14px;
  border-radius: 15px;
}

.solve-summary-card h2 {
  font-size: 18px;
}

.solve-mini-stats div {
  padding: 9px 5px;
}

.solve-mini-stats strong {
  font-size: 16px;
}

@media (max-width: 720px) {
  .simple-tabs {
    gap: 38px;
  }

  .solve-question-title {
    padding: 10px;
  }

  .solve-question-title strong {
    font-size: 14px;
  }

  .solve-choices {
    gap: 5px;
    padding: 9px 10px;
  }

  .solve-choice span {
    width: 31px;
    height: 31px;
    min-height: 31px;
    font-size: 14px;
  }

  .solve-choice.unsure span {
    width: 40px;
    height: 31px;
    min-height: 31px;
    font-size: 11px;
  }

  .solve-question-card {
    border-radius: 12px;
  }

  .solve-question-list {
    gap: 8px;
  }
}
.button-row.no-margin {
  margin-top: 0;
}
.policy-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  margin: 14px 0;
}

.policy-box h2 {
  font-size: 16px;
  margin: 0 0 8px;
}

.policy-box ul {
  margin: 0;
  padding-left: 18px;
}

.policy-box li {
  margin: 6px 0;
  line-height: 1.45;
  color: #4b5563;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-weight: 800;
}

.inline-check input {
  width: 18px;
  height: 18px;
}

.danger-check {
  color: #b91c1c;
}

.danger-zone {
  border-color: #fecaca;
}

.danger-btn {
  color: #b91c1c;
  background: #fff;
  border-color: #fecaca;
}

@media (max-width: 720px) {
  .policy-box {
    padding: 11px;
    border-radius: 10px;
  }

  .policy-box h2 {
    font-size: 14px;
  }

  .policy-box li {
    font-size: 12px;
  }

  .inline-check {
    font-size: 12px;
    align-items: flex-start;
  }
}
/* =========================
   Teacher dashboard v0.4-1
   ========================= */

.dashboard-hero h1 {
  margin-bottom: 8px;
}

.dashboard-section-head {
  margin-bottom: 12px;
}

.dashboard-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.dashboard-filter-grid label {
  margin-top: 0;
}

.dashboard-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.assignment-card-list {
  display: grid;
  gap: 10px;
}

.assignment-card {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 14px;
  align-items: center;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  transition: 0.15s ease;
}

.assignment-card:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.assignment-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.assignment-card-main {
  display: grid;
  gap: 4px;
}

.assignment-card-main strong {
  font-size: 16px;
  color: #111827;
}

.assignment-card-main span {
  color: #6b7280;
  font-size: 13px;
}

.assignment-card-meta {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.assignment-card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
}

.assignment-card.active .assignment-card-meta span {
  background: #dbeafe;
  color: #1d4ed8;
}

.selected-assignment-card {
  border-color: #bfdbfe;
}

.selected-label {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.selected-assignment-top h2 {
  margin-bottom: 8px;
}

.selected-assignment-top p {
  margin: 4px 0;
}

.edit-assignment-btn {
  min-width: 120px;
}

.dashboard-summary-grid {
  margin-bottom: 16px;
}

.dashboard-summary-grid .stat {
  background: white;
}

.action-guide-card h2 {
  margin-bottom: 12px;
}

.action-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.action-guide-grid div {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 13px;
  background: #f9fafb;
}

.action-guide-grid p {
  margin: 8px 0 0;
  color: #4b5563;
  font-size: 13px;
}

.badge.neutral {
  background: #e5e7eb;
  color: #374151;
}

.student-status-row.not_submitted {
  background: #fafafa;
}

.student-status-row.in_progress {
  background: #fffbeb;
}

.student-status-row.completed {
  background: #f0fdf4;
}

.student-name-cell {
  font-weight: 900;
}

.teacher-student-card-list {
  display: none;
}

.teacher-dashboard-table table {
  min-width: 980px;
}

.teacher-dashboard-table th,
.teacher-dashboard-table td {
  vertical-align: middle;
}

@media (max-width: 720px) {
  .dashboard-filter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dashboard-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .assignment-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
  }

  .assignment-card-main strong {
    font-size: 14px;
  }

  .assignment-card-main span {
    font-size: 12px;
  }

  .assignment-card-meta {
    justify-content: flex-start;
    gap: 6px;
  }

  .assignment-card-meta span {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .selected-assignment-top {
    gap: 12px;
  }

  .edit-assignment-btn {
    width: 100%;
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-summary-grid .stat:last-child {
    grid-column: 1 / -1;
  }

  .action-guide-grid {
    grid-template-columns: 1fr;
  }

  .teacher-dashboard-table {
    display: none;
  }

  .teacher-student-card-list {
    display: grid;
    gap: 10px;
  }

  .teacher-student-card {
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    padding: 12px;
    background: white;
  }

  .teacher-student-card.not_submitted {
    background: #fafafa;
  }

  .teacher-student-card.in_progress {
    background: #fffbeb;
    border-color: #fde68a;
  }

  .teacher-student-card.completed {
    background: #f0fdf4;
    border-color: #bbf7d0;
  }

  .teacher-student-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
  }

  .teacher-student-card-top strong {
    font-size: 15px;
  }

  .teacher-student-card-top p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 12px;
  }

  .teacher-student-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .teacher-student-meta div {
    background: rgba(255,255,255,0.7);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px;
  }

  .teacher-student-meta span {
    display: block;
    color: #6b7280;
    font-size: 11px;
    margin-bottom: 4px;
  }

  .teacher-student-meta strong {
    display: block;
    font-size: 13px;
  }
}
/* =========================
   Assignment answer parser v0.4-2
   ========================= */

.compact-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.compact-list li {
  margin: 4px 0;
  line-height: 1.4;
}

.answer-preview-box {
  margin-top: 16px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 14px;
  padding: 16px;
}

.answer-preview-box h2 {
  margin-bottom: 0;
}

.preview-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 14px 0;
}

.preview-summary-grid div {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.preview-summary-grid span {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin-bottom: 5px;
}

.preview-summary-grid strong {
  font-size: 20px;
}

.preview-message {
  border-radius: 10px;
  padding: 11px 12px;
  margin: 10px 0;
  font-size: 13px;
}

.preview-message ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.preview-message li {
  margin: 4px 0;
}

.preview-message.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.preview-message.warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.preview-normalized {
  min-height: 80px;
  max-height: 220px;
  overflow: auto;
  background: white;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.example-grid h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

@media (max-width: 720px) {
  .answer-preview-box {
    padding: 12px;
    border-radius: 12px;
  }

  .preview-summary-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .preview-summary-grid div {
    padding: 9px;
  }

  .preview-summary-grid strong {
    font-size: 17px;
  }

  .example-grid {
    grid-template-columns: 1fr;
  }
}
/* =========================
   Assignment copy v0.4-4-1
   ========================= */

.selected-assignment-buttons {
  justify-content: flex-end;
  align-items: center;
}

@media (max-width: 720px) {
  .selected-assignment-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .selected-assignment-buttons .btn {
    width: 100%;
  }
}
/* =========================
   Submission timeline v0.4-4-2
   ========================= */

.attempt-timeline {
  display: grid;
  gap: 12px;
}

.attempt-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
}

.attempt-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.attempt-card-head strong {
  font-size: 17px;
}

.attempt-card-head p {
  margin: 5px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.attempt-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.attempt-stat-grid div {
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  padding: 10px 8px;
  text-align: center;
  background: #f9fafb;
}

.attempt-stat-grid span {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.attempt-stat-grid strong {
  font-size: 18px;
}

.attempt-detail-list {
  background: #f9fafb;
  border-radius: 11px;
  padding: 11px 13px;
}

.attempt-detail-list p {
  margin: 6px 0;
  font-size: 13px;
}

@media (max-width: 720px) {
  .attempt-card {
    padding: 12px;
    border-radius: 12px;
  }

  .attempt-card-head {
    flex-direction: column;
    gap: 8px;
  }

  .attempt-card-head strong {
    font-size: 15px;
  }

  .attempt-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }

  .attempt-stat-grid div {
    padding: 9px 6px;
  }

  .attempt-detail-list {
    padding: 9px 10px;
  }

  .attempt-detail-list p {
    font-size: 12px;
  }
}
/* =========================
   Student page status filter
   ========================= */

.student-page-filter {
  margin-bottom: 16px;
}

.filter-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: #4b5563;
}

.filter-label-row strong {
  font-size: 15px;
}

.filter-label-row span {
  font-size: 13px;
  color: #6b7280;
  font-weight: 800;
}

.student-filter-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.student-filter-tab {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px 10px;
  display: grid;
  gap: 4px;
  text-align: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.student-filter-tab span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.student-filter-tab strong {
  color: #111827;
  font-size: 18px;
}

.student-filter-tab.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.student-filter-tab.active span,
.student-filter-tab.active strong {
  color: #1d4ed8;
}

@media (max-width: 720px) {
  .student-page-filter {
    margin-bottom: 12px;
  }

  .student-filter-tabs {
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    gap: 6px;
  }

  .student-filter-tab {
    padding: 9px 6px;
    border-radius: 11px;
  }

  .student-filter-tab span {
    font-size: 11px;
  }

  .student-filter-tab strong {
    font-size: 15px;
  }
}

/* =========================
   Teacher students page
   ========================= */

.teacher-students-table table {
  min-width: 640px;
}

@media (max-width: 720px) {
  .teacher-students-table table {
    min-width: 620px;
  }
}