*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --primary-light: #e0f2fe;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, .78);
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --paper: #fffdf8;
  --ink-soft: #334155;
  --success: #059669;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, .14);
  --font-ui: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
  --font-display: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  font-family: var(--font-ui);
}

body {
  background:
    radial-gradient(circle at top left, rgba(8, 145, 178, .12), transparent 28%),
    radial-gradient(circle at top right, rgba(245, 158, 11, .12), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #f8fafc 42%, #f1f5f9 100%);
  color: var(--text);
  min-height: 100vh;
}

body.app-authenticated {
  --app-accent-a: rgba(8, 145, 178, .16);
  --app-accent-b: rgba(245, 158, 11, .12);
  --app-surface-border: rgba(148, 163, 184, .18);
  background: linear-gradient(180deg, #f4f8ff 0%, #edf6ff 22%, #f8fbff 62%, #eef4f8 100%);
  overflow-x: hidden;
}

body.app-authenticated[data-user-role="manager"] {
  --app-accent-a: rgba(37, 99, 235, .16);
  --app-accent-b: rgba(6, 182, 212, .13);
}

body.app-authenticated[data-user-role="school"] {
  --app-accent-a: rgba(14, 165, 233, .15);
  --app-accent-b: rgba(16, 185, 129, .13);
}

body.app-authenticated[data-user-role="teacher"] {
  --app-accent-a: rgba(245, 158, 11, .15);
  --app-accent-b: rgba(8, 145, 178, .14);
}

body.app-authenticated[data-user-role="student"] {
  --app-accent-a: rgba(124, 58, 237, .13);
  --app-accent-b: rgba(14, 165, 233, .13);
}

body.app-authenticated::before,
body.app-authenticated::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body.app-authenticated::before {
  z-index: -2;
  background:
    linear-gradient(118deg, transparent 0%, var(--app-accent-a) 18%, transparent 42%, transparent 60%, var(--app-accent-b) 84%, transparent 100%),
    linear-gradient(160deg, rgba(255, 255, 255, .72) 0%, transparent 34%, transparent 66%, rgba(255, 255, 255, .42) 100%);
  transform: scale(1.08);
  animation: appSceneSweep 18s ease-in-out infinite alternate;
}

body.app-authenticated::after {
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .38), transparent 82%);
  opacity: .42;
  animation: appGridDrift 28s linear infinite;
}

body.app-authenticated #app {
  position: relative;
  isolation: isolate;
}

@keyframes appSceneSweep {
  0% { transform: translate3d(-1.5%, -2%, 0) scale(1.05); }
  100% { transform: translate3d(2%, 1.5%, 0) scale(1.1); }
}

@keyframes appGridDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, -64px, 0); }
}

@keyframes appPageRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-scroll-fx] {
  --scroll-fx-distance: 42px;
  --scroll-fx-scale: .975;
  --scroll-fx-blur: 14px;
  --scroll-fx-delay: 0ms;
  opacity: .001;
  transform: translate3d(0, var(--scroll-fx-distance), 0) scale(var(--scroll-fx-scale));
  filter: blur(var(--scroll-fx-blur));
  transition:
    opacity .72s cubic-bezier(.22, 1, .36, 1) var(--scroll-fx-delay),
    transform .8s cubic-bezier(.22, 1, .36, 1) var(--scroll-fx-delay),
    filter .72s ease var(--scroll-fx-delay);
  will-change: opacity, transform, filter;
}

[data-scroll-fx].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

[data-scroll-fx].is-hidden-up {
  opacity: .001;
  transform: translate3d(0, -28px, 0) scale(.985);
  filter: blur(10px);
}

[data-scroll-fx].is-hidden-down {
  opacity: .001;
  transform: translate3d(0, 34px, 0) scale(.972);
  filter: blur(14px);
}

.landing-hero-panel[data-scroll-fx],
.landing-media-band[data-scroll-fx],
.auth-card[data-scroll-fx],
.card[data-scroll-fx],
.stat-card[data-scroll-fx],
.grade-card[data-scroll-fx],
.book-card[data-scroll-fx],
.unit-card[data-scroll-fx],
.chapter-card[data-scroll-fx],
.assignment-card[data-scroll-fx],
.table-wrapper[data-scroll-fx],
.empty-state[data-scroll-fx] {
  transform-origin: center bottom;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Typography ── */
h1, h2 { font-family: var(--font-display); letter-spacing: -.02em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.45rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }

/* ── Layout ── */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.page { flex: 1; padding: 2rem 1rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: gap; gap: 1rem; }

body.app-authenticated .page {
  max-width: 1240px;
  padding: 1.85rem 1rem 2.6rem;
  animation: appPageRise .58s ease both;
}

body.app-authenticated .page-header h1,
body.app-authenticated .page-section-head h2,
body.app-authenticated .empty-state h2 {
  background: linear-gradient(135deg, #0f172a 0%, #0e7490 56%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Navbar ── */
.navbar {
  background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  backdrop-filter: blur(18px);
}
.navbar-brand { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.touch-edu-logo-img { display: block; width: auto; height: 28px; }
.navbar-right { display: flex; align-items: center; gap: 1rem; }
.navbar-user { font-size: .875rem; color: var(--text-muted); }
.navbar-user strong { color: var(--text); }
.nav-message-link { position: relative; }
.nav-link-has-badge { padding-right: .9rem; }
.nav-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  margin-left: .45rem;
  padding: 0 .38rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 6px 14px rgba(220, 38, 38, .22);
}

body.app-authenticated .navbar {
  position: sticky;
  top: 1rem;
  width: min(1240px, calc(100% - 1.75rem));
  min-height: 72px;
  height: auto;
  margin: 1rem auto 0;
  padding: .9rem 1.15rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .72);
  background: linear-gradient(180deg, rgba(255, 255, 255, .88) 0%, rgba(248, 250, 252, .74) 100%);
  box-shadow:
    0 22px 48px rgba(15, 23, 42, .12),
    inset 0 1px 0 rgba(255, 255, 255, .76);
  overflow: hidden;
}

body.app-authenticated .navbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--app-accent-a), var(--app-accent-b), transparent);
  opacity: .95;
}

body.app-authenticated .navbar-brand {
  gap: .75rem;
  color: var(--text);
  letter-spacing: .02em;
}

body.app-authenticated .navbar-brand .touch-edu-logo-img {
  height: 34px;
  padding: .3rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(8, 145, 178, .16) 0%, rgba(255, 255, 255, .9) 100%);
  box-shadow: 0 10px 20px rgba(8, 145, 178, .12);
}

body.app-authenticated .navbar-right {
  gap: .65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.app-authenticated .navbar-user {
  padding: .55rem .85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(148, 163, 184, .16);
  color: var(--text-muted);
}

body.app-authenticated .navbar .btn-ghost,
body.app-authenticated .navbar .btn-outline {
  background: rgba(255, 255, 255, .54);
  border-color: rgba(148, 163, 184, .15);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .05);
}

body.app-authenticated .navbar .btn-ghost:hover,
body.app-authenticated .navbar .btn-outline:hover {
  border-color: rgba(8, 145, 178, .22);
  background: rgba(255, 255, 255, .8);
  color: var(--primary-dark);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background-color .22s ease, color .22s ease; text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border-color: var(--primary); box-shadow: 0 12px 28px rgba(8, 145, 178, .18); }
.btn-primary:hover { background: linear-gradient(135deg, #0ea5c6 0%, var(--primary-dark) 100%); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 16px 30px rgba(8, 145, 178, .24); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: rgba(224, 242, 254, .78); transform: translateY(-1px); box-shadow: 0 10px 18px rgba(8, 145, 178, .12); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: rgba(226, 232, 240, .68); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-outline { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-light); transform: translateY(-1px); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

body.app-authenticated .btn {
  border-radius: 14px;
}

body.app-authenticated .btn-primary {
  box-shadow: 0 14px 28px rgba(8, 145, 178, .2);
}

body.app-authenticated .btn-outline,
body.app-authenticated .btn-ghost,
body.app-authenticated .btn-danger-outline {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(148, 163, 184, .16);
  box-shadow: 0 12px 22px rgba(15, 23, 42, .05);
}

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.page-section + .page-section { margin-top: 2rem; }
.page-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-section-head p { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }

body.app-authenticated .card,
body.app-authenticated .stat-card,
body.app-authenticated .grade-card,
body.app-authenticated .book-card,
body.app-authenticated .unit-card,
body.app-authenticated .chapter-card,
body.app-authenticated .assignment-card,
body.app-authenticated .table-wrapper,
body.app-authenticated .admin-users-filter-pane,
body.app-authenticated .modal {
  border-color: var(--app-surface-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .94) 0%, rgba(248, 250, 252, .88) 100%);
  box-shadow:
    0 20px 42px rgba(15, 23, 42, .08),
    inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(18px);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease, background .24s ease;
}

body.app-authenticated .card,
body.app-authenticated .stat-card,
body.app-authenticated .grade-card,
body.app-authenticated .book-card,
body.app-authenticated .unit-card,
body.app-authenticated .chapter-card,
body.app-authenticated .assignment-card,
body.app-authenticated .admin-users-filter-pane,
body.app-authenticated .empty-state {
  position: relative;
  overflow: hidden;
}

body.app-authenticated .modal {
  position: relative;
  overflow-y: auto;
}

body.app-authenticated .card::before,
body.app-authenticated .stat-card::before,
body.app-authenticated .grade-card::before,
body.app-authenticated .book-card::before,
body.app-authenticated .unit-card::before,
body.app-authenticated .chapter-card::before,
body.app-authenticated .assignment-card::before,
body.app-authenticated .admin-users-filter-pane::before,
body.app-authenticated .modal::before,
body.app-authenticated .empty-state::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .96), transparent 75%);
  pointer-events: none;
}

body.app-authenticated .card:hover,
body.app-authenticated .stat-card:hover,
body.app-authenticated .admin-users-filter-pane:hover {
  transform: translateY(-2px);
  box-shadow:
    0 26px 54px rgba(15, 23, 42, .1),
    inset 0 1px 0 rgba(255, 255, 255, .82);
}

body.app-authenticated .table-wrapper:hover {
  box-shadow:
    0 26px 54px rgba(15, 23, 42, .1),
    inset 0 1px 0 rgba(255, 255, 255, .82);
}

/* ── Grade Card ── */
.grade-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; cursor: pointer;
  transition: all .15s; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.grade-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--primary); }
.grade-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.grade-card-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: .5rem; }
.grade-card-name { font-size: 1rem; font-weight: 600; color: var(--text); }
.grade-card-meta { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Book Card ── */
.book-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease; box-shadow: var(--shadow);
  position: relative;
}
.book-card::after,
.unit-card::after,
.chapter-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .16), transparent 42%, rgba(14, 116, 144, .08));
  opacity: 0;
  transition: opacity .24s ease;
  pointer-events: none;
}
.book-card:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-lg); border-color: rgba(8, 145, 178, .2); }
.book-card:hover::after,
.unit-card:hover::after,
.chapter-card:hover::after { opacity: 1; }
.book-cover { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.book-cover-thumb {
  display: block;
  position: relative;
  height: 180px;
  padding: 0;
  overflow: hidden;
  background: #e2e8f0;
}
.book-cover-thumb .book-page-loading {
  font-size: .78rem;
}
.book-cover-thumb .book-cover-canvas {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.08);
}
.book-card-main {
  cursor: pointer;
}
.book-body { padding: 1rem; }
.book-title { font-weight: 600; font-size: .95rem; margin-bottom: .25rem; }
.book-subject { display: inline-block; font-size: .72rem; font-weight: 600; padding: .2rem .5rem; border-radius: 20px; background: var(--primary-light); color: var(--primary-dark); }
.book-chapters { font-size: .78rem; color: var(--text-muted); margin-top: .5rem; }
.book-digital-note { font-size: .75rem; font-weight: 600; color: var(--primary-dark); margin-top: .55rem; }
.book-plan-note {
  margin-top: .6rem;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.45;
}
.book-plan-note-approved { color: #166534; }
.book-plan-note-pending { color: #92400e; }
.book-plan-note-empty { color: var(--text-muted); }
.book-card-footer {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding: 0 1rem 1rem;
}
.book-card-footer .btn {
  flex: 1 1 calc(50% - .25rem);
  justify-content: center;
}
.book-section-panel {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.book-section-panel-compact {
  margin: 0;
  padding: .8rem .8rem 0;
}
.book-section-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  appearance: none;
  border: 1px solid rgba(8, 145, 178, .14);
  background: linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, rgba(240, 249, 255, .9) 100%);
  color: var(--text-muted);
  border-radius: 999px;
  padding: .5rem .85rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}
.book-section-btn:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(8, 145, 178, .3);
  box-shadow: 0 10px 20px rgba(8, 145, 178, .08);
}
.book-section-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(8, 145, 178, .2);
}
.book-section-btn.is-locked:not(.active) {
  border-color: rgba(217, 119, 6, .24);
  background: linear-gradient(180deg, rgba(255, 251, 235, .98) 0%, rgba(254, 243, 199, .88) 100%);
  color: #92400e;
}
.book-section-btn[disabled] {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.book-section-btn[disabled]:hover {
  transform: none;
  color: #92400e;
  border-color: rgba(217, 119, 6, .24);
  box-shadow: none;
}
.book-section-btn-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
}
.book-section-btn-status.is-locked {
  background: rgba(217, 119, 6, .12);
  color: #92400e;
}
.book-section-btn-status.is-unlocked {
  background: rgba(8, 145, 178, .12);
  color: var(--primary-dark);
}
.book-section-btn-status svg {
  width: .82rem;
  height: .82rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.book-section-btn.active .book-section-btn-status {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.page-header-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.manager-plan-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.manager-plan-card-readonly {
  gap: 1.1rem;
}
.manager-plan-meta {
  color: var(--text-muted);
  font-size: .86rem;
  line-height: 1.6;
}
.manager-plan-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .4rem .85rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.manager-plan-chip-approved {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.manager-plan-chip-pending {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.manager-plan-chip-empty {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}
.manager-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.manager-plan-textarea {
  min-height: 240px;
  resize: vertical;
}
.manager-plan-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.manager-plan-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 1rem;
}
.manager-plan-block-title {
  font-size: .86rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .6rem;
}
.manager-plan-file-meta {
  color: #334155;
  font-size: .9rem;
  line-height: 1.6;
  min-height: 2.9rem;
}
.manager-plan-file-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .9rem;
}
.manager-plan-block-body {
  white-space: pre-wrap;
  line-height: 1.7;
  color: #334155;
}
.manager-plan-empty,
.manager-plan-empty-inline {
  color: var(--text-muted);
}
.manager-plan-modal-note {
  color: var(--text-muted);
  font-size: .84rem;
  line-height: 1.55;
}
.manager-plan-modal-link {
  margin-bottom: 1rem;
}
.manager-plan-modal-link a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}
.manager-plan-modal-link a:hover {
  text-decoration: underline;
}
.manager-plan-remove-toggle {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  margin-bottom: 1rem;
}

.book-hero {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, .12), transparent 32%),
    linear-gradient(135deg, #fdfefe 0%, #eff6ff 55%, #ecfeff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
  animation: riseIn .55s ease both;
}
.book-hero::before {
  content: "";
  position: absolute;
  inset: auto -4rem -4rem auto;
  width: 12rem;
  height: 12rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(8, 145, 178, .16), transparent 72%);
}
.book-hero-cover-only { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin-left: auto; margin-right: auto; }
.book-hero-cover-only.book-hero-compact { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.book-hero-compact { grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr); }
.book-hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: .75rem; }
.book-hero-copy h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.book-hero-copy p { color: var(--text-muted); line-height: 1.7; margin-bottom: 1rem; }
.book-hero-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-dark); margin-bottom: .5rem; }
.book-hero-meta { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); margin: 0; }
.book-cover-preview {
  min-height: 360px;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .08);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.book-cover-stage {
  min-height: 0;
  border-radius: 16px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, .82), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, .78) 0%, rgba(248, 250, 252, .96) 100%);
  border: 1px solid rgba(15, 23, 42, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .9rem;
  position: relative;
  overflow: hidden;
  animation: riseIn .5s ease both;
}
.book-cover-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, .05), transparent 20%, transparent 80%, rgba(15, 23, 42, .04));
  pointer-events: none;
}
.book-cover-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 22px 48px rgba(15, 23, 42, .16);
}
.book-cover-display {
  min-height: 360px;
  border-radius: calc(var(--radius) - 4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  gap: 1rem;
}
.book-cover-display-fallback {
  min-height: 280px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid rgba(15, 23, 42, .08);
}
.book-cover-display-photo {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92);
}
.book-cover-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  text-align: center;
  padding: .25rem 0 .1rem;
}
.book-cover-display-stats {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.book-cover-display-stat {
  padding: .5rem .8rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .08);
}
.book-cover-display-icon { font-size: 4rem; font-weight: 800; color: var(--primary-dark); }
.book-cover-display-title { font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 700; color: var(--text); max-width: 320px; }

.unit-grid, .chapter-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.unit-card, .chapter-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  position: relative;
  overflow: hidden;
}
.unit-card:hover, .chapter-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}
.unit-card-index { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-dark); margin-bottom: .5rem; }
.unit-card-title, .chapter-card-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.unit-card-meta, .chapter-card-meta, .chapter-card-copy { color: var(--text-muted); font-size: .84rem; }
.unit-card-meta, .chapter-card-copy { margin-top: .55rem; }
.chapter-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.chapter-card-completed { border-color: rgba(8, 145, 178, .25); background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%); }
.unit-card,
.chapter-card,
.book-card { animation: riseIn .45s ease both; }

/* Progress */
.progress-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.progress-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .85rem;
}
.progress-panel-head h3 { font-size: 1rem; margin: 0; }
.progress-panel-head p { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }
.progress-percent { font-size: 1.4rem; font-weight: 800; color: var(--primary); line-height: 1; }
.progress-track {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: #e2e8f0;
}
.progress-fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #0891b2 0%, #0f766e 100%);
}
.student-progress-list { display: flex; flex-direction: column; gap: .85rem; }
.student-progress-row {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .85rem .95rem; background: #f8fafc;
}
.student-progress-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem;
}
.student-progress-name { font-weight: 600; color: var(--text); }
.student-progress-meta { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.student-progress-stats { font-size: .85rem; font-weight: 600; color: var(--primary-dark); }

/* Assignment cards */
.assignment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.assignment-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .85rem;
}
.assignment-card-compact {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.assignment-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.assignment-card-title { font-size: .98rem; font-weight: 700; color: var(--text); }
.assignment-card-meta { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; line-height: 1.5; }
.assignment-card-body {
  font-size: .88rem; line-height: 1.65; color: #334155;
  padding: .8rem; border-radius: var(--radius-sm); background: #f8fafc; border: 1px solid var(--border);
}
.assignment-card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.assignment-empty { color: var(--text-muted); font-size: .9rem; }
.assignment-note { background: #f8fafc; color: var(--text-muted); font-size: .85rem; }
.assignment-detail-card { max-width: 820px; margin: 0 auto 1.5rem; }
.assignment-detail-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-dark); margin-bottom: .65rem; }
.assignment-detail-meta { display: flex; gap: .75rem; flex-wrap: wrap; color: var(--text-muted); font-size: .84rem; margin: .75rem 0 1rem; }
.assignment-detail-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.assignment-submit-form { margin-top: 1rem; }
.assignment-answer-input { resize: vertical; min-height: 120px; }
.assignment-current-file { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .88rem; color: var(--text); margin-bottom: .75rem; }
.assignment-current-file a { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
.assignment-current-file a:hover { text-decoration: underline; }
.assignment-remove-file { display: inline-flex; align-items: center; gap: .45rem; font-size: .84rem; color: var(--text-muted); margin-bottom: .5rem; }
.assignment-submission-meta { color: var(--primary-dark); font-size: .84rem; font-weight: 600; margin-top: .75rem; }
.submission-list { display: flex; flex-direction: column; gap: 1rem; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.resource-card {
  display: flex;
  flex-direction: column;
  gap: .95rem;
}
.resource-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .85rem;
}
.resource-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.resource-card-meta {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .3rem;
  line-height: 1.5;
}
.resource-card-body {
  font-size: .88rem;
  line-height: 1.65;
  color: #334155;
  padding: .85rem .95rem;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border);
}
.resource-card-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.resource-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .32rem .7rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: rgba(8, 145, 178, .1);
  border: 1px solid rgba(8, 145, 178, .18);
}
.resource-preview {
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .08);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}
.resource-preview-image,
.resource-preview-video iframe,
.resource-preview-video video {
  display: block;
  width: 100%;
}
.resource-preview-image {
  max-height: 260px;
  object-fit: cover;
}
.resource-preview-video iframe {
  aspect-ratio: 16 / 9;
  border: 0;
}
.resource-preview-video video {
  background: #0f172a;
}
.resource-preview-link {
  min-height: 140px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .45rem;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, .14), transparent 32%),
    linear-gradient(135deg, rgba(8, 145, 178, .08) 0%, rgba(239, 246, 255, .96) 100%);
}
.resource-preview-link-kicker {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-dark);
}
.resource-preview-link-host {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}
.note-compose-card { max-width: 820px; }
.note-compose-head h2 { font-size: 1.05rem; margin: 0; }
.note-form { margin-top: 1rem; }
.note-message-input { resize: vertical; min-height: 180px; }
.note-list { display: flex; flex-direction: column; gap: 1rem; }
.note-card { display: flex; flex-direction: column; gap: .9rem; }
.note-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.note-card-title { font-size: .98rem; font-weight: 700; color: var(--text); }
.note-card-meta { color: var(--text-muted); font-size: .82rem; margin-top: .3rem; line-height: 1.5; }
.message-card-status { color: var(--primary-dark); font-size: .8rem; font-weight: 600; margin-top: .35rem; }
.note-card-time { color: var(--primary-dark); font-size: .82rem; font-weight: 600; }
.note-card-body {
  white-space: pre-wrap;
  line-height: 1.65;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .95rem 1rem;
}
.assessment-alert-card {
  border-color: rgba(245, 158, 11, .2);
  box-shadow: 0 16px 34px rgba(245, 158, 11, .08);
}
.assessment-alert-summary {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: .84rem;
}
.note-card-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.note-reply-box {
  border: 1px solid rgba(8, 145, 178, .18);
  background: rgba(236, 254, 255, .75);
  border-radius: var(--radius-sm);
  padding: .95rem 1rem;
}
.note-reply-meta {
  color: var(--primary-dark);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .5rem;
}
.note-reply-body {
  white-space: pre-wrap;
  line-height: 1.65;
  color: #164e63;
}
.note-reply-empty {
  color: var(--text-muted);
  font-size: .85rem;
}
.submission-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 1rem;
}
.submission-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.submission-student-name { font-size: .95rem; font-weight: 700; color: var(--text); }
.submission-student-meta { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.submission-time { font-size: .82rem; font-weight: 600; color: var(--primary-dark); }
.submission-answer {
  white-space: pre-wrap;
  line-height: 1.65;
  color: #334155;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .8rem;
}
.submission-attachment {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: .84rem;
  margin-top: .75rem;
}
.submission-attachment a { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
.submission-attachment a:hover { text-decoration: underline; }
.badge-due { background: #dcfce7; color: #166534; }
.badge-overdue { background: #fee2e2; color: #b91c1c; }

/* ── Auth pages ── */
@keyframes authBackgroundShift {
  0% { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
  50% { transform: scale(1.14) translate3d(1.2%, .8%, 0); }
  100% { transform: scale(1.1) translate3d(.4%, 1.6%, 0); }
}
@keyframes authBeamSweep {
  0% { transform: translate3d(-18vw, 0, 0) rotate(-26deg); opacity: 0; }
  18%, 72% { opacity: .78; }
  100% { transform: translate3d(118vw, 0, 0) rotate(-26deg); opacity: 0; }
}
@keyframes authLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes authIntroRise {
  0% { opacity: 0; transform: translateY(18px) scale(.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
  background: #07111c;
}
.auth-page::before {
  content: "";
  position: absolute;
  inset: -5%;
  z-index: 0;
  background-image:
    linear-gradient(180deg, rgba(3, 10, 21, .48), rgba(3, 10, 21, .86)),
    var(--auth-entry-bg);
  background-size: cover;
  background-position: center;
  filter: saturate(1.06) contrast(1.05);
  animation: authBackgroundShift 24s ease-in-out infinite alternate;
}
.auth-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(115deg, rgba(2, 8, 23, .94) 0%, rgba(2, 8, 23, .68) 38%, rgba(2, 8, 23, .9) 100%),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, .08) 0 1px, transparent 1px 138px),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, .06) 0 1px, transparent 1px 92px);
}
.auth-page-effects {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.auth-page-beam {
  position: absolute;
  left: -28vw;
  width: 46vw;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(125, 211, 252, .85) 50%, transparent 100%);
  box-shadow: 0 0 22px rgba(125, 211, 252, .34);
  filter: blur(.2px);
  opacity: 0;
  animation: authBeamSweep 12s linear infinite;
}
.auth-page-beam-1 { top: 18%; }
.auth-page-beam-2 { top: 52%; animation-delay: -4s; }
.auth-page-beam-3 { top: 76%; animation-delay: -8s; }
.auth-page-shell {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(24px) scale(.985);
  transition: opacity .72s ease, transform .72s cubic-bezier(.22, 1, .36, 1);
}
.auth-page.is-ready .auth-page-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.25rem;
  color: #f8fafc;
}
.auth-logo .touch-edu-logo-img {
  height: 44px;
  flex: none;
  animation: authLogoFloat 5.6s ease-in-out infinite;
}
.auth-logo-subtitle {
  margin-top: .32rem;
  color: rgba(226, 232, 240, .8);
  font-size: .9rem;
  line-height: 1.5;
}
.auth-card {
  width: 100%;
  max-width: none;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 24px;
  padding: 1.6rem;
  box-shadow: 0 30px 70px rgba(2, 8, 23, .36);
  backdrop-filter: blur(22px) saturate(1.15);
}
.auth-card h2 {
  text-align: left;
  margin-bottom: .28rem;
  color: #f8fafc;
  font-size: clamp(1.7rem, 3.2vw, 2rem);
}
.auth-card-lead {
  margin-bottom: 1.25rem;
  color: rgba(226, 232, 240, .76);
  line-height: 1.65;
}
.auth-role-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
  padding: .35rem;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
}
.auth-role-tab {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: .62rem .5rem;
  background: transparent;
  color: rgba(226, 232, 240, .8);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.auth-role-tab:hover {
  transform: translateY(-1px);
  color: #f8fafc;
}
.auth-role-tab.is-active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0891b2 100%);
  color: #fff;
  box-shadow: 0 12px 22px rgba(14, 165, 233, .26);
}
.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .875rem;
  color: rgba(226, 232, 240, .72);
}
.auth-footer a {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }
.auth-page .form-label { color: rgba(226, 232, 240, .88); }
.auth-page .form-control {
  background: rgba(248, 250, 252, .95);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
}
.auth-page .form-control:focus {
  border-color: rgba(125, 211, 252, .84);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .16);
}
.auth-page .btn-primary { box-shadow: 0 18px 34px rgba(14, 165, 233, .22); }
.auth-intro-splash {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(2, 8, 23, .18), rgba(2, 8, 23, .82));
  backdrop-filter: blur(10px);
  transition: opacity .7s ease, visibility .7s ease;
}
.auth-intro-splash::before {
  content: "";
  position: absolute;
  inset: -6%;
  background-image:
    linear-gradient(180deg, rgba(3, 10, 21, .26), rgba(3, 10, 21, .64)),
    var(--auth-entry-bg);
  background-size: cover;
  background-position: center;
  filter: saturate(1.08) contrast(1.06);
  animation: authBackgroundShift 18s ease-in-out infinite alternate;
}
.auth-intro-splash.is-exiting {
  opacity: 0;
  visibility: hidden;
}
.auth-intro-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(2, 8, 23, .78) 0%, rgba(2, 8, 23, .44) 42%, rgba(2, 8, 23, .8) 100%),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, .08) 0 1px, transparent 1px 128px),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, .06) 0 1px, transparent 1px 84px);
}
.auth-intro-core {
  position: relative;
  z-index: 1;
  padding: 1.6rem;
  animation: authIntroRise 1.15s cubic-bezier(.22, 1, .36, 1) both;
}
.auth-intro-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.auth-intro-brand .touch-edu-logo-img {
  height: 84px;
  filter: drop-shadow(0 24px 48px rgba(8, 145, 178, .35));
}
.auth-intro-subtitle {
  margin-top: .7rem;
  color: rgba(226, 232, 240, .82);
  font-size: .96rem;
  line-height: 1.6;
}

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .4rem; color: var(--text); }
.form-control {
  width: 100%; padding: .6rem .85rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9rem; background: var(--surface);
  color: var(--text); transition: border-color .15s; outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,145,178,.1); }
select.form-control { cursor: pointer; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: .3rem; }

.password-input-wrap { position: relative; }
.password-input-wrap .form-control { padding-right: 2.6rem; }
.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: .5rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.password-toggle-btn:hover { color: var(--text); }
.password-toggle-btn svg { width: 20px; height: 20px; }
.password-toggle-btn.is-visible { color: var(--primary); }
.password-toggle-btn.is-visible::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 1px;
}

/* ── Alert ── */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: 1rem; }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid #fca5a5; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #86efac; }

/* ── Reader layout ── */
.reader-layout {
  display: flex;
  gap: 0;
  height: calc(100vh - 60px);
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(8, 145, 178, .08), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #f7fafc 100%);
}
.reader-sidebar {
  width: 280px; min-width: 280px; background: rgba(255, 255, 255, .82);
  border-right: 1px solid var(--border); overflow-y: auto;
  padding: 1.5rem 0; flex-shrink: 0;
  backdrop-filter: blur(18px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .55);
}
.reader-sidebar-title {
  font-weight: 700;
  font-size: 1rem;
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
  font-family: var(--font-display);
}
.reader-overview-link, .reader-unit-link {
  display: block;
  width: calc(100% - 2.5rem);
  margin: 0 1.25rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text);
  padding: .7rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.reader-overview-link:hover, .reader-unit-link:hover { border-color: var(--primary); color: var(--primary-dark); }
.reader-unit-block + .reader-unit-block { margin-top: .5rem; }
.reader-unit-block { animation: riseIn .45s ease both; }
.reader-unit-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .25rem 1.25rem .4rem;
}
.chapter-item {
  padding: .65rem 1.25rem; cursor: pointer; font-size: .875rem;
  color: var(--text-muted); transition: all .1s; border-left: 3px solid transparent;
  display: flex; align-items: center; gap: .5rem;
}
.chapter-item:hover { background: rgba(241, 245, 249, .9); color: var(--text); transform: translateX(2px); }
.chapter-item.active {
  background: linear-gradient(90deg, rgba(224, 242, 254, .95) 0%, rgba(240, 253, 250, .96) 100%);
  color: var(--primary-dark);
  border-left-color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.chapter-item.completed { color: var(--text); }
.chapter-item-num { font-size: .75rem; font-weight: 700; min-width: 20px; }
.chapter-item-copy { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.chapter-item-page { font-size: .72rem; color: var(--text-muted); }
.chapter-item.completed .chapter-item-num { color: var(--primary-dark); }
.chapter-item-status {
  margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--primary-dark);
  background: var(--primary-light); padding: .15rem .45rem; border-radius: 999px;
}
.reader-sidebar-actions {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.reader-main { flex: 1; overflow-y: auto; padding: 3rem 2rem; }
.reader-content { max-width: 1180px; margin: 0 auto; animation: riseIn .5s ease both; }
.reader-back { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-muted); text-decoration: none; font-size: .875rem; margin-bottom: 1.5rem; transition: color .15s; }
.reader-back:hover { color: var(--primary); }
.chapter-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-dark); margin-bottom: .75rem; }
.chapter-title {
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(226, 232, 240, .9);
  padding-bottom: 1rem;
  font-family: var(--font-display);
  letter-spacing: -.03em;
}
.chapter-body {
  line-height: 1.8;
  color: var(--ink-soft);
  font-size: 1.05rem;
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.chapter-guide {
  background: linear-gradient(180deg, rgba(255, 255, 255, .96) 0%, rgba(248, 250, 252, .96) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: riseIn .48s ease both;
}
.chapter-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.chapter-guide-head h3 { font-size: 1rem; margin: 0; }
.chapter-guide-head p { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }
.chapter-guide-body {
  padding: 1rem 1.1rem;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, .98) 0%, rgba(255, 255, 255, .95) 100%);
  color: var(--ink-soft);
  line-height: 1.7;
  white-space: pre-wrap;
}
.book-page-reader {
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, .08), transparent 24%),
    linear-gradient(180deg, #dfe7f0 0%, #d5dee8 42%, #cfd8e3 100%);
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 22px;
  box-shadow: var(--shadow-xl);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  white-space: normal;
  position: relative;
  overflow: hidden;
  animation: riseIn .52s ease both;
}
.book-page-reader::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, .2), transparent 24%, rgba(255, 255, 255, .1) 55%, transparent 85%);
  pointer-events: none;
}
.book-page-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.book-page-label {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
}
.book-page-meta {
  color: var(--primary-dark);
  font-size: .82rem;
  font-weight: 700;
  margin-top: .25rem;
}
.book-page-progress {
  color: var(--text-muted);
  font-size: .85rem;
  margin-top: .2rem;
}
.book-page-controls {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
}
.book-annotation-toolbar {
  display: none;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .8rem .95rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: rgba(255, 255, 255, .8);
  position: relative;
  z-index: 2;
}
.book-annotation-group {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.book-annotation-tool,
.book-annotation-style,
.book-annotation-clear {
  border: 1px solid rgba(15, 23, 42, .12);
  background: rgba(255, 255, 255, .92);
  color: var(--text);
  border-radius: 999px;
  padding: .45rem .8rem;
  font-size: .8rem;
  font-weight: 700;
  min-height: 36px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.book-annotation-tool:hover,
.book-annotation-style:hover,
.book-annotation-clear:hover {
  transform: translateY(-1px);
}
.book-annotation-tool.is-active,
.book-annotation-style.is-active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.book-annotation-swatch {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .82);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .16);
  background: var(--annotation-color, #0f172a);
  transition: transform .18s ease, box-shadow .18s ease;
}
.book-annotation-swatch.is-active {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--primary), 0 8px 18px rgba(15, 23, 42, .16);
}
.book-annotation-slider {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.book-annotation-slider input[type="range"] {
  width: 108px;
  accent-color: var(--primary);
}
.book-page-text-editor {
  position: absolute;
  z-index: 3;
  min-height: 48px;
  max-width: min(420px, 80%);
  padding: .2rem .25rem;
  border: 0;
  outline: none;
  resize: none;
  overflow: hidden;
  background: rgba(255, 255, 255, .14);
  color: #0f172a;
  line-height: 1.3;
  white-space: pre-wrap;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, .45), 0 14px 28px rgba(15, 23, 42, .18);
  backdrop-filter: blur(1px);
}
.book-page-sheet {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, .12);
  background:
    linear-gradient(180deg, rgba(203, 213, 225, .94) 0%, rgba(226, 232, 240, .98) 100%);
  position: relative;
  transition: background .22s ease, padding .22s ease, border-color .22s ease;
}
.book-page-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: rgba(255, 255, 255, .9);
  color: #0f172a;
  box-shadow: 0 16px 30px rgba(15, 23, 42, .14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  font-weight: 700;
  z-index: 4;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, opacity .18s ease;
}
.book-page-arrow:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.04);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 20px 34px rgba(15, 23, 42, .2);
}
.book-page-arrow:disabled {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
}
.book-page-arrow-prev { left: .65rem; }
.book-page-arrow-next { right: .65rem; }
.book-page-arrow span {
  line-height: 1;
  transform: translateY(-1px);
}
.book-page-stage {
  min-height: 64vh;
  border-radius: 16px;
  background: linear-gradient(180deg, #bcc8d6 0%, #d6dee8 100%);
  border: 1px solid rgba(15, 23, 42, .14);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  padding: 1rem;
  position: relative;
  perspective: 1800px;
  overflow: hidden;
  transition: gap .22s ease, padding .22s ease, background .22s ease, border-color .22s ease;
}
.book-page-stage.is-spread {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.book-page-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, .08), transparent 18%, transparent 82%, rgba(15, 23, 42, .08));
  pointer-events: none;
}
.book-page-turn-overlay {
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  width: calc(50% - 1.35rem);
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .98) 0%, rgba(248, 250, 252, .96) 42%, rgba(226, 232, 240, .92) 72%, rgba(148, 163, 184, .45) 100%);
  box-shadow:
    0 24px 42px rgba(15, 23, 42, .18),
    inset 0 0 0 1px rgba(15, 23, 42, .06);
  will-change: transform, opacity, filter;
}
.book-page-stage.is-single .book-page-turn-overlay {
  width: calc(100% - 2rem);
}
.book-page-stage.is-spread::after {
  content: "";
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 50%;
  width: 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(15, 23, 42, .08), rgba(255, 255, 255, .65), rgba(15, 23, 42, .08));
  opacity: .6;
  pointer-events: none;
}
.book-page-slot {
  min-width: 0;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.book-page-slot[hidden] {
  display: none !important;
}
.book-page-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 22px 48px rgba(15, 23, 42, .16);
  border: 1px solid rgba(15, 23, 42, .08);
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform, opacity, filter;
}
.book-page-annotation-layer {
  position: absolute;
  z-index: 1;
  background: transparent;
  touch-action: none;
}
.book-page-slot-left .book-page-canvas { transform-origin: center right; }
.book-page-slot-right .book-page-canvas { transform-origin: center left; }
.book-page-stage.is-single .book-page-canvas { transform-origin: center center; }
.book-page-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: transparent;
  font-size: 0;
  padding: 1rem;
  background: transparent;
  pointer-events: none;
}
.book-page-loading[data-state="loading"]::before {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(8, 145, 178, .16);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite, shimmerPulse 1.4s ease-in-out infinite;
}
.book-page-loading[data-state="error"] {
  color: var(--text-muted);
  font-size: .92rem;
  background: rgba(255, 255, 255, .9);
}
.book-page-stage.is-ready .book-page-canvas,
.book-cover-stage.is-ready .book-cover-canvas {
  animation: paperSettle .42s ease both;
}
.book-cover-stage.is-ready .book-cover-canvas {
  animation: paperSettle .42s ease both, coverFloat 7.5s ease-in-out .45s infinite;
}
.book-page-stage.is-single.is-turning-forward .book-page-canvas,
.book-page-stage.is-spread.is-turning-forward .book-page-slot-right .book-page-canvas {
  animation: pageTurnForward .62s cubic-bezier(.2, .78, .18, 1) both;
}
.book-page-stage.is-single.is-turning-backward .book-page-canvas,
.book-page-stage.is-spread.is-turning-backward .book-page-slot-left .book-page-canvas {
  animation: pageTurnBackward .62s cubic-bezier(.2, .78, .18, 1) both;
}
.book-page-stage.is-spread.is-turning-forward .book-page-slot-left .book-page-canvas,
.book-page-stage.is-spread.is-turning-backward .book-page-slot-right .book-page-canvas {
  animation: paperSettle .36s ease both;
}
.book-page-stage.is-single.is-turning-forward .book-page-canvas { transform-origin: center right; }
.book-page-stage.is-single.is-turning-backward .book-page-canvas { transform-origin: center left; }
.book-page-stage.is-turning-forward .book-page-turn-overlay {
  left: 50%;
  transform-origin: left center;
  animation: pageLeafForward .62s cubic-bezier(.2, .78, .18, 1) both;
}
.book-page-stage.is-turning-backward .book-page-turn-overlay {
  right: 50%;
  transform-origin: right center;
  animation: pageLeafBackward .62s cubic-bezier(.2, .78, .18, 1) both;
}
.book-page-stage.is-single.is-turning-forward .book-page-turn-overlay {
  left: 1rem;
  transform-origin: left center;
}
.book-page-stage.is-single.is-turning-backward .book-page-turn-overlay {
  right: 1rem;
  transform-origin: right center;
}
.book-page-reader::backdrop {
  background: rgba(15, 23, 42, .82);
  backdrop-filter: blur(8px);
}
.book-page-reader:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border-radius: 0;
  padding: 1rem 1.2rem 1.2rem;
  isolation: isolate;
  background: linear-gradient(160deg, var(--chapter-fs-start, #243140) 0%, var(--chapter-fs-mid, #1f2937) 48%, var(--chapter-fs-end, #17202d) 100%);
}
.book-page-reader:fullscreen::before {
  content: "";
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(circle at 16% 24%, var(--chapter-fs-glow-a, rgba(34, 211, 238, .22)), transparent 30%),
    radial-gradient(circle at 82% 18%, var(--chapter-fs-glow-b, rgba(245, 158, 11, .16)), transparent 28%),
    radial-gradient(circle at 54% 84%, var(--chapter-fs-glow-c, rgba(16, 185, 129, .14)), transparent 36%);
  filter: blur(8px);
  opacity: .95;
  animation: chapterAuraDrift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
.book-page-reader:fullscreen::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .05), transparent 28%, rgba(255, 255, 255, .03) 52%, transparent 76%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .04), transparent 42%);
  opacity: .8;
  animation: chapterMeshShift 22s linear infinite;
  pointer-events: none;
}
.book-page-reader:fullscreen .book-page-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: .5rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
}
.book-page-reader:fullscreen .book-annotation-toolbar {
  display: flex;
  position: sticky;
  top: 5.85rem;
  z-index: 5;
  background: rgba(15, 23, 42, .72);
  border-color: rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
}
.book-page-reader:fullscreen .book-annotation-tool,
.book-page-reader:fullscreen .book-annotation-style,
.book-page-reader:fullscreen .book-annotation-clear {
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, .1);
}
.book-page-reader:fullscreen .book-annotation-tool.is-active,
.book-page-reader:fullscreen .book-annotation-style.is-active {
  background: #f8fafc;
  color: #0f172a;
  border-color: transparent;
}
.book-page-reader:fullscreen .book-annotation-slider {
  color: #cbd5e1;
}
.book-page-reader:fullscreen .book-page-toolbar,
.book-page-reader:fullscreen .book-page-sheet {
  position: relative;
  z-index: 2;
}
.book-page-reader:fullscreen .book-page-label { color: #f8fafc; }
.book-page-reader:fullscreen .book-page-progress { color: #cbd5e1; }
.book-page-reader:fullscreen .book-page-meta { color: #7dd3fc; }
.book-page-reader:fullscreen .book-page-sheet {
  border-color: rgba(255, 255, 255, .1);
  background:
    radial-gradient(circle at 18% 22%, var(--chapter-fs-glow-a, rgba(34, 211, 238, .18)), transparent 30%),
    radial-gradient(circle at 84% 14%, var(--chapter-fs-glow-b, rgba(245, 158, 11, .16)), transparent 28%),
    linear-gradient(145deg, rgba(15, 23, 42, .48) 0%, rgba(15, 23, 42, .26) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  overflow: hidden;
  isolation: isolate;
}
.book-page-reader:fullscreen .book-page-sheet::before {
  content: "";
  position: absolute;
  inset: -16%;
  background:
    radial-gradient(circle at 18% 22%, var(--chapter-fs-glow-a, rgba(34, 211, 238, .2)), transparent 20%),
    radial-gradient(circle at 82% 20%, var(--chapter-fs-glow-b, rgba(245, 158, 11, .18)), transparent 18%),
    radial-gradient(circle at 56% 78%, var(--chapter-fs-glow-c, rgba(16, 185, 129, .18)), transparent 22%);
  filter: blur(18px);
  opacity: .9;
  animation: chapterOrbDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
.book-page-reader:fullscreen .book-page-sheet::after {
  content: "";
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .22) 0 2px, transparent 3px),
    radial-gradient(circle at 74% 24%, rgba(255, 255, 255, .18) 0 2px, transparent 3px),
    radial-gradient(circle at 36% 72%, rgba(255, 255, 255, .18) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 86% 76%, rgba(255, 255, 255, .2) 0 2px, transparent 3px);
  background-size: 32% 32%, 28% 28%, 24% 24%, 36% 36%;
  opacity: .35;
  animation: chapterParticleDrift 26s linear infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}
.book-page-reader:fullscreen .book-page-stage {
  background:
    radial-gradient(circle at 20% 18%, var(--chapter-fs-glow-a, rgba(34, 211, 238, .16)), transparent 26%),
    radial-gradient(circle at 78% 20%, var(--chapter-fs-glow-b, rgba(245, 158, 11, .14)), transparent 24%),
    radial-gradient(circle at 52% 78%, var(--chapter-fs-glow-c, rgba(16, 185, 129, .14)), transparent 30%),
    linear-gradient(180deg, var(--chapter-fs-mid, #1f2937) 0%, var(--chapter-fs-end, #17202d) 100%);
  border-color: rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  position: relative;
  z-index: 1;
  gap: .1rem;
  padding: .85rem .7rem;
  align-items: center;
}
.book-page-reader:fullscreen .book-page-stage::before {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, .18), transparent 18%, transparent 82%, rgba(15, 23, 42, .18)),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .04), transparent 42%);
  animation: chapterStageShift 14s ease-in-out infinite alternate;
}
.book-page-reader:fullscreen .book-page-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
}
.book-page-reader:fullscreen .book-page-stage {
  flex: 1;
  min-height: 0;
  height: 100%;
}
.book-page-reader:fullscreen .book-page-stage.is-spread .book-page-slot-left {
  justify-content: flex-end;
  padding-right: .12rem;
}
.book-page-reader:fullscreen .book-page-stage.is-spread .book-page-slot-right {
  justify-content: flex-start;
  padding-left: .12rem;
}
.book-page-reader:fullscreen .book-page-stage.is-spread .book-page-slot-left .book-page-canvas {
  margin-right: -.35rem;
}
.book-page-reader:fullscreen .book-page-stage.is-spread .book-page-slot-right .book-page-canvas {
  margin-left: -.35rem;
}
.book-page-reader:fullscreen .book-page-stage.is-spread::after {
  top: .85rem;
  bottom: .85rem;
  width: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(15, 23, 42, .24), rgba(255, 255, 255, .12));
  opacity: .75;
}
.book-page-reader:fullscreen .book-page-canvas {
  max-height: calc(100vh - 13rem);
  width: auto;
  max-width: 100%;
}
.chapter-assessment {
  margin-top: 2rem; background: rgba(255, 255, 255, .94); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow-lg);
  animation: riseIn .56s ease both;
}
.chapter-assessment-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .85rem;
}
.chapter-assessment-head h3 { font-size: 1rem; margin: 0; }
.chapter-assessment-head p { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }
.chapter-assessment-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(248, 250, 252, .98), rgba(240, 249, 255, .98));
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.chapter-assessment-toggle:hover {
  border-color: rgba(8, 145, 178, .35);
  box-shadow: 0 14px 30px rgba(8, 145, 178, .12);
  transform: translateY(-1px);
}
.chapter-assessment-toggle:focus-visible {
  outline: 2px solid rgba(8, 145, 178, .28);
  outline-offset: 2px;
}
.chapter-assessment-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.chapter-assessment-toggle-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.chapter-assessment-toggle-text {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.chapter-assessment-toggle-icon {
  flex: 0 0 auto;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  transition: transform .18s ease, color .18s ease;
}
.chapter-assessment-toggle[aria-expanded="true"] .chapter-assessment-toggle-icon {
  transform: rotate(90deg);
  color: var(--primary);
}
.chapter-assessment-attempts {
  margin-top: .85rem;
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 1.55;
}
.chapter-assessment-panel {
  margin-top: 1rem;
}
.chapter-assessment-question {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .85rem .95rem; color: var(--text); line-height: 1.6;
}
.chapter-assessment-form { margin-top: 1rem; }
.assessment-question-block + .assessment-question-block {
  margin-top: 1rem;
}
.assessment-question-number {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: .45rem;
}
.assessment-choice-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.assessment-choice {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.assessment-choice:hover {
  border-color: rgba(8, 145, 178, .35);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
  transform: translateY(-1px);
}
.assessment-choice input[type="radio"] {
  margin-top: .18rem;
  accent-color: var(--primary);
  flex: 0 0 auto;
}
.assessment-choice span {
  color: var(--text);
  line-height: 1.55;
}
.assessment-choice:has(input:checked) {
  border-color: var(--primary);
  background: rgba(8, 145, 178, .08);
  box-shadow: 0 10px 24px rgba(8, 145, 178, .12);
}
.chapter-assessment-answer {
  margin-top: .85rem; color: var(--text-muted); font-size: .88rem; line-height: 1.55;
}
.reader-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  animation: riseIn .6s ease both;
}
.chapter-assignments { margin-top: 2rem; animation: riseIn .54s ease both; }
.chapter-assignments-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.chapter-assignments-head p { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }

/* ── Admin ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.stat-card-actions { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.stat-card-actions .btn { width: 100%; justify-content: center; }

/* ── Table ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th { background: var(--bg); padding: .75rem 1rem; text-align: left; font-size: .8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
td { padding: .8rem 1rem; font-size: .875rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

body.app-authenticated .table-wrapper {
  border-radius: 22px;
}

body.app-authenticated table {
  background: transparent;
}

body.app-authenticated th {
  background: rgba(241, 245, 249, .78);
}

body.app-authenticated td {
  background: transparent;
}

body.app-authenticated tr:hover td {
  background: rgba(240, 249, 255, .72);
}
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge-manager { background: #fef3c7; color: #92400e; }
.badge-school { background: #dcfce7; color: #166534; }
.badge-student { background: #ede9fe; color: #5b21b6; }
.badge-teacher { background: #dbeafe; color: #1d4ed8; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-frozen { background: #fee2e2; color: #b91c1c; }

.admin-users-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-users-filter-pane {
  flex: 1;
  min-width: min(520px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 1rem;
}

.admin-users-filter-pane-title {
  color: var(--primary-dark);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .85rem;
}

.admin-users-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.admin-users-filter {
  width: 100%;
}

.admin-users-bulk-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .75rem;
  justify-content: center;
  min-width: 190px;
}

.admin-users-selection-summary {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
}

.admin-users-table {
  table-layout: fixed;
}

.admin-users-table th,
.admin-users-table td {
  padding: .72rem .78rem;
  overflow-wrap: anywhere;
}

.school-rollup-row td {
  padding: 0;
  background: #f8fafc;
}

.school-rollup-bar {
  display: flex;
  align-items: stretch;
  gap: .2rem;
}

.school-rollup-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: .85rem;
  padding-right: .15rem;
  flex: none;
}

.school-rollup-selector input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.school-rollup-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  flex: 1;
}

.school-rollup-toggle:hover {
  background: rgba(226, 232, 240, .55);
}

.school-rollup-chevron {
  width: 1rem;
  color: var(--primary-dark);
  font-size: .9rem;
  flex: none;
}

.school-rollup-logo {
  display: flex;
  align-items: center;
  flex: none;
}

.school-rollup-copy {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  min-width: 0;
}

.school-rollup-title {
  font-size: .96rem;
  font-weight: 700;
  color: var(--text);
}

.school-rollup-meta {
  color: var(--text-muted);
  font-size: .82rem;
}

.school-rollup-user-row-collapsed {
  display: none;
}

.admin-users-table .user-col-name {
  width: 14%;
}

.admin-users-table .user-col-contact {
  width: 13%;
}

.admin-users-table .user-col-role,
.admin-users-table .user-col-status,
.admin-users-table .user-col-grade,
.admin-users-table .user-col-joined {
  width: 7%;
  white-space: nowrap;
}

.admin-users-table .user-col-books {
  width: 14%;
}

.admin-users-table .user-col-school {
  width: 10%;
}

.admin-users-table .user-col-actions {
  width: 18%;
}

.user-select-cell {
  width: 44px;
  text-align: center;
}

.user-select-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.admin-user-row-actions {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-width: 0;
}

.admin-user-row-actions > .btn {
  justify-content: center;
}

.admin-user-row-actions .btn {
  width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  padding-inline: .55rem;
}

.admin-user-row-actions-secondary {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.admin-user-row-actions-secondary .btn {
  flex: 1 1 calc(50% - .4rem);
  min-width: 0;
  justify-content: center;
}

.user-row-frozen td {
  background: #fff7f7;
}

.user-row-note {
  color: var(--danger);
  font-size: .78rem;
  margin-top: .25rem;
}
.user-row-note-muted {
  color: var(--text-muted);
}
.user-row-note-success {
  color: #166534;
}

@media (max-width: 1200px) {
  .admin-users-table .user-col-contact,
  .admin-users-table .user-col-books,
  .admin-users-table .user-col-school {
    width: auto;
  }

  .admin-users-table .user-col-actions {
    width: 22%;
  }
}

@media (max-width: 960px) {
  .admin-users-table {
    table-layout: auto;
  }

  .admin-users-table .user-col-role,
  .admin-users-table .user-col-status,
  .admin-users-table .user-col-grade,
  .admin-users-table .user-col-joined,
  .admin-users-table .user-col-actions {
    white-space: normal;
    width: auto;
  }
}

.certificate-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(8, 145, 178, .18);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, .16), transparent 34%),
    linear-gradient(135deg, #fdfefe 0%, #eff6ff 52%, #ecfeff 100%);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.certificate-panel-locked {
  border-color: rgba(217, 119, 6, .24);
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, .16), transparent 34%),
    linear-gradient(135deg, #fffaf0 0%, #fffbeb 55%, #fef3c7 100%);
}
.certificate-panel-info {
  border-color: rgba(15, 23, 42, .08);
  background:
    radial-gradient(circle at top right, rgba(148, 163, 184, .16), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 55%, #eef2ff 100%);
}
.certificate-kicker {
  color: var(--primary-dark);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}
.certificate-panel h2 {
  margin-bottom: .5rem;
}
.certificate-panel p {
  color: var(--text-muted);
  max-width: 56ch;
}
.certificate-student-name {
  margin-top: 1.35rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.05;
}
.certificate-student-meta {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .85rem;
}
.certificate-student-meta span {
  display: inline-flex;
  align-items: center;
  padding: .42rem .72rem;
  border-radius: 999px;
  background: rgba(8, 145, 178, .1);
  color: var(--primary-dark);
  font-size: .82rem;
  font-weight: 700;
}
.certificate-editor-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  align-items: start;
}
.certificate-panel-editor,
.certificate-panel-preview {
  min-height: 100%;
}
.certificate-template-link {
  margin-top: .75rem;
  font-size: .88rem;
}
.certificate-template-link a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}
.certificate-template-link a:hover {
  text-decoration: underline;
}
.certificate-layout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin-top: .5rem;
}
.certificate-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.certificate-preview-shell {
  margin-top: 1rem;
}
.certificate-preview-stage {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(15, 23, 42, .08);
  background: #f8fafc;
  min-height: 240px;
}
.certificate-preview-stage canvas {
  width: 100%;
  height: auto;
  display: block;
}
.certificate-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.certificate-overlay-field {
  position: absolute;
  color: #111827;
  line-height: 1.12;
  max-width: 70%;
  font-family: Georgia, "Times New Roman", serif;
  text-shadow: 0 1px 1px rgba(255, 255, 255, .6);
}
.certificate-overlay-field-name {
  font-weight: 700;
  letter-spacing: .02em;
}
.certificate-overlay-field-school {
  max-width: 56%;
}
.certificate-overlay-field-date {
  max-width: 24%;
}
.certificate-overlay-field-principal {
  font-weight: 700;
}

@media (max-width: 960px) {
  .certificate-editor-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .certificate-layout-grid {
    grid-template-columns: 1fr;
  }
}

.teacher-student-checklist {
  display: grid;
  gap: .65rem;
  max-height: 240px;
  overflow: auto;
  padding: .25rem;
}

.teacher-student-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}

.teacher-student-filter-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(180px, .9fr);
  align-items: end;
  gap: .85rem;
  flex: 1;
  padding: .85rem 1rem;
  border: 1px solid rgba(8, 145, 178, .14);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .92)),
    radial-gradient(circle at top right, rgba(14, 165, 233, .08), transparent 36%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.teacher-student-toolbar-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.teacher-student-total {
  display: inline-flex;
  align-items: center;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: rgba(8, 145, 178, .1);
  color: var(--primary-dark);
  font-size: .82rem;
  font-weight: 700;
}

.teacher-student-filter {
  width: 100%;
  min-width: 0;
}

.teacher-student-search {
  width: 100%;
}

.teacher-student-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: .55rem;
  align-items: center;
}

.teacher-students-search-input {
  min-width: 0;
}

.teacher-student-search-btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(8, 145, 178, .22);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(8, 145, 178, .12), rgba(14, 165, 233, .18));
  color: var(--primary-dark);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.teacher-student-search-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 145, 178, .34);
  box-shadow: 0 12px 20px rgba(8, 145, 178, .12);
}

.teacher-student-search-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.teacher-grade-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1rem;
}

.teacher-grade-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(8, 145, 178, .14);
  background: rgba(248, 250, 252, .92);
  color: var(--text);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.teacher-grade-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 145, 178, .26);
  box-shadow: 0 10px 18px rgba(15, 23, 42, .08);
}

.teacher-grade-pill span {
  font-size: .84rem;
  font-weight: 600;
}

.teacher-grade-pill strong {
  min-width: 24px;
  padding: .15rem .42rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
  font-size: .76rem;
  text-align: center;
}

.teacher-grade-pill.is-active {
  background: linear-gradient(135deg, rgba(8, 145, 178, .14), rgba(14, 165, 233, .2));
  border-color: rgba(8, 145, 178, .34);
  color: var(--primary-dark);
}

.teacher-grade-pill.is-active strong {
  background: rgba(8, 145, 178, .16);
}

.teacher-grade-groups {
  display: grid;
  gap: 1rem;
}

.teacher-grade-group {
  padding: 0;
  overflow: hidden;
  border-color: rgba(15, 23, 42, .08);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, .08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.teacher-grade-group[open] {
  box-shadow: 0 20px 36px rgba(15, 23, 42, .08);
}

.teacher-grade-group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, rgba(248, 250, 252, .96), rgba(241, 245, 249, .88));
}

.teacher-grade-group-head::-webkit-details-marker {
  display: none;
}

.teacher-grade-group-head-copy {
  min-width: 0;
}

.teacher-grade-group-head-copy h3 {
  font-size: 1rem;
}

.teacher-grade-group-head-copy p {
  color: var(--text-muted);
  font-size: .85rem;
  margin-top: .2rem;
}

.teacher-grade-group-indicators {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.teacher-grade-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: .35rem .55rem;
  border-radius: 999px;
  background: rgba(8, 145, 178, .12);
  color: var(--primary-dark);
  font-size: .82rem;
  font-weight: 800;
}

.teacher-grade-group-toggle {
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.teacher-grade-group[open] .teacher-grade-group-toggle::before {
  content: "Hide";
}

.teacher-grade-group:not([open]) .teacher-grade-group-toggle::before {
  content: "Open";
}

.teacher-grade-group-toggle {
  color: transparent;
  position: relative;
}

.teacher-grade-group-toggle::before {
  color: var(--text-muted);
}

.teacher-grade-group-body {
  padding: 0 1rem 1rem;
}

.teacher-grade-group-body.is-scrollable .teacher-student-cards {
  max-height: min(58vh, 720px);
  overflow: auto;
  padding-right: .25rem;
}

.teacher-student-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
}

.teacher-student-card {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .95rem;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  background: rgba(248, 250, 252, .9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

.teacher-student-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(8, 145, 178, .16), rgba(14, 165, 233, .24));
  color: var(--primary-dark);
  font-size: .92rem;
  font-weight: 800;
  flex: 0 0 42px;
}

.teacher-student-card-copy {
  min-width: 0;
  flex: 1;
}

.teacher-student-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.teacher-student-card-head strong {
  font-size: .94rem;
}

.teacher-student-card-head span {
  color: var(--text-muted);
  font-size: .76rem;
  white-space: nowrap;
}

.teacher-student-card-contact {
  color: var(--text-muted);
  font-size: .84rem;
  margin-top: .28rem;
  overflow-wrap: anywhere;
}

.teacher-student-card-meta {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-top: .55rem;
}

.teacher-student-card-meta span {
  display: inline-flex;
  align-items: center;
  padding: .32rem .56rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  color: var(--text-muted);
  font-size: .74rem;
  font-weight: 700;
}

@media (max-width: 860px) {
  .teacher-student-filter-panel {
    grid-template-columns: 1fr;
  }

  .manager-plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .teacher-student-filter-panel,
  .teacher-student-toolbar-meta,
  .teacher-student-filter,
  .teacher-student-search {
    width: 100%;
  }

  .teacher-student-toolbar-meta {
    justify-content: space-between;
  }

  .teacher-grade-group-head {
    align-items: flex-start;
  }

  .teacher-student-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .teacher-student-card-head span {
    white-space: normal;
  }

  .teacher-grade-group-body {
    padding: 0 .8rem .8rem;
  }
}

.teacher-student-option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .8rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  cursor: pointer;
}

.teacher-student-option input {
  margin-top: .15rem;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem; backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 1.75rem;
  width: 100%; max-width: 480px; max-height: calc(100vh - 2rem); overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

body.app-authenticated .modal-backdrop {
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(12px);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h3 { font-size: 1.1rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.25rem; }

/* ── Tabs ── */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: .6rem 1rem; cursor: pointer; font-size: .875rem; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

body.app-authenticated .tabs {
  width: fit-content;
  max-width: 100%;
  padding: .3rem;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .64);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .06);
  backdrop-filter: blur(18px);
}

body.app-authenticated .tab {
  margin-bottom: 0;
  border: none;
  border-radius: 999px;
  font-weight: 700;
}

body.app-authenticated .tab.active {
  color: #fff;
  border-bottom-color: transparent;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 12px 24px rgba(8, 145, 178, .18);
}

/* ── Breadcrumb ── */
.breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .875rem; margin-bottom: 1.5rem; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }
.page-section-actions { padding-top: 0; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: .95rem; }

body.app-authenticated .empty-state {
  border: 1px dashed rgba(148, 163, 184, .24);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .88) 0%, rgba(240, 249, 255, .68) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76);
}

body.app-authenticated .empty-state-icon {
  color: var(--primary-dark);
}

/* ── Loading ── */
.loading { display: flex; align-items: center; justify-content: center; padding: 4rem; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; flex-direction: column; gap: .5rem; z-index: 9999; }
.toast {
  background: #1e293b; color: #fff; padding: .75rem 1.25rem;
  border-radius: var(--radius-sm); font-size: .875rem;
  box-shadow: var(--shadow-lg); animation: slideUp .2s ease;
  max-width: 320px; display: flex; align-items: center; gap: .5rem;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .reader-sidebar { display: none; }
  .reader-main { padding: 2rem 1rem; }
  .page { padding: 1rem .75rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-panel { padding: .9rem; }
  .progress-percent { font-size: 1.15rem; }
  .student-progress-top { flex-direction: column; align-items: flex-start; }
  .reader-content { max-width: 100%; }
  .book-page-stage,
  .book-page-stage.is-spread { grid-template-columns: minmax(0, 1fr); }
  .book-page-stage { min-height: 58vh; }
  .book-page-stage::after { display: none; }
  .book-page-arrow {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  .book-page-arrow-prev { left: .45rem; }
  .book-page-arrow-next { right: .45rem; }
  .book-page-controls { width: 100%; }
  .book-page-controls .btn { flex: 1 1 140px; justify-content: center; }
  .book-page-reader:fullscreen .book-annotation-toolbar {
    top: 6.5rem;
  }
  .book-annotation-toolbar {
    gap: .6rem;
  }
  .book-annotation-slider {
    width: 100%;
    justify-content: space-between;
  }
  .book-annotation-slider input[type="range"] {
    flex: 1;
    min-width: 120px;
  }
  .book-hero, .book-hero-compact { grid-template-columns: 1fr; }
  .book-cover-preview, .book-cover-stage, .book-cover-display { min-height: 260px; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { width: 100%; }
  .manager-plan-actions { width: 100%; }
  .manager-plan-actions .btn { width: 100%; }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmerPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@keyframes paperSettle {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes coverFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes pageTurnForward {
  0% {
    opacity: .1;
    transform: perspective(1800px) rotateY(-76deg) translateX(42px) scale(.955);
    filter: blur(2px) brightness(.88);
  }
  58% {
    opacity: .94;
    transform: perspective(1800px) rotateY(-14deg) translateX(8px) scale(.992);
    filter: blur(.35px) brightness(1.02);
  }
  100% {
    opacity: 1;
    transform: perspective(1800px) rotateY(0deg) translateX(0) scale(1);
    filter: blur(0) brightness(1);
  }
}

@keyframes pageTurnBackward {
  0% {
    opacity: .1;
    transform: perspective(1800px) rotateY(76deg) translateX(-42px) scale(.955);
    filter: blur(2px) brightness(.88);
  }
  58% {
    opacity: .94;
    transform: perspective(1800px) rotateY(14deg) translateX(-8px) scale(.992);
    filter: blur(.35px) brightness(1.02);
  }
  100% {
    opacity: 1;
    transform: perspective(1800px) rotateY(0deg) translateX(0) scale(1);
    filter: blur(0) brightness(1);
  }
}

@keyframes pageLeafForward {
  0% {
    opacity: 0;
    transform: perspective(2200px) rotateY(0deg) skewY(0deg) translateX(0);
    filter: brightness(1.04);
  }
  18% {
    opacity: .96;
  }
  100% {
    opacity: 0;
    transform: perspective(2200px) rotateY(-108deg) skewY(-1.8deg) translateX(-10px);
    filter: brightness(.92);
  }
}

@keyframes pageLeafBackward {
  0% {
    opacity: 0;
    transform: perspective(2200px) rotateY(0deg) skewY(0deg) translateX(0);
    filter: brightness(1.04);
  }
  18% {
    opacity: .96;
  }
  100% {
    opacity: 0;
    transform: perspective(2200px) rotateY(108deg) skewY(1.8deg) translateX(10px);
    filter: brightness(.92);
  }
}

@keyframes chapterAuraDrift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  50% {
    transform: translate3d(2%, 2%, 0) scale(1.04);
  }
  100% {
    transform: translate3d(-1%, 1%, 0) scale(1.02);
  }
}

@keyframes chapterMeshShift {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(8deg) scale(1.06);
  }
  100% {
    transform: rotate(16deg) scale(1);
  }
}

@keyframes chapterStageShift {
  0% {
    transform: translate3d(-1.5%, 0, 0) scale(1);
    opacity: .9;
  }
  50% {
    transform: translate3d(1.5%, 1%, 0) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: translate3d(-1%, -1%, 0) scale(1.01);
    opacity: .92;
  }
}

@keyframes chapterOrbDrift {
  0% {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }
  33% {
    transform: translate3d(4%, 2%, 0) scale(1.05);
  }
  66% {
    transform: translate3d(-2%, 4%, 0) scale(1.02);
  }
  100% {
    transform: translate3d(3%, -1%, 0) scale(1.08);
  }
}

@keyframes chapterParticleDrift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    background-position: 0% 0%, 100% 0%, 30% 100%, 90% 90%;
  }
  50% {
    transform: translate3d(1%, -2%, 0) rotate(6deg) scale(1.03);
    background-position: 12% 8%, 88% 18%, 38% 84%, 82% 78%;
  }
  100% {
    transform: translate3d(-1%, 1%, 0) rotate(12deg) scale(1.06);
    background-position: 20% 14%, 78% 26%, 46% 72%, 72% 68%;
  }
}

.landing-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(8, 145, 178, .16), transparent 26%),
    radial-gradient(circle at top right, rgba(245, 158, 11, .14), transparent 28%),
    linear-gradient(180deg, #fffef8 0%, #f8fafc 40%, #edf6ff 100%);
}
.landing-shell > :not(.landing-page-backdrop):not(.landing-media-viewer):not(.program-detail-modal) {
  position: relative;
  z-index: 1;
}
.landing-page-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.landing-page-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 254, 248, .9) 0%, rgba(248, 250, 252, .88) 40%, rgba(237, 246, 255, .92) 100%),
    radial-gradient(circle at top left, rgba(8, 145, 178, .12), transparent 28%),
    radial-gradient(circle at top right, rgba(245, 158, 11, .12), transparent 30%);
}
.landing-page-backdrop-panel {
  position: absolute;
  top: -6vh;
  bottom: -6vh;
  width: clamp(260px, 30vw, 460px);
  background-image: var(--landing-page-backdrop-image);
  background-size: cover;
  background-position: center;
  opacity: .22;
  filter: saturate(.94) blur(1px);
  transform: scale(1.08);
  will-change: transform;
  animation: landingPictureDrift 26s ease-in-out infinite alternate;
  animation-delay: var(--landing-page-backdrop-delay, 0s);
}
.landing-page-backdrop-panel-1 {
  left: -4vw;
}
.landing-page-backdrop-panel-2 {
  left: 23vw;
}
.landing-page-backdrop-panel-3 {
  right: 23vw;
}
.landing-page-backdrop-panel-4 {
  right: -4vw;
}
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
  background: rgba(248, 250, 252, .72);
  backdrop-filter: blur(18px);
}
.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .01em;
}
.landing-brand .touch-edu-logo-img {
  height: 36px;
}
.landing-nav-links {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.landing-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 700;
  padding: .6rem .85rem;
  border-radius: 999px;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.landing-nav-link:hover,
.landing-nav-link.is-active {
  background: rgba(8, 145, 178, .1);
  color: var(--primary-dark);
  transform: translateY(-1px);
}
.landing-nav-cta {
  margin-left: .25rem;
}
.landing-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 4rem;
}
.landing-hero {
  display: grid;
  grid-template-columns: minmax(320px, .78fr) minmax(0, 1.22fr);
  gap: 1.4rem;
  align-items: stretch;
  padding: 1.5rem 0 2.5rem;
}
.landing-hero-copy {
  align-self: stretch;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100%;
  padding: 1rem .4rem 1rem 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.landing-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin: .1rem 0 .85rem;
}
.landing-hero-title {
  display: grid;
  justify-items: center;
  gap: .1rem;
  width: 100%;
  margin: 0;
}
.landing-hero-title-word {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.18rem, .65vw, .55rem);
  width: auto;
  max-width: 100%;
}
.landing-hero-letter {
  display: inline-block;
  flex: 0 0 auto;
  min-width: 0;
  font-size: clamp(1.7rem, calc(27vw / var(--word-len, 3)), 7.5rem);
  font-weight: 900;
  line-height: .9;
  letter-spacing: 0;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(135deg, #0f172a 0%, #0ea5e9 28%, #22c55e 52%, #f59e0b 76%, #ef4444 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: landing-hero-letter-wave 6s ease-in-out infinite;
  animation-delay: calc(var(--letter-index) * .14s);
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, .14));
}
.landing-hero-title-word:first-child {
  gap: clamp(.12rem, .48vw, .36rem);
}
.landing-hero-title-word:first-child .landing-hero-letter {
  font-size: clamp(3.45rem, calc(38vw / var(--word-len, 5)), 6.3rem);
}
.landing-hero-copy p {
  max-width: 24rem;
  font-size: .98rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.landing-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  flex-wrap: wrap;
  margin-top: 1.3rem;
}
.landing-hero-btn {
  width: auto;
}
.landing-hero-secondary {
  min-height: 48px;
}
.landing-hero-visual {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.landing-hero-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(14, 116, 144, .94), rgba(12, 74, 110, .96));
  color: #f8fafc;
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: 0 22px 48px rgba(14, 116, 144, .18);
}
.landing-hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, .18), transparent 30%),
    linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, .06) 100%);
  pointer-events: none;
}
.landing-hero-panel-main {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(6, 23, 37, .1), rgba(6, 23, 37, .78)),
    var(--landing-hero-main-bg);
  background-size: cover;
  background-position: center;
}
.landing-hero-panel-kicker {
  position: relative;
  z-index: 1;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .84;
}
.landing-hero-panel-title {
  position: relative;
  z-index: 1;
  margin-top: .9rem;
  font-size: 1.45rem;
  line-height: 1.35;
  font-family: var(--font-display);
}
@keyframes landingPictureDrift {
  0% {
    transform: scale(1.08) translate3d(-1.5%, -1.2%, 0);
  }
  50% {
    transform: scale(1.14) translate3d(1.4%, .8%, 0);
  }
  100% {
    transform: scale(1.1) translate3d(.3%, 1.4%, 0);
  }
}
.landing-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.landing-hero-shortcut {
  appearance: none;
  width: 100%;
  min-height: 126px;
  border: 0;
  text-align: left;
  cursor: pointer;
  background: transparent;
  transition: transform .2s ease, box-shadow .2s ease;
}
.landing-hero-shortcut::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--landing-shortcut-bg);
  background-size: cover;
  background-position: center;
  filter: saturate(1.04) contrast(1.03);
  transform: scale(1.08);
  will-change: transform;
  animation: landingPictureDrift 18s ease-in-out infinite alternate;
  animation-delay: var(--landing-shortcut-delay, 0s);
}
.landing-hero-shortcut::after {
  background:
    linear-gradient(180deg, rgba(6, 23, 37, .22), rgba(6, 23, 37, .84)),
    radial-gradient(circle at top right, rgba(255, 255, 255, .18), transparent 34%),
    linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, .08) 100%);
}
.landing-hero-shortcut:hover,
.landing-hero-shortcut:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 26px 54px rgba(14, 116, 144, .24);
}
.landing-hero-shortcut-label {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  font-size: .84rem;
  font-weight: 700;
  color: rgba(248, 250, 252, .9);
}
.landing-hero-rotator-panel {
  padding: 1.2rem;
}
.landing-hero-rotator-copy {
  position: relative;
  z-index: 1;
}
.landing-hero-rotator {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 1rem;
  min-height: 220px;
  perspective: 1400px;
  overflow: visible;
  background: transparent;
}
.landing-hero-rotator::after {
  content: "";
  position: absolute;
  inset: auto 8% 0;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(15, 23, 42, .22) 0%, rgba(15, 23, 42, 0) 72%);
  pointer-events: none;
}
.landing-hero-wheel-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(64%, 300px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform .72s ease, opacity .72s ease, filter .72s ease, box-shadow .72s ease;
}
.landing-wheel-media,
.landing-wheel-placeholder {
  display: block;
  width: 100%;
  height: 168px;
}
.landing-wheel-media {
  object-fit: cover;
  opacity: 1;
  pointer-events: none;
  background: #0f172a;
}
.landing-wheel-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, .22), transparent 32%),
    linear-gradient(145deg, rgba(8, 145, 178, .14), rgba(255, 255, 255, .94));
}
.landing-hero-wheel-slide.is-center {
  z-index: 5;
  opacity: 1;
  filter: saturate(1);
  box-shadow: 0 22px 52px rgba(15, 23, 42, .24);
  transform: translate(-50%, -50%) scale(1) rotateY(0deg);
}
.landing-hero-wheel-slide.is-left-1 {
  z-index: 4;
  opacity: .9;
  filter: saturate(.9);
  transform: translate(-116%, -50%) scale(.82) rotateY(24deg);
}
.landing-hero-wheel-slide.is-right-1 {
  z-index: 4;
  opacity: .9;
  filter: saturate(.9);
  transform: translate(16%, -50%) scale(.82) rotateY(-24deg);
}
.landing-hero-wheel-slide.is-left-2 {
  z-index: 3;
  opacity: .45;
  filter: saturate(.75) blur(.2px);
  transform: translate(-152%, -50%) scale(.66) rotateY(34deg);
}
.landing-hero-wheel-slide.is-right-2 {
  z-index: 3;
  opacity: .45;
  filter: saturate(.75) blur(.2px);
  transform: translate(52%, -50%) scale(.66) rotateY(-34deg);
}
.landing-hero-wheel-slide.is-hidden {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.54);
}
@keyframes landing-hero-letter-wave {
  0%, 100% {
    background-position: 0% 50%;
    transform: translateY(0);
  }
  35% {
    background-position: 100% 50%;
    transform: translateY(-4px);
  }
  65% {
    background-position: 55% 50%;
    transform: translateY(2px);
  }
}
.landing-section + .landing-section {
  margin-top: 2.4rem;
}
.landing-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.landing-section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}
.landing-section-copy {
  max-width: 34rem;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}
.landing-stats-section {
  padding: .4rem 0 1.4rem;
}
.landing-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.landing-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .6rem;
  padding: 1.6rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}
.landing-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.landing-stat-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.landing-stat-icon svg {
  width: 26px;
  height: 26px;
}
.landing-stat-value {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
}
.landing-stat-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
}
.landing-stat-card-media {
  padding: 0;
  overflow: hidden;
}
.landing-stat-card-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.landing-media-showcase,
.landing-about-showcase,
.landing-about-grid,
.landing-about-metrics,
.landing-contact-grid {
  display: grid;
  gap: 1rem;
}
.landing-media-showcase {
  grid-template-columns: minmax(0, 1fr);
}
.landing-contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.landing-about-showcase {
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  margin-bottom: 1rem;
  align-items: stretch;
}
.landing-about-side {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
  gap: 1rem;
}
.landing-about-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.landing-about-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.landing-media-band {
  position: relative;
  isolation: isolate;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .56);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  padding: 1.2rem;
  overflow: hidden;
}
.landing-media-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--landing-band-bg);
  background-size: cover;
  background-position: center;
  filter: saturate(1.03) contrast(1.02);
  transform: scale(1.08);
  will-change: transform;
  animation: landingPictureDrift 22s ease-in-out infinite alternate;
  animation-delay: var(--landing-band-delay, 0s);
}
.landing-media-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, .62), rgba(255, 255, 255, .82) 42%, rgba(241, 245, 249, .7) 100%),
    linear-gradient(180deg, rgba(6, 23, 37, .08), rgba(6, 23, 37, .2));
  backdrop-filter: blur(12px) saturate(1.08);
  pointer-events: none;
}
.landing-media-band > * {
  position: relative;
  z-index: 1;
}
.landing-media-band-head {
  display: block;
  margin-bottom: 1rem;
}
.landing-media-band-head h3 {
  margin: .3rem 0 0;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
}
.landing-media-wheel {
  margin-top: 0;
  min-height: 290px;
}
.landing-media-wheel::after {
  inset: auto 12% 0;
  height: 42px;
}
.landing-media-wheel-slide {
  width: min(34%, 320px);
}
.landing-media-wheel-slide .landing-wheel-media,
.landing-media-wheel-slide .landing-wheel-placeholder {
  height: 214px;
}
.landing-media-wheel-slide.is-center {
  z-index: 5;
  opacity: 1;
  filter: saturate(1);
  box-shadow: 0 24px 56px rgba(15, 23, 42, .22);
  transform: translate(-50%, -50%) scale(1) rotateY(0deg);
}
.landing-media-wheel-slide.is-left-1 {
  z-index: 4;
  opacity: .92;
  filter: saturate(.92);
  transform: translate(-132%, -50%) scale(.82) rotateY(30deg);
}
.landing-media-wheel-slide.is-right-1 {
  z-index: 4;
  opacity: .92;
  filter: saturate(.92);
  transform: translate(32%, -50%) scale(.82) rotateY(-30deg);
}
.landing-media-wheel-slide.is-left-2 {
  z-index: 3;
  opacity: .42;
  filter: saturate(.75) blur(.25px);
  transform: translate(-165%, -50%) scale(.66) rotateY(38deg);
}
.landing-media-wheel-slide.is-right-2 {
  z-index: 3;
  opacity: .42;
  filter: saturate(.75) blur(.25px);
  transform: translate(65%, -50%) scale(.66) rotateY(-38deg);
}
.landing-media-wheel-slide.is-hidden {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.54);
}
.landing-marquee-card,
.landing-about-card,
.landing-contact-card {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.landing-marquee-card {
  width: clamp(240px, 24vw, 320px);
  flex: 0 0 auto;
}
.landing-marquee-media-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: #e2e8f0;
  overflow: hidden;
}
button.landing-marquee-media-shell {
  appearance: none;
}
.landing-marquee-media-shell.is-clickable {
  cursor: zoom-in;
}
.landing-marquee-media,
.landing-marquee-placeholder {
  width: 100%;
  height: 100%;
  display: block;
}
.landing-marquee-video {
  object-fit: cover;
  background: #0f172a;
}
.landing-marquee-image {
  object-fit: cover;
}
.landing-marquee-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, .22), transparent 32%),
    linear-gradient(145deg, rgba(8, 145, 178, .14), rgba(255, 255, 255, .94));
}
.landing-marquee-badge {
  position: absolute;
  top: .8rem;
  left: .8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 .7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, .76);
  color: #f8fafc;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.landing-marquee-placeholder-kicker {
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary-dark);
}
.landing-marquee-placeholder-title {
  margin-top: .45rem;
  font-size: 1.1rem;
  font-family: var(--font-display);
  color: var(--text);
}
.landing-about-card,
.landing-contact-card {
  padding: 1.2rem 1.25rem 1.3rem;
}
.landing-about-spotlight,
.landing-about-visual,
.landing-about-metric,
.landing-about-card {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
}
.landing-about-spotlight:hover,
.landing-about-visual:hover,
.landing-about-metric:hover,
.landing-about-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 70px rgba(15, 23, 42, .2);
}
.landing-about-spotlight {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.6rem;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, .16), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(241, 245, 249, .78));
}
.landing-about-spotlight-media {
  margin: -1.6rem -1.6rem 1.2rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #dbe4ee;
}
.landing-about-spotlight-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.landing-about-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 .8rem;
  border-radius: 999px;
  background: rgba(14, 116, 144, .12);
  color: var(--primary-dark);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.landing-about-spotlight h3 {
  margin-top: 1rem;
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
  line-height: 1.22;
}
.landing-about-spotlight p {
  margin-top: .85rem;
  max-width: 44rem;
  color: var(--ink-soft);
  line-height: 1.8;
}
.landing-about-visual {
  position: relative;
  min-height: 240px;
  background: #0f172a;
}
.landing-about-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--landing-about-visual-bg);
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  will-change: transform;
  animation: landingPictureDrift 20s ease-in-out infinite alternate;
}
.landing-about-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 23, 37, .14), rgba(6, 23, 37, .82)),
    linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, .06) 100%);
}
.landing-about-visual-copy {
  position: absolute;
  inset: auto 1.2rem 1.2rem 1.2rem;
  z-index: 1;
  color: #f8fafc;
}
.landing-about-visual-label {
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .84;
}
.landing-about-visual-title {
  margin-top: .6rem;
  font-size: 1.35rem;
  line-height: 1.35;
  font-family: var(--font-display);
}
.landing-about-metric {
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 1.05rem;
}
.landing-about-metric-media {
  margin: -1rem -1rem .9rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #dbe4ee;
}
.landing-about-metric-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.landing-about-metric-value {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
}
.landing-about-metric-label {
  margin-top: .4rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: .9rem;
}
.landing-about-card {
  padding: 1.3rem 1.25rem 1.35rem;
}
.landing-about-card-media {
  margin: -1.3rem -1.25rem 1rem;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e2e8f0;
}
.landing-about-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.landing-about-card-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  background: rgba(14, 116, 144, .12);
  color: var(--primary-dark);
  font-size: .8rem;
  font-weight: 800;
}
.landing-about-card h3 {
  margin: .85rem 0 .55rem;
}
.landing-about-card p,
.landing-contact-value {
  line-height: 1.7;
  color: var(--ink-soft);
}
.landing-media-viewer {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.landing-media-viewer[hidden] {
  display: none !important;
}
.landing-media-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, .84);
}
.landing-media-viewer-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(94vw, 1180px);
  max-height: 88vh;
}
.landing-media-viewer-close {
  position: absolute;
  top: -3rem;
  right: 0;
  min-height: 40px;
  padding: 0 .95rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #f8fafc;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}
.landing-media-viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
}
.landing-media-viewer-media {
  display: block;
  width: auto;
  max-width: min(94vw, 1180px);
  max-height: 84vh;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .45);
  background: #020617;
  opacity: 1;
  transition: opacity .2s ease;
}
.landing-media-viewer-stage.is-loading .landing-media-viewer-media {
  opacity: 0;
}
.landing-media-viewer-spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  animation: landing-viewer-spin .8s linear infinite;
}
.landing-media-viewer-stage.is-loading .landing-media-viewer-spinner {
  display: block;
}
@keyframes landing-viewer-spin {
  to { transform: rotate(360deg); }
}
.landing-media-viewer-image {
  object-fit: contain;
}
.landing-media-viewer-video {
  width: min(94vw, 1180px);
  object-fit: contain;
}
.landing-about-card {
  min-height: 220px;
}
.landing-contact-section {
  padding-bottom: 1rem;
}
.landing-contact-card {
  position: relative;
  isolation: isolate;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(240, 249, 255, .94));
  transition: transform .22s ease, box-shadow .22s ease;
}
.landing-contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 70px rgba(15, 23, 42, .2);
}
.landing-contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--landing-contact-bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.landing-contact-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .4) 0%, rgba(255, 255, 255, .88) 62%, rgba(240, 249, 255, .95) 100%);
}
.landing-contact-label {
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: .7rem;
}
.landing-contact-value {
  font-size: 1.02rem;
}
.landing-contact-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: inherit;
  text-decoration: none;
}
.landing-contact-whatsapp::before {
  content: "";
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: #25d366;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.5 14.4c-.3-.1-1.6-.8-1.9-.9-.2-.1-.4-.1-.6.1-.2.3-.7.9-.8 1-.2.2-.3.2-.5.1-.3-.1-1.2-.4-2.2-1.4-.8-.7-1.4-1.6-1.5-1.9-.2-.3 0-.4.1-.6l.4-.5c.1-.2.1-.3.2-.5.1-.2 0-.4 0-.5S9.9 8 9.7 7.6c-.2-.5-.4-.4-.6-.4h-.5c-.2 0-.5.1-.7.3-.3.3-1 1-1 2.4s1 2.8 1.2 3c.1.2 2 3 4.8 4.3.7.3 1.2.5 1.6.6.7.2 1.3.2 1.8.1.5-.1 1.6-.7 1.9-1.3.2-.6.2-1.1.2-1.2-.1-.1-.3-.2-.6-.3z'/%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12c0 1.8.5 3.5 1.3 5L2 22l5.2-1.4C8.6 21.5 10.3 22 12 22c5.5 0 10-4.5 10-10S17.5 2 12 2zm0 18.3c-1.6 0-3.1-.4-4.4-1.2l-.3-.2-3.1.8.8-3-.2-.3C3.8 14.9 3.3 13.5 3.3 12c0-4.8 3.9-8.7 8.7-8.7s8.7 3.9 8.7 8.7-3.9 8.7-8.7 8.7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.5 14.4c-.3-.1-1.6-.8-1.9-.9-.2-.1-.4-.1-.6.1-.2.3-.7.9-.8 1-.2.2-.3.2-.5.1-.3-.1-1.2-.4-2.2-1.4-.8-.7-1.4-1.6-1.5-1.9-.2-.3 0-.4.1-.6l.4-.5c.1-.2.1-.3.2-.5.1-.2 0-.4 0-.5S9.9 8 9.7 7.6c-.2-.5-.4-.4-.6-.4h-.5c-.2 0-.5.1-.7.3-.3.3-1 1-1 2.4s1 2.8 1.2 3c.1.2 2 3 4.8 4.3.7.3 1.2.5 1.6.6.7.2 1.3.2 1.8.1.5-.1 1.6-.7 1.9-1.3.2-.6.2-1.1.2-1.2-.1-.1-.3-.2-.6-.3z'/%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12c0 1.8.5 3.5 1.3 5L2 22l5.2-1.4C8.6 21.5 10.3 22 12 22c5.5 0 10-4.5 10-10S17.5 2 12 2zm0 18.3c-1.6 0-3.1-.4-4.4-1.2l-.3-.2-3.1.8.8-3-.2-.3C3.8 14.9 3.3 13.5 3.3 12c0-4.8 3.9-8.7 8.7-8.7s8.7 3.9 8.7 8.7-3.9 8.7-8.7 8.7z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.landing-contact-whatsapp:hover {
  color: #128c4a;
  text-decoration: underline;
}
.competitions-page-head h1 {
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  margin: 0 0 .6rem;
}
.competitions-page-head .landing-section-copy {
  max-width: 42rem;
}
.competitions-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}
.competitions-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.competitions-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(8, 145, 178, .2);
}
.competitions-card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e2e8f0;
}
.competitions-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.competitions-card:hover .competitions-card-media img {
  transform: scale(1.06);
}
.competitions-card-caption {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .85rem 1rem 1rem;
}
.competitions-card-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
}
.competitions-card-subtitle {
  font-size: .8rem;
  color: var(--text-muted);
}
.competitions-empty-state {
  margin: 0;
}

.program-section-note {
  font-style: italic;
}

.program-pathway-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}
.program-pathway-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .5rem;
  padding: 1.6rem 1.2rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.program-pathway-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(8, 145, 178, .2);
}
.program-pathway-step {
  position: absolute;
  top: .75rem;
  left: .85rem;
  font-size: .74rem;
  font-weight: 800;
  color: var(--text-muted);
}
.program-pathway-grades {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: .25rem .65rem;
  border-radius: 999px;
}
.program-pathway-stage {
  margin: .15rem 0 0;
  font-size: 1.05rem;
}
.program-pathway-badge {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: rgba(245, 158, 11, .14);
  padding: .2rem .6rem;
  border-radius: 999px;
}
.program-pathway-description {
  font-size: .86rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

.program-feature-grid,
.program-competitions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}
.program-feature-card,
.program-competition-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .6rem;
  padding: 1.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.program-feature-card:hover,
.program-competition-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(8, 145, 178, .2);
}
.program-pathway-card::before,
.program-feature-card::before,
.program-competition-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--program-card-bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.program-pathway-card::after,
.program-feature-card::after,
.program-competition-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, .92) 55%, rgba(255, 255, 255, .97) 100%);
}
.program-feature-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.program-feature-icon svg {
  width: 26px;
  height: 26px;
}
.program-competition-icon {
  background: rgba(245, 158, 11, .14);
  color: var(--accent-dark);
}
.program-feature-title {
  margin: 0;
  font-size: 1rem;
}
.program-feature-text {
  margin: 0;
  font-size: .86rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.program-competition-national {
  margin-top: 1.1rem;
  background: linear-gradient(135deg, rgba(8, 145, 178, .06) 0%, rgba(245, 158, 11, .08) 100%);
}
.program-pathway-card,
.program-feature-card,
.program-competition-card {
  cursor: pointer;
}
.program-pathway-card:focus-visible,
.program-feature-card:focus-visible,
.program-competition-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.program-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.program-detail-modal[hidden] {
  display: none !important;
}
.program-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, .72);
}
.program-detail-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 480px);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .45);
  padding: 2rem 1.75rem 1.75rem;
}
.program-detail-close {
  position: absolute;
  top: .9rem;
  right: .9rem;
  min-height: 34px;
  padding: 0 .85rem;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}
.program-detail-close:hover {
  background: var(--border);
  color: var(--text);
}
.program-detail-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .5rem;
}
.program-detail-icon {
  display: inline-grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  margin-bottom: .3rem;
}
.program-detail-icon svg {
  width: 34px;
  height: 34px;
}
.program-detail-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: .5rem;
}
.program-detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.program-detail-body h3 {
  margin: 0;
}
.program-detail-meta {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: .25rem .65rem;
  border-radius: 999px;
}
.program-detail-body p {
  margin: .3rem 0 0;
  font-size: .92rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .program-pathway-track,
  .program-feature-grid,
  .program-competitions-grid {
    grid-template-columns: 1fr;
  }
}

body.landing-viewer-open {
  overflow: hidden;
}
.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .58rem .95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
  color: rgba(226, 232, 240, .88);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 700;
  margin-bottom: 1rem;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.auth-back-link:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, .28);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 960px) {
  body.app-authenticated .navbar {
    width: calc(100% - 1.25rem);
    padding: .9rem 1rem;
    top: .75rem;
    align-items: flex-start;
    flex-direction: column;
  }
  body.app-authenticated .navbar-right {
    width: 100%;
    justify-content: flex-start;
  }
  body.app-authenticated .page {
    width: calc(100% - 1.25rem);
    padding-left: 0;
    padding-right: 0;
  }
  .landing-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .landing-hero-copy {
    max-width: none;
    justify-content: flex-start;
    padding-right: 0;
  }
  .landing-hero-letter {
    font-size: clamp(1.6rem, calc(33vw / var(--word-len, 3)), 4.8rem);
  }
  .landing-hero-title-word:first-child .landing-hero-letter {
    font-size: clamp(2.45rem, calc(48vw / var(--word-len, 5)), 4.1rem);
  }
  .landing-hero-rotator {
    min-height: 200px;
  }
  .landing-hero-wheel-slide {
    width: min(70%, 320px);
  }
  .landing-wheel-media,
  .landing-wheel-placeholder {
    height: 156px;
  }
  .landing-media-wheel {
    min-height: 254px;
  }
  .landing-media-wheel-slide {
    width: min(44%, 300px);
  }
  .landing-media-wheel-slide .landing-wheel-media,
  .landing-media-wheel-slide .landing-wheel-placeholder {
    height: 188px;
  }
  .landing-about-showcase {
    grid-template-columns: 1fr;
  }
  .landing-about-grid,
  .landing-contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .competitions-gallery {
    grid-template-columns: 1fr;
  }
  body.app-authenticated .navbar {
    gap: .85rem;
    border-radius: 18px;
  }
  body.app-authenticated .navbar-brand {
    font-size: 1.05rem;
  }
  body.app-authenticated .navbar-right {
    gap: .55rem;
  }
  body.app-authenticated .navbar-right .btn,
  body.app-authenticated .navbar-user {
    width: 100%;
    justify-content: center;
  }
  body.app-authenticated .tabs {
    width: 100%;
    border-radius: 24px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .auth-page {
    padding: 1rem;
  }
  .auth-page-shell {
    width: 100%;
  }
  .auth-logo {
    align-items: flex-start;
  }
  .auth-role-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 22px;
  }
  .auth-intro-brand .touch-edu-logo-img {
    height: 58px;
  }
  .landing-stats-grid {
    grid-template-columns: 1fr;
  }
  .landing-nav {
    width: calc(100% - 1.25rem);
    padding: .75rem 0;
    align-items: flex-start;
    flex-direction: column;
  }
  .landing-page-backdrop-panel {
    width: 58vw;
    opacity: .18;
  }
  .landing-page-backdrop-panel-2 {
    left: 42vw;
  }
  .landing-page-backdrop-panel-3 {
    display: none;
  }
  .landing-page-backdrop-panel-4 {
    display: none;
  }
  .landing-main {
    width: calc(100% - 1.25rem);
    padding-top: .5rem;
  }
  .landing-hero-copy {
    padding: 1.6rem;
  }
  .landing-hero-grid,
  .landing-about-grid,
  .landing-contact-grid {
    grid-template-columns: 1fr;
  }
  .landing-about-metrics {
    grid-template-columns: 1fr;
  }
  .landing-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .landing-hero-rotator {
    min-height: 176px;
  }
  .landing-hero-wheel-slide {
    width: min(76%, 300px);
  }
  .landing-wheel-media,
  .landing-wheel-placeholder {
    height: 142px;
  }
  .landing-media-wheel {
    min-height: 220px;
  }
  .landing-media-wheel-slide {
    width: min(60%, 280px);
  }
  .landing-media-wheel-slide .landing-wheel-media,
  .landing-media-wheel-slide .landing-wheel-placeholder {
    height: 164px;
  }
  .landing-marquee-card {
    width: min(82vw, 300px);
  }
  .landing-media-viewer {
    padding: .85rem;
  }
  .landing-media-viewer-dialog {
    width: 100%;
    max-height: 86vh;
  }
  .landing-media-viewer-close {
    top: -2.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-scroll-fx],
  [data-scroll-fx].is-visible,
  [data-scroll-fx].is-hidden-up,
  [data-scroll-fx].is-hidden-down {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
