/* Chainberry BerryDesk — partner demo.
   Visual language mirrored from chainberry-app.vercel.app (shadcn-style):
   white content on a slate sidebar, bordered cards, 10px radius, pastel
   status dots, system font stack, primary #2B7DE7. */

:root {
  --bg: #ffffff;
  --sidebar-bg: #f8fafc;
  --card: #ffffff;
  --line: #e8eaee;
  --line-strong: #d9dee5;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --blue: #2b7de7;
  --blue-dark: #2368c4;
  --blue-soft: #eff5fd;
  --green: #22c55e;
  --green-soft: #ecfdf3;
  --orange: #f59e0b;
  --orange-soft: #fffbeb;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --purple: #6366f1;
  --hover: #f4f6f9;
  --seg: #f1f4f8;
  --ink2: #334155;
  --alert-bg: #fffbeb;
  --alert-line: #fde68a;
  /* pastel status dots (vercel app) */
  --dot-created: #7dd3fc;
  --dot-ok: #86efac;
  --dot-warn: #fcd34d;
  --dot-bad: #fda4af;
  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-pop: 0 10px 38px rgba(15, 23, 42, .16);
  font-size: 15.5px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0f16;
  --sidebar-bg: #0e141d;
  --card: #111722;
  --line: #222b38;
  --line-strong: #333f50;
  --text: #e7eaf1;
  --muted: #98a2b3;
  --faint: #64748b;
  --blue: #5593f0;
  --blue-dark: #7cabf9;
  --blue-soft: #16233c;
  --green-soft: #10241a;
  --orange-soft: #26200f;
  --red-soft: #2a1614;
  --hover: #1a2230;
  --seg: #1c2534;
  --ink2: #c3cad6;
  --alert-bg: #241d10;
  --alert-line: #4d3f1d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-pop: 0 14px 44px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
[data-theme="dark"] .avatar { background: #2b3342; }
[data-theme="dark"] .note.info { color: #a9c1f7; }
[data-theme="dark"] .note.warn { color: #f2ca88; }
[data-theme="dark"] .note.danger { color: #f2a49b; }
[data-theme="dark"] .note.ok { color: #8fdcab; }
[data-theme="dark"] .addr { color: #9db4e8; }
[data-theme="dark"] .pill.green { color: #62d78f; }
[data-theme="dark"] .pill.orange { color: #f0b35c; }
[data-theme="dark"] .pill.red { color: #f1928a; }
[data-theme="dark"] .pill.blue { color: #8fb0ff; }
[data-theme="dark"] .logo img, [data-theme="dark"] .m-logo, [data-theme="dark"] .pw-foot img { filter: brightness(1.35); }
[data-theme="dark"] .tabs button.on, [data-theme="dark"] .seg button.on { box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
input[type=text], input[type=number], input[type=email], select, textarea { background-color: var(--card); color: var(--text); }
input[type=checkbox] { accent-color: var(--blue); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; grid-template-rows: 52px 1fr; height: 100vh; }
.topbar { grid-column: 2; display: flex; align-items: center; gap: 12px; background: var(--bg); border-bottom: 1px solid var(--line); padding: 0 24px; z-index: 30; overflow: visible; }
.sidebar { grid-row: 1 / 3; grid-column: 1; position: relative; background: var(--sidebar-bg); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: visible; padding: 18px 10px 10px; display: flex; flex-direction: column; }
.main { grid-row: 2; grid-column: 2; overflow-y: auto; padding: 22px 30px 60px; background: var(--bg); }
.page { max-width: 1180px; margin: 0 auto; }

/* collapse button on the sidebar edge (vercel-app style) */
.collapse-btn { position: fixed; left: 236px; top: 30px; z-index: 40; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 0; transition: left .15s; }
.collapse-btn:hover { background: var(--hover); }
.collapse-btn svg { width: 12px; height: 12px; }
.app.navmin .collapse-btn { left: 50px; }

/* ---------- topbar ---------- */
.logo { display: flex; align-items: center; padding: 2px 10px 10px; }
.logo img { height: 24px; display: block; }
.topbar .spacer { flex: 1; }
.lang-wrap { position: relative; }
.lang-globe { display: inline-flex; align-items: center; color: var(--muted); line-height: 0; }
.lang-globe svg { width: 15px; height: 15px; }
.lang-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--ink2); font-variant-numeric: tabular-nums; }
.lang-pick { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 9px 0 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow); color: var(--ink2); cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s; }
.lang-pick:hover { background: var(--hover); }
.lang-pick.open { background: var(--hover); border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(43,125,231,.1); }
.lang-chev { width: 10px; height: 10px; color: var(--faint); opacity: .75; transition: transform .15s ease; flex-shrink: 0; margin-left: 1px; }
.lang-pick.open .lang-chev { transform: rotate(180deg); opacity: 1; }
.lang-pop { position: fixed; top: 54px; right: 235px; min-width: 196px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(15,23,42,.14), 0 2px 6px rgba(15,23,42,.06); padding: 5px; z-index: 71; animation: fade-in .12s ease both; }
.lang-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: none; background: none; border-radius: 8px; font-size: 13.5px; font-weight: 450; text-align: left; cursor: pointer; color: var(--ink); transition: background .1s; }
.lang-opt .lang-tag { min-width: 28px; padding: 2px 0; border-radius: 4px; background: var(--seg); color: var(--muted); font-size: 10.5px; }
.lang-opt.on .lang-tag { background: var(--blue-soft); color: var(--blue-dark); }
.lang-opt:hover { background: var(--hover); }
.lang-opt.on { font-weight: 550; color: var(--text); }
.lang-opt .lang-label { flex: 1; min-width: 0; }
.lang-check-ic { width: 15px; height: 15px; color: var(--blue); flex-shrink: 0; }
.iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); color: var(--ink2); box-shadow: var(--shadow); }
.iconbtn:hover { background: var(--hover); }
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn .badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #1e293b; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); border: none; background: transparent; }
.user-chip:hover { background: var(--hover); }
.user-chip .name { font-size: 13px; font-weight: 500; }

/* ---------- sidebar nav ---------- */
.nav-group { margin-bottom: 7px; }
.nav-group h6 { margin: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .09em; color: var(--faint); text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 14.5px; font-weight: 450; color: var(--muted); margin-bottom: 1px; transition: background .12s, color .12s; }
.nav-item:hover { background: var(--seg); color: var(--ink2); text-decoration: none; }
.nav-item.active { background: var(--seg); color: var(--text); font-weight: 550; }
.nav-item.active svg { opacity: 1; color: var(--text); }
a.nav-item { box-sizing: border-box; }
.nav-item .ext { margin-left: auto; color: var(--faint); font-size: 12px; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav-item .nbadge { margin-left: auto; background: var(--blue); color: #fff; border-radius: 8px; font-size: 10px; font-weight: 700; padding: 1px 6px; }
.nav-item .soon { margin-left: auto; background: var(--orange-soft); color: #b45309; border-radius: 6px; font-size: 9.5px; font-weight: 700; padding: 1.5px 6px; letter-spacing: .04em; }
.viewas { margin-top: auto; border-top: 1px solid var(--line); padding: 10px 8px 4px; }
.viewas label { display: block; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 3px 5px; }
.viewas select { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); font-size: 13px; font-weight: 500; }
.viewas .hint { font-size: 10.5px; color: var(--faint); margin: 6px 3px 0; line-height: 1.4; }

/* collapsed sidebar (icons only) */
.app.navmin { grid-template-columns: 62px 1fr; }
.app.navmin .sidebar { padding: 14px 9px 10px; }
.app.navmin .logo { justify-content: center; padding: 0 0 10px; }
.app.navmin .logo img { height: 22px; width: 22px; object-fit: cover; object-position: left; }
.app.navmin .nav-group h6 { display: none; }
.app.navmin .nav-group { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.app.navmin .nav-group:last-of-type { border-bottom: none; }
.app.navmin .nav-item { justify-content: center; padding: 8px 0; gap: 0; }
.app.navmin .nav-item span, .app.navmin .nav-item .ext, .app.navmin .nav-item .soon, .app.navmin .nav-item .nbadge { display: none; }
.app.navmin .viewas { display: none; }

/* ---------- common ---------- */
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.page-head h1 { margin: 0 0 3px; font-size: 23px; font-weight: 650; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card .card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.card .card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card .card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.card .card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card .card-body { padding: 16px 20px 20px; }
.card.flat-top .card-body { padding-top: 10px; }

.btn { display: inline-flex; align-items: center; gap: 7px; border-radius: var(--radius-sm); padding: 7.5px 14px; font-size: 13.5px; font-weight: 500; border: 1px solid transparent; transition: background .12s, box-shadow .12s, transform .06s; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: var(--shadow); }
.btn.primary:hover { background: var(--blue-dark); }
.btn.secondary { background: var(--card); border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }
.btn.secondary:hover { background: var(--hover); border-color: var(--line-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 3px 10px; }
.pill.green { background: var(--green-soft); color: #15803d; }
.pill.orange { background: var(--orange-soft); color: #b45309; }
.pill.red { background: var(--red-soft); color: #b42318; }
.pill.blue { background: var(--blue-soft); color: var(--blue-dark); }
.pill.grey { background: var(--seg); color: var(--muted); }

/* pastel status dots — vercel-app style */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: var(--dot-ok); }
.dot.orange { background: var(--dot-warn); }
.dot.red { background: var(--dot-bad); }
.dot.blue { background: var(--dot-created); }
.dot.grey { background: #cbd5e1; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 450; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10.5px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.tbl .neg { color: var(--red); }
.tbl .pos { color: var(--green); }
.rowlink { color: var(--blue); font-size: 12.5px; font-weight: 500; background: none; border: none; padding: 0; }
.rowlink:hover { text-decoration: underline; }
tr.rowclick { cursor: pointer; }
tr.rowclick td { transition: background .12s ease; }
tr.rowclick:hover td { background: var(--hover); }
tr.rowclick:active td { background: var(--seg); }

/* coin avatar with network badge (vercel-app pattern) */
.coin { display: inline-flex; align-items: center; gap: 10px; }
.cico { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cico.sm { width: 22px; height: 22px; font-size: 11px; }
.cico svg { width: 68%; height: 68%; }
/* real coin icons fetched from CDN fill the circle */
.cico.img { background: #fff; overflow: hidden; }
.cico.img img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; display: block; }
.cico.usdt { background: #26a17b; }
.cico.usdc { background: #2775ca; }
.cico.btc { background: #f7931a; }
.cico.eth { background: #627eea; }
.cico.trx { background: #eb0029; }
.cico.matic { background: #8247e5; }
.cico.ton { background: #0098ea; }
.cico.bnb { background: #f3ba2f; color: #1a1a1a; }
.cico.sol { background: #9945ff; }
.cico.avax { background: #e84142; }
.cico.base { background: #0052ff; }
.enabled-assets { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.enabled-asset { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--seg); }
.enabled-asset .pill { font-size: 11px; padding: 2px 8px; }
.coinav { position: relative; display: inline-flex; flex: none; }
.coinav .netbadge { position: absolute; right: -5px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--card); color: #fff; font-size: 7px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.coinav .netbadge svg { width: 8px; height: 8px; }
.coinav .netbadge.img { background: var(--card); overflow: hidden; }
.coinav .netbadge.img img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.coin .cname { font-weight: 500; font-size: 13.5px; line-height: 1.2; }
.coin .cnet { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }

.addr { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; color: #33507e; }
.copy { border: none; background: none; color: var(--faint); padding: 2px 4px; border-radius: 5px; }
.copy:hover { color: var(--blue); background: var(--blue-soft); }
.copy svg { width: 14px; height: 14px; }

.banner { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 22px; margin-bottom: 16px; }
.banner .lbl { font-size: 12.5px; color: var(--muted); max-width: 130px; line-height: 1.35; }
.banner .val { font-size: 28px; font-weight: 650; letter-spacing: -.02em; }

.note { border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13px; line-height: 1.5; margin: 10px 0; }
.note.info { background: var(--blue-soft); color: #274b9f; }
.note.info.subtle { background: var(--seg); color: var(--ink2); border: 1px solid var(--line); }
.note.warn { background: var(--seg); border: 1px solid var(--line); color: var(--ink2); }
.note.danger { background: var(--seg); border: 1px solid var(--line); color: var(--ink2); }
.note.ok { background: var(--green-soft); color: #166534; }

.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 12.5px; font-weight: 550; color: var(--ink2); margin-bottom: 6px; }
.field input[type=text], .field input[type=number], .field input[type=email], .field select, .field textarea {
  width: 100%; padding: 8.5px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-size: 13.5px; box-shadow: var(--shadow);
}
.field input:focus, .field select:focus { outline: 2px solid #c8d8fb; border-color: var(--blue); }
.field .help { font-size: 12px; color: var(--faint); margin-top: 5px; }
.field input[readonly] { background: var(--seg); color: var(--muted); box-shadow: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.grid2 > .full { grid-column: 1 / 3; }

.tabs { display: inline-flex; background: var(--seg); border-radius: var(--radius-sm); padding: 3px; gap: 2px; margin-bottom: 16px; }
.tabs button { border: none; background: transparent; border-radius: 8px; padding: 6px 15px; font-size: 13px; font-weight: 500; color: var(--muted); }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.09); }

.seg { display: inline-flex; background: var(--seg); border-radius: var(--radius-sm); padding: 3px; }
.seg button { border: none; background: transparent; border-radius: 8px; padding: 5.5px 16px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.09); }

.toggle { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); border: none; transition: background .15s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle.on { background: var(--blue); }
.toggle.on::after { left: 18px; }

.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--seg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 500; color: var(--ink2); }

/* ---------- dashboard widgets ---------- */
.widgets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-height: 118px; display: flex; flex-direction: column; }
.widget.w2 { grid-column: span 2; }
.widget.w4 { grid-column: span 4; }
.widget h4 { margin: 0 0 2px; font-size: 13px; font-weight: 500; color: var(--muted); }
.widget .big { font-size: 27px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; }
.widget .foot { margin-top: auto; font-size: 12.5px; color: var(--faint); padding-top: 8px; }
.widget.alert { border-color: var(--line); background: var(--card); }
[data-theme="dark"] .widget.alert { background: var(--card); }
.threshold-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--ink2); }
.threshold-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 6px; flex: none; }
.widget .rows { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.widget .rows .r { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.widget .rows .r .amt { margin-left: auto; font-weight: 550; text-align: right; }
.widget .rows .r .amt .sub { display: block; font-size: 11px; color: var(--faint); font-weight: 400; }
.riskdist-rows .r span:nth-child(2) { flex: 1; }

/* deposits vs withdrawals chart */
.flowchart { display: flex; gap: 10px; margin-top: 10px; }
.fc-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 10.5px; color: var(--faint); padding: 0 0 22px; min-width: 34px; text-align: right; }
.fc-body { flex: 1; position: relative; min-height: 96px; }
.fc-grid { position: absolute; inset: 0 0 22px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.fc-line { border-top: 1px dashed var(--line); }
.fc-bars { position: relative; display: flex; align-items: flex-end; gap: 8px; height: 96px; padding-bottom: 22px; z-index: 1; }
.fc-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.fc-pair { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 72px; }
.fc-lbl { font-size: 10px; color: var(--faint); text-align: center; margin-top: 5px; }
.bar { width: 45%; max-width: 16px; border-radius: 4px 4px 2px 2px; position: relative; cursor: default; }
.bar.dep { background: var(--blue); opacity: .88; }
.bar.wd { background: #cbd5e1; }
.bar[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; font-size: 10px; padding: 3px 6px; border-radius: 5px; white-space: nowrap; z-index: 5; }
[data-theme="dark"] .bar.wd { background: #3b4b61; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* risk signal bars (neutral, tooltip on hover) */
.risksig { position: relative; display: inline-flex; cursor: default; }
.risksig .rsbars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.risksig .rsbars i { display: block; width: 3px; border-radius: 1px; background: var(--line-strong); }
.risksig .rsbars i:nth-child(1) { height: 5px; }
.risksig .rsbars i:nth-child(2) { height: 9px; }
.risksig .rsbars i:nth-child(3) { height: 13px; }
.risksig .rsbars i.on { background: #94a3b8; }
.risksig.low .rsbars i.on { background: var(--green); }
.risksig.med .rsbars i.on { background: var(--orange); }
.risksig.high .rsbars i.on { background: var(--red); }
.risksig:hover::after, .risksig[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; font-size: 11px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 20; pointer-events: none; }

/* payment type row icons */
.paytype { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.pt-ic { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: var(--seg); color: var(--muted); border: 1px solid var(--line); }
.pt-ic.dep { color: #15803d; }
.pt-ic.wd { color: #b42318; }
.pt-ic.conv { color: var(--blue-dark); }

/* transactions toolbar */
.tx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.tx-search { flex: 1; min-width: 220px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--card); font-size: 14px; box-shadow: var(--shadow); }
.tx-toolbar-mid { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tx-toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tx-pill { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--muted); }
.tx-pill.on { background: var(--seg); color: var(--text); border-color: var(--line-strong); }
.iconbtn.sm { width: 32px; height: 32px; font-size: 16px; }
.thsort { display: inline-flex; align-items: center; gap: 4px; }
.sort-ic { color: var(--faint); font-size: 11px; }
.dtcell { display: block; line-height: 1.35; }
.dtcell .dt-d { display: block; font-size: 13.5px; color: var(--text); }
.dtcell .dt-t { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.tx-tbl td.num b { display: block; }
.tx-tbl .tx-amt b { display: block; font-weight: 600; }
/* keep every cell on a single line — nothing wraps */
.tx-tbl th, .tx-tbl td { white-space: nowrap; }
/* mono value + copy button stay on the same line */
.cell-copy { display: inline-flex; align-items: center; gap: 4px; }
.cell-copy .copy { flex: none; }
/* only the table body scrolls; header stays pinned */
.tx-scroll { max-height: calc(100vh - 330px); min-height: 240px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.tx-scroll table.tbl { min-width: 900px; }
.tx-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--card); box-shadow: inset 0 -1px 0 var(--line); }
.tx-scroll thead th::after { content: none; }

/* donut summary (reports) */
.donut-card { display: flex; padding: 0 !important; }
.donut-sec { flex: 1; padding: 18px 20px 14px; }
.donut-sec + .donut-sec { border-left: 1px solid var(--line); }
.donut-sec .dt { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.donut-sec .dv { font-size: 28px; font-weight: 650; letter-spacing: -.02em; }
.donut-sec .dchart { display: flex; justify-content: center; margin: 14px 0 6px; }
.donut-sec .dchart svg { width: 148px; height: 148px; }
.donut-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; padding-bottom: 6px; }
.donut-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.donut-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.donut-legend b { color: var(--text); font-weight: 550; }

/* ---------- drawers / detail sheet ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(10,14,25,.35); z-index: 60; }
.drawer-mask.clear { background: transparent; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 500px; max-width: 94vw; background: var(--card); z-index: 61; box-shadow: var(--shadow-pop); border-radius: 14px 0 0 14px; padding: 24px; overflow-y: auto; }
.anim-drawer .drawer-mask { animation: fade-in .2s ease both; }
.anim-drawer .drawer { animation: slide-in-right .34s cubic-bezier(.22,.61,.36,1) both; }
.anim-drawer .drawer > * { animation: drawer-content .42s cubic-bezier(.22,.61,.36,1) both; }
/* exit animation — added on close, plays before the element is removed */
.drawer.drawer-out { animation: slide-out-right .26s cubic-bezier(.4,0,.7,.4) both; }
.drawer-mask.drawer-out { animation: fade-out .24s ease both; }
.drawer.drawer-out > * { animation: none; }
.drawer h3 { margin: 0 0 4px; font-size: 17px; font-weight: 650; }
.drawer .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.drawer .wopt { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 450; }
.drawer .wopt .t { margin-left: auto; }
/* detail sheet building blocks (vercel-app Transaction Details) */
.d-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.d-type { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.d-amt { font-size: 32px; font-weight: 650; letter-spacing: -.02em; }
.d-amt .cur { font-size: 17px; font-weight: 400; color: var(--muted); }
.d-fiat { font-size: 13px; margin-top: 2px; }
.d-fiat.pos { color: var(--green); }
.d-fiat.neg { color: var(--red); }
.dsect { display: flex; align-items: center; gap: 6px; padding: 18px 0 4px; font-size: 14.5px; font-weight: 600; border-top: 1px solid var(--line); margin-top: 14px; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; padding: 12px 0; }
.dgrid .df label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.dgrid .df .v { font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.dgrid .df.span2 { grid-column: 1 / 3; }
.riskscore { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.riskscore .rs-val { font-size: 28px; font-weight: 700; }
.riskscore .rs-max { font-size: 15px; color: var(--muted); }
.riskscore .rs-tip { margin-left: 4px; }
.arpanel { border: 1px solid var(--line); background: var(--seg); border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 4px; }
.arpanel .ar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.arpanel .ar-head b { font-size: 14.5px; }
.arpanel .ar-tag { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--card); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
/* ---------- notifications ---------- */
.notif-pop { position: fixed; top: 54px; right: 84px; width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); z-index: 70; overflow: hidden; }
.notif-pop .np-head { padding: 13px 16px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.notif-pop .item { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.45; cursor: pointer; }
.notif-pop .item:hover { background: var(--hover); }
.notif-pop .item .ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.notif-pop .item .ic svg { width: 15px; height: 15px; }
.notif-pop .item .when { display: block; color: var(--faint); font-size: 11.5px; margin-top: 3px; }
.notif-pop .np-foot { padding: 10px 16px; font-size: 12.5px; }

/* ---------- QR ---------- */
.qr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; width: 148px; height: 148px; flex: none; }
.qr svg { width: 100%; height: 100%; }

.avmenu { position: fixed; top: 54px; right: 16px; width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); z-index: 70; padding: 6px; }
.avmenu .mi { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 450; }
.avmenu .mi:hover { background: var(--hover); }
.avmenu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.avmenu .who .n { font-weight: 600; font-size: 13.5px; }
.avmenu .who .r { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- misc screens ---------- */
.wallet-section { display: grid; grid-template-columns: 210px 1fr; }
.wallet-side { border-right: 1px solid var(--line); padding: 18px 20px; }
.wallet-side .tlab { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; color: var(--faint); text-transform: uppercase; margin-top: 16px; }
.wallet-side .tval { font-size: 18px; font-weight: 650; margin-top: 3px; }
.wallet-side .tfiat { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.optcards { display: flex; gap: 10px; flex-wrap: wrap; }
.optcard { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-sm); padding: 10px 15px; font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow); }
.optcard:hover { border-color: var(--line-strong); background: var(--hover); }
.optcard.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 1px var(--blue); }

/* conversion page layout */
.conv-page { padding: 18px 20px 20px !important; }
/* Two framed columns of equal height: their top and bottom borders line up as a matched pair. */
.conv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: stretch; }
.conv-main { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 18px 20px; }
.conv-swap { max-width: none; width: 100%; }
.conv-block { margin-bottom: 4px; }
.conv-block .conv-wal { margin-bottom: 8px; }
.conv-side { min-width: 0; }
.conv-summary { height: 100%; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--seg); }
.conv-summary h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.conv-summary .cs-pair { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.conv-summary .cs-big { font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.conv-summary .cs-cur { font-size: 16px; font-weight: 500; color: var(--muted); }
.conv-summary .cs-rows { margin: 16px 0 0; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.conv-summary .cs-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.conv-summary .cs-row b { color: var(--text); font-weight: 550; text-align: right; font-size: 13px; }
.conv-summary .cs-actions { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.conv-summary .conv-go { width: 100%; justify-content: center; margin: 0; }
/* when the summary has a foot block (Deposit warning) but no actions, push it to the bottom */
.conv-summary > .cs-foot:last-child { margin-top: auto; }
.cs-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cs-callout { display: flex; gap: 12px; align-items: flex-start; width: 100%; }
.cs-callout-ic { flex: none; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.cs-callout-ic svg { width: 17px; height: 17px; }
.cs-callout.warn .cs-callout-ic { background: #fef3c7; color: #b45309; }
[data-theme="dark"] .cs-callout.warn .cs-callout-ic { background: #3d2e0a; color: #fbbf24; }
.cs-callout.ok .cs-callout-ic { background: var(--green-soft); color: #166534; }
[data-theme="dark"] .cs-callout.ok .cs-callout-ic { background: #0f2a1a; color: #8fdcab; }
.cs-callout-body { flex: 1; min-width: 0; }
.cs-callout-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cs-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card); border: 1px solid var(--line); }
.cs-chip.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-dark); }
[data-theme="dark"] .cs-chip.on { color: #a9c1f7; }
.cs-chip-sep { font-size: 11px; color: var(--faint); font-weight: 500; }
.cs-callout-body p, .cs-callout > p { margin: 0; flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink2); }
.conv-history { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.conv-history h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.dep-receive { display: flex; align-items: flex-start; gap: 24px; margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.dep-addr { flex: 1; min-width: 0; }
.action-form { display: flex; flex-direction: column; gap: 16px; }
.action-form .field label { font-size: 13px; }
@media (max-width: 960px) { .conv-grid { grid-template-columns: 1fr; } .dep-receive { flex-direction: column; align-items: center; } }
.conv-wal label { font-size: 13px; }
.wal-select { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-size: 13.5px; box-shadow: var(--shadow); }
/* wallet selector with a leading coin icon (native select can't render option icons) */
.wal-pick { position: relative; display: flex; align-items: center; }
.wal-pick .coinav { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; z-index: 1; }
.wal-pick .wal-select { padding-left: 40px; }
.swap { max-width: none; }
.swap-box { background: var(--seg); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.swap-box.to-box { background: var(--card); }
.swap-box .sb-lbl { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; }
.swap-box .sb-main { display: flex; align-items: center; gap: 12px; }
.swap-box .sb-main input { flex: 1; min-width: 0; border: none; background: transparent; font-size: 26px; font-weight: 650; letter-spacing: -.02em; padding: 0; outline: none; box-shadow: none; }
.swap-box .sb-main .sb-out { flex: 1; font-size: 26px; font-weight: 650; letter-spacing: -.02em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px 5px 6px; box-shadow: var(--shadow); flex: none; position: relative; }
.coin-chip b { font-size: 14px; font-weight: 600; }
.coin-chip .car { color: var(--faint); font-size: 10px; }
.coin-chip select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.swap-arrow { display: flex; justify-content: center; margin: -8px 0; position: relative; z-index: 2; }
.swap-arrow button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--bg); background: var(--card); box-shadow: var(--shadow); color: var(--muted); display: flex; align-items: center; justify-content: center; padding: 0; }
.swap-arrow button:hover { color: var(--blue); }
.swap-arrow button svg { width: 15px; height: 15px; }
.swap-meta { padding: 12px 4px 2px; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.swap-meta .sm-r { display: flex; justify-content: space-between; }
.swap-meta .sm-r b { color: var(--text); font-weight: 550; }

.approval-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.approval-card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.approval-card .amt { font-size: 16px; font-weight: 650; }
.approval-card .meta { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.approval-card .chips { display: flex; gap: 7px; margin: 9px 0; flex-wrap: wrap; }
.approval-card .foot { display: flex; gap: 9px; align-items: center; margin-top: 11px; }
.approval-card.rowclick { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.approval-card.rowclick:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.drawer-actions { display: flex; gap: 8px; margin-top: 16px; }
.drawer-actions .btn { flex: 1; justify-content: center; }
.audit-ref { font-size: 11.5px; color: var(--faint); margin-left: auto; }

.teaser-hero { text-align: center; padding: 44px 30px 26px; }
.teaser-hero h1 { font-size: 28px; font-weight: 650; margin: 12px 0 10px; letter-spacing: -.02em; }
.teaser-hero p { color: var(--muted); max-width: 560px; margin: 0 auto; line-height: 1.6; }
.teaser-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0; }
.teaser-grid .tcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.teaser-grid .tcard .ic { width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.teaser-grid .tcard .ic svg { width: 19px; height: 19px; }
.teaser-grid h4 { margin: 0 0 7px; font-size: 15px; }
.teaser-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.finemark { font-size: 11.5px; color: var(--faint); line-height: 1.6; text-align: center; max-width: 640px; margin: 18px auto 0; }

.codebox { background: #0f172a; color: #cfe0ff; border-radius: var(--radius-sm); padding: 14px 16px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.6; overflow-x: auto; position: relative; }
.codebox .copy { position: absolute; top: 8px; right: 8px; color: #8fa4cc; }

/* BerryPay-style checkout preview */
.pw-shell { background: #f4f6f9; border-radius: 18px; padding: 16px 16px 14px; position: relative; }
[data-theme="dark"] .pw-shell { background: #121820; }
.pw-lang { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.pw-lang select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 13px; background: var(--card); color: var(--text); }
.pw { border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px 18px; background: var(--card); box-shadow: 0 1px 3px rgba(15, 23, 42, .06); max-width: 420px; margin: 0 auto; }
.pw .pw-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pw .pw-order { font-size: 13px; color: var(--muted); font-weight: 500; }
.pw .pw-status { font-size: 12px; font-weight: 600; color: var(--blue-dark); background: var(--blue-soft); border-radius: 999px; padding: 3px 10px; }
.pw .pw-coin { display: flex; justify-content: center; margin: 10px 0 8px; }
.pw .pw-coin .cico { width: 64px; height: 64px; font-size: 28px; }
.pw .pw-amt { text-align: center; font-size: 24px; font-weight: 650; letter-spacing: -.02em; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pw .pw-fiat { text-align: center; color: var(--muted); font-size: 14px; margin-top: 2px; margin-bottom: 14px; }
.pw .pw-note { color: var(--ink2); font-size: 13.5px; margin: 0 0 10px; line-height: 1.5; }
.pw .pw-addrbox { display: flex; gap: 12px; align-items: stretch; background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
[data-theme="dark"] .pw .pw-addrbox { background: var(--seg); }
.pw .pw-addr { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.pw .pw-addr .addr { font-size: 12.5px; overflow-wrap: anywhere; display: block; line-height: 1.45; color: var(--text); font-family: ui-monospace, Consolas, monospace; }
.pw-copybtn { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; color: var(--muted); font-size: 12.5px; padding: 4px 0; margin-top: 8px; cursor: pointer; }
.pw-copybtn:hover { color: var(--blue); }
.pw-copybtn svg { width: 14px; height: 14px; }
.pw .pw-qr { width: 80px; height: 80px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; flex: none; align-self: center; }
.pw .pw-meta { border-top: 1px solid var(--line); padding-top: 4px; }
.pw .pw-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 13.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.pw .pw-row:last-child { border-bottom: none; }
.pw .pw-row b { color: var(--text); font-weight: 550; font-size: 13.5px; }
.pw .pw-row .cico.sm { width: 18px; height: 18px; font-size: 9px; }
.pw .pw-foot { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; color: var(--faint); margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pw .pw-foot img { height: 15px; opacity: .85; }
.pw .pw-sep { color: var(--line-strong); }

.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.rdot { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line-strong); }
.rdot.on { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 3px var(--card); }

.faq-q { border-bottom: 1px solid var(--line); padding: 13px 2px; }
.faq-q > button { width: 100%; text-align: left; background: none; border: none; font-size: 14px; font-weight: 550; display: flex; }
.faq-q > button::after { content: "+"; margin-left: auto; color: var(--faint); font-size: 17px; }
.faq-q.open > button::after { content: "–"; }
.faq-q .a { display: none; color: var(--muted); font-size: 13.5px; line-height: 1.6; padding-top: 8px; }
.faq-q.open .a { display: block; }

.chat { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat .log { padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--seg); min-height: 130px; }
.chat .msg { max-width: 82%; padding: 9px 13px; border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.chat .msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.chat .msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat .inp { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat .inp input { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; background: var(--card); }

.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f172a; color: #fff; border-radius: var(--radius-sm); padding: 11px 18px; font-size: 13.5px; font-weight: 450; box-shadow: var(--shadow-pop); animation: popin .18s ease-out; }
.toast.ok::before { content: "✓  "; color: #5ee69a; }
@keyframes popin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- demo layer: welcome, tour, screen info ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(10,14,25,.45); z-index: 95; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-pop); width: 520px; max-width: calc(100vw - 40px); max-height: calc(100vh - 60px); overflow-y: auto; padding: 30px 32px; }
.anim-modal .modal-mask { animation: fade-in .16s ease both; }
.anim-modal .modal { animation: modal-in .22s cubic-bezier(.22,.61,.36,1) both; }
.modal .m-logo { height: 26px; display: block; margin-bottom: 18px; }
.modal h2 { margin: 0 0 8px; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.modal p { color: var(--muted); font-size: 13.5px; line-height: 1.65; margin: 0 0 10px; }
.modal .mfoot { display: flex; gap: 10px; margin-top: 20px; }
.modal ul.mlist { margin: 4px 0 10px; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.modal.twofa-modal { width: 420px; }
.twofa-summary { background: var(--seg); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; color: var(--ink2); margin: 12px 0 0; line-height: 1.5; }
.twofa-field { margin-top: 16px; }
.twofa-field input { font-size: 22px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; padding: 12px 16px; }

.tour-card { position: fixed; right: 22px; bottom: 22px; width: 380px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); z-index: 96; padding: 18px 20px; }
.tour-card .t-step { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.tour-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.tour-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.tour-card .t-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-card .t-count { margin-right: auto; font-size: 12px; color: var(--faint); }
.tour-card .t-btns { display: flex; align-items: center; gap: 8px; }
.tour-card .t-btn-ghost { visibility: hidden; pointer-events: none; }
.nav-item.tour-hl { outline: 2px solid var(--blue); outline-offset: -2px; background: var(--blue-soft); }

/* Info button next to the page title */
.info-inline { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); vertical-align: 3px; margin-left: 6px; padding: 0; }
.info-inline:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.info-inline svg { width: 14px; height: 14px; }
.info-hint { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--blue); background: var(--blue-soft); color: var(--blue-dark); border-radius: 999px; padding: 4px 12px 4px 8px; font-size: 12px; font-weight: 550; vertical-align: 4px; margin-left: 10px; animation: pulse 1.8s ease-out infinite; }
.info-hint:hover { background: var(--blue); color: #fff; animation: none; }
.info-hint svg { width: 14px; height: 14px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(43,125,231,.4); } 70% { box-shadow: 0 0 0 9px rgba(43,125,231,0); } 100% { box-shadow: 0 0 0 0 rgba(43,125,231,0); } }

/* Inline "About this screen" guide card */
.screen-guide { display: flex; gap: 13px; align-items: flex-start; background: var(--blue-soft); border: 1px solid #c6dbfd; border-radius: var(--radius); padding: 15px 17px; margin: -4px 0 18px; }
[data-theme="dark"] .screen-guide { border-color: #2a3b63; }
.screen-guide .sg-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.screen-guide .sg-ic svg { width: 17px; height: 17px; }
.screen-guide .sg-body { flex: 1; font-size: 13px; }
.screen-guide .sg-body b { font-size: 14px; }
.screen-guide .sg-body p { margin: 4px 0 0; color: var(--ink2); line-height: 1.6; }
[data-theme="dark"] .screen-guide .sg-body p { color: #c3cad6; }
.screen-guide .sg-try { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--blue-dark); margin: 10px 0 4px; }
.screen-guide ol { margin: 0; padding-left: 18px; line-height: 1.7; color: var(--ink2); }
[data-theme="dark"] .screen-guide ol { color: #c3cad6; }
.screen-guide .sg-close { border: none; background: none; color: var(--faint); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.screen-guide .sg-close:hover { background: rgba(0,0,0,.06); color: var(--text); }

/* action-page live summary (withdraw) */
.action-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; background: var(--seg); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 16px; margin: 4px 0 14px; }
.action-summary .asr { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.action-summary .asr b { color: var(--text); font-size: 13px; font-weight: 550; }
@media (max-width: 1100px) { .action-summary { grid-template-columns: 1fr 1fr; } }

.empty { text-align: center; color: var(--faint); padding: 26px; font-size: 13px; }
/* payout builder entry cards */
.pb-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.pb-ic svg { width: 20px; height: 20px; }
/* coin multi-select (invoice drawer) */
.coin-check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coin-check { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-size: 13px; cursor: pointer; transition: border-color .12s, background .12s; }
.coin-check:hover { border-color: var(--line-strong); background: var(--hover); }
.coin-check.on { border-color: var(--blue); background: var(--blue-soft); }
.coin-check input { flex: none; }

/* wider drawer for invoice create/detail */
.drawer.drawer-wide { width: 620px; }
.drawer-tag { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--seg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; margin-left: 8px; vertical-align: 3px; }
.drawer textarea { width: 100%; padding: 8.5px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-size: 13.5px; box-shadow: var(--shadow); resize: vertical; font-family: inherit; }
.drawer textarea:focus { outline: 2px solid #c8d8fb; border-color: var(--blue); }

/* recipient quick-pick chips (invoice) */
.recipient-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.rec-chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 500; color: var(--ink2); box-shadow: var(--shadow); }
.rec-chip:hover { border-color: var(--line-strong); background: var(--hover); }
.rec-chip.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }

/* invoice line-item editor */
.li-head { display: grid; grid-template-columns: 1fr 58px 96px 90px 26px; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 0 2px 6px; }
.li-head .li-qty, .li-head .li-price, .li-head .li-amt { text-align: right; }
.li-row { display: grid; grid-template-columns: 1fr 58px 96px 90px 26px; gap: 8px; align-items: center; margin-bottom: 8px; }
.li-row input { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-size: 13px; box-shadow: var(--shadow); }
.li-row input.li-qty, .li-row input.li-price { text-align: right; }
.li-row .li-amt { text-align: right; font-size: 13px; font-weight: 550; color: var(--text); font-variant-numeric: tabular-nums; }
.li-row .li-x { border: none; background: none; color: var(--faint); font-size: 18px; line-height: 1; padding: 0; border-radius: 6px; height: 26px; }
.li-row .li-x:hover:not(:disabled) { color: var(--red); background: var(--red-soft); }
.li-row .li-x:disabled { opacity: .3; cursor: default; }

/* invoice totals block */
.inv-totals { margin: 14px 0 4px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; max-width: 320px; margin-left: auto; }
.inv-totals .it-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.inv-totals .it-row b { color: var(--text); font-weight: 550; font-variant-numeric: tabular-nums; }
.inv-totals .it-total { border-top: 1px solid var(--line); padding-top: 8px; font-size: 15px; }
.inv-totals .it-total b { font-size: 16px; font-weight: 650; }
.tax-inp { width: 56px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); font-size: 12.5px; text-align: right; margin: 0 2px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.right { margin-left: auto; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ============================================================
   Final polish: motion, focus states, hover, responsiveness
   ============================================================ */

/* --- entrance keyframes --- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slide-in-right { from { transform: translateX(100%); } to { transform: none; } }
@keyframes slide-out-right { from { transform: none; } to { transform: translateX(100%); } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes drawer-content { 0%, 30% { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* Enterprise consoles favour near-instant navigation. Keep only a very fast,
   single whole-page fade on route change — no per-card stagger, no translate —
   so power users never feel a lag. Disabled entirely under reduced-motion. */
.route-anim { animation: fade-in .12s ease both; }

/* --- keyboard focus: a single consistent ring across controls --- */
:focus-visible { outline: none; }
.btn:focus-visible,
.iconbtn:focus-visible,
.lang-pick:focus-visible,
.lang-opt:focus-visible,
.user-chip:focus-visible,
.nav-item:focus-visible,
.tabs button:focus-visible,
.seg button:focus-visible,
.toggle:focus-visible,
.tx-pill:focus-visible,
.rowlink:focus-visible,
.copy:focus-visible,
.pw-copybtn:focus-visible,
.faq-q > button:focus-visible,
.info-inline:focus-visible,
.info-hint:focus-visible,
.avmenu .mi:focus-visible,
.optcard:focus-visible,
.sg-close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.nav-item:focus-visible { outline-offset: -2px; }
.wal-select:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* --- hover lift for interactive surfaces --- */
.widget, .teaser-grid .tcard { transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.widget:not(.alert):hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(15,23,42,.07); }
[data-theme="dark"] .widget:not(.alert):hover { box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.widget .foot a:hover { text-decoration: none; }
.teaser-grid .tcard:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 8px 22px rgba(15,23,42,.08); }
.optcard { transition: border-color .12s, background .12s, box-shadow .12s; }
.iconbtn, .user-chip { transition: background .12s, border-color .12s; }

/* subtle press feedback on nav + icon buttons */
.iconbtn:active, .nav-item:active { transform: translateY(1px); }

/* --- responsive: tablet --- */
@media (max-width: 1024px) {
  .widgets { grid-template-columns: repeat(2, 1fr); }
  .widget.w4 { grid-column: span 2; }
  .teaser-grid { grid-template-columns: 1fr 1fr; }
}

/* --- responsive: small tablet / large phone --- */
@media (max-width: 820px) {
  .app { grid-template-columns: 62px 1fr; }
  .app .sidebar { padding: 14px 9px 10px; }
  .app .logo { justify-content: center; padding: 0 0 10px; }
  .app .logo img { height: 22px; width: 22px; object-fit: cover; object-position: left; }
  .app .nav-group h6 { display: none; }
  .app .nav-group { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
  .app .nav-group:last-of-type { border-bottom: none; }
  .app .nav-item { justify-content: center; padding: 8px 0; gap: 0; }
  .app .nav-item span, .app .nav-item .ext, .app .nav-item .soon, .app .nav-item .nbadge { display: none; }
  .app .viewas { display: none; }
  .collapse-btn { display: none; }
  .main { padding: 18px 18px 50px; }
  .wallet-section { grid-template-columns: 1fr; }
  .wallet-side { border-right: none; border-bottom: 1px solid var(--line); }
  .donut-card { flex-direction: column; }
  .donut-sec + .donut-sec { border-left: none; border-top: 1px solid var(--line); }
  .teaser-grid { grid-template-columns: 1fr; }
}

/* --- responsive: phone --- */
@media (max-width: 560px) {
  :root { font-size: 15px; }
  .widgets { grid-template-columns: 1fr; }
  .widget.w2, .widget.w4 { grid-column: span 1; }
  .page-head { flex-wrap: wrap; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .topbar { padding: 0 14px; gap: 8px; }
  .lang-pick { padding: 0 7px; }
  .drawer, .drawer.drawer-wide { width: 100%; max-width: 100vw; border-radius: 0; padding: 20px 18px; }
  .li-head { display: none; }
  .li-row { grid-template-columns: 1fr 48px 1fr; grid-template-areas: "desc desc desc" "qty price amt" "x x x"; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .li-row input[data-action-input="invItemDesc"] { grid-area: desc; }
  .li-row input.li-qty { grid-area: qty; }
  .li-row input.li-price { grid-area: price; }
  .li-row .li-amt { grid-area: amt; }
  .li-row .li-x { grid-area: x; justify-self: end; }
  .inv-totals { max-width: none; }
  .modal { padding: 24px 20px; }
  .notif-pop { right: 10px; left: 10px; width: auto; }
  .tabs, .seg { width: 100%; overflow-x: auto; }
  /* let wide tables scroll instead of squashing */
  .card-body { overflow-x: auto; }
  table.tbl { min-width: 560px; }
  .action-summary { grid-template-columns: 1fr; }
  /* stack two-column form/detail layouts (beats inline template-columns) */
  .grid2 { grid-template-columns: 1fr !important; gap: 0 !important; }
  .grid2 > .full { grid-column: 1; }
  .dgrid { grid-template-columns: 1fr; }
  .tx-toolbar-right { margin-left: 0; width: 100%; }
  .tx-search { min-width: 0; }
}

/* --- respect reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* password gate */
.gate { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.gate-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 13px; text-align: center; padding: 32px 28px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop); }
.gate-logo { height: 30px; width: auto; margin: 0 auto 6px; display: block; }
[data-theme="dark"] .gate-logo { filter: brightness(1.35); }
.gate-card h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.gate-card p { margin: 0 0 4px; font-size: 13.5px; color: var(--muted); }
.gate-card input { padding: 11px 14px; font-size: 15px; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); }
.gate-card input:focus { outline: 2px solid #c8d8fb; border-color: var(--blue); }
.gate-err { font-size: 12.5px; color: var(--red); }
.gate-btn { justify-content: center; padding: 11px; font-size: 15px; }
.gate-note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

/* mobile block — hidden on desktop, covers screen on small viewports */
.mobile-block { display: none; }
@media (max-width: 767px) {
  .mobile-block {
    position: fixed; inset: 0; z-index: 9999; display: flex;
    align-items: center; justify-content: center; padding: 28px;
    background: var(--bg);
  }
  #app { display: none !important; }
  .gate { display: none !important; }
  .mobile-block-card {
    width: 100%; max-width: 340px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 34px 26px; background: var(--card);
    border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop);
  }
  .mobile-block-logo { height: 28px; width: auto; margin-bottom: 2px; }
  [data-theme="dark"] .mobile-block-logo { filter: brightness(1.35); }
  .mobile-block-icon {
    display: flex; align-items: center; justify-content: center;
    width: 68px; height: 68px; border-radius: 16px;
    color: var(--blue); background: var(--blue-soft);
  }
  .mobile-block-card h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
  .mobile-block-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
}
