/* USDT (TRC20) top-up (usdt1, 2026-11). Wallet panel (.usdtw-*, public/usdt-wallet.js) and the Admin tab
   (.uadm-*, public/usdt-admin.js). Older .usdt-* rules stay in vip-credits.css and are reused here. */

/* ---------------------------------------------------------------- wallet panel */
.usdtw { display: grid; gap: 16px; }
/* Open order (usdt3): one card, one column (the QR sits under the address), and on wide screens the card,
   notes and history form one centred 600px column. */
.usdtw-order { position: relative; grid-template-columns: minmax(0, 1fr); }
.usdtw-order .usdt-order-main { gap: 12px; }
.usdtw.has-order { justify-items: center; }
.usdtw.has-order > * { width: 100%; max-width: 600px; }
/* The top bar stays pinned while scrolling (64px desktop, about 50px on phones): anything scrolled into
   view (TXID fields, the order card) stops below it instead of under it. */
.usdtw-order, .usdtw-claim, .usdtw-help, .usdt-history, .usdtw .input { scroll-margin-top: 88px; }
.usdtw-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
/* Steps as one quiet line: done = normal text, current = blue, later = muted. */
.usdtw-steps { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; font-size: 13px; }
.usdtw-steps li { color: var(--muted); line-height: 1.4; }
.usdtw-steps li + li::before { content: '›'; margin: 0 8px; color: var(--muted); opacity: .6; }
.usdtw-steps li.on { color: var(--soft); }
.usdtw-steps li.now { color: var(--blue); font-weight: 700; }
.usdtw-countdown { color: var(--muted); font-size: 13px; }
.usdtw-countdown b { font: 800 15px/1 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text); margin-left: 4px; }
/* Receipt rows: label | value | copy. */
.usdtw-lines { margin: 0; display: grid; border-top: 1px solid var(--line-soft); }
.usdtw-line { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.usdtw-line dt { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.usdtw-line dt small { display: block; margin-top: 2px; font-size: 11.5px; opacity: .85; }
.usdtw-line dd { margin: 0; min-width: 0; display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.usdtw-amount { font: 800 22px/1.15 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text); letter-spacing: .01em; }
.usdtw-amount em { font-style: normal; color: var(--amber); }
.usdtw-amount small { margin-left: 6px; font-family: var(--ui-font, system-ui, sans-serif); font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.usdtw-addr { padding: 0; background: none; border: 0; font: 500 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); overflow-wrap: anywhere; letter-spacing: .02em; }
.usdtw-addr b { color: var(--text); font-weight: 800; }
.usdtw-addr span { color: var(--muted); font-weight: 500; }
.usdtw-copy { flex: none; margin-left: auto; }
.usdtw-line-hint { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.usdtw-exact { flex-basis: 100%; margin: 4px 0 0; padding: 9px 11px; border-left: 3px solid var(--warning-text, #f2b84b); border-radius: 6px; background: var(--warning-bg, #f2b84b12); color: var(--warning-text, #f2b84b); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.usdtw-exact b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.usdtw-credit { color: var(--soft); font-size: 13px; }
.usdtw-credit b { color: var(--text); font-size: 15px; }
.usdtw-credit small { margin-left: 8px; color: var(--muted); font-size: 12.5px; }
.usdtw-foot { align-items: center; }
/* Create form: amount buttons like the RMB top-up (own class; see usdt-wallet.js). On wide screens the
   notes sit next to the form; history goes below both. */
.usdtw-form { max-width: 760px; }
@media (min-width: 1100px) {
  .usdtw.has-form { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); align-items: start; }
  .usdtw.has-form > .usdtw-form { max-width: none; }
  .usdtw.has-form > .usdt-history { grid-column: 1 / -1; }
}
/* Notes and the "付款问题" ticket box (usdt2/usdt3): next to the form on wide screens, below it otherwise. */
.usdtw-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.usdtw-help { display: grid; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel2); font-size: 13px; }
.usdtw-help-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.usdtw-help .usdtw-support { margin-left: auto; padding: 2px 0; font-size: 12.5px; }
.usdtw-help > small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.usdtw-general-form { display: grid; gap: 8px; }
.usdtw-general { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.usdtw-general .input { min-width: 0; }
/* Problem type: real radio inputs (keyboard and screen readers) drawn as chips. */
.usdtw-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.usdtw-kind { position: relative; display: inline-flex; }
.usdtw-kind input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.usdtw-kind span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--soft); font-size: 12.5px; line-height: 1.3; cursor: pointer; user-select: none; }
.usdtw-kind span:hover { color: var(--text); }
.usdtw-kind input:checked + span { border-color: color-mix(in srgb, var(--blue) 65%, var(--line-soft)); background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--text); font-weight: 700; }
.usdtw-kind input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
/* "我的工单" rows: state · type · amount · time, then TXID and what happens next. */
.usdtw-ticket { display: grid; gap: 4px; padding: 8px 0 10px; border-bottom: 1px solid var(--line-soft); }
.usdtw-ticket-head { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 13px; }
.usdtw-ticket-head b { color: var(--text); font-weight: 600; }
.usdtw-ticket-head small { margin-left: auto; color: var(--muted); font-size: 12px; }
.usdtw-ticket .usdtw-row-note { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: baseline; }
.usdtw-ticket code { font: 500 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--soft); }
/* "钱包只能输入 2 位小数？" under the amount. */
.usdtw-line dd .usdtw-2dp { flex-basis: 100%; margin: 0; padding: 0; text-align: left; font-size: 12.5px; }
body:not(.admin-view):not(.agent-view) .usdtw-amounts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.usdtw-limits { margin: 0; font-size: 12.5px; line-height: 1.5; }
.usdtw-link { margin-left: auto; padding: 6px 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.usdtw-link:hover, .usdtw-link:focus-visible { color: var(--text); }
.usdtw-link:disabled { opacity: .5; cursor: default; }
.usdtw-state { display: grid; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--amber, #f2b84b) 45%, var(--line-soft)); background: color-mix(in srgb, var(--amber, #f2b84b) 8%, transparent); }
.usdtw-state > span { color: var(--muted); font-size: 12.5px; }
.usdtw-state.bad { border-color: var(--error-border, #e5484d); background: var(--error-bg, rgba(229, 72, 77, .08)); }
.usdtw-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* QR on its own line in the address row: under the address (centred on phones), caption under the QR.
   That row is top-aligned so its label stays next to the address, not beside the middle of the QR. */
.usdtw-line.has-qr { align-items: start; }
.usdtw-line.has-qr dt { padding-top: 2px; }
.usdtw-line dd .usdtw-qr { flex: 0 0 100%; margin: 4px 0 2px; display: grid; grid-template-columns: 152px; justify-content: start; gap: 6px; }
.usdtw-qr .usdt-qr { width: 152px; height: 152px; }
.usdtw-qr figcaption { color: var(--muted); font-size: 11.5px; text-align: center; }
.usdtw-claim { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line-soft); background: var(--panel); }
.usdtw-claim .field > span { font-size: 12.5px; }
.usdtw-claim .field-hint { color: var(--muted); font-size: 12px; }
.usdtw-msg { margin: 0; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; }
.usdtw-msg.ok { background: color-mix(in srgb, var(--green, #2fbf71) 12%, transparent); color: var(--text); }
.usdtw-msg.bad { background: var(--error-bg, rgba(229, 72, 77, .1)); color: var(--error-text, #e5484d); }
.usdtw-notice { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel2); font-size: 13px; }
.usdtw-notice ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--soft); }
.usdtw-row { display: grid; gap: 6px; padding: 2px 0 8px; border-bottom: 1px solid var(--line-soft); }
.usdtw-row .usdt-history-row { border-bottom: 0; padding-bottom: 0; }
.usdtw-row .usdt-history-row .pill { justify-self: start; max-width: 100%; white-space: normal; text-align: center; line-height: 1.35; }
.usdtw-row-note { margin: 0; color: var(--muted); font-size: 12.5px; }
.usdtw-row-btn { justify-self: start; }
.usdtw-error { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Admin tab */
.uadm { display: grid; gap: 16px; }
.uadm-status-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.uadm-status-head h3 { margin: 0 0 6px; }
.uadm-status-head p { margin: 0; }
.uadm-blockers { margin: 10px 0 0; padding-left: 20px; color: var(--error-text, #e5484d); }
.uadm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.uadm-chips button, .uadm-chip-static { display: grid; gap: 2px; min-width: 92px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel2); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.uadm-chip-static { cursor: default; }
.uadm-chips b, .uadm-chip-static b { font-size: 20px; line-height: 1.1; }
.uadm-chips span, .uadm-chip-static span { color: var(--muted); font-size: 12px; }
.uadm-chips button.hot { border-color: color-mix(in srgb, var(--amber, #f2b84b) 60%, var(--line-soft)); background: color-mix(in srgb, var(--amber, #f2b84b) 12%, var(--panel2)); }
.uadm-health { display: grid; gap: 6px; margin: 12px 0 0; }
.uadm-health > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.uadm-health dt { color: var(--muted); font-size: 12.5px; }
.uadm-health dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.uadm-health small { color: var(--muted); }
.uadm-ack-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.uadm-ack-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.uadm-label { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.uadm code, .uadm-modal code { font: 500 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.uadm code b, .uadm-modal code b { color: var(--blue); }
.uadm-addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.uadm-address { display: grid; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--panel2); }
.uadm-address-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.uadm-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.uadm-kv dt { color: var(--muted); font-size: 12px; }
.uadm-kv dd { margin: 0; font-size: 13px; }
.uadm-guard ul, .uadm-blocked { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.uadm-guard li, .uadm-blocked li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.uadm-guard small, .uadm-blocked small { color: var(--muted); }
.uadm-reason { margin: 0; font-size: 13px; color: var(--warning-text, #f2b84b); }
.uadm-tx { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.uadm-late { color: var(--error-text, #e5484d); font-weight: 700; }
.uadm-pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; }
.uadm-modal { max-width: 520px; }
.uadm-modal .section-title { display: grid; gap: 6px; }
.uadm-modal .section-title p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* Wallet tabs without "USDT 充值" (shown only to allowed accounts): 4 tabs instead of 5. */
body:not(.admin-view):not(.agent-view) .wallet-tabs.no-usdt { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  body:not(.admin-view):not(.agent-view) .wallet-tabs.no-usdt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body:not(.admin-view):not(.agent-view) .usdtw-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body:not(.admin-view):not(.agent-view) .usdtw-amounts .amount-btn { min-width: 0; min-height: 64px; padding: 10px 12px; }
}
@media (max-width: 340px) {
  body:not(.admin-view):not(.agent-view) .usdtw-amounts { grid-template-columns: 1fr; }
}

/* Admin on a phone: the shared admin style makes every row button full width (one per line), which
   pushed the payment queue far down. Inside the USDT tab short buttons share a row instead. */
@media (max-width: 760px) {
  body.admin-view .uadm .row-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  body.admin-view .uadm .row-actions .btn { width: auto; flex: 1 1 auto; min-height: 40px; }
  body.admin-view .uadm .uadm-tx .btn { flex: 0 0 auto; }
}

/* Small phones: the 34-character address fits one line, so its bold first and last 6 stay together. */
@media (max-width: 400px) {
  .usdtw-addr { font-size: 12.5px; letter-spacing: 0; }
  .usdtw-general { grid-template-columns: 1fr; }
  .usdtw-ticket-head small { flex-basis: 100%; margin-left: 0; }
}

@media (max-width: 640px) {
  .usdtw-top { align-items: flex-start; }
  .usdtw-line { grid-template-columns: 1fr; gap: 6px; }
  .usdtw-line dt small { display: inline; margin: 0 0 0 6px; }
  .usdtw-amount { font-size: 21px; }
  .usdtw-line dd .usdtw-qr { justify-content: center; }
  .uadm-health > div { grid-template-columns: 1fr; gap: 2px; }
  .uadm-addresses { grid-template-columns: 1fr; }
}
