/* Tịnh Hạnh · Luận số miễn phí
   Màu, phông và phần đầu trang theo canvas 3D (bản mới nhất):
   giấy #f8f1e8 · giấy đậm #efe3d4 · mực #2b1714 · mực nhạt #6b4d45 · son #983121 · nâu rượu #501f1c · phấn #fbe6da */
:root {
  --giay: #f8f1e8;
  --giay-dam: #efe3d4;
  --o: #fffaf4;
  --muc: #2b1714;
  --muc-nhat: #6b4d45;
  --son: #983121;
  --nau-ruou: #501f1c;
  --phan: #fbe6da;
  --vien: rgba(80, 31, 28, .16);
  --vien-o: #c9b3a0;
  --thanh: #e3d3c2;
  --chu-tieu-de: "Cormorant Garamond", Georgia, serif;
  --chu-hieu: "Bonheur Royale", "Segoe Script", cursive;
  --chu-than: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--giay); color: var(--muc); font-family: var(--chu-than); font-size: 15px; line-height: 1.6; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
a { color: var(--son); }
a:hover { color: var(--nau-ruou); }
:focus-visible { outline: 2px solid var(--son); outline-offset: 2px; }
button, input, textarea { font: inherit; color: inherit; }
.chi-may-tinh { display: none !important; }
@media (min-width: 960px) { .chi-may-tinh { display: flex !important; } .chi-dien-thoai { display: none !important; } }
.an { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Đầu trang ---------- */
.dau { position: sticky; top: 0; z-index: 10; background: rgba(248, 241, 232, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--vien); padding-top: env(safe-area-inset-top, 0px); }
.dau__trong { max-width: 1120px; margin: 0 auto; min-height: 64px; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hieu { display: flex; align-items: center; gap: 10px; color: var(--muc); text-decoration: none; }
.hieu img { display: block; width: auto; height: 46px; flex: none; filter: drop-shadow(0 1px 1px rgba(80, 31, 28, .25)); }
.hieu b { display: block; font: 400 30px/1.1 var(--chu-hieu); color: var(--son); }
.hieu small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--muc-nhat); }
.dau__phai { font-size: 14px; color: var(--muc-nhat); display: none; }

/* ---------- Khung chung ---------- */
.khung { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; display: flex; }
.muc-luc { display: none; }
#man { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Màn câu hỏi ---------- */
.cau { flex: 1; display: flex; flex-direction: column; }
.tien-do { display: flex; align-items: center; gap: 10px; padding: 10px 20px 0 8px; }
.tien-do__lui { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--nau-ruou); background: none; border: 0; border-radius: 10px; cursor: pointer; }
.tien-do__lui[hidden] { display: flex; visibility: hidden; }
.tien-do__thanh { flex: 1; height: 4px; border-radius: 2px; background: var(--thanh); overflow: hidden; }
.tien-do__thanh span { display: block; height: 100%; background: var(--son); transition: width .3s ease; }
.tien-do__so { font-size: 13px; color: var(--muc-nhat); }
.cau__than { flex: 1; padding: 32px 24px 8px; display: flex; flex-direction: column; gap: 14px; }
.cau__hoi { margin: 0; padding: 0; font-family: var(--chu-tieu-de); font-size: 32px; font-weight: 600; line-height: 1.15; color: var(--nau-ruou); }
.cau__hoi--nho { font-size: 28px; }
.cau__vi-sao { margin: 0; color: var(--muc-nhat); font-size: 14px; }
.cau__dan { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--giay-dam); color: var(--nau-ruou); font-size: 13.5px; line-height: 1.55; }
.cau__chan { position: sticky; bottom: 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, rgba(248, 241, 232, 0), var(--giay) 22%); display: flex; flex-direction: column; gap: 6px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

.nut { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; text-align: center; }
.nut--chinh { background: var(--son); color: #fff; }
.nut--chinh:hover { background: var(--nau-ruou); color: #fff; }
.nut--phu { background: var(--o); border-color: var(--vien-o); color: var(--muc); font-weight: 400; }
.nut--chu { min-height: 44px; background: none; color: var(--muc-nhat); font-weight: 400; font-size: 14px; }
.nut[disabled] { opacity: .6; cursor: progress; }

.o { width: 100%; height: 56px; padding: 0 16px; border: 1px solid var(--vien-o); border-radius: 12px; background: var(--o); font-size: 18px; }
.o--to { height: 60px; font-size: 24px; letter-spacing: 3px; }
textarea.o { height: auto; padding: 14px 16px; font-size: 16px; resize: vertical; line-height: 1.55; }
.o.sai { border: 2px solid var(--son); background: #fff; }
.loi { margin: 0; display: flex; align-items: flex-start; gap: 8px; color: var(--son); font-size: 14px; font-weight: 500; line-height: 1.5; }
.loi svg { flex: none; margin-top: 2px; }
.nhac { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--phan); color: var(--son); font-size: 14px; font-weight: 500; }
/* 30/11: nhắc khai số cũ; chừa chỗ cho nút Tiếp ghim đáy */
.nhac--so-cu { display: flex; flex-direction: column; gap: 12px; padding: 14px; scroll-margin-bottom: 112px; }
.nhac--so-cu p { margin: 0; text-wrap: pretty; }
.nhac--so-cu .nut { min-height: 48px; background: var(--o); }
.dem { font-size: 13px; color: var(--muc-nhat); }

/* Nút chọn dạng viên (câu 2) */
.vien-chon { display: flex; flex-wrap: wrap; gap: 8px; }
.vien-chon label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--vien-o); border-radius: 22px; background: var(--o); font-size: 14px; cursor: pointer; }
.vien-chon input { margin: 0; accent-color: var(--son); }
.vien-chon label.chon { background: var(--son); border-color: var(--son); color: #fff; }
.vien-chon label.chon input { accent-color: #fff; }
.vien-chon label.tat { opacity: .45; cursor: not-allowed; }

/* Hàng chọn một (câu 6, 7, số đến thế nào) */
.hang-chon { display: flex; flex-direction: column; gap: 8px; }
.hang-chon label { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; border: 1px solid var(--vien-o); border-radius: 12px; background: var(--o); cursor: pointer; }
.hang-chon input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--son); }
.hang-chon label.chon { border: 1.5px solid var(--son); background: var(--phan); font-weight: 500; }
.hang-chon label.mo { color: var(--muc-nhat); }
.hang-chon.sai label { border-color: var(--son); }

/* Màn chào */
.chao { flex: 1; display: flex; flex-direction: column; }
.chao__than { flex: 1; padding: 44px 24px 8px; display: flex; flex-direction: column; gap: 18px; max-width: 620px; }
.nhan { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--son); }
.chao h1 { margin: 0; font-family: var(--chu-tieu-de); font-size: 38px; font-weight: 600; line-height: 1.12; color: var(--nau-ruou); }
.chao p { margin: 0; color: var(--muc-nhat); }
.chao ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.chao li { display: flex; gap: 12px; align-items: flex-start; }
.chao li svg { flex: none; margin-top: 2px; }

/* Câu 5 · số điện thoại */
.the-so { padding: 18px 16px; border: 1px solid var(--vien); border-radius: 14px; background: var(--o); display: flex; flex-direction: column; gap: 14px; }
.the-so__dau { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.the-so__dau b { color: var(--nau-ruou); }
.the-so__xoa { width: 44px; height: 44px; margin-right: -10px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: none; color: var(--muc-nhat); cursor: pointer; }
.truong { display: flex; flex-direction: column; gap: 6px; }
.truong > label, .truong > legend { font-weight: 500; font-size: 14px; }
.truong legend { margin-bottom: 6px; }
.truong .o { height: 48px; font-size: 16px; border-radius: 10px; background: #fff; }
.ba-o { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ba-o label { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 4px 6px; border: 1px solid var(--vien-o); border-radius: 10px; background: #fff; font-size: 13px; line-height: 1.3; cursor: pointer; }
.ba-o input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ba-o label.chon { background: var(--nau-ruou); border-color: var(--nau-ruou); color: #fff; }
.ba-o label:focus-within { outline: 2px solid var(--son); outline-offset: 2px; }
.hai-nam { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chon-nho { display: flex; flex-direction: column; gap: 2px; }
.chon-nho label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.chon-nho input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--son); }
.them-so { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border: 1.5px dashed var(--son); border-radius: 12px; background: none; color: var(--son); font-weight: 600; cursor: pointer; }
.ghi-chu-nam { padding: 14px 16px; border-radius: 12px; background: var(--phan); color: var(--nau-ruou); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }

/* Câu 10 */
.dong-y { display: flex; align-items: flex-start; gap: 14px; padding: 18px 16px; border: 1.5px solid var(--son); border-radius: 14px; background: var(--o); font-size: 14.5px; line-height: 1.6; cursor: pointer; }
.dong-y input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--son); }
.dong-y.sai { border-width: 2px; background: #fff; }
.con-thieu { padding: 16px; border: 1.5px solid var(--son); border-radius: 14px; background: var(--phan); display: flex; flex-direction: column; gap: 10px; }
.con-thieu > p { margin: 0; display: flex; align-items: flex-start; gap: 8px; color: var(--son); font-weight: 600; }
.con-thieu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--o); color: var(--nau-ruou); font-weight: 500; text-align: left; cursor: pointer; }
.con-thieu button span:last-child { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--son); white-space: nowrap; }

/* ---------- Đang luận ---------- */
.cho { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 24px; text-align: center; }
.cho p { margin: 0; font-family: var(--chu-tieu-de); font-size: 24px; color: var(--nau-ruou); }
.cho__vong { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--thanh); border-top-color: var(--son); animation: xoay 1s linear infinite; }
@keyframes xoay { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cho__vong { animation-duration: 3s; } }

/* ---------- Kết quả ---------- */
.ket { width: 100%; max-width: 720px; margin: 0 auto; padding: 28px 20px 48px; display: flex; flex-direction: column; gap: 22px; line-height: 1.65; }
.ket h1 { margin: 0; font-family: var(--chu-tieu-de); font-size: 32px; font-weight: 600; line-height: 1.15; color: var(--nau-ruou); }
.ket__dan { margin: 0; color: var(--muc-nhat); font-size: 14px; }
.ket__mo { margin: 0; font-family: var(--chu-tieu-de); font-size: 23px; font-weight: 500; line-height: 1.35; color: var(--nau-ruou); }
.ket__mo--phu { font-size: 20px; }
.mo-them { margin: 6px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--phan); color: var(--nau-ruou); font-size: 14px; }
.the { padding: 20px 18px; border: 1px solid var(--vien); border-radius: 16px; background: var(--o); display: flex; flex-direction: column; gap: 14px; animation: hien .5s ease both; }
.the--cho { border: 1.5px solid var(--son); }
@keyframes hien { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .the { animation: none; } }
.the__nhan { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--son); }
.the p { margin: 0; }
.the__hoi { font-weight: 600; color: var(--nau-ruou); }
.the__goi { font-size: 13px; color: var(--muc-nhat); }
.ba-nut { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ba-nut button { min-height: 46px; padding: 0 6px; border: 1px solid var(--vien-o); border-radius: 10px; background: #fff; font-size: 14px; cursor: pointer; }
.ba-nut button[aria-pressed="true"] { background: var(--nau-ruou); border-color: var(--nau-ruou); color: #fff; font-weight: 600; }
/* Thẻ nhiều ý (26/11): mỗi ý một ô tích, 2 nút thống kê */
.the__chung-y { font-weight: 600; color: var(--nau-ruou); }
.the__dan-y { font-size: 14px; color: var(--muc-nhat); }
.cac-y { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cac-y label { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--vien-o); border-radius: 10px; background: #fff; line-height: 1.45; cursor: pointer; }
.cac-y label.tich { border-color: var(--nau-ruou); background: var(--phan); }
.cac-y input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--nau-ruou); cursor: pointer; }
.cac-y label:focus-within { outline: 2px solid var(--son); outline-offset: 2px; }
.hai-nut { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hai-nut button { min-height: 46px; padding: 0 8px; border: 1px solid var(--vien-o); border-radius: 10px; background: #fff; font-size: 14px; cursor: pointer; }
.hai-nut button[aria-pressed="true"] { background: var(--nau-ruou); border-color: var(--nau-ruou); color: #fff; font-weight: 600; }
.hai-nut button[aria-disabled="true"] { color: var(--muc-nhat); opacity: .65; }
.chia-se { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px dashed rgba(80, 31, 28, .2); }
.chia-se label { font-size: 14px; font-weight: 500; }
.chia-se label span { font-weight: 400; color: var(--muc-nhat); }
.chia-se textarea { padding: 10px 12px; border: 1px solid var(--vien-o); border-radius: 10px; background: #fff; font-size: 14px; resize: vertical; }
.chia-se__cam-on { font-size: 13px; font-weight: 500; color: var(--nau-ruou); }
.chia-se__tran-trong { font-size: 12.5px; line-height: 1.55; color: var(--muc-nhat); }
.khoi { padding: 20px 18px; border-radius: 16px; display: flex; flex-direction: column; gap: 10px; }
.khoi--be { background: var(--giay-dam); }
.khoi--o { background: var(--o); border: 1px solid var(--vien); }
.khoi__tieu-de { font-family: var(--chu-tieu-de); font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--nau-ruou); }
.khoi p { margin: 0; }
.khoi textarea { padding: 10px 12px; border: 1px solid var(--vien-o); border-radius: 10px; background: #fff; font-size: 14px; resize: vertical; }
.ket-thuc { padding: 22px 18px; border-radius: 16px; background: var(--nau-ruou); color: var(--phan); display: flex; flex-direction: column; gap: 12px; }
.ket-thuc p { margin: 0; }
.ket-thuc p:first-child { color: #fff; }
.ket-thuc a { display: flex; align-items: center; justify-content: center; min-height: 50px; margin-top: 4px; border-radius: 12px; background: var(--phan); color: var(--nau-ruou); font-weight: 600; text-decoration: none; }
.doc-tay { width: 100%; max-width: 620px; margin: 0 auto; padding: 40px 20px 48px; display: flex; flex-direction: column; gap: 22px; }
.doc-tay__bieu { width: 56px; height: 56px; border-radius: 28px; background: var(--phan); display: flex; align-items: center; justify-content: center; color: var(--son); }
.doc-tay h1 { margin: 0; font-family: var(--chu-tieu-de); font-size: 32px; font-weight: 600; line-height: 1.15; color: var(--nau-ruou); }
.doc-tay p { margin: 0; }
.ghi-nho { font-size: 13px; color: var(--muc-nhat); }

/* ---------- Máy tính ---------- */
@media (min-width: 960px) {
  body { font-size: 16px; }
  .dau__trong { padding: 0 20px; }
  .hieu img { height: 52px; }
  .hieu b { font-size: 34px; }
  .dau__phai { display: block; }
  .khung--form { padding: 48px 20px; gap: 72px; }
  .khung--form .muc-luc { display: flex; flex-direction: column; gap: 22px; width: 340px; flex: none; }
  .muc-luc p { margin: 0; color: var(--muc-nhat); font-size: 15px; }
  .muc-luc ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
  .muc-luc li button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 0 10px; margin: 0 -10px; border: 0; border-radius: 10px; background: none; color: var(--muc-nhat); text-align: left; cursor: default; }
  .muc-luc li button.xong { cursor: pointer; }
  .muc-luc li button.xong:hover { background: var(--giay-dam); }
  .muc-luc li button.dang { background: var(--giay-dam); color: var(--nau-ruou); font-weight: 600; }
  .muc-luc i { width: 24px; height: 24px; flex: none; border-radius: 12px; border: 1px solid var(--vien-o); display: flex; align-items: center; justify-content: center; font-size: 12px; font-style: normal; }
  .muc-luc .xong i { background: var(--son); border-color: var(--son); color: #fff; }
  .muc-luc .dang i { border: 1.5px solid var(--son); color: var(--son); }
  .khung--form #man { max-width: 620px; }
  .tien-do { padding: 0; }
  .tien-do__lui, .tien-do__thanh { display: none !important; }
  .tien-do__so::before { content: "Câu "; }
  .cau__than { padding: 14px 0 8px; }
  .cau__hoi { font-size: 42px; line-height: 1.12; }
  .cau__hoi--nho { font-size: 42px; }
  .cau__chan { position: static; background: none; padding: 22px 0 0; flex-direction: row; }
  .cau__chan .nut--chinh { min-width: 200px; }
  .chao__than { padding: 0; }
  .ket { padding: 56px 20px 72px; gap: 28px; }
  .ket h1 { font-size: 44px; }
  .ket__mo { font-size: 30px; }
  .the { padding: 28px 32px; }
  .ba-nut { display: flex; gap: 10px; }
  .ba-nut button { min-width: 140px; min-height: 48px; padding: 0 18px; }
}
/* Hai lối vào chung một form (19/11): gói đã chọn khi vào từ nút "Đặt gói này" · nút đặt gói ở cuối bản luận miễn phí */
.goi-da-chon { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--giay-dam); font-size: 14px; }
.goi-da-chon b { color: var(--son); }
.ket-thuc a.ket-thuc__dat { background: #e9cf8a; color: #2b1714; }
.ket-thuc a.ket-thuc__dat + a { background: transparent; border: 1px solid var(--phan); color: var(--phan); }
