/* ==========================================================================
   TIAD — Shared UI kit ("Campus" style) for Student Web + Admin Portal
   White sidebar · blue-grey canvas · white rounded cards · orange accent
   ========================================================================== */

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--page);
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 36px 28px 32px;
  background: var(--surface);
  overflow-y: auto;
}

.brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 52px; padding-left: 4px; }
.brand-in { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-dot {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-dot svg { width: 30px; height: 30px; }
.brand-name { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; line-height: 1; }
.brand-name small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; margin-top: 4px; }
.brand .ghost { color: var(--ink-3); padding: 6px; border-radius: 8px; }
.brand .ghost:hover { color: var(--ink); background: var(--tile-2); }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-group { font-size: 12px; color: var(--ink-3); padding: 18px 18px 6px; }
.nav-group:first-child { padding-top: 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 50px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: var(--fs-md);
  text-align: left;
  width: 100%;
  transition: background .2s;
}
.nav-item .ic { color: var(--ink-2); }
.nav-item:hover { background: var(--tile-2); }
.nav-item.on { background: var(--page); }
.nav-item.on .ic { color: var(--primary); }
.nav-item .count {
  margin-left: auto;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--accent-50);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-item.danger, .nav-item.danger .ic { color: var(--danger); }
.side-foot { margin-top: auto; padding-top: 32px; display: flex; flex-direction: column; gap: 6px; }

.main { min-width: 0; padding: 0 clamp(24px, 2.6vw, 48px) 56px; }

.topbar { display: flex; align-items: center; gap: 14px; padding: 36px 0 40px; }
.topbar .grow { flex: 1; }

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(540px, 44vw);
  height: 52px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
}
.search input { flex: 1; min-width: 0; font-size: var(--fs-md); }
.search kbd { font: 400 11.5px var(--font); color: var(--ink-3); background: var(--tile-2); padding: 3px 8px; border-radius: 6px; }

.icon-btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  flex-shrink: 0;
  transition: color .2s;
}
.icon-btn:hover { color: var(--ink); }
.icon-btn .dot { position: absolute; top: 10px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.icon-btn.sm { width: 40px; height: 40px; }
.icon-btn.line { background: transparent; border: 1px solid var(--line-2); }

.vsep { width: 1px; height: 40px; background: var(--line-2); margin: 0 12px; }

.me { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.me-name { font-size: var(--fs-lg); font-weight: 400; line-height: 1.25; }
.me-mail { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.3; }

/* ---------- Page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.ph-title { font-size: clamp(28px, 2.3vw, 36px); font-weight: 400; letter-spacing: -0.03em; }
.ph-sub { color: var(--ink-3); margin-top: 6px; }
.ph-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 44px 0 24px; }
.sec-h h2 { font-size: clamp(24px, 2vw, 32px); font-weight: 400; letter-spacing: -0.03em; }
.sec-h:first-child { margin-top: 0; }

/* ---------- Layout helpers ---------- */
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
.split-l { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 28px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }

/* ---------- Card ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 30px; }
.card.pad-s { padding: 22px; }
.card.flat { background: var(--tile-2); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.card-t { font-size: var(--fs-xl); font-weight: 400; letter-spacing: -0.02em; }
.card-s { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 4px; }
.divider { height: 1px; background: var(--line); margin: 28px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  font-size: var(--fs-md);
  font-weight: 400;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-600); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-indigo { background: var(--primary); color: #fff; }
.btn-indigo:hover { background: var(--primary-600); }
.btn-sky { background: var(--sky); color: #fff; }
.btn-sky:hover { background: var(--sky-600); }
.btn-outline { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.btn-outline:hover { border-color: var(--ink); }
.btn-white { background: var(--surface); color: var(--sky-600); }
.btn-white:hover { color: var(--ink); }
.btn-soft { background: var(--tile-2); color: var(--ink); }
.btn-soft:hover { background: var(--tile); }
.btn-ghost { color: var(--ink-2); padding: 0 12px; }
.btn-ghost:hover { color: var(--ink); }
.btn-sm { height: 38px; padding: 0 16px; font-size: var(--fs-sm); }
.btn-lg { height: 56px; padding: 0 30px; font-size: var(--fs-lg); }
.btn-block { width: 100%; }

.link { color: var(--accent-ink); font-weight: 400; font-size: var(--fs-sm); cursor: pointer; }
.link:hover { color: var(--accent-ink); }

.arrows { display: flex; gap: 10px; }
.arrows button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.arrows button.on { background: var(--accent); color: var(--ink); }

/* ---------- Chips, pills, tabs ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
button.chip { transition: all .2s; }
button.chip:hover { border-color: var(--ink-4); color: var(--ink); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.soft { border-color: transparent; background: var(--tile-2); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips.center { justify-content: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
  background: var(--tile-2);
  color: var(--ink-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.plain::before { display: none; }
.pill-ok { background: var(--ok-50); color: var(--ok); }
.pill-warn { background: var(--warn-50); color: var(--warn); }
.pill-danger { background: var(--danger-50); color: var(--danger); }
.pill-sky { background: var(--sky-50); color: var(--sky-600); }
.pill-accent { background: var(--accent-50); color: var(--accent-ink); }

.tabs { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tab {
  height: 42px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  color: var(--ink-3);
  font-size: var(--fs-md);
  font-weight: 400;
  transition: color .2s, background .2s;
}
.tab:hover { color: var(--ink); }
.tab.on { background: var(--primary); color: #fff; }

/* ---------- Course card ---------- */
.cc { background: var(--surface); border-radius: var(--r-lg); padding: 14px 14px 22px; display: flex; flex-direction: column; }
.cover {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--tile) 0%, var(--sky-50) 100%);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-fb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--sky-600);
}
.cc-fav {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cc-fav.on { color: var(--danger); }
.cc-fav.on svg { fill: currentColor; }
.cc-body { padding: 20px 10px 0; display: flex; flex-direction: column; flex: 1; }
.cc-meta { display: flex; align-items: center; justify-content: space-between; }
.cc-title { font-size: var(--fs-lg); font-weight: 400; line-height: 1.4; margin: 16px 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; margin-top: auto; }
.cc-by { font-size: var(--fs-sm); color: var(--sky-600); font-weight: 400; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-md); font-weight: 400; }
.rating .star { fill: #0E0E0E; stroke: #0E0E0E; }

/* ---------- Resume / hero card (sky) ---------- */
.resume { position: relative; margin-bottom: 26px; }
.resume::after {
  content: "";
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: -24px;
  height: 60px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: #DADADA;
  z-index: 0;
}
.resume-in {
  position: relative;
  z-index: 1;
  background: var(--sky);
  border-radius: var(--r-lg);
  padding: 36px 40px 30px;
  color: #fff;
  overflow: hidden;
}
.resume-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.resume-kicker { font-size: var(--fs-lg); opacity: .92; }
.resume-badge { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--r-pill); background: var(--surface); color: var(--ok); font-size: var(--fs-sm); font-weight: 400; }
.resume-badge i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.resume-mid { display: flex; align-items: center; gap: 28px; margin: 28px 0 34px; }
.resume-logo {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--sky-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.resume-title { color: #fff; font-size: clamp(24px, 2.2vw, 34px); font-weight: 400; letter-spacing: -0.02em; }
.resume-sub { opacity: .9; font-size: var(--fs-lg); margin-top: 6px; }
.resume-foot { display: flex; align-items: center; gap: 24px; padding-top: 26px; border-top: 1px solid rgba(255, 255, 255, .35); font-size: var(--fs-sm); }
.resume-foot .sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .45); }
.resume-foot .btn { margin-left: auto; }
.resume-curve { display: none; }
.resume-in { isolation: isolate; }
.resume-in::after { content: ""; position: absolute; right: -12%; top: -60%; width: 55%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(91,225,91,.55), transparent 65%); z-index: -1; pointer-events: none; }

/* ---------- Ring ---------- */
.ring { position: relative; margin: 0 auto; }
.ring svg { position: absolute; inset: 0; }
.ring-in { position: absolute; inset: 22%; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ring-in .av { width: 100% !important; height: 100% !important; font-size: 34px !important; }
.ring-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  border: 3px solid #fff;
}

/* ---------- Data ---------- */
.stat-l { font-size: var(--fs-sm); color: var(--ink-3); }
.stat-v { font-size: clamp(26px, 2.2vw, 34px); font-weight: 400; letter-spacing: -0.03em; line-height: 1.15; margin-top: 8px; }
.stat-d { font-size: var(--fs-sm); color: var(--ok); margin-top: 6px; }

.bar { height: 6px; border-radius: 99px; background: var(--tile); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar.sky > i { background: var(--sky); }

.card:has(> .tbl) { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: var(--fs-sm); font-weight: 400; color: var(--ink-3); padding: 0 16px 14px; white-space: nowrap; }
.tbl td { padding: 18px 16px; border-top: 1px solid var(--line); font-size: var(--fs-md); vertical-align: middle; }
.tbl td:not(:first-child) { white-space: nowrap; }
.app.adm .tbl td:not(:first-child) { white-space: normal; }
.app.adm .tbl td .pill, .app.adm .tbl td .btn, .app.adm .tbl td .row, .app.adm .tbl td b, .app.adm .tbl td .mono, .app.adm .tbl td.nowrap { white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; text-align: right; }
.tbl tr:hover td { background: transparent; }
.tbl .t-main { font-weight: 400; }
.tbl .t-sub { font-size: var(--fs-sm); color: var(--ink-3); }

.list-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: none; padding-top: 0; }
.list-row:last-child { padding-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.lr-t { font-weight: 400; }
.lr-s { font-size: var(--fs-sm); color: var(--ink-3); }

.icon-tile {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tile-2);
  color: var(--ink);
  flex-shrink: 0;
  font-weight: 500;
  font-size: var(--fs-sm);
}
.icon-tile.peach { background: var(--tint-peach); color: var(--tint-peach-ink); }
.icon-tile.lilac { background: var(--tint-lilac); color: var(--tint-lilac-ink); }
.icon-tile.lime { background: var(--tint-lime); color: var(--tint-lime-ink); }
.icon-tile.sky { background: var(--tint-sky); color: var(--tint-sky-ink); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 400; }
.input, .select, .textarea {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  background: var(--tile-2);
  border: 1px solid transparent;
  font-size: var(--fs-md);
  transition: border-color .2s, background .2s;
}
.textarea { height: auto; min-height: 120px; padding: 14px 18px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-ink); background: var(--surface); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B909B' stroke-width='1.8'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(14, 14, 14, .38);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .2s ease;
}
.modal {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 34px;
  animation: popIn .3s var(--ease);
}
.modal.wide { max-width: 860px; }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.modal-t { font-size: var(--fs-xl); font-weight: 400; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); }

/* ---------- Responsive shell ---------- */
@media (max-width: 1280px) {
  .split { grid-template-columns: minmax(0, 1fr) 340px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 92px minmax(0, 1fr); }
  .side { padding: 30px 16px; align-items: center; }
  .side .brand { padding: 0; justify-content: center; }
  .side .brand-name, .side .brand .ghost, .nav-item span, .nav-item .count, .nav-group { display: none; }
  .nav-item { width: 56px; justify-content: center; padding: 0; }
  .split, .split-l { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .me > div { display: none; }
}
@media (max-width: 720px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .search { display: none; }
}

/* Generated book cover */
.book {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: 20px;
  overflow: hidden;
  background: var(--b-bg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
}
.book::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: var(--b-ink); opacity: .9; }
.book-art { position: absolute; right: -6px; bottom: -14px; width: 58%; opacity: .8; }
.book-code { position: relative; font-size: 12px; font-weight: 500; letter-spacing: .04em; color: var(--b-ink); margin-left: 8px; }
.book-title { position: relative; font-size: 19px; font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; margin: 12px 0 0 8px; max-width: 85%; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-foot { position: relative; margin-top: auto; margin-left: 8px; font-size: 12px; opacity: .6; }
.tc-av { width: 100% !important; height: 100% !important; border-radius: 0 !important; }

/* ---------- Person in shape ---------- */
.shp { position: relative; width: 100%; aspect-ratio: 1; background: var(--c); overflow: hidden; }
.shp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shp-fig { position: absolute; left: 6%; right: 6%; bottom: -4%; top: 10%; }
.shp-fig svg { width: 100%; height: 100%; display: block; }

/* ---------- Course banner ---------- */
.cb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  overflow: hidden;
  background: var(--cb);
  color: #fff;
  isolation: isolate;
}
.cb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%),
    radial-gradient(80% 70% at 0% 100%, rgba(0, 0, 0, .18), transparent 60%);
  z-index: -1;
}
.cb-text { z-index: 2; position: absolute; left: 7%; top: 9%; bottom: 9%; width: 56%; display: flex; flex-direction: column; }
.cb-tag { align-self: flex-start; font-size: clamp(10px, .8vw, 12px); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.cb-title { position: relative; z-index: 2; margin-top: auto; font-size: clamp(20px, 2vw, 34px); font-weight: 300; line-height: 1.04; letter-spacing: -0.04em; text-transform: uppercase; }
.cb-sub { margin-top: 8px; font-size: clamp(11px, .85vw, 14px); font-weight: 400; opacity: .85; }
.cb-person { position: absolute; right: 5%; bottom: 0; width: 42%; }
.cb-person .shp { border-radius: 0; }
.cb-name { position: absolute; right: 6%; bottom: 7%; font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); }
.cb-logo { position: absolute; right: 6%; top: 8%; font-size: 12px; font-weight: 300; letter-spacing: .08em; opacity: .9; }
.cb.lg .cb-title { font-size: clamp(30px, 3.6vw, 60px); }
.cb.lg .cb-tag { font-size: 13px; padding: 7px 14px; }
.cb.lg .cb-sub { font-size: clamp(14px, 1.1vw, 18px); }
.cb.lg .cb-name { font-size: 13px; padding: 6px 14px; }

.cc .cb-logo { display: none; }

.shp.round { border-radius: 22px; aspect-ratio: .86; }
.cb-person .shp.round { border-radius: 16px 16px 0 0; aspect-ratio: .9; }

/* =========================================================
   PDF viewer (shared: student + admin)
   ========================================================= */
.pv-bg { position: fixed; inset: 0; z-index: 8000; background: rgba(0, 0, 0, .6);  display: flex; padding: 20px; opacity: 0; transition: opacity .3s; }
.pv-bg.in { opacity: 1; }
.pv { flex: 1; display: flex; flex-direction: column; background: #F2F2F2; border-radius: 32px; overflow: hidden; transform: translateY(24px) scale(.985); transition: transform .45s var(--ease); min-width: 0; }
.pv-bg.in .pv { transform: none; }
.pv-h { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 14px 16px 14px 18px; background: var(--surface); }
.pv-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pv-title > div { display: flex; flex-direction: column; min-width: 0; }
.pv-title b { font-weight: 500; font-size: 16px; }
.pv-title span { color: var(--ink-3); font-size: 13px; }
.pv-ic { width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pv-ctrl { display: flex; align-items: center; gap: 4px; background: var(--page); border-radius: 99px; padding: 5px; }
.pv-b { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); transition: background .2s, color .2s; }
.pv-b:hover { background: var(--surface); color: var(--ink); }
.pv-pg { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-3); padding: 0 4px; }
.pv-pg input { width: 40px; height: 32px; border-radius: 10px; border: 0; background: var(--surface); text-align: center; font: inherit; font-weight: 500; color: var(--ink); }
.pv-zoom { min-width: 52px; text-align: center; font-size: 13px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pv-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 6px; }
.pv-act { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.pv-x { width: 46px; height: 46px; border-radius: 50%; background: var(--page); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); transition: background .25s, color .25s, transform .35s var(--ease); flex-shrink: 0; }
.pv-x:hover { background: var(--ink); color: #fff; transform: rotate(90deg); }
.pv-body { flex: 1; display: flex; min-height: 0; position: relative; }
.pv-thumbs { width: 148px; flex-shrink: 0; overflow-y: auto; padding: 18px 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.pv-th { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.pv-th canvas { width: 100%; height: auto; border-radius: 8px; background: var(--surface); box-shadow: 0 0 0 2px transparent, 0 6px 16px -8px rgba(0, 0, 0, .3); transition: box-shadow .2s; }
.pv-th.on canvas { box-shadow: 0 0 0 3px var(--primary), 0 6px 16px -8px rgba(0, 0, 0, .3); }
.pv-th.on { color: var(--primary); }
.pv-main { flex: 1; overflow: auto; padding: 24px 32px 48px; min-width: 0; scroll-behavior: auto; }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 22px; min-width: min-content; }
.pv-page { position: relative; background: var(--surface); border-radius: 6px; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .35); overflow: hidden; }
.pv-page canvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .3s; }
.pv-page.ok canvas { opacity: 1; }
.pv-page:not(.ok)::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, #fff 30%, #FFFFFF 50%, #fff 70%); background-size: 200% 100%; animation: pvShimmer 1.2s infinite; }
@keyframes pvShimmer { to { background-position: -200% 0; } }
.pv-wm { position: absolute; inset: -20%; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 60px 80px; transform: rotate(-28deg); pointer-events: none; user-select: none; }
.pv-wm span { font-size: 15px; font-weight: 500; color: rgba(14, 14, 14, .07); white-space: nowrap; }
.pv-load { display: flex; gap: 8px; padding: 120px 0; }
.pv-load i { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); animation: pvDot 1s infinite; }
.pv-load i:nth-child(2) { animation-delay: .15s; }
.pv-load i:nth-child(3) { animation-delay: .3s; }
@keyframes pvDot { 50% { transform: translateY(-8px); opacity: .4; } }
.pv-err { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 120px 20px; color: var(--ink-3); text-align: center; }
.pv-err b { color: var(--ink); font-size: 17px; }
.pv-rp { position: absolute; top: 14px; right: 14px; bottom: 14px; width: 340px; background: var(--surface); border-radius: 26px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35); transform: translateX(calc(100% + 30px)); transition: transform .45s var(--ease); }
.pv.rp-open .pv-rp { transform: none; }
.pv-rp-t { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.pv-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.pv-rp .lbl { margin-top: 6px; }
.pv-rp textarea { resize: none; height: auto; padding-top: 12px; line-height: 1.5; }
.pv-rp .btn-block { margin-top: auto; }
.pv.rp-open .pv-rp-btn { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (max-width: 1000px) {
  .pv-bg { padding: 0; }
  .pv { border-radius: 0; }
  .pv-h { grid-template-columns: minmax(0, 1fr) auto; }
  .pv-ctrl { order: 3; grid-column: 1 / -1; justify-self: center; }
  .pv-thumbs { display: none; }
  .pv-act .btn span { display: none; }
  .pv-main { padding: 16px 12px 40px; }
  .pv-rp { left: 10px; right: 10px; width: auto; }
}

/* =========================================================
   MONO + NEON layer (MHGIAOVU language) — overrides above
   ========================================================= */
body { font-weight: 300; }
.btn { font-weight: 400; letter-spacing: -0.005em; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--primary-600); box-shadow: 0 14px 28px -16px rgba(0, 0, 0, .6); }
.btn-neon { background: var(--accent); color: var(--ink); }
.btn-neon:hover { background: #4CD34C; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-indigo, .btn-sky { background: var(--ink); color: #fff; }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: var(--accent); color: var(--ink); }
.btn-outline { background: #fff; border: 1px solid var(--line-2); }
.btn-soft { background: var(--surface); color: var(--ink); }
.btn-soft:hover { background: var(--tile); }
.chip { background: var(--surface); border-color: transparent; color: var(--ink-2); font-weight: 300; }
.chip:hover { background: var(--tile); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab { font-weight: 300; }
.tab.on { background: var(--ink); color: #fff; }
.tabs { background: var(--surface); border-radius: var(--r-pill); padding: 4px; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; flex-shrink: 0; }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.link:hover { color: var(--ink); text-decoration-color: var(--ink); }
.card { background: var(--surface); border-radius: var(--r-lg); padding: 26px; }
.card-t { font-weight: 300; font-size: 19px; letter-spacing: -0.015em; }
.ph-title, .page-title { font-weight: 300; letter-spacing: -0.035em; }
.bar { background: var(--tile); }
.bar > i { background: var(--ink); }
.bar.sky > i { background: var(--ink); }
.pill-accent { background: var(--accent); color: var(--ink); }
.pill-sky { background: #fff; color: var(--ink); }
.input, .select, .textarea { background: #fff; border: 1px solid var(--line); font-weight: 300; }
.card .input, .card .select, .card .textarea { background: #fff; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0, 0, 0, .05); background: #fff; }
.modal { border-radius: 26px; }

/* ---------- Icon-only sidebar (always collapsed) ---------- */
.app { grid-template-columns: 92px minmax(0, 1fr); background: #fff; }
.side { padding: 26px 0 22px; align-items: center; background: #fff; overflow: visible; z-index: 30; border-right: 1px solid var(--line); }
.side .brand { margin: 0 0 30px; padding: 0; justify-content: center; }
.side .brand-name, .side .brand .ghost { display: none; }
.side .brand-dot { width: 44px; height: 44px; background: var(--ink); }
.side .nav { align-items: center; gap: 10px; }
.side .nav-group { font-size: 0; padding: 0; width: 22px; height: 1px; background: var(--line); margin: 8px 0; }
.side .nav-group:first-child { display: none; }
.side .nav-item { width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 50%; position: relative; color: var(--ink-2); }
.side .nav-item .ic { color: inherit; }
.side .nav-item:hover { background: var(--surface); color: var(--ink); }
.side .nav-item.on { background: var(--ink); color: #fff; }
.side .nav-item.on .ic { color: #fff; }
.side .nav-item.danger { color: var(--danger); }
.side .nav-item > span:not(.count) {
  position: absolute; left: calc(100% + 14px); top: 50%; transform: translate(-6px, -50%);
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 300; white-space: nowrap; padding: 7px 12px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .35s var(--ease); z-index: 60;
}
.side .nav-item:hover > span:not(.count) { opacity: 1; transform: translate(0, -50%); }
.side .nav-item .count {
  position: absolute; top: 2px; right: 0; margin: 0; min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10.5px; font-weight: 400; background: var(--accent); color: var(--ink); border-radius: 99px; box-shadow: 0 0 0 2px #fff;
}
.side .side-foot { align-items: center; padding-top: 16px; gap: 10px; }

/* ---------- Top bar ---------- */
.topbar { padding: 26px 0 30px; }
.search { background: #fff; border: 1px solid var(--line); height: 48px; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0, 0, 0, .05); }
.icon-btn { background: #fff; border: 1px solid var(--line); width: 48px; height: 48px; }
.icon-btn:hover { background: var(--surface); }
.icon-btn .dot { background: var(--accent); border-color: #fff; }
.me-name { font-weight: 400; font-size: 15.5px; }
.vsep { background: var(--line); }

/* Circle "go" buttons rotate like MHGIAOVU */
.circle-go { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--ink); transition: transform .45s var(--ease), background .3s; flex-shrink: 0; }

/* Course banners keep their bold display type */
.cb-title { font-weight: 600 !important; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
}

/* ===== PDF viewer · mono reading room ===== */
.pv-bg { background: rgba(10, 10, 10, .72);  padding: 14px; }
.pv { background: #EDEDED; border-radius: 14px; }
.pv-h { background: #fff; padding: 12px 14px 12px 20px; gap: 20px; }
.pv-ic { width: auto; height: auto; background: none; border-radius: 0; }
.pv-ic .file-svg { display: block; transition: transform .4s var(--ease); }
.pv-title:hover .pv-ic .file-svg { transform: rotate(-6deg) translateY(-2px); }
.pv-title b { font-size: 17px; font-weight: 400; letter-spacing: -0.02em; }
.pv-title span { font-size: 12.5px; }
.pv-ctrl { background: none; padding: 0; gap: 2px; }
.pv-b { width: 36px; height: 36px; color: var(--ink-3); }
.pv-b:hover { background: #F1F1F1; color: var(--ink); }
.pv-pg input { width: 38px; height: 30px; border-radius: 6px; background: #F1F1F1; font-weight: 400; }
.pv-zoom { font-weight: 400; color: var(--ink-3); }
.pv-sep { background: var(--line); margin: 0 8px; }
.pv-act .btn { height: 42px; border-radius: 99px; }
.pv-act .pv-rp-btn { border: 0; background: none; color: var(--ink-3); padding: 0 12px; }
.pv-act .pv-rp-btn:hover { color: var(--ink); background: #F1F1F1; }
.pv-x { width: 42px; height: 42px; background: #F1F1F1; }
.pv-prog { height: 2px; background: var(--line); flex-shrink: 0; }
.pv-prog i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px rgba(91, 225, 91, .8); transition: width .15s linear; }
.pv-thumbs { width: 132px; padding: 22px 12px 120px 20px; gap: 18px; }
.pv-th { align-items: flex-start; flex-direction: row; gap: 10px; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.pv-th span { order: -1; width: 14px; padding-top: 2px; transition: color .2s; }
.pv-th canvas { flex: 1; min-width: 0; border-radius: 2px; box-shadow: 0 1px 0 rgba(0, 0, 0, .06); opacity: .55; transition: opacity .25s, transform .35s var(--ease); }
.pv-th:hover canvas { opacity: .9; transform: translateX(3px); }
.pv-th.on canvas { opacity: 1; box-shadow: -3px 0 0 var(--accent), 0 8px 18px -10px rgba(0, 0, 0, .35); }
.pv-th.on { color: var(--ink); }
.pv-main { padding: 28px 40px 60px; }
.pv-page { border-radius: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 18px 40px -28px rgba(0, 0, 0, .35); }
.pv-big { position: absolute; left: 22px; bottom: 18px; z-index: 2; display: flex; align-items: baseline; gap: 6px; pointer-events: none; font-variant-numeric: tabular-nums; }
.pv-big b { font-size: 56px; font-weight: 300; letter-spacing: -0.05em; line-height: 1; color: var(--ink); }
.pv-big span { font-size: 14px; color: var(--ink-3); }
.pv-load i { background: var(--ink); }
.pv-rp { border-radius: 12px; top: 10px; right: 10px; bottom: 10px; background: #fff; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .4); }
.pv.rp-open .pv-rp-btn { background: var(--ink); color: #fff; }
@media (max-width: 900px) { .pv-big { display: none; } .pv { border-radius: 0; } }
.cb { color: var(--cbk, #fff); }
.cb::before { background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .14), transparent 55%), radial-gradient(70% 60% at 0% 100%, rgba(91, 225, 91, .18), transparent 60%); }
.cb-tag { background: color-mix(in srgb, var(--cbk, #fff) 14%, transparent); }

/* course cards: same motion as the homepage rail (tilt + lift + photo zoom) */
.tilt { transform-style: preserve-3d; transition: transform .5s var(--ease), box-shadow .5s var(--ease); will-change: transform; }
.tilt.live { transition: transform .08s linear, box-shadow .5s var(--ease); }
.tilt .cb { transform: translateZ(30px); }
.cc { transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.cc:hover { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .3); }
.cc .cb .shp { transition: transform .6s var(--ease); }
.cc:hover .cb .shp { transform: translateY(-4px) scale(1.03); }
.cc .btn-outline { transition: background .25s, color .25s, border-color .25s; }
.cc:hover .btn-outline { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .tilt, .cc .cb .shp { transition: none; } }

/* ===== Links: never underlined (2026-11 rule) ===== */
a, a:hover, a:focus, .link, .link:hover { text-decoration: none !important; }
.link { color: var(--ink); font-weight: 500; transition: color .2s; }
.link:hover { color: var(--accent-ink); }

/* ===================== PDF viewer v3 · dark reading room ===================== */
.pv-bg:has(.pv2) { padding: 0; background: #050505; }
.pv2 { border-radius: 0; background: radial-gradient(70% 60% at 50% 40%, #1B1B1B 0%, #0B0B0B 60%, #050505 100%); color: #fff; position: relative; overflow: hidden; }
.pv2::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .05; background-image: radial-gradient(rgba(255, 255, 255, .8) .6px, transparent .6px); background-size: 3px 3px; }
.pv2 .pv-h { position: absolute; top: 0; left: 0; right: 0; z-index: 5; background: linear-gradient(#0B0B0B 30%, rgba(11, 11, 11, 0)); padding: 16px 20px 28px 24px; display: flex; justify-content: space-between; }
.pv2 .pv-title b { color: #fff; font-weight: 300; font-size: 18px; }
.pv2 .pv-title span { color: rgba(255, 255, 255, .5); }
.pv2 .pv-act { gap: 8px; }
.pv-ghost, .pv-dl { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 99px; font-size: 14px; transition: background .2s, color .2s, transform .3s var(--ease); }
.pv-ghost { color: rgba(255, 255, 255, .75); }
.pv-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.pv-dl { background: #fff; color: var(--ink); }
.pv-dl:hover { background: var(--accent); transform: translateY(-1px); }
.pv2 .pv-x { background: rgba(255, 255, 255, .08); color: #fff; }
.pv2 .pv-x:hover { background: #fff; color: var(--ink); }
.pv2.rp-open .pv-rp-btn { background: #fff; color: var(--ink); }
.pv2 .pv-prog { position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 2px; background: transparent; }
.pv2 .pv-body { height: 100%; }
.pv2 .pv-main { padding: 96px 40px 130px; }
.pv2 .pv-pages { gap: 34px; perspective: 1600px; }
.pv2 .pv-page { border-radius: 3px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04); animation: pvIn .7s var(--ease) both; transition: box-shadow .4s, transform .4s var(--ease); }
.pv2 .pv-page:nth-child(2) { animation-delay: .08s; }
.pv2 .pv-page:nth-child(3) { animation-delay: .16s; }
@keyframes pvIn { from { opacity: 0; transform: translateY(40px) rotateX(8deg) scale(.97); } }
.pv2 .pv-page:not(.ok)::before { background: linear-gradient(100deg, #1d1d1d 30%, #2a2a2a 50%, #1d1d1d 70%); background-size: 200% 100%; }
.pv2.night .pv-page canvas, .pv2.night .pv-sp canvas, .pv2.night .pv-face canvas { filter: invert(.92) hue-rotate(180deg) brightness(.95); }
.pv2.night .pv-page, .pv2.night .pv-sp { background: #111; }
.pv2 .pv-wm span { color: rgba(14, 14, 14, .06); }
.pv2.night .pv-wm span { color: rgba(255, 255, 255, .06); }
/* filmstrip */
.pv2 .pv-thumbs { position: absolute; left: 0; top: 0; bottom: 0; z-index: 4; width: 120px; padding: 96px 14px 130px 22px; background: linear-gradient(90deg, rgba(5, 5, 5, .85), rgba(5, 5, 5, 0)); opacity: .35; transition: opacity .35s, width .35s var(--ease); }
.pv2 .pv-thumbs:hover { opacity: 1; width: 150px; }
.pv2 .pv-th { color: rgba(255, 255, 255, .4); }
.pv2 .pv-th canvas { border-radius: 2px; opacity: .6; box-shadow: 0 8px 18px -10px #000; transition: opacity .25s, transform .35s var(--ease), box-shadow .25s; }
.pv2 .pv-th:hover canvas { opacity: 1; transform: scale(1.06); }
.pv2 .pv-th.on { color: var(--accent); }
.pv2 .pv-th.on canvas { opacity: 1; box-shadow: 0 0 0 2px var(--accent), 0 12px 24px -12px rgba(91, 225, 91, .6); }
/* big numeral */
.pv2 .pv-big { left: auto; right: 34px; bottom: 34px; z-index: 4; flex-direction: column; align-items: flex-end; gap: 0; }
.pv2 .pv-big b { font-size: clamp(70px, 8vw, 120px); color: #fff; opacity: .9; letter-spacing: -0.07em; }
.pv2 .pv-big span { color: rgba(255, 255, 255, .4); font-size: 14px; letter-spacing: .1em; }
/* floating dock */
.pv-dock { position: absolute; left: 50%; bottom: 26px; z-index: 6; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 8px; border-radius: 99px; background: rgba(28, 28, 28, .72); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 50px -20px #000; animation: dockIn .7s .2s var(--ease) both; }
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 24px); } }
.pv-dock .pv-b { color: rgba(255, 255, 255, .7); width: 40px; height: 40px; }
.pv-dock .pv-b:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.pv-dock .pv-b.on { background: #fff; color: var(--ink); }
.pv-dock .pv-pg { color: rgba(255, 255, 255, .5); }
.pv-dock .pv-pg input { background: rgba(255, 255, 255, .1); color: #fff; border-radius: 99px; width: 44px; }
.pv-dock .pv-zoom { color: rgba(255, 255, 255, .7); }
.pv-dock .pv-sep { background: rgba(255, 255, 255, .12); height: 20px; }
.pv-mode { display: flex; background: rgba(255, 255, 255, .06); border-radius: 99px; padding: 3px; }
.pv-mode button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13px; color: rgba(255, 255, 255, .65); transition: background .25s, color .25s; }
.pv-mode button.on { background: #fff; color: var(--ink); }
.pv2 .pv-rp { top: 84px; bottom: 100px; background: #fff; color: var(--ink); }
/* book mode */
.pv2.is-book .pv-main, .pv2.is-book .pv-thumbs, .pv2.is-book .pv-dock .pv-zoom, .pv2.is-book [data-act="in"], .pv2.is-book [data-act="out"] { display: none; }
.pv-book { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 30px; }
.pv-book[hidden] { display: none; }
.pv-spread { position: relative; display: flex; perspective: 2600px; animation: pvIn .7s var(--ease) both; }
.pv-sp { position: relative; width: var(--pw); height: var(--ph); background: #fff; overflow: hidden; cursor: pointer; }
.pv-sp.blank { background: #141414; cursor: default; }
.pv-sp canvas, .pv-face canvas { width: 100%; height: 100%; display: block; }
.pv-leafL { border-radius: 4px 0 0 4px; box-shadow: -30px 40px 80px -40px #000; }
.pv-leafR { border-radius: 0 4px 4px 0; box-shadow: 30px 40px 80px -40px #000; }
.pv-leafL::after, .pv-leafR::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60px; pointer-events: none; }
.pv-leafL::after { right: 0; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .18)); }
.pv-leafR::after { left: 0; background: linear-gradient(-90deg, transparent, rgba(0, 0, 0, .22)); }
.pv-spine { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px); background: rgba(0, 0, 0, .25); z-index: 2; pointer-events: none; }
.pv-sp:hover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(var(--dir, 90deg), transparent 70%, rgba(91, 225, 91, .14)); }
.pv-leafL:hover::before { --dir: -90deg; }
.pv-leaf { position: absolute; top: 0; width: var(--pw); height: var(--ph); transform-style: preserve-3d; transition: transform .75s cubic-bezier(.6, .02, .2, 1); z-index: 3; }
.pv-leaf.fwd { left: 50%; transform-origin: left center; }
.pv-leaf.back { left: 0; transform-origin: right center; }
.pv-leaf.fwd.go { transform: rotateY(-180deg); }
.pv-leaf.back.go { transform: rotateY(180deg); }
.pv-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fff; overflow: hidden; }
.pv-face.backf { transform: rotateY(180deg); }
.pv-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 30%, transparent 70%, rgba(0, 0, 0, .12)); opacity: 0; transition: opacity .75s; }
.pv-leaf.go .pv-face::after { opacity: 1; }
.pv-sp .pv-wm, .pv-face .pv-wm { inset: -20%; }
@media (max-width: 900px) {
  .pv-dock { bottom: 12px; max-width: calc(100vw - 24px); overflow-x: auto; }
  .pv-mode span { display: none; }
  .pv2 .pv-big { display: none; }
  .pv2 .pv-main { padding: 80px 10px 110px; }
}
.pv-spread.single .pv-leafR, .pv-spread.single .pv-spine { display: none; }
.pv-spread.single .pv-leafL { border-radius: 4px; box-shadow: 0 40px 80px -30px #000; }
.pv-spread.single .pv-leafL::after { display: none; }
.pv-book { padding: 70px 0 110px; }
.pv2 .pv-ic .file-svg path:first-child { fill: var(--accent); }
.pv2 .pv-ic .file-svg path:last-child { fill: #0E0E0E; fill-opacity: .35; }
.pv-sp.blank:hover::before, .pv-sp.blank .pv-wm { display: none; }

/* ===================== Sửa chữ trên web (edit mode) ===================== */
.tx-editing body { padding-bottom: 46px; }
.tx-editing #tiad-student-app * { cursor: text; }
.tx-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10000; height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: #0E0E0E; color: #fff; font: 400 14px/1 Lexend, sans-serif; }
.tx-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(91, 225, 91, .18); animation: txPulse 1.6s infinite; }
.tx-bar kbd { background: rgba(255, 255, 255, .14); border-radius: 6px; padding: 3px 7px; font: inherit; font-size: 12px; }
@keyframes txPulse { 50% { box-shadow: 0 0 0 10px rgba(91, 225, 91, 0); } }
.tx-hl { position: fixed; z-index: 9998; pointer-events: none; border-radius: 6px; box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px rgba(91, 225, 91, .18); background: rgba(91, 225, 91, .06); opacity: 0; transition: opacity .12s, left .12s, top .12s, width .12s, height .12s; }
.tx-pop { position: fixed; z-index: 10001; width: 380px; background: #fff; color: #0E0E0E; border-radius: 18px; padding: 18px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .06); font: 300 14px/1.5 Lexend, sans-serif; animation: txIn .25s var(--ease, ease) both; cursor: default; }
@keyframes txIn { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.tx-pop * { cursor: auto; }
.tx-k { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #8C8C8C; margin-bottom: 8px; }
.tx-o { font-size: 13px; color: #6B6B6B; background: #F4F4F4; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; max-height: 90px; overflow: auto; }
.tx-p { margin-bottom: 10px; }
.tx-pop textarea { width: 100%; border: 1.5px solid #0E0E0E; border-radius: 12px; padding: 10px 12px; font: 400 15px/1.45 Lexend, sans-serif; resize: vertical; outline: none; }
.tx-pop textarea:focus { box-shadow: 0 0 0 4px rgba(91, 225, 91, .3); }
.tx-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.tx-b, .tx-g { height: 38px; padding: 0 16px; border-radius: 99px; font: 400 14px Lexend, sans-serif; cursor: pointer; }
.tx-b { background: #0E0E0E; color: #fff; }
.tx-b:hover { background: #2A2A2A; }
.tx-g { background: #F0F0F0; color: #0E0E0E; }
.tx-h { font-size: 12px; color: #8C8C8C; margin-top: 10px; }
.cb-title.long { font-size: clamp(15px, 1.45vw, 24px); }
.cb.lg .cb-title.long { font-size: clamp(22px, 2.6vw, 42px); }
.tbl td.wrap { white-space: normal; }
.tx-hl.lock { box-shadow: 0 0 0 2px #8C8C8C, 0 0 0 6px rgba(140, 140, 140, .18); background: rgba(140, 140, 140, .08); cursor: not-allowed; }
/* report panel: centred window of fixed size instead of sliding from the right */
.pv .pv-rp, .pv2 .pv-rp { top: 50%; left: 50%; right: auto; bottom: auto; width: min(420px, calc(100% - 32px)); height: min(520px, calc(100% - 32px)); z-index: 20; transform: translate(-50%, -50%) scale(.96); opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45), 0 30px 60px -20px rgba(0, 0, 0, .5); }
.pv.rp-open .pv-rp, .pv2.rp-open .pv-rp { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
/* page behind an open window never scrolls (and keeps its place) */
html { scrollbar-gutter: stable; }
html.ui-locked, html.ui-locked body { overflow: hidden !important; }
.qz-bg, .sh-bg, .em-bg, .tm-bg, .pv-bg, .lb-bg, .rw-bg { overscroll-behavior: contain; }
html:has(.qz-bg, .sh-bg, .em-bg, .tm-bg, .pv-bg, .lb-bg, .modal-bg, .drw-bg), html:has(.qz-bg, .sh-bg, .em-bg, .tm-bg, .pv-bg, .lb-bg, .modal-bg, .drw-bg) body { overflow: hidden; }
/* avatars keep their size in any flex row (never stretched into ovals) */
.av { flex: none !important; aspect-ratio: 1; }

/* =====================================================================
   Math editor (shared/js/math-editor.js): formulas show as maths while typing
   ===================================================================== */
.mxe { position: relative; display: flex; align-items: flex-start; gap: 8px; background: #fff; border-radius: 18px; box-shadow: 0 0 0 1px var(--line); padding: 8px 8px 8px 16px; transition: box-shadow .2s; }
.mxe:focus-within { box-shadow: 0 0 0 1.5px var(--ink); }
.mxe-area { position: relative; flex: 1; min-width: 0; min-height: 76px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; outline: none; padding: 5px 0; line-height: 1.75; font-weight: 300; white-space: pre-wrap; word-break: break-word; cursor: text; }
.mxe.single .mxe-area { min-height: 26px; max-height: 150px; padding: 3px 0; }
.mxe-area.empty::before { content: attr(data-ph); position: absolute; left: 0; top: 5px; right: 0; color: var(--ink-3); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mxe.single .mxe-area.empty::before { top: 3px; }
.mxc { display: inline-block; max-width: 100%; overflow-x: auto; vertical-align: middle; line-height: 1.3; padding: 1px 5px; margin: 0 1px; border-radius: 8px; background: var(--accent-50); cursor: pointer; transition: box-shadow .2s, background .2s; position: relative; }
.mxc:hover, .mxc:focus { box-shadow: inset 0 0 0 1.5px var(--accent-600); outline: none; }
.mxc.blk { display: block; text-align: center; padding: 8px; margin: 6px 0; }
.mxc .katex { font-size: 1.08em; }
.mxe-fx { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 12px; border-radius: 99px; background: var(--surface); color: var(--ink-2); font-size: 13px; transition: background .2s, color .2s; }
.mxe-fx span { font-family: "Times New Roman", serif; font-size: 19px; line-height: 1; }
.mxe-fx em { font-style: normal; }
.mxe-fx:hover { background: var(--ink); color: #fff; }
.mxe.single .mxe-fx { width: 34px; height: 34px; padding: 0; justify-content: center; }
/* Trình soạn công thức — same layout, sizes and symbols as MHMT; TIAD green instead of orange */
.mxp-bg { position: fixed; inset: 0; z-index: 9800; background: rgba(8, 8, 8, .55); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.mxp-bg.in { opacity: 1; }
.mxp { width: min(1020px, 96vw); height: min(600px, 92vh); background: #fff; border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); display: flex; flex-direction: column; transform: translateY(12px) scale(.985); transition: transform .35s var(--ease); font-weight: 400; color: var(--ink); }
.mxp-bg.in .mxp { transform: none; }
.mxp-h { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--line); }
.mxp-h h3 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.mxp-x { width: 34px; height: 34px; border-radius: 50%; background: transparent; color: var(--ink-3); font-size: 22px; line-height: 1; display: inline-grid; place-items: center; transition: background .15s, color .15s; }
.mxp-x:hover { background: var(--surface); color: var(--ink); }
.mxp-body { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 24px 6px; }
.mxp-catwrap { position: relative; flex-shrink: 0; }
.mxp-cats { display: flex; align-items: stretch; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mxp-cats::-webkit-scrollbar { display: none; }
.mxp-cat { flex: 1 1 0; min-width: 62px; min-height: 78px; padding: 7px 6px 7px; border-radius: 14px; border: 1px solid transparent; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 4px; transition: background .15s, border-color .15s, box-shadow .15s; }
.mxp-cat:hover { background: var(--tile); }
.mxp-cat.on { background: var(--accent-50); border-color: var(--accent-600); }
.mxp-cat-ic { min-height: 44px; display: flex; align-items: center; justify-content: center; font-size: 13.5px; line-height: 1.05; color: var(--ink); }
.mxp-cat-ic .katex { font-size: 1.02em; }
.mxp-cat-l { font-size: 11px; font-weight: 400; color: var(--ink-2); white-space: nowrap; line-height: 1.15; }
.mxp-cat.on .mxp-cat-l { color: var(--ink); font-weight: 500; }
/* symbol palette floats under the category bar; nothing is ever clipped */
.mxp-pop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 5; max-height: 300px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .28); padding: 14px 16px; }
.mxp-pop[hidden] { display: none; }
.mxp-sec + .mxp-sec { margin-top: 14px; }
.mxp-sec-t { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.mxp-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.mxp-sym { flex: 0 0 auto; min-width: 48px; min-height: 52px; padding: 7px 13px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14.5px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; transition: border-color .12s, background .12s; }
.mxp-sym .katex { font-size: 1.05em; }
.mxp-sym:hover { border-color: var(--accent-600); background: var(--accent-50); }
.mxp-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--ink-3); }
.mxp-mine { display: flex; flex-wrap: wrap; gap: 8px; }
.mxp-mine-i { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--tile-2); overflow: hidden; }
.mxp-mine-b { padding: 7px 14px; font-size: 14px; display: inline-flex; align-items: center; }
.mxp-mine-b:hover { background: var(--accent-50); }
.mxp-mine-x { border-left: 1px solid var(--line); padding: 0 10px; color: var(--ink-3); font-size: 15px; }
.mxp-mine-x:hover { background: var(--danger-50); color: var(--danger); }
.mxp-code { display: block; width: 100%; flex: 1 1 0; min-height: 0; resize: none; border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; font: 14px/1.55 "JetBrains Mono", ui-monospace, Consolas, "Courier New", monospace; color: var(--ink); background: #fff; outline: none; box-shadow: none; transition: border-color .15s; }
.mxp-code::placeholder { color: var(--ink-3); font-family: var(--font, inherit); }
.mxp-code:focus { border-color: var(--ink); box-shadow: none; }
.mxp-pv { flex-shrink: 0; height: 122px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; display: flex; padding: 12px 16px; font-size: 16px; position: relative; }
.mxp-pv-math { margin: auto; min-width: max-content; padding: 4px 6px; }
.mxp-pv-math .katex-display { margin: 0; }
.mxp-pv-line + .mxp-pv-line { margin-top: 6px; }
.mxp-pv-m.blk { display: block; text-align: center; }
.mxp-ph { margin: auto; font-size: 15px; color: var(--ink-3); }
.mxp-f { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 24px 16px; border-top: 1px solid var(--line); }
.mxp-fl, .mxp-fr { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mxp-radio { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.mxp-radio input { accent-color: var(--accent-ink); width: 16px; height: 16px; cursor: pointer; margin: 0; }
.mxp-env { height: 32px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-size: 13px; outline: none; cursor: pointer; }
.mxp-env:disabled { opacity: .45; cursor: default; }
.mxp-btn { height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s, color .15s; }
.mxp-btn:hover { border-color: var(--ink); }
.mxp-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 500; padding: 0 20px; }
.mxp-btn.primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.mxp-btn.danger { color: var(--danger); border-color: transparent; }
.mxp-btn.danger:hover { background: var(--danger-50); }
@media (max-width: 720px) {
  .mxp-bg { padding: 8px; grid-template-columns: minmax(0, 1fr); }
  .mxp { width: 100%; min-width: 0; height: 92vh; border-radius: 20px; }
  .mxp-env { max-width: 110px; }
  .mxp-body { padding: 12px 14px 4px; }
  .mxp-cat { flex: 0 0 66px; }
  .mxp-f { padding: 10px 14px 12px; }
  .mxp-fl { gap: 8px 12px; }
  .mxp-fr { width: 100%; }
  .mxp-btn.primary { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .mxp, .mxp-bg { transition: none; } }

/* =====================================================================
   Dropdown (shared/js/select.js) — same design as MHGIAOVU "Chọn"
   ===================================================================== */
select.chon-native { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
.chon { display: inline-flex; align-items: center; gap: 9px; min-width: 0; border: 1px solid transparent; color: var(--ink); font: inherit; font-weight: 300; font-size: 14px; text-align: left; cursor: pointer; transition: background .2s var(--ease), border-color .2s, box-shadow .2s; }
.chon:disabled { opacity: .55; cursor: default; }
.chon-gt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.chon.trong .chon-gt { color: var(--ink-3); }
.chon-mui { flex: 0 0 auto; display: inline-flex; color: var(--ink-3); transition: transform .25s var(--ease); }
.chon.open .chon-mui { transform: rotate(180deg); }
/* field in a form: same size as .input */
.chon-o { width: 100%; min-height: 50px; padding: 6px 16px 6px 18px; border-radius: var(--r-sm); background: var(--tile-2); border-color: transparent; font-size: var(--fs-md); }
.chon-o:hover { background: #fff; border-color: var(--line-2); }
.chon-o.open, .chon-o:focus-visible { background: #fff; border-color: var(--ink); outline: none; }
.card .chon-o, .drw .chon-o { background: #fff; border-color: var(--line); }
/* pill on a toolbar */
.chon-vien { height: 44px; padding: 0 16px; border-radius: 99px; background: #fff; border-color: var(--line); }
.chon-nho { height: 36px; padding: 0 12px; border-radius: 99px; background: #fff; border-color: var(--line); font-size: 13px; }
/* pills size to their label: never squeeze "M5 · 15 điểm" into "M5 · 15 đi…" */
.chon-vien, .chon-nho { flex-shrink: 0; max-width: 100%; }
.chon-vien:hover, .chon-nho:hover, .chon-vien.open, .chon-nho.open { background: var(--tile); }
.chon-vien:focus-visible, .chon-nho:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.chon-vien:not(.trong) .chon-gt, .chon-nho:not(.trong) .chon-gt { font-weight: 400; }
/* the open list */
.chon-pop { position: fixed; z-index: 12000; display: flex; flex-direction: column; background: #fff; border-radius: 18px; padding: 8px; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .04); animation: chonIn .16s var(--ease); font-weight: 300; }
@keyframes chonIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.chon-tim { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; background: var(--tile); border-radius: 12px; padding: 0 10px; height: 36px; margin-bottom: 6px; color: var(--ink-3); }
.chon-tim input { border: 0; background: transparent; outline: none; flex: 1; font: inherit; font-size: 13px; color: var(--ink); min-width: 0; }
.chon-list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; outline: none; }
.chon-nhom { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 9px 10px 4px; }
.chon-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 10px; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.chon-item.hl { background: var(--tile); }
.chon-item.active { background: var(--ink); color: #fff; }
.chon-item.mo { color: var(--ink-3); cursor: default; }
.chon-item-t { flex: 1; min-width: 0; }
.chon-rong { padding: 14px 10px; font-size: 13px; color: var(--ink-3); text-align: center; }
@media (prefers-reduced-motion: reduce) { .chon-pop { animation: none; } .chon-mui { transition: none; } }
.mxp-ocr { cursor: pointer; gap: 6px; }
.mxp-ocr.busy { pointer-events: none; opacity: .6; }
