/* Bridge Dialog — extracted from styles.css 2026-05-17 (#19a). */
/* Loaded by index.html AFTER styles.css so cascade order is preserved. */

/* ============ BRIDGE DIALOG (Deposit / Withdraw via Relay) ============ */

.bridge-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(40, 35, 30, 0.5);
    display: flex;
    /* Top-anchored, not centered: the deposit card changes height when a coin's
       amount form expands. A vertically-centered dialog would re-center on every
       height change, shoving the content upward (clicking the last coin appeared
       to "jump" to a coin near the top). flex-start keeps the top edge fixed so
       the card only grows downward; the dialog's own max-height + overflow
       handles tall content. */
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding-top: 6vh;
    box-sizing: border-box;
    z-index: 10000;
    animation: fadeIn 0.15s;
    font-family: 'IBM Plex Mono', monospace;
}

/* Bridge dialog — visual sibling of the cart panel + wallet dropdown.
   Same warm-beige #faf6f0 surface, same #e8e0d4 borders, IBM Plex Mono
   throughout. Inherits the modal-center pattern (rather than slide-in)
   because it's not a long-running side-by-side surface. */
.bridge-dialog {
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    border-radius: 14px;
    width: 420px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(40, 35, 30, 0.18);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bridge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #e8e0d4;
}

.bridge-tabs {
    display: inline-flex;
    gap: 6px;
}

/* Match .cart-tab — rounded outlined pill that flips to dark brown when
   active. Per-tab color cues live as a small ::before dot. */
.bridge-tab {
    padding: 5px 14px;
    background: #f5ebe0;
    border: 1px solid #e8e0d4;
    border-radius: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #7a6f66;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bridge-tab:hover {
    background: #ece2d2;
    color: #5c5048;
    border-color: #d8cfc3;
}

.bridge-tab.active {
    background: #5c5048;
    color: #f5ebe0;
    border-color: #5c5048;
    box-shadow: none;
}

/* Kill the browser default focus-ring (blue outline) that lands on the
   tab after click — replaced with a subtle warm-tan inset so it stays
   in palette + keeps accessibility cue. */
.bridge-tab:focus { outline: none; }
.bridge-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #d4c4b0;
}

.bridge-tab::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
}

/* Per-tab dot color — preserved as a subtle accent that survives active
   state because we set color via :not(.active) selectors. */
.bridge-tab-deposit:not(.active)::before  { background: #7fbbb3; opacity: 0.9; }
.bridge-tab-withdraw:not(.active)::before { background: #e67e80; opacity: 0.9; }
.bridge-tab-transfer:not(.active)::before { background: #dbbc7f; opacity: 0.9; }

/* Transfer section inside bridge dialog — preserves the old #fundDialog
   visual identity (warm-beige interior, generous spacing) while sitting
   inside the new bridge-dialog shell. */
#bridgeTransferSection.fund-dialog-body {
    padding: 0;                 /* outer .bridge-step already pads */
    background: #faf6f0;
    border-radius: 10px;
    margin: 4px 0;
}
#bridgeTransferSection .fund-dialog-desc {
    padding: 14px 16px 0;
    margin: 0;
}
#bridgeTransferSection .fund-source-box,
#bridgeTransferSection .fund-dest-box {
    margin: 10px 16px 0;
}
#bridgeTransferSection .fund-swap-row {
    margin: 4px 0;
}
#bridgeTransferSection .fund-amount-row {
    padding: 0 16px;
    margin-top: 12px;
}
#bridgeTransferSection .fund-transfer-btn {
    margin: 12px 16px 16px;
    width: calc(100% - 32px);
}
#bridgeTransferSection .fund-status {
    margin: 0 16px 16px;
}

.bridge-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #a89984;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.bridge-close:hover { color: #5c5048; }

.bridge-step {
    padding: 12px 16px 16px;
}

.bridge-section-label {
    font-size: 10px;
    font-weight: 600;
    color: #8c7e72;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    margin-top: 8px;
}

.bridge-section-label:first-child { margin-top: 0; }

.bridge-select-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    background: #faf6f1;
    border: 1px solid #e8e0d4;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: #3c3836;
    transition: all 0.15s;
}

.bridge-select-btn:hover:not(:disabled) {
    border-color: #c4b8a8;
    background: #f5f0eb;
}

.bridge-select-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bridge-chain-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e8e0d4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    overflow: hidden;
}

.bridge-chain-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.bridge-token-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.bridge-token-bal {
    margin-left: auto;
    font-size: 12px;
    color: #8c7e72;
}

.bridge-chevron {
    margin-left: auto;
    font-size: 18px;
    color: #b0a89e;
    font-weight: 300;
}

.bridge-token-bal + .bridge-chevron {
    margin-left: 8px;
}

/* Source Wallet Toggle (Withdraw mode) */
.bridge-source-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.bridge-src-btn {
    flex: 1;
    padding: 7px 8px;
    border: none;
    background: #faf6f0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #7c7068;
    cursor: pointer;
    transition: all 0.15s;
}

.bridge-src-btn.active {
    background: #3c3836;
    color: #f5ebe0;
    font-weight: 600;
}

.bridge-src-btn:not(.active):hover {
    background: #f0e8da;
}

.bridge-source-info {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #7c7068;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bridge-source-addr {
    color: #a0522d;
}

.bridge-source-bal {
    font-weight: 600;
    color: #3c3836;
}

/* Withdraw Method Toggle */
.bridge-method-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}

.bridge-method-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1.5px solid #e8e0d4;
    border-radius: 8px;
    background: #faf6f0;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.bridge-method-btn.active {
    border-color: #3c3836;
    background: #faf6f0;
}

.bridge-method-btn.active .bridge-method-icon {
    background: #3c3836;
    color: #f9f6f2;
}

.bridge-method-btn:not(.active):hover {
    border-color: #c4b5a3;
    background: #f0e8da;
}

.bridge-method-icon {
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: #e8e0d4;
    color: #5c5048;
}

.bridge-method-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bridge-method-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #3c3836;
}

.bridge-method-desc {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: #7c7068;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Balance List (Deposit mode) */
.bridge-balances-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    background: #faf6f0;
}

.bridge-bal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0e8da;
}

.bridge-bal-item:last-child { border-bottom: none; }

.bridge-bal-item:hover { background: #f0e8da; }

.bridge-bal-item.selected {
    background: #e8ddd0;
    box-shadow: inset 3px 0 0 #a0522d;
}

.bridge-bal-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bridge-bal-chain-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.bridge-bal-icon-wrap {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.bridge-bal-token-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.bridge-bal-chain-badge {
    position: absolute;
    bottom: -2px;
    right: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #fdf6e3;
    background: #fdf6e3;
}

.bridge-bal-chain-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8e0d4;
    color: #3c3836;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.bridge-bal-symbol {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 14px;
    color: #3c3836;
}

.bridge-bal-direct-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    color: #79740e;
    background: #e8e5c0;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 5px;
    vertical-align: middle;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.bridge-bal-chain {
    font-size: 11px;
    color: #b0a89e;
}

.bridge-bal-right {
    text-align: right;
}

.bridge-bal-amount {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #3c3836;
}

.bridge-bal-usd {
    font-size: 11px;
    color: #b0a89e;
}

.bridge-bal-loading,
.bridge-bal-empty {
    padding: 32px 20px;
    text-align: center;
    color: #b0a89e;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
}

/* Deposit list (chain selector inline) */
.bridge-deposit-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    max-height: 240px;
    overflow-y: auto;
}
.bridge-deposit-row {
    display: block;
    width: 100%;
    text-align: left;
    background: #f7efe0;
    border: 1px solid #e6dcc8;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    transition: background 0.12s, border-color 0.12s;
}
.bridge-deposit-row:hover { background: #f0e6d2; }
.bridge-deposit-row.selected {
    background: #fdf6e3;
    border-color: #b9aa92;
    box-shadow: 0 0 0 2px rgba(140,126,114,0.18);
}
.bridge-deposit-row-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #2e2a22;
}
.bridge-deposit-row-name { font-weight: 600; }
.bridge-deposit-row-min {
    color: #7a6d54;
    font-size: 11px;
}
.bridge-deposit-row-tokens {
    margin-top: 4px;
    color: #8a7d63;
    font-size: 11px;
    line-height: 1.3;
    word-break: break-word;
}
.bridge-deposit-selected {
    margin-top: 12px;
    padding: 12px;
    background: #faf6f0;
    border: 1px solid #e6dcc8;
    border-radius: 8px;
}
.bridge-deposit-grid {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.bridge-qr-wrap {
    flex: 0 0 auto;
    background: #fff;
    padding: 6px;
    border: 1px solid #e6dcc8;
    border-radius: 6px;
}
.bridge-qr-img { display: block; width: 140px; height: 140px; }
.bridge-deposit-meta { flex: 1 1 auto; min-width: 0; }
.bridge-addr-row {
    display: flex;
    gap: 6px;
    align-items: center;
    background: #f7efe0;
    padding: 6px 8px;
    border-radius: 6px;
}
.bridge-addr {
    flex: 1 1 auto;
    font-size: 11px;
    word-break: break-all;
    color: #2e2a22;
}
.bridge-copy-btn {
    flex: 0 0 auto;
    padding: 4px 10px;
    border: 1px solid #e6dcc8;
    background: #fdf6e3;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
}
.bridge-copy-btn:hover { background: #f0e6d2; }
.bridge-help {
    margin-top: 6px;
    font-size: 11px;
    color: #6e6353;
    line-height: 1.4;
}
.bridge-deposit-amount-wrap { margin-bottom: 12px; }
.bridge-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #e6dcc8;
    border-radius: 6px;
    background: #fff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #2e2a22;
}
.bridge-input:focus { outline: none; border-color: #8c7e72; }
.bridge-warning {
    padding: 8px 10px;
    background: #ffeec8;
    border: 1px solid #d4a945;
    border-radius: 6px;
    color: #7a5c1a;
    font-size: 12px;
    line-height: 1.4;
    font-family: 'IBM Plex Mono', monospace;
}
.bridge-deposit-status {
    margin-top: 8px;
    text-align: center;
    color: #8a7d63;
    font-size: 12px;
    font-family: 'IBM Plex Mono', monospace;
}

/* Connected-wallet balances inside Deposit */
.bridge-bal-section { margin-bottom: 14px; }
.bridge-bal-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.bridge-bal-refresh {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #e6dcc8;
    background: #f7efe0;
    cursor: pointer;
    font-size: 14px;
    color: #6e6353;
}
.bridge-bal-refresh:hover { background: #f0e6d2; }
.bridge-bal-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}
.bridge-bal-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: #faf6f0;
    border: 1px solid #e6dcc8;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    font-family: 'IBM Plex Mono', monospace;
    transition: background 0.12s, border-color 0.12s;
}
.bridge-bal-row:hover {
    background: #f0e8da;
    border-color: #b9aa92;
}
.bridge-bal-row-icons {
    position: relative;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
}
.bridge-bal-token-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e6dcc8;
}
.bridge-bal-chain-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e6dcc8;
}
.bridge-bal-row-main {
    flex: 1 1 auto;
    min-width: 0;
}
.bridge-bal-row-line1,
.bridge-bal-row-line2 {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}
.bridge-bal-row-line1 { font-size: 13px; color: #2e2a22; }
.bridge-bal-row-line2 { font-size: 11px; color: #8a7d63; margin-top: 2px; }
.bridge-bal-symbol { font-weight: 600; }
.bridge-bal-amount,
.bridge-bal-usd { color: #6e6353; }

/* New: row container becomes a div (not button) so the form can sit inside */
.bridge-bal-row { flex-direction: column; align-items: stretch; }
.bridge-bal-row-clickable {
    display: flex; align-items: center; gap: 10px; width: 100%;
}
.bridge-bal-row.selected {
    border-color: #8c7e72;
    background: #f0e8da;
}
.bridge-bal-search-row {
    display: flex; gap: 8px; align-items: center; margin: 6px 0;
}
.bridge-bal-search {
    flex: 1; min-width: 0;
    padding: 7px 10px;
    border: 1px solid #e6dcc8;
    border-radius: 8px;
    background: #faf6f0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #2e2a22;
}
.bridge-bal-note {
    font-size: 10px; color: #8a7d63; margin-bottom: 6px;
}
.bridge-bal-form {
    margin-top: 10px;
    padding: 10px 12px;
    background: #faf6f0;
    border: 1px dashed #b9aa92;
    border-radius: 8px;
}
.bridge-bal-form-label {
    font-size: 11px; color: #6e6353; margin-bottom: 6px;
}
.bridge-bal-form-input-row {
    display: flex; gap: 6px; align-items: center;
}
.bridge-bal-form-input-row .bridge-input { flex: 1; }
.bridge-bal-btn-max {
    padding: 6px 10px;
    border: 1px solid #e6dcc8;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #6e6353;
}
.bridge-bal-quote {
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.3;
}
.bridge-bal-quote.loading {
    color: #8a7e74;
    background: rgba(138, 126, 116, 0.08);
}
.bridge-bal-quote.ok {
    color: #4a7a2a;
    background: rgba(167, 192, 128, 0.14);
    border: 1px solid rgba(167, 192, 128, 0.35);
    font-weight: 600;
}
.bridge-bal-quote.error {
    color: #c27171;
    background: rgba(229, 57, 53, 0.10);
}
.bridge-bal-form-actions {
    display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px;
}
.bridge-btn-secondary,
.bridge-btn-primary {
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    border: 1px solid #b9aa92;
}
.bridge-btn-secondary { background: #fff; color: #6e6353; }
.bridge-btn-primary {
    background: #5c5048; color: #f5ebe0; border-color: #4a3f38;
}
.bridge-btn-primary:disabled {
    background: #b9aa92; cursor: not-allowed; opacity: 0.7;
}
.bridge-manual-toggle-row { margin: 14px 0 10px; }
.bridge-manual-toggle {
    width: 100%;
    padding: 9px 12px;
    background: #faf6f0;
    border: 1px dashed #b9aa92;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #6e6353;
}
.bridge-manual-toggle:hover { background: #f0e8da; }
.bridge-manual-panel {
    border-top: 1px solid #e6dcc8;
    padding-top: 10px;
}

/* Destination Address */
.bridge-dest-section { margin-top: 6px; }

.bridge-dest-wrap {
    display: flex;
    gap: 4px;
    align-items: center;
}

.bridge-dest-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e8e0d4;
    border-radius: 7px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #3c3836;
    background: #faf6f0;
    outline: none;
    transition: border-color 0.2s;
}

.bridge-dest-input:focus {
    border-color: #a0522d;
}

.bridge-dest-reset {
    width: 30px;
    height: 30px;
    border: 1px solid #e8e0d4;
    border-radius: 7px;
    background: #faf6f0;
    color: #a0522d;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.bridge-dest-reset:hover {
    background: #f0e8da;
}

.bridge-dest-hint {
    font-size: 11px;
    color: #b0a89e;
    margin-top: 4px;
}

/* Amount */
.bridge-amount-section { margin-top: 6px; }

.bridge-amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.bridge-avail-bal {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #a0522d;
    cursor: pointer;
    transition: color 0.15s;
}

.bridge-avail-bal:hover {
    color: #7c3f1a;
    text-decoration: underline;
}

.bridge-amount-wrap {
    position: relative;
}

.bridge-amount-input {
    width: 100%;
    padding: 8px 12px;
    padding-right: 80px;
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    font-weight: 500;
    color: #3c3836;
    background: #faf6f1;
    box-sizing: border-box;
}

.bridge-amount-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.bridge-amount-usd {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #8c7e72;
}

.bridge-amount-btns {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.bridge-amount-btns button {
    flex: 1;
    padding: 4px 0;
    border: 1px solid #e8e0d4;
    border-radius: 5px;
    background: #faf6f1;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: #5c5048;
    cursor: pointer;
    transition: all 0.15s;
}

.bridge-amount-btns button:hover {
    background: #e8e0d4;
    border-color: #c4b8a8;
}

/* Action button */
/* Bridge primary action — Get Quote / Direct Withdraw / Confirm /
   Deposit & Wrap / Transfer pUSD. Mirrors .cart-execute-btn for
   visual cohesion across the wallet → cart → bridge flow. */
.bridge-action-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px 16px;
    background: #5c5048;
    color: #f5ebe0;
    border: none;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
}

.bridge-action-btn:hover:not(:disabled) {
    background: #7a6e64;
}

.bridge-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quote summary */
.bridge-quote-summary {
    background: #faf6f1;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.bridge-quote-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bridge-quote-label {
    font-size: 12px;
    color: #8c7e72;
}

.bridge-quote-value {
    font-size: 16px;
    font-weight: 600;
    color: #3c3836;
}

.bridge-quote-arrow {
    text-align: center;
    font-size: 18px;
    color: #b0a89e;
    padding: 8px 0;
}

/* Quote details */
.bridge-quote-details {
    border: 1px solid #f0e9e0;
    border-radius: 10px;
    padding: 12px 14px;
}

.bridge-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 12px;
}

.bridge-detail-row span:first-child {
    color: #8c7e72;
}

.bridge-detail-row span:last-child {
    color: #3c3836;
    font-weight: 500;
}

.bridge-confirm-btns {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.bridge-back-btn {
    padding: 12px 18px;
    background: #f5f0eb;
    border: 1px solid #e8e0d4;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #5c5048;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.bridge-back-btn:hover {
    background: #e8e0d4;
}

.bridge-confirm-btns .bridge-action-btn {
    flex: 1;
    margin-top: 0;
}

/* Execution status */
.bridge-exec-status {
    text-align: center;
    padding: 24px 0;
}

.bridge-exec-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 56px;
}

.bx-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e0d8;
    border-top-color: #7c6f64;
    border-radius: 50%;
    animation: bx-spin 0.8s linear infinite;
}

@keyframes bx-spin {
    to { transform: rotate(360deg); }
}

/* SVG status icons (success / error) — animated draw-in */
.bx-icon-success,
.bx-icon-error {
    width: 56px;
    height: 56px;
    display: block;
}

.bx-icon-success circle,
.bx-icon-error circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: bx-stroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.bx-icon-success path,
.bx-icon-error path {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: bx-stroke 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.45s forwards;
}

.bx-icon-success { color: #10b981; }
.bx-icon-error   { color: #ef4444; }

@keyframes bx-stroke {
    to { stroke-dashoffset: 0; }
}

/* Subtle pulse on the title while we're working */
.bridge-exec-title.is-loading {
    animation: bx-pulse 1.4s ease-in-out infinite;
}
@keyframes bx-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

.bridge-exec-title {
    font-size: 18px;
    font-weight: 600;
    color: #3c3836;
    margin-bottom: 8px;
}

.bridge-exec-desc {
    font-size: 13px;
    color: #8c7e72;
    line-height: 1.5;
}

.bridge-exec-tx {
    margin-top: 12px;
    font-size: 12px;
}

.bridge-exec-tx a {
    color: #3b82f6;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    background: #f6faff;
    transition: background 0.15s, border-color 0.15s;
}
.bridge-exec-tx a:hover {
    background: #eaf3ff;
    border-color: #93c5fd;
    text-decoration: none;
}
.bridge-exec-tx a code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    background: transparent;
    padding: 0;
}
.bridge-exec-tx svg { width: 12px; height: 12px; }

/* Status */
.bridge-status {
    margin: 0 20px 16px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
}

.bridge-status.loading {
    background: #eff6ff;
    color: #2563eb;
}

.bridge-status.success {
    background: #f0fdf4;
    color: #059669;
}

.bridge-status.error {
    background: #fef2f2;
    color: #dc2626;
}

/* Selector popup */
/* Chain/Token selector popup — visual sibling of .bridge-dialog. Same
   warm-beige surface and IBM Plex Mono throughout so the chooser feels
   native rather than like a generic browser modal. */
.bridge-selector-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(40, 35, 30, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.15s;
    font-family: 'IBM Plex Mono', monospace;
}

.bridge-selector {
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    border-radius: 14px;
    width: 380px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(40, 35, 30, 0.18);
    animation: slideUp 0.2s ease;
}

.bridge-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #e8e0d4;
}

.bridge-selector-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #5c5048;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
}

.bridge-selector-search {
    padding: 10px 14px 8px;
}

.bridge-selector-search input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #3c3836;
    background: #faf7f2;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.bridge-selector-search input::placeholder { color: #a89984; }

.bridge-selector-search input:focus {
    outline: none;
    border-color: #5c5048;
}

.bridge-selector-list {
    overflow-y: auto;
    max-height: 460px;
    padding: 2px 8px 12px;
}

.bridge-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    margin: 2px 0;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: 'IBM Plex Mono', monospace;
    color: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.bridge-selector-item:hover {
    background: #f5ebe0;
    border-color: #e8e0d4;
}

.bridge-selector-item img,
.bridge-selector-item .chain-icon-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: #e8e0d4;
    flex-shrink: 0;
}

.chain-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #5c5048;
}

.bridge-selector-item-info {
    flex: 1;
    min-width: 0;
}

.bridge-selector-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #3c3836;
}

.bridge-selector-item-detail {
    font-size: 10px;
    color: #a89984;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.bridge-selector-item-right {
    text-align: right;
    font-size: 11px;
    color: #7a6f66;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.bridge-selector-separator {
    font-size: 9px;
    font-weight: 600;
    color: #a89984;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px 4px;
}









/* Tabs */



/* Loading */

/* Content */


/* Summary row */

/* Batch close filter bar */

/* ─── Bridge dialog — mobile overrides (#19e/f) ─────────────────────────── */
/* Moved here from main styles.css MOBILE LAYOUT block. Cascade order:
   themed file loads AFTER main styles.css, so override is implicit —
   no more !important reliance needed conceptually. */
@media (max-width: 768px) {
    .bridge-dialog {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 80vh;
    }

    .bridge-overlay {
        align-items: flex-end !important;
    }
}

/* ─── Direct-unwrap checkbox (C2: Polygon-only short-circuit) ─────────── */
/* Toggle row used by both Deposit (wrap) and Withdraw (direct-unwrap)
   modes. Conditional row — appears only when the alternative path is
   actually available (USDC.e balance / Polygon destination). When the
   row is present it visually sits ABOVE the main flow card with a
   clear "or" separator so the two paths read as alternatives, not
   layered settings on one path. */
.bridge-direct-unwrap-row {
    margin: 4px 0 12px;
    padding: 10px 14px;
    background: rgba(154, 121, 80, 0.06);
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    position: relative;
}
/* "or" badge that hangs between the toggle row and the rest of the
   tab. Visible only when the toggle's checkbox is OFF — because that's
   the only state where both paths are presentable choices. */
.bridge-direct-unwrap-row:has(input[type="checkbox"]:not(:checked)) {
    margin-bottom: 22px;
}
.bridge-direct-unwrap-row:has(input[type="checkbox"]:not(:checked))::after {
    content: 'OR';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 10px;
    background: #faf6f0;
    border: 1px solid #e8e0d4;
    border-radius: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    color: #a89984;
    letter-spacing: 1.5px;
}
.bridge-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #5c5048;
    line-height: 1.4;
}
.bridge-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    flex-shrink: 0;
}
