/* ============================================================
   Đăng nhập Google + lịch sử luận — style BỔ SUNG cho tai-khoan.js.
   Chỉ thêm selector có tiền tố hh-; dùng lại khung .modal-backdrop/.modal của bản gốc.
   Nút nhà cung cấp theo thiết kế đã duyệt ở bản xem thử (index-test.html).
   ============================================================ */
.hh-providers { display: grid; gap: 10px; margin: 16px 0 6px; }
.hh-provider {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 16px;
  border-radius: 12px; border: 1px solid transparent; font-family: inherit; font-size: 14.5px; font-weight: 600; line-height: 1.2; cursor: pointer;
}
.hh-provider .hh-logo { width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; }
.hh-provider .hh-label { flex: 1; text-align: center; margin-right: 22px; }
.hh-provider.google { background: #ffffff; color: #1f1f1f; border-color: #747775; }
.hh-provider.facebook { background: #1877f2; color: #ffffff; }
.hh-provider.apple { background: #000000; color: #ffffff; border-color: rgba(255, 255, 255, .35); }
.hh-provider:disabled { cursor: not-allowed; opacity: .55; }
.hh-provider.google.is-busy { opacity: .8; cursor: progress; }
.hh-soon { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: rgba(255, 255, 255, .22); }
.hh-login-err { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; color: #f3a6a6; border: 1px solid rgba(240, 138, 138, .45); background: rgba(240, 138, 138, .09); }
html[data-theme="light"] .hh-login-err { color: #b3261e; border-color: rgba(179, 38, 30, .35); background: rgba(179, 38, 30, .06); }
html[data-theme="light"] .hh-provider.apple { border-color: #000000; }

/* lịch sử trong khung hồ sơ */
.history-row.hh-hist { display: flex; align-items: center; gap: 10px; }
.hh-hist-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hh-hist-pre { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-reopen { flex: none; border: 1px solid rgba(217, 189, 124, .45); background: rgba(217, 189, 124, .10); color: var(--gold-2); border-radius: 999px; padding: 5px 12px; font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; cursor: pointer; }
.hh-reopen:hover { background: rgba(217, 189, 124, .18); }
html[data-theme="light"] .hh-reopen { color: #8f6530; border-color: rgba(169, 121, 58, .45); background: rgba(169, 121, 58, .08); }

/* xem lại một bài */
.modal-backdrop .modal.hh-read { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.hh-reopen-banner { margin: 12px 0 6px; padding: 9px 12px; border-radius: 10px; font-size: 13px; color: #90d8cb; border: 1px solid rgba(144, 216, 203, .4); background: rgba(144, 216, 203, .08); }
html[data-theme="light"] .hh-reopen-banner { color: #2c8a7b; border-color: rgba(44, 138, 123, .35); background: rgba(44, 138, 123, .06); }
.hh-read-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.hh-read-cards { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 6px 0 14px; }
.hh-read-cards figure { margin: 0; width: 96px; text-align: center; }
.hh-read-cards img { width: 96px; height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(217, 189, 124, .35); display: block; }
.hh-read-cards img.rev { transform: rotate(180deg); }
.hh-read-cards figcaption { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.hh-read-body h3 { margin: 18px 0 6px; font: 600 20px/1.3 'Cormorant Garamond', serif; color: var(--gold-2); }
.modal-backdrop .modal.hh-read .hh-read-body p { font-size: 15px; line-height: 1.7; color: var(--text); margin: 0 0 12px; }
.hh-read-body blockquote { margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--gold); background: rgba(217, 189, 124, .08); border-radius: 0 10px 10px 0; font: italic 500 17px/1.5 'Cormorant Garamond', serif; color: var(--text); }

/* ---------- Menu gọn trong popup avatar ---------- */
.hh-menu { display: grid; gap: 2px; margin: 8px 0; padding: 6px 0; border-top: 1px solid rgba(225, 204, 160, .14); border-bottom: 1px solid rgba(225, 204, 160, .14); }
.hh-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; font-family: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.hh-menu button:hover, .hh-menu button:focus-visible { background: rgba(217, 189, 124, .10); }
.hh-menu button svg { flex: none; color: var(--gold-2); }
.hh-menu button span { flex: 1; }
.hh-menu button b { font-size: 12.5px; color: var(--gold-2); }

/* ---------- Cửa sổ Hồ sơ / Lịch sử (thứ tự lớp: cửa sổ < xem lại < chia sẻ) ---------- */
.hh-win-backdrop { z-index: 61; }
.hh-read-backdrop { z-index: 62; }
#hnShareModal { z-index: 63; }
.modal-backdrop .modal.hh-win { width: min(760px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.hh-win-body { overflow: auto; min-height: 0; padding-right: 2px; }
.hh-card { margin-top: 12px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
html[data-theme="light"] .hh-card { background: rgba(90, 60, 140, .04); }
.hh-pf-head { display: flex; align-items: center; gap: 14px; }
.hh-pf-avatar { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; color: #fff; font-size: 26px; flex: none; }
.hh-pf-name { display: block; font: 600 22px/1.2 'Cormorant Garamond', serif; color: var(--text); }
.hh-pf-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 10px 3px 6px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.hh-note { margin: 10px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.hh-note.small { font-size: 12px; }
.hh-sec { margin: 18px 0 0; font: 600 19px/1.2 'Cormorant Garamond', serif; color: var(--text); }
.hh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.modal-backdrop .modal.hh-win .hh-actions .btn, .modal-backdrop .modal.hh-win .hh-actions .btn-primary { width: auto; margin-top: 0; }
.hh-actions .btn:not(.btn-primary) { color: var(--text); background: transparent; border: 1px solid var(--line); }
.hh-label { display: block; margin: 10px 0 6px; font-size: 12.5px; color: var(--muted); }
.hh-input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; font-size: 14px; }
html[data-theme="light"] .hh-input { background: #fff; }
.hh-av-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.hh-av-pick button { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; color: #fff; font-size: 16px; cursor: pointer; }
.hh-av-pick button[aria-pressed="true"] { border-color: var(--gold); }

/* lịch sử */
.hh-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; }
.hh-filters button { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 5px 12px; border-radius: 999px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.hh-filters button[aria-pressed="true"] { color: var(--gold-2); border-color: rgba(217, 189, 124, .5); background: rgba(217, 189, 124, .10); }
.hh-list { display: grid; gap: 8px; }
.hh-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); }
html[data-theme="light"] .hh-row { background: rgba(90, 60, 140, .03); }
.hh-row-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.hh-row-type { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.hh-row strong { font: 600 17px/1.3 'Cormorant Garamond', serif; color: var(--text); }
.modal-backdrop .modal.hh-win p.hh-row-pre { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hh-row-when { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.hh-chip { padding: 1px 8px; border-radius: 999px; border: 1px solid rgba(217, 189, 124, .45); color: var(--gold-2); background: rgba(217, 189, 124, .08); font-weight: 600; }
.hh-chip.free { color: #90d8cb; border-color: rgba(144, 216, 203, .45); background: rgba(144, 216, 203, .08); }
html[data-theme="light"] .hh-chip { color: #8f6530; }
html[data-theme="light"] .hh-chip.free { color: #2c8a7b; }
.hh-empty { text-align: center; padding: 30px 10px; color: var(--muted); font-size: 13.5px; }
.hh-empty strong { display: block; margin: 6px 0; font: 600 20px/1.2 'Cormorant Garamond', serif; color: var(--text); }
.hh-empty-sigil { font-size: 34px; color: var(--gold); }
.modal-backdrop .modal.hh-win .hh-empty p { font-size: 13px; color: var(--muted); }
.hh-more { display: flex; justify-content: center; margin-top: 8px; }
.hh-more .btn { width: auto; color: var(--text); background: transparent; border: 1px solid var(--line); }
@media (max-width: 560px) {
  .hh-row { flex-direction: column; align-items: stretch; }
  .hh-row .hh-reopen { align-self: flex-start; }
}
/* chữ trong cửa sổ: CSS gốc đặt mọi <p> trong hộp thoại 10px — nâng lại cho dễ đọc */
.modal-backdrop .modal.hh-win p.hh-note { font-size: 13px; line-height: 1.55; }
.modal-backdrop .modal.hh-win p.hh-note.small { font-size: 12px; }
.modal-backdrop .modal.hh-win .hh-actions .btn { font-size: 13px; padding: 10px 16px; }

/* ---------- Lịch sử nạp: chip trạng thái (19/11/2026) ----------
   Thành công = vàng đồng như chip "Đã mở khóa"; Đang xử lý = chấm nhịp; Chưa nhận = xám; Cần hỗ trợ = hồng đậm. */
.hh-chip.hh-st-cho { display: inline-flex; align-items: center; gap: 6px; color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .04); }
.hh-chip.hh-st-cho::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: hhNhip 1.4s ease-in-out infinite; }
.hh-chip.hh-st-het { color: var(--muted); border-color: var(--line); background: transparent; }
.hh-chip.hh-st-loi { color: #f0a3a3; border-color: rgba(240, 163, 163, .45); background: rgba(240, 163, 163, .08); }
html[data-theme="light"] .hh-chip.hh-st-cho { color: var(--text); background: rgba(90, 60, 140, .04); }
html[data-theme="light"] .hh-chip.hh-st-het { color: var(--muted); }
html[data-theme="light"] .hh-chip.hh-st-loi { color: #a3343d; border-color: rgba(163, 52, 61, .4); background: rgba(163, 52, 61, .07); }
.hh-nap-row .hh-row-type { letter-spacing: .06em; }
@keyframes hhNhip { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .hh-chip.hh-st-cho::before { animation: none; } }
/* ghi chú trạng thái nạp là hướng dẫn cần đọc đủ: không cắt 2 dòng như xem trước bài luận */
.modal-backdrop .modal.hh-win .hh-nap-row p.hh-row-pre { display: block; -webkit-line-clamp: unset; overflow: visible; }
.hh-win-body > .hh-note + .hh-list { margin-top: 14px; }
