:root {
  --paper: #fffaf0;
  --ink: #14171f;
  --muted: #5a6170;
  --line: #e2e5ea;
  --card: #ffffff;
  --green: #08785f;
  --blue: #1663a7;
  --cyan: #14a6b8;
  --yellow: #f4c430;
  --pink: #e54d7f;
  --orange: #f27b35;
  --shadow: 0 18px 42px rgba(20, 23, 31, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px clamp(18px, 5vw, 68px);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.nav__brand img {
  width: 88px;
  height: 38px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  object-fit: contain;
  box-shadow: 0 8px 18px rgba(20, 23, 31, 0.14);
}

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

.nav__links a {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 800;
}

.home-hero,
.subject-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(8, 120, 95, 0.96), rgba(22, 99, 167, 0.88)),
    url("assets/hero-mnp.png") center / cover;
}

body[data-course="pds"] .subject-hero {
  background:
    linear-gradient(135deg, rgba(8, 120, 95, 0.94), rgba(22, 99, 167, 0.82)),
    url("assets/hero-pds.png") center / cover;
}

body[data-course="ptic-ii"] .subject-hero {
  background:
    linear-gradient(135deg, rgba(22, 99, 167, 0.96), rgba(20, 166, 184, 0.82)),
    url("assets/hero-ptic-ii.svg") center / cover;
}

.home-hero::after,
.subject-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(255, 250, 240, 0), var(--paper));
}

.home-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 430px);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: 38px clamp(18px, 5vw, 68px) 100px;
}

.home-hero__copy {
  max-width: 760px;
}

.tag {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  max-width: 12ch;
  font-size: clamp(3rem, 7vw, 6.7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.home-hero__copy p:not(.tag),
.subject-hero__copy p:not(.tag) {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.12rem;
}

.hero-actions,
.card-actions,
.lesson-actions,
.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.btn--main {
  background: var(--yellow);
  color: #1d2430;
}

.btn--dark {
  background: var(--ink);
  color: #fff;
}

.btn--light {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn--outline {
  border-color: #b9c6d8;
  background: #fff;
  color: #263241;
}

.lesson-actions .btn--outline,
.viewer-actions .btn--outline {
  border-color: rgba(22, 99, 167, 0.38);
  background: linear-gradient(180deg, #ffffff, #eaf4ff);
  color: #0f4f88;
  box-shadow: 0 10px 20px rgba(22, 99, 167, 0.12);
}

.lesson-actions .btn--outline:hover,
.viewer-actions .btn--outline:hover {
  border-color: var(--blue);
  background: linear-gradient(180deg, #f8fcff, #dceeff);
  transform: translateY(-1px);
}

.teacher-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
  border: 3px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.08)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 12px, rgba(255, 255, 255, 0.05) 12px 24px);
  box-shadow: var(--shadow);
}

.teacher-card img {
  width: min(92%, 410px);
  max-height: 470px;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.24));
}

.teacher-card__caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 8px;
  background: rgba(20, 23, 31, 0.84);
}

.teacher-card__caption span {
  color: rgba(255, 255, 255, 0.76);
}

.section {
  padding: 72px clamp(18px, 5vw, 68px);
}

.section-title {
  max-width: 780px;
  margin-bottom: 26px;
}

.section-title .tag,
.viewer-head .tag,
.lesson-card .tag {
  color: var(--blue);
}

.section-title p:not(.tag) {
  color: var(--muted);
}

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

.course-card,
.lesson-card,
.viewer-shell,
.quiz-panel,
.presence-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.course-card {
  display: grid;
  gap: 16px;
  min-height: 270px;
  padding: 22px;
}

.course-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.course-code {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e9f7f4;
  color: var(--green);
  font-weight: 950;
}

.course-card__meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: 96px;
}

.course-card__meter span {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
}

.course-card__meter span:nth-child(1) {
  background: var(--cyan);
}

.course-card__meter span:nth-child(2) {
  background: var(--yellow);
}

.course-card__meter span:nth-child(3) {
  background: var(--pink);
}

.course-card__meter span:nth-child(4) {
  background: var(--orange);
}

.course-card p,
.lesson-card p {
  color: var(--muted);
}

.strip {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: center;
  padding: 54px clamp(18px, 5vw, 68px);
  background: #14171f;
  color: #fff;
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.flow span {
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.subject-hero {
  min-height: 430px;
}

.subject-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: center;
  padding: 34px clamp(18px, 5vw, 68px) 86px;
}

.subject-hero__copy h1 {
  max-width: 14ch;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
}

.subject-avatar {
  width: min(100%, 240px);
  max-height: 270px;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.25));
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 0 clamp(18px, 5vw, 68px) 72px;
}

.class-method {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1.38fr);
  gap: 24px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.class-method p:not(.tag) {
  color: var(--muted);
}

.method-grid {
  counter-reset: method-step;
  display: grid;
  gap: 0;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  overflow: hidden;
}

.method-grid span {
  counter-increment: method-step;
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  border-bottom: 1px solid #dbe3ef;
  background: linear-gradient(90deg, #f7fbff, #fff);
  color: #263241;
  font-size: 0.95rem;
  font-weight: 900;
}

.method-grid span:last-child {
  border-bottom: 0;
}

.method-grid span::before {
  content: counter(method-step, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #14171f;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
}

.method-grid span:nth-child(1)::before {
  background: var(--green);
}

.method-grid span:nth-child(2)::before {
  background: var(--blue);
}

.method-grid span:nth-child(3)::before {
  background: var(--cyan);
}

.method-grid span:nth-child(4)::before {
  background: var(--pink);
}

.method-grid span:nth-child(5)::before {
  background: var(--orange);
}

.presence-checker {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid #cbd6e5;
  border-left: 6px solid var(--green);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.presence-checker p:not(.tag) {
  color: var(--muted);
}

.presence-checker__form {
  display: grid;
  gap: 8px;
}

.presence-checker__form label {
  font-weight: 900;
}

.presence-checker__form div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.presence-checker__form input {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.presence-checker__form p {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.student-login-page {
  padding: 26px clamp(18px, 5vw, 68px) 72px;
}

.student-login-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.72fr);
  gap: 28px;
  align-items: start;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid #cbd6e5;
  border-left: 6px solid var(--blue);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.student-login-card p:not(.tag) {
  color: var(--muted);
}

.student-login-card h2 {
  max-width: 12ch;
}

.login-hint {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f7fbff;
}

.student-login-form,
.presence-form {
  display: grid;
  gap: 9px;
}

.student-login-form {
  align-self: start;
  padding-top: 2px;
}

.student-login-form label,
.presence-form label {
  font-weight: 900;
}

.student-login-form input,
.presence-form input {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
}

.password-toggle {
  min-height: 44px;
  border: 1px solid #b9c6d8;
  border-radius: 8px;
  background: #f7fbff;
  color: #263241;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
}

.student-login-form p,
.presence-message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.student-session-card {
  display: grid;
  gap: 3px;
  padding: 13px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #f7fbff;
  color: #263241;
}

.student-session-card .tag {
  margin: 0;
}

.student-session-card strong {
  font-size: 1.02rem;
}

.student-session-card span,
.student-session-card small {
  color: var(--muted);
  font-weight: 800;
}

.student-logout {
  margin-left: 8px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.student-session-card .student-logout {
  justify-self: start;
  margin: 8px 0 0;
  border-color: #cbd6e5;
  background: #111722;
  color: #fff;
}

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

.presence-checker__summary[hidden] {
  display: none;
}

.presence-metric {
  display: grid;
  gap: 8px;
  min-height: 124px;
  padding: 14px;
  border: 1px solid;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(16, 24, 39, 0.08);
}

.presence-metric--lessons {
  border-color: #91d6c4;
  background: linear-gradient(180deg, #f3fffb, #e9f7f4);
  color: #075b49;
}

.presence-metric--assessments {
  border-color: #f0c079;
  background: linear-gradient(180deg, #fff9ed, #fff1d8);
  color: #7a4300;
}

.presence-metric__label {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.presence-metric strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #101827;
  font-size: 2.3rem;
  line-height: 1;
}

.presence-metric small {
  color: currentColor;
  font-size: 0.92rem;
  font-weight: 950;
}

.presence-metric__bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 24, 39, 0.12);
}

.presence-metric__bar span {
  display: block;
  width: var(--metric-percent);
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.presence-metric__foot {
  color: currentColor;
  font-size: 0.9rem;
  font-weight: 950;
}

#lessonList {
  display: grid;
  gap: 14px;
}

.lesson-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border-left: 6px solid #91d6c4;
}

.assessment-section-title {
  margin-top: 28px;
}

.assessment-card {
  border-color: #f0c079;
  background:
    linear-gradient(90deg, rgba(242, 123, 53, 0.12), rgba(255, 255, 255, 0) 42%),
    #fffaf1;
}

.assessment-card .tag {
  color: #7a4300;
}

.lesson-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attendance-status {
  display: grid;
  gap: 2px;
  width: fit-content;
  margin: 12px 0;
  padding: 9px 12px;
  border: 1px solid;
  border-radius: 8px;
  font-weight: 900;
}

.attendance-status strong {
  font-size: 0.95rem;
}

.attendance-status span {
  font-size: 0.82rem;
  font-weight: 800;
}

.attendance-status.is-computed {
  border-color: #91d6c4;
  background: #e9f7f4;
  color: #075b49;
}

.attendance-status.is-missing {
  border-color: #f2d38a;
  background: #fff7df;
  color: #6a4b00;
}

.lesson-deadline,
.presence-deadline {
  display: grid;
  gap: 2px;
  width: fit-content;
  margin: 10px 0 12px;
  padding: 9px 12px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #f7fbff;
  color: #263241;
  font-weight: 900;
}

.lesson-deadline span,
.presence-deadline span {
  color: var(--blue);
}

.lesson-deadline small,
.presence-deadline small {
  color: var(--muted);
  font-weight: 800;
}

.lesson-deadline.is-closed {
  border-color: #f0b7ae;
  background: #fff0ed;
  color: #7a2418;
}

.lesson-deadline.is-open {
  border-color: #91d6c4;
  background: #e9f7f4;
  color: #075b49;
}

.lesson-badges span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f1f4f8;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.classroom {
  min-height: 100vh;
  background: #f4f7fb;
}

.classroom .nav,
.assessment-top .nav {
  background: #14171f;
  color: #fff;
}

.assessment-page {
  display: grid;
  gap: 18px;
  padding: 26px clamp(18px, 4vw, 48px) 56px;
  background: #f4f7fb;
}

.assessment-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.assessment-head h1 {
  max-width: 18ch;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.assessment-head p:not(.tag) {
  max-width: 780px;
  color: var(--muted);
}

.assessment-rules,
.assessment-login,
.assessment-form,
.assessment-result {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.assessment-rules {
  display: grid;
  grid-template-columns: minmax(260px, 0.68fr) minmax(0, 1.32fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  border-left: 6px solid var(--orange);
}

.assessment-rules p:not(.tag) {
  color: var(--muted);
  font-weight: 800;
}

.assessment-rule-list {
  counter-reset: assessment-rule;
  display: grid;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
}

.assessment-rule-list span {
  counter-increment: assessment-rule;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 11px 14px;
  border-bottom: 1px solid #dbe3ef;
  background: linear-gradient(90deg, #fff7df, #fff);
  color: #263241;
  font-weight: 900;
}

.assessment-rule-list span:last-child {
  border-bottom: 0;
}

.assessment-rule-list span::before {
  content: counter(assessment-rule, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
}

.assessment-login {
  padding: 20px;
}

.assessment-login form,
.assessment-form {
  display: grid;
  gap: 12px;
}

.assessment-login label,
.assessment-form label {
  font-weight: 900;
}

.assessment-login input {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.assessment-login p,
.assessment-form p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.assessment-form {
  padding: 20px;
}

.assessment-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #f7fbff;
  color: #263241;
  font-weight: 900;
}

#assessmentQuestions {
  display: grid;
  gap: 14px;
}

.assessment-question {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fff;
}

.assessment-question.is-missing {
  border-color: #f2d38a;
  background: #fff9e8;
  box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.2);
}

.assessment-question.is-correct {
  border-color: #91d6c4;
  background: #f3fbf8;
}

.assessment-question.is-wrong {
  border-color: #f0b7ae;
  background: #fff5f2;
}

.assessment-question legend {
  padding: 0 4px;
  color: #263241;
  font-weight: 950;
}

.assessment-question label,
.assessment-confirm {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #263241;
  font-weight: 800;
}

.assessment-question label.is-selected {
  border-color: var(--blue);
  background: #eaf4ff;
  color: #103f6d;
  box-shadow: inset 4px 0 0 var(--blue);
}

.assessment-question label.is-correct-option {
  border-color: #72c7ad;
  background: #e9f7f4;
  color: #075b49;
  box-shadow: inset 4px 0 0 var(--green);
}

.assessment-question label.is-wrong-option {
  border-color: #f0b7ae;
  background: #fff0ed;
  color: #7a2418;
  box-shadow: inset 4px 0 0 #d24632;
}

.assessment-question input,
.assessment-confirm input {
  margin-top: 4px;
}

.assessment-confirm {
  border-color: #f2d38a;
  background: #fff7df;
}

.assessment-question-result {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #14171f;
  color: #fff;
  font-weight: 900;
}

.assessment-result {
  padding: 24px;
  border-left: 6px solid var(--green);
}

.assessment-result h2 {
  color: var(--green);
}

.assessment-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.assessment-score-grid span {
  min-height: 76px;
  padding: 14px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #f7fbff;
  color: #263241;
  font-weight: 900;
}

.assessment-score-grid strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.assessment-review-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.assessment-review-list span {
  padding: 10px 12px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #f7fbff;
  font-weight: 850;
}

.assessment-review-list span strong {
  display: block;
}

.assessment-review-list .is-correct {
  border-color: #91d6c4;
  background: #e9f7f4;
  color: #075b49;
}

.assessment-review-list .is-wrong {
  border-color: #f0b7ae;
  background: #fff0ed;
  color: #7a2418;
}

.admin-body {
  background: #f7f2e8;
}

.admin-top {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(20, 23, 31, 0.96), rgba(22, 99, 167, 0.82)),
    url("assets/hero-ptic-ii.svg") center / cover;
}

.admin-hero {
  padding: 34px clamp(18px, 5vw, 68px) 84px;
}

.admin-hero h1 {
  max-width: none;
  margin-bottom: 12px;
  font-size: clamp(3rem, 7vw, 5.8rem);
}

.admin-hero p:not(.tag) {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.12rem;
}

.admin-page {
  padding: 24px clamp(18px, 5vw, 68px) 72px;
}

.admin-login,
.admin-shell,
.admin-card {
  border: 1px solid #cbd6e5;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.55fr);
  gap: 24px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
  border-left: 6px solid var(--blue);
}

.admin-login form {
  display: grid;
  gap: 9px;
}

.admin-login label,
.admin-list-head label {
  font-weight: 900;
}

.admin-login input,
.admin-card input,
.admin-card select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.admin-login p:not(.tag),
.admin-card p,
.admin-muted {
  color: var(--muted);
}

.admin-shell {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-tabs .btn {
  margin-left: auto;
}

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: block;
}

.admin-panel[data-admin-panel="reports"].is-active {
  display: grid;
  gap: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-card {
  padding: 18px;
}

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

.report-header {
  display: grid;
  grid-template-columns: minmax(250px, 0.75fr) minmax(0, 1.6fr);
  gap: 18px;
  align-items: start;
  padding: 20px;
  border-bottom: 1px solid #dbe3ef;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 58%, #eef8f5 100%);
}

.report-title {
  display: grid;
  gap: 8px;
}

.report-title h2 {
  margin: 0;
  line-height: 1.04;
}

.report-title p:not(.tag) {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  font-weight: 800;
}

.report-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 10px;
  align-items: end;
}

.report-field {
  display: grid;
  gap: 5px;
  margin: 0;
  color: #263241;
  font-size: 0.82rem;
  font-weight: 900;
}

.report-field span {
  line-height: 1.1;
}

.report-field--wide {
  grid-column: span 2;
}

.report-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.report-card .admin-report-summary {
  padding: 16px 20px 12px;
}

.report-card .admin-table-wrap {
  margin: 0 20px 16px;
}

.report-card > p {
  margin: 0;
  padding: 0 20px 18px;
}

.admin-student-form {
  display: grid;
  gap: 9px;
}

.admin-student-form label,
.admin-disciplines legend {
  font-weight: 900;
}

.admin-check,
.admin-disciplines label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 900;
}

.admin-check input,
.admin-disciplines input {
  width: auto;
  min-height: auto;
}

.admin-disciplines {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
}

.admin-form-actions,
.admin-row-actions,
.admin-list-head,
#studentSearchForm {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-list-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

#studentSearchForm {
  flex: 1 1 360px;
  justify-content: flex-end;
}

#studentSearchForm input {
  max-width: 420px;
}

#studentSearchForm select {
  min-width: 170px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #dbe3ef;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #f7fbff;
  color: #263241;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.admin-table td small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.admin-badge,
.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 950;
}

.admin-badge {
  background: #eaf4ff;
  color: #0f4f88;
}

.admin-status.is-active {
  background: #e9f7f4;
  color: #075b49;
}

.admin-status.is-inactive {
  background: #eef1f5;
  color: #5a6170;
}

.mention-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.mention-mb {
  --mention-bg: #e4f8ef;
  --mention-border: #9ad8bc;
  --mention-color: #075b35;
  --mention-accent: #12965f;
}

.mention-b {
  --mention-bg: #e8f2ff;
  --mention-border: #a8cdf8;
  --mention-color: #0d4d8f;
  --mention-accent: #2277d6;
}

.mention-r {
  --mention-bg: #fff7d7;
  --mention-border: #f1d67a;
  --mention-color: #735400;
  --mention-accent: #d5a300;
}

.mention-i {
  --mention-bg: #ffe9e9;
  --mention-border: #f3aaaa;
  --mention-color: #8d1717;
  --mention-accent: #d83c3c;
}

.mention-badge.mention-mb,
.mention-badge.mention-b,
.mention-badge.mention-r,
.mention-badge.mention-i,
.assessment-score-grid span.mention-mb,
.assessment-score-grid span.mention-b,
.assessment-score-grid span.mention-r,
.assessment-score-grid span.mention-i {
  border-color: var(--mention-border);
  background: var(--mention-bg);
  color: var(--mention-color);
}

.assessment-result.mention-mb,
.assessment-result.mention-b,
.assessment-result.mention-r,
.assessment-result.mention-i {
  border-left-color: var(--mention-accent);
}

.assessment-result.mention-mb h2,
.assessment-result.mention-b h2,
.assessment-result.mention-r h2,
.assessment-result.mention-i h2,
.assessment-score-grid span.mention-mb strong,
.assessment-score-grid span.mention-b strong,
.assessment-score-grid span.mention-r strong,
.assessment-score-grid span.mention-i strong {
  color: var(--mention-color);
}

.attendance-status.mention-mb,
.attendance-status.mention-b,
.attendance-status.mention-r,
.attendance-status.mention-i {
  border-color: var(--mention-border);
  background: var(--mention-bg);
}

.attendance-status.mention-mb strong,
.attendance-status.mention-b strong,
.attendance-status.mention-r strong,
.attendance-status.mention-i strong {
  color: var(--mention-color);
}

.admin-report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.admin-report-summary > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(21, 41, 64, 0.06);
  font-weight: 900;
}

.admin-report-summary > span > strong {
  grid-row: span 2;
  font-size: 1.8rem;
  color: var(--blue);
}

.admin-report-summary small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.mention-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.mention-summary .mention-badge {
  min-height: 24px;
  padding: 4px 7px;
  font-size: 0.75rem;
}

.viewer-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 26px clamp(18px, 4vw, 48px) 48px;
}

.viewer-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.class-title-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.class-teacher-avatar {
  width: 96px;
  height: 96px;
  border: 3px solid #fff;
  border-radius: 18px;
  background: #dceaf5;
  object-fit: cover;
  object-position: top center;
  box-shadow: 0 12px 28px rgba(20, 23, 31, 0.16);
}

.viewer-head h1 {
  max-width: 22ch;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.viewer-head p:not(.tag) {
  max-width: 760px;
  color: var(--muted);
}

.viewer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.tab {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.tab.is-active {
  border-color: var(--blue);
  background: #eaf4ff;
  color: var(--blue);
}

.viewer-shell {
  grid-column: 1 / -1;
  overflow: hidden;
  min-height: 640px;
}

.viewer-frame,
.viewer-video {
  display: none;
  width: 100%;
  height: 640px;
  border: 0;
  background: #20242d;
}

.viewer-video {
  height: auto;
  min-height: 420px;
  aspect-ratio: 16 / 9;
}

.viewer-frame.is-active,
.viewer-video.is-active {
  display: block;
}

.mission-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.quiz-panel,
.presence-panel {
  padding: 18px;
}

.game-panel {
  background:
    linear-gradient(180deg, #ffffff, #eef8ff);
}

.game-instruction {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 800;
}

.game-briefing-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #bdd6e8;
  border-left: 5px solid var(--cyan);
  border-radius: 8px;
  background: #f4fbff;
  color: #263241;
  font-weight: 800;
}

.game-briefing-card img {
  width: 86px;
  height: 86px;
  border: 2px solid #fff;
  border-radius: 16px;
  background: #dceaf5;
  object-fit: cover;
  object-position: top center;
}

.game-briefing-card strong {
  display: block;
  margin-bottom: 4px;
}

.game-briefing-card p {
  margin: 0;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.game-hud span {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #14171f;
  color: #fff;
  font-weight: 950;
  text-align: center;
}

.sound-toggle {
  width: 100%;
  min-height: 38px;
  margin-bottom: 10px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #fff;
  color: #263241;
  cursor: pointer;
  font-weight: 900;
}

.sound-toggle[aria-pressed="true"] {
  border-color: var(--green);
  background: #e9f7f4;
  color: #075b49;
}

.game-progress {
  height: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe3ef;
}

.game-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--yellow), var(--pink));
  transition: width 0.2s ease;
}

.game-instructions {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #cbd6e5;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  color: #263241;
}

.game-instructions strong {
  display: block;
  margin-bottom: 6px;
}

.game-instructions ol {
  margin: 0;
  padding-left: 20px;
}

.game-instructions li {
  margin: 3px 0;
}

.mission-log {
  min-height: 40px;
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #fff;
  color: #263241;
  font-weight: 900;
}

.mission-objectives {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mission-objectives span {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #fff;
  color: #5a6170;
  font-size: 0.86rem;
  font-weight: 900;
}

.mission-objectives .is-current {
  border-color: var(--yellow);
  background: #fff4c8;
  color: #4a3900;
}

.mission-objectives .is-done {
  border-color: #91d6c4;
  background: #e9f7f4;
  color: #075b49;
}

#lessonGame {
  display: block;
  width: 100%;
  min-height: 520px;
  aspect-ratio: 56 / 31;
  border: 3px solid #14171f;
  border-radius: 10px;
  background: #101827;
  touch-action: none;
}

.game-controls {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}

.game-controls button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(20, 23, 31, 0.12);
}

.game-controls button[data-move="up"] {
  grid-column: 2;
}

.game-controls button[data-move="left"] {
  grid-column: 1;
}

.game-controls button[data-move="down"] {
  grid-column: 2;
}

.game-controls button[data-move="right"] {
  grid-column: 3;
  grid-row: 2;
}

.game-start {
  width: 100%;
}

.quiz-after {
  margin-top: 18px;
  padding: 18px;
  border: 2px solid var(--yellow);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(244, 196, 48, 0.16), rgba(255, 255, 255, 0.96)),
    #fff;
  box-shadow: 0 14px 28px rgba(20, 23, 31, 0.12);
}

.quiz-after h2 {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
}

.quiz-helper {
  margin-bottom: 14px;
  color: #6a4b00;
  font-weight: 900;
}

.quiz-question {
  margin: 0 0 12px;
  font-weight: 900;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-options button {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.quiz-options button.is-right {
  border-color: var(--green);
  background: #e9f7f4;
}

.quiz-options button.is-wrong {
  border-color: var(--pink);
  background: #fff0f5;
}

.quiz-feedback {
  min-height: 48px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.presence-panel p {
  color: var(--muted);
}

.presence-panel {
  display: grid;
  gap: 10px;
  border-left: 6px solid var(--green);
}

.presence-panel h2 {
  margin-bottom: 0;
}

.presence-form {
  display: grid;
  gap: 9px;
}

.presence-form label {
  color: var(--ink);
  font-weight: 900;
}

.presence-form input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.presence-form input:disabled {
  background: #eef1f5;
  color: #89909d;
}

.presence-panel .btn {
  width: 100%;
  margin-top: 8px;
}

.presence-message {
  min-height: 40px;
  margin-top: 10px;
  font-weight: 900;
}

.btn.is-locked {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.6);
}

.presence-panel:has(.is-locked) {
  background:
    linear-gradient(135deg, rgba(20, 23, 31, 0.04), rgba(20, 23, 31, 0)),
    var(--card);
}

@media (max-width: 980px) {
  .home-hero__grid,
  .course-grid,
  .strip,
  .viewer-page,
  .mission-zone {
    grid-template-columns: 1fr;
  }

  .viewer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .assessment-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .class-title-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .class-teacher-avatar {
    width: 76px;
    height: 76px;
  }

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

  .teacher-card {
    min-height: 390px;
  }

  .lesson-card {
    grid-template-columns: 1fr;
  }

  .class-method {
    grid-template-columns: 1fr;
  }

  .presence-checker {
    grid-template-columns: 1fr;
  }

  .student-login-card {
    grid-template-columns: 1fr;
  }

  .presence-checker__summary {
    grid-template-columns: 1fr;
  }

  .assessment-rules {
    grid-template-columns: 1fr;
  }

  .admin-login,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .report-header,
  .report-filter-form {
    grid-template-columns: 1fr;
  }

  .report-field--wide {
    grid-column: auto;
  }

  .report-filter-actions {
    justify-content: flex-start;
  }

  .admin-tabs .btn {
    margin-left: 0;
  }

  .assessment-score-grid {
    grid-template-columns: 1fr;
  }

  .presence-checker__form div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav__brand img {
    width: 78px;
    height: 34px;
  }

  .home-hero__grid {
    min-height: auto;
    padding-top: 28px;
  }

  h1 {
    font-size: 3.2rem;
  }

  .subject-hero__inner {
    grid-template-columns: 1fr;
  }

  .subject-avatar {
    justify-self: center;
  }

  .viewer-shell {
    min-height: 520px;
  }

  .viewer-frame {
    height: 520px;
  }

  .game-hud {
    grid-template-columns: 1fr;
  }

  #lessonGame {
    min-height: 340px;
  }

  .game-briefing-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .game-briefing-card img {
    width: 64px;
    height: 64px;
  }

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