:root {
  --app-bg: #f4f6fb;
  --app-border: rgba(15, 23, 42, 0.08);
  --app-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

body {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

code {
  font-size: 0.9em;
}

.app-topbar {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--app-border);
}

.teacher-shell {
  width: min(100%, 1860px);
  margin-inline: auto;
  padding-inline: clamp(0.85rem, 1.6vw, 1.75rem);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #206bc4, #4f46e5);
  color: #fff;
  font-weight: 700;
  margin-right: 0.75rem;
}

.brand-copy {
  display: inline-flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--tblr-secondary);
}

.screen {
  display: none;
}

.active-screen {
  display: block;
}

.card,
.offcanvas,
.modal-content {
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
}

.boundary-alert {
  background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
  border: 1px solid rgba(249, 115, 22, 0.18);
}

.mode-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.mode-card:hover,
.mode-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(32, 107, 196, 0.35);
  box-shadow: 0 12px 30px rgba(32, 107, 196, 0.12);
}

.mode-card .form-check-input {
  margin-top: 0.25rem;
}

.exam-status-card {
  background: linear-gradient(135deg, rgba(32, 107, 196, 0.08), rgba(79, 70, 229, 0.08));
}

.timer-box {
  min-width: 12rem;
}

.timer-value {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.palette-card .card-body,
.card-sticky {
  position: sticky;
  top: 6rem;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.palette-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.25rem;
  border-radius: 0.8rem;
  border: 1px solid var(--app-border);
  background: #fff;
  font-weight: 600;
}

.palette-item.current {
  outline: 3px solid rgba(32, 107, 196, 0.28);
}

.palette-item.answered {
  background: rgba(46, 204, 113, 0.14);
  border-color: rgba(46, 204, 113, 0.3);
}

.palette-item.flagged::after {
  content: '⚑';
  position: absolute;
  top: 0.15rem;
  right: 0.25rem;
  font-size: 0.7rem;
}

.palette-item-label {
  display: block;
  font-size: 0.7rem;
  color: var(--tblr-secondary);
}

.question-card .card-header,
.question-card .card-footer {
  background: rgba(248, 250, 252, 0.72);
}

.question-body-wrap {
  display: grid;
  gap: 1rem;
}

.stimulus-panel,
.prompt-panel,
.explanation-panel {
  border-radius: 1rem;
  border: 1px solid var(--app-border);
  background: #fff;
  padding: 1rem;
}

.stimulus-panel {
  background: #f8fafc;
}

.stimulus-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.prompt-stem {
  font-size: 1rem;
  line-height: 1.7;
}

.option-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.option-card,
.matrix-row-card {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.option-card:hover,
.option-card:focus-within,
.matrix-row-card:hover,
.matrix-row-card:focus-within {
  border-color: rgba(32, 107, 196, 0.35);
  box-shadow: 0 10px 24px rgba(32, 107, 196, 0.1);
}

.option-card.selected,
.matrix-row-card.selected {
  border-color: rgba(32, 107, 196, 0.65);
  background: rgba(32, 107, 196, 0.08);
}

.option-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
}

.option-label-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
  font-weight: 700;
}

.option-card.selected .option-label-badge {
  background: #206bc4;
  color: #fff;
}

.matrix-table {
  overflow-x: auto;
}

.matrix-table table {
  min-width: 100%;
}

.fillin-input {
  max-width: 20rem;
}

.status-legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--app-border);
  font-size: 0.78rem;
}

.review-card {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  overflow: hidden;
}

.review-card summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem;
  background: #fff;
}

.review-card summary::-webkit-details-marker {
  display: none;
}

.review-card[open] summary {
  border-bottom: 1px solid var(--app-border);
}

.review-body {
  padding: 1rem;
  background: #fcfcfd;
}

.review-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.review-meta-box {
  border: 1px solid var(--app-border);
  border-radius: 0.85rem;
  padding: 0.85rem;
  background: #fff;
}

.kpi-value {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.35rem 0;
}

.teacher-chart-card .card-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.teacher-chart-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 21rem;
}

.teacher-chart-card-body-lg {
  min-height: 24rem;
}

.teacher-chart-frame {
  position: relative;
  width: 100%;
  height: 16rem;
  flex: 0 0 auto;
}

.teacher-chart-frame-lg {
  height: 19rem;
}

.teacher-chart-frame-detail {
  height: 17rem;
}

.teacher-chart-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.cohort-lead {
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.teacher-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.summary-block {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
}

.summary-title {
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.summary-subtitle {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tblr-secondary);
}

.summary-stat-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.summary-stat-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-stat-line span {
  color: var(--tblr-secondary);
}

.summary-stat-line strong {
  text-align: right;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.chip-secondary {
  background: rgba(100, 116, 139, 0.12);
  color: #334155;
  border-color: rgba(100, 116, 139, 0.15);
}

.chip-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.2);
}

.attention-item,
.timeline-item {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  background: #fff;
  padding: 0.95rem;
}

.attention-item + .attention-item,
.timeline-item + .timeline-item {
  margin-top: 0.85rem;
}

.metric-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.metric-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(32, 107, 196, 0.08);
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 600;
}

.summary-alert {
  border-radius: 0.9rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--app-border);
  background: #fff;
}

.summary-alert + .summary-alert {
  margin-top: 0.65rem;
}

.summary-alert-high {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.14);
}

.summary-alert-medium {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.16);
}

.summary-alert-low {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.14);
}

.teacher-table td,
.teacher-table th {
  vertical-align: top;
}

.teacher-row-active {
  box-shadow: inset 4px 0 0 #206bc4;
}

.review-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.mini-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tblr-secondary);
}

.detail-pulse {
  animation: detailPulse 0.7s ease;
}

@keyframes detailPulse {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

.list-compact {
  display: grid;
  gap: 0.75rem;
}

.list-compact-item {
  border: 1px solid var(--app-border);
  border-radius: 0.9rem;
  padding: 0.8rem 0.9rem;
  background: #fff;
}

.stimulus-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.stimulus-table th,
.stimulus-table td {
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.6rem 0.75rem;
  vertical-align: top;
}

.stimulus-table th {
  background: rgba(15, 23, 42, 0.04);
}

.text-pretty {
  white-space: pre-wrap;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.2), transparent 28rem),
    linear-gradient(135deg, rgba(32, 107, 196, 0.12), rgba(15, 23, 42, 0.02));
}

.landing-anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.landing-anchor-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(32, 107, 196, 0.12);
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.landing-anchor-nav a:hover,
.landing-anchor-nav a:focus-visible {
  color: #0f172a;
  border-color: rgba(32, 107, 196, 0.28);
  box-shadow: 0 12px 24px rgba(32, 107, 196, 0.1);
}

.landing-eyebrow,
.section-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0f766e;
}

.landing-title {
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 16ch;
}

.landing-lead,
.section-copy {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #475569;
}

.landing-signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.landing-signal-card {
  min-height: 100%;
  padding: 1rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(32, 107, 196, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.landing-signal-value {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.1;
  color: #0f172a;
}

.landing-signal-copy {
  margin: 0.4rem 0 0;
  color: #475569;
  line-height: 1.6;
}

.seo-section {
  scroll-margin-top: 6rem;
}

.section-title {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.seo-feature-card {
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.seo-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0ea5e9, #206bc4);
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.learning-steps {
  display: grid;
  gap: 1rem;
}

.learning-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.learning-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
}

.benefit-list {
  display: grid;
  gap: 0.85rem;
  padding-left: 1.1rem;
  color: #334155;
  line-height: 1.7;
}

.faq-list {
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: #fff;
  padding: 0.9rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: #0f172a;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 0.85rem 0 0;
  line-height: 1.75;
  color: #475569;
}

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

.cluster-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.cluster-card h3 {
  margin-bottom: 0.5rem;
}

.cluster-card p {
  margin-bottom: 0.85rem;
  color: #475569;
  line-height: 1.7;
}

.cluster-card .btn {
  margin-top: auto;
}

.hero-inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.hero-inline-links a {
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
}

.hero-inline-links a:hover,
.hero-inline-links a:focus-visible {
  color: #206bc4;
}

.breadcrumb-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  color: #64748b;
  font-size: 0.92rem;
}

.breadcrumb-inline a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb-inline a:hover,
.breadcrumb-inline a:focus-visible {
  color: #0f172a;
}

.content-prose p,
.content-prose li {
  color: #475569;
  line-height: 1.8;
}

.content-prose ul,
.content-prose ol {
  padding-left: 1.2rem;
}

.print-only {
  display: none !important;
}

@media (max-width: 1199.98px) {
  .palette-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .teacher-summary-grid {
    grid-template-columns: 1fr;
  }

  .teacher-chart-card-body,
  .teacher-chart-card-body-lg {
    min-height: 18rem;
  }

  .teacher-chart-frame,
  .teacher-chart-frame-lg,
  .teacher-chart-frame-detail {
    height: 15rem;
  }

  .landing-title {
    max-width: 100%;
  }
}

@media (max-width: 767.98px) {
  .brand-subtitle {
    display: none;
  }

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

  .question-card .card-header,
  .question-card .card-footer {
    padding: 0.9rem;
  }

  .timer-box {
    min-width: 0;
  }

  .summary-stat-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .teacher-shell {
    padding-inline: 0.85rem;
  }

  .teacher-chart-card-body,
  .teacher-chart-card-body-lg {
    min-height: 16rem;
  }

  .teacher-chart-frame,
  .teacher-chart-frame-lg,
  .teacher-chart-frame-detail {
    height: 14rem;
  }

  .landing-anchor-nav {
    gap: 0.55rem;
  }

  .landing-anchor-nav a {
    width: 100%;
    justify-content: center;
  }

  .landing-signal-grid {
    grid-template-columns: 1fr;
  }

  .learning-step {
    grid-template-columns: 1fr;
  }

  .cluster-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1399.98px) and (min-width: 768px) {
  .cluster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1600px) {
  .teacher-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .teacher-chart-card-body {
    min-height: 23rem;
  }

  .teacher-chart-card-body-lg {
    min-height: 26rem;
  }

  .teacher-chart-frame {
    height: 18rem;
  }

  .teacher-chart-frame-lg {
    height: 22rem;
  }

  .teacher-chart-frame-detail {
    height: 18.5rem;
  }
}

@media print {
  body {
    background: #fff !important;
  }

  .app-topbar,
  .btn,
  .offcanvas,
  #screen-landing,
  #screen-exam,
  #btn-download-report,
  #btn-new-session,
  #btn-reset-session {
    display: none !important;
  }

  #screen-report {
    display: block !important;
  }

  .card,
  .review-card,
  .review-meta-box,
  .list-compact-item {
    box-shadow: none !important;
    border-color: #cbd5e1 !important;
  }
}
