.pairs-table-wrapper { width:100%; margin-top:10px; }
.pairs-table-header { display:grid; grid-template-columns: 2.2fr 1.7fr 1.5fr 1.2fr .9fr .9fr 1fr; gap:0; background:#19202b; color:#a6b4c2; font-size:12px; font-weight:600; border-radius:10px 10px 0 0; padding: 8px 0 8px 0; margin-bottom:0; }
.pairs-table-header > div { padding-left:12px; }
.pairs-grid { display:flex; flex-direction:column; gap:0; }
.pair-row { display:grid; padding: 5px 0; grid-template-columns: 1.8fr 1.7fr 1.5fr 1fr .7fr .9fr 1fr; align-items:center; background:#10151e; border-bottom:1px solid #1a2230; min-height:54px; font-size:14px; transition:.18s; position:relative; }
.pair-row:last-child { border-radius:0 0 10px 10px; }
.col-token, .col-blockchain, .col-exchange-from, .col-exchange-to, .col-profit, .col-type, .col-action { display:flex; align-items:center; min-height:54px; padding-left:12px; }
.pair-tokens, .pair-chains, .pair-exchanges { display:flex; align-items:center; gap:8px; }
.pair-tokens .asset, .pair-chains .chain, .pair-exchanges .exchange { display:flex; align-items:center; gap:4px; background:#162334; padding:4px 10px; border-radius:7px; font-size:13px; }
.pair-tokens .asset img, .pair-chains .chain img, .pair-exchanges .exchange img { width:18px; height:18px; border-radius: 50%; object-fit:contain; filter:drop-shadow(0 0 2px rgba(0,0,0,.3)); }
.pair-tokens .arrow, .pair-chains .arrow { opacity:.5; font-size:13px; }
.pair-tokens.masked .asset, .pair-chains.masked .chain, .pair-exchanges.masked .exchange, .hidden-asset, .hidden-chain, .hidden-exchange { background:#232b36!important; color:#6b7280!important; font-style:italic; }
.pair-tokens.masked .asset span, .pair-chains.masked .chain span, .pair-exchanges.masked .exchange span { color:#6b7280!important; }
.pair-profit { font-weight:600; font-size:15px; }
.pair-profit.masked { color:#6b7280; font-style:italic; }
.pair-type { font-size:12px; font-weight:700; padding:4px 10px; border-radius:8px; letter-spacing:.5px; background:#1d2733; }
.pair-type.tier-private{background:linear-gradient(120deg,#7e22ce,#c084fc);-webkit-background-clip:text;background-clip:text;color:transparent}
.pair-type.tier-vip{background:linear-gradient(120deg,#d97706,#fbbf24);-webkit-background-clip:text;background-clip:text;color:transparent}
.pair-type.tier-regular{color:#6b7280}
.uid-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #151c25;
    color: #8fa2b7;
    border: 1px solid #223041;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
}
/* Enhanced VIP/PRIVATE badges */
.pair-type.tier-vip,
.pair-type.tier-private {
    /* override earlier gradient-text behavior */
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: #0b1117 !important;
    border-radius: 999px;
    padding: 6px 12px 6px 30px; 
    font-weight: 800;
    letter-spacing: .6px;
    position: relative;
    border: 1px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.pair-type.tier-vip {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    border-color: rgba(251,191,36,0.6);
    box-shadow: 0 6px 16px -6px rgba(251,191,36,0.45), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.pair-type.tier-private {
    background: linear-gradient(135deg, #7e22ce, #c084fc);
    border-color: rgba(192,132,252,0.55);
    box-shadow: 0 6px 16px -6px rgba(192,132,252,0.45), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.pair-type.tier-vip::before,
.pair-type.tier-private::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    background: rgba(11,17,23,0.95);
    -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
    mask-size: contain; mask-repeat: no-repeat; mask-position: center;
    opacity: .95;
}
/* Crown icon for VIP */
.pair-type.tier-vip::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7l5 5 4-7 4 7 5-5v12H3z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7l5 5 4-7 4 7 5-5v12H3z"/></svg>');
}
/* Diamond icon for PRIVATE */
.pair-type.tier-private::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3h12l4 5-10 13L2 8z"/><path d="M6 3l6 13L18 3"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3h12l4 5-10 13L2 8z"/><path d="M6 3l6 13L18 3"/></svg>');
}
@media (max-width: 860px) {
    .pair-type.tier-vip, .pair-type.tier-private { padding: 6px 12px 6px 28px; font-size: 12.5px; }
    .pair-type.tier-vip::before, .pair-type.tier-private::before { width: 13px; height: 13px; left: 9px; }
}
.pair-status.active { color:#22d3ee; font-weight:700; font-size:13px; }
.pair-status.free { color:#4ade80; font-weight:700; font-size:13px; }
.pay-btn { background:linear-gradient(90deg,#0ea5e9,#2563eb);color:#fff;border:0;padding:7px 18px;font-size:13px;border-radius:20px;cursor:pointer;font-weight:600;box-shadow:0 4px 10px -2px rgba(14,165,233,.4);transition:.2s }
.pay-btn:hover{transform:translateY(-1px);box-shadow:0 6px 14px -2px rgba(37,99,235,.5)}
.instruction-btn { display:none; }

/* New action buttons */
.pair-actions { display:flex; align-items:center; gap:8px; }
.open-exchange-btn { background:#253141; color:#cdd9e5; border:1px solid #314155; padding:7px 14px; font-size:13px; border-radius:18px; cursor:pointer; font-weight:500; transition:.2s; }
.open-exchange-btn:hover { background:#2f3d4e; color:#fff; }
.open-exchange-btn--green { background:#1f3b2b; color:#d1fae5; border-color:#2f6f52; }
.open-exchange-btn--green:hover { background:#24533b; color:#ecfdf5; }
.col-exchange-to { min-width:0; }
.ex-site-link { color:#9bd7ff; text-decoration:none; display:inline-block; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ex-site-link:hover { color:#c2e9ff; text-decoration:underline; }
.instruction-icon-btn { width:34px; height:34px; border-radius:50%; border:1px solid #324152; background:#1d2733; color:#fff; font-weight:700; font-size:16px; cursor:pointer; display:flex; align-items:center; justify-content:center; line-height:1; }
.instruction-icon-btn:hover { background:#253444; }
.instruction-icon-btn:active { transform:scale(.94); }

/* Status badge for history */
.status-badge { display:inline-flex; align-items:center; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:700; letter-spacing:.3px; }
.status-badge.status-used { background:#1f2a36; color:#9bd7ff; border:1px solid #2b3b4f; }

/* ===== From Exchanges column tightening & alignment ===== */
/* Allow the grid item to shrink and clip content without pushing other columns */
.col-exchange-from { min-width: 0; overflow: hidden; position: relative; }
/* Make exchange chips smaller and prevent internal wrapping */
.pair-exchanges { gap:6px; }
.pair-exchanges .exchange { padding:3px 8px; font-size:12px; border-radius:6px; white-space: nowrap; }
.pair-exchanges .exchange span { display:inline-block; max-width:120px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* In case icons appear in future, keep them compact */
.pair-exchanges .exchange img { width:14px; height:14px; }
/* Subtle right fade to indicate overflowed content */
/* .col-exchange-from::after { content:""; position:absolute; right:0; top:8px; bottom:8px; width:22px; pointer-events:none; background:linear-gradient(90deg, rgba(16,21,30,0), #10151e 70%); } */
/* Overflow chip */
.pair-exchanges .exchange-more { background:#1a2230; color:#9fb2c9; border:1px dashed #2b3a4b; }
/* Keep profit and exchange list readable; do NOT rely on parent .masked (we avoid adding it to the row) */
.pair-row.masked { filter:none !important; opacity:1 !important; }
.pair-profit { filter:none; opacity:1; }
.pair-exchanges { filter:none; opacity:1; }
.pair-exchanges .exchange { background:#162334; color:#d1dbe5; }
/* Ensure action buttons are never visually masked */
.pair-actions, .pair-actions .pay-btn, .pair-actions .instruction-icon-btn { filter:none !important; opacity:1 !important; }

/* Custom tooltip for exchanges full list */
.ex-tooltip { position:fixed; left:-9999px; top:-9999px; background:#182430; color:#d8e2ec; border:1px solid #223344; border-radius:10px; padding:8px 10px; font-size:12px; line-height:1.45; max-width: 60vw; box-shadow:0 8px 22px -6px rgba(0,0,0,.6); z-index:1000; display:none; }
.ex-tooltip.visible { display:block; }
.ex-tooltip__content { white-space:pre-wrap; }

/* Free pairs counter states */
.free-pairs-counter { --fpc-bg-ok: rgba(120,255,120,0.12); --fpc-bg-warn: rgba(255,120,60,0.15); }
.free-pairs-counter.state-ok { background: var(--fpc-bg-ok) !important; }
.free-pairs-counter.state-exhausted { background: #315a7a; color: #fff; border-color: #3f6f97; }
.dash { font-family: system-ui, Arial, sans-serif; margin: 1.5rem; }
.dash h1 { margin-top:0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: .75rem; margin-bottom:1.25rem; }
.stat { background:#111; color:#eee; padding:.75rem .9rem; border-radius:8px; font-size:.9rem; line-height:1.3; }
.stat span { color:#7cc957; }
.purchases { list-style:none; padding:0; margin:0; display:grid; gap:4px; }
.purchase-item { background:#1d1d1f; color:#f5f5f5; padding:.55rem .7rem; border-radius:6px; font-size:.85rem; display:flex; gap:.5rem; flex-wrap:wrap; }
.purchase-item em { color:#7cc957; font-style:normal; font-weight:600; }
.dash--public .stat { background:#f5f5f5; color:#222; }
.dash--public .purchase-item { background:#ffffff; color:#222; }

/* ============= Arbitrage Dashboard Extracted Styles ============= */
body { font-family:system-ui,sans-serif; margin:0; background:#0b0e13; color:#fff; }
header { display:flex; justify-content:space-between; align-items:center; padding:14px 22px; border-bottom:1px solid #1d2430; background:#0f1218; position:sticky; top:0; z-index:20 }
.brand h1 { margin:0; font-size:18px; font-weight:600; letter-spacing:.5px }
.brand small { opacity:.55; font-size:11px }
.role-badge { padding:4px 10px; border-radius:999px; font-size:11px; background:#1e2530; border:1px solid #2d3643; letter-spacing:.5px }
.role-badge.admin { background:#3b255a; border-color:#6d3dc0; color:#e7d9ff }
.top-tabs {
    display: flex;
    gap: 6px;
    padding: 0 0 20px 0;
}
.top-tabs button { background:#141b24; border:1px solid #1f2935; color:#9fb2c9; padding:8px 14px; font-size:13px; border-radius:8px; cursor:pointer; letter-spacing:.3px; display:flex; align-items:center; gap:6px; transition:.18s }
.top-tabs button.active { background:#253141; color:#fff; border-color:#36506b }
.top-tabs button:hover { background:#1c2632; color:#fff }
.top-tabs .refresh-btn-tab { margin-left:auto; background:#1d2835; border:1px solid #2d3a49; color:#9fb2c9; }
.top-tabs .refresh-btn-tab:hover { background:#263445; color:#fff; }
/* Refresh button icon */
.top-tabs .refresh-btn-tab { position:relative; padding-left:34px; }
.top-tabs .refresh-btn-tab::before { content:""; position:absolute; left:12px; top:50%; width:14px; height:14px; transform:translateY(-50%); background:currentColor; -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%239fb2c9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0114.85-3.36L23 10"/><path d="M20.49 15a9 9 0 01-14.85 3.36L1 14"/></svg>') center / contain no-repeat; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%239fb2c9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0114.85-3.36L23 10"/><path d="M20.49 15a9 9 0 01-14.85 3.36L1 14"/></svg>') center / contain no-repeat; opacity:.85; }
.top-tabs .refresh-btn-tab:hover::before { opacity:1; }
.top-tabs .mute-btn-tab {
    margin-left:auto;
    background:#1d2835;
    border:1px solid #2d3a49;
    color:#9fb2c9;
    width:34px; height:34px;
    border-radius:8px;
    cursor:pointer;
    position:relative;
    display:inline-block;
}
.top-tabs .mute-btn-tab::before {
    content:"";
    position:absolute; left:50%; top:50%;
    width:16px; height:16px; transform:translate(-50%,-50%);
    background:currentColor; opacity:.95;
    /* Unmuted (speaker with waves) */
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%239fb2c9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M15 8a5 5 0 0 1 0 8"/><path d="M19 5a9 9 0 0 1 0 14"/></svg>') center/contain no-repeat;
            mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%239fb2c9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M15 8a5 5 0 0 1 0 8"/><path d="M19 5a9 9 0 0 1 0 14"/></svg>') center/contain no-repeat;
}
.top-tabs .mute-btn-tab:hover { background:#263445; color:#fff; border-color:#32455a; }
.top-tabs .mute-btn-tab.is-muted { color:#ef4444; background:#162131; border-color:#3a1f22; }
.top-tabs .mute-btn-tab.is-muted::before {
    opacity:1;
    /* Muted (speaker with X) */
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><line x1="23" y1="9" x2="17" y2="15"/><line x1="17" y1="9" x2="23" y2="15"/></svg>') center/contain no-repeat;
            mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><line x1="23" y1="9" x2="17" y2="15"/><line x1="17" y1="9" x2="23" y2="15"/></svg>') center/contain no-repeat;
}
.period-filters { display:flex; gap:8px; padding:18px 18px 0 18px; flex-wrap:wrap }
.period-filters button { background:#151c25; border:1px solid #223041; color:#8fa2b7; padding:6px 12px; font-size:12px; border-radius:6px; cursor:pointer; transition:.15s }
.period-filters button.active { background:#315a7a; color:#fff; border-color:#3f6f97 }
.period-filters button:hover { background:#223041; color:#fff }
.wrap { padding:18px; min-height:100vh; display:flex; flex-direction:column; }
.grid-admin { display:grid; gap:14px; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); margin-bottom:18px }
.metric { background:#11161d; border:1px solid #1c242f; padding:12px 14px; border-radius:14px; position:relative; overflow:hidden }
.metric h4 { margin:0 0 4px; font-size:11px; font-weight:500; letter-spacing:.5px; text-transform:uppercase; color:#90a4b7 }
.metric .value { font-size:20px; font-weight:600; line-height:1 }
.metric .delta { font-size:11px; margin-top:4px; font-weight:600; letter-spacing:.5px }
.delta.pos { color:#4ade80 } .delta.neg { color:#f87171 } .delta.neu { color:#6b7280 }
.section { background:#0f141b; border:1px solid #1b2430; border-radius:16px; padding:16px 18px; margin-bottom:24px }
.section h3 { margin:0 5px 10px; font-size:15px; font-weight:600; letter-spacing:.5px; display:flex; align-items:center; gap:8px }
/* Pairs header line */
.pairs-header-line { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; padding: 0 7px 0; }
.pairs-header-line h3 { margin:0; }
.pairs-header-actions { display:flex; align-items:center; gap:12px; }
.free-pairs-counter { font-size:13px; padding:6px 10px; border-radius:6px; display:inline-flex; align-items:center; gap:6px; background:#1b2430; }
.free-pairs-counter .fpc-label { opacity:.7; }
.free-pairs-counter .fpc-simple { font-weight:600; }
table.data { width:100%; border-collapse:collapse; font-size:12.5px }
table.data th, table.data td { padding:6px 8px; border-bottom:1px solid #1c2531; text-align:left }
table.data th { font-weight:500; color:#90a4b7; font-size:11px; letter-spacing:.5px; text-transform:uppercase }
table.data tbody tr:last-child td { border-bottom:none }
.pair-chip { display:inline-flex; align-items:center; gap:4px; padding:2px 6px; font-size:11px; border-radius:6px; background:#1e2530; border:1px solid #24303d }
.tier-tag { font-size:10px; padding:2px 6px; border-radius:999px; background:#222b37; border:1px solid #2f3c4b; letter-spacing:.5px }
.tier-regular { color:#7d8bff } .tier-vip { color:#ffb347 } .tier-private { color:#ff78c6 }
.masked { filter:blur(3px); opacity:.5; user-select:none }
.pairs-grid { display:flex; flex-direction: column; }
.pair-card { background:#111821; border:1px solid #1d2834; padding:10px 12px; border-radius:12px; position:relative; display:flex; flex-direction:column; gap:6px; min-height:120px }
.pair-card .profit { font-size:13px; font-weight:600 }
.pair-card .mini { font-size:11px; opacity:.7 }
.pair-card .badge { position:absolute; top:8px; right:8px; font-size:10px; padding:3px 6px; border-radius:999px; background:#1f2935; border:1px solid #2c3a4a; letter-spacing:.5px }
.pair-card .badge.active { background:#1e3a8a; border-color:#3b82f6; color:#dbeafe }
.skeleton { background:linear-gradient(100deg,#1a232d 10%,#22303d 30%,#1a232d 50%); background-size:200% 100%; animation:shimmer 1.1s infinite }
@keyframes shimmer { 0% { background-position:200% 0 } 100% { background-position:-200% 0 } }
.hidden { display:none!important }
footer { margin:30px 0 50px; text-align:center; font-size:11px; opacity:.3 }

/* ===== Purchases Tab (cards) ===== */
.purchases-wrap { padding: 6px 2px; overflow:auto; }
.purchases-list { display: flex; flex-direction: column; gap: 8px; }
.purchases-empty { padding: 16px; text-align: center; opacity: .6; font-size: 13.5px; }
.purchase-card { display:flex; align-items:center; justify-content:space-between; gap:12px; background:#0f151c; border:1px solid #192331; border-radius:12px; padding:10px 12px; }
.purchase-card:hover { background:#121b24; border-color:#203041; }
.purchase-card .pc-left { display:flex; align-items:center; gap:10px; min-width:0; }
.purchase-card .pc-right { display:flex; align-items:center; gap:12px; text-align:right; }
.pc-avatar { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; color:#e5eef7; font-weight:800; letter-spacing:.5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07); }
.pc-info { display:flex; flex-direction:column; min-width:0; }
.pc-user { font-size:13.5px; font-weight:700; color:#dbe7f3; }
.pc-pair { font-size:12.5px; color:#97abc0; max-width:54vw; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:8px; }
.pc-pair .pc-logo { width:16px; height:16px; border-radius:50%; object-fit:contain; filter: drop-shadow(0 0 2px rgba(0,0,0,.3)); }
.pc-pair .pc-site { color:#7fa3c6; font-size:12px; }
.pc-profit { font-size:14px; font-weight:800; color:#4ade80; letter-spacing:.3px; }
.pc-tier-badge { font-size:11px; font-weight:800; letter-spacing:.5px; padding:4px 8px; border-radius:999px; background:#192331; border:1px solid #223446; color:#c9d6e2; min-width:64px; text-align:center; }
.pc-tier-badge.tier-regular { background:#172131; border-color:#223446; color:#9fb2c9; }
.pc-tier-badge.tier-vip { background:linear-gradient(135deg, #f59e0b, #fbbf24); color:#0b1117; border-color:rgba(251,191,36,0.6); }
.pc-tier-badge.tier-private { background:linear-gradient(135deg, #7e22ce, #c084fc); color:#0b1117; border-color:rgba(192,132,252,0.55); }
.pc-cost { font-size:14px; font-weight:800; color:#e5eef7; letter-spacing:.3px; min-width:72px; }
.pc-time { font-size:12px; color:#8da1b6; }
@media (max-width: 560px){
    .purchase-card { padding: 10px; gap: 10px; }
    .pc-pair { max-width: 42vw; }
    .pc-profit { font-size: 13.5px; }
    .pc-cost { font-size: 13.5px; }
}

/* Hide scrollbar specifically in purchases container (keep scrollable) */
.purchases-wrap { scrollbar-width: none; }
.purchases-wrap::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Fill remaining viewport height for admin purchases section */
#mainWrap { display:flex; flex-direction:column; min-height:calc(100vh - 60px); }
#adminPurchasesSection { flex: 1 1 auto; display:flex; flex-direction:column; min-height:0; }
#adminPurchasesSection > h3 { flex: 0 0 auto; }
#adminPurchasesSection .purchases-wrap { flex: 1 1 auto; min-height:0; }

/* ===== Instruction Modal ===== */
.instruction-modal { position:fixed; inset:0; z-index:400; display:flex; align-items:center; justify-content:center; padding:24px 12px; background:linear-gradient(145deg, rgba(9,13,18,0.92), rgba(9,13,18,0.94)); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); overflow:auto; }
.instruction-modal.hidden { display:none; }
.instruction-modal .im-dialog { width:clamp(360px, 96vw, 1200px); max-height:92vh; overflow:auto; background:#0f1823; border:1px solid #1d2b38; border-radius:28px; padding:34px 38px 48px; position:relative; box-shadow:0 20px 50px -12px rgba(0,0,0,.55); font-family:inherit; }
.instruction-modal .im-close { position:absolute; top:14px; right:16px; width:38px; height:38px; background:#1d2733; border:1px solid #2c3947; color:#cbd5e1; border-radius:12px; font-size:20px; font-weight:600; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.instruction-modal .im-close:hover { background:#253444; color:#fff; }
.instruction-modal h2 { margin:0 0 4px; font-size:22px; font-weight:600; letter-spacing:.5px; color:#f1f5f9; }
.instruction-modal .im-sub { margin:0 0 24px; margin-top: 30px; font-size:13px; color:#93a4b6; line-height:1.5; }
.instruction-steps { counter-reset:step; list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:18px; }
.instruction-step { min-height: 50px; position:relative; background:#121e2a; border:1px solid #1f2d3a; padding:16px 18px 16px 56px; border-radius:18px; display:flex; flex-direction:column; gap:10px; }
.instruction-step::before { counter-increment:step; content:counter(step); position:absolute; left:14px; top:14px; width:34px; height:34px; background:linear-gradient(135deg,#2563eb,#1e40af); color:#fff; border-radius:12px; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; box-shadow:0 4px 10px -2px rgba(37,99,235,.45); }
.instruction-step .im-line { font-size:14px; line-height:1.5; color:#d3dde6; overflow-wrap:anywhere; word-break:break-word; }
.instruction-step .im-line a { color:#38bdf8; text-decoration:none; }
.instruction-step .im-line a:hover { text-decoration:underline; }
.instruction-assets { display:flex; flex-wrap:wrap; gap:8px; }
.im-asset { display:flex; align-items:center; gap:6px; background:#162334; padding:6px 10px; border-radius:10px; font-size:12px; color:#d1dbe5; min-width:0; }
.im-asset span { overflow-wrap:anywhere; }
.im-asset img { width:20px; height:20px; border-radius:50%; object-fit:contain; filter:drop-shadow(0 0 2px rgba(0,0,0,.35)); }
.im-exchange-link-btn { background:#253141; border:1px solid #314155; color:#cdd9e5; padding:6px 14px; font-size:13px; border-radius:16px; cursor:pointer; font-weight:500; display:inline-flex; align-items:center; gap:6px; }
.im-exchange-link-btn:hover { background:#2f3d4e; color:#fff; }

/* Tooltip (image capable) */
.im-tip { position:relative; cursor:help; }
.im-tip[data-tip]:hover::after, .im-tip[data-tip]:focus::after { content:attr(data-tip); position:absolute; left:50%; top:100%; transform:translate(-50%,8px); background:#182430; border:1px solid #223344; padding:10px 12px; white-space:pre-line; font-size:12px; line-height:1.45; color:#d8e2ec; width:min(88vw, 320px); border-radius:10px; box-shadow:0 6px 18px -4px rgba(0,0,0,.45); z-index:10; }
.im-tip[data-img]:hover::before, .im-tip[data-img]:focus::before { content:""; position:absolute; left:50%; top:100%; transform:translate(-50%,8px); width:min(92vw, 360px); height:200px; background:#0b1117 center/cover no-repeat; border:1px solid #223344; border-radius:14px; box-shadow:0 10px 28px -6px rgba(0,0,0,.6); z-index:9; background-image:var(--tip-img); }
.im-note { font-size:12px; opacity:.7; margin-top:8px; }
/* Instruction step image button */
.instruction-step .im-line { position: relative; padding-right: 42px; }
.im-img-btn { position:absolute; right:0; width:34px; height:34px; border-radius:10px; border:1px solid #2c3947; background:#1b2633; cursor:pointer; }
.im-img-btn:hover { background:#223346; }
/* .im-img-btn::before { content:""; display:block; width:18px; height:18px; margin:0 auto; background:#cbd5e1; -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23cbd5e1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="14" rx="2" ry="2"/><circle cx="8.5" cy="9" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>') center/contain no-repeat; mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23cbd5e1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="14" rx="2" ry="2"/><circle cx="8.5" cy="9" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>') center/contain no-repeat; } */

/* Instruction image viewer overlay */
.im-viewer { position:fixed; inset:0; z-index:5000; display:flex; align-items:center; justify-content:center; padding:40px 14px; padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); }
.im-viewer.hidden { display:none; }
.im-viewer .imv-backdrop { position:absolute; inset:0; background:rgba(6,10,15,.86); backdrop-filter: blur(4px); }
.im-viewer .imv-dialog { position:relative; background:#0f1823; border:1px solid #1d2b38; border-radius:16px; padding:14px 14px 12px; width:min(92vw, 840px); box-shadow:0 18px 44px -10px rgba(0,0,0,.6); }
.im-viewer .imv-close { position:absolute; top:8px; right:10px; width:36px; height:36px; border-radius:10px; background:#1b2633; border:1px solid #2c3947; color:#cbd5e1; font-size:18px; font-weight:700; cursor:pointer; }
.im-viewer .imv-close:hover { background:#223346; color:#fff; }
.im-viewer .imv-stage { position:relative; display:flex; align-items:center; justify-content:center; background:#0b1117; border:1px solid #1a2733; border-radius:12px; padding:10px; }
.im-viewer .imv-img { max-width: min(88vw, 800px); max-height: 70vh; border-radius:8px; display:block; }
.im-viewer .imv-nav { position:absolute; top:50%; transform:translateY(-50%); width:38px; height:38px; border-radius:999px; border:1px solid #2c3947; background:#1b2633; color:#cbd5e1; font-size:22px; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.im-viewer .imv-prev { left:10px; }
.im-viewer .imv-next { right:10px; }
.im-viewer .imv-nav:hover { background:#223346; color:#fff; }
.im-viewer .imv-caption { margin-top:10px; font-size:12.5px; color:#9fb2c9; text-align:center; }
@media (max-width:520px){ .instruction-step .im-line{ padding-right: 40px; } .im-img-btn{ width:32px; height:32px; right:6px; } .im-viewer{ padding:50px 10px; } .im-viewer .imv-dialog{ width:min(96vw, 560px); } }
@media (max-width:900px){ .instruction-modal .im-dialog { padding:26px 24px 40px;margin-top: 20px; } .instruction-step { padding:16px 16px 16px 56px; } .instruction-modal h2{font-size:22px} .instruction-modal .im-sub{font-size:13.5px} .instruction-step .im-line{font-size:14.5px} .instruction-step::before{width:34px;height:34px;font-size:14px} .instruction-assets{gap:8px} .im-asset{padding:7px 10px;font-size:12.5px} .im-asset img{width:20px;height:20px} .instruction-modal .im-close{width:40px;height:40px;font-size:21px} }
@media (max-width:520px){ .instruction-modal{padding:40px 12px 60px; padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); } .instruction-modal .im-dialog{border-radius:20px; padding:22px 16px 28px; max-height: 92vh;margin-top: 20px;} .instruction-modal h2{font-size:20px} .instruction-modal .im-sub{font-size:13px} .instruction-step{padding:14px 12px 14px 52px} .instruction-step .im-line{font-size:14.5px} .im-exchange-link-btn{font-size:13.5px; padding:8px 14px; min-height:40px} }

/* ===== Enhanced Pair Cards & Payment Modal ===== */
.pair-card.v2{position:relative;display:flex;flex-direction:column;gap:6px;padding:10px 12px;background:#0f1621;border:1px solid #1f2a38;border-radius:10px;box-shadow:0 2px 4px -1px rgba(0,0,0,.4);min-width:260px}
.pair-card.v2 .head-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pair-card.v2 .badge{background:#2d3b4f;color:#a6b4c2;font-size:11px;padding:2px 6px;border-radius:6px;font-weight:600;letter-spacing:.5px}
.pair-card.v2 .badge.active{background:#2563eb;color:#fff}
.pair-card.v2 .profit{margin-left:auto;font-weight:600;font-size:14px}
.pair-card.v2 .tier-tag{font-size:10px;font-weight:700;padding:2px 6px;border-radius:4px;letter-spacing:.5px;background:#1d2733}
.pair-card.v2 .tier-private{background:linear-gradient(120deg,#7e22ce,#c084fc);-webkit-background-clip:text;background-clip:text;color:transparent}
.pair-card.v2 .tier-vip{background:linear-gradient(120deg,#d97706,#fbbf24);-webkit-background-clip:text;background-clip:text;color:transparent}
.pair-card.v2 .tier-regular{color:#6b7280}
.pair-card.v2 .logos,.pair-card.v2 .chains{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:500;color:#cbd5e1}
.pair-card.v2 .asset,.pair-card.v2 .chain{display:flex;align-items:center;gap:4px;background:#152131;padding:4px 8px;border-radius:6px}
.pair-card.v2 img{width:18px;height:18px;object-fit:contain;filter:drop-shadow(0 0 2px rgba(0,0,0,.3))}
.pair-card.v2 .arrow{opacity:.5;font-size:12px}
.pair-card.v2 .pay-btn{margin-left:auto;background:linear-gradient(90deg,#0ea5e9,#2563eb);color:#fff;border:0;padding:6px 12px;font-size:12px;border-radius:20px;cursor:pointer;font-weight:600;box-shadow:0 4px 10px -2px rgba(14,165,233,.4);transition:.2s}
.pair-card.v2 .pay-btn:hover{transform:translateY(-1px);box-shadow:0 6px 14px -2px rgba(37,99,235,.5)}
.pair-card.v2 .masked-pair{font-size:12px;opacity:.65;font-style:italic}

.payment-modal{position:fixed;inset:0;z-index:500;display:flex;align-items:center;justify-content:center;font-family:inherit; padding:24px 12px; padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right));}/* centered with safe margins */
/* Ensure border-box sizing within the modal to prevent overflow from padding/borders */
.payment-modal, .payment-modal * { box-sizing: border-box; }
.payment-modal.hidden{display:none}
.payment-modal .pm-backdrop{position:absolute;inset:0;background:rgba(8,12,18,.78);backdrop-filter:blur(6px)}
.payment-modal .pm-dialog{position:relative;background:#101a25;border:1px solid #1f2d3b;border-radius:18px;padding:28px 30px;width:clamp(360px,94vw,1100px);max-width: 800px;max-height:90vh;overflow-y:auto;overflow-x:hidden;box-shadow:0 10px 40px -5px rgba(0,0,0,.6)}
.payment-modal h2{margin:0 0 14px;font-size:22px;letter-spacing:.5px;font-weight:600;color:#f1f5f9}
.payment-modal .pm-close{position:absolute;top:10px;right:12px;background:#1e293b;color:#cbd5e1;border:0;width:38px;height:38px;border-radius:10px;cursor:pointer;font-size:20px;line-height:1;display:flex;align-items:center;justify-content:center}
.payment-modal .pm-close:hover{background:#334155}
.payment-modal .pm-body{display:grid;grid-template-columns:1fr 260px;gap:24px; min-width:0 }
@media (max-width:860px){.payment-modal .pm-body{grid-template-columns:1fr}}
.pm-summary{order:1; min-width:0;margin-top: 15px;}
.pm-action{order:2; min-width:0}
@media (max-width:860px){
    .payment-modal .pm-body{grid-auto-flow:row}
    .pm-summary{order:1}
    .pm-action{order:2}
}
.pm-summary{display:flex;flex-direction:column;gap:16px}
.pm-amount,.pm-wallet{font-size:15px;background:#162334;padding:10px 12px;border-radius:12px;display:flex;align-items:center;gap:10px; min-width:0;}
.pm-amount {justify-content: space-between;}
.pm-wallet button.copy-btn, .pm-amount button.copy-btn{background:#1d4ed8;color:#fff;border:0;padding:6px 12px;border-radius:10px;font-size:13px;cursor:pointer; flex-shrink:0}
.pm-wallet button.copy-btn.copied, .pm-amount button.copy-btn.copied { background:#16a34a !important; color:#fff; box-shadow:0 0 0 0 rgba(22,163,74,.0); }
.pm-wallet span#pmWallet, .pm-amount span#pmAmount{ flex:1 1 auto; min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pm-wallet button.copy-btn:hover, .pm-amount button.copy-btn:hover{background:#2563eb}
.pm-qr { position: relative; display: flex; align-items: center; justify-content: center; }
.pm-qr canvas{background:#fff;padding:6px;border-radius:12px;width:clamp(200px, 68vw, 260px);max-width:100%;height:auto}
.pm-qr .qr-logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.pm-networks {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.pm-networks .net{display:flex;align-items:center;gap:8px;background:#1a2737;padding:8px 12px;border-radius:12px;font-size:13px;color:#e2e8f0}
.pm-networks .net img{width:22px;height:22px;border-radius:50%;}
.pm-note{text-align: center; margin:0;font-size:13px;line-height:1.6;color:#94a3b8}
.pm-action{display:flex;flex-direction:column;gap:12px;background:#162334;padding:16px 18px;border-radius:16px}
.pm-label{font-size:12.5px;font-weight:700;color:#cbd5e1;text-transform:uppercase;letter-spacing:.5px}
.pm-input{background:#0f1823;border:1px solid #223245;border-radius:10px;padding:12px 14px;color:#e2e8f0;font-size:14px; min-width:0 }
.pm-input:focus{outline:2px solid #2563eb;outline-offset:2px}
.pm-status{min-height:18px;font-size:12.5px;color:#94a3b8}
.pm-verify{background:linear-gradient(90deg,#14b8a6,#0ea5e9);border:0;color:#fff;padding:12px 16px;border-radius:12px;font-weight:700;cursor:pointer;font-size:15px;box-shadow:0 6px 18px -4px rgba(13,148,136,.5);transition:.25s; min-height:44px}
.pm-verify:hover{transform:translateY(-2px);box-shadow:0 10px 24px -6px rgba(14,165,233,.55)}

/* Payment modal small screens tuning */
@media (max-width:860px){
    .payment-modal h2{font-size:21px}
    .pm-amount,.pm-wallet{font-size:15px}
    .pm-note{font-size:13px}
    .pm-label{font-size:12.5px}
    .pm-input{font-size:14px;padding:12px 14px}
    .pm-verify{font-size:15px}
}
@media (max-width:520px){
    .payment-modal{ padding:40px 12px 60px; }
    .payment-modal .pm-dialog{width:clamp(320px, 96vw, 1100px); max-width:100%; border-radius:16px; padding:20px 14px;}
    .payment-modal h2{font-size:20px}
    .payment-modal .pm-close{width:40px;height:40px}
    .pm-qr canvas{width:clamp(160px, 78vw, 300px); max-width:100%}
    .pm-qr .qr-logo{width:52px;height:52px}
    .pm-networks{gap:8px}
    .pm-networks .net{padding:8px 10px; font-size:13px}
    .pm-amount,.pm-wallet{padding:10px 12px}
    .pm-wallet button.copy-btn{font-size:13px;padding:7px 12px}
    .pm-action{gap:12px;padding:14px 14px}
    .pm-input{font-size:15px;padding:13px 14px}
    .pm-verify{font-size:16px; min-height:46px}
}

/* Hide scrollbars (keep scrolling) for modals */
.instruction-modal, .instruction-modal .im-dialog,
.payment-modal, .payment-modal .pm-dialog { scrollbar-width: none; }
.instruction-modal::-webkit-scrollbar, .instruction-modal .im-dialog::-webkit-scrollbar,
.payment-modal::-webkit-scrollbar, .payment-modal .pm-dialog::-webkit-scrollbar { display:none; width:0; height:0; }

/* ============= Telegram Auth Overlay ============= */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, rgba(11,14,19,0.97) 0%, rgba(11,14,19,0.94) 60%, rgba(11,14,19,0.92) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 22px 60px;
    z-index: 2500;
    animation: authOverlayFade .35s ease;
}

.auth-overlay__card {
    width: 100%;
    max-width: 520px;
    background: #121921;
    border: 1px solid #1f2833;
    border-radius: 22px;
    padding: 36px 42px 40px;
    box-shadow: 0 10px 40px -5px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,0.02);
    position: relative;
    box-sizing: border-box; /* prevent horizontal overflow on small screens */
}

@media (max-width: 640px) {
    .auth-overlay__card { padding: 22px 16px 22px; border-radius: 18px; max-width: calc(100vw - 24px); }
    .tg-auth-btn { width: 100%; justify-content: center; }
}

.auth-overlay__logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #41b9ff 0%, #229ED9 45%, #1b6aa8 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 34px;
    font-weight: 600;
    box-shadow: 0 8px 28px -6px rgba(34,158,217,0.55), 0 4px 12px -3px rgba(0,0,0,.55);
    margin-bottom: 32px;
    overflow: hidden;
}
.auth-overlay__logo:after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 55%);
    mix-blend-mode: overlay;
    pointer-events: none;
}
.auth-overlay__logo svg { width: 56px; height: 56px; }

.auth-overlay__title { font-size: 24px; font-weight: 600; margin: 0 0 14px; letter-spacing: .5px; }
.auth-overlay__subtitle { font-size: 14px; line-height: 1.55; opacity: .75; margin: 0 0 26px; }

.auth-overlay__actions { display:flex; flex-direction:column; gap:14px; }

.tg-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg,#229ED9,#1788bd);
    color: #fff;
    border: none;
    padding: 14px 20px 15px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .3px;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    outline: none;
    box-shadow: 0 6px 18px -4px rgba(34,158,217,0.45), 0 2px 4px -1px rgba(0,0,0,.5);
    transition: background .2s, transform .2s, box-shadow .2s;
}
.tg-auth-btn:hover { background: linear-gradient(135deg,#35b4ef,#1d9ad4); box-shadow: 0 8px 24px -6px rgba(34,158,217,0.55), 0 3px 6px -1px rgba(0,0,0,.55); }
.tg-auth-btn:active { transform: translateY(1px); }
.tg-auth-btn svg { width:22px; height:22px; }

.tg-auth-btn--loading { opacity: .65; pointer-events: none; }
.tg-auth-btn--loading:after {
    content: '';
    width: 18px; height: 18px;
    border: 3px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    position: absolute;
    right: 16px;
}

.auth-overlay__hint { font-size: 12.5px; opacity: .55; line-height: 1.5; margin-top: 8px; }
.auth-overlay__divider { height:1px; background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.12),rgba(255,255,255,0)); margin: 26px 0 20px; }

.auth-overlay__secure {
    display:flex;
    gap:14px;
    align-items:center;
    background: linear-gradient(180deg, rgba(22,32,42,0.95) 0%, rgba(18,25,33,0.95) 100%);
    border: 1px solid #243445;
    padding: 14px 16px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 8px 24px -10px rgba(0,0,0,.65);
}
.auth-overlay__secure svg { width:74px; height:74px; opacity:1 }
/* Make shield filled and bolder with a contrasting check */
.auth-overlay__secure svg { stroke: none; }
.auth-overlay__secure svg path:first-of-type { fill: #1f2d3b; }
.auth-overlay__secure svg path:last-of-type { fill: #34d399; }

.auth-overlay__alt { margin-top:22px; font-size:12.5px; opacity:.6; }
.auth-overlay__alt button { background:none; border:none; color:#2ea8ff; cursor:pointer; font-weight:600; padding:0; }
.auth-overlay__alt button:hover { text-decoration:underline; }

@keyframes authOverlayFade { from { opacity:0; transform: translateY(4px); } to { opacity:1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.no-scroll { overflow:hidden; }
/* Also prevent scrolling on root when a modal is open */
body.modal-open { overflow: hidden; touch-action: none; }

/* Utility hidden override for overlay context */
.auth-overlay.hidden { display:none!important; }

/* ===== Responsive layout for pairs rows (table -> stacked on small screens) ===== */
@media (max-width: 1024px) {
    .pairs-table-header { font-size: 11px; }
    .pair-row { font-size: 13px; min-height: 52px; }
    .pair-tokens .asset, .pair-chains .chain, .pair-exchanges .exchange { padding: 4px 8px; font-size: 12px; }
    .open-exchange-btn, .pay-btn { padding: 7px 12px; font-size: 12px; }
}

@media (max-width: 860px) {
    header { position:sticky; top:0; }
    .wrap { padding: 14px; }
    .pairs-table-header { display: none; }
    .pairs-grid { gap: 10px; }
    .pair-row {
        grid-template-columns: 1fr; /* single column */
        grid-template-areas:
            "tok"
            "chn"
            "exf"
            "ext"
            "prf"
            "typ"
            "act";
        padding: 16px 12px 14px;
        border-radius: 14px;
        background: linear-gradient(180deg, #0f151d 0%, #0c1219 100%);
        box-shadow: 0 6px 18px -10px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,0.02);
    }
    .col-token { grid-area: tok; padding: 8px 10px 0; }
    .col-blockchain { grid-area: chn; padding: 4px 10px 0; }
    .col-exchange-from { grid-area: exf; padding: 4px 10px 0; }
    .col-exchange-to { grid-area: ext; padding: 4px 10px 0; }
    /* Profit pill pinned to top-right for quick scan */
    .col-profit { grid-area: prf; padding: 0; position: absolute; top: 10px; right: 12px; }
    .pair-profit { background: linear-gradient(135deg,#16a34a,#22d3ee); color:white; padding:6px 10px; border-radius:999px; font-size:13.5px; box-shadow: 0 6px 16px -6px rgba(34,211,238,.35); }
    .col-type { grid-area: typ; padding: 4px 10px 0; }
    .col-action { grid-area: act; padding: 10px 10px 6px; justify-content: flex-start; }

    /* increase readability */
    .pair-row { font-size: 15px; }
    .pair-type { font-size: 12.5px; }
    .pair-tokens .arrow, .pair-chains .arrow { font-size: 14px; }

    /* touch-friendly buttons */
    .open-exchange-btn, .pay-btn, .instruction-icon-btn { height: 42px; border-radius: 12px; }
    /* Make primary action wide and prominent */
    .pair-actions { width: 100%; gap: 10px; }
    .open-exchange-btn { padding: 10px 14px; font-size: 14px; flex: 1 1 auto; justify-content: center; background: linear-gradient(135deg,#10b981,#059669); border-color: #0e7f61; color: #ecfdf5; }
    .open-exchange-btn:hover { background: linear-gradient(135deg,#14c5a0,#079f7b); }
    .pay-btn { padding: 10px 16px; font-size: 14px; flex: 1 1 auto; display:flex; align-items:center; justify-content:center; }
    .instruction-icon-btn { width: 38px; font-size: 17px; }

    /* clamp exchange chips to avoid overflow */
    .pair-exchanges .exchange span { max-width: 160px; }

    /* To-exchange pill */
    .ex-site-link { background:#162334; padding:6px 10px; border-radius:10px; border: 1px solid #203144; color:#bfe2ff; }
    .ex-site-link:hover { color:#e6f5ff; }

    /* Field labels for mobile */
    .pair-row .col-token::before,
    .pair-row .col-blockchain::before,
    .pair-row .col-exchange-from::before,
    .pair-row .col-exchange-to::before,
    .pair-row .col-type::before,
    .pair-row .col-action::before {
        content: '';
        display: block;
        margin: 6px 0 6px;
        font-size: 11px;
        letter-spacing: .4px;
        color: #8fa2b7;
        text-transform: uppercase;
        opacity: .85;
    }
    .pair-row .col-token::before { content: 'Tokens'; }
    .pair-row .col-blockchain::before { content: 'Blockchains'; }
    .pair-row .col-exchange-from::before { content: 'From Exchanges'; }
    .pair-row .col-exchange-to::before { content: 'To Exchange'; }
}

@media (max-width: 520px) {
    .col-token, .col-blockchain, .col-exchange-from, .col-exchange-to, .col-profit, .col-action { justify-content: space-between; }
    .brand h1 { font-size: 16px; }
    .top-tabs { padding-bottom: 14px; }
    .top-tabs button { padding: 8px 10px; font-size: 12px; }
    .period-filters { padding: 12px 12px 0; gap: 6px; }
    .period-filters button { padding: 5px 10px; font-size: 11.5px; }

    .pair-row { padding: 14px 10px; }
    .col-token, .col-blockchain, .col-exchange-from, .col-exchange-to, .col-profit, .col-type, .col-action { padding-left: 8px; padding-right: 8px; }
    .pair-tokens .asset img, .pair-chains .chain img, .pair-exchanges .exchange img { width: 16px; height: 16px; }
    .pair-tokens .asset, .pair-chains .chain, .pair-exchanges .exchange { padding: 4px 8px; font-size: 12px; }
    .open-exchange-btn { padding: 10px 12px; font-size: 13.5px; }
    .pay-btn { padding: 10px 14px; font-size: 13.5px; }
    .pair-exchanges .exchange span { max-width: 120px; }
    /* Profit pill adjustments */
    .col-profit { top: 8px; right: 10px; }
    .pair-profit { font-size: 14px; font-weight: 900; }
}
