:root {
  --sky-0: #f7fbff;
  --sky-1: #eaf4fc;
  --sky-2: #d5ebf8;
  --ink: #173047;
  --ink-soft: #4a647a;
  --brand: #0c6f78;
  --brand-deep: #08545b;
  --accent: #ef7a3a;
  --accent-soft: #fff1e7;
  --card: #ffffffee;
  --line: #c9deec;
  --ok: #1f8a55;
  --shadow: 0 18px 50px rgba(23, 72, 104, 0.12);
  --radius: 22px;
  --font-display: "Syne", "Apple SD Gothic Neo", sans-serif;
  --font-body: "Manrope", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  background:
    radial-gradient(1200px 600px at 10% -10%, #c8ecff 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #ffe7d4 0%, transparent 50%),
    linear-gradient(180deg, var(--sky-0), var(--sky-1) 40%, #f3f9fd);
  min-height: 100vh;
}

button, input, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* ===== Login ===== */
.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-card {
  width: min(540px, 100%);
  background: #fff;
  border: 1px solid rgba(23, 48, 71, 0.08);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(12, 40, 56, 0.14);
  overflow: hidden;
}

.login-hero {
  position: relative;
  min-height: 228px;
  color: #fff;
  overflow: hidden;
}

.login-hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  filter: none;
  transform: scale(1);
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 28, 34, 0.18) 0%, rgba(6, 28, 34, 0.08) 38%, rgba(6, 28, 34, 0.72) 100%);
  pointer-events: none;
}

.login-hero-copy {
  position: relative;
  z-index: 1;
  padding: 88px 26px 22px;
}

.login-hero .login-kicker {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(158, 240, 245, 0.95);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.85rem, 6vw, 2.35rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.brand-mark span { color: #9ef0f5; }

.login-hero p {
  margin: 8px 0 0;
  max-width: 22rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.92);
}

.login-hero #brandHero {
  color: rgba(255,255,255,0.78);
  font-size: 0.84rem;
}

.login-body { padding: 24px 22px 28px; }

.section-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 10px;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.country-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid #d7e4ee;
  border-radius: 12px;
  background: #f8fbfd;
  padding: 12px 14px;
  margin: 0 0 4px;
  cursor: pointer;
}

.country-trigger[aria-expanded="true"] {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12,111,120,0.12);
}

.country-trigger-flag {
  font-size: 2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.flag-img {
  width: 36px;
  height: 24px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(15, 40, 70, 0.12);
  background: #fff;
  display: block;
}

.country-option-flag .flag-img {
  width: 32px;
  height: 22px;
}

.country-trigger-meta b,
.country-option-meta b {
  display: block;
  font-size: 1rem;
}

.country-trigger-meta small,
.country-option-meta small {
  color: var(--ink-soft);
}

.country-trigger-chevron {
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.country-list {
  display: grid;
  gap: 6px;
  margin: -6px 0 16px;
  max-height: min(48vh, 360px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 8px;
}

.country-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  margin-bottom: 4px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.country-empty {
  padding: 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.country-option {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
}

.country-option:hover { background: var(--sky-0); }
.country-option.on {
  border-color: var(--brand);
  background: rgba(12,111,120,0.08);
}
.country-option-flag { font-size: 1.6rem; line-height: 1; }
.country-option-check { color: var(--brand); font-weight: 800; min-width: 1em; }

.country-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
}

.country-sheet.hidden { display: none; }

.country-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 24, 36, 0.42);
  cursor: pointer;
}

.country-sheet-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: min(72vh, 560px);
  overflow: auto;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.18);
}

.country-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.country-sheet-head button {
  border: 0;
  background: var(--sky-0);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.country-sheet-list {
  display: grid;
  gap: 6px;
}

@media (min-width: 800px) {
  .country-sheet {
    place-items: center;
    align-items: center;
  }
  .country-sheet-panel {
    width: min(420px, 92vw);
    border-radius: 20px;
    max-height: min(70vh, 520px);
  }
}

.lang-card {
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  text-align: left;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.lang-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lang-card.on {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(12,111,120,0.12);
}

.lang-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.lang-card .meta { padding: 12px 14px 14px; }
.lang-card b { display: block; font-size: 1.05rem; }
.lang-card small { color: var(--ink-soft); }

.form-row { margin-top: 16px; }
.form-row label {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ink);
  margin-bottom: 7px;
}

.form-row input {
  width: 100%;
  height: 50px;
  border: 1px solid #d7e4ee;
  border-radius: 12px;
  padding: 0 14px;
  background: #f8fbfd;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-row input:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(12,111,120,0.12);
}

.login-err {
  margin: 10px 0 0;
  color: #b52525;
  font-weight: 700;
  font-size: 0.92rem;
}

.start-btn {
  margin-top: 20px;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 12px;
  background: var(--brand-deep);
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 22px rgba(8, 84, 91, 0.28);
}

.start-btn:hover {
  background: #07464c;
}

.hint {
  margin: 12px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -18px -16px 18px;
  padding: 14px 16px 12px;
  background: rgba(247,251,255,0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-dot {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand), #19a0ab);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.72rem;
  text-decoration: none;
}

.top-meta { flex: 1; min-width: 0; }
.top-meta b, .top-meta small {
  display: block;
  white-space: normal;
  overflow: hidden;
}
.top-meta small {
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-meta small .flag-img {
  width: 22px;
  height: 15px;
  flex: 0 0 auto;
}

.tabs button,
.tabs a.tab-home {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-weight: 800;
  color: var(--ink);
}
.tabs a.tab-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-decoration: none;
  box-sizing: border-box;
}

.tabs button.on {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

.hero-panel {
  border-radius: var(--radius);
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(12,111,120,0.78), rgba(56,176,186,0.72) 55%, rgba(239,122,58,0.45)),
    center/cover no-repeat var(--hero-image);
  box-shadow: var(--shadow);
}

.hero-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.5vw, 2.1rem);
  margin: 4px 0 8px;
  letter-spacing: -0.02em;
}

.hero-panel p { margin: 0; opacity: 0.92; max-width: 40rem; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.tabs .tab-search {
  margin-left: auto;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(23,72,104,0.06);
}

.panel h2 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.35rem;
}

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

.week-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, var(--sky-0));
  padding: 14px;
}

.week-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.week-actions button {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.week-actions .week-study {
  background: #0b5a62;
  border-color: #0b5a62;
  color: #fff;
}

.week-actions .week-exam {
  flex: 0 0 56px;
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, #ff9a4d, var(--accent) 55%, #d65e1f);
  color: #fff;
  font-size: 0.82rem;
  box-shadow: 0 8px 16px rgba(239, 122, 58, 0.32);
}

.week-card b { color: var(--brand-deep); display: block; }
.week-card small { color: var(--ink-soft); }
.week-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12,111,120,0.12);
}

/* ===== Theater: video lecture + textbook ===== */
.panel.theater {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 4px 0 0;
}

.theater-title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  letter-spacing: -0.02em;
  color: #1a2b48;
  margin: 0 0 18px;
}

.theater-body {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.theater-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rail-face {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #111827;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  cursor: pointer;
}

.rail-face video,
.talking-head {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.rail-prof {
  margin: 10px 0 0;
  font-weight: 800;
  font-size: 0.92rem;
  color: #1a2b48;
}

.rail-prof-sub,
.rail-page {
  margin: 2px 0 10px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.rail-mark {
  display: grid;
  place-items: center;
  height: 92px;
  border-radius: 14px;
  background: #0b3d44;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.rail-controls {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.rail-controls button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid #e4e9ef;
  border-radius: 0;
  background: #fff;
  color: #1a2b48;
  font-weight: 800;
  font-size: 0.92rem;
  text-align: left;
}

.rail-controls button i {
  width: 1.2em;
  font-style: normal;
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.85;
}

.rail-controls button.primary,
.rail-controls #btnPlay {
  margin: 6px 0 8px;
  border: 0;
  border-radius: 10px;
  background: #0b5a62;
  color: #fff;
  justify-content: flex-start;
}

.rail-controls button.primary i,
.rail-controls #btnPlay i {
  opacity: 1;
}

.rail-controls button:disabled {
  opacity: 0.38;
  cursor: default;
}

.theater-main { min-width: 0; }

.stage {
  position: relative;
  aspect-ratio: 16 / 9.2;
  background: #0d1d28;
  overflow: hidden;
  border-radius: 22px;
}

.stage .plate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  opacity: 1;
  transform: scale(1);
  transition: opacity .45s ease, transform .55s ease, filter .35s ease;
}

.stage .plate.is-swapping {
  opacity: 0;
  transform: scale(1.04);
}

.stage.playing .plate {
  filter: brightness(0.96) saturate(1.04);
  transform: scale(1.015);
}

.lip-pulse { display: none !important; }

.stage-shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(0,0,0,0.18), transparent 28%, transparent 72%, rgba(0,0,0,0.22));
  pointer-events: none;
}

.badge {
  position: absolute;
  top: 14px;
  z-index: 4;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(28, 32, 38, 0.62);
  color: #fff;
  backdrop-filter: blur(8px);
  font-size: 0.82rem;
  font-weight: 700;
}

.badge.left { left: 14px; }
.badge.right { right: 14px; }

.progress {
  height: 3px;
  background: #e7edf3;
  margin-top: 0;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: #0b5a62;
  transition: width .2s linear;
}

.lecture-book {
  margin-top: 14px;
  background: #f6f8fb;
  border-radius: 16px;
  padding: 14px 16px 16px;
}

.lecture-book-kicker {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.lecture-book-kicker b {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0b5a62;
}

.lecture-book-kicker small,
.status-line {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.caption {
  min-height: 72px;
  padding: 0;
  background: transparent;
  color: #1a2b48;
  font-size: 1.02rem;
  line-height: 1.65;
}

.theater-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 10px;
}

.exam-link,
.exam-btn {
  margin-left: auto;
  flex: 0 0 56px;
  width: 56px;
  min-width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, #ff9a4d, var(--accent) 55%, #d65e1f);
  color: #fff;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: -0.02em;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(239, 122, 58, 0.32);
  display: inline-grid;
  place-items: center;
}

.exam-link:hover,
.exam-btn:hover,
.week-actions .week-exam:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.exam-link:active,
.exam-btn:active,
.week-actions .week-exam:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
}

.dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #c5d7e4;
}
.dots button.on { background: #0b5a62; transform: scale(1.15); }
.dots button.locked { opacity: 0.35; }

.lipsync-ready {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: #0b5a62;
  font-weight: 700;
}

.books-reader.theater {
  margin-top: 8px;
}

.book-jump-btn {
  background: linear-gradient(135deg, #0b5a62, #0d7580) !important;
  color: #fff !important;
  border-color: #0b5a62 !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(11, 90, 98, 0.25) !important;
}
.book-jump-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.rail-lang {
  margin: 6px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0b5a62;
}

.books-plate {
  margin: 0 0 14px;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0d1d28;
}
.books-plate img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.books-stage {
  min-height: 280px;
  max-height: min(48vh, 560px);
  border-radius: 22px;
  border: 1px solid #e4e9ef;
  background: #fff;
  padding: 28px 32px;
  white-space: pre-wrap;
  line-height: 1.8;
  color: #1a2b48;
  overflow: auto;
}

@media (max-width: 860px) {
  .theater-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .theater-rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
  }
  .rail-face {
    width: 92px;
    height: 116px;
    aspect-ratio: auto;
    flex: none;
  }
  .rail-prof, .rail-prof-sub, .rail-mark, .rail-page {
    display: none;
  }
  .rail-controls {
    flex: 1;
    min-width: 0;
    margin: 0;
  }
  .stage { border-radius: 16px; }
  .books-plate { border-radius: 16px; }
  .books-stage { padding: 18px 16px; border-radius: 16px; }
}

.voice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px 8px;
  color: var(--ink-soft, #4b6475);
  font-size: 0.92rem;
}

.voice-toggle {
  display: inline-flex;
  gap: 6px;
}

.voice-toggle button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.voice-toggle button.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.actions {
  display: none;
}

.lipsync-ready {
  margin: 8px 0 0;
}

.lesson-text {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.lesson-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--sky-0);
}

.lesson-block.current {
  background: #fff8ef;
  border-color: #f0c39a;
}

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

.grades-summary {
  margin: 0 0 14px;
  padding: 18px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, var(--sky-0));
  border: 1px solid var(--line);
  text-align: center;
}

.grades-summary .big {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--brand-deep);
}

.grade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sky-0);
  border: 1px solid var(--line);
}

.grade-row .grade-meta {
  display: grid;
  gap: 4px;
}

.grade-row .grade-meta small {
  color: var(--ink-soft);
}

.grade-row button,
.grade-row .exam-btn {
  margin-left: 0;
  flex: 0 0 56px;
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, #ff9a4d, var(--accent) 55%, #d65e1f);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: 0 8px 16px rgba(239, 122, 58, 0.32);
  display: grid;
  place-items: center;
}

.exam-nav-bar {
  position: sticky;
  top: 60px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.exam-nav-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exam-nav-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.exam-nav-badge {
  background: #0b5a62;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.exam-nav-state {
  font-size: 13px;
  font-weight: 700;
  color: #0b5a62;
}
.exam-nav-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.exam-nav-pill {
  flex: 1 1 36px;
  min-width: 32px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.exam-nav-pill:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
.exam-nav-pill.answered {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}
.exam-nav-pill.answered.is-correct {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.exam-nav-pill.answered.is-wrong {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.exam-q {
  margin: 0 0 16px;
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.exam-qmeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.exam-qbadge {
  background: #f1f5f9;
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.exam-qscore {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.exam-read.reading {
  color: #e11d48;
  animation: pulse 1s infinite;
}
.exam-actions.sticky-bottom {
  position: sticky;
  bottom: 12px;
  z-index: 15;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exam-qtitle {
  font-weight: 800;
  margin-bottom: 10px;
}

.exam-option {
  display: block;
  width: 100%;
  text-align: left;
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--sky-0);
  cursor: pointer;
  font-weight: 650;
}

.exam-option.correct {
  background: #e8f7ee;
  border-color: #7dca98;
}

.exam-option.wrong {
  background: #fdecea;
  border-color: #f0a8a0;
}

.exam-option:disabled {
  cursor: default;
}

.exam-read {
  margin: 0 0 8px;
  border: 0;
  background: transparent;
  color: #0b5a62;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.exam-feedback {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
}

.exam-feedback.ok {
  background: #e8f7ee;
  color: #1d6b3a;
}

.exam-feedback.bad {
  background: #fdecea;
  color: #9b2c2c;
}

.exam-feedback .review {
  margin-top: 6px;
  font-weight: 600;
  color: var(--ink-soft);
}

.exam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.exam-actions button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.exam-actions .primary,
.exam-option + .exam-actions .primary {
  background: #0b5a62;
  border-color: #0b5a62;
  color: #fff;
}

.exam-result {
  text-align: center;
  padding: 18px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--sky-0));
}

.exam-result .big {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--brand-deep);
  margin: 8px 0 16px;
}

.exam-attempts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.exam-attempt {
  padding: 12px 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 12px;
  background: #12343a;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.toast.hidden {
  display: none;
}

.intro-video {
  width: 100%;
  border-radius: 16px;
  background: #000;
  margin-top: 10px;
}

.intro-caption {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.prof-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin: 12px 0 4px;
}

.prof-row > span {
  font-size: 0.82rem;
  color: var(--ink-soft);
  grid-column: 1 / -1;
}

.prof-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 8px;
  cursor: pointer;
}

.prof-card.on {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12,111,120,0.12);
}

.prof-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.prof-meta b {
  font-size: 0.95rem;
  color: var(--ink);
}

.prof-meta small {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.3;
}

.prof-face {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}

.lipsync-ready {
  margin: 4px 0 8px;
  font-size: 0.86rem;
  color: var(--brand-deep);
  font-weight: 700;
}

.faculty-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.faculty-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
}

.faculty-card.on {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12,111,120,0.12);
}

.faculty-card b { display: block; font-size: 1.05rem; }
.faculty-card small { display: block; color: var(--ink-soft); margin-top: 4px; }
.faculty-card span { display: block; margin-top: 8px; color: var(--brand); font-size: 0.8rem; font-weight: 700; }

.faculty-card-face,
.faculty-detail-face {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 16px;
  background: #111;
}

.faculty-detail {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.faculty-detail-face {
  width: 140px;
  height: 140px;
}

.faculty-title { margin: 4px 0; font-weight: 700; color: var(--brand-deep); }
.faculty-dept { margin: 0 0 10px; color: var(--ink-soft); font-size: 0.9rem; }
.faculty-courses { margin: 8px 0 16px; padding-left: 18px; }
.faculty-courses li { margin: 4px 0; }
.faculty-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.books-facets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}

.books-facets label {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.books-facets select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.books-more-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0 4px;
}

.books-more-wrap button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  cursor: pointer;
}

.search-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.search-modes button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.search-modes button.on {
  border-color: var(--brand);
  background: rgba(12,111,120,0.08);
  color: var(--brand-deep);
  font-weight: 700;
}

.speed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
}

.speed-row > span {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.speed-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.speed-toggle button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.speed-toggle button.on {
  border-color: var(--brand);
  background: rgba(12,111,120,0.08);
  color: var(--brand);
  font-weight: 700;
}

.search-hint {
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}

.search-box input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-hit {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sky-0);
  padding: 12px 14px;
  cursor: pointer;
}

.search-hit:hover { border-color: var(--brand); }
.search-hit b { color: var(--brand); font-size: 0.85rem; }
.search-hit span { color: var(--ink); line-height: 1.45; }
.books-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
}

.books-toolbar input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}

.books-count {
  color: var(--ink-soft);
  font-size: 0.85rem;
  white-space: nowrap;
}

.books-list {
  display: grid;
  gap: 8px;
  max-height: min(62vh, 720px);
  overflow: auto;
}

.book-card {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sky-0);
  padding: 12px 14px;
  cursor: pointer;
}

.book-card:hover { border-color: var(--brand); }
.book-card b { color: var(--ink); }
.book-card small, .book-card span { color: var(--ink-soft); font-size: 0.86rem; }

.study-kicker {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #0b5a62;
}

.browse-back {
  grid-column: 1 / -1;
  width: fit-content;
  border: 0;
  background: transparent;
  color: #0b5a62;
  font-weight: 800;
  padding: 4px 0 8px;
  cursor: pointer;
}

.browse-card {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  cursor: pointer;
}

.browse-card:hover,
.book-card:hover { border-color: var(--brand); }
.browse-card b { color: var(--ink); }
.browse-card small { color: var(--ink-soft); }

.book-card.preparing {
  border-color: #ead7a0;
  background: #fff8e8;
}
.book-card .prep-pill {
  color: #9a6700;
  font-weight: 800;
}

.learn-guide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 18px 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sky-0);
}
.learn-guide.hidden { display: none; }
.learn-guide p {
  margin: 0;
  font-weight: 800;
  color: #0b5a62;
}
.learn-guide ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.learn-guide li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.86rem;
  cursor: pointer;
}
.learn-guide li.on {
  border-color: #0b5a62;
  background: #0b5a62;
  color: #fff;
  font-weight: 700;
}
.learn-guide button {
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  background: #0b5a62;
  color: #fff;
  font-weight: 800;
  padding: 8px 14px;
  cursor: pointer;
}

.booksPageBody.preparing,
#booksPageBody.preparing {
  color: #9a6700;
  font-weight: 700;
}

.faculty-course-link {
  border: 0;
  background: transparent;
  color: #0b5a62;
  font-weight: 700;
  padding: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
}

.books-reader-bar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.books-reader-meta b { display: block; }
.books-reader-meta small { color: var(--ink-soft); }

.books-page-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.books-page-nav button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

#panelBooks.is-reading {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 4px 0 0;
}

#panelBooks.is-reading > h2,
#panelBooks.is-reading > .books-mode-tabs,
#panelBooks.is-reading > .search-hint,
#panelBooks.is-reading .books-toolbar,
#panelBooks.is-reading .books-facets,
#panelBooks.is-reading .books-list,
#panelBooks.is-reading .books-more-wrap {
  display: none !important;
}

/* Books Mode Tabs */
.books-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 16px;
}
.books-mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 2px solid var(--line, #cbd5e1);
  background: var(--surface, #ffffff);
  color: var(--ink, #1e293b);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.books-mode-tab:hover {
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}
.books-mode-tab.active {
  background: var(--accent, #2563eb) !important;
  border-color: var(--accent, #2563eb) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
@media (max-width: 640px) {
  .books-mode-tabs {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .books-mode-tab {
    padding: 11px 12px;
    font-size: 0.85rem;
  }
}

.book-card.featured-card {
  border: 2px solid #bfdbfe;
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}
.book-card.featured-card:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
}
.book-card.featured-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #2563eb;
}

@media (min-width: 800px) {
  .books-reader-bar {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}


@media (min-width: 800px) {
  .week-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lang-card img { height: 180px; }
  .login-body { padding: 26px 26px 30px; }
  .prof-row > span { grid-column: auto; }
  .prof-row { grid-template-columns: minmax(120px, auto) 1fr 1fr; }
}

@media (max-width: 720px) {
  .faculty-detail {
    grid-template-columns: 1fr;
  }
  .books-facets {
    grid-template-columns: 1fr;
  }
}

/* Campus / auth / HQ */
.top-actions { display: flex; gap: 8px; flex: 0 0 auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top-nav-btn { cursor: pointer; }
.top-nav-btn.on {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}
.mypage-wrap { position: relative; }
.mypage-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(23,72,104,0.14);
  padding: 6px;
  z-index: 30;
}
.mypage-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}
.mypage-menu button:hover { background: var(--sky-0, #eef6fb); }
.lang-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(46vw, 240px);
}
.lang-top-btn .flag-img {
  width: 22px;
  height: 15px;
  flex: 0 0 auto;
}
.lang-top-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-actions button, .top-intro-link {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  min-height: 40px;
}
.top-intro-link {
  display: inline-flex;
  align-items: center;
  color: var(--brand-deep);
  text-decoration: none;
}
.auth-h { margin: 0 0 12px; font-size: 1.1rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.auth-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 800;
}
.auth-tabs button.on { background: var(--brand-deep); color: #fff; border-color: var(--brand-deep); }
.auth-form { display: grid; gap: 10px; }
.auth-form label, .profile-form label { display: grid; gap: 4px; font-weight: 700; font-size: 0.92rem; }
.auth-form input, .auth-form select, .auth-form textarea,
.profile-form input, .profile-form select, .profile-form textarea,
.admin-create input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
}
.auth-form small { font-weight: 500; color: var(--ink-soft); }
.text-link {
  border: 0;
  background: none;
  color: var(--brand-deep);
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}
.hint.muted { color: var(--ink-soft); font-size: 0.82rem; line-height: 1.5; }
.login-intro-link {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 800;
}
.login-intro-link a {
  color: var(--brand-deep);
  text-decoration: none;
}
.login-intro-link a:hover { text-decoration: underline; }
.briefing-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #9a3d0c;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.4;
}
.campus-grid, .people-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.campus-card, .people-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sky-0);
  padding: 14px;
}
.campus-card.openable { cursor: pointer; }
.campus-card.openable:hover { border-color: var(--brand); }
.campus-card small, .people-card small { color: var(--ink-soft); }
.campus-card b, .people-card b { display: block; margin: 4px 0; }
.campus-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.people-card { cursor: pointer; }
.people-card.mine { border-color: var(--brand); background: #fff; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #e8f1f6;
}
.pill.ok { background: #e3f7ea; color: var(--ok); }
.pill.bad { background: #fde8e8; color: #b42318; }
.admin-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  margin: 0 0 12px;
}
.admin-inline {
  width: 100%;
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
}
.admin-assign {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.admin-assign select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font: inherit;
}
.admin-progs { font-size: 0.85rem; color: var(--ink-soft); }
.profile-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; }
.profile-dl dt { color: var(--ink-soft); font-weight: 700; }
.profile-dl dd { margin: 0; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.admin-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 800;
}
.admin-tabs button.on { background: var(--brand-deep); color: #fff; border-color: var(--brand-deep); }
.admin-create {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 12px;
}
.issue-hint {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.issued-cred {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #c9a227;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf0 0%, #fff 100%);
}
.issued-cred[hidden] { display: none; }
.issued-title { margin: 0 0 6px; font-weight: 800; }
.issued-name { margin: 0 0 10px; color: var(--ink-soft); font-size: 0.88rem; }
.issued-cred dl { margin: 0 0 12px; display: grid; gap: 8px; }
.issued-cred dt { font-size: 0.75rem; color: var(--ink-soft); font-weight: 700; }
.issued-cred dd { margin: 2px 0 0; }
.issued-cred code {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.95rem;
  word-break: break-all;
}
.admin-table-wrap { overflow: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.admin-table button { margin: 2px 4px 2px 0; }

.demo-stage {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4fbff 55%, #fff8f1 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.demo-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  padding: 18px 18px 8px;
}
.demo-head small {
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--brand);
}
.demo-head h2 { margin: 4px 0 6px; font-family: var(--font-display); }
.demo-head p { margin: 0; color: var(--ink-soft); max-width: 40rem; }
.demo-head .primary, .demo-col .primary, .campus-actions .primary, .pay-row .primary {
  border: 0;
  background: var(--brand-deep);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  min-height: 44px;
}
.demo-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 8px 18px 14px;
}
.demo-steps li {
  border-radius: 999px;
  padding: 8px 10px;
  text-align: center;
  font-weight: 800;
  font-size: 0.86rem;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.demo-steps li.on { color: var(--ink); border-color: var(--brand); }
.demo-steps li.now { background: var(--brand-deep); color: #fff; border-color: var(--brand-deep); }
.demo-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.demo-col { padding: 16px 18px 18px; min-height: 280px; }
.demo-col + .demo-col { border-left: 1px solid var(--line); }
.demo-col header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 12px;
}
.demo-col header span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
}
.demo-kicker { margin: 0; color: var(--brand-deep); font-weight: 800; font-size: 0.82rem; }
.demo-col h3 { margin: 4px 0 10px; font-size: 1.05rem; }
.demo-col dl, .pay-slip dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 6px 10px;
  margin: 0 0 12px;
}
.demo-col dt, .pay-slip dt { color: var(--ink-soft); font-size: 0.82rem; }
.demo-col dd, .pay-slip dd { margin: 0; font-weight: 700; }
.demo-empty { color: var(--ink-soft); margin: 0; }
.pay-slip {
  border: 1.5px dashed #c9deec;
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  margin-bottom: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.pay-slip b { display: block; color: var(--brand-deep); margin-bottom: 6px; }
.pay-slip .vacct {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  color: var(--ink);
}
.hq-col { text-align: center; background: linear-gradient(180deg, #fff, #eef8f4); }
.hq-stamp {
  width: 148px;
  height: 148px;
  margin: 8px auto 12px;
  border: 6px solid #c5d0d6;
  border-radius: 50%;
  display: grid;
  place-content: center;
  color: #8aa0ad;
  transform: rotate(-8deg);
}
.hq-stamp.ok {
  border-color: #1f8a55;
  color: #1f8a55;
  background: rgba(31, 138, 85, 0.06);
}
.hq-stamp.pop { animation: stamp-pop 0.55s ease; }
.hq-stamp strong { font-size: 1.05rem; line-height: 1.15; }
.hq-stamp small { display: block; margin-top: 4px; font-weight: 700; }
@keyframes stamp-pop {
  0% { transform: rotate(-8deg) scale(1.35); opacity: 0; }
  100% { transform: rotate(-8deg) scale(1); opacity: 1; }
}
.campus-card.focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(12,111,120,0.12); }
.pay-ledger { display: grid; gap: 10px; }
.pay-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
}
.pay-row.ok { border-color: #b7e0c8; background: #f4fbf6; }
.pay-row b { display: block; }
.pay-row small { color: var(--ink-soft); }
.pay-row-status { display: grid; gap: 4px; }
.hq-mini-stamp {
  display: inline-block;
  border: 2px solid #1f8a55;
  color: #1f8a55;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 8px;
  transform: rotate(-6deg);
}
@media (max-width: 860px) {
  .demo-board, .demo-steps, .pay-row { grid-template-columns: 1fr; }
  .demo-col + .demo-col { border-left: 0; border-top: 1px solid var(--line); }
  .demo-head { flex-direction: column; align-items: stretch; }
}
.learn-guide li.locked { opacity: 0.45; cursor: not-allowed; }
.tabs button.locked { opacity: 0.45; }
.rail-controls #booksExam {
  color: #fff;
  background: linear-gradient(160deg, #ff9a4d, var(--accent) 55%, #d65e1f);
  border-bottom: 0;
}
.rail-controls #booksExam i { opacity: 1; }
.profile-hero { display: flex; gap: 14px; align-items: center; margin: 0 0 14px; }
.profile-avatar {
  width: 88px; height: 88px; border-radius: 18px; object-fit: cover;
  background: #e8f1f6; flex: 0 0 auto;
}
.profile-avatar.empty { border: 1px dashed var(--line); }
.people-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; display: block; margin: 0 0 6px; }
.file-links { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-toolbar { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.admin-roster { margin: 18px 0 28px; }
.admin-roster h3 small { font-weight: 600; color: var(--muted, #5a7480); }

/* Textbook Stage Live PIP AI Professor Video */
.stage-pip-face {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 130px;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
  border: 2.5px solid #c59b27;
  z-index: 10;
  background: #0d1d28;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  pointer-events: none;
}
.stage.idle .stage-pip-face {
  opacity: 0.92;
}
.stage.playing .stage-pip-face {
  transform: scale(1.03);
  border-color: #f3d264;
  box-shadow: 0 12px 32px rgba(197, 155, 39, 0.45);
}
@media (max-width: 768px) {
  .stage-pip-face {
    width: 84px;
    right: 10px;
    bottom: 10px;
    border-radius: 10px;
    border-width: 2px;
  }
}

/* Cinematic Fullscreen Theater Mode for Books */
.books-reader.theater.theater-cinematic {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: radial-gradient(circle at center 20%, #101c36 0%, #050b18 100%);
  padding: 24px 32px;
  margin: 0 !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.books-reader.theater.theater-cinematic .theater-body {
  grid-template-columns: 290px 1fr;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  gap: 24px;
}
.books-reader.theater.theater-cinematic .stage {
  aspect-ratio: 16 / 9;
  min-height: 480px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(197, 155, 39, 0.3);
}

.scene-header-card h2 {
  color: #0f2744 !important;
}
.scene-text-card {
  color: #243b53 !important;
}
.scene-takeaway-card {
  background: #f0f7ff !important;
  border: 1px solid #bcd0ee !important;
  border-left: 4px solid #c59b27 !important;
}
.scene-takeaway-card b {
  color: #0d3b66 !important;
}
.scene-takeaway-card li {
  color: #1a365d !important;
}

.module-completion-card {
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 27, 49, 0.96), rgba(30, 58, 106, 0.96));
  border: 1px solid rgba(197, 155, 39, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.completion-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.completion-card-info {
  flex: 1 1 260px;
}
.completion-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #f3d264;
  letter-spacing: 0.08em;
  background: rgba(197, 155, 39, 0.2);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.completion-card-info h3 {
  font-size: 18px;
  color: #fff;
  margin: 4px 0;
  font-weight: 800;
}
.completion-card-info p {
  font-size: 13px;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.5;
}
.completion-card-inner .exam-link {
  background: linear-gradient(135deg, #c59b27, #f3d264);
  color: #070e1d;
  font-weight: 800;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(197, 155, 39, 0.4);
}

/* NWSSU Academic Log & Degree Audit Inspector */
#campusModalOverlay .admin-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 2px solid #e2e8f0;
}
#campusModalOverlay .admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
#campusModalOverlay .admin-tabs button {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
#campusModalOverlay .admin-tabs button.on {
  background: #0284c7;
  color: #fff;
}

/* Video Stage Play Button Overlay */
.stage-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(11, 90, 98, 0.92) 0%, rgba(13, 117, 128, 0.92) 100%);
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 8px rgba(11, 90, 98, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(6px);
  outline: none;
  padding: 0;
}

.stage-play-overlay:hover {
  transform: translate(-50%, -50%) scale(1.14);
  background: linear-gradient(135deg, rgba(13, 117, 128, 0.98) 0%, rgba(16, 185, 129, 0.95) 100%);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55), 0 0 0 12px rgba(16, 185, 129, 0.35);
}

.stage-play-overlay:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.stage-play-icon {
  font-size: 34px;
  color: #ffffff;
  margin-left: 5px;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.stage.playing .stage-play-overlay {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.7);
}

/* 📖 Text Lecture Modal & Typewriter Focus Effects */
.typewriter-cursor {
  display: inline-block;
  color: #0b5a62;
  font-weight: 900;
  margin-left: 2px;
  animation: typewriterBlink 0.75s infinite;
}

@keyframes typewriterBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.text-lecture-scene-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 14px;
  transition: all 0.25s ease;
  cursor: pointer;
}

.text-lecture-scene-card:hover {
  border-color: #0b5a62;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(11, 90, 98, 0.08);
}

.text-lecture-scene-card.active-scene {
  border-color: #0b5a62;
  box-shadow: 0 4px 20px rgba(11, 90, 98, 0.15);
  background: #f0fdf4;
}

.text-lecture-scene-card h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #0b5a62;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text-lecture-scene-card p {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: #334155;
  word-break: keep-all;
}



