/* Thanh niên Trường học — ứng dụng khách (máy tính bảng, xoay ngang) */

:root {
  --navy-950: #030d36;
  --navy-900: #041347;
  --navy-800: #061a5c;
  --navy-700: #0b2a8a;
  --blue-600: #1746c0;
  --blue-500: #1f5fe0;
  --cyan: #8fdcff;
  --ice: #e9f4ff;
  --ink: #0b1f4d;
  --ink-2: #33415f;
  --line: #d6e1f5;
  --paper: #ffffff;
  --gold: #ffd36b;
  --radius: 20px;
  --side-w: 296px;
  --pad-x: 40px;
  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --shadow: 0 10px 30px rgba(1, 8, 40, .28), 0 2px 6px rgba(1, 8, 40, .18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font: 400 20px/1.55 var(--font);
  color: #fff;
  background-color: var(--navy-800);
  background-image:
    radial-gradient(ellipse 70% 60% at 85% 0%, rgba(80, 160, 255, .22), transparent 60%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(40, 120, 255, .18), transparent 60%),
    repeating-radial-gradient(circle at 70% 40%, rgba(255, 255, 255, .025) 0 2px, transparent 2px 38px),
    linear-gradient(150deg, var(--navy-800) 0%, var(--navy-700) 100%);
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

img { -webkit-user-drag: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:focus { outline: none; }
button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
button[disabled] { cursor: default; }

.ico { display: inline-flex; width: 28px; height: 28px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.ico.sm { width: 22px; height: 22px; }

/* ============ Màn mở đầu ============ */
.home {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--navy-800);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.home.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .45s ease, visibility 0s;
}
.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.home-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 13, 54, .55) 0%, rgba(3, 13, 54, 0) 34%);
  pointer-events: none;
}
.home-cta {
  position: absolute;
  left: 50%;
  top: 80%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100vw - 48px);
}
.enter-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 80px;
  min-width: 340px;
  padding: 0 46px 0 54px;
  border-radius: 999px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 30, 120, .55);
  background: linear-gradient(180deg, rgba(255, 255, 255, .30) 0%, rgba(160, 210, 255, .14) 55%, rgba(255, 255, 255, .20) 100%);
  border: 1.5px solid rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow:
    0 14px 44px rgba(0, 18, 90, .5),
    inset 0 1px 0 rgba(255, 255, 255, .7),
    inset 0 -10px 24px rgba(120, 190, 255, .18),
    0 0 0 0 rgba(143, 220, 255, .45);
  animation: breathe 3.6s ease-in-out infinite;
  transition: transform .15s ease, background .3s ease;
}
.enter-btn:active { transform: scale(.97); }
.enter-btn .enter-label { position: relative; z-index: 2; white-space: nowrap; }
.enter-arrow { position: relative; z-index: 2; display: inline-flex; width: 30px; height: 30px; transition: transform .25s ease; }
.enter-arrow svg { width: 100%; height: 100%; }
.enter-btn.ready:active .enter-arrow { transform: translateX(4px); }
.enter-shine {
  position: absolute;
  z-index: 1;
  top: 0; bottom: 0;
  left: -40%;
  width: 34%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .5) 50%, transparent 100%);
  transform: skewX(-18deg);
  animation: shine 4.8s ease-in-out infinite;
  pointer-events: none;
}
.enter-fill {
  position: absolute;
  z-index: 0;
  left: 0; top: 0; bottom: 0;
  width: var(--p, 0%);
  background: linear-gradient(90deg, rgba(143, 220, 255, .18), rgba(143, 220, 255, .42));
  transition: width .4s ease;
  display: none;
}
.enter-btn.loading .enter-fill { display: block; }
.enter-btn:not(.ready) { cursor: default; animation: none; font-size: 23px; }
.enter-btn:not(.ready) .enter-arrow { display: none; }
.enter-btn.loading .enter-shine { animation-duration: 2.2s; }
.home-note {
  margin: 0;
  padding: 10px 22px;
  border-radius: 14px;
  font-size: 19px;
  font-weight: 500;
  text-align: center;
  color: #fff;
  background: rgba(3, 13, 54, .55);
  border: 1px solid rgba(255, 255, 255, .25);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 14px 44px rgba(0, 18, 90, .5), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -10px 24px rgba(120, 190, 255, .18), 0 0 0 0 rgba(143, 220, 255, .40); }
  50% { box-shadow: 0 14px 44px rgba(0, 18, 90, .5), inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -10px 24px rgba(120, 190, 255, .28), 0 0 0 12px rgba(143, 220, 255, 0); }
}
@keyframes shine {
  0% { left: -40%; }
  55%, 100% { left: 120%; }
}

/* ============ Khung ứng dụng ============ */
.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, rgba(3, 13, 54, .72), rgba(3, 13, 54, .5));
  border-right: 1px solid rgba(160, 205, 255, .18);
  box-shadow: 8px 0 30px rgba(0, 6, 30, .25);
  -webkit-user-select: none;
  user-select: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 8px 20px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(160, 205, 255, .16);
}
.brand-logo { width: 58px; height: 58px; border-radius: 14px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.nav {
  list-style: none;
  margin: 0;
  padding: 0 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 70px;
  padding: 12px 16px 12px 20px;
  border-radius: 16px;
  text-align: left;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(255, 255, 255, .88);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.nav-btn .ico { width: 30px; height: 30px; opacity: .9; }
.nav-btn:active { background: rgba(255, 255, 255, .12); }
.nav li.active .nav-btn {
  color: var(--navy-800);
  background: linear-gradient(180deg, #ffffff, #e6f1ff);
  box-shadow: 0 8px 24px rgba(0, 10, 50, .35), 0 0 0 1px rgba(255, 255, 255, .6), 0 0 22px rgba(143, 220, 255, .35);
}
.nav li.active .nav-btn::before {
  content: "";
  position: absolute;
  left: 6px; top: 18px; bottom: 18px;
  width: 5px;
  border-radius: 4px;
  background: var(--blue-500);
}
.nav li.active .nav-btn .ico { color: var(--blue-500); opacity: 1; }

.side-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; margin-top: 10px; border-top: 1px solid rgba(160, 205, 255, .16); }
.side-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 20px;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .22);
}
.side-btn:active { background: rgba(255, 255, 255, .18); }
.side-btn.subtle { min-height: 52px; font-size: 17px; font-weight: 500; color: rgba(255, 255, 255, .75); background: transparent; border-color: rgba(255, 255, 255, .12); }
.side-btn.subtle .ico { width: 22px; height: 22px; }
.side-btn[hidden] { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  flex: none;
  padding: 22px var(--pad-x) 16px;
  border-bottom: 1px solid rgba(160, 205, 255, .14);
  background: linear-gradient(180deg, rgba(3, 13, 54, .35), rgba(3, 13, 54, 0));
}
.tb-site { font-size: 15px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.tb-event {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 10px var(--pad-x) 64px;
  scroll-behavior: auto;
}
.page { animation: pageIn .3s ease both; max-width: 1400px; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-title {
  margin: 14px 0 24px;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.005em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 10, 60, .35);
}
.page-detail .page-title { font-size: 22px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin: 14px 0 14px; }

/* ============ Khối giấy (nền sáng) ============ */
.paper {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 32px 40px;
  box-shadow: var(--shadow);
}

/* ============ Nội dung HTML (Quill) ============ */
.rich { font-size: 21px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p { margin: .55em 0; }
.rich h1 { font-size: 34px; line-height: 1.25; margin: 1em 0 .4em; color: var(--navy-700); }
.rich h2 { font-size: 30px; line-height: 1.25; margin: 1em 0 .4em; color: var(--navy-700); }
.rich h3 { font-size: 25px; line-height: 1.3; margin: .9em 0 .35em; color: var(--navy-700); }
.rich ul, .rich ol { padding-left: 1.5em; margin: .5em 0; }
.rich li { margin: .25em 0; }
.rich li::marker { color: var(--blue-500); font-weight: 700; }
.rich blockquote { margin: .8em 0; padding: .3em 0 .3em 1em; border-left: 4px solid var(--blue-500); color: var(--ink-2); font-style: italic; }
.rich a { color: var(--blue-600); text-decoration: underline; text-underline-offset: 3px; }
.rich img { max-width: 100%; height: auto; border-radius: 12px; display: inline-block; vertical-align: middle; }
.rich img.zoomable { cursor: zoom-in; }
.rich table { border-collapse: collapse; max-width: 100%; }
.rich td, .rich th { border: 1px solid var(--line); padding: 8px 12px; }
.rich strong { font-weight: 700; }
.rich .ql-align-center { text-align: center; }
.rich .ql-align-right { text-align: right; }
.rich .ql-align-justify { text-align: justify; }
.rich .ql-indent-1 { padding-left: 3em; }
.rich .ql-indent-2 { padding-left: 6em; }
.rich .ql-indent-3 { padding-left: 9em; }
.rich .ql-indent-4 { padding-left: 12em; }
.rich .ql-indent-5 { padding-left: 15em; }
.rich .ql-indent-6 { padding-left: 18em; }
.rich .ql-indent-7 { padding-left: 21em; }
.rich .ql-indent-8 { padding-left: 24em; }
.rich li.ql-indent-1 { margin-left: 1.5em; padding-left: 0; }
.rich li.ql-indent-2 { margin-left: 3em; padding-left: 0; }
.rich li.ql-indent-3 { margin-left: 4.5em; padding-left: 0; }
.rich li.ql-indent-4 { margin-left: 6em; padding-left: 0; }
.rich .ql-size-small { font-size: .85em; }
.rich .ql-size-large { font-size: 1.3em; }
.rich .ql-size-huge { font-size: 1.7em; }

/* ============ Trống ============ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46vh;
  padding: 40px;
  border-radius: var(--radius);
  border: 1.5px dashed rgba(160, 205, 255, .35);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .85);
  text-align: center;
}
.empty p { margin: 0; font-size: 24px; font-weight: 500; }
.empty-ico { display: inline-flex; width: 64px; height: 64px; color: var(--cyan); opacity: .8; }
.empty-ico svg { width: 100%; height: 100%; }

/* ============ Chương trình (timeline) ============ */
.schedule { max-width: 1100px; }
.intro { margin-bottom: 28px; padding: 22px 32px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 124px 36px 1fr;
  align-items: start;
  padding-bottom: 22px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: calc(124px + 17px);
  top: 30px;
  bottom: -2px;
  width: 2px;
  background: linear-gradient(180deg, rgba(143, 220, 255, .7), rgba(143, 220, 255, .2));
}
.tl-item:last-child::before { display: none; }
.tl-time {
  padding-top: 14px;
  padding-right: 10px;
  text-align: right;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  text-shadow: 0 0 18px rgba(143, 220, 255, .45);
}
.tl-dot {
  position: relative;
  z-index: 1;
  justify-self: center;
  margin-top: 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--blue-500);
  box-shadow: 0 0 0 5px rgba(143, 220, 255, .25), 0 0 16px rgba(143, 220, 255, .7);
}
.tl-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  padding: 18px 26px;
  box-shadow: var(--shadow);
  border-left: 6px solid var(--blue-500);
}
.tl-title { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.35; color: var(--navy-800); }
.tl-speaker { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 20px; font-weight: 600; color: var(--blue-600); }
.tl-speaker .ico { width: 22px; height: 22px; }
.tl-desc { margin: 8px 0 0; font-size: 20px; line-height: 1.6; color: var(--ink-2); white-space: pre-line; }

/* ============ Bài viết ============ */
.article { max-width: 1100px; display: flex; flex-direction: column; gap: 28px; }
.article > .paper { padding: 36px 48px; }

/* ============ Đính kèm ============ */
.attachments { margin-top: 6px; }
.block-title { margin: 0 0 14px; font-size: 24px; font-weight: 700; color: #fff; }
.paper .block-title { color: var(--navy-800); margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.att-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 12px 18px 12px 12px;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(1, 8, 40, .12);
  transition: transform .15s ease, box-shadow .15s ease;
}
.att-card:active { transform: scale(.98); }
.att-card .thumb { width: 76px; height: 76px; border-radius: 12px; flex: none; }
.att-card .thumb-ico { width: 34px; height: 34px; }
.att-card .thumb-ext { display: none; }
.att-text { display: flex; flex-direction: column; min-width: 0; }
.att-label { font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--navy-800); }
.att-meta { font-size: 17px; color: var(--ink-2); margin-top: 2px; }

/* ============ Ảnh thu nhỏ / biểu tượng loại tệp ============ */
.thumb {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8eef9;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.icon-only { flex-direction: column; gap: 6px; }
.thumb.icon-only[data-kind="pdf"] { background: linear-gradient(150deg, #fff1f0, #ffd9d4); color: #c4291c; }
.thumb.icon-only[data-kind="video"] { background: linear-gradient(150deg, #e8f0ff, #c8dbff); color: var(--blue-600); }
.thumb.icon-only[data-kind="image"] { background: linear-gradient(150deg, #e9fbf3, #c6f0dc); color: #0f7a4d; }
.thumb.icon-only[data-kind="file"] { background: linear-gradient(150deg, #f1f4fa, #dde4f0); color: var(--ink-2); }
.thumb-ico { display: inline-flex; width: 72px; height: 72px; }
.thumb-ico svg { width: 100%; height: 100%; }
.thumb-ext { font-size: 16px; font-weight: 800; letter-spacing: .12em; }
.thumb .play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(3, 13, 54, .55);
  border: 2px solid rgba(255, 255, 255, .8);
}
.thumb .play .ico { width: 36px; height: 36px; }

/* ============ Tài liệu ============ */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.doc-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.doc-card:active { transform: scale(.98); }
.doc-card .thumb { aspect-ratio: 4 / 3; width: 100%; }
.doc-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 20px; }
.doc-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-600); }
.doc-label { font-size: 22px; font-weight: 700; line-height: 1.3; color: var(--navy-800); }
.doc-desc { font-size: 18px; line-height: 1.5; color: var(--ink-2); }

/* ============ Hồ sơ ============ */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 22px; }
.profile-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.profile-card:active { transform: scale(.97); }
.pc-photo, .pd-photo { position: relative; aspect-ratio: 3 / 4; width: 100%; overflow: hidden; background: linear-gradient(160deg, #dbe7fb, #b9cdf3); }
.pc-photo img, .pd-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; }
.no-photo { display: flex; align-items: center; justify-content: center; color: rgba(11, 42, 138, .45); }
.ph-ico { display: inline-flex; width: 45%; height: 45%; }
.ph-ico svg { width: 100%; height: 100%; }
.pc-text { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 18px; }
.pc-name { font-size: 21px; font-weight: 700; line-height: 1.3; color: var(--navy-800); }
.pc-title { font-size: 18px; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Lọc hồ sơ theo tỉnh/thành phố */
.grp-bar {
  position: sticky;
  top: -10px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: -6px calc(-1 * var(--pad-x)) 22px;
  padding: 12px var(--pad-x);
  background: rgba(6, 26, 92, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(160, 205, 255, .16);
}
.grp-all, .grp-pick {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 21px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 1.5px solid rgba(255, 255, 255, .4);
}
.grp-pick { min-width: 0; max-width: 100%; }
.grp-all.on, .grp-pick.on { color: var(--navy-800); background: #fff; border-color: #fff; box-shadow: var(--shadow); }
.grp-all:active, .grp-pick:active { transform: scale(.97); }
.grp-pick-k { font-weight: 500; opacity: .85; white-space: nowrap; }
.grp-pick-v { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-caret { font-size: 20px; margin-left: 2px; }
.pgroup { margin: 0 0 34px; }
.pgroup-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 16px;
  padding-bottom: 8px;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  border-bottom: 2px solid rgba(143, 220, 255, .35);
}
.pgroup-n { font-size: 18px; font-weight: 600; color: var(--cyan); }
.pd-group { font-size: 19px; font-weight: 700; color: var(--cyan); margin-right: 4px; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-pop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 28px max(24px, env(safe-area-inset-bottom));
  background: rgba(2, 8, 36, .6);
  opacity: 0;
  transition: opacity .18s ease;
}
.grp-pop.show { opacity: 1; }
.grp-sheet {
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  max-height: 100%;
  color: var(--ink);
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.grp-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px 14px 28px; border-bottom: 1px solid var(--line); }
.grp-h { font-size: 24px; color: var(--navy-800); }
.grp-x { display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 20px; border-radius: 999px; font-size: 19px; font-weight: 700; color: var(--navy-800); background: #eef3fc; }
.grp-x .ico { width: 24px; height: 24px; }
.grp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  padding: 18px 22px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.grp-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 64px;
  padding: 8px 16px 8px 20px;
  border-radius: 14px;
  text-align: left;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--navy-800);
  background: #f2f6fd;
  border: 1.5px solid var(--line);
}
.grp-opt:active { transform: scale(.98); }
.grp-opt.on { color: #fff; background: var(--blue-500); border-color: var(--blue-500); }
.grp-n { flex: none; min-width: 40px; padding: 2px 10px; border-radius: 999px; text-align: center; font-size: 17px; font-weight: 700; background: rgba(6, 26, 92, .08); font-variant-numeric: tabular-nums; }
.grp-opt.on .grp-n { background: rgba(255, 255, 255, .22); }

.profile-detail { touch-action: pan-y; }
.pd-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 0 28px 0 22px;
  border-radius: 999px;
  font-size: 21px;
  font-weight: 700;
  color: var(--navy-800);
  background: #fff;
  box-shadow: var(--shadow);
}
.pill-btn:active { transform: scale(.97); }
.pd-pager { display: flex; align-items: center; gap: 14px; }
.pd-count { min-width: 84px; text-align: center; font-size: 20px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.round-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 1.5px solid rgba(255, 255, 255, .45);
}
.round-btn .ico { width: 32px; height: 32px; }
.round-btn:active { background: rgba(255, 255, 255, .25); }
.round-btn[disabled] { opacity: .3; }
.pd-main { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 32px; align-items: start; }
.pd-side { position: sticky; top: 0; }
.pd-photo { border-radius: var(--radius); box-shadow: var(--shadow); border: 4px solid rgba(255, 255, 255, .9); }
.pd-content { padding: 34px 40px; min-width: 0; }
.pd-name { margin: 0; font-size: 36px; font-weight: 800; line-height: 1.2; color: var(--navy-800); }
.pd-title { margin: 10px 0 0; font-size: 22px; font-weight: 600; line-height: 1.45; color: var(--blue-600); }
.pd-summary { margin: 20px 0 0; padding: 14px 20px; font-size: 21px; line-height: 1.6; font-style: italic; color: var(--ink-2); background: #f2f6fd; border-left: 5px solid var(--blue-500); border-radius: 0 12px 12px 0; }
.pd-content > .rich { margin-top: 22px; }

/* ============ Lớp phủ ============ */
.overlays { position: relative; z-index: 100; }
.ov {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #020a2a linear-gradient(160deg, #03103d 0%, #020820 100%);
  opacity: 0;
  transition: opacity .2s ease;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.ov.show { opacity: 1; }
.ov-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 80px;
  padding: 10px 14px 10px 28px;
  background: linear-gradient(180deg, rgba(6, 26, 92, .95), rgba(6, 26, 92, .75));
  border-bottom: 1px solid rgba(160, 205, 255, .2);
}
.ov-title { flex: 1 1 auto; min-width: 0; font-size: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-tools { display: flex; align-items: center; gap: 8px; }
.ov-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 60px;
  min-height: 60px;
  padding: 0 14px;
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .25);
}
.ov-btn:active { background: rgba(255, 255, 255, .22); }
.ov-btn .ico { width: 30px; height: 30px; }
.ov-close { margin-left: 8px; padding: 0 24px 0 18px; font-size: 21px; font-weight: 700; color: var(--navy-800); background: #fff; border-color: #fff; }
.ov-close:active { background: #dfeaff; }
.ov-zoom, .ov-page { min-width: 64px; text-align: center; font-size: 18px; font-weight: 600; color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; }
.ov-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.ov-scroll { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ov-msg { position: absolute; inset: 0; margin: auto; height: max-content; max-width: 640px; padding: 28px 32px; text-align: center; font-size: 22px; line-height: 1.5; border-radius: 18px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); }
.ov-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-size: 21px; color: rgba(255, 255, 255, .85); }
.spin { width: 52px; height: 52px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .2); border-top-color: var(--cyan); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ov-video { display: flex; align-items: center; justify-content: center; background: #000; }
.ov-video video { width: 100%; height: 100%; max-width: 100%; max-height: 100%; background: #000; }

.ov-img-holder, .pdf-holder {
  display: grid;
  place-items: center;
  min-width: 100%;
  min-height: 100%;
  width: max-content;
  padding: 24px;
}
.pdf-holder { padding: 20px 24px 76px; }
.ov-img { display: block; max-width: calc(100vw - 48px); max-height: calc(100vh - 80px - 48px); border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.ov-img-holder.zoomed .ov-img { max-width: none; max-height: none; }

.pdf-body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.pdf-stage { flex: 1 1 auto; touch-action: none; background: radial-gradient(ellipse at center, rgba(40, 80, 180, .25), transparent 70%); }
.pdf-stage.zoomed { touch-action: pan-x pan-y; }
.pdf-canvas { display: block; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .55); border-radius: 2px; }
.pdf-holder.slide-l .pdf-canvas { animation: slideL .25s ease; }
.pdf-holder.slide-r .pdf-canvas { animation: slideR .25s ease; }
@keyframes slideL { from { opacity: .3; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: .3; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.pdf-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 84px;
  height: 84px;
  margin-top: -42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--navy-800);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
  transition: opacity .2s ease, transform .15s ease;
}
.pdf-nav .ico { width: 44px; height: 44px; }
.pdf-nav.prev { left: 18px; }
.pdf-nav.next { right: 18px; }
.pdf-nav:active { transform: scale(.94); }
.pdf-nav[disabled] { opacity: 0; pointer-events: none; }
.pdf-counter {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 8px 22px;
  border-radius: 999px;
  background: rgba(3, 13, 54, .85);
  border: 1px solid rgba(255, 255, 255, .25);
  pointer-events: none;
}
.pdf-counter .ov-page { font-size: 21px; font-weight: 700; color: #fff; }

/* ============ Xoay ngang ============ */
.rotate { display: none; }
@media (orientation: portrait) {
  .rotate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--navy-800), var(--navy-700));
    text-align: center;
  }
  .rotate-box { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 24px; }
  .rotate-box p { margin: 0; font-size: 28px; font-weight: 700; }
  .rotate-ico { display: inline-flex; width: 96px; height: 96px; color: var(--cyan); animation: rot 2.4s ease-in-out infinite; }
  .rotate-ico svg { width: 100%; height: 100%; }
}
@keyframes rot { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }

/* ============ Trạng thái ============ */
.status {
  position: fixed;
  right: max(4px, env(safe-area-inset-right));
  bottom: max(4px, env(safe-area-inset-bottom));
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  touch-action: none;
}
.st-dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa6bf; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); transition: transform .3s ease; }
.st-pct { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .65); font-variant-numeric: tabular-nums; }
.status[data-color="green"] .st-dot { background: #2bd47d; }
.status[data-color="yellow"] .st-dot { background: #ffcc33; animation: blink 1.1s ease-in-out infinite; }
.status[data-color="gray"] .st-dot { background: #9aa6bf; }
.status[data-color="red"] .st-dot { background: #ff4d4f; }
.status.pressing .st-dot { transform: scale(2.2); transition: transform 2s linear; }
@keyframes blink { 50% { opacity: .25; } }
.st-panel {
  position: fixed;
  right: 16px;
  bottom: 56px;
  z-index: 200;
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 18px 20px 20px;
  border-radius: 18px;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.st-panel[hidden] { display: none; }
.st-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 19px; color: var(--navy-800); }
.st-x { width: 44px; height: 44px; font-size: 30px; line-height: 1; color: var(--ink-2); }
.st-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
.st-list dt { color: var(--ink-2); }
.st-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.st-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.st-btn { min-height: 52px; padding: 0 18px; border-radius: 12px; font-size: 17px; font-weight: 600; color: var(--navy-800); background: #eef3fc; border: 1px solid var(--line); }
.st-btn.primary { color: #fff; background: var(--blue-500); border-color: var(--blue-500); }
.st-btn.danger { color: #b3261e; }
.st-btn[disabled] { opacity: .6; }
.st-warn { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: #fff4e5; color: #8a4b00; font-weight: 600; }
.st-warn[hidden] { display: none; }

.noscript { position: fixed; inset: auto 0 0 0; padding: 16px; text-align: center; background: #b3261e; z-index: 2000; }

/* ============ Màn hình nhỏ hơn (iPad 4:3, tablet 10") ============ */
@media (max-width: 1100px) {
  :root { --side-w: 256px; --pad-x: 28px; }
  .nav-btn { font-size: 20px; gap: 12px; padding-left: 16px; }
  .brand-logo { width: 50px; height: 50px; }
  .page-title { font-size: 34px; }
  .pd-main { grid-template-columns: minmax(200px, 270px) 1fr; gap: 24px; }
  .pd-content { padding: 28px 30px; }
  .tl-item { grid-template-columns: 104px 34px 1fr; }
  .tl-item::before { left: calc(104px + 16px); }
  .tl-time { font-size: 26px; }
}
@media (max-height: 640px) {
  .nav-btn { min-height: 60px; }
  .brand { padding-bottom: 12px; margin-bottom: 10px; }
  .brand-logo { width: 44px; height: 44px; }
  .topbar { padding-top: 14px; padding-bottom: 10px; }
}
@media (max-width: 760px) {
  .enter-btn { min-width: 0; padding: 0 30px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
