:root {
  --red: #e50012;
  --red-dark: #b9000f;
  --ink: #101928;
  --muted: #667085;
  --line: #e7e9ee;
  --soft: #fff4f4;
  --panel: #ffffff;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.08);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-sinhala-display: "Noto Sans Sinhala", "Iskoola Pota", "Malithi Web", "Nirmala UI", var(--font-sans);
  font-family: var(--font-sans);
}

/* Public contact page */
.contact-page { min-height: 100vh; background: linear-gradient(145deg, #fff 0%, #fff5f5 52%, #f6f8fc 100%); }
.contact-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 72px 0 100px; }
.contact-hero { max-width: 780px; margin-bottom: 42px; }
.contact-hero h1 { margin: 16px 0; font-size: clamp(2.3rem, 5vw, 4.7rem); line-height: 1.02; color: #111827; }
.contact-hero h1 span { color: #d71920; }
.contact-hero p { max-width: 700px; color: #657087; font-size: 1.08rem; line-height: 1.75; }
.contact-layout { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(0, 1.35fr); gap: 28px; align-items: start; }
.contact-details-card, .contact-form-card { background: rgba(255,255,255,.94); border: 1px solid #eadfe1; border-radius: 26px; padding: clamp(24px, 4vw, 42px); box-shadow: 0 22px 60px rgba(111, 20, 25, .1); }
.contact-details-card { background: linear-gradient(160deg, #c8171e, #8d0c12); color: #fff; }
.contact-details-card .eyebrow { color: #ffd4d6; }
.contact-details-card h2, .contact-form-card h2 { margin: 12px 0 28px; font-size: clamp(1.55rem, 3vw, 2.15rem); }
.contact-detail { display: grid; gap: 6px; padding: 19px 0; border-top: 1px solid rgba(255,255,255,.2); }
.contact-detail small { color: #ffd4d6; }
.contact-detail a, .contact-detail strong { color: #fff; font-size: 1.08rem; text-decoration: none; }
.contact-form { display: grid; gap: 19px; }
.contact-form label { display: grid; gap: 8px; color: #344056; font-weight: 750; }
.contact-form input, .contact-form textarea { width: 100%; border: 1px solid #ced5e0; border-radius: 13px; padding: 14px 16px; font: inherit; background: #fff; color: #111827; }
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid rgba(215,25,32,.13); border-color: #d71920; }
.contact-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form-status { min-height: 24px; margin: 0; font-weight: 700; }
.contact-form-status.success { color: #16803b; }
.contact-form-status.error { color: #c8171e; }
@media (max-width: 760px) { .contact-main { padding-top: 42px; } .contact-layout, .contact-form-row { grid-template-columns: 1fr; } }

/* Student portal application shell */
.student-login-page.student-authenticated { background: #f4f6fa; }
.student-login-page.student-authenticated > .site-header { display: none; }
.student-login-page.student-authenticated .login-layout {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #f4f6fa;
}
.student-login-page.student-authenticated .login-panel { width: 100%; min-height: 100vh; padding: 0; }
.student-login-page.student-authenticated .login-content { width: 100%; max-width: none; }
.student-login-page.student-authenticated .student-dashboard {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f4f6fa;
}
.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  color: #dbe3ef;
  background: #101828;
}
.portal-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; color: #fff; font-size: 17px; font-weight: 800; }
.portal-brand img { width: 42px; height: 42px; object-fit: contain; }
.portal-brand strong { color: #ff3342; }
.portal-sidebar nav { display: grid; gap: 6px; }
.portal-sidebar nav a,
.portal-sidebar nav button,
.portal-sidebar > button {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: #b9c4d4;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.portal-sidebar nav a span,
.portal-sidebar nav button span,
.portal-sidebar > button span { width: 22px; color: #8795aa; font-size: 18px; text-align: center; }
.portal-sidebar .portal-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  flex: 0 0 24px;
  place-items: center;
}
.portal-sidebar .portal-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}
.portal-nav-label { min-width: 0; width: auto !important; color: inherit !important; font-size: inherit !important; text-align: left !important; }
.portal-unread-badge {
  min-width: 20px !important;
  width: auto !important;
  height: 20px;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff !important;
  background: #e50012;
  box-shadow: 0 0 0 2px #101828, 0 8px 18px rgba(229, 0, 18, .35);
  font-size: 11px !important;
  font-weight: 900;
  line-height: 1;
  text-align: center !important;
}
.portal-unread-badge[hidden] { display: none !important; }
.portal-sidebar nav a:hover,
.portal-sidebar nav a.active,
.portal-sidebar nav button:hover,
.portal-sidebar nav button.active { color: #fff; background: rgba(255,255,255,.09); }
.portal-sidebar nav a.active,
.portal-sidebar nav button.active { box-shadow: inset 3px 0 0 var(--red); }
.portal-sidebar nav a.active span,
.portal-sidebar nav button.active span { color: #ff4b58; }
.portal-sidebar nav a:hover .portal-icon,
.portal-sidebar nav button:hover .portal-icon,
.portal-sidebar nav a.active .portal-icon,
.portal-sidebar nav button.active .portal-icon { color: #ff4b58; }
.portal-sidebar > button { margin-top: auto; width: 100%; }
.portal-sidebar > button:hover { color: #fff; background: rgba(229,0,18,.16); }
.portal-workspace { min-width: 0; }
.portal-topbar {
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 430px) auto;
  align-items: center;
  gap: 24px;
  padding: 18px 34px;
  border-bottom: 1px solid #e6eaf0;
  background: rgba(255,255,255,.94);
}
.portal-kicker { color: var(--red); font-size: 11px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.portal-topbar h2 { margin: 2px 0 0; font-size: 24px; }
.portal-topbar h2 span { color: var(--red); }
.portal-search-wrap { display: grid; gap: 5px; }
.portal-search { min-height: 44px; display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid #dfe4ec; border-radius: 10px; background: #f8fafc; }
.portal-search > span { color: #7b8799; font-size: 21px; }
.portal-search input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; }
.portal-search-status { min-height: 16px; margin: 0; color: #667085; font-size: 11px; font-weight: 700; }
.portal-home-link { padding: 10px 14px; border: 1px solid #dfe4ec; border-radius: 9px; color: #344054; background: #fff; font-size: 13px; font-weight: 750; }
.portal-main { width: min(1500px, 100%); margin: 0 auto; padding: 28px 34px 56px; scroll-margin-top: 20px; }
.portal-welcome {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  overflow: hidden;
  padding: 32px 38px;
  border-radius: 16px;
  color: #fff;
  background: radial-gradient(circle at 88% 20%, rgba(255,255,255,.12), transparent 20%), linear-gradient(120deg, #e50012, #a9000d);
  box-shadow: 0 18px 38px rgba(181, 0, 15, .18);
}
.portal-welcome span { font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.portal-welcome h3 { margin: 7px 0 8px; color: #fff; font-size: clamp(25px, 3vw, 38px); }
.portal-welcome p { max-width: 640px; margin: 0; color: #ffe7e9; line-height: 1.6; }
.portal-welcome > a { flex: 0 0 auto; padding: 13px 18px; border-radius: 9px; color: #b9000f; background: #fff; font-size: 13px; font-weight: 800; }
.portal-main > .student-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0 24px; }
.portal-main .student-summary-card { padding: 20px; border: 1px solid #e3e8f0; border-radius: 13px; background: #fff; text-align: left; box-shadow: 0 8px 22px rgba(16,24,40,.045); }
.portal-main .student-summary-card strong { margin-bottom: 5px; font-size: 29px; }
.portal-content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .75fr); align-items: start; gap: 22px; }
.portal-primary-column,
.portal-secondary-column { min-width: 0; display: grid; gap: 20px; }
.portal-panel {
  scroll-margin-top: 20px;
  padding: 22px;
  border: 1px solid #e3e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16,24,40,.045);
}
.portal-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.portal-panel-title span { color: var(--red); font-size: 10px; font-weight: 850; letter-spacing: .09em; }
.portal-panel-title h3 { margin: 3px 0 0; color: var(--ink); font-size: 20px; }
.portal-panel-title > a { color: var(--red); font-size: 12px; font-weight: 800; }
.portal-course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-main .student-learning-item { padding: 14px 15px; border: 1px solid #e5e9f0; border-radius: 10px; background: #fafbfc; }
.portal-main .student-learning-item:hover { border-color: rgba(229,0,18,.22); background: #fff; }
.student-subject-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.student-subject-card { display: grid; gap: 0; overflow: hidden; padding: 0; border: 1px solid #e3e8f0; border-radius: 14px; color: var(--ink); background: #fff; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 10px 24px rgba(16,24,40,.055); }
.student-subject-card:hover,.student-subject-card:focus-visible { border-color: rgba(229,0,18,.35); transform: translateY(-2px); box-shadow: 0 16px 34px rgba(16,24,40,.1); }
.student-subject-card:focus-visible { outline: 3px solid rgba(229,0,18,.18); outline-offset: 3px; }
.student-subject-card-media { aspect-ratio: 4/5; display: grid; place-items: center; overflow: hidden; color: #fff; font-size: 42px; font-weight: 900; }
.student-subject-card-media img { width: 100%; height: 100%; object-fit: cover; }
.student-subject-card-body { display: grid; gap: 5px; padding: 15px; }
.student-subject-card-body strong { font-size: 17px; }
.student-subject-card-body span { color: var(--muted); font-size: 13px; }
.student-subject-card-body .student-subject-card-description { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; }
.student-subject-card-body em { width: fit-content; margin-top: 7px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-style: normal; font-weight: 850; }
.student-subject-card-body em.active { color: #08783e; background: #e7f8ef; }
.student-subject-card-body em.inactive { color: #b42318; background: #fee4e2; }
.student-subject-card.inactive { border-color: #f4b4b0; background: #fffafa; }
.portal-account-status { display: inline-block; margin-top: 8px; padding: 6px 10px; border-radius: 999px; color: #08783e; background: #e7f8ef; font-size: 12px; font-weight: 850; }
.portal-account-status.inactive { color: #b42318; background: #fee4e2; }
.student-subject-detail { margin-top: 18px; }
.student-subject-detail > p { margin: -8px 0 18px; color: var(--muted); font-weight: 700; }
.student-course-detail-list { display: grid; gap: 18px; }
.student-course-detail-card { overflow: hidden; border: 1px solid #e3e8f0; border-radius: 14px; background: #fff; box-shadow: 0 10px 24px rgba(16,24,40,.055); }
.student-course-detail-header { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: stretch; gap: 0; background: #fafbfc; border-bottom: 1px solid #e3e8f0; }
.student-course-detail-media { min-height: 104px; display: grid; place-items: center; color: #fff; font-size: 38px; font-weight: 900; }
.student-course-detail-media img { width: 100%; height: 100%; object-fit: cover; }
.student-course-detail-header > div { min-width: 0; display: grid; align-content: center; gap: 5px; padding: 18px; }
.student-course-detail-header h4 { margin: 0; color: var(--ink); font-size: 22px; }
.student-course-detail-header p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 750; }
.student-course-content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.student-course-content-grid > section { min-width: 0; display: grid; align-content: start; gap: 10px; padding: 14px; border: 1px solid #e3e8f0; border-radius: 12px; background: #fafbfc; }
.student-course-content-grid h5 { margin: 0; color: var(--ink); font-size: 15px; }
.portal-secondary-column .student-profile { margin: 0; padding: 22px; border: 1px solid #e3e8f0; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(16,24,40,.045); }
.portal-secondary-column .student-profile dl { gap: 0; margin: 0; }
.portal-secondary-column .student-profile dl > div { display: grid; gap: 3px; padding: 10px 0; }
.portal-secondary-column .student-profile dt { font-size: 11px; }
.portal-secondary-column .student-profile dd { text-align: left; font-size: 14px; overflow-wrap: anywhere; }
.portal-main .student-actions { display: block; margin: 22px 0 0; padding: 24px; }
.portal-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.portal-settings-grid .student-mini-form { margin: 0; padding: 18px; background: #fafbfc; }
.portal-settings-grid .student-mini-form h4 { margin: 0 0 5px; font-size: 17px; }
.portal-settings-grid .student-mini-form:first-child { grid-row: span 2; }
.portal-settings-grid [data-student-message-form] { display: grid; gap: 14px; }
.portal-settings-grid [data-student-message-form] .btn { justify-self: start; min-width: 150px; margin-top: 4px; }
.portal-main .student-legal-links { margin: 18px 0 0; }
.portal-tab-page { min-height: calc(100vh - 150px); }
.portal-tab-page[hidden],
.portal-main [data-portal-page][hidden] { display: none !important; }
.portal-page-heading { margin-bottom: 22px; }
.portal-page-heading > span { color: var(--red); font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.portal-page-heading h3 { margin: 4px 0 5px; font-size: clamp(28px, 3vw, 38px); }
.portal-page-heading p { margin: 0; color: var(--muted); }
.portal-page-heading-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.portal-page-heading-actions > .btn { flex: 0 0 auto; }
@media (max-width: 600px) {
  .portal-page-heading-actions { align-items: stretch; flex-direction: column; }
  .portal-page-heading-actions > .btn { width: 100%; }
}
.portal-profile-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr); align-items: start; gap: 22px; }
.portal-profile-layout .student-mini-form { margin: 0; padding: 24px; }
.portal-profile-layout .student-mini-form h4 { margin: 0 0 12px; font-size: 20px; }

@media (max-width: 1100px) {
  .student-login-page.student-authenticated .student-dashboard { grid-template-columns: 82px minmax(0, 1fr); }
  .portal-sidebar { padding: 22px 12px; }
  .portal-brand span,
  .portal-sidebar nav a:not(.active)::after,
  .portal-sidebar nav a,
  .portal-sidebar nav button { font-size: 0; }
  .portal-brand { justify-content: center; padding-inline: 0; }
  .portal-sidebar nav a,
  .portal-sidebar nav button,
  .portal-sidebar > button { justify-content: center; padding: 0; }
  .portal-sidebar nav a span,
  .portal-sidebar nav button span,
  .portal-sidebar > button span { width: auto; font-size: 19px; }
  .portal-unread-badge { position: absolute; top: 8px; right: 8px; min-width: 18px !important; height: 18px; padding: 0 5px; font-size: 10px !important; }
  .portal-sidebar .portal-icon { width: 26px; height: 26px; }
  .portal-sidebar .portal-icon svg { width: 24px; height: 24px; }
  .portal-sidebar > button { font-size: 0; }
  .portal-content-grid { grid-template-columns: 1fr; }
  .portal-secondary-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-subject-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-course-content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .student-login-page.student-authenticated .student-dashboard { display: block; }
  .portal-sidebar { position: fixed; z-index: 30; top: auto; right: 0; bottom: 0; left: 0; height: 72px; display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 4px; padding: 8px 10px; }
  .portal-brand { display: none; }
  .portal-sidebar nav { height: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 56px; gap: 3px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .portal-sidebar nav::-webkit-scrollbar { display: none; }
  .portal-sidebar nav a,
  .portal-sidebar nav button,
  .portal-sidebar > button { min-height: 50px; display: grid; place-items: center; padding: 0; font-size: 0; }
  .portal-sidebar nav a span,
  .portal-sidebar nav button span,
  .portal-sidebar > button span { font-size: 18px; }
  .portal-unread-badge { top: 4px; right: 6px; box-shadow: 0 0 0 2px #101828, 0 6px 14px rgba(229, 0, 18, .35); }
  .portal-sidebar nav a.active,
  .portal-sidebar nav button.active { box-shadow: inset 0 -3px 0 var(--red); }
  .portal-sidebar > button { margin: 0; width: 100%; }
  .portal-topbar { grid-template-columns: 1fr auto; gap: 12px; padding: 15px 16px; }
  .portal-topbar h2 { font-size: 19px; }
  .portal-search { grid-column: 1 / -1; grid-row: 2; }
  .portal-main { padding: 18px 14px 100px; }
  .portal-welcome { min-height: 0; display: block; padding: 25px 22px; }
  .portal-welcome > a { display: inline-flex; margin-top: 20px; }
  .portal-main > .student-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .portal-secondary-column,
  .portal-settings-grid,
  .portal-course-grid,
  .portal-profile-layout { grid-template-columns: 1fr; }
  .student-course-detail-header { grid-template-columns: 1fr; }
  .student-course-detail-media { min-height: 150px; }
  .portal-settings-grid .student-mini-form:first-child { grid-row: auto; }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.top-rule {
  height: 7px;
  background: var(--red);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-shell {
  width: min(1380px, calc(100% - 48px));
  min-height: 112px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}

.brand strong {
  display: block;
  font-weight: 800;
  font-size: clamp(22px, 2vw, 31px);
  line-height: 1;
  letter-spacing: 0;
}

.brand em {
  color: var(--red);
  font-style: normal;
}

.brand small {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
}

.nav-links {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(22px, 2.25vw, 38px);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.nav-links a {
  position: relative;
  padding: 36px 0 30px;
  transform-origin: center;
  transition: color 0.18s ease, text-shadow 0.18s ease, transform 0.18s ease;
}

.nav-links .active {
  color: var(--red);
  text-shadow: 0 0 14px rgba(229, 0, 18, 0.14);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--red);
  text-shadow: 0 0 16px rgba(229, 0, 18, 0.24);
  transform: scale(1.08);
}

.nav-links .active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 19px;
  height: 3px;
  background: var(--red);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(229, 0, 18, 0.35);
}

.nav-actions {
  display: flex;
  gap: 14px;
  margin-left: 20px;
}

.nav-actions .btn-primary[href$="register.html"] {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: #f6c851;
  box-shadow: 0 10px 20px rgba(229, 0, 18, 0.18), 0 0 0 1px rgba(255, 211, 94, 0.35);
}

.nav-actions .btn-primary[href$="register.html"]::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 1;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 224, 121, 0.25) 42%, #ffe37e 50%, rgba(255, 204, 54, 0.25) 58%, transparent 75%);
  transform: translateX(-135%);
  animation: register-gold-run 2.8s ease-in-out infinite;
  pointer-events: none;
}

#how-to-start {
  scroll-margin-top: 128px;
}

@keyframes register-gold-run {
  0%, 42% { transform: translateX(-135%); }
  78%, 100% { transform: translateX(135%); }
}

.btn {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 25px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 750;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #f20b18, #d9000f);
  box-shadow: 0 10px 20px rgba(229, 0, 18, 0.18);
}

.btn-muted,
.btn-light {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

.hero {
  position: relative;
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(320px, 610px) 1fr;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, #fff 0%, #fff8f8 46%, #fff1f1 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.88) 30%, rgba(255, 255, 255, 0.2) 48%, rgba(255, 245, 245, 0) 64%),
    radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.82), transparent 30%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(100%, 600px);
  margin-left: max(32px, calc((100vw - 1340px) / 2));
  padding: 74px 0 130px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 8px 14px;
  color: var(--red);
  background: #ffe8e8;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}

.eyebrow span {
  color: #111827;
  font-weight: 750;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-sinhala-display);
  font-weight: 800;
  font-size: clamp(40px, 4vw, 60px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero h1 span,
.section-heading span {
  color: var(--red);
}

.hero h1 span {
  display: block;
}

.hero h1 .headline-line {
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.84em;
}

.hero h1 i {
  font-style: italic;
  font-weight: 900;
}

.hero h1 .grade-a {
  text-shadow:
    0 0 10px rgba(229, 0, 18, 0.28),
    0 0 22px rgba(229, 0, 18, 0.18);
}

.hero h1 em {
  display: block;
  font-style: normal;
}

.hero h1 span:last-child {
  white-space: nowrap;
}

.hero h1 span:last-child em {
  display: inline;
}

.hero p {
  max-width: 590px;
  margin: 22px 0 28px;
  color: #243042;
  font-size: 16px;
  line-height: 1.72;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 20px;
  max-width: 560px;
}

.hero-actions > .btn {
  min-height: 54px;
  min-width: 188px;
  padding: 0 28px;
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
  line-height: 1.25;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hero-actions > .btn-primary,
.hero-actions > .btn-light {
  flex: 0 0 188px;
}

.hero-secondary-actions {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.hero-secondary-actions .btn {
  flex: 0 0 188px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 8px;
  text-align: center;
  line-height: 1.25;
}

.hero-actions > .btn:hover,
.hero-actions > .btn:focus-visible,
.hero-secondary-actions .btn:hover,
.hero-secondary-actions .btn:focus-visible {
  transform: translateY(-2px);
}

.hero-actions > .btn-primary:hover,
.hero-actions > .btn-primary:focus-visible {
  box-shadow:
    0 14px 28px rgba(229, 0, 18, 0.24),
    0 0 26px rgba(229, 0, 18, 0.28);
}

.hero-actions .btn-light:hover,
.hero-actions .btn-light:focus-visible {
  border-color: rgba(229, 0, 18, 0.28);
  box-shadow:
    0 12px 26px rgba(16, 24, 40, 0.08),
    0 0 22px rgba(229, 0, 18, 0.16);
}

.play-dot {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid var(--red);
}

.calendar-dot {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 4px;
}

.calendar-dot::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 4px;
  border-top: 2px solid var(--ink);
}

.calendar-dot::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 5px;
  left: 4px;
  top: -5px;
  background: var(--ink);
  box-shadow: 8px 0 0 var(--ink);
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  background-image: url("assets/images/heroc.png");
  background-repeat: no-repeat;
  background-size: auto 100%;
  background-position: right bottom;
  filter: saturate(1.05) contrast(1.04);
}

.site-search {
  position: relative;
  z-index: 4;
  width: min(680px, calc(100% - 56px));
  margin: -108px auto 10px;
  text-align: center;
}

.site-search-form {
  min-height: 58px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.site-search-form:focus-within {
  border-color: rgba(229, 0, 18, 0.34);
  box-shadow:
    0 18px 38px rgba(16, 24, 40, 0.09),
    0 0 24px rgba(229, 0, 18, 0.14);
  transform: translateY(-1px);
}

.search-icon {
  width: 18px;
  height: 18px;
  border: 2px solid var(--red);
  border-radius: 50%;
  position: relative;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  border-radius: 999px;
  background: var(--red);
  transform: rotate(45deg);
}

.site-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.site-search input::placeholder {
  color: #8a94a6;
  font-weight: 600;
}

.site-search button {
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #f20b18, #d9000f);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(229, 0, 18, 0.16);
}

.search-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-hit {
  outline: 3px solid rgba(229, 0, 18, 0.22);
  outline-offset: 6px;
  box-shadow: 0 0 26px rgba(229, 0, 18, 0.18);
}

.metrics-strip {
  position: relative;
  z-index: 3;
  width: min(1260px, calc(100% - 56px));
  margin: -8px auto 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow:
    0 18px 44px rgba(16, 24, 40, 0.08),
    0 0 0 1px rgba(229, 0, 18, 0.16),
    0 0 22px rgba(229, 0, 18, 0.22),
    0 0 48px rgba(229, 0, 18, 0.1);
}

.metrics-strip article {
  min-width: 0;
  min-height: 118px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: 28px 22px;
  align-content: center;
  align-items: center;
  gap: 3px 14px;
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}

.metrics-strip article:last-child {
  border-right: 0;
}

.metric-icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center start;
  overflow: visible;
}

.metric-icon svg {
  width: 38px;
  height: 38px;
  display: block;
  fill: none;
  stroke: var(--red);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metrics-strip strong {
  min-width: 0;
  font-size: clamp(17px, 1.2vw, 21px);
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: normal;
  word-break: keep-all;
}

.metrics-strip small {
  min-width: 0;
  color: #344054;
  font-size: clamp(13px, 0.95vw, 16px);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: keep-all;
}

.metrics-strip .zoom-youtube-metric small {
  color: #344054;
  font-size: clamp(13px, 0.95vw, 16px);
  font-weight: 700;
  letter-spacing: 0;
  white-space: normal;
}

.metrics-strip .zoom-youtube-metric strong {
  font-size: clamp(15px, 1.05vw, 19px);
  white-space: normal;
}

@media (max-width: 1320px) and (min-width: 981px) {
  .hero-copy {
    width: min(49vw, 570px);
  }

  .hero h1 {
    font-size: clamp(39px, 3.8vw, 50px);
  }

  .metrics-strip {
    width: calc(100% - 32px);
  }

  .metrics-strip article {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 3px 9px;
    padding: 18px 12px;
  }

  .metric-icon {
    width: 36px;
    height: 40px;
  }

  .metric-icon svg {
    width: 33px;
    height: 33px;
  }

  .metrics-strip strong,
  .metrics-strip .zoom-youtube-metric strong {
    font-size: clamp(14px, 1.35vw, 17px);
    line-height: 1.22;
  }

  .metrics-strip small,
  .metrics-strip .zoom-youtube-metric small {
    font-size: clamp(11px, 1.05vw, 14px);
    line-height: 1.25;
  }
}

.section {
  width: min(1340px, calc(100% - 56px));
  margin: 34px auto 0;
}

.intro-video-panel {
  width: min(980px, 100%);
  margin: 0 auto 34px;
  padding: 28px;
}

.intro-video-panel h2 {
  font-size: clamp(30px, 3.4vw, 44px);
  text-align: center;
}

.intro-video-subtitle {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.section-heading {
  text-align: center;
  margin-bottom: 30px;
}

.section-heading h2,
.impact h2,
.panel h2,
.subscribe h2 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 500;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.class-card {
  position: relative;
  min-width: 0;
  min-height: 380px;
  overflow: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.class-card h3 {
  min-height: 70px;
  margin: 12px 0 8px;
  display: grid;
  align-content: center;
  gap: 4px;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.08;
  text-align: center;
}

.class-card h3 span,
.class-card h3 small {
  display: block;
}

.class-card h3 small {
  font-size: 0.78em;
  font-weight: 800;
  line-height: 1.18;
}

.class-card p {
  min-height: 42px;
  margin: 0 0 4px 48px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.class-icon {
  position: static;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
}

.class-icon img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

.class-card.orange { --tone: #ff6b00; }
.class-card.green { --tone: #28a745; }
.class-card.blue { --tone: #188bd9; }
.class-card.purple { --tone: #6f31b8; }
.class-card.teal { --tone: #008c95; }
.class-card.red { --tone: #ee1b24; }
.class-card.dark { --tone: #202938; }
.class-card h3,
.class-card a {
  color: var(--tone);
}
.class-icon {
  background: var(--tone);
}

.student-photo {
  width: 100%;
  height: 220px;
  display: block;
  margin: 6px auto 16px;
  object-fit: contain;
  object-position: center bottom;
  transform: scale(1.28);
  transform-origin: center bottom;
}

.class-card a {
  width: 100%;
  min-height: 38px;
  margin-top: auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-weight: 800;
  font-size: 13px;
}

.auth-section {
  padding-top: 28px;
}

.auth-page {
  min-height: calc(100vh - 98px);
  padding: 42px 0 72px;
  background:
    radial-gradient(circle at 18% 12%, rgba(229, 0, 18, 0.08), transparent 26%),
    linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}

.auth-page .auth-section {
  margin-top: 0;
}

.auth-page .section-heading h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.05;
}

.auth-page .section-heading h1 span {
  color: var(--red);
}

.auth-page-card {
  width: min(920px, 100%);
  margin: 0 auto;
}

.auth-login-card {
  width: min(680px, 100%);
}

.register-split {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #fdeceb;
  box-shadow: var(--shadow);
}

.register-split .register-form-card {
  width: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.register-visual {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  background: #fdeceb;
}

.register-visual img {
  width: 100%;
  height: 100%;
  max-height: none;
  display: block;
  object-fit: cover;
}

@media (max-width: 900px) {
  .register-split {
    display: block;
  }

  .register-visual {
    display: none;
  }

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

.auth-switch {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.auth-switch a {
  color: var(--red);
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.auth-card {
  padding: 28px;
}

.auth-kicker {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--red);
  background: #ffe8e8;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-card h2,
.student-dashboard h3 {
  margin: 12px 0 18px;
  font-size: 28px;
  line-height: 1.15;
}

.auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.auth-form[hidden] {
  display: none !important;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.auth-form label:nth-last-of-type(1),
.auth-form button,
.auth-form .form-status {
  grid-column: 1 / -1;
}

.auth-form input,
.auth-form select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 650;
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: rgba(229, 0, 18, 0.36);
  box-shadow: 0 0 0 4px rgba(229, 0, 18, 0.08);
}

.auth-form .register-password-field {
  grid-column: auto !important;
}

.auth-form .register-full-row {
  grid-column: 1 / -1;
}

.field-help {
  color: #667085;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .nav-actions .btn-primary[href$="register.html"]::after {
    animation: none;
    transform: none;
  }
}

.register-teachers { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.register-teachers legend { padding: 0 7px; color: #344054; font-size: 13px; font-weight: 850; }
.register-teachers > p { margin: 0 0 12px; color: #667085; font-size: 12px; }
.register-teacher-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.register-teacher-card { display: grid; gap: 6px; padding: 11px; border-radius: 8px; background: #fff7f7; }
.register-teacher-card strong { color: #1d2939; font-size: 13px; }
.register-teacher-card select { min-height: 40px; }
.register-teachers > small { display: block; margin-top: 9px; color: #667085; }

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-field .password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 7px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #687892;
  box-shadow: none;
}

.password-field .password-toggle:hover,
.password-field .password-toggle:focus-visible {
  background: transparent;
  color: var(--red);
  box-shadow: none;
}

.auth-form button {
  width: 100%;
  margin-top: 4px;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-status.success {
  color: #087443;
}

.form-status.error {
  color: var(--red-dark);
}

.registration-modal {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 80px rgba(16, 24, 40, 0.28);
}

.registration-modal::backdrop {
  background: rgba(16, 24, 40, 0.68);
  backdrop-filter: blur(4px);
}

.registration-modal-content {
  padding: 34px;
  text-align: center;
}

.registration-success-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #16a268;
  font-size: 32px;
  font-weight: 900;
}

.registration-modal h2 { margin: 0 0 6px; font-size: 27px; }
.registration-modal p { margin: 8px 0; color: #667085; line-height: 1.5; }
.registration-student-id { margin: 24px 0 18px; padding: 20px; border: 1px solid #ffd4d7; border-radius: 12px; background: #fff4f5; }
.registration-student-id span { display: block; color: #667085; font-size: 13px; font-weight: 800; }
.registration-student-id strong { display: block; margin-top: 8px; color: var(--red); font-size: 34px; letter-spacing: 0.08em; }
.registration-modal .registration-save-note { color: #344054; font-weight: 700; }
.registration-modal .btn { width: 100%; min-height: 52px; margin-top: 18px; }

/* Student login — split-panel layout */
.student-login-page {
  min-height: 100vh;
  background: #fff8f7;
}

.login-layout {
  box-sizing: border-box;
  width: min(1020px, calc(100% - 220px));
  height: min(520px, calc(100vh - 250px));
  min-height: 0;
  margin: 64px auto 58px;
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
  overflow: hidden;
  border-radius: 34px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(114, 39, 48, 0.1);
}

.login-panel {
  box-sizing: border-box;
  position: relative;
  padding: 36px 46px 30px;
}

.login-brand {
  position: absolute;
  top: 34px;
  left: 42px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 850;
}

.login-brand em { color: var(--red); font-style: normal; }
.login-content { box-sizing: border-box; width: min(480px, 100%); margin: 0 auto; }
.login-content h1 { margin: 0 0 18px; color: #101a30; font-size: clamp(28px, 2vw, 34px); line-height: 1.1; }
.login-intro { margin: 18px 0 32px; color: #40506a; font-size: 16px; font-weight: 600; line-height: 1.55; }
.login-content .auth-form { grid-template-columns: 1fr; gap: 14px; }
.login-content .auth-form label:nth-last-of-type(1), .login-content .auth-form button, .login-content .auth-form .form-status { grid-column: auto; }
.login-content .auth-form label { gap: 10px; font-size: 16px; color: #17243a; }
.login-input { display: flex; align-items: center; min-height: 50px; padding: 0 14px; border: 1px solid #d6ddea; border-radius: 10px; background: #fff; color: #7e8ca5; }
.login-input > span { width: 26px; color: #687892; font-size: 24px; }
.login-content .auth-form .login-input input { min-height: 46px; padding: 0 8px; border: 0; box-shadow: none; color: #14213a; font-weight: 600; }
.login-content .auth-form .password-toggle { width: 42px; min-height: 42px; margin: 0; padding: 9px; border: 0; background: transparent; box-shadow: none; color: #687892; }
.password-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.login-content .auth-form .password-toggle:hover, .login-content .auth-form .password-toggle:focus-visible { color: var(--red); background: transparent; box-shadow: none; }
.login-content .auth-form button { min-height: 50px; margin-top: 8px; border-radius: 10px; font-size: 17px; box-shadow: 0 12px 22px rgba(229, 0, 18, 0.18); }
.login-content .auth-switch { margin-top: 14px; text-align: right; color: #3b82f6; font-size: 15px; }
.login-content .auth-switch a { color: #3b82f6; }
.login-content [data-login-status]:empty { display: none; }
.login-content .login-signup { margin-top: 26px; padding-top: 20px; border-top: 1px solid #e8edf4; text-align: center; color: #40506a; }
.login-content .login-signup a { color: var(--red); }
.login-content [data-password-reset-request], .login-content [data-password-reset-confirm] { margin-top: 22px; }
.login-content [data-password-reset-request] h3 { margin: 0 0 4px; }
.login-visual { display: grid; place-items: center; overflow: hidden; padding: 0; background: #fdeceb; }
.login-visual img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }

@media (max-width: 1100px) {
  .login-layout { width: 100%; min-height: calc(100vh - 96px); height: auto; margin: 0; display: block; border-radius: 0; }
  .login-panel { min-height: 100vh; padding: 112px 28px 48px; }
  .login-brand { top: 28px; left: 28px; }
  .login-content h1 { text-align: center; }
  .login-intro { margin: 18px 0 34px; font-size: 15px; }
  .login-visual { display: none; }
}

@media (max-width: 560px) {
  .student-login-page:not(.student-authenticated) .login-panel { padding: 96px 16px 42px; }
  .student-login-page:not(.student-authenticated) .login-content {
    width: 100%;
    max-width: calc(100vw - 32px);
  }
  .student-login-page:not(.student-authenticated) .login-content .auth-form,
  .student-login-page:not(.student-authenticated) .login-input,
  .student-login-page:not(.student-authenticated) .login-content .auth-form button {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
  }
  .student-login-page:not(.student-authenticated) .login-content .auth-form input {
    min-width: 0;
  }
  .student-login-page:not(.student-authenticated) .login-content .auth-form .password-toggle {
    width: 42px;
    min-width: 42px;
    flex: 0 0 42px;
  }
  .student-login-page:not(.student-authenticated) .login-content .auth-switch { text-align: center; }
  .student-login-page:not(.student-authenticated) .login-content .login-signup {
    display: block;
    line-height: 1.6;
  }
  .student-login-page:not(.student-authenticated) .login-content .login-signup a {
    display: block;
  }
}

.student-dashboard {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(229, 0, 18, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff, #fff7f7);
}

.student-portal-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #101928, #28364d);
  box-shadow: 0 18px 38px rgba(16, 25, 40, .14);
}

.student-portal-heading h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); }
.student-portal-heading p { margin: 6px 0 0; color: #cbd5e1; }
.student-portal-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.student-portal-nav a { padding: 9px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.1); color: #fff; font-weight: 750; }
.student-portal-nav a:hover { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.16); }

.student-authenticated .login-layout {
  width: min(1340px, calc(100% - 56px));
  min-height: 0;
  height: auto;
  margin: 36px auto 72px;
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 16px;
  background: #f5f7fb;
}

.student-authenticated .login-panel { min-height: 0; padding: 28px; }
.student-authenticated .login-content { width: 100%; max-width: none; }
.student-authenticated .login-content > h1 { display: none; }
.student-authenticated .login-signup { display: none; }
.student-authenticated .login-visual { display: none; }
.student-authenticated .student-dashboard {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(0, 1.55fr);
  align-items: start;
  gap: 24px;
  margin: 0;
  padding: 28px;
  border: 0;
  background: #f5f7fb;
  scroll-margin-top: 130px;
}
.student-authenticated .student-dashboard > .auth-kicker { display: none; }
.student-authenticated .student-profile,
.student-authenticated .student-learning {
  margin: 0;
  padding: 24px;
  border: 1px solid #e4e9f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .055);
}
.student-authenticated .student-profile { align-self: start; position: static; }
.student-authenticated .student-profile h3,
.student-authenticated .student-learning h3 { font-size: 23px; }
.student-authenticated .student-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.student-authenticated .student-summary-card { padding: 16px 10px; border: 1px solid #ffe0e3; }
.student-authenticated .student-summary-card strong { font-size: 1.65rem; }
.student-authenticated .student-learning h4 { margin-top: 26px; padding-top: 20px; border-top: 1px solid #edf0f5; }
.student-authenticated .student-learning-item { padding: 14px 16px; border-color: #e7eaf0; }
.student-authenticated .student-actions,
.student-authenticated .student-dashboard > [data-student-logout] { grid-column: 1 / -1; }
.student-authenticated .student-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 24px;
  border: 1px solid #e4e9f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .055);
}
.student-authenticated .student-actions > h3,
.student-authenticated .student-actions > .student-legal-links { grid-column: 1 / -1; }
.student-authenticated .student-actions > h3 { margin-bottom: 2px; font-size: 24px; }
.student-authenticated .student-mini-form { align-content: start; padding: 18px; background: #fafbfc; }
.student-authenticated .student-mini-form:first-of-type { grid-column: 1 / -1; }
.student-authenticated .student-dashboard > [data-student-logout] { justify-self: end; min-width: 150px; }

@media (max-width: 900px) {
  .student-authenticated .login-layout { width: calc(100% - 28px); }
  .student-authenticated .student-dashboard { grid-template-columns: 1fr; padding: 20px; }
  .student-authenticated .student-profile { position: static; }
  .student-portal-heading { align-items: flex-start; flex-direction: column; }
  .student-authenticated .student-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-authenticated .student-actions { grid-template-columns: 1fr; }
  .student-authenticated .student-actions > *,
  .student-authenticated .student-mini-form:first-of-type { grid-column: 1; }
}

@media (max-width: 560px) {
  .student-authenticated .login-panel { padding: 0; }
  .student-authenticated .student-dashboard { padding: 12px; gap: 14px; }
  .student-portal-heading,
  .student-authenticated .student-profile,
  .student-authenticated .student-learning,
  .student-authenticated .student-actions { padding: 18px; border-radius: 11px; }
  .student-portal-nav { width: 100%; }
  .student-portal-nav a { flex: 1; text-align: center; }
}

.student-dashboard dl {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.student-dashboard dl > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0dfe1;
}

.student-dashboard dt {
  color: var(--muted);
  font-weight: 750;
}

.student-dashboard dd {
  margin: 0;
  color: var(--ink);
  font-weight: 850;
  text-align: right;
}

.student-learning {
  margin: 24px 0;
}

.student-profile {
  margin-top: 18px;
}

.student-profile h3,
.student-learning h3 {
  margin: 0 0 16px;
  color: var(--navy);
}

.student-profile h4 {
  margin: 20px 0 10px;
  color: var(--navy);
  font-size: 1rem;
}

.student-learning h4 {
  margin: 20px 0 10px;
  color: var(--navy);
  font-size: 1rem;
}

.student-learning-list {
  display: grid;
  gap: 8px;
}

.student-learning-item {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid #e3e8f1;
  border-radius: 10px;
  color: var(--navy);
  text-decoration: none;
  background: #fff;
}

button.student-learning-item {
  width: 100%;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.student-learning-item span,
.student-learning-item p,
.student-learning-empty {
  margin: 0;
  color: #68748b;
  font-size: .84rem;
}

.student-notification-item {
  position: relative;
  align-items: start;
  min-height: 58px;
  padding-right: 42px;
}
.student-notification-item::after {
  content: "+";
  position: absolute;
  top: 14px;
  right: 16px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #667085;
  background: #f2f4f7;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
.student-notification-item[aria-expanded="true"]::after {
  content: "-";
  color: #fff;
  background: var(--red);
}
.student-notification-item.unread {
  border-color: rgba(229, 0, 18, .3);
  background: #fffafa;
  box-shadow: inset 3px 0 0 var(--red);
}
.student-notification-item:not(.unread) {
  border-color: #e7eaf0;
  background: #fff;
  opacity: .82;
}
.student-notification-detail {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}
.student-notification-detail[hidden] { display: none !important; }
.student-notification-detail span { font-weight: 750; }

.student-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.student-dashboard-search { display: grid; gap: 6px; margin: 0 0 14px; color: #344054; font-size: .82rem; font-weight: 750; }.student-dashboard-search input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #d0d5dd; border-radius: 9px; font: inherit; }

.student-summary-card {
  padding: 12px;
  border-radius: 10px;
  color: #344054;
  background: #fff3f3;
  text-align: center;
}

.student-summary-card strong { display: block; color: var(--red); font-size: 1.25rem; }
.student-summary-progress { display: block; width: 100%; height: 7px; overflow: hidden; margin-top: 9px; border-radius: 999px; background: #ffd9dc; }
.student-summary-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e50012, #ff4351); transition: width .35s ease; }
.student-summary-progress-row { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 14px 18px; border: 1px solid #ffd2d6; border-radius: 12px; color: #344054; background: #fff; }
.student-summary-progress-row > span:first-child { font-weight: 750; }
.student-summary-progress-row > strong { color: var(--red); }
.student-summary-progress-row .student-summary-progress { grid-column: 1 / -1; }
.student-learning-item-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.student-learning-item-actions .btn { min-height: 34px; padding: 7px 11px; font-size: .78rem; }
.student-payment-layout { display:grid; grid-template-columns:minmax(280px,.72fr) minmax(380px,1.28fr); gap:18px; align-items:start; }
.student-payment-layout > .portal-panel { margin:0; }
.payment-status-badge { display:inline-flex; width:max-content; padding:5px 10px; border-radius:999px; background:#fff4e5; color:#9a6700; font-weight:800; text-transform:capitalize; }
.payment-status-badge.paid { background:#e8f8ef; color:#08783e; }
.payment-status-badge.declined,.payment-status-badge.overdue { background:#fff0f0; color:#b42318; }
@media (max-width: 850px) { .student-payment-layout { grid-template-columns:1fr; } }
.student-paid-lock { width: 100%; padding: 8px 10px; border-radius: 8px; color: #9f1239 !important; background: #fff1f2; font-weight: 750; }
.student-progress { height: 7px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.student-progress span { display: block; height: 100%; background: var(--red); }
.student-actions { display: grid; gap: 14px; margin: 28px 0 18px; }
.student-actions h3 { margin: 0; }
.student-mini-form { display: grid; gap: 10px; padding: 14px; border: 1px solid #e3e8f1; border-radius: 10px; background: #fff; }
.student-mini-form label { display: grid; gap: 5px; color: #344054; font-size: .82rem; font-weight: 750; }
.student-mini-form input,.student-mini-form select,.student-mini-form textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d0d5dd; border-radius: 8px; font: inherit; }
.student-mini-form textarea { min-height: 76px; resize: vertical; }
.student-legal-links { text-align: center; }

@media (max-width: 520px) { .student-summary-grid { grid-template-columns: 1fr; } }

.legal-page { width: min(860px, calc(100% - 36px)); margin: 0 auto; padding: 64px 0 90px; color: var(--ink); line-height: 1.7; }
.legal-page > a { color: var(--red); font-weight: 800; }.legal-page h1 { margin: 28px 0 8px; font-size: clamp(2rem,6vw,3.5rem); }.legal-page h2 { margin: 30px 0 6px; }.legal-page p { color: #59657b; }

.feature-row {
  width: min(1340px, calc(100% - 56px));
  margin: 32px auto 0;
  display: grid;
  grid-template-columns: 1.55fr 1.05fr 0.82fr;
  gap: 20px;
  align-items: stretch;
}

.event-showcase {
  width: min(1340px, calc(100% - 56px));
  margin: 48px auto 0;
}

.event-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  align-items: end;
  gap: 48px;
  margin-bottom: 24px;
}

.event-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--red);
  font-family: var(--font-sinhala-display);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.event-heading h2 {
  font-family: var(--font-sinhala-display);
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.08;
}

.event-heading h2 span { color: var(--red); }

.event-heading p {
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--font-sinhala-display);
  font-weight: 550;
  line-height: 1.65;
}

.event-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, 270px);
  gap: 16px;
}

.event-card {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #101928;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .12);
}

.event-card-featured,
.event-card-wide,
.event-card-tall {
  grid-column: auto;
  grid-row: auto;
}

.event-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .45s ease;
}

.event-card-featured img { object-position: 52% center; }
.event-card-tall img { object-position: 48% 32%; }

.event-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(4, 11, 23, .86) 100%);
  pointer-events: none;
}

.event-card figcaption {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 22px;
  color: #fff;
  font-family: var(--font-sinhala-display);
}

.event-card figcaption span,
.event-card figcaption strong { display: block; }

.event-card figcaption span {
  margin-bottom: 5px;
  color: #ffd5d8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.event-card figcaption strong {
  font-size: 18px;
  line-height: 1.2;
}

@media (hover: hover) {
  .event-card:hover img { transform: scale(1.045); }
}

@media (max-width: 980px) {
  .event-showcase { width: calc(100% - 28px); }

  .event-heading {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .event-heading p { max-width: 680px; }

  .event-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, 240px);
  }
}

@media (max-width: 600px) {
  .event-showcase { margin-top: 36px; }
  .event-heading h2 { font-size: 27px; overflow-wrap: anywhere; }

  .event-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .event-card,
  .event-card-featured,
  .event-card-wide,
  .event-card-tall {
    grid-column: auto;
    grid-row: auto;
    min-height: 240px;
    aspect-ratio: 4 / 3;
  }

  .event-card-featured { aspect-ratio: 16 / 10; }
  .event-card figcaption { padding: 18px; }
  .event-card figcaption strong { font-size: 17px; }
}

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.05);
}

.video-panel {
  padding: 22px;
}

.video-panel h2 {
  font-size: 25px;
  line-height: 1.15;
}

.video-meta {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(229, 0, 18, 0.1);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff, #fff6f6);
}

.video-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--red);
  background: #ffe7e9;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.video-meta h3 {
  margin: 10px 0 5px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.video-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}

.video-frame {
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  background: #101928;
  border: 1px solid rgba(16, 24, 40, 0.12);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.channel-btn {
  width: max-content;
  display: flex;
  min-height: 42px;
  margin: 18px auto 0;
  padding: 0 24px;
  color: var(--red);
  background: #fff;
  border-color: #e8eaf0;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.yt-icon {
  position: relative;
  width: 20px;
  height: 14px;
  display: inline-block;
  border-radius: 4px;
  background: var(--red);
}

.yt-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 3px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #fff;
}

.benefits ul {
  display: grid;
  gap: 18px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.benefits li {
  position: relative;
  padding-left: 40px;
}

.benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 50%;
  font-weight: 900;
}

.benefits strong {
  display: block;
  font-weight: 800;
  margin-bottom: 5px;
}

.benefits span,
.start-card p {
  color: var(--muted);
  line-height: 1.65;
}

.start-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 118px;
  grid-template-rows: auto 1fr auto;
  gap: 12px 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(229, 0, 18, 0.09), transparent 24%),
    radial-gradient(circle at 45% 82%, rgba(229, 0, 18, 0.16), transparent 30%),
    linear-gradient(135deg, #fff 0%, #fff7f7 46%, #fff0f0 100%);
}

.start-card::before {
  content: "∑  π  √x";
  position: absolute;
  right: 22px;
  top: 20px;
  color: rgba(229, 0, 18, 0.13);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.start-card::after {
  content: "";
  position: absolute;
  right: 32px;
  bottom: 84px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px dashed rgba(229, 0, 18, 0.16);
}

.start-card div {
  position: relative;
  z-index: 1;
  grid-column: 1 / 3;
}

.start-card h2 {
  max-width: 280px;
  font-size: clamp(30px, 3.2vw, 38px);
  line-height: 1.08;
}

.start-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  padding: 7px 11px;
  color: var(--red);
  background: rgba(229, 0, 18, 0.08);
  border: 1px solid rgba(229, 0, 18, 0.14);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.start-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
}

.start-card p {
  max-width: 310px;
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.7;
}

.start-card .btn {
  position: relative;
  z-index: 2;
  grid-column: 1 / 3;
  align-self: end;
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.rocket {
  position: relative;
  z-index: 1;
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  width: 126px;
  height: 168px;
  object-fit: contain;
  align-self: end;
  justify-self: end;
  margin-bottom: -4px;
  filter: drop-shadow(0 18px 24px rgba(229, 0, 18, 0.2));
  transform: rotate(9deg);
}

.impact {
  width: min(1340px, calc(100% - 56px));
  margin: 30px auto 0;
  padding: 30px 44px 42px;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #f10918, #c90010);
  box-shadow: var(--shadow);
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.impact-grid span {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: center;
  gap: 2px 14px;
  text-align: left;
}

.impact-grid svg {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
}

.impact-grid strong {
  font-size: 30px;
  line-height: 1;
}

.impact-grid small {
  font-weight: 600;
  line-height: 1.25;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.resource-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.resource-img {
  position: relative;
  height: 128px;
  min-height: 0;
  background-size: cover;
  background-position: center;
}

.resource-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.18));
}

.resource-img span {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  padding: 7px 12px;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.notes {
  background-image: linear-gradient(135deg, rgba(255,255,255,.12), rgba(0,0,0,.12)), url("assets/optimized/resource/past-papers.webp");
}

.papers {
  background-image: linear-gradient(135deg, rgba(255,255,255,.12), rgba(0,0,0,.12)), url("assets/optimized/resource/tips.webp");
}

.algebra {
  background-image: linear-gradient(135deg, rgba(255,255,255,.08), rgba(0,0,0,.24)), url("assets/optimized/resource/algebra.webp");
}

.exam {
  background-image: linear-gradient(135deg, rgba(255,255,255,.08), rgba(0,0,0,.12)), url("assets/optimized/resource/time-manage.webp");
}

.resource-card h3 {
  min-height: 62px;
  margin: 18px 18px 8px;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.25;
}

.resource-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 18px 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.resource-card.expanded p {
  display: block;
  overflow: visible;
}

.resource-actions {
  margin: 0 18px 22px;
}

.resource-actions .btn {
  width: 100%;
  min-height: 42px;
}

.center-btn {
  width: max-content;
  display: flex;
  margin: 28px auto 0;
}

.subscribe {
  width: min(1340px, calc(100% - 56px));
  margin: 18px auto 0;
  padding: 44px 56px;
  display: grid;
  grid-template-columns: minmax(680px, 1fr) minmax(300px, 360px);
  align-items: center;
  gap: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7f7, #ffecec);
}

.subscribe h2 {
  max-width: 920px;
  font-size: clamp(28px, 2.7vw, 40px);
  line-height: 1.08;
}

.subscribe h2 span {
  display: block;
}

.subscribe p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}

.youtube-subscribe {
  justify-self: end;
  min-height: 58px;
  min-width: 270px;
  padding: 0 32px;
  font-size: 16px;
  box-shadow: 0 14px 28px rgba(229, 0, 18, 0.2);
}

.footer {
  margin-top: 12px;
  color: #d8e0ea;
  background: #07111f;
}

.footer-grid {
  width: min(1340px, calc(100% - 56px));
  margin: 0 auto;
  padding: 44px 0 22px;
  display: grid;
  grid-template-columns: 2.1fr repeat(4, 1fr);
  gap: 44px;
}

.footer .brand small,
.footer p,
.footer a {
  color: #d8e0ea;
}

.footer .brand strong {
  color: #fff;
}

.footer p {
  max-width: 330px;
  line-height: 1.65;
}

.footer h3 {
  margin: 0 0 14px;
  color: #fff;
}

.footer-grid div:not(:first-child) a {
  display: block;
  margin-bottom: 8px;
}

.socials {
  display: flex;
  gap: 12px;
}

.socials a {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
}

.socials img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.copyright {
  width: min(1340px, calc(100% - 56px));
  margin: 0 auto;
  padding: 18px 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: #a8b4c2;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright strong {
  color: #ff303a;
}

.copyright a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease, text-shadow .2s ease, filter .2s ease;
}

.copyright a:hover,
.copyright a:focus-visible {
  color: #fff;
  text-decoration: none;
  text-shadow: 0 0 8px rgba(255, 48, 58, .7), 0 0 18px rgba(255, 48, 58, .38);
  filter: drop-shadow(0 0 8px rgba(255, 48, 58, .32));
}

.copyright a:focus-visible {
  outline: 2px solid rgba(255, 48, 58, .55);
  outline-offset: 4px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .nav-shell {
    grid-template-columns: auto auto;
  }

  .nav-toggle {
    display: block;
    justify-self: end;
  }

  .nav-links,
  .nav-actions {
    display: none;
  }

  .nav-links.open {
    grid-column: 1 / -1;
    display: grid;
    justify-self: stretch;
    gap: 0;
    padding-bottom: 8px;
  }

  .nav-links a {
    padding: 14px 0;
    transform: none;
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    transform: none;
  }

  .nav-shell.menu-open .nav-actions,
  .nav-shell:has(.nav-links.open) .nav-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
  }

  .nav-shell.menu-open .nav-actions .btn,
  .nav-shell:has(.nav-links.open) .nav-actions .btn {
    width: 100%;
  }

  .nav-links .active::after {
    display: none;
  }

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

  .student-photo {
    height: 210px;
  }

  .feature-row {
    grid-template-columns: 1fr 1fr;
  }

  .start-card {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 150px;
  }

  .impact-grid,
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 760px;
    background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
  }

  .hero-copy {
    margin-left: 0;
    width: min(100% - 48px, 560px);
    padding: 56px 0 410px;
    justify-self: center;
  }

  .hero-art {
    top: auto;
    right: 0;
    left: 0;
    height: 430px;
    width: 100%;
    transform: none;
    background-size: cover;
    background-position: 62% center;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .hero::before {
    display: none;
  }
}

@media (max-width: 820px) {
  .nav-shell {
    width: min(100% - 28px, 760px);
    min-height: 88px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
  }

  .brand strong {
    font-size: 20px;
  }

  .brand small {
    font-size: 13px;
  }

  .hero {
    min-height: 770px;
    padding-bottom: 0;
    background: linear-gradient(180deg, #fff 0%, #fff6f6 100%);
  }

  .hero-copy {
    width: calc(100% - 32px);
    margin: 0 auto;
    padding: 44px 0 390px;
  }

  .hero p {
    font-size: 15px;
    line-height: 1.7;
  }

  .hero-actions .btn {
    flex: 1 0 100%;
    width: 100%;
  }

  .hero-secondary-actions {
    width: 100%;
  }

  .hero-secondary-actions .btn {
    flex: 1 0 100%;
  }

  .hero-art {
    height: 400px;
    background-size: cover;
    background-position: 60% center;
  }

  .feature-row,
  .impact-grid,
  .subscribe,
  .copyright {
    grid-template-columns: 1fr;
  }

  .metrics-strip,
  .class-grid,
  .auth-grid,
  .impact-grid,
  .resource-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-strip,
  .site-search,
  .section,
  .feature-row,
  .impact,
  .subscribe,
  .footer-grid,
  .copyright {
    width: calc(100% - 28px);
  }

  .site-search {
    margin: -10px auto 14px;
  }

  .site-search-form {
    grid-template-columns: 24px 1fr;
    padding: 10px 12px 10px 18px;
    border-radius: 14px;
  }

  .site-search button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .metrics-strip article {
    min-height: 96px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 3px 8px;
    padding: 14px 12px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .metrics-strip article:nth-child(2n) {
    border-right: 0;
  }

  .metrics-strip article:last-child {
    grid-column: 1 / -1;
    grid-template-columns: 30px auto;
    justify-content: center;
    text-align: center;
    border-right: 0;
    border-bottom: 0;
  }

  .metrics-strip article:last-child small {
    font-size: 13px;
    font-weight: 800;
  }

  .metric-icon {
    width: 30px;
    height: 30px;
  }

  .metric-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.8;
  }

  .metrics-strip strong {
    font-size: 16px;
    line-height: 1.15;
  }

  .metrics-strip small {
    font-size: 10.5px;
    line-height: 1.2;
  }

  .panel,
  .impact,
  .subscribe {
    padding: 24px;
  }

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

  .subscribe {
    gap: 18px;
  }

  .subscribe h2 {
    font-size: 22px;
    line-height: 1.15;
  }

  .subscribe p {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.45;
  }

  .start-card {
    grid-template-columns: 1fr 112px;
  }

  .start-card div {
    grid-column: 1 / 3;
  }

  .rocket {
    width: 112px;
    height: 145px;
  }

  .section-heading p {
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
    line-height: 1.45;
  }

  .class-grid {
    gap: 10px;
  }

  .class-card {
    min-height: 258px;
    padding: 12px;
  }

  .class-card h3 {
    min-height: 48px;
    margin: 8px 0 8px;
    gap: 2px;
    font-size: 15px;
    line-height: 1.1;
  }

  .class-card p {
    min-height: 40px;
    margin-left: 40px;
    font-size: 11px;
    overflow-wrap: anywhere;
  }

  .class-icon {
    width: 38px;
    height: 38px;
  }

  .class-icon img {
    width: 24px;
    height: 24px;
  }

  .student-photo {
    height: 132px;
    margin: 8px auto 12px;
    transform: scale(1.2);
  }

  .class-card a {
    min-height: 36px;
    font-size: 11px;
    white-space: nowrap;
  }

  .resource-grid {
    gap: 12px;
  }

  .impact-grid {
    gap: 18px 14px;
    margin-top: 24px;
  }

  .impact-grid span {
    grid-template-columns: 34px 1fr;
    gap: 2px 10px;
  }

  .impact-grid svg {
    width: 34px;
    height: 34px;
    stroke-width: 3;
  }

  .impact-grid strong {
    font-size: 21px;
  }

  .impact-grid small {
    font-size: 11px;
  }

  .resource-img {
    min-height: 96px;
  }

  .resource-img span {
    top: 9px;
    left: 9px;
    padding: 5px 9px;
    font-size: 10px;
  }

  .resource-card h3 {
    min-height: 64px;
    margin: 12px 12px 8px;
    font-size: 13px;
    line-height: 1.25;
  }

  .resource-card p {
    margin: 0 12px 14px;
    font-size: 11px;
    line-height: 1.35;
  }

  .youtube-subscribe {
    justify-self: stretch;
    min-height: 46px;
    min-width: 0;
    font-size: 13px;
  }

  .copyright {
    display: grid;
  }

  .footer-grid {
    gap: 26px 18px;
    padding: 34px 0 18px;
  }

  .footer-grid > div:first-child,
  .footer-grid > div:last-child {
    grid-column: 1 / -1;
  }

  .footer-brand .brand-mark {
    width: 56px;
    height: 56px;
  }

  .footer p {
    max-width: 100%;
    margin: 14px 0 18px;
    font-size: 14px;
    line-height: 1.55;
  }

  .footer h3 {
    margin-bottom: 10px;
    font-size: 17px;
  }

  .footer-grid div:not(:first-child) a {
    margin-bottom: 7px;
    font-size: 14px;
    line-height: 1.35;
  }

  .socials a {
    width: 34px;
    height: 34px;
  }

  .copyright {
    gap: 8px;
    padding: 16px 0 22px;
    font-size: 12px;
    line-height: 1.45;
  }
}

@media (max-width: 600px) {
  .video-panel h2 {
    text-align: center;
  }

  .hero-copy {
    text-align: center;
  }

  .eyebrow {
    width: fit-content;
    max-width: 100%;
    justify-content: center;
    margin: 0 auto 18px;
    padding: 9px 18px;
    gap: 5px 10px;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(229, 0, 18, 0.08);
  }

  .eyebrow span {
    flex-basis: 100%;
    white-space: normal;
  }

  .hero h1 {
    max-width: 410px;
    margin: 0 auto;
    font-size: 30px;
    line-height: 1.14;
    font-weight: 780;
    text-align: center;
    text-wrap: balance;
  }

  .hero h1 .headline-line {
    white-space: normal;
    font-size: 0.86em;
  }

  .hero h1 em {
    display: inline;
  }

  .hero h1 span:last-child {
    white-space: nowrap;
    font-size: 0.92em;
  }

  .hero p {
    max-width: 390px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .hero-copy {
    padding-bottom: 360px;
  }

  .hero-art {
    height: 360px;
    background-position: 58% center;
  }

  .hero-actions,
  .hero-actions .btn,
  .hero-secondary-actions,
  .channel-btn,
  .center-btn {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 0 100%;
  }

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

  .start-card div,
  .start-card .btn,
  .rocket {
    grid-column: 1;
    grid-row: auto;
  }

  .rocket {
    justify-self: center;
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: clamp(25px, 7.5vw, 28px);
  }

  .hero h1 span:last-child {
    font-size: 0.9em;
  }

  .class-grid,
  .resource-grid {
    gap: 10px;
  }

  .class-card {
    min-height: 238px;
    padding: 10px;
  }

  .class-card h3 {
    min-height: 46px;
    margin: 8px 0;
    font-size: 14px;
  }

  .class-card p {
    min-height: 40px;
    margin-left: 37px;
    font-size: 10px;
  }

  .class-icon {
    width: 32px;
    height: 32px;
  }

  .class-icon img {
    width: 20px;
    height: 20px;
  }

  .student-photo {
    height: 116px;
    transform: scale(1.15);
  }

  .resource-img {
    min-height: 86px;
  }
}

/* Final portal cascade overrides */
.student-authenticated .portal-secondary-column .student-profile { margin: 0; padding: 22px; }
.student-authenticated .portal-main .student-actions { display: block; margin: 22px 0 0; padding: 24px; }
.student-authenticated .portal-main .student-summary-grid { margin: 20px 0 24px; }
.student-authenticated .portal-settings-grid .student-mini-form:first-of-type { grid-column: auto; grid-row: span 2; }
.student-authenticated .portal-profile-layout { grid-template-columns: 250px minmax(300px, .85fr) minmax(340px, 1.15fr); }
.profile-photo-card { margin: 0; text-align: center; }
.profile-photo-preview { width: 142px; height: 142px; display: grid; place-items: center; overflow: hidden; margin: 0 auto 18px; border: 5px solid #fff; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #e50012, #8f000b); box-shadow: 0 10px 28px rgba(16,24,40,.16); }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-preview span { font-size: 38px; font-weight: 850; letter-spacing: .04em; }
.profile-photo-card h4 { margin: 0 0 5px; font-size: 19px; }
.profile-photo-card > p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.profile-photo-picker { min-height: 42px; display: grid; place-items: center; padding: 0 14px; border: 1px dashed #cfd6e2; border-radius: 9px; color: #344054; background: #f8fafc; font-size: 13px; font-weight: 750; cursor: pointer; }
.profile-photo-picker:hover { color: var(--red); border-color: rgba(229,0,18,.35); background: #fff7f7; }
.profile-photo-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.profile-photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.profile-photo-actions .btn { min-width: 0; min-height: 40px; padding: 8px 12px; font-size: 12px; }
.profile-identity-card { position: relative; min-height: 270px; display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; align-items: end; gap: 24px; overflow: hidden; padding: 125px 30px 28px; border: 1px solid #e3e8f0; border-radius: 16px; background: #fff; box-shadow: 0 12px 30px rgba(16,24,40,.06); }
.profile-cover-pattern { position: absolute; inset: 0 0 auto; height: 138px; background: radial-gradient(circle at 82% 25%, rgba(255,255,255,.18), transparent 16%), linear-gradient(120deg, #9f000d, #e50012 55%, #ff4451); }
.profile-cover-pattern::after { content: "∑  π  √x  △"; position: absolute; right: 34px; top: 28px; color: rgba(255,255,255,.18); font-size: 28px; font-weight: 900; letter-spacing: 12px; }
.profile-avatar-form { position: relative; z-index: 1; align-self: start; margin-top: -82px; }
.profile-avatar-form .profile-photo-preview { width: 164px; height: 164px; margin: 0; }
.profile-photo-edit { width: 210px; margin-top: 12px; }
.profile-photo-edit[hidden],
.profile-edit-panel[hidden] { display: none !important; }
.profile-identity-copy { position: relative; z-index: 1; padding-bottom: 5px; }
.profile-identity-copy h4 { margin: 7px 0 6px; font-size: clamp(25px, 2.6vw, 36px); line-height: 1.15; }
.profile-identity-copy p { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; color: var(--muted); }
.profile-identity-copy p strong { color: #344054; }
.profile-status { display: inline-flex; padding: 5px 10px; border-radius: 999px; color: #067647; background: #ecfdf3; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.profile-edit-button { position: relative; z-index: 1; align-self: end; min-width: 130px; }
.profile-information-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.profile-information-card { min-height: 245px; }
.profile-information-card dl { display: grid; gap: 0; margin: 0; }
.profile-information-card dl > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 13px 0; border-bottom: 1px solid #edf0f5; }
.profile-information-card dl > div:last-child { border-bottom: 0; }
.profile-information-card dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.profile-information-card dd { margin: 0; color: var(--ink); font-weight: 800; overflow-wrap: anywhere; }
.profile-edit-panel { margin-top: 20px !important; }
.profile-edit-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.profile-edit-fields label { display: grid; gap: 6px; color: #344054; font-size: 13px; font-weight: 750; }
.profile-edit-fields input { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid #d0d5dd; border-radius: 9px; font: inherit; }
.profile-edit-actions { display: flex; gap: 10px; margin-top: 16px; }
.profile-edit-actions .btn { min-width: 145px; }
.profile-subjects-form { margin-top: 20px; }
.profile-subjects-form > p { margin: -7px 0 18px; color: var(--muted); font-size: 13px; }
.profile-enrolled-subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.profile-enrolled-subject-card { display: grid; gap: 5px; padding: 15px; border: 1px solid #e3e8f0; border-radius: 10px; background: #fff; }
.profile-enrolled-subject-card strong { color: var(--ink); font-size: 14px; }
.profile-enrolled-subject-card span,
.profile-enrolled-subject-card small { color: var(--muted); font-size: 13px; }
.profile-subject-enroll-panel { display: grid; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #e4e7ec; }
.profile-subject-enroll-panel[hidden] { display: none; }
.profile-subject-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.profile-subject-option { display: grid; gap: 8px; padding: 15px; border: 1px solid #e3e8f0; border-radius: 10px; background: #fafbfc; }
.profile-subject-option strong { color: var(--ink); font-size: 14px; }
.profile-subject-option select { width: 100%; min-height: 43px; padding: 8px 11px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; }
.profile-subject-mark { display: grid; grid-template-columns: 1fr 110px; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }

/* Public announcements and extra-subject teachers */
.public-content-page { min-height: calc(100vh - 220px); background: linear-gradient(180deg, #fff 0, #fff7f7 360px, #fff 700px); }
.public-page-hero { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 76px 0 48px; text-align: center; }
.public-page-hero > span { display: inline-block; padding: 8px 14px; border-radius: 999px; color: var(--red); background: #ffe9eb; font-size: 12px; font-weight: 850; }
.public-page-hero h1 { margin: 18px 0 12px; font-size: clamp(36px, 5vw, 62px); line-height: 1.1; }
.public-page-hero h1 em { color: var(--red); font-style: normal; }
.public-page-hero p { margin: 0; color: var(--muted); font-size: clamp(14px, 1.6vw, 18px); line-height: 1.75; }
.public-card-section { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 80px; }
.announcement-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.announcement-public-card { min-width: 0; display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr); overflow: hidden; border: 1px solid #f1d6d9; border-radius: 16px; background: #fff; box-shadow: 0 16px 38px rgba(16,24,40,.08), 0 0 22px rgba(229,0,18,.08); }
.announcement-public-card > img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; }
.announcement-public-card > div { min-width: 0; display: flex; align-items: flex-start; flex-direction: column; padding: 25px; }
.announcement-public-card time { color: var(--red); font-size: 12px; font-weight: 800; }
.announcement-public-card h2 { margin: 9px 0; font-size: clamp(20px, 2vw, 27px); overflow-wrap: anywhere; }
.announcement-public-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.announcement-public-card .btn { margin-top: auto; }
.teacher-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.extra-teacher-card { min-width: 0; overflow: hidden; border: 1px solid #f0dadd; border-radius: 16px; background: #fff; box-shadow: 0 14px 34px rgba(16,24,40,.08); transition: transform .2s ease, box-shadow .2s ease; }
.extra-teacher-card:hover { transform: translateY(-5px); box-shadow: 0 20px 42px rgba(16,24,40,.12), 0 0 24px rgba(229,0,18,.13); }
.extra-teacher-card > img { width: 100%; aspect-ratio: 4 / 5; display: block; object-fit: cover; background: #f4f5f7; }
.extra-teacher-card > div { padding: 20px; }
.extra-teacher-card span { color: var(--red); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.extra-teacher-card h2 { margin: 7px 0 8px; font-size: 23px; overflow-wrap: anywhere; }
.extra-teacher-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.extra-teacher-card .btn { width: 100%; }
.public-empty { padding: 48px 20px; border: 1px dashed #e4bfc3; border-radius: 14px; color: var(--muted); background: #fff; font-weight: 750; text-align: center; }
.public-empty[hidden] { display: none; }
.public-page-footer { padding-top: 0; }

@media (max-width: 1050px) {
  .teacher-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .announcement-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .public-page-hero { padding: 52px 0 34px; }
  .teacher-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .announcement-public-card { grid-template-columns: 1fr; }
  .announcement-public-card > img { min-height: 0; aspect-ratio: 16 / 9; }
}

@media (max-width: 480px) {
  .public-page-hero, .public-card-section { width: calc(100% - 28px); }
  .teacher-card-grid { grid-template-columns: 1fr; }
}
.profile-subject-mark input { width: 100%; min-height: 43px; padding: 8px 11px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; }
.profile-subject-mark input:disabled { background: #f2f4f7; cursor: not-allowed; }
.student-term-marks { display: grid; gap: 5px; }
.student-authenticated .portal-main > .student-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
@media (max-width: 900px) {
  .student-authenticated .portal-main > .student-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px; }
  .student-authenticated .portal-main .student-summary-card { min-height: 82px; padding: 12px 9px; }
  .student-authenticated .portal-main .student-summary-card strong { font-size: 23px; }
  .student-authenticated .portal-main .student-summary-card span {
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }
}
@media (max-width: 520px) {
  .student-authenticated .portal-main > .student-summary-grid { gap: 6px; }
  .student-authenticated .portal-main .student-summary-card { min-height: 72px; padding: 10px 7px; border-radius: 10px; }
  .student-authenticated .portal-main .student-summary-card strong { font-size: 20px; }
  .student-authenticated .portal-main .student-summary-card span { font-size: 10px; }
}
.student-id-card-panel { margin-top: 20px; }
.student-id-card-note { margin: -4px 0 18px; color: var(--muted); }
.student-id-card-sheet { display: grid; grid-template-columns: repeat(2, minmax(260px, 360px)); justify-content: center; gap: 24px; }
.student-id-card { aspect-ratio: 5 / 8; position: relative; display: flex; flex-direction: column; align-items: center; overflow: hidden; border: 1px solid #e4e7ec; border-radius: 22px; background: #fff; box-shadow: 0 14px 35px rgba(16,24,40,.12); }
.student-id-card-front { padding: 24px 25px 20px; background: linear-gradient(180deg, #e60012 0 25%, #fff 25%); }
.student-id-card-front header { width: 100%; display: flex; align-items: center; gap: 10px; color: #fff; }
.student-id-card-front header img, .student-id-card-back header img { width: 44px; height: 44px; object-fit: contain; border-radius: 50%; }
.student-id-card-front header div { display: grid; }
.student-id-card-front header strong { font-size: 17px; }
.student-id-card-front header span { font-size: 10px; opacity: .85; letter-spacing: .08em; text-transform: uppercase; }
.student-id-card-photo { width: 142px; height: 142px; display: grid; place-items: center; overflow: hidden; margin: 30px 0 17px; border: 6px solid #fff; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #e60012, #91000b); box-shadow: 0 8px 24px rgba(16,24,40,.18); }
.student-id-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.student-id-card-photo span { font-size: 36px; font-weight: 850; }
.student-id-card h4 { margin: 0 0 8px; text-align: center; font-size: 22px; line-height: 1.15; }
.student-id-card-front > p { margin: 4px 0; color: #667085; }
.student-id-card-number strong { color: #101828; }
.student-id-card-front footer { width: calc(100% + 50px); margin-top: auto; padding: 11px; color: #fff; background: #101828; text-align: center; font-size: 10px; }
.student-id-card-back { justify-content: center; padding: 23px 28px; background: radial-gradient(circle at top right, #ffe8ea, transparent 42%), #fff; }
.student-id-card-back header { display: flex; justify-content: center; margin-bottom: 24px; }
.student-id-card-back header img { width: 82px; height: 82px; }
.student-id-card-qr { position: relative; width: 210px; height: 210px; display: grid; place-items: center; margin: 0; padding: 7px; border: 1px solid #e4e7ec; border-radius: 14px; background: #fff; }
.student-id-card-qr > img:first-child { width: 100%; height: 100%; }
.student-id-card-qr-logo { position: absolute; width: 34px; height: 34px; padding: 3px; border-radius: 8px; background: #fff; object-fit: contain; }
.student-id-card-front-qr { width: 108px; height: 108px; margin: 14px 0 10px; padding: 4px; border-radius: 9px; }
.student-id-card-front-qr .student-id-card-qr-logo { width: 23px; height: 23px; border-radius: 5px; }
@media (max-width: 760px) { .student-id-card-sheet { grid-template-columns: minmax(260px, 360px); } }
@media print {
  body.student-authenticated * { visibility: hidden !important; }
  body.student-authenticated .student-id-card-sheet, body.student-authenticated .student-id-card-sheet * { visibility: visible !important; }
  body.student-authenticated .student-id-card-sheet { position: absolute; inset: 0; width: 100%; display: flex; align-items: flex-start; justify-content: center; gap: 8mm; padding: 10mm; background: #fff; }
  body.student-authenticated .student-id-card { width: 62.5mm; height: 100mm; flex: none; box-shadow: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
.student-card-verification { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f5f7fb; }
.student-card-verification .portal-panel { width: min(100%, 520px); padding: 36px; text-align: center; }
.student-card-verification img { width: 82px; height: 82px; object-fit: contain; margin-bottom: 16px; }
.student-card-verification h1 { margin: 10px 0 22px; }
.student-card-verification [data-verify-details] { display: grid; margin: 20px 0; text-align: left; }
.student-card-verification [data-verify-details][hidden] { display: none; }
.student-card-verification [data-verify-details] p { display: flex; justify-content: space-between; gap: 20px; margin: 0; padding: 12px 0; border-bottom: 1px solid #e4e7ec; }
.student-card-verification [data-verify-details] span { color: #667085; }
.profile-subjects-form > .btn { min-width: 160px; }

@media (max-width: 760px) {
  .student-authenticated .portal-settings-grid .student-mini-form:first-of-type { grid-row: auto; }
  .student-authenticated .portal-main .student-actions { padding: 18px; }
  .student-authenticated .portal-profile-layout { grid-template-columns: 1fr; }
  .profile-identity-card { grid-template-columns: 1fr; padding: 110px 20px 22px; text-align: center; }
  .profile-avatar-form { justify-self: center; margin-top: -75px; }
  .profile-identity-copy p { justify-content: center; }
  .profile-edit-button { justify-self: stretch; width: 100%; }
  .profile-information-grid,
  .profile-edit-fields,
  .profile-enrolled-subjects,
  .profile-subject-options,
  .student-subject-card-grid,
  .student-subject-detail-grid { grid-template-columns: 1fr; }
  .profile-information-card dl > div { grid-template-columns: 1fr; gap: 3px; text-align: left; }
  .profile-edit-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .profile-edit-actions .btn { min-width: 0; }
}
.profile-address-field{grid-column:1/-1}.profile-address-field textarea{resize:vertical;min-height:96px}
