:root {
  color-scheme: light;
  --page: #f3f5f9;
  --surface: #fff;
  --surface-soft: #f8f9fc;
  --ink: #172033;
  --muted: #59667b;
  --line: #e2e6ee;
  --line-strong: #cfd5e1;
  --accent: #4c57d9;
  --accent-dark: #3944bd;
  --accent-soft: #eef0ff;
  --green: #137a5c;
  --green-soft: #e7f6f0;
  --amber: #9a6508;
  --amber-soft: #fff4dc;
  --red: #b84444;
  --red-soft: #fff0f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 8% -12%, #4c57d91f, transparent 30rem), var(--page); font-size: 13px; line-height: 1.6; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #4c57d95c; outline-offset: 3px; }
input:focus, select:focus { outline: 2px solid #9299eb; outline-offset: 2px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
input, select { min-width: 0; }
strong { font-weight: 700; }
code { font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
::selection { background: #dce0ff; }
[hidden] { display: none !important; }
.muted, .fine-print, .field-help { color: var(--muted); line-height: 1.8; }
.muted { font-size: 12px; }
.fine-print, .field-help { font-size: 11px; }
.field-help { margin-top: 8px; overflow-wrap: anywhere; }
.section-kicker { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 750; letter-spacing: .12em; color: var(--accent); }
.dot { display: inline-block; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--green); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand img { flex-shrink: 0; border-radius: 13px; box-shadow: 0 8px 20px #3e49c82b; }
.brand h1 { font-size: inherit; line-height: 1.3; }
.brand small, .brand p { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px; border: 1px solid var(--line-strong); border-radius: 9px; color: #536075; background: var(--surface); font-size: 13px; font-weight: 750; line-height: 1.5; transition: background .15s, border-color .15s; }
.button:hover:not(:disabled) { background: var(--surface-soft); text-decoration: none; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { border-color: var(--accent-dark); background: var(--accent-dark); }
.button.secondary { color: #536075; background: var(--surface); }
.button.secondary:hover:not(:disabled) { border-color: #b9beef; background: var(--surface-soft); }
.full { width: 100%; justify-content: space-between; }
.compact { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.text-button { min-height: 32px; border: 0; background: transparent; padding: 5px 0; color: var(--accent); font-size: 11px; font-weight: 650; }
.text-button:hover:not(:disabled) { color: var(--accent-dark); text-decoration: underline; }
.error-text { color: var(--red); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.error-text:empty { display: none; }
.banner { padding: 12px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.danger { color: var(--red); border: 1px solid #efcdcd; background: var(--red-soft); }

/* Compact password entry, separate from wallet authorization. */
.login-layout { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 36px 20px; }
.login-shell { width: min(440px, 100%); }
.login-box { border: 1px solid var(--line); border-radius: 20px; padding: 30px; background: var(--surface); box-shadow: 0 20px 60px #212a4814; }
.login-heading { margin: 28px 0 22px; padding-top: 23px; border-top: 1px solid var(--line); }
.login-heading h1 { font-size: 22px; letter-spacing: -.025em; margin-bottom: 7px; }
.login-box label { display: block; margin: 16px 0 8px; font-size: 12px; font-weight: 650; }
.login-box input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); }
.login-box input::placeholder { color: #778296; font-size: 12px; }
.login-box .error-text { margin: 12px 0; }
.login-box .primary { min-height: 42px; margin-top: 20px; justify-content: center; }
.privacy-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; padding: 12px 13px; border: 1px solid #d9dcfa; border-radius: 9px; color: #53618c; background: var(--accent-soft); font-size: 11px; line-height: 1.85; }
.small-shield { color: var(--accent); font-size: 22px; line-height: 1.5; }
.privacy-note strong { color: var(--accent-dark); }
.login-footer { margin-top: 18px; text-align: center; font-size: 10px; color: var(--muted); }

/* Workspace and account overview. */
.topbar, .workspace { width: min(1520px, calc(100% - 36px)); margin: 0 auto; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0 20px; }
.top-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 6px 10px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-badge.neutral { color: var(--muted); background: #e9edf4; }
.neutral .dot { background: #8490a4; }
.workspace-nav { display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.network-card { display: flex; align-items: center; gap: 10px; min-width: 245px; padding: 10px 13px; border: 1px solid #9299eb; border-radius: 12px; background: var(--accent-soft); box-shadow: 0 0 0 2px #4c57d90a; }
.network-card strong { display: block; color: var(--accent-dark); font-size: 12px; }
.network-card small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.network-mark, .chain-icon { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; background: #fff1ca; color: #a77812; font-size: 17px; }
.network-tag { margin-left: auto; color: var(--accent-dark); font-size: 9px; font-weight: 700; letter-spacing: .03em; }
.workspace-nav>.button { padding: 10px 17px; font-size: 12px; }
.section-links { display: flex; flex: 1 1 260px; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 20px; padding: 0 4px; }
.section-links a { color: var(--muted); font-size: 12px; }
.section-links a:hover { color: var(--accent); }
.balances-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.balance-card, .panel { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: #fffffff0; box-shadow: 0 9px 27px #212a480d; }
.balance-card { padding: 17px; }
.balance-label { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.balance-label>span:not(.coin-icon):not(.card-tag) { min-width: 0; overflow-wrap: anywhere; }
.balance-label small { display: block; margin-top: 2px; font-size: 10px; font-weight: 400; }
.coin-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; font-size: 18px; }
.coin-icon.bnb { color: #a77812; background: #fff4d4; }
.coin-icon.usdt { color: var(--green); background: var(--green-soft); font-size: 22px; }
.coin-icon.token { color: var(--accent); background: var(--accent-soft); font-size: 14px; font-weight: 800; }
.card-tag { margin-left: auto; padding: 3px 6px; border-radius: 4px; color: #65728a; background: var(--surface-soft); font-size: 9px; white-space: nowrap; }
.balance-number { display: flex; align-items: baseline; gap: 7px; margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.balance-number>span { min-width: 0; font-size: 25px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.balance-number small { min-width: 0; max-width: 40%; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balance-bottom { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.balance-bottom>* { min-width: 0; }
.tiny-dot { width: 3px; height: 3px; border-radius: 50%; background: #b9c1d0; }
.selected-balance { border-color: #d7dbf3; }
.selected-balance .balance-number>span { color: var(--accent-dark); }
.workspace-note { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 14px; border: 1px solid #c7d3fb; border-radius: 9px; background: #f4f6ff; color: #3d4f82; font-size: 11px; }
.workspace-note>span:first-child { color: var(--accent); font-size: 20px; }
.workspace-note p { flex: 1; }
.note-tag { color: var(--accent-dark); white-space: nowrap; font-size: 10px; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .65fr); align-items: start; gap: 14px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2 { font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.panel-header p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.panel-body { padding: 18px 20px; }
.subtle-pill { flex-shrink: 0; padding: 4px 7px; border-radius: 5px; color: var(--accent-dark); background: var(--accent-soft); font-size: 10px; }

/* Trade form, keeping buy and sell states visually distinct. */
.trade-tabs { display: flex; gap: 6px; padding: 4px; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.trade-tab { flex: 1; min-height: 36px; padding: 7px 10px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; transition: background .15s, border-color .15s; }
.trade-tab span { margin-left: 5px; font-size: 10px; font-weight: 500; }
.trade-tab.active { color: var(--accent-dark); border-color: #d4d8f4; background: var(--accent-soft); }
.trade-tab.sell-active { color: var(--red); border-color: #f0d4d4; background: var(--red-soft); }
.token-entry { padding: 13px 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 12px; }
.field-label label { font-weight: 650; }
.token-label { display: inline-flex; align-items: center; gap: 9px; color: #35445e; }
.field-hint { flex-shrink: 0; color: var(--muted); font-size: 10px; }
.ca-field { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); }
.ca-field:focus-within, .amount-field:focus-within { border-color: #9299eb; box-shadow: 0 0 0 3px var(--accent-soft); }
.contract-prefix { border-right: 1px solid var(--line); padding: 0 10px; color: #65728a; font-size: 10px; font-weight: 750; }
.ca-field input { flex: 1; width: 100%; min-height: 43px; border: 0; border-radius: 8px; padding: 10px; outline: none; color: var(--ink); background: transparent; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ca-field input::placeholder { color: #778296; font-size: 11px; }
.input-action { flex-shrink: 0; min-height: 32px; margin-right: 4px; padding: 5px 10px; border: 0; border-left: 1px solid var(--line); color: var(--accent); background: transparent; font-size: 11px; font-weight: 650; }
.input-action:hover:not(:disabled) { color: var(--accent-dark); }
.token-details { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.token-details>* { min-width: 0; }
.token-details code { width: 100%; color: var(--accent-dark); }
.token-chip { padding: 3px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 650; }
.asset-select-label { display: inline-flex; align-items: center; gap: 9px; }
.asset-select-label>span { font-size: 11px; color: var(--muted); font-weight: 400; }
select { border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 9px; color: #35445e; background: var(--surface); font-size: 12px; }
.amount-field { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); }
.amount-field input { width: 100%; padding: 4px 0; border: 0; outline: none; color: var(--ink); background: transparent; font-size: 27px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.amount-field input::placeholder { color: #a8b1c2; }
.amount-field>span { color: var(--muted); font-size: 12px; font-weight: 650; }
.amount-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.amount-chips button { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; color: #65728a; background: var(--surface-soft); font-size: 11px; font-weight: 650; }
.amount-chips button:hover:not(:disabled) { color: var(--accent-dark); border-color: #b9beef; background: var(--accent-soft); }
.percentages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.percentage { min-height: 48px; padding: 10px 5px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 14px; font-weight: 750; }
.percentage.active { color: var(--red); border-color: #e8bebe; background: var(--red-soft); }
.sell-estimate { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: 11px; }
.sell-estimate strong { min-width: 0; color: var(--red); text-align: right; font-size: 14px; overflow-wrap: anywhere; }
.trade-settings { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.trade-settings select { margin-left: auto; font-size: 11px; }
.help-badge { display: inline-grid; place-items: center; width: 13px; height: 13px; margin-left: 3px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font-size: 9px; }
.mev-note { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: 10px; }
.mev-note .dot { width: 5px; height: 5px; }
.gas-note { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; margin: 14px 0; border: 1px solid #eadcae; border-radius: 9px; color: #795712; background: var(--amber-soft); font-size: 11px; line-height: 1.8; }
.gas-note>span { display: grid; place-items: center; flex-shrink: 0; width: 17px; height: 17px; margin-top: 2px; border: 1px solid #d8bd79; border-radius: 50%; font-size: 10px; font-weight: 800; }
.trade-submit { width: 100%; min-height: 43px; justify-content: space-between; padding: 10px 15px; }
.button.primary.trade-submit.sell { border-color: var(--red); background: var(--red); }
.button.primary.trade-submit.sell:hover:not(:disabled) { border-color: #9e3737; background: #9e3737; }
.button-aside { display: inline-flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 500; }
.button-aside span { font-size: 16px; }
.trade-message { margin: 12px 0; padding: 10px 12px; border: 1px solid #d9dcfa; border-radius: 9px; color: var(--accent-dark); background: var(--accent-soft); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
#trade-error:not(:empty) { margin: 12px 0; }
.trade-disclaimer { margin-top: 10px; text-align: center; font-size: 11px; line-height: 1.8; color: var(--muted); }

/* Wallet card and operational notes. */
.side-stack { display: grid; min-width: 0; gap: 14px; }
.outline-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d9dcfa; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 20px; }
.wallet-identity { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.wallet-avatar { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border: 1px solid #d9dcfa; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-size: 18px; font-weight: 800; }
.wallet-identity strong { font-size: 12px; }
.wallet-identity div>span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.wallet-address-box { margin-bottom: 16px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.address-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.wallet-address-box code { display: block; color: #43536d; }
.wallet-address-box button { margin-top: 3px; }
.session-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.session-row strong { min-width: 0; color: #35445e; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-actions { display: grid; gap: 8px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.wallet-actions .button { font-size: 12px; }
.wallet-actions .button>span:nth-child(2) { flex: 1; text-align: left; }
#authorize-wallet { color: var(--accent-dark); border-color: #d4d8f4; background: var(--accent-soft); }
#authorize-wallet:hover:not(:disabled) { border-color: #9299eb; background: #e5e8ff; }
.auth-help { font-size: 11px; margin-top: 12px; }
.quiet-card { min-width: 0; padding: 17px 20px; border: 1px solid var(--line); border-radius: 15px; background: #ffffffe6; }
.quiet-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quiet-heading h3 { font-size: 13px; }
.quiet-heading .subtle-pill { background: var(--surface-soft); color: var(--muted); }
.assurances { list-style: none; padding: 0; margin: 14px 0 0; }
.assurances li { display: flex; align-items: flex-start; gap: 10px; }
.assurances li+li { margin-top: 12px; }
.assurances li>span { display: grid; place-items: center; width: 23px; height: 23px; flex-shrink: 0; border: 1px solid #d9dcfa; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 750; }
.assurances strong { color: #43536d; font-size: 11px; }
.assurances p { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.8; }

/* History stays scrollable without widening the page on phones. */
.orders-panel { margin-top: 14px; }
.orders-panel .error-text { margin: 12px 20px; }
.table-scroll { overflow-x: auto; border-radius: 0 0 15px 15px; }
table { width: 100%; min-width: 690px; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th { padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
td { max-width: 290px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: #35445e; font-size: 12px; vertical-align: top; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8f9ff; }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
td details { margin-top: 5px; color: var(--muted); font-size: 10px; }
td summary { cursor: pointer; }
td details code { display: block; max-width: 260px; margin-top: 5px; font-size: 10px; }
.order-status { display: inline-block; padding: 4px 7px; border-radius: 5px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 650; white-space: nowrap; }
.order-status.failed { color: var(--red); background: var(--red-soft); }
.order-status.pending { color: var(--amber); background: var(--amber-soft); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 28px 14px 30px; text-align: center; }
.empty-lines { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 3px; border: 1px solid var(--line); border-radius: 10px; color: #7b87a2; background: var(--surface-soft); font-size: 24px; }
.empty-state strong { color: #536075; font-size: 12px; font-weight: 650; }
.empty-state p { color: var(--muted); font-size: 11px; }
.operation-notices:not(:empty) { padding: 14px 20px 0; }
.operation-notices>div { margin-bottom: 12px; padding: 11px 13px; border: 1px solid #eadcae; border-radius: 9px; background: var(--amber-soft); color: #795712; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.operation-notices code { font-size: 10px; }
.asset-details { margin-top: 14px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 12px; background: #ffffffe6; color: var(--muted); font-size: 11px; }
.asset-details summary { cursor: pointer; color: #43536d; font-weight: 650; }
.asset-row { display: grid; grid-template-columns: minmax(60px, .4fr) minmax(0, 2fr) minmax(100px, 1fr); align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.asset-row:last-child { border-bottom: 0; padding-bottom: 0; }
.asset-row strong { color: #35445e; text-align: right; font-size: 11px; font-weight: 650; }
.asset-row code { font-size: 10px; }
.page-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 20px 0 30px; color: var(--muted); font-size: 10px; }
.page-footer strong { color: #43536d; }

/* Authorization and account switch dialogs. */
dialog { width: min(500px, calc(100% - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 28px; overflow: auto; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 60px #1f284b33; }
dialog::backdrop { background: #17203366; backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-heading .section-kicker { font-size: 9px; }
.dialog-heading h2 { font-size: 20px; letter-spacing: -.025em; }
.close-button { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border: 0; border-radius: 8px; color: #65728a; background: var(--surface-soft); font-size: 23px; line-height: 1; }
.close-button:hover { color: var(--accent-dark); background: var(--accent-soft); }
.qr-wrap { margin: 20px 0; text-align: center; }
.qr-wrap img { max-width: 100%; height: auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pairing { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0; color: var(--muted); font-size: 11px; }
.pairing strong { max-width: 100%; color: var(--accent-dark); font-size: 23px; font-weight: 800; letter-spacing: .12em; overflow-wrap: anywhere; }
.auth-message { margin: 15px 0; color: #43536d; font-size: 12px; line-height: 1.8; }
.dialog-footnote { margin-top: 18px; font-size: 11px; text-align: center; }
.notice-box { margin-top: 17px; padding: 12px; border: 1px solid #eadcae; border-radius: 9px; color: #795712; background: var(--amber-soft); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.notice-box strong { font-size: 12px; }
.notice-box p { margin-top: 6px; }
.audit-result { margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; color: #43536d; background: var(--surface-soft); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.audit-result.risky { border-color: #efcdcd; color: #9e3737; background: var(--red-soft); }
.audit-result strong { display: block; margin-bottom: 6px; font-size: 12px; }
.audit-result ul { margin: 8px 0; padding-left: 18px; }
.audit-result li+li { margin-top: 5px; }
#switch-dialog .wallet-address-box { margin-top: 18px; }
#switch-dialog .primary { margin-top: 20px; justify-content: center; }
#switch-error { margin-top: 14px; }
.toast { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: 90vw; padding: 12px 18px; border: 1px solid #d9dcfa; border-radius: 10px; background: var(--surface); color: var(--accent-dark); box-shadow: 0 8px 30px #26336126; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
noscript { display: block; padding: 16px; color: var(--red); text-align: center; }

@media (max-width: 1050px) {
  .main-grid { grid-template-columns: minmax(0, 1fr); }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .balance-number>span { font-size: 23px; }
  .balance-label .card-tag { display: none; }
}
@media (max-width: 720px) {
  .topbar, .workspace { width: calc(100% - 20px); }
  .topbar-inner { flex-wrap: wrap; gap: 14px; padding: 16px 0; }
  .brand { font-size: 20px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .network-card { flex: 1; min-width: 0; }
  .network-tag { display: none; }
  .workspace-nav>.button { padding: 8px 12px; }
  .section-links { flex-basis: 100%; justify-content: flex-start; gap: 22px; padding: 5px 2px 1px; }
  .section-links a { font-size: 11px; }
  .balances-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .balance-card { padding: 14px; }
  .balance-label { gap: 7px; font-size: 11px; }
  .balance-label small { font-size: 10px; }
  .coin-icon { width: 28px; height: 28px; border-radius: 8px; }
  .balance-number { gap: 5px; margin-top: 10px; }
  .balance-number>span { font-size: 22px; }
  .balance-bottom { font-size: 10px; }
  .balance-bottom .tiny-dot { display: none; }
  .selected-balance { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; align-items: center; }
  .selected-balance .balance-number { margin: 0; justify-content: flex-end; }
  .selected-balance .balance-bottom { grid-column: 1 / -1; }
  .workspace-note { align-items: flex-start; padding: 10px 12px; }
  .note-tag { display: none; }
  .panel-header { padding: 15px 16px; }
  .panel-header h2 { font-size: 15px; }
  .panel-body { padding: 16px; }
  .side-stack { grid-template-columns: minmax(0, 1fr); }
  .quiet-card { padding: 16px; }
  .orders-panel .error-text { margin: 12px 16px; }
  .operation-notices:not(:empty) { padding: 12px 16px 0; }
  .asset-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; }
  .asset-row code { grid-column: 1 / -1; grid-row: 2; }
  .page-footer { flex-direction: column; padding: 18px 0 24px; font-size: 10px; }
}
@media (max-width: 480px) {
  .login-layout { padding: 24px 12px; }
  .login-box { padding: 24px 20px; }
  .login-box .brand { gap: 10px; }
  .login-box .brand small { font-size: 10px; }
  .balance-card { padding: 13px 11px; }
  .balance-label small { font-size: 9px; }
  .balance-number>span { font-size: 20px; }
  .panel-header { gap: 9px; }
  .panel-header p { font-size: 10px; }
  .token-entry { padding: 11px; }
  .token-label { gap: 7px; font-size: 11px; }
  .field-hint { font-size: 9px; }
  .contract-prefix { padding: 0 8px; }
  .ca-field input { padding: 10px 7px; font-size: 11px; }
  .ca-field input::placeholder { font-size: 10px; }
  .input-action { padding: 5px 7px; font-size: 10px; }
  .asset-select-label { gap: 6px; }
  .amount-field input { font-size: 25px; }
  .trade-settings { gap: 8px; }
  .mev-note { width: 100%; }
  dialog { padding: 23px 20px; }
  .dialog-heading h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
