/* ---------- Account page (opened from "THÊM" / button-add-account) ---------- */
.acct-page {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; flex-direction: column;
  background: #f2f4f8;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 180ms ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.acct-page.open { opacity: 1; pointer-events: auto; visibility: visible; }

.acct-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 10px;
  background: linear-gradient(180deg, #0b74f0 0%, #0a6ceb 100%);
  color: #fff;
}
.acct-icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 10px;
  padding: 0;
}
.acct-icon-btn:active { background: rgba(255, 255, 255, 0.14); }
.acct-icon-btn svg { width: 22px; height: 22px; }
.acct-title { font-size: 19px; font-weight: 700; letter-spacing: 0.2px; margin: 0; }

.acct-blue {
  background: linear-gradient(180deg, #0b70ef 0%, #0a63e4 100%);
  padding: 0 0 18px;
}
.acct-balance-card {
  margin: 6px 12px 0;
  background: linear-gradient(135deg, #0a63e6 0%, #0b72f5 55%, #0a6ae8 100%);
  border-radius: 18px;
  padding: 16px 18px 14px;
  box-shadow: 0 10px 24px rgba(6, 80, 190, 0.28);
}
.acct-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.acct-label { font-size: 13px; color: rgba(255, 255, 255, 0.78); margin: 0 0 4px; }
.acct-amount { font-size: 30px; font-weight: 700; color: #fff; line-height: 1.1; letter-spacing: 0.2px; margin: 0; }
.acct-currency { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 17px; font-weight: 600; letter-spacing: 0.4px; }
.acct-cur-badge {
  width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff;
}
.acct-cur-badge.khr { background: #e01b1b; }
.acct-cur-badge.usd { background: #1aa64b; }

.acct-swap {
  position: relative; height: 26px; margin: 10px 0 8px;
  display: flex; align-items: center; justify-content: center;
}
.acct-swap::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}
.acct-swap-ico {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: transparent;
}
.acct-swap-ico svg { width: 20px; height: 20px; }

.acct-sheet {
  flex: 1;
  background: #fff;
  border-radius: 22px 22px 0 0;
  margin-top: -2px;
  padding: 18px 14px 32px;
  min-height: 62vh;
}
.acct-sheet-title { margin: 2px 4px 14px; font-size: 20px; font-weight: 700; color: #14181f; letter-spacing: 0.2px; }

.acct-list { display: flex; flex-direction: column; gap: 12px; }

.acct-item {
  position: relative;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px 16px;
  border-radius: 16px;
  background: linear-gradient(120deg, #ffffff 0%, #ffffff 62%, #f4f8ff 100%);
  box-shadow: 0 3px 12px rgba(18, 41, 84, 0.08);
  overflow: hidden;
}
.acct-item::after {
  content: ""; position: absolute; right: -26px; top: -18px; width: 150px; height: 150px;
  background:
    radial-gradient(ellipse at 46% 18%, rgba(10, 110, 240, 0.055) 0 14%, transparent 15%),
    radial-gradient(ellipse at 62% 48%, rgba(10, 110, 240, 0.045) 0 16%, transparent 17%),
    radial-gradient(ellipse at 30% 62%, rgba(10, 110, 240, 0.04) 0 18%, transparent 19%);
  pointer-events: none;
}
.acct-badge {
  display: inline-flex; align-items: center;
  margin: 0 0 6px; padding: 3px 9px;
  font-size: 11px; font-weight: 600; color: #0e7a4e;
  background: #d8f2e2; border-radius: 999px;
}
.acct-name { margin: 0 0 2px; font-size: 15px; font-weight: 700; color: #12161d; letter-spacing: 0.2px; }
.acct-number { margin: 0 0 8px; font-size: 13px; color: #6a7385; letter-spacing: 0.3px; }
.acct-bal { margin: 0; font-size: 16px; font-weight: 700; color: #12161d; }
.acct-bal span { font-size: 13px; font-weight: 600; color: #39424f; letter-spacing: 0.3px; }

.acct-copy {
  position: relative; z-index: 1;
  flex: 0 0 auto; width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: #0a66e8; border-radius: 10px; cursor: pointer;
  padding: 0; margin-top: 12px;
}
.acct-copy:active { background: #eaf2ff; }
.acct-copy svg { width: 19px; height: 19px; }

.acct-toast {
  position: fixed; left: 50%; bottom: 42px; transform: translate(-50%, 8px);
  background: rgba(12, 18, 30, 0.9); color: #fff;
  font-size: 13px; padding: 9px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease;
  z-index: 10002;
}
.acct-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 380px) {
  .acct-amount { font-size: 27px; }
  .acct-sheet-title { font-size: 18px; }
}

/* ---------- add account ---------- */
.acct-sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 4px 14px; }
.acct-add {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 13px 0 9px; border-radius: 999px; border: 0;
  background: #e9f1ff; color: #0a66e8; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.acct-add:active { background: #dbe8ff; }
.acct-add svg { width: 15px; height: 15px; }

.acct-form { margin: 6px 2px 0; }
.acct-form-title { margin: 6px 2px 16px; font-size: 17px; font-weight: 700; color: #12161d; }
.acct-field { display: block; margin-bottom: 14px; }
.acct-field > span { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #6a7385; }
.acct-field input {
  width: 100%; height: 46px; border-radius: 12px; border: 1px solid #dde4ef;
  background: #fff; padding: 0 14px; font-size: 15px; color: #12161d;
  font-family: inherit; outline: none; box-sizing: border-box;
}
.acct-field input:focus { border-color: #0a66e8; box-shadow: 0 0 0 3px rgba(10, 102, 232, 0.12); }
.acct-seg { display: flex; gap: 8px; }
.acct-seg button {
  flex: 1; height: 44px; border-radius: 12px; border: 1px solid #dde4ef;
  background: #fff; font-size: 14px; font-weight: 600; color: #4b5567;
  font-family: inherit; cursor: pointer;
}
.acct-seg button.on { border-color: #0a66e8; background: #eaf2ff; color: #0a66e8; }
.acct-form-err { margin: 0 0 8px; min-height: 16px; font-size: 13px; color: #c2413a; }
.acct-form-actions { display: flex; gap: 10px; margin-top: 6px; }
.acct-btn { flex: 1; height: 50px; border-radius: 14px; border: 0; font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; }
.acct-btn.ghost { background: #f0f3f9; color: #39424f; }
.acct-btn.primary { background: linear-gradient(180deg, #0b74f0, #0a62e0); color: #fff; box-shadow: 0 6px 16px rgba(10, 100, 230, 0.25); }
.acct-btn.primary[disabled] { opacity: 0.6; }

/* ---------- account detail (transactions) ---------- */
.acd-page {
  position: fixed; inset: 0; z-index: 10003;
  display: flex; flex-direction: column;
  background: #f4f6fa; overflow-y: auto;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 180ms ease;
  -webkit-overflow-scrolling: touch;
}
.acd-page.open { opacity: 1; pointer-events: auto; visibility: visible; }

.acd-header {
  position: relative; z-index: 3; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 10px; color: #fff;
  background: linear-gradient(180deg, #0b74f0 0%, #0a6ceb 100%);
}
.acd-icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 10px; padding: 0;
}
.acd-icon-btn:active { background: rgba(255, 255, 255, 0.14); }
.acd-icon-btn svg { width: 22px; height: 22px; }
.acd-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }

.acd-hero {
  position: relative; flex: 0 0 auto;
  margin-top: -56px; padding: 78px 16px 26px;
  background: linear-gradient(180deg, #0b74f0 0%, #0a6be9 100%);
  border-radius: 0 0 28px 28px;
  text-align: center;
  overflow: hidden;
}
.acd-hero::after {
  content: ""; position: absolute; right: -30px; top: 40px; width: 220px; height: 220px;
  background:
    radial-gradient(ellipse 44% 22% at 50% 30%, rgba(255, 255, 255, 0.07) 0 60%, transparent 62%),
    radial-gradient(ellipse 40% 20% at 44% 62%, rgba(255, 255, 255, 0.06) 0 60%, transparent 62%);
  transform: rotate(-24deg); pointer-events: none;
}
.acd-pill-wrap { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.acd-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px 0 16px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16); color: #fff;
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  max-width: 84vw;
}
.acd-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acd-pill svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: 0.9; }
.acd-menu {
  position: fixed; top: 120px; left: 16px;
  width: min(330px, 90vw); padding: 6px;
  z-index: 10006;
  background: #fff; border-radius: 14px;
  box-shadow: 0 14px 34px rgba(6, 30, 70, 0.22);
  display: flex; flex-direction: column; gap: 2px;
}
.acd-menu[hidden] { display: none; }
.acd-menu button {
  border: 0; background: transparent; text-align: left;
  padding: 11px 12px; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-family: inherit; color: #1b2230;
}
.acd-menu button small { display: block; margin-top: 2px; font-size: 11.5px; color: #8a93a5; }
.acd-menu button:active { background: #eef4ff; }
.acd-menu button.on { background: #eaf2ff; color: #0a66e8; font-weight: 600; }

.acd-balance {
  position: relative; z-index: 2;
  margin: 16px 0 0; font-size: 33px; font-weight: 700; color: #fff; letter-spacing: 0.4px;
}
.acd-balance small { font-size: 17px; font-weight: 700; margin-left: 6px; letter-spacing: 0.6px; }

.acd-body { flex: 1 0 auto; padding: 18px 16px 96px; }
.acd-body-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.acd-section-title {
  margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #5c6675;
}
.acd-more {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: transparent; color: #d0453f;
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; padding: 4px 0;
}
.acd-more svg { width: 15px; height: 15px; }

.acd-list { list-style: none; margin: 0; padding: 0; }
.acd-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 2px 15px; border-bottom: 1px solid #e8ecf3;
}
.acd-avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: #e8f0fd; color: #0a4fb4;
  font-size: 10px; font-weight: 800; line-height: 1.05; letter-spacing: 0.4px;
}
.acd-avatar em { font-style: normal; font-size: 6.5px; opacity: 0.75; letter-spacing: 0.2px; }
.acd-main { flex: 1; min-width: 0; }
.acd-row-title { margin: 0 0 3px; font-size: 15px; font-weight: 500; color: #1a1f28; line-height: 1.35; }
.acd-row-time { margin: 0; font-size: 12.5px; color: #8a93a5; }
.acd-row-acct { margin: 3px 0 0; font-size: 11.5px; color: #0a66e8; line-height: 1.3; overflow-wrap: anywhere; }
.acd-row-note { margin: 3px 0 0; font-size: 12px; color: #525d70; line-height: 1.35; overflow-wrap: anywhere; }
.acd-row-ref { margin: 2px 0 0; font-size: 10.5px; color: #8a93a5; line-height: 1.3; overflow-wrap: anywhere; }
.acd-amount { flex: 0 0 auto; font-size: 14.5px; font-weight: 600; padding-top: 2px; white-space: nowrap; }
.acd-amount.in { color: #12a150; }
.acd-amount.out { color: #d92d20; }

.acd-empty { margin: 26px 0; text-align: center; font-size: 14px; color: #8a93a5; }
.acd-note { margin: 14px 0 0; text-align: center; font-size: 11.5px; color: #9aa3b4; }

.acd-foot {
  position: sticky; bottom: 0; z-index: 4; flex: 0 0 auto;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(244, 246, 250, 0) 0%, #f4f6fa 34%);
}
.acd-export {
  width: 100%; height: 52px; border-radius: 14px;
  border: 1.6px solid #0a66e8; background: #fff; color: #0a66e8;
  font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer;
  box-shadow: 0 6px 18px rgba(10, 100, 230, 0.14);
}
.acd-export:active { background: #eef4ff; }

.acd-toast {
  position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 8px);
  background: rgba(12, 18, 30, 0.9); color: #fff; font-size: 13px;
  padding: 9px 16px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease; z-index: 10004;
}
.acd-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- individual transaction details ---------- */
.acd-row { cursor: pointer; border-radius: 8px; }
.acd-row:hover { background: rgba(10, 102, 232, 0.045); }
.acd-row:focus-visible { outline: 2px solid #0a66e8; outline-offset: 2px; }

.txd-page {
  position: fixed; inset: 0; z-index: 10005;
  display: flex; flex-direction: column;
  background: #f4f6fa; overflow-y: auto;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 180ms ease;
  -webkit-overflow-scrolling: touch;
}
.txd-page.open { opacity: 1; pointer-events: auto; visibility: visible; }
.txd-header {
  position: sticky; top: 0; z-index: 2; flex: 0 0 56px;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 10px; color: #fff;
  background: linear-gradient(180deg, #0b74f0 0%, #0a6ceb 100%);
}
.txd-icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 10px; padding: 0;
}
.txd-icon-btn svg { width: 22px; height: 22px; }
.txd-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }
.txd-header-space { width: 40px; }
.txd-content { width: min(100%, 720px); margin: 0 auto; padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); }
.txd-summary { padding: 8px 2px 24px; }
.txd-label { margin: 0 0 7px; color: #7b8493; font-size: 14px; }
.txd-summary .txd-label {
  margin-bottom: 10px; color: #0a66e8; font-size: 13px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
}
.txd-amount { margin: 0; color: #e0211a; font-size: clamp(30px, 7.5vw, 38px); font-weight: 700; letter-spacing: 0.2px; overflow-wrap: anywhere; }
.txd-amount.in { color: #159447; }
.txd-parties, .txd-info {
  background: #fff; border-radius: 18px; box-shadow: 0 5px 18px rgba(25, 42, 70, 0.04);
}
.txd-parties { margin-bottom: 16px; padding: 8px 16px; }
.txd-party { display: flex; align-items: center; gap: 16px; min-height: 112px; }
.txd-party + .txd-party { border-top: 1px solid #edf0f5; }
.txd-mark {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #1379f3, #173bc4); color: #fff;
  font-size: 14px; font-weight: 800; line-height: 1;
  overflow: hidden;
}
.txd-mark small { margin-top: 3px; font-size: 8px; font-weight: 500; }
.txd-mark.has-logo { background: #fff; border: 1px solid #e6ebf3; padding: 3px; border-radius: 12px; }
.txd-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.txd-bank-tile {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 3px; text-align: center;
  font-size: 9px; font-weight: 700; line-height: 1.15; letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.txd-bank-tile.wing { background: #00b14f; color: #fff; }
.txd-bank-tile.maybank { background: #f5bd22; color: #1c1c1c; }
.txd-bank-tile.generic { background: #eef2f9; color: #29405f; }
.txd-party-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.txd-party-copy .txd-label { margin: 0; }
.txd-party-copy strong { color: #171b23; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.txd-party-copy small { color: #747d8b; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.txd-info { padding: 12px 18px; }
.txd-info-row {
  min-height: 62px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; border-bottom: 1px solid #f0f2f6; color: #33445f; font-size: 14px;
}
.txd-info-row:last-child { border-bottom: 0; }
.txd-info-row > span:first-child { flex: 0 0 auto; }
.txd-info-row > strong, .txd-external-ref > strong {
  color: #151922; font-size: 14px; font-weight: 600; text-align: right;
  overflow-wrap: anywhere;
}
#txd-status[data-state="success"] { color: #159447; }
#txd-status[data-state="pending"] { color: #bd7c00; }
#txd-status[data-state="failed"] { color: #d92720; }
.txd-external-ref { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.txd-external-ref button {
  flex: 0 0 34px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 9px; background: #eef4ff; color: #0a66e8; cursor: pointer;
}
.txd-external-ref button svg { width: 20px; height: 20px; }
.txd-external-ref button:disabled { opacity: 0.4; cursor: default; }
.txd-description-row { align-items: flex-start; padding: 18px 0; }
.txd-description-row > strong { max-width: 65%; }
.txd-toast { min-height: 20px; margin: 12px 0 0; text-align: center; color: #526174; font-size: 13px; }

.txd-share {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; margin: 10px 0 4px;
  border: 0; border-radius: 15px;
  background: #dfe7fb; color: #1d5be0;
  font-family: inherit; font-size: 18px; font-weight: 700;
  cursor: pointer;
}
.txd-share svg { width: 22px; height: 22px; }
.txd-share:active { background: #d2ddf8; }

@media (max-width: 420px) {
  .txd-content { padding-right: 14px; padding-left: 14px; }
  .txd-party { min-height: 100px; }
  .txd-info { padding-right: 14px; padding-left: 14px; }
  .txd-info-row { gap: 10px; font-size: 13px; }
  .txd-info-row > strong, .txd-external-ref > strong { font-size: 13px; }
}
