/* =========================================================
   Các trang con: danh mục, hạng mục, chi tiết phần mềm
   Nạp sau style.css (dùng chung biến màu, nút, header, footer)
   ========================================================= */

.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; }

/* Khung trang con: nền kẻ ô mờ phía trên */
.page { position: relative; padding: clamp(24px, 4vw, 40px) 0 clamp(64px, 8vw, 100px); isolation: isolate; }
.page::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 520px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent);
}

/* Đường dẫn như đường dẫn thư mục */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 22px; font-size: 13.5px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.crumbs a:hover { color: var(--office); text-decoration-color: currentColor; }
.crumbs span { color: var(--line-2); }
.crumbs b { color: var(--ink); font-weight: 600; }

/* Tab đang chọn của bìa hồ sơ */
.folder__tab small { font-size: 12px; font-weight: 600; opacity: .8; }
.folder__tab.is-active { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-bottom: 0; box-shadow: inset 0 3px 0 var(--c); z-index: 1; margin-bottom: -1px; }
.folder__tab.is-active:hover { transform: none; }

/* ---------- Thẻ, nhãn dùng chung ---------- */
.picon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 10px; overflow: hidden; color: var(--c, var(--office)); background: color-mix(in srgb, var(--c, var(--office)) 12%, transparent); border: 1px solid var(--line); }
.picon img { width: 100%; height: 100%; object-fit: cover; }
.picon svg { width: 24px; height: 24px; }
.tag { display: inline-block; padding: 0 7px; font-style: normal; font-size: 11.5px; font-weight: 600; line-height: 20px; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line); border-radius: 3px; white-space: nowrap; }
.tag--ai { color: var(--plum); border: 1px dashed color-mix(in srgb, var(--plum) 60%, transparent); background: color-mix(in srgb, var(--plum) 8%, transparent); }
.tag.is-on { color: var(--ink); background: color-mix(in srgb, var(--hl) 60%, var(--card)); border-color: color-mix(in srgb, var(--amber) 50%, transparent); }
.badge { display: inline-block; padding: 0 6px; font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 17px; color: var(--amber); border: 1.5px solid var(--amber); border-radius: 4px; transform: rotate(-4deg); vertical-align: 2px; }
.price { font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; }
.price.is-free { color: var(--green); }
.old-price { margin-left: 4px; font-weight: 500; font-size: 12.5px; color: var(--ink-3); }
.rate { font-size: 13px; font-weight: 600; color: var(--amber); white-space: nowrap; }
mark { background: var(--hl); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- Trang danh mục: tủ hồ sơ hai ngăn ---------- */
.intro { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.intro h1 { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 50px); font-weight: 700; letter-spacing: -.01em; }
.intro p { margin-top: 12px; color: var(--ink-2); font-size: 17px; }
.drawers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.drawer { --c: var(--office); }
.drawer[data-cat="edu"] { --c: var(--edu); }
.drawer .folder__tabs .folder__tab { --c: #2f5d9e; }
.drawer[data-cat="edu"] .folder__tabs .folder__tab { --c: #d9771f; }
.drawer__body { padding: 8px 22px 18px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 0 12px 12px 12px; box-shadow: var(--shadow-lg); }
.drawer__head { display: flex; align-items: center; gap: 14px; padding: 16px 0 14px; border-bottom: 2px solid var(--ink); }
.drawer__head .picon { width: 44px; height: 44px; border: 0; }
.drawer__head h2 { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.drawer__head p { font-size: 13.5px; color: var(--ink-3); }
.drawer__head p b { color: var(--green); }
.drawer__go { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--c); white-space: nowrap; }
.drawer__go svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.drawer__go:hover svg { transform: translateX(3px); }
.drawer[data-cat="edu"] .drawer__go { color: var(--edu-ink); }

.items { margin: 0; padding: 0; list-style: none; }
.items li + li { border-top: 1px dashed var(--line-2); }
.item { display: flex; gap: 14px; padding: 14px 8px; margin: 0 -8px; border-radius: 8px; transition: background .2s; }
.item:hover { background: var(--paper-2); }
.item__body { min-width: 0; flex: 1; }
.item__body b { display: block; font-size: 15.5px; line-height: 1.35; }
.item__body small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; }
.drawer__more { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 6px; padding: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); border: 1.5px dashed var(--line-2); border-radius: 8px; transition: border-color .2s, color .2s; }
.drawer__more:hover { color: var(--ink); border-color: var(--ink-3); }
.drawer__more svg { width: 16px; height: 16px; }
.drawer__empty { padding: 24px 0; color: var(--ink-3); font-family: var(--hand); font-size: 19px; }

/* Ghi chú "làm phần mềm theo yêu cầu" */
.request { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; max-width: 760px; margin: 48px auto 0; padding: 20px 26px; background: #fff3b0; color: #2a2f3a; border-radius: 2px 2px 14px 2px; transform: rotate(-.6deg); box-shadow: 0 14px 22px -16px rgba(40, 30, 0, .45); text-align: center; position: relative; }
.request::before { content: ""; position: absolute; top: -11px; left: 50%; width: 90px; height: 22px; margin-left: -45px; background: rgba(214, 204, 176, .65); transform: rotate(-3deg); }
.request p { font-family: var(--hand); font-size: 21px; line-height: 1.3; }
.request a { font-weight: 700; color: #1b2a4a; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Trang hạng mục ---------- */
.hm-head { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.hm-head .picon { width: 60px; height: 60px; border: 0; }
.hm-head .picon svg { width: 30px; height: 30px; }
.hm-head h1 { font-family: var(--serif); font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; }
.hm-head p { margin-top: 2px; color: var(--ink-3); font-size: 14.5px; }
.hm-head p b { color: var(--green); }

.hm-bar { display: flex; gap: 10px; margin-top: 26px; }
.field-line {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 46px;
  background: var(--card); border: 1px solid var(--line-2); border-bottom: 2px solid var(--ink-3); border-radius: 8px 8px 4px 4px;
  transition: border-color .2s;
}
.field-line:focus-within { border-color: var(--office); }
.field-line svg { width: 19px; height: 19px; color: var(--ink-3); flex: none; }
.field-line input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font-size: 15px; }
.field-line input::placeholder { color: var(--ink-3); }
.field-line input::-webkit-search-cancel-button { display: none; }
.field-line .clear { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--ink-3); }
.field-line .clear:hover { background: var(--paper-2); color: var(--ink); }
.field-line .clear svg { width: 16px; height: 16px; }
.select { position: relative; display: flex; }
.select select {
  height: 46px; padding: 0 38px 0 14px; font: 600 14px var(--sans); color: var(--ink); appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 8px;
}
.select::after { content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
.hm-filter-btn { display: none; height: 46px; }
.hm-filter-btn em { font-style: normal; min-width: 20px; padding: 0 6px; border-radius: 10px; font-size: 12px; background: var(--btn-bg); color: var(--btn-fg); }
.hm-filter-btn em:empty { display: none; }

.hm-filters { display: grid; gap: 12px; margin-top: 18px; padding: 16px 18px; background: var(--card); border: 1px dashed var(--line-2); border-radius: 8px; }
.hm-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hm-group__label { width: 72px; flex: none; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 4px; transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip small { font-size: 11.5px; color: var(--ink-3); }
.chip.is-on { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--hl) 65%, var(--card)); border-color: color-mix(in srgb, var(--amber) 60%, transparent); }
.chip.is-on::before { content: "✓"; font-family: var(--hand); font-size: 17px; line-height: 0; color: var(--green); }
.chip.is-zero { opacity: .45; }
.chip.is-extra { display: none; }
.show-all-topics .chip.is-extra { display: inline-flex; }
.chip--more { border-style: dashed; }

.hm-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 14px; font-size: 14px; color: var(--ink-3); }
.hm-status b { color: var(--ink); }
.hm-reset { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--red); }
.hm-reset svg { width: 14px; height: 14px; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.pcard {
  --c: var(--office);
  position: relative; display: flex; gap: 16px; height: 100%; padding: 18px 44px 18px 22px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 0 10px 10px 0; box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.pcard[data-cat="edu"] { --c: var(--edu); }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pcard .picon { --c: inherit; }
.pcard__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.pcard__title b { font-size: 16.5px; line-height: 1.35; }
.pcard__go { position: absolute; right: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--ink-3); transition: transform .2s var(--ease), color .2s; }
.pcard:hover .pcard__go { color: var(--c); transform: translateX(3px); }
/* Hạng mục: cột trái trả phí, cột phải miễn phí */
.hm-cols { display: grid; gap: 28px 22px; align-items: start; }
.hm-cols.is-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hm-cols.is-split .cards { grid-template-columns: 1fr; }
.hm-col { --k: var(--amber); }
.hm-col--free { --k: var(--green); }
.hm-col__head {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding-bottom: 8px;
  font-family: var(--serif); font-size: 19px; color: var(--k); border-bottom: 2px solid color-mix(in srgb, var(--k) 35%, transparent);
}
.hm-col__head small { padding: 1px 9px; font-family: var(--sans); font-size: 12.5px; font-weight: 700; color: var(--card); background: var(--k); border-radius: 999px; }
.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; padding: 44px 20px; text-align: center; background: var(--card); border: 1.5px dashed var(--line-2); border-radius: 10px; }
.empty b { font-family: var(--serif); font-size: 20px; }
.empty span { color: var(--ink-2); font-size: 14.5px; }

/* ---------- Trang chi tiết phần mềm ---------- */
.pd { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px 32px; align-items: start; }
.pd-main { display: grid; gap: 24px; min-width: 0; }
.pd-side { display: grid; gap: 20px; position: sticky; top: calc(var(--header-h) + 16px); }

.pd-hero { --c: var(--office); position: relative; display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 26px 26px 22px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 0 0 12px 12px; box-shadow: var(--shadow); }
.pd-hero[data-cat="edu"] { --c: var(--edu); }
.pd-hero .picon { width: 84px; height: 84px; border-radius: 16px; }
.pd-hero .picon svg { width: 40px; height: 40px; }
.pd-hero__cat { display: inline-block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.pd-hero[data-cat="edu"] .pd-hero__cat { color: var(--edu-ink); }
.pd-hero h1 { font-family: var(--serif); font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; letter-spacing: -.01em; }
.pd-hero h1 .badge { font-family: var(--sans); font-size: 12px; margin-left: 6px; vertical-align: 8px; }
.pd-hero p { margin-top: 10px; color: var(--ink-2); font-size: 16px; }
.pd-hero__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pd-hero__file { position: absolute; right: 18px; top: 14px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* Ảnh giới thiệu: khung ảnh dán băng dính */
.shot { position: relative; margin: 8px 0 0; padding: 10px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: rotate(-.3deg); }
.shot::before, .shot::after { content: ""; position: absolute; top: -10px; width: 90px; height: 22px; background: rgba(214, 204, 176, .7); z-index: 1; }
.shot::before { left: -18px; transform: rotate(-32deg); }
.shot::after { right: -18px; transform: rotate(32deg); }
.shot img, .shot iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; background: #000; border: 0; }
.shot figcaption { padding: 8px 4px 0; font-family: var(--hand); font-size: 17px; color: var(--ink-3); text-align: center; }
.shot--empty { display: grid; place-items: center; gap: 8px; aspect-ratio: 16 / 9; color: var(--ink-3); font-family: var(--hand); font-size: 19px; background: repeating-linear-gradient(135deg, var(--paper-2) 0 12px, var(--card) 12px 24px); }
.shot--empty svg { width: 42px; height: 42px; }

.pd-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.sheet { padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.sheet h2 { margin-bottom: 14px; font-family: var(--serif); font-size: 21px; font-weight: 700; }

/* Danh sách tính năng: ô vuông đánh dấu */
.checklist { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.checklist li { position: relative; padding-left: 34px; font-size: 14.5px; color: var(--ink-2); }
.checklist li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border: 1.5px solid var(--ink-3); border-radius: 3px; background: var(--card); }
.checklist li::after { content: "✓"; position: absolute; left: 3px; top: -6px; font-family: var(--hand); font-size: 26px; line-height: 1; color: var(--green); }

/* Bảng thông số có dấu chấm dẫn */
.specs { display: grid; gap: 10px; margin: 0; font-size: 14.5px; }
.specs div { display: flex; align-items: baseline; gap: 8px; }
.specs dt { color: var(--ink-3); white-space: nowrap; }
.specs div::after { content: none; }
.specs .dots { flex: 1; min-width: 12px; border-bottom: 1.5px dotted var(--line-2); transform: translateY(-4px); }
.specs dd { margin: 0; font-weight: 600; text-align: right; }
.specs dd .rate { font-size: 14.5px; }

/* Có gì mới ở phiên bản hiện tại (dưới bảng thông số) */
.whatsnew { margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed var(--line-2); }
.whatsnew h3 { margin-bottom: 10px; font-family: var(--serif); font-size: 16px; font-weight: 700; }
.changes { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.changes li { position: relative; padding-left: 18px; }
.changes li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.changes li.chg--fix::before { background: var(--amber); }

/* Các bước mua: số khoanh tròn */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-left: 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 34px; height: 34px; font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--red); border: 2px solid var(--red); border-radius: 50%; }
.steps b { display: block; font-size: 15px; }
.steps span { font-size: 13.5px; color: var(--ink-2); }

/* Phiếu mua (hoá đơn răng cưa) */
.slip {
  --z: 8px;
  position: relative; padding: 24px 22px calc(26px + var(--z)); background: var(--card); filter: drop-shadow(0 14px 18px rgba(27, 42, 74, .16));
}
.slip__paper {
  position: absolute; inset: 0; z-index: -1; background: var(--card);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--z)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--z)) 100%;
}
.slip { background: none; isolation: isolate; }
.slip__head { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1.5px dashed var(--line-2); }
.slip__price { padding: 16px 0 14px; border-bottom: 1.5px dashed var(--line-2); }
.slip__price b { display: block; font-family: var(--serif); font-size: 38px; font-weight: 700; line-height: 1.1; }
.slip__price b.is-free { color: var(--green); }
.slip__price small { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.slip__old { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); }
.slip__old em { font-style: normal; font-weight: 700; color: var(--red); }
.slip form { display: grid; gap: 10px; margin-top: 16px; }
.slip label span { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.slip input { width: 100%; height: 44px; padding: 0 2px; font-size: 15px; background: transparent; border: 0; border-bottom: 2px solid var(--ink-3); outline: 0; transition: border-color .2s; }
.slip input::placeholder { color: var(--ink-3); }
.slip input:focus { border-color: var(--office); }
.slip input.is-error { border-color: var(--red); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.slip .btn { width: 100%; }
.slip > .btn { margin-top: 14px; }
.slip form + .btn { margin-top: 10px; }
.btn--dl { background: var(--card); color: var(--green); border: 1.5px solid color-mix(in srgb, var(--green) 55%, transparent); }
.btn--dl:hover { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--card)); }
.slip__notes { display: grid; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.slip__notes li { position: relative; padding-left: 18px; }
.slip__notes li::before { content: "–"; position: absolute; left: 2px; color: var(--ink-3); }

/* Hướng dẫn SmartScreen: giấy nhớ xanh */
.memo { position: relative; padding: 22px 20px 18px; background: #dcebfb; color: #24324d; border-radius: 2px 2px 12px 2px; box-shadow: 0 14px 22px -16px rgba(20, 40, 80, .45); transform: rotate(.6deg); }
.memo::before { content: ""; position: absolute; top: -10px; left: 50%; width: 76px; height: 20px; margin-left: -38px; background: rgba(214, 204, 176, .7); transform: rotate(2deg); }
.memo h3 { font-size: 14.5px; font-weight: 700; line-height: 1.4; }
.memo p { margin-top: 8px; font-size: 13.5px; }
.memo ol { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; display: grid; gap: 4px; }
.memo small { color: #56637d; }
.wbtn { display: inline-block; padding: 0 6px; font: 600 12.5px/1.6 var(--sans); color: #fff; background: #0067b8; border-radius: 3px; }

/* Cùng danh mục */
.related { margin-top: clamp(48px, 6vw, 72px); }
.related h2 { margin-bottom: 18px; font-family: var(--serif); font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; }
.related__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rel { --c: var(--office); display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 0 0 10px 10px; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s; }
.rel[data-cat="edu"] { --c: var(--edu); }
.rel:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.rel b { font-size: 15px; line-height: 1.35; }
.rel small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--ink-2); }
.rel .price { margin-top: auto; }

.missing { max-width: 560px; margin: 40px auto; padding: 36px 28px; text-align: center; background: var(--card); border: 1.5px dashed var(--line-2); border-radius: 12px; }
.missing h1 { font-family: var(--serif); font-size: 28px; }
.missing p { margin: 10px 0 22px; color: var(--ink-2); }

/* Thông báo nhỏ */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 200; translate: -50% 0; display: grid; gap: 10px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 18px; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); animation: toastIn .35s var(--ease) both; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* Tab đang mở trên header */

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .pd { grid-template-columns: 1fr; }
  .pd-side { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .related__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .drawers, .cards, .hm-cols.is-split { grid-template-columns: 1fr; }
  .pd-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .drawer__body { padding: 4px 16px 14px; }
  .drawer__head { flex-wrap: wrap; }
  .drawer__go { margin-left: 58px; }
  .hm-bar { flex-wrap: wrap; }
  .hm-bar .field-line { flex-basis: 100%; }
  .hm-bar .select { flex: 1; }
  .hm-bar .select select { width: 100%; }
  .hm-filter-btn { display: inline-flex; }
  .hm-filters { display: none; }
  .hm-filters.is-open { display: grid; }
  .hm-group__label { width: 100%; }
  .pcard { padding: 16px 38px 16px 16px; gap: 12px; }
  .pcard__go { right: 12px; }
  .pd-side { grid-template-columns: 1fr; }
  .pd-hero { grid-template-columns: 1fr; padding: 22px 18px 18px; }
  .pd-hero .picon { width: 64px; height: 64px; }
  .pd-hero__file { display: none; }
  .sheet { padding: 20px 18px; }
  .related__list { grid-template-columns: 1fr; }
  .shot::before { left: -8px; } .shot::after { right: -8px; }
}

/* =========================================================
   VĂN BẢN (chính sách, điều khoản): tờ giấy đục lỗ, tab chuyển giữa các văn bản
   ========================================================= */
.docs { max-width: 900px; margin: 0 auto; }
.docs .folder__tabs { flex-wrap: wrap; }
.docs .folder__tab { --c: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); border-bottom: 0; font-weight: 600; }
.docs .folder__tab:hover { color: var(--ink); }
.docs .folder__tab.is-active { --c: var(--red); color: var(--ink); }
.legal {
  position: relative; padding: clamp(28px, 5vw, 56px) clamp(22px, 6vw, 72px); background: var(--card);
  border: 1px solid var(--line); border-radius: 0 12px 12px 12px; box-shadow: var(--shadow-lg); line-height: 1.75;
}
/* 3 lỗ đục bên lề trái như giấy kẹp bìa còng */
.legal::before {
  content: ""; position: absolute; left: 14px; top: 90px; bottom: 90px; width: 14px; pointer-events: none;
  background: radial-gradient(circle, var(--paper) 5px, color-mix(in srgb, var(--ink) 18%, transparent) 5.5px, transparent 6.5px) 0 0 / 14px 33.3% repeat-y;
}
.legal h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.01em; }
.legal .lead { margin-top: 12px; font-size: 17px; color: var(--ink-2); }
.legal__meta { display: inline-block; margin-top: 14px; padding: 2px 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: 4px; }
.legal__toc {
  margin-top: 26px; padding: 18px 22px 18px; background-color: var(--card-2); border: 1px solid var(--line); border-radius: 4px;
  background-image: repeating-linear-gradient(transparent 0 27px, var(--ruled) 27px 28px); background-position: 0 48px;
}
.legal__toc b { font-family: var(--serif); font-size: 17px; }
.legal__toc ol { margin: 8px 0 0; padding-left: 22px; columns: 2; column-gap: 32px; font-size: 14.5px; line-height: 28px; }
.legal__toc li { break-inside: avoid; }
.legal__toc li::marker { font-family: var(--serif); font-style: italic; color: var(--office); }
.legal__toc a { color: var(--ink-2); }
.legal__toc a:hover { color: var(--office); text-decoration: underline; text-underline-offset: 3px; }
.legal section { scroll-margin-top: calc(var(--header-h) + 16px); }
.legal h2 { margin-top: 40px; padding-top: 24px; font-family: var(--serif); font-size: 22px; font-weight: 700; border-top: 1.5px dashed var(--line-2); }
.legal h3 { margin-top: 20px; font-size: 16px; font-weight: 700; }
.legal p, .legal li { color: var(--ink-2); font-size: 15.5px; }
.legal p { margin-top: 10px; }
.legal ul, .legal ol.legal__steps { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.legal ul li::marker { color: var(--ink-3); }
.legal b { color: var(--ink); font-weight: 600; }
.legal section a { color: var(--office); text-decoration: underline; text-underline-offset: 3px; }
.legal ol.legal__steps { list-style: none; padding-left: 0; counter-reset: ls; gap: 10px; }
.legal ol.legal__steps li { counter-increment: ls; position: relative; padding-left: 40px; }
.legal ol.legal__steps li::before { content: counter(ls); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 27px; height: 27px; font-family: var(--serif); font-weight: 700; font-size: 14px; color: var(--red); border: 1.5px solid var(--red); border-radius: 50%; }
.legal__notice { padding: 12px 16px; background: color-mix(in srgb, var(--hl) 40%, var(--card)); border-left: 4px solid var(--amber); color: var(--ink) !important; font-weight: 600; }
.legal .note { margin-top: 28px; }
.kv { display: grid; margin-top: 10px; }
.kv > div { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px dotted var(--line-2); }
.kv > div > span { color: var(--ink-3); font-size: 14.5px; }
.kv > div > b, .kv > div > span + b { margin-left: auto; display: flex; align-items: center; gap: 8px; text-align: right; color: var(--ink); font-weight: 600; word-break: break-word; }
.kv .hl { background: none; padding: 0; font-size: 17px; color: var(--ink); }

/* =========================================================
   BIỂU MẪU: kích hoạt offline, lấy lại key, đơn hàng — "phiếu" có răng cưa
   ========================================================= */
.form-page { max-width: 700px; margin: 0 auto; }
.ticket { position: relative; padding: clamp(26px, 5vw, 44px) clamp(20px, 5vw, 44px); background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--office); border-radius: 0 0 12px 12px; box-shadow: var(--shadow-lg); }
.ticket--edu { border-top-color: var(--edu); }
.ticket--red { border-top-color: var(--red); }
.ticket__no { position: absolute; right: 22px; top: 18px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ticket h1 { font-family: var(--serif); font-size: clamp(26px, 4vw, 36px); font-weight: 700; }
.ticket h2 { margin-top: 30px; font-family: var(--serif); font-size: 20px; }
.ticket .lead { margin-top: 10px; color: var(--ink-2); font-size: 16px; }
.steps-mini { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: sm; display: grid; gap: 12px; }
.steps-mini li { counter-increment: sm; position: relative; padding-left: 42px; color: var(--ink-2); font-size: 15px; }
.steps-mini li::before { content: counter(sm); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 28px; height: 28px; font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--red); border: 1.5px solid var(--red); border-radius: 50%; }
.steps-mini b { color: var(--ink); }
.steps-mini a { color: var(--office); text-decoration: underline; text-underline-offset: 3px; }
.field { display: grid; gap: 6px; margin-top: 22px; }
.field > span { font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.field small { color: var(--ink-3); font-size: 13px; }
.input { width: 100%; padding: 10px 2px; font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 2px solid var(--ink-3); border-radius: 0; outline: 0; transition: border-color .2s; }
.input::placeholder { color: color-mix(in srgb, var(--ink-3) 70%, transparent); }
.input:focus { border-color: var(--office); }
.input.is-error { border-color: var(--red); }
textarea.input { min-height: 120px; padding: 12px; resize: vertical; word-break: break-all; line-height: 1.5; border: 1px solid var(--line-2); border-radius: 6px; background: var(--paper-2); }
.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; letter-spacing: .06em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.msg { margin-top: 18px; padding: 11px 14px; font-size: 14.5px; line-height: 1.55; border-left: 4px solid; border-radius: 0 6px 6px 0; }
.msg:empty { display: none; }
.msg--error { color: var(--red); border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--card)); }
.msg--ok { color: var(--green); border-color: var(--green); background: color-mix(in srgb, var(--green) 9%, var(--card)); }
.msg--warn { color: var(--ink); border-color: var(--amber); background: color-mix(in srgb, var(--hl) 35%, var(--card)); }
.msg--proto { color: var(--ink-2); border-color: var(--ink-3); border-left-style: dashed; background: var(--paper-2); }
.note { margin-top: 24px; padding-top: 18px; font-size: 14px; color: var(--ink-3); line-height: 1.65; border-top: 1.5px dashed var(--line-2); }
.note a { color: var(--office); text-decoration: underline; text-underline-offset: 3px; }

/* Đơn hàng */
.status { display: inline-block; margin-top: 14px; }
.status--wait { color: var(--amber); border-color: var(--amber); }
.status--paid { color: var(--green); border-color: var(--green); }
.pay { display: grid; grid-template-columns: 220px 1fr; gap: 26px; margin-top: 24px; align-items: start; }
.pay__qr { padding: 12px; background: #fff; border: 1px solid var(--line-2); border-radius: 6px; }
.pay__qr-demo { display: grid; place-items: center; aspect-ratio: 1; color: #6f7891; font-size: 13px; text-align: center; background: repeating-conic-gradient(#1b2a4a 0 25%, #fff 0 50%) 0 0 / 22px 22px; }
.pay__qr-demo span { padding: 6px 10px; background: #fff; border-radius: 4px; font-weight: 600; }
.copy { flex: none; padding: 3px 9px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 4px; }
.copy:hover { color: var(--ink); border-color: var(--ink-3); }
.bill { display: grid; gap: 4px; margin-top: 24px; padding: 14px 16px; background: var(--paper-2); border-radius: 6px; font-size: 14.5px; }
.bill > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--ink-2); }
.bill > div:last-child { margin-top: 4px; padding-top: 10px; border-top: 1.5px dashed var(--line-2); color: var(--ink); }
.keys { display: grid; gap: 14px; margin-top: 18px; }
.keycard { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 16px 26px; background: var(--paper-2); border: 1.5px dashed var(--line-2); border-radius: 8px; }
.keycard::before { content: "✂"; position: absolute; left: -9px; top: 50%; margin-top: -11px; font-size: 16px; line-height: 22px; color: var(--ink-3); background: var(--card); }
.keycard b { display: block; font-size: 15px; }
.keycard code { display: block; margin-top: 4px; font-size: 17px; color: var(--office); word-break: break-all; }
.keycard__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.demo-switch { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; font-size: 13.5px; color: var(--ink-3); }
.demo-switch a { color: var(--office); text-decoration: underline; text-underline-offset: 3px; }
.ticket .memo { margin-top: 26px; transform: rotate(-.4deg); }

@media (max-width: 640px) {
  .legal::before { display: none; }
  .legal__toc ol { columns: 1; }
  .pay { grid-template-columns: 1fr; }
  .pay__qr { max-width: 240px; }
  .ticket__no { position: static; display: block; margin-bottom: 8px; }
  .docs .folder__tab { padding: 7px 10px 9px; font-size: 12.5px; }
}
