/* site.css — login.archangel.mobi (site nạp riêng). Bootstrap 5 làm nền.
 * Tông SÁNG, đơn giản, không ảnh nền: chữ đậm trên nền xám nhạt, khối trắng viền mảnh,
 * nút vàng (theo mẫu nạp ban đầu), xanh dương cho trạng thái chọn/tiêu điểm.
 * Bố cục: Đăng nhập = 1 khung giữa màn hình; Nạp = tiêu đề -> [1 Nhân vật + 3 Đơn hàng] [2 Gói],
 *         mobile xếp dọc + thanh thanh toán dính đáy. Một giao diện sáng cố định (color-scheme light). */
:root {
  --bg: #f4f6fa;          /* nền trang */
  --card: #ffffff;
  --soft: #f6f8fb;        /* nền phụ trong khối */
  --line: #e6e9f0;
  --line-2: #d5dae4;
  --text: #141a2b;
  --muted: #667085;
  --blue: #2463eb;        /* chọn / tiêu điểm */
  --gold: #fbbf24;        /* nút nạp */
  --gold-2: #f59e0b;
  --gold-edge: #d98700;
  --gold-ink: #3b2400;
  --ruby: #e11d48;        /* thưởng nạp đầu */
  --ok: #16a34a;

  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --top-h: 60px;
  color-scheme: light;
}

@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("../fonts/bvp-vietnamese-400.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("../fonts/bvp-latin-ext-400.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("../fonts/bvp-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url("../fonts/bvp-vietnamese-500.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url("../fonts/bvp-latin-ext-500.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url("../fonts/bvp-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url("../fonts/bvp-vietnamese-600.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url("../fonts/bvp-latin-ext-600.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url("../fonts/bvp-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url("../fonts/bvp-vietnamese-700.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url("../fonts/bvp-latin-ext-700.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url("../fonts/bvp-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- chuyển trang ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: ag-out .18s var(--ease) both; }
::view-transition-new(root) { animation: ag-in .3s var(--ease) both; }
::view-transition-group(agtop) { animation-duration: 0s; }
@keyframes ag-out { to { opacity: 0; } }
@keyframes ag-in { from { opacity: 0; transform: translateY(8px); } }

html { background: var(--bg); }
body.ag {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--f-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  transition: opacity .18s var(--ease);
}
body.ag.is-leaving { opacity: 0; }
.ag a { color: var(--blue); }
.ag-wrap {
  width: 100%; max-width: 1120px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.ag-muted { color: var(--muted); }
.ag-rise { animation: ag-rise .45s calc(var(--d, 0) * 70ms) var(--ease) backwards; }
@keyframes ag-rise { from { opacity: 0; transform: translateY(12px); } }
.ag :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- nút ---------- */
.ag-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-family: var(--f-body); font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), filter .2s, box-shadow .2s, background .2s, opacity .2s;
}
.ag-btn--gold {
  color: var(--gold-ink) !important;
  background: linear-gradient(180deg, #ffd54d, var(--gold) 55%, var(--gold-2));
  border-color: var(--gold-edge);
  box-shadow: 0 2px 0 var(--gold-edge), 0 6px 14px rgba(245, 166, 0, .22);
}
.ag-btn--gold:hover:not(:disabled) { filter: brightness(1.04); }
.ag-btn--gold:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 var(--gold-edge); }
.ag-btn--gold:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.ag-btn--ghost { background: var(--card); color: var(--text) !important; border-color: var(--line-2); }
.ag-btn--ghost:hover { background: var(--soft); }
.ag-btn--icon { width: 48px; padding: 0; flex-shrink: 0; background: var(--card); color: var(--text); border-color: var(--line-2); }
.ag-btn--icon:hover { border-color: var(--blue); color: var(--blue); }
.ag-btn.is-busy { pointer-events: none; }
.ag-btn.is-busy > * { opacity: 0; }
.ag-btn.is-busy::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent; animation: ag-spin .7s linear infinite;
}
@keyframes ag-spin { to { transform: rotate(360deg); } }

.ag-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--card);
  color: var(--text) !important; font-size: .8rem; font-weight: 600; text-decoration: none;
  transition: border-color .2s, background .2s;
}
.ag-chip:hover { border-color: var(--blue); }
.ag-chip__name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-test {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  background: #fff4dc; color: #9a5b00; border: 1px solid #f3d293; font-size: .72rem; font-weight: 700; white-space: nowrap;
}

/* ---------- ô nhập ---------- */
.ag-form { display: grid; gap: 14px; }
.ag-label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 600; color: var(--text); }
.ag-input, .ag-float > .form-control, .ag-float > .form-select {
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background-color: var(--card); color: var(--text);
}
.ag-input { height: 48px; }
.ag-float > .form-control, .ag-float > .form-select { height: 56px; min-height: 56px; }
.ag-float > label { color: var(--muted); }
.ag-input:focus, .ag-float > .form-control:focus, .ag-float > .form-select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36, 99, 235, .12);
}
.ag-float { position: relative; min-width: 0; }
.ag-pass { position: relative; }
.ag-pass .ag-input { padding-right: 46px; }
.ag-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--muted); padding: 8px; border-radius: 8px;
}
.ag-eye:hover, .ag-eye.is-on { color: var(--blue); }

/* ===================== ĐĂNG NHẬP ===================== */
.ag-auth {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: calc(64px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.ag-auth__corner {
  position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 8px;
}
.ag-auth__box {
  width: 100%; max-width: 420px; padding: 28px 24px;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .07);
}
@media (max-width: 400px) { .ag-auth__box { padding: 22px 18px; } }
.ag-logo { display: flex; justify-content: center; margin-bottom: 2px; }
/* logo dạng chữ (không dùng ảnh) */
.ag-word { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; color: var(--text); }
.ag-word b { font-weight: 700; font-size: 1.05rem; letter-spacing: .24em; }
.ag-word small { margin-top: 3px; font-size: .58rem; font-weight: 600; letter-spacing: .5em; color: var(--blue); }
.ag-logo .ag-word b { font-size: 1.35rem; }
.ag-logo .ag-word small { font-size: .66rem; }
.ag-h1 { margin: 0; font-size: 1.45rem; font-weight: 700; text-align: center; letter-spacing: -.01em; }
.ag-auth__sub { margin: -8px 0 4px; font-size: .88rem; text-align: center; text-wrap: balance; }
.ag-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; }
.ag-or::before, .ag-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ag-social { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ag-social__btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card);
  color: var(--text) !important; font-size: .84rem; font-weight: 600; text-decoration: none;
  transition: border-color .2s, background .2s;
}
.ag-social__btn:hover { border-color: var(--blue); background: var(--soft); }
@media (max-width: 360px) { .ag-social__btn span { display: none; } }
.ag-secure { margin: 0 auto; max-width: 420px; text-align: center; color: var(--muted); font-size: .75rem; }
.ag-secure svg { color: var(--ok); vertical-align: -2px; }
.ag-secure--sm { margin-top: 10px; }

/* ===================== THANH TRÊN ===================== */
.ag-top {
  position: sticky; top: 0; z-index: 30; view-transition-name: agtop;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.ag-top__in {
  max-width: 1120px; margin-inline: auto; height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.ag-top__logo { flex-shrink: 0; text-decoration: none; }
.ag-top__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ag-nav { position: relative; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.ag-nav__a {
  position: relative; z-index: 1; padding: 6px 14px; border-radius: 999px;
  color: var(--muted) !important; text-decoration: none; font-weight: 600; font-size: .88rem; white-space: nowrap;
  transition: color .25s;
}
.ag-nav__a.is-on { color: var(--text) !important; }
.ag-nav__ink {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 4px); border-radius: 999px;
  background: var(--card); box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
  transition: transform .35s var(--ease);
}
.ag-nav[data-active="history"] .ag-nav__ink, .ag-nav.is-going-history .ag-nav__ink { transform: translateX(calc(100% + 2px)); }
.ag-nav.is-going-buy .ag-nav__ink { transform: none; }
@media (max-width: 575.98px) {
  .ag-top__in { gap: 8px; }
  .ag-top__logo .ag-word b { font-size: .85rem; letter-spacing: .14em; }
  .ag-top__logo .ag-word small { letter-spacing: .32em; }
  .ag-top .ag-test, .ag-chip__name { display: none; }
  .ag-top__right { gap: 6px; }
  .ag-top .ag-chip { padding: 0 10px; }
  .ag-nav__a { padding: 6px 10px; font-size: .8rem; }
}
@media (max-width: 359.98px) { .ag-top__logo { display: none; } }
.ag-menu { border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 220px; box-shadow: 0 12px 30px rgba(16, 24, 40, .12); }
.ag-menu__head { padding: 8px 10px; font-size: .75rem; color: var(--muted); display: flex; flex-direction: column; }
.ag-menu__head b { color: var(--text); font-size: .9rem; overflow-wrap: anywhere; }
.ag-menu__item { display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 8px 10px; }

.ag-flash { max-width: 1120px; margin: 12px auto 0; padding-inline: max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 8px; }
.ag-auth__box .ag-flash { margin: 0; padding: 0; max-width: none; }
.ag-flash__item { padding: 10px 14px; border-radius: 10px; font-size: .88rem; border: 1px solid; animation: ag-rise .35s var(--ease) backwards; }
.ag-flash__item--danger { background: #fef1f2; border-color: #fbcdd2; color: #b42332; }
.ag-flash__item--warning { background: #fff7e6; border-color: #f7d9a0; color: #92560a; }
.ag-flash__item--success { background: #ecfbf3; border-color: #b6ead0; color: #11734a; }
.ag-flash__item--info { background: #eef4ff; border-color: #c9dafc; color: #1f4fb5; }

/* ===================== TRANG NẠP ===================== */
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 16px; }
.ag-head__title { margin: 0; font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 700; letter-spacing: -.01em; }
.ag-head__sub { margin: 2px 0 0; font-size: .88rem; }
.ag-bonus {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: #fff1f2; color: var(--ruby); border: 1px solid #fecdd3; font-weight: 700; font-size: .82rem;
}
.ag-buy { display: grid; gap: 16px; padding-bottom: 110px; }
@media (min-width: 992px) {
  .ag-buy { grid-template-columns: 340px minmax(0, 1fr); align-items: start; gap: 20px; padding-bottom: 48px; }
  .ag-side { align-self: stretch; align-content: start; }
  .ag-order { position: sticky; top: calc(var(--top-h) + 16px); }
}
.ag-side { display: grid; gap: 16px; min-width: 0; }
.ag-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; min-width: 0; box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
@media (min-width: 576px) { .ag-panel { padding: 20px; } }
.ag-h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.05rem; font-weight: 700; }
.ag-step {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-size: .8rem; font-weight: 700; color: var(--blue); background: #eaf0ff;
}
.ag-empty { margin: 0; padding: 14px; border-radius: var(--r-sm); border: 1px dashed var(--line-2); color: var(--muted); font-size: .86rem; text-align: center; background: var(--soft); }
.ag-hint { margin: 10px 0 0; color: var(--muted); font-size: .82rem; }
.ag-err { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: #fef1f2; border: 1px solid #fbcdd2; color: #b42332; font-size: .86rem; }
.ag-search { display: flex; gap: 8px; }
.ag-search .ag-float { flex: 1; }
.ag-search .ag-btn--icon { min-height: 56px; width: 56px; }

.ag-role {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px;
  border-radius: var(--r-sm); border: 1px solid #b6ead0; background: #f0fbf5;
  animation: ag-pop .3s var(--ease);
}
.ag-role__ico { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.ag-role__txt { min-width: 0; flex: 1; }
.ag-role__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-role__meta { color: var(--muted); font-size: .8rem; }
.ag-role__ok { color: var(--ok); flex-shrink: 0; }
@keyframes ag-pop { from { opacity: 0; transform: scale(.97); } }
.ag-shake { animation: ag-shake .45s var(--ease); }
@keyframes ag-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* đơn hàng */
.ag-order__body { display: none; }
.ag-order[data-state="ready"] .ag-order__empty { display: none; }
.ag-order[data-state="ready"] .ag-order__body { display: block; animation: ag-pop .25s var(--ease); }
.ag-order__pkg { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ag-order__name { font-weight: 700; }
.ag-order__sub { color: var(--muted); font-size: .8rem; }
.ag-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--soft); font-size: .88rem; }
.ag-dl dt { color: var(--muted); font-weight: 500; }
.ag-dl dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ag-order__total { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 0; }
.ag-order__total > span { color: var(--muted); font-size: .88rem; }
.ag-order__total b { font-size: 1.5rem; color: var(--text); font-variant-numeric: tabular-nums; }
.ag-order > .ag-btn { margin-top: 14px; }
@media (max-width: 991.98px) { .ag-order { display: none; } }

/* gói */
.ag-pkgs__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ag-pkgs__head .ag-h2 { margin: 0; }
.ag-filter { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.ag-filter::-webkit-scrollbar { display: none; }
.ag-filter__btn {
  flex-shrink: 0; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--muted); font-weight: 600; font-size: .82rem; transition: all .2s var(--ease);
}
.ag-filter__btn:hover { color: var(--text); border-color: var(--text); }
.ag-filter__btn.is-on { background: var(--text); border-color: var(--text); color: #fff; }
.ag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .ag-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ag-pkg {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  padding: 34px 12px 12px; border-radius: 14px; text-align: center; color: var(--text);
  background: var(--card); border: 1px solid var(--line);
  transition: transform .2s var(--ease), border-color .2s, box-shadow .25s var(--ease);
  animation: ag-rise .4s calc(var(--i, 0) * 35ms + 120ms) var(--ease) backwards;
}
.ag-pkg:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 10px 24px rgba(16, 24, 40, .08); }
.ag-pkg:active:not(:disabled) { transform: translateY(-1px) scale(.985); }
.ag-pkg:disabled { opacity: .5; cursor: not-allowed; }
.ag-pkg.is-picked { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 99, 235, .15); }
.ag-pkg.is-hidden { display: none; }
.ag-pkg.is-in { animation: ag-pop .28s var(--ease); }
.ag-pkg__name { margin-top: 0; font-weight: 700; font-size: .95rem; line-height: 1.25; text-wrap: balance; }
.ag-pkg__line { margin-top: 2px; color: var(--ruby); font-size: .76rem; font-weight: 600; line-height: 1.3; }
.ag-pkg__line--soft { color: var(--muted); font-weight: 500; }
.ag-pkg__price {
  margin-top: auto; width: 100%; padding: 8px 0; border-radius: 9px;
  background: linear-gradient(180deg, #ffd54d, var(--gold) 55%, var(--gold-2)); border: 1px solid var(--gold-edge);
  color: var(--gold-ink); font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums;
}
.ag-pkg__line + .ag-pkg__price, .ag-pkg__name + .ag-pkg__price { margin-top: auto; }
.ag-pkg > .ag-pkg__line:last-of-type { margin-bottom: 10px; }
.ag-pkg__price small { font-size: .68rem; font-weight: 700; opacity: .75; }
.ag-pkg__bonus {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 6px;
  background: var(--ruby); color: #fff; font-size: .72rem; font-weight: 800;
}
.ag-pkg__check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--blue); color: #fff;
  transform: scale(0); transition: transform .22s var(--ease);
}
.ag-pkg.is-picked .ag-pkg__check { transform: scale(1); }

/* thanh dính đáy (mobile) */
.ag-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(16, 24, 40, .08);
  transform: translateY(110%); visibility: hidden; transition: transform .35s var(--ease), visibility 0s linear .35s;
}
.ag-dock.is-on { transform: none; visibility: visible; transition: transform .35s var(--ease), visibility 0s; }
.ag-dock img { flex-shrink: 0; }
.ag-dock__txt { flex: 1; min-width: 0; }
.ag-dock__name { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-dock__sub { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-dock .ag-btn { min-height: 44px; padding: 0 16px; font-variant-numeric: tabular-nums; }
@media (min-width: 992px) { .ag-dock { display: none; } }

/* ===================== LỊCH SỬ / KẾT QUẢ ===================== */
.ag-page { padding-top: 22px; padding-bottom: 48px; max-width: 820px; }
.ag-page--center { max-width: 500px; }
.ag-hist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ag-hist__row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  animation: ag-rise .35s calc(var(--i, 0) * 35ms) var(--ease) backwards;
}
.ag-hist__row img { flex-shrink: 0; }
.ag-hist__main { flex: 1 1 0; min-width: 0; }
.ag-hist__name { font-weight: 700; }
.ag-hist__meta { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-hist__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.ag-hist__amt { font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  .ag-hist__row { flex-wrap: wrap; }
  .ag-hist__main { flex-basis: 100%; }
  .ag-hist__side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
}
.ag-st { padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.ag-st--done { color: #11734a; background: #e6f7ee; }
.ag-st--processing, .ag-st--waiting { color: #92560a; background: #fff3dc; }
.ag-st--failed, .ag-st--refunded { color: #b42332; background: #fdecee; }
.ag-st--expired { color: var(--muted); background: var(--soft); }
.ag-blank { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 12px; text-align: center; color: var(--muted); }
.ag-blank p { margin: 0; }

.ag-result { text-align: center; }
.ag-result__art { position: relative; width: 64px; height: 64px; margin: 4px auto 12px; }
.ag-result__badge {
  position: absolute; inset: 0; border-radius: 50%;
  display: grid; place-items: center; background: #fff7e6; border: 2px solid #f3b23c; color: #f3b23c;
}
.ag-result__i { position: absolute; width: 32px; height: 32px; opacity: 0; }
.ag-result[data-state="waiting"] .ag-result__i--wait, .ag-result[data-state="processing"] .ag-result__i--wait { opacity: 1; animation: ag-spin 1s linear infinite; }
.ag-result[data-state="done"] .ag-result__badge { border-color: var(--ok); color: var(--ok); background: #ecfbf3; }
.ag-result[data-state="done"] .ag-result__i--ok { opacity: 1; }
.ag-result[data-state="done"] .ag-result__i--ok path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: ag-draw .45s .1s var(--ease) forwards; }
.ag-result[data-state="failed"] .ag-result__badge, .ag-result[data-state="expired"] .ag-result__badge,
.ag-result[data-state="refunded"] .ag-result__badge { border-color: var(--ruby); color: var(--ruby); background: #fef1f2; }
.ag-result[data-state="failed"] .ag-result__i--bad, .ag-result[data-state="expired"] .ag-result__i--bad,
.ag-result[data-state="refunded"] .ag-result__i--bad { opacity: 1; }
@keyframes ag-draw { to { stroke-dashoffset: 0; } }
.ag-result__title { font-size: 1.4rem; font-weight: 700; margin: 0 0 6px; text-wrap: balance; }
.ag-result__sub { max-width: 38ch; margin: 0 auto 18px; font-size: .9rem; }
.ag-result .ag-dl { text-align: left; }
.ag-result__actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 18px; }
.ag-copy { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: right; }
.ag-copy span { overflow-wrap: anywhere; }
.ag-copy svg { color: var(--muted); flex-shrink: 0; }

/* ---------- toast ---------- */
.ag-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  max-width: min(92vw, 420px); padding: 10px 16px; border-radius: 10px; text-align: center; font-size: .88rem;
  background: var(--text); color: #fff; box-shadow: 0 12px 30px rgba(16, 24, 40, .2);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: all .25s var(--ease);
}
.ag-toast.is-on { transform: translate(-50%, 0); opacity: 1; }
body.has-dock .ag-toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
