/* ---------- Modern surface pass ---------- */
body {
    background: #08070d !important;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
    z-index: 0;
}

.container {
    background: linear-gradient(180deg, rgba(26,22,42,0.94), rgba(15,13,24,0.97)) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(180,150,255,0.12) !important;
    border-radius: 32px !important;
    box-shadow:
        0 40px 90px rgba(20,10,50,0.55),
        0 0 0 1px rgba(240,185,11,0.06),
        0 2px 0 rgba(255,255,255,0.05) inset !important;
    position: relative;
    z-index: 1;
}

.swap-box {
    background: rgba(11,10,18,0.7) !important;
    border: 1px solid rgba(180,150,255,0.08) !important;
    border-radius: 22px !important;
}

.select-group {
    background: rgba(30,35,41,0.7) !important;
    backdrop-filter: blur(6px);
}

.input-group input#fromAmount,
.input-group input#toAmount {
    font-size: 26px !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px;
}

.balance-display, .ticker-wrap, .stats-bar {
    background: rgba(11,14,17,0.6) !important;
    border-color: rgba(255,255,255,0.06) !important;
}

.btn-primary {
    border-radius: 18px !important;
    box-shadow: 0 12px 32px rgba(240,185,11,0.22) !important;
}

.csel-native { display: none !important; }


.csel-wrap { position: relative; }

.csel-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #eaecef;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 6px 4px 4px;
    cursor: pointer;
    border-radius: 20px;
    transition: background 0.15s ease;
}
.csel-trigger:hover, .csel-trigger.open { background: rgba(240, 185, 11, 0.08); }

.csel-symbol { max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.csel-chevron { color: #8d949e; transition: transform 0.2s ease; flex-shrink: 0; }
.csel-trigger.open .csel-chevron { transform: rotate(180deg); color: #f0b90b; }

.csel-badge {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.csel-badge-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    color: #0b0e11;
    font-weight: 700;
    font-size: 11px;
    align-items: center;
    justify-content: center;
}

.csel-panel {
    position: fixed;
    min-width: 220px;
    max-height: 340px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    background: #181a20;
    border: 1px solid #2b3139;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    z-index: 9999;
}
.csel-panel.open { display: flex; }

.csel-search-wrap {
    position: relative;
    flex-shrink: 0;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.csel-search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #5e6673;
    pointer-events: none;
    transition: color 0.15s ease;
}
.csel-search {
    width: 100%;
    background: rgba(255,255,255,0.035);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: #eaecef;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    padding: 10px 34px 10px 34px;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.csel-search::placeholder { color: #5e6673; font-weight: 400; }
.csel-search:focus {
    border-color: rgba(240,185,11,0.5);
    background: rgba(240,185,11,0.045);
    box-shadow: 0 0 0 3px rgba(240,185,11,0.1);
}
.csel-search:focus ~ .csel-search-icon { color: #f0b90b; }

.csel-search-clear {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #8d949e;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.csel-search-clear:hover { background: rgba(255,255,255,0.16); color: #eaecef; }
.csel-search-wrap.has-text .csel-search-clear { display: flex; }
.csel-search-wrap.has-text .csel-search { padding-right: 50px; }

.csel-options-list {
    overflow-y: auto;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: #2b3139 transparent;
}
.csel-options-list::-webkit-scrollbar { width: 6px; }
.csel-options-list::-webkit-scrollbar-thumb { background: #2b3139; border-radius: 6px; }
.csel-options-list::-webkit-scrollbar-track { background: transparent; }
.csel-panel.open { animation: cselFadeIn 0.14s ease; }

@keyframes cselFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.csel-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s ease;
}
.csel-option:hover { background: #1e2329; }
.csel-option.selected { background: rgba(240, 185, 11, 0.1); }

.csel-option-label {
    font-size: 13px;
    font-weight: 600;
    color: #eaecef;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.csel-check { color: #f0b90b; flex-shrink: 0; }

.csel-empty { padding: 16px; text-align: center; font-size: 12px; color: #5e6673; }

/* ---------- Reverse direction button ---------- */
.reverse-swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1e2329;
    border: 3px solid #0b0e11;
    color: #f0b90b;
    cursor: pointer;
    margin: -6px auto -2px;
    position: relative;
    z-index: 5;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.reverse-swap-btn:hover { background: #2b3139; border-color: rgba(240,185,11,0.25); }
.reverse-swap-btn.spin svg { animation: reverseSpin 0.4s ease; }

@keyframes reverseSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
}

@media (max-width: 420px) {
    .csel-panel { min-width: 180px; }
}

/* ==========================================================
   Unified deposit + status modal
   ---------------------------------------------------------
   Replaces the old two-step Confirm/Track modals with one
   professional view: swap summary, deposit address/QR, and a live
   status stepper together, no confirm button gate.
   ========================================================== */
.deposit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,6,9,0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: depositFadeIn 0.18s ease;
}
@keyframes depositFadeIn { from { opacity: 0; } to { opacity: 1; } }

.deposit-modal {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(26,22,42,0.98), rgba(15,13,24,0.99));
    border: 1px solid rgba(180,150,255,0.14);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(240,185,11,0.06);
    animation: depositSlideUp 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes depositSlideUp { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.deposit-modal-close {
    position: absolute;
    top: 18px; right: 18px;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.06);
    color: #8d949e;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.deposit-modal-close:hover { background: rgba(255,255,255,0.12); color: #eaecef; }

.deposit-modal-header { margin-bottom: 18px; padding-right: 30px; }
.deposit-modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: #eaecef;
    letter-spacing: -0.2px;
}

/* ---- Swap summary ---- */
.deposit-summary {
    background: rgba(11,10,18,0.55);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.deposit-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13.5px;
}
.deposit-summary-row .label { color: #8d949e; }
.deposit-summary-row .value { color: #eaecef; font-weight: 600; }
.deposit-summary-row .value.highlight { color: #f8d33a; font-weight: 700; }
.deposit-summary-row .value.green { color: #0ecb81; font-weight: 700; }
.deposit-summary-row.muted { font-size: 12px; }
.deposit-summary-row.muted .value { font-weight: 500; color: #b8bec9; }
.deposit-summary-row + .deposit-summary-row { border-top: 1px solid rgba(255,255,255,0.05); }

/* ---- Deposit address + QR ---- */
.deposit-main {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: rgba(11,10,18,0.55);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 18px;
}
.deposit-qr {
    flex-shrink: 0;
    width: 116px; height: 116px;
    display: flex; align-items: center; justify-content: center;
    background: #eaecef;
    border-radius: 12px;
    padding: 6px;
    box-sizing: border-box;
}
.deposit-address-block { flex: 1; min-width: 0; }
.deposit-address-label {
    font-size: 10.5px;
    color: #8d949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}
.deposit-address-row {
    position: relative;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 12px 44px 12px 12px;
}
.deposit-address-value {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #eaecef;
    word-break: break-all;
    line-height: 1.6;
}
.deposit-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid rgba(240,185,11,0.35);
    background: rgba(240,185,11,0.1);
    color: #f8d33a;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.deposit-copy-btn:hover { background: rgba(240,185,11,0.2); transform: translateY(-1px); }
.deposit-copy-btn:active { transform: translateY(0); }

/* Three real inline SVG icons live inside the button at all times - only
   the one matching the current state is shown. This avoids the CSS
   mask/data-URI technique used previously, which didn't render
   reliably everywhere and left the button looking like an empty pill. */
.deposit-copy-btn svg { display: none; }
.deposit-copy-btn .icon-default { display: block; }
.deposit-copy-btn.copied .icon-default,
.deposit-copy-btn.copy-failed .icon-default { display: none; }
.deposit-copy-btn.copied .icon-copied { display: block; }
.deposit-copy-btn.copy-failed .icon-failed { display: block; }

.deposit-copy-btn.copied { background: rgba(14,203,129,0.18); border-color: rgba(14,203,129,0.45); color: #0ecb81; }
/* Every copy method failed - address text gets selected instead so the
   user can still copy manually; this just signals "look at the text". */
.deposit-copy-btn.copy-failed { background: rgba(220,53,69,0.14); border-color: rgba(220,53,69,0.4); color: #ff8a93; }
.deposit-address-value { user-select: all; -webkit-user-select: all; }
.deposit-instruction {
    font-size: 11.5px;
    color: #8d949e;
    line-height: 1.6;
    margin-top: 10px;
}
.deposit-instruction strong { color: #eaecef; }

/* ---- Status tracker ---- */
.deposit-tracker {
    background: rgba(11,10,18,0.4);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 20px 16px 16px;
}
.deposit-tracker-title {
    font-size: 11px;
    font-weight: 700;
    color: #8d949e;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-align: center;
    margin-bottom: 16px;
}
.deposit-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.deposit-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 78px;
    flex-shrink: 0;
}
.deposit-step-dot {
    width: 13px; height: 13px;
    border-radius: 50%;
    background: #1e2329;
    border: 2px solid #2b3139;
    transition: all 0.25s ease;
}
.deposit-step.active .deposit-step-dot {
    background: #f0b90b;
    border-color: #f0b90b;
    box-shadow: 0 0 0 4px rgba(240,185,11,0.18);
    animation: depositPulse 1.5s ease-in-out infinite;
}
.deposit-step.done .deposit-step-dot { background: #0ecb81; border-color: #0ecb81; }
.deposit-step-label {
    font-size: 9.5px;
    font-weight: 600;
    color: #5e6673;
    text-align: center;
    line-height: 1.3;
}
.deposit-step.active .deposit-step-label { color: #f8d33a; }
.deposit-step.done .deposit-step-label { color: #0ecb81; }
.deposit-step-line {
    flex: 1;
    height: 2px;
    background: #2b3139;
    margin-top: 6px;
}
.deposit-status-message {
    text-align: center;
    font-size: 12px;
    color: #b8bec9;
    line-height: 1.6;
    margin-top: 16px;
    min-height: 18px;
}
.deposit-tx-link { text-align: center; margin-top: 8px; font-size: 12px; }
.deposit-tx-link a { color: #f0b90b; text-decoration: underline; }

@keyframes depositPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(240,185,11,0.18); }
    50% { box-shadow: 0 0 0 7px rgba(240,185,11,0.06); }
}

@media (max-width: 480px) {
    .deposit-modal { padding: 22px 18px; border-radius: 20px; }
    .deposit-main { flex-direction: column; align-items: center; text-align: center; }
    .deposit-qr { width: 116px; height: 116px; }
    .deposit-address-row { text-align: left; }
    .deposit-step { width: 64px; }
    .deposit-step-label { font-size: 8.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .deposit-step.active .deposit-step-dot,
    .deposit-modal-overlay,
    .deposit-modal {
        animation: none !important;
    }
}


/* ---------- Transfer mode tabs ---------- */
.transfer-mode-tabs {
    display: flex;
    gap: 6px;
    background: #0b0e11;
    border: 1px solid #2b3139;
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 12px;
}
.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #8d949e;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 9px 10px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.mode-tab.active {
    background: linear-gradient(135deg, #f0b90b, #f8d33a);
    color: #0b0e11;
}
.mode-tab:not(.active):hover { color: #eaecef; }

/* ---------- Trust strip ---------- */
.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    justify-content: center;
    padding: 2px 4px 14px;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: #8d949e;
    font-weight: 500;
}
.trust-item svg { color: #0ecb81; flex-shrink: 0; }



/* ---------- Locked amount field (wallet mode, not yet connected) ---------- */
#fromAmount:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

/* ---------- Professional polish pass ---------- */
.container {
    position: relative;
    overflow: hidden;
}
.container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f0b90b, #f8d33a, #f0b90b);
    background-size: 200% 100%;
    animation: shimmerLine 3s linear infinite;
}
@keyframes shimmerLine {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.swap-box {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.connect-wallet-btn {
    letter-spacing: 0.1px;
}

/* Give the balances panel a gentle entrance instead of popping in */
.balance-display {
    animation: balanceReveal 0.25s ease;
}
@keyframes balanceReveal {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.reverse-swap-btn:active { transform: scale(0.92); }

.mode-tab svg { flex-shrink: 0; }

/* ---------- Glass panels to match the new surface treatment ---------- */
.csel-panel {
    background: rgba(24,26,32,0.96) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .container::before,
    .balance-display,
    .deposit-step.active .deposit-step-dot,
    .reverse-swap-btn.spin svg {
        animation: none !important;
    }
}

/* ==========================================================
   Full homepage layout (site nav, hero, features, footer)
   ========================================================== */
html, body { height: auto !important; min-height: 100vh; }
body {
    display: block !important;
    padding: 0 !important;
    align-items: unset !important;
    justify-content: unset !important;
}

.site-logo-img { height: 26px; width: auto; display: block; }

/* ---------- Top nav ---------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(8,7,15,0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-nav-brand img { height: 28px; width: auto; display: block; }
.site-nav-links { display: flex; gap: 28px; }
.site-nav-links a {
    color: #a8adb8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: color 0.15s ease;
}
.site-nav-links a:hover { color: #f0b90b; }

/* ---------- Hero: the purple-to-black gradient from the reference image ---------- */
.hero-section {
    position: relative;
    background:
        linear-gradient(180deg, transparent 0%, transparent 49.7%, #e8952e 49.7%, #f0b90b 50%, transparent 50.3%, transparent 100%),
        linear-gradient(160deg, #322672 0%, #241a5c 45%, #150f3d 50%),
        linear-gradient(200deg, #0d0a1f 50%, #0a0714 100%);
    background-size: 100% 100%, 100% 50%, 100% 50%;
    background-position: top, top, bottom;
    background-repeat: no-repeat;
    padding: 64px 24px 84px;
    overflow: hidden;
}
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.hero-layout {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 56px;
    align-items: center;
}

.hero-copy { color: #fff; padding-bottom: 20px; }

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.68);
    margin-bottom: 20px;
}
.hero-kicker-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #0ecb81;
    box-shadow: 0 0 0 3px rgba(14,203,129,0.18);
}

.hero-copy h1 {
    font-size: clamp(30px, 3.6vw, 44px);
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -0.8px;
    max-width: 15ch;
    margin-bottom: 18px;
}
.hero-copy p {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255,255,255,0.66);
    max-width: 48ch;
    margin-bottom: 34px;
}

.hero-metrics {
    display: flex;
    align-items: center;
    gap: 22px;
}
.hero-metric { display: flex; flex-direction: column; gap: 3px; }
.hero-metric-value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}
.hero-metric-label {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}
.hero-metric-divider {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.14);
}

.hero-layout .container { margin: 0; max-width: 460px; width: 100%; }

/* ---------- Features section ---------- */
.features-section {
    background: #08070d;
    padding: 70px 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.features-grid {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 28px;
}
.feature-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(240,185,11,0.1);
    color: #f0b90b;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.feature-card h3 { color: #eaecef; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: #8d949e; font-size: 13.5px; line-height: 1.65; }

/* ---------- Full site footer ---------- */
.site-footer-full {
    background: #050409;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 40px 24px;
}
.site-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
}
.site-footer-brand img { height: 24px; width: auto; opacity: 0.85; }
.site-footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer-links a { color: #8d949e; text-decoration: none; font-size: 13px; }
.site-footer-links a:hover { color: #f0b90b; }
.site-footer-copy { color: #5e6673; font-size: 12px; }

/* ---------- Responsive: stack hero on smaller screens ---------- */
@media (max-width: 980px) {
    .hero-layout { grid-template-columns: 1fr; }
    .hero-copy { text-align: center; padding-bottom: 0; }
    .hero-copy h1 { max-width: none; }
    .hero-copy p { margin-left: auto; margin-right: auto; }
    .hero-kicker { justify-content: center; width: 100%; }
    .hero-metrics { justify-content: center; }
    .hero-layout .container { max-width: 480px; margin: 0 auto; }
    .features-grid { grid-template-columns: 1fr; }
    .site-nav-links { gap: 18px; }
}

@media (max-width: 560px) {
    .site-nav-inner { padding: 14px 16px; }
    .hero-section { padding: 40px 12px 56px; }
    .site-nav-links a:nth-child(3) { display: none; }
}

/* ---------- Extra device coverage ---------- */
@media (min-width: 981px) and (max-width: 1120px) {
    .hero-layout { grid-template-columns: 1fr 420px; gap: 36px; }
}

@media (max-width: 380px) {
    .hero-copy h1 { font-size: 26px; }
    .hero-metric-value { font-size: 19px; }
    .site-nav-links a:nth-child(3) { display: none; }
}

/* Large desktop: keep the hero from feeling too sparse at wide viewports */
@media (min-width: 1400px) {
    .hero-layout, .site-nav-inner, .features-grid, .site-footer-inner {
        max-width: 1320px;
    }
}

/* ---------- Coin picker polish pass ---------- */
.csel-trigger {
    transition: background 0.18s cubic-bezier(.2,.8,.2,1), box-shadow 0.18s ease;
}
.csel-trigger.open {
    box-shadow: 0 0 0 1px rgba(240,185,11,0.3), 0 0 18px -4px rgba(240,185,11,0.35);
}
.csel-trigger:focus-visible {
    outline: 2px solid #f0b90b;
    outline-offset: 2px;
}

.csel-option {
    transition: background 0.14s cubic-bezier(.2,.8,.2,1), transform 0.14s ease;
}
.csel-option:hover {
    transform: translateX(2px);
}
.csel-option.selected {
    box-shadow: inset 0 0 0 1px rgba(240,185,11,0.25);
}

.reverse-swap-btn {
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.reverse-swap-btn:hover {
    box-shadow: 0 6px 20px rgba(240,185,11,0.25);
}
.reverse-swap-btn:focus-visible {
    outline: 2px solid #f0b90b;
    outline-offset: 2px;
}

.mode-tab:focus-visible {
    outline: 2px solid #f0b90b;
    outline-offset: -2px;
}

/* ==========================================================
   Network selector - made as visible/tappable as the coin picker
   ----------------------------------------------------------
   The base site's .network-select was tiny (9px font, 55px max-width,
   shrinking to 8px/45px on mobile) - easy to miss entirely, especially
   on a phone. This gives it the same visual weight as the coin picker
   trigger next to it: real font size, a proper pill background/border,
   a network icon, and a comfortable touch target.
   ========================================================== */
.swap-row .select-group .network-select,
#fromNetworkManual,
#toNetwork {
    background: rgba(240,185,11,0.07) !important;
    border: 1px solid rgba(240,185,11,0.3) !important;
    border-radius: 20px !important;
    color: #f8d33a !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 7px 12px !important;
    max-width: 108px !important;
    min-height: 34px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8d33a' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 13px !important;
    padding-right: 28px !important;
}
.swap-row .select-group .network-select:hover,
#fromNetworkManual:hover,
#toNetwork:hover {
    background-color: rgba(240,185,11,0.13) !important;
    border-color: rgba(240,185,11,0.45) !important;
}
.swap-row .select-group .network-select:focus,
#fromNetworkManual:focus,
#toNetwork:focus {
    background-color: rgba(240,185,11,0.15) !important;
    color: #f8d33a !important;
    outline: 2px solid #f0b90b;
    outline-offset: 1px;
}
.swap-row .select-group .network-select option {
    background: #181a20 !important;
    color: #eaecef !important;
    font-size: 14px;
}

@media (max-width: 480px) {
    .swap-row .select-group .network-select,
    #fromNetworkManual,
    #toNetwork {
        font-size: 12.5px !important;
        padding: 7px 26px 7px 11px !important;
        min-height: 36px;
        max-width: 92px !important;
    }
}

/* ==========================================================
   Custom network dropdown - glass panel (native <select> option
   lists can't take shadow/blur/radius styling, so this replaces the
   trigger with a styled button and portals a real glass panel to body,
   same technique as the coin picker).
   ========================================================== */
.nsel-native { display: none !important; }
.nsel-wrap { position: relative; display: inline-flex; }

.nsel-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(240,185,11,0.07);
    border: 1px solid rgba(240,185,11,0.3);
    border-radius: 20px;
    color: #f8d33a;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 11px;
    min-height: 34px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease;
}
.nsel-trigger:hover { background: rgba(240,185,11,0.13); border-color: rgba(240,185,11,0.45); }
.nsel-trigger.open {
    background: rgba(240,185,11,0.15);
    box-shadow: 0 0 0 1px rgba(240,185,11,0.3), 0 0 18px -4px rgba(240,185,11,0.35);
}
.nsel-trigger:focus-visible { outline: 2px solid #f0b90b; outline-offset: 2px; }

.nsel-code { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsel-chevron { flex-shrink: 0; transition: transform 0.2s ease; }
.nsel-trigger.open .nsel-chevron { transform: rotate(180deg); }

/* The glass panel itself */
.nsel-panel {
    position: fixed;
    min-width: 140px;
    max-height: 280px;
    overflow-y: auto;
    background: rgba(24,26,32,0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(240,185,11,0.16);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.03) inset;
    padding: 6px;
    z-index: 9999;
    display: none;
}
.nsel-panel.open { display: block; animation: nselFadeIn 0.15s ease; }

@keyframes nselFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.nsel-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #eaecef;
    transition: background 0.13s ease, transform 0.13s ease;
}
.nsel-option:hover { background: rgba(255,255,255,0.06); transform: translateX(2px); }
.nsel-option.selected { background: rgba(240,185,11,0.1); color: #f8d33a; }
.nsel-check { color: #f0b90b; flex-shrink: 0; }
.nsel-empty { padding: 14px; text-align: center; font-size: 12px; color: #5e6673; }

@media (max-width: 480px) {
    .nsel-trigger { font-size: 12.5px; padding: 7px 10px; min-height: 36px; }
    .nsel-code { max-width: 64px; }
}

/* ==========================================================
   Coin picker (You Send / You Receive) - mobile clarity pass
   ----------------------------------------------------------
   The trigger and dropdown rows were sized for desktop (13px text,
   24-28px icons, tight padding) - too small/cramped to read and tap
   comfortably on a phone. This enlarges everything on small screens:
   bigger text, bigger coin icons, taller touch targets (44px+, the
   generally recommended minimum), more breathing room in the dropdown.
   ========================================================== */
@media (max-width: 480px) {
    .csel-trigger {
        gap: 8px;
        font-size: 15px;
        font-weight: 700;
        padding: 8px 10px 8px 6px;
        min-height: 44px;
    }
    .csel-symbol { max-width: 84px; font-size: 15px; }
    .csel-chevron { width: 14px; height: 14px; }

    /* Overrides the inline width/height set by JS for the badge icons -
       needed since inline styles otherwise win over a plain class rule. */
    .csel-trigger .csel-badge {
        width: 30px !important;
        height: 30px !important;
    }
    .csel-trigger .csel-badge img {
        width: 20px !important;
        height: 20px !important;
    }
    .csel-badge-fallback { font-size: 13px; }

    .csel-panel { min-width: 260px; max-width: 92vw; }
    .csel-search-wrap { padding: 12px; }
    .csel-search { font-size: 15px; padding: 12px 38px 12px 38px; }
    .csel-search-icon { left: 24px; width: 16px; height: 16px; }
    .csel-search-clear { right: 22px; width: 20px; height: 20px; }

    .csel-option {
        gap: 12px;
        padding: 12px 10px;
        min-height: 50px;
    }
    .csel-option .csel-badge {
        width: 34px !important;
        height: 34px !important;
    }
    .csel-option .csel-badge img {
        width: 22px !important;
        height: 22px !important;
    }
    .csel-option-label { font-size: 15px; }
    .csel-check { width: 18px; height: 18px; }
}

/* ==========================================================
   Full mobile experience overhaul
   ----------------------------------------------------------
   A systematic pass over every small-text/small-touch-target element
   on the page for phones, not just the coin picker. Two problems kept
   repeating in the original mobile rules: text shrunk to 8-10px (hard
   to read) and interactive elements shrunk below the ~40-44px minimum
   comfortable touch target size. This brings both back to readable/
   tappable sizes without changing anything on desktop.
   ========================================================== */
@media (max-width: 480px) {

    /* ---- Header ---- */
    .connect-wallet-btn {
        padding: 9px 16px !important;
        font-size: 12.5px !important;
        min-height: 38px;
    }
    .refresh-btn {
        width: 36px !important;
        height: 36px !important;
    }
    .refresh-btn svg {
        width: 17px !important;
        height: 17px !important;
    }

    /* ---- Stats bar / rate / fee rows ---- */
    .stats-bar {
        font-size: 12px !important;
        padding: 10px 12px !important;
        gap: 6px !important;
    }
    .rate-info {
        font-size: 12px !important;
        line-height: 1.6;
    }
    .fee-info {
        font-size: 12px !important;
        line-height: 1.6;
    }

    /* ---- Trust badges: readable text, tidy two-per-row wrap instead
       of a cramped single line ---- */
    .trust-badges {
        font-size: 11.5px !important;
        padding: 12px 14px !important;
        gap: 10px 16px !important;
    }
    .trust-badges span { gap: 6px !important; }

    /* ---- Transfer mode tabs (Wallet / Manual) ---- */
    .mode-tab {
        font-size: 13px !important;
        padding: 12px 10px !important;
        min-height: 42px;
    }

    /* ---- Amount input row already gets font-size:16px from the base
       stylesheet (prevents iOS auto-zoom) - just add breathing room ---- */
    .input-group input {
        padding: 13px 0 !important;
    }

    /* ---- Recipient address field + its validation message ---- */
    .recipient-group input {
        font-size: 14px !important;
        padding: 12px !important;
        min-height: 44px;
    }
    .recipient-group input::placeholder { font-size: 13px !important; }

    /* ---- Wallet picker modal ---- */
    .wallet-option {
        padding: 13px 14px !important;
        font-size: 14px !important;
        min-height: 48px;
    }
    .wallet-option img {
        width: 32px !important;
        height: 32px !important;
    }

    /* ---- Balance display ---- */
    .balance-display .balance-item {
        font-size: 13px !important;
        padding: 5px 0 !important;
    }

    /* ---- Nav: three links is tight at this width - shrink text
       slightly and let them wrap onto their own row rather than
       silently dropping the third link, so nothing on the site becomes
       unreachable from a phone. ---- */
    .site-nav-links {
        gap: 14px !important;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .site-nav-links a {
        font-size: 12.5px !important;
    }

    /* ---- Feature cards ---- */
    .feature-card { padding: 22px 20px !important; }
    .feature-card p { font-size: 14px !important; }

    /* ---- Footer ---- */
    .site-footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 16px !important;
    }
    .site-footer-links {
        justify-content: center;
        gap: 16px 20px !important;
    }
    .site-footer-links a { font-size: 13.5px !important; }
}

/* Restore the hidden third nav link now that links wrap instead of
   overflowing - nothing should be unreachable on a phone. */
@media (max-width: 560px) {
    .site-nav-links a:nth-child(3) { display: inline !important; }
}
@media (max-width: 380px) {
    .site-nav-links a:nth-child(3) { display: inline !important; }
}