/* Pavilion Bridge app. An Ink card on the Paper page, the same identity as the homepage widget
   and Pavilion Wallet. Radius family: 24 card, 18 panels, 16 buttons, pills for chips. */
.bx {
  --bx-card: #1b2b41;
  --bx-raise: #24374f;
  --bx-raise-2: #2d4361;
  --bx-line: rgba(244, 242, 236, .1);
  --bx-line-2: rgba(244, 242, 236, .2);
  --bx-text: #f4f2ec;
  --bx-muted: #aab7c4;
  --bx-faint: #7f90a3;
  --bx-accent: #8db1c1;
  --bx-accent-strong: #b9d2dc;
  --bx-error: #f0a898;
  position: relative;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  color: var(--bx-text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}
:where(.bx) *, :where(.bx) *::before, :where(.bx) *::after { box-sizing: border-box; }
:where(.bx) :where(p, h2, dl, dd, ol, ul) { margin: 0; }
:where(.bx) button { font: inherit; color: inherit; cursor: pointer; }
:where(.bx) button:disabled { cursor: not-allowed; }
:where(.bx) code { font: 500 12px/16px var(--font-mono); letter-spacing: 0; }
.bx :focus-visible, .bx-hbtn:focus-visible { outline: 2px solid var(--bx-accent); outline-offset: 2px; }
.bx-i { width: 20px; height: 20px; flex: none; }
.bx [hidden], .bx-hbtn[hidden] { display: none !important; }
.bx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Card ---------- */
.bx-card {
  position: relative;
  padding: 8px;
  border-radius: 24px;
  background: var(--bx-card);
  box-shadow: inset 0 1px 0 rgba(244, 242, 236, .05), 0 40px 90px -40px rgba(27, 43, 65, .7), 0 14px 32px -20px rgba(27, 43, 65, .5);
}
.bx-head { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 2px 4px 8px; }
.bx-head-title { flex: 1; min-width: 0; font: 600 16px/24px var(--font-sans); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bx-tabs { display: flex; gap: 2px; }
.bx-tabs [role="tab"] { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: 9999px; background: transparent; color: var(--bx-muted); font-weight: 600; font-size: 15px; transition: background-color .2s, color .2s; }
.bx-tabs [role="tab"]:hover { color: var(--bx-text); }
.bx-tabs [aria-selected="true"] { background: var(--bx-raise); color: var(--bx-text); }
.bx-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px; background: var(--bx-accent); color: #1b2b41; font: 700 11px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.bx-status { display: inline-flex; align-items: center; gap: 8px; height: 32px; margin-left: auto; padding: 0 12px; border: 1px solid var(--bx-line); border-radius: 9999px; background: transparent; color: var(--bx-muted); font-weight: 600; font-size: 12px; transition: border-color .2s, color .2s; }
.bx-status:hover { border-color: var(--bx-line-2); color: var(--bx-text); }
.bx-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bx-accent); box-shadow: 0 0 0 3px rgba(141, 177, 193, .2); }
.bx-status.is-paused .bx-status-dot { background: var(--bx-error); box-shadow: 0 0 0 3px rgba(240, 168, 152, .2); }
.bx-icon-btn { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--bx-muted); transition: background-color .2s, color .2s; }
.bx-icon-btn:hover { background: var(--bx-raise); color: var(--bx-text); }
.bx-icon-btn.is-small { width: 28px; height: 28px; border-radius: 8px; }
.bx-icon-btn.is-small .bx-i { width: 16px; height: 16px; }

/* ---------- Bridge form ---------- */
.bx-form { display: grid; grid-template-columns: minmax(0, 1fr); }
.bx-swap-stack { display: flex; flex-direction: column; }
.bx-panel { padding: 14px 16px 12px; border: 1px solid transparent; border-radius: 18px; background: var(--bx-raise); transition: border-color .2s; }
.bx-panel:focus-within { border-color: var(--bx-line-2); }
.bx-panel.is-over { border-color: rgba(240, 168, 152, .5); }
.bx-panel.is-to { background: transparent; border-color: var(--bx-line); }
.bx-panel-top { display: flex; align-items: center; gap: 8px; min-height: 24px; font-size: 13px; line-height: 16px; color: var(--bx-muted); }
.bx-panel-label { min-width: 34px; font-weight: 600; }
.bx-chain { display: inline-flex; align-items: center; gap: 6px; color: var(--bx-text); font-weight: 600; }
.bx-panel-acct { margin-left: auto; color: var(--bx-faint); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bx-amount-row { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; }
.bx-amount { flex: 1; min-width: 0; width: 100%; height: 48px; padding: 0; border: 0; background: transparent; color: var(--bx-text); font: 500 40px/48px var(--font-sans); letter-spacing: -.025em; font-variant-numeric: tabular-nums; outline: none; }
.bx-amount::placeholder { color: var(--bx-faint); opacity: 1; }
.bx-amount.is-out { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-amount.is-zero { color: var(--bx-faint); }
.bx-token { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 40px; padding: 0 14px 0 6px; border-radius: 9999px; background: var(--bx-raise-2); font-weight: 600; font-size: 16px; }
.bx-panel.is-to .bx-token { background: var(--bx-raise); }
.bx-panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; font-size: 13px; line-height: 16px; color: var(--bx-muted); font-variant-numeric: tabular-nums; }
.bx-panel-foot .is-error { color: var(--bx-error); }
.bx-quick { display: flex; flex: none; gap: 4px; }
.bx-quick button { height: 28px; padding: 0 10px; border: 1px solid var(--bx-line-2); border-radius: 9999px; background: transparent; font-weight: 600; font-size: 12px; transition: background-color .2s; }
.bx-quick button:hover { background: var(--bx-raise-2); }
.bx-flip { position: relative; z-index: 1; display: grid; place-items: center; align-self: center; width: 44px; height: 44px; margin: -18px 0; padding: 0; border: 4px solid var(--bx-card); border-radius: 14px; background: var(--bx-raise-2); color: var(--bx-text); transition: transform .3s var(--ease), background-color .2s; }
.bx-flip:hover { background: #36506f; transform: rotate(180deg); }
.bx-flip .bx-i { width: 18px; height: 18px; }
.bx-rec { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--bx-line); font-size: 13px; line-height: 20px; }
.bx-rec-label { color: var(--bx-muted); font-weight: 600; }
.bx-rec-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.bx-rec-value.is-muted, .is-muted { color: var(--bx-faint); font-weight: 500; }
.bx-rec-own { color: var(--bx-faint); }
.bx-rec .bx-link { margin-left: auto; }
.bx-rec-edit { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--bx-line); }
.bx-rec-input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--bx-line-2); border-radius: 12px; background: rgba(9, 16, 27, .25); color: var(--bx-text); font: 500 13px/20px var(--font-mono); outline: none; }
.bx-rec-input:focus { border-color: var(--bx-accent); box-shadow: 0 0 0 3px rgba(141, 177, 193, .2); }
.bx-rec-input[aria-invalid="true"] { border-color: rgba(240, 168, 152, .6); }
.bx-rec-msg { margin: 8px 0 4px; font-size: 12px; line-height: 16px; color: var(--bx-faint); }
.bx-rec-msg.is-error { color: var(--bx-error); }
.bx-type { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: var(--bx-raise-2); color: var(--bx-accent-strong); font-weight: 600; }

.bx-details { margin: 6px 0 0; }
.bx-details-toggle { display: flex; flex-wrap: wrap; row-gap: 4px; align-items: center; gap: 0; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--bx-muted); font-weight: 500; font-size: 13px; line-height: 16px; text-align: left; transition: background-color .2s; }
.bx-details-toggle:hover { background: rgba(244, 242, 236, .04); }
.bx-details-toggle > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bx-details-toggle > span + span::before { content: ""; width: 3px; height: 3px; margin: 0 10px 0 4px; border-radius: 50%; background: var(--bx-faint); }
.bx-details-toggle .bx-i:not(.bx-chev) { width: 15px; height: 15px; }
.bx-chev { width: 18px; height: 18px; margin-left: auto; transition: transform .25s var(--ease); }
[aria-expanded="true"] > .bx-chev { transform: rotate(180deg); }
.bx-split { display: flex; gap: 8px; margin: 2px 12px 6px; padding: 10px 12px; border-radius: 12px; background: rgba(141, 177, 193, .1); color: var(--bx-accent-strong); font-size: 12px; line-height: 17px; }
.bx-split .bx-i { width: 16px; height: 16px; margin-top: 1px; }
.bx-rows { display: grid; margin: 0 12px 6px; }
.bx-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-top: 1px solid var(--bx-line); font-size: 13px; line-height: 18px; }
.bx-rows dt { flex: none; color: var(--bx-muted); }
.bx-rows dd { min-width: 0; color: var(--bx-text); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.bx-rows dd .is-error { color: var(--bx-error); }
.bx-rows.is-facts dd { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.bx-rows.is-facts code { word-break: break-all; text-align: right; }
.bx-rows.is-status > div.is-block { display: grid; gap: 6px; }
.bx-rows.is-status .is-block dd { text-align: left; display: grid; gap: 6px; }
.bx-rows.is-status small { color: var(--bx-faint); font-size: 12px; font-weight: 500; }

.bx-cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; margin-top: 6px; padding: 0 20px; border: 0; border-radius: 16px; background: var(--paper, #f4f2ec); color: var(--ink, #1b2b41); font-weight: 700; font-size: 16px; line-height: 20px; transition: background-color .2s, transform .1s; }
.bx-cta:hover:not(:disabled) { background: #fff; }
.bx-cta:active:not(:disabled) { transform: scale(.995); }
.bx-cta:disabled { background: var(--bx-raise); color: var(--bx-faint); }
.bx-cta small { padding: 2px 8px; border-radius: 9999px; background: rgba(27, 43, 65, .08); color: #4a5a6e; font-size: 12px; font-weight: 600; }
.bx-cta.is-quiet { background: transparent; border: 1px solid var(--bx-line-2); color: var(--bx-text); }
.bx-cta.is-quiet:hover:not(:disabled) { background: var(--bx-raise); }
.bx-cta.is-quiet:disabled { background: transparent; border-color: var(--bx-line); color: var(--bx-faint); }
.bx-link { display: inline; padding: 0; border: 0; background: none; color: var(--bx-accent-strong); font-weight: 600; font-size: 13px; line-height: 20px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .2s; }
.bx-link:hover { text-decoration-color: currentColor; }
.bx-link.is-center { display: block; margin: 8px auto 2px; }
.bx-fine { color: var(--bx-faint); font-size: 12px; line-height: 17px; }
.bx-fine.is-center { text-align: center; }

.bx-note { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; padding: 12px 14px; border-radius: 16px; background: var(--bx-raise); font-size: 13px; line-height: 18px; }
.bx-note > .bx-i { width: 18px; height: 18px; margin-top: 1px; color: var(--bx-accent); }
.bx-note > div { flex: 1; min-width: 0; }
.bx-note p:not(.bx-note-title) { color: var(--bx-muted); }
.bx-note-title { margin-bottom: 2px; color: var(--bx-text); font-weight: 700; }
.bx-note.is-warn { background: rgba(240, 168, 152, .1); }
.bx-note.is-warn > .bx-i { color: var(--bx-error); }
.bx-note .bx-link { margin-top: 6px; display: inline-block; }

/* ---------- Logos ---------- */
.bx-logo { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; }
.bx-logo svg { display: block; }
.bx-logo-pearl { background: #cfe0e7; color: #1b2b41; }
.bx-logo-pearl svg { width: 64%; height: auto; fill: currentColor; transform: translateY(4%); }
.bx-logo-eth { background: #f4f2ec; color: #1b2b41; }
.bx-logo-eth svg { width: 60%; height: 60%; fill: currentColor; }
.bx-logo.is-chain { width: 20px; height: 20px; }
.bx-token-logo { position: relative; display: inline-flex; flex: none; }
.bx-token-logo .bx-badge { position: absolute; right: -4px; bottom: -3px; display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 2px var(--bx-raise-2); }
.bx-token-logo .bx-badge .bx-logo { width: 14px; height: 14px; }
.bx-token-logo.is-lg > .bx-logo { width: 40px; height: 40px; }
.bx-token-logo.is-lg .bx-badge { right: -3px; bottom: -2px; box-shadow: 0 0 0 2px var(--bx-raise); }
.bx-token-logo.is-lg .bx-badge .bx-logo { width: 18px; height: 18px; }
.bx-mark { width: 16px; height: 16px; }

/* ---------- Crossing tracker ---------- */
.bx-crossing { display: grid; gap: 12px; padding: 0 0 2px; }
.bx-route-card { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--bx-raise); }
.bx-route-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bx-route-side > div { min-width: 0; }
.bx-route-amt { font-weight: 600; font-size: 18px; line-height: 24px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bx-route-amt span { display: block; color: var(--bx-muted); font-weight: 500; font-size: 14px; }
.bx-route-sub { overflow: hidden; color: var(--bx-faint); font-size: 12px; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; }
.bx-route-arrow { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bx-raise-2); color: var(--bx-muted); }
.bx-route-arrow .bx-i { width: 16px; height: 16px; }
.bx-eta { display: flex; align-items: center; gap: 8px; padding: 0 6px; color: var(--bx-muted); font-size: 13px; line-height: 16px; }
.bx-eta .bx-i { width: 16px; height: 16px; }
.bx-steps { list-style: none; padding: 4px 6px 0; }
.bx-step { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 14px; padding-bottom: 16px; }
.bx-step:last-child { padding-bottom: 2px; }
.bx-step::before { content: ""; position: absolute; left: 11px; top: 28px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--bx-line); }
.bx-step:last-child::before { display: none; }
.bx-step.is-done::before { background: rgba(141, 177, 193, .55); }
.bx-dot { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--bx-line-2); border-radius: 50%; color: #1b2b41; font: 800 13px/1 var(--font-sans); }
.bx-dot.is-done { border-color: var(--bx-accent); background: var(--bx-accent); }
.bx-dot.is-done .bx-i { width: 14px; height: 14px; stroke-width: 2.6; }
.bx-dot.is-active { border-color: var(--bx-accent); }
.bx-dot.is-active span { width: 8px; height: 8px; border-radius: 50%; background: var(--bx-accent); animation: bx-pulse 1.6s ease-in-out infinite; }
.bx-dot.is-active::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(141, 177, 193, .25); animation: bx-ring 1.6s ease-out infinite; }
.bx-dot.is-wait { border-color: rgba(141, 177, 193, .6); border-style: dashed; color: var(--bx-accent); }
.bx-dot.is-wait .bx-i { width: 13px; height: 13px; stroke-width: 2.2; }
.bx-dot.is-error { border-color: var(--bx-error); background: var(--bx-error); }
.bx-dot.is-action { border-color: var(--bx-text); background: var(--bx-text); }
.bx-dot.is-skip { border-style: dashed; opacity: .45; }
.bx-step-body { min-width: 0; padding-top: 2px; }
.bx-step-title { font-weight: 600; font-size: 15px; line-height: 20px; }
.bx-step.is-todo .bx-step-title, .bx-step.is-skip .bx-step-title { color: var(--bx-faint); font-weight: 500; }
.bx-step.is-skip .bx-step-title { text-decoration: line-through; text-decoration-color: rgba(127, 144, 163, .6); }
.bx-step-meta { margin-top: 2px; color: var(--bx-muted); font-size: 13px; line-height: 18px; }
.bx-step.is-error .bx-step-meta { color: var(--bx-error); }
.bx-step.is-action .bx-step-meta { color: var(--bx-text); }
.bx-tx { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.bx-tx code { color: var(--bx-faint); }
.bx-bar { display: block; height: 4px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: var(--bx-line); }
.bx-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--bx-accent); transition: width .6s var(--ease); }
.bx-bar.is-wide { margin-top: 2px; }
.bx-success { display: grid; justify-items: center; gap: 2px; padding: 12px 0 2px; text-align: center; }
.bx-success-mark { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 10px; border-radius: 50%; background: var(--bx-accent); color: #1b2b41; box-shadow: 0 0 0 8px rgba(141, 177, 193, .14); }
.bx-success-mark .bx-i { width: 28px; height: 28px; stroke-width: 2.4; }
.bx-success-title { font-weight: 600; font-size: 24px; line-height: 32px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bx-success-sub { color: var(--bx-muted); font-size: 14px; }
.bx-done-actions { display: grid; }
.bx-fund { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px; border-radius: 18px; background: var(--bx-raise); }
.bx-fund-qr { padding: 6px; border-radius: 12px; background: #f4f2ec; }
.bx-qr { display: block; width: 100%; height: auto; }
.bx-fund-title { font-weight: 700; font-size: 16px; line-height: 22px; }
.bx-fund-sub { color: var(--bx-muted); font-size: 13px; line-height: 18px; }
.bx-copyline { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 8px; padding: 8px 6px 8px 10px; border-radius: 12px; background: rgba(9, 16, 27, .25); }
.bx-addr { display: block; flex: 1; min-width: 0; padding-top: 6px; color: var(--bx-text); overflow-wrap: anywhere; word-break: break-all; }
.bx-fund-info { min-width: 0; }
.bx-steps-summary { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--bx-line); border-radius: 16px; background: transparent; color: var(--bx-text); font-weight: 600; font-size: 14px; text-align: left; }
.bx-steps-summary > .bx-i { width: 18px; height: 18px; color: var(--bx-accent); }
.bx-steps-summary .bx-link { margin-left: auto; }
.bx-steps-summary:hover { background: rgba(244, 242, 236, .04); }
.bx-facts { margin: 0 -2px; border-top: 1px solid var(--bx-line); padding-top: 4px; }
.bx-details-toggle.is-facts { color: var(--bx-muted); font-weight: 600; }

/* ---------- Activity ---------- */
.bx-activity { display: grid; gap: 4px; }
.bx-filters { display: flex; gap: 6px; padding: 0 4px 8px; overflow-x: auto; scrollbar-width: none; }
.bx-filters button { flex: none; height: 32px; padding: 0 12px; border: 1px solid var(--bx-line); border-radius: 9999px; background: transparent; color: var(--bx-muted); font-weight: 600; font-size: 13px; transition: background-color .2s, color .2s; }
.bx-filters button:hover { color: var(--bx-text); }
.bx-filters [aria-pressed="true"] { border-color: var(--bx-text); background: var(--bx-text); color: #1b2b41; }
.bx-list { display: grid; gap: 2px; padding: 0; list-style: none; }
.bx-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 16px; background: transparent; text-align: left; transition: background-color .2s; }
.bx-row:hover { background: var(--bx-raise); }
.bx-row-logos { display: flex; flex: none; width: 44px; }
.bx-row-logos .bx-logo { width: 28px; height: 28px; }
.bx-row-logos .bx-logo + .bx-logo { margin-left: -12px; box-shadow: 0 0 0 2px var(--bx-card); }
.bx-row:hover .bx-row-logos .bx-logo + .bx-logo { box-shadow: 0 0 0 2px var(--bx-raise); }
.bx-row-main { display: grid; flex: 1; min-width: 0; }
.bx-row-title { font-weight: 600; font-size: 15px; line-height: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bx-row-sub { overflow: hidden; color: var(--bx-faint); font-size: 12px; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; }
.bx-row-chev { width: 16px; height: 16px; color: var(--bx-faint); }
.bx-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 26px; padding: 0 10px; border-radius: 9999px; font-weight: 600; font-size: 12px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bx-pill.is-live { background: rgba(141, 177, 193, .16); color: var(--bx-accent-strong); }
.bx-pill.is-wait { background: var(--bx-raise-2); color: var(--bx-muted); }
.bx-pill.is-action { background: var(--bx-text); color: #1b2b41; }
.bx-pill.is-done { border: 1px solid var(--bx-line-2); color: var(--bx-muted); }
.bx-pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: bx-pulse 1.6s ease-in-out infinite; }
.bx-empty { display: grid; justify-items: center; gap: 10px; padding: 40px 16px 16px; text-align: center; }
.bx-empty > .bx-i { width: 28px; height: 28px; color: var(--bx-faint); }
.bx-empty-title { font-weight: 600; font-size: 15px; }
.bx-empty .bx-cta { margin-top: 10px; }
.bx-empty.is-small { padding: 32px 16px 24px; gap: 4px; }

/* ---------- Header actions (on the Paper masthead) ---------- */
.bx-hbtn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 1px solid rgba(27, 43, 65, .16); border-radius: 9999px; background: rgba(244, 242, 236, .78); color: var(--ink, #1b2b41); font: 600 14px/20px var(--font-sans); white-space: nowrap; cursor: pointer; backdrop-filter: blur(8px); transition: background-color .2s, border-color .2s; }
.bx-hbtn:hover { border-color: rgba(27, 43, 65, .32); background: #fbfaf7; }
.bx-hbtn.is-primary { border-color: var(--ink, #1b2b41); background: var(--ink, #1b2b41); color: var(--paper, #f4f2ec); }
.bx-hbtn.is-primary:hover { background: #2e405a; }
.bx-hbtn .bx-i { width: 18px; height: 18px; }
.bx-hbtn .bx-count { background: var(--ink, #1b2b41); color: var(--paper, #f4f2ec); }
.bx-hbtn.is-account { padding: 0 12px 0 6px; }
.bx-avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink, #1b2b41); color: var(--paper, #f4f2ec); }
.bx-avatar.is-lg { width: 40px; height: 40px; }
.bx-avatar.is-lg .bx-mark { width: 20px; height: 20px; }
.bx-acct-text { display: grid; text-align: left; line-height: 16px; }
.bx-acct-text small { color: var(--muted, #4a5a6e); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bx-acct-wrap { position: relative; }
.bx-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; display: grid; gap: 4px; width: 340px; padding: 12px; border-radius: 22px; background: #1b2b41; color: #f4f2ec; text-align: left; box-shadow: 0 30px 70px -24px rgba(27, 43, 65, .7); }
.bx-menu-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; }
.bx-menu-head .bx-avatar { background: #f4f2ec; color: #1b2b41; }
.bx-menu-name { font-weight: 700; font-size: 15px; line-height: 20px; }
.bx-menu-sub { color: #aab7c4; font-size: 12px; line-height: 16px; }
.bx-menu-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: #24374f; font-size: 13px; line-height: 18px; }
.bx-menu-row > div { flex: 1; min-width: 0; }
.bx-menu-row code { color: #aab7c4; font: 500 12px/16px var(--font-mono); }
.bx-menu-bal { display: grid; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bx-menu-bal small { color: #7f90a3; font-weight: 500; font-size: 12px; }
.bx-menu .bx-icon-btn { color: #aab7c4; }
.bx-menu .bx-icon-btn:hover { background: #2d4361; color: #f4f2ec; }
.bx-menu-label { margin: 10px 4px 2px; color: #7f90a3; font-size: 12px; font-weight: 600; }
.bx-menu-acct { display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: #f4f2ec; font: 600 14px/20px var(--font-sans); text-align: left; cursor: pointer; }
.bx-menu-acct:hover { background: #24374f; }
.bx-menu-acct small { margin-left: auto; color: #7f90a3; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bx-menu-acct .bx-i { width: 16px; height: 16px; color: #8db1c1; }
.bx-menu-out { display: flex; align-items: center; gap: 8px; height: 44px; margin-top: 6px; padding: 0 10px; border: 0; border-top: 1px solid rgba(244, 242, 236, .1); border-radius: 0; background: transparent; color: #aab7c4; font: 600 14px/20px var(--font-sans); cursor: pointer; }
.bx-menu-out:hover { color: #f4f2ec; }
.bx-menu-out .bx-i { width: 18px; height: 18px; }
.bx-topbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }

/* ---------- Dialogs, toast, preview line ---------- */
.bx-layer:empty { display: none; }
.bx-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(15, 25, 39, .45); backdrop-filter: blur(3px); }
.bx-dialog { position: fixed; z-index: 61; left: 50%; top: 50%; display: grid; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 8px; border-radius: 24px; background: var(--bx-card); color: var(--bx-text); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .6); transform: translate(-50%, -50%); }
.bx-dialog.is-entering { animation: bx-in .22s var(--ease, ease-out); }
.bx-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 12px; }
.bx-dlg-head h2 { font-weight: 600; font-size: 18px; line-height: 24px; letter-spacing: -.01em; }
.bx-dlg-body { display: grid; gap: 12px; padding: 4px 8px 8px; }
.bx-dlg-body .bx-cta { margin-top: 2px; }
.bx-dlg-body .bx-rows { margin: 0 4px; }
.bx-dlg-body .bx-rows > div:first-child { border-top: 0; }
.bx-dlg-foot { margin: 0 12px 8px; padding-top: 12px; border-top: 1px solid var(--bx-line); color: var(--bx-faint); font-size: 12px; line-height: 16px; }
.bx-dlg-label { color: var(--bx-faint); font-weight: 600; font-size: 12px; line-height: 16px; }
.bx-route { display: grid; gap: 0; padding: 10px 16px; border-radius: 18px; background: var(--bx-raise); }
.bx-route-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.bx-route-row > div { min-width: 0; }
.bx-route-down { display: grid; place-items: center; width: 40px; height: 16px; color: var(--bx-faint); }
.bx-route-down .bx-i { width: 16px; height: 16px; }
.bx-recipient-full { display: grid; gap: 4px; padding: 0 4px; }
.bx-recipient-full code { color: var(--bx-text); font-size: 13px; line-height: 18px; word-break: break-all; }
.bx-callout { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(141, 177, 193, .1); color: var(--bx-muted); font-size: 13px; line-height: 18px; }
.bx-callout .bx-i { width: 18px; height: 18px; margin-top: 1px; color: var(--bx-accent); }
.bx-waiting { display: grid; justify-items: center; gap: 4px; padding: 14px 8px 2px; text-align: center; }
.bx-waiting-title { font-weight: 700; font-size: 15px; }
.bx-spinner { width: 32px; height: 32px; margin-bottom: 8px; border: 3px solid var(--bx-line-2); border-top-color: var(--bx-accent); border-radius: 50%; animation: bx-spin .9s linear infinite; }
.bx-wallet { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--bx-line); border-radius: 16px; background: var(--bx-raise); text-align: left; transition: border-color .2s, background-color .2s; }
.bx-wallet:hover { border-color: rgba(141, 177, 193, .6); }
.bx-wallet.is-featured { padding: 16px; border-color: var(--bx-line-2); }
.bx-wallet.is-featured .bx-avatar { background: #f4f2ec; color: #1b2b41; }
.bx-wallet-text { display: grid; flex: 1; min-width: 0; }
.bx-wallet-text b { font-weight: 600; font-size: 15px; line-height: 20px; }
.bx-wallet-text small { color: var(--bx-muted); font-size: 12px; line-height: 16px; }
.bx-wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bx-wallet-glyph { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--bx-raise-2); font-weight: 700; }
.bx-tag { flex: none; height: 24px; padding: 0 10px; border-radius: 9999px; background: var(--bx-accent); color: #1b2b41; font-weight: 700; font-size: 11px; line-height: 24px; }
.bx-toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 9999px; background: #1b2b41; color: #f4f2ec; font-weight: 600; font-size: 14px; line-height: 20px; box-shadow: 0 18px 40px -16px rgba(27, 43, 65, .6); transform: translateX(-50%); pointer-events: none; }
.bx-toast:not(.is-shown) { display: none; }
.bx-toast .bx-i { width: 18px; height: 18px; color: #8db1c1; }
.bx-preview { display: flex; align-items: center; justify-content: center; gap: 6px; width: fit-content; max-width: 100%; margin: 14px auto 0; padding: 6px 12px; border-radius: 9999px; background: rgba(244, 242, 236, .88); color: var(--muted, #4a5a6e); font-size: 12px; line-height: 16px; text-align: center; backdrop-filter: blur(6px); }
.bx-preview .bx-i { width: 14px; height: 14px; }

@keyframes bx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bx-ring { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.15); } }
@keyframes bx-spin { to { transform: rotate(360deg); } }
@keyframes bx-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
@keyframes bx-up { from { opacity: 0; transform: translateY(24px); } }

@media (max-width: 600px) {
  .bx-card { border-radius: 22px; }
  .bx-amount { font-size: 34px; }
  .bx-panel { padding: 12px 14px 10px; }
  .bx-details-toggle > span:nth-child(2) { display: none; }
  .bx-fund { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .bx-fund-qr { width: 168px; }
  .bx-fund-info { width: 100%; }
  .bx-copyline { text-align: left; }
  .bx-route-card { grid-template-columns: 1fr; gap: 6px; }
  .bx-route-arrow { transform: rotate(90deg); margin-left: 6px; }
  .bx-dialog { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92vh; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; transform: none; }
  .bx-dialog.is-entering { animation: bx-up .24s var(--ease, ease-out); }
  .bx-wallet-grid { grid-template-columns: 1fr; }
  .bx-hide-sm { display: none; }
  .bx-hbtn { height: 40px; padding: 0 12px; }
  .bx-hbtn.is-account { padding: 0 8px 0 4px; }
  .bx-hbtn.is-account .bx-acct-text small { display: none; }
  .bx-hbtn.is-activity { display: none; }
  .app-actions { min-width: 0; }
  .bx-panel-acct { max-width: none; }
  .bx-menu { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; }
  .bx-toast { bottom: 16px; max-width: calc(100vw - 32px); }
}
@media (max-width: 380px) {
  .bx-quick button[data-v="25"] { display: none; }
  .bx-status { width: 32px; padding: 0; justify-content: center; }
  .bx-status-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bx-hbtn.is-account .bx-acct-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bx *, .bx *::before, .bx *::after { animation: none !important; transition: none !important; }
}

/* ---------- Host page ---------- */
.bridge-page { min-height: 100vh; background: var(--paper); }
.bridge-page .site-header { position: relative; z-index: 30; }
.bridge-page .masthead { gap: 40px; }
.bridge-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bridge-scene img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.bridge-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(244, 242, 236, .9) 0, rgba(244, 242, 236, .35) 28%, rgba(244, 242, 236, 0) 52%); }
.bridge-workspace { position: relative; z-index: 1; min-height: calc(100vh - 88px); padding: 32px 16px 96px; }
.app-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* Narrow desktops: the card's own Activity tab stands in for the header shortcut, so the nav keeps one line. */
@media (max-width: 1100px) {
  .app-actions .bx-hbtn.is-activity { display: none; }
}
@media (max-width: 1000px) {
  .bridge-page .masthead { gap: 24px; }
}
@media (max-width: 900px) {
  .bridge-page .masthead { gap: 8px; }
  .app-actions { gap: 6px; }
  .bridge-workspace { padding: 12px 12px 64px; }
}
@media (max-width: 600px) {
  .bridge-scene img { object-position: 42% 100%; }
}
.bridge-page .bridge-noscript { max-width: 480px; margin: 40px auto; padding: 0 16px; color: var(--ink); text-align: center; }
.bridge-page .bridge-noscript a { display: inline; margin: 0; text-decoration: underline; }
.bx-addr, .bx-recipient-full code, .bx-rows.is-facts code, .bx-menu-row code { white-space: normal; }

/* Keep complete token names visible in compact account and activity views. */
.bx-row-title { white-space: normal; overflow-wrap: anywhere; }
.bx-menu-bal { min-width: 0; max-width: 50%; overflow-wrap: anywhere; }
.bx-menu-acct { min-height: 44px; height: auto; padding-block: 10px; }
.bx-menu-acct small { text-align: right; }
