/* =========================================================================
   ALOBO Wiki — design system
   1. Tokens        5. Header / Footer     9.  Article page + prose
   2. Base          6. Home (landing)      10. Contact / 404
   3. Layout        7. Shared blocks       11. Lightbox
   4. Components    8. Guide library       12. Motion
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* Brand: lấy theo logo xanh lá chuyển sắc */
  --brand-900: #033d22;
  --brand-800: #01562d;
  --brand-700: #016d38;
  --brand-600: #108942;
  --brand-500: #1fa855;
  --brand-400: #4cc46e;
  --lime-400: #8bd34a;
  --brand-soft: #e8f6ed;

  /* Màu nhấn cho từng khối, giúp mắt quét nhanh */
  --c-green: #108942;
  --c-blue: #2563eb;
  --c-amber: #d97706;
  --c-violet: #7c3aed;
  --c-rose: #e11d48;
  --c-teal: #0d9488;
  --c-sky: #0284c7;
  --c-orange: #ea580c;
  --c-indigo: #4f46e5;

  --bg-page: #f3f6f4;
  --bg-surface: #ffffff;
  --bg-subtle: #f7f9f8;
  --bg-inverse: #062a18;

  --text-1: #0d1b14;
  --text-2: #42524a;
  --text-3: #6b7a72;
  --text-on-brand: #ffffff;

  --stroke: #e3e9e5;
  --stroke-strong: #cfd8d3;

  /* Bóng 2 lớp rất nhẹ: đủ tách thẻ khỏi nền mà trang không bị nặng */
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-pop: 0 18px 40px -12px rgba(3, 61, 34, 0.25), 0 4px 12px rgba(0, 0, 0, 0.06);

  --r-8: 8px;
  --r-12: 12px;
  --r-16: 16px;
  --r-24: 24px;
  --r-pill: 999px;

  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Consolas, 'Courier New', monospace;

  --fs-display: clamp(2rem, 1.2rem + 3.6vw, 3.6rem);
  --fs-h2: clamp(1.55rem, 1.15rem + 1.6vw, 2.4rem);
  --fs-h3: 1.125rem;
  --fs-lead: clamp(1rem, 0.95rem + 0.3vw, 1.175rem);

  --header-h: 68px;

  /* Bố cục theo khổ màn — mặc định: điện thoại 400–599 */
  --gutter: 20px;
  --page-max: 100%;
  --side-w: 0px;
  --col-gap: 20px;
  --section-y: 56px;
  --cols-feature: 1;
  --cols-cards: 1;
}

/* Điện thoại nhỏ < 400: bóp lề gọn hơn */
@media (max-width: 399px) {
  :root { --gutter: 16px; --section-y: 44px; }
}
/* Tablet 600–899: 1 cột, bó khung ~720px căn giữa */
@media (min-width: 600px) {
  :root { --gutter: 24px; --page-max: 768px; --section-y: 72px; --cols-feature: 2; --cols-cards: 2; }
}
/* Laptop 900–1199: 2 cột, cột trái 320, trải hết bề ngang */
@media (min-width: 900px) {
  :root { --gutter: 20px; --page-max: 100%; --side-w: 320px; --col-gap: 20px; --section-y: 88px; --cols-feature: 3; --cols-cards: 2; }
}
/* Desktop 1200–1599: cột trái 400 */
@media (min-width: 1200px) {
  :root { --gutter: 32px; --side-w: 400px; --col-gap: 24px; --section-y: 104px; --cols-cards: 3; }
}
/* Màn lớn ≥ 1600: cột trái 440, giới hạn 2400, phần dư chia thêm cột */
@media (min-width: 1600px) {
  :root { --gutter: 48px; --page-max: 2400px; --side-w: 440px; --col-gap: 28px; --cols-feature: 4; --cols-cards: 4; }
}

[data-theme="dark"] {
  --brand-soft: rgba(76, 196, 110, 0.12);
  --bg-page: #08110c;
  --bg-surface: #0f1c15;
  --bg-subtle: #13231a;
  --bg-inverse: #040b07;

  --text-1: #e7efea;
  --text-2: #b3c2b9;
  --text-3: #85968c;

  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.16);

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  --shadow-pop: 0 18px 40px -12px rgba(0, 0, 0, 0.6);

  --c-green: #3ccb6f;
  --c-blue: #60a5fa;
  --c-amber: #fbbf24;
  --c-violet: #a78bfa;
  --c-rose: #fb7185;
  --c-teal: #2dd4bf;
  --c-sky: #38bdf8;
  --c-orange: #fb923c;
  --c-indigo: #818cf8;
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-1); font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
ul { list-style: none; }
/* Thuộc tính hidden luôn thắng: nhiều khối tự đặt display (flex/grid) sẽ đè mất hidden của trình duyệt */
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-500) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

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

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 2000;
  background: var(--brand-700); color: #fff; padding: 10px 16px; border-radius: var(--r-8);
}
.skip-link:focus { top: 12px; }

/* ---------- 3. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--surface { background: var(--bg-surface); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }

.section-head { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: var(--fs-h2); margin-bottom: 12px; }
.section-head p { color: var(--text-2); font-size: var(--fs-lead); }
.section-head--left { margin-inline: 0; text-align: left; }

/* Bố cục 2 cột theo vai trò: cột trái = điều hướng / thao tác thường dùng */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--col-gap);
  align-items: start;
}
@media (min-width: 900px) {
  .split { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .split__side--sticky { position: sticky; top: calc(var(--header-h) + 20px); }
}

.page-body { padding-block: 28px 72px; }
@media (min-width: 900px) { .page-body { padding-block: 32px 96px; } }

/* ---------- 4. Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-weight: 600; font-size: 0.975rem; line-height: 1; white-space: nowrap;
  cursor: pointer; transition: transform .15s ease, background-color .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-600); color: #fff; box-shadow: 0 6px 16px -6px rgba(16, 137, 66, .6); }
.btn--primary:hover { background: var(--brand-700); }
.btn--light { background: #fff; color: var(--brand-800); }
.btn--light:hover { background: #ecfdf2; }
.btn--ghost { background: var(--bg-surface); color: var(--text-1); border-color: var(--stroke-strong); }
.btn--ghost:hover { border-color: var(--brand-500); color: var(--brand-600); }
.btn--glass { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn--glass:hover { background: rgba(255, 255, 255, .18); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 0.9rem; }
.btn--block { width: 100%; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand-600);
  font-size: 0.8rem; font-weight: 600; letter-spacing: .02em;
}
[data-theme="dark"] .eyebrow { color: var(--brand-400); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-pill);
  font-size: 0.8rem; font-weight: 600;
  background: color-mix(in srgb, var(--accent, var(--c-green)) 10%, transparent);
  color: var(--accent, var(--c-green));
}

/* Màu nhấn theo khối */
.accent-green { --accent: var(--c-green); }
.accent-blue { --accent: var(--c-blue); }
.accent-amber { --accent: var(--c-amber); }
.accent-violet { --accent: var(--c-violet); }
.accent-rose { --accent: var(--c-rose); }
.accent-teal { --accent: var(--c-teal); }
.accent-sky { --accent: var(--c-sky); }
.accent-orange { --accent: var(--c-orange); }
.accent-indigo { --accent: var(--c-indigo); }

/* Ô icon có màu nhấn: nền chuyển sắc, icon trắng, bóng cùng tông */
.icon-tile {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--r-12);
  color: #fff; font-size: 1.1rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, var(--c-green)) 78%, #fff), var(--accent, var(--c-green)));
  box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--accent, var(--c-green)) 45%, transparent);
}
.icon-tile--sm { width: 32px; height: 32px; border-radius: var(--r-8); font-size: 0.9rem; }
.icon-tile--soft {
  background: color-mix(in srgb, var(--accent, var(--c-green)) 12%, transparent);
  color: var(--accent, var(--c-green)); box-shadow: none;
}

/* Card cấp ngoài: nền trắng, bo 16, bóng nhẹ. Không lồng card trong card. */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-16);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
@media (min-width: 1200px) { .card { padding: 24px; } }

.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { font-size: 1rem; letter-spacing: -0.01em; }
.card-head p { font-size: 0.8rem; color: var(--text-3); }
.card-head__trailing { margin-left: auto; }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--stroke);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; color: var(--text-1); }
.brand img { width: 34px; height: 34px; border-radius: 0; }
.brand__tld { color: var(--brand-500); }
.brand__tag {
  font-size: 0.68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand-600);
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  display: block; padding: 8px 14px; border-radius: var(--r-pill);
  font-weight: 500; font-size: 0.95rem; color: var(--text-2);
  transition: background-color .2s, color .2s;
}
.nav__links a:hover { color: var(--text-1); background: var(--bg-subtle); }
.nav__links a.is-active { color: var(--brand-600); background: var(--brand-soft); font-weight: 600; }
[data-theme="dark"] .nav__links a.is-active { color: var(--brand-400); }
.nav__cta { margin-left: 8px; }

.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-pill);
  border: 1px solid var(--stroke); background: var(--bg-surface); color: var(--text-2);
  cursor: pointer; transition: color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--brand-600); border-color: var(--brand-400); }
.menu-btn { display: none; }

@media (max-width: 899px) {
  .menu-btn { display: grid; }
  .nav { gap: 8px; }
  .nav__panel {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--stroke);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .25);
    padding: 12px var(--gutter) 20px;
    display: none;
  }
  .nav__panel.is-open { display: block; animation: drop .2s ease; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__links a { padding: 14px 16px; border-radius: var(--r-12); font-size: 1rem; }
  .nav__cta { margin: 12px 0 0; width: 100%; }
}
@media (min-width: 900px) {
  .nav__panel { display: flex; align-items: center; gap: 4px; order: -1; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 5b. Footer ---------- */
.site-footer { background: var(--bg-inverse); color: rgba(255, 255, 255, .72); padding-top: 64px; }
.site-footer h3 { color: #fff; font-size: 0.95rem; margin-bottom: 16px; letter-spacing: 0; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 36px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 48px; } }
.footer-brand .brand { color: #fff; margin-bottom: 16px; }
.footer-brand p { max-width: 340px; font-size: 0.93rem; }
.footer-links li + li { margin-top: 10px; }
.footer-links a { font-size: 0.93rem; }
.socials { display: flex; gap: 10px; margin-top: 20px; }
.socials a {
  width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: rgba(255, 255, 255, .08); color: #fff; transition: background-color .2s;
}
.socials a:hover { background: var(--brand-600); }
.footer-contact li { display: flex; gap: 12px; font-size: 0.93rem; }
.footer-contact li + li { margin-top: 14px; }
.footer-contact i { color: var(--brand-400); margin-top: 4px; width: 16px; text-align: center; }
.footer-contact small { display: block; font-size: 0.78rem; color: rgba(255, 255, 255, .5); }
.footer-contact strong { color: #fff; font-weight: 600; }
.footer-bottom {
  margin-top: 48px; padding-block: 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  font-size: 0.85rem; color: rgba(255, 255, 255, .5);
}

/* ---------- 6. Home ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(139, 211, 74, .22), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(31, 168, 85, .25), transparent 60%),
    linear-gradient(160deg, var(--brand-900) 0%, var(--brand-800) 55%, #02472a 100%);
  color: #fff;
  padding-block: 56px 72px;
}
.hero::after { /* lưới chấm mờ tạo chiều sâu */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent 90%);
}
.hero__inner { position: relative; z-index: 1; display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding-block: 88px 104px; }
  .hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; }
}
@media (min-width: 1600px) { .hero__inner { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 96px; } }

.hero .eyebrow { background: rgba(255, 255, 255, .1); color: #d9f7c2; border: 1px solid rgba(255, 255, 255, .16); }
.hero h1 { color: #fff; font-size: var(--fs-display); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin: 20px 0; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #a6f07a, #4fd987); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { font-size: var(--fs-lead); color: rgba(255, 255, 255, .82); max-width: 580px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (max-width: 399px) { .hero__actions .btn { width: 100%; } }
.hero__ticks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 28px; font-size: 0.9rem; color: rgba(255, 255, 255, .78); }
.hero__ticks li { display: flex; align-items: center; gap: 8px; }
.hero__ticks i { color: var(--lime-400); }

/* Mockup giao diện lịch sân (dựng bằng HTML, không cần ảnh) */
.mock { position: relative; padding: 0 0 52px; }
/* Màn hẹp: thẻ "Lịch đặt mới" nằm dưới khung lịch, không che hàng Sân 4 */
@media (max-width: 599px) { .mock .mock__float--new { bottom: 0; } }
@media (min-width: 600px) { .mock { padding: 24px 24px 36px 0; } }
.mock__window {
  background: #fff; color: #0d1b14;
  border-radius: var(--r-16);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08);
  overflow: hidden;
}
.mock__bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #edf1ee; }
.mock__dots { display: flex; gap: 6px; }
.mock__dots span { width: 10px; height: 10px; border-radius: 50%; background: #e3e8e5; }
.mock__dots span:first-child { background: #ff6b6b; }
.mock__dots span:nth-child(2) { background: #ffc94d; }
.mock__dots span:nth-child(3) { background: #3fcf6c; }
.mock__title { font-weight: 700; font-size: 0.85rem; }
.mock__date { margin-left: auto; font-size: 0.72rem; font-weight: 600; color: var(--brand-600); background: #e8f6ed; padding: 4px 10px; border-radius: var(--r-pill); }
.mock__body { padding: 14px 16px 18px; }
.mock__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.7rem; color: #5b6b62; margin-bottom: 12px; }
.mock__legend span { display: inline-flex; align-items: center; gap: 6px; }
.mock__legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.sched { display: grid; grid-template-columns: 52px repeat(6, minmax(0, 1fr)); gap: 6px 4px; font-size: 0.7rem; }
.sched__h { color: #8a988f; font-weight: 600; text-align: left; padding-bottom: 2px; }
.sched__court { font-weight: 700; color: #33443a; align-self: center; white-space: nowrap; }
.sched__slot { height: 38px; border-radius: 8px; border: 1px dashed #dfe6e1; background: #fafcfb; }
.sched__bk {
  height: 38px; border-radius: 8px; padding: 5px 8px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; line-height: 1.25;
  color: #fff; font-weight: 600;
}
.sched__bk small { font-weight: 500; opacity: .85; font-size: 0.62rem; white-space: nowrap; }
.sched__bk b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 479px) {
  .sched { grid-template-columns: 40px repeat(6, minmax(0, 1fr)); font-size: 0.62rem; }
  .sched__bk { padding: 4px 6px; }
  .sched__bk small { display: none; }
}
.bk-day { background: linear-gradient(135deg, #22b45e, #108942); }
/* Lịch ngày: xanh lá · Lịch tháng: xanh dương · Xé vé: tím */
.bk-month { background: linear-gradient(135deg, #5b8cff, #2852d9); }
.bk-ticket { background: linear-gradient(135deg, #a77bff, #7c3aed); }
.bk-live { background: linear-gradient(135deg, #f0718b, #e11d48); }

.mock__float {
  position: absolute; z-index: 2;
  background: #fff; color: #0d1b14;
  border-radius: var(--r-12); padding: 12px 14px;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .45);
  display: flex; align-items: center; gap: 12px;
  font-size: 0.8rem;
}
.mock__float small { display: block; color: #6b7a72; font-size: 0.7rem; }
.mock__float strong { font-size: 0.98rem; }
.mock__float .up { color: #108942; font-weight: 700; font-size: 0.72rem; margin-left: 6px; }
.mock__float--rev { right: 0; bottom: 0; }
.mock__float--new { left: 12px; bottom: -6px; animation: bob 5s ease-in-out infinite; }
@media (min-width: 600px) { .mock__float--new { left: -20px; bottom: 0; } }
@media (max-width: 599px) { .mock__float--rev { display: none; } }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* Dải môn thể thao */
.sports { background: var(--bg-surface); border-bottom: 1px solid var(--stroke); }
.sports .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; padding-block: 22px; }
.sports__label { font-size: 0.85rem; color: var(--text-3); font-weight: 500; }
.sports__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sports__list li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--r-pill);
  border: 1px solid var(--stroke); background: var(--bg-subtle);
  font-weight: 600; font-size: 0.9rem; color: var(--text-1);
}
.sports__list i { color: var(--accent); }
.sports__more { border-style: dashed !important; color: var(--text-2) !important; background: transparent !important; }

/* Số liệu */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--col-gap); } }
.stat { text-align: center; padding: 24px 12px; }
.stat__num {
  font-size: clamp(1.6rem, 1rem + 2.6vw, 3rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .stat__num { background-image: linear-gradient(135deg, #a6f07a, var(--brand-400)); }
.stat__label { margin-top: 8px; color: var(--text-2); font-weight: 500; font-size: 0.93rem; }

/* Bento tính năng */
.features { display: grid; gap: 16px; grid-template-columns: repeat(var(--cols-feature), minmax(0, 1fr)); }
@media (min-width: 1200px) { .features { gap: var(--col-gap); } }
.feature { display: flex; flex-direction: column; gap: 14px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.feature h3 { font-size: var(--fs-h3); }
.feature p { color: var(--text-2); font-size: 0.93rem; }
a.feature { color: inherit; }
.feature__more { margin-top: auto; font-size: 0.85rem; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
a.feature:hover .feature__more i { transform: translateY(2px); }
.feature__more i { transition: transform .2s; }
.feature__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.feature--hero {
  background:
    radial-gradient(400px 220px at 100% 0%, rgba(139, 211, 74, .25), transparent 70%),
    linear-gradient(150deg, var(--brand-700), var(--brand-900));
  border: 0; color: #fff;
}
.feature--hero h3 { color: #fff; font-size: 1.35rem; }
.feature--hero p { color: rgba(255, 255, 255, .8); }
.feature--hero .icon-tile { background: rgba(255, 255, 255, .14); box-shadow: none; }
.feature--hero .chip { background: rgba(255, 255, 255, .14); color: #fff; }
@media (min-width: 600px) { .feature--hero { grid-column: span 2; } }
@media (min-width: 900px) { .feature--hero { grid-row: span 2; } }
@media (min-width: 1600px) { .feature--hero { grid-column: span 2; grid-row: span 2; } }
.feature__visual { margin-top: auto; display: grid; gap: 8px; }
.slotline { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--r-12); padding: 10px 12px; font-size: 0.85rem; }
.slotline b { font-weight: 600; }
.slotline span { margin-left: auto; font-size: 0.75rem; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(166, 240, 122, .2); color: #c9f7a8; font-weight: 600; white-space: nowrap; }
.slotline span.busy { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .7); }

/* 3 bước bắt đầu */
.steps { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); } }
.step { position: relative; padding-top: 28px; }
.step__num {
  position: absolute; top: -18px; left: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: 0 0 0 6px var(--bg-page);
}
.section--surface .step__num { box-shadow: 0 0 0 6px var(--bg-surface); }
.step h3 { font-size: var(--fs-h3); margin: 6px 0 8px; }
.step p { color: var(--text-2); font-size: 0.93rem; }
.step a { color: var(--brand-600); font-weight: 600; }
.steps-wrap { padding-top: 18px; }

/* Lợi ích */
.benefits { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); } }
.benefit { display: flex; gap: 16px; align-items: flex-start; }
.benefit h3 { font-size: var(--fs-h3); margin-bottom: 6px; }
.benefit p { color: var(--text-2); font-size: 0.93rem; }

/* Tải ứng dụng: 2 nhóm người dùng */
.platforms { display: grid; gap: var(--col-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.platform {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-24); padding: 28px; color: #fff;
  display: flex; flex-direction: column; gap: 14px;
}
@media (min-width: 1200px) { .platform { padding: 40px; } }
.platform--owner { background: linear-gradient(140deg, var(--brand-600), var(--brand-900)); }
.platform--player { background: linear-gradient(140deg, #3b6cf0, #1e3a8a); }
.platform::before, .platform::after { /* vòng tròn trắng mờ trang trí */
  content: ''; position: absolute; z-index: -1; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none;
}
.platform::before { width: 280px; height: 280px; right: -80px; top: -100px; }
.platform::after { width: 180px; height: 180px; right: 60px; bottom: -110px; background: rgba(255, 255, 255, .05); }
.platform__badge { align-self: flex-start; font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .16); }
.platform h3 { color: #fff; font-size: 1.5rem; }
.platform p { color: rgba(255, 255, 255, .82); max-width: 460px; }
.platform__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; min-height: 48px; border-radius: var(--r-12);
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .18); color: #fff;
  transition: background-color .2s;
}
.store-btn:hover { background: rgba(0, 0, 0, .45); }
.store-btn i { font-size: 1.4rem; }
.store-btn small { display: block; font-size: 0.65rem; opacity: .75; line-height: 1.1; }
.store-btn b { display: block; font-size: 0.95rem; line-height: 1.2; }
.platform .btn--light { color: var(--brand-800); }
.platform--player .btn--light { color: #1e3a8a; }
@media (max-width: 399px) { .platform__actions > * { flex: 1 1 100%; justify-content: center; } }

/* CTA cuối trang */
.cta-band {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-24);
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(139, 211, 74, .28), transparent 65%),
    linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: #fff; padding: 36px 24px;
  display: grid; gap: 24px; align-items: center;
}
@media (min-width: 900px) { .cta-band { grid-template-columns: minmax(0, 1fr) auto; padding: 56px; } }
.cta-band h2 { color: #fff; font-size: var(--fs-h2); margin-bottom: 8px; }
.cta-band p { color: rgba(255, 255, 255, .82); font-size: var(--fs-lead); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-band__phone { display: inline-flex; align-items: center; gap: 12px; }
.cta-band__phone small { display: block; font-size: 0.75rem; opacity: .75; }
.cta-band__phone b { font-size: 1.15rem; }

/* Đánh giá app người chơi */
.ratings { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.rating {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 12px; border-radius: var(--r-16);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
}
.rating > i { font-size: 1.5rem; width: 28px; text-align: center; }
.rating b { display: block; font-size: 1.05rem; line-height: 1.2; }
.rating small { display: block; font-size: 0.72rem; color: rgba(255, 255, 255, .7); }
.stars { color: #fbbf24; font-size: 0.68rem; letter-spacing: 1px; display: block; }
.ratings__note { flex-basis: 100%; font-size: 0.78rem; color: rgba(255, 255, 255, .6); }
@media (max-width: 399px) { .rating { flex: 1 1 100%; } }

.stat__stars { color: #f59e0b; font-size: 0.8rem; letter-spacing: 2px; margin-top: 8px; }
.stat__label small { display: block; color: var(--text-3); font-size: 0.8rem; font-weight: 400; }

/* Social – Xé vé: khối nổi bật nền tối */
.social {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(800px 420px at 100% 0%, rgba(59, 108, 240, .28), transparent 60%),
    radial-gradient(700px 420px at 0% 100%, rgba(139, 211, 74, .18), transparent 60%),
    linear-gradient(160deg, #04261a, #063a26 60%, #052e1f);
  color: #fff;
}
.social .section-head h2, .social h3 { color: #fff; }
.social .section-head p { color: rgba(255, 255, 255, .78); }
.social .eyebrow { background: rgba(255, 255, 255, .1); color: #d9f7c2; border: 1px solid rgba(255, 255, 255, .16); }
.social__grid {
  display: grid; gap: 24px; align-items: start;
  grid-template-columns: minmax(0, 1fr);
  /* Màn hẹp: tab → ảnh → điểm nổi bật, để ảnh nằm ngay dưới tab đang chọn */
  grid-template-areas: "tabs" "media" "extra";
}
.social__tabs { grid-area: tabs; }
.social__media { grid-area: media; }
.social__extra { grid-area: extra; }
.social__extra .social__points { margin-top: 0; }
@media (min-width: 900px) {
  .social__grid { grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-areas: "tabs media" "extra media"; gap: 24px var(--col-gap); }
}
@media (min-width: 1600px) { .social__grid { grid-template-columns: 520px minmax(0, 1fr); } }

.tabs { display: flex; flex-direction: column; gap: 10px; }
.tab {
  display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%;
  padding: 16px; border-radius: var(--r-16); cursor: pointer;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); color: #fff;
  transition: background-color .2s, border-color .2s;
}
.tab:hover { background: rgba(255, 255, 255, .08); }
.tab[aria-selected="true"] { background: rgba(255, 255, 255, .12); border-color: rgba(166, 240, 122, .55); box-shadow: inset 3px 0 0 #a6f07a; }
.tab b { display: block; font-size: 1rem; margin-bottom: 2px; }
.tab span.tab__desc { display: block; font-size: 0.86rem; color: rgba(255, 255, 255, .72); }
.tab .icon-tile { background: rgba(255, 255, 255, .12); box-shadow: none; }
.tab[aria-selected="true"] .icon-tile { background: linear-gradient(135deg, #8bd34a, #1fa855); }
@media (max-width: 899px) {
  .tabs { flex-direction: row; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; width: auto; padding: 10px 14px; align-items: center; border-radius: var(--r-pill); }
  .tab .icon-tile { width: 28px; height: 28px; font-size: .75rem; border-radius: 50%; }
  .tab b { margin: 0; font-size: .9rem; white-space: nowrap; }
  .tab span.tab__desc { display: none; }
  .tab[aria-selected="true"] { box-shadow: none; }
}
.social__frame {
  background: #fff; border-radius: var(--r-24); padding: 8px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6);
}
.social__frame img { width: 100%; height: auto; border-radius: calc(var(--r-24) - 8px); cursor: zoom-in; }
.social__caption { margin-top: 12px; font-size: 0.8rem; color: rgba(255, 255, 255, .6); display: flex; align-items: center; gap: 8px; }
.social__points { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px; }
/* 4 ô một hàng chỉ khi khối chữ trải hết bề ngang (tablet); desktop nằm trong cột trái nên giữ 2 cột */
@media (min-width: 600px) and (max-width: 899px) { .social__points { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.social__point { padding: 14px; border-radius: var(--r-12); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.social__point i { color: #a6f07a; margin-bottom: 8px; display: block; }
.social__point b { display: block; font-size: 0.92rem; }
.social__point span { font-size: 0.8rem; color: rgba(255, 255, 255, .68); }
.social__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Hàng giới thiệu tính năng: chữ một bên, mockup một bên, đổi bên xen kẽ */
.showcase { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: center; }
.showcase + .showcase { margin-top: calc(var(--section-y) * 0.85); }
@media (min-width: 900px) {
  .showcase { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; }
  .showcase--flip .showcase__visual { order: -1; }
}
@media (min-width: 1600px) { .showcase { gap: 96px; } }
.showcase__text h3 { font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); margin: 14px 0 12px; }
.showcase__text > p { color: var(--text-2); font-size: var(--fs-lead); }
.showcase .chip { font-size: 0.78rem; padding: 6px 12px; }
.ticks { margin-top: 20px; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; }
.ticks li > i {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.65rem; margin-top: 2px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.ticks b { font-weight: 600; }
.ticks small { color: var(--text-3); }
.showcase__link { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font-weight: 600; color: var(--accent); }
.showcase__link:hover { gap: 12px; }

.stage {
  position: relative; border-radius: var(--r-24); padding: 28px 20px;
  background:
    radial-gradient(420px 260px at 85% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    linear-gradient(150deg, color-mix(in srgb, var(--accent) 10%, var(--bg-surface)), var(--bg-subtle));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}
@media (min-width: 600px) { .stage { padding: 40px; } }
.stage__tag {
  position: absolute; z-index: 2; right: 16px; bottom: -16px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-pill);
  background: #fff; color: #0d1b14; font-size: 0.8rem; font-weight: 600;
  box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .35);
}
.stage__tag i { color: var(--accent); }

/* Mockup UI (luôn sáng, mô phỏng giao diện app) */
.ui {
  background: #fff; color: #0d1b14; border-radius: var(--r-16); overflow: hidden;
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .4), 0 0 0 1px rgba(0, 0, 0, .04);
  font-size: 0.82rem; max-width: 560px; margin-inline: auto;
}
.ui__bar { background: linear-gradient(90deg, #13a538, #016d38); color: #fff; text-align: center; padding: 12px 16px; font-weight: 700; font-size: 0.92rem; }
.ui__bar small { display: block; font-weight: 500; font-size: 0.7rem; opacity: .85; }
.ui__body { padding: 14px; display: grid; gap: 10px; }
.ui__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ui__stat { border: 1px solid #e6ece8; border-radius: 12px; padding: 10px; }
.ui__stat b { display: block; font-size: 1.2rem; line-height: 1.1; }
.ui__stat span { font-size: 0.68rem; color: #6b7a72; }
.ui__row { display: flex; align-items: center; gap: 10px; border: 1px solid #edf1ee; border-radius: 12px; padding: 10px 12px; }
.ui__avatar { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.72rem; color: #fff; }
.ui__main { flex: 1; min-width: 0; }
.ui__main b { display: block; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui__main span { display: block; font-size: 0.7rem; color: #6b7a72; }
.ui__pill { flex-shrink: 0; font-size: 0.66rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pill-green { background: #e5f6ea; color: #108942; }
.pill-amber { background: #fff3dc; color: #b45309; }
.pill-red { background: #fde8ec; color: #be123c; }
.pill-blue { background: #e6eeff; color: #2850c8; }
.ui__progress { height: 6px; border-radius: 999px; background: #edf1ee; margin-top: 6px; overflow: hidden; }
.ui__progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4cc46e, #108942); }
@media (max-width: 479px) { .ui .hide-sm { display: none; } }
.ui__btn { flex-shrink: 0; font-size: 0.7rem; font-weight: 700; color: #fff; background: #016d38; padding: 6px 10px; border-radius: 8px; }
.ui__seg { display: grid; grid-template-columns: 1fr 1fr; background: #eef2ef; border-radius: 10px; padding: 3px; font-weight: 600; font-size: 0.78rem; text-align: center; }
.ui__seg span { padding: 7px; border-radius: 8px; color: #6b7a72; }
.ui__seg span.on { background: #fff; color: #016d38; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.ui__line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.ui__line + .ui__line { border-top: 1px dashed #e6ece8; }
.ui__line span:first-child { color: #42524a; }
.ui__line.total { border-top: 1px solid #dfe6e1; font-weight: 800; font-size: 0.95rem; }
.ui__line.total span:last-child { color: #108942; }
.ui__tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ui__tile { background: #f4f8f5; border-radius: 10px; padding: 8px 10px; }
.ui__tile span { display: block; font-size: 0.66rem; color: #6b7a72; }
.ui__tile b { font-size: 0.85rem; }
.ui__check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #108942; font-size: 0.78rem; }
.ui__check i { width: 16px; height: 16px; border-radius: 4px; background: #108942; color: #fff; display: grid; place-items: center; font-size: 0.55rem; }
.ui__kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.76rem; }
.ui__kv span { color: #6b7a72; }
.ui__kv b { font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ui__chip { font-size: 0.68rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; border: 1px solid #dfe6e1; color: #42524a; }
.ui__cta { text-align: center; font-weight: 700; color: #fff; background: linear-gradient(90deg, #13a538, #016d38); border-radius: 10px; padding: 10px; }

/* Khung điện thoại cho Bảng tin */
.phone {
  width: min(100%, 320px); margin-inline: auto;
  border-radius: 38px; padding: 10px; background: #0b1410;
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .55), inset 0 0 0 2px #26332c;
}
.phone__screen { background: #f2f5f3; border-radius: 30px; overflow: hidden; height: 540px; position: relative; color: #0d1b14; font-size: 0.8rem; }
.phone__screen::after { content: ''; position: absolute; inset: auto 0 0 0; height: 70px; background: linear-gradient(transparent, #f2f5f3); }
.phone__notch { width: 90px; height: 22px; border-radius: 0 0 14px 14px; background: #0b1410; margin: 0 auto; }
.phone__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 10px; font-weight: 800; font-size: 1rem; }
.phone__head i { color: #6b7a72; font-size: 0.9rem; }
.feed { display: grid; gap: 10px; padding: 0 10px; }
.post { background: #fff; border-radius: 16px; padding: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.post__top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.post__top img { width: 30px; height: 30px; border-radius: 50%; background: #e8f6ed; padding: 4px; }
.post__top b { display: block; font-size: 0.78rem; }
.post__top span { font-size: 0.66rem; color: #6b7a72; }
.post p { font-weight: 700; margin-bottom: 8px; }
.post__banner { border-radius: 12px; padding: 14px; color: #fff; font-weight: 800; letter-spacing: .02em; margin-bottom: 8px; background: linear-gradient(135deg, #7c5cff, #3b5bdb); }
.post__banner small { display: block; font-weight: 500; opacity: .85; letter-spacing: 0; font-size: .7rem; }
.post__slots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.post__slots span { font-size: 0.68rem; font-weight: 600; padding: 4px 8px; border-radius: 8px; background: #e5f6ea; color: #108942; }
.post__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.7rem; color: #6b7a72; }
.post__foot .ui__btn { font-size: 0.68rem; }

/* Một ngày ở sân: công tắc Thủ công ⇄ Với ALOBO lật 6 thẻ */
.day { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .day { grid-template-columns: var(--side-w) minmax(0, 1fr); gap: var(--col-gap); } }
.day__side h2 { font-size: var(--fs-h2); margin: 14px 0 12px; }
.day__side > p { color: var(--text-2); font-size: var(--fs-lead); }
@media (min-width: 900px) { .day__side { position: sticky; top: calc(var(--header-h) + 24px); } }

.toggle {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-top: 24px;
  padding: 5px; border-radius: var(--r-pill); background: var(--bg-surface); border: 1px solid var(--stroke);
  box-shadow: var(--shadow-card);
}
/* Màn hẹp: công tắc dính dưới header để vừa cuộn thẻ vừa bấm được */
@media (max-width: 899px) {
  /* Bỏ lớp bọc để công tắc dính theo cả section, vừa cuộn thẻ vừa bấm được */
  .day { gap: 0; }
  .day__side { display: contents; }
  .day__side > .eyebrow { justify-self: start; }
  .toggle { position: sticky; top: calc(var(--header-h) + 10px); z-index: 5; }
  .day__grid { margin-top: 20px; }
}
.toggle__opt {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; border-radius: var(--r-pill); font-weight: 700; font-size: 0.95rem; cursor: pointer;
  color: var(--text-2); transition: color .35s;
}
.toggle__thumb {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: var(--r-pill);
  background: linear-gradient(135deg, #f0718b, #e11d48); box-shadow: 0 8px 18px -8px rgba(225, 29, 72, .6);
  transition: transform .5s cubic-bezier(.65, 0, .35, 1), background .5s;
}
#mode-manual:checked ~ .day__side .toggle__opt--manual,
#mode-alobo:checked ~ .day__side .toggle__opt--alobo { color: #fff; }
#mode-alobo:checked ~ .day__side .toggle__thumb {
  transform: translateX(100%);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); box-shadow: 0 8px 18px -8px rgba(16, 137, 66, .7);
}
#mode-manual:focus-visible ~ .day__side .toggle__opt--manual,
#mode-alobo:focus-visible ~ .day__side .toggle__opt--alobo { outline: 3px solid color-mix(in srgb, var(--brand-500) 55%, transparent); outline-offset: 2px; }

.mood { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding: 16px; border-radius: var(--r-16); background: var(--bg-surface); border: 1px solid var(--stroke); }
.mood__face { position: relative; width: 52px; height: 52px; flex-shrink: 0; font-size: 2.4rem; line-height: 52px; text-align: center; }
.mood__face span { position: absolute; inset: 0; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), opacity .3s; }
.mood__text { flex: 1; min-width: 0; display: grid; }
.mood__text b { grid-area: 1 / 1; font-size: 1rem; transition: opacity .3s; }
.mood__text > span { font-size: 0.78rem; color: var(--text-3); margin-top: 6px; }
.mood__bar { height: 8px; border-radius: 999px; background: var(--bg-subtle); margin-top: 6px; overflow: hidden; }
.mood__bar span { display: block; height: 100%; width: 92%; border-radius: inherit; background: linear-gradient(90deg, #f59e0b, #e11d48); transition: width .8s cubic-bezier(.65, 0, .35, 1), background .8s; }
.mood__b { opacity: 0; }
.mood__face .mood__b { transform: scale(.3) rotate(-90deg); }
#mode-alobo:checked ~ .day__side .mood__a { opacity: 0; }
#mode-alobo:checked ~ .day__side .mood__face .mood__a { transform: scale(.3) rotate(90deg); }
#mode-alobo:checked ~ .day__side .mood__b { opacity: 1; }
#mode-alobo:checked ~ .day__side .mood__face .mood__b { transform: none; }
#mode-alobo:checked ~ .day__side .mood__bar span { width: 14%; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); }
/* Mặt khó chịu rung nhẹ khi đang ở chế độ thủ công */
#mode-manual:checked ~ .day__side .mood__face .mood__a { animation: shake 2.4s ease-in-out infinite; }
@keyframes shake { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-12deg); } 85% { transform: rotate(10deg); } 95% { transform: rotate(-4deg); } }

.day__grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .day__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .day__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); } }

.flip { perspective: 1200px; }
.flip__inner { display: grid; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.65, 0, .35, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.flip__face {
  grid-area: 1 / 1; display: flex; flex-direction: column; gap: 8px;
  padding: 18px 20px 20px; border-radius: var(--r-16);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flip__face--front { background: color-mix(in srgb, var(--c-rose) 5%, var(--bg-surface)); border: 1px dashed color-mix(in srgb, var(--c-rose) 35%, transparent); }
/* Mặt sau: mỗi thẻ một màu (đặt mã màu cố định để chữ trắng đủ tương phản cả ở chế độ tối) */
.flip--blue { --flip: #2563eb; }
.flip--teal { --flip: #0d9488; }
.flip--violet { --flip: #7c3aed; }
.flip--orange { --flip: #ea580c; }
.flip--indigo { --flip: #4f46e5; }
.flip--green { --flip: #108942; }
.flip__face--back {
  position: relative; overflow: hidden;
  transform: rotateY(180deg); color: #fff;
  background:
    radial-gradient(240px 150px at 100% 0%, rgba(255, 255, 255, .22), transparent 70%),
    linear-gradient(150deg, color-mix(in srgb, var(--flip, #108942) 86%, #fff), color-mix(in srgb, var(--flip, #108942) 72%, #000));
  box-shadow: 0 18px 36px -18px color-mix(in srgb, var(--flip, #108942) 75%, transparent);
}
.flip__face--back > :not(.flip__mark) { position: relative; }
.flip__mark { position: absolute; right: -14px; bottom: -22px; font-size: 6.5rem; color: #fff; opacity: .13; transform: rotate(-14deg); pointer-events: none; }
.flip__face h3 { font-size: 1.05rem; }
.flip__face p { font-size: 0.9rem; color: var(--text-2); }
.flip__face--back h3 { color: #fff; }
.flip__face--back p { color: rgba(255, 255, 255, .82); }
.flip__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.flip__time { font-size: 0.78rem; font-weight: 700; color: var(--text-3); letter-spacing: .02em; }
.flip__face--back .flip__time { color: rgba(255, 255, 255, .7); }
.flip__face--back .icon-tile { background: rgba(255, 255, 255, .16); box-shadow: none; }
.flip__tag { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--c-rose) 12%, transparent); color: var(--c-rose); }
.flip__face--back .flip__tag { background: rgba(255, 255, 255, .2); color: #fff; }
#mode-alobo:checked ~ .day__grid .flip__inner { transform: rotateY(180deg); }

/* Nút chat nổi */
.chat { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 1500; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
@media (max-width: 599px) { .chat { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } }
.chat__fab {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 22px 0 8px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: linear-gradient(135deg, #22b45e, #016d38); color: #fff; font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 14px 30px -10px rgba(1, 86, 45, .7);
  transition: transform .2s, box-shadow .2s;
}
.chat__fab:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -10px rgba(1, 86, 45, .8); }
.chat__fab::before { /* vòng sóng lan toả gợi ý bấm */
  content: ''; position: absolute; inset: 0; border-radius: inherit; border: 2px solid #22b45e;
  animation: ring 2.4s ease-out infinite; pointer-events: none;
}
@keyframes ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.25, 1.5); opacity: 0; } }
.chat__icons { position: relative; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .16); flex-shrink: 0; }
.chat__icons > * { position: absolute; inset: 0; margin: auto; font-size: 1.25rem; opacity: 0; animation: cycle 7.5s infinite; }
.chat__icons > i { width: 100%; height: 100%; line-height: 42px; text-align: center; }
.chat__icons img { width: 26px; height: 26px; }
.chat__icons > :nth-child(2) { animation-delay: 2.5s; }
.chat__icons > :nth-child(3) { animation-delay: 5s; }
/* 3 biểu tượng Messenger → Zalo → Điện thoại thay phiên nhau */
@keyframes cycle { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 4%, 30% { opacity: 1; transform: none; } 34%, 100% { opacity: 0; transform: translateY(-8px) scale(.8); } }
.chat__icons .chat__x { animation: none; transform: rotate(-90deg); transition: opacity .2s, transform .3s; }
.chat.is-open .chat__icons > :not(.chat__x) { animation: none; opacity: 0; }
.chat.is-open .chat__icons .chat__x { opacity: 1; transform: none; }
.chat.is-open .chat__fab::before { animation: none; opacity: 0; }
@media (max-width: 599px) { .chat__fab { width: 58px; padding: 0; justify-content: center; } .chat__label { display: none; } }

.chat__panel {
  width: min(360px, calc(100vw - 28px));
  background: var(--bg-surface); color: var(--text-1);
  border: 1px solid var(--stroke); border-radius: var(--r-24);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35);
  overflow: hidden; transform-origin: bottom right;
  animation: pop .28s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.9); } }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; color: #fff; background: radial-gradient(260px 120px at 100% 0%, rgba(139, 211, 74, .35), transparent 70%), linear-gradient(135deg, var(--brand-600), var(--brand-800)); }
.chat__head img { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 6px; }
.chat__head b { display: block; font-size: 1rem; }
.chat__head span { font-size: 0.78rem; opacity: .85; display: inline-flex; align-items: center; gap: 6px; }
.chat__dot { width: 8px; height: 8px; border-radius: 50%; background: #8bf38f; box-shadow: 0 0 0 3px rgba(139, 243, 143, .25); }
.chat__close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; }
.chat__close:hover { background: rgba(255, 255, 255, .28); }
.chat__hello { margin: 14px 16px 4px; padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: var(--bg-subtle); font-size: 0.9rem; }
.chat__list { display: grid; gap: 8px; padding: 10px 12px 14px; }
.chat__item {
  width: 100%; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-12);
  border: 1px solid var(--stroke); transition: border-color .2s, transform .2s, background-color .2s;
}
.chat__item:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 6%, transparent); transform: translateX(3px); }
.chat__ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff; font-size: 1.1rem; background: var(--c); }
.chat__ico--zalo { background: color-mix(in srgb, var(--c) 10%, transparent); }
.chat__txt { flex: 1; min-width: 0; }
.chat__txt b { display: block; font-size: 0.92rem; }
.chat__txt small { display: block; font-size: 0.78rem; color: var(--text-3); }
.chat__go { color: var(--text-3); font-size: 0.75rem; }
.chat__panel[hidden] { display: none; }

/* Badge số tin ALOBO trả lời mà khách chưa đọc */
.chat__badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--r-pill); background: #e11d48; color: #fff; border: 2px solid #fff;
  font-size: 0.72rem; font-weight: 800; line-height: 18px; text-align: center;
  animation: popin .4s cubic-bezier(.34, 1.56, .64, 1);
}
.chat__badge--inline { position: static; border: 0; margin-left: auto; }
.chat__badge--inline + .chat__go { margin-left: 4px; }
.chat__item--live { border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 6%, transparent); }
.chat__back { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; flex-shrink: 0; }
.chat__back:hover { background: rgba(255, 255, 255, .28); }
.chat__dot.is-wait { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, .25); }

/* Chat trực tiếp: khung cao hơn, phần tin nhắn cuộn riêng */
.chat.is-live .chat__panel:not([hidden]) { display: flex; flex-direction: column; width: min(400px, calc(100vw - 28px)); height: min(640px, calc(100dvh - 110px)); }
.live { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.live__state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--text-2); font-size: 0.9rem; }
.live__state--error > i { font-size: 2rem; color: var(--c-rose); }
.live__state small a { color: var(--brand-600); font-weight: 600; }
.live__spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand-500); animation: spin .8s linear infinite; }
.live__start { flex: 1; overflow-y: auto; padding: 14px 16px 16px; }
.live__intro { font-size: 0.88rem; color: var(--text-2); margin-bottom: 14px; }
.live__start .field input { height: 44px; }
.needs--stack { grid-template-columns: minmax(0, 1fr) !important; }
.lead__error.is-info { background: color-mix(in srgb, var(--c-blue) 10%, transparent); color: var(--c-blue); }

.live__conv { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.live__notice { margin: 10px 12px 0; padding: 8px 12px; border-radius: var(--r-12); font-size: 0.82rem; background: color-mix(in srgb, var(--c-blue) 10%, transparent); color: var(--c-blue); }
.live__msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; background: var(--bg-subtle); overscroll-behavior: contain; }
.live__older { display: block; margin: 0 auto 10px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--stroke-strong); background: var(--bg-surface); font-size: 0.78rem; cursor: pointer; }
.live__list { display: flex; flex-direction: column; gap: 2px; list-style: none; padding: 0; }
.live__day { align-self: center; margin: 10px 0 6px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--bg-surface); border: 1px solid var(--stroke); font-size: 0.7rem; color: var(--text-3); }
.live__sys { align-self: center; max-width: 90%; margin: 6px 0; text-align: center; font-size: 0.76rem; color: var(--text-3); }
/* Một cụm tin = các tin liên tiếp của cùng người trong 5 phút: sát nhau, cách cụm khác 10px */
.live__msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.live__msg.is-first { margin-top: 8px; }
.live__msg.is-mine { align-self: flex-end; }
.live__msg.is-theirs { align-self: flex-start; }
.live__msg.is-new { animation: pop .25s ease-out; }
.live__col { display: flex; flex-direction: column; min-width: 0; }
.is-mine .live__col { align-items: flex-end; }
.is-theirs .live__col { align-items: flex-start; }
/* Ô avatar giữ chỗ ở mọi tin để bong bóng thẳng hàng; ảnh chỉ có ở tin cuối cụm (nằm sát đáy) */
.live__avatar { flex-shrink: 0; width: 28px; height: 28px; margin-bottom: 18px; }
.live__avatar img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); border: 1px solid var(--stroke); }
.live__msg:not(.is-last) .live__avatar { margin-bottom: 0; }
.live__who { font-size: 0.7rem; font-weight: 600; color: var(--text-3); margin: 0 0 2px 4px; }
.live__bubble { padding: 8px 12px; border-radius: 16px; font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.is-mine .live__bubble { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; }
.is-theirs .live__bubble { background: var(--bg-surface); border: 1px solid var(--stroke); }
/* Góc phía người gửi bo nhỏ ở các tin giữa cụm, như các app chat quen thuộc */
.is-mine:not(.is-first) .live__bubble { border-top-right-radius: 5px; }
.is-mine:not(.is-last) .live__bubble { border-bottom-right-radius: 5px; }
.is-mine.is-last .live__bubble { border-bottom-right-radius: 4px; }
.is-theirs:not(.is-first) .live__bubble { border-top-left-radius: 5px; }
.is-theirs:not(.is-last) .live__bubble { border-bottom-left-radius: 5px; }
.is-theirs.is-last .live__bubble { border-bottom-left-radius: 4px; }
.live__meta { font-size: 0.66rem; color: var(--text-3); margin: 3px 4px 0; }
.live__msg.is-sending .live__bubble { opacity: .65; }
.live__msg.is-failed { cursor: pointer; }
.live__msg.is-failed .live__bubble { background: color-mix(in srgb, var(--c-rose) 85%, #000); }
.live__msg.is-failed .live__meta { color: var(--c-rose); font-weight: 600; }

.live__composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--stroke); background: var(--bg-surface); }
.live__composer textarea {
  flex: 1; resize: none; max-height: 120px; min-height: 42px; padding: 10px 14px;
  border-radius: 21px; border: 1px solid var(--stroke-strong); background: var(--bg-subtle);
  font: inherit; font-size: 0.92rem; line-height: 1.4;
}
.live__composer textarea:focus { outline: none; border-color: var(--brand-500); background: var(--bg-surface); }
.live__composer button { width: 42px; height: 42px; border-radius: 50%; border: 0; flex-shrink: 0; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); transition: transform .15s; }
.live__composer button:hover { transform: scale(1.06); }
/*
 * Màn hẹp: chat trực tiếp chiếm trọn màn hình, cao / vị trí bám theo visualViewport
 * (--vv-height / --vv-top do guest-chat.js đặt) = đúng phần nhìn thấy phía trên bàn
 * phím. Dùng 100dvh thì Android co giãn theo bàn phím, iOS cuộn cả trang để lộ ô
 * nhập -> khung bị đẩy lên, nhảy lung tung.
 */
@media (max-width: 599px) {
  .chat.is-live .chat__panel:not([hidden]) {
    /* Dịch bằng transform (không tính lại bố cục) thay vì top; không transition để bám tay */
    position: fixed; left: 0; right: 0; top: 0;
    transform: translate3d(0, var(--vv-top, 0px), 0); will-change: transform, height;
    width: 100%; height: var(--vv-height, 100%);
    border: 0; border-radius: 0; z-index: 1600;
    animation: none; transition: none;
  }
  .chat.is-live .chat__head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  /* Nền phủ kín màn hình, thuộc widget chat, nằm dưới khung. Khung co lên khi bàn phím mở
     thì cú click của chính lần chạm ô nhập rơi vào đây (không đóng chat, không bấm nhầm
     nút / link của trang phía sau), và không lộ nội dung trang dưới khung */
  .chat.is-live.is-open::before { content: ''; position: fixed; inset: 0; z-index: 1590; background: var(--bg-surface); }
  /* Bàn phím đang mở thì không cần chừa vùng home indicator */
  .chat.is-live:not(.is-keyboard) .live__composer { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  /* Nút tròn nằm đè lên ô soạn tin; đóng khung bằng nút × trên header */
  .chat.is-live.is-open .chat__fab { display: none; }
  /* iOS tự phóng to trang khi chạm ô nhập có chữ < 16px */
  .live__composer textarea, .live__start .field input { font-size: 16px; }
}
/* Khoá cuộn trang nền khi khung chat phủ kín màn hình (iOS bỏ qua overflow trên body
   nên ghim body bằng position: fixed, guest-chat.js giữ lại vị trí cuộn) */
html.chat-locked, html.chat-locked body { overflow: hidden; overscroll-behavior: none; }
html.chat-locked body { position: fixed; left: 0; right: 0; width: 100%; }

/* Hộp thoại Đăng ký dùng thử / tư vấn */
.lead {
  margin: auto; padding: 0; border: 0; background: transparent; color: var(--text-1);
  width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: visible;
}
.lead::backdrop { background: rgba(3, 18, 10, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.lead[open] { animation: pop .3s cubic-bezier(.34, 1.3, .64, 1); }
.lead__wrap {
  display: grid; grid-template-columns: minmax(0, 1fr); max-height: calc(100dvh - 24px); overflow: auto;
  background: var(--bg-surface); border-radius: var(--r-24); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .45);
}
@media (min-width: 900px) { .lead__wrap { grid-template-columns: 320px minmax(0, 1fr); } }
.lead__aside {
  display: none; position: relative; overflow: hidden; padding: 32px 28px; color: #fff;
  background: radial-gradient(360px 220px at 100% 0%, rgba(139, 211, 74, .3), transparent 70%), linear-gradient(160deg, var(--brand-700), var(--brand-900));
}
@media (min-width: 900px) { .lead__aside { display: flex; flex-direction: column; gap: 18px; } }
.lead__aside::after { content: ''; position: absolute; width: 240px; height: 240px; border-radius: 50%; right: -90px; bottom: -90px; background: rgba(255, 255, 255, .06); }
.lead__aside .eyebrow { align-self: flex-start; background: rgba(255, 255, 255, .12); color: #d9f7c2; }
.lead__aside h3 { color: #fff; font-size: 1.45rem; line-height: 1.3; }
.lead__aside ul { display: grid; gap: 12px; font-size: 0.92rem; color: rgba(255, 255, 255, .88); }
.lead__aside li { display: flex; gap: 10px; }
.lead__aside li i { color: var(--lime-400); margin-top: 4px; }
.lead__rating { margin-top: auto; font-size: 0.82rem; color: rgba(255, 255, 255, .75); }
.lead__main { position: relative; padding: 28px 22px 22px; }
@media (min-width: 600px) { .lead__main { padding: 32px; } }
.lead__close { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg-subtle); color: var(--text-2); cursor: pointer; }
.lead__close:hover { color: var(--text-1); }
.lead__form h2 { font-size: 1.4rem; padding-right: 40px; }
.lead__sub { color: var(--text-2); margin: 6px 0 18px; font-size: 0.93rem; }
.field { border: 0; margin-bottom: 14px; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; padding: 0; }
.field > label > span, .field > legend > span { color: var(--c-rose); }
.field input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-12);
  border: 1px solid var(--stroke-strong); background: var(--bg-surface); font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 18%, transparent); }
.field__err { display: none; margin-top: 6px; font-size: 0.8rem; color: var(--c-rose); }
.field.is-invalid input { border-color: var(--c-rose); }
.field.is-invalid .field__err { display: block; }
.needs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 480px) { .needs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.need { position: relative; cursor: pointer; }
.need input { position: absolute; opacity: 0; pointer-events: none; }
.need span {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 12px;
  border-radius: var(--r-12); border: 1px solid var(--stroke-strong); font-size: 0.88rem; font-weight: 500;
  transition: border-color .2s, background-color .2s, color .2s;
}
.need span i { width: 18px; text-align: center; color: var(--text-3); transition: color .2s; }
.need:hover span { border-color: var(--brand-400); }
.need input:checked + span { border-color: var(--brand-500); background: var(--brand-soft); color: var(--brand-700); font-weight: 600; }
[data-theme="dark"] .need input:checked + span { color: var(--brand-400); }
.need input:checked + span i { color: var(--brand-500); }
.need input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand-500) 55%, transparent); outline-offset: 2px; }
.lead__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead__error { margin-bottom: 12px; padding: 10px 12px; border-radius: var(--r-12); font-size: 0.88rem; background: color-mix(in srgb, var(--c-rose) 10%, transparent); color: var(--c-rose); }
.lead__error a { font-weight: 700; text-decoration: underline; }
.lead__submit { position: relative; margin-top: 6px; }
.lead__spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .8s linear infinite; }
.lead__submit.is-loading .lead__submit-text { display: none; }
.lead__submit.is-loading .lead__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.lead__note { margin-top: 10px; font-size: 0.78rem; color: var(--text-3); text-align: center; }
.lead__done { text-align: center; padding: 32px 8px 12px; }
.lead__check {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  font-size: 2rem; color: #fff; background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  box-shadow: 0 0 0 10px var(--brand-soft); animation: popin .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.lead__done h2 { font-size: 1.5rem; margin-bottom: 8px; }
.lead__done p { color: var(--text-2); max-width: 420px; margin: 0 auto 22px; }
.lead__done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- 7. Shared blocks: thẻ bài viết ---------- */
.article-grid { display: grid; gap: 16px; grid-template-columns: repeat(var(--cols-cards), minmax(0, 1fr)); }
@media (min-width: 1200px) { .article-grid { gap: var(--col-gap); } }
.article-grid--home { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .article-grid--home { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .article-grid--home { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .article-grid--home { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Lấy 4 bài: chỉ hiện bài thứ 4 khi lưới có số cột chẵn (tablet 2 cột, màn lớn 4 cột) */
@media (max-width: 599px), (min-width: 900px) and (max-width: 1599px) { .article-grid--home > :nth-child(4) { display: none; } }

.post-card {
  display: flex; flex-direction: column;
  background: var(--bg-surface); border: 1px solid var(--stroke); border-radius: var(--r-16);
  overflow: hidden; box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--brand-500) 35%, transparent); }
.post-card__thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-subtle); overflow: hidden; }
.post-card__thumb::before { /* nền dự phòng khi ảnh lỗi / chưa tải */
  content: '\f02d'; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2rem; color: color-mix(in srgb, var(--brand-500) 45%, transparent);
  background: linear-gradient(135deg, var(--brand-soft), var(--bg-subtle));
}
.post-card__thumb img { position: relative; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.04); }
.post-card__cat {
  position: absolute; left: 12px; top: 12px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .92); color: var(--brand-700);
  font-size: 0.72rem; font-weight: 700;
  max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.post-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__title { font-size: 1.02rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__excerpt { color: var(--text-2); font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__meta { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 0.8rem; }
.post-card__meta .go { color: var(--brand-600); font-weight: 600; }

.empty {
  grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--text-2);
  background: var(--bg-surface); border: 1px dashed var(--stroke-strong); border-radius: var(--r-16);
}
.empty__icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--bg-subtle); color: var(--text-3); font-size: 1.3rem; }
.empty strong { display: block; color: var(--text-1); margin-bottom: 4px; }

/* Đầu trang con (Hướng dẫn, Liên hệ) */
.page-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(700px 300px at 90% 0%, rgba(139, 211, 74, .2), transparent 60%),
    linear-gradient(160deg, var(--brand-900), var(--brand-800));
  color: #fff; padding-block: 44px 52px;
}
@media (min-width: 900px) { .page-hero { padding-block: 64px 72px; } }
.page-hero h1 { color: #fff; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); font-weight: 800; margin: 14px 0 10px; }
.page-hero p { color: rgba(255, 255, 255, .8); font-size: var(--fs-lead); max-width: 640px; }
.page-hero .eyebrow { background: rgba(255, 255, 255, .1); color: #d9f7c2; border: 1px solid rgba(255, 255, 255, .16); }

.search {
  position: relative; margin-top: 24px; max-width: 640px;
}
.search i { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 56px; padding: 0 20px 0 52px;
  border-radius: var(--r-pill); border: 0;
  background: var(--bg-surface); color: var(--text-1);
  font-size: 1rem; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5);
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: 3px solid rgba(139, 211, 74, .6); outline-offset: 2px; }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-3); }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb i { font-size: 0.6rem; opacity: .7; }

/* ---------- 8. Guide library ---------- */
.cat-nav { display: flex; flex-direction: column; gap: 2px; }
.cat-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-12); border: 0; background: transparent;
  text-align: left; font-weight: 500; font-size: 0.93rem; color: var(--text-2); cursor: pointer;
  transition: background-color .2s, color .2s;
}
.cat-nav button:hover { background: var(--bg-subtle); color: var(--text-1); }
.cat-nav button.is-active { background: var(--brand-soft); color: var(--brand-600); font-weight: 600; }
[data-theme="dark"] .cat-nav button.is-active { color: var(--brand-400); }
.cat-nav__count { margin-left: auto; font-size: 0.75rem; font-weight: 600; color: var(--text-3); background: var(--bg-subtle); padding: 2px 8px; border-radius: var(--r-pill); }
.cat-nav button.is-active .cat-nav__count { background: var(--bg-surface); color: inherit; }

/* Màn hẹp: danh mục thành hàng chip cuộn ngang */
@media (max-width: 899px) {
  .guide-side .card { padding: 0; background: none; border: 0; box-shadow: none; }
  .guide-side .card-head, .guide-side .help-card { display: none; }
  .cat-nav { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .cat-nav::-webkit-scrollbar { display: none; }
  .cat-nav button { width: auto; flex-shrink: 0; white-space: nowrap; border: 1px solid var(--stroke); background: var(--bg-surface); border-radius: var(--r-pill); padding: 8px 14px; }
  .cat-nav button.is-active { border-color: transparent; background: var(--brand-600); color: #fff; }
  .cat-nav button.is-active .cat-nav__count { background: rgba(255, 255, 255, .2); }
}

.help-card { margin-top: var(--col-gap); }
.help-card p { color: var(--text-2); font-size: 0.9rem; margin-bottom: 16px; }
.help-card__lines { display: grid; gap: 12px; }
.help-card__lines small { display: block; color: var(--text-2); font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.toolbar__count { color: var(--text-2); font-size: 0.93rem; }
.toolbar__count b { color: var(--text-1); }
.select { position: relative; }
.select select {
  appearance: none; height: 40px; padding: 0 38px 0 14px;
  border-radius: var(--r-pill); border: 1px solid var(--stroke-strong);
  background: var(--bg-surface); font-size: 0.9rem; cursor: pointer;
}
.select i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 0.7rem; color: var(--text-3); pointer-events: none; }

.group-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.group-title:first-child { margin-top: 0; }
.group-title h2 { font-size: 1.15rem; }
.group-title span { color: var(--text-3); font-size: 0.85rem; font-weight: 500; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 32px; }
.pager button {
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--stroke-strong); background: var(--bg-surface); cursor: pointer; font-weight: 600; font-size: 0.9rem;
}
.pager button:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-600); }
.pager button.is-active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager span { align-self: center; padding: 0 4px; color: var(--text-3); }

/* ---------- 8b. News ---------- */
/* Bài tin tức không có ảnh: hiện biểu tượng tờ báo thay vì sách */
#news-grid .post-card__thumb::before { content: '\f1ea'; }

.news-side__list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 4px; }
.news-side__list a { display: grid; gap: 2px; padding: 10px 12px; margin-inline: -12px; border-radius: var(--r-12); transition: background-color .2s; }
.news-side__list a:hover { background: var(--bg-subtle); }
.news-side__list b { font-size: 0.9rem; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-side__list span { font-size: 0.78rem; color: var(--text-3); }
@media (max-width: 899px) { .news-side { display: none; } }

/* ---------- 9. Article page ---------- */
.article-head { padding-block: 28px 8px; }
@media (min-width: 900px) { .article-head { padding-block: 40px 8px; } }
.article-head h1 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 800; margin: 14px 0 12px; max-width: 980px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; color: var(--text-3); font-size: 0.88rem; }
.article-meta i { margin-right: 6px; }

.article-main { min-width: 0; }
.article-body { padding: 22px 20px; }
@media (min-width: 600px) { .article-body { padding: 32px; } }
@media (min-width: 1200px) { .article-body { padding: 44px 52px; } }

.toc { list-style: none; border-left: 2px solid var(--stroke); }
.toc li a {
  display: block; margin-left: -2px; padding: 7px 12px;
  border-left: 2px solid transparent;
  font-size: 0.88rem; color: var(--text-2); line-height: 1.45;
  transition: color .2s, border-color .2s;
}
.toc li.toc-sub a { padding-left: 26px; font-size: 0.83rem; }
.toc li a:hover { color: var(--text-1); }
.toc li a.active { color: var(--brand-600); border-left-color: var(--brand-600); font-weight: 600; }
[data-theme="dark"] .toc li a.active { color: var(--brand-400); border-left-color: var(--brand-400); }
.toc-scroll { max-height: calc(100vh - var(--header-h) - 260px); overflow-y: auto; }
@media (max-width: 899px) { .toc-scroll { max-height: 320px; } }

.toc-details summary { list-style: none; cursor: pointer; }
.toc-details summary::-webkit-details-marker { display: none; }
.toc-details summary .card-head { margin-bottom: 0; }
.toc-details[open] summary .card-head { margin-bottom: 14px; }
.toc-details .chev { transition: transform .2s; color: var(--text-3); }
.toc-details[open] .chev { transform: rotate(180deg); }
@media (min-width: 900px) { .toc-details summary { pointer-events: none; } .toc-details .chev { display: none; } }

.side-stack { display: flex; flex-direction: column; gap: var(--col-gap); }
@media (max-width: 899px) { .side-stack .help-card { display: none; } }

.related { margin-top: 40px; }
.related h2 { font-size: 1.2rem; margin-bottom: 16px; }
.related .article-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .related .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .related .article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Prose: nội dung markdown do admin soạn */
.prose { font-size: 1.04rem; line-height: 1.8; color: var(--text-1); max-width: 860px; overflow-wrap: anywhere; }
.prose > *:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.25em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--brand-500); }
.prose h1, .prose h2 { font-size: 1.5rem; margin: 2.2em 0 .8em; padding-bottom: .4em; border-bottom: 1px solid var(--stroke); }
.prose h3 { font-size: 1.22rem; margin: 1.8em 0 .6em; }
.prose h4 { font-size: 1.05rem; margin: 1.5em 0 .5em; }
.prose a { color: var(--brand-600); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--stroke); margin: 2.5em 0; }
.prose img {
  border-radius: var(--r-12); border: 1px solid var(--stroke);
  margin: 1.25em auto; cursor: zoom-in; transition: box-shadow .2s;
}
.prose img:hover { box-shadow: var(--shadow-pop); }
/* Ảnh theo thiết bị (cú pháp ![@pc ...] / ![@mobile ...] trong bài viết) */
@media (max-width: 899px) { .prose img.img--pc, .prose p:has(> img.img--pc:only-child) { display: none; } }
@media (min-width: 900px) { .prose img.img--mobile, .prose p:has(> img.img--mobile:only-child) { display: none; } }
/* Video YouTube (link YouTube đứng riêng một đoạn trong bài viết) */
.prose .video-embed {
  position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 1.5em 0;
  border-radius: var(--r-12); overflow: hidden; background: #000; box-shadow: var(--shadow-pop);
}
.prose .video-embed--vertical { aspect-ratio: 9 / 16; max-width: 360px; margin-inline: auto; }
.prose .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Video theo thiết bị (cú pháp "@pc <link>" / "@mobile <link>"), cùng mốc 900px với ảnh */
@media (max-width: 899px) { .prose .video-embed--pc { display: none; } }
@media (min-width: 900px) { .prose .video-embed--mobile { display: none; } }
.prose :not(pre) > code { font-family: var(--mono); font-size: .88em; background: var(--bg-subtle); border: 1px solid var(--stroke); padding: .1em .4em; border-radius: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }

.prose blockquote {
  position: relative; margin: 2em 0; padding: 1.1em 1.4em 1.1em 3em;
  border-left: 4px solid var(--brand-500); border-radius: 0 var(--r-12) var(--r-12) 0;
  background: var(--brand-soft); font-style: italic;
}
.prose blockquote::before {
  content: '\f10d'; font-family: "Font Awesome 6 Free"; font-weight: 900; font-style: normal;
  position: absolute; left: 1em; top: 1.05em; color: var(--brand-500); opacity: .5;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; margin-top: .75em; font-size: .9rem; color: var(--text-3); font-style: normal; font-weight: 600; }

.prose pre {
  background: #0f1712; color: #d4dcd7; padding: 1.25em 1.4em; border-radius: var(--r-12);
  overflow-x: auto; margin: 1.75em 0; font-family: var(--mono); font-size: .9rem; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.code-keyword, .code-tag { color: #569cd6; }
.code-string { color: #ce9178; }
.code-comment { color: #6a9955; }
.code-attr { color: #9cdcfe; }

/* Callout */
.alert { display: flex; gap: 14px; align-items: flex-start; padding: 1em 1.2em; margin: 1.75em 0; border-radius: var(--r-12); border: 1px solid; border-left-width: 4px; }
.alert-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: .15em; }
.alert-content p:last-child { margin-bottom: 0; }
.alert-info { background: color-mix(in srgb, var(--c-blue) 8%, transparent); border-color: color-mix(in srgb, var(--c-blue) 25%, transparent); border-left-color: var(--c-blue); }
.alert-info .alert-icon { color: var(--c-blue); }
.alert-success { background: color-mix(in srgb, var(--c-green) 8%, transparent); border-color: color-mix(in srgb, var(--c-green) 25%, transparent); border-left-color: var(--c-green); }
.alert-success .alert-icon { color: var(--c-green); }
.alert-warning { background: color-mix(in srgb, var(--c-amber) 9%, transparent); border-color: color-mix(in srgb, var(--c-amber) 28%, transparent); border-left-color: var(--c-amber); }
.alert-warning .alert-icon { color: var(--c-amber); }

/* Các bước đánh số */
.prose .process-list { list-style: none; counter-reset: step; padding-left: 0; margin: 1.75em 0; }
.prose .process-list li { position: relative; padding-left: 3.25em; margin-bottom: 1.5em; }
.prose .process-list li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 2.1em; height: 2.1em; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem; color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
}
.prose .process-list li strong { display: block; font-size: 1.1rem; margin-bottom: .3em; }

.prose .checklist { list-style: none; padding-left: 0; }
.prose .checklist li { position: relative; padding-left: 2em; }
.prose .checklist li::before {
  content: '\f00c'; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; left: 0; top: .1em; color: var(--brand-500);
}

.prose .img-wrapper { margin: 2em 0; text-align: center; }
.prose .img-caption { display: block; margin-top: .6em; font-size: .88rem; color: var(--text-3); font-style: italic; }

/* Bảng: bọc cuộn ngang trên màn hẹp */
.table-wrapper { overflow-x: auto; margin: 1.75em 0; border: 1px solid var(--stroke); border-radius: var(--r-12); }
.table-custom { min-width: 560px; }
.table-custom th, .table-custom td { padding: .8em 1.1em; text-align: left; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.table-custom th { background: var(--bg-subtle); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.table-custom tr:last-child td { border-bottom: 0; }

/* ---------- 10. Contact / 404 ---------- */
.contact-list { display: flex; flex-direction: column; gap: 12px; }
.contact-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: var(--r-12);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  transition: border-color .2s, transform .15s;
}
.contact-row:hover { border-color: var(--accent); }
.contact-row div small { display: block; font-size: 0.78rem; color: var(--text-3); }
.contact-row div strong { display: block; font-size: 1.15rem; color: var(--accent); letter-spacing: .01em; }
.contact-row div span { display: block; font-size: 0.85rem; color: var(--text-2); }
.contact-row .go { margin-left: auto; color: var(--accent); }

.info-rows li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; }
.info-rows li + li { border-top: 1px solid var(--stroke); }
.info-rows small { display: block; font-size: 0.78rem; color: var(--text-3); }
.info-rows p { font-size: 0.95rem; font-weight: 500; }

.map-frame { border-radius: var(--r-12); overflow: hidden; border: 1px solid var(--stroke); aspect-ratio: 4 / 3; max-height: 520px; }
@media (min-width: 900px) { .map-frame { aspect-ratio: 16 / 10; } }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.contact-main { display: flex; flex-direction: column; gap: var(--col-gap); }
.quick-links { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .quick-links { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quick-link { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-12); border: 1px solid var(--stroke); background: var(--bg-subtle); transition: border-color .2s; }
.quick-link:hover { border-color: var(--accent); }
.quick-link b { display: block; font-size: 0.93rem; }
.quick-link span { display: block; font-size: 0.8rem; color: var(--text-3); }

.notfound { text-align: center; padding-block: 80px 104px; }
.notfound__code {
  font-size: clamp(5rem, 3rem + 10vw, 9rem); font-weight: 800; line-height: 1; letter-spacing: -0.06em;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-800));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.notfound h1 { font-size: 1.6rem; margin: 12px 0 8px; }
.notfound p { color: var(--text-2); margin-bottom: 28px; }
.notfound .btn + .btn { margin-left: 8px; }

/* ---------- 11. Lightbox ---------- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(3, 10, 6, .92);
  display: none; align-items: center; justify-content: center;
}
.lightbox-overlay.active { display: flex; }
.lightbox-img { max-width: 92vw; max-height: 86vh; border-radius: var(--r-8); cursor: grab; transition: transform .2s ease-out; }
.lightbox-img:active { cursor: grabbing; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .1); border: 0; color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .2); }
.lightbox-controls {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.zoom-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: #fff; cursor: pointer; }
.zoom-btn:hover { background: rgba(255, 255, 255, .15); }
.zoom-value { color: #fff; font-size: .85rem; font-weight: 600; min-width: 48px; text-align: center; }

/* ---------- 12. Motion ---------- */
/* Đốm sáng trôi chậm sau hero */
.hero__orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero__orbs span { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; animation: drift 18s ease-in-out infinite alternate; }
.hero__orbs span:nth-child(1) { width: 420px; height: 420px; background: #4fd987; left: -120px; top: 20%; }
.hero__orbs span:nth-child(2) { width: 360px; height: 360px; background: #a6f07a; right: 10%; top: -140px; opacity: .3; animation-duration: 22s; }
.hero__orbs span:nth-child(3) { width: 300px; height: 300px; background: #3b6cf0; right: -100px; bottom: -120px; opacity: .25; animation-duration: 26s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15); } }

/* Hero: các dòng chữ trồi lên lần lượt */
.hero__inner > div:first-child > * { animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
.hero__inner > div:first-child > :nth-child(2) { animation-delay: .08s; }
.hero__inner > div:first-child > :nth-child(3) { animation-delay: .16s; }
.hero__inner > div:first-child > :nth-child(4) { animation-delay: .24s; }
.hero__inner > div:first-child > :nth-child(5) { animation-delay: .32s; }
.hero__inner > div:first-child > :nth-child(6) { animation-delay: .4s; }
.mock__window { animation: rise 1s .2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* Lịch sân tự lấp đầy */
.sched__bk { transform-origin: left center; animation: fill .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.6s + var(--d, 0) * .14s); }
@keyframes fill { from { transform: scaleX(0); opacity: 0; } 60% { opacity: 1; } }
.sched__bk.is-live { position: relative; }
.sched__bk.is-live::after {
  content: ''; position: absolute; right: 8px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .8); animation: live 1.6s ease-out infinite;
}
@keyframes live { to { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); } }
.mock__float--new { animation: popin .6s 1.8s cubic-bezier(.34, 1.56, .64, 1) both, bob 5s 2.4s ease-in-out infinite; }
.mock__float--rev { animation: popin .6s 2.2s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes popin { from { opacity: 0; transform: translateY(16px) scale(.85); } }

/* Thanh tiến trình cuộn trang (chỉ trình duyệt hỗ trợ scroll-driven animation) */
.scroll-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--brand-500), var(--lime-400)); pointer-events: none; }
@supports (animation-timeline: scroll()) {
  .scroll-progress { animation: progress linear both; animation-timeline: scroll(root); }
  @keyframes progress { to { transform: scaleX(1); } }
}

/* Ánh sáng chạy theo con trỏ trên thẻ tính năng */
[data-spotlight] .feature { position: relative; isolation: isolate; }
[data-spotlight] .feature::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent, var(--c-green)) 14%, transparent), transparent 60%);
}
[data-spotlight] .feature:hover::after { opacity: 1; }
.feature .icon-tile, .sports__list li i { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.feature:hover .icon-tile { transform: rotate(-8deg) scale(1.08); }
.sports__list li { transition: transform .2s, border-color .2s; }
.sports__list li:hover { transform: translateY(-2px); border-color: var(--accent); }
.sports__list li:hover i { transform: rotate(-20deg) scale(1.2); }

/* Mockup: thanh tiến độ chạy khi cuộn tới, bảng tin tự cuộn, nhãn nổi nhấp nhô */
.js .showcase__visual .ui__progress span { transform: scaleX(0); transform-origin: left; transition: transform 1.2s .5s cubic-bezier(.2, .8, .2, 1); }
.js .showcase__visual.is-in .ui__progress span { transform: none; }
.feed { animation: feed 9s ease-in-out 1s infinite alternate; }
@keyframes feed { 0%, 20% { transform: translateY(0); } 80%, 100% { transform: translateY(-150px); } }
.stage__tag { animation: bob 4s ease-in-out infinite; }

/* Hiện dần khi cuộn tới (JS gắn độ trễ so le cho các phần tử cùng hàng) */
.no-transition * { transition: none !important; }
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .flip.reveal { transform: translateY(16px) scale(.97); }
.js .flip.reveal.is-in { transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .scroll-progress { display: none; }
  .hero__orbs { display: none; }
  /* Không lật 3D: đổi mặt thẻ tức thì */
  .flip__inner { transform: none !important; }
  .flip__face--back { transform: none; visibility: hidden; }
  #mode-alobo:checked ~ .day__grid .flip__face--front { visibility: hidden; }
  #mode-alobo:checked ~ .day__grid .flip__face--back { visibility: visible; }
}

/* ---------- Trang Tin tức / Hướng dẫn: đầu trang gọn, chữ bên trái, cột phải để trống ---------- */
.hero-split { display: grid; gap: 24px; }
.hero-split__text { min-width: 0; }
/* Cột phải (trang Hướng dẫn): thẻ mời vào trang Đào tạo; cao bằng cột giữ chỗ để đầu trang không đổi chiều cao */
.hero-split__aside { min-width: 0; }
@media (min-width: 900px) { .hero-split__aside { display: flex; align-items: center; justify-content: flex-end; min-height: 284px; } }
.hero-learn {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 16px;
  width: 100%; max-width: 440px; padding: 20px 22px; border-radius: var(--r-24);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-learn__icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-16);
  background: var(--lime-400); color: var(--brand-900); font-size: 1.35rem;
  box-shadow: 0 10px 24px -10px rgba(139, 211, 74, .8);
}
.hero-learn__text { display: grid; gap: 4px; }
.hero-learn__text b { color: #fff; font-size: 1.05rem; }
.hero-learn__text span { color: rgba(255, 255, 255, .75); font-size: .88rem; line-height: 1.5; }
.hero-learn__btn { grid-column: 1 / -1; width: 100%; }
@media (max-width: 899px) { .hero-learn { max-width: none; padding: 16px; } }
/* Cột phải giữ chỗ để đầu trang có chiều cao cố định trên máy tính */
.hero-split__spacer { display: none; }
@media (min-width: 900px) { .hero-split__spacer { display: block; min-height: 284px; } }
@media (min-width: 900px) {
  .hero-split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; align-items: stretch; }
  .hero-split__text { align-self: center; }
  .page-hero--slider { padding-block: 36px 40px; }
  .page-hero--slider h1 { font-size: clamp(1.6rem, 0.9rem + 1.5vw, 2.25rem); }
  /* Mô tả giữ trên 1 dòng; màn hẹp không đủ chỗ thì cắt bằng dấu "…" */
  .page-hero--slider p { max-width: none; font-size: clamp(.9rem, .55rem + .45vw, 1rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page-hero--slider .search { max-width: none; }
}

/* ---------- Bài ghim: nhãn "Ghim" trên ảnh thẻ bài ---------- */
.post-card__pin {
  position: absolute; right: 12px; top: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--lime-400); color: var(--brand-800);
  font-size: 0.72rem; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.post-card__pin i { font-size: .68rem; transform: rotate(35deg); }
.post-card--pinned .post-card__cat { max-width: calc(100% - 100px); }

/* ---------- Bài viết mở trong khung (trang Đào tạo): chỉ còn nội dung bài ---------- */
.is-embedded .site-header,
.is-embedded .site-footer,
.is-embedded .skip-link,
.is-embedded [data-chat],
.is-embedded .breadcrumb,
.is-embedded .help-card,
.is-embedded .related { display: none !important; }
.is-embedded { scroll-padding-top: 16px; }
.is-embedded .split__side--sticky { top: 16px; }
.is-embedded .page-body { padding-block: 16px 40px; }

/* ---------- Trang Đào tạo khách hàng (/training/) ---------- */
.training [hidden] { display: none !important; }

/* Form thêm người học */
.tr-new { display: grid; gap: 14px; }
.tr-new .card-head { margin-bottom: 2px; }
.tr-field { display: grid; gap: 6px; }
.tr-field > span:first-child { font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
.tr-field input,
.tr-select select {
  width: 100%; height: 46px; padding: 0 14px;
  border-radius: var(--r-12); border: 1px solid var(--stroke-strong);
  background: var(--bg-surface); color: var(--text-1); font: inherit; font-size: 0.95rem;
  transition: border-color .15s, box-shadow .15s;
}
.tr-field input:focus,
.tr-select select:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 22%, transparent); }
.tr-field .is-invalid { border-color: var(--c-rose); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-rose) 15%, transparent); }
.tr-select { position: relative; display: block; }
.tr-select select { appearance: none; padding-right: 40px; cursor: pointer; }
.tr-select select:disabled { cursor: not-allowed; color: var(--text-3); background: var(--bg-subtle); }
.tr-select i { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: .75rem; color: var(--text-3); pointer-events: none; }
.tr-program-desc { margin-top: -6px; font-size: 0.83rem; color: var(--text-3); line-height: 1.5; }
.tr-error { color: var(--c-rose); font-size: 0.85rem; font-weight: 600; }
.tr-new .btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.tr-note { display: flex; gap: 8px; margin-top: 14px; padding: 0 4px; font-size: 0.8rem; color: var(--text-3); line-height: 1.5; }
.tr-note i { margin-top: 3px; }

.tr-search { position: relative; flex: 0 1 260px; }
.tr-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: .8rem; color: var(--text-3); pointer-events: none; }
.tr-search input {
  width: 100%; height: 40px; padding: 0 14px 0 36px;
  border-radius: var(--r-pill); border: 1px solid var(--stroke-strong);
  background: var(--bg-surface); color: var(--text-1); font: inherit; font-size: 0.9rem;
}
.tr-search input:focus { outline: none; border-color: var(--brand-500); }

.tr-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 16px; padding: 12px 16px;
  border-radius: var(--r-12); font-size: 0.88rem; line-height: 1.5;
  background: color-mix(in srgb, var(--c-amber) 12%, transparent); color: var(--text-1);
  border: 1px solid color-mix(in srgb, var(--c-amber) 30%, transparent);
}
.tr-banner.is-error { background: color-mix(in srgb, var(--c-rose) 10%, transparent); border-color: color-mix(in srgb, var(--c-rose) 30%, transparent); }
.tr-retry { padding: 0; border: 0; background: none; color: var(--brand-600); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* Thẻ người học */
.tr-learners { display: grid; gap: 12px; }
@media (min-width: 1200px) { .tr-learners { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tr-learner {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  padding: 18px; border-radius: var(--r-16);
  background: var(--bg-surface); border: 1px solid var(--stroke); box-shadow: var(--shadow-card);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.tr-learner:hover { border-color: color-mix(in srgb, var(--brand-500) 45%, var(--stroke)); box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.tr-learner:focus-within { border-color: var(--brand-500); }
.tr-learner__link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tr-learner__link:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-500) 50%, transparent); outline-offset: 2px; }
.tr-learner__main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.tr-learner__main h3 { font-size: 1.02rem; line-height: 1.35; overflow-wrap: anywhere; }
.tr-learner__main p { font-size: 0.85rem; color: var(--text-2); }
.tr-learner__main small { font-size: 0.76rem; color: var(--text-3); }
.tr-learner__progress { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 0.8rem; color: var(--text-3); white-space: nowrap; }
.tr-learner__progress b { color: var(--text-1); }
.tr-learner__progress .tr-meter { flex: 1; }
.tr-learner__actions { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 18px; align-self: stretch; }
.tr-learner__go { font-size: 0.85rem; font-weight: 600; color: var(--brand-600); white-space: nowrap; }
.tr-learner__go i { font-size: .75rem; margin-left: 2px; transition: transform .2s; }
.tr-learner:hover .tr-learner__go i { transform: translateX(3px); }
.tr-learner__del {
  position: relative; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: var(--r-pill); border: 1px solid transparent; background: none; color: var(--text-3); cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s;
}
.tr-learner__del:hover,
.tr-learner__del:focus-visible { color: var(--c-rose); background: color-mix(in srgb, var(--c-rose) 10%, transparent); border-color: color-mix(in srgb, var(--c-rose) 25%, transparent); }
.tr-learner.is-complete .tr-meter i { background: linear-gradient(90deg, var(--brand-500), var(--lime-400)); }
.tr-tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); font-size: 0.72rem; font-weight: 700; }
.tr-tag.is-warn { background: color-mix(in srgb, var(--c-amber) 15%, transparent); color: var(--c-amber); }

.tr-avatar {
  flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--av, var(--c-green)) 14%, transparent); color: var(--av, var(--c-green));
  font-weight: 800; font-size: 0.95rem; letter-spacing: .02em;
}
[data-theme="dark"] .tr-avatar { color: color-mix(in srgb, var(--av, var(--c-green)) 60%, #fff); }

.tr-meter { display: block; height: 6px; border-radius: var(--r-pill); background: var(--bg-subtle); overflow: hidden; box-shadow: inset 0 0 0 1px var(--stroke); }
.tr-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--brand-500); transition: width .4s cubic-bezier(.2, .8, .2, 1); }

/* ===== Màn hình học ===== */
body.is-learning .site-footer { display: none; }
.learn {
  --learn-bar: 68px;
  display: flex; flex-direction: column;
  height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
  background: var(--bg-page);
}
.learn__bar {
  flex-shrink: 0; display: flex; align-items: center; gap: 12px 20px;
  min-height: var(--learn-bar); padding: 10px var(--gutter);
  background: var(--bg-surface); border-bottom: 1px solid var(--stroke);
}
.learn__back {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px;
  border-radius: var(--r-pill); border: 1px solid var(--stroke); color: var(--text-2); font-size: 0.88rem; font-weight: 600;
  transition: color .15s, border-color .15s;
}
.learn__back:hover { color: var(--brand-600); border-color: var(--brand-400); }
.learn__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.learn__who .tr-avatar { width: 38px; height: 38px; font-size: 0.85rem; }
.learn__who div { display: grid; min-width: 0; }
.learn__who b { font-size: 0.98rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learn__who span { font-size: 0.8rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learn__progress { flex: 0 1 300px; margin-left: auto; display: grid; gap: 6px; }
.learn__progress-text { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--text-3); white-space: nowrap; }
.learn__progress-text b { color: var(--text-1); font-weight: 600; }
.learn__progress.is-complete .learn__progress-text span { color: var(--brand-600); font-weight: 700; }
.learn__progress.is-complete .tr-meter i { background: linear-gradient(90deg, var(--brand-500), var(--lime-400)); }

.learn__body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
.learn__side { min-height: 0; border-right: 1px solid var(--stroke); background: var(--bg-surface); }
.learn__side-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 12px 10px 24px; }
.learn__side-empty { padding: 16px; color: var(--text-3); font-size: 0.9rem; }

/* Nhóm tính năng */
.lg + .lg { margin-top: 4px; }
.lg__head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: var(--r-12);
  background: none; color: var(--text-1); font: inherit; text-align: left; cursor: pointer;
}
.lg__head:hover { background: var(--bg-subtle); }
.lg__no {
  flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-8);
  background: var(--brand-soft); color: var(--brand-600); font-size: 0.78rem; font-weight: 700;
}
.lg.is-complete .lg__no { background: var(--brand-500); color: #fff; }
.lg__name { flex: 1; min-width: 0; font-size: 0.9rem; font-weight: 700; line-height: 1.35; }
.lg__count { flex-shrink: 0; font-size: 0.76rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lg__chev { flex-shrink: 0; font-size: 0.7rem; color: var(--text-3); transition: transform .2s; }
.lg.is-collapsed .lg__chev { transform: rotate(-90deg); }
.lg.is-collapsed .lg__lessons { display: none; }
.lg__lessons { list-style: none; margin: 0 0 6px; padding: 0 0 0 22px; }

/* Bài học */
.ll { position: relative; display: flex; align-items: flex-start; gap: 4px; padding-left: 14px; }
.ll::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--stroke); }
.ll.is-active::before { background: var(--brand-500); }
.ll__check {
  appearance: none; flex-shrink: 0; width: 20px; height: 20px; margin: 9px 0 0; border-radius: 6px;
  border: 2px solid var(--stroke-strong); background: var(--bg-surface); cursor: pointer;
  display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.ll__check::after { content: ""; width: 9px; height: 5px; margin-top: -2px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); transition: transform .15s; }
.ll__check:checked { background: var(--brand-500); border-color: var(--brand-500); }
.ll__check:checked::after { transform: rotate(-45deg) scale(1); }
.ll__check:hover { border-color: var(--brand-500); }
.ll__check:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-500) 40%, transparent); outline-offset: 2px; }
.ll__title {
  flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  padding: 8px 10px; border: 0; border-radius: var(--r-8); background: none;
  color: var(--text-2); font: inherit; font-size: 0.88rem; line-height: 1.45; text-align: left; cursor: pointer;
}
.ll__title:hover { background: var(--bg-subtle); color: var(--text-1); }
.ll.is-done .ll__title span { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 60%, transparent); }
.ll.is-active .ll__title { background: var(--brand-soft); color: var(--brand-700); font-weight: 600; }
[data-theme="dark"] .ll.is-active .ll__title { color: var(--brand-400); }
.ll.is-active.is-done .ll__title span { color: inherit; }
.ll__title em { font-style: normal; font-size: 0.7rem; font-weight: 600; color: var(--c-amber); white-space: nowrap; }

/* Khung bài viết */
.learn__view { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.learn__view-head {
  flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 12px 20px; background: var(--bg-surface); border-bottom: 1px solid var(--stroke);
}
.learn__lesson { flex: 1 1 260px; min-width: 0; }
.learn__lesson span { display: block; font-size: 0.76rem; font-weight: 600; color: var(--brand-600); text-transform: uppercase; letter-spacing: .04em; }
.learn__lesson h2 { font-size: 1.05rem; line-height: 1.35; }
.learn__actions { display: flex; align-items: center; gap: 8px; }
.learn__actions .icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.learn__actions .icon-btn i { font-size: .85rem; }
#ln-done { min-width: 168px; }
#ln-done.is-done { background: var(--brand-soft); color: var(--brand-700); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-500) 40%, transparent); }
[data-theme="dark"] #ln-done.is-done { color: var(--brand-400); }
.learn__frame { position: relative; flex: 1; min-height: 0; background: var(--bg-page); }
.learn__frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg-page); }
.learn__loading {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: var(--r-pill);
  background: var(--bg-surface); box-shadow: var(--shadow-pop); font-size: 0.85rem; color: var(--text-2);
}
.tr-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--stroke-strong); border-top-color: var(--brand-500); animation: tr-spin .8s linear infinite; }
@keyframes tr-spin { to { transform: rotate(360deg); } }
.learn__empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 32px 20px; text-align: center; color: var(--text-2); }
.learn__empty strong { color: var(--text-1); font-size: 1.05rem; }
.learn__empty p { max-width: 420px; font-size: 0.9rem; line-height: 1.6; }
.learn__empty .empty__icon { margin-bottom: 6px; }

/* Luôn chia 2 khung (checklist trái, bài viết phải) từ 640px trở lên; khung trái co theo màn hình */
@media (max-width: 1199px) {
  .learn__body { grid-template-columns: clamp(240px, 32vw, 340px) minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .learn__bar { flex-wrap: wrap; gap: 8px 12px; }
  .learn__back span { display: none; }
  .learn__back { width: 40px; padding: 0; justify-content: center; }
  .learn__who { flex: 1; }
  .learn__progress { flex: 1 1 220px; margin-left: 0; }
  .learn__view-head { padding: 10px 14px; }
  .lg__lessons { padding-left: 12px; }
}
/* Điện thoại: 2 khung xếp dọc, checklist ở trên (cuộn riêng), bài viết ở dưới */
@media (max-width: 639px) {
  .learn { height: auto; min-height: calc(100dvh - var(--header-h)); }
  .learn__body { display: flex; flex-direction: column; }
  .learn__side { border-right: 0; border-bottom: 1px solid var(--stroke); }
  .learn__side-scroll { height: auto; max-height: 42dvh; }
  .learn__actions { width: 100%; }
  .learn__actions #ln-done { margin-left: auto; min-width: 0; }
  .learn__frame { flex: none; height: calc(100dvh - var(--header-h) - 20px); }
}
@media (prefers-reduced-motion: reduce) {
  .tr-meter i, .tr-learner { transition: none; }
}

/* ===== Nút lên đầu trang (base.njk, bật bằng toTop: true) ===== */
.to-top {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 1400;
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: var(--r-pill); border: 1px solid var(--stroke);
  background: var(--bg-surface); color: var(--brand-600); box-shadow: var(--shadow-pop);
  font-size: 1rem; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.9);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s, background-color .15s, color .15s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.to-top:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.to-top:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 3px; }
.to-top:active { transform: scale(.94); }
.is-embedded .to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
@media (max-width: 639px) { .to-top { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
/* Trang có nút "Đặt câu hỏi" (nằm sát đáy): nút lên đầu trang đứng phía trên nó */
.has-ask .to-top { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
.is-embedded .has-ask .to-top { bottom: 80px; }
@media (max-width: 639px) { .has-ask .to-top { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); } }

/* ===== Đặt câu hỏi ở trang bài viết (ask-form.njk, main.js mục 13) ===== */
.ask-cta { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding: 20px 22px; }
.ask-cta__icon { flex-shrink: 0; }
.ask-cta__text { flex: 1; min-width: 0; }
.ask-cta__text h2 { font-size: 1.05rem; margin: 0 0 4px; }
.ask-cta__text p { margin: 0; color: var(--text-2); font-size: 0.9rem; }
.ask-cta__btn { flex-shrink: 0; }
@media (max-width: 639px) {
  .ask-cta { flex-wrap: wrap; padding: 18px; }
  .ask-cta__btn { width: 100%; }
}

.lead--ask { width: min(520px, calc(100vw - 24px)); }
.lead--ask .lead__main { background: var(--bg-surface); border-radius: var(--r-24, 24px); box-shadow: var(--shadow-pop); max-height: calc(100dvh - 24px); overflow: auto; }
.ask__icon { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-600); font-size: 1.25rem; }
.lead--ask .lead__sub b { color: var(--text-1); font-weight: 600; }
.field textarea {
  display: block; width: 100%; min-height: 120px; padding: 12px 14px; border-radius: var(--r-12);
  border: 1px solid var(--stroke-strong); background: var(--bg-surface); color: inherit; font: inherit; font-size: 1rem; line-height: 1.55; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 18%, transparent); }
.field.is-invalid textarea { border-color: var(--c-rose); }
.ask__counter { display: block; margin-top: 4px; text-align: right; font-size: 0.75rem; color: var(--text-3); }
.field.is-invalid .ask__counter { display: none; }

/* Nút nổi "Đặt câu hỏi": cố định góc phải, phía trên nút lên đầu trang */
.ask-fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 1400;
  display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 22px 0 0;
  border: 0; border-radius: var(--r-pill); isolation: isolate;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff;
  font: inherit; font-weight: 700; font-size: 0.95rem; letter-spacing: .01em; cursor: pointer;
  box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--brand-700) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: ask-fab-in .6s cubic-bezier(.34, 1.5, .64, 1) .3s both;
  transition: transform .2s ease, box-shadow .2s ease;
}
.ask-fab:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -10px color-mix(in srgb, var(--brand-700) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25); }
.ask-fab:active { transform: translateY(0) scale(.97); }
.ask-fab:focus-visible { outline: 3px solid color-mix(in srgb, var(--lime-400) 80%, transparent); outline-offset: 3px; }
/* Quầng sáng toả ra quanh nút */
.ask-fab__glow {
  position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--lime-400) 70%, transparent);
  animation: ask-glow 2.6s ease-out infinite;
}
.ask-fab__glow::after {
  content: ''; position: absolute; inset: -8px; border-radius: inherit;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lime-400) 55%, transparent), transparent);
  filter: blur(8px); opacity: .55; animation: ask-halo 2.6s ease-in-out infinite;
}
/* Vệt sáng lướt qua nút */
.ask-fab__shine { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.ask-fab__shine::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-18deg) translateX(-120%); animation: ask-shine 4.2s ease-in-out 1.2s infinite;
}
/* Linh vật (sticker nền trong suốt) nhô lên khỏi nút */
.ask-fab__icon { position: relative; flex-shrink: 0; width: 64px; height: 54px; margin-left: 2px; }
.ask-fab__icon img {
  position: absolute; left: -4px; bottom: -2px; width: 72px; height: 72px; max-width: none;
  transform-origin: 50% 90%; animation: ask-tilt 3.2s ease-in-out infinite, ask-icon-glow 2.6s ease-in-out infinite;
}
.ask-fab:hover .ask-fab__icon img { animation-duration: 1.2s; }
.ask-fab__text { white-space: nowrap; }

@keyframes ask-fab-in { from { opacity: 0; transform: translateY(24px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes ask-glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lime-400) 65%, transparent); }
  70%, 100% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--lime-400) 0%, transparent); }
}
@keyframes ask-halo { 0%, 100% { opacity: .35; transform: scale(.96); } 50% { opacity: .75; transform: scale(1.06); } }
@keyframes ask-shine { 0% { transform: skewX(-18deg) translateX(-120%); } 35%, 100% { transform: skewX(-18deg) translateX(520%); } }
@keyframes ask-icon-glow {
  0%, 100% { filter: drop-shadow(0 4px 6px rgba(1, 61, 34, .35)) drop-shadow(0 0 2px rgba(220, 255, 180, .4)); }
  50% { filter: drop-shadow(0 4px 6px rgba(1, 61, 34, .35)) drop-shadow(0 0 12px rgba(200, 255, 140, .95)); }
}
@keyframes ask-tilt { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-6deg) scale(1.03); } 55% { transform: rotate(4deg) scale(1.03); } }

.is-embedded .ask-fab { right: 14px; bottom: 14px; }
@media (max-width: 639px) {
  /* Điện thoại: chỉ còn icon tròn cho đỡ che nội dung */
  .ask-fab { right: 4px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: 64px; height: 64px; padding: 0; justify-content: center; background: none; box-shadow: none; }
  .ask-fab:hover { box-shadow: none; }
  .ask-fab__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ask-fab__icon { width: 64px; height: 64px; margin: 0; }
  .ask-fab__icon img { left: -2px; bottom: -2px; width: 68px; height: 68px; }
  .ask-fab__shine { display: none; }
  .is-embedded .ask-fab { right: 4px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ask-fab, .ask-fab__glow, .ask-fab__glow::after, .ask-fab__shine::after, .ask-fab__icon, .ask-fab__icon img { animation: none; }
}

.lead__done .ask__limit-icon { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 0 0 10px color-mix(in srgb, #f59e0b 16%, transparent); font-size: 1.7rem; }
.ask__limit p a { color: var(--brand-600); font-weight: 700; white-space: nowrap; }

/* ===== Nội dung chuyển từ website WordPress cũ (www.alobo.vn) ===== */
/* Bài viết cũ (trong .prose): khối Gutenberg / Essential Blocks hiển thị gọn theo giao diện Wiki */
.wp-legacy img { max-width: 100%; height: auto; border-radius: 10px; }
.wp-legacy figure { margin: 1.5em 0; }
.wp-legacy figure.aligncenter, .wp-legacy .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.wp-legacy figcaption { font-size: .9em; color: var(--text-2); text-align: center; margin-top: .5em; }
.wp-legacy .wp-block-columns { display: flex; flex-wrap: wrap; gap: 1.5em; }
.wp-legacy .wp-block-column { flex: 1 1 240px; min-width: 0; }
.wp-legacy .wp-block-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75em; }
.wp-legacy .wp-block-gallery figure { margin: 0; }
.wp-legacy .wp-block-spacer { height: 1em !important; }
.wp-legacy .wp-block-separator { border: 0; border-top: 1px solid var(--border, #e2e8f0); margin: 2em 0; }
.wp-legacy .wp-block-pullquote, .wp-legacy .wp-block-quote { border-left: 4px solid var(--brand-600, #0a7a45); padding: .5em 1em; margin: 1.5em 0; font-style: italic; }
.wp-legacy .eb-button-wrapper { margin: 1.25em 0; text-align: center; }
.wp-legacy a.eb-button-anchor { display: inline-block; padding: .7em 1.4em; border-radius: 10px; background: var(--brand-600, #0a7a45); color: #fff; font-weight: 700; text-decoration: none; }
.wp-legacy .video-embed iframe { border: 0; }

/* Trang giới thiệu cũ: dùng CSS riêng của trang (assets/legacy), chỉ chỉnh phần nền tảng */
.legacy-page { overflow-x: clip; }
.legacy-page img { max-width: 100%; height: auto; }
.legacy-page .eb-accordion-title-wrapper, .legacy-page .ea-header a { cursor: pointer; }
.legacy-page .eb-modal-player { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .75); }
.legacy-page > :first-child { margin-top: 0; }
.legacy-page__head { padding-top: 32px; padding-bottom: 8px; }
.legacy-page__head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.25; }
.legacy-page .vc_row { margin-left: 0; margin-right: 0; }
.footer-bottom__links a { color: inherit; text-decoration: none; }
.footer-bottom__links a:hover { text-decoration: underline; }
.footer-bottom { flex-wrap: wrap; gap: 8px 16px; }
.hero h1.hero__title--long { font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.1rem); line-height: 1.18; letter-spacing: -0.02em; }
