/**
 * KHU TÀI KHOẢN — /tai-khoan/ + trang con (Ví, Hạng, Giới thiệu, Lịch sử bói).
 * Bố cục "bảng điều khiển": cột trái (hồ sơ, số dư, danh mục có dòng giải
 * thích) + cột phải (nội dung). Không icon/emoji — phân biệt bằng chữ, số,
 * màu vàng nhấn. Kế thừa .tarot-account-* (nút, thẻ, danh sách) từ main.css.
 */

/* ---------- Khung ---------- */
/* main.css đặt overflow-x:hidden cho .tarot-account-page → sticky bị tính theo
   khung đó (cột trái bị đẩy xuống 90px). Mở lại overflow; body đã chặn tràn ngang. */
.tk-page.tarot-account-page { overflow: visible; }
.tk-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.tk-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 0.9rem; }
.tk-content { min-width: 0; }

/* ---------- Cột trái ---------- */
.tk-profile { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--theme-border); background: var(--theme-surface-1); }
/* ---------- Avatar + khung hạng ----------
   .tk-frame-1..4 theo THỨ TỰ hạng trong cấu hình (1 = hạng đầu). Khung là viền
   gradient quanh ảnh; hạng càng cao viền càng dày/sáng. Dùng chung với header. */
.tk-avatar { position: relative; flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; padding: 3px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; background: var(--theme-border-strong); }
.tk-avatar > img { display: block; width: 100% !important; height: 100% !important; max-width: none; border-radius: 50%; object-fit: cover; }
.tk-avatar > span { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 800; color: #0a0a0f; background: linear-gradient(135deg, var(--tarot-gold-light,#e6c18a), var(--tarot-gold,#d4a574)); }
.tk-avatar-lg { width: 96px; height: 96px; padding: 4px; }
.tk-avatar-lg > span { font-size: 2rem; }
.tk-avatar-sm { width: 34px; height: 34px; padding: 2px; }
.tk-avatar-xs { width: 20px; height: 20px; display: inline-block; vertical-align: -4px; margin-right: 0.35rem; }
/* Khung hạng là ẢNH (assets/img/ranks/rank-N.png). Cả 4 ảnh đã chuẩn hoá cùng
   một vòng tròn trong = 66% cạnh ảnh, nên avatar mọi hạng cùng cỡ, cùng tâm;
   phần trang trí (trăng sao, vương miện, kim cương) nằm trong 17% lề. */
.tk-avatar.tk-frame-1, .tk-avatar.tk-frame-2, .tk-avatar.tk-frame-3, .tk-avatar.tk-frame-4 {
    padding: 0;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    box-shadow: none;
}
/* Ảnh đại diện nằm gọn trong vòng tròn của khung (66% cạnh). KHÔNG dùng padding %
   vì phần trăm padding tính theo bề rộng phần tử CHA, không phải chính nó. */
.tk-avatar.tk-frame-1 > img, .tk-avatar.tk-frame-2 > img, .tk-avatar.tk-frame-3 > img, .tk-avatar.tk-frame-4 > img,
.tk-avatar.tk-frame-1 > span, .tk-avatar.tk-frame-2 > span, .tk-avatar.tk-frame-3 > span, .tk-avatar.tk-frame-4 > span {
    width: 66% !important;
    height: 66% !important;
    border-radius: 50%;
}
.tk-frame-1 { background-image: url(../img/ranks/rank-1.png?v=1); }
.tk-frame-2 { background-image: url(../img/ranks/rank-2.png?v=1); }
.tk-frame-3 { background-image: url(../img/ranks/rank-3.png?v=1); }
.tk-frame-4 { background-image: url(../img/ranks/rank-4.png?v=1); }
[data-theme="light"] .tk-frame-2, [data-theme="light"] .tk-frame-4 { filter: drop-shadow(0 0 1px rgba(40, 30, 20, 0.45)); }
/* Cỡ nhỏ TRONG DÒNG CHỮ (ví dụ "Hạng Vàng" ở khối quyền lợi): 20px không đọc được
   hoa văn nên dùng chấm màu theo hạng. Còn ở bảng/danh sách hạng thì hiện KHUNG
   thật, cỡ 46px — xem quy tắc ngay bên dưới. */
.tk-avatar-xs.tk-frame-1 { background: var(--theme-border-strong); }
.tk-avatar-xs.tk-frame-2 { background: conic-gradient(from 200deg, #9aa3ad, #eef1f4, #b9c0c8, #f7f9fb, #9aa3ad); }
.tk-avatar-xs.tk-frame-3 { background: conic-gradient(from 200deg, #b8862b, #ffe9b3, #d4a574, #fff3d0, #b8862b); }
.tk-avatar-xs.tk-frame-4 { background: conic-gradient(from 200deg, #5aa9ff, #e9fbff, #a58cff, #ffffff, #7fe0ff, #5aa9ff); }
.tk-avatar-xs { filter: none !important; }
.tk-profile-text { display: flex; flex-direction: column; min-width: 0; gap: 0.1rem; }
.tk-profile-name { color: var(--theme-text-primary); font-size: 1rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-profile-email { font-size: 0.78rem; color: var(--theme-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-profile-rank { margin-top: 0.25rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--theme-gold-text); text-decoration: none; }

.tk-side-balance { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 0.6rem; padding: 0.85rem 1.1rem; border-radius: 16px; text-decoration: none; border: 1.5px solid var(--theme-border-strong); background: rgba(212,165,116,0.1); }
.tk-side-balance span { font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--theme-text-muted); }
.tk-side-balance strong { grid-row: 2; font-size: 1.35rem; font-weight: 800; color: var(--theme-gold-text); line-height: 1.2; }
.tk-side-balance em { grid-column: 2; grid-row: 1 / 3; font-style: normal; font-size: 0.8rem; font-weight: 700; color: var(--theme-gold-text); white-space: nowrap; }
.tk-side-balance:hover { border-color: var(--theme-gold-text); }

.tk-nav { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.4rem; border-radius: 16px; border: 1px solid var(--theme-border); background: var(--theme-surface-1); }
.tk-nav-item { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.65rem 0.9rem; border-radius: 11px; text-decoration: none; border-left: 3px solid transparent; transition: background 0.2s ease; }
.tk-nav-title { font-weight: 700; font-size: 0.95rem; color: var(--theme-text-primary); }
.tk-nav-desc { font-size: 0.78rem; color: var(--theme-text-muted); line-height: 1.35; }
.tk-nav-item:hover { background: rgba(212,165,116,0.08); }
.tk-nav-item.is-active { background: rgba(212,165,116,0.14); border-left-color: var(--theme-gold-text); }
.tk-nav-item.is-active .tk-nav-title { color: var(--theme-gold-text); }

.tk-side-foot { display: flex; flex-direction: column; gap: 0.5rem; }
.tk-side-foot .tarot-account-btn-primary, .tk-side-foot .tarot-account-btn-ghost { width: 100%; justify-content: center; text-align: center; }

/* ---------- Đầu trang ---------- */
.tk-eyebrow { margin: 0 0 0.15rem; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--theme-text-muted); }
.tk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; margin: 0.2rem 0 1.2rem; }
.tk-title { margin: 0 0 0.4rem; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; color: var(--theme-text-primary); }
.tk-lead { margin: 0; max-width: 940px; color: var(--theme-text-body); line-height: 1.65; }
.tk-lead strong { color: var(--theme-gold-text); }
.tk-head-stats { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tk-head-stats span { padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--theme-border); background: var(--theme-surface-1); font-size: 0.85rem; color: var(--theme-text-muted); }
.tk-head-stats strong { color: var(--theme-gold-text); }
.tk-link { font-size: 0.86rem; font-weight: 700; color: var(--theme-gold-text); text-decoration: none; white-space: nowrap; }
.tk-link:hover { text-decoration: underline; }

/* ---------- Lưới nội dung: chính + phụ ---------- */
.tk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.2rem; align-items: start; }
.tk-main { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.tk-aside { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }

/* ---------- Tổng quan: 3 ô ---------- */
.tk-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.2rem; }
.tk-tile { display: flex; flex-direction: column; gap: 0.25rem; padding: 1.1rem 1.2rem 1.1rem; border-radius: 16px; border: 1px solid var(--theme-border); background: var(--theme-surface-1); text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease; }
.tk-tile:hover { border-color: var(--theme-gold-text); transform: translateY(-2px); }
.tk-tile-cta { margin-top: 0.5rem; font-size: 0.84rem; font-weight: 700; color: var(--theme-gold-text); }
.tk-tile-cta::after { content: " \2192"; }
.tk-tile-label { font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--theme-text-muted); }
.tk-tile-value { font-size: 1.6rem; line-height: 1.15; font-weight: 800; color: var(--theme-gold-text); }
.tk-tile-sub { font-size: 0.84rem; color: var(--theme-text-muted); line-height: 1.45; min-height: 2.5em; }
.tk-tile-bar { height: 5px; border-radius: 999px; background: var(--theme-surface-3); overflow: hidden; margin: 0.2rem 0 0.1rem; }
.tk-tile-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--tarot-gold-light,#e6c18a), var(--tarot-gold,#d4a574)); }
.tk-tile .tarot-account-btn-sm { margin-top: 0.5rem; align-self: flex-start; text-decoration: none; }

/* ---------- Phần phẳng: tiêu đề + nội dung, ngăn bằng đường kẻ ---------- */
.tk-section { padding: 1.4rem 0 0.4rem; border-top: 1px solid var(--theme-border); margin-top: 0.6rem; }
.tk-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.tk-section-head h2 { margin: 0; font-size: 1.15rem; color: var(--theme-text-primary); text-transform: none; letter-spacing: 0; }
.tk-muted { font-size: 0.84rem; color: var(--theme-text-muted); }
.tk-note { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--theme-text-muted); line-height: 1.55; }
.tk-empty { margin: 0 0 0.8rem; color: var(--theme-text-muted); }
.tk-kv { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.tk-kv div { padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--theme-border); }
.tk-kv dt { font-size: 0.82rem; color: var(--theme-text-muted); }
.tk-kv dd { margin: 0.15rem 0 0; font-size: 1.4rem; font-weight: 800; color: var(--theme-gold-text); }
.tk-tx { list-style: none; margin: 0; padding: 0; }
.tk-tx li { display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 0.8rem; padding: 0.65rem 0; border-bottom: 1px dashed var(--theme-border); }
.tk-tx-type { color: var(--theme-text-primary); font-weight: 600; }
.tk-tx-type small { display: block; font-weight: 400; font-size: 0.8rem; color: var(--theme-text-muted); }
.tk-tx-amt { font-weight: 800; text-align: right; white-space: nowrap; }
.tk-tx-amt.is-pos { color: #1f7a45; } .tk-tx-amt.is-neg { color: var(--theme-danger); }
:root:not([data-theme="light"]) .tk-tx-amt.is-pos { color: #6fd39a; }
.tk-tx-meta { grid-column: 1 / -1; font-size: 0.78rem; color: var(--theme-text-faint); }
.tk-balance-pk { font-size: 0.8rem; color: var(--theme-text-muted); line-height: 1.5; text-align: center; }
.tk-balance-how { grid-column: 1 / -1; list-style: none; margin: 0.2rem 0 0; padding: 1rem 0 0; border-top: 1px dashed var(--theme-border); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; counter-reset: how; }
.tk-balance-how li { counter-increment: how; font-size: 0.86rem; color: var(--theme-text-muted); line-height: 1.5; padding-left: 1.9rem; position: relative; }
.tk-balance-how li::before { content: counter(how); position: absolute; left: 0; top: 0.05rem; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; color: #0a0a0f; background: linear-gradient(135deg, var(--tarot-gold-light,#e6c18a), var(--tarot-gold,#d4a574)); }
.tk-balance-how strong { color: var(--theme-text-primary); }
.tk-ranks-table td em { font-style: normal; font-size: 0.74rem; font-weight: 700; color: var(--theme-gold-text); margin-left: 0.3rem; }
.tk-ranks-table tr.is-current td { background: rgba(212,165,116,0.1); }
.tk-ref-box .tk-balance-how { grid-template-columns: 1fr; gap: 0.5rem; margin-top: 1rem; }

/* "Bạn có thể làm gì ở đây" (không còn dùng ở Tổng quan, giữ cho tương lai) */
.tk-can { list-style: none; margin: 0; padding: 0; }
.tk-can li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px dashed var(--theme-border); }
.tk-can li:last-child { border-bottom: none; padding-bottom: 0; }
.tk-can strong { display: block; color: var(--theme-text-primary); margin-bottom: 0.15rem; }
.tk-can p { margin: 0; font-size: 0.87rem; color: var(--theme-text-muted); line-height: 1.5; }
.tk-can a { flex-shrink: 0; padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--theme-border-strong); color: var(--theme-gold-text); font-size: 0.84rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.tk-can a:hover { background: rgba(212,165,116,0.12); }

/* ---------- Ví: khối số dư ---------- */
.tk-balance { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.2rem 2rem; align-items: center; padding: 1.5rem 1.7rem; margin-bottom: 1.2rem; border-radius: 20px; border: 1.5px solid var(--theme-border-strong); background: radial-gradient(circle at 0% 0%, rgba(212,165,116,0.18), transparent 50%), var(--theme-surface-1); }
.tk-balance-main { display: flex; flex-direction: column; gap: 0.25rem; }
.tk-balance-label { font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--theme-text-muted); }
.tk-balance-value { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.05; font-weight: 800; color: var(--theme-gold-text); }
.tk-balance-hint { font-size: 0.9rem; color: var(--theme-text-body); line-height: 1.5; max-width: 420px; }
.tk-balance-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.tk-balance-actions .tarot-account-btn-primary, .tk-balance-actions .tarot-account-btn-secondary { justify-content: center; text-align: center; }
.tk-btn-big { font-size: 1.02rem; padding-top: 0.85rem; padding-bottom: 0.85rem; }
.tk-balance-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 0.2rem 0 0; padding-top: 1rem; border-top: 1px dashed var(--theme-border); }
.tk-balance-stats div { display: flex; flex-direction: column; gap: 0.1rem; }
.tk-balance-stats dt { font-size: 0.76rem; color: var(--theme-text-muted); }
.tk-balance-stats dd { margin: 0; font-weight: 700; color: var(--theme-text-primary); }

/* ---------- Bước hướng dẫn (Ví, Giới thiệu) ---------- */
.tk-how { margin-bottom: 1.2rem; }
.tk-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tk-steps li { padding: 1rem 1rem 0.9rem; border-radius: 14px; border: 1px dashed var(--theme-border-strong); }
.tk-step-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--tarot-gold-light,#e6c18a), var(--tarot-gold,#d4a574)); color: #0a0a0f; font-weight: 800; font-size: 0.82rem; margin-bottom: 0.5rem; }
.tk-steps li > strong { display: block; margin: 0 0 0.35rem; color: var(--theme-text-primary); }
.tk-steps p { margin: 0; font-size: 0.88rem; color: var(--theme-text-muted); line-height: 1.55; }
.tk-steps p strong { color: var(--theme-gold-text); }
.tk-how-note { margin: 0.9rem 0 0; font-size: 0.86rem; color: var(--theme-text-soft); line-height: 1.5; }

/* ---------- Bảng ---------- */
.tk-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tk-table th, .tk-table td { padding: 0.6rem 0.5rem; text-align: left; border-bottom: 1px solid var(--theme-border); color: var(--theme-text-body); vertical-align: top; }
.tk-table th { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--theme-text-muted); font-weight: 700; }
.tk-table td strong { color: var(--theme-text-primary); }
.tk-table td small { color: var(--theme-text-faint); }
.tk-table-total { font-weight: 800; color: var(--theme-gold-text); }
.tk-table .is-current { background: rgba(212,165,116,0.12); color: var(--theme-gold-text); font-weight: 700; }
.tk-tx.tarot-wallet-tx { border-top: none; margin-top: 0; }

/* ---------- FAQ ---------- */
.tk-faq details { border-bottom: 1px dashed var(--theme-border); padding: 0.55rem 0; }
.tk-faq details:last-child { border-bottom: none; }
.tk-faq summary { cursor: pointer; font-weight: 700; color: var(--theme-text-primary); font-size: 0.92rem; list-style: none; position: relative; padding-right: 1.4rem; }
.tk-faq summary::-webkit-details-marker { display: none; }
.tk-faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0; color: var(--theme-gold-text); font-weight: 800; }
.tk-faq details[open] summary::after { content: "−"; }
.tk-faq p { margin: 0.45rem 0 0; font-size: 0.86rem; color: var(--theme-text-muted); line-height: 1.55; }

/* ---------- Hạng ---------- */
.tk-rank-hero { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.4rem; align-items: center; padding: 1.5rem 1.7rem; margin-bottom: 1.2rem; border-radius: 20px; border: 1.5px solid var(--theme-border-strong); background: radial-gradient(circle at 0% 50%, rgba(212,165,116,0.2), transparent 55%), var(--theme-surface-1); }
.tk-rank-badge { width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0.5rem; font-weight: 800; font-size: 1.05rem; line-height: 1.2; color: var(--theme-gold-text); background: rgba(212,165,116,0.14); border: 2px solid var(--theme-border-strong); box-shadow: 0 0 0 8px rgba(212,165,116,0.08); }
.tk-rank-now { margin: 0 0 0.3rem; font-size: 1.3rem; color: var(--theme-text-primary); }
.tk-rank-now strong { color: var(--theme-gold-text); }
.tk-rank-benefit, .tk-rank-next { margin: 0; color: var(--theme-text-body); line-height: 1.55; font-size: 0.95rem; }
.tk-rank-benefit strong, .tk-rank-next strong { color: var(--theme-gold-text); }
.tk-rank-next a { color: var(--theme-gold-text); font-weight: 700; }
.tk-rank-progress { height: 8px; border-radius: 999px; background: var(--theme-surface-3); overflow: hidden; margin: 0.8rem 0 0.45rem; }
.tk-rank-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--tarot-gold-light,#e6c18a), var(--tarot-gold,#d4a574)); }
.tk-rank-actions { margin-top: 0.9rem; }
.tk-ranks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
.tk-rank-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.25rem; padding: 1.4rem 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--theme-border); }
.tk-rank-card.is-passed { opacity: 0.75; }
.tk-rank-card.is-current { border: 2px solid var(--theme-gold-text); background: rgba(212,165,116,0.1); box-shadow: 0 10px 28px rgba(212,165,116,0.18); }
.tk-rank-card-tag { position: absolute; top: -0.7em; left: 50%; transform: translateX(-50%); padding: 0.15rem 0.7rem; border-radius: 999px; background: linear-gradient(135deg, var(--tarot-gold-light,#e6c18a), var(--tarot-gold,#d4a574)); color: #0a0a0f; font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.tk-rank-card-step { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--theme-text-faint); }
.tk-rank-card-name { font-size: 1.2rem; color: var(--theme-text-primary); }
.tk-rank-card.is-current .tk-rank-card-name { color: var(--theme-gold-text); }
.tk-rank-card-min { font-size: 0.8rem; color: var(--theme-text-muted); }
.tk-rank-card-perks { list-style: none; margin: 0.6rem 0 0; padding: 0.6rem 0 0; border-top: 1px dashed var(--theme-border); width: 100%; font-size: 0.84rem; color: var(--theme-text-body); line-height: 1.5; }
.tk-rank-card-perks li + li { margin-top: 0.3rem; }
.tk-rank-card-perks strong { color: var(--theme-gold-text); }

/* ---------- Giới thiệu ---------- */
.tk-ref-box { padding: 1.3rem 1.5rem; margin-bottom: 1.2rem; border-radius: 18px; border: 1.5px dashed var(--theme-border-strong); background: rgba(212,165,116,0.06); }
.tk-ref-label { margin: 0 0 0.6rem; font-weight: 700; color: var(--theme-text-primary); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tk-ref-code { font-size: 0.74rem; font-weight: 700; color: var(--theme-gold-text); padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--theme-border-strong); }
.tk-ref-row { display: flex; gap: 0.6rem; }
.tk-ref-row input { flex: 1; min-width: 0; padding: 0.7rem 0.9rem; border-radius: 12px; border: 1px solid var(--theme-border-strong); background: var(--theme-surface-1); color: var(--theme-text-primary); font-family: inherit; font-size: 0.95rem; }
.tk-ref-share { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.8rem; font-size: 0.86rem; color: var(--theme-text-muted); }
.tk-share-btn { display: inline-flex; align-items: center; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--theme-border-strong); background: transparent; color: var(--theme-text-body); font-family: inherit; font-size: 0.85rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.tk-share-btn:hover { border-color: var(--theme-gold-text); color: var(--theme-gold-text); }
.tk-ref-sample { margin: 0.8rem 0 0; font-size: 0.84rem; color: var(--theme-text-muted); line-height: 1.5; }
.tk-ref-stats { margin: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.tk-ref-stats div { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; padding-bottom: 0.6rem; border-bottom: 1px dashed var(--theme-border); }
.tk-ref-stats dt { font-size: 0.88rem; color: var(--theme-text-muted); }
.tk-ref-stats dd { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--theme-gold-text); }

/* ---------- Chung ---------- */
.tk-page .tarot-account-note a { color: var(--theme-gold-text); font-weight: 600; }
.tk-page .tarot-account-count-pill { text-decoration: none; }

/* ---------- Khách chưa đăng nhập ---------- */
.tk-guest { max-width: 720px; margin: 1rem auto 0; padding: 2rem 1.6rem; text-align: center; border-radius: 20px; border: 1px solid var(--theme-border); background: var(--theme-surface-1); }
.tk-guest h1 { margin: 0 0 0.5rem; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--theme-text-primary); }
.tk-guest-lead { margin: 0 0 1.2rem; color: var(--theme-text-body); }
.tk-guest-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-top: 1.6rem; text-align: left; }
.tk-guest-grid div { padding: 0.9rem 1rem; border-radius: 12px; border: 1px dashed var(--theme-border-strong); }
.tk-guest-grid strong { display: block; color: var(--theme-text-primary); margin-bottom: 0.2rem; }
.tk-guest-grid p { margin: 0; font-size: 0.86rem; color: var(--theme-text-muted); line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .tk-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 1.2rem; }
    .tk-grid { grid-template-columns: 1fr; }
    .tk-ranks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .tk-layout { grid-template-columns: 1fr; }
    .tk-side { position: static; gap: 0.7rem; }
    /* Cột trái thành thanh ngang: danh mục cuộn ngang, ẩn dòng giải thích và nút cuối */
    .tk-profile { padding: 0.8rem 0.9rem; }
    .tk-side-balance { padding: 0.7rem 0.9rem; }
    .tk-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 0.3rem; border-radius: 12px; }
    .tk-nav::-webkit-scrollbar { display: none; }
    .tk-nav-item { flex: 0 0 auto; padding: 0.5rem 0.85rem; border-left: none; border-bottom: 3px solid transparent; border-radius: 9px 9px 4px 4px; }
    .tk-nav-item.is-active { border-left: none; border-bottom-color: var(--theme-gold-text); }
    .tk-nav-desc { display: none; }
    .tk-side-foot { display: none; }
    .tk-tiles { grid-template-columns: 1fr; }
    .tk-steps { grid-template-columns: 1fr; }
    .tk-balance { grid-template-columns: 1fr; padding: 1.2rem 1.1rem; }
    .tk-rank-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 1.3rem 1.1rem; }
    .tk-ref-row { flex-direction: column; }
    .tk-can li { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .tk-balance-how { grid-template-columns: 1fr; }
    .tk-kv { grid-template-columns: 1fr; }
    .tk-table { font-size: 0.82rem; }
    .tk-table th, .tk-table td { padding: 0.5rem 0.35rem; }
    .tk-guest-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .tk-ranks { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    /* bảng hạng: ẩn cột ví dụ giá cho đỡ chật */
    .tk-ranks-table th:last-child, .tk-ranks-table td:last-child { display: none; }
}

/* Combo & lượt đã mua trước, ngày sinh */
.tk-combos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem; }
.tk-combo { display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--theme-border-strong); background: var(--theme-surface-1); }
.tk-combo-name { font-weight: 800; color: var(--theme-text-primary); }
.tk-combo-price { font-size: 1.35rem; font-weight: 800; color: var(--theme-gold-text); }
.tk-combo-price s { font-size: 0.85rem; font-weight: 500; color: var(--theme-text-faint); margin-left: 0.3rem; }
.tk-combo-desc, .tk-combo-items { margin: 0; font-size: 0.84rem; color: var(--theme-text-muted); line-height: 1.5; }
.tk-combo .tarot-account-btn-primary { margin-top: auto; justify-content: center; }
.tk-vouchers { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.tk-vouchers li { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--theme-border); font-size: 0.9rem; }
.tk-vouchers strong { color: var(--theme-gold-text); }
.tk-terms { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--theme-text-muted); line-height: 1.6; }
.tk-bday { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 0.4rem; }
.tk-bday input { padding: 0.45rem 0.7rem; border-radius: 10px; border: 1px solid var(--theme-border-strong); background: var(--theme-surface-1); color: var(--theme-text-primary); font-family: inherit; }

/* Quyền lợi & ưu đãi (Tổng quan) */
.tk-perks { list-style: none; margin: 0; padding: 0; }
.tk-perks li { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 0.4rem 1rem; align-items: center; padding: 0.8rem 0 0.8rem 0.9rem; border-bottom: 1px dashed var(--theme-border); border-left: 3px solid var(--theme-border); }
.tk-perks li.is-on { border-left-color: var(--theme-gold-text); }
.tk-perks li.is-done { border-left-color: #1f7a45; }
.tk-perks li.is-done .tk-perk-value { color: var(--theme-text-muted); }
.tk-perk-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--theme-text-muted); }
.tk-perk-value { color: var(--theme-text-body); line-height: 1.55; font-size: 0.93rem; }
.tk-perk-value strong { color: var(--theme-text-primary); }
.tk-perk-cta { padding: 0.4rem 0.9rem; border-radius: 999px; border: 1px solid var(--theme-border-strong); color: var(--theme-gold-text); font-size: 0.84rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.tk-perk-cta:hover { background: rgba(212,165,116,0.12); }
.tk-perks .tk-bday { margin-top: 0.4rem; display: flex; }
@media (max-width: 760px) {
    .tk-perks li { grid-template-columns: 1fr; }
    .tk-perk-cta { justify-self: start; }
}

/* Bảng gói nạp + máy tính (trang Ví) */
.tk-pk-table-wrap { overflow-x: auto; }
.tk-pk-table td small { color: var(--theme-text-faint); font-weight: 500; }
.tk-pk-table tr.is-best td { background: rgba(31,122,69,0.07); }
.tk-pk-table td em { font-style: normal; font-size: 0.7rem; font-weight: 800; color: #fff; background: #1f7a45; padding: 0.05rem 0.45rem; border-radius: 999px; margin-left: 0.3rem; }
.tk-pk-table tbody tr:hover td { background: rgba(212,165,116,0.1); }
.tk-calc { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: 14px; border: 1px dashed var(--theme-border-strong); }
.tk-calc label { color: var(--theme-text-body); font-size: 0.92rem; }
.tk-calc-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.tk-calc-row input { width: 200px; max-width: 100%; padding: 0.55rem 0.8rem; border-radius: 10px; border: 1px solid var(--theme-border-strong); background: var(--theme-surface-1); color: var(--theme-text-primary); font-family: inherit; font-size: 1rem; }
.tk-calc .tarot-calc { max-width: 520px; }

/* Dải ưu đãi + bảng mốc nạp */
.tk-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.6rem; margin: 0 0 1rem; }
.tk-offer { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.9rem; border-radius: 14px; border: 1.5px solid; background: var(--theme-surface-1); }
.tk-offer > strong { font-size: 1.55rem; line-height: 1; font-weight: 800; white-space: nowrap; }
.tk-offer > span { font-size: 0.8rem; line-height: 1.35; color: var(--theme-text-muted); }
.tk-offer > span b { display: block; font-size: 0.88rem; color: var(--theme-text-primary); }
.tk-offer.is-promo { border-color: rgba(192,57,43,0.45); background: rgba(192,57,43,0.06); }
.tk-offer.is-promo > strong { color: #c0392b; }
.tk-offer.is-first { border-color: rgba(31,122,69,0.45); background: rgba(31,122,69,0.06); }
.tk-offer.is-first > strong { color: #1f7a45; }
.tk-offer.is-rank { border-color: rgba(138,106,31,0.5); background: rgba(212,165,116,0.1); }
.tk-offer.is-rank > strong { color: var(--theme-gold-text); }
:root:not([data-theme="light"]) .tk-offer.is-promo > strong { color: #ff7b6b; }
:root:not([data-theme="light"]) .tk-offer.is-first > strong { color: #6fd39a; }
.tk-pk-table td { vertical-align: middle; }
.tk-pk-table td:first-child, .tk-pk-table td:last-child { white-space: nowrap; }
.tk-pk-range { display: block; font-size: 0.74rem; color: var(--theme-text-faint); font-weight: 500; }
.tk-pk-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tk-pk-chips .tarot-pct.is-first { background: #1f7a45; }
.tk-pk-chips .tarot-pct.is-pack { background: #2d6fa3; }
.tk-pk-total strong { display: block; font-size: 1.1rem; color: var(--theme-gold-text); }
.tk-pk-total .tarot-pct { margin-top: 0.2rem; }
.tk-pk-table td.tk-pk-total em { display: inline-block; margin: 0.2rem 0 0 0.3rem; }
.tk-pk-table tbody tr:hover td { background: transparent; }
.tk-pk-table tr.is-best td { background: rgba(31,122,69,0.07); }
@media (max-width: 700px) {
    .tk-pk-table th, .tk-pk-table td { padding: 0.6rem 0.45rem; }
    .tk-pk-table th:nth-child(2) { white-space: nowrap; }
    .tk-pk-total strong { font-size: 1rem; }
    .tk-pk-table td.tk-pk-total em { margin-left: 0; }
    .tk-offer > strong { font-size: 1.35rem; }
}

/* Ghi chú hạng trong trang Ví */
.tk-wrank { margin: 0 0 1.6rem; padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--theme-border); background: var(--theme-surface-1); }
.tk-wrank-head { display: flex; align-items: center; gap: 0.85rem; }
.tk-wrank-head > div { flex: 1; min-width: 0; }
.tk-wrank-head h2 { margin: 0; font-size: 1.1rem; color: var(--theme-text-primary); }
.tk-wrank-head h2 .tarot-pct { margin-left: 0.3rem; vertical-align: 0.15em; }
.tk-wrank-head p { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--theme-text-body); }
.tk-wrank-link { flex: none; font-size: 0.85rem; font-weight: 700; color: var(--theme-gold-text); text-decoration: none; }
.tk-wrank .tk-rank-progress { margin: 0.8rem 0 0; }
.tk-wrank-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.45rem; margin: 0.9rem 0 0; padding: 0; }
.tk-wrank-steps li { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 0.45rem; align-items: center; padding: 0.5rem 0.6rem; border-radius: 12px; border: 1px solid var(--theme-border); }
.tk-wrank-steps li .tk-avatar { grid-row: 1 / 3; }
.tk-wrank-steps li b { font-size: 0.86rem; white-space: nowrap; }
.tk-wrank-steps li small { grid-column: 2; font-size: 0.72rem; color: var(--theme-text-faint); white-space: nowrap; }
.tk-wrank-steps li em { grid-column: 3; grid-row: 1 / 3; font-style: normal; font-weight: 800; color: var(--theme-gold-text); }
.tk-wrank-steps li.is-current { border-color: var(--theme-gold-text); background: rgba(212,165,116,0.12); }
.tk-wrank-steps li.is-done { opacity: 0.6; }
.tk-wrank .tk-note { margin: 0.8rem 0 0; }
.tk-pk-table td.tk-pk-total .tk-pk-rankup { display: block; width: max-content; margin-top: 0.3rem; }
@media (max-width: 560px) {
    .tk-wrank-head { flex-wrap: wrap; }
    .tk-wrank-link { order: 3; width: 100%; }
    .tk-wrank-steps { grid-template-columns: 1fr 1fr; }
    .tk-wrank-steps li { padding: 0.45rem 0.5rem; column-gap: 0.35rem; }
    .tk-wrank-steps li em { font-size: 0.85rem; }
    .tk-wrank { padding: 0.9rem; }
}
.tk-wrank .tk-wrank-head .tk-avatar-sm { width: 46px; height: 46px; flex: none; }

/* Khối "việc nên làm tiếp" ở Tổng quan + dòng quy ra lượt bói / trấn an ở trang Ví */
.tk-next {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    margin: 0 0 1.4rem; padding: 1.1rem 1.3rem; border-radius: 18px;
    border: 1px solid var(--theme-border-strong); background: var(--gk-soft, var(--theme-surface-1));
}
.tk-next.is-ready { border-color: var(--theme-border); }
.tk-next > div { flex: 1 1 320px; min-width: 0; }
.tk-next .tarot-account-btn-primary { flex: none; }
.tk-next-title { margin: 0; font-size: 1.12rem; font-weight: 600; color: var(--theme-text-primary); }
.tk-next-sub { margin: 0.25rem 0 0; font-size: 0.92rem; color: var(--theme-text-body); }
.tk-balance-turns { display: block; margin-top: 0.15rem; font-size: 0.95rem; font-weight: 600; color: var(--theme-gold-text); }
.tk-balance-trust { margin: 0.5rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--theme-text-muted); max-width: 38rem; }
.tk-rank-body > .tarot-account-btn-primary { margin-top: 0.7rem; display: inline-block; }
@media (max-width: 560px) {
    .tk-next { padding: 0.95rem 1rem; }
    .tk-next .tarot-account-btn-primary { width: 100%; text-align: center; }
}

/* Bảng "Các hạng" + danh sách hạng (trang Ví, trang Bảng giá): hiện KHUNG thật,
   không dùng chấm màu — khách thấy trước mình sẽ được khung nào khi lên hạng. */
.tk-ranks-table td .tk-avatar-xs,
.tk-wrank-steps li .tk-avatar-xs,
.bg-ranks li .tk-avatar-xs {
    width: 46px;
    height: 46px;
    vertical-align: middle;
    margin-right: 0.55rem;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
.tk-ranks-table td .tk-avatar-xs.tk-frame-1,
.tk-wrank-steps li .tk-avatar-xs.tk-frame-1,
.bg-ranks li .tk-avatar-xs.tk-frame-1 { background-image: url(../img/ranks/rank-1.png?v=1); }
.tk-ranks-table td .tk-avatar-xs.tk-frame-2,
.tk-wrank-steps li .tk-avatar-xs.tk-frame-2,
.bg-ranks li .tk-avatar-xs.tk-frame-2 { background-image: url(../img/ranks/rank-2.png?v=1); }
.tk-ranks-table td .tk-avatar-xs.tk-frame-3,
.tk-wrank-steps li .tk-avatar-xs.tk-frame-3,
.bg-ranks li .tk-avatar-xs.tk-frame-3 { background-image: url(../img/ranks/rank-3.png?v=1); }
.tk-ranks-table td .tk-avatar-xs.tk-frame-4,
.tk-wrank-steps li .tk-avatar-xs.tk-frame-4,
.bg-ranks li .tk-avatar-xs.tk-frame-4 { background-image: url(../img/ranks/rank-4.png?v=1); }
.tk-ranks-table td .tk-avatar-xs { margin-right: 0.7rem; }
